@therealtinhtute/baroiplayer 1.2.0 → 1.2.1

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 (97) hide show
  1. package/README.md +1 -2
  2. package/dist/context/media.js +1 -2
  3. package/dist/context/media.mjs +3 -15
  4. package/dist/context/store.js +1 -2
  5. package/dist/context/store.mjs +3 -5
  6. package/dist/context-Bzd5QCKM.cjs +7 -0
  7. package/dist/context-Bzd5QCKM.cjs.map +1 -0
  8. package/dist/context-DD_SH4tT.js +1053 -0
  9. package/dist/context-DD_SH4tT.js.map +1 -0
  10. package/dist/core-events-BRnLMB7s.cjs +2 -0
  11. package/dist/core-events-BRnLMB7s.cjs.map +1 -0
  12. package/dist/core-events-v_mKdj5p.js +417 -0
  13. package/dist/core-events-v_mKdj5p.js.map +1 -0
  14. package/dist/core-plugins-CMBv-yVh.cjs +2 -0
  15. package/dist/core-plugins-CMBv-yVh.cjs.map +1 -0
  16. package/dist/core-plugins-CqCxLkbd.js +754 -0
  17. package/dist/core-plugins-CqCxLkbd.js.map +1 -0
  18. package/dist/core.js +7 -29
  19. package/dist/core.js.map +1 -1
  20. package/dist/core.mjs +947 -1220
  21. package/dist/core.mjs.map +1 -1
  22. package/dist/enhanced-components-BwjBqSA1.js +2858 -0
  23. package/dist/enhanced-components-BwjBqSA1.js.map +1 -0
  24. package/dist/enhanced-components-C-ka-XLp.cjs +2 -0
  25. package/dist/enhanced-components-C-ka-XLp.cjs.map +1 -0
  26. package/dist/hooks-B-IIWPJr.js +1842 -0
  27. package/dist/hooks-B-IIWPJr.js.map +1 -0
  28. package/dist/hooks-DcHzmBwA.cjs +4 -0
  29. package/dist/hooks-DcHzmBwA.cjs.map +1 -0
  30. package/dist/index.js +27 -97
  31. package/dist/index.js.map +1 -1
  32. package/dist/index.mjs +5613 -6208
  33. package/dist/index.mjs.map +1 -1
  34. package/dist/minimal-components-BYsMQde5.js +1610 -0
  35. package/dist/minimal-components-BYsMQde5.js.map +1 -0
  36. package/dist/minimal-components-CsxQbDp7.cjs +2 -0
  37. package/dist/minimal-components-CsxQbDp7.cjs.map +1 -0
  38. package/dist/performance-monitor-DCSijLJg.js +312 -0
  39. package/dist/performance-monitor-DCSijLJg.js.map +1 -0
  40. package/dist/performance-monitor-wNFKmqMr.cjs +2 -0
  41. package/dist/performance-monitor-wNFKmqMr.cjs.map +1 -0
  42. package/dist/rolldown-runtime-BmowowmI.js +14 -0
  43. package/dist/rolldown-runtime-mLOUI7ql.cjs +1 -0
  44. package/dist/utils-D2gQ7c2R.js +64 -0
  45. package/dist/utils-D2gQ7c2R.js.map +1 -0
  46. package/dist/utils-DJaAwiZ9.cjs +2 -0
  47. package/dist/utils-DJaAwiZ9.cjs.map +1 -0
  48. package/dist/utils.js +1 -2
  49. package/dist/utils.mjs +3 -11
  50. package/package.json +28 -22
  51. package/src/components/AnimateLoading.tsx +14 -10
  52. package/src/components/examples/loading-states-demo.tsx +1 -2
  53. package/src/components/examples/react-19-demo.tsx +6 -10
  54. package/src/components/examples/volume-orientation-demo.tsx +1 -2
  55. package/src/components/ui/blur-poster.tsx +18 -15
  56. package/src/components/variants/minimal/components/VideoElement.tsx +3 -1
  57. package/src/core/performance/media-loading-optimizer.ts +2 -1
  58. package/src/hooks/useScreenshot.ts +60 -44
  59. package/src/types/assets.d.ts +29 -0
  60. package/dist/context/media.js.map +0 -1
  61. package/dist/context/media.mjs.map +0 -1
  62. package/dist/context/store.js.map +0 -1
  63. package/dist/context/store.mjs.map +0 -1
  64. package/dist/context-BYwDoSRX.js +0 -1172
  65. package/dist/context-BYwDoSRX.js.map +0 -1
  66. package/dist/context-eNS62_ac.cjs +0 -23
  67. package/dist/context-eNS62_ac.cjs.map +0 -1
  68. package/dist/core-events-B1iM2F46.cjs +0 -2
  69. package/dist/core-events-B1iM2F46.cjs.map +0 -1
  70. package/dist/core-events-DunPHKRE.js +0 -484
  71. package/dist/core-events-DunPHKRE.js.map +0 -1
  72. package/dist/core-plugins-By-4-kGs.cjs +0 -2
  73. package/dist/core-plugins-By-4-kGs.cjs.map +0 -1
  74. package/dist/core-plugins-DSBWcTuX.js +0 -821
  75. package/dist/core-plugins-DSBWcTuX.js.map +0 -1
  76. package/dist/enhanced-components-B_l3cist.js +0 -1142
  77. package/dist/enhanced-components-B_l3cist.js.map +0 -1
  78. package/dist/enhanced-components-BspFs9OO.cjs +0 -2
  79. package/dist/enhanced-components-BspFs9OO.cjs.map +0 -1
  80. package/dist/hooks-BXwI8QG6.cjs +0 -4
  81. package/dist/hooks-BXwI8QG6.cjs.map +0 -1
  82. package/dist/hooks-Bpi-jDiO.js +0 -1816
  83. package/dist/hooks-Bpi-jDiO.js.map +0 -1
  84. package/dist/minimal-components-C4z900Ro.js +0 -1926
  85. package/dist/minimal-components-C4z900Ro.js.map +0 -1
  86. package/dist/minimal-components-v4qBp6jv.cjs +0 -2
  87. package/dist/minimal-components-v4qBp6jv.cjs.map +0 -1
  88. package/dist/performance-monitor-C5k6FDXw.js +0 -301
  89. package/dist/performance-monitor-C5k6FDXw.js.map +0 -1
  90. package/dist/performance-monitor-lJmuUjQQ.cjs +0 -2
  91. package/dist/performance-monitor-lJmuUjQQ.cjs.map +0 -1
  92. package/dist/utils-CFOue_9K.cjs +0 -9
  93. package/dist/utils-CFOue_9K.cjs.map +0 -1
  94. package/dist/utils-Dzpl2ArK.js +0 -2844
  95. package/dist/utils-Dzpl2ArK.js.map +0 -1
  96. package/dist/utils.js.map +0 -1
  97. package/dist/utils.mjs.map +0 -1
package/dist/index.js CHANGED
@@ -1,112 +1,42 @@
1
- "use strict";var Ss=Object.create;var zt=Object.defineProperty;var Ps=Object.getOwnPropertyDescriptor;var Ns=Object.getOwnPropertyNames;var As=Object.getPrototypeOf,Ts=Object.prototype.hasOwnProperty;var ks=(e,t,n)=>t in e?zt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Ds=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Ns(t))!Ts.call(e,s)&&s!==n&&zt(e,s,{get:()=>t[s],enumerable:!(r=Ps(t,s))||r.enumerable});return e};var De=(e,t,n)=>(n=e!=null?Ss(As(e)):{},Ds(t||!e||!e.__esModule?zt(n,"default",{value:e,enumerable:!0}):n,e));var de=(e,t,n)=>ks(e,typeof t!="symbol"?t+"":t,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./context-eNS62_ac.cjs"),E=require("react"),U=require("./hooks-BXwI8QG6.cjs"),C=require("./utils-CFOue_9K.cjs"),we=require("./minimal-components-v4qBp6jv.cjs"),re=require("./enhanced-components-BspFs9OO.cjs"),_s=require("@radix-ui/react-tooltip"),Is=require("@radix-ui/react-slider"),_e=require("react-dom"),Os=require("./performance-monitor-lJmuUjQQ.cjs");function Ct(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const f=Ct(E),V=Ct(_s),te=Ct(Is),gr=Ct(_e);function Qe({children:e,className:t,size:n="md",variant:r="spinner"}){const s={sm:"w-4 h-4",md:"w-8 h-8",lg:"w-12 h-12"};return r==="spinner"?o.jsxRuntimeExports.jsxs("div",{className:C.cn("flex items-center justify-center",t),children:[o.jsxRuntimeExports.jsx("div",{className:C.cn("animate-spin rounded-full border-2 border-current border-t-transparent",s[n])}),e&&o.jsxRuntimeExports.jsx("span",{className:"ml-2 text-muted-foreground text-sm",children:e})]}):r==="skeleton"?o.jsxRuntimeExports.jsx("div",{className:C.cn("animate-pulse rounded bg-muted",s[n],t)}):o.jsxRuntimeExports.jsx("div",{className:C.cn("animate-pulse bg-gradient-to-r bg-pos-0 bg-size-200 from-muted via-muted/50 to-muted","animate-shimmer rounded",s[n],t)})}function yr({children:e,fallback:t=o.jsxRuntimeExports.jsx(Qe,{}),className:n}){return o.jsxRuntimeExports.jsx("div",{className:n,children:o.jsxRuntimeExports.jsx(E.Suspense,{fallback:t,children:e})})}function Ls({error:e,resetError:t}){return o.jsxRuntimeExports.jsxs("div",{className:"flex flex-col items-center justify-center rounded-lg border border-destructive/20 bg-destructive/10 p-6",children:[o.jsxRuntimeExports.jsx("div",{className:"mb-2 font-semibold text-destructive text-lg",children:"Media Player Error"}),o.jsxRuntimeExports.jsx("div",{className:"mb-4 text-center text-muted-foreground text-sm",children:e.message}),o.jsxRuntimeExports.jsx("button",{onClick:t,className:"rounded bg-primary px-4 py-2 text-primary-foreground transition-colors hover:bg-primary/90",children:"Try Again"})]})}class br extends E.Component{constructor(n){super(n);de(this,"resetError",()=>{this.setState({hasError:!1,error:null})});this.state={hasError:!1,error:null}}static getDerivedStateFromError(n){return{hasError:!0,error:n}}componentDidCatch(n,r){this.props.onError?.(n,r),console.error("MediaErrorBoundary caught an error:",n,r)}render(){if(this.state.hasError&&this.state.error){const n=this.props.fallback||Ls;return o.jsxRuntimeExports.jsx(n,{error:this.state.error,resetError:this.resetError})}return this.props.children}}function Er({children:e,priority:t="normal",deferredMs:n=0}){const[r,s]=E.useState(n>0),i=E.useDeferredValue(e);return E.useEffect(()=>{if(n>0){const a=setTimeout(()=>{s(!1)},n);return()=>clearTimeout(a)}},[n]),r?o.jsxRuntimeExports.jsx(Qe,{variant:"skeleton"}):t==="high"?o.jsxRuntimeExports.jsx(o.jsxRuntimeExports.Fragment,{children:e}):t==="low"?o.jsxRuntimeExports.jsx(o.jsxRuntimeExports.Fragment,{children:i}):o.jsxRuntimeExports.jsx(E.Suspense,{fallback:o.jsxRuntimeExports.jsx(Qe,{}),children:e})}function Fs(e=100){const[t,n]=E.useState(!1),r=E.useDeferredValue(t);return E.useEffect(()=>{const s=setTimeout(()=>{n(!0)},e);return()=>clearTimeout(s)},[e]),{isReady:r,actualIsReady:t}}function zs({children:e,className:t,loadingFallback:n=o.jsxRuntimeExports.jsx(Qe,{}),errorFallback:r,priority:s="normal",deferredMs:i=0,onError:a}){return o.jsxRuntimeExports.jsx("div",{className:t,children:o.jsxRuntimeExports.jsx(br,{fallback:r,onError:a,children:o.jsxRuntimeExports.jsx(yr,{fallback:n,children:o.jsxRuntimeExports.jsx(Er,{priority:s,deferredMs:i,children:e})})})})}const wr=E.forwardRef(({src:e,className:t,children:n,keyboardControls:r=!0,showControls:s=!0,customControls:i=!1,crossOrigin:a,enablePerformanceMonitoring:c=!0,bufferingStrategy:m="adaptive",preloadStrategy:l="progressive",enableOptimizations:d=!0,...u},p)=>{E.useTransition();const{state:x,controls:y,mediaRef:h,containerRef:v,performanceMetrics:w,isEnhanced:j}=U.useEnhancedMediaPlayer({src:e,crossOrigin:a,enablePerformanceMonitoring:c,bufferingStrategy:m,preloadStrategy:l,enableTimeUpdateThrottling:!0,timeUpdateThrottleMs:100,enableSeekPreview:!0,...u}),{memoryStats:b}=U.useMemoryOptimization({maxMemoryUsage:50,cleanupInterval:15e3,enableGC:!0,monitorMemory:d});U.useKeyboardControls({enabled:r,state:x,controls:y});const g=E.useMemo(()=>Array.isArray(e)?e.some(M=>/\.(mp4|webm|ogv|mov|avi)$/i.test(M)):/\.(mp4|webm|ogv|mov|avi)$/i.test(e),[e]),R=E.useMemo(()=>Array.isArray(e)?e.map((M,S)=>o.jsxRuntimeExports.jsx("source",{src:M},`${M}-${S}`)):null,[e]),P=E.useMemo(()=>({controls:s&&!i,className:C.cn("w-full transition-all duration-300",g&&"aspect-video","bg-[color:var(--media-bg)] rounded-lg",x.isTransitioning&&"opacity-90"),preload:l==="eager"?"auto":"metadata",crossOrigin:a,...Array.isArray(e)?{}:{src:e}}),[s,i,g,x.isTransitioning,l,a,e]);return o.jsxRuntimeExports.jsx(zs,{priority:"high",errorFallback:({error:M,resetError:S})=>o.jsxRuntimeExports.jsx("div",{className:C.cn("absolute inset-0 flex items-center justify-center","glass-strong animate-enter rounded-lg","bg-[color:var(--color-error)]/10 backdrop-blur-md"),children:o.jsxRuntimeExports.jsxs("div",{className:"space-y-2 text-center text-[color:var(--media-text)]",children:[o.jsxRuntimeExports.jsx("div",{className:"mx-auto w-fit rounded-full bg-[color:var(--color-error)]/20 p-3",children:o.jsxRuntimeExports.jsx("svg",{className:"size-6 text-[color:var(--color-error)]",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:o.jsxRuntimeExports.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}),o.jsxRuntimeExports.jsx("p",{className:"font-semibold text-lg",children:"Playback Error"}),o.jsxRuntimeExports.jsx("p",{className:"max-w-xs text-[color:var(--media-text-secondary)] text-sm",children:M.message||x.error}),o.jsxRuntimeExports.jsx("button",{onClick:S,className:"mt-2 rounded bg-[color:var(--color-brand-primary)] px-4 py-2 text-sm text-white transition-colors hover:bg-[color:var(--color-brand-accent)]",children:"Try Again"})]})}),loadingFallback:o.jsxRuntimeExports.jsx("div",{className:C.cn("absolute inset-0 flex items-center justify-center","glass animate-enter rounded-lg","bg-[color:var(--media-bg)]/20 backdrop-blur-sm"),children:o.jsxRuntimeExports.jsxs("div",{className:"space-y-4 text-center text-[color:var(--media-text)]",children:[o.jsxRuntimeExports.jsxs("div",{className:"relative",children:[o.jsxRuntimeExports.jsx("div",{className:C.cn("size-12 animate-spin rounded-full border-2","border-[color:var(--color-brand-accent)]/30","border-t-[color:var(--color-brand-accent)]")}),o.jsxRuntimeExports.jsx("div",{className:C.cn("absolute inset-0 size-12 rounded-full","bg-gradient-to-r from-[color:var(--color-brand-primary)] to-[color:var(--color-brand-accent)]","animate-pulse opacity-20 blur-sm")})]}),o.jsxRuntimeExports.jsx("p",{className:"font-medium text-[color:var(--media-text-secondary)] text-sm",children:"Loading media..."})]})}),children:o.jsxRuntimeExports.jsxs("div",{ref:p||v,className:C.cn("media-container relative overflow-hidden contain-strict","bg-[color:var(--media-bg)] focus-within:outline-none","rounded-xl border border-[color:var(--media-border)]/30","shadow-2xl shadow-[color:var(--media-bg)]/50","transition-all duration-300 ease-out","hover:border-[color:var(--media-border)]/50","hover:shadow-3xl hover:shadow-[color:var(--media-bg)]/60","will-change-transform",x.isTransitioning&&"cursor-wait",t),tabIndex:0,role:"application","aria-label":g?"Video player":"Audio player","aria-busy":x.isLoading||x.isBuffering,children:[g?o.jsxRuntimeExports.jsxs("video",{ref:h,...P,disablePictureInPicture:!1,playsInline:!0,"x-webkit-airplay":"allow",style:{willChange:"transform"},children:[R,"Your browser does not support the video element."]}):o.jsxRuntimeExports.jsxs("audio",{ref:h,...P,preload:l==="eager"?"auto":"metadata",children:[R,"Your browser does not support the audio element."]}),x.error&&o.jsxRuntimeExports.jsx("div",{className:C.cn("absolute inset-0 flex items-center justify-center","glass-strong animate-enter rounded-lg","bg-[color:var(--color-error)]/10 backdrop-blur-md"),children:o.jsxRuntimeExports.jsxs("div",{className:"space-y-2 text-center text-[color:var(--media-text)]",children:[o.jsxRuntimeExports.jsx("div",{className:"mx-auto w-fit rounded-full bg-[color:var(--color-error)]/20 p-3",children:o.jsxRuntimeExports.jsx("svg",{className:"size-6 text-[color:var(--color-error)]",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:o.jsxRuntimeExports.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}),o.jsxRuntimeExports.jsx("p",{className:"font-semibold text-lg",children:"Playback Error"}),o.jsxRuntimeExports.jsx("p",{className:"max-w-xs text-[color:var(--media-text-secondary)] text-sm",children:x.error})]})}),x.isLoading&&o.jsxRuntimeExports.jsx("div",{className:C.cn("absolute inset-0 flex items-center justify-center","glass animate-enter rounded-lg","bg-[color:var(--media-bg)]/20 backdrop-blur-sm"),children:o.jsxRuntimeExports.jsxs("div",{className:"space-y-4 text-center text-[color:var(--media-text)]",children:[o.jsxRuntimeExports.jsxs("div",{className:"relative",children:[o.jsxRuntimeExports.jsx("div",{className:C.cn("size-12 animate-spin rounded-full border-2","border-[color:var(--color-brand-accent)]/30","border-t-[color:var(--color-brand-accent)]")}),o.jsxRuntimeExports.jsx("div",{className:C.cn("absolute inset-0 size-12 rounded-full","bg-gradient-to-r from-[color:var(--color-brand-primary)] to-[color:var(--color-brand-accent)]","animate-pulse opacity-20 blur-sm")})]}),o.jsxRuntimeExports.jsx("p",{className:"font-medium text-[color:var(--media-text-secondary)] text-sm",children:x.isBuffering?"Buffering...":"Loading media..."})]})}),i&&typeof n=="function"&&o.jsxRuntimeExports.jsx("div",{className:"pointer-events-auto absolute inset-0 z-50",children:n({state:x,controls:y})}),i&&typeof n!="function"&&o.jsxRuntimeExports.jsx("div",{className:"pointer-events-auto absolute inset-0 z-50",children:n}),process.env.NODE_ENV==="development"&&c&&o.jsxRuntimeExports.jsxs("div",{className:"absolute bottom-2 left-2 rounded bg-black/50 px-2 py-1 text-white text-xs",children:[o.jsxRuntimeExports.jsxs("div",{children:["FPS: ",w.frameRate||0]}),o.jsxRuntimeExports.jsxs("div",{children:["Memory: ",b.usage.toFixed(1),"MB"]}),j&&o.jsxRuntimeExports.jsx("div",{children:"Enhanced ✓"})]})]})})});wr.displayName="MediaPlayer";const jr=E.forwardRef(({src:e,poster:t,width:n="100%",height:r="auto",aspectRatio:s="16/9",className:i,children:a,keyboardControls:c=!0,showControls:m=!0,customControls:l=!1,crossOrigin:d,...u},p)=>{const{state:x,controls:y,mediaRef:h,containerRef:v}=U.useMediaPlayer({src:e,crossOrigin:d,...u});U.useKeyboardControls({enabled:c,state:x,controls:y});const w=()=>Array.isArray(e)?e.map((g,R)=>o.jsxRuntimeExports.jsx("source",{src:g},R)):null,j={width:n,height:r,aspectRatio:r==="auto"?s:void 0},b={ref:h,controls:m&&!l,poster:t,className:"w-full h-full object-contain bg-black",...Array.isArray(e)?{}:{src:e}};return o.jsxRuntimeExports.jsxs("div",{ref:p||v,style:j,className:C.cn("relative overflow-hidden bg-black","focus-within:outline-none",i),tabIndex:0,children:[o.jsxRuntimeExports.jsxs("video",{...b,children:[Array.isArray(e)&&w(),"Your browser does not support the video element."]}),x.error&&o.jsxRuntimeExports.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-black/80",children:o.jsxRuntimeExports.jsxs("div",{className:"text-center text-white",children:[o.jsxRuntimeExports.jsx("p",{className:"font-semibold text-lg",children:"Error"}),o.jsxRuntimeExports.jsx("p",{className:"text-sm opacity-80",children:x.error})]})}),x.isLoading&&o.jsxRuntimeExports.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-black/50",children:o.jsxRuntimeExports.jsx("div",{className:"text-white",children:o.jsxRuntimeExports.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-white border-b-2"})})}),l&&typeof a=="function"&&o.jsxRuntimeExports.jsx("div",{className:"pointer-events-none absolute inset-0",children:o.jsxRuntimeExports.jsx("div",{className:"pointer-events-auto",children:a({state:x,controls:y})})}),l&&typeof a!="function"&&a]})});jr.displayName="VideoPlayer";const Rr=E.forwardRef(({src:e,className:t,children:n,keyboardControls:r=!0,showControls:s=!0,customControls:i=!1,...a},c)=>{const{state:m,controls:l,mediaRef:d,containerRef:u}=U.useMediaPlayer({src:e,...a});U.useKeyboardControls({enabled:r,state:m,controls:l});const p=()=>Array.isArray(e)?e.map((y,h)=>o.jsxRuntimeExports.jsx("source",{src:y},h)):null,x={ref:d,controls:s&&!i,className:"w-full",...Array.isArray(e)?{}:{src:e}};return o.jsxRuntimeExports.jsxs("div",{ref:c||u,className:C.cn("relative","focus-within:outline-none",t),tabIndex:0,children:[o.jsxRuntimeExports.jsxs("audio",{...x,children:[Array.isArray(e)&&p(),"Your browser does not support the audio element."]}),m.error&&o.jsxRuntimeExports.jsx("div",{className:"mt-2 rounded-md border border-red-300 bg-red-100 p-3",children:o.jsxRuntimeExports.jsxs("div",{className:"text-red-800",children:[o.jsxRuntimeExports.jsx("p",{className:"font-semibold",children:"Error"}),o.jsxRuntimeExports.jsx("p",{className:"text-sm",children:m.error})]})}),m.isLoading&&o.jsxRuntimeExports.jsx("div",{className:"mt-2 rounded-md border border-gray-300 bg-gray-100 p-3",children:o.jsxRuntimeExports.jsxs("div",{className:"flex items-center space-x-2 text-gray-600",children:[o.jsxRuntimeExports.jsx("div",{className:"h-4 w-4 animate-spin rounded-full border-gray-600 border-b-2"}),o.jsxRuntimeExports.jsx("span",{className:"text-sm",children:"Loading..."})]})}),i&&typeof n=="function"&&o.jsxRuntimeExports.jsx("div",{className:"mt-2",children:n({state:m,controls:l})}),i&&typeof n!="function"&&o.jsxRuntimeExports.jsx("div",{className:"mt-2",children:n})]})});Rr.displayName="AudioPlayer";let $t=null,$n=null;async function $s(){if(!$t){const[e,t]=await Promise.all([import("video.js"),import("hls.js")]);$t=e.default,$n=t.default,await Promise.all([import("@videojs/http-streaming"),import("videojs-contrib-quality-levels"),import("videojs-hls-quality-selector")])}return{videojs:$t,Hls:$n}}function Mr({sources:e,poster:t,textTracks:n=[],autoplay:r=!1,muted:s=!1,controls:i=!1,preload:a="metadata",fluid:c=!0,responsive:m=!0,playbackRates:l=[.5,.75,1,1.25,1.5,2],className:d,onReady:u,onError:p,hlsConfig:x={},enableQualitySelector:y=!0,enableSubtitles:h=!0}){const v=E.useRef(null),w=E.useRef(null),j=E.useRef(null),[b,g]=E.useState(!0),[R,P]=E.useState(null),M=o.useMediaContext(),S=o.useMediaDispatch(),F=async()=>{if(!(!v.current||w.current))try{g(!0);const{videojs:D,Hls:_}=await $s(),B=e.some(O=>O.type==="application/x-mpegURL")&&!v.current.canPlayType("application/vnd.apple.mpegurl"),$={autoplay:r,muted:s,controls:i,preload:a,fluid:c,responsive:m,playbackRates:l,sources:B?[]:e,poster:t,html5:{vhs:{overrideNative:!v.current.canPlayType("application/vnd.apple.mpegurl"),enableLowInitialPlaylist:!0,fastQualityChange:!0,handleManifestRedirects:!0}}},T=D(v.current,$,function(){console.log("Video.js player ready")});if(w.current=T,n.forEach(O=>{T.addRemoteTextTrack({kind:O.kind,src:O.src,srclang:O.srclang,label:O.label,default:O.default},!1)}),B){const O=e.find(k=>k.type==="application/x-mpegURL");if(O){const k=new _({debug:!1,enableWorker:!0,lowLatencyMode:!1,backBufferLength:30,maxBufferLength:30,maxMaxBufferLength:600,maxBufferSize:6e7,maxBufferHole:.1,highBufferWatchdogPeriod:2,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,capLevelToPlayerSize:!0,capLevelOnFPSDrop:!0,renderTextTracksNatively:!1,subtitlePreference:{lang:navigator.language.split("-")[0],forced:!1},...x});j.current=k,k.loadSource(O.src),k.attachMedia(v.current),k.on(_.Events.MANIFEST_PARSED,()=>{if(console.log("HLS manifest parsed",{levels:k.levels.map(I=>({height:I.height,bitrate:I.bitrate,codec:I.codecSet}))}),y&&T.qualityLevels){const I=T.qualityLevels();k.levels.forEach((N,A)=>{I.addQualityLevel({id:A.toString(),label:`${N.height}p`,width:N.width,height:N.height,bitrate:N.bitrate,enabled:!0})})}}),k.on(_.Events.LEVEL_SWITCHED,(I,N)=>{console.log(`HLS quality switched to level ${N.level}`),S({type:o.MediaActionTypes.SET_QUALITY_LEVEL,detail:N.level})}),k.on(_.Events.ERROR,(I,N)=>{if(N.fatal)switch(N.type){case _.ErrorTypes.NETWORK_ERROR:console.error("Fatal network error encountered, try to recover"),k.startLoad();break;case _.ErrorTypes.MEDIA_ERROR:console.error("Fatal media error encountered, try to recover"),k.recoverMediaError();break;default:console.error("Fatal error, cannot recover"),P("Streaming error occurred"),p?.(N),k.destroy();break}}),k.on(_.Events.FRAG_LOADED,()=>{const I=k.bandwidthEstimate;I&&S({type:o.MediaActionTypes.SET_BANDWIDTH_ESTIMATE,detail:I})})}}y&&T.qualityLevels&&T.hlsQualitySelector({displayCurrentQuality:!0}),T.on("play",()=>{S({type:o.MediaActionTypes.PLAY})}),T.on("pause",()=>{S({type:o.MediaActionTypes.PAUSE})}),T.on("timeupdate",()=>{S({type:o.MediaActionTypes.SET_CURRENT_TIME,detail:T.currentTime()||0})}),T.on("durationchange",()=>{S({type:o.MediaActionTypes.SET_DURATION,detail:T.duration()||0})}),T.on("volumechange",()=>{S({type:o.MediaActionTypes.SET_VOLUME,detail:T.volume()||0}),S({type:T.muted()?o.MediaActionTypes.MUTE:o.MediaActionTypes.UNMUTE})}),T.on("ended",()=>{S({type:o.MediaActionTypes.PAUSE})}),T.on("error",O=>{const k=T.error();P(k?.message||"An error occurred"),S({type:o.MediaActionTypes.SET_ERROR,detail:k?.message||"Playback error"}),p?.(k)}),T.on("loadstart",()=>{S({type:o.MediaActionTypes.SET_LOADING,detail:!0})}),T.on("loadeddata",()=>{g(!1),S({type:o.MediaActionTypes.SET_LOADING,detail:!1})}),T.on("waiting",()=>{S({type:o.MediaActionTypes.SET_BUFFERING,detail:!0})}),T.on("playing",()=>{S({type:o.MediaActionTypes.SET_BUFFERING,detail:!1})}),T.on("texttrackchange",()=>{const O=T.textTracks(),k=[];if(O&&O.length)for(let I=0;I<O.length;I++){const N=O[I];N.mode==="showing"&&k.push({id:N.id,label:N.label,language:N.language,kind:N.kind})}S({type:o.MediaActionTypes.SET_ACTIVE_TEXT_TRACKS,detail:k})}),M.mediaRef&&(M.mediaRef.current=v.current),u?.(T),g(!1)}catch(D){console.error("Failed to initialize Video.js player:",D),P("Failed to initialize player"),g(!1),p?.(D)}};return E.useEffect(()=>(F(),()=>{j.current&&(j.current.destroy(),j.current=null),w.current&&(w.current.dispose(),w.current=null)}),[F]),E.useEffect(()=>{if(!w.current||!M.mediaRef)return;const D={play:()=>w.current?.play(),pause:()=>w.current?.pause(),seekTo:_=>{w.current&&w.current.currentTime(_)},setVolume:_=>{w.current&&w.current.volume(_)},setMuted:_=>{w.current&&w.current.muted(_)},setQualityLevel:_=>{j.current&&(j.current.currentLevel=_)},getQualityLevels:()=>j.current?j.current.levels:[],getCurrentQualityLevel:()=>j.current?j.current.currentLevel:-1,getBandwidthEstimate:()=>j.current?j.current.bandwidthEstimate:0};v.current&&Object.assign(v.current,D)},[M.mediaRef]),o.jsxRuntimeExports.jsxs("div",{className:C.cn("relative h-full w-full",d),children:[o.jsxRuntimeExports.jsx("video",{ref:v,className:"video-js vjs-default-skin vjs-big-play-centered h-full w-full",playsInline:!0}),b&&o.jsxRuntimeExports.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-black/50",children:o.jsxRuntimeExports.jsx("div",{className:"text-white",children:o.jsxRuntimeExports.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-white border-b-2"})})}),R&&o.jsxRuntimeExports.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-black/80",children:o.jsxRuntimeExports.jsxs("div",{className:"text-center text-white",children:[o.jsxRuntimeExports.jsx("p",{className:"font-semibold text-lg",children:"Error"}),o.jsxRuntimeExports.jsx("p",{className:"text-sm opacity-80",children:R})]})})]})}Mr.displayName="VideoJSAdapter";function Bn(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function St(...e){return t=>{let n=!1;const r=e.map(s=>{const i=Bn(s,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let s=0;s<r.length;s++){const i=r[s];typeof i=="function"?i():Bn(e[s],null)}}}}function X(...e){return f.useCallback(St(...e),e)}function Ze(e){const t=Vs(e),n=f.forwardRef((r,s)=>{const{children:i,...a}=r,c=f.Children.toArray(i),m=c.find(Us);if(m){const l=m.props.children,d=c.map(u=>u===m?f.Children.count(l)>1?f.Children.only(null):f.isValidElement(l)?l.props.children:null:u);return o.jsxRuntimeExports.jsx(t,{...a,ref:s,children:f.isValidElement(l)?f.cloneElement(l,void 0,d):null})}return o.jsxRuntimeExports.jsx(t,{...a,ref:s,children:i})});return n.displayName=`${e}.Slot`,n}var Bs=Ze("Slot");function Vs(e){const t=f.forwardRef((n,r)=>{const{children:s,...i}=n;if(f.isValidElement(s)){const a=Ks(s),c=Ws(i,s.props);return s.type!==f.Fragment&&(c.ref=r?St(r,a):a),f.cloneElement(s,c)}return f.Children.count(s)>1?f.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Hs=Symbol("radix.slottable");function Us(e){return f.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Hs}function Ws(e,t){const n={...t};for(const r in t){const s=e[r],i=t[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...c)=>{const m=i(...c);return s(...c),m}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...e,...n}}function Ks(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}const Vn=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Hn=C.clsx,Gs=(e,t)=>n=>{var r;if(t?.variants==null)return Hn(e,n?.class,n?.className);const{variants:s,defaultVariants:i}=t,a=Object.keys(s).map(l=>{const d=n?.[l],u=i?.[l];if(d===null)return null;const p=Vn(d)||Vn(u);return s[l][p]}),c=n&&Object.entries(n).reduce((l,d)=>{let[u,p]=d;return p===void 0||(l[u]=p),l},{}),m=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((l,d)=>{let{class:u,className:p,...x}=d;return Object.entries(x).every(y=>{let[h,v]=y;return Array.isArray(v)?v.includes({...i,...c}[h]):{...i,...c}[h]===v})?[...l,u,p]:l},[]);return Hn(e,a,m,n?.class,n?.className)},Ys=Gs("inline-flex shrink-0 items-center justify-center gap-2 whitespace-nowrap rounded-md font-medium text-sm outline-none transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});function q({className:e,variant:t,size:n,asChild:r=!1,...s}){const i=r?Bs:"button";return o.jsxRuntimeExports.jsx(i,{"data-slot":"button",className:C.cn$1(Ys({variant:t,size:n,className:e})),...s})}/**
2
- * @license lucide-react v0.511.0 - ISC
3
- *
4
- * This source code is licensed under the ISC license.
5
- * See the LICENSE file in the root directory of this source tree.
6
- */var qs={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
7
- * @license lucide-react v0.511.0 - ISC
8
- *
9
- * This source code is licensed under the ISC license.
10
- * See the LICENSE file in the root directory of this source tree.
11
- */const Xs=E.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:i,iconNode:a,...c},m)=>E.createElement("svg",{ref:m,...qs,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:C.mergeClasses("lucide",s),...!i&&!C.hasA11yProp(c)&&{"aria-hidden":"true"},...c},[...a.map(([l,d])=>E.createElement(l,d)),...Array.isArray(i)?i:[i]]));/**
12
- * @license lucide-react v0.511.0 - ISC
13
- *
14
- * This source code is licensed under the ISC license.
15
- * See the LICENSE file in the root directory of this source tree.
16
- */const le=(e,t)=>{const n=E.forwardRef(({className:r,...s},i)=>E.createElement(Xs,{ref:i,iconNode:t,className:C.mergeClasses(`lucide-${C.toKebabCase(C.toPascalCase(e))}`,`lucide-${e}`,r),...s}));return n.displayName=C.toPascalCase(e),n};/**
17
- * @license lucide-react v0.511.0 - ISC
18
- *
19
- * This source code is licensed under the ISC license.
20
- * See the LICENSE file in the root directory of this source tree.
21
- */const Qs=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Zs=le("loader-circle",Qs);/**
22
- * @license lucide-react v0.511.0 - ISC
23
- *
24
- * This source code is licensed under the ISC license.
25
- * See the LICENSE file in the root directory of this source tree.
26
- */const Js=[["path",{d:"M8 3H5a2 2 0 0 0-2 2v3",key:"1dcmit"}],["path",{d:"M21 8V5a2 2 0 0 0-2-2h-3",key:"1e4gt3"}],["path",{d:"M3 16v3a2 2 0 0 0 2 2h3",key:"wsl5sc"}],["path",{d:"M16 21h3a2 2 0 0 0 2-2v-3",key:"18trek"}]],ei=le("maximize",Js);/**
27
- * @license lucide-react v0.511.0 - ISC
28
- *
29
- * This source code is licensed under the ISC license.
30
- * See the LICENSE file in the root directory of this source tree.
31
- */const ti=[["path",{d:"M8 3v3a2 2 0 0 1-2 2H3",key:"hohbtr"}],["path",{d:"M21 8h-3a2 2 0 0 1-2-2V3",key:"5jw1f3"}],["path",{d:"M3 16h3a2 2 0 0 1 2 2v3",key:"198tvr"}],["path",{d:"M16 21v-3a2 2 0 0 1 2-2h3",key:"ph8mxp"}]],ni=le("minimize",ti);/**
32
- * @license lucide-react v0.511.0 - ISC
33
- *
34
- * This source code is licensed under the ISC license.
35
- * See the LICENSE file in the root directory of this source tree.
36
- */const ri=[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]],oi=le("pause",ri);/**
37
- * @license lucide-react v0.511.0 - ISC
38
- *
39
- * This source code is licensed under the ISC license.
40
- * See the LICENSE file in the root directory of this source tree.
41
- */const si=[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]],ii=le("play",si);/**
42
- * @license lucide-react v0.511.0 - ISC
43
- *
44
- * This source code is licensed under the ISC license.
45
- * See the LICENSE file in the root directory of this source tree.
46
- */const ai=[["path",{d:"M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"14sxne"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16",key:"1hlbsb"}],["path",{d:"M16 16h5v5",key:"ccwih5"}]],Un=le("refresh-ccw",ai);/**
47
- * @license lucide-react v0.511.0 - ISC
48
- *
49
- * This source code is licensed under the ISC license.
50
- * See the LICENSE file in the root directory of this source tree.
51
- */const ci=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],Wn=le("rotate-ccw",ci);/**
52
- * @license lucide-react v0.511.0 - ISC
53
- *
54
- * This source code is licensed under the ISC license.
55
- * See the LICENSE file in the root directory of this source tree.
56
- */const li=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],ui=le("triangle-alert",li);/**
57
- * @license lucide-react v0.511.0 - ISC
58
- *
59
- * This source code is licensed under the ISC license.
60
- * See the LICENSE file in the root directory of this source tree.
61
- */const di=[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}]],fi=le("volume-1",di);/**
62
- * @license lucide-react v0.511.0 - ISC
63
- *
64
- * This source code is licensed under the ISC license.
65
- * See the LICENSE file in the root directory of this source tree.
66
- */const mi=[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]],pi=le("volume-2",mi);/**
67
- * @license lucide-react v0.511.0 - ISC
68
- *
69
- * This source code is licensed under the ISC license.
70
- * See the LICENSE file in the root directory of this source tree.
71
- */const xi=[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["line",{x1:"22",x2:"16",y1:"9",y2:"15",key:"1ewh16"}],["line",{x1:"16",x2:"22",y1:"9",y2:"15",key:"5ykzw1"}]],hi=le("volume-x",xi);function Cr({error:e,label:t,description:n,onRetry:r,onReload:s,className:i,asChild:a=!1,children:c,...m}){const l=o.useMediaContext(),d=o.useMediaSelector(g=>g.error),u=e||d,[p,x]=E.useState({retryPending:!1,reloadPending:!1}),y=E.useCallback(()=>{x(g=>({...g,retryPending:!0})),requestAnimationFrame(()=>{const g=l.mediaRef.current;if(!g){x(R=>({...R,retryPending:!1}));return}r?r():g.src&&g.load(),x(R=>({...R,retryPending:!1}))})},[l.mediaRef,r]),h=E.useCallback(()=>{x(g=>({...g,reloadPending:!0})),requestAnimationFrame(()=>{s?s():window.location.reload()})},[s]),v=E.useMemo(()=>t||(u instanceof Error?"Media Error":"Playback Error"),[t,u]),w=E.useMemo(()=>n||(u instanceof Error?u.message:typeof u=="string"?u:"An error occurred while loading the media"),[n,u]);if(!u)return null;const j={role:"alert","aria-describedby":`${l.mediaId}-error-description`,"aria-labelledby":`${l.mediaId}-error-label`,"aria-live":"assertive","data-slot":"media-player-error","data-state":"error",className:C.cn("pointer-events-auto absolute inset-0 z-50 flex flex-col items-center justify-center bg-black/80 text-white backdrop-blur-sm",i),...m},b=o.jsxRuntimeExports.jsxs("div",{className:"flex flex-col items-center gap-4 p-6 text-center",children:[o.jsxRuntimeExports.jsx(ui,{className:"size-12 text-red-400"}),o.jsxRuntimeExports.jsxs("div",{className:"space-y-2",children:[o.jsxRuntimeExports.jsx("h3",{id:`${l.mediaId}-error-label`,className:"font-semibold text-lg",children:v}),o.jsxRuntimeExports.jsx("p",{id:`${l.mediaId}-error-description`,className:"text-sm text-white/80",children:w})]}),o.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-2",children:[o.jsxRuntimeExports.jsxs(q,{variant:"outline",size:"sm",onClick:y,disabled:p.retryPending,children:[p.retryPending?o.jsxRuntimeExports.jsx(Un,{className:"mr-2 size-4 animate-spin"}):o.jsxRuntimeExports.jsx(Un,{className:"mr-2 size-4"}),"Try again"]}),o.jsxRuntimeExports.jsxs(q,{variant:"outline",size:"sm",onClick:h,disabled:p.reloadPending,children:[p.reloadPending?o.jsxRuntimeExports.jsx(Wn,{className:"mr-2 size-4 animate-spin"}):o.jsxRuntimeExports.jsx(Wn,{className:"mr-2 size-4"}),"Reload page"]})]})]});if(a){const g=E.Children.only(c);return E.cloneElement(g,j,b)}return o.jsxRuntimeExports.jsx("div",{...j,children:b})}Cr.displayName="MediaPlayerError";function Sr({className:e,delayMs:t=300,asChild:n=!1,children:r,...s}){const i=o.useMediaSelector(u=>u.isLoading),[a,c]=E.useState(!1),m=E.useRef(void 0);if(E.useEffect(()=>(m.current&&(clearTimeout(m.current),m.current=void 0),i?t>0?m.current=setTimeout(()=>{c(!0),m.current=void 0},t):c(!0):c(!1),()=>{m.current&&(clearTimeout(m.current),m.current=void 0)}),[i,t]),!a)return null;const l={role:"status","aria-live":"polite","data-slot":"media-player-loading",className:C.cn("fade-in-0 zoom-in-95 pointer-events-none absolute inset-0 z-50 flex animate-in items-center justify-center duration-200",e),...s},d=o.jsxRuntimeExports.jsx(Zs,{className:"size-8 animate-spin text-white"});if(n){const u=E.Children.only(r);return E.cloneElement(u,l,d)}return o.jsxRuntimeExports.jsx("div",{...l,children:d})}Sr.displayName="MediaPlayerLoading";function vi({sources:e,poster:t,textTracks:n=[],showControls:r=!0,customControls:s,hlsConfig:i,enableQualitySelector:a=!0,enableSubtitles:c=!0,containerClassName:m,videoClassName:l,onPlayerReady:d,onPlayerError:u}){const p=o.useMediaSelector(h=>h.isLoading),x=o.useMediaSelector(h=>h.isBuffering),y=o.useMediaSelector(h=>h.error);return o.jsxRuntimeExports.jsxs("div",{className:C.cn("relative h-full w-full",m),children:[o.jsxRuntimeExports.jsx(Mr,{sources:e,poster:t,textTracks:n,controls:!0,autoplay:!1,muted:!0,preload:"auto",className:l,hlsConfig:i,enableQualitySelector:a,enableSubtitles:c,onReady:d,onError:u}),(p||x)&&o.jsxRuntimeExports.jsx(Sr,{}),y&&o.jsxRuntimeExports.jsx(Cr,{children:y})]})}function Pr(e){const{sources:t,poster:n,textTracks:r,showControls:s,customControls:i,hlsConfig:a,enableQualitySelector:c,enableSubtitles:m,containerClassName:l,videoClassName:d,onPlayerReady:u,onPlayerError:p,...x}=e;return o.jsxRuntimeExports.jsx(we.MediaPlayerRoot,{...x,children:o.jsxRuntimeExports.jsx(vi,{sources:t,poster:n,textTracks:r,showControls:s,customControls:i,hlsConfig:a,enableQualitySelector:c,enableSubtitles:m,containerClassName:l,videoClassName:d,onPlayerReady:u,onPlayerError:p})})}Pr.displayName="MediaPlayerHLS";const Nr=["mp4","webm","ogv","mov","avi","m4v","mkv"],Ar=["mp3","aac","ogg","wav","flac","m4a","weba"],nn={mp4:"video/mp4",webm:"video/webm",ogv:"video/ogg",mov:"video/quicktime",avi:"video/x-msvideo",m4v:"video/x-m4v",mkv:"video/x-matroska"},rn={mp3:"audio/mpeg",aac:"audio/aac",ogg:"audio/ogg",wav:"audio/wav",flac:"audio/flac",m4a:"audio/mp4",weba:"audio/webm"};function gi(e){const t=e.split(".").pop()?.toLowerCase();return t&&Nr.includes(t)?"video":t&&Ar.includes(t)?"audio":"unknown"}function yi(e){const t=e.split(".").pop()?.toLowerCase();if(t&&t in nn)return nn[t];if(t&&t in rn)return rn[t]}function rt(e,t=[]){let n=[];function r(i,a){const c=f.createContext(a),m=n.length;n=[...n,a];const l=u=>{const{scope:p,children:x,...y}=u,h=p?.[e]?.[m]||c,v=f.useMemo(()=>y,Object.values(y));return o.jsxRuntimeExports.jsx(h.Provider,{value:v,children:x})};l.displayName=i+"Provider";function d(u,p){const x=p?.[e]?.[m]||c,y=f.useContext(x);if(y)return y;if(a!==void 0)return a;throw new Error(`\`${u}\` must be used within \`${i}\``)}return[l,d]}const s=()=>{const i=n.map(a=>f.createContext(a));return function(c){const m=c?.[e]||i;return f.useMemo(()=>({[`__scope${e}`]:{...c,[e]:m}}),[c,m])}};return s.scopeName=e,[r,bi(s,...t)]}function bi(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(i){const a=r.reduce((c,{useScope:m,scopeName:l})=>{const u=m(i)[`__scope${l}`];return{...c,...u}},{});return f.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function Tr(e){const t=e+"CollectionProvider",[n,r]=rt(t),[s,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=h=>{const{scope:v,children:w}=h,j=E.useRef(null),b=E.useRef(new Map).current;return o.jsxRuntimeExports.jsx(s,{scope:v,itemMap:b,collectionRef:j,children:w})};a.displayName=t;const c=e+"CollectionSlot",m=Ze(c),l=E.forwardRef((h,v)=>{const{scope:w,children:j}=h,b=i(c,w),g=X(v,b.collectionRef);return o.jsxRuntimeExports.jsx(m,{ref:g,children:j})});l.displayName=c;const d=e+"CollectionItemSlot",u="data-radix-collection-item",p=Ze(d),x=E.forwardRef((h,v)=>{const{scope:w,children:j,...b}=h,g=E.useRef(null),R=X(v,g),P=i(d,w);return E.useEffect(()=>(P.itemMap.set(g,{ref:g,...b}),()=>void P.itemMap.delete(g))),o.jsxRuntimeExports.jsx(p,{[u]:"",ref:R,children:j})});x.displayName=d;function y(h){const v=i(e+"CollectionConsumer",h);return E.useCallback(()=>{const j=v.collectionRef.current;if(!j)return[];const b=Array.from(j.querySelectorAll(`[${u}]`));return Array.from(v.itemMap.values()).sort((P,M)=>b.indexOf(P.ref.current)-b.indexOf(M.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:a,Slot:l,ItemSlot:x},y,r]}function z(e,t,{checkForDefaultPrevented:n=!0}={}){return function(s){if(e?.(s),n===!1||!s.defaultPrevented)return t?.(s)}}var Ce=globalThis?.document?f.useLayoutEffect:()=>{},Ei=f[" useInsertionEffect ".trim().toString()]||Ce;function kr({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[s,i,a]=wi({defaultProp:t,onChange:n}),c=e!==void 0,m=c?e:s;{const d=f.useRef(e!==void 0);f.useEffect(()=>{const u=d.current;u!==c&&console.warn(`${r} is changing from ${u?"controlled":"uncontrolled"} to ${c?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),d.current=c},[c,r])}const l=f.useCallback(d=>{if(c){const u=ji(d)?d(e):d;u!==e&&a.current?.(u)}else i(d)},[c,e,i,a]);return[m,l]}function wi({defaultProp:e,onChange:t}){const[n,r]=f.useState(e),s=f.useRef(n),i=f.useRef(t);return Ei(()=>{i.current=t},[t]),f.useEffect(()=>{s.current!==n&&(i.current?.(n),s.current=n)},[n,s]),[n,r,i]}function ji(e){return typeof e=="function"}var Ri=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],G=Ri.reduce((e,t)=>{const n=Ze(`Primitive.${t}`),r=f.forwardRef((s,i)=>{const{asChild:a,...c}=s,m=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),o.jsxRuntimeExports.jsx(m,{...c,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Dr(e,t){e&&gr.flushSync(()=>e.dispatchEvent(t))}function Mi(e,t){return f.useReducer((n,r)=>t[n][r]??n,e)}var ot=e=>{const{present:t,children:n}=e,r=Ci(t),s=typeof n=="function"?n({present:r.isPresent}):f.Children.only(n),i=X(r.ref,Si(s));return typeof n=="function"||r.isPresent?f.cloneElement(s,{ref:i}):null};ot.displayName="Presence";function Ci(e){const[t,n]=f.useState(),r=f.useRef(null),s=f.useRef(e),i=f.useRef("none"),a=e?"mounted":"unmounted",[c,m]=Mi(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return f.useEffect(()=>{const l=ut(r.current);i.current=c==="mounted"?l:"none"},[c]),Ce(()=>{const l=r.current,d=s.current;if(d!==e){const p=i.current,x=ut(l);e?m("MOUNT"):x==="none"||l?.display==="none"?m("UNMOUNT"):m(d&&p!==x?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,m]),Ce(()=>{if(t){let l;const d=t.ownerDocument.defaultView??window,u=x=>{const h=ut(r.current).includes(x.animationName);if(x.target===t&&h&&(m("ANIMATION_END"),!s.current)){const v=t.style.animationFillMode;t.style.animationFillMode="forwards",l=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=v)})}},p=x=>{x.target===t&&(i.current=ut(r.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",u),t.addEventListener("animationend",u),()=>{d.clearTimeout(l),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",u),t.removeEventListener("animationend",u)}}else m("ANIMATION_END")},[t,m]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:f.useCallback(l=>{r.current=l?getComputedStyle(l):null,n(l)},[])}}function ut(e){return e?.animationName||"none"}function Si(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Pi=f[" useId ".trim().toString()]||(()=>{}),Ni=0;function on(e){const[t,n]=f.useState(Pi());return Ce(()=>{n(r=>r??String(Ni++))},[e]),e||(t?`radix-${t}`:"")}var Ai=f.createContext(void 0);function _r(e){const t=f.useContext(Ai);return e||t||"ltr"}function ye(e){const t=f.useRef(e);return f.useEffect(()=>{t.current=e}),f.useMemo(()=>(...n)=>t.current?.(...n),[])}function Ti(e,t=globalThis?.document){const n=ye(e);f.useEffect(()=>{const r=s=>{s.key==="Escape"&&n(s)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var ki="DismissableLayer",sn="dismissableLayer.update",Di="dismissableLayer.pointerDownOutside",_i="dismissableLayer.focusOutside",Kn,Ir=f.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Or=f.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:i,onInteractOutside:a,onDismiss:c,...m}=e,l=f.useContext(Ir),[d,u]=f.useState(null),p=d?.ownerDocument??globalThis?.document,[,x]=f.useState({}),y=X(t,M=>u(M)),h=Array.from(l.layers),[v]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),w=h.indexOf(v),j=d?h.indexOf(d):-1,b=l.layersWithOutsidePointerEventsDisabled.size>0,g=j>=w,R=Li(M=>{const S=M.target,F=[...l.branches].some(D=>D.contains(S));!g||F||(s?.(M),a?.(M),M.defaultPrevented||c?.())},p),P=Fi(M=>{const S=M.target;[...l.branches].some(D=>D.contains(S))||(i?.(M),a?.(M),M.defaultPrevented||c?.())},p);return Ti(M=>{j===l.layers.size-1&&(r?.(M),!M.defaultPrevented&&c&&(M.preventDefault(),c()))},p),f.useEffect(()=>{if(d)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(Kn=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(d)),l.layers.add(d),Gn(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=Kn)}},[d,p,n,l]),f.useEffect(()=>()=>{d&&(l.layers.delete(d),l.layersWithOutsidePointerEventsDisabled.delete(d),Gn())},[d,l]),f.useEffect(()=>{const M=()=>x({});return document.addEventListener(sn,M),()=>document.removeEventListener(sn,M)},[]),o.jsxRuntimeExports.jsx(G.div,{...m,ref:y,style:{pointerEvents:b?g?"auto":"none":void 0,...e.style},onFocusCapture:z(e.onFocusCapture,P.onFocusCapture),onBlurCapture:z(e.onBlurCapture,P.onBlurCapture),onPointerDownCapture:z(e.onPointerDownCapture,R.onPointerDownCapture)})});Or.displayName=ki;var Ii="DismissableLayerBranch",Oi=f.forwardRef((e,t)=>{const n=f.useContext(Ir),r=f.useRef(null),s=X(t,r);return f.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),o.jsxRuntimeExports.jsx(G.div,{...e,ref:s})});Oi.displayName=Ii;function Li(e,t=globalThis?.document){const n=ye(e),r=f.useRef(!1),s=f.useRef(()=>{});return f.useEffect(()=>{const i=c=>{if(c.target&&!r.current){let m=function(){Lr(Di,n,l,{discrete:!0})};const l={originalEvent:c};c.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=m,t.addEventListener("click",s.current,{once:!0})):m()}else t.removeEventListener("click",s.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",i),t.removeEventListener("click",s.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Fi(e,t=globalThis?.document){const n=ye(e),r=f.useRef(!1);return f.useEffect(()=>{const s=i=>{i.target&&!r.current&&Lr(_i,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Gn(){const e=new CustomEvent(sn);document.dispatchEvent(e)}function Lr(e,t,n,{discrete:r}){const s=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?Dr(s,i):s.dispatchEvent(i)}var Bt="focusScope.autoFocusOnMount",Vt="focusScope.autoFocusOnUnmount",Yn={bubbles:!1,cancelable:!0},zi="FocusScope",Fr=f.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:i,...a}=e,[c,m]=f.useState(null),l=ye(s),d=ye(i),u=f.useRef(null),p=X(t,h=>m(h)),x=f.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;f.useEffect(()=>{if(r){let h=function(b){if(x.paused||!c)return;const g=b.target;c.contains(g)?u.current=g:Me(u.current,{select:!0})},v=function(b){if(x.paused||!c)return;const g=b.relatedTarget;g!==null&&(c.contains(g)||Me(u.current,{select:!0}))},w=function(b){if(document.activeElement===document.body)for(const R of b)R.removedNodes.length>0&&Me(c)};document.addEventListener("focusin",h),document.addEventListener("focusout",v);const j=new MutationObserver(w);return c&&j.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",h),document.removeEventListener("focusout",v),j.disconnect()}}},[r,c,x.paused]),f.useEffect(()=>{if(c){Xn.add(x);const h=document.activeElement;if(!c.contains(h)){const w=new CustomEvent(Bt,Yn);c.addEventListener(Bt,l),c.dispatchEvent(w),w.defaultPrevented||($i(Wi(zr(c)),{select:!0}),document.activeElement===h&&Me(c))}return()=>{c.removeEventListener(Bt,l),setTimeout(()=>{const w=new CustomEvent(Vt,Yn);c.addEventListener(Vt,d),c.dispatchEvent(w),w.defaultPrevented||Me(h??document.body,{select:!0}),c.removeEventListener(Vt,d),Xn.remove(x)},0)}}},[c,l,d,x]);const y=f.useCallback(h=>{if(!n&&!r||x.paused)return;const v=h.key==="Tab"&&!h.altKey&&!h.ctrlKey&&!h.metaKey,w=document.activeElement;if(v&&w){const j=h.currentTarget,[b,g]=Bi(j);b&&g?!h.shiftKey&&w===g?(h.preventDefault(),n&&Me(b,{select:!0})):h.shiftKey&&w===b&&(h.preventDefault(),n&&Me(g,{select:!0})):w===j&&h.preventDefault()}},[n,r,x.paused]);return o.jsxRuntimeExports.jsx(G.div,{tabIndex:-1,...a,ref:p,onKeyDown:y})});Fr.displayName=zi;function $i(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Me(r,{select:t}),document.activeElement!==n)return}function Bi(e){const t=zr(e),n=qn(t,e),r=qn(t.reverse(),e);return[n,r]}function zr(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function qn(e,t){for(const n of e)if(!Vi(n,{upTo:t}))return n}function Vi(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Hi(e){return e instanceof HTMLInputElement&&"select"in e}function Me(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Hi(e)&&t&&e.select()}}var Xn=Ui();function Ui(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=Qn(e,t),e.unshift(t)},remove(t){e=Qn(e,t),e[0]?.resume()}}}function Qn(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Wi(e){return e.filter(t=>t.tagName!=="A")}var Ki="Portal",$r=f.forwardRef((e,t)=>{const{container:n,...r}=e,[s,i]=f.useState(!1);Ce(()=>i(!0),[]);const a=n||s&&globalThis?.document?.body;return a?_e.createPortal(o.jsxRuntimeExports.jsx(G.div,{...r,ref:t}),a):null});$r.displayName=Ki;var Ht=0;function Gi(){f.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Zn()),document.body.insertAdjacentElement("beforeend",e[1]??Zn()),Ht++,()=>{Ht===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Ht--}},[])}function Zn(){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 fe=function(){return fe=Object.assign||function(t){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},fe.apply(this,arguments)};function Br(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]]);return n}function Yi(e,t,n){if(n||arguments.length===2)for(var r=0,s=t.length,i;r<s;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}var vt="right-scroll-bar-position",gt="width-before-scroll-bar",qi="with-scroll-bars-hidden",Xi="--removed-body-scroll-bar-size";function Ut(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Qi(e,t){var n=E.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var s=n.value;s!==r&&(n.value=r,n.callback(r,s))}}}})[0];return n.callback=t,n.facade}var Zi=typeof window<"u"?f.useLayoutEffect:f.useEffect,Jn=new WeakMap;function Ji(e,t){var n=Qi(null,function(r){return e.forEach(function(s){return Ut(s,r)})});return Zi(function(){var r=Jn.get(n);if(r){var s=new Set(r),i=new Set(e),a=n.current;s.forEach(function(c){i.has(c)||Ut(c,null)}),i.forEach(function(c){s.has(c)||Ut(c,a)})}Jn.set(n,e)},[e]),n}function ea(e){return e}function ta(e,t){t===void 0&&(t=ea);var n=[],r=!1,s={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(i){var a=t(i,r);return n.push(a),function(){n=n.filter(function(c){return c!==a})}},assignSyncMedium:function(i){for(r=!0;n.length;){var a=n;n=[],a.forEach(i)}n={push:function(c){return i(c)},filter:function(){return n}}},assignMedium:function(i){r=!0;var a=[];if(n.length){var c=n;n=[],c.forEach(i),a=n}var m=function(){var d=a;a=[],d.forEach(i)},l=function(){return Promise.resolve().then(m)};l(),n={push:function(d){a.push(d),l()},filter:function(d){return a=a.filter(d),n}}}};return s}function na(e){e===void 0&&(e={});var t=ta(null);return t.options=fe({async:!0,ssr:!1},e),t}var Vr=function(e){var t=e.sideCar,n=Br(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return f.createElement(r,fe({},n))};Vr.isSideCarExport=!0;function ra(e,t){return e.useMedium(t),Vr}var Hr=na(),Wt=function(){},Pt=f.forwardRef(function(e,t){var n=f.useRef(null),r=f.useState({onScrollCapture:Wt,onWheelCapture:Wt,onTouchMoveCapture:Wt}),s=r[0],i=r[1],a=e.forwardProps,c=e.children,m=e.className,l=e.removeScrollBar,d=e.enabled,u=e.shards,p=e.sideCar,x=e.noRelative,y=e.noIsolation,h=e.inert,v=e.allowPinchZoom,w=e.as,j=w===void 0?"div":w,b=e.gapMode,g=Br(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),R=p,P=Ji([n,t]),M=fe(fe({},g),s);return f.createElement(f.Fragment,null,d&&f.createElement(R,{sideCar:Hr,removeScrollBar:l,shards:u,noRelative:x,noIsolation:y,inert:h,setCallbacks:i,allowPinchZoom:!!v,lockRef:n,gapMode:b}),a?f.cloneElement(f.Children.only(c),fe(fe({},M),{ref:P})):f.createElement(j,fe({},M,{className:m,ref:P}),c))});Pt.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Pt.classNames={fullWidth:gt,zeroRight:vt};var oa=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function sa(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=oa();return t&&e.setAttribute("nonce",t),e}function ia(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function aa(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var ca=function(){var e=0,t=null;return{add:function(n){e==0&&(t=sa())&&(ia(t,n),aa(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},la=function(){var e=ca();return function(t,n){f.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Ur=function(){var e=la(),t=function(n){var r=n.styles,s=n.dynamic;return e(r,s),null};return t},ua={left:0,top:0,right:0,gap:0},Kt=function(e){return parseInt(e||"",10)||0},da=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],s=t[e==="padding"?"paddingRight":"marginRight"];return[Kt(n),Kt(r),Kt(s)]},fa=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return ua;var t=da(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])}},ma=Ur(),He="data-scroll-locked",pa=function(e,t,n,r){var s=e.left,i=e.top,a=e.right,c=e.gap;return n===void 0&&(n="margin"),`
72
- .`.concat(qi,` {
73
- overflow: hidden `).concat(r,`;
74
- padding-right: `).concat(c,"px ").concat(r,`;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./rolldown-runtime-mLOUI7ql.cjs"),t=require("./context-Bzd5QCKM.cjs"),n=require("./hooks-DcHzmBwA.cjs"),r=require("./enhanced-components-C-ka-XLp.cjs"),i=require("./minimal-components-CsxQbDp7.cjs"),a=require("./utils-DJaAwiZ9.cjs"),o=require("./performance-monitor-wNFKmqMr.cjs");let s=require("react"),c=e.r(s,1);s=e.r(s);let l=require("react-dom");l=e.r(l,1);let u=require("@radix-ui/react-slider");u=e.r(u,1);let d=require("@radix-ui/react-tooltip");d=e.r(d,1);var f=t.i();function p({children:e,className:t,size:n=`md`,variant:i=`spinner`}){let a={sm:`w-4 h-4`,md:`w-8 h-8`,lg:`w-12 h-12`};return i===`spinner`?(0,f.jsxs)(`div`,{className:r.g(`flex items-center justify-center`,t),children:[(0,f.jsx)(`div`,{className:r.g(`animate-spin rounded-full border-2 border-current border-t-transparent`,a[n])}),e&&(0,f.jsx)(`span`,{className:`ml-2 text-muted-foreground text-sm`,children:e})]}):i===`skeleton`?(0,f.jsx)(`div`,{className:r.g(`animate-pulse rounded bg-muted`,a[n],t)}):(0,f.jsx)(`div`,{className:r.g(`animate-pulse bg-gradient-to-r bg-pos-0 bg-size-200 from-muted via-muted/50 to-muted`,`animate-shimmer rounded`,a[n],t)})}function m({children:e,fallback:t=(0,f.jsx)(p,{}),className:n}){return(0,f.jsx)(`div`,{className:n,children:(0,f.jsx)(c.Suspense,{fallback:t,children:e})})}function h({error:e,resetError:t}){return(0,f.jsxs)(`div`,{className:`flex flex-col items-center justify-center rounded-lg border border-destructive/20 bg-destructive/10 p-6`,children:[(0,f.jsx)(`div`,{className:`mb-2 font-semibold text-destructive text-lg`,children:`Media Player Error`}),(0,f.jsx)(`div`,{className:`mb-4 text-center text-muted-foreground text-sm`,children:e.message}),(0,f.jsx)(`button`,{onClick:t,className:`rounded bg-primary px-4 py-2 text-primary-foreground transition-colors hover:bg-primary/90`,children:`Try Again`})]})}var g=class extends c.default.Component{constructor(e){super(e),t.r(this,`resetError`,()=>{this.setState({hasError:!1,error:null})}),this.state={hasError:!1,error:null}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,t){this.props.onError?.(e,t),console.error(`MediaErrorBoundary caught an error:`,e,t)}render(){return this.state.hasError&&this.state.error?(0,f.jsx)(this.props.fallback||h,{error:this.state.error,resetError:this.resetError}):this.props.children}};function _({children:e,priority:t=`normal`,deferredMs:n=0}){let[r,i]=c.default.useState(n>0),a=c.default.useDeferredValue(e);return c.default.useEffect(()=>{if(n>0){let e=setTimeout(()=>{i(!1)},n);return()=>clearTimeout(e)}},[n]),r?(0,f.jsx)(p,{variant:`skeleton`}):t===`high`?(0,f.jsx)(f.Fragment,{children:e}):t===`low`?(0,f.jsx)(f.Fragment,{children:a}):(0,f.jsx)(c.default.Suspense,{fallback:(0,f.jsx)(p,{}),children:e})}function v(e=100){let[t,n]=c.default.useState(!1),r=c.default.useDeferredValue(t);return c.default.useEffect(()=>{let t=setTimeout(()=>{n(!0)},e);return()=>clearTimeout(t)},[e]),{isReady:r,actualIsReady:t}}function y({children:e,className:t,loadingFallback:n=(0,f.jsx)(p,{}),errorFallback:r,priority:i=`normal`,deferredMs:a=0,onError:o}){return(0,f.jsx)(`div`,{className:t,children:(0,f.jsx)(g,{fallback:r,onError:o,children:(0,f.jsx)(m,{fallback:n,children:(0,f.jsx)(_,{priority:i,deferredMs:a,children:e})})})})}var b=(0,c.forwardRef)(({src:e,className:t,children:i,keyboardControls:a=!0,showControls:o=!0,customControls:s=!1,crossOrigin:l,enablePerformanceMonitoring:u=!0,bufferingStrategy:d=`adaptive`,preloadStrategy:p=`progressive`,enableOptimizations:m=!0,...h},g)=>{let[_]=(0,c.useTransition)(),{state:v,controls:b,mediaRef:x,containerRef:S,performanceMetrics:C,isEnhanced:w}=n.x({src:e,crossOrigin:l,enablePerformanceMonitoring:u,bufferingStrategy:d,preloadStrategy:p,enableTimeUpdateThrottling:!0,timeUpdateThrottleMs:100,enableSeekPreview:!0,...h}),{memoryStats:T,addEventListener:E}=n.v({maxMemoryUsage:50,cleanupInterval:15e3,enableGC:!0,monitorMemory:m});n.y({enabled:a,state:v,controls:b});let D=(0,c.useMemo)(()=>Array.isArray(e)?e.some(e=>/\.(mp4|webm|ogv|mov|avi)$/i.test(e)):/\.(mp4|webm|ogv|mov|avi)$/i.test(e),[e]),O=(0,c.useMemo)(()=>Array.isArray(e)?e.map((e,t)=>(0,f.jsx)(`source`,{src:e},`${e}-${t}`)):null,[e]),k=(0,c.useMemo)(()=>({controls:o&&!s,className:r.g(`w-full transition-all duration-300`,D&&`aspect-video`,`bg-[color:var(--media-bg)] rounded-lg`,v.isTransitioning&&`opacity-90`),preload:p===`eager`?`auto`:`metadata`,crossOrigin:l,...Array.isArray(e)?{}:{src:e}}),[o,s,D,v.isTransitioning,p,l,e]);return(0,f.jsx)(y,{priority:`high`,errorFallback:({error:e,resetError:t})=>(0,f.jsx)(`div`,{className:r.g(`absolute inset-0 flex items-center justify-center`,`glass-strong animate-enter rounded-lg`,`bg-[color:var(--color-error)]/10 backdrop-blur-md`),children:(0,f.jsxs)(`div`,{className:`space-y-2 text-center text-[color:var(--media-text)]`,children:[(0,f.jsx)(`div`,{className:`mx-auto w-fit rounded-full bg-[color:var(--color-error)]/20 p-3`,children:(0,f.jsx)(`svg`,{className:`size-6 text-[color:var(--color-error)]`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,children:(0,f.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z`})})}),(0,f.jsx)(`p`,{className:`font-semibold text-lg`,children:`Playback Error`}),(0,f.jsx)(`p`,{className:`max-w-xs text-[color:var(--media-text-secondary)] text-sm`,children:e.message||v.error}),(0,f.jsx)(`button`,{onClick:t,className:`mt-2 rounded bg-[color:var(--color-brand-primary)] px-4 py-2 text-sm text-white transition-colors hover:bg-[color:var(--color-brand-accent)]`,children:`Try Again`})]})}),loadingFallback:(0,f.jsx)(`div`,{className:r.g(`absolute inset-0 flex items-center justify-center`,`glass animate-enter rounded-lg`,`bg-[color:var(--media-bg)]/20 backdrop-blur-sm`),children:(0,f.jsxs)(`div`,{className:`space-y-4 text-center text-[color:var(--media-text)]`,children:[(0,f.jsxs)(`div`,{className:`relative`,children:[(0,f.jsx)(`div`,{className:r.g(`size-12 animate-spin rounded-full border-2`,`border-[color:var(--color-brand-accent)]/30`,`border-t-[color:var(--color-brand-accent)]`)}),(0,f.jsx)(`div`,{className:r.g(`absolute inset-0 size-12 rounded-full`,`bg-gradient-to-r from-[color:var(--color-brand-primary)] to-[color:var(--color-brand-accent)]`,`animate-pulse opacity-20 blur-sm`)})]}),(0,f.jsx)(`p`,{className:`font-medium text-[color:var(--media-text-secondary)] text-sm`,children:`Loading media...`})]})}),children:(0,f.jsxs)(`div`,{ref:g||S,className:r.g(`media-container relative overflow-hidden contain-strict`,`bg-[color:var(--media-bg)] focus-within:outline-none`,`rounded-xl border border-[color:var(--media-border)]/30`,`shadow-2xl shadow-[color:var(--media-bg)]/50`,`transition-all duration-300 ease-out`,`hover:border-[color:var(--media-border)]/50`,`hover:shadow-3xl hover:shadow-[color:var(--media-bg)]/60`,`will-change-transform`,v.isTransitioning&&`cursor-wait`,t),tabIndex:0,role:`application`,"aria-label":D?`Video player`:`Audio player`,"aria-busy":v.isLoading||v.isBuffering,children:[D?(0,f.jsxs)(`video`,{ref:x,...k,disablePictureInPicture:!1,playsInline:!0,"x-webkit-airplay":`allow`,style:{willChange:`transform`},children:[O,`Your browser does not support the video element.`]}):(0,f.jsxs)(`audio`,{ref:x,...k,preload:p===`eager`?`auto`:`metadata`,children:[O,`Your browser does not support the audio element.`]}),v.error&&(0,f.jsx)(`div`,{className:r.g(`absolute inset-0 flex items-center justify-center`,`glass-strong animate-enter rounded-lg`,`bg-[color:var(--color-error)]/10 backdrop-blur-md`),children:(0,f.jsxs)(`div`,{className:`space-y-2 text-center text-[color:var(--media-text)]`,children:[(0,f.jsx)(`div`,{className:`mx-auto w-fit rounded-full bg-[color:var(--color-error)]/20 p-3`,children:(0,f.jsx)(`svg`,{className:`size-6 text-[color:var(--color-error)]`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,children:(0,f.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z`})})}),(0,f.jsx)(`p`,{className:`font-semibold text-lg`,children:`Playback Error`}),(0,f.jsx)(`p`,{className:`max-w-xs text-[color:var(--media-text-secondary)] text-sm`,children:v.error})]})}),v.isLoading&&(0,f.jsx)(`div`,{className:r.g(`absolute inset-0 flex items-center justify-center`,`glass animate-enter rounded-lg`,`bg-[color:var(--media-bg)]/20 backdrop-blur-sm`),children:(0,f.jsxs)(`div`,{className:`space-y-4 text-center text-[color:var(--media-text)]`,children:[(0,f.jsxs)(`div`,{className:`relative`,children:[(0,f.jsx)(`div`,{className:r.g(`size-12 animate-spin rounded-full border-2`,`border-[color:var(--color-brand-accent)]/30`,`border-t-[color:var(--color-brand-accent)]`)}),(0,f.jsx)(`div`,{className:r.g(`absolute inset-0 size-12 rounded-full`,`bg-gradient-to-r from-[color:var(--color-brand-primary)] to-[color:var(--color-brand-accent)]`,`animate-pulse opacity-20 blur-sm`)})]}),(0,f.jsx)(`p`,{className:`font-medium text-[color:var(--media-text-secondary)] text-sm`,children:v.isBuffering?`Buffering...`:`Loading media...`})]})}),s&&typeof i==`function`&&(0,f.jsx)(`div`,{className:`pointer-events-auto absolute inset-0 z-50`,children:i({state:v,controls:b})}),s&&typeof i!=`function`&&(0,f.jsx)(`div`,{className:`pointer-events-auto absolute inset-0 z-50`,children:i}),process.env.NODE_ENV===`development`&&u&&(0,f.jsxs)(`div`,{className:`absolute bottom-2 left-2 rounded bg-black/50 px-2 py-1 text-white text-xs`,children:[(0,f.jsxs)(`div`,{children:[`FPS: `,C.frameRate||0]}),(0,f.jsxs)(`div`,{children:[`Memory: `,T.usage.toFixed(1),`MB`]}),w&&(0,f.jsx)(`div`,{children:`Enhanced ✓`})]})]})})});b.displayName=`MediaPlayer`;var x=(0,c.forwardRef)(({src:e,poster:t,width:i=`100%`,height:a=`auto`,aspectRatio:o=`16/9`,className:s,children:c,keyboardControls:l=!0,showControls:u=!0,customControls:d=!1,crossOrigin:p,...m},h)=>{let{state:g,controls:_,mediaRef:v,containerRef:y}=n.g({src:e,crossOrigin:p,...m});n.y({enabled:l,state:g,controls:_});let b=()=>Array.isArray(e)?e.map((e,t)=>(0,f.jsx)(`source`,{src:e},t)):null,x={width:i,height:a,aspectRatio:a===`auto`?o:void 0},S={ref:v,controls:u&&!d,poster:t,className:`w-full h-full object-contain bg-black`,...Array.isArray(e)?{}:{src:e}};return(0,f.jsxs)(`div`,{ref:h||y,style:x,className:r.g(`relative overflow-hidden bg-black`,`focus-within:outline-none`,s),tabIndex:0,children:[(0,f.jsxs)(`video`,{...S,children:[Array.isArray(e)&&b(),`Your browser does not support the video element.`]}),g.error&&(0,f.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center bg-black/80`,children:(0,f.jsxs)(`div`,{className:`text-center text-white`,children:[(0,f.jsx)(`p`,{className:`font-semibold text-lg`,children:`Error`}),(0,f.jsx)(`p`,{className:`text-sm opacity-80`,children:g.error})]})}),g.isLoading&&(0,f.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center bg-black/50`,children:(0,f.jsx)(`div`,{className:`text-white`,children:(0,f.jsx)(`div`,{className:`h-8 w-8 animate-spin rounded-full border-white border-b-2`})})}),d&&typeof c==`function`&&(0,f.jsx)(`div`,{className:`pointer-events-none absolute inset-0`,children:(0,f.jsx)(`div`,{className:`pointer-events-auto`,children:c({state:g,controls:_})})}),d&&typeof c!=`function`&&c]})});x.displayName=`VideoPlayer`;var S=(0,c.forwardRef)(({src:e,className:t,children:i,keyboardControls:a=!0,showControls:o=!0,customControls:s=!1,...c},l)=>{let{state:u,controls:d,mediaRef:p,containerRef:m}=n.g({src:e,...c});n.y({enabled:a,state:u,controls:d});let h=()=>Array.isArray(e)?e.map((e,t)=>(0,f.jsx)(`source`,{src:e},t)):null,g={ref:p,controls:o&&!s,className:`w-full`,...Array.isArray(e)?{}:{src:e}};return(0,f.jsxs)(`div`,{ref:l||m,className:r.g(`relative`,`focus-within:outline-none`,t),tabIndex:0,children:[(0,f.jsxs)(`audio`,{...g,children:[Array.isArray(e)&&h(),`Your browser does not support the audio element.`]}),u.error&&(0,f.jsx)(`div`,{className:`mt-2 rounded-md border border-red-300 bg-red-100 p-3`,children:(0,f.jsxs)(`div`,{className:`text-red-800`,children:[(0,f.jsx)(`p`,{className:`font-semibold`,children:`Error`}),(0,f.jsx)(`p`,{className:`text-sm`,children:u.error})]})}),u.isLoading&&(0,f.jsx)(`div`,{className:`mt-2 rounded-md border border-gray-300 bg-gray-100 p-3`,children:(0,f.jsxs)(`div`,{className:`flex items-center space-x-2 text-gray-600`,children:[(0,f.jsx)(`div`,{className:`h-4 w-4 animate-spin rounded-full border-gray-600 border-b-2`}),(0,f.jsx)(`span`,{className:`text-sm`,children:`Loading...`})]})}),s&&typeof i==`function`&&(0,f.jsx)(`div`,{className:`mt-2`,children:i({state:u,controls:d})}),s&&typeof i!=`function`&&(0,f.jsx)(`div`,{className:`mt-2`,children:i})]})});S.displayName=`AudioPlayer`;var C=null,w=null;async function T(){if(!C){let[e,t]=await Promise.all([import(`video.js`),import(`hls.js`)]);C=e.default,w=t.default,await Promise.all([import(`@videojs/http-streaming`),import(`videojs-contrib-quality-levels`),import(`videojs-hls-quality-selector`)])}return{videojs:C,Hls:w}}function E({sources:e,poster:n,textTracks:i=[],autoplay:a=!1,muted:o=!1,controls:s=!1,preload:l=`metadata`,fluid:u=!0,responsive:d=!0,playbackRates:p=[.5,.75,1,1.25,1.5,2],className:m,onReady:h,onError:g,hlsConfig:_={},enableQualitySelector:v=!0,enableSubtitles:y=!0}){let b=(0,c.useRef)(null),x=(0,c.useRef)(null),S=(0,c.useRef)(null),[C,w]=(0,c.useState)(!0),[E,D]=(0,c.useState)(null),O=t.l(),k=t.u(),A=async()=>{if(!(!b.current||x.current))try{w(!0);let{videojs:r,Hls:c}=await T(),f=e.some(e=>e.type===`application/x-mpegURL`)&&!b.current.canPlayType(`application/vnd.apple.mpegurl`),m={autoplay:a,muted:o,controls:s,preload:l,fluid:u,responsive:d,playbackRates:p,sources:f?[]:e,poster:n,html5:{vhs:{overrideNative:!b.current.canPlayType(`application/vnd.apple.mpegurl`),enableLowInitialPlaylist:!0,fastQualityChange:!0,handleManifestRedirects:!0}}},y=r(b.current,m,function(){console.log(`Video.js player ready`)});if(x.current=y,i.forEach(e=>{y.addRemoteTextTrack({kind:e.kind,src:e.src,srclang:e.srclang,label:e.label,default:e.default},!1)}),f){let n=e.find(e=>e.type===`application/x-mpegURL`);if(n){let e=new c({debug:!1,enableWorker:!0,lowLatencyMode:!1,backBufferLength:30,maxBufferLength:30,maxMaxBufferLength:600,maxBufferSize:60*1e3*1e3,maxBufferHole:.1,highBufferWatchdogPeriod:2,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,capLevelToPlayerSize:!0,capLevelOnFPSDrop:!0,renderTextTracksNatively:!1,subtitlePreference:{lang:navigator.language.split(`-`)[0],forced:!1},..._});S.current=e,e.loadSource(n.src),e.attachMedia(b.current),e.on(c.Events.MANIFEST_PARSED,()=>{if(console.log(`HLS manifest parsed`,{levels:e.levels.map(e=>({height:e.height,bitrate:e.bitrate,codec:e.codecSet}))}),v&&y.qualityLevels){let t=y.qualityLevels();e.levels.forEach((e,n)=>{t.addQualityLevel({id:n.toString(),label:`${e.height}p`,width:e.width,height:e.height,bitrate:e.bitrate,enabled:!0})})}}),e.on(c.Events.LEVEL_SWITCHED,(e,n)=>{console.log(`HLS quality switched to level ${n.level}`),k({type:t.a.SET_QUALITY_LEVEL,detail:n.level})}),e.on(c.Events.ERROR,(t,n)=>{if(n.fatal)switch(n.type){case c.ErrorTypes.NETWORK_ERROR:console.error(`Fatal network error encountered, try to recover`),e.startLoad();break;case c.ErrorTypes.MEDIA_ERROR:console.error(`Fatal media error encountered, try to recover`),e.recoverMediaError();break;default:console.error(`Fatal error, cannot recover`),D(`Streaming error occurred`),g?.(n),e.destroy();break}}),e.on(c.Events.FRAG_LOADED,()=>{let n=e.bandwidthEstimate;n&&k({type:t.a.SET_BANDWIDTH_ESTIMATE,detail:n})})}}v&&y.qualityLevels&&y.hlsQualitySelector({displayCurrentQuality:!0}),y.on(`play`,()=>{k({type:t.a.PLAY})}),y.on(`pause`,()=>{k({type:t.a.PAUSE})}),y.on(`timeupdate`,()=>{k({type:t.a.SET_CURRENT_TIME,detail:y.currentTime()||0})}),y.on(`durationchange`,()=>{k({type:t.a.SET_DURATION,detail:y.duration()||0})}),y.on(`volumechange`,()=>{k({type:t.a.SET_VOLUME,detail:y.volume()||0}),k({type:y.muted()?t.a.MUTE:t.a.UNMUTE})}),y.on(`ended`,()=>{k({type:t.a.PAUSE})}),y.on(`error`,e=>{let n=y.error();D(n?.message||`An error occurred`),k({type:t.a.SET_ERROR,detail:n?.message||`Playback error`}),g?.(n)}),y.on(`loadstart`,()=>{k({type:t.a.SET_LOADING,detail:!0})}),y.on(`loadeddata`,()=>{w(!1),k({type:t.a.SET_LOADING,detail:!1})}),y.on(`waiting`,()=>{k({type:t.a.SET_BUFFERING,detail:!0})}),y.on(`playing`,()=>{k({type:t.a.SET_BUFFERING,detail:!1})}),y.on(`texttrackchange`,()=>{let e=y.textTracks(),n=[];if(e&&e.length)for(let t=0;t<e.length;t++){let r=e[t];r.mode===`showing`&&n.push({id:r.id,label:r.label,language:r.language,kind:r.kind})}k({type:t.a.SET_ACTIVE_TEXT_TRACKS,detail:n})}),O.mediaRef&&(O.mediaRef.current=b.current),h?.(y),w(!1)}catch(e){console.error(`Failed to initialize Video.js player:`,e),D(`Failed to initialize player`),w(!1),g?.(e)}};return(0,c.useEffect)(()=>(A(),()=>{S.current&&(S.current.destroy(),S.current=null),x.current&&(x.current.dispose(),x.current=null)}),[A]),(0,c.useEffect)(()=>{!x.current||!O.mediaRef||b.current&&Object.assign(b.current,{play:()=>x.current?.play(),pause:()=>x.current?.pause(),seekTo:e=>{x.current&&x.current.currentTime(e)},setVolume:e=>{x.current&&x.current.volume(e)},setMuted:e=>{x.current&&x.current.muted(e)},setQualityLevel:e=>{S.current&&(S.current.currentLevel=e)},getQualityLevels:()=>S.current?S.current.levels:[],getCurrentQualityLevel:()=>S.current?S.current.currentLevel:-1,getBandwidthEstimate:()=>S.current?S.current.bandwidthEstimate:0})},[O.mediaRef]),(0,f.jsxs)(`div`,{className:r.g(`relative h-full w-full`,m),children:[(0,f.jsx)(`video`,{ref:b,className:`video-js vjs-default-skin vjs-big-play-centered h-full w-full`,playsInline:!0}),C&&(0,f.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center bg-black/50`,children:(0,f.jsx)(`div`,{className:`text-white`,children:(0,f.jsx)(`div`,{className:`h-8 w-8 animate-spin rounded-full border-white border-b-2`})})}),E&&(0,f.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center bg-black/80`,children:(0,f.jsxs)(`div`,{className:`text-center text-white`,children:[(0,f.jsx)(`p`,{className:`font-semibold text-lg`,children:`Error`}),(0,f.jsx)(`p`,{className:`text-sm opacity-80`,children:E})]})})]})}E.displayName=`VideoJSAdapter`;var D=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,O=r.v,k=(e,t)=>n=>{if(t?.variants==null)return O(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=D(t)||D(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return O(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)};function A(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function j(...e){return t=>{let n=!1,r=e.map(e=>{let r=A(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():A(e[t],null)}}}}function M(...e){return c.useCallback(j(...e),e)}function N(e){let t=c.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];ae(r)&&typeof le==`function`&&(r=le(r._payload)),c.Children.forEach(r,e=>{if(re(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;ae(n)&&typeof le==`function`&&(n=le(n._payload)),a=te(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=c.cloneElement(a,void 0,s):!o&&c.Children.count(r)===1&&c.isValidElement(r)&&(a=r);let l=a?ne(a):void 0,u=M(n,l);if(!a){if(r||r===0)throw Error(o?ce(e):se(e));return r}let d=F(i,a.props??{});return a.type!==c.Fragment&&(d.ref=n?u:l),c.cloneElement(a,d)});return t.displayName=`${e}.Slot`,t}var P=N(`Slot`),ee=Symbol.for(`radix.slottable`),te=(e,t)=>{if(`child`in e.props){let t=e.props.child;return c.isValidElement(t)?c.cloneElement(t,void 0,e.props.children(t.props.children)):null}return c.isValidElement(t)?t:null};function F(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function ne(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function re(e){return c.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===ee}var ie=Symbol.for(`react.lazy`);function ae(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===ie&&`_payload`in e&&oe(e._payload)}function oe(e){return typeof e==`object`&&!!e&&`then`in e}var se=e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,ce=e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,le=c.use,I=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=N(`Primitive.${t}`),r=c.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,f.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function L(e,t){e&&l.flushSync(()=>e.dispatchEvent(t))}function R(e,t=[]){let n=[];function r(t,r){let i=c.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,l=c.useMemo(()=>o,Object.values(o));return(0,f.jsx)(s.Provider,{value:l,children:r})};o.displayName=t+`Provider`;function s(n,o,s={}){let{optional:l=!1}=s,u=c.useContext(o?.[e]?.[a]||i);if(u)return u;if(r!==void 0)return r;if(!l)throw Error(`\`${n}\` must be used within \`${t}\``)}return[o,s]}let i=()=>{let t=n.map(e=>c.createContext(e));return function(n){let r=n?.[e]||t;return c.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,ue(i,...t)]}function ue(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return c.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}function de(e){let t=e+`CollectionProvider`,[n,r]=R(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=e=>{let{scope:t,children:n}=e,r=c.useRef(null),a=c.useRef(new Map).current;return(0,f.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})};o.displayName=t;let s=e+`CollectionSlot`,l=N(s),u=c.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=M(t,a(s,n).collectionRef);return(0,f.jsx)(l,{ref:i,children:r})});u.displayName=s;let d=e+`CollectionItemSlot`,p=`data-radix-collection-item`,m=N(d),h=c.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=c.useRef(null),s=M(t,o),l=a(d,n);return c.useEffect(()=>(l.itemMap.set(o,{ref:o,...i}),()=>void l.itemMap.delete(o))),(0,f.jsx)(m,{[p]:``,ref:s,children:r})});h.displayName=d;function g(t){let n=a(e+`CollectionConsumer`,t);return c.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${p}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return[{Provider:o,Slot:u,ItemSlot:h},g,r]}function z(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)}}var B=globalThis?.document?c.useLayoutEffect:()=>{},fe=c.useInsertionEffect||B;function pe({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,o]=me({defaultProp:t,onChange:n}),s=e!==void 0,l=s?e:i;{let t=c.useRef(e!==void 0);c.useEffect(()=>{let e=t.current;e!==s&&console.warn(`${r} is changing from ${e?`controlled`:`uncontrolled`} to ${s?`controlled`:`uncontrolled`}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),t.current=s},[s,r])}return[l,c.useCallback(t=>{if(s){let n=he(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}function me({defaultProp:e,onChange:t}){let[n,r]=c.useState(e),i=c.useRef(n),a=c.useRef(t);return fe(()=>{a.current=t},[t]),c.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function he(e){return typeof e==`function`}function ge(e,t){return c.useReducer((e,n)=>t[e][n]??e,e)}var _e=e=>{let{present:t,children:n}=e,r=ve(t),i=typeof n==`function`?n({present:r.isPresent}):c.Children.only(n),a=be(r.ref,Se(i));return typeof n==`function`||r.isPresent?c.cloneElement(i,{ref:a}):null};_e.displayName=`Presence`;function ve(e){let[t,n]=c.useState(),r=c.useRef(null),i=c.useRef(e),a=c.useRef(`none`),o=c.useRef(void 0),[s,l]=ge(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return c.useEffect(()=>{s===`mounted`?(a.current=o.current??xe(r.current),o.current=void 0):a.current=`none`},[s]),B(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=xe(t);e?(o.current=s,l(`MOUNT`)):l(s===`none`||t?.display===`none`?`UNMOUNT`:n&&r!==s?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,l]),B(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=a=>{let o=xe(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(l(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},s=e=>{e.target===t&&(a.current=xe(r.current))};return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}else l(`ANIMATION_END`)},[t,l]),{isPresent:[`mounted`,`unmountSuspended`].includes(s),ref:c.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=xe(t)}else r.current=null;n(e)},[])}}function ye(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function be(...e){let t=c.useRef(e);return t.current=e,c.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=ye(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():ye(n[e],null)}}},[])}function xe(e){return e?.animationName||`none`}function Se(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Ce=c.useId||(()=>void 0),we=0;function Te(e){let[t,n]=c.useState(Ce());return B(()=>{e||n(e=>e??String(we++))},[e]),e||(t?`radix-${t}`:``)}var Ee=c.createContext(void 0);function De(e){let t=c.useContext(Ee);return e||t||`ltr`}function V(e){let t=c.useRef(e);return c.useEffect(()=>{t.current=e}),c.useMemo(()=>((...e)=>t.current?.(...e)),[])}var Oe=`DismissableLayer`,ke=`dismissableLayer.update`,Ae=`dismissableLayer.pointerDownOutside`,je=`dismissableLayer.focusOutside`,Me,Ne=c.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Pe=c.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:l,...u}=e,d=c.useContext(Ne),[p,m]=c.useState(null),h=p?.ownerDocument??globalThis?.document,[,g]=c.useState({}),_=M(t,m),v=Array.from(d.layers),[y]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),b=y?v.indexOf(y):-1,x=p?v.indexOf(p):-1,S=d.layersWithOutsidePointerEventsDisabled.size>0,C=x>=b,w=c.useRef(!1),T=Re(e=>{a?.(e),s?.(e),e.defaultPrevented||l?.()},{ownerDocument:h,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:w,dismissableSurfaces:d.dismissableSurfaces,shouldHandlePointerDownOutside:c.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...d.branches].some(t=>t.contains(e));return C&&!t},[d.branches,C])}),E=ze(e=>{if(r&&w.current)return;let t=e.target;[...d.branches].some(e=>e.contains(t))||(o?.(e),s?.(e),e.defaultPrevented||l?.())},h),D=p?x===v.length-1:!1,O=V(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&l&&(e.preventDefault(),l()))});return c.useEffect(()=>{if(D)return h.addEventListener(`keydown`,O,{capture:!0}),()=>h.removeEventListener(`keydown`,O,{capture:!0})},[h,D,O]),c.useEffect(()=>{if(p)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(Me=h.body.style.pointerEvents,h.body.style.pointerEvents=`none`),d.layersWithOutsidePointerEventsDisabled.add(p)),d.layers.add(p),Be(),()=>{n&&(d.layersWithOutsidePointerEventsDisabled.delete(p),d.layersWithOutsidePointerEventsDisabled.size===0&&(h.body.style.pointerEvents=Me))}},[p,h,n,d]),c.useEffect(()=>()=>{p&&(d.layers.delete(p),d.layersWithOutsidePointerEventsDisabled.delete(p),Be())},[p,d]),c.useEffect(()=>{let e=()=>g({});return document.addEventListener(ke,e),()=>document.removeEventListener(ke,e)},[]),(0,f.jsx)(I.div,{...u,ref:_,style:{pointerEvents:S?C?`auto`:`none`:void 0,...e.style},onFocusCapture:z(e.onFocusCapture,E.onFocusCapture),onBlurCapture:z(e.onBlurCapture,E.onBlurCapture),onPointerDownCapture:z(e.onPointerDownCapture,T.onPointerDownCapture)})});Pe.displayName=Oe;var Fe=`DismissableLayerBranch`,Ie=c.forwardRef((e,t)=>{let n=c.useContext(Ne),r=c.useRef(null),i=M(t,r);return c.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,f.jsx)(I.div,{...e,ref:i})});Ie.displayName=Fe;var Le=()=>!0;function Re(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=Le}=t,s=V(e),l=c.useRef(!1),u=c.useRef(!1),d=c.useRef(new Map),f=c.useRef(()=>{});return c.useEffect(()=>{function e(){u.current=!1,i.current=!1,d.current.clear()}function t(){return Array.from(d.current.values()).some(Boolean)}function c(e){if(!u.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||d.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{u.current&&f.current()},0)}function p(e){u.current&&d.current.set(e.type,!1)}let m=a=>{if(a.target&&!l.current){let c=function(){n.removeEventListener(`click`,f.current);let r=t();e(),r||Ve(Ae,s,p,{discrete:!0})};if(!o(a.target)){n.removeEventListener(`click`,f.current),e(),l.current=!1;return}let p={originalEvent:a};u.current=!0,i.current=r&&a.button===0,d.current.clear(),!r||a.button!==0?c():(n.removeEventListener(`click`,f.current),f.current=c,n.addEventListener(`click`,f.current,{once:!0}))}else n.removeEventListener(`click`,f.current),e();l.current=!1},h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,c,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`click`,f.current);for(let e of h)n.removeEventListener(e,c,!0),n.removeEventListener(e,p)}},[n,s,r,i,a,o]),{onPointerDownCapture:()=>l.current=!0}}function ze(e,t=globalThis?.document){let n=V(e),r=c.useRef(!1);return c.useEffect(()=>{let e=e=>{e.target&&!r.current&&Ve(je,n,{originalEvent:e},{discrete:!1})};return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Be(){let e=new CustomEvent(ke);document.dispatchEvent(e)}function Ve(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?L(i,a):i.dispatchEvent(a)}var He=`focusScope.autoFocusOnMount`,Ue=`focusScope.autoFocusOnUnmount`,We={bubbles:!1,cancelable:!0},Ge=`FocusScope`,Ke=c.forwardRef((e,t)=>{let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,l]=c.useState(null),u=V(i),d=V(a),p=c.useRef(null),m=M(t,l),h=c.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;c.useEffect(()=>{if(r){let e=function(e){if(h.paused||!s)return;let t=e.target;s.contains(t)?p.current=t:$e(p.current,{select:!0})},t=function(e){if(h.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||$e(p.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&$e(s)};document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,h.paused]),c.useEffect(()=>{if(s){et.add(h);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(He,We);s.addEventListener(He,u),s.dispatchEvent(t),t.defaultPrevented||(qe(rt(Ye(s)),{select:!0}),document.activeElement===e&&$e(s))}return()=>{s.removeEventListener(He,u),setTimeout(()=>{let t=new CustomEvent(Ue,We);s.addEventListener(Ue,d),s.dispatchEvent(t),t.defaultPrevented||$e(e??document.body,{select:!0}),s.removeEventListener(Ue,d),et.remove(h)},0)}}},[s,u,d,h]);let g=c.useCallback(e=>{if(!n&&!r||h.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=Je(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&$e(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&$e(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,h.paused]);return(0,f.jsx)(I.div,{tabIndex:-1,...o,ref:m,onKeyDown:g})});Ke.displayName=Ge;function qe(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if($e(r,{select:t}),document.activeElement!==n)return}function Je(e){let t=Ye(e);return[Xe(t,e),Xe(t.reverse(),e)]}function Ye(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>e.disabled||e.hidden||e.tagName===`INPUT`&&e.type===`hidden`?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;n.nextNode();)t.push(n.currentNode);return t}function Xe(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):Ze(r,{upTo:t})))return r}function Ze(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}function Qe(e){return e instanceof HTMLInputElement&&`select`in e}function $e(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Qe(e)&&t&&e.select()}}var et=tt();function tt(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=nt(e,t),e.unshift(t)},remove(t){e=nt(e,t),e[0]?.resume()}}}function nt(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function rt(e){return e.filter(e=>e.tagName!==`A`)}var it=`Portal`,at=c.forwardRef((e,t)=>{let{container:n,...r}=e,[i,a]=c.useState(!1);B(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?l.createPortal((0,f.jsx)(I.div,{...r,ref:t}),o):null});at.displayName=it;var ot=0,st=null;function ct(){c.useEffect(()=>{st||(st={start:lt(),end:lt()});let{start:e,end:t}=st;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),ot++,()=>{ot===1&&(st?.start.remove(),st?.end.remove(),st=null),ot=Math.max(0,ot-1)}},[])}function lt(){let 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 H=function(){return H=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},H.apply(this,arguments)};function ut(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function dt(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||(a=Array.prototype.slice.call(t,0,r)),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var ft=`right-scroll-bar-position`,pt=`width-before-scroll-bar`,mt=`with-scroll-bars-hidden`,ht=`--removed-body-scroll-bar-size`;function gt(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function _t(e,t){var n=(0,s.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var vt=typeof window<`u`?s.useLayoutEffect:s.useEffect,yt=new WeakMap;function bt(e,t){var n=_t(t||null,function(t){return e.forEach(function(e){return gt(e,t)})});return vt(function(){var t=yt.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||gt(e,null)}),i.forEach(function(e){r.has(e)||gt(e,a)})}yt.set(n,e)},[e]),n}function xt(e){return e}function St(e,t){t===void 0&&(t=xt);var n=[],r=!1;return{read:function(){if(r)throw 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 i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},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 i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function Ct(e){e===void 0&&(e={});var t=St(null);return t.options=H({async:!0,ssr:!1},e),t}var wt=function(e){var t=e.sideCar,n=ut(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return s.createElement(r,H({},n))};wt.isSideCarExport=!0;function Tt(e,t){return e.useMedium(t),wt}var Et=Ct(),Dt=function(){},Ot=s.forwardRef(function(e,t){var n=s.useRef(null),r=s.useState({onScrollCapture:Dt,onWheelCapture:Dt,onTouchMoveCapture:Dt}),i=r[0],a=r[1],o=e.forwardProps,c=e.children,l=e.className,u=e.removeScrollBar,d=e.enabled,f=e.shards,p=e.sideCar,m=e.noRelative,h=e.noIsolation,g=e.inert,_=e.allowPinchZoom,v=e.as,y=v===void 0?`div`:v,b=e.gapMode,x=ut(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=p,C=bt([n,t]),w=H(H({},x),i);return s.createElement(s.Fragment,null,d&&s.createElement(S,{sideCar:Et,removeScrollBar:u,shards:f,noRelative:m,noIsolation:h,inert:g,setCallbacks:a,allowPinchZoom:!!_,lockRef:n,gapMode:b}),o?s.cloneElement(s.Children.only(c),H(H({},w),{ref:C})):s.createElement(y,H({},w,{className:l,ref:C}),c))});Ot.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Ot.classNames={fullWidth:pt,zeroRight:ft};var kt,At=function(){if(kt)return kt;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function jt(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=At();return t&&e.setAttribute(`nonce`,t),e}function Mt(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Nt(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var Pt=function(){var e=0,t=null;return{add:function(n){e==0&&(t=jt())&&(Mt(t,n),Nt(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Ft=function(){var e=Pt();return function(t,n){s.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},It=function(){var e=Ft();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},Lt={left:0,top:0,right:0,gap:0},Rt=function(e){return parseInt(e||``,10)||0},zt=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[Rt(n),Rt(r),Rt(i)]},Bt=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return Lt;var t=zt(e);return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,window.innerWidth-document.documentElement.clientWidth+t[2]-t[0])}},Vt=It(),Ht=`data-scroll-locked`,Ut=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
2
+ .${mt} {
3
+ overflow: hidden ${r};
4
+ padding-right: ${s}px ${r};
75
5
  }
76
- body[`).concat(He,`] {
77
- overflow: hidden `).concat(r,`;
6
+ body[${Ht}] {
7
+ overflow: hidden ${r};
78
8
  overscroll-behavior: contain;
79
- `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
80
- padding-left: `.concat(s,`px;
81
- padding-top: `).concat(i,`px;
82
- padding-right: `).concat(a,`px;
9
+ ${[t&&`position: relative ${r};`,n===`margin`&&`
10
+ padding-left: ${i}px;
11
+ padding-top: ${a}px;
12
+ padding-right: ${o}px;
83
13
  margin-left:0;
84
14
  margin-top:0;
85
- margin-right: `).concat(c,"px ").concat(r,`;
86
- `),n==="padding"&&"padding-right: ".concat(c,"px ").concat(r,";")].filter(Boolean).join(""),`
15
+ margin-right: ${s}px ${r};
16
+ `,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
87
17
  }
88
18
 
89
- .`).concat(vt,` {
90
- right: `).concat(c,"px ").concat(r,`;
19
+ .${ft} {
20
+ right: ${s}px ${r};
91
21
  }
92
22
 
93
- .`).concat(gt,` {
94
- margin-right: `).concat(c,"px ").concat(r,`;
23
+ .${pt} {
24
+ margin-right: ${s}px ${r};
95
25
  }
96
26
 
97
- .`).concat(vt," .").concat(vt,` {
98
- right: 0 `).concat(r,`;
27
+ .${ft} .${ft} {
28
+ right: 0 ${r};
99
29
  }
100
30
 
101
- .`).concat(gt," .").concat(gt,` {
102
- margin-right: 0 `).concat(r,`;
31
+ .${pt} .${pt} {
32
+ margin-right: 0 ${r};
103
33
  }
104
34
 
105
- body[`).concat(He,`] {
106
- `).concat(Xi,": ").concat(c,`px;
35
+ body[${Ht}] {
36
+ ${ht}: ${s}px;
107
37
  }
108
- `)},er=function(){var e=parseInt(document.body.getAttribute(He)||"0",10);return isFinite(e)?e:0},xa=function(){f.useEffect(function(){return document.body.setAttribute(He,(er()+1).toString()),function(){var e=er()-1;e<=0?document.body.removeAttribute(He):document.body.setAttribute(He,e.toString())}},[])},ha=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,s=r===void 0?"margin":r;xa();var i=f.useMemo(function(){return fa(s)},[s]);return f.createElement(ma,{styles:pa(i,!t,s,n?"":"!important")})},an=!1;if(typeof window<"u")try{var dt=Object.defineProperty({},"passive",{get:function(){return an=!0,!0}});window.addEventListener("test",dt,dt),window.removeEventListener("test",dt,dt)}catch{an=!1}var $e=an?{passive:!1}:!1,va=function(e){return e.tagName==="TEXTAREA"},Wr=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!va(e)&&n[t]==="visible")},ga=function(e){return Wr(e,"overflowY")},ya=function(e){return Wr(e,"overflowX")},tr=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=Kr(e,r);if(s){var i=Gr(e,r),a=i[1],c=i[2];if(a>c)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},ba=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Ea=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},Kr=function(e,t){return e==="v"?ga(t):ya(t)},Gr=function(e,t){return e==="v"?ba(t):Ea(t)},wa=function(e,t){return e==="h"&&t==="rtl"?-1:1},ja=function(e,t,n,r,s){var i=wa(e,window.getComputedStyle(t).direction),a=i*r,c=n.target,m=t.contains(c),l=!1,d=a>0,u=0,p=0;do{if(!c)break;var x=Gr(e,c),y=x[0],h=x[1],v=x[2],w=h-v-i*y;(y||w)&&Kr(e,c)&&(u+=w,p+=y);var j=c.parentNode;c=j&&j.nodeType===Node.DOCUMENT_FRAGMENT_NODE?j.host:j}while(!m&&c!==document.body||m&&(t.contains(c)||t===c));return(d&&Math.abs(u)<1||!d&&Math.abs(p)<1)&&(l=!0),l},ft=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},nr=function(e){return[e.deltaX,e.deltaY]},rr=function(e){return e&&"current"in e?e.current:e},Ra=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Ma=function(e){return`
109
- .block-interactivity-`.concat(e,` {pointer-events: none;}
110
- .allow-interactivity-`).concat(e,` {pointer-events: all;}
111
- `)},Ca=0,Be=[];function Sa(e){var t=f.useRef([]),n=f.useRef([0,0]),r=f.useRef(),s=f.useState(Ca++)[0],i=f.useState(Ur)[0],a=f.useRef(e);f.useEffect(function(){a.current=e},[e]),f.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var h=Yi([e.lockRef.current],(e.shards||[]).map(rr),!0).filter(Boolean);return h.forEach(function(v){return v.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),h.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var c=f.useCallback(function(h,v){if("touches"in h&&h.touches.length===2||h.type==="wheel"&&h.ctrlKey)return!a.current.allowPinchZoom;var w=ft(h),j=n.current,b="deltaX"in h?h.deltaX:j[0]-w[0],g="deltaY"in h?h.deltaY:j[1]-w[1],R,P=h.target,M=Math.abs(b)>Math.abs(g)?"h":"v";if("touches"in h&&M==="h"&&P.type==="range")return!1;var S=tr(M,P);if(!S)return!0;if(S?R=M:(R=M==="v"?"h":"v",S=tr(M,P)),!S)return!1;if(!r.current&&"changedTouches"in h&&(b||g)&&(r.current=R),!R)return!0;var F=r.current||R;return ja(F,v,h,F==="h"?b:g)},[]),m=f.useCallback(function(h){var v=h;if(!(!Be.length||Be[Be.length-1]!==i)){var w="deltaY"in v?nr(v):ft(v),j=t.current.filter(function(R){return R.name===v.type&&(R.target===v.target||v.target===R.shadowParent)&&Ra(R.delta,w)})[0];if(j&&j.should){v.cancelable&&v.preventDefault();return}if(!j){var b=(a.current.shards||[]).map(rr).filter(Boolean).filter(function(R){return R.contains(v.target)}),g=b.length>0?c(v,b[0]):!a.current.noIsolation;g&&v.cancelable&&v.preventDefault()}}},[]),l=f.useCallback(function(h,v,w,j){var b={name:h,delta:v,target:w,should:j,shadowParent:Pa(w)};t.current.push(b),setTimeout(function(){t.current=t.current.filter(function(g){return g!==b})},1)},[]),d=f.useCallback(function(h){n.current=ft(h),r.current=void 0},[]),u=f.useCallback(function(h){l(h.type,nr(h),h.target,c(h,e.lockRef.current))},[]),p=f.useCallback(function(h){l(h.type,ft(h),h.target,c(h,e.lockRef.current))},[]);f.useEffect(function(){return Be.push(i),e.setCallbacks({onScrollCapture:u,onWheelCapture:u,onTouchMoveCapture:p}),document.addEventListener("wheel",m,$e),document.addEventListener("touchmove",m,$e),document.addEventListener("touchstart",d,$e),function(){Be=Be.filter(function(h){return h!==i}),document.removeEventListener("wheel",m,$e),document.removeEventListener("touchmove",m,$e),document.removeEventListener("touchstart",d,$e)}},[]);var x=e.removeScrollBar,y=e.inert;return f.createElement(f.Fragment,null,y?f.createElement(i,{styles:Ma(s)}):null,x?f.createElement(ha,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Pa(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Na=ra(Hr,Sa);var Yr=f.forwardRef(function(e,t){return f.createElement(Pt,fe({},e,{ref:t,sideCar:Na}))});Yr.classNames=Pt.classNames;var Aa=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Ve=new WeakMap,mt=new WeakMap,pt={},Gt=0,qr=function(e){return e&&(e.host||qr(e.parentNode))},Ta=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=qr(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},ka=function(e,t,n,r){var s=Ta(t,Array.isArray(e)?e:[e]);pt[n]||(pt[n]=new WeakMap);var i=pt[n],a=[],c=new Set,m=new Set(s),l=function(u){!u||c.has(u)||(c.add(u),l(u.parentNode))};s.forEach(l);var d=function(u){!u||m.has(u)||Array.prototype.forEach.call(u.children,function(p){if(c.has(p))d(p);else try{var x=p.getAttribute(r),y=x!==null&&x!=="false",h=(Ve.get(p)||0)+1,v=(i.get(p)||0)+1;Ve.set(p,h),i.set(p,v),a.push(p),h===1&&y&&mt.set(p,!0),v===1&&p.setAttribute(n,"true"),y||p.setAttribute(r,"true")}catch(w){console.error("aria-hidden: cannot operate on ",p,w)}})};return d(t),c.clear(),Gt++,function(){a.forEach(function(u){var p=Ve.get(u)-1,x=i.get(u)-1;Ve.set(u,p),i.set(u,x),p||(mt.has(u)||u.removeAttribute(r),mt.delete(u)),x||u.removeAttribute(n)}),Gt--,Gt||(Ve=new WeakMap,Ve=new WeakMap,mt=new WeakMap,pt={})}},Da=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),s=Aa(e);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live], script"))),ka(r,s,n,"aria-hidden")):function(){return null}};function _a(e){const[t,n]=f.useState(void 0);return Ce(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const i=s[0];let a,c;if("borderBoxSize"in i){const m=i.borderBoxSize,l=Array.isArray(m)?m[0]:m;a=l.inlineSize,c=l.blockSize}else a=e.offsetWidth,c=e.offsetHeight;n({width:a,height:c})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}const Ia=["top","right","bottom","left"],Se=Math.min,Q=Math.max,bt=Math.round,xt=Math.floor,pe=e=>({x:e,y:e}),Oa={left:"right",right:"left",bottom:"top",top:"bottom"},La={start:"end",end:"start"};function cn(e,t,n){return Q(e,Se(t,n))}function be(e,t){return typeof e=="function"?e(t):e}function Ee(e){return e.split("-")[0]}function Ke(e){return e.split("-")[1]}function mn(e){return e==="x"?"y":"x"}function pn(e){return e==="y"?"height":"width"}function me(e){return["top","bottom"].includes(Ee(e))?"y":"x"}function xn(e){return mn(me(e))}function Fa(e,t,n){n===void 0&&(n=!1);const r=Ke(e),s=xn(e),i=pn(s);let a=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=Et(a)),[a,Et(a)]}function za(e){const t=Et(e);return[ln(e),t,ln(t)]}function ln(e){return e.replace(/start|end/g,t=>La[t])}function $a(e,t,n){const r=["left","right"],s=["right","left"],i=["top","bottom"],a=["bottom","top"];switch(e){case"top":case"bottom":return n?t?s:r:t?r:s;case"left":case"right":return t?i:a;default:return[]}}function Ba(e,t,n,r){const s=Ke(e);let i=$a(Ee(e),n==="start",r);return s&&(i=i.map(a=>a+"-"+s),t&&(i=i.concat(i.map(ln)))),i}function Et(e){return e.replace(/left|right|bottom|top/g,t=>Oa[t])}function Va(e){return{top:0,right:0,bottom:0,left:0,...e}}function Xr(e){return typeof e!="number"?Va(e):{top:e,right:e,bottom:e,left:e}}function wt(e){const{x:t,y:n,width:r,height:s}=e;return{width:r,height:s,top:n,left:t,right:t+r,bottom:n+s,x:t,y:n}}function or(e,t,n){let{reference:r,floating:s}=e;const i=me(t),a=xn(t),c=pn(a),m=Ee(t),l=i==="y",d=r.x+r.width/2-s.width/2,u=r.y+r.height/2-s.height/2,p=r[c]/2-s[c]/2;let x;switch(m){case"top":x={x:d,y:r.y-s.height};break;case"bottom":x={x:d,y:r.y+r.height};break;case"right":x={x:r.x+r.width,y:u};break;case"left":x={x:r.x-s.width,y:u};break;default:x={x:r.x,y:r.y}}switch(Ke(t)){case"start":x[a]-=p*(n&&l?-1:1);break;case"end":x[a]+=p*(n&&l?-1:1);break}return x}const Ha=async(e,t,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:i=[],platform:a}=n,c=i.filter(Boolean),m=await(a.isRTL==null?void 0:a.isRTL(t));let l=await a.getElementRects({reference:e,floating:t,strategy:s}),{x:d,y:u}=or(l,r,m),p=r,x={},y=0;for(let h=0;h<c.length;h++){const{name:v,fn:w}=c[h],{x:j,y:b,data:g,reset:R}=await w({x:d,y:u,initialPlacement:r,placement:p,strategy:s,middlewareData:x,rects:l,platform:a,elements:{reference:e,floating:t}});d=j??d,u=b??u,x={...x,[v]:{...x[v],...g}},R&&y<=50&&(y++,typeof R=="object"&&(R.placement&&(p=R.placement),R.rects&&(l=R.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:s}):R.rects),{x:d,y:u}=or(l,p,m)),h=-1)}return{x:d,y:u,placement:p,strategy:s,middlewareData:x}};async function Je(e,t){var n;t===void 0&&(t={});const{x:r,y:s,platform:i,rects:a,elements:c,strategy:m}=e,{boundary:l="clippingAncestors",rootBoundary:d="viewport",elementContext:u="floating",altBoundary:p=!1,padding:x=0}=be(t,e),y=Xr(x),v=c[p?u==="floating"?"reference":"floating":u],w=wt(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(v)))==null||n?v:v.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(c.floating)),boundary:l,rootBoundary:d,strategy:m})),j=u==="floating"?{x:r,y:s,width:a.floating.width,height:a.floating.height}:a.reference,b=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c.floating)),g=await(i.isElement==null?void 0:i.isElement(b))?await(i.getScale==null?void 0:i.getScale(b))||{x:1,y:1}:{x:1,y:1},R=wt(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:j,offsetParent:b,strategy:m}):j);return{top:(w.top-R.top+y.top)/g.y,bottom:(R.bottom-w.bottom+y.bottom)/g.y,left:(w.left-R.left+y.left)/g.x,right:(R.right-w.right+y.right)/g.x}}const Ua=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:s,rects:i,platform:a,elements:c,middlewareData:m}=t,{element:l,padding:d=0}=be(e,t)||{};if(l==null)return{};const u=Xr(d),p={x:n,y:r},x=xn(s),y=pn(x),h=await a.getDimensions(l),v=x==="y",w=v?"top":"left",j=v?"bottom":"right",b=v?"clientHeight":"clientWidth",g=i.reference[y]+i.reference[x]-p[x]-i.floating[y],R=p[x]-i.reference[x],P=await(a.getOffsetParent==null?void 0:a.getOffsetParent(l));let M=P?P[b]:0;(!M||!await(a.isElement==null?void 0:a.isElement(P)))&&(M=c.floating[b]||i.floating[y]);const S=g/2-R/2,F=M/2-h[y]/2-1,D=Se(u[w],F),_=Se(u[j],F),B=D,$=M-h[y]-_,T=M/2-h[y]/2+S,O=cn(B,T,$),k=!m.arrow&&Ke(s)!=null&&T!==O&&i.reference[y]/2-(T<B?D:_)-h[y]/2<0,I=k?T<B?T-B:T-$:0;return{[x]:p[x]+I,data:{[x]:O,centerOffset:T-O-I,...k&&{alignmentOffset:I}},reset:k}}}),Wa=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:s,middlewareData:i,rects:a,initialPlacement:c,platform:m,elements:l}=t,{mainAxis:d=!0,crossAxis:u=!0,fallbackPlacements:p,fallbackStrategy:x="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:h=!0,...v}=be(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const w=Ee(s),j=me(c),b=Ee(c)===c,g=await(m.isRTL==null?void 0:m.isRTL(l.floating)),R=p||(b||!h?[Et(c)]:za(c)),P=y!=="none";!p&&P&&R.push(...Ba(c,h,y,g));const M=[c,...R],S=await Je(t,v),F=[];let D=((r=i.flip)==null?void 0:r.overflows)||[];if(d&&F.push(S[w]),u){const T=Fa(s,a,g);F.push(S[T[0]],S[T[1]])}if(D=[...D,{placement:s,overflows:F}],!F.every(T=>T<=0)){var _,B;const T=(((_=i.flip)==null?void 0:_.index)||0)+1,O=M[T];if(O&&(!(u==="alignment"?j!==me(O):!1)||D.every(N=>N.overflows[0]>0&&me(N.placement)===j)))return{data:{index:T,overflows:D},reset:{placement:O}};let k=(B=D.filter(I=>I.overflows[0]<=0).sort((I,N)=>I.overflows[1]-N.overflows[1])[0])==null?void 0:B.placement;if(!k)switch(x){case"bestFit":{var $;const I=($=D.filter(N=>{if(P){const A=me(N.placement);return A===j||A==="y"}return!0}).map(N=>[N.placement,N.overflows.filter(A=>A>0).reduce((A,W)=>A+W,0)]).sort((N,A)=>N[1]-A[1])[0])==null?void 0:$[0];I&&(k=I);break}case"initialPlacement":k=c;break}if(s!==k)return{reset:{placement:k}}}return{}}}};function sr(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function ir(e){return Ia.some(t=>e[t]>=0)}const Ka=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...s}=be(e,t);switch(r){case"referenceHidden":{const i=await Je(t,{...s,elementContext:"reference"}),a=sr(i,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:ir(a)}}}case"escaped":{const i=await Je(t,{...s,altBoundary:!0}),a=sr(i,n.floating);return{data:{escapedOffsets:a,escaped:ir(a)}}}default:return{}}}}};async function Ga(e,t){const{placement:n,platform:r,elements:s}=e,i=await(r.isRTL==null?void 0:r.isRTL(s.floating)),a=Ee(n),c=Ke(n),m=me(n)==="y",l=["left","top"].includes(a)?-1:1,d=i&&m?-1:1,u=be(t,e);let{mainAxis:p,crossAxis:x,alignmentAxis:y}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return c&&typeof y=="number"&&(x=c==="end"?y*-1:y),m?{x:x*d,y:p*l}:{x:p*l,y:x*d}}const Ya=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:s,y:i,placement:a,middlewareData:c}=t,m=await Ga(t,e);return a===((n=c.offset)==null?void 0:n.placement)&&(r=c.arrow)!=null&&r.alignmentOffset?{}:{x:s+m.x,y:i+m.y,data:{...m,placement:a}}}}},qa=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:s}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:c={fn:v=>{let{x:w,y:j}=v;return{x:w,y:j}}},...m}=be(e,t),l={x:n,y:r},d=await Je(t,m),u=me(Ee(s)),p=mn(u);let x=l[p],y=l[u];if(i){const v=p==="y"?"top":"left",w=p==="y"?"bottom":"right",j=x+d[v],b=x-d[w];x=cn(j,x,b)}if(a){const v=u==="y"?"top":"left",w=u==="y"?"bottom":"right",j=y+d[v],b=y-d[w];y=cn(j,y,b)}const h=c.fn({...t,[p]:x,[u]:y});return{...h,data:{x:h.x-n,y:h.y-r,enabled:{[p]:i,[u]:a}}}}}},Xa=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:s,rects:i,middlewareData:a}=t,{offset:c=0,mainAxis:m=!0,crossAxis:l=!0}=be(e,t),d={x:n,y:r},u=me(s),p=mn(u);let x=d[p],y=d[u];const h=be(c,t),v=typeof h=="number"?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(m){const b=p==="y"?"height":"width",g=i.reference[p]-i.floating[b]+v.mainAxis,R=i.reference[p]+i.reference[b]-v.mainAxis;x<g?x=g:x>R&&(x=R)}if(l){var w,j;const b=p==="y"?"width":"height",g=["top","left"].includes(Ee(s)),R=i.reference[u]-i.floating[b]+(g&&((w=a.offset)==null?void 0:w[u])||0)+(g?0:v.crossAxis),P=i.reference[u]+i.reference[b]+(g?0:((j=a.offset)==null?void 0:j[u])||0)-(g?v.crossAxis:0);y<R?y=R:y>P&&(y=P)}return{[p]:x,[u]:y}}}},Qa=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:s,rects:i,platform:a,elements:c}=t,{apply:m=()=>{},...l}=be(e,t),d=await Je(t,l),u=Ee(s),p=Ke(s),x=me(s)==="y",{width:y,height:h}=i.floating;let v,w;u==="top"||u==="bottom"?(v=u,w=p===(await(a.isRTL==null?void 0:a.isRTL(c.floating))?"start":"end")?"left":"right"):(w=u,v=p==="end"?"top":"bottom");const j=h-d.top-d.bottom,b=y-d.left-d.right,g=Se(h-d[v],j),R=Se(y-d[w],b),P=!t.middlewareData.shift;let M=g,S=R;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(S=b),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(M=j),P&&!p){const D=Q(d.left,0),_=Q(d.right,0),B=Q(d.top,0),$=Q(d.bottom,0);x?S=y-2*(D!==0||_!==0?D+_:Q(d.left,d.right)):M=h-2*(B!==0||$!==0?B+$:Q(d.top,d.bottom))}await m({...t,availableWidth:S,availableHeight:M});const F=await a.getDimensions(c.floating);return y!==F.width||h!==F.height?{reset:{rects:!0}}:{}}}};function Nt(){return typeof window<"u"}function Ge(e){return Qr(e)?(e.nodeName||"").toLowerCase():"#document"}function Z(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function he(e){var t;return(t=(Qr(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Qr(e){return Nt()?e instanceof Node||e instanceof Z(e).Node:!1}function ae(e){return Nt()?e instanceof Element||e instanceof Z(e).Element:!1}function xe(e){return Nt()?e instanceof HTMLElement||e instanceof Z(e).HTMLElement:!1}function ar(e){return!Nt()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Z(e).ShadowRoot}function st(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=ce(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(s)}function Za(e){return["table","td","th"].includes(Ge(e))}function At(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function hn(e){const t=vn(),n=ae(e)?ce(e):e;return["transform","translate","scale","rotate","perspective"].some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function Ja(e){let t=Pe(e);for(;xe(t)&&!We(t);){if(hn(t))return t;if(At(t))return null;t=Pe(t)}return null}function vn(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function We(e){return["html","body","#document"].includes(Ge(e))}function ce(e){return Z(e).getComputedStyle(e)}function Tt(e){return ae(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Pe(e){if(Ge(e)==="html")return e;const t=e.assignedSlot||e.parentNode||ar(e)&&e.host||he(e);return ar(t)?t.host:t}function Zr(e){const t=Pe(e);return We(t)?e.ownerDocument?e.ownerDocument.body:e.body:xe(t)&&st(t)?t:Zr(t)}function et(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=Zr(e),i=s===((r=e.ownerDocument)==null?void 0:r.body),a=Z(s);if(i){const c=un(a);return t.concat(a,a.visualViewport||[],st(s)?s:[],c&&n?et(c):[])}return t.concat(s,et(s,[],n))}function un(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Jr(e){const t=ce(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const s=xe(e),i=s?e.offsetWidth:n,a=s?e.offsetHeight:r,c=bt(n)!==i||bt(r)!==a;return c&&(n=i,r=a),{width:n,height:r,$:c}}function gn(e){return ae(e)?e:e.contextElement}function Ue(e){const t=gn(e);if(!xe(t))return pe(1);const n=t.getBoundingClientRect(),{width:r,height:s,$:i}=Jr(t);let a=(i?bt(n.width):n.width)/r,c=(i?bt(n.height):n.height)/s;return(!a||!Number.isFinite(a))&&(a=1),(!c||!Number.isFinite(c))&&(c=1),{x:a,y:c}}const ec=pe(0);function eo(e){const t=Z(e);return!vn()||!t.visualViewport?ec:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function tc(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Z(e)?!1:t}function Ie(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),i=gn(e);let a=pe(1);t&&(r?ae(r)&&(a=Ue(r)):a=Ue(e));const c=tc(i,n,r)?eo(i):pe(0);let m=(s.left+c.x)/a.x,l=(s.top+c.y)/a.y,d=s.width/a.x,u=s.height/a.y;if(i){const p=Z(i),x=r&&ae(r)?Z(r):r;let y=p,h=un(y);for(;h&&r&&x!==y;){const v=Ue(h),w=h.getBoundingClientRect(),j=ce(h),b=w.left+(h.clientLeft+parseFloat(j.paddingLeft))*v.x,g=w.top+(h.clientTop+parseFloat(j.paddingTop))*v.y;m*=v.x,l*=v.y,d*=v.x,u*=v.y,m+=b,l+=g,y=Z(h),h=un(y)}}return wt({width:d,height:u,x:m,y:l})}function yn(e,t){const n=Tt(e).scrollLeft;return t?t.left+n:Ie(he(e)).left+n}function to(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),s=r.left+t.scrollLeft-(n?0:yn(e,r)),i=r.top+t.scrollTop;return{x:s,y:i}}function nc(e){let{elements:t,rect:n,offsetParent:r,strategy:s}=e;const i=s==="fixed",a=he(r),c=t?At(t.floating):!1;if(r===a||c&&i)return n;let m={scrollLeft:0,scrollTop:0},l=pe(1);const d=pe(0),u=xe(r);if((u||!u&&!i)&&((Ge(r)!=="body"||st(a))&&(m=Tt(r)),xe(r))){const x=Ie(r);l=Ue(r),d.x=x.x+r.clientLeft,d.y=x.y+r.clientTop}const p=a&&!u&&!i?to(a,m,!0):pe(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-m.scrollLeft*l.x+d.x+p.x,y:n.y*l.y-m.scrollTop*l.y+d.y+p.y}}function rc(e){return Array.from(e.getClientRects())}function oc(e){const t=he(e),n=Tt(e),r=e.ownerDocument.body,s=Q(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Q(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+yn(e);const c=-n.scrollTop;return ce(r).direction==="rtl"&&(a+=Q(t.clientWidth,r.clientWidth)-s),{width:s,height:i,x:a,y:c}}function sc(e,t){const n=Z(e),r=he(e),s=n.visualViewport;let i=r.clientWidth,a=r.clientHeight,c=0,m=0;if(s){i=s.width,a=s.height;const l=vn();(!l||l&&t==="fixed")&&(c=s.offsetLeft,m=s.offsetTop)}return{width:i,height:a,x:c,y:m}}function ic(e,t){const n=Ie(e,!0,t==="fixed"),r=n.top+e.clientTop,s=n.left+e.clientLeft,i=xe(e)?Ue(e):pe(1),a=e.clientWidth*i.x,c=e.clientHeight*i.y,m=s*i.x,l=r*i.y;return{width:a,height:c,x:m,y:l}}function cr(e,t,n){let r;if(t==="viewport")r=sc(e,n);else if(t==="document")r=oc(he(e));else if(ae(t))r=ic(t,n);else{const s=eo(e);r={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return wt(r)}function no(e,t){const n=Pe(e);return n===t||!ae(n)||We(n)?!1:ce(n).position==="fixed"||no(n,t)}function ac(e,t){const n=t.get(e);if(n)return n;let r=et(e,[],!1).filter(c=>ae(c)&&Ge(c)!=="body"),s=null;const i=ce(e).position==="fixed";let a=i?Pe(e):e;for(;ae(a)&&!We(a);){const c=ce(a),m=hn(a);!m&&c.position==="fixed"&&(s=null),(i?!m&&!s:!m&&c.position==="static"&&!!s&&["absolute","fixed"].includes(s.position)||st(a)&&!m&&no(e,a))?r=r.filter(d=>d!==a):s=c,a=Pe(a)}return t.set(e,r),r}function cc(e){let{element:t,boundary:n,rootBoundary:r,strategy:s}=e;const a=[...n==="clippingAncestors"?At(t)?[]:ac(t,this._c):[].concat(n),r],c=a[0],m=a.reduce((l,d)=>{const u=cr(t,d,s);return l.top=Q(u.top,l.top),l.right=Se(u.right,l.right),l.bottom=Se(u.bottom,l.bottom),l.left=Q(u.left,l.left),l},cr(t,c,s));return{width:m.right-m.left,height:m.bottom-m.top,x:m.left,y:m.top}}function lc(e){const{width:t,height:n}=Jr(e);return{width:t,height:n}}function uc(e,t,n){const r=xe(t),s=he(t),i=n==="fixed",a=Ie(e,!0,i,t);let c={scrollLeft:0,scrollTop:0};const m=pe(0);function l(){m.x=yn(s)}if(r||!r&&!i)if((Ge(t)!=="body"||st(s))&&(c=Tt(t)),r){const x=Ie(t,!0,i,t);m.x=x.x+t.clientLeft,m.y=x.y+t.clientTop}else s&&l();i&&!r&&s&&l();const d=s&&!r&&!i?to(s,c):pe(0),u=a.left+c.scrollLeft-m.x-d.x,p=a.top+c.scrollTop-m.y-d.y;return{x:u,y:p,width:a.width,height:a.height}}function Yt(e){return ce(e).position==="static"}function lr(e,t){if(!xe(e)||ce(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return he(e)===n&&(n=n.ownerDocument.body),n}function ro(e,t){const n=Z(e);if(At(e))return n;if(!xe(e)){let s=Pe(e);for(;s&&!We(s);){if(ae(s)&&!Yt(s))return s;s=Pe(s)}return n}let r=lr(e,t);for(;r&&Za(r)&&Yt(r);)r=lr(r,t);return r&&We(r)&&Yt(r)&&!hn(r)?n:r||Ja(e)||n}const dc=async function(e){const t=this.getOffsetParent||ro,n=this.getDimensions,r=await n(e.floating);return{reference:uc(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function fc(e){return ce(e).direction==="rtl"}const mc={convertOffsetParentRelativeRectToViewportRelativeRect:nc,getDocumentElement:he,getClippingRect:cc,getOffsetParent:ro,getElementRects:dc,getClientRects:rc,getDimensions:lc,getScale:Ue,isElement:ae,isRTL:fc};function oo(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function pc(e,t){let n=null,r;const s=he(e);function i(){var c;clearTimeout(r),(c=n)==null||c.disconnect(),n=null}function a(c,m){c===void 0&&(c=!1),m===void 0&&(m=1),i();const l=e.getBoundingClientRect(),{left:d,top:u,width:p,height:x}=l;if(c||t(),!p||!x)return;const y=xt(u),h=xt(s.clientWidth-(d+p)),v=xt(s.clientHeight-(u+x)),w=xt(d),b={rootMargin:-y+"px "+-h+"px "+-v+"px "+-w+"px",threshold:Q(0,Se(1,m))||1};let g=!0;function R(P){const M=P[0].intersectionRatio;if(M!==m){if(!g)return a();M?a(!1,M):r=setTimeout(()=>{a(!1,1e-7)},1e3)}M===1&&!oo(l,e.getBoundingClientRect())&&a(),g=!1}try{n=new IntersectionObserver(R,{...b,root:s.ownerDocument})}catch{n=new IntersectionObserver(R,b)}n.observe(e)}return a(!0),i}function xc(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:i=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:m=!1}=r,l=gn(e),d=s||i?[...l?et(l):[],...et(t)]:[];d.forEach(w=>{s&&w.addEventListener("scroll",n,{passive:!0}),i&&w.addEventListener("resize",n)});const u=l&&c?pc(l,n):null;let p=-1,x=null;a&&(x=new ResizeObserver(w=>{let[j]=w;j&&j.target===l&&x&&(x.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var b;(b=x)==null||b.observe(t)})),n()}),l&&!m&&x.observe(l),x.observe(t));let y,h=m?Ie(e):null;m&&v();function v(){const w=Ie(e);h&&!oo(h,w)&&n(),h=w,y=requestAnimationFrame(v)}return n(),()=>{var w;d.forEach(j=>{s&&j.removeEventListener("scroll",n),i&&j.removeEventListener("resize",n)}),u?.(),(w=x)==null||w.disconnect(),x=null,m&&cancelAnimationFrame(y)}}const hc=Ya,vc=qa,gc=Wa,yc=Qa,bc=Ka,ur=Ua,Ec=Xa,wc=(e,t,n)=>{const r=new Map,s={platform:mc,...n},i={...s.platform,_c:r};return Ha(e,t,{...s,platform:i})};var jc=typeof document<"u",Rc=function(){},yt=jc?E.useLayoutEffect:Rc;function jt(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,s;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!jt(e[r],t[r]))return!1;return!0}if(s=Object.keys(e),n=s.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,s[r]))return!1;for(r=n;r--!==0;){const i=s[r];if(!(i==="_owner"&&e.$$typeof)&&!jt(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function so(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function dr(e,t){const n=so(e);return Math.round(t*n)/n}function qt(e){const t=f.useRef(e);return yt(()=>{t.current=e}),t}function Mc(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:i,floating:a}={},transform:c=!0,whileElementsMounted:m,open:l}=e,[d,u]=f.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,x]=f.useState(r);jt(p,r)||x(r);const[y,h]=f.useState(null),[v,w]=f.useState(null),j=f.useCallback(N=>{N!==P.current&&(P.current=N,h(N))},[]),b=f.useCallback(N=>{N!==M.current&&(M.current=N,w(N))},[]),g=i||y,R=a||v,P=f.useRef(null),M=f.useRef(null),S=f.useRef(d),F=m!=null,D=qt(m),_=qt(s),B=qt(l),$=f.useCallback(()=>{if(!P.current||!M.current)return;const N={placement:t,strategy:n,middleware:p};_.current&&(N.platform=_.current),wc(P.current,M.current,N).then(A=>{const W={...A,isPositioned:B.current!==!1};T.current&&!jt(S.current,W)&&(S.current=W,gr.flushSync(()=>{u(W)}))})},[p,t,n,_,B]);yt(()=>{l===!1&&S.current.isPositioned&&(S.current.isPositioned=!1,u(N=>({...N,isPositioned:!1})))},[l]);const T=f.useRef(!1);yt(()=>(T.current=!0,()=>{T.current=!1}),[]),yt(()=>{if(g&&(P.current=g),R&&(M.current=R),g&&R){if(D.current)return D.current(g,R,$);$()}},[g,R,$,D,F]);const O=f.useMemo(()=>({reference:P,floating:M,setReference:j,setFloating:b}),[j,b]),k=f.useMemo(()=>({reference:g,floating:R}),[g,R]),I=f.useMemo(()=>{const N={position:n,left:0,top:0};if(!k.floating)return N;const A=dr(k.floating,d.x),W=dr(k.floating,d.y);return c?{...N,transform:"translate("+A+"px, "+W+"px)",...so(k.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:A,top:W}},[n,c,k.floating,d.x,d.y]);return f.useMemo(()=>({...d,update:$,refs:O,elements:k,floatingStyles:I}),[d,$,O,k,I])}const Cc=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:s}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?ur({element:r.current,padding:s}).fn(n):{}:r?ur({element:r,padding:s}).fn(n):{}}}},Sc=(e,t)=>({...hc(e),options:[e,t]}),Pc=(e,t)=>({...vc(e),options:[e,t]}),Nc=(e,t)=>({...Ec(e),options:[e,t]}),Ac=(e,t)=>({...gc(e),options:[e,t]}),Tc=(e,t)=>({...yc(e),options:[e,t]}),kc=(e,t)=>({...bc(e),options:[e,t]}),Dc=(e,t)=>({...Cc(e),options:[e,t]});var _c="Arrow",io=f.forwardRef((e,t)=>{const{children:n,width:r=10,height:s=5,...i}=e;return o.jsxRuntimeExports.jsx(G.svg,{...i,ref:t,width:r,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:o.jsxRuntimeExports.jsx("polygon",{points:"0,0 30,0 15,10"})})});io.displayName=_c;var Ic=io,bn="Popper",[ao,co]=rt(bn),[Oc,lo]=ao(bn),uo=e=>{const{__scopePopper:t,children:n}=e,[r,s]=f.useState(null);return o.jsxRuntimeExports.jsx(Oc,{scope:t,anchor:r,onAnchorChange:s,children:n})};uo.displayName=bn;var fo="PopperAnchor",mo=f.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...s}=e,i=lo(fo,n),a=f.useRef(null),c=X(t,a);return f.useEffect(()=>{i.onAnchorChange(r?.current||a.current)}),r?null:o.jsxRuntimeExports.jsx(G.div,{...s,ref:c})});mo.displayName=fo;var En="PopperContent",[Lc,Fc]=ao(En),po=f.forwardRef((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:s=0,align:i="center",alignOffset:a=0,arrowPadding:c=0,avoidCollisions:m=!0,collisionBoundary:l=[],collisionPadding:d=0,sticky:u="partial",hideWhenDetached:p=!1,updatePositionStrategy:x="optimized",onPlaced:y,...h}=e,v=lo(En,n),[w,j]=f.useState(null),b=X(t,H=>j(H)),[g,R]=f.useState(null),P=_a(g),M=P?.width??0,S=P?.height??0,F=r+(i!=="center"?"-"+i:""),D=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},_=Array.isArray(l)?l:[l],B=_.length>0,$={padding:D,boundary:_.filter($c),altBoundary:B},{refs:T,floatingStyles:O,placement:k,isPositioned:I,middlewareData:N}=Mc({strategy:"fixed",placement:F,whileElementsMounted:(...H)=>xc(...H,{animationFrame:x==="always"}),elements:{reference:v.anchor},middleware:[Sc({mainAxis:s+S,alignmentAxis:a}),m&&Pc({mainAxis:!0,crossAxis:!1,limiter:u==="partial"?Nc():void 0,...$}),m&&Ac({...$}),Tc({...$,apply:({elements:H,rects:K,availableWidth:Te,availableHeight:je})=>{const{width:Ye,height:ue}=K.reference,Re=H.floating.style;Re.setProperty("--radix-popper-available-width",`${Te}px`),Re.setProperty("--radix-popper-available-height",`${je}px`),Re.setProperty("--radix-popper-anchor-width",`${Ye}px`),Re.setProperty("--radix-popper-anchor-height",`${ue}px`)}}),g&&Dc({element:g,padding:c}),Bc({arrowWidth:M,arrowHeight:S}),p&&kc({strategy:"referenceHidden",...$})]}),[A,W]=vo(k),J=ye(y);Ce(()=>{I&&J?.()},[I,J]);const ve=N.arrow?.x,Ne=N.arrow?.y,Ae=N.arrow?.centerOffset!==0,[Fe,ge]=f.useState();return Ce(()=>{w&&ge(window.getComputedStyle(w).zIndex)},[w]),o.jsxRuntimeExports.jsx("div",{ref:T.setFloating,"data-radix-popper-content-wrapper":"",style:{...O,transform:I?O.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Fe,"--radix-popper-transform-origin":[N.transformOrigin?.x,N.transformOrigin?.y].join(" "),...N.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:o.jsxRuntimeExports.jsx(Lc,{scope:n,placedSide:A,onArrowChange:R,arrowX:ve,arrowY:Ne,shouldHideArrow:Ae,children:o.jsxRuntimeExports.jsx(G.div,{"data-side":A,"data-align":W,...h,ref:b,style:{...h.style,animation:I?void 0:"none"}})})})});po.displayName=En;var xo="PopperArrow",zc={top:"bottom",right:"left",bottom:"top",left:"right"},ho=f.forwardRef(function(t,n){const{__scopePopper:r,...s}=t,i=Fc(xo,r),a=zc[i.placedSide];return o.jsxRuntimeExports.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:o.jsxRuntimeExports.jsx(Ic,{...s,ref:n,style:{...s.style,display:"block"}})})});ho.displayName=xo;function $c(e){return e!==null}var Bc=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:s}=t,a=s.arrow?.centerOffset!==0,c=a?0:e.arrowWidth,m=a?0:e.arrowHeight,[l,d]=vo(n),u={start:"0%",center:"50%",end:"100%"}[d],p=(s.arrow?.x??0)+c/2,x=(s.arrow?.y??0)+m/2;let y="",h="";return l==="bottom"?(y=a?u:`${p}px`,h=`${-m}px`):l==="top"?(y=a?u:`${p}px`,h=`${r.floating.height+m}px`):l==="right"?(y=`${-m}px`,h=a?u:`${x}px`):l==="left"&&(y=`${r.floating.width+m}px`,h=a?u:`${x}px`),{data:{x:y,y:h}}}});function vo(e){const[t,n="center"]=e.split("-");return[t,n]}var Vc=uo,Hc=mo,Uc=po,Wc=ho,Xt="rovingFocusGroup.onEntryFocus",Kc={bubbles:!1,cancelable:!0},it="RovingFocusGroup",[dn,go,Gc]=Tr(it),[Yc,yo]=rt(it,[Gc]),[qc,Xc]=Yc(it),bo=f.forwardRef((e,t)=>o.jsxRuntimeExports.jsx(dn.Provider,{scope:e.__scopeRovingFocusGroup,children:o.jsxRuntimeExports.jsx(dn.Slot,{scope:e.__scopeRovingFocusGroup,children:o.jsxRuntimeExports.jsx(Qc,{...e,ref:t})})}));bo.displayName=it;var Qc=f.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:s=!1,dir:i,currentTabStopId:a,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:m,onEntryFocus:l,preventScrollOnEntryFocus:d=!1,...u}=e,p=f.useRef(null),x=X(t,p),y=_r(i),[h,v]=kr({prop:a,defaultProp:c??null,onChange:m,caller:it}),[w,j]=f.useState(!1),b=ye(l),g=go(n),R=f.useRef(!1),[P,M]=f.useState(0);return f.useEffect(()=>{const S=p.current;if(S)return S.addEventListener(Xt,b),()=>S.removeEventListener(Xt,b)},[b]),o.jsxRuntimeExports.jsx(qc,{scope:n,orientation:r,dir:y,loop:s,currentTabStopId:h,onItemFocus:f.useCallback(S=>v(S),[v]),onItemShiftTab:f.useCallback(()=>j(!0),[]),onFocusableItemAdd:f.useCallback(()=>M(S=>S+1),[]),onFocusableItemRemove:f.useCallback(()=>M(S=>S-1),[]),children:o.jsxRuntimeExports.jsx(G.div,{tabIndex:w||P===0?-1:0,"data-orientation":r,...u,ref:x,style:{outline:"none",...e.style},onMouseDown:z(e.onMouseDown,()=>{R.current=!0}),onFocus:z(e.onFocus,S=>{const F=!R.current;if(S.target===S.currentTarget&&F&&!w){const D=new CustomEvent(Xt,Kc);if(S.currentTarget.dispatchEvent(D),!D.defaultPrevented){const _=g().filter(k=>k.focusable),B=_.find(k=>k.active),$=_.find(k=>k.id===h),O=[B,$,..._].filter(Boolean).map(k=>k.ref.current);jo(O,d)}}R.current=!1}),onBlur:z(e.onBlur,()=>j(!1))})})}),Eo="RovingFocusGroupItem",wo=f.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:s=!1,tabStopId:i,children:a,...c}=e,m=on(),l=i||m,d=Xc(Eo,n),u=d.currentTabStopId===l,p=go(n),{onFocusableItemAdd:x,onFocusableItemRemove:y,currentTabStopId:h}=d;return f.useEffect(()=>{if(r)return x(),()=>y()},[r,x,y]),o.jsxRuntimeExports.jsx(dn.ItemSlot,{scope:n,id:l,focusable:r,active:s,children:o.jsxRuntimeExports.jsx(G.span,{tabIndex:u?0:-1,"data-orientation":d.orientation,...c,ref:t,onMouseDown:z(e.onMouseDown,v=>{r?d.onItemFocus(l):v.preventDefault()}),onFocus:z(e.onFocus,()=>d.onItemFocus(l)),onKeyDown:z(e.onKeyDown,v=>{if(v.key==="Tab"&&v.shiftKey){d.onItemShiftTab();return}if(v.target!==v.currentTarget)return;const w=el(v,d.orientation,d.dir);if(w!==void 0){if(v.metaKey||v.ctrlKey||v.altKey||v.shiftKey)return;v.preventDefault();let b=p().filter(g=>g.focusable).map(g=>g.ref.current);if(w==="last")b.reverse();else if(w==="prev"||w==="next"){w==="prev"&&b.reverse();const g=b.indexOf(v.currentTarget);b=d.loop?tl(b,g+1):b.slice(g+1)}setTimeout(()=>jo(b))}}),children:typeof a=="function"?a({isCurrentTabStop:u,hasTabStop:h!=null}):a})})});wo.displayName=Eo;var Zc={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Jc(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function el(e,t,n){const r=Jc(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Zc[r]}function jo(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function tl(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var nl=bo,rl=wo,fn=["Enter"," "],ol=["ArrowDown","PageUp","Home"],Ro=["ArrowUp","PageDown","End"],sl=[...ol,...Ro],il={ltr:[...fn,"ArrowRight"],rtl:[...fn,"ArrowLeft"]},al={ltr:["ArrowLeft"],rtl:["ArrowRight"]},at="Menu",[tt,cl,ll]=Tr(at),[Oe,Mo]=rt(at,[ll,co,yo]),kt=co(),Co=yo(),[ul,Le]=Oe(at),[dl,ct]=Oe(at),So=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:s,onOpenChange:i,modal:a=!0}=e,c=kt(t),[m,l]=f.useState(null),d=f.useRef(!1),u=ye(i),p=_r(s);return f.useEffect(()=>{const x=()=>{d.current=!0,document.addEventListener("pointerdown",y,{capture:!0,once:!0}),document.addEventListener("pointermove",y,{capture:!0,once:!0})},y=()=>d.current=!1;return document.addEventListener("keydown",x,{capture:!0}),()=>{document.removeEventListener("keydown",x,{capture:!0}),document.removeEventListener("pointerdown",y,{capture:!0}),document.removeEventListener("pointermove",y,{capture:!0})}},[]),o.jsxRuntimeExports.jsx(Vc,{...c,children:o.jsxRuntimeExports.jsx(ul,{scope:t,open:n,onOpenChange:u,content:m,onContentChange:l,children:o.jsxRuntimeExports.jsx(dl,{scope:t,onClose:f.useCallback(()=>u(!1),[u]),isUsingKeyboardRef:d,dir:p,modal:a,children:r})})})};So.displayName=at;var fl="MenuAnchor",wn=f.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=kt(n);return o.jsxRuntimeExports.jsx(Hc,{...s,...r,ref:t})});wn.displayName=fl;var jn="MenuPortal",[ml,Po]=Oe(jn,{forceMount:void 0}),No=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:s}=e,i=Le(jn,t);return o.jsxRuntimeExports.jsx(ml,{scope:t,forceMount:n,children:o.jsxRuntimeExports.jsx(ot,{present:n||i.open,children:o.jsxRuntimeExports.jsx($r,{asChild:!0,container:s,children:r})})})};No.displayName=jn;var ne="MenuContent",[pl,Rn]=Oe(ne),Ao=f.forwardRef((e,t)=>{const n=Po(ne,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,i=Le(ne,e.__scopeMenu),a=ct(ne,e.__scopeMenu);return o.jsxRuntimeExports.jsx(tt.Provider,{scope:e.__scopeMenu,children:o.jsxRuntimeExports.jsx(ot,{present:r||i.open,children:o.jsxRuntimeExports.jsx(tt.Slot,{scope:e.__scopeMenu,children:a.modal?o.jsxRuntimeExports.jsx(xl,{...s,ref:t}):o.jsxRuntimeExports.jsx(hl,{...s,ref:t})})})})}),xl=f.forwardRef((e,t)=>{const n=Le(ne,e.__scopeMenu),r=f.useRef(null),s=X(t,r);return f.useEffect(()=>{const i=r.current;if(i)return Da(i)},[]),o.jsxRuntimeExports.jsx(Mn,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:z(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),hl=f.forwardRef((e,t)=>{const n=Le(ne,e.__scopeMenu);return o.jsxRuntimeExports.jsx(Mn,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),vl=Ze("MenuContent.ScrollLock"),Mn=f.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:c,onEntryFocus:m,onEscapeKeyDown:l,onPointerDownOutside:d,onFocusOutside:u,onInteractOutside:p,onDismiss:x,disableOutsideScroll:y,...h}=e,v=Le(ne,n),w=ct(ne,n),j=kt(n),b=Co(n),g=cl(n),[R,P]=f.useState(null),M=f.useRef(null),S=X(t,M,v.onContentChange),F=f.useRef(0),D=f.useRef(""),_=f.useRef(0),B=f.useRef(null),$=f.useRef("right"),T=f.useRef(0),O=y?Yr:f.Fragment,k=y?{as:vl,allowPinchZoom:!0}:void 0,I=A=>{const W=D.current+A,J=g().filter(H=>!H.disabled),ve=document.activeElement,Ne=J.find(H=>H.ref.current===ve)?.textValue,Ae=J.map(H=>H.textValue),Fe=Nl(Ae,W,Ne),ge=J.find(H=>H.textValue===Fe)?.ref.current;(function H(K){D.current=K,window.clearTimeout(F.current),K!==""&&(F.current=window.setTimeout(()=>H(""),1e3))})(W),ge&&setTimeout(()=>ge.focus())};f.useEffect(()=>()=>window.clearTimeout(F.current),[]),Gi();const N=f.useCallback(A=>$.current===B.current?.side&&Tl(A,B.current?.area),[]);return o.jsxRuntimeExports.jsx(pl,{scope:n,searchRef:D,onItemEnter:f.useCallback(A=>{N(A)&&A.preventDefault()},[N]),onItemLeave:f.useCallback(A=>{N(A)||(M.current?.focus(),P(null))},[N]),onTriggerLeave:f.useCallback(A=>{N(A)&&A.preventDefault()},[N]),pointerGraceTimerRef:_,onPointerGraceIntentChange:f.useCallback(A=>{B.current=A},[]),children:o.jsxRuntimeExports.jsx(O,{...k,children:o.jsxRuntimeExports.jsx(Fr,{asChild:!0,trapped:s,onMountAutoFocus:z(i,A=>{A.preventDefault(),M.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:o.jsxRuntimeExports.jsx(Or,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:l,onPointerDownOutside:d,onFocusOutside:u,onInteractOutside:p,onDismiss:x,children:o.jsxRuntimeExports.jsx(nl,{asChild:!0,...b,dir:w.dir,orientation:"vertical",loop:r,currentTabStopId:R,onCurrentTabStopIdChange:P,onEntryFocus:z(m,A=>{w.isUsingKeyboardRef.current||A.preventDefault()}),preventScrollOnEntryFocus:!0,children:o.jsxRuntimeExports.jsx(Uc,{role:"menu","aria-orientation":"vertical","data-state":Ko(v.open),"data-radix-menu-content":"",dir:w.dir,...j,...h,ref:S,style:{outline:"none",...h.style},onKeyDown:z(h.onKeyDown,A=>{const J=A.target.closest("[data-radix-menu-content]")===A.currentTarget,ve=A.ctrlKey||A.altKey||A.metaKey,Ne=A.key.length===1;J&&(A.key==="Tab"&&A.preventDefault(),!ve&&Ne&&I(A.key));const Ae=M.current;if(A.target!==Ae||!sl.includes(A.key))return;A.preventDefault();const ge=g().filter(H=>!H.disabled).map(H=>H.ref.current);Ro.includes(A.key)&&ge.reverse(),Sl(ge)}),onBlur:z(e.onBlur,A=>{A.currentTarget.contains(A.target)||(window.clearTimeout(F.current),D.current="")}),onPointerMove:z(e.onPointerMove,nt(A=>{const W=A.target,J=T.current!==A.clientX;if(A.currentTarget.contains(W)&&J){const ve=A.clientX>T.current?"right":"left";$.current=ve,T.current=A.clientX}}))})})})})})})});Ao.displayName=ne;var gl="MenuGroup",Cn=f.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return o.jsxRuntimeExports.jsx(G.div,{role:"group",...r,ref:t})});Cn.displayName=gl;var yl="MenuLabel",To=f.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return o.jsxRuntimeExports.jsx(G.div,{...r,ref:t})});To.displayName=yl;var Rt="MenuItem",fr="menu.itemSelect",Dt=f.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...s}=e,i=f.useRef(null),a=ct(Rt,e.__scopeMenu),c=Rn(Rt,e.__scopeMenu),m=X(t,i),l=f.useRef(!1),d=()=>{const u=i.current;if(!n&&u){const p=new CustomEvent(fr,{bubbles:!0,cancelable:!0});u.addEventListener(fr,x=>r?.(x),{once:!0}),Dr(u,p),p.defaultPrevented?l.current=!1:a.onClose()}};return o.jsxRuntimeExports.jsx(ko,{...s,ref:m,disabled:n,onClick:z(e.onClick,d),onPointerDown:u=>{e.onPointerDown?.(u),l.current=!0},onPointerUp:z(e.onPointerUp,u=>{l.current||u.currentTarget?.click()}),onKeyDown:z(e.onKeyDown,u=>{const p=c.searchRef.current!=="";n||p&&u.key===" "||fn.includes(u.key)&&(u.currentTarget.click(),u.preventDefault())})})});Dt.displayName=Rt;var ko=f.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:s,...i}=e,a=Rn(Rt,n),c=Co(n),m=f.useRef(null),l=X(t,m),[d,u]=f.useState(!1),[p,x]=f.useState("");return f.useEffect(()=>{const y=m.current;y&&x((y.textContent??"").trim())},[i.children]),o.jsxRuntimeExports.jsx(tt.ItemSlot,{scope:n,disabled:r,textValue:s??p,children:o.jsxRuntimeExports.jsx(rl,{asChild:!0,...c,focusable:!r,children:o.jsxRuntimeExports.jsx(G.div,{role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...i,ref:l,onPointerMove:z(e.onPointerMove,nt(y=>{r?a.onItemLeave(y):(a.onItemEnter(y),y.defaultPrevented||y.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:z(e.onPointerLeave,nt(y=>a.onItemLeave(y))),onFocus:z(e.onFocus,()=>u(!0)),onBlur:z(e.onBlur,()=>u(!1))})})})}),bl="MenuCheckboxItem",Do=f.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...s}=e;return o.jsxRuntimeExports.jsx(Fo,{scope:e.__scopeMenu,checked:n,children:o.jsxRuntimeExports.jsx(Dt,{role:"menuitemcheckbox","aria-checked":Mt(n)?"mixed":n,...s,ref:t,"data-state":Pn(n),onSelect:z(s.onSelect,()=>r?.(Mt(n)?!0:!n),{checkForDefaultPrevented:!1})})})});Do.displayName=bl;var _o="MenuRadioGroup",[El,wl]=Oe(_o,{value:void 0,onValueChange:()=>{}}),Io=f.forwardRef((e,t)=>{const{value:n,onValueChange:r,...s}=e,i=ye(r);return o.jsxRuntimeExports.jsx(El,{scope:e.__scopeMenu,value:n,onValueChange:i,children:o.jsxRuntimeExports.jsx(Cn,{...s,ref:t})})});Io.displayName=_o;var Oo="MenuRadioItem",Lo=f.forwardRef((e,t)=>{const{value:n,...r}=e,s=wl(Oo,e.__scopeMenu),i=n===s.value;return o.jsxRuntimeExports.jsx(Fo,{scope:e.__scopeMenu,checked:i,children:o.jsxRuntimeExports.jsx(Dt,{role:"menuitemradio","aria-checked":i,...r,ref:t,"data-state":Pn(i),onSelect:z(r.onSelect,()=>s.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});Lo.displayName=Oo;var Sn="MenuItemIndicator",[Fo,jl]=Oe(Sn,{checked:!1}),zo=f.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...s}=e,i=jl(Sn,n);return o.jsxRuntimeExports.jsx(ot,{present:r||Mt(i.checked)||i.checked===!0,children:o.jsxRuntimeExports.jsx(G.span,{...s,ref:t,"data-state":Pn(i.checked)})})});zo.displayName=Sn;var Rl="MenuSeparator",$o=f.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return o.jsxRuntimeExports.jsx(G.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});$o.displayName=Rl;var Ml="MenuArrow",Bo=f.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=kt(n);return o.jsxRuntimeExports.jsx(Wc,{...s,...r,ref:t})});Bo.displayName=Ml;var Cl="MenuSub",[Wu,Vo]=Oe(Cl),Xe="MenuSubTrigger",Ho=f.forwardRef((e,t)=>{const n=Le(Xe,e.__scopeMenu),r=ct(Xe,e.__scopeMenu),s=Vo(Xe,e.__scopeMenu),i=Rn(Xe,e.__scopeMenu),a=f.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:m}=i,l={__scopeMenu:e.__scopeMenu},d=f.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=null},[]);return f.useEffect(()=>d,[d]),f.useEffect(()=>{const u=c.current;return()=>{window.clearTimeout(u),m(null)}},[c,m]),o.jsxRuntimeExports.jsx(wn,{asChild:!0,...l,children:o.jsxRuntimeExports.jsx(ko,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":s.contentId,"data-state":Ko(n.open),...e,ref:St(t,s.onTriggerChange),onClick:u=>{e.onClick?.(u),!(e.disabled||u.defaultPrevented)&&(u.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:z(e.onPointerMove,nt(u=>{i.onItemEnter(u),!u.defaultPrevented&&!e.disabled&&!n.open&&!a.current&&(i.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{n.onOpenChange(!0),d()},100))})),onPointerLeave:z(e.onPointerLeave,nt(u=>{d();const p=n.content?.getBoundingClientRect();if(p){const x=n.content?.dataset.side,y=x==="right",h=y?-5:5,v=p[y?"left":"right"],w=p[y?"right":"left"];i.onPointerGraceIntentChange({area:[{x:u.clientX+h,y:u.clientY},{x:v,y:p.top},{x:w,y:p.top},{x:w,y:p.bottom},{x:v,y:p.bottom}],side:x}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(u),u.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:z(e.onKeyDown,u=>{const p=i.searchRef.current!=="";e.disabled||p&&u.key===" "||il[r.dir].includes(u.key)&&(n.onOpenChange(!0),n.content?.focus(),u.preventDefault())})})})});Ho.displayName=Xe;var Uo="MenuSubContent",Wo=f.forwardRef((e,t)=>{const n=Po(ne,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,i=Le(ne,e.__scopeMenu),a=ct(ne,e.__scopeMenu),c=Vo(Uo,e.__scopeMenu),m=f.useRef(null),l=X(t,m);return o.jsxRuntimeExports.jsx(tt.Provider,{scope:e.__scopeMenu,children:o.jsxRuntimeExports.jsx(ot,{present:r||i.open,children:o.jsxRuntimeExports.jsx(tt.Slot,{scope:e.__scopeMenu,children:o.jsxRuntimeExports.jsx(Mn,{id:c.contentId,"aria-labelledby":c.triggerId,...s,ref:l,align:"start",side:a.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:d=>{a.isUsingKeyboardRef.current&&m.current?.focus(),d.preventDefault()},onCloseAutoFocus:d=>d.preventDefault(),onFocusOutside:z(e.onFocusOutside,d=>{d.target!==c.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:z(e.onEscapeKeyDown,d=>{a.onClose(),d.preventDefault()}),onKeyDown:z(e.onKeyDown,d=>{const u=d.currentTarget.contains(d.target),p=al[a.dir].includes(d.key);u&&p&&(i.onOpenChange(!1),c.trigger?.focus(),d.preventDefault())})})})})})});Wo.displayName=Uo;function Ko(e){return e?"open":"closed"}function Mt(e){return e==="indeterminate"}function Pn(e){return Mt(e)?"indeterminate":e?"checked":"unchecked"}function Sl(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function Pl(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function Nl(e,t,n){const s=t.length>1&&Array.from(t).every(l=>l===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let a=Pl(e,Math.max(i,0));s.length===1&&(a=a.filter(l=>l!==n));const m=a.find(l=>l.toLowerCase().startsWith(s.toLowerCase()));return m!==n?m:void 0}function Al(e,t){const{x:n,y:r}=e;let s=!1;for(let i=0,a=t.length-1;i<t.length;a=i++){const c=t[i],m=t[a],l=c.x,d=c.y,u=m.x,p=m.y;d>r!=p>r&&n<(u-l)*(r-d)/(p-d)+l&&(s=!s)}return s}function Tl(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return Al(n,t)}function nt(e){return t=>t.pointerType==="mouse"?e(t):void 0}var kl=So,Dl=wn,_l=No,Il=Ao,Ol=Cn,Ll=To,Fl=Dt,zl=Do,$l=Io,Bl=Lo,Vl=zo,Hl=$o,Ul=Bo,Wl=Ho,Kl=Wo,_t="DropdownMenu",[Gl,Ku]=rt(_t,[Mo]),Y=Mo(),[Yl,Go]=Gl(_t),Yo=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:s,defaultOpen:i,onOpenChange:a,modal:c=!0}=e,m=Y(t),l=f.useRef(null),[d,u]=kr({prop:s,defaultProp:i??!1,onChange:a,caller:_t});return o.jsxRuntimeExports.jsx(Yl,{scope:t,triggerId:on(),triggerRef:l,contentId:on(),open:d,onOpenChange:u,onOpenToggle:f.useCallback(()=>u(p=>!p),[u]),modal:c,children:o.jsxRuntimeExports.jsx(kl,{...m,open:d,onOpenChange:u,dir:r,modal:c,children:n})})};Yo.displayName=_t;var qo="DropdownMenuTrigger",Xo=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...s}=e,i=Go(qo,n),a=Y(n);return o.jsxRuntimeExports.jsx(Dl,{asChild:!0,...a,children:o.jsxRuntimeExports.jsx(G.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...s,ref:St(t,i.triggerRef),onPointerDown:z(e.onPointerDown,c=>{!r&&c.button===0&&c.ctrlKey===!1&&(i.onOpenToggle(),i.open||c.preventDefault())}),onKeyDown:z(e.onKeyDown,c=>{r||(["Enter"," "].includes(c.key)&&i.onOpenToggle(),c.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(c.key)&&c.preventDefault())})})})});Xo.displayName=qo;var ql="DropdownMenuPortal",Qo=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Y(t);return o.jsxRuntimeExports.jsx(_l,{...r,...n})};Qo.displayName=ql;var Zo="DropdownMenuContent",Jo=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Go(Zo,n),i=Y(n),a=f.useRef(!1);return o.jsxRuntimeExports.jsx(Il,{id:s.contentId,"aria-labelledby":s.triggerId,...i,...r,ref:t,onCloseAutoFocus:z(e.onCloseAutoFocus,c=>{a.current||s.triggerRef.current?.focus(),a.current=!1,c.preventDefault()}),onInteractOutside:z(e.onInteractOutside,c=>{const m=c.detail.originalEvent,l=m.button===0&&m.ctrlKey===!0,d=m.button===2||l;(!s.modal||d)&&(a.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Jo.displayName=Zo;var Xl="DropdownMenuGroup",Ql=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Y(n);return o.jsxRuntimeExports.jsx(Ol,{...s,...r,ref:t})});Ql.displayName=Xl;var Zl="DropdownMenuLabel",es=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Y(n);return o.jsxRuntimeExports.jsx(Ll,{...s,...r,ref:t})});es.displayName=Zl;var Jl="DropdownMenuItem",ts=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Y(n);return o.jsxRuntimeExports.jsx(Fl,{...s,...r,ref:t})});ts.displayName=Jl;var eu="DropdownMenuCheckboxItem",tu=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Y(n);return o.jsxRuntimeExports.jsx(zl,{...s,...r,ref:t})});tu.displayName=eu;var nu="DropdownMenuRadioGroup",ru=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Y(n);return o.jsxRuntimeExports.jsx($l,{...s,...r,ref:t})});ru.displayName=nu;var ou="DropdownMenuRadioItem",su=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Y(n);return o.jsxRuntimeExports.jsx(Bl,{...s,...r,ref:t})});su.displayName=ou;var iu="DropdownMenuItemIndicator",au=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Y(n);return o.jsxRuntimeExports.jsx(Vl,{...s,...r,ref:t})});au.displayName=iu;var cu="DropdownMenuSeparator",ns=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Y(n);return o.jsxRuntimeExports.jsx(Hl,{...s,...r,ref:t})});ns.displayName=cu;var lu="DropdownMenuArrow",uu=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Y(n);return o.jsxRuntimeExports.jsx(Ul,{...s,...r,ref:t})});uu.displayName=lu;var du="DropdownMenuSubTrigger",fu=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Y(n);return o.jsxRuntimeExports.jsx(Wl,{...s,...r,ref:t})});fu.displayName=du;var mu="DropdownMenuSubContent",pu=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Y(n);return o.jsxRuntimeExports.jsx(Kl,{...s,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});pu.displayName=mu;var xu=Yo,hu=Xo,vu=Qo,gu=Jo,yu=es,bu=ts,Eu=ns;function Qt({...e}){return o.jsxRuntimeExports.jsx(xu,{"data-slot":"dropdown-menu",...e})}function Zt({...e}){return o.jsxRuntimeExports.jsx(hu,{"data-slot":"dropdown-menu-trigger",...e})}function Jt({className:e,sideOffset:t=4,...n}){return o.jsxRuntimeExports.jsx(vu,{children:o.jsxRuntimeExports.jsx(gu,{"data-slot":"dropdown-menu-content",sideOffset:t,className:C.cn$1("data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-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 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=closed]:animate-out data-[state=open]:animate-in",e),...n})})}function ht({className:e,inset:t,variant:n="default",...r}){return o.jsxRuntimeExports.jsx(bu,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":n,className:C.cn$1("data-[variant=destructive]:*:[svg]:!text-destructive relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[inset]:pl-8 data-[variant=destructive]:text-destructive data-[disabled]:opacity-50 data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0",e),...r})}function en({className:e,inset:t,...n}){return o.jsxRuntimeExports.jsx(yu,{"data-slot":"dropdown-menu-label","data-inset":t,className:C.cn$1("px-2 py-1.5 font-medium text-sm data-[inset]:pl-8",e),...n})}function tn({className:e,...t}){return o.jsxRuntimeExports.jsx(Eu,{"data-slot":"dropdown-menu-separator",className:C.cn$1("-mx-1 my-1 h-px bg-border",e),...t})}function rs({delayDuration:e=0,...t}){return o.jsxRuntimeExports.jsx(V.Provider,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function oe({...e}){return o.jsxRuntimeExports.jsx(rs,{children:o.jsxRuntimeExports.jsx(V.Root,{"data-slot":"tooltip",...e})})}function se({...e}){return o.jsxRuntimeExports.jsx(V.Trigger,{"data-slot":"tooltip-trigger",...e})}function ie({className:e,sideOffset:t=0,children:n,...r}){return o.jsxRuntimeExports.jsx(V.Portal,{children:o.jsxRuntimeExports.jsxs(V.Content,{"data-slot":"tooltip-content",sideOffset:t,className:C.cn$1("fade-in-0 zoom-in-95 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 w-fit origin-(--radix-tooltip-content-transform-origin) animate-in text-balance rounded-md bg-primary px-3 py-1.5 text-primary-foreground text-xs data-[state=closed]:animate-out",e),...r,children:[n,o.jsxRuntimeExports.jsx(V.Arrow,{className:"z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-primary fill-primary"})]})})}function mr({className:e,defaultValue:t,value:n,min:r=0,max:s=100,...i}){const a=f.useMemo(()=>Array.isArray(n)?n:Array.isArray(t)?t:[r,s],[n,t,r,s]);return o.jsxRuntimeExports.jsxs(te.Root,{"data-slot":"slider",defaultValue:t,value:n,min:r,max:s,className:C.cn$1("relative flex w-full touch-none select-none items-center data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col data-[disabled]:opacity-50",e),...i,children:[o.jsxRuntimeExports.jsx(te.Track,{"data-slot":"slider-track",className:C.cn$1("relative grow overflow-hidden rounded-full bg-muted data-[orientation=horizontal]:h-1.5 data-[orientation=vertical]:h-full data-[orientation=horizontal]:w-full data-[orientation=vertical]:w-1.5"),children:o.jsxRuntimeExports.jsx(te.Range,{"data-slot":"slider-range",className:C.cn$1("absolute bg-primary data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full")})}),Array.from({length:a.length},(c,m)=>o.jsxRuntimeExports.jsx(te.Thumb,{"data-slot":"slider-thumb",className:"block size-4 shrink-0 rounded-full border border-primary bg-background shadow-sm ring-ring/50 transition-[color,box-shadow] hover:ring-4 focus-visible:outline-hidden focus-visible:ring-4 disabled:pointer-events-none disabled:opacity-50"},m))]})}const pr=({className:e,...t})=>o.jsxRuntimeExports.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",className:C.cn$1("size-6",e),...t,children:o.jsxRuntimeExports.jsx("path",{d:"M8 5.14v13.72c0 .45.54.67.85.35l8.56-8.86a.5.5 0 0 0 0-.7L8.85 4.79c-.31-.32-.85-.1-.85.35z"})}),xr=({className:e,...t})=>o.jsxRuntimeExports.jsxs("svg",{viewBox:"0 0 24 24",fill:"currentColor",className:C.cn$1("size-6",e),...t,children:[o.jsxRuntimeExports.jsx("rect",{x:"6",y:"4",width:"4",height:"16",rx:"1"}),o.jsxRuntimeExports.jsx("rect",{x:"14",y:"4",width:"4",height:"16",rx:"1"})]}),wu=({className:e,...t})=>o.jsxRuntimeExports.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",className:C.cn$1("size-6",e),...t,children:o.jsxRuntimeExports.jsx("path",{d:"M3 9v6h4l5 5V4L7 9H3zm13.5 3c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02zM14 3.23v2.06c2.89.86 5 3.54 5 6.71s-2.11 5.85-5 6.71v2.06c4.01-.91 7-4.49 7-8.77s-2.99-7.86-7-8.77z"})}),ju=({className:e,...t})=>o.jsxRuntimeExports.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",className:C.cn$1("size-6",e),...t,children:o.jsxRuntimeExports.jsx("path",{d:"M16.5 12c0-1.77-1.02-3.29-2.5-4.03v2.21l2.45 2.45c.03-.2.05-.41.05-.63zm2.5 0c0 .94-.2 1.82-.54 2.64l1.51 1.51C20.63 14.91 21 13.5 21 12c0-4.28-2.99-7.86-7-8.77v2.06c2.89.86 5 3.54 5 6.71zM4.27 3L3 4.27 7.73 9H3v6h4l5 5v-6.73l4.25 4.25c-.67.52-1.42.93-2.25 1.18v2.06c1.38-.31 2.63-.95 3.69-1.81L19.73 21 21 19.73l-9-9L4.27 3zM12 4L9.91 6.09 12 8.18V4z"})}),Ru=({className:e,...t})=>o.jsxRuntimeExports.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",className:C.cn$1("size-6",e),...t,children:o.jsxRuntimeExports.jsx("path",{d:"M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"})}),Mu=({className:e,...t})=>o.jsxRuntimeExports.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",className:C.cn$1("size-6",e),...t,children:o.jsxRuntimeExports.jsx("path",{d:"M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z"})}),Cu=({className:e,...t})=>o.jsxRuntimeExports.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",className:C.cn$1("size-6",e),...t,children:o.jsxRuntimeExports.jsx("path",{d:"M19 7h-8v6h8V7zm2-4H3c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H3V5h18v14z"})}),Su=({className:e,...t})=>o.jsxRuntimeExports.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",className:C.cn$1("size-6",e),...t,children:o.jsxRuntimeExports.jsxs("g",{children:[o.jsxRuntimeExports.jsx("path",{d:"M18 13c0 3.31-2.69 6-6 6s-6-2.69-6-6 2.69-6 6-6v4l5-5-5-5v4c-4.42 0-8 3.58-8 8s3.58 8 8 8 8-3.58 8-8h-2z"}),o.jsxRuntimeExports.jsx("path",{d:"M10.86 15v-2.5h-1.5V15h1.5zm2.49-2.62c.24-.23.39-.5.39-.81 0-.32-.15-.59-.39-.82s-.53-.35-.88-.35c-.34 0-.64.12-.87.35s-.35.51-.35.82v.23c0 .16.02.3.06.41l.99-.28c-.02-.08-.03-.19-.03-.34 0-.14.05-.25.14-.34.09-.08.21-.13.35-.13s.26.05.35.13c.09.09.14.2.14.34s-.05.25-.14.34l-1.08 1.08c-.07.07-.12.14-.17.22s-.08.16-.1.24-.04.18-.04.28v.21h1.85v-.66h-.92l.59-.59z"})]})}),Pu=({className:e,...t})=>o.jsxRuntimeExports.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",className:C.cn$1("size-6",e),...t,children:o.jsxRuntimeExports.jsxs("g",{children:[o.jsxRuntimeExports.jsx("path",{d:"M12 5V1L7 6l5 5V7c3.31 0 6 2.69 6 6s-2.69 6-6 6-6-2.69-6-6H4c0 4.42 3.58 8 8 8s8-3.58 8-8-3.58-8-8-8z"}),o.jsxRuntimeExports.jsx("path",{d:"M10.89 16h-1.5v-2.5h-2v-1h3.5V16zm2.5-4.5V16h-1.5v-4.5h1.5z"})]})}),Nu=({className:e,...t})=>o.jsxRuntimeExports.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",className:C.cn$1("size-6",e),...t,children:o.jsxRuntimeExports.jsx("path",{d:"M20 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zM4 12h4v2H4v-2zm10 6H4v-2h10v2zm6 0h-4v-2h4v2zm0-4H10v-2h10v2z"})}),Au=({className:e,...t})=>o.jsxRuntimeExports.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",className:C.cn$1("size-6",e),...t,children:o.jsxRuntimeExports.jsx("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-8 12.5v-7c0-.55.45-1 1-1s1 .45 1 1v7c0 .55-.45 1-1 1s-1-.45-1-1zM7 11h1.5v3.5h1v-3.5H11v-1H7v1zm8.5 4.5H17v-1h-1.5v-1H17v-1h-1.5v-1H17v-1h-2.5c-.55 0-1 .45-1 1v4c0 .55.45 1 1 1z"})}),Tu=({className:e,...t})=>o.jsxRuntimeExports.jsxs("svg",{viewBox:"0 0 24 24",fill:"currentColor",className:C.cn$1("size-6",e),...t,children:[o.jsxRuntimeExports.jsx("path",{d:"M15.96 10.29l-2.75 3.08c-.31.34-.81.34-1.12 0-.31-.34-.31-.89 0-1.23l2.75-3.08c1.31-1.46 3.58-.21 3.58 1.75 0 .89-.36 1.79-1.07 2.5l-6.88 6.88c-.71.71-1.61 1.07-2.5 1.07-1.96 0-3.21-2.27-1.75-3.58l3.08-2.75c.34-.31.89-.31 1.23 0 .34.31.34.81 0 1.12l-3.08 2.75c-.35.39.07 1.04.58.79l6.88-6.88c.36-.36.52-.82.52-1.25 0-.51-.65-.93-1.04-.58z"}),o.jsxRuntimeExports.jsx("text",{x:"12",y:"10",fontSize:"8",textAnchor:"middle",fill:"currentColor",fontWeight:"bold",children:"1x"})]}),ku=({className:e,...t})=>o.jsxRuntimeExports.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",className:C.cn$1("size-6",e),...t,children:o.jsxRuntimeExports.jsx("path",{d:"M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z"})}),Du=({className:e,...t})=>o.jsxRuntimeExports.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",className:C.cn$1("size-6",e),...t,children:o.jsxRuntimeExports.jsx("path",{d:"M18 16.08c-.76 0-1.44.3-1.96.77L8.91 12.7c.05-.23.09-.46.09-.7s-.04-.47-.09-.7l7.05-4.11c.54.5 1.25.81 2.04.81 1.66 0 3-1.34 3-3s-1.34-3-3-3-3 1.34-3 3c0 .24.04.47.09.7L8.04 9.81C7.5 9.31 6.79 9 6 9c-1.66 0-3 1.34-3 3s1.34 3 3 3c.79 0 1.5-.31 2.04-.81l7.12 4.16c-.05.21-.08.43-.08.65 0 1.61 1.31 2.92 2.92 2.92 1.61 0 2.92-1.31 2.92-2.92s-1.31-2.92-2.92-2.92z"})}),hr=({className:e,...t})=>o.jsxRuntimeExports.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:C.cn$1("size-6 animate-spin",e),...t,children:o.jsxRuntimeExports.jsx("path",{d:"M12 2a10 10 0 1 0 10 10"})}),_u=E.lazy(()=>import("react-player"));function Iu({className:e,containerClassName:t,url:n,playing:r=!1,volume:s=1,muted:i=!1,controls:a=!1,light:c=!1,loop:m=!1,playbackRate:l=1,width:d="100%",height:u="100%",style:p,progressInterval:x=1e3,playsinline:y=!0,pip:h=!1,stopOnUnmount:v=!0,fallback:w=o.jsxRuntimeExports.jsx(hr,{className:"size-12 text-white"}),wrapper:j="div",config:b,showDownload:g=!1,showShare:R=!1,showSubtitles:P=!1,showQuality:M=!1,onDownload:S,onShare:F,qualityOptions:D=[{label:"1080p",value:"1080"},{label:"720p",value:"720"},{label:"480p",value:"480"},{label:"360p",value:"360"}],subtitleTracks:_=[],onReady:B,onStart:$,onPlay:T,onProgress:O,onDuration:k,onPause:I,onBuffer:N,onBufferEnd:A,onSeek:W,onPlaybackRateChange:J,onEnded:ve,onError:Ne,onClickPreview:Ae,onEnablePIP:Fe,onDisablePIP:ge,...H}){const[K,Te]=E.useState(r),[je,Ye]=E.useState(s),[ue,Re]=E.useState(i),[Nn,vs]=E.useState(0),[ke,gs]=E.useState(0),[ys,bs]=E.useState(0),[An,Tn]=E.useState(!1),[kn,It]=E.useState(h),[Dn,_n]=E.useState(l),[Es,Ot]=E.useState(!0),[ws,lt]=E.useState(!0),[js,Rs]=E.useState(D[0]?.value||"720"),[Hu,In]=E.useState(null),ze=E.useRef(null),Lt=E.useRef(null),qe=E.useRef(null),On=L=>{const ee=new Date(L*1e3),Ln=ee.getUTCHours(),Fn=ee.getUTCMinutes(),zn=ee.getUTCSeconds().toString().padStart(2,"0");return Ln?`${Ln}:${Fn.toString().padStart(2,"0")}:${zn}`:`${Fn}:${zn}`},Ms=()=>{Ot(!0),qe.current&&clearTimeout(qe.current),K&&(qe.current=setTimeout(()=>{Ot(!1)},3e3))};E.useEffect(()=>()=>{qe.current&&clearTimeout(qe.current)},[]);const Ft=()=>{document.fullscreenElement?(document.exitFullscreen(),Tn(!1)):(Lt.current?.requestFullscreen(),Tn(!0))};E.useEffect(()=>{const L=ee=>{if(Lt.current?.contains(document.activeElement))switch(ee.key.toLowerCase()){case" ":case"k":ee.preventDefault(),Te(!K);break;case"f":ee.preventDefault(),Ft();break;case"m":ee.preventDefault(),Re(!ue);break;case"arrowleft":ee.preventDefault(),ze.current?.seekTo(ke-10);break;case"arrowright":ee.preventDefault(),ze.current?.seekTo(ke+10);break;case"arrowup":ee.preventDefault(),Ye(Math.min(1,je+.1));break;case"arrowdown":ee.preventDefault(),Ye(Math.max(0,je-.1));break}};return window.addEventListener("keydown",L),()=>window.removeEventListener("keydown",L)},[K,ue,ke,je,Ft]);const Cs=[.5,.75,1,1.25,1.5,2];return o.jsxRuntimeExports.jsx(rs,{children:o.jsxRuntimeExports.jsxs("div",{ref:Lt,className:C.cn("relative overflow-hidden rounded-lg bg-black","focus-within:outline-none",t),onMouseMove:Ms,onMouseLeave:()=>K&&Ot(!1),tabIndex:0,children:[o.jsxRuntimeExports.jsx(E.Suspense,{fallback:w,children:o.jsxRuntimeExports.jsx(_u,{ref:ze,url:n,playing:K,volume:ue?0:je,muted:ue,controls:!1,light:c,loop:m,playbackRate:Dn,width:d,height:u,style:{...p,aspectRatio:"16/9"},progressInterval:x,playsinline:y,pip:kn,stopOnUnmount:v,fallback:w,wrapper:j,config:b,className:C.cn("aspect-video",e),onReady:()=>{lt(!1),B?.()},onStart:()=>{lt(!1),$?.()},onPlay:()=>{Te(!0),T?.()},onPause:()=>{Te(!1),I?.()},onProgress:L=>{gs(L.playedSeconds),bs(L.loaded),O?.(L)},onDuration:L=>{vs(L),k?.(L)},onBuffer:()=>{lt(!0),N?.()},onBufferEnd:()=>{lt(!1),A?.()},onSeek:W,onPlaybackRateChange:L=>{_n(L),J?.(L)},onEnded:ve,onError:Ne,onClickPreview:Ae,onEnablePIP:()=>{It(!0),Fe?.()},onDisablePIP:()=>{It(!1),ge?.()},...H})}),ws&&o.jsxRuntimeExports.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-black/50",children:o.jsxRuntimeExports.jsx(hr,{className:"size-12 text-white"})}),o.jsxRuntimeExports.jsxs("div",{className:C.cn("absolute inset-0 bg-gradient-to-t from-black/80 via-transparent to-black/20","transition-opacity duration-300",Es?"opacity-100":"pointer-events-none opacity-0"),children:[o.jsxRuntimeExports.jsxs("div",{className:"absolute top-0 right-0 left-0 flex items-center justify-between p-4",children:[o.jsxRuntimeExports.jsx("h3",{className:"font-medium text-lg text-white",children:"Media Player"}),o.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-2",children:[R&&o.jsxRuntimeExports.jsxs(oe,{children:[o.jsxRuntimeExports.jsx(se,{asChild:!0,children:o.jsxRuntimeExports.jsx(q,{variant:"ghost",size:"icon",className:"pixel-button rounded-none border border-gray-600/50 bg-gray-800/80 text-white shadow-lg transition-all duration-150 hover:border-gray-500 hover:bg-gray-700/80 active:scale-95",onClick:F,children:o.jsxRuntimeExports.jsx(Du,{className:"size-5"})})}),o.jsxRuntimeExports.jsx(ie,{children:"Share"})]}),g&&o.jsxRuntimeExports.jsxs(oe,{children:[o.jsxRuntimeExports.jsx(se,{asChild:!0,children:o.jsxRuntimeExports.jsx(q,{variant:"ghost",size:"icon",className:"pixel-button rounded-none border border-gray-600/50 bg-gray-800/80 text-white shadow-lg transition-all duration-150 hover:border-gray-500 hover:bg-gray-700/80 active:scale-95",onClick:S,children:o.jsxRuntimeExports.jsx(ku,{className:"size-5"})})}),o.jsxRuntimeExports.jsx(ie,{children:"Download"})]})]})]}),o.jsxRuntimeExports.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:o.jsxRuntimeExports.jsx(q,{variant:"ghost",size:"icon",className:"pixel-button size-20 rounded-none border-2 border-gray-600 bg-gray-800/90 text-white shadow-xl transition-all duration-200 hover:scale-105 hover:border-gray-500 hover:bg-gray-700/90 active:scale-95",onClick:()=>Te(!K),children:K?o.jsxRuntimeExports.jsx(xr,{className:"size-10"}):o.jsxRuntimeExports.jsx(pr,{className:"size-10"})})}),o.jsxRuntimeExports.jsxs("div",{className:"absolute right-0 bottom-0 left-0 space-y-2 p-4",children:[o.jsxRuntimeExports.jsxs("div",{className:"relative",children:[o.jsxRuntimeExports.jsx(mr,{value:[ke],max:Nn,step:1,onValueChange:([L])=>{typeof L=="number"&&ze.current?.seekTo(L)},className:"pixel-progress cursor-pointer [&>span]:rounded-none [&>span]:border [&>span]:border-gray-600 [&>span]:bg-gray-800 [&>span]:shadow-lg [&_[role=slider]]:size-4 [&_[role=slider]]:rounded-none [&_[role=slider]]:border-2 [&_[role=slider]]:border-gray-400 [&_[role=slider]]:bg-white [&_[role=slider]]:shadow-md"}),o.jsxRuntimeExports.jsx("div",{className:"pointer-events-none absolute top-0 left-0 h-full rounded-none border border-gray-500/30 bg-white/20",style:{width:`${ys*100}%`}})]}),o.jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-2",children:[o.jsxRuntimeExports.jsxs(oe,{children:[o.jsxRuntimeExports.jsx(se,{asChild:!0,children:o.jsxRuntimeExports.jsx(q,{variant:"ghost",size:"icon",className:"pixel-button rounded-none border border-gray-600/50 bg-gray-800/80 text-white shadow-lg transition-all duration-150 hover:border-gray-500 hover:bg-gray-700/80 active:scale-95",onClick:()=>Te(!K),children:K?o.jsxRuntimeExports.jsx(xr,{className:"size-6"}):o.jsxRuntimeExports.jsx(pr,{className:"size-6"})})}),o.jsxRuntimeExports.jsx(ie,{children:K?"Pause (k)":"Play (k)"})]}),o.jsxRuntimeExports.jsxs(oe,{children:[o.jsxRuntimeExports.jsx(se,{asChild:!0,children:o.jsxRuntimeExports.jsx(q,{variant:"ghost",size:"icon",className:"pixel-button rounded-none border border-gray-600/50 bg-gray-800/80 text-white shadow-lg transition-all duration-150 hover:border-gray-500 hover:bg-gray-700/80 active:scale-95",onClick:()=>ze.current?.seekTo(ke-10),children:o.jsxRuntimeExports.jsx(Pu,{className:"size-6"})})}),o.jsxRuntimeExports.jsx(ie,{children:"Back 10s (←)"})]}),o.jsxRuntimeExports.jsxs(oe,{children:[o.jsxRuntimeExports.jsx(se,{asChild:!0,children:o.jsxRuntimeExports.jsx(q,{variant:"ghost",size:"icon",className:"pixel-button rounded-none border border-gray-600/50 bg-gray-800/80 text-white shadow-lg transition-all duration-150 hover:border-gray-500 hover:bg-gray-700/80 active:scale-95",onClick:()=>ze.current?.seekTo(ke+10),children:o.jsxRuntimeExports.jsx(Su,{className:"size-6"})})}),o.jsxRuntimeExports.jsx(ie,{children:"Forward 10s (→)"})]}),o.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-2",children:[o.jsxRuntimeExports.jsxs(oe,{children:[o.jsxRuntimeExports.jsx(se,{asChild:!0,children:o.jsxRuntimeExports.jsx(q,{variant:"ghost",size:"icon",className:"pixel-button rounded-none border border-gray-600/50 bg-gray-800/80 text-white shadow-lg transition-all duration-150 hover:border-gray-500 hover:bg-gray-700/80 active:scale-95",onClick:()=>Re(!ue),children:ue||je===0?o.jsxRuntimeExports.jsx(ju,{className:"size-6"}):o.jsxRuntimeExports.jsx(wu,{className:"size-6"})})}),o.jsxRuntimeExports.jsx(ie,{children:ue?"Unmute (m)":"Mute (m)"})]}),o.jsxRuntimeExports.jsx(mr,{value:[ue?0:je],max:1,step:.05,onValueChange:([L])=>{typeof L=="number"&&(Ye(L),Re(L===0))},className:"pixel-progress w-20 cursor-pointer [&>span]:rounded-none [&>span]:border [&>span]:border-gray-600 [&>span]:bg-gray-800 [&>span]:shadow-lg [&_[role=slider]]:size-3 [&_[role=slider]]:rounded-none [&_[role=slider]]:border-2 [&_[role=slider]]:border-gray-400 [&_[role=slider]]:bg-white [&_[role=slider]]:shadow-md"})]}),o.jsxRuntimeExports.jsxs("span",{className:"pixel-time-display rounded-none border border-gray-600/50 bg-gray-900/80 px-2 py-1 font-mono text-sm text-white shadow-lg",children:[On(ke)," / ",On(Nn)]})]}),o.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-2",children:[P&&_.length>0&&o.jsxRuntimeExports.jsxs(Qt,{children:[o.jsxRuntimeExports.jsxs(oe,{children:[o.jsxRuntimeExports.jsx(se,{asChild:!0,children:o.jsxRuntimeExports.jsx(Zt,{asChild:!0,children:o.jsxRuntimeExports.jsx(q,{variant:"ghost",size:"icon",className:"pixel-button rounded-none border border-gray-600/50 bg-gray-800/80 text-white shadow-lg transition-all duration-150 hover:border-gray-500 hover:bg-gray-700/80 active:scale-95",children:o.jsxRuntimeExports.jsx(Nu,{className:"size-6"})})})}),o.jsxRuntimeExports.jsx(ie,{children:"Subtitles"})]}),o.jsxRuntimeExports.jsxs(Jt,{children:[o.jsxRuntimeExports.jsx(en,{children:"Subtitles"}),o.jsxRuntimeExports.jsx(tn,{}),o.jsxRuntimeExports.jsx(ht,{onClick:()=>In(null),children:"Off"}),_.map(L=>o.jsxRuntimeExports.jsx(ht,{onClick:()=>In(L.value),children:L.label},L.value))]})]}),M&&o.jsxRuntimeExports.jsxs(Qt,{children:[o.jsxRuntimeExports.jsxs(oe,{children:[o.jsxRuntimeExports.jsx(se,{asChild:!0,children:o.jsxRuntimeExports.jsx(Zt,{asChild:!0,children:o.jsxRuntimeExports.jsx(q,{variant:"ghost",size:"icon",className:"pixel-button rounded-none border border-gray-600/50 bg-gray-800/80 text-white shadow-lg transition-all duration-150 hover:border-gray-500 hover:bg-gray-700/80 active:scale-95",children:o.jsxRuntimeExports.jsx(Au,{className:"size-6"})})})}),o.jsxRuntimeExports.jsx(ie,{children:"Quality"})]}),o.jsxRuntimeExports.jsxs(Jt,{children:[o.jsxRuntimeExports.jsx(en,{children:"Quality"}),o.jsxRuntimeExports.jsx(tn,{}),D.map(L=>o.jsxRuntimeExports.jsxs(ht,{onClick:()=>Rs(L.value),children:[L.label," ",js===L.value&&"✓"]},L.value))]})]}),o.jsxRuntimeExports.jsxs(Qt,{children:[o.jsxRuntimeExports.jsxs(oe,{children:[o.jsxRuntimeExports.jsx(se,{asChild:!0,children:o.jsxRuntimeExports.jsx(Zt,{asChild:!0,children:o.jsxRuntimeExports.jsx(q,{variant:"ghost",size:"icon",className:"pixel-button rounded-none border border-gray-600/50 bg-gray-800/80 text-white shadow-lg transition-all duration-150 hover:border-gray-500 hover:bg-gray-700/80 active:scale-95",children:o.jsxRuntimeExports.jsx(Tu,{className:"size-6"})})})}),o.jsxRuntimeExports.jsx(ie,{children:"Playback Speed"})]}),o.jsxRuntimeExports.jsxs(Jt,{children:[o.jsxRuntimeExports.jsx(en,{children:"Speed"}),o.jsxRuntimeExports.jsx(tn,{}),Cs.map(L=>o.jsxRuntimeExports.jsxs(ht,{onClick:()=>_n(L),children:[L,"x ",Dn===L&&"✓"]},L))]})]}),o.jsxRuntimeExports.jsxs(oe,{children:[o.jsxRuntimeExports.jsx(se,{asChild:!0,children:o.jsxRuntimeExports.jsx(q,{variant:"ghost",size:"icon",className:"pixel-button rounded-none border border-gray-600/50 bg-gray-800/80 text-white shadow-lg transition-all duration-150 hover:border-gray-500 hover:bg-gray-700/80 active:scale-95",onClick:()=>It(!kn),children:o.jsxRuntimeExports.jsx(Cu,{className:"size-6"})})}),o.jsxRuntimeExports.jsx(ie,{children:"Picture in Picture"})]}),o.jsxRuntimeExports.jsxs(oe,{children:[o.jsxRuntimeExports.jsx(se,{asChild:!0,children:o.jsxRuntimeExports.jsx(q,{variant:"ghost",size:"icon",className:"pixel-button rounded-none border border-gray-600/50 bg-gray-800/80 text-white shadow-lg transition-all duration-150 hover:border-gray-500 hover:bg-gray-700/80 active:scale-95",onClick:Ft,children:An?o.jsxRuntimeExports.jsx(Mu,{className:"size-6"}):o.jsxRuntimeExports.jsx(Ru,{className:"size-6"})})}),o.jsxRuntimeExports.jsx(ie,{children:An?"Exit Fullscreen (f)":"Fullscreen (f)"})]})]})]})]})]})]})})}function os({src:e,type:t="video/mp4"}){const n=E.useRef(null),r=E.useRef(null);return E.useEffect(()=>((async()=>{if(!n.current||r.current)return;const i=(await import("video.js")).default,a=i(n.current,{controls:!0,autoplay:!1,preload:"auto",fluid:!0,sources:[{src:e,type:t}]});r.current=a,a.ready(()=>{console.log("Player is ready!")})})(),()=>{r.current&&(r.current.dispose(),r.current=null)}),[e,t]),o.jsxRuntimeExports.jsx("div",{className:"w-full",children:o.jsxRuntimeExports.jsx("div",{"data-vjs-player":!0,children:o.jsxRuntimeExports.jsx("video",{ref:n,className:"video-js vjs-big-play-centered vjs-default-skin w-full",playsInline:!0})})})}os.displayName="SimpleVideoPlayer";const ss=E.memo(E.forwardRef(({isFullscreen:e,onToggle:t,disabled:n=!1,size:r="lg",className:s},i)=>{const a={md:"h-11 w-11",lg:"h-12 w-12",xl:"h-14 w-14"},c={md:20,lg:24,xl:28},m=E.useMemo(()=>({button:a[r]||a.lg,icon:c[r]||c.lg}),[r]),l=E.useMemo(()=>e?ni:ei,[e]),d=E.useMemo(()=>e?"Exit fullscreen":"Enter fullscreen",[e]),u=E.useMemo(()=>e?"Exit fullscreen":"Enter fullscreen",[e]);return o.jsxRuntimeExports.jsx(V.Provider,{children:o.jsxRuntimeExports.jsxs(V.Root,{children:[o.jsxRuntimeExports.jsx(V.Trigger,{asChild:!0,children:o.jsxRuntimeExports.jsx("button",{ref:i,type:"button",onClick:t,disabled:n,className:C.cn("inline-flex items-center justify-center rounded-lg bg-transparent p-0 text-white transition-all hover:text-cyan-700 active:scale-95","focus:outline-none focus:ring-2 focus:ring-white/50 focus:ring-offset-2 focus:ring-offset-black/20","disabled:cursor-not-allowed disabled:opacity-50",m.button,s),"aria-label":d,children:o.jsxRuntimeExports.jsx(l,{size:m.icon})})}),o.jsxRuntimeExports.jsx(V.Portal,{children:o.jsxRuntimeExports.jsxs(V.Content,{className:C.cn("rounded bg-black/80 px-2 py-1 text-sm text-white","fade-in-0 zoom-in-95 animate-in"),sideOffset:5,children:[u,o.jsxRuntimeExports.jsx(V.Arrow,{className:"fill-black/80"})]})})]})})}));ss.displayName="FullscreenButton";const Ou=ss,vr={sm:{button:"size-8",icon:16},md:{button:"size-10",icon:20},lg:{button:"size-12",icon:24},xl:{button:"size-16",icon:32}},is=E.memo(E.forwardRef(({isPlaying:e,onToggle:t,disabled:n=!1,size:r="lg",className:s},i)=>{const a=E.useMemo(()=>vr[r]||vr.lg,[r]),c=E.useMemo(()=>e?"Pause media":"Play media",[e]);return o.jsxRuntimeExports.jsxs("button",{ref:i,type:"button",onClick:t,disabled:n,"data-state":e?"playing":"paused",className:C.cn("group relative inline-flex items-center justify-center","glass-strong media-control rounded-full contain-layout","focus-ring touch-manipulation",a.button,"text-[color:var(--media-text)] transition-all duration-300","bg-[color:var(--media-control-bg)] backdrop-blur-sm","border border-[color:var(--media-border)]/30","hover:bg-[color:var(--media-control-hover)]","hover:border-[color:var(--media-border)]/50","hover:shadow-[color:var(--media-bg)]/20 hover:shadow-lg","hover:-translate-y-0.5 hover:scale-105","active:bg-[color:var(--media-control-active)]","active:translate-y-0 active:scale-100","focus-visible:ring-2 focus-visible:ring-[color:var(--media-focus)]","focus-visible:ring-offset-2 focus-visible:ring-offset-[color:var(--media-bg)]","disabled:cursor-not-allowed disabled:opacity-50","disabled:hover:translate-y-0 disabled:hover:scale-100","disabled:hover:bg-[color:var(--media-control-bg)]",s),"aria-label":c,"aria-pressed":e,children:[o.jsxRuntimeExports.jsx("div",{className:C.cn("absolute inset-0 rounded-full opacity-0 transition-opacity duration-300","bg-gradient-to-br from-[color:var(--color-media-play)] to-[color:var(--color-media-pause)]","blur-sm group-hover:opacity-20",e&&"opacity-10")}),e?o.jsxRuntimeExports.jsx(oi,{size:a.icon,className:C.cn("relative z-10 fill-current transition-all duration-200","text-[color:var(--color-media-pause)]","group-hover:scale-110 group-active:scale-95","drop-shadow-sm")}):o.jsxRuntimeExports.jsx(ii,{size:a.icon,className:C.cn("relative z-10 fill-current transition-all duration-200","ml-0.5 text-[color:var(--color-media-play)]","group-hover:scale-110 group-active:scale-95","drop-shadow-sm")}),o.jsxRuntimeExports.jsx("div",{className:C.cn("absolute inset-0 rounded-full opacity-0","scale-75 bg-[color:var(--media-text)]/10","group-active:scale-100 group-active:opacity-100","transition-all duration-150 ease-out")})]})}));is.displayName="PlayButton";const Lu=is,as=E.memo(E.forwardRef(({currentTime:e,duration:t,buffered:n,onSeek:r,size:s="sm",className:i},a)=>{const[c,m]=E.useState(!1),[l,d]=E.useState(0),[u,p]=E.useState(!1);E.useDeferredValue(l);const x=E.useMemo(()=>({trackHeight:s==="sm"?"h-1":s==="md"?"h-1.5":"h-2",thumbSize:s==="sm"?"size-3":s==="md"?"size-4":"size-5",trackHoverHeight:"h-1.5"}),[s]),y=E.useMemo(()=>t>0?e/t*100:0,[e,t]),h=E.useMemo(()=>{const M=[];if(n&&t>0)for(let S=0;S<n.length;S++){const F=n.start(S)/t*100,D=n.end(S)/t*100;M.push({start:F,end:D})}return M},[n,t]),v=E.useCallback(([M])=>{const S=(M??0)/100*t;d(S),c&&r(S)},[t,c,r]),w=E.useCallback(([M])=>{const S=(M??0)/100*t;r(S),m(!1)},[t,r]),j=E.useCallback(()=>{m(!0)},[]),b=E.useCallback(()=>p(!0),[]),g=E.useCallback(()=>p(!1),[]),R=E.useMemo(()=>C.formatTime(e),[e]),P=E.useMemo(()=>C.formatTime(t),[t]);return o.jsxRuntimeExports.jsx("div",{ref:a,className:C.cn("media-container relative w-full text-[color:var(--media-text)]","touch-manipulation contain-layout",i),onMouseEnter:b,onMouseLeave:g,role:"group","aria-label":"Seek bar",children:o.jsxRuntimeExports.jsx(V.Provider,{children:o.jsxRuntimeExports.jsxs(V.Root,{children:[o.jsxRuntimeExports.jsx(V.Trigger,{asChild:!0,children:o.jsxRuntimeExports.jsx("div",{className:"relative animate-enter",children:o.jsxRuntimeExports.jsxs(te.Root,{className:C.cn("group relative flex w-full touch-none select-none items-center","focus-ring cursor-pointer",x.trackHeight),value:[y],max:100,step:.1,onValueChange:v,onValueCommit:w,onPointerDown:j,"aria-label":"Seek to position","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(y),"aria-valuetext":`${R} of ${P}`,"aria-orientation":"horizontal",children:[o.jsxRuntimeExports.jsxs(te.Track,{className:C.cn("relative grow overflow-hidden rounded-full","bg-[color:var(--media-control-bg)]/40 backdrop-blur-sm","border border-[color:var(--media-border)]/20","shadow-inner transition-all duration-300 ease-out",x.trackHoverHeight,"group-hover:bg-[color:var(--media-control-bg)]/60","group-hover:border-[color:var(--media-border)]/40"),children:[h.map((M,S)=>o.jsxRuntimeExports.jsx("div",{className:C.cn("absolute h-full rounded-full transition-all duration-500","bg-[color:var(--color-media-buffered)] shadow-inner","opacity-60 group-hover:opacity-80"),style:{left:`${M.start}%`,width:`${M.end-M.start}%`}},S)),o.jsxRuntimeExports.jsx(te.Range,{className:C.cn("absolute h-full rounded-full transition-all duration-300","bg-gradient-to-r from-[color:var(--color-media-progress)] to-[color:var(--color-brand-accent)]","shadow-[color:var(--color-brand-primary)]/20 shadow-lg","group-hover:shadow-xl")})]}),o.jsxRuntimeExports.jsx(te.Thumb,{className:C.cn("block rounded-full border-white/20 bg-white","shadow-lg hover:shadow-xl",x.thumbSize,"opacity-0 group-hover:opacity-100","hover:scale-110 hover:bg-white/95 active:scale-95","focus:opacity-100 focus:outline-none focus:ring-2 focus:ring-white/50","focus:ring-offset-2 focus:ring-offset-black/20","transition-all duration-300 ease-out",c&&"opacity-100"),"aria-label":"Seek slider","aria-valuetext":`${R} of ${P}`})]})})}),c&&o.jsxRuntimeExports.jsx(V.Portal,{children:o.jsxRuntimeExports.jsxs(V.Content,{className:C.cn("rounded bg-black/80 px-2 py-1 text-sm text-white","fade-in-0 zoom-in-95 animate-in"),sideOffset:10,children:[C.formatTime(l),o.jsxRuntimeExports.jsx(V.Arrow,{className:"fill-black/80"})]})})]})})})}));as.displayName="SeekBar";const Fu=as,cs=E.memo(E.forwardRef(function({currentTime:t,duration:n,showRemaining:r=!1,size:s="sm",className:i},a){const c=E.useMemo(()=>C.formatTime(t),[t]),m=E.useMemo(()=>C.formatTime(n),[n]),l=E.useMemo(()=>C.formatTime(n-t),[n,t]),d={sm:"text-xs",md:"text-sm",lg:"text-base",xl:"text-lg"},u=E.useMemo(()=>r?`-${l}`:m,[r,l,m]);return o.jsxRuntimeExports.jsxs("div",{ref:a,className:C.cn("flex items-center font-mono text-white text-xs","rounded-lg backdrop-blur-sm","px-3 py-1.5",d[s],"select-none",i),role:"timer","aria-label":`${r?"Time remaining":"Duration"}: ${u}`,"aria-live":"off",children:[o.jsxRuntimeExports.jsx("span",{className:"tabular-nums","aria-label":"Current time",children:c}),o.jsxRuntimeExports.jsx("span",{className:"mx-1 text-white","aria-hidden":"true",children:"/"}),o.jsxRuntimeExports.jsx("span",{className:"tabular-nums","aria-label":r?"Time remaining":"Total duration",children:u})]})}));cs.displayName="TimeDisplay";const zu=cs,ls=E.memo(E.forwardRef(function({volume:t,isMuted:n,onVolumeChange:r,onToggleMute:s,size:i="lg",className:a},c){const m=E.useMemo(()=>n||t===0?hi:t<.5?fi:pi,[n,t]),l=E.useMemo(()=>({md:"h-11 w-11",lg:"h-12 w-12",xl:"h-14 w-14"}),[]),d=E.useMemo(()=>({md:"h-5 w-5",lg:"h-6 w-6",xl:"h-7 w-7"}),[]),u=E.useMemo(()=>({md:"h-6",lg:"h-7",xl:"h-8"}),[]),p=E.useMemo(()=>({md:"h-4 w-4",lg:"h-4 w-4",xl:"h-5 w-5"}),[]),x=E.useMemo(()=>({md:"h-1.5",lg:"h-2",xl:"h-2.5"}),[]),y=E.useMemo(()=>[n?0:t],[n,t]),h=E.useMemo(()=>Math.round((n?0:t)*100),[n,t]),v=E.useCallback(()=>{s()},[s]),w=E.useCallback(([g])=>{r(g??0)},[r]),j=n?"Unmute":"Mute",b=j;return o.jsxRuntimeExports.jsxs("div",{ref:c,className:C.cn("flex items-center space-x-3 text-white",a),children:[o.jsxRuntimeExports.jsx(V.Provider,{children:o.jsxRuntimeExports.jsxs(V.Root,{children:[o.jsxRuntimeExports.jsx(V.Trigger,{asChild:!0,children:o.jsxRuntimeExports.jsx("button",{type:"button",onClick:v,className:C.cn("inline-flex items-center justify-center rounded-lg bg-transparent p-0 text-white transition-all hover:text-cyan-700 active:scale-95","focus:outline-none focus:ring-2 focus:ring-white/50 focus:ring-offset-2 focus:ring-offset-black/20",l[i]),"aria-label":j,"aria-pressed":n,children:o.jsxRuntimeExports.jsx(m,{className:C.cn(d[i])})})}),o.jsxRuntimeExports.jsx(V.Portal,{children:o.jsxRuntimeExports.jsxs(V.Content,{className:C.cn("rounded bg-black/80 px-2 py-1 text-sm text-white","fade-in-0 zoom-in-95 animate-in"),sideOffset:5,children:[b,o.jsxRuntimeExports.jsx(V.Arrow,{className:"fill-black/80"})]})})]})}),o.jsxRuntimeExports.jsx("div",{className:"w-32",children:o.jsxRuntimeExports.jsxs(te.Root,{className:C.cn("group relative flex w-full touch-none select-none items-center",u[i]),value:y,max:1,step:.01,onValueChange:w,"aria-label":"Volume","aria-valuemin":0,"aria-valuemax":1,"aria-valuenow":t,"aria-valuetext":`${h} percent`,children:[o.jsxRuntimeExports.jsx(te.Track,{className:C.cn("relative grow rounded-full bg-white/20 shadow-inner transition-all duration-300 group-hover:bg-white/30","border border-white/10",x[i]),children:o.jsxRuntimeExports.jsx(te.Range,{className:"absolute h-full rounded-full bg-white shadow-sm"})}),o.jsxRuntimeExports.jsx(te.Thumb,{className:C.cn("block rounded-full border-2 border-white/20 bg-white shadow-lg","transition-all duration-300 ease-out hover:scale-110 hover:bg-white/95 active:scale-95","focus:outline-none focus:ring-2 focus:ring-white/50 focus:ring-offset-2 focus:ring-offset-black/20",p[i]),"aria-label":"Volume"})]})}),o.jsxRuntimeExports.jsx("span",{className:"w-10 text-right text-sm text-white","aria-hidden":"true",children:h})]})}));ls.displayName="VolumeControl";const $u=ls,us=E.forwardRef((e,t)=>(C.showDeprecationWarning("ModernMediaPlayer","MediaPlayer (the primary media player component)"),o.jsxRuntimeExports.jsx(Iu,{...e,ref:t})));us.displayName="DeprecatedModernMediaPlayer";const ds=E.forwardRef((e,t)=>(C.showDeprecationWarning("SimpleVideoPlayer","VideoPlayer (the primary video player component)"),o.jsxRuntimeExports.jsx(os,{...e})));ds.displayName="DeprecatedSimpleVideoPlayer";const fs=E.forwardRef((e,t)=>(C.showDeprecationWarning("PlayButton","Use MediaPlayer compound components or MediaPlayer (all-in-one)"),o.jsxRuntimeExports.jsx(Lu,{...e})));fs.displayName="DeprecatedPlayButton";const ms=E.forwardRef((e,t)=>(C.showDeprecationWarning("SeekBar","Use MediaPlayer compound components or MediaPlayer (all-in-one)"),o.jsxRuntimeExports.jsx(Fu,{...e})));ms.displayName="DeprecatedSeekBar";const ps=E.forwardRef((e,t)=>(C.showDeprecationWarning("TimeDisplay","Use MediaPlayer compound components or MediaPlayer (all-in-one)"),o.jsxRuntimeExports.jsx(zu,{...e})));ps.displayName="DeprecatedTimeDisplay";const xs=E.forwardRef((e,t)=>(C.showDeprecationWarning("VolumeControl","Use MediaPlayer compound components or MediaPlayer (all-in-one)"),o.jsxRuntimeExports.jsx($u,{...e})));xs.displayName="DeprecatedVolumeControl";const hs=E.forwardRef((e,t)=>(C.showDeprecationWarning("FullscreenButton","Use MediaPlayer compound components or MediaPlayer (all-in-one)"),o.jsxRuntimeExports.jsx(Ou,{...e})));hs.displayName="DeprecatedFullscreenButton";const Bu=({sources:e,enableIntelligentPreloading:t=!0,adaptToNetworkConditions:n=!0,priority:r="auto",strategy:s="adaptive"})=>{const i=E.useRef(null),a=E.useRef(null),c=E.useRef(new Map);function m(b){return!b.includes(window.location.origin)}function l(b){}function d(b){b.forEach(g=>{c.current.set(g,Date.now()),_e.preload(g,{as:"fetch",crossOrigin:"anonymous"})})}const u=E.useMemo(()=>{const b={dnsPrefetch:[],preconnect:[],preload:[],preinit:[]};return e.forEach(g=>{const P=new URL(g.src).origin;y(P)&&b.dnsPrefetch.push(P),h(g.type||"",s)&&b.preconnect.push(P),v(g,r,s)&&b.preload.push({url:g.src,type:j(g.type||"")}),w(g,s)&&b.preinit.push({url:g.src,type:"script"})}),b},[e,r,s]),[p,x]=E.useState(u);E.useEffect(()=>{const b={...u};b.preload=u.preload.filter(({url:g})=>{const R=e.find(M=>M.src===g);if(!R)return!1;const P=c.current.get(R.src);if(P&&Date.now()-P<3e5)return!1;if(s==="conservative")return r==="high"&&R.type==="hls";if(s==="aggressive")return!0;if(i.current){const{effectiveType:M,saveData:S}=i.current;if(S)return!1;if(M==="slow-2g"||M==="2g")return r==="high"&&R.type==="hls";if(M==="3g")return["hls","m3u8"].includes(R.type||"")}return r!=="low"}),x(b)},[u,e,r,s]),E.useEffect(()=>{if(n&&"connection"in navigator){i.current=navigator.connection;const b=()=>{};return i.current.addEventListener("change",b),()=>{i.current?.removeEventListener("change",b)}}},[n]),E.useEffect(()=>{if(t)return a.current=new Vu,a.current.startTracking(),()=>{a.current?.stopTracking()}},[t]),E.useEffect(()=>{p.dnsPrefetch.forEach(b=>{_e.prefetchDNS(b)})},[p.dnsPrefetch]),E.useEffect(()=>{p.preconnect.forEach(b=>{_e.preconnect(b,{crossOrigin:"anonymous"})})},[p.preconnect]),E.useEffect(()=>{p.preload.forEach(({url:b,type:g})=>{const R=m(b)?"anonymous":void 0;_e.preload(b,{as:g,crossOrigin:R,integrity:void 0})})},[p.preload,r]),E.useEffect(()=>{p.preinit.forEach(({url:b,type:g})=>{const R=m(b)?"anonymous":void 0;_e.preinit(b,{as:g,crossOrigin:R})})},[p.preinit]),E.useEffect(()=>{if(!t||!a.current)return;const b=g=>{g.isLikelyToInteract&&d(g.predictedSources)};a.current.onBehaviorChange(b)},[t]);function y(b){return["cdn.jsdelivr.net","cdnjs.cloudflare.com","unpkg.com","cloudflare.com","fastly.net","akamaized.net"].some(R=>b.includes(R))}function h(b,g){return g==="aggressive"?!0:g==="conservative"?["hls","m3u8"].includes(b):["hls","m3u8","mp4"].includes(b)}function v(b,g,R){return R==="conservative"?g==="high"&&b.type==="hls":R==="aggressive"?!0:g!=="low"}function w(b,g){return g==="aggressive"&&b.type==="hls"}function j(b){switch(b){case"hls":case"m3u8":return"fetch";case"mp4":case"webm":return"video";case"mp3":case"wav":return"audio";default:return"fetch"}}return null};class Vu{constructor(){de(this,"behaviorData",{isLikelyToInteract:!1,engagementScore:0,predictedSources:[],interactionHistory:[]});de(this,"listeners",[]);de(this,"mouseMoveTimer",null);de(this,"handleMouseMove",()=>{this.mouseMoveTimer||(this.mouseMoveTimer=window.setTimeout(()=>{this.updateEngagementScore(.1),this.mouseMoveTimer=null},100))});de(this,"handleScroll",()=>{this.updateEngagementScore(.2)});de(this,"handleKeydown",()=>{this.updateEngagementScore(.3),this.behaviorData.isLikelyToInteract=!0});de(this,"handleFocus",()=>{this.updateEngagementScore(.4),this.behaviorData.isLikelyToInteract=!0});de(this,"handleVisibilityChange",()=>{document.hidden||(this.updateEngagementScore(.5),this.behaviorData.isLikelyToInteract=!0)})}startTracking(){document.addEventListener("mousemove",this.handleMouseMove),document.addEventListener("scroll",this.handleScroll),document.addEventListener("keydown",this.handleKeydown),document.addEventListener("focusin",this.handleFocus),document.addEventListener("visibilitychange",this.handleVisibilityChange)}stopTracking(){document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("scroll",this.handleScroll),document.removeEventListener("keydown",this.handleKeydown),document.removeEventListener("focusin",this.handleFocus),document.removeEventListener("visibilitychange",this.handleVisibilityChange),this.mouseMoveTimer&&clearTimeout(this.mouseMoveTimer)}onBehaviorChange(t){this.listeners.push(t)}getCurrentBehavior(){return this.behaviorData}updateEngagementScore(t){this.behaviorData.engagementScore=Math.min(1,this.behaviorData.engagementScore+t),setTimeout(()=>{this.behaviorData.engagementScore=Math.max(0,this.behaviorData.engagementScore-t*.5),this.notifyListeners()},3e4),this.notifyListeners()}notifyListeners(){this.listeners.forEach(t=>t(this.behaviorData))}}exports.MediaProvider=o.MediaProvider;exports.createEnhancedMediaStore=o.createEnhancedMediaStore;exports.useMediaContext=o.useMediaContext;exports.useMediaDispatch=o.useMediaDispatch;exports.useMediaSelector=o.useMediaSelector;exports.useOptimisticMediaSelector=o.useOptimisticMediaSelector;exports.useEnhancedMediaPlayer=U.useEnhancedMediaPlayer;exports.useEnhancedSubtitles=U.useEnhancedSubtitles$1;exports.useIntelligentPreloading=U.useIntelligentPreloading;exports.useKeyboardControls=U.useKeyboardControls;exports.useMediaActionState=U.useMediaActionState;exports.useMediaActions=U.useMediaActions;exports.useMediaControls=U.useMediaControls;exports.useMediaPlayer=U.useMediaPlayer;exports.useMediaState=U.useMediaState;exports.useScreenshot=U.useScreenshot;exports.useSubtitles=U.useSubtitles;exports.useTouchGestures=U.useTouchGestures;exports.useVideoPlayer=U.useVideoPlayer$1;exports.cn=C.cn;exports.formatTime=C.formatTime;exports.parseTime=C.parseTime;exports.MediaPlayerRoot=we.MediaPlayerRoot;exports.MinimalFullscreenIcon=we.MinimalFullscreenIcon;exports.MinimalMediaPlayer=we.MinimalMediaPlayer;exports.MinimalPauseIcon=we.MinimalPauseIcon;exports.MinimalPlayIcon=we.MinimalPlayIcon;exports.MinimalVolumeIcon=we.MinimalVolumeIcon;exports.SimpleMinimalPlayer=we.SimpleMinimalPlayer;exports.defaultMinimalIcons=we.defaultMinimalIcons;exports.ChaptersPanel=re.ChaptersPanel;exports.DebugPanel=re.DebugPanel;exports.EnhancedControlBar=re.EnhancedControlBar;exports.EnhancedMediaPlayer=re.EnhancedMediaPlayer;exports.EnhancedPlayButton=re.EnhancedPlayButton;exports.EnhancedSeekBar=re.EnhancedSeekBar;exports.EnhancedTimeDisplay=re.EnhancedTimeDisplay;exports.EnhancedVolumeControl=re.EnhancedVolumeControl;exports.PictureInPictureButton=re.PictureInPictureButton;exports.PlaybackSpeedSelector=re.PlaybackSpeedSelector;exports.QualitySelector=re.QualitySelector;exports.SubtitleSelector=re.SubtitleSelector;exports.PerformanceMonitor=Os.PerformanceMonitor;exports.AUDIO_MIME_TYPES=rn;exports.AudioPlayer=Rr;exports.ConcurrentMedia=Er;exports.FullscreenButton=hs;exports.MediaErrorBoundary=br;exports.MediaLoading=Qe;exports.MediaPlayer=wr;exports.MediaPlayerHLS=Pr;exports.MediaResourcePreloader=Bu;exports.MediaSuspense=yr;exports.ModernMediaPlayer=us;exports.PlayButton=fs;exports.SUPPORTED_AUDIO_FORMATS=Ar;exports.SUPPORTED_VIDEO_FORMATS=Nr;exports.SeekBar=ms;exports.SimpleVideoPlayer=ds;exports.TimeDisplay=ps;exports.VIDEO_MIME_TYPES=nn;exports.VideoPlayer=jr;exports.VolumeControl=xs;exports.getMediaTypeFromUrl=gi;exports.getMimeTypeFromUrl=yi;exports.useDeferredMediaLoading=Fs;
112
- //# sourceMappingURL=index.js.map
38
+ `},Wt=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},Gt=function(){s.useEffect(function(){return document.body.setAttribute(Ht,(Wt()+1).toString()),function(){var e=Wt()-1;e<=0?document.body.removeAttribute(Ht):document.body.setAttribute(Ht,e.toString())}},[])},Kt=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;Gt();var a=s.useMemo(function(){return Bt(i)},[i]);return s.createElement(Vt,{styles:Ut(a,!t,i,n?``:`!important`)})},qt=!1;if(typeof window<`u`)try{var Jt=Object.defineProperty({},"passive",{get:function(){return qt=!0,!0}});window.addEventListener(`test`,Jt,Jt),window.removeEventListener(`test`,Jt,Jt)}catch{qt=!1}var Yt=qt?{passive:!1}:!1,Xt=function(e){return e.tagName===`TEXTAREA`},Zt=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!Xt(e)&&n[t]===`visible`)},Qt=function(e){return Zt(e,`overflowY`)},$t=function(e){return Zt(e,`overflowX`)},en=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),rn(e,r)){var i=an(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},tn=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},nn=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},rn=function(e,t){return e===`v`?Qt(t):$t(t)},an=function(e,t){return e===`v`?tn(t):nn(t)},on=function(e,t){return e===`h`&&t===`rtl`?-1:1},sn=function(e,t,n,r,i){var a=on(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=an(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&rn(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},cn=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},ln=function(e){return[e.deltaX,e.deltaY]},un=function(e){return e&&`current`in e?e.current:e},dn=function(e,t){return e[0]===t[0]&&e[1]===t[1]},fn=function(e){return`
39
+ .block-interactivity-${e} {pointer-events: none;}
40
+ .allow-interactivity-${e} {pointer-events: all;}
41
+ `},pn=0,mn=[];function hn(e){var t=s.useRef([]),n=s.useRef([0,0]),r=s.useRef(),i=s.useState(pn++)[0],a=s.useState(It)[0],o=s.useRef(e);s.useEffect(function(){o.current=e},[e]),s.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=dt([e.lockRef.current],(e.shards||[]).map(un),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var c=s.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=cn(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=en(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=en(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return sn(h,t,e,h===`h`?s:c,!0)},[]),l=s.useCallback(function(e){var n=e;if(!(!mn.length||mn[mn.length-1]!==a)){var r=`deltaY`in n?ln(n):cn(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&dn(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var s=(o.current.shards||[]).map(un).filter(Boolean).filter(function(e){return e.contains(n.target)});(s.length>0?c(n,s[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),u=s.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:gn(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),d=s.useCallback(function(e){n.current=cn(e),r.current=void 0},[]),f=s.useCallback(function(t){u(t.type,ln(t),t.target,c(t,e.lockRef.current))},[]),p=s.useCallback(function(t){u(t.type,cn(t),t.target,c(t,e.lockRef.current))},[]);s.useEffect(function(){return mn.push(a),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener(`wheel`,l,Yt),document.addEventListener(`touchmove`,l,Yt),document.addEventListener(`touchstart`,d,Yt),function(){mn=mn.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,l,Yt),document.removeEventListener(`touchmove`,l,Yt),document.removeEventListener(`touchstart`,d,Yt)}},[]);var m=e.removeScrollBar;return s.createElement(s.Fragment,null,e.inert?s.createElement(a,{styles:fn(i)}):null,m?s.createElement(Kt,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function gn(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var _n=Tt(Et,hn),vn=s.forwardRef(function(e,t){return s.createElement(Ot,H({},e,{ref:t,sideCar:_n}))});vn.classNames=Ot.classNames;var yn=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},bn=new WeakMap,xn=new WeakMap,Sn={},Cn=0,wn=function(e){return e&&(e.host||wn(e.parentNode))},Tn=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=wn(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},En=function(e,t,n,r){var i=Tn(t,Array.isArray(e)?e:[e]);Sn[n]||(Sn[n]=new WeakMap);var a=Sn[n],o=[],s=new Set,c=new Set(i),l=function(e){!e||s.has(e)||(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){!e||c.has(e)||Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(bn.get(e)||0)+1,l=(a.get(e)||0)+1;bn.set(e,c),a.set(e,l),o.push(e),c===1&&i&&xn.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),Cn++,function(){o.forEach(function(e){var t=bn.get(e)-1,i=a.get(e)-1;bn.set(e,t),a.set(e,i),t||(xn.has(e)||e.removeAttribute(r),xn.delete(e)),i||e.removeAttribute(n)}),Cn--,Cn||(bn=new WeakMap,bn=new WeakMap,xn=new WeakMap,Sn={})}},Dn=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||yn(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),En(r,i,n,`aria-hidden`)):function(){return null}};function On(e){let[t,n]=c.useState(void 0);return B(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}else n(void 0)},[e]),t}var kn=[`top`,`right`,`bottom`,`left`],An=Math.min,U=Math.max,jn=Math.round,Mn=Math.floor,Nn=e=>({x:e,y:e}),Pn={left:`right`,right:`left`,bottom:`top`,top:`bottom`},Fn={start:`end`,end:`start`};function In(e,t,n){return U(e,An(t,n))}function Ln(e,t){return typeof e==`function`?e(t):e}function Rn(e){return e.split(`-`)[0]}function zn(e){return e.split(`-`)[1]}function Bn(e){return e===`x`?`y`:`x`}function Vn(e){return e===`y`?`height`:`width`}function Hn(e){return[`top`,`bottom`].includes(Rn(e))?`y`:`x`}function Un(e){return Bn(Hn(e))}function Wn(e,t,n){n===void 0&&(n=!1);let r=zn(e),i=Un(e),a=Vn(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Yn(o)),[o,Yn(o)]}function Gn(e){let t=Yn(e);return[Kn(e),t,Kn(t)]}function Kn(e){return e.replace(/start|end/g,e=>Fn[e])}function qn(e,t,n){let r=[`left`,`right`],i=[`right`,`left`],a=[`top`,`bottom`],o=[`bottom`,`top`];switch(e){case`top`:case`bottom`:return n?t?i:r:t?r:i;case`left`:case`right`:return t?a:o;default:return[]}}function Jn(e,t,n,r){let i=zn(e),a=qn(Rn(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Kn)))),a}function Yn(e){return e.replace(/left|right|bottom|top/g,e=>Pn[e])}function Xn(e){return{top:0,right:0,bottom:0,left:0,...e}}function Zn(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Xn(e)}function Qn(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function $n(e,t,n){let{reference:r,floating:i}=e,a=Hn(t),o=Un(t),s=Vn(o),c=Rn(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(zn(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}var er=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=a.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=$n(l,r,c),f=r,p={},m=0;for(let n=0;n<s.length;n++){let{name:a,fn:h}=s[n],{x:g,y:_,data:v,reset:y}=await h({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:p,rects:l,platform:o,elements:{reference:e,floating:t}});u=g??u,d=_??d,p={...p,[a]:{...p[a],...v}},y&&m<=50&&(m++,typeof y==`object`&&(y.placement&&(f=y.placement),y.rects&&(l=y.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):y.rects),{x:u,y:d}=$n(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:p}};async function tr(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=Ln(t,e),p=Zn(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Qn(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=Qn(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var nr=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=Ln(e,t)||{};if(l==null)return{};let d=Zn(u),f={x:n,y:r},p=Un(i),m=Vn(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=An(d[_],T),D=An(d[v],T),O=E,k=C-h[m]-D,A=C/2-h[m]/2+w,j=In(O,A,k),M=!c.arrow&&zn(i)!=null&&A!==j&&a.reference[m]/2-(A<O?E:D)-h[m]/2<0,N=M?A<O?A-O:A-k:0;return{[p]:f[p]+N,data:{[p]:j,centerOffset:A-j-N,...M&&{alignmentOffset:N}},reset:M}}}),rr=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=Ln(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Rn(r),_=Hn(o),v=Rn(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[Yn(o)]:Gn(o)),x=p!==`none`;!d&&x&&b.push(...Jn(o,m,p,y));let S=[o,...b],C=await tr(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=Wn(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==Hn(t))||T.every(e=>e.overflows[0]>0&&Hn(e.placement)===_)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=Hn(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function ir(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function ar(e){return kn.some(t=>e[t]>=0)}var or=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n}=t,{strategy:r=`referenceHidden`,...i}=Ln(e,t);switch(r){case`referenceHidden`:{let e=ir(await tr(t,{...i,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:ar(e)}}}case`escaped`:{let e=ir(await tr(t,{...i,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:ar(e)}}}default:return{}}}}};async function sr(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Rn(n),s=zn(n),c=Hn(n)===`y`,l=[`left`,`top`].includes(o)?-1:1,u=a&&c?-1:1,d=Ln(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var cr=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await sr(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},lr=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i}=t,{mainAxis:a=!0,crossAxis:o=!1,limiter:s={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...c}=Ln(e,t),l={x:n,y:r},u=await tr(t,c),d=Hn(Rn(i)),f=Bn(d),p=l[f],m=l[d];if(a){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=p+u[e],r=p-u[t];p=In(n,p,r)}if(o){let e=d===`y`?`top`:`left`,t=d===`y`?`bottom`:`right`,n=m+u[e],r=m-u[t];m=In(n,m,r)}let h=s.fn({...t,[f]:p,[d]:m});return{...h,data:{x:h.x-n,y:h.y-r,enabled:{[f]:a,[d]:o}}}}}},ur=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=Ln(e,t),u={x:n,y:r},d=Hn(i),f=Bn(d),p=u[f],m=u[d],h=Ln(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=[`top`,`left`].includes(Rn(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},dr=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=Ln(e,t),u=await tr(t,l),d=Rn(i),f=zn(i),p=Hn(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=An(h-u[g],v),x=An(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=U(u.left,0),t=U(u.right,0),n=U(u.top,0),r=U(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:U(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:U(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function fr(){return typeof window<`u`}function pr(e){return hr(e)?(e.nodeName||``).toLowerCase():`#document`}function W(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function mr(e){return((hr(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function hr(e){return fr()?e instanceof Node||e instanceof W(e).Node:!1}function G(e){return fr()?e instanceof Element||e instanceof W(e).Element:!1}function gr(e){return fr()?e instanceof HTMLElement||e instanceof W(e).HTMLElement:!1}function _r(e){return!fr()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof W(e).ShadowRoot}function vr(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=K(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&![`inline`,`contents`].includes(i)}function yr(e){return[`table`,`td`,`th`].includes(pr(e))}function br(e){return[`:popover-open`,`:modal`].some(t=>{try{return e.matches(t)}catch{return!1}})}function xr(e){let t=Cr(),n=G(e)?K(e):e;return[`transform`,`translate`,`scale`,`rotate`,`perspective`].some(e=>n[e]?n[e]!==`none`:!1)||(n.containerType?n.containerType!==`normal`:!1)||!t&&(n.backdropFilter?n.backdropFilter!==`none`:!1)||!t&&(n.filter?n.filter!==`none`:!1)||[`transform`,`translate`,`scale`,`rotate`,`perspective`,`filter`].some(e=>(n.willChange||``).includes(e))||[`paint`,`layout`,`strict`,`content`].some(e=>(n.contain||``).includes(e))}function Sr(e){let t=Er(e);for(;gr(t)&&!wr(t);){if(xr(t))return t;if(br(t))return null;t=Er(t)}return null}function Cr(){return typeof CSS>`u`||!CSS.supports?!1:CSS.supports(`-webkit-backdrop-filter`,`none`)}function wr(e){return[`html`,`body`,`#document`].includes(pr(e))}function K(e){return W(e).getComputedStyle(e)}function Tr(e){return G(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Er(e){if(pr(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||_r(e)&&e.host||mr(e);return _r(t)?t.host:t}function Dr(e){let t=Er(e);return wr(t)?e.ownerDocument?e.ownerDocument.body:e.body:gr(t)&&vr(t)?t:Dr(t)}function Or(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Dr(e),i=r===e.ownerDocument?.body,a=W(r);if(i){let e=kr(a);return t.concat(a,a.visualViewport||[],vr(r)?r:[],e&&n?Or(e):[])}return t.concat(r,Or(r,[],n))}function kr(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Ar(e){let t=K(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=gr(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=jn(n)!==a||jn(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function jr(e){return G(e)?e:e.contextElement}function Mr(e){let t=jr(e);if(!gr(t))return Nn(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Ar(t),o=(a?jn(n.width):n.width)/r,s=(a?jn(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Nr=Nn(0);function Pr(e){let t=W(e);return!Cr()||!t.visualViewport?Nr:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Fr(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==W(e)?!1:t}function Ir(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=jr(e),o=Nn(1);t&&(r?G(r)&&(o=Mr(r)):o=Mr(e));let s=Fr(a,n,r)?Pr(a):Nn(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=W(a),t=r&&G(r)?W(r):r,n=e,i=kr(n);for(;i&&r&&t!==n;){let e=Mr(i),t=i.getBoundingClientRect(),r=K(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=W(i),i=kr(n)}}return Qn({width:u,height:d,x:c,y:l})}function Lr(e,t){let n=Tr(e).scrollLeft;return t?t.left+n:Ir(mr(e)).left+n}function Rr(e,t,n){n===void 0&&(n=!1);let r=e.getBoundingClientRect();return{x:r.left+t.scrollLeft-(n?0:Lr(e,r)),y:r.top+t.scrollTop}}function zr(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=mr(r),s=t?br(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Nn(1),u=Nn(0),d=gr(r);if((d||!d&&!a)&&((pr(r)!==`body`||vr(o))&&(c=Tr(r)),gr(r))){let e=Ir(r);l=Mr(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Rr(o,c,!0):Nn(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function Br(e){return Array.from(e.getClientRects())}function Vr(e){let t=mr(e),n=Tr(e),r=e.ownerDocument.body,i=U(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=U(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+Lr(e),s=-n.scrollTop;return K(r).direction===`rtl`&&(o+=U(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}function Hr(e,t){let n=W(e),r=mr(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=Cr();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}return{width:a,height:o,x:s,y:c}}function Ur(e,t){let n=Ir(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=gr(e)?Mr(e):Nn(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Wr(e,t,n){let r;if(t===`viewport`)r=Hr(e,n);else if(t===`document`)r=Vr(mr(e));else if(G(t))r=Ur(t,n);else{let n=Pr(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Qn(r)}function Gr(e,t){let n=Er(e);return n===t||!G(n)||wr(n)?!1:K(n).position===`fixed`||Gr(n,t)}function Kr(e,t){let n=t.get(e);if(n)return n;let r=Or(e,[],!1).filter(e=>G(e)&&pr(e)!==`body`),i=null,a=K(e).position===`fixed`,o=a?Er(e):e;for(;G(o)&&!wr(o);){let t=K(o),n=xr(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&[`absolute`,`fixed`].includes(i.position)||vr(o)&&!n&&Gr(e,o))?r=r.filter(e=>e!==o):i=t,o=Er(o)}return t.set(e,r),r}function qr(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?br(t)?[]:Kr(t,this._c):[].concat(n),r],o=a[0],s=a.reduce((e,n)=>{let r=Wr(t,n,i);return e.top=U(r.top,e.top),e.right=An(r.right,e.right),e.bottom=An(r.bottom,e.bottom),e.left=U(r.left,e.left),e},Wr(t,o,i));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}}function Jr(e){let{width:t,height:n}=Ar(e);return{width:t,height:n}}function Yr(e,t,n){let r=gr(t),i=mr(t),a=n===`fixed`,o=Ir(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=Nn(0);function l(){c.x=Lr(i)}if(r||!r&&!a)if((pr(t)!==`body`||vr(i))&&(s=Tr(t)),r){let e=Ir(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?Rr(i,s):Nn(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function Xr(e){return K(e).position===`static`}function Zr(e,t){if(!gr(e)||K(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return mr(e)===n&&(n=n.ownerDocument.body),n}function Qr(e,t){let n=W(e);if(br(e))return n;if(!gr(e)){let t=Er(e);for(;t&&!wr(t);){if(G(t)&&!Xr(t))return t;t=Er(t)}return n}let r=Zr(e,t);for(;r&&yr(r)&&Xr(r);)r=Zr(r,t);return r&&wr(r)&&Xr(r)&&!xr(r)?n:r||Sr(e)||n}var $r=async function(e){let t=this.getOffsetParent||Qr,n=this.getDimensions,r=await n(e.floating);return{reference:Yr(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function ei(e){return K(e).direction===`rtl`}var ti={convertOffsetParentRelativeRectToViewportRelativeRect:zr,getDocumentElement:mr,getClippingRect:qr,getOffsetParent:Qr,getElementRects:$r,getClientRects:Br,getDimensions:Jr,getScale:Mr,isElement:G,isRTL:ei};function ni(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function ri(e,t){let n=null,r,i=mr(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=Mn(d),h=Mn(i.clientWidth-(u+f)),g=Mn(i.clientHeight-(d+p)),_=Mn(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:U(0,An(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!ni(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function ii(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=jr(e),u=i||a?[...l?Or(l):[],...Or(t)]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?ri(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),p.observe(t));let m,h=c?Ir(e):null;c&&g();function g(){let t=Ir(e);h&&!ni(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var ai=cr,oi=lr,si=rr,ci=dr,li=or,ui=nr,di=ur,fi=(e,t,n)=>{let r=new Map,i={platform:ti,...n},a={...i.platform,_c:r};return er(e,t,{...i,platform:a})},pi=typeof document<`u`?c.useLayoutEffect:function(){};function mi(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!mi(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!mi(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function hi(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function gi(e,t){let n=hi(e);return Math.round(t*n)/n}function _i(e){let t=c.useRef(e);return pi(()=>{t.current=e}),t}function vi(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:u,open:d}=e,[f,p]=c.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[m,h]=c.useState(r);mi(m,r)||h(r);let[g,_]=c.useState(null),[v,y]=c.useState(null),b=c.useCallback(e=>{e!==w.current&&(w.current=e,_(e))},[]),x=c.useCallback(e=>{e!==T.current&&(T.current=e,y(e))},[]),S=a||g,C=o||v,w=c.useRef(null),T=c.useRef(null),E=c.useRef(f),D=u!=null,O=_i(u),k=_i(i),A=_i(d),j=c.useCallback(()=>{if(!w.current||!T.current)return;let e={placement:t,strategy:n,middleware:m};k.current&&(e.platform=k.current),fi(w.current,T.current,e).then(e=>{let t={...e,isPositioned:A.current!==!1};M.current&&!mi(E.current,t)&&(E.current=t,l.flushSync(()=>{p(t)}))})},[m,t,n,k,A]);pi(()=>{d===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,p(e=>({...e,isPositioned:!1})))},[d]);let M=c.useRef(!1);pi(()=>(M.current=!0,()=>{M.current=!1}),[]),pi(()=>{if(S&&(w.current=S),C&&(T.current=C),S&&C){if(O.current)return O.current(S,C,j);j()}},[S,C,j,O,D]);let N=c.useMemo(()=>({reference:w,floating:T,setReference:b,setFloating:x}),[b,x]),P=c.useMemo(()=>({reference:S,floating:C}),[S,C]),ee=c.useMemo(()=>{let e={position:n,left:0,top:0};if(!P.floating)return e;let t=gi(P.floating,f.x),r=gi(P.floating,f.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...hi(P.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,P.floating,f.x,f.y]);return c.useMemo(()=>({...f,update:j,refs:N,elements:P,floatingStyles:ee}),[f,j,N,P,ee])}var yi=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:ui({element:r.current,padding:i}).fn(n):r?ui({element:r,padding:i}).fn(n):{}}}},bi=(e,t)=>({...ai(e),options:[e,t]}),xi=(e,t)=>({...oi(e),options:[e,t]}),Si=(e,t)=>({...di(e),options:[e,t]}),Ci=(e,t)=>({...si(e),options:[e,t]}),wi=(e,t)=>({...ci(e),options:[e,t]}),Ti=(e,t)=>({...li(e),options:[e,t]}),Ei=(e,t)=>({...yi(e),options:[e,t]}),Di=`Arrow`,Oi=c.forwardRef((e,t)=>{let{children:n,width:r=10,height:i=5,...a}=e;return(0,f.jsx)(I.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,f.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})});Oi.displayName=Di;var ki=Oi,Ai=`Popper`,[ji,Mi]=R(Ai),[Ni,Pi]=ji(Ai),Fi=e=>{let{__scopePopper:t,children:n}=e,[r,i]=c.useState(null),[a,o]=c.useState(void 0);return(0,f.jsx)(Ni,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})};Fi.displayName=Ai;var Ii=`PopperAnchor`,Li=c.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...i}=e,a=Pi(Ii,n),o=c.useRef(null),s=a.onAnchorChange,l=M(t,c.useCallback(e=>{o.current=e,e&&s(e)},[s])),u=c.useRef(null);c.useEffect(()=>{if(!r)return;let e=u.current;u.current=r.current,e!==u.current&&s(u.current)});let d=a.placementState&&qi(a.placementState);return r?null:(0,f.jsx)(I.div,{"data-radix-popper-side":d?.[0],"data-radix-popper-align":d?.[1],...i,ref:l})});Li.displayName=Ii;var Ri=`PopperContent`,[zi,Bi]=ji(Ri),Vi=c.forwardRef((e,t)=>{let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:p=`partial`,hideWhenDetached:m=!1,updatePositionStrategy:h=`optimized`,onPlaced:g,..._}=e,v=Pi(Ri,n),[y,b]=c.useState(null),x=M(t,b),[S,C]=c.useState(null),w=On(S),T=w?.width??0,E=w?.height??0,D=r+(a===`center`?``:`-`+a),O=typeof d==`number`?d:{top:0,right:0,bottom:0,left:0,...d},k=Array.isArray(u)?u:[u],A=k.length>0,j={padding:O,boundary:k.filter(Gi),altBoundary:A},{refs:N,floatingStyles:P,placement:ee,isPositioned:te,middlewareData:F}=vi({strategy:`fixed`,placement:D,whileElementsMounted:(...e)=>ii(...e,{animationFrame:h===`always`}),elements:{reference:v.anchor},middleware:[bi({mainAxis:i+E,alignmentAxis:o}),l&&xi({mainAxis:!0,crossAxis:!1,limiter:p===`partial`?Si():void 0,...j}),l&&Ci({...j}),wi({...j,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)}}),S&&Ei({element:S,padding:s}),Ki({arrowWidth:T,arrowHeight:E}),m&&Ti({strategy:`referenceHidden`,...j,boundary:A?j.boundary:void 0})]}),ne=v.setPlacementState;B(()=>(ne(ee),()=>{ne(void 0)}),[ee,ne]);let[re,ie]=qi(ee),ae=V(g);B(()=>{te&&ae?.()},[te,ae]);let oe=F.arrow?.x,se=F.arrow?.y,ce=F.arrow?.centerOffset!==0,[le,L]=c.useState();return B(()=>{y&&L(window.getComputedStyle(y).zIndex)},[y]),(0,f.jsx)(`div`,{ref:N.setFloating,"data-radix-popper-content-wrapper":``,style:{...P,transform:te?P.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:le,"--radix-popper-transform-origin":[F.transformOrigin?.x,F.transformOrigin?.y].join(` `),...F.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,f.jsx)(zi,{scope:n,placedSide:re,placedAlign:ie,onArrowChange:C,arrowX:oe,arrowY:se,shouldHideArrow:ce,children:(0,f.jsx)(I.div,{"data-side":re,"data-align":ie,..._,ref:x,style:{..._.style,animation:te?void 0:`none`}})})})});Vi.displayName=Ri;var Hi=`PopperArrow`,Ui={top:`bottom`,right:`left`,bottom:`top`,left:`right`},Wi=c.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=Bi(Hi,n);return(0,f.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[Ui[i.placedSide]]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,f.jsx)(ki,{...r,ref:t,style:{...r.style,display:`block`}})})});Wi.displayName=Hi;function Gi(e){return e!==null}var Ki=e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=qi(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}});function qi(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var Ji=Fi,Yi=Li,Xi=Vi,Zi=Wi,Qi=!1;function $i(){let[e,t]=c.useState(Qi);return c.useEffect(()=>{Qi||(Qi=!0,t(!0))},[]),e}var ea=c.useSyncExternalStore;function ta(){return()=>{}}function na(){return ea(ta,()=>!0,()=>!1)}var ra=typeof ea==`function`?na:$i,ia=`rovingFocusGroup.onEntryFocus`,aa={bubbles:!1,cancelable:!0},oa=`RovingFocusGroup`,[sa,ca,la]=de(oa),[ua,da]=R(oa,[la]),[fa,pa]=ua(oa),ma=c.forwardRef((e,t)=>(0,f.jsx)(sa.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,f.jsx)(sa.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,f.jsx)(ha,{...e,ref:t})})}));ma.displayName=oa;var ha=c.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:l,onEntryFocus:u,preventScrollOnEntryFocus:d=!1,...p}=e,m=c.useRef(null),h=M(t,m),g=De(a),[_,v]=pe({prop:o,defaultProp:s??null,onChange:l,caller:oa}),[y,b]=c.useState(!1),x=V(u),S=ca(n),C=c.useRef(!1),[w,T]=c.useState(0);return c.useEffect(()=>{let e=m.current;if(e)return e.addEventListener(ia,x),()=>e.removeEventListener(ia,x)},[x]),(0,f.jsx)(fa,{scope:n,orientation:r,dir:g,loop:i,currentTabStopId:_,onItemFocus:c.useCallback(e=>v(e),[v]),onItemShiftTab:c.useCallback(()=>b(!0),[]),onFocusableItemAdd:c.useCallback(()=>T(e=>e+1),[]),onFocusableItemRemove:c.useCallback(()=>T(e=>e-1),[]),children:(0,f.jsx)(I.div,{tabIndex:y||w===0?-1:0,"data-orientation":r,...p,ref:h,style:{outline:`none`,...e.style},onMouseDown:z(e.onMouseDown,()=>{C.current=!0}),onFocus:z(e.onFocus,e=>{if(e.target===e.currentTarget&&!C.current&&!y){let t=new CustomEvent(ia,aa);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=S().filter(e=>e.focusable);xa([e.find(e=>e.active),e.find(e=>e.id===_),...e].filter(Boolean).map(e=>e.ref.current),d)}}C.current=!1}),onBlur:z(e.onBlur,()=>b(!1))})})}),ga=`RovingFocusGroupItem`,_a=c.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,l=Te(),u=a||l,d=pa(ga,n),p=d.currentTabStopId===u,m=ca(n),{onFocusableItemAdd:h,onFocusableItemRemove:g,currentTabStopId:_}=d,v=ra();return B(()=>{if(!(!v||!r))return h(),()=>g()},[v,r,h,g]),c.useEffect(()=>{if(!(v||!r))return h(),()=>g()},[v,r,h,g]),(0,f.jsx)(sa.ItemSlot,{scope:n,id:u,focusable:r,active:i,children:(0,f.jsx)(I.span,{tabIndex:p?0:-1,"data-orientation":d.orientation,...s,ref:t,onMouseDown:z(e.onMouseDown,e=>{r?d.onItemFocus(u):e.preventDefault()}),onFocus:z(e.onFocus,()=>d.onItemFocus(u)),onKeyDown:z(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){d.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=ba(e,d.orientation,d.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=m().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=d.loop?Sa(n,r+1):n.slice(r+1)}setTimeout(()=>xa(n))}}),children:typeof o==`function`?o({isCurrentTabStop:p,hasTabStop:_!=null}):o})})});_a.displayName=ga;var va={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function ya(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}function ba(e,t,n){let r=ya(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return va[r]}function xa(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function Sa(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Ca=ma,wa=_a,Ta=[`Enter`,` `],Ea=[`ArrowDown`,`PageUp`,`Home`],Da=[`ArrowUp`,`PageDown`,`End`],Oa=[...Ea,...Da],ka={ltr:[...Ta,`ArrowRight`],rtl:[...Ta,`ArrowLeft`]},Aa={ltr:[`ArrowLeft`],rtl:[`ArrowRight`]},ja=`Menu`,[Ma,Na,Pa]=de(ja),[Fa,Ia]=R(ja,[Pa,Mi,da]),La=Mi(),Ra=da(),[za,Ba]=Fa(ja),[Va,Ha]=Fa(ja),Ua=e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,s=La(t),[l,u]=c.useState(null),d=c.useRef(!1),p=V(a),m=De(i);return c.useEffect(()=>{let e=()=>{d.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},t=()=>d.current=!1;return document.addEventListener(`keydown`,e,{capture:!0}),()=>{document.removeEventListener(`keydown`,e,{capture:!0}),document.removeEventListener(`pointerdown`,t,{capture:!0}),document.removeEventListener(`pointermove`,t,{capture:!0})}},[]),c.useEffect(()=>{if(!n)return;let e=()=>p(!1);return window.addEventListener(`blur`,e),()=>window.removeEventListener(`blur`,e)},[n,p]),(0,f.jsx)(Ji,{...s,children:(0,f.jsx)(za,{scope:t,open:n,onOpenChange:p,content:l,onContentChange:u,children:(0,f.jsx)(Va,{scope:t,onClose:c.useCallback(()=>p(!1),[p]),isUsingKeyboardRef:d,dir:m,modal:o,children:r})})})};Ua.displayName=ja;var Wa=`MenuAnchor`,Ga=c.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=La(n);return(0,f.jsx)(Yi,{...i,...r,ref:t})});Ga.displayName=Wa;var Ka=`MenuPortal`,[qa,Ja]=Fa(Ka,{forceMount:void 0}),Ya=e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=Ba(Ka,t);return(0,f.jsx)(qa,{scope:t,forceMount:n,children:(0,f.jsx)(_e,{present:n||a.open,children:(0,f.jsx)(at,{asChild:!0,container:i,children:r})})})};Ya.displayName=Ka;var q=`MenuContent`,[Xa,Za]=Fa(q),Qa=c.forwardRef((e,t)=>{let n=Ja(q,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=Ba(q,e.__scopeMenu),o=Ha(q,e.__scopeMenu);return(0,f.jsx)(Ma.Provider,{scope:e.__scopeMenu,children:(0,f.jsx)(_e,{present:r||a.open,children:(0,f.jsx)(Ma.Slot,{scope:e.__scopeMenu,children:(0,f.jsx)(o.modal?$a:eo,{...i,ref:t})})})})}),$a=c.forwardRef((e,t)=>{let n=Ba(q,e.__scopeMenu),r=c.useRef(null),i=M(t,r);return c.useEffect(()=>{let e=r.current;if(e)return Dn(e)},[]),(0,f.jsx)(no,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:z(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),eo=c.forwardRef((e,t)=>{let n=Ba(q,e.__scopeMenu);return(0,f.jsx)(no,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),to=N(`MenuContent.ScrollLock`),no=c.forwardRef((e,t)=>{let{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEntryFocus:l,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:p,onInteractOutside:m,onDismiss:h,disableOutsideScroll:g,..._}=e,v=Ba(q,n),y=Ha(q,n),b=La(n),x=Ra(n),S=Na(n),[C,w]=c.useState(null),T=c.useRef(null),E=M(t,T,v.onContentChange),D=c.useRef(0),O=c.useRef(``),k=c.useRef(0),A=c.useRef(null),j=c.useRef(`right`),N=c.useRef(0),P=g?vn:c.Fragment,ee=g?{as:to,allowPinchZoom:!0}:void 0,te=e=>{let t=O.current+e,n=S().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=Vo(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;(function e(t){O.current=t,window.clearTimeout(D.current),t!==``&&(D.current=window.setTimeout(()=>e(``),1e3))})(t),o&&setTimeout(()=>o.focus())};c.useEffect(()=>()=>window.clearTimeout(D.current),[]),ct();let F=c.useCallback(e=>j.current===A.current?.side&&Uo(e,A.current?.area),[]);return(0,f.jsx)(Xa,{scope:n,searchRef:O,onItemEnter:c.useCallback(e=>{F(e)&&e.preventDefault()},[F]),onItemLeave:c.useCallback(e=>{F(e)||(T.current?.focus(),w(null))},[F]),onTriggerLeave:c.useCallback(e=>{F(e)&&e.preventDefault()},[F]),pointerGraceTimerRef:k,onPointerGraceIntentChange:c.useCallback(e=>{A.current=e},[]),children:(0,f.jsx)(P,{...ee,children:(0,f.jsx)(Ke,{asChild:!0,trapped:i,onMountAutoFocus:z(a,e=>{e.preventDefault(),T.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:(0,f.jsx)(Pe,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:p,onInteractOutside:m,onDismiss:h,children:(0,f.jsx)(Ca,{asChild:!0,...x,dir:y.dir,orientation:`vertical`,loop:r,currentTabStopId:C,onCurrentTabStopIdChange:w,onEntryFocus:z(l,e=>{y.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,f.jsx)(Xi,{role:`menu`,"aria-orientation":`vertical`,"data-state":Io(v.open),"data-radix-menu-content":``,dir:y.dir,...b,..._,ref:E,style:{outline:`none`,..._.style},onKeyDown:z(_.onKeyDown,e=>{let t=e.target.closest(`[data-radix-menu-content]`)===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=e.key.length===1;if(t&&(e.key===`Tab`&&e.preventDefault(),!n&&r&&te(e.key)),e.target!==T.current||!Oa.includes(e.key))return;e.preventDefault();let i=S().filter(e=>!e.disabled).map(e=>e.ref.current);Da.includes(e.key)&&i.reverse(),zo(i)}),onBlur:z(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(D.current),O.current=``)}),onPointerMove:z(e.onPointerMove,Wo(e=>{let t=e.target,n=N.current!==e.clientX;e.currentTarget.contains(t)&&n&&(j.current=e.clientX>N.current?`right`:`left`,N.current=e.clientX)}))})})})})})})});Qa.displayName=q;var ro=`MenuGroup`,io=c.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,f.jsx)(I.div,{role:`group`,...r,ref:t})});io.displayName=ro;var ao=`MenuLabel`,oo=c.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,f.jsx)(I.div,{...r,ref:t})});oo.displayName=ao;var so=`MenuItem`,co=`menu.itemSelect`,lo=c.forwardRef((e,t)=>{let{disabled:n=!1,onSelect:r,...i}=e,a=c.useRef(null),o=Ha(so,e.__scopeMenu),s=Za(so,e.__scopeMenu),l=M(t,a),u=c.useRef(!1),d=()=>{let e=a.current;if(!n&&e){let t=new CustomEvent(co,{bubbles:!0,cancelable:!0});e.addEventListener(co,e=>r?.(e),{once:!0}),L(e,t),t.defaultPrevented?u.current=!1:o.onClose()}};return(0,f.jsx)(uo,{...i,ref:l,disabled:n,onClick:z(e.onClick,d),onPointerDown:t=>{e.onPointerDown?.(t),u.current=!0},onPointerUp:z(e.onPointerUp,e=>{u.current||e.currentTarget?.click()}),onKeyDown:z(e.onKeyDown,e=>{n||e.target!==e.currentTarget||s.searchRef.current!==``&&e.key===` `||Ta.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});lo.displayName=so;var uo=c.forwardRef((e,t)=>{let{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=Za(so,n),s=Ra(n),l=c.useRef(null),u=M(t,l),[d,p]=c.useState(!1),[m,h]=c.useState(``);return c.useEffect(()=>{let e=l.current;e&&h((e.textContent??``).trim())},[a.children]),(0,f.jsx)(Ma.ItemSlot,{scope:n,disabled:r,textValue:i??m,children:(0,f.jsx)(wa,{asChild:!0,...s,focusable:!r,children:(0,f.jsx)(I.div,{role:`menuitem`,"data-highlighted":d?``:void 0,"aria-disabled":r||void 0,"data-disabled":r?``:void 0,...a,ref:u,onPointerMove:z(e.onPointerMove,Wo(e=>{r?o.onItemLeave(e):(o.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:z(e.onPointerLeave,Wo(e=>o.onItemLeave(e))),onFocus:z(e.onFocus,()=>p(!0)),onBlur:z(e.onBlur,()=>p(!1))})})})}),fo=`MenuCheckboxItem`,po=c.forwardRef((e,t)=>{let{checked:n=!1,onCheckedChange:r,...i}=e;return(0,f.jsx)(xo,{scope:e.__scopeMenu,checked:n,children:(0,f.jsx)(lo,{role:`menuitemcheckbox`,"aria-checked":Lo(n)?`mixed`:n,...i,ref:t,"data-state":Ro(n),onSelect:z(i.onSelect,()=>r?.(Lo(n)?!0:!n),{checkForDefaultPrevented:!1})})})});po.displayName=fo;var mo=`MenuRadioGroup`,[ho,go]=Fa(mo,{value:void 0,onValueChange:()=>{}}),_o=c.forwardRef((e,t)=>{let{value:n,onValueChange:r,...i}=e,a=V(r);return(0,f.jsx)(ho,{scope:e.__scopeMenu,value:n,onValueChange:a,children:(0,f.jsx)(io,{...i,ref:t})})});_o.displayName=mo;var vo=`MenuRadioItem`,yo=c.forwardRef((e,t)=>{let{value:n,...r}=e,i=go(vo,e.__scopeMenu),a=n===i.value;return(0,f.jsx)(xo,{scope:e.__scopeMenu,checked:a,children:(0,f.jsx)(lo,{role:`menuitemradio`,"aria-checked":a,...r,ref:t,"data-state":Ro(a),onSelect:z(r.onSelect,()=>i.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});yo.displayName=vo;var bo=`MenuItemIndicator`,[xo,So]=Fa(bo,{checked:!1}),Co=c.forwardRef((e,t)=>{let{__scopeMenu:n,forceMount:r,...i}=e,a=So(bo,n);return(0,f.jsx)(_e,{present:r||Lo(a.checked)||a.checked===!0,children:(0,f.jsx)(I.span,{...i,ref:t,"data-state":Ro(a.checked)})})});Co.displayName=bo;var wo=`MenuSeparator`,To=c.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,f.jsx)(I.div,{role:`separator`,"aria-orientation":`horizontal`,...r,ref:t})});To.displayName=wo;var Eo=`MenuArrow`,Do=c.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=La(n);return(0,f.jsx)(Zi,{...i,...r,ref:t})});Do.displayName=Eo;var Oo=`MenuSub`,[ko,Ao]=Fa(Oo),jo=e=>{let{__scopeMenu:t,children:n,open:r=!1,onOpenChange:i}=e,a=Ba(Oo,t),o=La(t),[s,l]=c.useState(null),[u,d]=c.useState(null),p=V(i);return c.useEffect(()=>(a.open===!1&&p(!1),()=>p(!1)),[a.open,p]),(0,f.jsx)(Ji,{...o,children:(0,f.jsx)(za,{scope:t,open:r,onOpenChange:p,content:u,onContentChange:d,children:(0,f.jsx)(ko,{scope:t,contentId:Te(),triggerId:Te(),trigger:s,onTriggerChange:l,children:n})})})};jo.displayName=Oo;var Mo=`MenuSubTrigger`,No=c.forwardRef((e,t)=>{let n=Ba(Mo,e.__scopeMenu),r=Ha(Mo,e.__scopeMenu),i=Ao(Mo,e.__scopeMenu),a=Za(Mo,e.__scopeMenu),o=c.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:l}=a,u={__scopeMenu:e.__scopeMenu},d=c.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);c.useEffect(()=>d,[d]),c.useEffect(()=>{let e=s.current;return()=>{window.clearTimeout(e),l(null)}},[s,l]);let p=M(t,i.onTriggerChange);return(0,f.jsx)(Ga,{asChild:!0,...u,children:(0,f.jsx)(uo,{id:i.triggerId,"aria-haspopup":`menu`,"aria-expanded":n.open,"aria-controls":n.open?i.contentId:void 0,"data-state":Io(n.open),...e,ref:p,onClick:t=>{e.onClick?.(t),!(e.disabled||t.defaultPrevented)&&(t.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:z(e.onPointerMove,Wo(t=>{a.onItemEnter(t),!t.defaultPrevented&&!e.disabled&&!n.open&&!o.current&&(a.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),d()},100))})),onPointerLeave:z(e.onPointerLeave,Wo(e=>{d();let t=n.content?.getBoundingClientRect();if(t){let r=n.content?.dataset.side,i=r===`right`,o=i?-5:5,c=t[i?`left`:`right`],l=t[i?`right`:`left`];a.onPointerGraceIntentChange({area:[{x:e.clientX+o,y:e.clientY},{x:c,y:t.top},{x:l,y:t.top},{x:l,y:t.bottom},{x:c,y:t.bottom}],side:r}),window.clearTimeout(s.current),s.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(e),e.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:z(e.onKeyDown,t=>{e.disabled||t.target!==t.currentTarget||a.searchRef.current!==``&&t.key===` `||ka[r.dir].includes(t.key)&&(n.onOpenChange(!0),n.content?.focus(),t.preventDefault())})})})});No.displayName=Mo;var Po=`MenuSubContent`,Fo=c.forwardRef((e,t)=>{let n=Ja(q,e.__scopeMenu),{forceMount:r=n.forceMount,align:i=`start`,...a}=e,o=Ba(q,e.__scopeMenu),s=Ha(q,e.__scopeMenu),l=Ao(Po,e.__scopeMenu),u=c.useRef(null),d=M(t,u);return(0,f.jsx)(Ma.Provider,{scope:e.__scopeMenu,children:(0,f.jsx)(_e,{present:r||o.open,children:(0,f.jsx)(Ma.Slot,{scope:e.__scopeMenu,children:(0,f.jsx)(no,{id:l.contentId,"aria-labelledby":l.triggerId,...a,ref:d,align:i,side:s.dir===`rtl`?`left`:`right`,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{s.isUsingKeyboardRef.current&&u.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:z(e.onFocusOutside,e=>{e.target!==l.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:z(e.onEscapeKeyDown,e=>{s.onClose(),e.preventDefault()}),onKeyDown:z(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),n=Aa[s.dir].includes(e.key);t&&n&&(o.onOpenChange(!1),l.trigger?.focus(),e.preventDefault())})})})})})});Fo.displayName=Po;function Io(e){return e?`open`:`closed`}function Lo(e){return e===`indeterminate`}function Ro(e){return Lo(e)?`indeterminate`:e?`checked`:`unchecked`}function zo(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function Bo(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function Vo(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=Bo(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function Ho(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function Uo(e,t){return t?Ho({x:e.clientX,y:e.clientY},t):!1}function Wo(e){return t=>t.pointerType===`mouse`?e(t):void 0}var Go=Ua,Ko=Ga,qo=Ya,Jo=Qa,Yo=io,Xo=oo,Zo=lo,Qo=po,$o=_o,es=yo,ts=Co,ns=To,rs=Do,is=No,as=Fo,os=`DropdownMenu`,[ss,cs]=R(os,[Ia]),J=Ia(),[ls,us]=ss(os),ds=e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,l=J(t),u=c.useRef(null),[d,p]=pe({prop:i,defaultProp:a??!1,onChange:o,caller:os});return(0,f.jsx)(ls,{scope:t,triggerId:Te(),triggerRef:u,contentId:Te(),open:d,onOpenChange:p,onOpenToggle:c.useCallback(()=>p(e=>!e),[p]),modal:s,children:(0,f.jsx)(Go,{...l,open:d,onOpenChange:p,dir:r,modal:s,children:n})})};ds.displayName=os;var fs=`DropdownMenuTrigger`,ps=c.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=us(fs,n),o=J(n),s=M(t,a.triggerRef);return(0,f.jsx)(Ko,{asChild:!0,...o,children:(0,f.jsx)(I.button,{type:`button`,id:a.triggerId,"aria-haspopup":`menu`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?`open`:`closed`,"data-disabled":r?``:void 0,disabled:r,...i,ref:s,onPointerDown:z(e.onPointerDown,e=>{!r&&e.button===0&&e.ctrlKey===!1&&(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:z(e.onKeyDown,e=>{r||([`Enter`,` `].includes(e.key)&&a.onOpenToggle(),e.key===`ArrowDown`&&a.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})});ps.displayName=fs;var ms=`DropdownMenuPortal`,hs=e=>{let{__scopeDropdownMenu:t,...n}=e,r=J(t);return(0,f.jsx)(qo,{...r,...n})};hs.displayName=ms;var gs=`DropdownMenuContent`,_s=c.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=us(gs,n),a=J(n),o=c.useRef(!1);return(0,f.jsx)(Jo,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:z(e.onCloseAutoFocus,e=>{o.current||i.triggerRef.current?.focus(),o.current=!1,e.preventDefault()}),onInteractOutside:z(e.onInteractOutside,e=>{let t=e.detail.originalEvent;(!i.modal||t.button===2||t.button===0&&t.ctrlKey===!0)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});_s.displayName=gs;var vs=`DropdownMenuGroup`,ys=c.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=J(n);return(0,f.jsx)(Yo,{...i,...r,ref:t})});ys.displayName=vs;var bs=`DropdownMenuLabel`,xs=c.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=J(n);return(0,f.jsx)(Xo,{...i,...r,ref:t})});xs.displayName=bs;var Ss=`DropdownMenuItem`,Cs=c.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=J(n);return(0,f.jsx)(Zo,{...i,...r,ref:t})});Cs.displayName=Ss;var ws=`DropdownMenuCheckboxItem`,Ts=c.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=J(n);return(0,f.jsx)(Qo,{...i,...r,ref:t})});Ts.displayName=ws;var Es=`DropdownMenuRadioGroup`,Ds=c.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=J(n);return(0,f.jsx)($o,{...i,...r,ref:t})});Ds.displayName=Es;var Os=`DropdownMenuRadioItem`,ks=c.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=J(n);return(0,f.jsx)(es,{...i,...r,ref:t})});ks.displayName=Os;var As=`DropdownMenuItemIndicator`,js=c.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=J(n);return(0,f.jsx)(ts,{...i,...r,ref:t})});js.displayName=As;var Ms=`DropdownMenuSeparator`,Ns=c.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=J(n);return(0,f.jsx)(ns,{...i,...r,ref:t})});Ns.displayName=Ms;var Ps=`DropdownMenuArrow`,Fs=c.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=J(n);return(0,f.jsx)(rs,{...i,...r,ref:t})});Fs.displayName=Ps;var Is=`DropdownMenuSubTrigger`,Ls=c.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=J(n);return(0,f.jsx)(is,{...i,...r,ref:t})});Ls.displayName=Is;var Rs=`DropdownMenuSubContent`,zs=c.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=J(n);return(0,f.jsx)(as,{...i,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});zs.displayName=Rs;var Bs=ds,Vs=ps,Hs=hs,Us=_s,Ws=xs,Gs=Cs,Ks=Ns,qs=k(`inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/90`,destructive:`bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40`,outline:`border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50`,secondary:`bg-secondary text-secondary-foreground hover:bg-secondary/80`,ghost:`hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-9 px-4 py-2 has-[>svg]:px-3`,xs:`h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5`,lg:`h-10 rounded-md px-6 has-[>svg]:px-4`,icon:`size-9`,"icon-xs":`size-6 rounded-md [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-8`,"icon-lg":`size-10`}},defaultVariants:{variant:`default`,size:`default`}});function Y({className:e,variant:t=`default`,size:n=`default`,asChild:r=!1,...i}){return(0,f.jsx)(r?P:`button`,{"data-slot":`button`,"data-variant":t,"data-size":n,className:a.l(qs({variant:t,size:n,className:e})),...i})}var Js={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},Ys=(0,c.createContext)({}),Xs=()=>(0,c.useContext)(Ys),Zs=(0,c.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:o,iconNode:s,...l},u)=>{let{size:d=24,strokeWidth:f=2,absoluteStrokeWidth:p=!1,color:m=`currentColor`,className:h=``}=Xs()??{},g=r??p?Number(n??f)*24/Number(t??d):n??f;return(0,c.createElement)(`svg`,{ref:u,...Js,width:t??d??Js.width,height:t??d??Js.height,stroke:e??m,strokeWidth:g,className:a.c(`lucide`,h,i),...!o&&!a.a(l)&&{"aria-hidden":`true`},...l},[...s.map(([e,t])=>(0,c.createElement)(e,t)),...Array.isArray(o)?o:[o]])}),X=(e,t)=>{let n=(0,c.forwardRef)(({className:n,...r},i)=>(0,c.createElement)(Zs,{ref:i,iconNode:t,className:a.c(`lucide-${a.s(a.o(e))}`,`lucide-${e}`,n),...r}));return n.displayName=a.o(e),n},Qs=X(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),$s=X(`maximize`,[[`path`,{d:`M8 3H5a2 2 0 0 0-2 2v3`,key:`1dcmit`}],[`path`,{d:`M21 8V5a2 2 0 0 0-2-2h-3`,key:`1e4gt3`}],[`path`,{d:`M3 16v3a2 2 0 0 0 2 2h3`,key:`wsl5sc`}],[`path`,{d:`M16 21h3a2 2 0 0 0 2-2v-3`,key:`18trek`}]]),ec=X(`minimize`,[[`path`,{d:`M8 3v3a2 2 0 0 1-2 2H3`,key:`hohbtr`}],[`path`,{d:`M21 8h-3a2 2 0 0 1-2-2V3`,key:`5jw1f3`}],[`path`,{d:`M3 16h3a2 2 0 0 1 2 2v3`,key:`198tvr`}],[`path`,{d:`M16 21v-3a2 2 0 0 1 2-2h3`,key:`ph8mxp`}]]),tc=X(`pause`,[[`rect`,{x:`14`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`kaeet6`}],[`rect`,{x:`5`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`1wsw3u`}]]),nc=X(`play`,[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]),rc=X(`refresh-ccw`,[[`path`,{d:`M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`14sxne`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16`,key:`1hlbsb`}],[`path`,{d:`M16 16h5v5`,key:`ccwih5`}]]),ic=X(`rotate-ccw`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]),ac=X(`triangle-alert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),oc=X(`volume-1`,[[`path`,{d:`M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z`,key:`uqj9uw`}],[`path`,{d:`M16 9a5 5 0 0 1 0 6`,key:`1q6k2b`}]]),sc=X(`volume-2`,[[`path`,{d:`M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z`,key:`uqj9uw`}],[`path`,{d:`M16 9a5 5 0 0 1 0 6`,key:`1q6k2b`}],[`path`,{d:`M19.364 18.364a9 9 0 0 0 0-12.728`,key:`ijwkga`}]]),cc=X(`volume-x`,[[`path`,{d:`M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z`,key:`uqj9uw`}],[`line`,{x1:`22`,x2:`16`,y1:`9`,y2:`15`,key:`1ewh16`}],[`line`,{x1:`16`,x2:`22`,y1:`9`,y2:`15`,key:`5ykzw1`}]]);function lc({error:e,label:n,description:i,onRetry:a,onReload:o,className:s,asChild:l=!1,children:u,...d}){let p=t.l(),m=t.f(e=>e.error),h=e||m,[g,_]=c.default.useState({retryPending:!1,reloadPending:!1}),v=c.default.useCallback(()=>{_(e=>({...e,retryPending:!0})),requestAnimationFrame(()=>{let e=p.mediaRef.current;if(!e){_(e=>({...e,retryPending:!1}));return}a?a():e.src&&e.load(),_(e=>({...e,retryPending:!1}))})},[p.mediaRef,a]),y=c.default.useCallback(()=>{_(e=>({...e,reloadPending:!0})),requestAnimationFrame(()=>{o?o():window.location.reload()})},[o]),b=c.default.useMemo(()=>n||(h instanceof Error?`Media Error`:`Playback Error`),[n,h]),x=c.default.useMemo(()=>i||(h instanceof Error?h.message:typeof h==`string`?h:`An error occurred while loading the media`),[i,h]);if(!h)return null;let S={role:`alert`,"aria-describedby":`${p.mediaId}-error-description`,"aria-labelledby":`${p.mediaId}-error-label`,"aria-live":`assertive`,"data-slot":`media-player-error`,"data-state":`error`,className:r.g(`pointer-events-auto absolute inset-0 z-50 flex flex-col items-center justify-center bg-black/80 text-white backdrop-blur-sm`,s),...d},C=(0,f.jsxs)(`div`,{className:`flex flex-col items-center gap-4 p-6 text-center`,children:[(0,f.jsx)(ac,{className:`size-12 text-red-400`}),(0,f.jsxs)(`div`,{className:`space-y-2`,children:[(0,f.jsx)(`h3`,{id:`${p.mediaId}-error-label`,className:`font-semibold text-lg`,children:b}),(0,f.jsx)(`p`,{id:`${p.mediaId}-error-description`,className:`text-sm text-white/80`,children:x})]}),(0,f.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,f.jsxs)(Y,{variant:`outline`,size:`sm`,onClick:v,disabled:g.retryPending,children:[g.retryPending?(0,f.jsx)(rc,{className:`mr-2 size-4 animate-spin`}):(0,f.jsx)(rc,{className:`mr-2 size-4`}),`Try again`]}),(0,f.jsxs)(Y,{variant:`outline`,size:`sm`,onClick:y,disabled:g.reloadPending,children:[g.reloadPending?(0,f.jsx)(ic,{className:`mr-2 size-4 animate-spin`}):(0,f.jsx)(ic,{className:`mr-2 size-4`}),`Reload page`]})]})]});if(l){let e=c.default.Children.only(u);return c.default.cloneElement(e,S,C)}return(0,f.jsx)(`div`,{...S,children:C})}lc.displayName=`MediaPlayerError`;function uc({className:e,delayMs:n=300,asChild:i=!1,children:a,...o}){let s=t.f(e=>e.isLoading),[l,u]=c.default.useState(!1),d=c.default.useRef(void 0);if(c.default.useEffect(()=>(d.current&&(clearTimeout(d.current),d.current=void 0),s?n>0?d.current=setTimeout(()=>{u(!0),d.current=void 0},n):u(!0):u(!1),()=>{d.current&&(clearTimeout(d.current),d.current=void 0)}),[s,n]),!l)return null;let p={role:`status`,"aria-live":`polite`,"data-slot":`media-player-loading`,className:r.g(`fade-in-0 zoom-in-95 pointer-events-none absolute inset-0 z-50 flex animate-in items-center justify-center duration-200`,e),...o},m=(0,f.jsx)(Qs,{className:`size-8 animate-spin text-white`});if(i){let e=c.default.Children.only(a);return c.default.cloneElement(e,p,m)}return(0,f.jsx)(`div`,{...p,children:m})}uc.displayName=`MediaPlayerLoading`;function dc({sources:e,poster:n,textTracks:i=[],showControls:a=!0,customControls:o,hlsConfig:s,enableQualitySelector:c=!0,enableSubtitles:l=!0,containerClassName:u,videoClassName:d,onPlayerReady:p,onPlayerError:m}){let h=t.f(e=>e.isLoading),g=t.f(e=>e.isBuffering),_=t.f(e=>e.error);return(0,f.jsxs)(`div`,{className:r.g(`relative h-full w-full`,u),children:[(0,f.jsx)(E,{sources:e,poster:n,textTracks:i,controls:!0,autoplay:!1,muted:!0,preload:`auto`,className:d,hlsConfig:s,enableQualitySelector:c,enableSubtitles:l,onReady:p,onError:m}),(h||g)&&(0,f.jsx)(uc,{}),_&&(0,f.jsx)(lc,{children:_})]})}function fc(e){let{sources:t,poster:n,textTracks:r,showControls:a,customControls:o,hlsConfig:s,enableQualitySelector:c,enableSubtitles:l,containerClassName:u,videoClassName:d,onPlayerReady:p,onPlayerError:m,...h}=e;return(0,f.jsx)(i.c,{...h,children:(0,f.jsx)(dc,{sources:t,poster:n,textTracks:r,showControls:a,customControls:o,hlsConfig:s,enableQualitySelector:c,enableSubtitles:l,containerClassName:u,videoClassName:d,onPlayerReady:p,onPlayerError:m})})}fc.displayName=`MediaPlayerHLS`;var pc=[`mp4`,`webm`,`ogv`,`mov`,`avi`,`m4v`,`mkv`],mc=[`mp3`,`aac`,`ogg`,`wav`,`flac`,`m4a`,`weba`],hc={mp4:`video/mp4`,webm:`video/webm`,ogv:`video/ogg`,mov:`video/quicktime`,avi:`video/x-msvideo`,m4v:`video/x-m4v`,mkv:`video/x-matroska`},gc={mp3:`audio/mpeg`,aac:`audio/aac`,ogg:`audio/ogg`,wav:`audio/wav`,flac:`audio/flac`,m4a:`audio/mp4`,weba:`audio/webm`};function _c(e){let t=e.split(`.`).pop()?.toLowerCase();return t&&pc.includes(t)?`video`:t&&mc.includes(t)?`audio`:`unknown`}function vc(e){let t=e.split(`.`).pop()?.toLowerCase();if(t&&t in hc)return hc[t];if(t&&t in gc)return gc[t]}function yc({...e}){return(0,f.jsx)(Bs,{"data-slot":`dropdown-menu`,...e})}function bc({...e}){return(0,f.jsx)(Vs,{"data-slot":`dropdown-menu-trigger`,...e})}function xc({className:e,sideOffset:t=4,...n}){return(0,f.jsx)(Hs,{children:(0,f.jsx)(Us,{"data-slot":`dropdown-menu-content`,sideOffset:t,className:a.l(`z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95`,e),...n})})}function Sc({className:e,inset:t,variant:n=`default`,...r}){return(0,f.jsx)(Gs,{"data-slot":`dropdown-menu-item`,"data-inset":t,"data-variant":n,className:a.l(`relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground data-[variant=destructive]:*:[svg]:text-destructive!`,e),...r})}function Cc({className:e,inset:t,...n}){return(0,f.jsx)(Ws,{"data-slot":`dropdown-menu-label`,"data-inset":t,className:a.l(`px-2 py-1.5 text-sm font-medium data-[inset]:pl-8`,e),...n})}function wc({className:e,...t}){return(0,f.jsx)(Ks,{"data-slot":`dropdown-menu-separator`,className:a.l(`-mx-1 my-1 h-px bg-border`,e),...t})}function Tc({delayDuration:e=0,...t}){return(0,f.jsx)(d.Provider,{"data-slot":`tooltip-provider`,delayDuration:e,...t})}function Z({...e}){return(0,f.jsx)(d.Root,{"data-slot":`tooltip`,...e})}function Q({...e}){return(0,f.jsx)(d.Trigger,{"data-slot":`tooltip-trigger`,...e})}function $({className:e,sideOffset:t=0,children:n,...r}){return(0,f.jsx)(d.Portal,{children:(0,f.jsxs)(d.Content,{"data-slot":`tooltip-content`,sideOffset:t,className:a.l(`z-50 w-fit origin-(--radix-tooltip-content-transform-origin) animate-in rounded-md bg-foreground px-3 py-1.5 text-xs text-balance text-background fade-in-0 zoom-in-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 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95`,e),...r,children:[n,(0,f.jsx)(d.Arrow,{className:`z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground`})]})})}function Ec({className:e,defaultValue:t,value:n,min:r=0,max:i=100,...o}){let s=c.useMemo(()=>Array.isArray(n)?n:Array.isArray(t)?t:[r,i],[n,t,r,i]);return(0,f.jsxs)(u.Root,{"data-slot":`slider`,defaultValue:t,value:n,min:r,max:i,className:a.l(`relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col`,e),...o,children:[(0,f.jsx)(u.Track,{"data-slot":`slider-track`,className:a.l(`relative grow overflow-hidden rounded-full bg-muted data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5`),children:(0,f.jsx)(u.Range,{"data-slot":`slider-range`,className:a.l(`absolute bg-primary data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full`)})}),Array.from({length:s.length},(e,t)=>(0,f.jsx)(u.Thumb,{"data-slot":`slider-thumb`,className:`block size-4 shrink-0 rounded-full border border-primary bg-white shadow-sm ring-ring/50 transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50`},t))]})}var Dc=({className:e,...t})=>(0,f.jsx)(`svg`,{viewBox:`0 0 24 24`,fill:`currentColor`,className:a.l(`size-6`,e),...t,children:(0,f.jsx)(`path`,{d:`M8 5.14v13.72c0 .45.54.67.85.35l8.56-8.86a.5.5 0 0 0 0-.7L8.85 4.79c-.31-.32-.85-.1-.85.35z`})}),Oc=({className:e,...t})=>(0,f.jsxs)(`svg`,{viewBox:`0 0 24 24`,fill:`currentColor`,className:a.l(`size-6`,e),...t,children:[(0,f.jsx)(`rect`,{x:`6`,y:`4`,width:`4`,height:`16`,rx:`1`}),(0,f.jsx)(`rect`,{x:`14`,y:`4`,width:`4`,height:`16`,rx:`1`})]}),kc=({className:e,...t})=>(0,f.jsx)(`svg`,{viewBox:`0 0 24 24`,fill:`currentColor`,className:a.l(`size-6`,e),...t,children:(0,f.jsx)(`path`,{d:`M3 9v6h4l5 5V4L7 9H3zm13.5 3c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02zM14 3.23v2.06c2.89.86 5 3.54 5 6.71s-2.11 5.85-5 6.71v2.06c4.01-.91 7-4.49 7-8.77s-2.99-7.86-7-8.77z`})}),Ac=({className:e,...t})=>(0,f.jsx)(`svg`,{viewBox:`0 0 24 24`,fill:`currentColor`,className:a.l(`size-6`,e),...t,children:(0,f.jsx)(`path`,{d:`M16.5 12c0-1.77-1.02-3.29-2.5-4.03v2.21l2.45 2.45c.03-.2.05-.41.05-.63zm2.5 0c0 .94-.2 1.82-.54 2.64l1.51 1.51C20.63 14.91 21 13.5 21 12c0-4.28-2.99-7.86-7-8.77v2.06c2.89.86 5 3.54 5 6.71zM4.27 3L3 4.27 7.73 9H3v6h4l5 5v-6.73l4.25 4.25c-.67.52-1.42.93-2.25 1.18v2.06c1.38-.31 2.63-.95 3.69-1.81L19.73 21 21 19.73l-9-9L4.27 3zM12 4L9.91 6.09 12 8.18V4z`})}),jc=({className:e,...t})=>(0,f.jsx)(`svg`,{viewBox:`0 0 24 24`,fill:`currentColor`,className:a.l(`size-6`,e),...t,children:(0,f.jsx)(`path`,{d:`M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z`})}),Mc=({className:e,...t})=>(0,f.jsx)(`svg`,{viewBox:`0 0 24 24`,fill:`currentColor`,className:a.l(`size-6`,e),...t,children:(0,f.jsx)(`path`,{d:`M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z`})}),Nc=({className:e,...t})=>(0,f.jsx)(`svg`,{viewBox:`0 0 24 24`,fill:`currentColor`,className:a.l(`size-6`,e),...t,children:(0,f.jsx)(`path`,{d:`M19 7h-8v6h8V7zm2-4H3c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H3V5h18v14z`})}),Pc=({className:e,...t})=>(0,f.jsx)(`svg`,{viewBox:`0 0 24 24`,fill:`currentColor`,className:a.l(`size-6`,e),...t,children:(0,f.jsxs)(`g`,{children:[(0,f.jsx)(`path`,{d:`M18 13c0 3.31-2.69 6-6 6s-6-2.69-6-6 2.69-6 6-6v4l5-5-5-5v4c-4.42 0-8 3.58-8 8s3.58 8 8 8 8-3.58 8-8h-2z`}),(0,f.jsx)(`path`,{d:`M10.86 15v-2.5h-1.5V15h1.5zm2.49-2.62c.24-.23.39-.5.39-.81 0-.32-.15-.59-.39-.82s-.53-.35-.88-.35c-.34 0-.64.12-.87.35s-.35.51-.35.82v.23c0 .16.02.3.06.41l.99-.28c-.02-.08-.03-.19-.03-.34 0-.14.05-.25.14-.34.09-.08.21-.13.35-.13s.26.05.35.13c.09.09.14.2.14.34s-.05.25-.14.34l-1.08 1.08c-.07.07-.12.14-.17.22s-.08.16-.1.24-.04.18-.04.28v.21h1.85v-.66h-.92l.59-.59z`})]})}),Fc=({className:e,...t})=>(0,f.jsx)(`svg`,{viewBox:`0 0 24 24`,fill:`currentColor`,className:a.l(`size-6`,e),...t,children:(0,f.jsxs)(`g`,{children:[(0,f.jsx)(`path`,{d:`M12 5V1L7 6l5 5V7c3.31 0 6 2.69 6 6s-2.69 6-6 6-6-2.69-6-6H4c0 4.42 3.58 8 8 8s8-3.58 8-8-3.58-8-8-8z`}),(0,f.jsx)(`path`,{d:`M10.89 16h-1.5v-2.5h-2v-1h3.5V16zm2.5-4.5V16h-1.5v-4.5h1.5z`})]})}),Ic=({className:e,...t})=>(0,f.jsx)(`svg`,{viewBox:`0 0 24 24`,fill:`currentColor`,className:a.l(`size-6`,e),...t,children:(0,f.jsx)(`path`,{d:`M20 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zM4 12h4v2H4v-2zm10 6H4v-2h10v2zm6 0h-4v-2h4v2zm0-4H10v-2h10v2z`})}),Lc=({className:e,...t})=>(0,f.jsx)(`svg`,{viewBox:`0 0 24 24`,fill:`currentColor`,className:a.l(`size-6`,e),...t,children:(0,f.jsx)(`path`,{d:`M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-8 12.5v-7c0-.55.45-1 1-1s1 .45 1 1v7c0 .55-.45 1-1 1s-1-.45-1-1zM7 11h1.5v3.5h1v-3.5H11v-1H7v1zm8.5 4.5H17v-1h-1.5v-1H17v-1h-1.5v-1H17v-1h-2.5c-.55 0-1 .45-1 1v4c0 .55.45 1 1 1z`})}),Rc=({className:e,...t})=>(0,f.jsxs)(`svg`,{viewBox:`0 0 24 24`,fill:`currentColor`,className:a.l(`size-6`,e),...t,children:[(0,f.jsx)(`path`,{d:`M15.96 10.29l-2.75 3.08c-.31.34-.81.34-1.12 0-.31-.34-.31-.89 0-1.23l2.75-3.08c1.31-1.46 3.58-.21 3.58 1.75 0 .89-.36 1.79-1.07 2.5l-6.88 6.88c-.71.71-1.61 1.07-2.5 1.07-1.96 0-3.21-2.27-1.75-3.58l3.08-2.75c.34-.31.89-.31 1.23 0 .34.31.34.81 0 1.12l-3.08 2.75c-.35.39.07 1.04.58.79l6.88-6.88c.36-.36.52-.82.52-1.25 0-.51-.65-.93-1.04-.58z`}),(0,f.jsx)(`text`,{x:`12`,y:`10`,fontSize:`8`,textAnchor:`middle`,fill:`currentColor`,fontWeight:`bold`,children:`1x`})]}),zc=({className:e,...t})=>(0,f.jsx)(`svg`,{viewBox:`0 0 24 24`,fill:`currentColor`,className:a.l(`size-6`,e),...t,children:(0,f.jsx)(`path`,{d:`M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z`})}),Bc=({className:e,...t})=>(0,f.jsx)(`svg`,{viewBox:`0 0 24 24`,fill:`currentColor`,className:a.l(`size-6`,e),...t,children:(0,f.jsx)(`path`,{d:`M18 16.08c-.76 0-1.44.3-1.96.77L8.91 12.7c.05-.23.09-.46.09-.7s-.04-.47-.09-.7l7.05-4.11c.54.5 1.25.81 2.04.81 1.66 0 3-1.34 3-3s-1.34-3-3-3-3 1.34-3 3c0 .24.04.47.09.7L8.04 9.81C7.5 9.31 6.79 9 6 9c-1.66 0-3 1.34-3 3s1.34 3 3 3c.79 0 1.5-.31 2.04-.81l7.12 4.16c-.05.21-.08.43-.08.65 0 1.61 1.31 2.92 2.92 2.92 1.61 0 2.92-1.31 2.92-2.92s-1.31-2.92-2.92-2.92z`})}),Vc=({className:e,...t})=>(0,f.jsx)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,className:a.l(`size-6 animate-spin`,e),...t,children:(0,f.jsx)(`path`,{d:`M12 2a10 10 0 1 0 10 10`})}),Hc=(0,c.lazy)(()=>import(`react-player`));function Uc({className:e,containerClassName:t,url:n,playing:i=!1,volume:a=1,muted:o=!1,controls:s=!1,light:l=!1,loop:u=!1,playbackRate:d=1,width:p=`100%`,height:m=`100%`,style:h,progressInterval:g=1e3,playsinline:_=!0,pip:v=!1,stopOnUnmount:y=!0,fallback:b=(0,f.jsx)(Vc,{className:`size-12 text-white`}),wrapper:x=`div`,config:S,showDownload:C=!1,showShare:w=!1,showSubtitles:T=!1,showQuality:E=!1,onDownload:D,onShare:O,qualityOptions:k=[{label:`1080p`,value:`1080`},{label:`720p`,value:`720`},{label:`480p`,value:`480`},{label:`360p`,value:`360`}],subtitleTracks:A=[],onReady:j,onStart:M,onPlay:N,onProgress:P,onDuration:ee,onPause:te,onBuffer:F,onBufferEnd:ne,onSeek:re,onPlaybackRateChange:ie,onEnded:ae,onError:oe,onClickPreview:se,onEnablePIP:ce,onDisablePIP:le,...I}){let[L,R]=(0,c.useState)(i),[ue,de]=(0,c.useState)(a),[z,B]=(0,c.useState)(o),[fe,pe]=(0,c.useState)(0),[me,he]=(0,c.useState)(0),[ge,_e]=(0,c.useState)(0),[ve,ye]=(0,c.useState)(!1),[be,xe]=(0,c.useState)(v),[Se,Ce]=(0,c.useState)(d),[we,Te]=(0,c.useState)(!0),[Ee,De]=(0,c.useState)(!0),[V,Oe]=(0,c.useState)(k[0]?.value||`720`),[ke,Ae]=(0,c.useState)(null),je=(0,c.useRef)(null),Me=(0,c.useRef)(null),Ne=(0,c.useRef)(null),Pe=e=>{let t=new Date(e*1e3),n=t.getUTCHours(),r=t.getUTCMinutes(),i=t.getUTCSeconds().toString().padStart(2,`0`);return n?`${n}:${r.toString().padStart(2,`0`)}:${i}`:`${r}:${i}`},Fe=()=>{Te(!0),Ne.current&&clearTimeout(Ne.current),L&&(Ne.current=setTimeout(()=>{Te(!1)},3e3))};(0,c.useEffect)(()=>()=>{Ne.current&&clearTimeout(Ne.current)},[]);let Ie=()=>{document.fullscreenElement?(document.exitFullscreen(),ye(!1)):(Me.current?.requestFullscreen(),ye(!0))};(0,c.useEffect)(()=>{let e=e=>{if(Me.current?.contains(document.activeElement))switch(e.key.toLowerCase()){case` `:case`k`:e.preventDefault(),R(!L);break;case`f`:e.preventDefault(),Ie();break;case`m`:e.preventDefault(),B(!z);break;case`arrowleft`:e.preventDefault(),je.current?.seekTo(me-10);break;case`arrowright`:e.preventDefault(),je.current?.seekTo(me+10);break;case`arrowup`:e.preventDefault(),de(Math.min(1,ue+.1));break;case`arrowdown`:e.preventDefault(),de(Math.max(0,ue-.1));break}};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[L,z,me,ue,Ie]);let Le=[.5,.75,1,1.25,1.5,2];return(0,f.jsx)(Tc,{children:(0,f.jsxs)(`div`,{ref:Me,className:r.g(`relative overflow-hidden rounded-lg bg-black`,`focus-within:outline-none`,t),onMouseMove:Fe,onMouseLeave:()=>L&&Te(!1),tabIndex:0,children:[(0,f.jsx)(c.Suspense,{fallback:b,children:(0,f.jsx)(Hc,{ref:je,url:n,playing:L,volume:z?0:ue,muted:z,controls:!1,light:l,loop:u,playbackRate:Se,width:p,height:m,style:{...h,aspectRatio:`16/9`},progressInterval:g,playsinline:_,pip:be,stopOnUnmount:y,fallback:b,wrapper:x,config:S,className:r.g(`aspect-video`,e),onReady:()=>{De(!1),j?.()},onStart:()=>{De(!1),M?.()},onPlay:()=>{R(!0),N?.()},onPause:()=>{R(!1),te?.()},onProgress:e=>{he(e.playedSeconds),_e(e.loaded),P?.(e)},onDuration:e=>{pe(e),ee?.(e)},onBuffer:()=>{De(!0),F?.()},onBufferEnd:()=>{De(!1),ne?.()},onSeek:re,onPlaybackRateChange:e=>{Ce(e),ie?.(e)},onEnded:ae,onError:oe,onClickPreview:se,onEnablePIP:()=>{xe(!0),ce?.()},onDisablePIP:()=>{xe(!1),le?.()},...I})}),Ee&&(0,f.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center bg-black/50`,children:(0,f.jsx)(Vc,{className:`size-12 text-white`})}),(0,f.jsxs)(`div`,{className:r.g(`absolute inset-0 bg-gradient-to-t from-black/80 via-transparent to-black/20`,`transition-opacity duration-300`,we?`opacity-100`:`pointer-events-none opacity-0`),children:[(0,f.jsxs)(`div`,{className:`absolute top-0 right-0 left-0 flex items-center justify-between p-4`,children:[(0,f.jsx)(`h3`,{className:`font-medium text-lg text-white`,children:`Media Player`}),(0,f.jsxs)(`div`,{className:`flex items-center gap-2`,children:[w&&(0,f.jsxs)(Z,{children:[(0,f.jsx)(Q,{asChild:!0,children:(0,f.jsx)(Y,{variant:`ghost`,size:`icon`,className:`pixel-button rounded-none border border-gray-600/50 bg-gray-800/80 text-white shadow-lg transition-all duration-150 hover:border-gray-500 hover:bg-gray-700/80 active:scale-95`,onClick:O,children:(0,f.jsx)(Bc,{className:`size-5`})})}),(0,f.jsx)($,{children:`Share`})]}),C&&(0,f.jsxs)(Z,{children:[(0,f.jsx)(Q,{asChild:!0,children:(0,f.jsx)(Y,{variant:`ghost`,size:`icon`,className:`pixel-button rounded-none border border-gray-600/50 bg-gray-800/80 text-white shadow-lg transition-all duration-150 hover:border-gray-500 hover:bg-gray-700/80 active:scale-95`,onClick:D,children:(0,f.jsx)(zc,{className:`size-5`})})}),(0,f.jsx)($,{children:`Download`})]})]})]}),(0,f.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center`,children:(0,f.jsx)(Y,{variant:`ghost`,size:`icon`,className:`pixel-button size-20 rounded-none border-2 border-gray-600 bg-gray-800/90 text-white shadow-xl transition-all duration-200 hover:scale-105 hover:border-gray-500 hover:bg-gray-700/90 active:scale-95`,onClick:()=>R(!L),children:(0,f.jsx)(L?Oc:Dc,{className:`size-10`})})}),(0,f.jsxs)(`div`,{className:`absolute right-0 bottom-0 left-0 space-y-2 p-4`,children:[(0,f.jsxs)(`div`,{className:`relative`,children:[(0,f.jsx)(Ec,{value:[me],max:fe,step:1,onValueChange:([e])=>{typeof e==`number`&&je.current?.seekTo(e)},className:`pixel-progress cursor-pointer [&>span]:rounded-none [&>span]:border [&>span]:border-gray-600 [&>span]:bg-gray-800 [&>span]:shadow-lg [&_[role=slider]]:size-4 [&_[role=slider]]:rounded-none [&_[role=slider]]:border-2 [&_[role=slider]]:border-gray-400 [&_[role=slider]]:bg-white [&_[role=slider]]:shadow-md`}),(0,f.jsx)(`div`,{className:`pointer-events-none absolute top-0 left-0 h-full rounded-none border border-gray-500/30 bg-white/20`,style:{width:`${ge*100}%`}})]}),(0,f.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,f.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,f.jsxs)(Z,{children:[(0,f.jsx)(Q,{asChild:!0,children:(0,f.jsx)(Y,{variant:`ghost`,size:`icon`,className:`pixel-button rounded-none border border-gray-600/50 bg-gray-800/80 text-white shadow-lg transition-all duration-150 hover:border-gray-500 hover:bg-gray-700/80 active:scale-95`,onClick:()=>R(!L),children:(0,f.jsx)(L?Oc:Dc,{className:`size-6`})})}),(0,f.jsx)($,{children:L?`Pause (k)`:`Play (k)`})]}),(0,f.jsxs)(Z,{children:[(0,f.jsx)(Q,{asChild:!0,children:(0,f.jsx)(Y,{variant:`ghost`,size:`icon`,className:`pixel-button rounded-none border border-gray-600/50 bg-gray-800/80 text-white shadow-lg transition-all duration-150 hover:border-gray-500 hover:bg-gray-700/80 active:scale-95`,onClick:()=>je.current?.seekTo(me-10),children:(0,f.jsx)(Fc,{className:`size-6`})})}),(0,f.jsx)($,{children:`Back 10s (←)`})]}),(0,f.jsxs)(Z,{children:[(0,f.jsx)(Q,{asChild:!0,children:(0,f.jsx)(Y,{variant:`ghost`,size:`icon`,className:`pixel-button rounded-none border border-gray-600/50 bg-gray-800/80 text-white shadow-lg transition-all duration-150 hover:border-gray-500 hover:bg-gray-700/80 active:scale-95`,onClick:()=>je.current?.seekTo(me+10),children:(0,f.jsx)(Pc,{className:`size-6`})})}),(0,f.jsx)($,{children:`Forward 10s (→)`})]}),(0,f.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,f.jsxs)(Z,{children:[(0,f.jsx)(Q,{asChild:!0,children:(0,f.jsx)(Y,{variant:`ghost`,size:`icon`,className:`pixel-button rounded-none border border-gray-600/50 bg-gray-800/80 text-white shadow-lg transition-all duration-150 hover:border-gray-500 hover:bg-gray-700/80 active:scale-95`,onClick:()=>B(!z),children:(0,f.jsx)(z||ue===0?Ac:kc,{className:`size-6`})})}),(0,f.jsx)($,{children:z?`Unmute (m)`:`Mute (m)`})]}),(0,f.jsx)(Ec,{value:[z?0:ue],max:1,step:.05,onValueChange:([e])=>{typeof e==`number`&&(de(e),B(e===0))},className:`pixel-progress w-20 cursor-pointer [&>span]:rounded-none [&>span]:border [&>span]:border-gray-600 [&>span]:bg-gray-800 [&>span]:shadow-lg [&_[role=slider]]:size-3 [&_[role=slider]]:rounded-none [&_[role=slider]]:border-2 [&_[role=slider]]:border-gray-400 [&_[role=slider]]:bg-white [&_[role=slider]]:shadow-md`})]}),(0,f.jsxs)(`span`,{className:`pixel-time-display rounded-none border border-gray-600/50 bg-gray-900/80 px-2 py-1 font-mono text-sm text-white shadow-lg`,children:[Pe(me),` / `,Pe(fe)]})]}),(0,f.jsxs)(`div`,{className:`flex items-center gap-2`,children:[T&&A.length>0&&(0,f.jsxs)(yc,{children:[(0,f.jsxs)(Z,{children:[(0,f.jsx)(Q,{asChild:!0,children:(0,f.jsx)(bc,{asChild:!0,children:(0,f.jsx)(Y,{variant:`ghost`,size:`icon`,className:`pixel-button rounded-none border border-gray-600/50 bg-gray-800/80 text-white shadow-lg transition-all duration-150 hover:border-gray-500 hover:bg-gray-700/80 active:scale-95`,children:(0,f.jsx)(Ic,{className:`size-6`})})})}),(0,f.jsx)($,{children:`Subtitles`})]}),(0,f.jsxs)(xc,{children:[(0,f.jsx)(Cc,{children:`Subtitles`}),(0,f.jsx)(wc,{}),(0,f.jsx)(Sc,{onClick:()=>Ae(null),children:`Off`}),A.map(e=>(0,f.jsx)(Sc,{onClick:()=>Ae(e.value),children:e.label},e.value))]})]}),E&&(0,f.jsxs)(yc,{children:[(0,f.jsxs)(Z,{children:[(0,f.jsx)(Q,{asChild:!0,children:(0,f.jsx)(bc,{asChild:!0,children:(0,f.jsx)(Y,{variant:`ghost`,size:`icon`,className:`pixel-button rounded-none border border-gray-600/50 bg-gray-800/80 text-white shadow-lg transition-all duration-150 hover:border-gray-500 hover:bg-gray-700/80 active:scale-95`,children:(0,f.jsx)(Lc,{className:`size-6`})})})}),(0,f.jsx)($,{children:`Quality`})]}),(0,f.jsxs)(xc,{children:[(0,f.jsx)(Cc,{children:`Quality`}),(0,f.jsx)(wc,{}),k.map(e=>(0,f.jsxs)(Sc,{onClick:()=>Oe(e.value),children:[e.label,` `,V===e.value&&`✓`]},e.value))]})]}),(0,f.jsxs)(yc,{children:[(0,f.jsxs)(Z,{children:[(0,f.jsx)(Q,{asChild:!0,children:(0,f.jsx)(bc,{asChild:!0,children:(0,f.jsx)(Y,{variant:`ghost`,size:`icon`,className:`pixel-button rounded-none border border-gray-600/50 bg-gray-800/80 text-white shadow-lg transition-all duration-150 hover:border-gray-500 hover:bg-gray-700/80 active:scale-95`,children:(0,f.jsx)(Rc,{className:`size-6`})})})}),(0,f.jsx)($,{children:`Playback Speed`})]}),(0,f.jsxs)(xc,{children:[(0,f.jsx)(Cc,{children:`Speed`}),(0,f.jsx)(wc,{}),Le.map(e=>(0,f.jsxs)(Sc,{onClick:()=>Ce(e),children:[e,`x `,Se===e&&`✓`]},e))]})]}),(0,f.jsxs)(Z,{children:[(0,f.jsx)(Q,{asChild:!0,children:(0,f.jsx)(Y,{variant:`ghost`,size:`icon`,className:`pixel-button rounded-none border border-gray-600/50 bg-gray-800/80 text-white shadow-lg transition-all duration-150 hover:border-gray-500 hover:bg-gray-700/80 active:scale-95`,onClick:()=>xe(!be),children:(0,f.jsx)(Nc,{className:`size-6`})})}),(0,f.jsx)($,{children:`Picture in Picture`})]}),(0,f.jsxs)(Z,{children:[(0,f.jsx)(Q,{asChild:!0,children:(0,f.jsx)(Y,{variant:`ghost`,size:`icon`,className:`pixel-button rounded-none border border-gray-600/50 bg-gray-800/80 text-white shadow-lg transition-all duration-150 hover:border-gray-500 hover:bg-gray-700/80 active:scale-95`,onClick:Ie,children:(0,f.jsx)(ve?Mc:jc,{className:`size-6`})})}),(0,f.jsx)($,{children:ve?`Exit Fullscreen (f)`:`Fullscreen (f)`})]})]})]})]})]})]})})}function Wc({src:e,type:t=`video/mp4`}){let n=(0,c.useRef)(null),r=(0,c.useRef)(null);return(0,c.useEffect)(()=>((async()=>{if(!n.current||r.current)return;let i=(await import(`video.js`)).default,a=i(n.current,{controls:!0,autoplay:!1,preload:`auto`,fluid:!0,sources:[{src:e,type:t}]});r.current=a,a.ready(()=>{console.log(`Player is ready!`)})})(),()=>{r.current&&(r.current.dispose(),r.current=null)}),[e,t]),(0,f.jsx)(`div`,{className:`w-full`,children:(0,f.jsx)(`div`,{"data-vjs-player":!0,children:(0,f.jsx)(`video`,{ref:n,className:`video-js vjs-big-play-centered vjs-default-skin w-full`,playsInline:!0})})})}Wc.displayName=`SimpleVideoPlayer`;var Gc=(0,c.memo)((0,c.forwardRef)(({isFullscreen:e,onToggle:t,disabled:n=!1,size:i=`lg`,className:a},o)=>{let s={md:`h-11 w-11`,lg:`h-12 w-12`,xl:`h-14 w-14`},l={md:20,lg:24,xl:28},u=(0,c.useMemo)(()=>({button:s[i]||s.lg,icon:l[i]||l.lg}),[i]),p=(0,c.useMemo)(()=>e?ec:$s,[e]),m=(0,c.useMemo)(()=>e?`Exit fullscreen`:`Enter fullscreen`,[e]),h=(0,c.useMemo)(()=>e?`Exit fullscreen`:`Enter fullscreen`,[e]);return(0,f.jsx)(d.Provider,{children:(0,f.jsxs)(d.Root,{children:[(0,f.jsx)(d.Trigger,{asChild:!0,children:(0,f.jsx)(`button`,{ref:o,type:`button`,onClick:t,disabled:n,className:r.g(`inline-flex items-center justify-center rounded-lg bg-transparent p-0 text-white transition-all hover:text-cyan-700 active:scale-95`,`focus:outline-none focus:ring-2 focus:ring-white/50 focus:ring-offset-2 focus:ring-offset-black/20`,`disabled:cursor-not-allowed disabled:opacity-50`,u.button,a),"aria-label":m,children:(0,f.jsx)(p,{size:u.icon})})}),(0,f.jsx)(d.Portal,{children:(0,f.jsxs)(d.Content,{className:r.g(`rounded bg-black/80 px-2 py-1 text-sm text-white`,`fade-in-0 zoom-in-95 animate-in`),sideOffset:5,children:[h,(0,f.jsx)(d.Arrow,{className:`fill-black/80`})]})})]})})}));Gc.displayName=`FullscreenButton`;var Kc=Gc,qc={sm:{button:`size-8`,icon:16},md:{button:`size-10`,icon:20},lg:{button:`size-12`,icon:24},xl:{button:`size-16`,icon:32}},Jc=(0,c.memo)((0,c.forwardRef)(({isPlaying:e,onToggle:t,disabled:n=!1,size:i=`lg`,className:a},o)=>{let s=(0,c.useMemo)(()=>qc[i]||qc.lg,[i]),l=(0,c.useMemo)(()=>e?`Pause media`:`Play media`,[e]);return(0,f.jsxs)(`button`,{ref:o,type:`button`,onClick:t,disabled:n,"data-state":e?`playing`:`paused`,className:r.g(`group relative inline-flex items-center justify-center`,`glass-strong media-control rounded-full contain-layout`,`focus-ring touch-manipulation`,s.button,`text-[color:var(--media-text)] transition-all duration-300`,`bg-[color:var(--media-control-bg)] backdrop-blur-sm`,`border border-[color:var(--media-border)]/30`,`hover:bg-[color:var(--media-control-hover)]`,`hover:border-[color:var(--media-border)]/50`,`hover:shadow-[color:var(--media-bg)]/20 hover:shadow-lg`,`hover:-translate-y-0.5 hover:scale-105`,`active:bg-[color:var(--media-control-active)]`,`active:translate-y-0 active:scale-100`,`focus-visible:ring-2 focus-visible:ring-[color:var(--media-focus)]`,`focus-visible:ring-offset-2 focus-visible:ring-offset-[color:var(--media-bg)]`,`disabled:cursor-not-allowed disabled:opacity-50`,`disabled:hover:translate-y-0 disabled:hover:scale-100`,`disabled:hover:bg-[color:var(--media-control-bg)]`,a),"aria-label":l,"aria-pressed":e,children:[(0,f.jsx)(`div`,{className:r.g(`absolute inset-0 rounded-full opacity-0 transition-opacity duration-300`,`bg-gradient-to-br from-[color:var(--color-media-play)] to-[color:var(--color-media-pause)]`,`blur-sm group-hover:opacity-20`,e&&`opacity-10`)}),e?(0,f.jsx)(tc,{size:s.icon,className:r.g(`relative z-10 fill-current transition-all duration-200`,`text-[color:var(--color-media-pause)]`,`group-hover:scale-110 group-active:scale-95`,`drop-shadow-sm`)}):(0,f.jsx)(nc,{size:s.icon,className:r.g(`relative z-10 fill-current transition-all duration-200`,`ml-0.5 text-[color:var(--color-media-play)]`,`group-hover:scale-110 group-active:scale-95`,`drop-shadow-sm`)}),(0,f.jsx)(`div`,{className:r.g(`absolute inset-0 rounded-full opacity-0`,`scale-75 bg-[color:var(--media-text)]/10`,`group-active:scale-100 group-active:opacity-100`,`transition-all duration-150 ease-out`)})]})}));Jc.displayName=`PlayButton`;var Yc=Jc,Xc=(0,c.memo)((0,c.forwardRef)(({currentTime:e,duration:t,buffered:n,onSeek:i,size:a=`sm`,className:o},s)=>{let[l,p]=(0,c.useState)(!1),[m,h]=(0,c.useState)(0),[g,_]=(0,c.useState)(!1);(0,c.useDeferredValue)(m);let v=(0,c.useMemo)(()=>({trackHeight:a===`sm`?`h-1`:a===`md`?`h-1.5`:`h-2`,thumbSize:a===`sm`?`size-3`:a===`md`?`size-4`:`size-5`,trackHoverHeight:`h-1.5`}),[a]),y=(0,c.useMemo)(()=>t>0?e/t*100:0,[e,t]),b=(0,c.useMemo)(()=>{let e=[];if(n&&t>0)for(let r=0;r<n.length;r++){let i=n.start(r)/t*100,a=n.end(r)/t*100;e.push({start:i,end:a})}return e},[n,t]),x=(0,c.useCallback)(([e])=>{let n=(e??0)/100*t;h(n),l&&i(n)},[t,l,i]),S=(0,c.useCallback)(([e])=>{i((e??0)/100*t),p(!1)},[t,i]),C=(0,c.useCallback)(()=>{p(!0)},[]),w=(0,c.useCallback)(()=>_(!0),[]),T=(0,c.useCallback)(()=>_(!1),[]),E=(0,c.useMemo)(()=>r.p(e),[e]),D=(0,c.useMemo)(()=>r.p(t),[t]);return(0,f.jsx)(`div`,{ref:s,className:r.g(`media-container relative w-full text-[color:var(--media-text)]`,`touch-manipulation contain-layout`,o),onMouseEnter:w,onMouseLeave:T,role:`group`,"aria-label":`Seek bar`,children:(0,f.jsx)(d.Provider,{children:(0,f.jsxs)(d.Root,{children:[(0,f.jsx)(d.Trigger,{asChild:!0,children:(0,f.jsx)(`div`,{className:`relative animate-enter`,children:(0,f.jsxs)(u.Root,{className:r.g(`group relative flex w-full touch-none select-none items-center`,`focus-ring cursor-pointer`,v.trackHeight),value:[y],max:100,step:.1,onValueChange:x,onValueCommit:S,onPointerDown:C,"aria-label":`Seek to position`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(y),"aria-valuetext":`${E} of ${D}`,"aria-orientation":`horizontal`,children:[(0,f.jsxs)(u.Track,{className:r.g(`relative grow overflow-hidden rounded-full`,`bg-[color:var(--media-control-bg)]/40 backdrop-blur-sm`,`border border-[color:var(--media-border)]/20`,`shadow-inner transition-all duration-300 ease-out`,v.trackHoverHeight,`group-hover:bg-[color:var(--media-control-bg)]/60`,`group-hover:border-[color:var(--media-border)]/40`),children:[b.map((e,t)=>(0,f.jsx)(`div`,{className:r.g(`absolute h-full rounded-full transition-all duration-500`,`bg-[color:var(--color-media-buffered)] shadow-inner`,`opacity-60 group-hover:opacity-80`),style:{left:`${e.start}%`,width:`${e.end-e.start}%`}},t)),(0,f.jsx)(u.Range,{className:r.g(`absolute h-full rounded-full transition-all duration-300`,`bg-gradient-to-r from-[color:var(--color-media-progress)] to-[color:var(--color-brand-accent)]`,`shadow-[color:var(--color-brand-primary)]/20 shadow-lg`,`group-hover:shadow-xl`)})]}),(0,f.jsx)(u.Thumb,{className:r.g(`block rounded-full border-white/20 bg-white`,`shadow-lg hover:shadow-xl`,v.thumbSize,`opacity-0 group-hover:opacity-100`,`hover:scale-110 hover:bg-white/95 active:scale-95`,`focus:opacity-100 focus:outline-none focus:ring-2 focus:ring-white/50`,`focus:ring-offset-2 focus:ring-offset-black/20`,`transition-all duration-300 ease-out`,l&&`opacity-100`),"aria-label":`Seek slider`,"aria-valuetext":`${E} of ${D}`})]})})}),l&&(0,f.jsx)(d.Portal,{children:(0,f.jsxs)(d.Content,{className:r.g(`rounded bg-black/80 px-2 py-1 text-sm text-white`,`fade-in-0 zoom-in-95 animate-in`),sideOffset:10,children:[r.p(m),(0,f.jsx)(d.Arrow,{className:`fill-black/80`})]})})]})})})}));Xc.displayName=`SeekBar`;var Zc=Xc,Qc=(0,c.memo)((0,c.forwardRef)(function({currentTime:e,duration:t,showRemaining:n=!1,size:i=`sm`,className:a},o){let s=(0,c.useMemo)(()=>r.p(e),[e]),l=(0,c.useMemo)(()=>r.p(t),[t]),u=(0,c.useMemo)(()=>r.p(t-e),[t,e]),d={sm:`text-xs`,md:`text-sm`,lg:`text-base`,xl:`text-lg`},p=(0,c.useMemo)(()=>n?`-${u}`:l,[n,u,l]);return(0,f.jsxs)(`div`,{ref:o,className:r.g(`flex items-center font-mono text-white text-xs`,`rounded-lg backdrop-blur-sm`,`px-3 py-1.5`,d[i],`select-none`,a),role:`timer`,"aria-label":`${n?`Time remaining`:`Duration`}: ${p}`,"aria-live":`off`,children:[(0,f.jsx)(`span`,{className:`tabular-nums`,"aria-label":`Current time`,children:s}),(0,f.jsx)(`span`,{className:`mx-1 text-white`,"aria-hidden":`true`,children:`/`}),(0,f.jsx)(`span`,{className:`tabular-nums`,"aria-label":n?`Time remaining`:`Total duration`,children:p})]})}));Qc.displayName=`TimeDisplay`;var $c=Qc,el=(0,c.memo)((0,c.forwardRef)(function({volume:e,isMuted:t,onVolumeChange:n,onToggleMute:i,size:a=`lg`,className:o},s){let l=(0,c.useMemo)(()=>t||e===0?cc:e<.5?oc:sc,[t,e]),p=(0,c.useMemo)(()=>({md:`h-11 w-11`,lg:`h-12 w-12`,xl:`h-14 w-14`}),[]),m=(0,c.useMemo)(()=>({md:`h-5 w-5`,lg:`h-6 w-6`,xl:`h-7 w-7`}),[]),h=(0,c.useMemo)(()=>({md:`h-6`,lg:`h-7`,xl:`h-8`}),[]),g=(0,c.useMemo)(()=>({md:`h-4 w-4`,lg:`h-4 w-4`,xl:`h-5 w-5`}),[]),_=(0,c.useMemo)(()=>({md:`h-1.5`,lg:`h-2`,xl:`h-2.5`}),[]),v=(0,c.useMemo)(()=>[t?0:e],[t,e]),y=(0,c.useMemo)(()=>Math.round((t?0:e)*100),[t,e]),b=(0,c.useCallback)(()=>{i()},[i]),x=(0,c.useCallback)(([e])=>{n(e??0)},[n]),S=t?`Unmute`:`Mute`,C=S;return(0,f.jsxs)(`div`,{ref:s,className:r.g(`flex items-center space-x-3 text-white`,o),children:[(0,f.jsx)(d.Provider,{children:(0,f.jsxs)(d.Root,{children:[(0,f.jsx)(d.Trigger,{asChild:!0,children:(0,f.jsx)(`button`,{type:`button`,onClick:b,className:r.g(`inline-flex items-center justify-center rounded-lg bg-transparent p-0 text-white transition-all hover:text-cyan-700 active:scale-95`,`focus:outline-none focus:ring-2 focus:ring-white/50 focus:ring-offset-2 focus:ring-offset-black/20`,p[a]),"aria-label":S,"aria-pressed":t,children:(0,f.jsx)(l,{className:r.g(m[a])})})}),(0,f.jsx)(d.Portal,{children:(0,f.jsxs)(d.Content,{className:r.g(`rounded bg-black/80 px-2 py-1 text-sm text-white`,`fade-in-0 zoom-in-95 animate-in`),sideOffset:5,children:[C,(0,f.jsx)(d.Arrow,{className:`fill-black/80`})]})})]})}),(0,f.jsx)(`div`,{className:`w-32`,children:(0,f.jsxs)(u.Root,{className:r.g(`group relative flex w-full touch-none select-none items-center`,h[a]),value:v,max:1,step:.01,onValueChange:x,"aria-label":`Volume`,"aria-valuemin":0,"aria-valuemax":1,"aria-valuenow":e,"aria-valuetext":`${y} percent`,children:[(0,f.jsx)(u.Track,{className:r.g(`relative grow rounded-full bg-white/20 shadow-inner transition-all duration-300 group-hover:bg-white/30`,`border border-white/10`,_[a]),children:(0,f.jsx)(u.Range,{className:`absolute h-full rounded-full bg-white shadow-sm`})}),(0,f.jsx)(u.Thumb,{className:r.g(`block rounded-full border-2 border-white/20 bg-white shadow-lg`,`transition-all duration-300 ease-out hover:scale-110 hover:bg-white/95 active:scale-95`,`focus:outline-none focus:ring-2 focus:ring-white/50 focus:ring-offset-2 focus:ring-offset-black/20`,g[a]),"aria-label":`Volume`})]})}),(0,f.jsx)(`span`,{className:`w-10 text-right text-sm text-white`,"aria-hidden":`true`,children:y})]})}));el.displayName=`VolumeControl`;var tl=el,nl=c.default.forwardRef((e,t)=>(n.r(`ModernMediaPlayer`,`MediaPlayer (the primary media player component)`),(0,f.jsx)(Uc,{...e,ref:t})));nl.displayName=`DeprecatedModernMediaPlayer`;var rl=c.default.forwardRef((e,t)=>(n.r(`SimpleVideoPlayer`,`VideoPlayer (the primary video player component)`),(0,f.jsx)(Wc,{...e})));rl.displayName=`DeprecatedSimpleVideoPlayer`;var il=c.default.forwardRef((e,t)=>(n.r(`PlayButton`,`Use MediaPlayer compound components or MediaPlayer (all-in-one)`),(0,f.jsx)(Yc,{...e})));il.displayName=`DeprecatedPlayButton`;var al=c.default.forwardRef((e,t)=>(n.r(`SeekBar`,`Use MediaPlayer compound components or MediaPlayer (all-in-one)`),(0,f.jsx)(Zc,{...e})));al.displayName=`DeprecatedSeekBar`;var ol=c.default.forwardRef((e,t)=>(n.r(`TimeDisplay`,`Use MediaPlayer compound components or MediaPlayer (all-in-one)`),(0,f.jsx)($c,{...e})));ol.displayName=`DeprecatedTimeDisplay`;var sl=c.default.forwardRef((e,t)=>(n.r(`VolumeControl`,`Use MediaPlayer compound components or MediaPlayer (all-in-one)`),(0,f.jsx)(tl,{...e})));sl.displayName=`DeprecatedVolumeControl`;var cl=c.default.forwardRef((e,t)=>(n.r(`FullscreenButton`,`Use MediaPlayer compound components or MediaPlayer (all-in-one)`),(0,f.jsx)(Kc,{...e})));cl.displayName=`DeprecatedFullscreenButton`;var ll=({sources:e,enableIntelligentPreloading:t=!0,adaptToNetworkConditions:n=!0,priority:r=`auto`,strategy:i=`adaptive`})=>{let a=(0,c.useRef)(null),o=(0,c.useRef)(null),s=(0,c.useRef)(new Map);function u(e){return!e.includes(window.location.origin)}function d(e){e.forEach(e=>{s.current.set(e,Date.now()),(0,l.preload)(e,{as:`fetch`,crossOrigin:`anonymous`})})}let f=(0,c.useMemo)(()=>{let t={dnsPrefetch:[],preconnect:[],preload:[],preinit:[]};return e.forEach(e=>{let n=new URL(e.src).origin;h(n)&&t.dnsPrefetch.push(n),g(e.type||``,i)&&t.preconnect.push(n),_(e,r,i)&&t.preload.push({url:e.src,type:y(e.type||``)}),v(e,i)&&t.preinit.push({url:e.src,type:`script`})}),t},[e,r,i]),[p,m]=c.default.useState(f);c.default.useEffect(()=>{let t={...f};t.preload=f.preload.filter(({url:t})=>{let n=e.find(e=>e.src===t);if(!n)return!1;let o=s.current.get(n.src);if(o&&Date.now()-o<3e5)return!1;if(i===`conservative`)return r===`high`&&n.type===`hls`;if(i===`aggressive`)return!0;if(a.current){let{effectiveType:e,saveData:t}=a.current;if(t)return!1;if(e===`slow-2g`||e===`2g`)return r===`high`&&n.type===`hls`;if(e===`3g`)return[`hls`,`m3u8`].includes(n.type||``)}return r!==`low`}),m(t)},[f,e,r,i]),(0,c.useEffect)(()=>{if(n&&`connection`in navigator){a.current=navigator.connection;let e=()=>{};return a.current.addEventListener(`change`,e),()=>{a.current?.removeEventListener(`change`,e)}}},[n]),(0,c.useEffect)(()=>{if(t)return o.current=new ul,o.current.startTracking(),()=>{o.current?.stopTracking()}},[t]),(0,c.useEffect)(()=>{p.dnsPrefetch.forEach(e=>{(0,l.prefetchDNS)(e)})},[p.dnsPrefetch]),(0,c.useEffect)(()=>{p.preconnect.forEach(e=>{(0,l.preconnect)(e,{crossOrigin:`anonymous`})})},[p.preconnect]),(0,c.useEffect)(()=>{p.preload.forEach(({url:e,type:t})=>{(0,l.preload)(e,{as:t,crossOrigin:u(e)?`anonymous`:void 0,integrity:void 0})})},[p.preload,r]),(0,c.useEffect)(()=>{p.preinit.forEach(({url:e,type:t})=>{(0,l.preinit)(e,{as:t,crossOrigin:u(e)?`anonymous`:void 0})})},[p.preinit]),(0,c.useEffect)(()=>{!t||!o.current||o.current.onBehaviorChange(e=>{e.isLikelyToInteract&&d(e.predictedSources)})},[t]);function h(e){return[`cdn.jsdelivr.net`,`cdnjs.cloudflare.com`,`unpkg.com`,`cloudflare.com`,`fastly.net`,`akamaized.net`].some(t=>e.includes(t))}function g(e,t){return t===`aggressive`?!0:t===`conservative`?[`hls`,`m3u8`].includes(e):[`hls`,`m3u8`,`mp4`].includes(e)}function _(e,t,n){return n===`conservative`?t===`high`&&e.type===`hls`:n===`aggressive`||t!==`low`}function v(e,t){return t===`aggressive`&&e.type===`hls`}function y(e){switch(e){case`hls`:case`m3u8`:return`fetch`;case`mp4`:case`webm`:return`video`;case`mp3`:case`wav`:return`audio`;default:return`fetch`}}return null},ul=class{constructor(){t.r(this,`behaviorData`,{isLikelyToInteract:!1,engagementScore:0,predictedSources:[],interactionHistory:[]}),t.r(this,`listeners`,[]),t.r(this,`mouseMoveTimer`,null),t.r(this,`handleMouseMove`,()=>{this.mouseMoveTimer||(this.mouseMoveTimer=window.setTimeout(()=>{this.updateEngagementScore(.1),this.mouseMoveTimer=null},100))}),t.r(this,`handleScroll`,()=>{this.updateEngagementScore(.2)}),t.r(this,`handleKeydown`,()=>{this.updateEngagementScore(.3),this.behaviorData.isLikelyToInteract=!0}),t.r(this,`handleFocus`,()=>{this.updateEngagementScore(.4),this.behaviorData.isLikelyToInteract=!0}),t.r(this,`handleVisibilityChange`,()=>{document.hidden||(this.updateEngagementScore(.5),this.behaviorData.isLikelyToInteract=!0)})}startTracking(){document.addEventListener(`mousemove`,this.handleMouseMove),document.addEventListener(`scroll`,this.handleScroll),document.addEventListener(`keydown`,this.handleKeydown),document.addEventListener(`focusin`,this.handleFocus),document.addEventListener(`visibilitychange`,this.handleVisibilityChange)}stopTracking(){document.removeEventListener(`mousemove`,this.handleMouseMove),document.removeEventListener(`scroll`,this.handleScroll),document.removeEventListener(`keydown`,this.handleKeydown),document.removeEventListener(`focusin`,this.handleFocus),document.removeEventListener(`visibilitychange`,this.handleVisibilityChange),this.mouseMoveTimer&&clearTimeout(this.mouseMoveTimer)}onBehaviorChange(e){this.listeners.push(e)}getCurrentBehavior(){return this.behaviorData}updateEngagementScore(e){this.behaviorData.engagementScore=Math.min(1,this.behaviorData.engagementScore+e),setTimeout(()=>{this.behaviorData.engagementScore=Math.max(0,this.behaviorData.engagementScore-e*.5),this.notifyListeners()},3e4),this.notifyListeners()}notifyListeners(){this.listeners.forEach(e=>e(this.behaviorData))}};exports.AUDIO_MIME_TYPES=gc,exports.AudioPlayer=S,exports.ChaptersPanel=r.s,exports.ConcurrentMedia=_,exports.DebugPanel=r.t,exports.EnhancedControlBar=r.n,exports.EnhancedMediaPlayer=r.h,exports.EnhancedPlayButton=r.r,exports.EnhancedSeekBar=r.i,exports.EnhancedTimeDisplay=r.a,exports.EnhancedVolumeControl=r.o,exports.FullscreenButton=cl,exports.MediaErrorBoundary=g,exports.MediaLoading=p,exports.MediaPlayer=b,exports.MediaPlayerHLS=fc,exports.MediaPlayerRoot=i.c,exports.MediaProvider=t.t,exports.MediaResourcePreloader=ll,exports.MediaSuspense=m,exports.MinimalFullscreenIcon=i.r,exports.MinimalMediaPlayer=i.n,exports.MinimalPauseIcon=i.i,exports.MinimalPlayIcon=i.a,exports.MinimalVolumeIcon=i.o,exports.ModernMediaPlayer=nl,exports.PerformanceMonitor=o.n,exports.PictureInPictureButton=r.c,exports.PlayButton=il,exports.PlaybackSpeedSelector=r.l,exports.QualitySelector=r.u,exports.SUPPORTED_AUDIO_FORMATS=mc,exports.SUPPORTED_VIDEO_FORMATS=pc,exports.SeekBar=al,exports.SimpleMinimalPlayer=i.t,exports.SimpleVideoPlayer=rl,exports.SubtitleSelector=r.d,exports.TimeDisplay=ol,exports.VIDEO_MIME_TYPES=hc,exports.VideoPlayer=x,exports.VolumeControl=sl,exports.cn=r.g,exports.createEnhancedMediaStore=t.n,exports.defaultMinimalIcons=i.s,exports.formatTime=r.p,exports.getMediaTypeFromUrl=_c,exports.getMimeTypeFromUrl=vc,exports.parseTime=r.m,exports.useDeferredMediaLoading=v,exports.useEnhancedMediaPlayer=n.x,exports.useEnhancedSubtitles=n.t,exports.useIntelligentPreloading=n.a,exports.useKeyboardControls=n.y,exports.useMediaActionState=n.S,exports.useMediaActions=n.C,exports.useMediaContext=t.l,exports.useMediaControls=n.c,exports.useMediaDispatch=t.u,exports.useMediaPlayer=n.g,exports.useMediaSelector=t.f,exports.useMediaState=n._,exports.useOptimisticMediaSelector=t.m,exports.useScreenshot=n.s,exports.useSubtitles=n.i,exports.useTouchGestures=n.p,exports.useVideoPlayer=n.n;
42
+ //# sourceMappingURL=index.js.map