ivt 0.0.5 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (128) hide show
  1. package/dist/accordion/index.mjs +1 -1
  2. package/dist/badge/index.mjs +1 -1
  3. package/dist/base/index.d.ts +13 -1
  4. package/dist/base/index.mjs +1 -1
  5. package/dist/base/index.mjs.map +1 -1
  6. package/dist/button/index.d.ts +1 -1
  7. package/dist/button/index.mjs +1 -1
  8. package/dist/calendar/index.mjs +1 -1
  9. package/dist/calendar/index.mjs.map +1 -1
  10. package/dist/card/index.mjs +1 -1
  11. package/dist/checkbox/index.mjs +1 -1
  12. package/dist/chunks/Combination-w1gWj54H.mjs +2 -0
  13. package/dist/chunks/Combination-w1gWj54H.mjs.map +1 -0
  14. package/dist/chunks/{TextWrap-apUajb0q.mjs → TextWrap-CjH4DiRJ.mjs} +2 -2
  15. package/dist/chunks/{TextWrap-apUajb0q.mjs.map → TextWrap-CjH4DiRJ.mjs.map} +1 -1
  16. package/dist/chunks/{accordion-CQGSj-IW.mjs → accordion-B9KfEWUD.mjs} +2 -2
  17. package/dist/chunks/{accordion-CQGSj-IW.mjs.map → accordion-B9KfEWUD.mjs.map} +1 -1
  18. package/dist/chunks/{bundle-mjs-CtG6Smj_.mjs → bundle-mjs-WLX8GCHw.mjs} +1 -1
  19. package/dist/chunks/{bundle-mjs-CtG6Smj_.mjs.map → bundle-mjs-WLX8GCHw.mjs.map} +1 -1
  20. package/dist/chunks/{button-D_c_ntEX.mjs → button-C25JgpF1.mjs} +2 -2
  21. package/dist/chunks/{button-D_c_ntEX.mjs.map → button-C25JgpF1.mjs.map} +1 -1
  22. package/dist/chunks/calendar-Bg8q2q0f.mjs +2 -0
  23. package/dist/chunks/calendar-Bg8q2q0f.mjs.map +1 -0
  24. package/dist/chunks/check-B7qxEGdi.mjs +2 -0
  25. package/dist/chunks/{check-DjRtCxG6.mjs.map → check-B7qxEGdi.mjs.map} +1 -1
  26. package/dist/chunks/chevron-down-C5QWUB1b.mjs +2 -0
  27. package/dist/chunks/{chevron-down-BCzo9yB2.mjs.map → chevron-down-C5QWUB1b.mjs.map} +1 -1
  28. package/dist/chunks/chevron-left-yZO8_iYx.mjs +2 -0
  29. package/dist/chunks/{chevron-left-DUJqO1vN.mjs.map → chevron-left-yZO8_iYx.mjs.map} +1 -1
  30. package/dist/chunks/chevron-right-DX1OAykB.mjs +2 -0
  31. package/dist/chunks/{chevron-right-CoNJE7ZW.mjs.map → chevron-right-DX1OAykB.mjs.map} +1 -1
  32. package/dist/chunks/{command-eoEJKrZQ.mjs → command-BdZ-rcJh.mjs} +2 -2
  33. package/dist/chunks/{command-eoEJKrZQ.mjs.map → command-BdZ-rcJh.mjs.map} +1 -1
  34. package/dist/chunks/{createLucideIcon-CIn9dHnW.mjs → createLucideIcon-CRElQpLA.mjs} +1 -1
  35. package/dist/chunks/{createLucideIcon-CIn9dHnW.mjs.map → createLucideIcon-CRElQpLA.mjs.map} +1 -1
  36. package/dist/chunks/{dialog-TKsk0Iu2.mjs → dialog-BEfPREgp.mjs} +2 -2
  37. package/dist/chunks/{dialog-TKsk0Iu2.mjs.map → dialog-BEfPREgp.mjs.map} +1 -1
  38. package/dist/chunks/{index-D-s-TbR3.mjs → index-46Dn4Q--.mjs} +2 -2
  39. package/dist/chunks/{index-D-s-TbR3.mjs.map → index-46Dn4Q--.mjs.map} +1 -1
  40. package/dist/chunks/{index-B98y16WE.mjs → index-BFX-PqV0.mjs} +2 -2
  41. package/dist/chunks/{index-B98y16WE.mjs.map → index-BFX-PqV0.mjs.map} +1 -1
  42. package/dist/chunks/{index-DOx7g1Qo.mjs → index-CIU1Xq1J.mjs} +2 -2
  43. package/dist/chunks/{index-DOx7g1Qo.mjs.map → index-CIU1Xq1J.mjs.map} +1 -1
  44. package/dist/chunks/{index-DxtdpBCb.mjs → index-CN1SA0_I.mjs} +1 -1
  45. package/dist/chunks/{index-DxtdpBCb.mjs.map → index-CN1SA0_I.mjs.map} +1 -1
  46. package/dist/chunks/{index-CXrD_SvM.mjs → index-COE6uEyP.mjs} +2 -2
  47. package/dist/chunks/{index-CXrD_SvM.mjs.map → index-COE6uEyP.mjs.map} +1 -1
  48. package/dist/chunks/{index-C598HM8V.mjs → index-CYJu5yO5.mjs} +2 -2
  49. package/dist/chunks/{index-C598HM8V.mjs.map → index-CYJu5yO5.mjs.map} +1 -1
  50. package/dist/chunks/{index-CX5r7IKM.mjs → index-ClSqYyO3.mjs} +1 -1
  51. package/dist/chunks/{index-CX5r7IKM.mjs.map → index-ClSqYyO3.mjs.map} +1 -1
  52. package/dist/chunks/{index-CCYyT_rk.mjs → index-D1rtromL.mjs} +1 -1
  53. package/dist/chunks/{index-CCYyT_rk.mjs.map → index-D1rtromL.mjs.map} +1 -1
  54. package/dist/chunks/{index-DzMQps4Q.mjs → index-DM6C2fpF.mjs} +2 -2
  55. package/dist/chunks/{index-DzMQps4Q.mjs.map → index-DM6C2fpF.mjs.map} +1 -1
  56. package/dist/chunks/index-DP22y5yX.mjs +2 -0
  57. package/dist/chunks/{index-CluuXDB_.mjs.map → index-DP22y5yX.mjs.map} +1 -1
  58. package/dist/chunks/{index-Db2NO0t8.mjs → index-DyAmMjEH.mjs} +2 -2
  59. package/dist/chunks/{index-Db2NO0t8.mjs.map → index-DyAmMjEH.mjs.map} +1 -1
  60. package/dist/chunks/{index-BpJwNLRW.mjs → index-oT2uIdb1.mjs} +1 -1
  61. package/dist/chunks/{index-BpJwNLRW.mjs.map → index-oT2uIdb1.mjs.map} +1 -1
  62. package/dist/chunks/{input-BxTp3Q5l.mjs → input-D7H1CxUv.mjs} +2 -2
  63. package/dist/chunks/{input-BxTp3Q5l.mjs.map → input-D7H1CxUv.mjs.map} +1 -1
  64. package/dist/chunks/{label-BhQUf4a7.mjs → label-Cue4yhAm.mjs} +2 -2
  65. package/dist/chunks/{label-BhQUf4a7.mjs.map → label-Cue4yhAm.mjs.map} +1 -1
  66. package/dist/chunks/{pagination-qTGmkoRO.mjs → pagination-BYLwRYiM.mjs} +2 -2
  67. package/dist/chunks/{pagination-qTGmkoRO.mjs.map → pagination-BYLwRYiM.mjs.map} +1 -1
  68. package/dist/chunks/popover-fxWu9ghI.mjs +2 -0
  69. package/dist/chunks/{popover-DDPhp0Sa.mjs.map → popover-fxWu9ghI.mjs.map} +1 -1
  70. package/dist/chunks/{progress-C_yWLgAi.mjs → progress-CKxTxjba.mjs} +2 -2
  71. package/dist/chunks/{progress-C_yWLgAi.mjs.map → progress-CKxTxjba.mjs.map} +1 -1
  72. package/dist/chunks/{scroll-area-CuX49k8h.mjs → scroll-area-DSDAk121.mjs} +2 -2
  73. package/dist/chunks/{scroll-area-CuX49k8h.mjs.map → scroll-area-DSDAk121.mjs.map} +1 -1
  74. package/dist/chunks/{select-BydKi4E_.mjs → select-BtEQWkQs.mjs} +2 -2
  75. package/dist/chunks/{select-BydKi4E_.mjs.map → select-BtEQWkQs.mjs.map} +1 -1
  76. package/dist/chunks/{skeleton-BFnps3wE.mjs → skeleton-DsvXPbHg.mjs} +2 -2
  77. package/dist/chunks/{skeleton-BFnps3wE.mjs.map → skeleton-DsvXPbHg.mjs.map} +1 -1
  78. package/dist/chunks/{sortable-7DK1K35h.mjs → sortable-D4tl3H9D.mjs} +2 -2
  79. package/dist/chunks/{sortable-7DK1K35h.mjs.map → sortable-D4tl3H9D.mjs.map} +1 -1
  80. package/dist/chunks/{table-DRvqJktC.mjs → table-Cql47amq.mjs} +2 -2
  81. package/dist/chunks/{table-DRvqJktC.mjs.map → table-Cql47amq.mjs.map} +1 -1
  82. package/dist/chunks/{tslib.es6-Cx3xzITX.mjs → tslib.es6-C59-pKsO.mjs} +1 -1
  83. package/dist/chunks/{tslib.es6-Cx3xzITX.mjs.map → tslib.es6-C59-pKsO.mjs.map} +1 -1
  84. package/dist/chunks/{utils-jIFl11as.mjs → utils-Dd3mX7Lt.mjs} +2 -2
  85. package/dist/chunks/{utils-jIFl11as.mjs.map → utils-Dd3mX7Lt.mjs.map} +1 -1
  86. package/dist/chunks/x-CYyikW5M.mjs +2 -0
  87. package/dist/chunks/{x-xnz0lTd-.mjs.map → x-CYyikW5M.mjs.map} +1 -1
  88. package/dist/command/index.mjs +1 -1
  89. package/dist/data-table/index.d.ts +4 -2
  90. package/dist/data-table/index.mjs +1 -1
  91. package/dist/data-table/index.mjs.map +1 -1
  92. package/dist/dialog/index.mjs +1 -1
  93. package/dist/dropdown-menu/index.mjs +1 -1
  94. package/dist/dropdown-menu/index.mjs.map +1 -1
  95. package/dist/dropzone/index.d.ts +4 -3
  96. package/dist/dropzone/index.mjs +2 -2
  97. package/dist/dropzone/index.mjs.map +1 -1
  98. package/dist/form/index.mjs +1 -1
  99. package/dist/icon/index.mjs +1 -1
  100. package/dist/index.css +1 -1
  101. package/dist/input/index.mjs +1 -1
  102. package/dist/label/index.mjs +1 -1
  103. package/dist/pagination/index.mjs +1 -1
  104. package/dist/popover/index.mjs +1 -1
  105. package/dist/progress/index.mjs +1 -1
  106. package/dist/scroll-area/index.mjs +1 -1
  107. package/dist/select/index.mjs +1 -1
  108. package/dist/separator/index.mjs +1 -1
  109. package/dist/sheet/index.mjs +1 -1
  110. package/dist/sheet/index.mjs.map +1 -1
  111. package/dist/skeleton/index.mjs +1 -1
  112. package/dist/sortable/index.mjs +1 -1
  113. package/dist/table/index.mjs +1 -1
  114. package/dist/tabs/index.mjs +1 -1
  115. package/dist/toast/index.d.ts +10 -10
  116. package/dist/toast/index.mjs +1 -1
  117. package/dist/toast/index.mjs.map +1 -1
  118. package/dist/tooltip/index.mjs +1 -1
  119. package/package.json +3 -3
  120. package/dist/chunks/check-DjRtCxG6.mjs +0 -2
  121. package/dist/chunks/chevron-down-BCzo9yB2.mjs +0 -2
  122. package/dist/chunks/chevron-left-DUJqO1vN.mjs +0 -2
  123. package/dist/chunks/chevron-right-CoNJE7ZW.mjs +0 -2
  124. package/dist/chunks/index-ChLuxn93.mjs +0 -2
  125. package/dist/chunks/index-ChLuxn93.mjs.map +0 -1
  126. package/dist/chunks/index-CluuXDB_.mjs +0 -2
  127. package/dist/chunks/popover-DDPhp0Sa.mjs +0 -2
  128. package/dist/chunks/x-xnz0lTd-.mjs +0 -2
