reactjs-media
Version:
Awesome Multimedia Components for React
2 lines (1 loc) • 43.7 kB
JavaScript
"use strict";var e=require("react"),n=require("react/jsx-runtime"),t=function(){return t=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},t.apply(this,arguments)};function r(e,n,t,r){return new(t||(t=Promise))((function(o,i){function u(e){try{a(r.next(e))}catch(e){i(e)}}function c(e){try{a(r.throw(e))}catch(e){i(e)}}function a(e){var n;e.done?o(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(u,c)}a((r=r.apply(e,n||[])).next())}))}function o(e,n){var t,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(c){return function(a){return function(c){if(t)throw new TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(u=0)),u;)try{if(t=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return u.label++,{value:c[1],done:!1};case 5:u.label++,r=c[1],c=[0];continue;case 7:c=u.ops.pop(),u.trys.pop();continue;default:if(!(o=u.trys,(o=o.length>0&&o[o.length-1])||6!==c[0]&&2!==c[0])){u=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){u.label=c[1];break}if(6===c[0]&&u.label<o[1]){u.label=o[1],o=c;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(c);break}o[2]&&u.ops.pop(),u.trys.pop();continue}c=n.call(e,u)}catch(e){c=[6,e],r=0}finally{t=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([c,a])}}}"function"==typeof SuppressedError&&SuppressedError;var i=e.createContext({videoRef:{current:null},containerRef:{current:null},overlayRef:{current:null},seekPreview:!1,setSeekPreview:function(e){},menuClientX:0,setMenuClientX:function(e){},menuClientY:0,setMenuClientY:function(e){},contextMenuItems:[],setContextMenuItems:function(e){},menuOpen:!1,setMenuOpen:function(e){},setSrc:function(e){},src:null}),u=function(t){var r=t.children,o=t.src,u=e.useRef(null),c=e.useRef(null),a=e.useRef(null),l=e.useState(!1),s=l[0],d=l[1],v=e.useState(0),f=v[0],m=v[1],p=e.useState(0),h=p[0],g=p[1],x=e.useState([]),_=x[0],b=x[1],y=e.useState(!1),C=y[0],w=y[1],E=e.useState(o),j=E[0],L=E[1];return e.useEffect((function(){L(o)}),[o]),n.jsx(i.Provider,{value:{videoRef:u,containerRef:c,seekPreview:s,setSeekPreview:d,menuClientX:f,setMenuClientX:m,menuClientY:h,setMenuClientY:g,contextMenuItems:_,setContextMenuItems:b,menuOpen:C,setMenuOpen:w,overlayRef:a,src:j,setSrc:L},children:r})},c=function(){var n=e.useContext(i),t=n.videoRef,u=n.containerRef,c=function(){return r(void 0,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return t.current?[4,t.current.play()]:[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}}))}))},a=function(){t.current&&t.current.pause()};return{play:c,pause:a,togglePlay:function(){return r(void 0,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return t.current?t.current.paused?[4,c()]:[3,2]:[3,3];case 1:return e.sent(),[3,3];case 2:a(),e.label=3;case 3:return[2]}}))}))},forward:function(){t.current&&(t.current.currentTime+=10)},rewind:function(){t.current&&(t.current.currentTime-=10)},updateVolume:function(e){t.current&&(t.current.volume=e)},updatePlaybackRate:function(e){t.current&&(t.current.playbackRate=e)},increasePlaybackRate:function(){t.current&&(t.current.playbackRate+=.25)},decreasePlaybackRate:function(){t.current&&(t.current.playbackRate-=.25)},toggleMute:function(){t.current&&(t.current.muted=!t.current.muted)},increaseVolume:function(){t.current&&(t.current.volume+=.1)},decreaseVolume:function(){t.current&&(t.current.volume-=.1)},toggleFullscreen:function(){u.current&&(document.fullscreenElement?document.exitFullscreen():u.current.requestFullscreen())},togglePip:function(){return r(void 0,void 0,void 0,(function(){var e;return o(this,(function(n){switch(n.label){case 0:if(!t.current||!("requestPictureInPicture"in t.current))return[3,7];n.label=1;case 1:return n.trys.push([1,6,,7]),document.pictureInPictureElement?[4,document.exitPictureInPicture()]:[3,3];case 2:return n.sent(),[3,5];case 3:return[4,t.current.requestPictureInPicture()];case 4:n.sent(),n.label=5;case 5:return[3,7];case 6:return e=n.sent(),console.error(e),[3,7];case 7:return[2]}}))}))},seek:function(e){t.current&&(t.current.currentTime=e)},setLoop:function(e){t.current&&(t.current.loop=e)}}},a={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},l=e.createContext&&e.createContext(a),s=["attr","size","title"];function d(e,n){if(null==e)return{};var t,r,o=function(e,n){if(null==e)return{};var t,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)t=i[r],n.indexOf(t)>=0||(o[t]=e[t]);return o}(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)t=i[r],n.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}function v(){return v=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},v.apply(this,arguments)}function f(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function m(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?f(Object(t),!0).forEach((function(n){p(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):f(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function p(e,n,t){return(n=function(e){var n=function(e,n){if("object"!=typeof e||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,n||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)}(e,"string");return"symbol"==typeof n?n:String(n)}(n))in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function h(n){return n&&n.map(((n,t)=>e.createElement(n.tag,m({key:t},n.attr),h(n.child))))}function g(n){return t=>e.createElement(x,v({attr:m({},n.attr)},t),h(n.child))}function x(n){var t=t=>{var r,{attr:o,size:i,title:u}=n,c=d(n,s),a=i||t.size||"1em";return t.className&&(r=t.className),n.className&&(r=(r?r+" ":"")+n.className),e.createElement("svg",v({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},t.attr,o,c,{className:r,style:m(m({color:n.color||t.color},t.style),n.style),height:a,width:a,xmlns:"http://www.w3.org/2000/svg"}),u&&e.createElement("title",null,u),n.children)};return void 0!==l?e.createElement(l.Consumer,null,(e=>t(e))):t(a)}function _(e){return g({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M0 180V56c0-13.3 10.7-24 24-24h124c6.6 0 12 5.4 12 12v40c0 6.6-5.4 12-12 12H64v84c0 6.6-5.4 12-12 12H12c-6.6 0-12-5.4-12-12zM288 44v40c0 6.6 5.4 12 12 12h84v84c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12V56c0-13.3-10.7-24-24-24H300c-6.6 0-12 5.4-12 12zm148 276h-40c-6.6 0-12 5.4-12 12v84h-84c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h124c13.3 0 24-10.7 24-24V332c0-6.6-5.4-12-12-12zM160 468v-40c0-6.6-5.4-12-12-12H64v-84c0-6.6-5.4-12-12-12H12c-6.6 0-12 5.4-12 12v124c0 13.3 10.7 24 24 24h124c6.6 0 12-5.4 12-12z"},child:[]}]})(e)}function b(e){return g({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M512 76v360c0 6.6-5.4 12-12 12h-40c-6.6 0-12-5.4-12-12V284.1L276.5 440.6c-20.6 17.2-52.5 2.8-52.5-24.6V284.1L52.5 440.6C31.9 457.8 0 443.4 0 416V96c0-27.4 31.9-41.7 52.5-24.6L224 226.8V96c0-27.4 31.9-41.7 52.5-24.6L448 226.8V76c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12z"},child:[]}]})(e)}function y(e){return g({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M144 479H48c-26.5 0-48-21.5-48-48V79c0-26.5 21.5-48 48-48h96c26.5 0 48 21.5 48 48v352c0 26.5-21.5 48-48 48zm304-48V79c0-26.5-21.5-48-48-48h-96c-26.5 0-48 21.5-48 48v352c0 26.5 21.5 48 48 48h96c26.5 0 48-21.5 48-48z"},child:[]}]})(e)}function C(e){return g({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M424.4 214.7L72.4 6.6C43.8-10.3 0 6.1 0 47.9V464c0 37.5 40.7 60.1 72.4 41.3l352-208c31.4-18.5 31.5-64.1 0-82.6z"},child:[]}]})(e)}function w(e){return g({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M215.03 71.05L126.06 160H24c-13.26 0-24 10.74-24 24v144c0 13.25 10.74 24 24 24h102.06l88.97 88.95c15.03 15.03 40.97 4.47 40.97-16.97V88.02c0-21.46-25.96-31.98-40.97-16.97zM461.64 256l45.64-45.64c6.3-6.3 6.3-16.52 0-22.82l-22.82-22.82c-6.3-6.3-16.52-6.3-22.82 0L416 210.36l-45.64-45.64c-6.3-6.3-16.52-6.3-22.82 0l-22.82 22.82c-6.3 6.3-6.3 16.52 0 22.82L370.36 256l-45.63 45.63c-6.3 6.3-6.3 16.52 0 22.82l22.82 22.82c6.3 6.3 16.52 6.3 22.82 0L416 301.64l45.64 45.64c6.3 6.3 16.52 6.3 22.82 0l22.82-22.82c6.3-6.3 6.3-16.52 0-22.82L461.64 256z"},child:[]}]})(e)}function E(e){return g({tag:"svg",attr:{viewBox:"0 0 256 512"},child:[{tag:"path",attr:{d:"M215 71l-89 89H24a24 24 0 0 0-24 24v144a24 24 0 0 0 24 24h102.06L215 441c15 15 41 4.47 41-17V88c0-21.47-26-32-41-17z"},child:[]}]})(e)}function j(e){return g({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M215.03 71.05L126.06 160H24c-13.26 0-24 10.74-24 24v144c0 13.25 10.74 24 24 24h102.06l88.97 88.95c15.03 15.03 40.97 4.47 40.97-16.97V88.02c0-21.46-25.96-31.98-40.97-16.97zm233.32-51.08c-11.17-7.33-26.18-4.24-33.51 6.95-7.34 11.17-4.22 26.18 6.95 33.51 66.27 43.49 105.82 116.6 105.82 195.58 0 78.98-39.55 152.09-105.82 195.58-11.17 7.32-14.29 22.34-6.95 33.5 7.04 10.71 21.93 14.56 33.51 6.95C528.27 439.58 576 351.33 576 256S528.27 72.43 448.35 19.97zM480 256c0-63.53-32.06-121.94-85.77-156.24-11.19-7.14-26.03-3.82-33.12 7.46s-3.78 26.21 7.41 33.36C408.27 165.97 432 209.11 432 256s-23.73 90.03-63.48 115.42c-11.19 7.14-14.5 22.07-7.41 33.36 6.51 10.36 21.12 15.14 33.12 7.46C447.94 377.94 480 319.54 480 256zm-141.77-76.87c-11.58-6.33-26.19-2.16-32.61 9.45-6.39 11.61-2.16 26.2 9.45 32.61C327.98 228.28 336 241.63 336 256c0 14.38-8.02 27.72-20.92 34.81-11.61 6.41-15.84 21-9.45 32.61 6.43 11.66 21.05 15.8 32.61 9.45 28.23-15.55 45.77-45 45.77-76.88s-17.54-61.32-45.78-76.86z"},child:[]}]})(e)}function L(e){return g({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M19 7h-8v6h8V7zm2-4H3c-1.1 0-2 .9-2 2v14c0 1.1.9 1.98 2 1.98h18c1.1 0 2-.88 2-1.98V5c0-1.1-.9-2-2-2zm0 16.01H3V4.98h18v14.03z"},child:[]}]})(e)}function k(e){return g({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58a.49.49 0 0 0 .12-.61l-1.92-3.32a.488.488 0 0 0-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54a.484.484 0 0 0-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58a.49.49 0 0 0-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z"},child:[]}]})(e)}function P(e){return g({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z"},child:[]}]})(e)}function M(e){return g({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M21 3C21.5523 3 22 3.44772 22 4V11H20V5H4V19H10V21H3C2.44772 21 2 20.5523 2 20V4C2 3.44772 2.44772 3 3 3H21ZM21 13C21.5523 13 22 13.4477 22 14V20C22 20.5523 21.5523 21 21 21H13C12.4477 21 12 20.5523 12 20V14C12 13.4477 12.4477 13 13 13H21ZM20 15H14V19H20V15ZM6.70711 6.29289L8.95689 8.54289L11 6.5V12H5.5L7.54289 9.95689L5.29289 7.70711L6.70711 6.29289Z"},child:[]}]})(e)}function S(e){return g({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M21 3C21.5523 3 22 3.44772 22 4V11H20V5H4V19H10V21H3C2.44772 21 2 20.5523 2 20V4C2 3.44772 2.44772 3 3 3H21ZM21 13C21.5523 13 22 13.4477 22 14V20C22 20.5523 21.5523 21 21 21H13C12.4477 21 12 20.5523 12 20V14C12 13.4477 12.4477 13 13 13H21ZM11.5 7L9.45711 9.04311L11.7071 11.2929L10.2929 12.7071L8.04311 10.4571L6 12.5V7H11.5Z"},child:[]}]})(e)}var B={videoRoot:"video-module_videoRoot__RXFIL",videoOverlay:"video-module_videoOverlay__cbySQ",videoLoader:"video-module_videoLoader__G-QHd",videoError:"video-module_videoError__8z6--",videoLoaderSpinner:"video-module_videoLoaderSpinner__WibeR",spin:"video-module_spin__p2vcz",videoTooltip:"video-module_videoTooltip__cd0GD",videoPoster:"video-module_videoPoster__MUSIO",videoPosterPlayButton:"video-module_videoPosterPlayButton__CJm-m",videoControlsBar:"video-module_videoControlsBar__NXw-a",videoControlsBarLeft:"video-module_videoControlsBarLeft__8pHvX",videoControlsBarRight:"video-module_videoControlsBarRight__1z7jL",videoControlsButton:"video-module_videoControlsButton__sY-vH",videoControlsContainer:"video-module_videoControlsContainer__Gfx4p",videoTime:"video-module_videoTime__lpo-v",videoTimeDuration:"video-module_videoTimeDuration__t-MSf",videoProgressBar:"video-module_videoProgressBar__DtfAs",videoProgressBarFill:"video-module_videoProgressBarFill__ps6Eo",seekingCanvas:"video-module_seekingCanvas__RZeny",videoVolumeControlContainer:"video-module_videoVolumeControlContainer__mISJl",volumeControlsButton:"video-module_volumeControlsButton__cZo0r",volumeControlsBar:"video-module_volumeControlsBar__OV5gG",volumeControlsBarFill:"video-module_volumeControlsBarFill__9jDkV",volumeControlsBarHandle:"video-module_volumeControlsBarHandle__xSJqU",contextPageOverlay:"video-module_contextPageOverlay__wqsdS",contextMenuCard:"video-module_contextMenuCard__gSYIB",contextMenu:"video-module_contextMenu__VPChO",contextMenuItem:"video-module_contextMenuItem__EvkZ8",contextMenuItemIcon:"video-module_contextMenuItemIcon__CvJ92",contextMenuItemLabel:"video-module_contextMenuItemLabel__wynsl",settingsOverlay:"video-module_settingsOverlay__uDaJy",settingRoot:"video-module_settingRoot__7mf39",settingHeader:"video-module_settingHeader__mFn-J",settingTitle:"video-module_settingTitle__wtmeq"};!function(e,n){void 0===n&&(n={});var t=n.insertAt;if("undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===t&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}(".video-module_videoRoot__RXFIL {\n position: relative;\n width: 100%;\n height: 100%;\n overflow: hidden;\n}\n\n.video-module_videoOverlay__cbySQ {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(0, 0, 0, 0.5);\n display: flex;\n justify-content: center;\n align-items: center;\n color: white;\n font-size: 2rem;\n font-weight: bold;\n text-align: center;\n}\n\n.video-module_videoLoader__G-QHd {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(0, 0, 0, 0.5);\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.video-module_videoError__8z6-- {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n color: white;\n font-size: 2rem;\n font-weight: bold;\n}\n\n.video-module_videoLoaderSpinner__WibeR {\n display: inline-block;\n width: 50px;\n height: 50px;\n border: 3px solid rgba(255, 255, 255, 0.3);\n border-radius: 50%;\n border-top-color: white;\n animation: video-module_spin__p2vcz 1s linear infinite;\n}\n\n@keyframes video-module_spin__p2vcz {\n to {\n transform: rotate(360deg);\n }\n}\n.video-module_videoTooltip__cd0GD {\n position: absolute;\n top: -4.5rem;\n left: 0;\n background-color: rgba(0, 0, 0, 0.5);\n color: white;\n padding: 0.2rem 0.5rem;\n border-radius: 0.2rem;\n font-size: 0.8rem;\n z-index: 2;\n}\n\n.video-module_videoPoster__MUSIO {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n object-fit: cover;\n cursor: pointer;\n z-index: 1;\n background-position: center;\n background-size: cover;\n}\n.video-module_videoPoster__MUSIO:hover {\n filter: brightness(0.8);\n}\n\n.video-module_videoPosterPlayButton__CJm-m {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n width: 50px;\n height: 50px;\n border: 3px solid white;\n border-radius: 50%;\n display: flex;\n justify-content: center;\n align-items: center;\n cursor: pointer;\n}\n\n.video-module_videoControlsBar__NXw-a {\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 5px 0px;\n width: 96%;\n margin: 0 auto;\n}\n\n.video-module_videoControlsBarLeft__8pHvX {\n display: flex;\n align-items: center;\n}\n\n.video-module_videoControlsBarRight__1z7jL {\n display: flex;\n align-items: center;\n}\n\n.video-module_videoControlsButton__sY-vH {\n background-color: transparent;\n border: none;\n color: white;\n font-size: 1.2rem;\n cursor: pointer;\n margin: 0 10px;\n}\n\n.video-module_videoControlsContainer__Gfx4p {\n position: absolute;\n bottom: 0;\n left: 0;\n width: 100%;\n background: linear-gradient(transparent, rgb(0, 0, 0));\n display: flex;\n flex-direction: column;\n height: fit-content;\n}\n\n.video-module_videoTime__lpo-v {\n color: white;\n text-align: left;\n width: 96%;\n margin: 0 auto;\n display: flex;\n margin-bottom: 10px;\n}\n@media (min-width: 1024px) {\n .video-module_videoTime__lpo-v {\n font-size: 0.8rem;\n }\n}\n@media (max-width: 1024px) and (min-width: 768px) {\n .video-module_videoTime__lpo-v {\n font-size: 0.7rem;\n }\n}\n@media (max-width: 768px) {\n .video-module_videoTime__lpo-v {\n font-size: 0.5rem;\n margin-bottom: 10px;\n }\n}\n\n.video-module_videoTimeDuration__t-MSf {\n margin-left: auto;\n}\n\n.video-module_videoProgressBar__DtfAs {\n width: 96%;\n margin: 0 auto;\n height: 3px;\n background-color: rgba(255, 255, 255, 0.5);\n position: relative;\n cursor: pointer;\n transition: height 0.3s;\n}\n.video-module_videoProgressBar__DtfAs:hover {\n height: 5px;\n}\n.video-module_videoProgressBar__DtfAs:hover .video-module_videoProgressBarFill__ps6Eo {\n background-color: white;\n}\n\n.video-module_videoProgressBarFill__ps6Eo {\n height: 100%;\n background-color: rgba(255, 255, 255, 0.5);\n transition: background-color 0.3s;\n}\n\n.video-module_seekingCanvas__RZeny {\n position: absolute;\n top: -3rem;\n left: 0;\n width: 80px;\n height: 40px;\n background-color: rgba(255, 255, 255, 0.5);\n z-index: 2;\n border-radius: 0.2rem;\n border: 1px solid white;\n}\n\n.video-module_videoVolumeControlContainer__mISJl {\n display: flex;\n align-items: center;\n margin: 0 10px;\n}\n@media (max-width: 768px) {\n .video-module_videoVolumeControlContainer__mISJl {\n display: none;\n }\n}\n\n.video-module_volumeControlsButton__cZo0r {\n background-color: transparent;\n border: none;\n color: white;\n font-size: 1rem;\n cursor: pointer;\n margin: 0 10px;\n}\n\n.video-module_volumeControlsBar__OV5gG {\n width: 70px;\n height: 3px;\n background-color: rgba(255, 255, 255, 0.5);\n position: relative;\n cursor: pointer;\n transition: height 0.3s;\n}\n.video-module_volumeControlsBar__OV5gG:hover .video-module_volumeControlsBarFill__9jDkV {\n background-color: rgba(255, 255, 255, 0.702);\n}\n\n.video-module_volumeControlsBarFill__9jDkV {\n height: 100%;\n background-color: white;\n transition: background-color 0.3s;\n}\n\n.video-module_volumeControlsBarHandle__xSJqU {\n position: absolute;\n top: -3.5px;\n left: 0;\n width: 10px;\n height: 10px;\n background-color: white;\n border-radius: 50%;\n cursor: pointer;\n}\n\n.video-module_contextPageOverlay__wqsdS {\n position: fixed;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n}\n\n.video-module_contextMenuCard__gSYIB {\n position: absolute;\n}\n\n.video-module_contextMenu__VPChO {\n background: rgba(0, 0, 0, 0.507);\n display: flex;\n flex-direction: column;\n color: white;\n padding: 5px;\n}\n\n.video-module_contextMenuItem__EvkZ8 {\n display: flex;\n align-items: center;\n padding: 10px;\n outline: none;\n border: none;\n border-radius: 5px;\n background: transparent;\n color: white;\n cursor: pointer;\n}\n.video-module_contextMenuItem__EvkZ8:hover {\n background: rgba(245, 245, 245, 0.325);\n}\n\n.video-module_contextMenuItemIcon__CvJ92 {\n color: white;\n margin-right: 10px;\n}\n\n.video-module_contextMenuItemLabel__wynsl {\n color: white;\n font-size: 0.7rem;\n}\n\n.video-module_settingsOverlay__uDaJy {\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n background-color: rgba(0, 0, 0, 0.5);\n display: flex;\n justify-content: center;\n align-items: center;\n z-index: 2;\n}\n\n.video-module_settingRoot__7mf39 {\n background-color: white;\n width: 50%;\n height: 50%;\n border-radius: 0.2rem;\n padding: 1rem;\n}\n\n.video-module_settingHeader__mFn-J {\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 1rem;\n}\n\n.video-module_settingTitle__wtmeq {\n font-size: 1.5rem;\n}");var V=function(){var t,r=e.useContext(i).videoRef,o=e.useState("00:00"),u=o[0],c=o[1];function a(e){var n=Math.floor(e/60),t=Math.floor(e%60),r=t<10?"0".concat(t):"".concat(t),o=n<10?"0".concat(n):"".concat(n);return"".concat(o,":").concat(r)}return e.useEffect((function(){if(r.current){var e=function(){r.current&&c(a(r.current.currentTime))};return r.current.addEventListener("timeupdate",e),function(){var n;null===(n=r.current)||void 0===n||n.removeEventListener("timeupdate",e)}}}),[r.current]),n.jsxs("div",{className:B.videoTime,children:[n.jsx("span",{className:B.videoTimeCurrent,children:u}),n.jsx("span",{className:B.videoTimeDuration,children:a((null===(t=r.current)||void 0===t?void 0:t.duration)||0)})]})};function R(e){return g({tag:"svg",attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M48 64C21.5 64 0 85.5 0 112V400c0 26.5 21.5 48 48 48H80c26.5 0 48-21.5 48-48V112c0-26.5-21.5-48-48-48H48zm192 0c-26.5 0-48 21.5-48 48V400c0 26.5 21.5 48 48 48h32c26.5 0 48-21.5 48-48V112c0-26.5-21.5-48-48-48H240z"},child:[]}]})(e)}function z(e){return g({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M301.1 34.8C312.6 40 320 51.4 320 64V448c0 12.6-7.4 24-18.9 29.2s-25 3.1-34.4-5.3L131.8 352H64c-35.3 0-64-28.7-64-64V224c0-35.3 28.7-64 64-64h67.8L266.7 40.1c9.4-8.4 22.9-10.4 34.4-5.3zM412.6 181.5C434.1 199.1 448 225.9 448 256s-13.9 56.9-35.4 74.5c-10.3 8.4-25.4 6.8-33.8-3.5s-6.8-25.4 3.5-33.8C393.1 284.4 400 271 400 256s-6.9-28.4-17.7-37.3c-10.3-8.4-11.8-23.5-3.5-33.8s23.5-11.8 33.8-3.5z"},child:[]}]})(e)}var N=function(){var t=c(),r=t.updateVolume,o=t.toggleMute,u=e.useContext(i).videoRef,a=e.useState(1),l=a[0],s=a[1],d=e.useRef(null),v=e.useState(!1),f=v[0],m=v[1];return e.useEffect((function(){if(d.current){var e=function(e){if(d.current&&u.current){var n=d.current.getBoundingClientRect(),t=(e.clientX-n.left)/n.width*100;r(t/100),s(t/100)}};return d.current.addEventListener("mousedown",e),function(){var n;null===(n=d.current)||void 0===n||n.removeEventListener("mousedown",e)}}}),[d.current]),e.useEffect((function(){u.current&&s(u.current.volume)}),[u.current]),e.useEffect((function(){if(u.current){var e=function(){u.current&&s(u.current.volume)},n=function(){u.current&&m(u.current.muted)};return u.current.addEventListener("volumechange",e),u.current.addEventListener("muted",n),function(){var t,r;null===(t=u.current)||void 0===t||t.removeEventListener("volumechange",e),null===(r=u.current)||void 0===r||r.removeEventListener("muted",n)}}}),[u.current]),n.jsxs("div",{className:B.videoVolumeControlContainer,children:[n.jsx("button",{className:B.volumeControlsButton,onClick:function(){f?(o(),m(!1)):(o(),m(!0))},children:f||0===l?n.jsx(w,{}):l<=.3?n.jsx(E,{}):l<.5?n.jsx(z,{}):n.jsx(j,{})}),n.jsxs("div",{className:B.volumeControlsBar,ref:d,children:[n.jsx("div",{className:B.volumeControlsBarFill,style:{width:"".concat(100*l,"%")}}),n.jsx("div",{className:"volume-controls-bar__handle",style:{left:"".concat(100*l-3.5,"%")}})]})]})},O=function(){var t=e.useContext(i),r=t.videoRef,o=t.seekPreview,u=e.useState(0),c=u[0],a=u[1],l=e.useRef(null),s=e.useState(0),d=s[0],v=s[1],f=e.useState(!1),m=f[0],p=f[1],h=e.useState("00:00"),g=h[0],x=h[1],_=e.useState(0),b=_[0],y=_[1];return e.useEffect((function(){if(l.current){var e=function(e){!function(e){if(l.current&&r.current){var n=l.current.getBoundingClientRect(),t=(e.clientX-n.left)/n.width*100;r.current.currentTime=t/100*r.current.duration}}(e)};return l.current.addEventListener("mousedown",e),function(){var n;null===(n=l.current)||void 0===n||n.removeEventListener("mousedown",e)}}}),[l.current]),e.useEffect((function(){if(l.current){var e=function(e){if(l.current&&r.current){var n=l.current.getBoundingClientRect(),t=(e.clientX-n.left)/n.width*100;v(t);var o=t/100*r.current.duration;y(o),x(function(e){var n=Math.floor(e/60),t=Math.floor(e%60),r=t<10?"0".concat(t):"".concat(t),o=n<10?"0".concat(n):"".concat(n);return"".concat(o,":").concat(r)}(o))}},n=function(){p(!0)},t=function(){p(!1)};return l.current.addEventListener("mousemove",e),l.current.addEventListener("mouseenter",n),l.current.addEventListener("mouseleave",t),function(){var r,o,i;null===(r=l.current)||void 0===r||r.removeEventListener("mousemove",e),null===(o=l.current)||void 0===o||o.removeEventListener("mouseenter",n),null===(i=l.current)||void 0===i||i.removeEventListener("mouseleave",t)}}}),[l.current]),e.useEffect((function(){if(r.current){var e=function(){r.current&&a(r.current.currentTime/r.current.duration*100)};return r.current.addEventListener("timeupdate",e),function(){var n;null===(n=r.current)||void 0===n||n.removeEventListener("timeupdate",e)}}}),[r.current]),n.jsxs("div",{ref:l,className:B.videoProgressBar,children:[o&&m&&n.jsx(H,{time:b,percentage:d}),n.jsx("div",{className:B.videoProgressBarFill,style:{width:"".concat(c,"%")}}),n.jsx(I,{text:g,open:m,percentage:d})]})},I=function(e){var t=e.text,r=e.percentage;return e.open?n.jsx("div",{className:B.videoTooltip,style:{left:"".concat(r-3,"%")},children:t}):null},H=function(t){var u=t.time,c=t.percentage,a=e.useRef(null),l=e.useContext(i).videoRef,s=e.useState(null),d=s[0],v=s[1];return e.useEffect((function(){if(null===d&&l.current){var e=document.createElement("video");e.src=l.current.src,e.volume=0,v(e)}}),[d,l.current]),e.useEffect((function(){!function(e){r(this,void 0,void 0,(function(){var n;return o(this,(function(t){switch(t.label){case 0:if(!a.current||!d)return[3,5];if(!(n=a.current.getContext("2d")))return[3,5];d.currentTime=e,t.label=1;case 1:return t.trys.push([1,3,,4]),[4,d.play()];case 2:return t.sent(),[3,4];case 3:return t.sent(),console.warn("Reference Video Inturrupted"),[3,4];case 4:try{d.pause()}catch(e){}n.drawImage(d,0,0,80,40),t.label=5;case 5:return[2]}}))}))}(u)}),[a.current,u,d]),n.jsx("canvas",{style:{left:"".concat(c-5,"%")},ref:a,className:B.seekingCanvas,height:40,width:80})},T=function(){var t=e.useContext(i).overlayRef;return n.jsxs("div",{className:B.videoOverlay,ref:t,children:[n.jsx(A,{}),n.jsx(D,{})]})},A=function(){var t=e.useContext(i).videoRef,r=e.useState(!0),o=r[0],u=r[1];return e.useEffect((function(){if(t.current){var e=function(){u(!1)};return t.current.addEventListener("loadeddata",e),function(){var n;null===(n=t.current)||void 0===n||n.removeEventListener("loadeddata",e)}}}),[t.current]),e.useEffect((function(){if(t.current){var e=function(){u(!1)};return t.current.addEventListener("canplay",e),function(){var n;null===(n=t.current)||void 0===n||n.removeEventListener("canplay",e)}}}),[t.current]),e.useEffect((function(){if(t.current){var e=function(){u(!0)};return t.current.addEventListener("waiting",e),function(){var n;null===(n=t.current)||void 0===n||n.removeEventListener("waiting",e)}}}),[t.current]),o?n.jsx("div",{className:B.videoLoader,children:n.jsx("div",{className:B.videoLoaderSpinner})}):null},D=function(){var t=e.useContext(i),r=t.containerRef,o=t.src,u=e.useState(!1),c=u[0],a=u[1],l=e.useState(!1),s=l[0],d=l[1];return e.useEffect((function(){if(r.current){var e;c&&(e=setTimeout((function(){a(!1)}),5e3));var n=function(){a(!0)},t=function(){a(!1)},o=function(){a(!0),e&&clearTimeout(e),e=setTimeout((function(){a(!1)}),5e3)};return r.current.addEventListener("mouseenter",n),r.current.addEventListener("mouseleave",t),r.current.addEventListener("mousemove",o),function(){var e,i,u;null===(e=r.current)||void 0===e||e.removeEventListener("mouseenter",n),null===(i=r.current)||void 0===i||i.removeEventListener("mouseleave",t),null===(u=r.current)||void 0===u||u.removeEventListener("mousemove",o)}}}),[r.current]),e.useEffect((function(){d("string"==typeof o)}),[o]),s?n.jsxs("div",{className:B.videoControlsContainer,style:{display:c?"flex":"none"},children:[n.jsx(V,{}),n.jsx(O,{}),n.jsx(X,{})]}):null},F=function(t){var r=t.src,o=e.useContext(i).videoRef,u=c().play,a=e.useState(!1),l=a[0],s=a[1];return e.useEffect((function(){o.current&&(o.current.poster=r)}),[]),e.useEffect((function(){if(o.current){var e=function(){s(!0)};return o.current.addEventListener("play",e),function(){var n;null===(n=o.current)||void 0===n||n.removeEventListener("play",e)}}}),[o.current]),l?null:n.jsx("div",{className:B.videoPoster,style:{backgroundImage:"url(".concat(r,")")},children:n.jsx("button",{className:B.videoPosterPlayButton,onClick:u,children:n.jsx(C,{})})})},X=function(){return"string"!=typeof e.useContext(i).src?null:n.jsxs("div",{className:B.videoControlsBar,children:[n.jsxs("div",{className:B.videoControlsBarLeft,children:[n.jsx(Y,{}),n.jsx(Z,{}),n.jsx(N,{})]}),n.jsxs("div",{className:B.videoControlsBarRight,children:[n.jsx(G,{}),n.jsx(q,{}),n.jsx(J,{})]})]})},Z=function(){var e=c().forward;return n.jsx("button",{className:B.videoControlsButton,onClick:e,children:n.jsx(b,{})})},J=function(){return n.jsx("button",{className:B.videoControlsButton,children:n.jsx(k,{})})},q=function(){var t=e.useState(!1),r=t[0],o=t[1],i=c().toggleFullscreen;return e.useEffect((function(){var e=function(){o(!!document.fullscreenElement)};return document.addEventListener("fullscreenchange",e),function(){document.removeEventListener("fullscreenchange",e)}}),[]),n.jsx("button",{className:B.videoControlsButton,onClick:i,children:r?n.jsx(P,{}):n.jsx(_,{})})},G=function(){var t=e.useContext(i).videoRef,r=e.useState(!1),o=r[0],u=r[1],a=c().togglePip;return e.useEffect((function(){if(t.current){var e=function(){u(!0)},n=function(){u(!1)};return t.current.addEventListener("enterpictureinpicture",e),t.current.addEventListener("leavepictureinpicture",n),function(){var r,o;null===(r=t.current)||void 0===r||r.removeEventListener("enterpictureinpicture",e),null===(o=t.current)||void 0===o||o.removeEventListener("leavepictureinpicture",n)}}}),[t.current]),n.jsx("button",{className:B.videoControlsButton,onClick:a,children:o?n.jsx(S,{}):n.jsx(M,{})})},Y=function(){var t=c().togglePlay,r=e.useContext(i).videoRef,o=e.useState(!1),u=o[0],a=o[1];return e.useEffect((function(){var e=function(e){" "===e.key&&t()};return window.addEventListener("keydown",e),function(){window.removeEventListener("keydown",e)}}),[]),e.useEffect((function(){if(r.current){var e=function(){a(!0)},n=function(){a(!1)};return r.current.addEventListener("play",e),r.current.addEventListener("pause",n),function(){var t,o;null===(t=r.current)||void 0===t||t.removeEventListener("play",e),null===(o=r.current)||void 0===o||o.removeEventListener("pause",n)}}}),[r.current]),n.jsx("button",{className:B.videoControlsButton,children:u?n.jsx(y,{onClick:t}):n.jsx(C,{onClick:t})})},U=function(t){var r=t.controls,o=void 0===r||r,u=t.src,c=e.useContext(i).videoRef;return e.useEffect((function(){c.current&&(u&&("string"==typeof u?c.current.src=u:(c.current.autoplay=!0,c.current.srcObject=u)),c.current.preload="metadata")}),[c.current,u]),n.jsx("video",{ref:c,className:B.videoElement,width:"100%",height:"100%",controls:o})},Q=function(t){var r=t.renderCustomMenu,o=e.useContext(i),u=o.contextMenuItems,c=o.menuOpen,a=o.setMenuOpen,l=o.menuClientX,s=o.menuClientY;return c?n.jsx("div",{className:B.contextPageOverlay,onClick:function(){return a(!1)},children:n.jsx("div",{className:B.contextMenuCard,style:{top:s,left:l},children:r?r(u):n.jsx("div",{className:B.contextMenu,children:null==u?void 0:u.map((function(e,t){return n.jsxs("button",{className:B.contextMenuItem,onClick:e.onClick,children:[n.jsx("span",{className:B.contextMenuItemIcon,children:e.icon}),n.jsx("span",{className:B.contextMenuItemLabel,children:e.label})]},t)}))})})}):null},W=e.forwardRef((function(e,r){return n.jsxs(K,t({},e,{ref:r,children:[n.jsx(U,{src:e.src,controls:!1}),e.controls&&e.src&&n.jsx(T,{}),e.poster&&n.jsx(F,{src:e.poster}),n.jsx(Q,{})]}))})),K=e.forwardRef((function(e,r){return n.jsx(u,t({},e,{children:n.jsx($,t({},e,{ref:r,children:e.children}))}))})),$=e.forwardRef((function(t,r){var o=e.useContext(i),u=o.containerRef,a=o.setSeekPreview,l=o.setContextMenuItems,s=o.setMenuClientX,d=o.setMenuClientY,v=o.setMenuOpen,f=o.overlayRef,m=c(),p=m.play,h=m.pause,g=m.togglePlay,x=m.updatePlaybackRate,b=m.updateVolume,y=m.seek,E=m.toggleFullscreen,j=m.togglePip,k=m.toggleMute;e.useEffect((function(){a(!!t.seekPreview)}),[t.seekPreview]),e.useEffect((function(){r&&(r.current={play:p,pause:h,seek:y,volume:b,playbackRate:x,toggleFullscreen:E,togglePip:j,toggleMute:k,togglePlay:g})}),[]),e.useEffect((function(){var e=u.current;if(e){var n=e.querySelector("video");if(n){var r=function(){t.onTimeUpdate&&t.onTimeUpdate(n.currentTime)},o=function(){t.onPlay&&t.onPlay()},i=function(){t.onPause&&t.onPause()},c=function(){t.onEnded&&t.onEnded()},a=function(){t.onVolumeChange&&t.onVolumeChange(n.volume)},l=function(){t.onSeeking&&t.onSeeking()},s=function(){t.onSeeked&&t.onSeeked()},d=function(){t.onLoadedMetadata&&t.onLoadedMetadata()},v=function(){t.onLoadedData&&t.onLoadedData()},f=function(){t.onCanPlay&&t.onCanPlay()};return n.addEventListener("timeupdate",r),n.addEventListener("play",o),n.addEventListener("pause",i),n.addEventListener("ended",c),n.addEventListener("volumechange",a),n.addEventListener("seeking",l),n.addEventListener("seeked",s),n.addEventListener("loadedmetadata",d),n.addEventListener("loadeddata",v),n.addEventListener("canplay",f),function(){n.removeEventListener("timeupdate",r),n.removeEventListener("play",o),n.removeEventListener("pause",i),n.removeEventListener("ended",c),n.removeEventListener("volumechange",a),n.removeEventListener("seeking",l),n.removeEventListener("seeked",s),n.removeEventListener("loadedmetadata",d),n.removeEventListener("loadeddata",v),n.removeEventListener("canplay",f)}}}}),[]);var P=[{label:"Play",onClick:p,icon:n.jsx(C,{})},{label:"Pause",onClick:h,icon:n.jsx(R,{})},{label:"Toggle Fullscreen",onClick:E,icon:n.jsx(_,{})},{label:"Toggle Picture in Picture",onClick:j,icon:n.jsx(L,{})},{label:"Toggle Mute",onClick:k,icon:n.jsx(w,{})}];return e.useEffect((function(){var e;t.contextMenu&&(t.contextMenuItems?l(t.contextMenuItems):l(P),null===(e=f.current)||void 0===e||e.addEventListener("contextmenu",(function(e){e.preventDefault(),s(e.clientX),d(e.clientY),v(!0)})))}),[]),n.jsx("div",{ref:u,className:B.videoRoot,style:{maxHeight:t.height,maxWidth:t.width,background:"black"},children:t.children})})),ee=function(e){if(isNaN(e))return"0:00";var n=Math.floor(e/60),t=Math.floor(e%60);return"".concat(n,":").concat(t.toString().padStart(2,"0"))};exports.Audio=function(i){var u=i.src,c=i.controls,a=void 0===c||c,l=i.customControls,s=void 0!==l&&l,d=i.autoplay,v=void 0!==d&&d,f=i.loop,m=void 0!==f&&f,p=i.volume,h=void 0===p?1:p,g=i.playbackRate,x=void 0===g?1:g,_=i.onPlay,b=i.onPause,y=i.onEnd,C=i.onError,w=i.onVolumeChange,E=i.onSeek,j=i.className,L=e.useRef(null),k=e.useState({isPlaying:!1,currentTime:0,duration:0,volume:h,playbackRate:x,isMuted:!1,isLoading:!0,error:null}),P=k[0],M=k[1];e.useEffect((function(){L.current&&(L.current.volume=h,L.current.playbackRate=x,L.current.loop=m,v&&L.current.play().catch((function(e){M((function(n){return t(t({},n),{error:e})})),C&&C(e)})))}),[]);var S=e.useCallback((function(){return r(void 0,void 0,void 0,(function(){var e;return o(this,(function(n){switch(n.label){case 0:if(!L.current)return[2];n.label=1;case 1:return n.trys.push([1,6,,7]),P.isPlaying?[4,L.current.pause()]:[3,3];case 2:return n.sent(),b&&b(),[3,5];case 3:return[4,L.current.play()];case 4:n.sent(),_&&_(),n.label=5;case 5:return M((function(e){return t(t({},e),{isPlaying:!e.isPlaying})})),[3,7];case 6:return e=n.sent(),M((function(n){return t(t({},n),{error:e})})),C&&C(e),[3,7];case 7:return[2]}}))}))}),[P.isPlaying,_,b,C]),B=e.useCallback((function(e){L.current&&(L.current.currentTime=e,M((function(n){return t(t({},n),{currentTime:e})})),E&&E(e))}),[E]),V=e.useCallback((function(e){L.current&&(L.current.volume=e,M((function(n){return t(t({},n),{volume:e})})),w&&w(e))}),[w]),R=e.useCallback((function(e){L.current&&(L.current.playbackRate=e,M((function(n){return t(t({},n),{playbackRate:e})})))}),[]);e.useEffect((function(){var e,n=function(){L.current&&M((function(e){return t(t({},e),{currentTime:L.current.currentTime,duration:L.current.duration})}))};return null===(e=L.current)||void 0===e||e.addEventListener("timeupdate",n),function(){var e;null===(e=L.current)||void 0===e||e.removeEventListener("timeupdate",n)}}),[]),e.useEffect((function(){var e=function(e){if(L.current)switch(e.code){case"Space":e.preventDefault(),S();break;case"ArrowUp":e.preventDefault(),V(Math.min(P.volume+.1,1));break;case"ArrowDown":e.preventDefault(),V(Math.max(P.volume-.1,0));break;case"ArrowLeft":e.preventDefault(),B(Math.max(P.currentTime-5,0));break;case"ArrowRight":e.preventDefault(),B(Math.min(P.currentTime+5,P.duration))}};return window.addEventListener("keydown",e),function(){window.removeEventListener("keydown",e)}}),[P.volume,P.currentTime,P.duration,S,V,B]);return n.jsxs("div",{className:"audio-wrapper ".concat(j||""),children:[n.jsx("audio",t({ref:L,src:u,controls:a&&!s,loop:m,onEnded:y,onError:function(e){var n=new Error("Audio playback error");M((function(e){return t(t({},e),{error:n})})),C&&C(n)}},!a&&{"aria-hidden":!0})),s&&n.jsxs("div",{className:"audio-controls",role:"group","aria-label":"Audio controls",children:[n.jsx("button",{onClick:S,"aria-label":P.isPlaying?"Pause":"Play",className:"control-button",children:P.isPlaying?"⏸️":"▶️"}),n.jsx("input",{type:"range",min:0,max:P.duration,value:P.currentTime,onChange:function(e){return B(Number(e.target.value))},"aria-label":"Seek",className:"seek-slider"}),n.jsxs("div",{className:"volume-control",children:[n.jsx("button",{onClick:function(){return M((function(e){return t(t({},e),{isMuted:!e.isMuted})}))},"aria-label":P.isMuted?"Unmute":"Mute",className:"control-button",children:P.isMuted?"🔇":"🔊"}),n.jsx("input",{type:"range",min:0,max:1,step:.1,value:P.volume,onChange:function(e){return V(Number(e.target.value))},"aria-label":"Volume",className:"volume-slider"})]}),n.jsxs("select",{value:P.playbackRate,onChange:function(e){return R(Number(e.target.value))},"aria-label":"Playback speed",className:"playback-rate",children:[n.jsx("option",{value:.5,children:"0.5x"}),n.jsx("option",{value:1,children:"1x"}),n.jsx("option",{value:1.5,children:"1.5x"}),n.jsx("option",{value:2,children:"2x"})]}),n.jsxs("span",{className:"time-display",role:"timer",children:[ee(P.currentTime)," / ",ee(P.duration)]})]})]})},exports.Img=function(i){var u=i.src,c=i.alt,a=i.width,l=void 0===a?"auto":a,s=i.height,d=void 0===s?"auto":s,v=i.lazy,f=void 0===v||v,m=i.placeholder,p=i.srcSet,h=i.sizes,g=i.className,x=void 0===g?"":g,_=i.style,b=void 0===_?{}:_,y=i.filter,C=i.onLoad,w=i.onError,E=i.onClick,j=i.caption,L=i.overlay,k=i.zoomable,P=void 0!==k&&k,M=i.fallbackSrc,S=e.useState({isLoaded:!1,hasError:!1,isZoomed:!1,zoomPosition:{x:0,y:0}}),B=S[0],V=S[1],R=e.useRef(null),z=e.useRef(null),N=function(n,t){var r=void 0===t?{}:t,o=r.threshold,i=void 0===o?0:o,u=r.rootMargin,c=void 0===u?"0px":u,a=r.triggerOnce,l=void 0!==a&&a,s=e.useState(!1),d=s[0],v=s[1];return e.useEffect((function(){var e=n.current;if(e){var t=new IntersectionObserver((function(n){var r=n[0];v(r.isIntersecting),r.isIntersecting&&l&&t.unobserve(e)}),{threshold:i,rootMargin:c});return t.observe(e),function(){return t.disconnect()}}}),[n,i,c,l]),{isIntersecting:d}}(z,{threshold:.1,triggerOnce:!0}).isIntersecting,O=e.useCallback((function(){V((function(e){return t(t({},e),{isLoaded:!0})})),null==C||C()}),[C]),I=e.useCallback((function(){var e=new Error("Image failed to load");V((function(e){return t(t({},e),{hasError:!0})})),null==w||w(e)}),[w]),H=e.useCallback((function(e){if(P&&R.current&&z.current){var n=z.current.getBoundingClientRect(),r=(e.clientX-n.left)/n.width,o=(e.clientY-n.top)/n.height;V((function(e){return t(t({},e),{isZoomed:!e.isZoomed,zoomPosition:{x:r,y:o}})}))}}),[P]),T=y?{filter:y}:{},A=t(t(t({},b),T),{width:l,height:d,objectFit:"cover",transition:"opacity 0.3s ease-in-out"});e.useEffect((function(){r(void 0,void 0,void 0,(function(){var e;return o(this,(function(n){return(e=new Image).src="data:image/webp;base64,UklGRhoAAABXRUJQVlA4TA0AAAAvAAAAEAcQERGIiP4HAA==",[2,new Promise((function(n){e.onload=function(){return n(!0)},e.onerror=function(){return n(!1)}}))]}))})).then((function(e){e&&p&&!p.includes(".webp")&&console.warn("WebP format is supported but not included in srcSet")}))}),[p]);return n.jsxs("div",{ref:z,className:"image-container ".concat(x),style:{position:"relative",overflow:"hidden",cursor:P?"zoom-in":"initial"},children:[(!f||N)&&n.jsx("img",{ref:R,src:u,alt:c,srcSet:p,sizes:h,style:t(t({},A),{opacity:B.isLoaded?1:0,transform:B.isZoomed?"scale(2)":"none",transformOrigin:"".concat(100*B.zoomPosition.x,"% ").concat(100*B.zoomPosition.y,"%")}),onLoad:O,onError:I,onClick:function(e){H(e),null==E||E(e)},loading:f?"lazy":void 0}),!B.isLoaded&&!B.hasError&&n.jsx("div",{style:{width:l,height:d,backgroundColor:"#f0f0f0",display:"flex",alignItems:"center",justifyContent:"center"},children:m?n.jsx("img",{src:m,alt:"",style:{width:"100%",height:"100%",objectFit:"cover",filter:"blur(10px)"}}):n.jsx("div",{role:"presentation",children:"Loading..."})}),B.hasError&&n.jsx("div",{style:{width:l,height:d,backgroundColor:"#fee",display:"flex",alignItems:"center",justifyContent:"center"},children:M?n.jsx("img",{src:M,alt:c,style:{width:"100%",height:"100%",objectFit:"cover"}}):n.jsx("div",{role:"alert",children:"Failed to load image"})}),L&&B.isLoaded&&!B.hasError&&n.jsx("div",{className:"image-overlay",style:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center"},children:L}),j&&B.isLoaded&&!B.hasError&&n.jsx("figcaption",{className:"image-caption",style:{position:"absolute",bottom:0,left:0,right:0,padding:"8px",backgroundColor:"rgba(0, 0, 0, 0.7)",color:"white",textAlign:"center"},children:j})]})},exports.Video=W,exports.VideoContext=i,exports.VideoControls=T,exports.VideoElement=U,exports.VideoPoster=F,exports.VideoProvider=K,exports.useControls=c;