@@ -1,2 +1,2 @@
1
- import*as e from"react";import*as t from"react-dom";import{u as r,P as o,c as n,a as s,b as a}from"../chunks/index-CX5r7IKM.mjs";import{createCollection as i}from"@radix-ui/react-collection";import{c}from"../chunks/index-CCYyT_rk.mjs";import{B as d,R as u,P as l}from"../chunks/index-CXrD_SvM.mjs";import{P as p,d as f}from"../chunks/index-DxtdpBCb.mjs";import{u as m}from"../chunks/index-D-s-TbR3.mjs";import{V as v}from"../chunks/index-B98y16WE.mjs";import{jsx as w,jsxs as h,Fragment as x}from"react/jsx-runtime";import{cva as y}from"class-variance-authority";import{c as g}from"../chunks/utils-jIFl11as.mjs";import{X as E}from"../chunks/x-xnz0lTd-.mjs";import"@radix-ui/react-slot";import"../chunks/bundle-mjs-CtG6Smj_.mjs";import"../chunks/createLucideIcon-CIn9dHnW.mjs";var T="ToastProvider",[b,R,C]=i("Toast"),[P,N]=c("Toast",[C]),[k,D]=P(T),L=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),f=e.useRef(!1);return o.trim()||console.error(`Invalid prop \`label\` supplied to \`${T}\`. Expected non-empty \`string\`.`),w(b.Provider,{scope:r,children:w(k,{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:f,children:i})})};L.displayName=T;var S="ToastViewport",_=["F8"],F="toast.viewportPause",I="toast.viewportResume",A=e.forwardRef(((t,o)=>{const{__scopeToast:n,hotkey:s=_,label:a="Notifications ({hotkey})",...i}=t,c=D(S,n),u=R(n),l=e.useRef(null),f=e.useRef(null),m=e.useRef(null),v=e.useRef(null),x=r(o,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(F);t.dispatchEvent(e),c.isClosePausedRef.current=!0}},o=()=>{if(c.isClosePausedRef.current){const e=new CustomEvent(I);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=u().map((t=>{const r=t.ref.current,o=[r,...ee(r)];return"forwards"===e?o:o.reverse()}));return("forwards"===e?t.reverse():t).flat()}),[u]);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 f.current?.focus();const n=E({tabbingDirection:o?"backwards":"forwards"}),s=n.findIndex((e=>e===r));te(n.slice(s+1))?t.preventDefault():o?f.current?.focus():m.current?.focus()}};return e.addEventListener("keydown",t),()=>e.removeEventListener("keydown",t)}}),[u,E]),h(d,{ref:l,role:"region","aria-label":a.replace("{hotkey}",y),tabIndex:-1,style:{pointerEvents:g?void 0:"none"},children:[g&&w(M,{ref:f,onFocusFromOutsideViewport:()=>{te(E({tabbingDirection:"forwards"}))}}),w(b.Slot,{scope:n,children:w(p.ol,{tabIndex:-1,...i,ref:x})}),g&&w(M,{ref:m,onFocusFromOutsideViewport:()=>{te(E({tabbingDirection:"backwards"}))}})]})}));A.displayName=S;var j="ToastFocusProxy",M=e.forwardRef(((e,t)=>{const{__scopeToast:r,onFocusFromOutsideViewport:o,...n}=e,s=D(j,r);return w(v,{"aria-hidden":!0,tabIndex:0,...n,ref:t,style:{position:"fixed"},onFocus:e=>{const t=e.relatedTarget;!s.viewport?.contains(t)&&o()}})}));M.displayName=j;var K="Toast",O=e.forwardRef(((e,t)=>{const{forceMount:r,open:a,defaultOpen:i,onOpenChange:c,...d}=e,[u=!0,l]=m({prop:a,defaultProp:i,onChange:c});return w(o,{present:r||u,children:w(B,{open:u,...d,ref:t,onClose:()=>l(!1),onPause:s(e.onPause),onResume:s(e.onResume),onSwipeStart:n(e.onSwipeStart,(e=>{e.currentTarget.setAttribute("data-swipe","start")})),onSwipeMove:n(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:n(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:n(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)}))})})}));O.displayName=K;var[V,$]=P(K,{onClose(){}}),B=e.forwardRef(((o,a)=>{const{__scopeToast:i,type:c="foreground",duration:d,open:l,onClose:f,onEscapeKeyDown:m,onPause:v,onResume:y,onSwipeStart:g,onSwipeMove:E,onSwipeCancel:T,onSwipeEnd:R,...C}=o,P=D(K,i),[N,k]=e.useState(null),L=r(a,(e=>k(e))),S=e.useRef(null),_=e.useRef(null),A=d||P.duration,j=e.useRef(0),M=e.useRef(A),O=e.useRef(0),{onToastAdd:$,onToastRemove:B}=P,X=s((()=>{const e=N?.contains(document.activeElement);e&&P.viewport?.focus(),f()})),q=e.useCallback((e=>{e&&e!==1/0&&(window.clearTimeout(O.current),j.current=(new Date).getTime(),O.current=window.setTimeout(X,e))}),[X]);e.useEffect((()=>{const e=P.viewport;if(e){const t=()=>{q(M.current),y?.()},r=()=>{const e=(new Date).getTime()-j.current;M.current=M.current-e,window.clearTimeout(O.current),v?.()};return e.addEventListener(F,r),e.addEventListener(I,t),()=>{e.removeEventListener(F,r),e.removeEventListener(I,t)}}}),[P.viewport,A,v,y,q]),e.useEffect((()=>{l&&!P.isClosePausedRef.current&&q(A)}),[l,A,P.isClosePausedRef,q]),e.useEffect((()=>($(),()=>B())),[$,B]);const H=e.useMemo((()=>N?J(N):null),[N]);return P.viewport?h(x,{children:[H&&w(U,{__scopeToast:i,role:"status","aria-live":"foreground"===c?"assertive":"polite","aria-atomic":!0,children:H}),w(V,{scope:i,onClose:X,children:t.createPortal(w(b.ItemSlot,{scope:i,children:w(u,{asChild:!0,onEscapeKeyDown:n(m,(()=>{P.isFocusedToastEscapeKeyDownRef.current||X(),P.isFocusedToastEscapeKeyDownRef.current=!1})),children:w(p.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":l?"open":"closed","data-swipe-direction":P.swipeDirection,...C,ref:L,style:{userSelect:"none",touchAction:"none",...o.style},onKeyDown:n(o.onKeyDown,(e=>{"Escape"===e.key&&(m?.(e.nativeEvent),e.nativeEvent.defaultPrevented||(P.isFocusedToastEscapeKeyDownRef.current=!0,X()))})),onPointerDown:n(o.onPointerDown,(e=>{0===e.button&&(S.current={x:e.clientX,y:e.clientY})})),onPointerMove:n(o.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(P.swipeDirection),s=["left","up"].includes(P.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,Q("toast.swipeMove",E,u,{discrete:!1})):Z(d,P.swipeDirection,c)?(_.current=d,Q("toast.swipeStart",g,u,{discrete:!1}),e.target.setPointerCapture(e.pointerId)):(Math.abs(t)>c||Math.abs(r)>c)&&(S.current=null)})),onPointerUp:n(o.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};Z(t,P.swipeDirection,P.swipeThreshold)?Q("toast.swipeEnd",R,o,{discrete:!0}):Q("toast.swipeCancel",T,o,{discrete:!0}),r.addEventListener("click",(e=>e.preventDefault()),{once:!0})}}))})})}),P.viewport)})]}):null})),U=t=>{const{__scopeToast:r,children:o,...n}=t,i=D(K,r),[c,d]=e.useState(!1),[u,p]=e.useState(!1);return function(e=()=>{}){const t=s(e);a((()=>{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((()=>p(!0)),1e3);return()=>window.clearTimeout(e)}),[]),u?null:w(l,{asChild:!0,children:w(v,{...n,children:c&&h(x,{children:[i.label," ",o]})})})},X=e.forwardRef(((e,t)=>{const{__scopeToast:r,...o}=e;return w(p.div,{...o,ref:t})}));X.displayName="ToastTitle";var q=e.forwardRef(((e,t)=>{const{__scopeToast:r,...o}=e;return w(p.div,{...o,ref:t})}));q.displayName="ToastDescription";var H="ToastAction",W=e.forwardRef(((e,t)=>{const{altText:r,...o}=e;return r.trim()?w(G,{altText:r,asChild:!0,children:w(z,{...o,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${H}\`. Expected non-empty \`string\`.`),null)}));W.displayName=H;var Y="ToastClose",z=e.forwardRef(((e,t)=>{const{__scopeToast:r,...o}=e,s=$(Y,r);return w(G,{asChild:!0,children:w(p.button,{type:"button",...o,ref:t,onClick:n(e.onClick,s.onClose)})})}));z.displayName=Y;var G=e.forwardRef(((e,t)=>{const{__scopeToast:r,altText:o,...n}=e;return w(p.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":o||void 0,...n,ref:t})}));function J(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(...J(e))}})),t}function Q(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 Z=(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 ee(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 te(e){const t=document.activeElement;return e.some((e=>e===t||(e.focus(),document.activeElement!==t)))}var re=A,oe=O,ne=X,se=q,ae=W,ie=z;const ce=L,de=({className:e,...t})=>React.createElement(re,{"data-slot":"toast-viewport",className:g("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),...t}),ue=y("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"}}),le=({className:e,variant:t,...r})=>React.createElement(oe,{"data-slot":"toast-root",className:g(ue({variant:t}),e),...r}),pe=({className:e,...t})=>React.createElement(ae,{"data-slot":"toast-action",className:g("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),...t}),fe=({className:e,...t})=>React.createElement(ie,{"data-slot":"toast-close",className:g("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":"",...t},React.createElement(E,{className:"h-4 w-4"})),me=({className:e,...t})=>React.createElement(ne,{"data-slot":"toast-title",className:g("text-sm font-semibold",e),...t}),ve=({className:e,...t})=>React.createElement(se,{"data-slot":"toast-description",className:g("text-sm opacity-90",e),...t});export{le as Toast,pe as ToastAction,fe as ToastClose,ve as ToastDescription,ce as ToastProvider,me as ToastTitle,de 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-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};
2
2
  //# sourceMappingURL=index.mjs.map
@@ -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 type * as 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":"wwBAqBA,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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EHS,MAACkS,cAAAA,GAAqB,CACpBC,YAAU,cACVF,UAAWG,EACT,wVACAH,GAEFY,cAAY,MACRtT,GAEJS,MAAC8S,cAAAA,EAAAA,CAAEb,UAAU,aAIXnE,GAAa,EACjBmE,eACG1S,KAEHS,MAACkS,cAAAA,GAAqB,CACpBC,YAAU,cACVF,UAAWG,EAAG,wBAAyBH,MACnC1S,IAIF0O,GAAmB,EACvBgE,eACG1S,KAEHS,MAACkS,cAAAA,GAA2B,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\",\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,8BACLk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F,UAAWG,EAAG,wBAAyBH,MACnC1S,IAIF0O,GAAmB,EACvBgE,eACG1S,KAEHS,EAACkS,cAAAA,GAA2B,CAC1BC,YAAU,oBACVF,UAAWG,EAAG,qBAAsBH,MAChC1S","x_google_ignoreList":[0]}
@@ -1,2 +1,2 @@
1
- import*as e from"react";import{u as t,c as n,P as o}from"../chunks/index-CX5r7IKM.mjs";import{c as r}from"../chunks/index-CCYyT_rk.mjs";import{P as i,D as a}from"../chunks/index-CXrD_SvM.mjs";import{u as s}from"../chunks/index-Db2NO0t8.mjs";import{c,R as l,A as u,C as d,a as p}from"../chunks/index-DOx7g1Qo.mjs";import{P as f}from"../chunks/index-DxtdpBCb.mjs";import{Slottable as m}from"@radix-ui/react-slot";import{u as h}from"../chunks/index-D-s-TbR3.mjs";import{R as g}from"../chunks/index-B98y16WE.mjs";import{jsx as x,jsxs as y}from"react/jsx-runtime";import{c as v}from"../chunks/utils-jIFl11as.mjs";import"react-dom";import"../chunks/index-DzMQps4Q.mjs";import"../chunks/bundle-mjs-CtG6Smj_.mjs";var[b,w]=r("Tooltip",[c]),T=c(),C="TooltipProvider",E=700,k="tooltip.open",[_,D]=b(C),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=C;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=T(n),[f,m]=e.useState(null),g=s(),y=e.useRef(0),v=c??d.disableHoverableContent,b=u??d.delayDuration,w=e.useRef(!1),[C=!1,E]=h({prop:r,defaultProp:i,onChange:e=>{e?(d.onOpen(),document.dispatchEvent(new CustomEvent(k))):d.onClose(),a?.(e)}}),_=e.useMemo((()=>C?w.current?"delayed-open":"instant-open":"closed"),[C]),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:C,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=T(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=T(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=T(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=0,...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};
1
+ import*as e from"react";import{u as t,c as n,P as o}from"../chunks/index-ClSqYyO3.mjs";import{c as r}from"../chunks/index-D1rtromL.mjs";import{P as i,D as a}from"../chunks/index-COE6uEyP.mjs";import{u as s}from"../chunks/index-DyAmMjEH.mjs";import{c,R as l,A as u,C as d,a as p}from"../chunks/index-CIU1Xq1J.mjs";import{P as f}from"../chunks/index-CN1SA0_I.mjs";import{Slottable as m}from"@radix-ui/react-slot";import{u as h}from"../chunks/index-46Dn4Q--.mjs";import{R as g}from"../chunks/index-BFX-PqV0.mjs";import{jsx as x,jsxs as y}from"react/jsx-runtime";import{c as v}from"../chunks/utils-Dd3mX7Lt.mjs";import"react-dom";import"../chunks/index-DM6C2fpF.mjs";import"../chunks/bundle-mjs-WLX8GCHw.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=0,...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
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "author": "Investtools",
3
3
  "name": "ivt",
4
- "version": "0.0.5",
4
+ "version": "0.0.6",
5
5
  "description": "Ivt Components Library",
6
6
  "keywords": [
7
7
  "ivt",
@@ -188,6 +188,8 @@
188
188
  "@radix-ui/react-tabs": "^1.1.3",
189
189
  "@radix-ui/react-tooltip": "^1.1.8",
190
190
  "class-variance-authority": "^0.7.1",
191
+ "@radix-ui/react-icons": "^1.3.2",
192
+ "@radix-ui/react-toast": "^1.2.6",
191
193
  "cmdk": "^1.0.0",
192
194
  "next-themes": "^0.4.6",
193
195
  "sonner": "^2.0.1"
@@ -196,8 +198,6 @@
196
198
  "@chromatic-com/storybook": "^3.2.5",
197
199
  "@eslint/js": "^9.21.0",
198
200
  "@hookform/resolvers": "^4.1.3",
199
- "@radix-ui/react-icons": "^1.3.2",
200
- "@radix-ui/react-toast": "^1.2.6",
201
201
  "@rollup/plugin-alias": "^5.1.1",
202
202
  "@rollup/plugin-commonjs": "^28.0.3",
203
203
  "@rollup/plugin-node-resolve": "^16.0.0",
@@ -1,2 +0,0 @@
1
- import{c}from"./createLucideIcon-CIn9dHnW.mjs";const e=c("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);export{e as C};
2
- //# sourceMappingURL=check-DjRtCxG6.mjs.map
@@ -1,2 +0,0 @@
1
- import{c as o}from"./createLucideIcon-CIn9dHnW.mjs";const e=o("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);export{e as C};
2
- //# sourceMappingURL=chevron-down-BCzo9yB2.mjs.map
@@ -1,2 +0,0 @@
1
- import{c as e}from"./createLucideIcon-CIn9dHnW.mjs";const o=e("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);export{o as C};
2
- //# sourceMappingURL=chevron-left-DUJqO1vN.mjs.map
@@ -1,2 +0,0 @@
1
- import{c as t}from"./createLucideIcon-CIn9dHnW.mjs";const e=t("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);export{e as C};
2
- //# sourceMappingURL=chevron-right-CoNJE7ZW.mjs.map
@@ -1,2 +0,0 @@
1
- import*as e from"react";import{useState as t}from"react";import{a as n,u as r}from"./index-CX5r7IKM.mjs";import{P as o}from"./index-DxtdpBCb.mjs";import{jsx as a}from"react/jsx-runtime";import{_ as c,a as i,b as u}from"./tslib.es6-Cx3xzITX.mjs";var s="focusScope.autoFocusOnMount",l="focusScope.autoFocusOnUnmount",d={bubbles:!1,cancelable:!0},f=e.forwardRef(((t,c)=>{const{loop:i=!1,trapped:u=!1,onMountAutoFocus:f,onUnmountAutoFocus:p,...y}=t,[E,b]=e.useState(null),w=n(f),S=n(p),C=e.useRef(null),k=r(c,(e=>b(e))),A=e.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;e.useEffect((()=>{if(u){let e=function(e){if(A.paused||!E)return;const t=e.target;E.contains(t)?C.current=t:h(C.current,{select:!0})},t=function(e){if(A.paused||!E)return;const t=e.relatedTarget;null!==t&&(E.contains(t)||h(C.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&h(E)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const r=new MutationObserver(n);return E&&r.observe(E,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),r.disconnect()}}}),[u,E,A.paused]),e.useEffect((()=>{if(E){g.add(A);const t=document.activeElement;if(!E.contains(t)){const n=new CustomEvent(s,d);E.addEventListener(s,w),E.dispatchEvent(n),n.defaultPrevented||(!function(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(h(r,{select:t}),document.activeElement!==n)return}((e=v(E),e.filter((e=>"A"!==e.tagName))),{select:!0}),document.activeElement===t&&h(E))}return()=>{E.removeEventListener(s,w),setTimeout((()=>{const e=new CustomEvent(l,d);E.addEventListener(l,S),E.dispatchEvent(e),e.defaultPrevented||h(t??document.body,{select:!0}),E.removeEventListener(l,S),g.remove(A)}),0)}}var e}),[E,w,S,A]);const M=e.useCallback((e=>{if(!i&&!u)return;if(A.paused)return;const t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,n=document.activeElement;if(t&&n){const t=e.currentTarget,[r,o]=function(e){const t=v(e),n=m(t,e),r=m(t.reverse(),e);return[n,r]}(t);r&&o?e.shiftKey||n!==o?e.shiftKey&&n===r&&(e.preventDefault(),i&&h(o,{select:!0})):(e.preventDefault(),i&&h(r,{select:!0})):n===t&&e.preventDefault()}}),[i,u,A.paused]);return a(o.div,{tabIndex:-1,...y,ref:k,onKeyDown:M})}));function v(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function m(e,t){for(const n of e)if(!p(n,{upTo:t}))return n}function p(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function h(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&function(e){return e instanceof HTMLInputElement&&"select"in e}(e)&&t&&e.select()}}f.displayName="FocusScope";var g=function(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=y(e,t),e.unshift(t)},remove(t){e=y(e,t),e[0]?.resume()}}}();function y(e,t){const n=[...e],r=n.indexOf(t);return-1!==r&&n.splice(r,1),n}var E=0;function b(){e.useEffect((()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??w()),document.body.insertAdjacentElement("beforeend",e[1]??w()),E++,()=>{1===E&&document.querySelectorAll("[data-radix-focus-guard]").forEach((e=>e.remove())),E--}}),[])}function w(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var S="right-scroll-bar-position",C="width-before-scroll-bar";function k(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var A="undefined"!=typeof window?e.useLayoutEffect:e.useEffect,M=new WeakMap;function L(e,n){var r,o,a,c=(r=null,o=function(t){return e.forEach((function(e){return k(e,t)}))},(a=t((function(){return{value:r,callback:o,facade:{get current(){return a.value},set current(e){var t=a.value;t!==e&&(a.value=e,a.callback(e,t))}}}}))[0]).callback=o,a.facade);return A((function(){var t=M.get(c);if(t){var n=new Set(t),r=new Set(e),o=c.current;n.forEach((function(e){r.has(e)||k(e,null)})),r.forEach((function(e){n.has(e)||k(e,o)}))}M.set(c,e)}),[e]),c}function N(e){return e}var T=function(t){var n=t.sideCar,r=i(t,["sideCar"]);if(!n)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var o=n.read();if(!o)throw new Error("Sidecar medium not found");return e.createElement(o,c({},r))};T.isSideCarExport=!0;var R=function(e){void 0===e&&(e={});var t=function(e,t){void 0===t&&(t=N);var n=[],r=!1;return{read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var o=t(e,r);return n.push(o),function(){n=n.filter((function(e){return e!==o}))}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var o=n;n=[],o.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},c=function(){return Promise.resolve().then(a)};c(),n={push:function(e){t.push(e),c()},filter:function(e){return t=t.filter(e),n}}}}}(null);return t.options=c({async:!0,ssr:!1},e),t}(),x=function(){},P=e.forwardRef((function(t,n){var r=e.useRef(null),o=e.useState({onScrollCapture:x,onWheelCapture:x,onTouchMoveCapture:x}),a=o[0],u=o[1],s=t.forwardProps,l=t.children,d=t.className,f=t.removeScrollBar,v=t.enabled,m=t.shards,p=t.sideCar,h=t.noIsolation,g=t.inert,y=t.allowPinchZoom,E=t.as,b=void 0===E?"div":E,w=t.gapMode,S=i(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=p,k=L([r,n]),A=c(c({},S),a);return e.createElement(e.Fragment,null,v&&e.createElement(C,{sideCar:R,removeScrollBar:f,shards:m,noIsolation:h,inert:g,setCallbacks:u,allowPinchZoom:!!y,lockRef:r,gapMode:w}),s?e.cloneElement(e.Children.only(l),c(c({},A),{ref:k})):e.createElement(b,c({},A,{className:d,ref:k}),l))}));P.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},P.classNames={fullWidth:C,zeroRight:S};function I(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=function(){if("undefined"!=typeof __webpack_nonce__)return __webpack_nonce__}();return t&&e.setAttribute("nonce",t),e}var F=function(){var e=0,t=null;return{add:function(n){var r,o;0==e&&(t=I())&&(o=n,(r=t).styleSheet?r.styleSheet.cssText=o:r.appendChild(document.createTextNode(o)),function(e){(document.head||document.getElementsByTagName("head")[0]).appendChild(e)}(t)),e++},remove:function(){! --e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},W=function(){var t,n=(t=F(),function(n,r){e.useEffect((function(){return t.add(n),function(){t.remove()}}),[n&&r])});return function(e){var t=e.styles,r=e.dynamic;return n(t,r),null}},_={left:0,top:0,right:0,gap:0},B=function(e){return parseInt(e||"",10)||0},D=function(e){if(void 0===e&&(e="margin"),"undefined"==typeof window)return _;var t=function(e){var t=window.getComputedStyle(document.body),n=t["padding"===e?"paddingLeft":"marginLeft"],r=t["padding"===e?"paddingTop":"marginTop"],o=t["padding"===e?"paddingRight":"marginRight"];return[B(n),B(r),B(o)]}(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},K=W(),j="data-scroll-locked",X=function(e,t,n,r){var o=e.left,a=e.top,c=e.right,i=e.gap;return void 0===n&&(n="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(r,";\n padding-right: ").concat(i,"px ").concat(r,";\n }\n body[").concat(j,"] {\n overflow: hidden ").concat(r,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(r,";"),"margin"===n&&"\n padding-left: ".concat(o,"px;\n padding-top: ").concat(a,"px;\n padding-right: ").concat(c,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(i,"px ").concat(r,";\n "),"padding"===n&&"padding-right: ".concat(i,"px ").concat(r,";")].filter(Boolean).join(""),"\n }\n \n .").concat(S," {\n right: ").concat(i,"px ").concat(r,";\n }\n \n .").concat(C," {\n margin-right: ").concat(i,"px ").concat(r,";\n }\n \n .").concat(S," .").concat(S," {\n right: 0 ").concat(r,";\n }\n \n .").concat(C," .").concat(C," {\n margin-right: 0 ").concat(r,";\n }\n \n body[").concat(j,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(i,"px;\n }\n")},Y=function(){var e=parseInt(document.body.getAttribute(j)||"0",10);return isFinite(e)?e:0},O=function(t){var n=t.noRelative,r=t.noImportant,o=t.gapMode,a=void 0===o?"margin":o;e.useEffect((function(){return document.body.setAttribute(j,(Y()+1).toString()),function(){var e=Y()-1;e<=0?document.body.removeAttribute(j):document.body.setAttribute(j,e.toString())}}),[]);var c=e.useMemo((function(){return D(a)}),[a]);return e.createElement(K,{styles:X(c,!n,a,r?"":"!important")})},H=!1;if("undefined"!=typeof window)try{var Z=Object.defineProperty({},"passive",{get:function(){return H=!0,!0}});window.addEventListener("test",Z,Z),window.removeEventListener("test",Z,Z)}catch(e){H=!1}var q=!!H&&{passive:!1},U=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return"hidden"!==n[t]&&!(n.overflowY===n.overflowX&&!function(e){return"TEXTAREA"===e.tagName}(e)&&"visible"===n[t])},z=function(e,t){var n=t.ownerDocument,r=t;do{if("undefined"!=typeof ShadowRoot&&r instanceof ShadowRoot&&(r=r.host),G(e,r)){var o=J(e,r);if(o[1]>o[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},G=function(e,t){return"v"===e?function(e){return U(e,"overflowY")}(t):function(e){return U(e,"overflowX")}(t)},J=function(e,t){return"v"===e?[(n=t).scrollTop,n.scrollHeight,n.clientHeight]:function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]}(t);var n},Q=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},V=function(e){return[e.deltaX,e.deltaY]},$=function(e){return e&&"current"in e?e.current:e},ee=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},te=0,ne=[];function re(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var oe,ae=(oe=function(t){var n=e.useRef([]),r=e.useRef([0,0]),o=e.useRef(),a=e.useState(te++)[0],c=e.useState(W)[0],i=e.useRef(t);e.useEffect((function(){i.current=t}),[t]),e.useEffect((function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(a));var e=u([t.lockRef.current],(t.shards||[]).map($),!0).filter(Boolean);return e.forEach((function(e){return e.classList.add("allow-interactivity-".concat(a))})),function(){document.body.classList.remove("block-interactivity-".concat(a)),e.forEach((function(e){return e.classList.remove("allow-interactivity-".concat(a))}))}}}),[t.inert,t.lockRef.current,t.shards]);var s=e.useCallback((function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!i.current.allowPinchZoom;var n,a=Q(e),c=r.current,u="deltaX"in e?e.deltaX:c[0]-a[0],s="deltaY"in e?e.deltaY:c[1]-a[1],l=e.target,d=Math.abs(u)>Math.abs(s)?"h":"v";if("touches"in e&&"h"===d&&"range"===l.type)return!1;var f=z(d,l);if(!f)return!0;if(f?n=d:(n="v"===d?"h":"v",f=z(d,l)),!f)return!1;if(!o.current&&"changedTouches"in e&&(u||s)&&(o.current=n),!n)return!0;var v=o.current||n;return function(e,t,n,r){var o=function(e,t){return"h"===e&&"rtl"===t?-1:1}(e,window.getComputedStyle(t).direction),a=o*r,c=n.target,i=t.contains(c),u=!1,s=a>0,l=0,d=0;do{var f=J(e,c),v=f[0],m=f[1]-f[2]-o*v;(v||m)&&G(e,c)&&(l+=m,d+=v),c=c instanceof ShadowRoot?c.host:c.parentNode}while(!i&&c!==document.body||i&&(t.contains(c)||t===c));return(s&&Math.abs(l)<1||!s&&Math.abs(d)<1)&&(u=!0),u}(v,t,e,"h"===v?u:s)}),[]),l=e.useCallback((function(e){var t=e;if(ne.length&&ne[ne.length-1]===c){var r="deltaY"in t?V(t):Q(t),o=n.current.filter((function(e){return e.name===t.type&&(e.target===t.target||t.target===e.shadowParent)&&(n=e.delta,o=r,n[0]===o[0]&&n[1]===o[1]);var n,o}))[0];if(o&&o.should)t.cancelable&&t.preventDefault();else if(!o){var a=(i.current.shards||[]).map($).filter(Boolean).filter((function(e){return e.contains(t.target)}));(a.length>0?s(t,a[0]):!i.current.noIsolation)&&t.cancelable&&t.preventDefault()}}}),[]),d=e.useCallback((function(e,t,r,o){var a={name:e,delta:t,target:r,should:o,shadowParent:re(r)};n.current.push(a),setTimeout((function(){n.current=n.current.filter((function(e){return e!==a}))}),1)}),[]),f=e.useCallback((function(e){r.current=Q(e),o.current=void 0}),[]),v=e.useCallback((function(e){d(e.type,V(e),e.target,s(e,t.lockRef.current))}),[]),m=e.useCallback((function(e){d(e.type,Q(e),e.target,s(e,t.lockRef.current))}),[]);e.useEffect((function(){return ne.push(c),t.setCallbacks({onScrollCapture:v,onWheelCapture:v,onTouchMoveCapture:m}),document.addEventListener("wheel",l,q),document.addEventListener("touchmove",l,q),document.addEventListener("touchstart",f,q),function(){ne=ne.filter((function(e){return e!==c})),document.removeEventListener("wheel",l,q),document.removeEventListener("touchmove",l,q),document.removeEventListener("touchstart",f,q)}}),[]);var p=t.removeScrollBar,h=t.inert;return e.createElement(e.Fragment,null,h?e.createElement(c,{styles:ee(a)}):null,p?e.createElement(O,{gapMode:t.gapMode}):null)},R.useMedium(oe),T),ce=e.forwardRef((function(t,n){return e.createElement(P,c({},t,{ref:n,sideCar:ae}))}));ce.classNames=P.classNames;var ie=new WeakMap,ue=new WeakMap,se={},le=0,de=function(e){return e&&(e.host||de(e.parentNode))},fe=function(e,t,n,r){var o=function(e,t){return t.map((function(t){if(e.contains(t))return t;var n=de(t);return n&&e.contains(n)?n:(console.error("aria-hidden",t,"in not contained inside",e,". Doing nothing"),null)})).filter((function(e){return Boolean(e)}))}(t,Array.isArray(e)?e:[e]);se[n]||(se[n]=new WeakMap);var a=se[n],c=[],i=new Set,u=new Set(o),s=function(e){e&&!i.has(e)&&(i.add(e),s(e.parentNode))};o.forEach(s);var l=function(e){e&&!u.has(e)&&Array.prototype.forEach.call(e.children,(function(e){if(i.has(e))l(e);else try{var t=e.getAttribute(r),o=null!==t&&"false"!==t,u=(ie.get(e)||0)+1,s=(a.get(e)||0)+1;ie.set(e,u),a.set(e,s),c.push(e),1===u&&o&&ue.set(e,!0),1===s&&e.setAttribute(n,"true"),o||e.setAttribute(r,"true")}catch(t){console.error("aria-hidden: cannot operate on ",e,t)}}))};return l(t),i.clear(),le++,function(){c.forEach((function(e){var t=ie.get(e)-1,o=a.get(e)-1;ie.set(e,t),a.set(e,o),t||(ue.has(e)||e.removeAttribute(r),ue.delete(e)),o||e.removeAttribute(n)})),--le||(ie=new WeakMap,ie=new WeakMap,ue=new WeakMap,se={})}},ve=function(e,t,n){void 0===n&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=function(e){return"undefined"==typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body}(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),fe(r,o,n,"aria-hidden")):function(){return null}};export{f as F,ce as R,ve as h,b as u};
2
- //# sourceMappingURL=index-ChLuxn93.mjs.map