From e65e8c205584cb1dfe9437c5bf8cbf802ea5e751 Mon Sep 17 00:00:00 2001 From: Yiannis Christodoulou Date: Sun, 27 Jul 2025 23:24:07 +0300 Subject: [PATCH] build assets --- static/js/embed.js | 2 +- static/video_editor/video-editor.js | 2 +- static/video_editor/video-editor.js.map | 2 +- static/video_editor/videos/sample-video.mp4 | Bin 0 -> 15087816 bytes 4 files changed, 3 insertions(+), 3 deletions(-) create mode 100644 static/video_editor/videos/sample-video.mp4 diff --git a/static/js/embed.js b/static/js/embed.js index 2fdbd05c..62469c2a 100644 --- a/static/js/embed.js +++ b/static/js/embed.js @@ -1 +1 @@ -!function(){"use strict";var e,t={285:function(e,t,n){var i,a=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var a=Object.getOwnPropertyDescriptor(t,n);a&&!("get"in a?!t.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,a)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||(i=function(e){return i=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t},i(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n=i(e),o=0;oe())}),window.addEventListener("resize",function(){e.window.resize.map(e=>e())}),window.addEventListener("scroll",function(){e.window.scroll.map(e=>e())}),{doc:function(t){"function"==typeof t&&e.document.visibility.push(t)},win:function(t,n){"function"==typeof t&&e.window.resize.push(t),"function"==typeof n&&e.window.scroll.push(n)}}}},1254:function(e,t,n){n(9471),n(7460),n(5338),n(1838),n(8790),n(285),n(7664)},1838:function(e,t,n){n.d(t,{BrowserEvents:function(){return i.GT},addClassname:function(){return i.zc},cancelAnimationFrame:function(){return i.uU},csrfToken:function(){return l.G},deleteRequest:function(){return p.Fb},exportStore:function(){return r.A},formatInnerLink:function(){return o.c},formatViewsNumber:function(){return s.A},getRequest:function(){return p.iq},greaterCommonDivision:function(){return d.p7},hasClassname:function(){return i.CX},isPositiveIntegerOrZero:function(){return d.tR},logErrorAndReturnError:function(){return a.m},logWarningAndReturnError:function(){return a.g},postRequest:function(){return p.MB},publishedOnDate:function(){return c.A},putRequest:function(){return p.zi},quickSort:function(){return u.g},removeClassname:function(){return i.qk},replaceString:function(){return h.u},requestAnimationFrame:function(){return i.xi},supportsSvgAsImg:function(){return i.kN},translateString:function(){return m.g}});var i=n(1134),a=n(6403),r=n(977),o=n(463),s=n(4632),l=n(5393),d=(n(8004),n(8354)),c=(n(1702),n(7673)),u=n(1453),p=n(9659),m=n(4036),h=n(4470)},1936:function(e,t,n){n(1254),n(3212),n(795),n(1470)},2140:function(e,t,n){var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.SidebarThemeSwitcher=void 0;var a=i(n(9471)),r=n(5338);t.SidebarThemeSwitcher=function(){var e=(0,r.useTheme)(),t=e.currentThemeMode,n=e.changeThemeMode,i=e.themeModeSwitcher;return i.enabled&&"sidebar"===i.position&&a.default.createElement("div",{className:"sidebar-theme-switcher"},a.default.createElement("div",{className:"sidebar-theme-switcher-inner"},a.default.createElement("span",{className:"theme-icon"+("dark"===t?"":" active")},a.default.createElement("i",{className:"material-icons","data-icon":"wb_sunny"})),a.default.createElement("span",null,a.default.createElement("span",{className:"checkbox-switcher"},a.default.createElement("input",{type:"checkbox",checked:"dark"===t,onChange:n}))),a.default.createElement("span",{className:"theme-icon"+("dark"===t?" active":"")},a.default.createElement("i",{className:"material-icons","data-icon":"brightness_3"}))))}},2818:function(e,t,n){n.d(t,{OQ:function(){return c},n1:function(){return l},uW:function(){return d}});var i=n(8790),a=n(1838),r=n(5697);const o=["hls","h265","vp9","h264","vp8","mp4","theora"];function s(e,t){let n=null,i=document.createElement("video");if(i.canPlayType)try{switch(e){case"hls":case"mp4":n=!0;break;case"h265":n="probably"===i.canPlayType('video/mp4; codecs="hvc1.1.L0.0"')||"probably"===i.canPlayType('video/mp4; codecs="hev1.1.L0.0"');break;case"h264":n="probably"===i.canPlayType('video/mp4; codecs="avc1.42E01E"')||"probably"===i.canPlayType('video/mp4; codecs="avc1.42E01E, mp4a.40.2"');break;case"vp9":n="probably"===i.canPlayType('video/webm; codecs="vp9"');break;case"vp8":n="probably"===i.canPlayType('video/webm; codecs="vp8, vorbis"');break;case"theora":n="probably"===i.canPlayType('video/ogg; codecs="theora"')}if(t=(t instanceof Boolean||0===t||1==t)&&t){if("no"===i.canPlayType("video/nonsense")&&r.warn('BUGGY: Codec detection bug in Firefox 3.5.0 - 3.5.1 and Safari 4.0.0 - 4.0.4 that answer "no" to unknown codecs instead of an empty string'),"probably"===i.canPlayType("video/webm")&&r.warn('BUGGY: Codec detection bug that Firefox 27 and earlier always says "probably" when asked about WebM, even when the codecs string is not present'),"maybe"===i.canPlayType('video/mp4; codecs="avc1.42E01E"'))switch(i.canPlayType("video/mp4")){case"probably":r.warn('BUGGY: Codec detection bug in iOS 4.1 and earlier that switches "maybe" and "probably" around');break;case"maybe":r.warn('BUGGY: Codec detection bug in Android where no better answer than "maybe" is given')}"probably"===i.canPlayType('video/mp4; codecs="avc1.42E01E, mp4a.40.2"')&&"probably"!==i.canPlayType('video/mp4; codecs="avc1.42E01E"')&&r.warn("BUGGY: Codec detection bug in Internet Explorer 9 that requires both audio and video codec on test")}}catch(e){r.warn(e)}return n}function l(e){let t=[],n={},i=document.createElement("video");return i.canPlayType&&(n.hls=!0,t.push("hls"),(i.canPlayType('video/mp4; codecs="hvc1.1.L0.0"')||"probably"===i.canPlayType('video/mp4; codecs="hev1.1.L0.0"'))&&(n.h265=!0,t.push("h265")),"probably"===i.canPlayType('video/mp4; codecs="avc1.42E01E"')&&(n.h264=!0,t.push("h264")),"probably"===i.canPlayType('video/webm; codecs="vp9"')&&(n.vp9=!0,t.push("vp9")),e&&("probably"===i.canPlayType('video/webm; codecs="vp8, vorbis"')&&(n.vp8=!0,t.push("vp8")),"probably"===i.canPlayType('video/ogg; codecs="theora"')&&(n.theora=!0,t.push("theora"))),"probably"===i.canPlayType('video/mp4; codecs="mp4v.20.8"')&&(n.mp4=!0,t.push("mp4"))),{order:t,support:n}}function d(e,t,n){const d={};let c,u,p;n=void 0===n?l():n;const m={hls:["m3u8"],h265:["mp4","webm"],h264:["mp4","webm"],vp9:["mp4","webm"],vp8:["mp4","webm"],theora:["ogg"],mp4:["mp4"]};for(c in t)t.hasOwnProperty(c)&&(u=null,"master_file"===c?u="Auto":(u=c.split("_playlist"),u=2===u.length?u[0]:null),null!==u&&(d[u]=void 0===d[u]?{format:[],url:[]}:d[u],d[u].format.push("hls"),d[u].url.push((0,a.formatInnerLink)(t[c],i.SiteContext._currentValue.url))));for(u in e)if(e.hasOwnProperty(u)&&Object.keys(e[u]).length&&(1080>=parseInt(u,10)||1080=parseInt(i[i.length-1],10))return i[i.length-1];if(parseInt(e,10)<=parseInt(i[0],10))return i[0];for(n=i.length-1;n>=0;){if(parseInt(e,10)>=parseInt(i[n],10))return i[n+1];n-=1}}},2828:function(e,t,n){n.d(t,{Z:function(){return a}});var i=n(9471);const a=({type:e})=>e?i.createElement("i",{className:"material-icons","data-icon":e}):null},2901:function(e,t,n){var i=n(9471);const a=i.forwardRef((e,t)=>void 0!==e.children?i.createElement("div",{ref:t,className:"popup"+(void 0!==e.className?" "+e.className:""),style:e.style},e.children):null);t.Ay=a},4463:function(e,t,n){n.r(t),n.d(t,{UserConsumer:function(){return l},UserContext:function(){return r},UserProvider:function(){return s}});var i=n(9471),a=n(3997);const r=(0,i.createContext)(),o=(0,a.$)(window.MediaCMS).member,s=({children:e})=>{const t={isAnonymous:o.is.anonymous,username:o.username,thumbnail:o.thumbnail,userCan:o.can,pages:o.pages};return i.createElement(r.Provider,{value:t},e)},l=r.Consumer;t.default=r},5305:function(e,t,n){var i=n(9471),a=n(9834),r=n(8713),o=n.n(r);function s(e){const t=(0,i.useRef)(null),[n,r]=(0,i.useState)(null);let o=[];function s(t,n){var i;n.preventDefault(),n.stopPropagation(),i=o[t].id,void 0!==e.pages[i]&&r(i)}return(0,i.useEffect)(()=>{void 0!==e.pages[e.initPage]?r(e.initPage):Object.keys(e.pages).length?r(Object.keys(e.pages)[0]):r(null)},[e.initPage]),(0,i.useEffect)(()=>{!function(){let e=0;for(;et=>s(e,t))(n),o[n].elem.addEventListener("click",o[n].listener)),n+=1;e.focusFirstItemOnPageChange&&r.focus()}(),"function"==typeof e.pageChangeCallback&&e.pageChangeCallback(n))},[n]),n?i.createElement("div",{ref:t},i.cloneElement(e.pages[n])):null}s.propTypes={initPage:o().string,pages:o().object.isRequired,pageChangeSelector:o().string.isRequired,pageIdSelectorAttr:o().string.isRequired,focusFirstItemOnPageChange:o().bool,pageChangeCallback:o().func},s.defaultProps={focusFirstItemOnPageChange:!0}},5320:function(e,t,n){n.r(t),n.d(t,{LayoutConsumer:function(){return u},LayoutContext:function(){return d},LayoutProvider:function(){return c}});var i=n(9471),a=n(7154),r=n(7460),o=n(1838),s=n(8899);let l;const d=(0,i.createContext)(),c=({children:e})=>{const t=(0,i.useContext)(s.default),n=new a.BrowserCache("MediaCMS["+t.id+"][layout]",86400),c=!(!document.getElementById("app-sidebar")&&!document.querySelector(".page-sidebar")),[u,p]=(0,i.useState)(n.get("visible-sidebar")),[m,h]=(0,i.useState)(!1);(0,i.useEffect)(()=>{u?(0,o.addClassname)(document.body,"visible-sidebar"):(0,o.removeClassname)(document.body,"visible-sidebar"),"media"!==r.PageStore.get("current-page")&&1023{r.PageStore.once("page_init",()=>{"media"===r.PageStore.get("current-page")&&(p(!1),(0,o.removeClassname)(document.body,"visible-sidebar"))}),p("media"!==r.PageStore.get("current-page")&&1023{h(!m)},toggleSidebar:()=>{const e=!u;!function(e){clearTimeout(l),(0,o.addClassname)(document.body,"sliding-sidebar"),l=setTimeout(function(){"media"===r.PageStore.get("current-page")?e?(0,o.addClassname)(document.body,"overflow-hidden"):(0,o.removeClassname)(document.body,"overflow-hidden"):!e||767{const t=(0,i.useContext)(s.default),n=new a.BrowserCache("MediaCMS["+t.id+"][theme]",86400),[o,c]=(0,i.useState)((u=n.get("mode"),p=l.theme.mode,"light"===u||"dark"===u?u:p));var u,p;const m=function(e){let t=null,n=null;return void 0!==e.darkMode&&((0,r.supportsSvgAsImg)()&&void 0!==e.darkMode.svg&&""!==e.darkMode.svg?n=e.darkMode.svg:void 0!==e.darkMode.img&&""!==e.darkMode.img&&(n=e.darkMode.img)),void 0!==e.lightMode&&((0,r.supportsSvgAsImg)()&&void 0!==e.lightMode.svg&&""!==e.lightMode.svg?t=e.lightMode.svg:void 0!==e.lightMode.img&&""!==e.lightMode.img&&(t=e.lightMode.img)),null===t&&null===n||(null===t?t=n:null===n&&(n=t)),{light:t,dark:n}}(l.theme.logo),[h,f]=(0,i.useState)(m[o]);(0,i.useEffect)(()=>{"dark"===o?(0,r.addClassname)(document.body,"dark_theme"):(0,r.removeClassname)(document.body,"dark_theme"),n.set("mode",o),f(m[o])},[o]);const v={logo:h,currentThemeMode:o,changeThemeMode:()=>{c("light"===o?"dark":"light")},themeModeSwitcher:l.theme.switch};return i.createElement(d.Provider,{value:v},e)},u=d.Consumer},7154:function(e,t,n){var i=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var a=Object.getOwnPropertyDescriptor(t,n);a&&!("get"in a?!t.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,a)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),a=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||i(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),a(n(6077),t),a(n(4247),t),a(n(7687),t),a(n(3337),t)},7201:function(e,t,n){var i=n(9471),a=n(8713),r=n.n(a),o=n(2828);function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t=1;ti.createElement(l,s({key:t},e)));return t.length?i.createElement("div",{className:"nav-menu"+(e.removeVerticalPadding?" pv0":"")},i.createElement("nav",null,i.createElement("ul",null,t))):null}l.propTypes={itemType:r().oneOf(["link","open-subpage","button","label","div"]),link:r().string,icon:r().string,iconPos:r().oneOf(["left","right"]),text:r().string,active:r().bool,divAttr:r().object,buttonAttr:r().object,itemAttr:r().object,linkAttr:r().object},l.defaultProps={itemType:"link",iconPos:"left",active:!1},d.propTypes={removeVerticalPadding:r().bool,items:r().arrayOf(r().shape(l.propTypes)).isRequired},d.defaultProps={removeVerticalPadding:!1}},7460:function(e,t,n){var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.VideoViewerStore=t.SearchFieldStore=t.ProfilePageStore=t.PlaylistViewStore=t.PlaylistPageStore=t.PageStore=t.MediaPageStore=void 0;var a=i(n(2127));t.MediaPageStore=a.default;var r=i(n(6371));t.PageStore=r.default;var o=i(n(6841));t.PlaylistPageStore=o.default;var s=i(n(5503));t.PlaylistViewStore=s.default;var l=i(n(8580));t.ProfilePageStore=l.default;var d=i(n(4402));t.SearchFieldStore=d.default;var c=i(n(1309));t.VideoViewerStore=c.default},7664:function(e,t,n){n.d(t,{CircleIconButton:function(){return i.i}});var i=n(5321);n(7256),n(3135),n(2828),n(5305),n(7201),n(6089),n(3818),n(2901),n(6568),n(878)},8175:function(e,t,n){var i=n(9471),a=n(9834);n(5465),n(5320),n(4463),n(1936),function(e,t){const n=e?document.getElementById(e):void 0;n&&t&&a.render(i.createElement(t,null),n)}("page-embed",n(9942).EmbedPage)},8531:function(e,t,n){n.r(t),n.d(t,{default:function(){return h}});var i=n(9471),a=n(8713),r=n.n(a),o=n(285),s=n(8790),l=n(7460),d=n(1838),c=n(7154),u=n(2818),p=n(9237),m=n(5697);class h extends i.PureComponent{constructor(e){if(super(e),this.state={displayPlayer:!1},this.videoSources=[],function(e){switch(e){case"running_X":l.MediaPageStore.set("media-load-error-type","encodingRunning"),l.MediaPageStore.set("media-load-error-message","Media encoding is currently running. Try again in few minutes.");break;case"pending_X":l.MediaPageStore.set("media-load-error-type","encodingPending"),l.MediaPageStore.set("media-load-error-message","Media encoding is pending");break;case"fail":l.MediaPageStore.set("media-load-error-type","encodingFailed"),l.MediaPageStore.set("media-load-error-message","Media encoding failed")}}(this.props.data.encoding_status),null!==l.MediaPageStore.get("media-load-error-type"))return void(this.state.displayPlayer=!0);if("string"==typeof this.props.data.poster_url?this.videoPoster=(0,d.formatInnerLink)(this.props.data.poster_url,this.props.siteUrl):"string"==typeof this.props.data.thumbnail_url&&(this.videoPoster=(0,d.formatInnerLink)(this.props.data.thumbnail_url,this.props.siteUrl)),this.videoInfo=(0,u.uW)(this.props.data.encodings_info,this.props.data.hls_info),Object.keys(this.videoInfo).length){let e=l.VideoViewerStore.get("video-quality");(null===e||"Auto"===e&&void 0===this.videoInfo.Auto)&&(e=720);let t=(0,u.OQ)(e,this.videoInfo);"Auto"===e&&void 0!==this.videoInfo.Auto&&this.videoSources.push({src:this.videoInfo.Auto.url[0]});const n=(0,u.n1)();let i,a;for(a=0;aemailEmail\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t',this.cornerLayers={topLeft:e,topRight:this.upNextLoaderView?this.upNextLoaderView.html():null,bottomLeft:this.recommendedMedia?this.recommendedMedia.html():null,bottomRight:this.props.inEmbed?n:null},this.setState({displayPlayer:!0},function(){setTimeout(function(){const e=document.querySelector(".share-video-btn"),t=document.querySelector(".share-options-wrapper"),n=document.querySelector(".share-options-inner");e&&e.addEventListener("click",function(e){(0,d.addClassname)(document.querySelector(".video-js.vjs-mediacms"),"vjs-visible-share-options")}),t&&t.addEventListener("click",function(e){e.target!==n&&e.target!==t||(0,d.removeClassname)(document.querySelector(".video-js.vjs-mediacms"),"vjs-visible-share-options")})},1e3)})}}componentWillUnmount(){this.unsetRecommendedMedia()}initRecommendedMedia(){null!==this.recommendedMedia&&(this.props.inEmbed||this.recommendedMedia.init(),this.playerInstance.player.on("fullscreenchange",this.recommendedMedia.onResize),l.PageStore.on("window_resize",this.recommendedMedia.onResize),l.VideoViewerStore.on("changed_viewer_mode",this.recommendedMedia.onResize))}unsetRecommendedMedia(){null!==this.recommendedMedia&&(this.playerInstance.player.off("fullscreenchange",this.recommendedMedia.onResize),l.PageStore.removeListener("window_resize",this.recommendedMedia.onResize),l.VideoViewerStore.removeListener("changed_viewer_mode",this.recommendedMedia.onResize),this.recommendedMedia.destroy())}onClickNext(){let e;l.MediaPageStore.get("playlist-id")?(e=l.MediaPageStore.get("playlist-next-media-url"),null===e&&(e=this.props.data.related_media[0].url)):this.props.inEmbed||(e=this.props.data.related_media[0].url),window.location.href=e}onClickPrevious(){let e;l.MediaPageStore.get("playlist-id")?(e=l.MediaPageStore.get("playlist-previous-media-url"),null===e&&(e=this.props.data.related_media[0].url)):this.props.inEmbed||(e=this.props.data.related_media[0].url),window.location.href=e}onStateUpdate(e){l.VideoViewerStore.get("in-theater-mode")!==e.theaterMode&&o.VideoViewerActions.set_viewer_mode(e.theaterMode),l.VideoViewerStore.get("player-volume")!==e.volume&&o.VideoViewerActions.set_player_volume(e.volume),l.VideoViewerStore.get("player-sound-muted")!==e.soundMuted&&o.VideoViewerActions.set_player_sound_muted(e.soundMuted),l.VideoViewerStore.get("video-quality")!==e.quality&&o.VideoViewerActions.set_video_quality(e.quality),l.VideoViewerStore.get("video-playback-speed")!==e.playbackSpeed&&o.VideoViewerActions.set_video_playback_speed(e.playbackSpeed)}onPlayerInit(e,t){this.playerElem=t,this.playerInstance=e,this.upNextLoaderView&&(this.upNextLoaderView.setVideoJsPlayerElem(this.playerInstance.player.el_),this.onUpdateMediaAutoPlay()),this.props.inEmbed||this.playerElem.parentNode.focus(),null!==this.recommendedMedia&&(this.recommendedMedia.initWrappers(this.playerElem.parentNode),this.props.inEmbed&&(this.playerInstance.player.one("pause",this.recommendedMedia.init),this.initRecommendedMedia())),this.playerInstance.player.one("ended",this.onVideoEnd)}onVideoRestart(){null!==this.recommendedMedia&&(this.recommendedMedia.updateDisplayType("inline"),this.props.inEmbed&&this.playerInstance.player.one("pause",this.recommendedMedia.init),this.playerInstance.player.one("ended",this.onVideoEnd))}onVideoEnd(){if(null!==this.recommendedMedia&&(this.props.inEmbed||this.initRecommendedMedia(),this.recommendedMedia.updateDisplayType("full"),this.playerInstance.player.one("playing",this.onVideoRestart)),!this.props.inEmbed&&l.MediaPageStore.get("playlist-id")){const e=document.querySelector(".video-player .more-media"),t=document.querySelector(".video-player .vjs-actions-anim");this.upNextLoaderView.cancelTimer();const n=l.MediaPageStore.get("playlist-next-media-url");return n&&(e&&(e.style.display="none"),t&&(t.style.display="none"),window.location.href=n),void this.upNextLoaderView.hideTimerView()}this.upNextLoaderView&&(l.PageStore.get("media-auto-play")?(this.upNextLoaderView.startTimer(),this.playerInstance.player.one("play",function(){this.upNextLoaderView.cancelTimer()}.bind(this))):this.upNextLoaderView.cancelTimer())}onUpdateMediaAutoPlay(){this.upNextLoaderView&&(l.PageStore.get("media-auto-play")?this.upNextLoaderView.showTimerView(this.playerInstance.isEnded()):this.upNextLoaderView.hideTimerView())}render(){let e=null,t=null;!this.props.inEmbed&&l.MediaPageStore.get("playlist-id")?(e=l.MediaPageStore.get("playlist-next-media-url"),t=l.MediaPageStore.get("playlist-previous-media-url")):e=this.props.data.related_media.length&&!this.props.inEmbed?this.props.data.related_media[0].url:null;const n=this.props.data.sprites_url?{url:this.props.siteUrl+"/"+this.props.data.sprites_url.replace(/^\//g,""),frame:{width:160,height:90,seconds:10}}:null;return i.createElement(i.Fragment,null,i.createElement("div",{key:(this.props.inEmbed?"embed-":"")+"player-container",className:"player-container"+(this.videoSources.length?"":" player-container-error"),style:this.props.containerStyles,ref:"playerContainer"},i.createElement("div",{className:"player-container-inner",ref:"playerContainerInner",style:this.props.containerStyles},this.state.displayPlayer&&null==l.MediaPageStore.get("media-load-error-type")?i.createElement("div",{className:"video-player",ref:"videoJSPlayerWrapper",key:"videoJSPlayerWrapper"},i.createElement(s.SiteConsumer,null,a=>i.createElement(p.A,{data:this.props.data,playerVolume:this.browserCache.get("player-volume"),playerSoundMuted:this.browserCache.get("player-sound-muted"),videoQuality:this.browserCache.get("video-quality"),videoPlaybackSpeed:parseInt(this.browserCache.get("video-playback-speed"),10),inTheaterMode:this.browserCache.get("in-theater-mode"),siteId:a.id,siteUrl:a.url,info:this.videoInfo,cornerLayers:this.cornerLayers,sources:this.videoSources,poster:this.videoPoster,previewSprite:n,subtitlesInfo:this.props.data.subtitles_info,enableAutoplay:!this.props.inEmbed,inEmbed:this.props.inEmbed,hasTheaterMode:!this.props.inEmbed,hasNextLink:!!e,hasPreviousLink:!!t,errorMessage:l.MediaPageStore.get("media-load-error-message"),onClickNextCallback:this.onClickNext,onClickPreviousCallback:this.onClickPrevious,onStateUpdateCallback:this.onStateUpdate,onPlayerInitCallback:this.onPlayerInit}))):null)))}}function f(e){let t=null,n=[];var i=location.search.substr(1).split("&");for(let a=0;a{const n=document.querySelector(".video-js.vjs-mediacms");if(n){const e=n.querySelector("video");e&&(function(e){if(!e||!e.tagName||"video"!==e.tagName.toLowerCase())return void m.error("Invalid video element:",e);const t=videojs(e);t.playsinline(!0),t.on("loadedmetadata",function(){const e=parseInt(f("muted")),n=parseInt(f("autoplay")),i=parseInt(f("t"));document.addEventListener("click",function(e){if(e.target.classList.contains("video-timestamp")){e.preventDefault();const n=parseInt(e.target.dataset.timestamp,10);n>=0&&n=0&&t.play()}}),1==e&&t.muted(!0),i>=0&&i=0&&i>=t.duration()&&t.play(),1===n&&t.play()})}(e),t.disconnect())}}).observe(document,{childList:!0,subtree:!0})},8790:function(e,t,n){var i=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var a=Object.getOwnPropertyDescriptor(t,n);a&&!("get"in a?!t.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,a)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),a=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||i(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),a(n(9781),t),a(n(3537),t),a(n(5320),t),a(n(2401),t),a(n(3496),t),a(n(9423),t),a(n(2579),t),a(n(9854),t),a(n(8899),t),a(n(5886),t),a(n(5465),t),a(n(4463),t)},8899:function(e,t,n){n.r(t),n.d(t,{SiteConsumer:function(){return o},SiteContext:function(){return r}});var i=n(9471),a=n(3997);const r=(0,i.createContext)((0,a.$)(window.MediaCMS).site),o=r.Consumer;t.default=r},9237:function(e,t,n){var i=n(9471);const a=({data:e,playerVolume:t,playerSoundMuted:n,videoQuality:a,videoPlaybackSpeed:r,inTheaterMode:o,siteId:s,siteUrl:l,info:d,cornerLayers:c,sources:u,poster:p,previewSprite:m,subtitlesInfo:h,enableAutoplay:f,inEmbed:v,hasTheaterMode:g,hasNextLink:b,hasPreviousLink:y,errorMessage:w,onClickNextCallback:P,onClickPreviousCallback:S,onStateUpdateCallback:k,onPlayerInitCallback:_})=>{const E=(0,i.useRef)(null),M=(0,i.useRef)(!1);(0,i.useEffect)(()=>{"undefined"!=typeof window&&(window.MEDIA_DATA={data:e||{},playerVolume:t||.5,playerSoundMuted:n||!1,videoQuality:a||"auto",videoPlaybackSpeed:r||1,inTheaterMode:o||!1,siteId:s||"",siteUrl:l||"",info:d||{},cornerLayers:c||[],sources:u||[],poster:p||"",previewSprite:m||null,subtitlesInfo:h||[],enableAutoplay:f||!1,inEmbed:v||!1,hasTheaterMode:g||!1,hasNextLink:b||!1,hasPreviousLink:y||!1,errorMessage:w||"",onClickNextCallback:P||null,onClickPreviousCallback:S||null,onStateUpdateCallback:k||null,onPlayerInitCallback:_||null}),M.current||(C(),M.current=!0)},[e,l]);const C=()=>{const e=document.querySelector('link[href*="video-js.css"]'),t=document.querySelector('script[src*="video-js.js"]');if(!e){const e=document.createElement("link");e.rel="stylesheet",e.href=l+"/static/video_js/video-js.css",document.head.appendChild(e)}if(!t){const e=document.createElement("script");e.src=l+"/static/video_js/video-js.js",document.head.appendChild(e)}};return i.createElement("div",{className:"video-js-wrapper",ref:E},i.createElement("div",{id:"video-js-root"}))};a.defaultProps={data:{},siteUrl:""},t.A=a},9942:function(e,t,n){var i,a=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var a=Object.getOwnPropertyDescriptor(t,n);a&&!("get"in a?!t.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,a)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||(i=function(e){return i=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t},i(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n=i(e),o=0;o=r)&&Object.keys(i.O).every(function(e){return i.O[e](n[l])})?n.splice(l--,1):(s=!1,r0&&e[c-1][2]>r;c--)e[c]=e[c-1];e[c]=[n,a,r]},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,{a:t}),t},i.d=function(e,t){for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.j=722,function(){var e={722:0};i.O.j=function(t){return 0===e[t]};var t=function(t,n){var a,r,o=n[0],s=n[1],l=n[2],d=0;if(o.some(function(t){return 0!==e[t]})){for(a in s)i.o(s,a)&&(i.m[a]=s[a]);if(l)var c=l(i)}for(t&&t(n);de())}),window.addEventListener("resize",function(){e.window.resize.map(e=>e())}),window.addEventListener("scroll",function(){e.window.scroll.map(e=>e())}),{doc:function(t){"function"==typeof t&&e.document.visibility.push(t)},win:function(t,n){"function"==typeof t&&e.window.resize.push(t),"function"==typeof n&&e.window.scroll.push(n)}}}},1254:function(e,t,n){n(9471),n(7460),n(5338),n(1838),n(8790),n(285),n(7664)},1838:function(e,t,n){n.d(t,{BrowserEvents:function(){return i.GT},addClassname:function(){return i.zc},cancelAnimationFrame:function(){return i.uU},csrfToken:function(){return l.G},deleteRequest:function(){return p.Fb},exportStore:function(){return r.A},formatInnerLink:function(){return o.c},formatViewsNumber:function(){return s.A},getRequest:function(){return p.iq},greaterCommonDivision:function(){return d.p7},hasClassname:function(){return i.CX},isPositiveIntegerOrZero:function(){return d.tR},logErrorAndReturnError:function(){return a.m},logWarningAndReturnError:function(){return a.g},postRequest:function(){return p.MB},publishedOnDate:function(){return c.A},putRequest:function(){return p.zi},quickSort:function(){return u.g},removeClassname:function(){return i.qk},replaceString:function(){return h.u},requestAnimationFrame:function(){return i.xi},supportsSvgAsImg:function(){return i.kN},translateString:function(){return m.g}});var i=n(1134),a=n(6403),r=n(977),o=n(463),s=n(4632),l=n(5393),d=(n(8004),n(8354)),c=(n(1702),n(7673)),u=n(1453),p=n(9659),m=n(4036),h=n(4470)},1936:function(e,t,n){n(1254),n(3212),n(795),n(1470)},2140:function(e,t,n){var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.SidebarThemeSwitcher=void 0;var a=i(n(9471)),r=n(5338);t.SidebarThemeSwitcher=function(){var e=(0,r.useTheme)(),t=e.currentThemeMode,n=e.changeThemeMode,i=e.themeModeSwitcher;return i.enabled&&"sidebar"===i.position&&a.default.createElement("div",{className:"sidebar-theme-switcher"},a.default.createElement("div",{className:"sidebar-theme-switcher-inner"},a.default.createElement("span",{className:"theme-icon"+("dark"===t?"":" active")},a.default.createElement("i",{className:"material-icons","data-icon":"wb_sunny"})),a.default.createElement("span",null,a.default.createElement("span",{className:"checkbox-switcher"},a.default.createElement("input",{type:"checkbox",checked:"dark"===t,onChange:n}))),a.default.createElement("span",{className:"theme-icon"+("dark"===t?" active":"")},a.default.createElement("i",{className:"material-icons","data-icon":"brightness_3"}))))}},2818:function(e,t,n){n.d(t,{OQ:function(){return c},n1:function(){return l},uW:function(){return d}});var i=n(8790),a=n(1838),r=n(5697);const o=["hls","h265","vp9","h264","vp8","mp4","theora"];function s(e,t){let n=null,i=document.createElement("video");if(i.canPlayType)try{switch(e){case"hls":case"mp4":n=!0;break;case"h265":n="probably"===i.canPlayType('video/mp4; codecs="hvc1.1.L0.0"')||"probably"===i.canPlayType('video/mp4; codecs="hev1.1.L0.0"');break;case"h264":n="probably"===i.canPlayType('video/mp4; codecs="avc1.42E01E"')||"probably"===i.canPlayType('video/mp4; codecs="avc1.42E01E, mp4a.40.2"');break;case"vp9":n="probably"===i.canPlayType('video/webm; codecs="vp9"');break;case"vp8":n="probably"===i.canPlayType('video/webm; codecs="vp8, vorbis"');break;case"theora":n="probably"===i.canPlayType('video/ogg; codecs="theora"')}if(t=(t instanceof Boolean||0===t||1==t)&&t){if("no"===i.canPlayType("video/nonsense")&&r.warn('BUGGY: Codec detection bug in Firefox 3.5.0 - 3.5.1 and Safari 4.0.0 - 4.0.4 that answer "no" to unknown codecs instead of an empty string'),"probably"===i.canPlayType("video/webm")&&r.warn('BUGGY: Codec detection bug that Firefox 27 and earlier always says "probably" when asked about WebM, even when the codecs string is not present'),"maybe"===i.canPlayType('video/mp4; codecs="avc1.42E01E"'))switch(i.canPlayType("video/mp4")){case"probably":r.warn('BUGGY: Codec detection bug in iOS 4.1 and earlier that switches "maybe" and "probably" around');break;case"maybe":r.warn('BUGGY: Codec detection bug in Android where no better answer than "maybe" is given')}"probably"===i.canPlayType('video/mp4; codecs="avc1.42E01E, mp4a.40.2"')&&"probably"!==i.canPlayType('video/mp4; codecs="avc1.42E01E"')&&r.warn("BUGGY: Codec detection bug in Internet Explorer 9 that requires both audio and video codec on test")}}catch(e){r.warn(e)}return n}function l(e){let t=[],n={},i=document.createElement("video");return i.canPlayType&&(n.hls=!0,t.push("hls"),(i.canPlayType('video/mp4; codecs="hvc1.1.L0.0"')||"probably"===i.canPlayType('video/mp4; codecs="hev1.1.L0.0"'))&&(n.h265=!0,t.push("h265")),"probably"===i.canPlayType('video/mp4; codecs="avc1.42E01E"')&&(n.h264=!0,t.push("h264")),"probably"===i.canPlayType('video/webm; codecs="vp9"')&&(n.vp9=!0,t.push("vp9")),e&&("probably"===i.canPlayType('video/webm; codecs="vp8, vorbis"')&&(n.vp8=!0,t.push("vp8")),"probably"===i.canPlayType('video/ogg; codecs="theora"')&&(n.theora=!0,t.push("theora"))),"probably"===i.canPlayType('video/mp4; codecs="mp4v.20.8"')&&(n.mp4=!0,t.push("mp4"))),{order:t,support:n}}function d(e,t,n){const d={};let c,u,p;n=void 0===n?l():n;const m={hls:["m3u8"],h265:["mp4","webm"],h264:["mp4","webm"],vp9:["mp4","webm"],vp8:["mp4","webm"],theora:["ogg"],mp4:["mp4"]};for(c in t)t.hasOwnProperty(c)&&(u=null,"master_file"===c?u="Auto":(u=c.split("_playlist"),u=2===u.length?u[0]:null),null!==u&&(d[u]=void 0===d[u]?{format:[],url:[]}:d[u],d[u].format.push("hls"),d[u].url.push((0,a.formatInnerLink)(t[c],i.SiteContext._currentValue.url))));for(u in e)if(e.hasOwnProperty(u)&&Object.keys(e[u]).length&&(1080>=parseInt(u,10)||1080=parseInt(i[i.length-1],10))return i[i.length-1];if(parseInt(e,10)<=parseInt(i[0],10))return i[0];for(n=i.length-1;n>=0;){if(parseInt(e,10)>=parseInt(i[n],10))return i[n+1];n-=1}}},2828:function(e,t,n){n.d(t,{Z:function(){return a}});var i=n(9471);const a=({type:e})=>e?i.createElement("i",{className:"material-icons","data-icon":e}):null},2901:function(e,t,n){var i=n(9471);const a=i.forwardRef((e,t)=>void 0!==e.children?i.createElement("div",{ref:t,className:"popup"+(void 0!==e.className?" "+e.className:""),style:e.style},e.children):null);t.Ay=a},4463:function(e,t,n){n.r(t),n.d(t,{UserConsumer:function(){return l},UserContext:function(){return r},UserProvider:function(){return s}});var i=n(9471),a=n(3997);const r=(0,i.createContext)(),o=(0,a.$)(window.MediaCMS).member,s=({children:e})=>{const t={isAnonymous:o.is.anonymous,username:o.username,thumbnail:o.thumbnail,userCan:o.can,pages:o.pages};return i.createElement(r.Provider,{value:t},e)},l=r.Consumer;t.default=r},5305:function(e,t,n){var i=n(9471),a=n(9834),r=n(8713),o=n.n(r);function s(e){const t=(0,i.useRef)(null),[n,r]=(0,i.useState)(null);let o=[];function s(t,n){var i;n.preventDefault(),n.stopPropagation(),i=o[t].id,void 0!==e.pages[i]&&r(i)}return(0,i.useEffect)(()=>{void 0!==e.pages[e.initPage]?r(e.initPage):Object.keys(e.pages).length?r(Object.keys(e.pages)[0]):r(null)},[e.initPage]),(0,i.useEffect)(()=>{!function(){let e=0;for(;et=>s(e,t))(n),o[n].elem.addEventListener("click",o[n].listener)),n+=1;e.focusFirstItemOnPageChange&&r.focus()}(),"function"==typeof e.pageChangeCallback&&e.pageChangeCallback(n))},[n]),n?i.createElement("div",{ref:t},i.cloneElement(e.pages[n])):null}s.propTypes={initPage:o().string,pages:o().object.isRequired,pageChangeSelector:o().string.isRequired,pageIdSelectorAttr:o().string.isRequired,focusFirstItemOnPageChange:o().bool,pageChangeCallback:o().func},s.defaultProps={focusFirstItemOnPageChange:!0}},5320:function(e,t,n){n.r(t),n.d(t,{LayoutConsumer:function(){return u},LayoutContext:function(){return d},LayoutProvider:function(){return c}});var i=n(9471),a=n(7154),r=n(7460),o=n(1838),s=n(8899);let l;const d=(0,i.createContext)(),c=({children:e})=>{const t=(0,i.useContext)(s.default),n=new a.BrowserCache("MediaCMS["+t.id+"][layout]",86400),c=!(!document.getElementById("app-sidebar")&&!document.querySelector(".page-sidebar")),[u,p]=(0,i.useState)(n.get("visible-sidebar")),[m,h]=(0,i.useState)(!1);(0,i.useEffect)(()=>{u?(0,o.addClassname)(document.body,"visible-sidebar"):(0,o.removeClassname)(document.body,"visible-sidebar"),"media"!==r.PageStore.get("current-page")&&1023{r.PageStore.once("page_init",()=>{"media"===r.PageStore.get("current-page")&&(p(!1),(0,o.removeClassname)(document.body,"visible-sidebar"))}),p("media"!==r.PageStore.get("current-page")&&1023{h(!m)},toggleSidebar:()=>{const e=!u;!function(e){clearTimeout(l),(0,o.addClassname)(document.body,"sliding-sidebar"),l=setTimeout(function(){"media"===r.PageStore.get("current-page")?e?(0,o.addClassname)(document.body,"overflow-hidden"):(0,o.removeClassname)(document.body,"overflow-hidden"):!e||767{const t=(0,i.useContext)(s.default),n=new a.BrowserCache("MediaCMS["+t.id+"][theme]",86400),[o,c]=(0,i.useState)((u=n.get("mode"),p=l.theme.mode,"light"===u||"dark"===u?u:p));var u,p;const m=function(e){let t=null,n=null;return void 0!==e.darkMode&&((0,r.supportsSvgAsImg)()&&void 0!==e.darkMode.svg&&""!==e.darkMode.svg?n=e.darkMode.svg:void 0!==e.darkMode.img&&""!==e.darkMode.img&&(n=e.darkMode.img)),void 0!==e.lightMode&&((0,r.supportsSvgAsImg)()&&void 0!==e.lightMode.svg&&""!==e.lightMode.svg?t=e.lightMode.svg:void 0!==e.lightMode.img&&""!==e.lightMode.img&&(t=e.lightMode.img)),null===t&&null===n||(null===t?t=n:null===n&&(n=t)),{light:t,dark:n}}(l.theme.logo),[h,f]=(0,i.useState)(m[o]);(0,i.useEffect)(()=>{"dark"===o?(0,r.addClassname)(document.body,"dark_theme"):(0,r.removeClassname)(document.body,"dark_theme"),n.set("mode",o),f(m[o])},[o]);const v={logo:h,currentThemeMode:o,changeThemeMode:()=>{c("light"===o?"dark":"light")},themeModeSwitcher:l.theme.switch};return i.createElement(d.Provider,{value:v},e)},u=d.Consumer},7154:function(e,t,n){var i=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var a=Object.getOwnPropertyDescriptor(t,n);a&&!("get"in a?!t.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,a)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),a=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||i(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),a(n(6077),t),a(n(4247),t),a(n(7687),t),a(n(3337),t)},7201:function(e,t,n){var i=n(9471),a=n(8713),r=n.n(a),o=n(2828);function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t=1;ti.createElement(l,s({key:t},e)));return t.length?i.createElement("div",{className:"nav-menu"+(e.removeVerticalPadding?" pv0":"")},i.createElement("nav",null,i.createElement("ul",null,t))):null}l.propTypes={itemType:r().oneOf(["link","open-subpage","button","label","div"]),link:r().string,icon:r().string,iconPos:r().oneOf(["left","right"]),text:r().string,active:r().bool,divAttr:r().object,buttonAttr:r().object,itemAttr:r().object,linkAttr:r().object},l.defaultProps={itemType:"link",iconPos:"left",active:!1},d.propTypes={removeVerticalPadding:r().bool,items:r().arrayOf(r().shape(l.propTypes)).isRequired},d.defaultProps={removeVerticalPadding:!1}},7460:function(e,t,n){var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.VideoViewerStore=t.SearchFieldStore=t.ProfilePageStore=t.PlaylistViewStore=t.PlaylistPageStore=t.PageStore=t.MediaPageStore=void 0;var a=i(n(2127));t.MediaPageStore=a.default;var r=i(n(6371));t.PageStore=r.default;var o=i(n(6841));t.PlaylistPageStore=o.default;var s=i(n(5503));t.PlaylistViewStore=s.default;var l=i(n(8580));t.ProfilePageStore=l.default;var d=i(n(4402));t.SearchFieldStore=d.default;var c=i(n(1309));t.VideoViewerStore=c.default},7664:function(e,t,n){n.d(t,{CircleIconButton:function(){return i.i}});var i=n(5321);n(7256),n(3135),n(2828),n(5305),n(7201),n(6089),n(3818),n(2901),n(6568),n(878)},8175:function(e,t,n){var i=n(9471),a=n(9834);n(5465),n(5320),n(4463),n(1936),function(e,t){const n=e?document.getElementById(e):void 0;n&&t&&a.render(i.createElement(t,null),n)}("page-embed",n(9942).EmbedPage)},8531:function(e,t,n){n.r(t),n.d(t,{default:function(){return h}});var i=n(9471),a=n(8713),r=n.n(a),o=n(285),s=n(8790),l=n(7460),d=n(1838),c=n(7154),u=n(2818),p=n(9237),m=n(5697);class h extends i.PureComponent{constructor(e){if(super(e),this.state={displayPlayer:!1},this.videoSources=[],function(e){switch(e){case"running_X":l.MediaPageStore.set("media-load-error-type","encodingRunning"),l.MediaPageStore.set("media-load-error-message","Media encoding is currently running. Try again in few minutes.");break;case"pending_X":l.MediaPageStore.set("media-load-error-type","encodingPending"),l.MediaPageStore.set("media-load-error-message","Media encoding is pending");break;case"fail":l.MediaPageStore.set("media-load-error-type","encodingFailed"),l.MediaPageStore.set("media-load-error-message","Media encoding failed")}}(this.props.data.encoding_status),null!==l.MediaPageStore.get("media-load-error-type"))return void(this.state.displayPlayer=!0);if("string"==typeof this.props.data.poster_url?this.videoPoster=(0,d.formatInnerLink)(this.props.data.poster_url,this.props.siteUrl):"string"==typeof this.props.data.thumbnail_url&&(this.videoPoster=(0,d.formatInnerLink)(this.props.data.thumbnail_url,this.props.siteUrl)),this.videoInfo=(0,u.uW)(this.props.data.encodings_info,this.props.data.hls_info),Object.keys(this.videoInfo).length){let e=l.VideoViewerStore.get("video-quality");(null===e||"Auto"===e&&void 0===this.videoInfo.Auto)&&(e=720);let t=(0,u.OQ)(e,this.videoInfo);"Auto"===e&&void 0!==this.videoInfo.Auto&&this.videoSources.push({src:this.videoInfo.Auto.url[0]});const n=(0,u.n1)();let i,a;for(a=0;aemailEmail\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t',this.cornerLayers={topLeft:e,topRight:this.upNextLoaderView?this.upNextLoaderView.html():null,bottomLeft:this.recommendedMedia?this.recommendedMedia.html():null,bottomRight:this.props.inEmbed?n:null},this.setState({displayPlayer:!0},function(){setTimeout(function(){const e=document.querySelector(".share-video-btn"),t=document.querySelector(".share-options-wrapper"),n=document.querySelector(".share-options-inner");e&&e.addEventListener("click",function(e){(0,d.addClassname)(document.querySelector(".video-js.vjs-mediacms"),"vjs-visible-share-options")}),t&&t.addEventListener("click",function(e){e.target!==n&&e.target!==t||(0,d.removeClassname)(document.querySelector(".video-js.vjs-mediacms"),"vjs-visible-share-options")})},1e3)})}}componentWillUnmount(){this.unsetRecommendedMedia()}initRecommendedMedia(){null!==this.recommendedMedia&&(this.props.inEmbed||this.recommendedMedia.init(),this.playerInstance.player.on("fullscreenchange",this.recommendedMedia.onResize),l.PageStore.on("window_resize",this.recommendedMedia.onResize),l.VideoViewerStore.on("changed_viewer_mode",this.recommendedMedia.onResize))}unsetRecommendedMedia(){null!==this.recommendedMedia&&(this.playerInstance.player.off("fullscreenchange",this.recommendedMedia.onResize),l.PageStore.removeListener("window_resize",this.recommendedMedia.onResize),l.VideoViewerStore.removeListener("changed_viewer_mode",this.recommendedMedia.onResize),this.recommendedMedia.destroy())}onClickNext(){let e;l.MediaPageStore.get("playlist-id")?(e=l.MediaPageStore.get("playlist-next-media-url"),null===e&&(e=this.props.data.related_media[0].url)):this.props.inEmbed||(e=this.props.data.related_media[0].url),window.location.href=e}onClickPrevious(){let e;l.MediaPageStore.get("playlist-id")?(e=l.MediaPageStore.get("playlist-previous-media-url"),null===e&&(e=this.props.data.related_media[0].url)):this.props.inEmbed||(e=this.props.data.related_media[0].url),window.location.href=e}onStateUpdate(e){l.VideoViewerStore.get("in-theater-mode")!==e.theaterMode&&o.VideoViewerActions.set_viewer_mode(e.theaterMode),l.VideoViewerStore.get("player-volume")!==e.volume&&o.VideoViewerActions.set_player_volume(e.volume),l.VideoViewerStore.get("player-sound-muted")!==e.soundMuted&&o.VideoViewerActions.set_player_sound_muted(e.soundMuted),l.VideoViewerStore.get("video-quality")!==e.quality&&o.VideoViewerActions.set_video_quality(e.quality),l.VideoViewerStore.get("video-playback-speed")!==e.playbackSpeed&&o.VideoViewerActions.set_video_playback_speed(e.playbackSpeed)}onPlayerInit(e,t){this.playerElem=t,this.playerInstance=e,this.upNextLoaderView&&(this.upNextLoaderView.setVideoJsPlayerElem(this.playerInstance.player.el_),this.onUpdateMediaAutoPlay()),this.props.inEmbed||this.playerElem.parentNode.focus(),null!==this.recommendedMedia&&(this.recommendedMedia.initWrappers(this.playerElem.parentNode),this.props.inEmbed&&(this.playerInstance.player.one("pause",this.recommendedMedia.init),this.initRecommendedMedia())),this.playerInstance.player.one("ended",this.onVideoEnd)}onVideoRestart(){null!==this.recommendedMedia&&(this.recommendedMedia.updateDisplayType("inline"),this.props.inEmbed&&this.playerInstance.player.one("pause",this.recommendedMedia.init),this.playerInstance.player.one("ended",this.onVideoEnd))}onVideoEnd(){if(null!==this.recommendedMedia&&(this.props.inEmbed||this.initRecommendedMedia(),this.recommendedMedia.updateDisplayType("full"),this.playerInstance.player.one("playing",this.onVideoRestart)),!this.props.inEmbed&&l.MediaPageStore.get("playlist-id")){const e=document.querySelector(".video-player .more-media"),t=document.querySelector(".video-player .vjs-actions-anim");this.upNextLoaderView.cancelTimer();const n=l.MediaPageStore.get("playlist-next-media-url");return n&&(e&&(e.style.display="none"),t&&(t.style.display="none"),window.location.href=n),void this.upNextLoaderView.hideTimerView()}this.upNextLoaderView&&(l.PageStore.get("media-auto-play")?(this.upNextLoaderView.startTimer(),this.playerInstance.player.one("play",function(){this.upNextLoaderView.cancelTimer()}.bind(this))):this.upNextLoaderView.cancelTimer())}onUpdateMediaAutoPlay(){this.upNextLoaderView&&(l.PageStore.get("media-auto-play")?this.upNextLoaderView.showTimerView(this.playerInstance.isEnded()):this.upNextLoaderView.hideTimerView())}render(){let e=null,t=null;!this.props.inEmbed&&l.MediaPageStore.get("playlist-id")?(e=l.MediaPageStore.get("playlist-next-media-url"),t=l.MediaPageStore.get("playlist-previous-media-url")):e=this.props.data.related_media.length&&!this.props.inEmbed?this.props.data.related_media[0].url:null;const n=this.props.data.sprites_url?{url:this.props.siteUrl+"/"+this.props.data.sprites_url.replace(/^\//g,""),frame:{width:160,height:90,seconds:10}}:null;return i.createElement(i.Fragment,null,i.createElement("div",{key:(this.props.inEmbed?"embed-":"")+"player-container",className:"player-container"+(this.videoSources.length?"":" player-container-error"),style:this.props.containerStyles,ref:"playerContainer"},i.createElement("div",{className:"player-container-inner",ref:"playerContainerInner",style:this.props.containerStyles},this.state.displayPlayer&&null==l.MediaPageStore.get("media-load-error-type")?i.createElement("div",{className:"video-player",ref:"videoJSPlayerWrapper",key:"videoJSPlayerWrapper"},i.createElement(s.SiteConsumer,null,a=>i.createElement(p.A,{nextLink:e,data:this.props.data,playerVolume:this.browserCache.get("player-volume"),playerSoundMuted:this.browserCache.get("player-sound-muted"),videoQuality:this.browserCache.get("video-quality"),videoPlaybackSpeed:parseInt(this.browserCache.get("video-playback-speed"),10),inTheaterMode:this.browserCache.get("in-theater-mode"),siteId:a.id,siteUrl:a.url,info:this.videoInfo,cornerLayers:this.cornerLayers,sources:this.videoSources,poster:this.videoPoster,previewSprite:n,subtitlesInfo:this.props.data.subtitles_info,enableAutoplay:!this.props.inEmbed,inEmbed:this.props.inEmbed,hasTheaterMode:!this.props.inEmbed,hasNextLink:!!e,hasPreviousLink:!!t,errorMessage:l.MediaPageStore.get("media-load-error-message"),onClickNextCallback:this.onClickNext,onClickPreviousCallback:this.onClickPrevious,onStateUpdateCallback:this.onStateUpdate,onPlayerInitCallback:this.onPlayerInit}))):null)))}}function f(e){let t=null,n=[];var i=location.search.substr(1).split("&");for(let a=0;a{const n=document.querySelector(".video-js.vjs-mediacms");if(n){const e=n.querySelector("video");e&&(function(e){if(!e||!e.tagName||"video"!==e.tagName.toLowerCase())return void m.error("Invalid video element:",e);const t=videojs(e);t.playsinline(!0),t.on("loadedmetadata",function(){const e=parseInt(f("muted")),n=parseInt(f("autoplay")),i=parseInt(f("t"));document.addEventListener("click",function(e){if(e.target.classList.contains("video-timestamp")){e.preventDefault();const n=parseInt(e.target.dataset.timestamp,10);n>=0&&n=0&&t.play()}}),1==e&&t.muted(!0),i>=0&&i=0&&i>=t.duration()&&t.play(),1===n&&t.play()})}(e),t.disconnect())}}).observe(document,{childList:!0,subtree:!0})},8790:function(e,t,n){var i=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var a=Object.getOwnPropertyDescriptor(t,n);a&&!("get"in a?!t.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,a)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),a=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||i(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),a(n(9781),t),a(n(3537),t),a(n(5320),t),a(n(2401),t),a(n(3496),t),a(n(9423),t),a(n(2579),t),a(n(9854),t),a(n(8899),t),a(n(5886),t),a(n(5465),t),a(n(4463),t)},8899:function(e,t,n){n.r(t),n.d(t,{SiteConsumer:function(){return o},SiteContext:function(){return r}});var i=n(9471),a=n(3997);const r=(0,i.createContext)((0,a.$)(window.MediaCMS).site),o=r.Consumer;t.default=r},9237:function(e,t,n){var i=n(9471);const a=({data:e,playerVolume:t,playerSoundMuted:n,videoQuality:a,videoPlaybackSpeed:r,inTheaterMode:o,siteId:s,siteUrl:l,info:d,cornerLayers:c,sources:u,poster:p,previewSprite:m,subtitlesInfo:h,enableAutoplay:f,inEmbed:v,hasTheaterMode:g,hasNextLink:b,hasPreviousLink:y,errorMessage:w,onClickNextCallback:P,onClickPreviousCallback:S,onStateUpdateCallback:k,onPlayerInitCallback:_})=>{const E=(0,i.useRef)(null),M=(0,i.useRef)(!1);(0,i.useEffect)(()=>{"undefined"!=typeof window&&(window.MEDIA_DATA={data:e||{},playerVolume:t||.5,playerSoundMuted:n||!1,videoQuality:a||"auto",videoPlaybackSpeed:r||1,inTheaterMode:o||!1,siteId:s||"",siteUrl:l||"",info:d||{},cornerLayers:c||[],sources:u||[],poster:p||"",previewSprite:m||null,subtitlesInfo:h||[],enableAutoplay:f||!1,inEmbed:v||!1,hasTheaterMode:g||!1,hasNextLink:b||!1,hasPreviousLink:y||!1,errorMessage:w||"",onClickNextCallback:P||null,onClickPreviousCallback:S||null,onStateUpdateCallback:k||null,onPlayerInitCallback:_||null}),M.current||(C(),M.current=!0)},[e,l]);const C=()=>{const e=document.querySelector('link[href*="video-js.css"]'),t=document.querySelector('script[src*="video-js.js"]');if(!e){const e=document.createElement("link");e.rel="stylesheet",e.href=l+"/static/video_js/video-js.css",document.head.appendChild(e)}if(!t){const e=document.createElement("script");e.src=l+"/static/video_js/video-js.js",document.head.appendChild(e)}};return i.createElement("div",{className:"video-js-wrapper",ref:E},i.createElement("div",{id:"video-js-root"}))};a.defaultProps={data:{},siteUrl:""},t.A=a},9942:function(e,t,n){var i,a=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var a=Object.getOwnPropertyDescriptor(t,n);a&&!("get"in a?!t.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,a)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||(i=function(e){return i=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t},i(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n=i(e),o=0;o=r)&&Object.keys(i.O).every(function(e){return i.O[e](n[l])})?n.splice(l--,1):(s=!1,r0&&e[c-1][2]>r;c--)e[c]=e[c-1];e[c]=[n,a,r]},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,{a:t}),t},i.d=function(e,t){for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.j=722,function(){var e={722:0};i.O.j=function(t){return 0===e[t]};var t=function(t,n){var a,r,o=n[0],s=n[1],l=n[2],d=0;if(o.some(function(t){return 0!==e[t]})){for(a in s)i.o(s,a)&&(i.m[a]=s[a]);if(l)var c=l(i)}for(t&&t(n);d);`),t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError),t.transitionCallbacks!==void 0&&t.transitionCallbacks);var o=c0(e,Ps,null,n,a,r,i);Us(o.current,e);var l=e.nodeType===vn?e.parentNode:e;return ql(l),new sm(o)}function Gc(e){this._internalRoot=e}function ZD(e){e&&vE(e)}Gc.prototype.unstable_scheduleHydration=ZD;function JD(e,t,n){if(!Xc(e))throw new Error("hydrateRoot(...): Target container is not a DOM element.");O0(e),t===void 0&&d("Must provide initial children as second argument to hydrateRoot. Example usage: hydrateRoot(domContainer, )");var a=n??null,r=n!=null&&n.hydratedSources||null,i=!1,o=!1,l="",u=L0;n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(l=n.identifierPrefix),n.onRecoverableError!==void 0&&(u=n.onRecoverableError));var f=f0(t,null,e,Ps,a,i,o,l,u);if(Us(f.current,e),ql(e),r)for(var v=0;v2&&arguments[2]!==void 0?arguments[2]:null;if(!Xc(t))throw new Error("Target container is not a DOM element.");return VD(e,t,null,n)}function s_(e,t,n,a){return o_(e,t,n,a)}var fm={usingClientEntryPoint:!1,Events:[ei,Oo,Hs,qm,Gm,Bp]};function c_(e,t){return fm.usingClientEntryPoint||d('You are importing createRoot from "react-dom" which is not supported. You should instead import it from "react-dom/client".'),KD(e,t)}function f_(e,t,n){return fm.usingClientEntryPoint||d('You are importing hydrateRoot from "react-dom" which is not supported. You should instead import it from "react-dom/client".'),JD(e,t,n)}function d_(e){return Pb()&&d("flushSync was called from inside a lifecycle method. React cannot flush when React is already rendering. Consider moving this call to a scheduler task or micro task."),Ur(e)}var v_=QD({findFiberByHostInstance:Fi,bundleType:1,version:rm,rendererPackageName:"react-dom"});if(!v_&&rn&&window.top===window.self&&(navigator.userAgent.indexOf("Chrome")>-1&&navigator.userAgent.indexOf("Edge")===-1||navigator.userAgent.indexOf("Firefox")>-1)){var H0=window.location.protocol;/^(https?|file):$/.test(H0)&&console.info("%cDownload the React DevTools for a better development experience: https://reactjs.org/link/react-devtools"+(H0==="file:"?` -You might need to use a local HTTP server (instead of file://): https://reactjs.org/link/react-devtools-faq`:""),"font-weight:bold")}ra.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=fm,ra.createPortal=u_,ra.createRoot=c_,ra.findDOMNode=a_,ra.flushSync=d_,ra.hydrate=r_,ra.hydrateRoot=f_,ra.render=i_,ra.unmountComponentAtNode=l_,ra.unstable_batchedUpdates=Bp,ra.unstable_renderSubtreeIntoContainer=s_,ra.version=rm,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}(),ra}hm.exports=$0();var P0=hm.exports,Sm,Tm=P0;{var Em=Tm.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;Sm=function(w,L){Em.usingClientEntryPoint=!0;try{return Tm.createRoot(w,L)}finally{Em.usingClientEntryPoint=!1}}}const $=w=>{if(isNaN(w))return"00:00:00.000";const L=Math.floor(w/3600),me=Math.floor(w%3600/60),Ee=Math.floor(w%60),fe=Math.round(w%1*1e3),Re=String(L).padStart(2,"0"),d=String(me).padStart(2,"0"),Q=String(Ee).padStart(2,"0"),he=String(fe).padStart(3,"0");return`${Re}:${d}:${Q}.${he}`},hi=w=>$(w),Y0=w=>$(w),re={debug:(...w)=>{},error:(...w)=>console.error(...w),warn:(...w)=>console.warn(...w),info:(...w)=>console.info(...w)};var ee=Zc();const W0=({videoRef:w,currentTime:L,duration:me,isPlaying:Ee,isMuted:fe=!1,onPlayPause:Re,onSeek:d,onToggleMute:Q})=>{var le;const he=ee.useRef(null),[te,bt]=ee.useState(!1),[I,H]=ee.useState(!1),[K,Oe]=ee.useState(null),[zt,qt]=ee.useState(!1),St=ee.useRef(!1),[Pe,_e]=ee.useState({x:0}),[ot,_]=ee.useState(0),ne=typeof window<"u"&&((le=window.MEDIA_DATA)==null?void 0:le.videoUrl)||"/videos/sample-video-10m.mp4";ee.useEffect(()=>{if(bt((()=>{const q=navigator.userAgent||navigator.vendor||window.opera;return/iPad|iPhone|iPod/.test(q)&&!window.MSStream})()),typeof window<"u"){const q=localStorage.getItem("video_initialized")==="true";H(q)}},[]),ee.useEffect(()=>{Ee&&!I&&(H(!0),typeof window<"u"&&localStorage.setItem("video_initialized","true"))},[Ee,I]),ee.useEffect(()=>{const W=w.current;if(!W)return;W.setAttribute("playsinline","true"),W.setAttribute("webkit-playsinline","true"),W.setAttribute("x-webkit-airplay","allow");const q=()=>{St.current||(Oe(W.currentTime),typeof window<"u"&&(window.lastSeekedPosition=W.currentTime))},Ye=()=>{te&&(H(!0),localStorage.setItem("video_initialized","true"))},Fe=()=>{};return W.addEventListener("timeupdate",q),W.addEventListener("play",Ye),W.addEventListener("pause",Fe),()=>{W.removeEventListener("timeupdate",q),W.removeEventListener("play",Ye),W.removeEventListener("pause",Fe)}},[w,te,St]),ee.useEffect(()=>{Oe(L)},[L]);const De=me>0?L/me*100:0,Vt=W=>{W.preventDefault(),qt(!0),St.current=!0,Me(W);const q=Fe=>{St.current&&Me(Fe)},Ye=()=>{qt(!1),St.current=!1,document.removeEventListener("mousemove",q),document.removeEventListener("mouseup",Ye)};document.addEventListener("mousemove",q),document.addEventListener("mouseup",Ye)},Me=W=>{if(!he.current)return;const q=he.current.getBoundingClientRect(),Ye=Math.max(0,Math.min(1,(W.clientX-q.left)/q.width)),Fe=me*Ye;_e({x:W.clientX}),_(Fe),Oe(Fe),typeof window<"u"&&(window.lastSeekedPosition=Fe),d(Fe)},pe=W=>{if(!he.current||!W.touches[0])return;W.preventDefault(),qt(!0),St.current=!0,nt(W);const q=Fe=>{St.current&&nt(Fe)},Ye=()=>{qt(!1),St.current=!1,document.removeEventListener("touchmove",q),document.removeEventListener("touchend",Ye),document.removeEventListener("touchcancel",Ye)};document.addEventListener("touchmove",q,{passive:!1}),document.addEventListener("touchend",Ye),document.addEventListener("touchcancel",Ye)},nt=W=>{if(!he.current)return;const q="touches"in W?W.touches[0]:null;if(!q)return;W.preventDefault();const Ye=he.current.getBoundingClientRect(),Fe=Math.max(0,Math.min(1,(q.clientX-Ye.left)/Ye.width)),at=me*Fe;_e({x:q.clientX}),_(at),Oe(at),typeof window<"u"&&(window.lastSeekedPosition=at),d(at)},oe=W=>{if(!zt&&he.current){const q=he.current.getBoundingClientRect(),Ye=(W.clientX-q.left)/q.width,Fe=me*Ye;Oe(Fe),typeof window<"u"&&(window.lastSeekedPosition=Fe),d(Fe)}},Le=()=>{w.current&&(document.fullscreenElement?document.exitFullscreen():w.current.requestFullscreen())},Ke=()=>{const W=w.current;W&&(W.paused?te&&K!==null&&K>0?(W.currentTime=K,setTimeout(()=>{w.current&&w.current.play().then(()=>{var q;re.debug("iOS: Play started successfully at position:",(q=w.current)==null?void 0:q.currentTime),Re()}).catch(q=>{console.error("iOS: Error playing video:",q)})},50)):W.play().then(()=>{Re()}).catch(q=>{console.error("Error playing video:",q)}):(W.pause(),Re()))};return p.jsxs("div",{className:"video-player-container",children:[p.jsxs("video",{ref:w,preload:"auto",crossOrigin:"anonymous",onClick:Ke,playsInline:!0,"webkit-playsinline":"true","x-webkit-airplay":"allow",controls:!1,muted:fe,children:[p.jsx("source",{src:ne,type:"video/mp4"}),p.jsx("p",{children:"Your browser doesn't support HTML5 video."})]}),te&&!I&&!Ee&&p.jsx("div",{className:"ios-first-play-indicator",children:p.jsx("div",{className:"ios-play-message",children:"Tap Play to initialize video controls"})}),p.jsx("div",{className:`play-pause-indicator ${Ee?"pause-icon":"play-icon"}`}),p.jsxs("div",{className:"video-controls",children:[p.jsxs("div",{className:"video-time-display",children:[p.jsx("span",{className:"video-current-time",children:hi(L)}),p.jsxs("span",{className:"video-duration",children:["/ ",hi(me)]})]}),p.jsxs("div",{ref:he,className:`video-progress ${zt?"dragging":""}`,onClick:oe,onMouseDown:Vt,onTouchStart:pe,children:[p.jsx("div",{className:"video-progress-fill",style:{width:`${De}%`}}),p.jsx("div",{className:"video-scrubber",style:{left:`${De}%`}}),zt&&p.jsx("div",{className:"video-time-tooltip",style:{left:`${Pe.x}px`,transform:"translateX(-50%)"},children:$(ot)})]}),p.jsxs("div",{className:"video-controls-buttons",children:[Q&&p.jsx("button",{className:"mute-button","aria-label":fe?"Unmute":"Mute",onClick:Q,"data-tooltip":fe?"Unmute":"Mute",children:fe?p.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[p.jsx("line",{x1:"1",y1:"1",x2:"23",y2:"23"}),p.jsx("path",{d:"M9 9v3a3 3 0 0 0 5.12 2.12M15 9.34V4a3 3 0 0 0-5.94-.6"}),p.jsx("path",{d:"M17 16.95A7 7 0 0 1 5 12v-2m14 0v2a7 7 0 0 1-.11 1.23"}),p.jsx("line",{x1:"12",y1:"19",x2:"12",y2:"23"}),p.jsx("line",{x1:"8",y1:"23",x2:"16",y2:"23"})]}):p.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[p.jsx("polygon",{points:"11 5 6 9 2 9 2 15 6 15 11 19 11 5"}),p.jsx("path",{d:"M19.07 4.93a10 10 0 0 1 0 14.14M15.54 8.46a5 5 0 0 1 0 7.07"})]})}),p.jsx("button",{className:"fullscreen-button","aria-label":"Fullscreen",onClick:Le,"data-tooltip":"Toggle fullscreen",children:p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",children:p.jsx("path",{fillRule:"evenodd",d:"M3 4a1 1 0 011-1h4a1 1 0 010 2H6.414l2.293 2.293a1 1 0 01-1.414 1.414L5 6.414V8a1 1 0 01-2 0V4zm9 1a1 1 0 010-2h4a1 1 0 011 1v4a1 1 0 01-2 0V6.414l-2.293 2.293a1 1 0 11-1.414-1.414L13.586 5H12zm-9 7a1 1 0 012 0v1.586l2.293-2.293a1 1 0 011.414 1.414L6.414 15H8a1 1 0 010 2H4a1 1 0 01-1-1v-4zm13-1a1 1 0 011 1v4a1 1 0 01-1 1h-4a1 1 0 010-2h1.586l-2.293-2.293a1 1 0 011.414-1.414L15 13.586V12a1 1 0 011-1z",clipRule:"evenodd"})})})]})]})]})},tf=(w,L)=>{const me=Math.min(Math.max(w/(L||1),0),1),Ee=210,fe=40+Math.floor(me*20),Re=85+Math.floor(me*8);return`hsl(${Ee}, ${fe}%, ${Re}%)`},Cm=async(w,L)=>new Promise(me=>{const Ee=document.createElement("canvas");Ee.width=10,Ee.height=10;const fe=Ee.getContext("2d");if(fe){const d=tf(L,w.duration);fe.fillStyle=d,fe.fillRect(0,0,Ee.width,Ee.height)}const Re=Ee.toDataURL("image/png",.5);me(Re)}),to=({isOpen:w,onClose:L,title:me,children:Ee,actions:fe})=>{if(ee.useEffect(()=>{const d=Q=>{Q.key==="Escape"&&w&&L()};return document.addEventListener("keydown",d),w&&(document.body.style.overflow="hidden"),()=>{document.removeEventListener("keydown",d),document.body.style.overflow=""}},[w,L]),!w)return null;const Re=d=>{d.target===d.currentTarget&&L()};return p.jsx("div",{className:"modal-overlay",onClick:Re,children:p.jsxs("div",{className:"modal-container",onClick:d=>d.stopPropagation(),children:[p.jsxs("div",{className:"modal-header",children:[p.jsx("h2",{className:"modal-title",children:me}),p.jsx("button",{className:"modal-close-button",onClick:L,"aria-label":"Close modal",children:p.jsxs("svg",{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",children:[p.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),p.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),p.jsx("div",{className:"modal-content",children:Ee}),fe&&p.jsx("div",{className:"modal-actions",children:fe})]})})},xm=w=>new Promise(L=>setTimeout(L,w)),nf=async(w,L)=>{try{const me=await fetch(`/api/v1/media/${w}/trim_video`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(L)});if(!me.ok)if(me.status===400)try{return{status:400,error:(await me.json()).error||"An error occurred during processing",msg:"Video Processing Error",url_redirect:""}}catch{return{status:400,error:"An error occurred during video processing",msg:"Video Processing Error",url_redirect:""}}else if(me.status!==404)try{const fe=await me.json();return{status:me.status,error:fe.error||"An error occurred during processing",msg:"Video Processing Error",url_redirect:""}}catch{return{status:me.status,error:"An error occurred during video processing",msg:"Video Processing Error",url_redirect:""}}else return await xm(1500),{status:200,msg:"Video Processed Successfully",url_redirect:`./view?m=${w}`};const Ee=await me.json();return{status:200,msg:"Video Processed Successfully",url_redirect:Ee.url_redirect||`./view?m=${w}`,...Ee}}catch{return await xm(1500),{status:200,msg:"Video Processed Successfully",url_redirect:`./view?m=${w}`}}},wm="data:image/svg+xml,%3c?xml%20version='1.0'%20?%3e%3csvg%20style='enable-background:new%200%200%20512%20512;'%20version='1.1'%20viewBox='0%200%20512%20512'%20xml:space='preserve'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cstyle%20type='text/css'%3e%20.st0{fill:%23333333;}%20.st1{fill:none;stroke:%23333333;stroke-width:32;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;}%20%3c/style%3e%3cg%20id='Layer_1'/%3e%3cg%20id='Layer_2'%3e%3cg%3e%3cpath%20class='st0'%20d='M350.45,277.5l-164.08,94.73c-16.55,9.56-37.24-2.39-37.24-21.5V161.27c0-19.11,20.69-31.06,37.24-21.5%20l164.08,94.73C367,244.06,367,267.94,350.45,277.5z'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e",Rm="data:image/svg+xml,%3c?xml%20version='1.0'%20?%3e%3csvg%20style='enable-background:new%200%200%20512%20512;'%20version='1.1'%20viewBox='0%200%20512%20512'%20xml:space='preserve'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cstyle%20type='text/css'%3e.st0{fill:%23333333;}.st1{fill:none;stroke:%23333333;stroke-width:32;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;}%3c/style%3e%3cg%20id='Layer_1'/%3e%3cg%20id='Layer_2'%3e%3cg%3e%3cg%3e%3cpath%20class='st0'%20d='M208.15,380.19h-91.19c-5.7,0-10.32-4.62-10.32-10.32V142.13c0-5.7,4.62-10.32,10.32-10.32h91.19%20c5.7,0,10.32,4.62,10.32,10.32v227.74C218.47,375.57,213.85,380.19,208.15,380.19z'/%3e%3c/g%3e%3cg%3e%3cpath%20class='st0'%20d='M395.04,380.19h-91.19c-5.7,0-10.32-4.62-10.32-10.32V142.13c0-5.7,4.62-10.32,10.32-10.32h91.19%20c5.7,0,10.32,4.62,10.32,10.32v227.74C405.36,375.57,400.74,380.19,395.04,380.19z'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e",Dm="data:image/svg+xml,%3c?xml%20version='1.0'%20?%3e%3csvg%20style='enable-background:new%200%200%20512%20512;'%20version='1.1'%20viewBox='0%200%20512%20512'%20xml:space='preserve'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cstyle%20type='text/css'%3e.st0{fill:%23333333;}.st1{fill:none;stroke:%23333333;stroke-width:32;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;}%3c/style%3e%3cg%20id='Layer_1'/%3e%3cg%20id='Layer_2'%3e%3cg%3e%3cg%3e%3cpath%20class='st0'%20d='M85.26,277.5l164.08,94.73c16.55,9.56,37.24-2.39,37.24-21.5V161.27c0-19.11-20.69-31.06-37.24-21.5%20L85.26,234.5C68.71,244.06,68.71,267.94,85.26,277.5z'/%3e%3c/g%3e%3cg%3e%3cpath%20class='st0'%20d='M377.47,375.59h41.42c11.19,0,20.26-9.07,20.26-20.26V156.67c0-11.19-9.07-20.26-20.26-20.26h-41.42%20c-11.19,0-20.26,9.07-20.26,20.26v198.67C357.21,366.52,366.28,375.59,377.47,375.59z'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e",I0="data:image/svg+xml,%3c?xml%20version='1.0'%20?%3e%3csvg%20height='32'%20viewBox='0%200%2032%2032'%20width='32'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle/%3e%3cg%20data-name='1'%20id='_1'%3e%3cpath%20d='M27,3V29a1,1,0,0,1-1,1H6a1,1,0,0,1-1-1V27H7v1H25V4H7V7H5V3A1,1,0,0,1,6,2H26A1,1,0,0,1,27,3Z'/%3e%3cg%20transform='translate(2,%200)'%3e%3cpath%20d='M10.71,20.29,7.41,17H18V15H7.41l3.3-3.29L9.29,10.29l-5,5a1,1,0,0,0,0,1.42l5,5Z'%20id='logout_account_exit_door'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e",q0="data:image/svg+xml,%3c?xml%20version='1.0'%20?%3e%3csvg%20height='32'%20viewBox='0%200%2032%2032'%20width='32'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20data-name='1'%20id='_1'%3e%3cpath%20d='M5,3V29a1,1,0,0,0,1,1H26a1,1,0,0,0,1-1V25H25v3H7V4H25V7h2V3a1,1,0,0,0-1-1H6A1,1,0,0,0,5,3Z'/%3e%3cg%20transform='translate(28,%200)%20scale(-1,%201)'%3e%3cpath%20d='M10.71,20.29,7.41,17H18V15H7.41l3.3-3.29L9.29,10.29l-5,5a1,1,0,0,0,0,1.42l5,5Z'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e",G0="data:image/svg+xml,%3c?xml%20version='1.0'%20?%3e%3csvg%20height='32'%20viewBox='0%200%2032%2032'%20width='32'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20data-name='1'%20id='_1'%3e%3cpath%20d='M5,3V29a1,1,0,0,0,1,1H26a1,1,0,0,0,1-1V25H25v3H7V4H25V7h2V3a1,1,0,0,0-1-1H6A1,1,0,0,0,5,3Z'/%3e%3cg%20transform='translate(30,%200)%20scale(-1,%201)'%3e%3cpath%20d='M10.71,20.29,7.41,17H18V15H7.41l3.3-3.29L9.29,10.29l-5,5a1,1,0,0,0,0,1.42l5,5Z'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e",X0="data:image/svg+xml,%3c?xml%20version='1.0'%20?%3e%3csvg%20height='32'%20viewBox='0%200%2032%2032'%20width='32'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle/%3e%3cg%20data-name='1'%20id='_1'%3e%3cpath%20d='M27,3V29a1,1,0,0,1-1,1H6a1,1,0,0,1-1-1V27H7v1H25V4H7V7H5V3A1,1,0,0,1,6,2H26A1,1,0,0,1,27,3Z'/%3e%3cg%20transform='translate(2,%200)'%3e%3cpath%20d='M10.71,20.29,7.41,17H18V15H7.41l3.3-3.29L9.29,10.29l-5,5a1,1,0,0,0,0,1.42l5,5Z'%20id='logout_account_exit_door'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e",Q0={color:"#007bff",textDecoration:"none",fontWeight:"bold","&:hover":{textDecoration:"underline",color:"#0056b3"}},_m=w=>{let Re,d;if(w<=25)if(w<=0)Re="0%",d="none";else{const he=-50*((w-0)/25);Re=`${w}%`,d=`translateX(${he}%)`}else if(w>=75)if(w>=100)Re="100%",d="translateX(-100%)";else{const he=-50-50*((w-75)/25);Re=`${w}%`,d=`translateX(${he}%)`}else Re=`${w}%`,d="translateX(-50%)";return{left:Re,transform:d}},K0=({currentTime:w,duration:L,thumbnails:me,trimStart:Ee,trimEnd:fe,splitPoints:Re,zoomLevel:d,clipSegments:Q,onTrimStartChange:he,onTrimEndChange:te,onZoomChange:bt,onSeek:I,videoRef:H,onSave:K,onSaveACopy:Oe,onSaveSegments:zt,hasUnsavedChanges:qt=!1,isIOSUninitialized:St=!1,isPlaying:Pe,setIsPlaying:_e,onPlayPause:ot,isPlayingSegments:_=!1})=>{const ne=ee.useRef(null),De=ee.useRef(null),Vt=ee.useRef(null),[Me,pe]=ee.useState(null),[nt,oe]=ee.useState(!1),[Le,Ke]=ee.useState({x:0,y:0}),[le,W]=ee.useState(0),[q,Ye]=ee.useState(!1),[Fe,at]=ee.useState(30),[ct,We]=ee.useState(!1),[Ve,Ue]=ee.useState(null),[cn,et]=ee.useState(0),[Ht,gt]=ee.useState(!1),Qe=ee.useRef(null),Gt=h=>{const B=h;let D=null,T=null,x=le;const O=()=>{const c=B<0?Math.max(0,x+B):Math.min(L,x+B);x=c;const y=ct;if(I(c),W(c),et(c),ne.current){const S=ne.current.getBoundingClientRect(),A=c/L*100,ve=S.left+S.width*(A/100);Ke({x:ve,y:S.top-10});const z=Q.find(ue=>c>=ue.startTime&&c<=ue.endTime);if(z)pe(z.id),oe(!1);else{pe(null);const ue=Tt(c);at(ue),oe(!0)}}y&&H.current&&(H.current.play(),We(!0))};return{onMouseDown:c=>{c.stopPropagation(),c.preventDefault(),x=le,O(),D=setTimeout(()=>{T=setInterval(O,200)},750);const y=()=>{D&&(clearTimeout(D),D=null),T&&(clearInterval(T),T=null),document.removeEventListener("mouseup",y),document.removeEventListener("mouseleave",y)};document.addEventListener("mouseup",y),document.addEventListener("mouseleave",y)},onTouchStart:c=>{c.stopPropagation(),c.preventDefault(),x=le,O(),D=setTimeout(()=>{T=setInterval(O,200)},750);const y=()=>{D&&(clearTimeout(D),D=null),T&&(clearInterval(T),T=null),document.removeEventListener("touchend",y),document.removeEventListener("touchcancel",y)};document.addEventListener("touchend",y),document.addEventListener("touchcancel",y)},onClick:c=>{c.stopPropagation()}}},[rn,fn]=ee.useState(!1),[F,G]=ee.useState(!1),[Te,Ce]=ee.useState(!1),[Ze,st]=ee.useState(!1),[ht,Ge]=ee.useState(!1),[yt,rt]=ee.useState(!1),[tn,mn]=ee.useState(""),[Ot,Lt]=ee.useState(""),[hn,ia]=ee.useState(""),[va,Z]=ee.useState("save"),xe=L>0?w/L*100:0,Je=L>0?Ee/L*100:0,Rt=L>0?fe/L*100:0,Bt=async()=>{var h,B;fn(!1),st(!0),Z("save");try{const D=Q.map(c=>({startTime:$(c.startTime),endTime:$(c.endTime)})),T=typeof window<"u"&&((h=window.MEDIA_DATA)==null?void 0:h.mediaId)||null,x=typeof window<"u"&&((B=window.MEDIA_DATA)==null?void 0:B.redirectURL)||null;re.debug("Save request:",{mediaId:T,segments:D,saveAsCopy:!1,redirectURL:x});const O=await nf(T,{segments:D,saveAsCopy:!1});if(re.debug("Save response:",O),st(!1),O.status===200){const c=x||O.url_redirect;re.debug("Using redirect URL:",c),ia(c),mn("Video saved successfully!"),Ge(!0)}else if(O.status===400){const c=O.error||"An error occurred during processing";re.debug("Save error (400):",c),Lt(c),rt(!0)}else re.debug("Save error (unknown status):",O),Lt("An unexpected error occurred"),rt(!0)}catch(D){re.error("Error processing video:",D),st(!1);const T=D instanceof Error?D.message:"An error occurred during processing";Lt(T),rt(!0)}},Xt=async()=>{var h,B;G(!1),st(!0),Z("copy");try{const D=Q.map(c=>({startTime:$(c.startTime),endTime:$(c.endTime)})),T=typeof window<"u"&&((h=window.MEDIA_DATA)==null?void 0:h.mediaId)||null,x=typeof window<"u"&&((B=window.MEDIA_DATA)==null?void 0:B.redirectUserMediaURL)||null;re.debug("Save as copy request:",{mediaId:T,segments:D,saveAsCopy:!0,redirectUserMediaURL:x});const O=await nf(T,{segments:D,saveAsCopy:!0});if(re.debug("Save as copy response:",O),st(!1),O.status===200){const c=x||O.url_redirect;re.debug("Using redirect user media URL:",c),ia(c),mn("Video saved as a new copy!"),Ge(!0)}else if(O.status===400){const c=O.error||"An error occurred during processing";re.debug("Save as copy error (400):",c),Lt(c),rt(!0)}else re.debug("Save as copy error (unknown status):",O),Lt("An unexpected error occurred"),rt(!0)}catch(D){re.error("Error processing video:",D),st(!1);const T=D instanceof Error?D.message:"An error occurred during processing";Lt(T),rt(!0)}},Qt=async()=>{var h,B;Ce(!1),st(!0),Z("segments");try{const D=Q.map(c=>({startTime:$(c.startTime),endTime:$(c.endTime),name:c.name})),T=typeof window<"u"&&((h=window.MEDIA_DATA)==null?void 0:h.mediaId)||null,x=typeof window<"u"&&((B=window.MEDIA_DATA)==null?void 0:B.redirectUserMediaURL)||null;re.debug("Save segments request:",{mediaId:T,segments:D,saveAsCopy:!0,saveIndividualSegments:!0,redirectUserMediaURL:x});const O=await nf(T,{segments:D,saveAsCopy:!0,saveIndividualSegments:!0});if(re.debug("Save segments response:",O),st(!1),O.status===200){const c=x||O.url_redirect;re.debug("Using redirect user media URL for segments:",c),ia(c),mn(`${D.length} segments saved successfully!`),Ge(!0)}else if(O.status===400){const c=O.error||"An error occurred during processing";re.debug("Save segments error (400):",c),Lt(c),rt(!0)}else re.debug("Save segments error (unknown status):",O),Lt("An unexpected error occurred"),rt(!0)}catch(D){re.error("Error processing video segments:",D),st(!1);const T=D instanceof Error?D.message:"An error occurred during processing";Lt(T),rt(!0)}};ee.useEffect(()=>{if(Qe.current&&ne.current&&d>1){const h=Qe.current.clientWidth,B=ne.current.clientWidth,D=w/L*B,T=Math.max(0,D-h/2);Qe.current.scrollTo({left:T,behavior:"smooth"});const x=ne.current.getBoundingClientRect();Qe.current.getBoundingClientRect();const c=x.left-Qe.current.scrollLeft+xe/100*x.width;(Me!==null||nt)&&(Ke({x:c,y:x.top-10}),W(w))}},[w,d,L,Me,nt,xe]),ee.useEffect(()=>{const h=H.current;if(!h||!Ve||!ct||_)return;re.debug("Segment boundary check ACTIVATED for segment:",Ve.id,"Start:",$(Ve.startTime),"End:",$(Ve.endTime));const B=()=>{const D=Ve.endTime-h.currentTime;if(Math.round(D*10)%10===0&&re.debug("Segment playback - time remaining:",$(D),"Current:",$(h.currentTime),"End:",$(Ve.endTime),"ContinuePastBoundary:",Ht),h.currentTime>Ve.endTime){h.pause(),h.currentTime=Ve.endTime,We(!1),gt(!1),re.debug("Passed segment end - setting back to exact boundary:",$(Ve.endTime));return}if(Ve.endTime-h.currentTime<.05)if(Ht)re.debug("Continuing past segment boundary:",$(Ve.endTime)),h.currentTime>Ve.endTime&&(gt(!1),Ue(null),sessionStorage.removeItem("continuingPastSegment"));else{h.pause(),h.currentTime=Ve.endTime,We(!1),re.debug("Paused at segment end boundary:",$(Ve.endTime));const x=[...Q].sort((O,c)=>O.startTime-c.startTime).find(O=>O.startTime>Ve.endTime);x&&Math.abs(x.startTime-Ve.endTime)<.1&&(re.debug("Found adjacent next segment:",x.id),pe(x.id),Ue(x),et(x.startTime),W(x.startTime),h.currentTime=x.startTime)}};return h.addEventListener("timeupdate",B),()=>{h.removeEventListener("timeupdate",B)}},[Ve,ct,Ht,Q]),ee.useEffect(()=>{if(H.current)if(H.current.paused)H.current.paused&&ct&&(et(w),W(w),We(!1),re.debug("Video paused at:",$(w)));else{et(w),W(w),Me!==null&&We(!0);const h=Q.find(T=>w>=T.startTime&&w<=T.endTime),B=w/L*100;if(ne.current){const T=ne.current.offsetWidth,x=B/100*T;Ke({x,y:ne.current.getBoundingClientRect().top-10})}const D=sessionStorage.getItem("continuingPastSegment")==="true";if(h){const T=H.current,x=Ve&&Ve.id<0&&ct;if((Ve==null?void 0:Ve.id)!==h.id&&!x&&!D&&!Ht&&(re.debug(`Entered a new segment during playback: ${h.id}, setting as active`),Ue(h),pe(h.id),oe(!1),gt(!1),sessionStorage.removeItem("continuingPastSegment")),x&&T&&h){re.debug(`CUTAWAY BOUNDARY REACHED: Current position ${$(T.currentTime)} at segment ${h.id} - STOPPING at boundary ${$(h.startTime)}`),T.pause(),setTimeout(()=>{if(H.current){H.current.currentTime=h.startTime,I(h.startTime),et(h.startTime),W(h.startTime),gt(!1),pe(h.id),oe(!1);const c=()=>{H.current&&(H.current.currentTime=h.startTime,I(h.startTime),et(h.startTime),W(h.startTime),re.debug(`Position corrected to exact segment boundary: ${$(H.current.currentTime)} (target: ${$(h.startTime)})`))};setTimeout(c,10),setTimeout(c,20),setTimeout(c,50),setTimeout(c,100),setTimeout(c,200),H.current.addEventListener("seeked",c),H.current.addEventListener("canplay",c),H.current.addEventListener("waiting",c),setTimeout(()=>{H.current&&(H.current.removeEventListener("seeked",c),H.current.removeEventListener("canplay",c),H.current.removeEventListener("waiting",c))},300)}},10),We(!1),Ue(null);return}Ve===null&&ct===!0||D||x?(Me!==h.id||nt)&&(re.debug("Tooltip updated for segment during continued playback:",h.id,x?"(cutaway playback - keeping virtual segment)":""),pe(h.id),oe(!1),!x&&sessionStorage.getItem("lastSegmentId")!==h.id.toString()&&sessionStorage.removeItem("continuingPastSegment")):((Ve==null?void 0:Ve.id)!==h.id||nt)&&(re.debug("Playback moved into segment:",h.id),pe(h.id),Ue(h),oe(!1),sessionStorage.setItem("lastSegmentId",h.id.toString()))}else if(Ve!==null||!nt){pe(null),Ue(null);const T=Tt(w);at(T),T>=.5?oe(!0):oe(!1)}}},[w,ct,Ve,Me,Q]),ee.useEffect(()=>{const h=B=>{const D=B.target;q&&!D.closest(".zoom-dropdown-container")&&Ye(!1)};return document.addEventListener("mousedown",h),()=>{document.removeEventListener("mousedown",h)}},[q]),ee.useEffect(()=>()=>{},[Me,nt,ct]),ee.useEffect(()=>{const h=De.current,B=Vt.current,D=ne.current;if(!h||!B||!D)return;const T=x=>O=>{O.preventDefault();const c=D.getBoundingClientRect();let y=!0,S=x?Ee:fe;const A=ue=>new CustomEvent("trim-handle-event",{detail:{type:ue,isStart:x}});document.dispatchEvent(A("drag-start"));const ve=ue=>{if(!y)return;const ye=c.width,it=Math.max(0,Math.min(1,(ue.clientX-c.left)/ye))*L;typeof window<"u"&&(window.lastSeekedPosition=it),x?itEe&&(document.dispatchEvent(new CustomEvent("update-trim",{detail:{time:it,isStart:!1,recordHistory:!1}})),S=it)},z=()=>{y=!1,document.removeEventListener("mousemove",ve),document.removeEventListener("mouseup",z),x?document.dispatchEvent(new CustomEvent("update-trim",{detail:{time:S,isStart:!0,recordHistory:!0,action:"adjust_trim_start"}})):document.dispatchEvent(new CustomEvent("update-trim",{detail:{time:S,isStart:!1,recordHistory:!0,action:"adjust_trim_end"}})),document.dispatchEvent(A("drag-end"))};document.addEventListener("mousemove",ve),document.addEventListener("mouseup",z)};return h.addEventListener("mousedown",T(!0)),B.addEventListener("mousedown",T(!1)),()=>{h.removeEventListener("mousedown",T(!0)),B.removeEventListener("mousedown",T(!1))}},[L,Ee,fe,he,te]);const wn=()=>{const h=me.length||10;return Array.from({length:h}).map((B,D)=>{const T=L/h,x=D*T,O=x+T,c=(x+O)/2,y=tf(c,L);return p.jsx("div",{className:"timeline-thumbnail",style:{width:`${100/h}%`,backgroundColor:y}},D)})},Pt=()=>Re.map((h,B)=>{const D=h/L*100;return p.jsx("div",{className:"split-point",style:{left:`${D}%`}},B)}),Tt=h=>{const D=[...Q].sort((c,y)=>c.startTime-y.startTime),T=D.find(c=>c.startTime>h),x=[...D].reverse().find(c=>c.endTime{if(!ne.current)return;const B=Q.find(S=>{const A=h>=S.startTime&&h<=S.endTime,ve=Math.abs(h-S.startTime)<.001,z=Math.abs(h-S.endTime)<.001;return A||ve||z}),D=[...Q].sort((S,A)=>S.startTime-A.startTime),T=D.find(S=>S.startTime>h),x=[...D].reverse().find(S=>S.endTime1&&Qe.current?y=O.left-Qe.current.scrollLeft+O.width*(c/100):y=O.left+O.width*(c/100),Ke({x:y,y:O.top-10})},er=h=>{if(!ne.current||!Qe.current||St)return;const B=H.current&&!H.current.paused;gt(!1);const D=ne.current.getBoundingClientRect();let T;if(d>1){const c=Qe.current.scrollLeft,y=ne.current.clientWidth;T=(h.clientX-D.left+c)/y}else T=(h.clientX-D.left)/D.width;const x=T*L;re.debug("Timeline clicked at:",$(x),"distance from end:",$(L-x)),typeof window<"u"&&(window.lastSeekedPosition=x),I(x),W(x),et(x);const O=Q.find(c=>{const y=x>=c.startTime&&x<=c.endTime,S=Math.abs(x-c.startTime)<.01,A=Math.abs(x-c.endTime)<.01;return y||S||A});if(O&&Ue(O),H.current)if(_&&B){if(O){const y=[...Q].sort((S,A)=>S.startTime-A.startTime).findIndex(S=>S.id===O.id);if(y!==-1){const S=new CustomEvent("update-segment-index",{detail:{segmentIndex:y}});document.dispatchEvent(S),re.debug(`Segments playback mode: updating segment index to ${y} for timeline click in segment ${O.id}`)}}H.current.play().then(()=>{We(!0)}).catch(c=>{console.error("Error resuming segments playback:",c),We(!1)})}else B&&!_&&H.current.play().then(()=>{We(!0)}).catch(c=>{console.error("Error resuming playback:",c),We(!1)});if(h.target===ne.current||h.target.classList.contains("timeline-thumbnail"))if(O)pe(O.id),oe(!1);else{pe(null);const c=Tt(x);at(c);let y;if(d>1){const z=D.left-Qe.current.scrollLeft,ue=x/L;y=z+ue*D.width}else y=h.clientX;Ke({x:y,y:D.top-10}),oe(!0);const S=[...Q].sort((z,ue)=>z.startTime-ue.startTime),A=[...S].reverse().find(z=>z.endTimez.startTime>x);re.debug("Clicked in cutaway area:",{position:$(x),availableSpace:$(c),prevSegmentEnd:A?$(A.endTime):"none",nextSegmentStart:ve?$(ve.startTime):"none"})}},$n=(h,B)=>D=>{if(D.preventDefault(),D.stopPropagation(),!ne.current)return;ne.current.getBoundingClientRect().width;const x=Q.find(Zt=>Zt.id===h);if(!x)return;const O=x.startTime,c=x.endTime,y={...x};document.body.style.cursor="ew-resize";const S=document.createElement("div");S.style.position="fixed",S.style.top="0",S.style.left="0",S.style.width="100vw",S.style.height="100vh",S.style.zIndex="1000",S.style.cursor="ew-resize",document.body.appendChild(S);let A=!0,ve=O,z=c;document.dispatchEvent(new CustomEvent("segment-drag-start",{detail:{segmentId:h}}));const ue=Zt=>{if(!A||!ne.current)return;const Pn=ne.current.getBoundingClientRect(),be=Math.max(0,Math.min(1,(Zt-Pn.left)/Pn.width))*L,Rn=B?be:O,Ua=B?c:be;if(w>=Rn&&w<=Ua)pe(h),oe(!1);else{pe(null);const un=Tt(w);at(un),oe(!0)}const Ha=Q.filter(un=>un.id!==h);let ha=O,ya=c;if(B){ha=Math.min(be,c-.5);const _t=Ha.filter(oa=>oa.endTime<=O).sort((oa,hr)=>hr.endTime-oa.endTime)[0];_t&&ha<_t.endTime&&(ha=_t.endTime),_t&&Math.abs(ha-_t.endTime)<.3&&(ha=_t.endTime),ve=ha}else{ya=Math.max(be,O+.5);const _t=Ha.filter(oa=>oa.startTime>=c).sort((oa,hr)=>oa.startTime-hr.startTime)[0];_t&&ya>_t.startTime&&(ya=_t.startTime),_t&&Math.abs(ya-_t.startTime)<.3&&(ya=_t.startTime),z=ya}const $r=Q.map(un=>un.id===h?{...un,startTime:ha,endTime:ya}:un),yi=new CustomEvent("update-segments",{detail:{segments:$r,recordHistory:!1}});if(document.dispatchEvent(yi),Me===h&&H.current){const un=H.current.currentTime,_t=$r.find(za=>za.id===h);if(_t){const za=un>=_t.startTime&&un<=_t.endTime;re.debug(`During drag - playhead at ${$(un)} is ${za?"inside":"outside"} segment (${$(_t.startTime)} - ${$(_t.endTime)})`),!za&&ct&&(H.current.pause(),We(!1),Ue(null)),un<_t.startTime?(re.debug(`Adjusting display time to segment start: ${$(_t.startTime)}`),et(_t.startTime),W(_t.startTime)):un>_t.endTime&&(re.debug(`Adjusting display time to segment end: ${$(_t.endTime)}`),et(_t.endTime),W(_t.endTime))}}},ye=()=>{if(!A)return;A=!1,document.removeEventListener("mousemove",ze),document.removeEventListener("mouseup",it),document.removeEventListener("touchmove",Ft),document.removeEventListener("touchend",nn),document.removeEventListener("touchcancel",nn),document.body.style.cursor="",document.body.contains(S)&&document.body.removeChild(S);const Zt=Q.map(ft=>ft.id===h?{...ft,startTime:ve,endTime:z}:ft),Pn=B?"adjust_segment_start":"adjust_segment_end";if(document.dispatchEvent(new CustomEvent("update-segments",{detail:{segments:Zt,recordHistory:!0,action:Pn}})),Me===h&&H.current){const ft=H.current.currentTime,be=Zt.find(Rn=>Rn.id===h);if(be){const Rn=ft>=be.startTime&&ft<=be.endTime;re.debug(`Drag complete - playhead at ${$(ft)} is ${Rn?"inside":"outside"} segment (${$(be.startTime)} - ${$(be.endTime)})`);const Ua=ft>=y.startTime&&ft<=y.endTime;Rn?(!Ua&&Rn||Ua&&Rn&&(be.startTime!==y.startTime||be.endTime!==y.endTime))&&Ue(be):(ct&&(H.current.pause(),We(!1),Ue(null),gt(!1)),ftbe.endTime&&(re.debug(`Final adjustment - setting display time to segment end: ${$(be.endTime)}`),et(be.endTime),W(be.endTime)))}}},ze=Zt=>{ue(Zt.clientX)},it=()=>{ye()},Ft=Zt=>{Zt.touches.length>0&&(Zt.preventDefault(),ue(Zt.touches[0].clientX))},nn=()=>{ye()};document.addEventListener("mousemove",ze,{passive:!1}),document.addEventListener("mouseup",it),document.addEventListener("touchmove",Ft,{passive:!1}),document.addEventListener("touchend",nn),document.addEventListener("touchcancel",nn)},pa=h=>B=>{if(B.target.classList.contains("clip-segment-handle"))return;B.preventDefault(),B.stopPropagation(),gt(!1);const D=H.current&&!H.current.paused;pe(h);const T=Q.find(z=>z.id===h);if(!T)return;const O=B.currentTarget.getBoundingClientRect(),c=(B.clientX-O.left)/O.width,y=T.startTime+c*(T.endTime-T.startTime),S=Math.max(T.startTime,Math.min(T.endTime,y));if(W(S),et(S),H.current){const z=H.current.currentTime,ue=z>=T.startTime&&z<=T.endTime;re.debug(`Segment click - playhead at ${$(z)} is ${ue?"inside":"outside"} segment (${$(T.startTime)} - ${$(T.endTime)})`),ue||(Math.abs(z-T.startTime)ye.startTime-ze.startTime).findIndex(ye=>ye.id===h);if(ue!==-1){const ye=new CustomEvent("update-segment-index",{detail:{segmentIndex:ue}});document.dispatchEvent(ye)}H.current.play().then(()=>{We(!0)}).catch(ye=>{console.error("Error continuing segments playback after segment click:",ye)})}else D&&!_&&(Ue(T),gt(!1),H.current.play().then(()=>{We(!0)}).catch(z=>{console.error("Error resuming playback after segment click:",z)}));const A=B.clientX,ve=O.top-10;if(Ke({x:A,y:ve}),d>1&&ne.current&&Qe.current){ne.current.getBoundingClientRect();const z=ne.current.clientWidth,ue=Qe.current.clientWidth,ye=S/L*z,ze=Math.max(0,ye-ue/2);Qe.current.scrollTo({left:ze,behavior:"smooth"}),setTimeout(()=>{if(ne.current&&Qe.current){const it=ne.current.getBoundingClientRect(),nn=S/L*z-Qe.current.scrollLeft+it.left;Ke({x:nn,y:ve})}},300)}},tr=()=>Q.map((h,B)=>{const D=h.startTime/L*100,T=(h.endTime-h.startTime)/L*100,x=tf((h.startTime+h.endTime)/2,L);return p.jsxs("div",{className:`clip-segment ${Me===h.id?"selected":""}`,style:{left:`${D}%`,width:`${T}%`,backgroundColor:x,borderWidth:"2px",borderStyle:"solid",borderColor:"rgba(0, 0, 0, 0.5)"},onClick:pa(h.id),children:[p.jsxs("div",{className:"clip-segment-info",children:[p.jsxs("div",{className:"clip-segment-name",children:["Segment ",B+1]}),p.jsxs("div",{className:"clip-segment-time",children:[hi(h.startTime)," - ",hi(h.endTime)]}),p.jsxs("div",{className:"clip-segment-duration",children:["Duration: ",hi(h.endTime-h.startTime)]})]}),_?null:p.jsxs(p.Fragment,{children:[p.jsx("div",{className:"clip-segment-handle left",title:"Resize segment start",onMouseDown:O=>{O.stopPropagation(),$n(h.id,!0)(O)},onTouchStart:O=>{O.stopPropagation(),$n(h.id,!0)(O)}}),p.jsx("div",{className:"clip-segment-handle right",title:"Resize segment end",onMouseDown:O=>{O.stopPropagation(),$n(h.id,!1)(O)},onTouchStart:O=>{O.stopPropagation(),$n(h.id,!1)(O)}})]})]},h.id)});ee.useEffect(()=>{const h=B=>{const{segmentId:D}=B.detail;if(Q.filter(x=>x.id!==D).length===0){const x={id:Date.now(),name:"Full Video",startTime:0,endTime:L,thumbnail:""},O=new CustomEvent("update-segments",{detail:{segments:[x],recordHistory:!0,action:"create_full_video_segment"}});if(document.dispatchEvent(O),pe(x.id),oe(!1),W(w),et(w),Ue(x),ne.current){const c=ne.current.getBoundingClientRect(),y=w/L*100,S=c.left+c.width*(y/100);Ke({x:S,y:c.top-10}),re.debug("Created full video segment:",{id:x.id,duration:$(L),currentPosition:$(w)})}}else if(Me===D){if(!Q.find(c=>c.id===D))return;const O=Tt(w);if(pe(null),oe(!0),at(O),ne.current){const c=ne.current.getBoundingClientRect(),y=w/L*100,S=c.left+c.width*(y/100);Ke({x:S,y:c.top-10}),re.debug("Segment deleted, showing cutaway tooltip:",{position:$(w),availableSpace:$(O)})}}};return document.addEventListener("delete-segment",h),()=>{document.removeEventListener("delete-segment",h)}},[Me,Q,w,L,ne]),ee.useEffect(()=>{const h=H.current;if(!h)return;const B=()=>{if(!H.current)return;const T=H.current,x=T.currentTime;gt(!1);let O=L,c=null,y=null;c=Q.find(A=>{const ve=x>=A.startTime&&x<=A.endTime,z=Math.abs(x-A.startTime)<.001,ue=Math.abs(x-A.endTime)<.001;return ve||z||ue}),y=Q.filter(A=>{const ve=A.startTime>x,z=Math.abs(A.startTime-x)>.001;return ve&&z}).sort((A,ve)=>A.startTime-ve.startTime)[0],c?(O=c.endTime,Ue(c)):y&&(O=y.startTime);const S=()=>{if(!T)return;const A=T.currentTime;if(O-A<=.001||A>=O){T.pause();const z=()=>{T&&(T.currentTime=O,I(O),et(O),W(O),re.debug("Position verification:",{target:$(O),actual:$(T.currentTime),difference:Math.abs(T.currentTime-O).toFixed(3)}))};z(),setTimeout(z,10),setTimeout(z,20),setTimeout(z,50),c?(pe(c.id),oe(!1)):y?(pe(y.id),oe(!1),Ue(y)):(pe(null),oe(!0),Ue(null)),T.removeEventListener("timeupdate",S),_e(!1),We(!1),gt(!1);return}};T.addEventListener("timeupdate",S),T.play().then(()=>{_e(!0),We(!0),re.debug("Playback started:",{from:$(x),to:$(O),currentSegment:c?`Segment ${c.id}`:"None",nextSegment:y?`Segment ${y.id}`:"None"})}).catch(A=>{console.error("Error playing video:",A)})},D=()=>{We(!1)};return h.addEventListener("play",B),h.addEventListener("pause",D),()=>{h.removeEventListener("play",B),h.removeEventListener("pause",D)}},[Q,L,I]);const Fr=h=>{if(!ne.current)return;const B=ne.current.getBoundingClientRect(),T=(h.clientX-B.left)/B.width*L,x=Math.max(0,Math.min(L,T));typeof window<"u"&&(window.lastSeekedPosition=x)},[Vr,wa]=ee.useState(!1),ja=ee.useRef(!1),Br=h=>{if(St)return;h.stopPropagation(),h.preventDefault(),wa(!0),ja.current=!0,Dt(w);const B=T=>{if(!ne.current||!Qe.current)return;const x=ne.current.getBoundingClientRect();let O;if(d>1){const y=Qe.current.scrollLeft,S=ne.current.clientWidth;O=(T.clientX-x.left+y)/S}else O=(T.clientX-x.left)/x.width;O=Math.max(0,Math.min(1,O));const c=O*L;W(c),et(c),Dt(c),typeof window<"u"&&(window.lastSeekedPosition=c),I(c)},D=()=>{wa(!1),ja.current=!1,document.removeEventListener("mousemove",B),document.removeEventListener("mouseup",D)};document.addEventListener("mousemove",B),document.addEventListener("mouseup",D)},ma=h=>{if(St)return;h.stopPropagation(),h.preventDefault(),wa(!0),ja.current=!0,Dt(w);const B=T=>{if(!ne.current||!Qe.current||!T.touches[0])return;const x=ne.current.getBoundingClientRect();let O;if(d>1){const y=Qe.current.scrollLeft,S=ne.current.clientWidth;O=(T.touches[0].clientX-x.left+y)/S}else O=(T.touches[0].clientX-x.left)/x.width;O=Math.max(0,Math.min(1,O));const c=O*L;W(c),et(c),Dt(c),typeof window<"u"&&(window.lastSeekedPosition=c),I(c)},D=()=>{wa(!1),ja.current=!1,document.removeEventListener("touchmove",B),document.removeEventListener("touchend",D),document.removeEventListener("touchcancel",D)};document.addEventListener("touchmove",B,{passive:!1}),document.addEventListener("touchend",D),document.addEventListener("touchcancel",D)};return ee.useEffect(()=>{},[hn,va,ht]),ee.useEffect(()=>{let h,B;if(ht&&hn){let D=10;h=setInterval(()=>{D--;const T=document.querySelector(".countdown");T&&(T.textContent=D.toString()),D<=0&&clearInterval(h)},1e3),B=setTimeout(()=>{K&&K(),window.location.href=hn},1e4)}return()=>{h&&clearInterval(h),B&&clearTimeout(B)}},[ht,hn,K]),p.jsxs("div",{className:`timeline-container-card ${_?"segments-playback-mode":""}`,children:[p.jsxs("div",{className:"timeline-header",children:[p.jsx("div",{className:"timeline-title",children:p.jsx("span",{className:"timeline-title-text",children:"Timeline"})}),p.jsxs("div",{className:"duration-time",children:["Total Segments:"," ",p.jsx("span",{children:$(Q.reduce((h,B)=>h+(B.endTime-B.startTime),0))})]})]}),p.jsx("div",{ref:Qe,className:`timeline-scroll-container ${_?"segments-playback-mode":""}`,style:{overflow:d>1?"auto":"hidden"},children:p.jsxs("div",{ref:ne,className:"timeline-container",onClick:er,onMouseMove:Fr,style:{width:`${d*100}%`,cursor:"pointer"},children:[p.jsxs("div",{className:"timeline-marker",style:{left:`${xe}%`},children:[p.jsx("div",{className:"timeline-marker-head",onClick:h=>{if(h.stopPropagation(),Q.find(B=>w>=B.startTime&&w<=B.endTime),Me||nt){pe(null),oe(!1);return}else Dt(w),re.debug("Opening tooltip at:",$(w))},children:p.jsx("span",{className:"timeline-marker-head-icon",children:Me||nt?"-":"+"})}),_?null:p.jsx("div",{className:`timeline-marker-drag ${Vr?"dragging":""}`,onMouseDown:Br,onTouchStart:ma,children:p.jsx("span",{className:"timeline-marker-drag-icon",children:"â‹®"})})]}),Q.length===0&&p.jsxs(p.Fragment,{children:[p.jsx("div",{className:"trim-line-marker",style:{left:`${Je}%`},children:p.jsx("div",{ref:De,className:"trim-handle left"})}),p.jsx("div",{className:"trim-line-marker",style:{left:`${Rt}%`},children:p.jsx("div",{ref:Vt,className:"trim-handle right"})})]}),tr(),Pt(),wn(),Me!==null&&p.jsxs("div",{className:`segment-tooltip two-row-tooltip ${_?"segments-playback-mode":""}`,style:{position:"absolute",..._m(xe)},onClick:h=>{_&&(h.stopPropagation(),h.preventDefault())},children:[p.jsxs("div",{className:"tooltip-row",children:[p.jsx("button",{className:`tooltip-time-btn ${_?"disabled":""}`,"data-tooltip":_?"Disabled during preview":"Seek -50ms (click or hold)",disabled:_,..._?{}:Gt(-.05),style:{userSelect:"none",WebkitUserSelect:"none",WebkitTouchCallout:"none",touchAction:"manipulation",cursor:_?"not-allowed":"pointer",WebkitTapHighlightColor:"transparent"},children:"-50ms"}),p.jsx("div",{className:`tooltip-time-display ${_?"disabled":""}`,style:{pointerEvents:_?"none":"auto",cursor:_?"not-allowed":"default",opacity:_?.6:1,userSelect:"none",WebkitUserSelect:"none"},onClick:h=>{_&&(h.stopPropagation(),h.preventDefault())},children:$(cn)}),p.jsx("button",{className:`tooltip-time-btn ${_?"disabled":""}`,"data-tooltip":_?"Disabled during preview":"Seek +50ms (click or hold)",disabled:_,..._?{}:Gt(.05),style:{userSelect:"none",WebkitUserSelect:"none",WebkitTouchCallout:"none",touchAction:"manipulation",cursor:_?"not-allowed":"pointer",WebkitTapHighlightColor:"transparent"},children:"+50ms"})]}),p.jsxs("div",{className:"tooltip-row tooltip-actions",children:[p.jsx("button",{className:`tooltip-action-btn delete ${_?"disabled":""}`,"data-tooltip":_?"Disabled during preview":"Delete segment",disabled:_,style:{userSelect:"none",WebkitUserSelect:"none",WebkitTouchCallout:"none",touchAction:"manipulation",cursor:_?"not-allowed":"pointer",WebkitTapHighlightColor:"transparent"},onClick:h=>{h.stopPropagation();const B=new CustomEvent("delete-segment",{detail:{segmentId:Me}});document.dispatchEvent(B)},children:p.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[p.jsx("path",{d:"M3 6h18"}),p.jsx("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"}),p.jsx("line",{x1:"10",y1:"11",x2:"10",y2:"17"}),p.jsx("line",{x1:"14",y1:"11",x2:"14",y2:"17"})]})}),p.jsx("button",{className:`tooltip-action-btn scissors ${_?"disabled":""}`,"data-tooltip":_?"Disabled during preview":"Split segment at current position",style:{userSelect:"none",WebkitUserSelect:"none",WebkitTouchCallout:"none",touchAction:"manipulation",cursor:_?"not-allowed":"pointer",WebkitTapHighlightColor:"transparent"},disabled:_,onClick:h=>{h.stopPropagation();const B=new CustomEvent("split-segment",{detail:{segmentId:Me,time:le}});document.dispatchEvent(B)},children:p.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[p.jsx("circle",{cx:"6",cy:"6",r:"3"}),p.jsx("circle",{cx:"6",cy:"18",r:"3"}),p.jsx("line",{x1:"20",y1:"4",x2:"8.12",y2:"15.88"}),p.jsx("line",{x1:"14.47",y1:"14.48",x2:"20",y2:"20"}),p.jsx("line",{x1:"8.12",y1:"8.12",x2:"12",y2:"12"})]})}),p.jsx("button",{className:`tooltip-action-btn play-from-start ${_?"disabled":""}`,"data-tooltip":_?"Disabled during preview":"Play segment from beginning",style:{userSelect:"none",WebkitUserSelect:"none",WebkitTouchCallout:"none",touchAction:"manipulation",cursor:_?"not-allowed":"pointer",WebkitTapHighlightColor:"transparent"},disabled:_,onClick:h=>{h.stopPropagation();const B=Q.find(D=>D.id===Me);if(B&&H.current){if(gt(!0),Math.abs(H.current.currentTime-B.endTime)<.05){re.debug(`Already at end boundary (${$(H.current.currentTime)}), nudging position back slightly`);const D=Math.max(B.startTime,B.endTime-.1);H.current.currentTime=D,I(D),W(D),re.debug(`Position adjusted to ${$(D)}`)}else I(B.startTime),W(B.startTime);Ue(B),H.current.play().then(()=>{We(!0)}).catch(D=>{console.error("Error playing from beginning:",D)})}},children:p.jsx("img",{src:Dm,alt:"Play from beginning",style:{width:"24px",height:"24px"}})}),p.jsx("button",{className:`tooltip-action-btn ${Pe?"pause":"play"} ${_?"disabled":""}`,"data-tooltip":_?"Disabled during preview":Pe?"Pause playback":"Play from current position",style:{userSelect:"none",WebkitUserSelect:"none",WebkitTouchCallout:"none",touchAction:"manipulation",cursor:_?"not-allowed":"pointer",WebkitTapHighlightColor:"transparent"},disabled:_,onClick:h=>{h.stopPropagation(),Pe?H.current&&(H.current.pause(),We(!1),gt(!1)):ot()},children:Pe?p.jsx("img",{src:Rm,alt:"Pause",style:{width:"24px",height:"24px"}}):p.jsx("img",{src:wm,alt:"Play",style:{width:"24px",height:"24px"}})}),p.jsx("button",{className:`tooltip-action-btn set-in ${_?"disabled":""}`,style:{userSelect:"none",WebkitUserSelect:"none",WebkitTouchCallout:"none",touchAction:"manipulation",cursor:_?"not-allowed":"pointer",WebkitTapHighlightColor:"transparent"},"data-tooltip":_?"Disabled during preview":"Set start point at current position",disabled:_,onClick:h=>{if(h.stopPropagation(),Q.find(D=>D.id===Me)){const D=Q.map(x=>x.id===Me?{...x,startTime:le{if(h.stopPropagation(),Q.find(D=>D.id===Me)){const D=Q.map(x=>x.id===Me?{...x,endTime:le>x.startTime+.5?le:x.startTime+.5}:x),T=new CustomEvent("update-segments",{detail:{segments:D,recordHistory:!0,action:"adjust_end_time"}});document.dispatchEvent(T)}},children:p.jsx("img",{src:I0,alt:"Set end point",style:{width:"24px",height:"24px"}})})]})]}),nt&&Me===null&&p.jsxs("div",{className:`empty-space-tooltip two-row-tooltip ${_?"segments-playback-mode":""}`,style:{position:"absolute",..._m(xe)},onClick:h=>{_&&(h.stopPropagation(),h.preventDefault())},children:[p.jsxs("div",{className:"tooltip-row",children:[p.jsx("button",{className:`tooltip-time-btn ${_?"disabled":""}`,"data-tooltip":_?"Disabled during preview":"Seek -50ms (click or hold)",disabled:_,..._?{}:Gt(-.05),style:{userSelect:"none",WebkitUserSelect:"none",WebkitTouchCallout:"none",touchAction:"manipulation",cursor:_?"not-allowed":"pointer",WebkitTapHighlightColor:"transparent"},children:"-50ms"}),p.jsx("div",{className:`tooltip-time-display ${_?"disabled":""}`,style:{pointerEvents:_?"none":"auto",cursor:_?"not-allowed":"default",opacity:_?.6:1,userSelect:"none",WebkitUserSelect:"none"},onClick:h=>{_&&(h.stopPropagation(),h.preventDefault())},children:$(le)}),p.jsx("button",{className:`tooltip-time-btn ${_?"disabled":""}`,style:{userSelect:"none",WebkitUserSelect:"none",WebkitTouchCallout:"none",touchAction:"manipulation",cursor:_?"not-allowed":"pointer",WebkitTapHighlightColor:"transparent"},"data-tooltip":_?"Disabled during preview":"Seek +50ms (click or hold)",disabled:_,..._?{}:Gt(.05),children:"+50ms"})]}),p.jsxs("div",{className:"tooltip-row tooltip-actions",children:[p.jsxs("button",{className:`tooltip-action-btn new-segment ${Fe<.5||_?"disabled":""}`,style:{userSelect:"none",WebkitUserSelect:"none",WebkitTouchCallout:"none",touchAction:"manipulation",cursor:_?"not-allowed":"pointer",WebkitTapHighlightColor:"transparent"},"data-tooltip":_?"Disabled during preview":Fe<.5?"Not enough space for new segment":"Create new segment",disabled:Fe<.5||_,onClick:async h=>{if(h.stopPropagation(),Fe<.5)return;const B=le,D=B+Fe,T={id:Date.now(),name:"segment",startTime:B,endTime:D,thumbnail:""},x=[...Q,T],O=new CustomEvent("update-segments",{detail:{segments:x,recordHistory:!0,action:"create_segment"}});document.dispatchEvent(O),oe(!1),setTimeout(()=>{const c=x[x.length-1];c&&(pe(c.id),re.debug("Created and selected new segment:",c.id))},100)},children:[p.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[p.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2"}),p.jsx("line",{x1:"12",y1:"8",x2:"12",y2:"16"}),p.jsx("line",{x1:"8",y1:"12",x2:"16",y2:"12"})]}),p.jsx("span",{className:"tooltip-btn-text",children:"New"})]}),p.jsx("button",{className:`tooltip-action-btn play-from-start ${_?"disabled":""}`,"data-tooltip":_?"Disabled during preview":"Play from beginning of cutaway",style:{userSelect:"none",WebkitUserSelect:"none",WebkitTouchCallout:"none",touchAction:"manipulation",cursor:_?"not-allowed":"pointer",WebkitTapHighlightColor:"transparent"},disabled:_,onClick:h=>{if(h.stopPropagation(),H.current){const B=le;gt(!0);const D=[...Q].sort((A,ve)=>A.startTime-ve.startTime),T=[...D].reverse().find(A=>A.endTimeA.startTime>B),c=O?O.startTime:L,y={id:-999,name:"Cutaway",startTime:x,endTime:c,thumbnail:""};I(x),W(x),We(!1),setTimeout(()=>{Ue(y)},0);const S=()=>{if(!H.current)return;const A=H.current.currentTime,ve=[...Q].sort((ze,it)=>ze.startTime-it.startTime),z=ve.find(ze=>ze.startTime>A-.3),ue=z&&A>=z.startTime-.25&&A<=z.startTime+.1&&!Ht;z&&A>=z.startTime-.25&&A<=z.startTime+.1&&re.debug(`Approaching boundary at ${$(z.startTime)}, continuePastBoundary=${Ht}, willStop=${ue}`);const ye=ve.find(ze=>A>=ze.startTime&&A<=ze.endTime);if(ye&&(Ve==null?void 0:Ve.id)!==ye.id){re.debug(`Entered segment ${ye.id} during cutaway playback`),Ue(ye),pe(ye.id),oe(!1),H.current.removeEventListener("timeupdate",S),gt(!1),sessionStorage.removeItem("continuingPastSegment");return}if(ue&&z){re.debug(`CUTAWAY MANUAL BOUNDARY CHECK: Current position ${$(A)} approaching segment at ${$(z.startTime)} (distance: ${Math.abs(A-z.startTime).toFixed(3)}s) - STOPPING`),H.current.pause(),setTimeout(()=>{if(H.current){H.current.currentTime=z.startTime,I(z.startTime),et(z.startTime),W(z.startTime),gt(!1),pe(z.id),oe(!1),Ue(z);const ze=()=>{H.current&&(H.current.currentTime=z.startTime,I(z.startTime),et(z.startTime),W(z.startTime),re.debug(`Position corrected to exact segment boundary: ${$(H.current.currentTime)} (target: ${$(z.startTime)})`))};setTimeout(ze,10),setTimeout(ze,20),setTimeout(ze,50),setTimeout(ze,100),setTimeout(ze,200),H.current.addEventListener("seeked",ze),H.current.addEventListener("canplay",ze),H.current.addEventListener("waiting",ze),setTimeout(()=>{H.current&&(H.current.removeEventListener("seeked",ze),H.current.removeEventListener("canplay",ze),H.current.removeEventListener("waiting",ze))},300)}},10),We(!1),Ue(null),H.current.removeEventListener("timeupdate",S);return}};H.current.addEventListener("timeupdate",S),setTimeout(()=>{H.current&&H.current.play().then(()=>{We(!0),re.debug("CUTAWAY PLAYBACK STARTED:",$(x),"to",$(c),T?`(after segment ${T.id}, offset +25ms from ${$(T.endTime)})`:"(from video start)",O?`(will stop at segment ${O.id})`:"(will play to end)")}).catch(A=>{console.error("Error playing cutaway:",A)})},50)}},children:p.jsx("img",{src:Dm,alt:"Play from beginning",style:{width:"24px",height:"24px"}})}),p.jsx("button",{className:`tooltip-action-btn ${Pe?"pause":"play"} ${_?"disabled":""}`,"data-tooltip":_?"Disabled during preview":Pe?"Pause playback":"Play from here until next segment",style:{userSelect:"none",WebkitUserSelect:"none",WebkitTouchCallout:"none",touchAction:"manipulation",cursor:_?"not-allowed":"pointer",WebkitTapHighlightColor:"transparent"},disabled:_,onClick:h=>{h.stopPropagation(),Pe?H.current&&(H.current.pause(),We(!1),gt(!1)):ot()},children:Pe?p.jsx("img",{src:Rm,alt:"Pause",style:{width:"24px",height:"24px"}}):p.jsx("img",{src:wm,alt:"Play",style:{width:"24px",height:"24px"}})}),p.jsx("button",{className:`tooltip-action-btn segment-end ${_?"disabled":""}`,style:{userSelect:"none",WebkitUserSelect:"none",WebkitTouchCallout:"none",touchAction:"manipulation",cursor:_?"not-allowed":"pointer",WebkitTapHighlightColor:"transparent"},"data-tooltip":_?"Disabled during preview":"Adjust end of previous segment",disabled:_,onClick:h=>{h.stopPropagation();const D=[...Q].sort((T,x)=>T.startTime-x.startTime).filter(T=>T.endTime<=le).sort((T,x)=>x.endTime-T.endTime)[0];if(D){const T=Q.map(O=>O.id===D.id?{...O,endTime:le}:O),x=new CustomEvent("update-segments",{detail:{segments:T,recordHistory:!0,action:"adjust_previous_end_time"}});document.dispatchEvent(x),re.debug("Adjusted end of previous segment to:",$(le)),pe(D.id),oe(!1)}else if(Q.length>0){const T=[...Q].sort((c,y)=>c.startTime-y.startTime);let x=!1,O=0;for(let c=0;cy&&leS.endTime-y.endTime)[0];if(c&&c.endTimeA.id===c.id?{...A,endTime:L}:A),S=new CustomEvent("update-segments",{detail:{segments:y,recordHistory:!0,action:"extend_last_segment"}});document.dispatchEvent(S),pe(c.id),oe(!1)}}}else if(le>0){const T={id:Date.now(),name:"segment",startTime:0,endTime:le,thumbnail:""},x=new CustomEvent("update-segments",{detail:{segments:[T],recordHistory:!0,action:"create_segment_from_start"}});document.dispatchEvent(x),re.debug("Created new segment from start to:",$(le)),pe(T.id),oe(!1)}},children:p.jsx("img",{src:X0,alt:"Set end point",style:{width:"24px",height:"24px"}})}),p.jsx("button",{className:`tooltip-action-btn segment-start ${_?"disabled":""}`,"data-tooltip":_?"Disabled during preview":"Adjust start of next segment",style:{userSelect:"none",WebkitUserSelect:"none",WebkitTouchCallout:"none",touchAction:"manipulation",cursor:_?"not-allowed":"pointer",WebkitTapHighlightColor:"transparent"},disabled:_,onClick:h=>{h.stopPropagation();const D=[...Q].sort((T,x)=>T.startTime-x.startTime).filter(T=>T.startTime>=le).sort((T,x)=>T.startTime-x.startTime)[0];if(D){const T=Q.map(O=>O.id===D.id?{...O,startTime:le}:O),x=new CustomEvent("update-segments",{detail:{segments:T,recordHistory:!0,action:"adjust_next_start_time"}});document.dispatchEvent(x),re.debug("Adjusted start of next segment to:",$(le)),pe(D.id),oe(!1)}else if(Q.length>0){const T=[...Q].sort((c,y)=>c.startTime-y.startTime);let x=!1,O=0;for(let c=0;cy&&leT[T.length-1].endTime){const c={id:Date.now(),name:"segment",startTime:le,endTime:L,thumbnail:""},y=[...Q,c],S=new CustomEvent("update-segments",{detail:{segments:y,recordHistory:!0,action:"create_segment_to_end"}});document.dispatchEvent(S),re.debug("Created new segment from",$(le),"to end"),pe(c.id),oe(!1)}else{const c=T[0];if(c&&c.startTime>0){const y=Q.map(A=>A.id===c.id?{...A,startTime:0}:A),S=new CustomEvent("update-segments",{detail:{segments:y,recordHistory:!0,action:"extend_first_segment"}});document.dispatchEvent(S),pe(c.id),oe(!1)}}}else if(le{if(h.key==="Enter"){const B=h.currentTarget.value;try{const D=B.split(":");let T=0,x=0,O=0,c=0;if(D.length===3){T=parseInt(D[0]),x=parseInt(D[1]);const S=D[2].split(".");O=parseInt(S[0]),S.length>1&&(c=parseInt(S[1].padEnd(3,"0").substring(0,3)))}else if(D.length===2){x=parseInt(D[0]);const S=D[1].split(".");O=parseInt(S[0]),S.length>1&&(c=parseInt(S[1].padEnd(3,"0").substring(0,3)))}const y=T*3600+x*60+O+c/1e3;if(!isNaN(y)&&y>=0&&y<=L){I(y);const S=A=>{const ve=Q.find(z=>{const ue=A>=z.startTime&&A<=z.endTime,ye=Math.abs(A-z.startTime)<.001,ze=Math.abs(A-z.endTime)<.001;return ue||ye||ze});if(ne.current&&Qe.current){const z=ne.current.getBoundingClientRect();let ue;if(d>1)ue=z.left-Qe.current.scrollLeft+A/L*z.width;else{const ye=A/L;ue=z.left+z.width*ye}Ke({x:ue,y:z.top-10}),W(A),ve?(pe(ve.id),oe(!1)):(pe(null),oe(!0))}};setTimeout(()=>S(y),10)}}catch(D){console.error("Invalid time format:",D)}}}}),p.jsx("div",{className:"time-button-group",children:(()=>{const h=()=>{const B=Q.find(D=>{const T=w>=D.startTime&&w<=D.endTime,x=Math.abs(w-D.startTime)<.001,O=Math.abs(w-D.endTime)<.001;return T||x||O});if(ne.current&&Qe.current){const D=ne.current.getBoundingClientRect();let T;if(d>1)T=D.left-Qe.current.scrollLeft+w/L*D.width;else{const x=w/L;T=D.left+D.width*x}if(Ke({x:T,y:D.top-10}),W(w),B)pe(B.id),oe(!1);else{const x=Tt(w);at(x),x>=.5?(pe(null),oe(!0)):(pe(null),oe(!1))}}};return p.jsxs(p.Fragment,{children:[p.jsx("button",{className:"time-button",onClick:()=>{I(w-.01),setTimeout(h,10)},"data-tooltip":"Move back 10ms",children:"-10ms"}),p.jsx("button",{className:"time-button",onClick:()=>{I(w-.001),setTimeout(h,10)},"data-tooltip":"Move back 1ms",children:"-1ms"}),p.jsx("button",{className:"time-button",onClick:()=>{I(w+.001),setTimeout(h,10)},"data-tooltip":"Move forward 1ms",children:"+1ms"}),p.jsx("button",{className:"time-button",onClick:()=>{I(w+.01),setTimeout(h,10)},"data-tooltip":"Move forward 10ms",children:"+10ms"})]})})()})]}),p.jsxs("div",{className:"controls-right",children:[p.jsxs("div",{className:"zoom-dropdown-container",children:[p.jsxs("button",{className:"zoom-button","data-tooltip":"Select zoom level",onClick:()=>Ye(!q),children:["Zoom ",d,"x",p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:p.jsx("polyline",{points:"6 9 12 15 18 9"})})]}),q&&p.jsx("div",{className:"zoom-dropdown",style:{position:"absolute",top:"100%",left:0,zIndex:1e3},children:[1,2,4,8,16,32,64,128,256,512,1024,2048,4096].map(h=>p.jsxs("div",{className:`zoom-option ${d===h?"selected":""}`,onClick:()=>{bt(h),Ye(!1)},children:[d===h&&p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:p.jsx("polyline",{points:"20 6 9 17 4 12"})}),"Zoom ",h,"x"]},h))})]}),p.jsxs("div",{className:"save-buttons-row",children:[K&&p.jsx("button",{onClick:()=>fn(!0),className:"save-button","data-tooltip":"Save changes",children:"Save"}),Oe&&p.jsx("button",{onClick:()=>G(!0),className:"save-copy-button","data-tooltip":"Save as a new copy",children:"Save as Copy"}),zt&&p.jsx("button",{onClick:()=>Ce(!0),className:"save-segments-button","data-tooltip":"Save segments as separate files",children:"Save Segments"})]}),p.jsx(to,{isOpen:rn,onClose:()=>fn(!1),title:"Save Changes",actions:p.jsxs(p.Fragment,{children:[p.jsx("button",{className:"modal-button modal-button-secondary",onClick:()=>fn(!1),children:"Cancel"}),p.jsx("button",{className:"modal-button modal-button-primary",onClick:()=>{K&&K(),Bt()},children:"Confirm Save"})]}),children:p.jsx("p",{className:"modal-message",children:"You're about to replace the original video with this trimmed version. This can't be undone."})}),p.jsx(to,{isOpen:F,onClose:()=>G(!1),title:"Save As New Copy",actions:p.jsxs(p.Fragment,{children:[p.jsx("button",{className:"modal-button modal-button-secondary",onClick:()=>G(!1),children:"Cancel"}),p.jsx("button",{className:"modal-button modal-button-primary",onClick:()=>{Oe&&Oe(),Xt()},children:"Confirm Save As Copy"})]}),children:p.jsx("p",{className:"modal-message",children:"You're about to save a new copy with your edits. The original video will stay the same. Find the new file in your My Media folder - named after the original file."})}),p.jsxs(to,{isOpen:Ze,onClose:()=>{},title:"Processing Video",children:[p.jsx("div",{className:"modal-spinner",children:p.jsx("div",{className:"spinner"})}),p.jsx("p",{className:"modal-message text-center",children:"Please wait while your video is being processed..."})]}),p.jsx(to,{isOpen:Te,onClose:()=>Ce(!1),title:"Save Segments",actions:p.jsxs(p.Fragment,{children:[p.jsx("button",{className:"modal-button modal-button-secondary",onClick:()=>Ce(!1),children:"Cancel"}),p.jsx("button",{className:"modal-button modal-button-primary",onClick:()=>{zt&&zt(),Qt()},children:"Save Segments"})]}),children:p.jsx("p",{className:"modal-message",children:"You're about to save each segment as a separate video. Find the new files in your My Media folder - named after the original file."})}),p.jsx(to,{isOpen:ht,onClose:()=>Ge(!1),title:"Video Edited Successfully",children:p.jsx("div",{className:"modal-success-content",children:p.jsxs("p",{className:"modal-message text-center redirect-message",children:["You will be redirected to your ",p.jsx("a",{href:hn,className:"media-page-link",style:Q0,children:"media page"})," in ",p.jsx("span",{className:"countdown",children:"10"})," seconds."," ",va==="segments"?"The new video(s) will soon be there.":"Changes to the video might take a few minutes to be applied."]})})}),p.jsxs(to,{isOpen:yt,onClose:()=>rt(!1),title:"Video Processing Error",children:[p.jsxs("div",{className:"modal-error-content",children:[p.jsx("div",{className:"modal-error-icon",children:p.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"48",height:"48",viewBox:"0 0 24 24",fill:"none",stroke:"#F44336",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[p.jsx("circle",{cx:"12",cy:"12",r:"10"}),p.jsx("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),p.jsx("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"})]})}),p.jsx("p",{className:"modal-message text-center error-message",children:Ot})]}),p.jsx("div",{className:"modal-choices",children:p.jsxs("button",{onClick:()=>rt(!1),className:"modal-choice-button centered-choice",children:[p.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[p.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),p.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}),"Close"]})})]})]})]}),St&&p.jsx("div",{className:"mobile-timeline-overlay",children:p.jsxs("div",{className:"mobile-timeline-message",children:[p.jsx("p",{children:"Please play the video first to enable timeline controls"}),p.jsx("div",{className:"mobile-play-icon"})]})})]})},Z0=({onSplit:w,onReset:L,onUndo:me,onRedo:Ee,onPlaySegments:fe,onPlay:Re,canUndo:d,canRedo:Q,isPlaying:he=!1,isPlayingSegments:te=!1})=>{const[bt,I]=ee.useState(!1);ee.useEffect(()=>{const K=()=>{I(window.innerWidth<=640)};return K(),window.addEventListener("resize",K),()=>window.removeEventListener("resize",K)},[]);const H=()=>{typeof window<"u"&&console.log("Play button clicked, current lastSeekedPosition:",window.lastSeekedPosition),Re()};return p.jsx("div",{className:"editing-tools-container",children:p.jsxs("div",{className:"flex-container single-row",children:[p.jsxs("div",{className:"button-group play-buttons-group",children:[p.jsx("button",{className:"button segments-button",onClick:fe,"data-tooltip":te?"Stop segments playback":"Play segments in one continuous flow",style:{fontSize:"0.875rem"},children:te?p.jsxs(p.Fragment,{children:[p.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[p.jsx("circle",{cx:"12",cy:"12",r:"10"}),p.jsx("line",{x1:"10",y1:"15",x2:"10",y2:"9"}),p.jsx("line",{x1:"14",y1:"15",x2:"14",y2:"9"})]}),p.jsx("span",{className:"full-text",children:"Stop Preview"}),p.jsx("span",{className:"short-text",children:"Stop Preview"})]}):p.jsxs(p.Fragment,{children:[p.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[p.jsx("circle",{cx:"12",cy:"12",r:"10"}),p.jsx("polygon",{points:"10 8 16 12 10 16 10 8"})]}),p.jsx("span",{className:"full-text",children:"Play Preview"}),p.jsx("span",{className:"short-text",children:"Play Preview"})]})}),(!te||!bt)&&p.jsx("button",{className:`button play-button ${te?"greyed-out":""}`,onClick:H,"data-tooltip":he?"Pause video":"Play full video",style:{fontSize:"0.875rem"},disabled:te,children:he&&!te?p.jsxs(p.Fragment,{children:[p.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[p.jsx("circle",{cx:"12",cy:"12",r:"10"}),p.jsx("line",{x1:"10",y1:"15",x2:"10",y2:"9"}),p.jsx("line",{x1:"14",y1:"15",x2:"14",y2:"9"})]}),p.jsx("span",{className:"full-text",children:"Pause"}),p.jsx("span",{className:"short-text",children:"Pause"})]}):p.jsxs(p.Fragment,{children:[p.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[p.jsx("circle",{cx:"12",cy:"12",r:"10"}),p.jsx("polygon",{points:"10 8 16 12 10 16 10 8"})]}),p.jsx("span",{className:"full-text",children:"Play"}),p.jsx("span",{className:"short-text",children:"Play"})]})})]}),p.jsxs("div",{className:"button-group secondary",children:[p.jsxs("button",{className:"button","aria-label":"Undo","data-tooltip":te?"Disabled during preview":"Undo last action",disabled:!d||te,onClick:me,children:[p.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[p.jsx("path",{d:"M9 14 4 9l5-5"}),p.jsx("path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5v0a5.5 5.5 0 0 1-5.5 5.5H11"})]}),p.jsx("span",{className:"button-text",children:"Undo"})]}),p.jsxs("button",{className:"button","aria-label":"Redo","data-tooltip":te?"Disabled during preview":"Redo last undone action",disabled:!Q||te,onClick:Ee,children:[p.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[p.jsx("path",{d:"m15 14 5-5-5-5"}),p.jsx("path",{d:"M20 9H9.5A5.5 5.5 0 0 0 4 14.5v0A5.5 5.5 0 0 0 9.5 20H13"})]}),p.jsx("span",{className:"button-text",children:"Redo"})]}),p.jsx("div",{className:"divider"}),p.jsxs("button",{className:"button",onClick:L,"data-tooltip":te?"Disabled during preview":"Reset to full video",disabled:te,children:[p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",children:p.jsx("path",{fillRule:"evenodd",d:"M4 2a1 1 0 011 1v2.101a7.002 7.002 0 0111.601 2.566 1 1 0 11-1.885.666A5.002 5.002 0 005.999 7H9a1 1 0 010 2H4a1 1 0 01-1-1V3a1 1 0 011-1zm.008 9.057a1 1 0 011.276.61A5.002 5.002 0 0014.001 13H11a1 1 0 110-2h5a1 1 0 011 1v5a1 1 0 11-2 0v-2.101a7.002 7.002 0 01-11.601-2.566 1 1 0 01.61-1.276z",clipRule:"evenodd"})}),p.jsx("span",{className:"reset-text",children:"Reset"})]})]})]})})},J0=({segments:w})=>{const L=[...w].sort((fe,Re)=>fe.startTime-Re.startTime),me=fe=>{const Re=new CustomEvent("delete-segment",{detail:{segmentId:fe}});document.dispatchEvent(Re)},Ee=fe=>`segment-default-color segment-color-${fe%8+1}`;return p.jsxs("div",{className:"clip-segments-container",children:[p.jsx("h3",{className:"clip-segments-title",children:"Clip Segments"}),L.map((fe,Re)=>p.jsxs("div",{className:`segment-item ${Ee(Re)}`,children:[p.jsxs("div",{className:"segment-content",children:[p.jsx("div",{className:"segment-thumbnail",style:{backgroundImage:`url(${fe.thumbnail})`}}),p.jsxs("div",{className:"segment-info",children:[p.jsxs("div",{className:"segment-title",children:["Segment ",Re+1]}),p.jsxs("div",{className:"segment-time",children:[hi(fe.startTime)," - ",hi(fe.endTime)]}),p.jsxs("div",{className:"segment-duration",children:["Duration: ",Y0(fe.endTime-fe.startTime)]})]})]}),p.jsx("div",{className:"segment-actions",children:p.jsx("button",{className:"delete-button","aria-label":"Delete Segment","data-tooltip":"Delete this segment",onClick:()=>me(fe.id),children:p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",children:p.jsx("path",{fillRule:"evenodd",d:"M9 2a1 1 0 00-.894.553L7.382 4H4a1 1 0 000 2v10a2 2 0 002 2h8a2 2 0 002-2V6a1 1 0 100-2h-3.382l-.724-1.447A1 1 0 0011 2H9zM7 8a1 1 0 012 0v6a1 1 0 11-2 0V8zm5-1a1 1 0 00-1 1v6a1 1 0 102 0V8a1 1 0 00-1-1z",clipRule:"evenodd"})})})})]},fe.id)),L.length===0&&p.jsx("div",{className:"empty-message",children:"No segments created yet. Use the split button to create segments."})]})},eS=({videoRef:w,onPlay:L})=>{const[me,Ee]=ee.useState(!1);ee.useEffect(()=>{const d=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini|Mobile|mobile|CriOS/i.test(navigator.userAgent);Ee(d)},[]),ee.useEffect(()=>{const Re=w.current;if(!Re)return;const d=()=>{Ee(!1)};return Re.addEventListener("play",d),()=>{Re.removeEventListener("play",d)}},[w]);const fe=()=>{L()};return me?p.jsx("div",{className:"mobile-play-prompt-overlay",children:p.jsx("div",{className:"mobile-play-prompt",children:p.jsx("button",{className:"mobile-play-button",onClick:fe,children:"Click to start editing..."})})}):null},tS=()=>{const w=ee.useRef(null),[L,me]=ee.useState(0),[Ee,fe]=ee.useState(0),[Re,d]=ee.useState(!1),[Q,he]=ee.useState(!1),[te,bt]=ee.useState([]),[I,H]=ee.useState(0),[K,Oe]=ee.useState(0),[zt,qt]=ee.useState([]),[St,Pe]=ee.useState(1),[_e,ot]=ee.useState([]),[_,ne]=ee.useState([]),[De,Vt]=ee.useState(-1),[Me,pe]=ee.useState(!1),[nt,oe]=ee.useState(!1),[Le,Ke]=ee.useState(0);ee.useEffect(()=>{var F;if(_.length>0){const G=((F=_[De])==null?void 0:F.action)||"";G!=="save"&&G!=="save_copy"&&G!=="save_segments"&&pe(!0)}},[_,De]),ee.useEffect(()=>{const F=G=>{if(Me){const Te="Your edits will get lost if you leave the page. Do you want to continue?";return G.preventDefault(),G.returnValue=Te,Te}};return window.addEventListener("beforeunload",F),()=>{window.removeEventListener("beforeunload",F)}},[Me]),ee.useEffect(()=>{const F=w.current;if(!F)return;const G=()=>{fe(F.duration),Oe(F.duration),(async()=>{const Ge=await Cm(F,F.duration/2),yt={id:1,name:"segment",startTime:0,endTime:F.duration,thumbnail:Ge},rt={trimStart:0,trimEnd:F.duration,splitPoints:[],clipSegments:[yt]};ne([rt]),Vt(0),ot([yt]);const tn=6,mn=F.duration/tn,Ot=[];for(let Lt=0;Lt{me(F.currentTime)},Ce=()=>{d(!0),rn(!0)},Ze=()=>{d(!1)},st=()=>{d(!1),F.currentTime=I};return F.addEventListener("loadedmetadata",G),F.addEventListener("timeupdate",Te),F.addEventListener("play",Ce),F.addEventListener("pause",Ze),F.addEventListener("ended",st),()=>{F.removeEventListener("loadedmetadata",G),F.removeEventListener("timeupdate",Te),F.removeEventListener("play",Ce),F.removeEventListener("pause",Ze),F.removeEventListener("ended",st)}},[]);const le=F=>{const G=w.current;if(!G)return;const Te=!G.paused;G.currentTime=F,me(F),typeof window<"u"&&(window.lastSeekedPosition=F),Te&&G.play().then(()=>{d(!0)}).catch(Ce=>{console.error("Error resuming playback:",Ce),d(!1)})},W=F=>{const G={trimStart:I,trimEnd:K,splitPoints:[...zt],clipSegments:JSON.parse(JSON.stringify(_e)),action:F||"manual_save"},Te=_[De],Ce=()=>{if(!Te||Te.clipSegments.length!==G.clipSegments.length)return!0;for(let ht=0;ht.001||Math.abs(Ge.endTime-yt.endTime)>.001)return!0}return!1},Ze=!Te||Te.trimStart!==G.trimStart||Te.trimEnd!==G.trimEnd||Te.splitPoints.length!==G.splitPoints.length||Ce(),st=G.action!==void 0;if(Ze||st){const ht=De;ne(Ge=>htGe+1)}};ee.useEffect(()=>{const F=G=>{if(G.detail){const{time:Te,isStart:Ce,recordHistory:Ze,action:st}=G.detail;Ce?H(Te):Oe(Te),Ze&&setTimeout(()=>{W(st||(Ce?"adjust_trim_start":"adjust_trim_end"))},10)}};return document.addEventListener("update-trim",F),()=>{document.removeEventListener("update-trim",F)}},[]),ee.useEffect(()=>{const F=Ce=>{if(Ce.detail&&Ce.detail.segments){const Ze=Ce.detail.recordHistory!==!1,st=Ce.detail.action||"update_segments";ot(Ce.detail.segments),Ze&&setTimeout(()=>{const ht=JSON.parse(JSON.stringify(Ce.detail.segments)),Ge={trimStart:I,trimEnd:K,splitPoints:[...zt],clipSegments:ht,action:st},yt=De;ne(rt=>ytrt+1)},20)}},G=async Ce=>{const Ze=Ce;if(Ze.detail&&typeof Ze.detail.time=="number"&&typeof Ze.detail.segmentId=="number"){const st=Ze.detail.time,ht=Ze.detail.segmentId;le(st);const Ge=_e.find(Ot=>Ot.id===ht);if(!Ge||st<=Ge.startTime||st>=Ge.endTime)return;const yt=[..._e],rt=yt.findIndex(Ot=>Ot.id===ht);if(rt===-1)return;yt.splice(rt,1);const tn={id:Date.now(),name:`${Ge.name}-A`,startTime:Ge.startTime,endTime:st,thumbnail:""},mn={id:Date.now()+1,name:`${Ge.name}-B`,startTime:st,endTime:Ge.endTime,thumbnail:""};yt.push(tn,mn),yt.sort((Ot,Lt)=>Ot.startTime-Lt.startTime),ot(yt),W("split_segment")}},Te=async Ce=>{const Ze=Ce;if(Ze.detail&&typeof Ze.detail.segmentId=="number"){const st=Ze.detail.segmentId,ht=_e.filter(Ge=>Ge.id!==st);if(ht.length!==_e.length){if(ht.length===0&&w.current){const Ge={id:Date.now(),name:"segment",startTime:0,endTime:w.current.duration,thumbnail:""};H(0),Oe(w.current.duration),qt([]),ot([Ge])}else ot(ht);W("delete_segment")}}};return document.addEventListener("update-segments",F),document.addEventListener("split-segment",G),document.addEventListener("delete-segment",Te),()=>{document.removeEventListener("update-segments",F),document.removeEventListener("split-segment",G),document.removeEventListener("delete-segment",Te)}},[_e,Ee]);const q=F=>{H(F),W("adjust_trim_start")},Ye=F=>{Oe(F),W("adjust_trim_end")},Fe=async()=>{if(w.current&&!zt.includes(L)){const F=[...zt,L].sort((Ce,Ze)=>Ce-Ze);qt(F);const G=[];let Te=0;for(let Ce=0;Ce<=F.length;Ce++){const Ze=Ce{if(H(0),Oe(Ee),qt([]),!w.current)return;const F={id:Date.now(),name:"segment",startTime:0,endTime:Ee,thumbnail:""};ot([F]),W("reset_all")},ct=()=>{if(De>0){const F=_[De-1];re.debug(`** UNDO ** to position ${De-1}, action: ${F.action}, segments: ${F.clipSegments.length}`),re.debug("Segment details after undo:",F.clipSegments.map(G=>`ID: ${G.id}, Time: ${$(G.startTime)} - ${$(G.endTime)}`)),H(F.trimStart),Oe(F.trimEnd),qt([...F.splitPoints]),ot(JSON.parse(JSON.stringify(F.clipSegments))),Vt(De-1)}},We=()=>{if(De<_.length-1){const F=_[De+1];re.debug(`** REDO ** to position ${De+1}, action: ${F.action}, segments: ${F.clipSegments.length}`),re.debug("Segment details after redo:",F.clipSegments.map(G=>`ID: ${G.id}, Time: ${$(G.startTime)} - ${$(G.endTime)}`)),H(F.trimStart),Oe(F.trimEnd),qt([...F.splitPoints]),ot(JSON.parse(JSON.stringify(F.clipSegments))),Vt(De+1)}},Ve=F=>{Pe(F)},Ue=()=>{const F=w.current;F&&(F.muted=!F.muted,he(!Q))},cn=()=>{[..._e].sort((G,Te)=>G.startTime-Te.startTime).map(G=>({startTime:$(G.startTime),endTime:$(G.endTime)})),pe(!1),W("save")},et=()=>{[..._e].sort((G,Te)=>G.startTime-Te.startTime).map(G=>({startTime:$(G.startTime),endTime:$(G.endTime)})),pe(!1),W("save_copy")},Ht=()=>{[..._e].sort((G,Te)=>G.startTime-Te.startTime).map(G=>({name:G.name,startTime:$(G.startTime),endTime:$(G.endTime)})),pe(!1),W("save_segments")},gt=F=>{(!Qe||Gt)&&le(F)},Qe=typeof window<"u"&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini|Mobile|mobile|CriOS/i.test(navigator.userAgent),[Gt,rn]=ee.useState(!1);return ee.useEffect(()=>{if(!nt||!w.current)return;const F=w.current,G=[..._e].sort((Ce,Ze)=>Ce.startTime-Ze.startTime),Te=()=>{const Ce=G[Le];if(!Ce)return;const Ze=F.currentTime;if(Ze=Ce.endTime-.01)if(Le{console.error("Error continuing segment playback:",ht)})}else F.pause(),oe(!1),Ke(0),F.removeEventListener("timeupdate",Te)};return F.addEventListener("timeupdate",Te),F.paused&&G.length>0&&(F.currentTime=G[0].startTime,F.play().catch(console.error)),()=>{F.removeEventListener("timeupdate",Te)}},[nt,Le,_e]),ee.useEffect(()=>{const F=G=>{const{segmentIndex:Te}=G.detail;nt&&Te!==Le&&Ke(Te)};return document.addEventListener("update-segment-index",F),()=>{document.removeEventListener("update-segment-index",F)}},[nt,Le]),{videoRef:w,currentTime:L,duration:Ee,isPlaying:Re,setIsPlaying:d,isMuted:Q,isPlayingSegments:nt,thumbnails:te,trimStart:I,trimEnd:K,splitPoints:zt,zoomLevel:St,clipSegments:_e,hasUnsavedChanges:Me,historyPosition:De,history:_,handleTrimStartChange:q,handleTrimEndChange:Ye,handleZoomChange:Ve,handleMobileSafeSeek:gt,handleSplit:Fe,handleReset:at,handleUndo:ct,handleRedo:We,handlePlaySegments:()=>{const F=w.current;if(!(!F||_e.length===0))if(nt)F.pause(),oe(!1),Ke(0);else{oe(!0),Ke(0);const G=[..._e].sort((Te,Ce)=>Te.startTime-Ce.startTime);F.currentTime=G[0].startTime,F.play().catch(Te=>{console.error("Error starting segments playback:",Te),oe(!1)})}},toggleMute:Ue,handleSave:cn,handleSaveACopy:et,handleSaveSegments:Ht,isMobile:Qe,videoInitialized:Gt,setVideoInitialized:rn}},nS=()=>{const{videoRef:w,currentTime:L,duration:me,isPlaying:Ee,setIsPlaying:fe,isMuted:Re,thumbnails:d,trimStart:Q,trimEnd:he,splitPoints:te,zoomLevel:bt,clipSegments:I,hasUnsavedChanges:H,historyPosition:K,history:Oe,handleTrimStartChange:zt,handleTrimEndChange:qt,handleZoomChange:St,handleMobileSafeSeek:Pe,handleSplit:_e,handleReset:ot,handleUndo:_,handleRedo:ne,toggleMute:De,handleSave:Vt,handleSaveACopy:Me,handleSaveSegments:pe,isMobile:nt,videoInitialized:oe,setVideoInitialized:Le,isPlayingSegments:Ke,handlePlaySegments:le}=tS(),W=()=>{if(!w.current)return;const q=w.current;if(Ee){q.pause(),fe(!1);return}const Ye=Number(q.currentTime.toFixed(6));let Fe=me,at=null,ct=null;const We=[...I].sort((Ue,cn)=>Ue.startTime-cn.startTime);at=We.find(Ue=>{const cn=Number(Ue.startTime.toFixed(6)),et=Number(Ue.endTime.toFixed(6));return Ye>cn&&YeNumber(Ue.startTime.toFixed(6))>Ye)),at?Fe=Number(at.endTime.toFixed(6)):ct&&(Fe=Number(ct.startTime.toFixed(6)));const Ve=()=>{if(!q)return;const Ue=Number(q.currentTime.toFixed(6));if(Number((Fe-Ue).toFixed(6))<=0||Ue>=Fe){q.pause();const et=()=>{if(!q)return;q.currentTime=Fe,Pe(Fe);const Ht=Number(q.currentTime.toFixed(6)),gt=Number(Math.abs(Ht-Fe).toFixed(6));re.debug("Position verification:",{target:$(Fe),actual:$(Ht),difference:gt}),gt>0&&(q.currentTime=Fe,Pe(Fe))};et(),setTimeout(et,5),setTimeout(et,10),setTimeout(et,20),setTimeout(et,50),q.removeEventListener("timeupdate",Ve),fe(!1),re.debug("Stopped at position:",{target:$(Fe),actual:$(q.currentTime),type:at?"segment end":ct?"next segment start":"end of video",segment:at?{id:at.id,start:$(at.startTime),end:$(at.endTime)}:null,nextSegment:ct?{id:ct.id,start:$(ct.startTime),end:$(ct.endTime)}:null});return}};q.addEventListener("timeupdate",Ve),q.play().then(()=>{fe(!0),Le(!0),re.debug("Playback started:",{from:$(Ye),to:$(Fe),currentSegment:at?{id:at.id,start:$(at.startTime),end:$(at.endTime)}:"None",nextSegment:ct?{id:ct.id,start:$(ct.startTime),end:$(ct.endTime)}:"None"})}).catch(Ue=>{console.error("Error playing video:",Ue)})};return p.jsxs("div",{className:"bg-background min-h-screen",children:[p.jsx(eS,{videoRef:w,onPlay:W}),p.jsxs("div",{className:"container mx-auto px-4 py-6 max-w-6xl",children:[p.jsx(W0,{videoRef:w,currentTime:L,duration:me,isPlaying:Ee,isMuted:Re,onPlayPause:W,onSeek:Pe,onToggleMute:De}),p.jsx(Z0,{onSplit:_e,onReset:ot,onUndo:_,onRedo:ne,onPlaySegments:le,onPlay:W,isPlaying:Ee,isPlayingSegments:Ke,canUndo:K>0,canRedo:K{const w=document.getElementById("video-editor-trim-root");w&&Sm(w).render(p.jsx(nS,{}))};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",km):km()})(); +You might need to use a local HTTP server (instead of file://): https://reactjs.org/link/react-devtools-faq`:""),"font-weight:bold")}ra.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=fm,ra.createPortal=u_,ra.createRoot=c_,ra.findDOMNode=a_,ra.flushSync=d_,ra.hydrate=r_,ra.hydrateRoot=f_,ra.render=i_,ra.unmountComponentAtNode=l_,ra.unstable_batchedUpdates=Bp,ra.unstable_renderSubtreeIntoContainer=s_,ra.version=rm,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}(),ra}hm.exports=$0();var P0=hm.exports,Sm,Tm=P0;{var Em=Tm.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;Sm=function(w,L){Em.usingClientEntryPoint=!0;try{return Tm.createRoot(w,L)}finally{Em.usingClientEntryPoint=!1}}}const $=w=>{if(isNaN(w))return"00:00:00.000";const L=Math.floor(w/3600),me=Math.floor(w%3600/60),Ee=Math.floor(w%60),fe=Math.round(w%1*1e3),Re=String(L).padStart(2,"0"),d=String(me).padStart(2,"0"),Q=String(Ee).padStart(2,"0"),he=String(fe).padStart(3,"0");return`${Re}:${d}:${Q}.${he}`},hi=w=>$(w),Y0=w=>$(w),re={debug:(...w)=>{},error:(...w)=>console.error(...w),warn:(...w)=>console.warn(...w),info:(...w)=>console.info(...w)};var ee=Zc();const W0=({videoRef:w,currentTime:L,duration:me,isPlaying:Ee,isMuted:fe=!1,onPlayPause:Re,onSeek:d,onToggleMute:Q})=>{var le;const he=ee.useRef(null),[te,bt]=ee.useState(!1),[I,H]=ee.useState(!1),[K,Oe]=ee.useState(null),[zt,qt]=ee.useState(!1),St=ee.useRef(!1),[Pe,_e]=ee.useState({x:0}),[ot,_]=ee.useState(0),ne=typeof window<"u"&&((le=window.MEDIA_DATA)==null?void 0:le.videoUrl)||"/videos/sample-video.mp4";ee.useEffect(()=>{if(bt((()=>{const q=navigator.userAgent||navigator.vendor||window.opera;return/iPad|iPhone|iPod/.test(q)&&!window.MSStream})()),typeof window<"u"){const q=localStorage.getItem("video_initialized")==="true";H(q)}},[]),ee.useEffect(()=>{Ee&&!I&&(H(!0),typeof window<"u"&&localStorage.setItem("video_initialized","true"))},[Ee,I]),ee.useEffect(()=>{const W=w.current;if(!W)return;W.setAttribute("playsinline","true"),W.setAttribute("webkit-playsinline","true"),W.setAttribute("x-webkit-airplay","allow");const q=()=>{St.current||(Oe(W.currentTime),typeof window<"u"&&(window.lastSeekedPosition=W.currentTime))},Ye=()=>{te&&(H(!0),localStorage.setItem("video_initialized","true"))},Fe=()=>{};return W.addEventListener("timeupdate",q),W.addEventListener("play",Ye),W.addEventListener("pause",Fe),()=>{W.removeEventListener("timeupdate",q),W.removeEventListener("play",Ye),W.removeEventListener("pause",Fe)}},[w,te,St]),ee.useEffect(()=>{Oe(L)},[L]);const De=me>0?L/me*100:0,Vt=W=>{W.preventDefault(),qt(!0),St.current=!0,Me(W);const q=Fe=>{St.current&&Me(Fe)},Ye=()=>{qt(!1),St.current=!1,document.removeEventListener("mousemove",q),document.removeEventListener("mouseup",Ye)};document.addEventListener("mousemove",q),document.addEventListener("mouseup",Ye)},Me=W=>{if(!he.current)return;const q=he.current.getBoundingClientRect(),Ye=Math.max(0,Math.min(1,(W.clientX-q.left)/q.width)),Fe=me*Ye;_e({x:W.clientX}),_(Fe),Oe(Fe),typeof window<"u"&&(window.lastSeekedPosition=Fe),d(Fe)},pe=W=>{if(!he.current||!W.touches[0])return;W.preventDefault(),qt(!0),St.current=!0,nt(W);const q=Fe=>{St.current&&nt(Fe)},Ye=()=>{qt(!1),St.current=!1,document.removeEventListener("touchmove",q),document.removeEventListener("touchend",Ye),document.removeEventListener("touchcancel",Ye)};document.addEventListener("touchmove",q,{passive:!1}),document.addEventListener("touchend",Ye),document.addEventListener("touchcancel",Ye)},nt=W=>{if(!he.current)return;const q="touches"in W?W.touches[0]:null;if(!q)return;W.preventDefault();const Ye=he.current.getBoundingClientRect(),Fe=Math.max(0,Math.min(1,(q.clientX-Ye.left)/Ye.width)),at=me*Fe;_e({x:q.clientX}),_(at),Oe(at),typeof window<"u"&&(window.lastSeekedPosition=at),d(at)},oe=W=>{if(!zt&&he.current){const q=he.current.getBoundingClientRect(),Ye=(W.clientX-q.left)/q.width,Fe=me*Ye;Oe(Fe),typeof window<"u"&&(window.lastSeekedPosition=Fe),d(Fe)}},Le=()=>{w.current&&(document.fullscreenElement?document.exitFullscreen():w.current.requestFullscreen())},Ke=()=>{const W=w.current;W&&(W.paused?te&&K!==null&&K>0?(W.currentTime=K,setTimeout(()=>{w.current&&w.current.play().then(()=>{var q;re.debug("iOS: Play started successfully at position:",(q=w.current)==null?void 0:q.currentTime),Re()}).catch(q=>{console.error("iOS: Error playing video:",q)})},50)):W.play().then(()=>{Re()}).catch(q=>{console.error("Error playing video:",q)}):(W.pause(),Re()))};return p.jsxs("div",{className:"video-player-container",children:[p.jsxs("video",{ref:w,preload:"auto",crossOrigin:"anonymous",onClick:Ke,playsInline:!0,"webkit-playsinline":"true","x-webkit-airplay":"allow",controls:!1,muted:fe,children:[p.jsx("source",{src:ne,type:"video/mp4"}),p.jsx("p",{children:"Your browser doesn't support HTML5 video."})]}),te&&!I&&!Ee&&p.jsx("div",{className:"ios-first-play-indicator",children:p.jsx("div",{className:"ios-play-message",children:"Tap Play to initialize video controls"})}),p.jsx("div",{className:`play-pause-indicator ${Ee?"pause-icon":"play-icon"}`}),p.jsxs("div",{className:"video-controls",children:[p.jsxs("div",{className:"video-time-display",children:[p.jsx("span",{className:"video-current-time",children:hi(L)}),p.jsxs("span",{className:"video-duration",children:["/ ",hi(me)]})]}),p.jsxs("div",{ref:he,className:`video-progress ${zt?"dragging":""}`,onClick:oe,onMouseDown:Vt,onTouchStart:pe,children:[p.jsx("div",{className:"video-progress-fill",style:{width:`${De}%`}}),p.jsx("div",{className:"video-scrubber",style:{left:`${De}%`}}),zt&&p.jsx("div",{className:"video-time-tooltip",style:{left:`${Pe.x}px`,transform:"translateX(-50%)"},children:$(ot)})]}),p.jsxs("div",{className:"video-controls-buttons",children:[Q&&p.jsx("button",{className:"mute-button","aria-label":fe?"Unmute":"Mute",onClick:Q,"data-tooltip":fe?"Unmute":"Mute",children:fe?p.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[p.jsx("line",{x1:"1",y1:"1",x2:"23",y2:"23"}),p.jsx("path",{d:"M9 9v3a3 3 0 0 0 5.12 2.12M15 9.34V4a3 3 0 0 0-5.94-.6"}),p.jsx("path",{d:"M17 16.95A7 7 0 0 1 5 12v-2m14 0v2a7 7 0 0 1-.11 1.23"}),p.jsx("line",{x1:"12",y1:"19",x2:"12",y2:"23"}),p.jsx("line",{x1:"8",y1:"23",x2:"16",y2:"23"})]}):p.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[p.jsx("polygon",{points:"11 5 6 9 2 9 2 15 6 15 11 19 11 5"}),p.jsx("path",{d:"M19.07 4.93a10 10 0 0 1 0 14.14M15.54 8.46a5 5 0 0 1 0 7.07"})]})}),p.jsx("button",{className:"fullscreen-button","aria-label":"Fullscreen",onClick:Le,"data-tooltip":"Toggle fullscreen",children:p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",children:p.jsx("path",{fillRule:"evenodd",d:"M3 4a1 1 0 011-1h4a1 1 0 010 2H6.414l2.293 2.293a1 1 0 01-1.414 1.414L5 6.414V8a1 1 0 01-2 0V4zm9 1a1 1 0 010-2h4a1 1 0 011 1v4a1 1 0 01-2 0V6.414l-2.293 2.293a1 1 0 11-1.414-1.414L13.586 5H12zm-9 7a1 1 0 012 0v1.586l2.293-2.293a1 1 0 011.414 1.414L6.414 15H8a1 1 0 010 2H4a1 1 0 01-1-1v-4zm13-1a1 1 0 011 1v4a1 1 0 01-1 1h-4a1 1 0 010-2h1.586l-2.293-2.293a1 1 0 011.414-1.414L15 13.586V12a1 1 0 011-1z",clipRule:"evenodd"})})})]})]})]})},tf=(w,L)=>{const me=Math.min(Math.max(w/(L||1),0),1),Ee=210,fe=40+Math.floor(me*20),Re=85+Math.floor(me*8);return`hsl(${Ee}, ${fe}%, ${Re}%)`},Cm=async(w,L)=>new Promise(me=>{const Ee=document.createElement("canvas");Ee.width=10,Ee.height=10;const fe=Ee.getContext("2d");if(fe){const d=tf(L,w.duration);fe.fillStyle=d,fe.fillRect(0,0,Ee.width,Ee.height)}const Re=Ee.toDataURL("image/png",.5);me(Re)}),to=({isOpen:w,onClose:L,title:me,children:Ee,actions:fe})=>{if(ee.useEffect(()=>{const d=Q=>{Q.key==="Escape"&&w&&L()};return document.addEventListener("keydown",d),w&&(document.body.style.overflow="hidden"),()=>{document.removeEventListener("keydown",d),document.body.style.overflow=""}},[w,L]),!w)return null;const Re=d=>{d.target===d.currentTarget&&L()};return p.jsx("div",{className:"modal-overlay",onClick:Re,children:p.jsxs("div",{className:"modal-container",onClick:d=>d.stopPropagation(),children:[p.jsxs("div",{className:"modal-header",children:[p.jsx("h2",{className:"modal-title",children:me}),p.jsx("button",{className:"modal-close-button",onClick:L,"aria-label":"Close modal",children:p.jsxs("svg",{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",children:[p.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),p.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),p.jsx("div",{className:"modal-content",children:Ee}),fe&&p.jsx("div",{className:"modal-actions",children:fe})]})})},xm=w=>new Promise(L=>setTimeout(L,w)),nf=async(w,L)=>{try{const me=await fetch(`/api/v1/media/${w}/trim_video`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(L)});if(!me.ok)if(me.status===400)try{return{status:400,error:(await me.json()).error||"An error occurred during processing",msg:"Video Processing Error",url_redirect:""}}catch{return{status:400,error:"An error occurred during video processing",msg:"Video Processing Error",url_redirect:""}}else if(me.status!==404)try{const fe=await me.json();return{status:me.status,error:fe.error||"An error occurred during processing",msg:"Video Processing Error",url_redirect:""}}catch{return{status:me.status,error:"An error occurred during video processing",msg:"Video Processing Error",url_redirect:""}}else return await xm(1500),{status:200,msg:"Video Processed Successfully",url_redirect:`./view?m=${w}`};const Ee=await me.json();return{status:200,msg:"Video Processed Successfully",url_redirect:Ee.url_redirect||`./view?m=${w}`,...Ee}}catch{return await xm(1500),{status:200,msg:"Video Processed Successfully",url_redirect:`./view?m=${w}`}}},wm="data:image/svg+xml,%3c?xml%20version='1.0'%20?%3e%3csvg%20style='enable-background:new%200%200%20512%20512;'%20version='1.1'%20viewBox='0%200%20512%20512'%20xml:space='preserve'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cstyle%20type='text/css'%3e%20.st0{fill:%23333333;}%20.st1{fill:none;stroke:%23333333;stroke-width:32;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;}%20%3c/style%3e%3cg%20id='Layer_1'/%3e%3cg%20id='Layer_2'%3e%3cg%3e%3cpath%20class='st0'%20d='M350.45,277.5l-164.08,94.73c-16.55,9.56-37.24-2.39-37.24-21.5V161.27c0-19.11,20.69-31.06,37.24-21.5%20l164.08,94.73C367,244.06,367,267.94,350.45,277.5z'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e",Rm="data:image/svg+xml,%3c?xml%20version='1.0'%20?%3e%3csvg%20style='enable-background:new%200%200%20512%20512;'%20version='1.1'%20viewBox='0%200%20512%20512'%20xml:space='preserve'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cstyle%20type='text/css'%3e.st0{fill:%23333333;}.st1{fill:none;stroke:%23333333;stroke-width:32;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;}%3c/style%3e%3cg%20id='Layer_1'/%3e%3cg%20id='Layer_2'%3e%3cg%3e%3cg%3e%3cpath%20class='st0'%20d='M208.15,380.19h-91.19c-5.7,0-10.32-4.62-10.32-10.32V142.13c0-5.7,4.62-10.32,10.32-10.32h91.19%20c5.7,0,10.32,4.62,10.32,10.32v227.74C218.47,375.57,213.85,380.19,208.15,380.19z'/%3e%3c/g%3e%3cg%3e%3cpath%20class='st0'%20d='M395.04,380.19h-91.19c-5.7,0-10.32-4.62-10.32-10.32V142.13c0-5.7,4.62-10.32,10.32-10.32h91.19%20c5.7,0,10.32,4.62,10.32,10.32v227.74C405.36,375.57,400.74,380.19,395.04,380.19z'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e",Dm="data:image/svg+xml,%3c?xml%20version='1.0'%20?%3e%3csvg%20style='enable-background:new%200%200%20512%20512;'%20version='1.1'%20viewBox='0%200%20512%20512'%20xml:space='preserve'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cstyle%20type='text/css'%3e.st0{fill:%23333333;}.st1{fill:none;stroke:%23333333;stroke-width:32;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;}%3c/style%3e%3cg%20id='Layer_1'/%3e%3cg%20id='Layer_2'%3e%3cg%3e%3cg%3e%3cpath%20class='st0'%20d='M85.26,277.5l164.08,94.73c16.55,9.56,37.24-2.39,37.24-21.5V161.27c0-19.11-20.69-31.06-37.24-21.5%20L85.26,234.5C68.71,244.06,68.71,267.94,85.26,277.5z'/%3e%3c/g%3e%3cg%3e%3cpath%20class='st0'%20d='M377.47,375.59h41.42c11.19,0,20.26-9.07,20.26-20.26V156.67c0-11.19-9.07-20.26-20.26-20.26h-41.42%20c-11.19,0-20.26,9.07-20.26,20.26v198.67C357.21,366.52,366.28,375.59,377.47,375.59z'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e",I0="data:image/svg+xml,%3c?xml%20version='1.0'%20?%3e%3csvg%20height='32'%20viewBox='0%200%2032%2032'%20width='32'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle/%3e%3cg%20data-name='1'%20id='_1'%3e%3cpath%20d='M27,3V29a1,1,0,0,1-1,1H6a1,1,0,0,1-1-1V27H7v1H25V4H7V7H5V3A1,1,0,0,1,6,2H26A1,1,0,0,1,27,3Z'/%3e%3cg%20transform='translate(2,%200)'%3e%3cpath%20d='M10.71,20.29,7.41,17H18V15H7.41l3.3-3.29L9.29,10.29l-5,5a1,1,0,0,0,0,1.42l5,5Z'%20id='logout_account_exit_door'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e",q0="data:image/svg+xml,%3c?xml%20version='1.0'%20?%3e%3csvg%20height='32'%20viewBox='0%200%2032%2032'%20width='32'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20data-name='1'%20id='_1'%3e%3cpath%20d='M5,3V29a1,1,0,0,0,1,1H26a1,1,0,0,0,1-1V25H25v3H7V4H25V7h2V3a1,1,0,0,0-1-1H6A1,1,0,0,0,5,3Z'/%3e%3cg%20transform='translate(28,%200)%20scale(-1,%201)'%3e%3cpath%20d='M10.71,20.29,7.41,17H18V15H7.41l3.3-3.29L9.29,10.29l-5,5a1,1,0,0,0,0,1.42l5,5Z'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e",G0="data:image/svg+xml,%3c?xml%20version='1.0'%20?%3e%3csvg%20height='32'%20viewBox='0%200%2032%2032'%20width='32'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20data-name='1'%20id='_1'%3e%3cpath%20d='M5,3V29a1,1,0,0,0,1,1H26a1,1,0,0,0,1-1V25H25v3H7V4H25V7h2V3a1,1,0,0,0-1-1H6A1,1,0,0,0,5,3Z'/%3e%3cg%20transform='translate(30,%200)%20scale(-1,%201)'%3e%3cpath%20d='M10.71,20.29,7.41,17H18V15H7.41l3.3-3.29L9.29,10.29l-5,5a1,1,0,0,0,0,1.42l5,5Z'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e",X0="data:image/svg+xml,%3c?xml%20version='1.0'%20?%3e%3csvg%20height='32'%20viewBox='0%200%2032%2032'%20width='32'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle/%3e%3cg%20data-name='1'%20id='_1'%3e%3cpath%20d='M27,3V29a1,1,0,0,1-1,1H6a1,1,0,0,1-1-1V27H7v1H25V4H7V7H5V3A1,1,0,0,1,6,2H26A1,1,0,0,1,27,3Z'/%3e%3cg%20transform='translate(2,%200)'%3e%3cpath%20d='M10.71,20.29,7.41,17H18V15H7.41l3.3-3.29L9.29,10.29l-5,5a1,1,0,0,0,0,1.42l5,5Z'%20id='logout_account_exit_door'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e",Q0={color:"#007bff",textDecoration:"none",fontWeight:"bold","&:hover":{textDecoration:"underline",color:"#0056b3"}},_m=w=>{let Re,d;if(w<=25)if(w<=0)Re="0%",d="none";else{const he=-50*((w-0)/25);Re=`${w}%`,d=`translateX(${he}%)`}else if(w>=75)if(w>=100)Re="100%",d="translateX(-100%)";else{const he=-50-50*((w-75)/25);Re=`${w}%`,d=`translateX(${he}%)`}else Re=`${w}%`,d="translateX(-50%)";return{left:Re,transform:d}},K0=({currentTime:w,duration:L,thumbnails:me,trimStart:Ee,trimEnd:fe,splitPoints:Re,zoomLevel:d,clipSegments:Q,onTrimStartChange:he,onTrimEndChange:te,onZoomChange:bt,onSeek:I,videoRef:H,onSave:K,onSaveACopy:Oe,onSaveSegments:zt,hasUnsavedChanges:qt=!1,isIOSUninitialized:St=!1,isPlaying:Pe,setIsPlaying:_e,onPlayPause:ot,isPlayingSegments:_=!1})=>{const ne=ee.useRef(null),De=ee.useRef(null),Vt=ee.useRef(null),[Me,pe]=ee.useState(null),[nt,oe]=ee.useState(!1),[Le,Ke]=ee.useState({x:0,y:0}),[le,W]=ee.useState(0),[q,Ye]=ee.useState(!1),[Fe,at]=ee.useState(30),[ct,We]=ee.useState(!1),[Ve,Ue]=ee.useState(null),[cn,et]=ee.useState(0),[Ht,gt]=ee.useState(!1),Qe=ee.useRef(null),Gt=h=>{const B=h;let D=null,T=null,x=le;const O=()=>{const c=B<0?Math.max(0,x+B):Math.min(L,x+B);x=c;const y=ct;if(I(c),W(c),et(c),ne.current){const S=ne.current.getBoundingClientRect(),A=c/L*100,ve=S.left+S.width*(A/100);Ke({x:ve,y:S.top-10});const z=Q.find(ue=>c>=ue.startTime&&c<=ue.endTime);if(z)pe(z.id),oe(!1);else{pe(null);const ue=Tt(c);at(ue),oe(!0)}}y&&H.current&&(H.current.play(),We(!0))};return{onMouseDown:c=>{c.stopPropagation(),c.preventDefault(),x=le,O(),D=setTimeout(()=>{T=setInterval(O,200)},750);const y=()=>{D&&(clearTimeout(D),D=null),T&&(clearInterval(T),T=null),document.removeEventListener("mouseup",y),document.removeEventListener("mouseleave",y)};document.addEventListener("mouseup",y),document.addEventListener("mouseleave",y)},onTouchStart:c=>{c.stopPropagation(),c.preventDefault(),x=le,O(),D=setTimeout(()=>{T=setInterval(O,200)},750);const y=()=>{D&&(clearTimeout(D),D=null),T&&(clearInterval(T),T=null),document.removeEventListener("touchend",y),document.removeEventListener("touchcancel",y)};document.addEventListener("touchend",y),document.addEventListener("touchcancel",y)},onClick:c=>{c.stopPropagation()}}},[rn,fn]=ee.useState(!1),[F,G]=ee.useState(!1),[Te,Ce]=ee.useState(!1),[Ze,st]=ee.useState(!1),[ht,Ge]=ee.useState(!1),[yt,rt]=ee.useState(!1),[tn,mn]=ee.useState(""),[Ot,Lt]=ee.useState(""),[hn,ia]=ee.useState(""),[va,Z]=ee.useState("save"),xe=L>0?w/L*100:0,Je=L>0?Ee/L*100:0,Rt=L>0?fe/L*100:0,Bt=async()=>{var h,B;fn(!1),st(!0),Z("save");try{const D=Q.map(c=>({startTime:$(c.startTime),endTime:$(c.endTime)})),T=typeof window<"u"&&((h=window.MEDIA_DATA)==null?void 0:h.mediaId)||null,x=typeof window<"u"&&((B=window.MEDIA_DATA)==null?void 0:B.redirectURL)||null;re.debug("Save request:",{mediaId:T,segments:D,saveAsCopy:!1,redirectURL:x});const O=await nf(T,{segments:D,saveAsCopy:!1});if(re.debug("Save response:",O),st(!1),O.status===200){const c=x||O.url_redirect;re.debug("Using redirect URL:",c),ia(c),mn("Video saved successfully!"),Ge(!0)}else if(O.status===400){const c=O.error||"An error occurred during processing";re.debug("Save error (400):",c),Lt(c),rt(!0)}else re.debug("Save error (unknown status):",O),Lt("An unexpected error occurred"),rt(!0)}catch(D){re.error("Error processing video:",D),st(!1);const T=D instanceof Error?D.message:"An error occurred during processing";Lt(T),rt(!0)}},Xt=async()=>{var h,B;G(!1),st(!0),Z("copy");try{const D=Q.map(c=>({startTime:$(c.startTime),endTime:$(c.endTime)})),T=typeof window<"u"&&((h=window.MEDIA_DATA)==null?void 0:h.mediaId)||null,x=typeof window<"u"&&((B=window.MEDIA_DATA)==null?void 0:B.redirectUserMediaURL)||null;re.debug("Save as copy request:",{mediaId:T,segments:D,saveAsCopy:!0,redirectUserMediaURL:x});const O=await nf(T,{segments:D,saveAsCopy:!0});if(re.debug("Save as copy response:",O),st(!1),O.status===200){const c=x||O.url_redirect;re.debug("Using redirect user media URL:",c),ia(c),mn("Video saved as a new copy!"),Ge(!0)}else if(O.status===400){const c=O.error||"An error occurred during processing";re.debug("Save as copy error (400):",c),Lt(c),rt(!0)}else re.debug("Save as copy error (unknown status):",O),Lt("An unexpected error occurred"),rt(!0)}catch(D){re.error("Error processing video:",D),st(!1);const T=D instanceof Error?D.message:"An error occurred during processing";Lt(T),rt(!0)}},Qt=async()=>{var h,B;Ce(!1),st(!0),Z("segments");try{const D=Q.map(c=>({startTime:$(c.startTime),endTime:$(c.endTime),name:c.name})),T=typeof window<"u"&&((h=window.MEDIA_DATA)==null?void 0:h.mediaId)||null,x=typeof window<"u"&&((B=window.MEDIA_DATA)==null?void 0:B.redirectUserMediaURL)||null;re.debug("Save segments request:",{mediaId:T,segments:D,saveAsCopy:!0,saveIndividualSegments:!0,redirectUserMediaURL:x});const O=await nf(T,{segments:D,saveAsCopy:!0,saveIndividualSegments:!0});if(re.debug("Save segments response:",O),st(!1),O.status===200){const c=x||O.url_redirect;re.debug("Using redirect user media URL for segments:",c),ia(c),mn(`${D.length} segments saved successfully!`),Ge(!0)}else if(O.status===400){const c=O.error||"An error occurred during processing";re.debug("Save segments error (400):",c),Lt(c),rt(!0)}else re.debug("Save segments error (unknown status):",O),Lt("An unexpected error occurred"),rt(!0)}catch(D){re.error("Error processing video segments:",D),st(!1);const T=D instanceof Error?D.message:"An error occurred during processing";Lt(T),rt(!0)}};ee.useEffect(()=>{if(Qe.current&&ne.current&&d>1){const h=Qe.current.clientWidth,B=ne.current.clientWidth,D=w/L*B,T=Math.max(0,D-h/2);Qe.current.scrollTo({left:T,behavior:"smooth"});const x=ne.current.getBoundingClientRect();Qe.current.getBoundingClientRect();const c=x.left-Qe.current.scrollLeft+xe/100*x.width;(Me!==null||nt)&&(Ke({x:c,y:x.top-10}),W(w))}},[w,d,L,Me,nt,xe]),ee.useEffect(()=>{const h=H.current;if(!h||!Ve||!ct||_)return;re.debug("Segment boundary check ACTIVATED for segment:",Ve.id,"Start:",$(Ve.startTime),"End:",$(Ve.endTime));const B=()=>{const D=Ve.endTime-h.currentTime;if(Math.round(D*10)%10===0&&re.debug("Segment playback - time remaining:",$(D),"Current:",$(h.currentTime),"End:",$(Ve.endTime),"ContinuePastBoundary:",Ht),h.currentTime>Ve.endTime){h.pause(),h.currentTime=Ve.endTime,We(!1),gt(!1),re.debug("Passed segment end - setting back to exact boundary:",$(Ve.endTime));return}if(Ve.endTime-h.currentTime<.05)if(Ht)re.debug("Continuing past segment boundary:",$(Ve.endTime)),h.currentTime>Ve.endTime&&(gt(!1),Ue(null),sessionStorage.removeItem("continuingPastSegment"));else{h.pause(),h.currentTime=Ve.endTime,We(!1),re.debug("Paused at segment end boundary:",$(Ve.endTime));const x=[...Q].sort((O,c)=>O.startTime-c.startTime).find(O=>O.startTime>Ve.endTime);x&&Math.abs(x.startTime-Ve.endTime)<.1&&(re.debug("Found adjacent next segment:",x.id),pe(x.id),Ue(x),et(x.startTime),W(x.startTime),h.currentTime=x.startTime)}};return h.addEventListener("timeupdate",B),()=>{h.removeEventListener("timeupdate",B)}},[Ve,ct,Ht,Q]),ee.useEffect(()=>{if(H.current)if(H.current.paused)H.current.paused&&ct&&(et(w),W(w),We(!1),re.debug("Video paused at:",$(w)));else{et(w),W(w),Me!==null&&We(!0);const h=Q.find(T=>w>=T.startTime&&w<=T.endTime),B=w/L*100;if(ne.current){const T=ne.current.offsetWidth,x=B/100*T;Ke({x,y:ne.current.getBoundingClientRect().top-10})}const D=sessionStorage.getItem("continuingPastSegment")==="true";if(h){const T=H.current,x=Ve&&Ve.id<0&&ct;if((Ve==null?void 0:Ve.id)!==h.id&&!x&&!D&&!Ht&&(re.debug(`Entered a new segment during playback: ${h.id}, setting as active`),Ue(h),pe(h.id),oe(!1),gt(!1),sessionStorage.removeItem("continuingPastSegment")),x&&T&&h){re.debug(`CUTAWAY BOUNDARY REACHED: Current position ${$(T.currentTime)} at segment ${h.id} - STOPPING at boundary ${$(h.startTime)}`),T.pause(),setTimeout(()=>{if(H.current){H.current.currentTime=h.startTime,I(h.startTime),et(h.startTime),W(h.startTime),gt(!1),pe(h.id),oe(!1);const c=()=>{H.current&&(H.current.currentTime=h.startTime,I(h.startTime),et(h.startTime),W(h.startTime),re.debug(`Position corrected to exact segment boundary: ${$(H.current.currentTime)} (target: ${$(h.startTime)})`))};setTimeout(c,10),setTimeout(c,20),setTimeout(c,50),setTimeout(c,100),setTimeout(c,200),H.current.addEventListener("seeked",c),H.current.addEventListener("canplay",c),H.current.addEventListener("waiting",c),setTimeout(()=>{H.current&&(H.current.removeEventListener("seeked",c),H.current.removeEventListener("canplay",c),H.current.removeEventListener("waiting",c))},300)}},10),We(!1),Ue(null);return}Ve===null&&ct===!0||D||x?(Me!==h.id||nt)&&(re.debug("Tooltip updated for segment during continued playback:",h.id,x?"(cutaway playback - keeping virtual segment)":""),pe(h.id),oe(!1),!x&&sessionStorage.getItem("lastSegmentId")!==h.id.toString()&&sessionStorage.removeItem("continuingPastSegment")):((Ve==null?void 0:Ve.id)!==h.id||nt)&&(re.debug("Playback moved into segment:",h.id),pe(h.id),Ue(h),oe(!1),sessionStorage.setItem("lastSegmentId",h.id.toString()))}else if(Ve!==null||!nt){pe(null),Ue(null);const T=Tt(w);at(T),T>=.5?oe(!0):oe(!1)}}},[w,ct,Ve,Me,Q]),ee.useEffect(()=>{const h=B=>{const D=B.target;q&&!D.closest(".zoom-dropdown-container")&&Ye(!1)};return document.addEventListener("mousedown",h),()=>{document.removeEventListener("mousedown",h)}},[q]),ee.useEffect(()=>()=>{},[Me,nt,ct]),ee.useEffect(()=>{const h=De.current,B=Vt.current,D=ne.current;if(!h||!B||!D)return;const T=x=>O=>{O.preventDefault();const c=D.getBoundingClientRect();let y=!0,S=x?Ee:fe;const A=ue=>new CustomEvent("trim-handle-event",{detail:{type:ue,isStart:x}});document.dispatchEvent(A("drag-start"));const ve=ue=>{if(!y)return;const ye=c.width,it=Math.max(0,Math.min(1,(ue.clientX-c.left)/ye))*L;typeof window<"u"&&(window.lastSeekedPosition=it),x?itEe&&(document.dispatchEvent(new CustomEvent("update-trim",{detail:{time:it,isStart:!1,recordHistory:!1}})),S=it)},z=()=>{y=!1,document.removeEventListener("mousemove",ve),document.removeEventListener("mouseup",z),x?document.dispatchEvent(new CustomEvent("update-trim",{detail:{time:S,isStart:!0,recordHistory:!0,action:"adjust_trim_start"}})):document.dispatchEvent(new CustomEvent("update-trim",{detail:{time:S,isStart:!1,recordHistory:!0,action:"adjust_trim_end"}})),document.dispatchEvent(A("drag-end"))};document.addEventListener("mousemove",ve),document.addEventListener("mouseup",z)};return h.addEventListener("mousedown",T(!0)),B.addEventListener("mousedown",T(!1)),()=>{h.removeEventListener("mousedown",T(!0)),B.removeEventListener("mousedown",T(!1))}},[L,Ee,fe,he,te]);const wn=()=>{const h=me.length||10;return Array.from({length:h}).map((B,D)=>{const T=L/h,x=D*T,O=x+T,c=(x+O)/2,y=tf(c,L);return p.jsx("div",{className:"timeline-thumbnail",style:{width:`${100/h}%`,backgroundColor:y}},D)})},Pt=()=>Re.map((h,B)=>{const D=h/L*100;return p.jsx("div",{className:"split-point",style:{left:`${D}%`}},B)}),Tt=h=>{const D=[...Q].sort((c,y)=>c.startTime-y.startTime),T=D.find(c=>c.startTime>h),x=[...D].reverse().find(c=>c.endTime{if(!ne.current)return;const B=Q.find(S=>{const A=h>=S.startTime&&h<=S.endTime,ve=Math.abs(h-S.startTime)<.001,z=Math.abs(h-S.endTime)<.001;return A||ve||z}),D=[...Q].sort((S,A)=>S.startTime-A.startTime),T=D.find(S=>S.startTime>h),x=[...D].reverse().find(S=>S.endTime1&&Qe.current?y=O.left-Qe.current.scrollLeft+O.width*(c/100):y=O.left+O.width*(c/100),Ke({x:y,y:O.top-10})},er=h=>{if(!ne.current||!Qe.current||St)return;const B=H.current&&!H.current.paused;gt(!1);const D=ne.current.getBoundingClientRect();let T;if(d>1){const c=Qe.current.scrollLeft,y=ne.current.clientWidth;T=(h.clientX-D.left+c)/y}else T=(h.clientX-D.left)/D.width;const x=T*L;re.debug("Timeline clicked at:",$(x),"distance from end:",$(L-x)),typeof window<"u"&&(window.lastSeekedPosition=x),I(x),W(x),et(x);const O=Q.find(c=>{const y=x>=c.startTime&&x<=c.endTime,S=Math.abs(x-c.startTime)<.01,A=Math.abs(x-c.endTime)<.01;return y||S||A});if(O&&Ue(O),H.current)if(_&&B){if(O){const y=[...Q].sort((S,A)=>S.startTime-A.startTime).findIndex(S=>S.id===O.id);if(y!==-1){const S=new CustomEvent("update-segment-index",{detail:{segmentIndex:y}});document.dispatchEvent(S),re.debug(`Segments playback mode: updating segment index to ${y} for timeline click in segment ${O.id}`)}}H.current.play().then(()=>{We(!0)}).catch(c=>{console.error("Error resuming segments playback:",c),We(!1)})}else B&&!_&&H.current.play().then(()=>{We(!0)}).catch(c=>{console.error("Error resuming playback:",c),We(!1)});if(h.target===ne.current||h.target.classList.contains("timeline-thumbnail"))if(O)pe(O.id),oe(!1);else{pe(null);const c=Tt(x);at(c);let y;if(d>1){const z=D.left-Qe.current.scrollLeft,ue=x/L;y=z+ue*D.width}else y=h.clientX;Ke({x:y,y:D.top-10}),oe(!0);const S=[...Q].sort((z,ue)=>z.startTime-ue.startTime),A=[...S].reverse().find(z=>z.endTimez.startTime>x);re.debug("Clicked in cutaway area:",{position:$(x),availableSpace:$(c),prevSegmentEnd:A?$(A.endTime):"none",nextSegmentStart:ve?$(ve.startTime):"none"})}},$n=(h,B)=>D=>{if(D.preventDefault(),D.stopPropagation(),!ne.current)return;ne.current.getBoundingClientRect().width;const x=Q.find(Zt=>Zt.id===h);if(!x)return;const O=x.startTime,c=x.endTime,y={...x};document.body.style.cursor="ew-resize";const S=document.createElement("div");S.style.position="fixed",S.style.top="0",S.style.left="0",S.style.width="100vw",S.style.height="100vh",S.style.zIndex="1000",S.style.cursor="ew-resize",document.body.appendChild(S);let A=!0,ve=O,z=c;document.dispatchEvent(new CustomEvent("segment-drag-start",{detail:{segmentId:h}}));const ue=Zt=>{if(!A||!ne.current)return;const Pn=ne.current.getBoundingClientRect(),be=Math.max(0,Math.min(1,(Zt-Pn.left)/Pn.width))*L,Rn=B?be:O,Ua=B?c:be;if(w>=Rn&&w<=Ua)pe(h),oe(!1);else{pe(null);const un=Tt(w);at(un),oe(!0)}const Ha=Q.filter(un=>un.id!==h);let ha=O,ya=c;if(B){ha=Math.min(be,c-.5);const _t=Ha.filter(oa=>oa.endTime<=O).sort((oa,hr)=>hr.endTime-oa.endTime)[0];_t&&ha<_t.endTime&&(ha=_t.endTime),_t&&Math.abs(ha-_t.endTime)<.3&&(ha=_t.endTime),ve=ha}else{ya=Math.max(be,O+.5);const _t=Ha.filter(oa=>oa.startTime>=c).sort((oa,hr)=>oa.startTime-hr.startTime)[0];_t&&ya>_t.startTime&&(ya=_t.startTime),_t&&Math.abs(ya-_t.startTime)<.3&&(ya=_t.startTime),z=ya}const $r=Q.map(un=>un.id===h?{...un,startTime:ha,endTime:ya}:un),yi=new CustomEvent("update-segments",{detail:{segments:$r,recordHistory:!1}});if(document.dispatchEvent(yi),Me===h&&H.current){const un=H.current.currentTime,_t=$r.find(za=>za.id===h);if(_t){const za=un>=_t.startTime&&un<=_t.endTime;re.debug(`During drag - playhead at ${$(un)} is ${za?"inside":"outside"} segment (${$(_t.startTime)} - ${$(_t.endTime)})`),!za&&ct&&(H.current.pause(),We(!1),Ue(null)),un<_t.startTime?(re.debug(`Adjusting display time to segment start: ${$(_t.startTime)}`),et(_t.startTime),W(_t.startTime)):un>_t.endTime&&(re.debug(`Adjusting display time to segment end: ${$(_t.endTime)}`),et(_t.endTime),W(_t.endTime))}}},ye=()=>{if(!A)return;A=!1,document.removeEventListener("mousemove",ze),document.removeEventListener("mouseup",it),document.removeEventListener("touchmove",Ft),document.removeEventListener("touchend",nn),document.removeEventListener("touchcancel",nn),document.body.style.cursor="",document.body.contains(S)&&document.body.removeChild(S);const Zt=Q.map(ft=>ft.id===h?{...ft,startTime:ve,endTime:z}:ft),Pn=B?"adjust_segment_start":"adjust_segment_end";if(document.dispatchEvent(new CustomEvent("update-segments",{detail:{segments:Zt,recordHistory:!0,action:Pn}})),Me===h&&H.current){const ft=H.current.currentTime,be=Zt.find(Rn=>Rn.id===h);if(be){const Rn=ft>=be.startTime&&ft<=be.endTime;re.debug(`Drag complete - playhead at ${$(ft)} is ${Rn?"inside":"outside"} segment (${$(be.startTime)} - ${$(be.endTime)})`);const Ua=ft>=y.startTime&&ft<=y.endTime;Rn?(!Ua&&Rn||Ua&&Rn&&(be.startTime!==y.startTime||be.endTime!==y.endTime))&&Ue(be):(ct&&(H.current.pause(),We(!1),Ue(null),gt(!1)),ftbe.endTime&&(re.debug(`Final adjustment - setting display time to segment end: ${$(be.endTime)}`),et(be.endTime),W(be.endTime)))}}},ze=Zt=>{ue(Zt.clientX)},it=()=>{ye()},Ft=Zt=>{Zt.touches.length>0&&(Zt.preventDefault(),ue(Zt.touches[0].clientX))},nn=()=>{ye()};document.addEventListener("mousemove",ze,{passive:!1}),document.addEventListener("mouseup",it),document.addEventListener("touchmove",Ft,{passive:!1}),document.addEventListener("touchend",nn),document.addEventListener("touchcancel",nn)},pa=h=>B=>{if(B.target.classList.contains("clip-segment-handle"))return;B.preventDefault(),B.stopPropagation(),gt(!1);const D=H.current&&!H.current.paused;pe(h);const T=Q.find(z=>z.id===h);if(!T)return;const O=B.currentTarget.getBoundingClientRect(),c=(B.clientX-O.left)/O.width,y=T.startTime+c*(T.endTime-T.startTime),S=Math.max(T.startTime,Math.min(T.endTime,y));if(W(S),et(S),H.current){const z=H.current.currentTime,ue=z>=T.startTime&&z<=T.endTime;re.debug(`Segment click - playhead at ${$(z)} is ${ue?"inside":"outside"} segment (${$(T.startTime)} - ${$(T.endTime)})`),ue||(Math.abs(z-T.startTime)ye.startTime-ze.startTime).findIndex(ye=>ye.id===h);if(ue!==-1){const ye=new CustomEvent("update-segment-index",{detail:{segmentIndex:ue}});document.dispatchEvent(ye)}H.current.play().then(()=>{We(!0)}).catch(ye=>{console.error("Error continuing segments playback after segment click:",ye)})}else D&&!_&&(Ue(T),gt(!1),H.current.play().then(()=>{We(!0)}).catch(z=>{console.error("Error resuming playback after segment click:",z)}));const A=B.clientX,ve=O.top-10;if(Ke({x:A,y:ve}),d>1&&ne.current&&Qe.current){ne.current.getBoundingClientRect();const z=ne.current.clientWidth,ue=Qe.current.clientWidth,ye=S/L*z,ze=Math.max(0,ye-ue/2);Qe.current.scrollTo({left:ze,behavior:"smooth"}),setTimeout(()=>{if(ne.current&&Qe.current){const it=ne.current.getBoundingClientRect(),nn=S/L*z-Qe.current.scrollLeft+it.left;Ke({x:nn,y:ve})}},300)}},tr=()=>Q.map((h,B)=>{const D=h.startTime/L*100,T=(h.endTime-h.startTime)/L*100,x=tf((h.startTime+h.endTime)/2,L);return p.jsxs("div",{className:`clip-segment ${Me===h.id?"selected":""}`,style:{left:`${D}%`,width:`${T}%`,backgroundColor:x,borderWidth:"2px",borderStyle:"solid",borderColor:"rgba(0, 0, 0, 0.5)"},onClick:pa(h.id),children:[p.jsxs("div",{className:"clip-segment-info",children:[p.jsxs("div",{className:"clip-segment-name",children:["Segment ",B+1]}),p.jsxs("div",{className:"clip-segment-time",children:[hi(h.startTime)," - ",hi(h.endTime)]}),p.jsxs("div",{className:"clip-segment-duration",children:["Duration: ",hi(h.endTime-h.startTime)]})]}),_?null:p.jsxs(p.Fragment,{children:[p.jsx("div",{className:"clip-segment-handle left",title:"Resize segment start",onMouseDown:O=>{O.stopPropagation(),$n(h.id,!0)(O)},onTouchStart:O=>{O.stopPropagation(),$n(h.id,!0)(O)}}),p.jsx("div",{className:"clip-segment-handle right",title:"Resize segment end",onMouseDown:O=>{O.stopPropagation(),$n(h.id,!1)(O)},onTouchStart:O=>{O.stopPropagation(),$n(h.id,!1)(O)}})]})]},h.id)});ee.useEffect(()=>{const h=B=>{const{segmentId:D}=B.detail;if(Q.filter(x=>x.id!==D).length===0){const x={id:Date.now(),name:"Full Video",startTime:0,endTime:L,thumbnail:""},O=new CustomEvent("update-segments",{detail:{segments:[x],recordHistory:!0,action:"create_full_video_segment"}});if(document.dispatchEvent(O),pe(x.id),oe(!1),W(w),et(w),Ue(x),ne.current){const c=ne.current.getBoundingClientRect(),y=w/L*100,S=c.left+c.width*(y/100);Ke({x:S,y:c.top-10}),re.debug("Created full video segment:",{id:x.id,duration:$(L),currentPosition:$(w)})}}else if(Me===D){if(!Q.find(c=>c.id===D))return;const O=Tt(w);if(pe(null),oe(!0),at(O),ne.current){const c=ne.current.getBoundingClientRect(),y=w/L*100,S=c.left+c.width*(y/100);Ke({x:S,y:c.top-10}),re.debug("Segment deleted, showing cutaway tooltip:",{position:$(w),availableSpace:$(O)})}}};return document.addEventListener("delete-segment",h),()=>{document.removeEventListener("delete-segment",h)}},[Me,Q,w,L,ne]),ee.useEffect(()=>{const h=H.current;if(!h)return;const B=()=>{if(!H.current)return;const T=H.current,x=T.currentTime;gt(!1);let O=L,c=null,y=null;c=Q.find(A=>{const ve=x>=A.startTime&&x<=A.endTime,z=Math.abs(x-A.startTime)<.001,ue=Math.abs(x-A.endTime)<.001;return ve||z||ue}),y=Q.filter(A=>{const ve=A.startTime>x,z=Math.abs(A.startTime-x)>.001;return ve&&z}).sort((A,ve)=>A.startTime-ve.startTime)[0],c?(O=c.endTime,Ue(c)):y&&(O=y.startTime);const S=()=>{if(!T)return;const A=T.currentTime;if(O-A<=.001||A>=O){T.pause();const z=()=>{T&&(T.currentTime=O,I(O),et(O),W(O),re.debug("Position verification:",{target:$(O),actual:$(T.currentTime),difference:Math.abs(T.currentTime-O).toFixed(3)}))};z(),setTimeout(z,10),setTimeout(z,20),setTimeout(z,50),c?(pe(c.id),oe(!1)):y?(pe(y.id),oe(!1),Ue(y)):(pe(null),oe(!0),Ue(null)),T.removeEventListener("timeupdate",S),_e(!1),We(!1),gt(!1);return}};T.addEventListener("timeupdate",S),T.play().then(()=>{_e(!0),We(!0),re.debug("Playback started:",{from:$(x),to:$(O),currentSegment:c?`Segment ${c.id}`:"None",nextSegment:y?`Segment ${y.id}`:"None"})}).catch(A=>{console.error("Error playing video:",A)})},D=()=>{We(!1)};return h.addEventListener("play",B),h.addEventListener("pause",D),()=>{h.removeEventListener("play",B),h.removeEventListener("pause",D)}},[Q,L,I]);const Fr=h=>{if(!ne.current)return;const B=ne.current.getBoundingClientRect(),T=(h.clientX-B.left)/B.width*L,x=Math.max(0,Math.min(L,T));typeof window<"u"&&(window.lastSeekedPosition=x)},[Vr,wa]=ee.useState(!1),ja=ee.useRef(!1),Br=h=>{if(St)return;h.stopPropagation(),h.preventDefault(),wa(!0),ja.current=!0,Dt(w);const B=T=>{if(!ne.current||!Qe.current)return;const x=ne.current.getBoundingClientRect();let O;if(d>1){const y=Qe.current.scrollLeft,S=ne.current.clientWidth;O=(T.clientX-x.left+y)/S}else O=(T.clientX-x.left)/x.width;O=Math.max(0,Math.min(1,O));const c=O*L;W(c),et(c),Dt(c),typeof window<"u"&&(window.lastSeekedPosition=c),I(c)},D=()=>{wa(!1),ja.current=!1,document.removeEventListener("mousemove",B),document.removeEventListener("mouseup",D)};document.addEventListener("mousemove",B),document.addEventListener("mouseup",D)},ma=h=>{if(St)return;h.stopPropagation(),h.preventDefault(),wa(!0),ja.current=!0,Dt(w);const B=T=>{if(!ne.current||!Qe.current||!T.touches[0])return;const x=ne.current.getBoundingClientRect();let O;if(d>1){const y=Qe.current.scrollLeft,S=ne.current.clientWidth;O=(T.touches[0].clientX-x.left+y)/S}else O=(T.touches[0].clientX-x.left)/x.width;O=Math.max(0,Math.min(1,O));const c=O*L;W(c),et(c),Dt(c),typeof window<"u"&&(window.lastSeekedPosition=c),I(c)},D=()=>{wa(!1),ja.current=!1,document.removeEventListener("touchmove",B),document.removeEventListener("touchend",D),document.removeEventListener("touchcancel",D)};document.addEventListener("touchmove",B,{passive:!1}),document.addEventListener("touchend",D),document.addEventListener("touchcancel",D)};return ee.useEffect(()=>{},[hn,va,ht]),ee.useEffect(()=>{let h,B;if(ht&&hn){let D=10;h=setInterval(()=>{D--;const T=document.querySelector(".countdown");T&&(T.textContent=D.toString()),D<=0&&clearInterval(h)},1e3),B=setTimeout(()=>{K&&K(),window.location.href=hn},1e4)}return()=>{h&&clearInterval(h),B&&clearTimeout(B)}},[ht,hn,K]),p.jsxs("div",{className:`timeline-container-card ${_?"segments-playback-mode":""}`,children:[p.jsxs("div",{className:"timeline-header",children:[p.jsx("div",{className:"timeline-title",children:p.jsx("span",{className:"timeline-title-text",children:"Timeline"})}),p.jsxs("div",{className:"duration-time",children:["Total Segments:"," ",p.jsx("span",{children:$(Q.reduce((h,B)=>h+(B.endTime-B.startTime),0))})]})]}),p.jsx("div",{ref:Qe,className:`timeline-scroll-container ${_?"segments-playback-mode":""}`,style:{overflow:d>1?"auto":"hidden"},children:p.jsxs("div",{ref:ne,className:"timeline-container",onClick:er,onMouseMove:Fr,style:{width:`${d*100}%`,cursor:"pointer"},children:[p.jsxs("div",{className:"timeline-marker",style:{left:`${xe}%`},children:[p.jsx("div",{className:"timeline-marker-head",onClick:h=>{if(h.stopPropagation(),Q.find(B=>w>=B.startTime&&w<=B.endTime),Me||nt){pe(null),oe(!1);return}else Dt(w),re.debug("Opening tooltip at:",$(w))},children:p.jsx("span",{className:"timeline-marker-head-icon",children:Me||nt?"-":"+"})}),_?null:p.jsx("div",{className:`timeline-marker-drag ${Vr?"dragging":""}`,onMouseDown:Br,onTouchStart:ma,children:p.jsx("span",{className:"timeline-marker-drag-icon",children:"â‹®"})})]}),Q.length===0&&p.jsxs(p.Fragment,{children:[p.jsx("div",{className:"trim-line-marker",style:{left:`${Je}%`},children:p.jsx("div",{ref:De,className:"trim-handle left"})}),p.jsx("div",{className:"trim-line-marker",style:{left:`${Rt}%`},children:p.jsx("div",{ref:Vt,className:"trim-handle right"})})]}),tr(),Pt(),wn(),Me!==null&&p.jsxs("div",{className:`segment-tooltip two-row-tooltip ${_?"segments-playback-mode":""}`,style:{position:"absolute",..._m(xe)},onClick:h=>{_&&(h.stopPropagation(),h.preventDefault())},children:[p.jsxs("div",{className:"tooltip-row",children:[p.jsx("button",{className:`tooltip-time-btn ${_?"disabled":""}`,"data-tooltip":_?"Disabled during preview":"Seek -50ms (click or hold)",disabled:_,..._?{}:Gt(-.05),style:{userSelect:"none",WebkitUserSelect:"none",WebkitTouchCallout:"none",touchAction:"manipulation",cursor:_?"not-allowed":"pointer",WebkitTapHighlightColor:"transparent"},children:"-50ms"}),p.jsx("div",{className:`tooltip-time-display ${_?"disabled":""}`,style:{pointerEvents:_?"none":"auto",cursor:_?"not-allowed":"default",opacity:_?.6:1,userSelect:"none",WebkitUserSelect:"none"},onClick:h=>{_&&(h.stopPropagation(),h.preventDefault())},children:$(cn)}),p.jsx("button",{className:`tooltip-time-btn ${_?"disabled":""}`,"data-tooltip":_?"Disabled during preview":"Seek +50ms (click or hold)",disabled:_,..._?{}:Gt(.05),style:{userSelect:"none",WebkitUserSelect:"none",WebkitTouchCallout:"none",touchAction:"manipulation",cursor:_?"not-allowed":"pointer",WebkitTapHighlightColor:"transparent"},children:"+50ms"})]}),p.jsxs("div",{className:"tooltip-row tooltip-actions",children:[p.jsx("button",{className:`tooltip-action-btn delete ${_?"disabled":""}`,"data-tooltip":_?"Disabled during preview":"Delete segment",disabled:_,style:{userSelect:"none",WebkitUserSelect:"none",WebkitTouchCallout:"none",touchAction:"manipulation",cursor:_?"not-allowed":"pointer",WebkitTapHighlightColor:"transparent"},onClick:h=>{h.stopPropagation();const B=new CustomEvent("delete-segment",{detail:{segmentId:Me}});document.dispatchEvent(B)},children:p.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[p.jsx("path",{d:"M3 6h18"}),p.jsx("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"}),p.jsx("line",{x1:"10",y1:"11",x2:"10",y2:"17"}),p.jsx("line",{x1:"14",y1:"11",x2:"14",y2:"17"})]})}),p.jsx("button",{className:`tooltip-action-btn scissors ${_?"disabled":""}`,"data-tooltip":_?"Disabled during preview":"Split segment at current position",style:{userSelect:"none",WebkitUserSelect:"none",WebkitTouchCallout:"none",touchAction:"manipulation",cursor:_?"not-allowed":"pointer",WebkitTapHighlightColor:"transparent"},disabled:_,onClick:h=>{h.stopPropagation();const B=new CustomEvent("split-segment",{detail:{segmentId:Me,time:le}});document.dispatchEvent(B)},children:p.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[p.jsx("circle",{cx:"6",cy:"6",r:"3"}),p.jsx("circle",{cx:"6",cy:"18",r:"3"}),p.jsx("line",{x1:"20",y1:"4",x2:"8.12",y2:"15.88"}),p.jsx("line",{x1:"14.47",y1:"14.48",x2:"20",y2:"20"}),p.jsx("line",{x1:"8.12",y1:"8.12",x2:"12",y2:"12"})]})}),p.jsx("button",{className:`tooltip-action-btn play-from-start ${_?"disabled":""}`,"data-tooltip":_?"Disabled during preview":"Play segment from beginning",style:{userSelect:"none",WebkitUserSelect:"none",WebkitTouchCallout:"none",touchAction:"manipulation",cursor:_?"not-allowed":"pointer",WebkitTapHighlightColor:"transparent"},disabled:_,onClick:h=>{h.stopPropagation();const B=Q.find(D=>D.id===Me);if(B&&H.current){if(gt(!0),Math.abs(H.current.currentTime-B.endTime)<.05){re.debug(`Already at end boundary (${$(H.current.currentTime)}), nudging position back slightly`);const D=Math.max(B.startTime,B.endTime-.1);H.current.currentTime=D,I(D),W(D),re.debug(`Position adjusted to ${$(D)}`)}else I(B.startTime),W(B.startTime);Ue(B),H.current.play().then(()=>{We(!0)}).catch(D=>{console.error("Error playing from beginning:",D)})}},children:p.jsx("img",{src:Dm,alt:"Play from beginning",style:{width:"24px",height:"24px"}})}),p.jsx("button",{className:`tooltip-action-btn ${Pe?"pause":"play"} ${_?"disabled":""}`,"data-tooltip":_?"Disabled during preview":Pe?"Pause playback":"Play from current position",style:{userSelect:"none",WebkitUserSelect:"none",WebkitTouchCallout:"none",touchAction:"manipulation",cursor:_?"not-allowed":"pointer",WebkitTapHighlightColor:"transparent"},disabled:_,onClick:h=>{h.stopPropagation(),Pe?H.current&&(H.current.pause(),We(!1),gt(!1)):ot()},children:Pe?p.jsx("img",{src:Rm,alt:"Pause",style:{width:"24px",height:"24px"}}):p.jsx("img",{src:wm,alt:"Play",style:{width:"24px",height:"24px"}})}),p.jsx("button",{className:`tooltip-action-btn set-in ${_?"disabled":""}`,style:{userSelect:"none",WebkitUserSelect:"none",WebkitTouchCallout:"none",touchAction:"manipulation",cursor:_?"not-allowed":"pointer",WebkitTapHighlightColor:"transparent"},"data-tooltip":_?"Disabled during preview":"Set start point at current position",disabled:_,onClick:h=>{if(h.stopPropagation(),Q.find(D=>D.id===Me)){const D=Q.map(x=>x.id===Me?{...x,startTime:le{if(h.stopPropagation(),Q.find(D=>D.id===Me)){const D=Q.map(x=>x.id===Me?{...x,endTime:le>x.startTime+.5?le:x.startTime+.5}:x),T=new CustomEvent("update-segments",{detail:{segments:D,recordHistory:!0,action:"adjust_end_time"}});document.dispatchEvent(T)}},children:p.jsx("img",{src:I0,alt:"Set end point",style:{width:"24px",height:"24px"}})})]})]}),nt&&Me===null&&p.jsxs("div",{className:`empty-space-tooltip two-row-tooltip ${_?"segments-playback-mode":""}`,style:{position:"absolute",..._m(xe)},onClick:h=>{_&&(h.stopPropagation(),h.preventDefault())},children:[p.jsxs("div",{className:"tooltip-row",children:[p.jsx("button",{className:`tooltip-time-btn ${_?"disabled":""}`,"data-tooltip":_?"Disabled during preview":"Seek -50ms (click or hold)",disabled:_,..._?{}:Gt(-.05),style:{userSelect:"none",WebkitUserSelect:"none",WebkitTouchCallout:"none",touchAction:"manipulation",cursor:_?"not-allowed":"pointer",WebkitTapHighlightColor:"transparent"},children:"-50ms"}),p.jsx("div",{className:`tooltip-time-display ${_?"disabled":""}`,style:{pointerEvents:_?"none":"auto",cursor:_?"not-allowed":"default",opacity:_?.6:1,userSelect:"none",WebkitUserSelect:"none"},onClick:h=>{_&&(h.stopPropagation(),h.preventDefault())},children:$(le)}),p.jsx("button",{className:`tooltip-time-btn ${_?"disabled":""}`,style:{userSelect:"none",WebkitUserSelect:"none",WebkitTouchCallout:"none",touchAction:"manipulation",cursor:_?"not-allowed":"pointer",WebkitTapHighlightColor:"transparent"},"data-tooltip":_?"Disabled during preview":"Seek +50ms (click or hold)",disabled:_,..._?{}:Gt(.05),children:"+50ms"})]}),p.jsxs("div",{className:"tooltip-row tooltip-actions",children:[p.jsxs("button",{className:`tooltip-action-btn new-segment ${Fe<.5||_?"disabled":""}`,style:{userSelect:"none",WebkitUserSelect:"none",WebkitTouchCallout:"none",touchAction:"manipulation",cursor:_?"not-allowed":"pointer",WebkitTapHighlightColor:"transparent"},"data-tooltip":_?"Disabled during preview":Fe<.5?"Not enough space for new segment":"Create new segment",disabled:Fe<.5||_,onClick:async h=>{if(h.stopPropagation(),Fe<.5)return;const B=le,D=B+Fe,T={id:Date.now(),name:"segment",startTime:B,endTime:D,thumbnail:""},x=[...Q,T],O=new CustomEvent("update-segments",{detail:{segments:x,recordHistory:!0,action:"create_segment"}});document.dispatchEvent(O),oe(!1),setTimeout(()=>{const c=x[x.length-1];c&&(pe(c.id),re.debug("Created and selected new segment:",c.id))},100)},children:[p.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[p.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2"}),p.jsx("line",{x1:"12",y1:"8",x2:"12",y2:"16"}),p.jsx("line",{x1:"8",y1:"12",x2:"16",y2:"12"})]}),p.jsx("span",{className:"tooltip-btn-text",children:"New"})]}),p.jsx("button",{className:`tooltip-action-btn play-from-start ${_?"disabled":""}`,"data-tooltip":_?"Disabled during preview":"Play from beginning of cutaway",style:{userSelect:"none",WebkitUserSelect:"none",WebkitTouchCallout:"none",touchAction:"manipulation",cursor:_?"not-allowed":"pointer",WebkitTapHighlightColor:"transparent"},disabled:_,onClick:h=>{if(h.stopPropagation(),H.current){const B=le;gt(!0);const D=[...Q].sort((A,ve)=>A.startTime-ve.startTime),T=[...D].reverse().find(A=>A.endTimeA.startTime>B),c=O?O.startTime:L,y={id:-999,name:"Cutaway",startTime:x,endTime:c,thumbnail:""};I(x),W(x),We(!1),setTimeout(()=>{Ue(y)},0);const S=()=>{if(!H.current)return;const A=H.current.currentTime,ve=[...Q].sort((ze,it)=>ze.startTime-it.startTime),z=ve.find(ze=>ze.startTime>A-.3),ue=z&&A>=z.startTime-.25&&A<=z.startTime+.1&&!Ht;z&&A>=z.startTime-.25&&A<=z.startTime+.1&&re.debug(`Approaching boundary at ${$(z.startTime)}, continuePastBoundary=${Ht}, willStop=${ue}`);const ye=ve.find(ze=>A>=ze.startTime&&A<=ze.endTime);if(ye&&(Ve==null?void 0:Ve.id)!==ye.id){re.debug(`Entered segment ${ye.id} during cutaway playback`),Ue(ye),pe(ye.id),oe(!1),H.current.removeEventListener("timeupdate",S),gt(!1),sessionStorage.removeItem("continuingPastSegment");return}if(ue&&z){re.debug(`CUTAWAY MANUAL BOUNDARY CHECK: Current position ${$(A)} approaching segment at ${$(z.startTime)} (distance: ${Math.abs(A-z.startTime).toFixed(3)}s) - STOPPING`),H.current.pause(),setTimeout(()=>{if(H.current){H.current.currentTime=z.startTime,I(z.startTime),et(z.startTime),W(z.startTime),gt(!1),pe(z.id),oe(!1),Ue(z);const ze=()=>{H.current&&(H.current.currentTime=z.startTime,I(z.startTime),et(z.startTime),W(z.startTime),re.debug(`Position corrected to exact segment boundary: ${$(H.current.currentTime)} (target: ${$(z.startTime)})`))};setTimeout(ze,10),setTimeout(ze,20),setTimeout(ze,50),setTimeout(ze,100),setTimeout(ze,200),H.current.addEventListener("seeked",ze),H.current.addEventListener("canplay",ze),H.current.addEventListener("waiting",ze),setTimeout(()=>{H.current&&(H.current.removeEventListener("seeked",ze),H.current.removeEventListener("canplay",ze),H.current.removeEventListener("waiting",ze))},300)}},10),We(!1),Ue(null),H.current.removeEventListener("timeupdate",S);return}};H.current.addEventListener("timeupdate",S),setTimeout(()=>{H.current&&H.current.play().then(()=>{We(!0),re.debug("CUTAWAY PLAYBACK STARTED:",$(x),"to",$(c),T?`(after segment ${T.id}, offset +25ms from ${$(T.endTime)})`:"(from video start)",O?`(will stop at segment ${O.id})`:"(will play to end)")}).catch(A=>{console.error("Error playing cutaway:",A)})},50)}},children:p.jsx("img",{src:Dm,alt:"Play from beginning",style:{width:"24px",height:"24px"}})}),p.jsx("button",{className:`tooltip-action-btn ${Pe?"pause":"play"} ${_?"disabled":""}`,"data-tooltip":_?"Disabled during preview":Pe?"Pause playback":"Play from here until next segment",style:{userSelect:"none",WebkitUserSelect:"none",WebkitTouchCallout:"none",touchAction:"manipulation",cursor:_?"not-allowed":"pointer",WebkitTapHighlightColor:"transparent"},disabled:_,onClick:h=>{h.stopPropagation(),Pe?H.current&&(H.current.pause(),We(!1),gt(!1)):ot()},children:Pe?p.jsx("img",{src:Rm,alt:"Pause",style:{width:"24px",height:"24px"}}):p.jsx("img",{src:wm,alt:"Play",style:{width:"24px",height:"24px"}})}),p.jsx("button",{className:`tooltip-action-btn segment-end ${_?"disabled":""}`,style:{userSelect:"none",WebkitUserSelect:"none",WebkitTouchCallout:"none",touchAction:"manipulation",cursor:_?"not-allowed":"pointer",WebkitTapHighlightColor:"transparent"},"data-tooltip":_?"Disabled during preview":"Adjust end of previous segment",disabled:_,onClick:h=>{h.stopPropagation();const D=[...Q].sort((T,x)=>T.startTime-x.startTime).filter(T=>T.endTime<=le).sort((T,x)=>x.endTime-T.endTime)[0];if(D){const T=Q.map(O=>O.id===D.id?{...O,endTime:le}:O),x=new CustomEvent("update-segments",{detail:{segments:T,recordHistory:!0,action:"adjust_previous_end_time"}});document.dispatchEvent(x),re.debug("Adjusted end of previous segment to:",$(le)),pe(D.id),oe(!1)}else if(Q.length>0){const T=[...Q].sort((c,y)=>c.startTime-y.startTime);let x=!1,O=0;for(let c=0;cy&&leS.endTime-y.endTime)[0];if(c&&c.endTimeA.id===c.id?{...A,endTime:L}:A),S=new CustomEvent("update-segments",{detail:{segments:y,recordHistory:!0,action:"extend_last_segment"}});document.dispatchEvent(S),pe(c.id),oe(!1)}}}else if(le>0){const T={id:Date.now(),name:"segment",startTime:0,endTime:le,thumbnail:""},x=new CustomEvent("update-segments",{detail:{segments:[T],recordHistory:!0,action:"create_segment_from_start"}});document.dispatchEvent(x),re.debug("Created new segment from start to:",$(le)),pe(T.id),oe(!1)}},children:p.jsx("img",{src:X0,alt:"Set end point",style:{width:"24px",height:"24px"}})}),p.jsx("button",{className:`tooltip-action-btn segment-start ${_?"disabled":""}`,"data-tooltip":_?"Disabled during preview":"Adjust start of next segment",style:{userSelect:"none",WebkitUserSelect:"none",WebkitTouchCallout:"none",touchAction:"manipulation",cursor:_?"not-allowed":"pointer",WebkitTapHighlightColor:"transparent"},disabled:_,onClick:h=>{h.stopPropagation();const D=[...Q].sort((T,x)=>T.startTime-x.startTime).filter(T=>T.startTime>=le).sort((T,x)=>T.startTime-x.startTime)[0];if(D){const T=Q.map(O=>O.id===D.id?{...O,startTime:le}:O),x=new CustomEvent("update-segments",{detail:{segments:T,recordHistory:!0,action:"adjust_next_start_time"}});document.dispatchEvent(x),re.debug("Adjusted start of next segment to:",$(le)),pe(D.id),oe(!1)}else if(Q.length>0){const T=[...Q].sort((c,y)=>c.startTime-y.startTime);let x=!1,O=0;for(let c=0;cy&&leT[T.length-1].endTime){const c={id:Date.now(),name:"segment",startTime:le,endTime:L,thumbnail:""},y=[...Q,c],S=new CustomEvent("update-segments",{detail:{segments:y,recordHistory:!0,action:"create_segment_to_end"}});document.dispatchEvent(S),re.debug("Created new segment from",$(le),"to end"),pe(c.id),oe(!1)}else{const c=T[0];if(c&&c.startTime>0){const y=Q.map(A=>A.id===c.id?{...A,startTime:0}:A),S=new CustomEvent("update-segments",{detail:{segments:y,recordHistory:!0,action:"extend_first_segment"}});document.dispatchEvent(S),pe(c.id),oe(!1)}}}else if(le{if(h.key==="Enter"){const B=h.currentTarget.value;try{const D=B.split(":");let T=0,x=0,O=0,c=0;if(D.length===3){T=parseInt(D[0]),x=parseInt(D[1]);const S=D[2].split(".");O=parseInt(S[0]),S.length>1&&(c=parseInt(S[1].padEnd(3,"0").substring(0,3)))}else if(D.length===2){x=parseInt(D[0]);const S=D[1].split(".");O=parseInt(S[0]),S.length>1&&(c=parseInt(S[1].padEnd(3,"0").substring(0,3)))}const y=T*3600+x*60+O+c/1e3;if(!isNaN(y)&&y>=0&&y<=L){I(y);const S=A=>{const ve=Q.find(z=>{const ue=A>=z.startTime&&A<=z.endTime,ye=Math.abs(A-z.startTime)<.001,ze=Math.abs(A-z.endTime)<.001;return ue||ye||ze});if(ne.current&&Qe.current){const z=ne.current.getBoundingClientRect();let ue;if(d>1)ue=z.left-Qe.current.scrollLeft+A/L*z.width;else{const ye=A/L;ue=z.left+z.width*ye}Ke({x:ue,y:z.top-10}),W(A),ve?(pe(ve.id),oe(!1)):(pe(null),oe(!0))}};setTimeout(()=>S(y),10)}}catch(D){console.error("Invalid time format:",D)}}}}),p.jsx("div",{className:"time-button-group",children:(()=>{const h=()=>{const B=Q.find(D=>{const T=w>=D.startTime&&w<=D.endTime,x=Math.abs(w-D.startTime)<.001,O=Math.abs(w-D.endTime)<.001;return T||x||O});if(ne.current&&Qe.current){const D=ne.current.getBoundingClientRect();let T;if(d>1)T=D.left-Qe.current.scrollLeft+w/L*D.width;else{const x=w/L;T=D.left+D.width*x}if(Ke({x:T,y:D.top-10}),W(w),B)pe(B.id),oe(!1);else{const x=Tt(w);at(x),x>=.5?(pe(null),oe(!0)):(pe(null),oe(!1))}}};return p.jsxs(p.Fragment,{children:[p.jsx("button",{className:"time-button",onClick:()=>{I(w-.01),setTimeout(h,10)},"data-tooltip":"Move back 10ms",children:"-10ms"}),p.jsx("button",{className:"time-button",onClick:()=>{I(w-.001),setTimeout(h,10)},"data-tooltip":"Move back 1ms",children:"-1ms"}),p.jsx("button",{className:"time-button",onClick:()=>{I(w+.001),setTimeout(h,10)},"data-tooltip":"Move forward 1ms",children:"+1ms"}),p.jsx("button",{className:"time-button",onClick:()=>{I(w+.01),setTimeout(h,10)},"data-tooltip":"Move forward 10ms",children:"+10ms"})]})})()})]}),p.jsxs("div",{className:"controls-right",children:[p.jsxs("div",{className:"zoom-dropdown-container",children:[p.jsxs("button",{className:"zoom-button","data-tooltip":"Select zoom level",onClick:()=>Ye(!q),children:["Zoom ",d,"x",p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:p.jsx("polyline",{points:"6 9 12 15 18 9"})})]}),q&&p.jsx("div",{className:"zoom-dropdown",style:{position:"absolute",top:"100%",left:0,zIndex:1e3},children:[1,2,4,8,16,32,64,128,256,512,1024,2048,4096].map(h=>p.jsxs("div",{className:`zoom-option ${d===h?"selected":""}`,onClick:()=>{bt(h),Ye(!1)},children:[d===h&&p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:p.jsx("polyline",{points:"20 6 9 17 4 12"})}),"Zoom ",h,"x"]},h))})]}),p.jsxs("div",{className:"save-buttons-row",children:[K&&p.jsx("button",{onClick:()=>fn(!0),className:"save-button","data-tooltip":"Save changes",children:"Save"}),Oe&&p.jsx("button",{onClick:()=>G(!0),className:"save-copy-button","data-tooltip":"Save as a new copy",children:"Save as Copy"}),zt&&p.jsx("button",{onClick:()=>Ce(!0),className:"save-segments-button","data-tooltip":"Save segments as separate files",children:"Save Segments"})]}),p.jsx(to,{isOpen:rn,onClose:()=>fn(!1),title:"Save Changes",actions:p.jsxs(p.Fragment,{children:[p.jsx("button",{className:"modal-button modal-button-secondary",onClick:()=>fn(!1),children:"Cancel"}),p.jsx("button",{className:"modal-button modal-button-primary",onClick:()=>{K&&K(),Bt()},children:"Confirm Save"})]}),children:p.jsx("p",{className:"modal-message",children:"You're about to replace the original video with this trimmed version. This can't be undone."})}),p.jsx(to,{isOpen:F,onClose:()=>G(!1),title:"Save As New Copy",actions:p.jsxs(p.Fragment,{children:[p.jsx("button",{className:"modal-button modal-button-secondary",onClick:()=>G(!1),children:"Cancel"}),p.jsx("button",{className:"modal-button modal-button-primary",onClick:()=>{Oe&&Oe(),Xt()},children:"Confirm Save As Copy"})]}),children:p.jsx("p",{className:"modal-message",children:"You're about to save a new copy with your edits. The original video will stay the same. Find the new file in your My Media folder - named after the original file."})}),p.jsxs(to,{isOpen:Ze,onClose:()=>{},title:"Processing Video",children:[p.jsx("div",{className:"modal-spinner",children:p.jsx("div",{className:"spinner"})}),p.jsx("p",{className:"modal-message text-center",children:"Please wait while your video is being processed..."})]}),p.jsx(to,{isOpen:Te,onClose:()=>Ce(!1),title:"Save Segments",actions:p.jsxs(p.Fragment,{children:[p.jsx("button",{className:"modal-button modal-button-secondary",onClick:()=>Ce(!1),children:"Cancel"}),p.jsx("button",{className:"modal-button modal-button-primary",onClick:()=>{zt&&zt(),Qt()},children:"Save Segments"})]}),children:p.jsx("p",{className:"modal-message",children:"You're about to save each segment as a separate video. Find the new files in your My Media folder - named after the original file."})}),p.jsx(to,{isOpen:ht,onClose:()=>Ge(!1),title:"Video Edited Successfully",children:p.jsx("div",{className:"modal-success-content",children:p.jsxs("p",{className:"modal-message text-center redirect-message",children:["You will be redirected to your ",p.jsx("a",{href:hn,className:"media-page-link",style:Q0,children:"media page"})," in ",p.jsx("span",{className:"countdown",children:"10"})," seconds."," ",va==="segments"?"The new video(s) will soon be there.":"Changes to the video might take a few minutes to be applied."]})})}),p.jsxs(to,{isOpen:yt,onClose:()=>rt(!1),title:"Video Processing Error",children:[p.jsxs("div",{className:"modal-error-content",children:[p.jsx("div",{className:"modal-error-icon",children:p.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"48",height:"48",viewBox:"0 0 24 24",fill:"none",stroke:"#F44336",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[p.jsx("circle",{cx:"12",cy:"12",r:"10"}),p.jsx("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),p.jsx("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"})]})}),p.jsx("p",{className:"modal-message text-center error-message",children:Ot})]}),p.jsx("div",{className:"modal-choices",children:p.jsxs("button",{onClick:()=>rt(!1),className:"modal-choice-button centered-choice",children:[p.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[p.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),p.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}),"Close"]})})]})]})]}),St&&p.jsx("div",{className:"mobile-timeline-overlay",children:p.jsxs("div",{className:"mobile-timeline-message",children:[p.jsx("p",{children:"Please play the video first to enable timeline controls"}),p.jsx("div",{className:"mobile-play-icon"})]})})]})},Z0=({onSplit:w,onReset:L,onUndo:me,onRedo:Ee,onPlaySegments:fe,onPlay:Re,canUndo:d,canRedo:Q,isPlaying:he=!1,isPlayingSegments:te=!1})=>{const[bt,I]=ee.useState(!1);ee.useEffect(()=>{const K=()=>{I(window.innerWidth<=640)};return K(),window.addEventListener("resize",K),()=>window.removeEventListener("resize",K)},[]);const H=()=>{typeof window<"u"&&console.log("Play button clicked, current lastSeekedPosition:",window.lastSeekedPosition),Re()};return p.jsx("div",{className:"editing-tools-container",children:p.jsxs("div",{className:"flex-container single-row",children:[p.jsxs("div",{className:"button-group play-buttons-group",children:[p.jsx("button",{className:"button segments-button",onClick:fe,"data-tooltip":te?"Stop segments playback":"Play segments in one continuous flow",style:{fontSize:"0.875rem"},children:te?p.jsxs(p.Fragment,{children:[p.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[p.jsx("circle",{cx:"12",cy:"12",r:"10"}),p.jsx("line",{x1:"10",y1:"15",x2:"10",y2:"9"}),p.jsx("line",{x1:"14",y1:"15",x2:"14",y2:"9"})]}),p.jsx("span",{className:"full-text",children:"Stop Preview"}),p.jsx("span",{className:"short-text",children:"Stop Preview"})]}):p.jsxs(p.Fragment,{children:[p.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[p.jsx("circle",{cx:"12",cy:"12",r:"10"}),p.jsx("polygon",{points:"10 8 16 12 10 16 10 8"})]}),p.jsx("span",{className:"full-text",children:"Play Preview"}),p.jsx("span",{className:"short-text",children:"Play Preview"})]})}),(!te||!bt)&&p.jsx("button",{className:`button play-button ${te?"greyed-out":""}`,onClick:H,"data-tooltip":he?"Pause video":"Play full video",style:{fontSize:"0.875rem"},disabled:te,children:he&&!te?p.jsxs(p.Fragment,{children:[p.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[p.jsx("circle",{cx:"12",cy:"12",r:"10"}),p.jsx("line",{x1:"10",y1:"15",x2:"10",y2:"9"}),p.jsx("line",{x1:"14",y1:"15",x2:"14",y2:"9"})]}),p.jsx("span",{className:"full-text",children:"Pause"}),p.jsx("span",{className:"short-text",children:"Pause"})]}):p.jsxs(p.Fragment,{children:[p.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[p.jsx("circle",{cx:"12",cy:"12",r:"10"}),p.jsx("polygon",{points:"10 8 16 12 10 16 10 8"})]}),p.jsx("span",{className:"full-text",children:"Play"}),p.jsx("span",{className:"short-text",children:"Play"})]})})]}),p.jsxs("div",{className:"button-group secondary",children:[p.jsxs("button",{className:"button","aria-label":"Undo","data-tooltip":te?"Disabled during preview":"Undo last action",disabled:!d||te,onClick:me,children:[p.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[p.jsx("path",{d:"M9 14 4 9l5-5"}),p.jsx("path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5v0a5.5 5.5 0 0 1-5.5 5.5H11"})]}),p.jsx("span",{className:"button-text",children:"Undo"})]}),p.jsxs("button",{className:"button","aria-label":"Redo","data-tooltip":te?"Disabled during preview":"Redo last undone action",disabled:!Q||te,onClick:Ee,children:[p.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[p.jsx("path",{d:"m15 14 5-5-5-5"}),p.jsx("path",{d:"M20 9H9.5A5.5 5.5 0 0 0 4 14.5v0A5.5 5.5 0 0 0 9.5 20H13"})]}),p.jsx("span",{className:"button-text",children:"Redo"})]}),p.jsx("div",{className:"divider"}),p.jsxs("button",{className:"button",onClick:L,"data-tooltip":te?"Disabled during preview":"Reset to full video",disabled:te,children:[p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",children:p.jsx("path",{fillRule:"evenodd",d:"M4 2a1 1 0 011 1v2.101a7.002 7.002 0 0111.601 2.566 1 1 0 11-1.885.666A5.002 5.002 0 005.999 7H9a1 1 0 010 2H4a1 1 0 01-1-1V3a1 1 0 011-1zm.008 9.057a1 1 0 011.276.61A5.002 5.002 0 0014.001 13H11a1 1 0 110-2h5a1 1 0 011 1v5a1 1 0 11-2 0v-2.101a7.002 7.002 0 01-11.601-2.566 1 1 0 01.61-1.276z",clipRule:"evenodd"})}),p.jsx("span",{className:"reset-text",children:"Reset"})]})]})]})})},J0=({segments:w})=>{const L=[...w].sort((fe,Re)=>fe.startTime-Re.startTime),me=fe=>{const Re=new CustomEvent("delete-segment",{detail:{segmentId:fe}});document.dispatchEvent(Re)},Ee=fe=>`segment-default-color segment-color-${fe%8+1}`;return p.jsxs("div",{className:"clip-segments-container",children:[p.jsx("h3",{className:"clip-segments-title",children:"Clip Segments"}),L.map((fe,Re)=>p.jsxs("div",{className:`segment-item ${Ee(Re)}`,children:[p.jsxs("div",{className:"segment-content",children:[p.jsx("div",{className:"segment-thumbnail",style:{backgroundImage:`url(${fe.thumbnail})`}}),p.jsxs("div",{className:"segment-info",children:[p.jsxs("div",{className:"segment-title",children:["Segment ",Re+1]}),p.jsxs("div",{className:"segment-time",children:[hi(fe.startTime)," - ",hi(fe.endTime)]}),p.jsxs("div",{className:"segment-duration",children:["Duration: ",Y0(fe.endTime-fe.startTime)]})]})]}),p.jsx("div",{className:"segment-actions",children:p.jsx("button",{className:"delete-button","aria-label":"Delete Segment","data-tooltip":"Delete this segment",onClick:()=>me(fe.id),children:p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",children:p.jsx("path",{fillRule:"evenodd",d:"M9 2a1 1 0 00-.894.553L7.382 4H4a1 1 0 000 2v10a2 2 0 002 2h8a2 2 0 002-2V6a1 1 0 100-2h-3.382l-.724-1.447A1 1 0 0011 2H9zM7 8a1 1 0 012 0v6a1 1 0 11-2 0V8zm5-1a1 1 0 00-1 1v6a1 1 0 102 0V8a1 1 0 00-1-1z",clipRule:"evenodd"})})})})]},fe.id)),L.length===0&&p.jsx("div",{className:"empty-message",children:"No segments created yet. Use the split button to create segments."})]})},eS=({videoRef:w,onPlay:L})=>{const[me,Ee]=ee.useState(!1);ee.useEffect(()=>{const d=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini|Mobile|mobile|CriOS/i.test(navigator.userAgent);Ee(d)},[]),ee.useEffect(()=>{const Re=w.current;if(!Re)return;const d=()=>{Ee(!1)};return Re.addEventListener("play",d),()=>{Re.removeEventListener("play",d)}},[w]);const fe=()=>{L()};return me?p.jsx("div",{className:"mobile-play-prompt-overlay",children:p.jsx("div",{className:"mobile-play-prompt",children:p.jsx("button",{className:"mobile-play-button",onClick:fe,children:"Click to start editing..."})})}):null},tS=()=>{const w=ee.useRef(null),[L,me]=ee.useState(0),[Ee,fe]=ee.useState(0),[Re,d]=ee.useState(!1),[Q,he]=ee.useState(!1),[te,bt]=ee.useState([]),[I,H]=ee.useState(0),[K,Oe]=ee.useState(0),[zt,qt]=ee.useState([]),[St,Pe]=ee.useState(1),[_e,ot]=ee.useState([]),[_,ne]=ee.useState([]),[De,Vt]=ee.useState(-1),[Me,pe]=ee.useState(!1),[nt,oe]=ee.useState(!1),[Le,Ke]=ee.useState(0);ee.useEffect(()=>{var F;if(_.length>0){const G=((F=_[De])==null?void 0:F.action)||"";G!=="save"&&G!=="save_copy"&&G!=="save_segments"&&pe(!0)}},[_,De]),ee.useEffect(()=>{const F=G=>{if(Me){const Te="Your edits will get lost if you leave the page. Do you want to continue?";return G.preventDefault(),G.returnValue=Te,Te}};return window.addEventListener("beforeunload",F),()=>{window.removeEventListener("beforeunload",F)}},[Me]),ee.useEffect(()=>{const F=w.current;if(!F)return;const G=()=>{fe(F.duration),Oe(F.duration),(async()=>{const Ge=await Cm(F,F.duration/2),yt={id:1,name:"segment",startTime:0,endTime:F.duration,thumbnail:Ge},rt={trimStart:0,trimEnd:F.duration,splitPoints:[],clipSegments:[yt]};ne([rt]),Vt(0),ot([yt]);const tn=6,mn=F.duration/tn,Ot=[];for(let Lt=0;Lt{me(F.currentTime)},Ce=()=>{d(!0),rn(!0)},Ze=()=>{d(!1)},st=()=>{d(!1),F.currentTime=I};return F.addEventListener("loadedmetadata",G),F.addEventListener("timeupdate",Te),F.addEventListener("play",Ce),F.addEventListener("pause",Ze),F.addEventListener("ended",st),()=>{F.removeEventListener("loadedmetadata",G),F.removeEventListener("timeupdate",Te),F.removeEventListener("play",Ce),F.removeEventListener("pause",Ze),F.removeEventListener("ended",st)}},[]);const le=F=>{const G=w.current;if(!G)return;const Te=!G.paused;G.currentTime=F,me(F),typeof window<"u"&&(window.lastSeekedPosition=F),Te&&G.play().then(()=>{d(!0)}).catch(Ce=>{console.error("Error resuming playback:",Ce),d(!1)})},W=F=>{const G={trimStart:I,trimEnd:K,splitPoints:[...zt],clipSegments:JSON.parse(JSON.stringify(_e)),action:F||"manual_save"},Te=_[De],Ce=()=>{if(!Te||Te.clipSegments.length!==G.clipSegments.length)return!0;for(let ht=0;ht.001||Math.abs(Ge.endTime-yt.endTime)>.001)return!0}return!1},Ze=!Te||Te.trimStart!==G.trimStart||Te.trimEnd!==G.trimEnd||Te.splitPoints.length!==G.splitPoints.length||Ce(),st=G.action!==void 0;if(Ze||st){const ht=De;ne(Ge=>htGe+1)}};ee.useEffect(()=>{const F=G=>{if(G.detail){const{time:Te,isStart:Ce,recordHistory:Ze,action:st}=G.detail;Ce?H(Te):Oe(Te),Ze&&setTimeout(()=>{W(st||(Ce?"adjust_trim_start":"adjust_trim_end"))},10)}};return document.addEventListener("update-trim",F),()=>{document.removeEventListener("update-trim",F)}},[]),ee.useEffect(()=>{const F=Ce=>{if(Ce.detail&&Ce.detail.segments){const Ze=Ce.detail.recordHistory!==!1,st=Ce.detail.action||"update_segments";ot(Ce.detail.segments),Ze&&setTimeout(()=>{const ht=JSON.parse(JSON.stringify(Ce.detail.segments)),Ge={trimStart:I,trimEnd:K,splitPoints:[...zt],clipSegments:ht,action:st},yt=De;ne(rt=>ytrt+1)},20)}},G=async Ce=>{const Ze=Ce;if(Ze.detail&&typeof Ze.detail.time=="number"&&typeof Ze.detail.segmentId=="number"){const st=Ze.detail.time,ht=Ze.detail.segmentId;le(st);const Ge=_e.find(Ot=>Ot.id===ht);if(!Ge||st<=Ge.startTime||st>=Ge.endTime)return;const yt=[..._e],rt=yt.findIndex(Ot=>Ot.id===ht);if(rt===-1)return;yt.splice(rt,1);const tn={id:Date.now(),name:`${Ge.name}-A`,startTime:Ge.startTime,endTime:st,thumbnail:""},mn={id:Date.now()+1,name:`${Ge.name}-B`,startTime:st,endTime:Ge.endTime,thumbnail:""};yt.push(tn,mn),yt.sort((Ot,Lt)=>Ot.startTime-Lt.startTime),ot(yt),W("split_segment")}},Te=async Ce=>{const Ze=Ce;if(Ze.detail&&typeof Ze.detail.segmentId=="number"){const st=Ze.detail.segmentId,ht=_e.filter(Ge=>Ge.id!==st);if(ht.length!==_e.length){if(ht.length===0&&w.current){const Ge={id:Date.now(),name:"segment",startTime:0,endTime:w.current.duration,thumbnail:""};H(0),Oe(w.current.duration),qt([]),ot([Ge])}else ot(ht);W("delete_segment")}}};return document.addEventListener("update-segments",F),document.addEventListener("split-segment",G),document.addEventListener("delete-segment",Te),()=>{document.removeEventListener("update-segments",F),document.removeEventListener("split-segment",G),document.removeEventListener("delete-segment",Te)}},[_e,Ee]);const q=F=>{H(F),W("adjust_trim_start")},Ye=F=>{Oe(F),W("adjust_trim_end")},Fe=async()=>{if(w.current&&!zt.includes(L)){const F=[...zt,L].sort((Ce,Ze)=>Ce-Ze);qt(F);const G=[];let Te=0;for(let Ce=0;Ce<=F.length;Ce++){const Ze=Ce{if(H(0),Oe(Ee),qt([]),!w.current)return;const F={id:Date.now(),name:"segment",startTime:0,endTime:Ee,thumbnail:""};ot([F]),W("reset_all")},ct=()=>{if(De>0){const F=_[De-1];re.debug(`** UNDO ** to position ${De-1}, action: ${F.action}, segments: ${F.clipSegments.length}`),re.debug("Segment details after undo:",F.clipSegments.map(G=>`ID: ${G.id}, Time: ${$(G.startTime)} - ${$(G.endTime)}`)),H(F.trimStart),Oe(F.trimEnd),qt([...F.splitPoints]),ot(JSON.parse(JSON.stringify(F.clipSegments))),Vt(De-1)}},We=()=>{if(De<_.length-1){const F=_[De+1];re.debug(`** REDO ** to position ${De+1}, action: ${F.action}, segments: ${F.clipSegments.length}`),re.debug("Segment details after redo:",F.clipSegments.map(G=>`ID: ${G.id}, Time: ${$(G.startTime)} - ${$(G.endTime)}`)),H(F.trimStart),Oe(F.trimEnd),qt([...F.splitPoints]),ot(JSON.parse(JSON.stringify(F.clipSegments))),Vt(De+1)}},Ve=F=>{Pe(F)},Ue=()=>{const F=w.current;F&&(F.muted=!F.muted,he(!Q))},cn=()=>{[..._e].sort((G,Te)=>G.startTime-Te.startTime).map(G=>({startTime:$(G.startTime),endTime:$(G.endTime)})),pe(!1),W("save")},et=()=>{[..._e].sort((G,Te)=>G.startTime-Te.startTime).map(G=>({startTime:$(G.startTime),endTime:$(G.endTime)})),pe(!1),W("save_copy")},Ht=()=>{[..._e].sort((G,Te)=>G.startTime-Te.startTime).map(G=>({name:G.name,startTime:$(G.startTime),endTime:$(G.endTime)})),pe(!1),W("save_segments")},gt=F=>{(!Qe||Gt)&&le(F)},Qe=typeof window<"u"&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini|Mobile|mobile|CriOS/i.test(navigator.userAgent),[Gt,rn]=ee.useState(!1);return ee.useEffect(()=>{if(!nt||!w.current)return;const F=w.current,G=[..._e].sort((Ce,Ze)=>Ce.startTime-Ze.startTime),Te=()=>{const Ce=G[Le];if(!Ce)return;const Ze=F.currentTime;if(Ze=Ce.endTime-.01)if(Le{console.error("Error continuing segment playback:",ht)})}else F.pause(),oe(!1),Ke(0),F.removeEventListener("timeupdate",Te)};return F.addEventListener("timeupdate",Te),F.paused&&G.length>0&&(F.currentTime=G[0].startTime,F.play().catch(console.error)),()=>{F.removeEventListener("timeupdate",Te)}},[nt,Le,_e]),ee.useEffect(()=>{const F=G=>{const{segmentIndex:Te}=G.detail;nt&&Te!==Le&&Ke(Te)};return document.addEventListener("update-segment-index",F),()=>{document.removeEventListener("update-segment-index",F)}},[nt,Le]),{videoRef:w,currentTime:L,duration:Ee,isPlaying:Re,setIsPlaying:d,isMuted:Q,isPlayingSegments:nt,thumbnails:te,trimStart:I,trimEnd:K,splitPoints:zt,zoomLevel:St,clipSegments:_e,hasUnsavedChanges:Me,historyPosition:De,history:_,handleTrimStartChange:q,handleTrimEndChange:Ye,handleZoomChange:Ve,handleMobileSafeSeek:gt,handleSplit:Fe,handleReset:at,handleUndo:ct,handleRedo:We,handlePlaySegments:()=>{const F=w.current;if(!(!F||_e.length===0))if(nt)F.pause(),oe(!1),Ke(0);else{oe(!0),Ke(0);const G=[..._e].sort((Te,Ce)=>Te.startTime-Ce.startTime);F.currentTime=G[0].startTime,F.play().catch(Te=>{console.error("Error starting segments playback:",Te),oe(!1)})}},toggleMute:Ue,handleSave:cn,handleSaveACopy:et,handleSaveSegments:Ht,isMobile:Qe,videoInitialized:Gt,setVideoInitialized:rn}},nS=()=>{const{videoRef:w,currentTime:L,duration:me,isPlaying:Ee,setIsPlaying:fe,isMuted:Re,thumbnails:d,trimStart:Q,trimEnd:he,splitPoints:te,zoomLevel:bt,clipSegments:I,hasUnsavedChanges:H,historyPosition:K,history:Oe,handleTrimStartChange:zt,handleTrimEndChange:qt,handleZoomChange:St,handleMobileSafeSeek:Pe,handleSplit:_e,handleReset:ot,handleUndo:_,handleRedo:ne,toggleMute:De,handleSave:Vt,handleSaveACopy:Me,handleSaveSegments:pe,isMobile:nt,videoInitialized:oe,setVideoInitialized:Le,isPlayingSegments:Ke,handlePlaySegments:le}=tS(),W=()=>{if(!w.current)return;const q=w.current;if(Ee){q.pause(),fe(!1);return}const Ye=Number(q.currentTime.toFixed(6));let Fe=me,at=null,ct=null;const We=[...I].sort((Ue,cn)=>Ue.startTime-cn.startTime);at=We.find(Ue=>{const cn=Number(Ue.startTime.toFixed(6)),et=Number(Ue.endTime.toFixed(6));return Ye>cn&&YeNumber(Ue.startTime.toFixed(6))>Ye)),at?Fe=Number(at.endTime.toFixed(6)):ct&&(Fe=Number(ct.startTime.toFixed(6)));const Ve=()=>{if(!q)return;const Ue=Number(q.currentTime.toFixed(6));if(Number((Fe-Ue).toFixed(6))<=0||Ue>=Fe){q.pause();const et=()=>{if(!q)return;q.currentTime=Fe,Pe(Fe);const Ht=Number(q.currentTime.toFixed(6)),gt=Number(Math.abs(Ht-Fe).toFixed(6));re.debug("Position verification:",{target:$(Fe),actual:$(Ht),difference:gt}),gt>0&&(q.currentTime=Fe,Pe(Fe))};et(),setTimeout(et,5),setTimeout(et,10),setTimeout(et,20),setTimeout(et,50),q.removeEventListener("timeupdate",Ve),fe(!1),re.debug("Stopped at position:",{target:$(Fe),actual:$(q.currentTime),type:at?"segment end":ct?"next segment start":"end of video",segment:at?{id:at.id,start:$(at.startTime),end:$(at.endTime)}:null,nextSegment:ct?{id:ct.id,start:$(ct.startTime),end:$(ct.endTime)}:null});return}};q.addEventListener("timeupdate",Ve),q.play().then(()=>{fe(!0),Le(!0),re.debug("Playback started:",{from:$(Ye),to:$(Fe),currentSegment:at?{id:at.id,start:$(at.startTime),end:$(at.endTime)}:"None",nextSegment:ct?{id:ct.id,start:$(ct.startTime),end:$(ct.endTime)}:"None"})}).catch(Ue=>{console.error("Error playing video:",Ue)})};return p.jsxs("div",{className:"bg-background min-h-screen",children:[p.jsx(eS,{videoRef:w,onPlay:W}),p.jsxs("div",{className:"container mx-auto px-4 py-6 max-w-6xl",children:[p.jsx(W0,{videoRef:w,currentTime:L,duration:me,isPlaying:Ee,isMuted:Re,onPlayPause:W,onSeek:Pe,onToggleMute:De}),p.jsx(Z0,{onSplit:_e,onReset:ot,onUndo:_,onRedo:ne,onPlaySegments:le,onPlay:W,isPlaying:Ee,isPlayingSegments:Ke,canUndo:K>0,canRedo:K{const w=document.getElementById("video-editor-trim-root");w&&Sm(w).render(p.jsx(nS,{}))};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",km):km()})(); //# sourceMappingURL=video-editor.js.map diff --git a/static/video_editor/video-editor.js.map b/static/video_editor/video-editor.js.map index 6b316377..e1dbb29c 100644 --- a/static/video_editor/video-editor.js.map +++ b/static/video_editor/video-editor.js.map @@ -1 +1 @@ -{"version":3,"file":"video-editor.js","sources":["../../frontend-tools/video-editor/node_modules/react/cjs/react.development.js","../../frontend-tools/video-editor/node_modules/react/index.js","../../frontend-tools/video-editor/node_modules/react/cjs/react-jsx-runtime.development.js","../../frontend-tools/video-editor/node_modules/react/jsx-runtime.js","../../frontend-tools/video-editor/node_modules/scheduler/cjs/scheduler.development.js","../../frontend-tools/video-editor/node_modules/scheduler/index.js","../../frontend-tools/video-editor/node_modules/react-dom/cjs/react-dom.development.js","../../frontend-tools/video-editor/node_modules/react-dom/index.js","../../frontend-tools/video-editor/node_modules/react-dom/client.js","../../frontend-tools/video-editor/client/src/lib/timeUtils.ts","../../frontend-tools/video-editor/client/src/lib/logger.ts","../../frontend-tools/video-editor/client/src/components/VideoPlayer.tsx","../../frontend-tools/video-editor/client/src/lib/videoUtils.ts","../../frontend-tools/video-editor/client/src/components/Modal.tsx","../../frontend-tools/video-editor/client/src/services/videoApi.ts","../../frontend-tools/video-editor/client/src/assets/play-icon.svg","../../frontend-tools/video-editor/client/src/assets/pause-icon.svg","../../frontend-tools/video-editor/client/src/assets/play-from-beginning-icon.svg","../../frontend-tools/video-editor/client/src/assets/segment-end-new.svg","../../frontend-tools/video-editor/client/src/assets/segment-start-new.svg","../../frontend-tools/video-editor/client/src/assets/segment-start-new-cutaway.svg","../../frontend-tools/video-editor/client/src/assets/segment-end-new-cutaway.svg","../../frontend-tools/video-editor/client/src/components/TimelineControls.tsx","../../frontend-tools/video-editor/client/src/components/EditingTools.tsx","../../frontend-tools/video-editor/client/src/components/ClipSegments.tsx","../../frontend-tools/video-editor/client/src/components/IOSPlayPrompt.tsx","../../frontend-tools/video-editor/client/src/hooks/useVideoTrimmer.tsx","../../frontend-tools/video-editor/client/src/App.tsx","../../frontend-tools/video-editor/client/src/main.tsx"],"sourcesContent":["/**\n * @license React\n * react.development.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nif (process.env.NODE_ENV !== \"production\") {\n (function() {\n\n 'use strict';\n\n/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */\nif (\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart ===\n 'function'\n) {\n __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());\n}\n var ReactVersion = '18.3.1';\n\n// ATTENTION\n// When adding new symbols to this file,\n// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'\n// The Symbol used to tag the ReactElement-like types.\nvar REACT_ELEMENT_TYPE = Symbol.for('react.element');\nvar REACT_PORTAL_TYPE = Symbol.for('react.portal');\nvar REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');\nvar REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');\nvar REACT_PROFILER_TYPE = Symbol.for('react.profiler');\nvar REACT_PROVIDER_TYPE = Symbol.for('react.provider');\nvar REACT_CONTEXT_TYPE = Symbol.for('react.context');\nvar REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');\nvar REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');\nvar REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');\nvar REACT_MEMO_TYPE = Symbol.for('react.memo');\nvar REACT_LAZY_TYPE = Symbol.for('react.lazy');\nvar REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');\nvar MAYBE_ITERATOR_SYMBOL = Symbol.iterator;\nvar FAUX_ITERATOR_SYMBOL = '@@iterator';\nfunction getIteratorFn(maybeIterable) {\n if (maybeIterable === null || typeof maybeIterable !== 'object') {\n return null;\n }\n\n var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];\n\n if (typeof maybeIterator === 'function') {\n return maybeIterator;\n }\n\n return null;\n}\n\n/**\n * Keeps track of the current dispatcher.\n */\nvar ReactCurrentDispatcher = {\n /**\n * @internal\n * @type {ReactComponent}\n */\n current: null\n};\n\n/**\n * Keeps track of the current batch's configuration such as how long an update\n * should suspend for if it needs to.\n */\nvar ReactCurrentBatchConfig = {\n transition: null\n};\n\nvar ReactCurrentActQueue = {\n current: null,\n // Used to reproduce behavior of `batchedUpdates` in legacy mode.\n isBatchingLegacy: false,\n didScheduleLegacyUpdate: false\n};\n\n/**\n * Keeps track of the current owner.\n *\n * The current owner is the component who should own any components that are\n * currently being constructed.\n */\nvar ReactCurrentOwner = {\n /**\n * @internal\n * @type {ReactComponent}\n */\n current: null\n};\n\nvar ReactDebugCurrentFrame = {};\nvar currentExtraStackFrame = null;\nfunction setExtraStackFrame(stack) {\n {\n currentExtraStackFrame = stack;\n }\n}\n\n{\n ReactDebugCurrentFrame.setExtraStackFrame = function (stack) {\n {\n currentExtraStackFrame = stack;\n }\n }; // Stack implementation injected by the current renderer.\n\n\n ReactDebugCurrentFrame.getCurrentStack = null;\n\n ReactDebugCurrentFrame.getStackAddendum = function () {\n var stack = ''; // Add an extra top frame while an element is being validated\n\n if (currentExtraStackFrame) {\n stack += currentExtraStackFrame;\n } // Delegate to the injected renderer-specific implementation\n\n\n var impl = ReactDebugCurrentFrame.getCurrentStack;\n\n if (impl) {\n stack += impl() || '';\n }\n\n return stack;\n };\n}\n\n// -----------------------------------------------------------------------------\n\nvar enableScopeAPI = false; // Experimental Create Event Handle API.\nvar enableCacheElement = false;\nvar enableTransitionTracing = false; // No known bugs, but needs performance testing\n\nvar enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber\n// stuff. Intended to enable React core members to more easily debug scheduling\n// issues in DEV builds.\n\nvar enableDebugTracing = false; // Track which Fiber(s) schedule render work.\n\nvar ReactSharedInternals = {\n ReactCurrentDispatcher: ReactCurrentDispatcher,\n ReactCurrentBatchConfig: ReactCurrentBatchConfig,\n ReactCurrentOwner: ReactCurrentOwner\n};\n\n{\n ReactSharedInternals.ReactDebugCurrentFrame = ReactDebugCurrentFrame;\n ReactSharedInternals.ReactCurrentActQueue = ReactCurrentActQueue;\n}\n\n// by calls to these methods by a Babel plugin.\n//\n// In PROD (or in packages without access to React internals),\n// they are left as they are instead.\n\nfunction warn(format) {\n {\n {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n printWarning('warn', format, args);\n }\n }\n}\nfunction error(format) {\n {\n {\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n\n printWarning('error', format, args);\n }\n }\n}\n\nfunction printWarning(level, format, args) {\n // When changing this logic, you might want to also\n // update consoleWithStackDev.www.js as well.\n {\n var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\n var stack = ReactDebugCurrentFrame.getStackAddendum();\n\n if (stack !== '') {\n format += '%s';\n args = args.concat([stack]);\n } // eslint-disable-next-line react-internal/safe-string-coercion\n\n\n var argsWithFormat = args.map(function (item) {\n return String(item);\n }); // Careful: RN currently depends on this prefix\n\n argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it\n // breaks IE9: https://github.com/facebook/react/issues/13610\n // eslint-disable-next-line react-internal/no-production-logging\n\n Function.prototype.apply.call(console[level], console, argsWithFormat);\n }\n}\n\nvar didWarnStateUpdateForUnmountedComponent = {};\n\nfunction warnNoop(publicInstance, callerName) {\n {\n var _constructor = publicInstance.constructor;\n var componentName = _constructor && (_constructor.displayName || _constructor.name) || 'ReactClass';\n var warningKey = componentName + \".\" + callerName;\n\n if (didWarnStateUpdateForUnmountedComponent[warningKey]) {\n return;\n }\n\n error(\"Can't call %s on a component that is not yet mounted. \" + 'This is a no-op, but it might indicate a bug in your application. ' + 'Instead, assign to `this.state` directly or define a `state = {};` ' + 'class property with the desired state in the %s component.', callerName, componentName);\n\n didWarnStateUpdateForUnmountedComponent[warningKey] = true;\n }\n}\n/**\n * This is the abstract API for an update queue.\n */\n\n\nvar ReactNoopUpdateQueue = {\n /**\n * Checks whether or not this composite component is mounted.\n * @param {ReactClass} publicInstance The instance we want to test.\n * @return {boolean} True if mounted, false otherwise.\n * @protected\n * @final\n */\n isMounted: function (publicInstance) {\n return false;\n },\n\n /**\n * Forces an update. This should only be invoked when it is known with\n * certainty that we are **not** in a DOM transaction.\n *\n * You may want to call this when you know that some deeper aspect of the\n * component's state has changed but `setState` was not called.\n *\n * This will not invoke `shouldComponentUpdate`, but it will invoke\n * `componentWillUpdate` and `componentDidUpdate`.\n *\n * @param {ReactClass} publicInstance The instance that should rerender.\n * @param {?function} callback Called after component is updated.\n * @param {?string} callerName name of the calling function in the public API.\n * @internal\n */\n enqueueForceUpdate: function (publicInstance, callback, callerName) {\n warnNoop(publicInstance, 'forceUpdate');\n },\n\n /**\n * Replaces all of the state. Always use this or `setState` to mutate state.\n * You should treat `this.state` as immutable.\n *\n * There is no guarantee that `this.state` will be immediately updated, so\n * accessing `this.state` after calling this method may return the old value.\n *\n * @param {ReactClass} publicInstance The instance that should rerender.\n * @param {object} completeState Next state.\n * @param {?function} callback Called after component is updated.\n * @param {?string} callerName name of the calling function in the public API.\n * @internal\n */\n enqueueReplaceState: function (publicInstance, completeState, callback, callerName) {\n warnNoop(publicInstance, 'replaceState');\n },\n\n /**\n * Sets a subset of the state. This only exists because _pendingState is\n * internal. This provides a merging strategy that is not available to deep\n * properties which is confusing. TODO: Expose pendingState or don't use it\n * during the merge.\n *\n * @param {ReactClass} publicInstance The instance that should rerender.\n * @param {object} partialState Next partial state to be merged with state.\n * @param {?function} callback Called after component is updated.\n * @param {?string} Name of the calling function in the public API.\n * @internal\n */\n enqueueSetState: function (publicInstance, partialState, callback, callerName) {\n warnNoop(publicInstance, 'setState');\n }\n};\n\nvar assign = Object.assign;\n\nvar emptyObject = {};\n\n{\n Object.freeze(emptyObject);\n}\n/**\n * Base class helpers for the updating state of a component.\n */\n\n\nfunction Component(props, context, updater) {\n this.props = props;\n this.context = context; // If a component has string refs, we will assign a different object later.\n\n this.refs = emptyObject; // We initialize the default updater but the real one gets injected by the\n // renderer.\n\n this.updater = updater || ReactNoopUpdateQueue;\n}\n\nComponent.prototype.isReactComponent = {};\n/**\n * Sets a subset of the state. Always use this to mutate\n * state. You should treat `this.state` as immutable.\n *\n * There is no guarantee that `this.state` will be immediately updated, so\n * accessing `this.state` after calling this method may return the old value.\n *\n * There is no guarantee that calls to `setState` will run synchronously,\n * as they may eventually be batched together. You can provide an optional\n * callback that will be executed when the call to setState is actually\n * completed.\n *\n * When a function is provided to setState, it will be called at some point in\n * the future (not synchronously). It will be called with the up to date\n * component arguments (state, props, context). These values can be different\n * from this.* because your function may be called after receiveProps but before\n * shouldComponentUpdate, and this new state, props, and context will not yet be\n * assigned to this.\n *\n * @param {object|function} partialState Next partial state or function to\n * produce next partial state to be merged with current state.\n * @param {?function} callback Called after state is updated.\n * @final\n * @protected\n */\n\nComponent.prototype.setState = function (partialState, callback) {\n if (typeof partialState !== 'object' && typeof partialState !== 'function' && partialState != null) {\n throw new Error('setState(...): takes an object of state variables to update or a ' + 'function which returns an object of state variables.');\n }\n\n this.updater.enqueueSetState(this, partialState, callback, 'setState');\n};\n/**\n * Forces an update. This should only be invoked when it is known with\n * certainty that we are **not** in a DOM transaction.\n *\n * You may want to call this when you know that some deeper aspect of the\n * component's state has changed but `setState` was not called.\n *\n * This will not invoke `shouldComponentUpdate`, but it will invoke\n * `componentWillUpdate` and `componentDidUpdate`.\n *\n * @param {?function} callback Called after update is complete.\n * @final\n * @protected\n */\n\n\nComponent.prototype.forceUpdate = function (callback) {\n this.updater.enqueueForceUpdate(this, callback, 'forceUpdate');\n};\n/**\n * Deprecated APIs. These APIs used to exist on classic React classes but since\n * we would like to deprecate them, we're not going to move them over to this\n * modern base class. Instead, we define a getter that warns if it's accessed.\n */\n\n\n{\n var deprecatedAPIs = {\n isMounted: ['isMounted', 'Instead, make sure to clean up subscriptions and pending requests in ' + 'componentWillUnmount to prevent memory leaks.'],\n replaceState: ['replaceState', 'Refactor your code to use setState instead (see ' + 'https://github.com/facebook/react/issues/3236).']\n };\n\n var defineDeprecationWarning = function (methodName, info) {\n Object.defineProperty(Component.prototype, methodName, {\n get: function () {\n warn('%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]);\n\n return undefined;\n }\n });\n };\n\n for (var fnName in deprecatedAPIs) {\n if (deprecatedAPIs.hasOwnProperty(fnName)) {\n defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);\n }\n }\n}\n\nfunction ComponentDummy() {}\n\nComponentDummy.prototype = Component.prototype;\n/**\n * Convenience component with default shallow equality check for sCU.\n */\n\nfunction PureComponent(props, context, updater) {\n this.props = props;\n this.context = context; // If a component has string refs, we will assign a different object later.\n\n this.refs = emptyObject;\n this.updater = updater || ReactNoopUpdateQueue;\n}\n\nvar pureComponentPrototype = PureComponent.prototype = new ComponentDummy();\npureComponentPrototype.constructor = PureComponent; // Avoid an extra prototype jump for these methods.\n\nassign(pureComponentPrototype, Component.prototype);\npureComponentPrototype.isPureReactComponent = true;\n\n// an immutable object with a single mutable value\nfunction createRef() {\n var refObject = {\n current: null\n };\n\n {\n Object.seal(refObject);\n }\n\n return refObject;\n}\n\nvar isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare\n\nfunction isArray(a) {\n return isArrayImpl(a);\n}\n\n/*\n * The `'' + value` pattern (used in in perf-sensitive code) throws for Symbol\n * and Temporal.* types. See https://github.com/facebook/react/pull/22064.\n *\n * The functions in this module will throw an easier-to-understand,\n * easier-to-debug exception with a clear errors message message explaining the\n * problem. (Instead of a confusing exception thrown inside the implementation\n * of the `value` object).\n */\n// $FlowFixMe only called in DEV, so void return is not possible.\nfunction typeName(value) {\n {\n // toStringTag is needed for namespaced types like Temporal.Instant\n var hasToStringTag = typeof Symbol === 'function' && Symbol.toStringTag;\n var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || 'Object';\n return type;\n }\n} // $FlowFixMe only called in DEV, so void return is not possible.\n\n\nfunction willCoercionThrow(value) {\n {\n try {\n testStringCoercion(value);\n return false;\n } catch (e) {\n return true;\n }\n }\n}\n\nfunction testStringCoercion(value) {\n // If you ended up here by following an exception call stack, here's what's\n // happened: you supplied an object or symbol value to React (as a prop, key,\n // DOM attribute, CSS property, string ref, etc.) and when React tried to\n // coerce it to a string using `'' + value`, an exception was thrown.\n //\n // The most common types that will cause this exception are `Symbol` instances\n // and Temporal objects like `Temporal.Instant`. But any object that has a\n // `valueOf` or `[Symbol.toPrimitive]` method that throws will also cause this\n // exception. (Library authors do this to prevent users from using built-in\n // numeric operators like `+` or comparison operators like `>=` because custom\n // methods are needed to perform accurate arithmetic or comparison.)\n //\n // To fix the problem, coerce this object or symbol value to a string before\n // passing it to React. The most reliable way is usually `String(value)`.\n //\n // To find which value is throwing, check the browser or debugger console.\n // Before this exception was thrown, there should be `console.error` output\n // that shows the type (Symbol, Temporal.PlainDate, etc.) that caused the\n // problem and how that type was used: key, atrribute, input value prop, etc.\n // In most cases, this console output also shows the component and its\n // ancestor components where the exception happened.\n //\n // eslint-disable-next-line react-internal/safe-string-coercion\n return '' + value;\n}\nfunction checkKeyStringCoercion(value) {\n {\n if (willCoercionThrow(value)) {\n error('The provided key is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', typeName(value));\n\n return testStringCoercion(value); // throw (to help callers find troubleshooting comments)\n }\n }\n}\n\nfunction getWrappedName(outerType, innerType, wrapperName) {\n var displayName = outerType.displayName;\n\n if (displayName) {\n return displayName;\n }\n\n var functionName = innerType.displayName || innerType.name || '';\n return functionName !== '' ? wrapperName + \"(\" + functionName + \")\" : wrapperName;\n} // Keep in sync with react-reconciler/getComponentNameFromFiber\n\n\nfunction getContextName(type) {\n return type.displayName || 'Context';\n} // Note that the reconciler package should generally prefer to use getComponentNameFromFiber() instead.\n\n\nfunction getComponentNameFromType(type) {\n if (type == null) {\n // Host root, text node or just invalid type.\n return null;\n }\n\n {\n if (typeof type.tag === 'number') {\n error('Received an unexpected object in getComponentNameFromType(). ' + 'This is likely a bug in React. Please file an issue.');\n }\n }\n\n if (typeof type === 'function') {\n return type.displayName || type.name || null;\n }\n\n if (typeof type === 'string') {\n return type;\n }\n\n switch (type) {\n case REACT_FRAGMENT_TYPE:\n return 'Fragment';\n\n case REACT_PORTAL_TYPE:\n return 'Portal';\n\n case REACT_PROFILER_TYPE:\n return 'Profiler';\n\n case REACT_STRICT_MODE_TYPE:\n return 'StrictMode';\n\n case REACT_SUSPENSE_TYPE:\n return 'Suspense';\n\n case REACT_SUSPENSE_LIST_TYPE:\n return 'SuspenseList';\n\n }\n\n if (typeof type === 'object') {\n switch (type.$$typeof) {\n case REACT_CONTEXT_TYPE:\n var context = type;\n return getContextName(context) + '.Consumer';\n\n case REACT_PROVIDER_TYPE:\n var provider = type;\n return getContextName(provider._context) + '.Provider';\n\n case REACT_FORWARD_REF_TYPE:\n return getWrappedName(type, type.render, 'ForwardRef');\n\n case REACT_MEMO_TYPE:\n var outerName = type.displayName || null;\n\n if (outerName !== null) {\n return outerName;\n }\n\n return getComponentNameFromType(type.type) || 'Memo';\n\n case REACT_LAZY_TYPE:\n {\n var lazyComponent = type;\n var payload = lazyComponent._payload;\n var init = lazyComponent._init;\n\n try {\n return getComponentNameFromType(init(payload));\n } catch (x) {\n return null;\n }\n }\n\n // eslint-disable-next-line no-fallthrough\n }\n }\n\n return null;\n}\n\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\n\nvar RESERVED_PROPS = {\n key: true,\n ref: true,\n __self: true,\n __source: true\n};\nvar specialPropKeyWarningShown, specialPropRefWarningShown, didWarnAboutStringRefs;\n\n{\n didWarnAboutStringRefs = {};\n}\n\nfunction hasValidRef(config) {\n {\n if (hasOwnProperty.call(config, 'ref')) {\n var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;\n\n if (getter && getter.isReactWarning) {\n return false;\n }\n }\n }\n\n return config.ref !== undefined;\n}\n\nfunction hasValidKey(config) {\n {\n if (hasOwnProperty.call(config, 'key')) {\n var getter = Object.getOwnPropertyDescriptor(config, 'key').get;\n\n if (getter && getter.isReactWarning) {\n return false;\n }\n }\n }\n\n return config.key !== undefined;\n}\n\nfunction defineKeyPropWarningGetter(props, displayName) {\n var warnAboutAccessingKey = function () {\n {\n if (!specialPropKeyWarningShown) {\n specialPropKeyWarningShown = true;\n\n error('%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);\n }\n }\n };\n\n warnAboutAccessingKey.isReactWarning = true;\n Object.defineProperty(props, 'key', {\n get: warnAboutAccessingKey,\n configurable: true\n });\n}\n\nfunction defineRefPropWarningGetter(props, displayName) {\n var warnAboutAccessingRef = function () {\n {\n if (!specialPropRefWarningShown) {\n specialPropRefWarningShown = true;\n\n error('%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);\n }\n }\n };\n\n warnAboutAccessingRef.isReactWarning = true;\n Object.defineProperty(props, 'ref', {\n get: warnAboutAccessingRef,\n configurable: true\n });\n}\n\nfunction warnIfStringRefCannotBeAutoConverted(config) {\n {\n if (typeof config.ref === 'string' && ReactCurrentOwner.current && config.__self && ReactCurrentOwner.current.stateNode !== config.__self) {\n var componentName = getComponentNameFromType(ReactCurrentOwner.current.type);\n\n if (!didWarnAboutStringRefs[componentName]) {\n error('Component \"%s\" contains the string ref \"%s\". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-string-ref', componentName, config.ref);\n\n didWarnAboutStringRefs[componentName] = true;\n }\n }\n }\n}\n/**\n * Factory method to create a new React element. This no longer adheres to\n * the class pattern, so do not use new to call it. Also, instanceof check\n * will not work. Instead test $$typeof field against Symbol.for('react.element') to check\n * if something is a React Element.\n *\n * @param {*} type\n * @param {*} props\n * @param {*} key\n * @param {string|object} ref\n * @param {*} owner\n * @param {*} self A *temporary* helper to detect places where `this` is\n * different from the `owner` when React.createElement is called, so that we\n * can warn. We want to get rid of owner and replace string `ref`s with arrow\n * functions, and as long as `this` and owner are the same, there will be no\n * change in behavior.\n * @param {*} source An annotation object (added by a transpiler or otherwise)\n * indicating filename, line number, and/or other information.\n * @internal\n */\n\n\nvar ReactElement = function (type, key, ref, self, source, owner, props) {\n var element = {\n // This tag allows us to uniquely identify this as a React Element\n $$typeof: REACT_ELEMENT_TYPE,\n // Built-in properties that belong on the element\n type: type,\n key: key,\n ref: ref,\n props: props,\n // Record the component responsible for creating this element.\n _owner: owner\n };\n\n {\n // The validation flag is currently mutative. We put it on\n // an external backing store so that we can freeze the whole object.\n // This can be replaced with a WeakMap once they are implemented in\n // commonly used development environments.\n element._store = {}; // To make comparing ReactElements easier for testing purposes, we make\n // the validation flag non-enumerable (where possible, which should\n // include every environment we run tests in), so the test framework\n // ignores it.\n\n Object.defineProperty(element._store, 'validated', {\n configurable: false,\n enumerable: false,\n writable: true,\n value: false\n }); // self and source are DEV only properties.\n\n Object.defineProperty(element, '_self', {\n configurable: false,\n enumerable: false,\n writable: false,\n value: self\n }); // Two elements created in two different places should be considered\n // equal for testing purposes and therefore we hide it from enumeration.\n\n Object.defineProperty(element, '_source', {\n configurable: false,\n enumerable: false,\n writable: false,\n value: source\n });\n\n if (Object.freeze) {\n Object.freeze(element.props);\n Object.freeze(element);\n }\n }\n\n return element;\n};\n/**\n * Create and return a new ReactElement of the given type.\n * See https://reactjs.org/docs/react-api.html#createelement\n */\n\nfunction createElement(type, config, children) {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n\n {\n warnIfStringRefCannotBeAutoConverted(config);\n }\n }\n\n if (hasValidKey(config)) {\n {\n checkKeyStringCoercion(config.key);\n }\n\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n\n props.children = childArray;\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n {\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}\nfunction cloneAndReplaceKey(oldElement, newKey) {\n var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);\n return newElement;\n}\n/**\n * Clone and return a new ReactElement using element as the starting point.\n * See https://reactjs.org/docs/react-api.html#cloneelement\n */\n\nfunction cloneElement(element, config, children) {\n if (element === null || element === undefined) {\n throw new Error(\"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\");\n }\n\n var propName; // Original props are copied\n\n var props = assign({}, element.props); // Reserved names are extracted\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n {\n checkKeyStringCoercion(config.key);\n }\n\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}\n/**\n * Verifies the object is a ReactElement.\n * See https://reactjs.org/docs/react-api.html#isvalidelement\n * @param {?object} object\n * @return {boolean} True if `object` is a ReactElement.\n * @final\n */\n\nfunction isValidElement(object) {\n return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;\n}\n\nvar SEPARATOR = '.';\nvar SUBSEPARATOR = ':';\n/**\n * Escape and wrap key so it is safe to use as a reactid\n *\n * @param {string} key to be escaped.\n * @return {string} the escaped key.\n */\n\nfunction escape(key) {\n var escapeRegex = /[=:]/g;\n var escaperLookup = {\n '=': '=0',\n ':': '=2'\n };\n var escapedString = key.replace(escapeRegex, function (match) {\n return escaperLookup[match];\n });\n return '$' + escapedString;\n}\n/**\n * TODO: Test that a single child and an array with one item have the same key\n * pattern.\n */\n\n\nvar didWarnAboutMaps = false;\nvar userProvidedKeyEscapeRegex = /\\/+/g;\n\nfunction escapeUserProvidedKey(text) {\n return text.replace(userProvidedKeyEscapeRegex, '$&/');\n}\n/**\n * Generate a key string that identifies a element within a set.\n *\n * @param {*} element A element that could contain a manual key.\n * @param {number} index Index that is used if a manual key is not provided.\n * @return {string}\n */\n\n\nfunction getElementKey(element, index) {\n // Do some typechecking here since we call this blindly. We want to ensure\n // that we don't block potential future ES APIs.\n if (typeof element === 'object' && element !== null && element.key != null) {\n // Explicit key\n {\n checkKeyStringCoercion(element.key);\n }\n\n return escape('' + element.key);\n } // Implicit key determined by the index in the set\n\n\n return index.toString(36);\n}\n\nfunction mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {\n var type = typeof children;\n\n if (type === 'undefined' || type === 'boolean') {\n // All of the above are perceived as null.\n children = null;\n }\n\n var invokeCallback = false;\n\n if (children === null) {\n invokeCallback = true;\n } else {\n switch (type) {\n case 'string':\n case 'number':\n invokeCallback = true;\n break;\n\n case 'object':\n switch (children.$$typeof) {\n case REACT_ELEMENT_TYPE:\n case REACT_PORTAL_TYPE:\n invokeCallback = true;\n }\n\n }\n }\n\n if (invokeCallback) {\n var _child = children;\n var mappedChild = callback(_child); // If it's the only child, treat the name as if it was wrapped in an array\n // so that it's consistent if the number of children grows:\n\n var childKey = nameSoFar === '' ? SEPARATOR + getElementKey(_child, 0) : nameSoFar;\n\n if (isArray(mappedChild)) {\n var escapedChildKey = '';\n\n if (childKey != null) {\n escapedChildKey = escapeUserProvidedKey(childKey) + '/';\n }\n\n mapIntoArray(mappedChild, array, escapedChildKey, '', function (c) {\n return c;\n });\n } else if (mappedChild != null) {\n if (isValidElement(mappedChild)) {\n {\n // The `if` statement here prevents auto-disabling of the safe\n // coercion ESLint rule, so we must manually disable it below.\n // $FlowFixMe Flow incorrectly thinks React.Portal doesn't have a key\n if (mappedChild.key && (!_child || _child.key !== mappedChild.key)) {\n checkKeyStringCoercion(mappedChild.key);\n }\n }\n\n mappedChild = cloneAndReplaceKey(mappedChild, // Keep both the (mapped) and old keys if they differ, just as\n // traverseAllChildren used to do for objects as children\n escapedPrefix + ( // $FlowFixMe Flow incorrectly thinks React.Portal doesn't have a key\n mappedChild.key && (!_child || _child.key !== mappedChild.key) ? // $FlowFixMe Flow incorrectly thinks existing element's key can be a number\n // eslint-disable-next-line react-internal/safe-string-coercion\n escapeUserProvidedKey('' + mappedChild.key) + '/' : '') + childKey);\n }\n\n array.push(mappedChild);\n }\n\n return 1;\n }\n\n var child;\n var nextName;\n var subtreeCount = 0; // Count of children found in the current subtree.\n\n var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR;\n\n if (isArray(children)) {\n for (var i = 0; i < children.length; i++) {\n child = children[i];\n nextName = nextNamePrefix + getElementKey(child, i);\n subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback);\n }\n } else {\n var iteratorFn = getIteratorFn(children);\n\n if (typeof iteratorFn === 'function') {\n var iterableChildren = children;\n\n {\n // Warn about using Maps as children\n if (iteratorFn === iterableChildren.entries) {\n if (!didWarnAboutMaps) {\n warn('Using Maps as children is not supported. ' + 'Use an array of keyed ReactElements instead.');\n }\n\n didWarnAboutMaps = true;\n }\n }\n\n var iterator = iteratorFn.call(iterableChildren);\n var step;\n var ii = 0;\n\n while (!(step = iterator.next()).done) {\n child = step.value;\n nextName = nextNamePrefix + getElementKey(child, ii++);\n subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback);\n }\n } else if (type === 'object') {\n // eslint-disable-next-line react-internal/safe-string-coercion\n var childrenString = String(children);\n throw new Error(\"Objects are not valid as a React child (found: \" + (childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString) + \"). \" + 'If you meant to render a collection of children, use an array ' + 'instead.');\n }\n }\n\n return subtreeCount;\n}\n\n/**\n * Maps children that are typically specified as `props.children`.\n *\n * See https://reactjs.org/docs/react-api.html#reactchildrenmap\n *\n * The provided mapFunction(child, index) will be called for each\n * leaf child.\n *\n * @param {?*} children Children tree container.\n * @param {function(*, int)} func The map function.\n * @param {*} context Context for mapFunction.\n * @return {object} Object containing the ordered map of results.\n */\nfunction mapChildren(children, func, context) {\n if (children == null) {\n return children;\n }\n\n var result = [];\n var count = 0;\n mapIntoArray(children, result, '', '', function (child) {\n return func.call(context, child, count++);\n });\n return result;\n}\n/**\n * Count the number of children that are typically specified as\n * `props.children`.\n *\n * See https://reactjs.org/docs/react-api.html#reactchildrencount\n *\n * @param {?*} children Children tree container.\n * @return {number} The number of children.\n */\n\n\nfunction countChildren(children) {\n var n = 0;\n mapChildren(children, function () {\n n++; // Don't return anything\n });\n return n;\n}\n\n/**\n * Iterates through children that are typically specified as `props.children`.\n *\n * See https://reactjs.org/docs/react-api.html#reactchildrenforeach\n *\n * The provided forEachFunc(child, index) will be called for each\n * leaf child.\n *\n * @param {?*} children Children tree container.\n * @param {function(*, int)} forEachFunc\n * @param {*} forEachContext Context for forEachContext.\n */\nfunction forEachChildren(children, forEachFunc, forEachContext) {\n mapChildren(children, function () {\n forEachFunc.apply(this, arguments); // Don't return anything.\n }, forEachContext);\n}\n/**\n * Flatten a children object (typically specified as `props.children`) and\n * return an array with appropriately re-keyed children.\n *\n * See https://reactjs.org/docs/react-api.html#reactchildrentoarray\n */\n\n\nfunction toArray(children) {\n return mapChildren(children, function (child) {\n return child;\n }) || [];\n}\n/**\n * Returns the first child in a collection of children and verifies that there\n * is only one child in the collection.\n *\n * See https://reactjs.org/docs/react-api.html#reactchildrenonly\n *\n * The current implementation of this function assumes that a single child gets\n * passed without a wrapper, but the purpose of this helper function is to\n * abstract away the particular structure of children.\n *\n * @param {?object} children Child collection structure.\n * @return {ReactElement} The first and only `ReactElement` contained in the\n * structure.\n */\n\n\nfunction onlyChild(children) {\n if (!isValidElement(children)) {\n throw new Error('React.Children.only expected to receive a single React element child.');\n }\n\n return children;\n}\n\nfunction createContext(defaultValue) {\n // TODO: Second argument used to be an optional `calculateChangedBits`\n // function. Warn to reserve for future use?\n var context = {\n $$typeof: REACT_CONTEXT_TYPE,\n // As a workaround to support multiple concurrent renderers, we categorize\n // some renderers as primary and others as secondary. We only expect\n // there to be two concurrent renderers at most: React Native (primary) and\n // Fabric (secondary); React DOM (primary) and React ART (secondary).\n // Secondary renderers store their context values on separate fields.\n _currentValue: defaultValue,\n _currentValue2: defaultValue,\n // Used to track how many concurrent renderers this context currently\n // supports within in a single renderer. Such as parallel server rendering.\n _threadCount: 0,\n // These are circular\n Provider: null,\n Consumer: null,\n // Add these to use same hidden class in VM as ServerContext\n _defaultValue: null,\n _globalName: null\n };\n context.Provider = {\n $$typeof: REACT_PROVIDER_TYPE,\n _context: context\n };\n var hasWarnedAboutUsingNestedContextConsumers = false;\n var hasWarnedAboutUsingConsumerProvider = false;\n var hasWarnedAboutDisplayNameOnConsumer = false;\n\n {\n // A separate object, but proxies back to the original context object for\n // backwards compatibility. It has a different $$typeof, so we can properly\n // warn for the incorrect usage of Context as a Consumer.\n var Consumer = {\n $$typeof: REACT_CONTEXT_TYPE,\n _context: context\n }; // $FlowFixMe: Flow complains about not setting a value, which is intentional here\n\n Object.defineProperties(Consumer, {\n Provider: {\n get: function () {\n if (!hasWarnedAboutUsingConsumerProvider) {\n hasWarnedAboutUsingConsumerProvider = true;\n\n error('Rendering is not supported and will be removed in ' + 'a future major release. Did you mean to render instead?');\n }\n\n return context.Provider;\n },\n set: function (_Provider) {\n context.Provider = _Provider;\n }\n },\n _currentValue: {\n get: function () {\n return context._currentValue;\n },\n set: function (_currentValue) {\n context._currentValue = _currentValue;\n }\n },\n _currentValue2: {\n get: function () {\n return context._currentValue2;\n },\n set: function (_currentValue2) {\n context._currentValue2 = _currentValue2;\n }\n },\n _threadCount: {\n get: function () {\n return context._threadCount;\n },\n set: function (_threadCount) {\n context._threadCount = _threadCount;\n }\n },\n Consumer: {\n get: function () {\n if (!hasWarnedAboutUsingNestedContextConsumers) {\n hasWarnedAboutUsingNestedContextConsumers = true;\n\n error('Rendering is not supported and will be removed in ' + 'a future major release. Did you mean to render instead?');\n }\n\n return context.Consumer;\n }\n },\n displayName: {\n get: function () {\n return context.displayName;\n },\n set: function (displayName) {\n if (!hasWarnedAboutDisplayNameOnConsumer) {\n warn('Setting `displayName` on Context.Consumer has no effect. ' + \"You should set it directly on the context with Context.displayName = '%s'.\", displayName);\n\n hasWarnedAboutDisplayNameOnConsumer = true;\n }\n }\n }\n }); // $FlowFixMe: Flow complains about missing properties because it doesn't understand defineProperty\n\n context.Consumer = Consumer;\n }\n\n {\n context._currentRenderer = null;\n context._currentRenderer2 = null;\n }\n\n return context;\n}\n\nvar Uninitialized = -1;\nvar Pending = 0;\nvar Resolved = 1;\nvar Rejected = 2;\n\nfunction lazyInitializer(payload) {\n if (payload._status === Uninitialized) {\n var ctor = payload._result;\n var thenable = ctor(); // Transition to the next state.\n // This might throw either because it's missing or throws. If so, we treat it\n // as still uninitialized and try again next time. Which is the same as what\n // happens if the ctor or any wrappers processing the ctor throws. This might\n // end up fixing it if the resolution was a concurrency bug.\n\n thenable.then(function (moduleObject) {\n if (payload._status === Pending || payload._status === Uninitialized) {\n // Transition to the next state.\n var resolved = payload;\n resolved._status = Resolved;\n resolved._result = moduleObject;\n }\n }, function (error) {\n if (payload._status === Pending || payload._status === Uninitialized) {\n // Transition to the next state.\n var rejected = payload;\n rejected._status = Rejected;\n rejected._result = error;\n }\n });\n\n if (payload._status === Uninitialized) {\n // In case, we're still uninitialized, then we're waiting for the thenable\n // to resolve. Set it as pending in the meantime.\n var pending = payload;\n pending._status = Pending;\n pending._result = thenable;\n }\n }\n\n if (payload._status === Resolved) {\n var moduleObject = payload._result;\n\n {\n if (moduleObject === undefined) {\n error('lazy: Expected the result of a dynamic imp' + 'ort() call. ' + 'Instead received: %s\\n\\nYour code should look like: \\n ' + // Break up imports to avoid accidentally parsing them as dependencies.\n 'const MyComponent = lazy(() => imp' + \"ort('./MyComponent'))\\n\\n\" + 'Did you accidentally put curly braces around the import?', moduleObject);\n }\n }\n\n {\n if (!('default' in moduleObject)) {\n error('lazy: Expected the result of a dynamic imp' + 'ort() call. ' + 'Instead received: %s\\n\\nYour code should look like: \\n ' + // Break up imports to avoid accidentally parsing them as dependencies.\n 'const MyComponent = lazy(() => imp' + \"ort('./MyComponent'))\", moduleObject);\n }\n }\n\n return moduleObject.default;\n } else {\n throw payload._result;\n }\n}\n\nfunction lazy(ctor) {\n var payload = {\n // We use these fields to store the result.\n _status: Uninitialized,\n _result: ctor\n };\n var lazyType = {\n $$typeof: REACT_LAZY_TYPE,\n _payload: payload,\n _init: lazyInitializer\n };\n\n {\n // In production, this would just set it on the object.\n var defaultProps;\n var propTypes; // $FlowFixMe\n\n Object.defineProperties(lazyType, {\n defaultProps: {\n configurable: true,\n get: function () {\n return defaultProps;\n },\n set: function (newDefaultProps) {\n error('React.lazy(...): It is not supported to assign `defaultProps` to ' + 'a lazy component import. Either specify them where the component ' + 'is defined, or create a wrapping component around it.');\n\n defaultProps = newDefaultProps; // Match production behavior more closely:\n // $FlowFixMe\n\n Object.defineProperty(lazyType, 'defaultProps', {\n enumerable: true\n });\n }\n },\n propTypes: {\n configurable: true,\n get: function () {\n return propTypes;\n },\n set: function (newPropTypes) {\n error('React.lazy(...): It is not supported to assign `propTypes` to ' + 'a lazy component import. Either specify them where the component ' + 'is defined, or create a wrapping component around it.');\n\n propTypes = newPropTypes; // Match production behavior more closely:\n // $FlowFixMe\n\n Object.defineProperty(lazyType, 'propTypes', {\n enumerable: true\n });\n }\n }\n });\n }\n\n return lazyType;\n}\n\nfunction forwardRef(render) {\n {\n if (render != null && render.$$typeof === REACT_MEMO_TYPE) {\n error('forwardRef requires a render function but received a `memo` ' + 'component. Instead of forwardRef(memo(...)), use ' + 'memo(forwardRef(...)).');\n } else if (typeof render !== 'function') {\n error('forwardRef requires a render function but was given %s.', render === null ? 'null' : typeof render);\n } else {\n if (render.length !== 0 && render.length !== 2) {\n error('forwardRef render functions accept exactly two parameters: props and ref. %s', render.length === 1 ? 'Did you forget to use the ref parameter?' : 'Any additional parameter will be undefined.');\n }\n }\n\n if (render != null) {\n if (render.defaultProps != null || render.propTypes != null) {\n error('forwardRef render functions do not support propTypes or defaultProps. ' + 'Did you accidentally pass a React component?');\n }\n }\n }\n\n var elementType = {\n $$typeof: REACT_FORWARD_REF_TYPE,\n render: render\n };\n\n {\n var ownName;\n Object.defineProperty(elementType, 'displayName', {\n enumerable: false,\n configurable: true,\n get: function () {\n return ownName;\n },\n set: function (name) {\n ownName = name; // The inner component shouldn't inherit this display name in most cases,\n // because the component may be used elsewhere.\n // But it's nice for anonymous functions to inherit the name,\n // so that our component-stack generation logic will display their frames.\n // An anonymous function generally suggests a pattern like:\n // React.forwardRef((props, ref) => {...});\n // This kind of inner function is not used elsewhere so the side effect is okay.\n\n if (!render.name && !render.displayName) {\n render.displayName = name;\n }\n }\n });\n }\n\n return elementType;\n}\n\nvar REACT_MODULE_REFERENCE;\n\n{\n REACT_MODULE_REFERENCE = Symbol.for('react.module.reference');\n}\n\nfunction isValidElementType(type) {\n if (typeof type === 'string' || typeof type === 'function') {\n return true;\n } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).\n\n\n if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing ) {\n return true;\n }\n\n if (typeof type === 'object' && type !== null) {\n if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object\n // types supported by any Flight configuration anywhere since\n // we don't know which Flight build this will end up being used\n // with.\n type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) {\n return true;\n }\n }\n\n return false;\n}\n\nfunction memo(type, compare) {\n {\n if (!isValidElementType(type)) {\n error('memo: The first argument must be a component. Instead ' + 'received: %s', type === null ? 'null' : typeof type);\n }\n }\n\n var elementType = {\n $$typeof: REACT_MEMO_TYPE,\n type: type,\n compare: compare === undefined ? null : compare\n };\n\n {\n var ownName;\n Object.defineProperty(elementType, 'displayName', {\n enumerable: false,\n configurable: true,\n get: function () {\n return ownName;\n },\n set: function (name) {\n ownName = name; // The inner component shouldn't inherit this display name in most cases,\n // because the component may be used elsewhere.\n // But it's nice for anonymous functions to inherit the name,\n // so that our component-stack generation logic will display their frames.\n // An anonymous function generally suggests a pattern like:\n // React.memo((props) => {...});\n // This kind of inner function is not used elsewhere so the side effect is okay.\n\n if (!type.name && !type.displayName) {\n type.displayName = name;\n }\n }\n });\n }\n\n return elementType;\n}\n\nfunction resolveDispatcher() {\n var dispatcher = ReactCurrentDispatcher.current;\n\n {\n if (dispatcher === null) {\n error('Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for' + ' one of the following reasons:\\n' + '1. You might have mismatching versions of React and the renderer (such as React DOM)\\n' + '2. You might be breaking the Rules of Hooks\\n' + '3. You might have more than one copy of React in the same app\\n' + 'See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.');\n }\n } // Will result in a null access error if accessed outside render phase. We\n // intentionally don't throw our own error because this is in a hot path.\n // Also helps ensure this is inlined.\n\n\n return dispatcher;\n}\nfunction useContext(Context) {\n var dispatcher = resolveDispatcher();\n\n {\n // TODO: add a more generic warning for invalid values.\n if (Context._context !== undefined) {\n var realContext = Context._context; // Don't deduplicate because this legitimately causes bugs\n // and nobody should be using this in existing code.\n\n if (realContext.Consumer === Context) {\n error('Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be ' + 'removed in a future major release. Did you mean to call useContext(Context) instead?');\n } else if (realContext.Provider === Context) {\n error('Calling useContext(Context.Provider) is not supported. ' + 'Did you mean to call useContext(Context) instead?');\n }\n }\n }\n\n return dispatcher.useContext(Context);\n}\nfunction useState(initialState) {\n var dispatcher = resolveDispatcher();\n return dispatcher.useState(initialState);\n}\nfunction useReducer(reducer, initialArg, init) {\n var dispatcher = resolveDispatcher();\n return dispatcher.useReducer(reducer, initialArg, init);\n}\nfunction useRef(initialValue) {\n var dispatcher = resolveDispatcher();\n return dispatcher.useRef(initialValue);\n}\nfunction useEffect(create, deps) {\n var dispatcher = resolveDispatcher();\n return dispatcher.useEffect(create, deps);\n}\nfunction useInsertionEffect(create, deps) {\n var dispatcher = resolveDispatcher();\n return dispatcher.useInsertionEffect(create, deps);\n}\nfunction useLayoutEffect(create, deps) {\n var dispatcher = resolveDispatcher();\n return dispatcher.useLayoutEffect(create, deps);\n}\nfunction useCallback(callback, deps) {\n var dispatcher = resolveDispatcher();\n return dispatcher.useCallback(callback, deps);\n}\nfunction useMemo(create, deps) {\n var dispatcher = resolveDispatcher();\n return dispatcher.useMemo(create, deps);\n}\nfunction useImperativeHandle(ref, create, deps) {\n var dispatcher = resolveDispatcher();\n return dispatcher.useImperativeHandle(ref, create, deps);\n}\nfunction useDebugValue(value, formatterFn) {\n {\n var dispatcher = resolveDispatcher();\n return dispatcher.useDebugValue(value, formatterFn);\n }\n}\nfunction useTransition() {\n var dispatcher = resolveDispatcher();\n return dispatcher.useTransition();\n}\nfunction useDeferredValue(value) {\n var dispatcher = resolveDispatcher();\n return dispatcher.useDeferredValue(value);\n}\nfunction useId() {\n var dispatcher = resolveDispatcher();\n return dispatcher.useId();\n}\nfunction useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) {\n var dispatcher = resolveDispatcher();\n return dispatcher.useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);\n}\n\n// Helpers to patch console.logs to avoid logging during side-effect free\n// replaying on render function. This currently only patches the object\n// lazily which won't cover if the log function was extracted eagerly.\n// We could also eagerly patch the method.\nvar disabledDepth = 0;\nvar prevLog;\nvar prevInfo;\nvar prevWarn;\nvar prevError;\nvar prevGroup;\nvar prevGroupCollapsed;\nvar prevGroupEnd;\n\nfunction disabledLog() {}\n\ndisabledLog.__reactDisabledLog = true;\nfunction disableLogs() {\n {\n if (disabledDepth === 0) {\n /* eslint-disable react-internal/no-production-logging */\n prevLog = console.log;\n prevInfo = console.info;\n prevWarn = console.warn;\n prevError = console.error;\n prevGroup = console.group;\n prevGroupCollapsed = console.groupCollapsed;\n prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099\n\n var props = {\n configurable: true,\n enumerable: true,\n value: disabledLog,\n writable: true\n }; // $FlowFixMe Flow thinks console is immutable.\n\n Object.defineProperties(console, {\n info: props,\n log: props,\n warn: props,\n error: props,\n group: props,\n groupCollapsed: props,\n groupEnd: props\n });\n /* eslint-enable react-internal/no-production-logging */\n }\n\n disabledDepth++;\n }\n}\nfunction reenableLogs() {\n {\n disabledDepth--;\n\n if (disabledDepth === 0) {\n /* eslint-disable react-internal/no-production-logging */\n var props = {\n configurable: true,\n enumerable: true,\n writable: true\n }; // $FlowFixMe Flow thinks console is immutable.\n\n Object.defineProperties(console, {\n log: assign({}, props, {\n value: prevLog\n }),\n info: assign({}, props, {\n value: prevInfo\n }),\n warn: assign({}, props, {\n value: prevWarn\n }),\n error: assign({}, props, {\n value: prevError\n }),\n group: assign({}, props, {\n value: prevGroup\n }),\n groupCollapsed: assign({}, props, {\n value: prevGroupCollapsed\n }),\n groupEnd: assign({}, props, {\n value: prevGroupEnd\n })\n });\n /* eslint-enable react-internal/no-production-logging */\n }\n\n if (disabledDepth < 0) {\n error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');\n }\n }\n}\n\nvar ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher;\nvar prefix;\nfunction describeBuiltInComponentFrame(name, source, ownerFn) {\n {\n if (prefix === undefined) {\n // Extract the VM specific prefix used by each line.\n try {\n throw Error();\n } catch (x) {\n var match = x.stack.trim().match(/\\n( *(at )?)/);\n prefix = match && match[1] || '';\n }\n } // We use the prefix to ensure our stacks line up with native stack frames.\n\n\n return '\\n' + prefix + name;\n }\n}\nvar reentry = false;\nvar componentFrameCache;\n\n{\n var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;\n componentFrameCache = new PossiblyWeakMap();\n}\n\nfunction describeNativeComponentFrame(fn, construct) {\n // If something asked for a stack inside a fake render, it should get ignored.\n if ( !fn || reentry) {\n return '';\n }\n\n {\n var frame = componentFrameCache.get(fn);\n\n if (frame !== undefined) {\n return frame;\n }\n }\n\n var control;\n reentry = true;\n var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined.\n\n Error.prepareStackTrace = undefined;\n var previousDispatcher;\n\n {\n previousDispatcher = ReactCurrentDispatcher$1.current; // Set the dispatcher in DEV because this might be call in the render function\n // for warnings.\n\n ReactCurrentDispatcher$1.current = null;\n disableLogs();\n }\n\n try {\n // This should throw.\n if (construct) {\n // Something should be setting the props in the constructor.\n var Fake = function () {\n throw Error();\n }; // $FlowFixMe\n\n\n Object.defineProperty(Fake.prototype, 'props', {\n set: function () {\n // We use a throwing setter instead of frozen or non-writable props\n // because that won't throw in a non-strict mode function.\n throw Error();\n }\n });\n\n if (typeof Reflect === 'object' && Reflect.construct) {\n // We construct a different control for this case to include any extra\n // frames added by the construct call.\n try {\n Reflect.construct(Fake, []);\n } catch (x) {\n control = x;\n }\n\n Reflect.construct(fn, [], Fake);\n } else {\n try {\n Fake.call();\n } catch (x) {\n control = x;\n }\n\n fn.call(Fake.prototype);\n }\n } else {\n try {\n throw Error();\n } catch (x) {\n control = x;\n }\n\n fn();\n }\n } catch (sample) {\n // This is inlined manually because closure doesn't do it for us.\n if (sample && control && typeof sample.stack === 'string') {\n // This extracts the first frame from the sample that isn't also in the control.\n // Skipping one frame that we assume is the frame that calls the two.\n var sampleLines = sample.stack.split('\\n');\n var controlLines = control.stack.split('\\n');\n var s = sampleLines.length - 1;\n var c = controlLines.length - 1;\n\n while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {\n // We expect at least one stack frame to be shared.\n // Typically this will be the root most one. However, stack frames may be\n // cut off due to maximum stack limits. In this case, one maybe cut off\n // earlier than the other. We assume that the sample is longer or the same\n // and there for cut off earlier. So we should find the root most frame in\n // the sample somewhere in the control.\n c--;\n }\n\n for (; s >= 1 && c >= 0; s--, c--) {\n // Next we find the first one that isn't the same which should be the\n // frame that called our sample function and the control.\n if (sampleLines[s] !== controlLines[c]) {\n // In V8, the first line is describing the message but other VMs don't.\n // If we're about to return the first line, and the control is also on the same\n // line, that's a pretty good indicator that our sample threw at same line as\n // the control. I.e. before we entered the sample frame. So we ignore this result.\n // This can happen if you passed a class to function component, or non-function.\n if (s !== 1 || c !== 1) {\n do {\n s--;\n c--; // We may still have similar intermediate frames from the construct call.\n // The next one that isn't the same should be our match though.\n\n if (c < 0 || sampleLines[s] !== controlLines[c]) {\n // V8 adds a \"new\" prefix for native classes. Let's remove it to make it prettier.\n var _frame = '\\n' + sampleLines[s].replace(' at new ', ' at '); // If our component frame is labeled \"\"\n // but we have a user-provided \"displayName\"\n // splice it in to make the stack more readable.\n\n\n if (fn.displayName && _frame.includes('')) {\n _frame = _frame.replace('', fn.displayName);\n }\n\n {\n if (typeof fn === 'function') {\n componentFrameCache.set(fn, _frame);\n }\n } // Return the line we found.\n\n\n return _frame;\n }\n } while (s >= 1 && c >= 0);\n }\n\n break;\n }\n }\n }\n } finally {\n reentry = false;\n\n {\n ReactCurrentDispatcher$1.current = previousDispatcher;\n reenableLogs();\n }\n\n Error.prepareStackTrace = previousPrepareStackTrace;\n } // Fallback to just using the name if we couldn't make it throw.\n\n\n var name = fn ? fn.displayName || fn.name : '';\n var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';\n\n {\n if (typeof fn === 'function') {\n componentFrameCache.set(fn, syntheticFrame);\n }\n }\n\n return syntheticFrame;\n}\nfunction describeFunctionComponentFrame(fn, source, ownerFn) {\n {\n return describeNativeComponentFrame(fn, false);\n }\n}\n\nfunction shouldConstruct(Component) {\n var prototype = Component.prototype;\n return !!(prototype && prototype.isReactComponent);\n}\n\nfunction describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {\n\n if (type == null) {\n return '';\n }\n\n if (typeof type === 'function') {\n {\n return describeNativeComponentFrame(type, shouldConstruct(type));\n }\n }\n\n if (typeof type === 'string') {\n return describeBuiltInComponentFrame(type);\n }\n\n switch (type) {\n case REACT_SUSPENSE_TYPE:\n return describeBuiltInComponentFrame('Suspense');\n\n case REACT_SUSPENSE_LIST_TYPE:\n return describeBuiltInComponentFrame('SuspenseList');\n }\n\n if (typeof type === 'object') {\n switch (type.$$typeof) {\n case REACT_FORWARD_REF_TYPE:\n return describeFunctionComponentFrame(type.render);\n\n case REACT_MEMO_TYPE:\n // Memo may contain any component type so we recursively resolve it.\n return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);\n\n case REACT_LAZY_TYPE:\n {\n var lazyComponent = type;\n var payload = lazyComponent._payload;\n var init = lazyComponent._init;\n\n try {\n // Lazy may contain any component type so we recursively resolve it.\n return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);\n } catch (x) {}\n }\n }\n }\n\n return '';\n}\n\nvar loggedTypeFailures = {};\nvar ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;\n\nfunction setCurrentlyValidatingElement(element) {\n {\n if (element) {\n var owner = element._owner;\n var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);\n ReactDebugCurrentFrame$1.setExtraStackFrame(stack);\n } else {\n ReactDebugCurrentFrame$1.setExtraStackFrame(null);\n }\n }\n}\n\nfunction checkPropTypes(typeSpecs, values, location, componentName, element) {\n {\n // $FlowFixMe This is okay but Flow doesn't know it.\n var has = Function.call.bind(hasOwnProperty);\n\n for (var typeSpecName in typeSpecs) {\n if (has(typeSpecs, typeSpecName)) {\n var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to\n // fail the render phase where it didn't fail before. So we log it.\n // After these have been cleaned up, we'll let them throw.\n\n try {\n // This is intentionally an invariant that gets caught. It's the same\n // behavior as without this statement except with a better message.\n if (typeof typeSpecs[typeSpecName] !== 'function') {\n // eslint-disable-next-line react-internal/prod-error-codes\n var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.');\n err.name = 'Invariant Violation';\n throw err;\n }\n\n error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');\n } catch (ex) {\n error$1 = ex;\n }\n\n if (error$1 && !(error$1 instanceof Error)) {\n setCurrentlyValidatingElement(element);\n\n error('%s: type specification of %s' + ' `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error$1);\n\n setCurrentlyValidatingElement(null);\n }\n\n if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {\n // Only monitor this failure once because there tends to be a lot of the\n // same error.\n loggedTypeFailures[error$1.message] = true;\n setCurrentlyValidatingElement(element);\n\n error('Failed %s type: %s', location, error$1.message);\n\n setCurrentlyValidatingElement(null);\n }\n }\n }\n }\n}\n\nfunction setCurrentlyValidatingElement$1(element) {\n {\n if (element) {\n var owner = element._owner;\n var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);\n setExtraStackFrame(stack);\n } else {\n setExtraStackFrame(null);\n }\n }\n}\n\nvar propTypesMisspellWarningShown;\n\n{\n propTypesMisspellWarningShown = false;\n}\n\nfunction getDeclarationErrorAddendum() {\n if (ReactCurrentOwner.current) {\n var name = getComponentNameFromType(ReactCurrentOwner.current.type);\n\n if (name) {\n return '\\n\\nCheck the render method of `' + name + '`.';\n }\n }\n\n return '';\n}\n\nfunction getSourceInfoErrorAddendum(source) {\n if (source !== undefined) {\n var fileName = source.fileName.replace(/^.*[\\\\\\/]/, '');\n var lineNumber = source.lineNumber;\n return '\\n\\nCheck your code at ' + fileName + ':' + lineNumber + '.';\n }\n\n return '';\n}\n\nfunction getSourceInfoErrorAddendumForProps(elementProps) {\n if (elementProps !== null && elementProps !== undefined) {\n return getSourceInfoErrorAddendum(elementProps.__source);\n }\n\n return '';\n}\n/**\n * Warn if there's no key explicitly set on dynamic arrays of children or\n * object keys are not valid. This allows us to keep track of children between\n * updates.\n */\n\n\nvar ownerHasKeyUseWarning = {};\n\nfunction getCurrentComponentErrorInfo(parentType) {\n var info = getDeclarationErrorAddendum();\n\n if (!info) {\n var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;\n\n if (parentName) {\n info = \"\\n\\nCheck the top-level render call using <\" + parentName + \">.\";\n }\n }\n\n return info;\n}\n/**\n * Warn if the element doesn't have an explicit key assigned to it.\n * This element is in an array. The array could grow and shrink or be\n * reordered. All children that haven't already been validated are required to\n * have a \"key\" property assigned to it. Error statuses are cached so a warning\n * will only be shown once.\n *\n * @internal\n * @param {ReactElement} element Element that requires a key.\n * @param {*} parentType element's parent's type.\n */\n\n\nfunction validateExplicitKey(element, parentType) {\n if (!element._store || element._store.validated || element.key != null) {\n return;\n }\n\n element._store.validated = true;\n var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);\n\n if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {\n return;\n }\n\n ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a\n // property, it may be the creator of the child that's responsible for\n // assigning it a key.\n\n var childOwner = '';\n\n if (element && element._owner && element._owner !== ReactCurrentOwner.current) {\n // Give the component that originally created this child.\n childOwner = \" It was passed a child from \" + getComponentNameFromType(element._owner.type) + \".\";\n }\n\n {\n setCurrentlyValidatingElement$1(element);\n\n error('Each child in a list should have a unique \"key\" prop.' + '%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner);\n\n setCurrentlyValidatingElement$1(null);\n }\n}\n/**\n * Ensure that every element either is passed in a static location, in an\n * array with an explicit keys property defined, or in an object literal\n * with valid key property.\n *\n * @internal\n * @param {ReactNode} node Statically passed child of any type.\n * @param {*} parentType node's parent's type.\n */\n\n\nfunction validateChildKeys(node, parentType) {\n if (typeof node !== 'object') {\n return;\n }\n\n if (isArray(node)) {\n for (var i = 0; i < node.length; i++) {\n var child = node[i];\n\n if (isValidElement(child)) {\n validateExplicitKey(child, parentType);\n }\n }\n } else if (isValidElement(node)) {\n // This element was passed in a valid location.\n if (node._store) {\n node._store.validated = true;\n }\n } else if (node) {\n var iteratorFn = getIteratorFn(node);\n\n if (typeof iteratorFn === 'function') {\n // Entry iterators used to provide implicit keys,\n // but now we print a separate warning for them later.\n if (iteratorFn !== node.entries) {\n var iterator = iteratorFn.call(node);\n var step;\n\n while (!(step = iterator.next()).done) {\n if (isValidElement(step.value)) {\n validateExplicitKey(step.value, parentType);\n }\n }\n }\n }\n }\n}\n/**\n * Given an element, validate that its props follow the propTypes definition,\n * provided by the type.\n *\n * @param {ReactElement} element\n */\n\n\nfunction validatePropTypes(element) {\n {\n var type = element.type;\n\n if (type === null || type === undefined || typeof type === 'string') {\n return;\n }\n\n var propTypes;\n\n if (typeof type === 'function') {\n propTypes = type.propTypes;\n } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.\n // Inner props are checked in the reconciler.\n type.$$typeof === REACT_MEMO_TYPE)) {\n propTypes = type.propTypes;\n } else {\n return;\n }\n\n if (propTypes) {\n // Intentionally inside to avoid triggering lazy initializers:\n var name = getComponentNameFromType(type);\n checkPropTypes(propTypes, element.props, 'prop', name, element);\n } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {\n propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers:\n\n var _name = getComponentNameFromType(type);\n\n error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown');\n }\n\n if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) {\n error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');\n }\n }\n}\n/**\n * Given a fragment, validate that it can only be provided with fragment props\n * @param {ReactElement} fragment\n */\n\n\nfunction validateFragmentProps(fragment) {\n {\n var keys = Object.keys(fragment.props);\n\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n\n if (key !== 'children' && key !== 'key') {\n setCurrentlyValidatingElement$1(fragment);\n\n error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);\n\n setCurrentlyValidatingElement$1(null);\n break;\n }\n }\n\n if (fragment.ref !== null) {\n setCurrentlyValidatingElement$1(fragment);\n\n error('Invalid attribute `ref` supplied to `React.Fragment`.');\n\n setCurrentlyValidatingElement$1(null);\n }\n }\n}\nfunction createElementWithValidation(type, props, children) {\n var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to\n // succeed and there will likely be errors in render.\n\n if (!validType) {\n var info = '';\n\n if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {\n info += ' You likely forgot to export your component from the file ' + \"it's defined in, or you might have mixed up default and named imports.\";\n }\n\n var sourceInfo = getSourceInfoErrorAddendumForProps(props);\n\n if (sourceInfo) {\n info += sourceInfo;\n } else {\n info += getDeclarationErrorAddendum();\n }\n\n var typeString;\n\n if (type === null) {\n typeString = 'null';\n } else if (isArray(type)) {\n typeString = 'array';\n } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {\n typeString = \"<\" + (getComponentNameFromType(type.type) || 'Unknown') + \" />\";\n info = ' Did you accidentally export a JSX literal instead of a component?';\n } else {\n typeString = typeof type;\n }\n\n {\n error('React.createElement: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info);\n }\n }\n\n var element = createElement.apply(this, arguments); // The result can be nullish if a mock or a custom function is used.\n // TODO: Drop this when these are no longer allowed as the type argument.\n\n if (element == null) {\n return element;\n } // Skip key warning if the type isn't valid since our key validation logic\n // doesn't expect a non-string/function type and can throw confusing errors.\n // We don't want exception behavior to differ between dev and prod.\n // (Rendering will throw with a helpful message and as soon as the type is\n // fixed, the key warnings will appear.)\n\n\n if (validType) {\n for (var i = 2; i < arguments.length; i++) {\n validateChildKeys(arguments[i], type);\n }\n }\n\n if (type === REACT_FRAGMENT_TYPE) {\n validateFragmentProps(element);\n } else {\n validatePropTypes(element);\n }\n\n return element;\n}\nvar didWarnAboutDeprecatedCreateFactory = false;\nfunction createFactoryWithValidation(type) {\n var validatedFactory = createElementWithValidation.bind(null, type);\n validatedFactory.type = type;\n\n {\n if (!didWarnAboutDeprecatedCreateFactory) {\n didWarnAboutDeprecatedCreateFactory = true;\n\n warn('React.createFactory() is deprecated and will be removed in ' + 'a future major release. Consider using JSX ' + 'or use React.createElement() directly instead.');\n } // Legacy hook: remove it\n\n\n Object.defineProperty(validatedFactory, 'type', {\n enumerable: false,\n get: function () {\n warn('Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.');\n\n Object.defineProperty(this, 'type', {\n value: type\n });\n return type;\n }\n });\n }\n\n return validatedFactory;\n}\nfunction cloneElementWithValidation(element, props, children) {\n var newElement = cloneElement.apply(this, arguments);\n\n for (var i = 2; i < arguments.length; i++) {\n validateChildKeys(arguments[i], newElement.type);\n }\n\n validatePropTypes(newElement);\n return newElement;\n}\n\nfunction startTransition(scope, options) {\n var prevTransition = ReactCurrentBatchConfig.transition;\n ReactCurrentBatchConfig.transition = {};\n var currentTransition = ReactCurrentBatchConfig.transition;\n\n {\n ReactCurrentBatchConfig.transition._updatedFibers = new Set();\n }\n\n try {\n scope();\n } finally {\n ReactCurrentBatchConfig.transition = prevTransition;\n\n {\n if (prevTransition === null && currentTransition._updatedFibers) {\n var updatedFibersCount = currentTransition._updatedFibers.size;\n\n if (updatedFibersCount > 10) {\n warn('Detected a large number of updates inside startTransition. ' + 'If this is due to a subscription please re-write it to use React provided hooks. ' + 'Otherwise concurrent mode guarantees are off the table.');\n }\n\n currentTransition._updatedFibers.clear();\n }\n }\n }\n}\n\nvar didWarnAboutMessageChannel = false;\nvar enqueueTaskImpl = null;\nfunction enqueueTask(task) {\n if (enqueueTaskImpl === null) {\n try {\n // read require off the module object to get around the bundlers.\n // we don't want them to detect a require and bundle a Node polyfill.\n var requireString = ('require' + Math.random()).slice(0, 7);\n var nodeRequire = module && module[requireString]; // assuming we're in node, let's try to get node's\n // version of setImmediate, bypassing fake timers if any.\n\n enqueueTaskImpl = nodeRequire.call(module, 'timers').setImmediate;\n } catch (_err) {\n // we're in a browser\n // we can't use regular timers because they may still be faked\n // so we try MessageChannel+postMessage instead\n enqueueTaskImpl = function (callback) {\n {\n if (didWarnAboutMessageChannel === false) {\n didWarnAboutMessageChannel = true;\n\n if (typeof MessageChannel === 'undefined') {\n error('This browser does not have a MessageChannel implementation, ' + 'so enqueuing tasks via await act(async () => ...) will fail. ' + 'Please file an issue at https://github.com/facebook/react/issues ' + 'if you encounter this warning.');\n }\n }\n }\n\n var channel = new MessageChannel();\n channel.port1.onmessage = callback;\n channel.port2.postMessage(undefined);\n };\n }\n }\n\n return enqueueTaskImpl(task);\n}\n\nvar actScopeDepth = 0;\nvar didWarnNoAwaitAct = false;\nfunction act(callback) {\n {\n // `act` calls can be nested, so we track the depth. This represents the\n // number of `act` scopes on the stack.\n var prevActScopeDepth = actScopeDepth;\n actScopeDepth++;\n\n if (ReactCurrentActQueue.current === null) {\n // This is the outermost `act` scope. Initialize the queue. The reconciler\n // will detect the queue and use it instead of Scheduler.\n ReactCurrentActQueue.current = [];\n }\n\n var prevIsBatchingLegacy = ReactCurrentActQueue.isBatchingLegacy;\n var result;\n\n try {\n // Used to reproduce behavior of `batchedUpdates` in legacy mode. Only\n // set to `true` while the given callback is executed, not for updates\n // triggered during an async event, because this is how the legacy\n // implementation of `act` behaved.\n ReactCurrentActQueue.isBatchingLegacy = true;\n result = callback(); // Replicate behavior of original `act` implementation in legacy mode,\n // which flushed updates immediately after the scope function exits, even\n // if it's an async function.\n\n if (!prevIsBatchingLegacy && ReactCurrentActQueue.didScheduleLegacyUpdate) {\n var queue = ReactCurrentActQueue.current;\n\n if (queue !== null) {\n ReactCurrentActQueue.didScheduleLegacyUpdate = false;\n flushActQueue(queue);\n }\n }\n } catch (error) {\n popActScope(prevActScopeDepth);\n throw error;\n } finally {\n ReactCurrentActQueue.isBatchingLegacy = prevIsBatchingLegacy;\n }\n\n if (result !== null && typeof result === 'object' && typeof result.then === 'function') {\n var thenableResult = result; // The callback is an async function (i.e. returned a promise). Wait\n // for it to resolve before exiting the current scope.\n\n var wasAwaited = false;\n var thenable = {\n then: function (resolve, reject) {\n wasAwaited = true;\n thenableResult.then(function (returnValue) {\n popActScope(prevActScopeDepth);\n\n if (actScopeDepth === 0) {\n // We've exited the outermost act scope. Recursively flush the\n // queue until there's no remaining work.\n recursivelyFlushAsyncActWork(returnValue, resolve, reject);\n } else {\n resolve(returnValue);\n }\n }, function (error) {\n // The callback threw an error.\n popActScope(prevActScopeDepth);\n reject(error);\n });\n }\n };\n\n {\n if (!didWarnNoAwaitAct && typeof Promise !== 'undefined') {\n // eslint-disable-next-line no-undef\n Promise.resolve().then(function () {}).then(function () {\n if (!wasAwaited) {\n didWarnNoAwaitAct = true;\n\n error('You called act(async () => ...) without await. ' + 'This could lead to unexpected testing behaviour, ' + 'interleaving multiple act calls and mixing their ' + 'scopes. ' + 'You should - await act(async () => ...);');\n }\n });\n }\n }\n\n return thenable;\n } else {\n var returnValue = result; // The callback is not an async function. Exit the current scope\n // immediately, without awaiting.\n\n popActScope(prevActScopeDepth);\n\n if (actScopeDepth === 0) {\n // Exiting the outermost act scope. Flush the queue.\n var _queue = ReactCurrentActQueue.current;\n\n if (_queue !== null) {\n flushActQueue(_queue);\n ReactCurrentActQueue.current = null;\n } // Return a thenable. If the user awaits it, we'll flush again in\n // case additional work was scheduled by a microtask.\n\n\n var _thenable = {\n then: function (resolve, reject) {\n // Confirm we haven't re-entered another `act` scope, in case\n // the user does something weird like await the thenable\n // multiple times.\n if (ReactCurrentActQueue.current === null) {\n // Recursively flush the queue until there's no remaining work.\n ReactCurrentActQueue.current = [];\n recursivelyFlushAsyncActWork(returnValue, resolve, reject);\n } else {\n resolve(returnValue);\n }\n }\n };\n return _thenable;\n } else {\n // Since we're inside a nested `act` scope, the returned thenable\n // immediately resolves. The outer scope will flush the queue.\n var _thenable2 = {\n then: function (resolve, reject) {\n resolve(returnValue);\n }\n };\n return _thenable2;\n }\n }\n }\n}\n\nfunction popActScope(prevActScopeDepth) {\n {\n if (prevActScopeDepth !== actScopeDepth - 1) {\n error('You seem to have overlapping act() calls, this is not supported. ' + 'Be sure to await previous act() calls before making a new one. ');\n }\n\n actScopeDepth = prevActScopeDepth;\n }\n}\n\nfunction recursivelyFlushAsyncActWork(returnValue, resolve, reject) {\n {\n var queue = ReactCurrentActQueue.current;\n\n if (queue !== null) {\n try {\n flushActQueue(queue);\n enqueueTask(function () {\n if (queue.length === 0) {\n // No additional work was scheduled. Finish.\n ReactCurrentActQueue.current = null;\n resolve(returnValue);\n } else {\n // Keep flushing work until there's none left.\n recursivelyFlushAsyncActWork(returnValue, resolve, reject);\n }\n });\n } catch (error) {\n reject(error);\n }\n } else {\n resolve(returnValue);\n }\n }\n}\n\nvar isFlushing = false;\n\nfunction flushActQueue(queue) {\n {\n if (!isFlushing) {\n // Prevent re-entrance.\n isFlushing = true;\n var i = 0;\n\n try {\n for (; i < queue.length; i++) {\n var callback = queue[i];\n\n do {\n callback = callback(true);\n } while (callback !== null);\n }\n\n queue.length = 0;\n } catch (error) {\n // If something throws, leave the remaining callbacks on the queue.\n queue = queue.slice(i + 1);\n throw error;\n } finally {\n isFlushing = false;\n }\n }\n }\n}\n\nvar createElement$1 = createElementWithValidation ;\nvar cloneElement$1 = cloneElementWithValidation ;\nvar createFactory = createFactoryWithValidation ;\nvar Children = {\n map: mapChildren,\n forEach: forEachChildren,\n count: countChildren,\n toArray: toArray,\n only: onlyChild\n};\n\nexports.Children = Children;\nexports.Component = Component;\nexports.Fragment = REACT_FRAGMENT_TYPE;\nexports.Profiler = REACT_PROFILER_TYPE;\nexports.PureComponent = PureComponent;\nexports.StrictMode = REACT_STRICT_MODE_TYPE;\nexports.Suspense = REACT_SUSPENSE_TYPE;\nexports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = ReactSharedInternals;\nexports.act = act;\nexports.cloneElement = cloneElement$1;\nexports.createContext = createContext;\nexports.createElement = createElement$1;\nexports.createFactory = createFactory;\nexports.createRef = createRef;\nexports.forwardRef = forwardRef;\nexports.isValidElement = isValidElement;\nexports.lazy = lazy;\nexports.memo = memo;\nexports.startTransition = startTransition;\nexports.unstable_act = act;\nexports.useCallback = useCallback;\nexports.useContext = useContext;\nexports.useDebugValue = useDebugValue;\nexports.useDeferredValue = useDeferredValue;\nexports.useEffect = useEffect;\nexports.useId = useId;\nexports.useImperativeHandle = useImperativeHandle;\nexports.useInsertionEffect = useInsertionEffect;\nexports.useLayoutEffect = useLayoutEffect;\nexports.useMemo = useMemo;\nexports.useReducer = useReducer;\nexports.useRef = useRef;\nexports.useState = useState;\nexports.useSyncExternalStore = useSyncExternalStore;\nexports.useTransition = useTransition;\nexports.version = ReactVersion;\n /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */\nif (\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop ===\n 'function'\n) {\n __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());\n}\n \n })();\n}\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react.production.min.js');\n} else {\n module.exports = require('./cjs/react.development.js');\n}\n","/**\n * @license React\n * react-jsx-runtime.development.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nif (process.env.NODE_ENV !== \"production\") {\n (function() {\n'use strict';\n\nvar React = require('react');\n\n// ATTENTION\n// When adding new symbols to this file,\n// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'\n// The Symbol used to tag the ReactElement-like types.\nvar REACT_ELEMENT_TYPE = Symbol.for('react.element');\nvar REACT_PORTAL_TYPE = Symbol.for('react.portal');\nvar REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');\nvar REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');\nvar REACT_PROFILER_TYPE = Symbol.for('react.profiler');\nvar REACT_PROVIDER_TYPE = Symbol.for('react.provider');\nvar REACT_CONTEXT_TYPE = Symbol.for('react.context');\nvar REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');\nvar REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');\nvar REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');\nvar REACT_MEMO_TYPE = Symbol.for('react.memo');\nvar REACT_LAZY_TYPE = Symbol.for('react.lazy');\nvar REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');\nvar MAYBE_ITERATOR_SYMBOL = Symbol.iterator;\nvar FAUX_ITERATOR_SYMBOL = '@@iterator';\nfunction getIteratorFn(maybeIterable) {\n if (maybeIterable === null || typeof maybeIterable !== 'object') {\n return null;\n }\n\n var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];\n\n if (typeof maybeIterator === 'function') {\n return maybeIterator;\n }\n\n return null;\n}\n\nvar ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;\n\nfunction error(format) {\n {\n {\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n\n printWarning('error', format, args);\n }\n }\n}\n\nfunction printWarning(level, format, args) {\n // When changing this logic, you might want to also\n // update consoleWithStackDev.www.js as well.\n {\n var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\n var stack = ReactDebugCurrentFrame.getStackAddendum();\n\n if (stack !== '') {\n format += '%s';\n args = args.concat([stack]);\n } // eslint-disable-next-line react-internal/safe-string-coercion\n\n\n var argsWithFormat = args.map(function (item) {\n return String(item);\n }); // Careful: RN currently depends on this prefix\n\n argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it\n // breaks IE9: https://github.com/facebook/react/issues/13610\n // eslint-disable-next-line react-internal/no-production-logging\n\n Function.prototype.apply.call(console[level], console, argsWithFormat);\n }\n}\n\n// -----------------------------------------------------------------------------\n\nvar enableScopeAPI = false; // Experimental Create Event Handle API.\nvar enableCacheElement = false;\nvar enableTransitionTracing = false; // No known bugs, but needs performance testing\n\nvar enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber\n// stuff. Intended to enable React core members to more easily debug scheduling\n// issues in DEV builds.\n\nvar enableDebugTracing = false; // Track which Fiber(s) schedule render work.\n\nvar REACT_MODULE_REFERENCE;\n\n{\n REACT_MODULE_REFERENCE = Symbol.for('react.module.reference');\n}\n\nfunction isValidElementType(type) {\n if (typeof type === 'string' || typeof type === 'function') {\n return true;\n } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).\n\n\n if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing ) {\n return true;\n }\n\n if (typeof type === 'object' && type !== null) {\n if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object\n // types supported by any Flight configuration anywhere since\n // we don't know which Flight build this will end up being used\n // with.\n type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) {\n return true;\n }\n }\n\n return false;\n}\n\nfunction getWrappedName(outerType, innerType, wrapperName) {\n var displayName = outerType.displayName;\n\n if (displayName) {\n return displayName;\n }\n\n var functionName = innerType.displayName || innerType.name || '';\n return functionName !== '' ? wrapperName + \"(\" + functionName + \")\" : wrapperName;\n} // Keep in sync with react-reconciler/getComponentNameFromFiber\n\n\nfunction getContextName(type) {\n return type.displayName || 'Context';\n} // Note that the reconciler package should generally prefer to use getComponentNameFromFiber() instead.\n\n\nfunction getComponentNameFromType(type) {\n if (type == null) {\n // Host root, text node or just invalid type.\n return null;\n }\n\n {\n if (typeof type.tag === 'number') {\n error('Received an unexpected object in getComponentNameFromType(). ' + 'This is likely a bug in React. Please file an issue.');\n }\n }\n\n if (typeof type === 'function') {\n return type.displayName || type.name || null;\n }\n\n if (typeof type === 'string') {\n return type;\n }\n\n switch (type) {\n case REACT_FRAGMENT_TYPE:\n return 'Fragment';\n\n case REACT_PORTAL_TYPE:\n return 'Portal';\n\n case REACT_PROFILER_TYPE:\n return 'Profiler';\n\n case REACT_STRICT_MODE_TYPE:\n return 'StrictMode';\n\n case REACT_SUSPENSE_TYPE:\n return 'Suspense';\n\n case REACT_SUSPENSE_LIST_TYPE:\n return 'SuspenseList';\n\n }\n\n if (typeof type === 'object') {\n switch (type.$$typeof) {\n case REACT_CONTEXT_TYPE:\n var context = type;\n return getContextName(context) + '.Consumer';\n\n case REACT_PROVIDER_TYPE:\n var provider = type;\n return getContextName(provider._context) + '.Provider';\n\n case REACT_FORWARD_REF_TYPE:\n return getWrappedName(type, type.render, 'ForwardRef');\n\n case REACT_MEMO_TYPE:\n var outerName = type.displayName || null;\n\n if (outerName !== null) {\n return outerName;\n }\n\n return getComponentNameFromType(type.type) || 'Memo';\n\n case REACT_LAZY_TYPE:\n {\n var lazyComponent = type;\n var payload = lazyComponent._payload;\n var init = lazyComponent._init;\n\n try {\n return getComponentNameFromType(init(payload));\n } catch (x) {\n return null;\n }\n }\n\n // eslint-disable-next-line no-fallthrough\n }\n }\n\n return null;\n}\n\nvar assign = Object.assign;\n\n// Helpers to patch console.logs to avoid logging during side-effect free\n// replaying on render function. This currently only patches the object\n// lazily which won't cover if the log function was extracted eagerly.\n// We could also eagerly patch the method.\nvar disabledDepth = 0;\nvar prevLog;\nvar prevInfo;\nvar prevWarn;\nvar prevError;\nvar prevGroup;\nvar prevGroupCollapsed;\nvar prevGroupEnd;\n\nfunction disabledLog() {}\n\ndisabledLog.__reactDisabledLog = true;\nfunction disableLogs() {\n {\n if (disabledDepth === 0) {\n /* eslint-disable react-internal/no-production-logging */\n prevLog = console.log;\n prevInfo = console.info;\n prevWarn = console.warn;\n prevError = console.error;\n prevGroup = console.group;\n prevGroupCollapsed = console.groupCollapsed;\n prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099\n\n var props = {\n configurable: true,\n enumerable: true,\n value: disabledLog,\n writable: true\n }; // $FlowFixMe Flow thinks console is immutable.\n\n Object.defineProperties(console, {\n info: props,\n log: props,\n warn: props,\n error: props,\n group: props,\n groupCollapsed: props,\n groupEnd: props\n });\n /* eslint-enable react-internal/no-production-logging */\n }\n\n disabledDepth++;\n }\n}\nfunction reenableLogs() {\n {\n disabledDepth--;\n\n if (disabledDepth === 0) {\n /* eslint-disable react-internal/no-production-logging */\n var props = {\n configurable: true,\n enumerable: true,\n writable: true\n }; // $FlowFixMe Flow thinks console is immutable.\n\n Object.defineProperties(console, {\n log: assign({}, props, {\n value: prevLog\n }),\n info: assign({}, props, {\n value: prevInfo\n }),\n warn: assign({}, props, {\n value: prevWarn\n }),\n error: assign({}, props, {\n value: prevError\n }),\n group: assign({}, props, {\n value: prevGroup\n }),\n groupCollapsed: assign({}, props, {\n value: prevGroupCollapsed\n }),\n groupEnd: assign({}, props, {\n value: prevGroupEnd\n })\n });\n /* eslint-enable react-internal/no-production-logging */\n }\n\n if (disabledDepth < 0) {\n error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');\n }\n }\n}\n\nvar ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;\nvar prefix;\nfunction describeBuiltInComponentFrame(name, source, ownerFn) {\n {\n if (prefix === undefined) {\n // Extract the VM specific prefix used by each line.\n try {\n throw Error();\n } catch (x) {\n var match = x.stack.trim().match(/\\n( *(at )?)/);\n prefix = match && match[1] || '';\n }\n } // We use the prefix to ensure our stacks line up with native stack frames.\n\n\n return '\\n' + prefix + name;\n }\n}\nvar reentry = false;\nvar componentFrameCache;\n\n{\n var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;\n componentFrameCache = new PossiblyWeakMap();\n}\n\nfunction describeNativeComponentFrame(fn, construct) {\n // If something asked for a stack inside a fake render, it should get ignored.\n if ( !fn || reentry) {\n return '';\n }\n\n {\n var frame = componentFrameCache.get(fn);\n\n if (frame !== undefined) {\n return frame;\n }\n }\n\n var control;\n reentry = true;\n var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined.\n\n Error.prepareStackTrace = undefined;\n var previousDispatcher;\n\n {\n previousDispatcher = ReactCurrentDispatcher.current; // Set the dispatcher in DEV because this might be call in the render function\n // for warnings.\n\n ReactCurrentDispatcher.current = null;\n disableLogs();\n }\n\n try {\n // This should throw.\n if (construct) {\n // Something should be setting the props in the constructor.\n var Fake = function () {\n throw Error();\n }; // $FlowFixMe\n\n\n Object.defineProperty(Fake.prototype, 'props', {\n set: function () {\n // We use a throwing setter instead of frozen or non-writable props\n // because that won't throw in a non-strict mode function.\n throw Error();\n }\n });\n\n if (typeof Reflect === 'object' && Reflect.construct) {\n // We construct a different control for this case to include any extra\n // frames added by the construct call.\n try {\n Reflect.construct(Fake, []);\n } catch (x) {\n control = x;\n }\n\n Reflect.construct(fn, [], Fake);\n } else {\n try {\n Fake.call();\n } catch (x) {\n control = x;\n }\n\n fn.call(Fake.prototype);\n }\n } else {\n try {\n throw Error();\n } catch (x) {\n control = x;\n }\n\n fn();\n }\n } catch (sample) {\n // This is inlined manually because closure doesn't do it for us.\n if (sample && control && typeof sample.stack === 'string') {\n // This extracts the first frame from the sample that isn't also in the control.\n // Skipping one frame that we assume is the frame that calls the two.\n var sampleLines = sample.stack.split('\\n');\n var controlLines = control.stack.split('\\n');\n var s = sampleLines.length - 1;\n var c = controlLines.length - 1;\n\n while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {\n // We expect at least one stack frame to be shared.\n // Typically this will be the root most one. However, stack frames may be\n // cut off due to maximum stack limits. In this case, one maybe cut off\n // earlier than the other. We assume that the sample is longer or the same\n // and there for cut off earlier. So we should find the root most frame in\n // the sample somewhere in the control.\n c--;\n }\n\n for (; s >= 1 && c >= 0; s--, c--) {\n // Next we find the first one that isn't the same which should be the\n // frame that called our sample function and the control.\n if (sampleLines[s] !== controlLines[c]) {\n // In V8, the first line is describing the message but other VMs don't.\n // If we're about to return the first line, and the control is also on the same\n // line, that's a pretty good indicator that our sample threw at same line as\n // the control. I.e. before we entered the sample frame. So we ignore this result.\n // This can happen if you passed a class to function component, or non-function.\n if (s !== 1 || c !== 1) {\n do {\n s--;\n c--; // We may still have similar intermediate frames from the construct call.\n // The next one that isn't the same should be our match though.\n\n if (c < 0 || sampleLines[s] !== controlLines[c]) {\n // V8 adds a \"new\" prefix for native classes. Let's remove it to make it prettier.\n var _frame = '\\n' + sampleLines[s].replace(' at new ', ' at '); // If our component frame is labeled \"\"\n // but we have a user-provided \"displayName\"\n // splice it in to make the stack more readable.\n\n\n if (fn.displayName && _frame.includes('')) {\n _frame = _frame.replace('', fn.displayName);\n }\n\n {\n if (typeof fn === 'function') {\n componentFrameCache.set(fn, _frame);\n }\n } // Return the line we found.\n\n\n return _frame;\n }\n } while (s >= 1 && c >= 0);\n }\n\n break;\n }\n }\n }\n } finally {\n reentry = false;\n\n {\n ReactCurrentDispatcher.current = previousDispatcher;\n reenableLogs();\n }\n\n Error.prepareStackTrace = previousPrepareStackTrace;\n } // Fallback to just using the name if we couldn't make it throw.\n\n\n var name = fn ? fn.displayName || fn.name : '';\n var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';\n\n {\n if (typeof fn === 'function') {\n componentFrameCache.set(fn, syntheticFrame);\n }\n }\n\n return syntheticFrame;\n}\nfunction describeFunctionComponentFrame(fn, source, ownerFn) {\n {\n return describeNativeComponentFrame(fn, false);\n }\n}\n\nfunction shouldConstruct(Component) {\n var prototype = Component.prototype;\n return !!(prototype && prototype.isReactComponent);\n}\n\nfunction describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {\n\n if (type == null) {\n return '';\n }\n\n if (typeof type === 'function') {\n {\n return describeNativeComponentFrame(type, shouldConstruct(type));\n }\n }\n\n if (typeof type === 'string') {\n return describeBuiltInComponentFrame(type);\n }\n\n switch (type) {\n case REACT_SUSPENSE_TYPE:\n return describeBuiltInComponentFrame('Suspense');\n\n case REACT_SUSPENSE_LIST_TYPE:\n return describeBuiltInComponentFrame('SuspenseList');\n }\n\n if (typeof type === 'object') {\n switch (type.$$typeof) {\n case REACT_FORWARD_REF_TYPE:\n return describeFunctionComponentFrame(type.render);\n\n case REACT_MEMO_TYPE:\n // Memo may contain any component type so we recursively resolve it.\n return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);\n\n case REACT_LAZY_TYPE:\n {\n var lazyComponent = type;\n var payload = lazyComponent._payload;\n var init = lazyComponent._init;\n\n try {\n // Lazy may contain any component type so we recursively resolve it.\n return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);\n } catch (x) {}\n }\n }\n }\n\n return '';\n}\n\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\n\nvar loggedTypeFailures = {};\nvar ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\n\nfunction setCurrentlyValidatingElement(element) {\n {\n if (element) {\n var owner = element._owner;\n var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);\n ReactDebugCurrentFrame.setExtraStackFrame(stack);\n } else {\n ReactDebugCurrentFrame.setExtraStackFrame(null);\n }\n }\n}\n\nfunction checkPropTypes(typeSpecs, values, location, componentName, element) {\n {\n // $FlowFixMe This is okay but Flow doesn't know it.\n var has = Function.call.bind(hasOwnProperty);\n\n for (var typeSpecName in typeSpecs) {\n if (has(typeSpecs, typeSpecName)) {\n var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to\n // fail the render phase where it didn't fail before. So we log it.\n // After these have been cleaned up, we'll let them throw.\n\n try {\n // This is intentionally an invariant that gets caught. It's the same\n // behavior as without this statement except with a better message.\n if (typeof typeSpecs[typeSpecName] !== 'function') {\n // eslint-disable-next-line react-internal/prod-error-codes\n var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.');\n err.name = 'Invariant Violation';\n throw err;\n }\n\n error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');\n } catch (ex) {\n error$1 = ex;\n }\n\n if (error$1 && !(error$1 instanceof Error)) {\n setCurrentlyValidatingElement(element);\n\n error('%s: type specification of %s' + ' `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error$1);\n\n setCurrentlyValidatingElement(null);\n }\n\n if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {\n // Only monitor this failure once because there tends to be a lot of the\n // same error.\n loggedTypeFailures[error$1.message] = true;\n setCurrentlyValidatingElement(element);\n\n error('Failed %s type: %s', location, error$1.message);\n\n setCurrentlyValidatingElement(null);\n }\n }\n }\n }\n}\n\nvar isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare\n\nfunction isArray(a) {\n return isArrayImpl(a);\n}\n\n/*\n * The `'' + value` pattern (used in in perf-sensitive code) throws for Symbol\n * and Temporal.* types. See https://github.com/facebook/react/pull/22064.\n *\n * The functions in this module will throw an easier-to-understand,\n * easier-to-debug exception with a clear errors message message explaining the\n * problem. (Instead of a confusing exception thrown inside the implementation\n * of the `value` object).\n */\n// $FlowFixMe only called in DEV, so void return is not possible.\nfunction typeName(value) {\n {\n // toStringTag is needed for namespaced types like Temporal.Instant\n var hasToStringTag = typeof Symbol === 'function' && Symbol.toStringTag;\n var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || 'Object';\n return type;\n }\n} // $FlowFixMe only called in DEV, so void return is not possible.\n\n\nfunction willCoercionThrow(value) {\n {\n try {\n testStringCoercion(value);\n return false;\n } catch (e) {\n return true;\n }\n }\n}\n\nfunction testStringCoercion(value) {\n // If you ended up here by following an exception call stack, here's what's\n // happened: you supplied an object or symbol value to React (as a prop, key,\n // DOM attribute, CSS property, string ref, etc.) and when React tried to\n // coerce it to a string using `'' + value`, an exception was thrown.\n //\n // The most common types that will cause this exception are `Symbol` instances\n // and Temporal objects like `Temporal.Instant`. But any object that has a\n // `valueOf` or `[Symbol.toPrimitive]` method that throws will also cause this\n // exception. (Library authors do this to prevent users from using built-in\n // numeric operators like `+` or comparison operators like `>=` because custom\n // methods are needed to perform accurate arithmetic or comparison.)\n //\n // To fix the problem, coerce this object or symbol value to a string before\n // passing it to React. The most reliable way is usually `String(value)`.\n //\n // To find which value is throwing, check the browser or debugger console.\n // Before this exception was thrown, there should be `console.error` output\n // that shows the type (Symbol, Temporal.PlainDate, etc.) that caused the\n // problem and how that type was used: key, atrribute, input value prop, etc.\n // In most cases, this console output also shows the component and its\n // ancestor components where the exception happened.\n //\n // eslint-disable-next-line react-internal/safe-string-coercion\n return '' + value;\n}\nfunction checkKeyStringCoercion(value) {\n {\n if (willCoercionThrow(value)) {\n error('The provided key is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', typeName(value));\n\n return testStringCoercion(value); // throw (to help callers find troubleshooting comments)\n }\n }\n}\n\nvar ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;\nvar RESERVED_PROPS = {\n key: true,\n ref: true,\n __self: true,\n __source: true\n};\nvar specialPropKeyWarningShown;\nvar specialPropRefWarningShown;\nvar didWarnAboutStringRefs;\n\n{\n didWarnAboutStringRefs = {};\n}\n\nfunction hasValidRef(config) {\n {\n if (hasOwnProperty.call(config, 'ref')) {\n var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;\n\n if (getter && getter.isReactWarning) {\n return false;\n }\n }\n }\n\n return config.ref !== undefined;\n}\n\nfunction hasValidKey(config) {\n {\n if (hasOwnProperty.call(config, 'key')) {\n var getter = Object.getOwnPropertyDescriptor(config, 'key').get;\n\n if (getter && getter.isReactWarning) {\n return false;\n }\n }\n }\n\n return config.key !== undefined;\n}\n\nfunction warnIfStringRefCannotBeAutoConverted(config, self) {\n {\n if (typeof config.ref === 'string' && ReactCurrentOwner.current && self && ReactCurrentOwner.current.stateNode !== self) {\n var componentName = getComponentNameFromType(ReactCurrentOwner.current.type);\n\n if (!didWarnAboutStringRefs[componentName]) {\n error('Component \"%s\" contains the string ref \"%s\". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-string-ref', getComponentNameFromType(ReactCurrentOwner.current.type), config.ref);\n\n didWarnAboutStringRefs[componentName] = true;\n }\n }\n }\n}\n\nfunction defineKeyPropWarningGetter(props, displayName) {\n {\n var warnAboutAccessingKey = function () {\n if (!specialPropKeyWarningShown) {\n specialPropKeyWarningShown = true;\n\n error('%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);\n }\n };\n\n warnAboutAccessingKey.isReactWarning = true;\n Object.defineProperty(props, 'key', {\n get: warnAboutAccessingKey,\n configurable: true\n });\n }\n}\n\nfunction defineRefPropWarningGetter(props, displayName) {\n {\n var warnAboutAccessingRef = function () {\n if (!specialPropRefWarningShown) {\n specialPropRefWarningShown = true;\n\n error('%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);\n }\n };\n\n warnAboutAccessingRef.isReactWarning = true;\n Object.defineProperty(props, 'ref', {\n get: warnAboutAccessingRef,\n configurable: true\n });\n }\n}\n/**\n * Factory method to create a new React element. This no longer adheres to\n * the class pattern, so do not use new to call it. Also, instanceof check\n * will not work. Instead test $$typeof field against Symbol.for('react.element') to check\n * if something is a React Element.\n *\n * @param {*} type\n * @param {*} props\n * @param {*} key\n * @param {string|object} ref\n * @param {*} owner\n * @param {*} self A *temporary* helper to detect places where `this` is\n * different from the `owner` when React.createElement is called, so that we\n * can warn. We want to get rid of owner and replace string `ref`s with arrow\n * functions, and as long as `this` and owner are the same, there will be no\n * change in behavior.\n * @param {*} source An annotation object (added by a transpiler or otherwise)\n * indicating filename, line number, and/or other information.\n * @internal\n */\n\n\nvar ReactElement = function (type, key, ref, self, source, owner, props) {\n var element = {\n // This tag allows us to uniquely identify this as a React Element\n $$typeof: REACT_ELEMENT_TYPE,\n // Built-in properties that belong on the element\n type: type,\n key: key,\n ref: ref,\n props: props,\n // Record the component responsible for creating this element.\n _owner: owner\n };\n\n {\n // The validation flag is currently mutative. We put it on\n // an external backing store so that we can freeze the whole object.\n // This can be replaced with a WeakMap once they are implemented in\n // commonly used development environments.\n element._store = {}; // To make comparing ReactElements easier for testing purposes, we make\n // the validation flag non-enumerable (where possible, which should\n // include every environment we run tests in), so the test framework\n // ignores it.\n\n Object.defineProperty(element._store, 'validated', {\n configurable: false,\n enumerable: false,\n writable: true,\n value: false\n }); // self and source are DEV only properties.\n\n Object.defineProperty(element, '_self', {\n configurable: false,\n enumerable: false,\n writable: false,\n value: self\n }); // Two elements created in two different places should be considered\n // equal for testing purposes and therefore we hide it from enumeration.\n\n Object.defineProperty(element, '_source', {\n configurable: false,\n enumerable: false,\n writable: false,\n value: source\n });\n\n if (Object.freeze) {\n Object.freeze(element.props);\n Object.freeze(element);\n }\n }\n\n return element;\n};\n/**\n * https://github.com/reactjs/rfcs/pull/107\n * @param {*} type\n * @param {object} props\n * @param {string} key\n */\n\nfunction jsxDEV(type, config, maybeKey, source, self) {\n {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null; // Currently, key can be spread in as a prop. This causes a potential\n // issue if key is also explicitly declared (ie.
\n // or
). We want to deprecate key spread,\n // but as an intermediary step, we will use jsxDEV for everything except\n //
, because we aren't currently able to tell if\n // key is explicitly declared to be undefined or not.\n\n if (maybeKey !== undefined) {\n {\n checkKeyStringCoercion(maybeKey);\n }\n\n key = '' + maybeKey;\n }\n\n if (hasValidKey(config)) {\n {\n checkKeyStringCoercion(config.key);\n }\n\n key = '' + config.key;\n }\n\n if (hasValidRef(config)) {\n ref = config.ref;\n warnIfStringRefCannotBeAutoConverted(config, self);\n } // Remaining properties are added to a new props object\n\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n }\n}\n\nvar ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;\nvar ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;\n\nfunction setCurrentlyValidatingElement$1(element) {\n {\n if (element) {\n var owner = element._owner;\n var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);\n ReactDebugCurrentFrame$1.setExtraStackFrame(stack);\n } else {\n ReactDebugCurrentFrame$1.setExtraStackFrame(null);\n }\n }\n}\n\nvar propTypesMisspellWarningShown;\n\n{\n propTypesMisspellWarningShown = false;\n}\n/**\n * Verifies the object is a ReactElement.\n * See https://reactjs.org/docs/react-api.html#isvalidelement\n * @param {?object} object\n * @return {boolean} True if `object` is a ReactElement.\n * @final\n */\n\n\nfunction isValidElement(object) {\n {\n return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;\n }\n}\n\nfunction getDeclarationErrorAddendum() {\n {\n if (ReactCurrentOwner$1.current) {\n var name = getComponentNameFromType(ReactCurrentOwner$1.current.type);\n\n if (name) {\n return '\\n\\nCheck the render method of `' + name + '`.';\n }\n }\n\n return '';\n }\n}\n\nfunction getSourceInfoErrorAddendum(source) {\n {\n if (source !== undefined) {\n var fileName = source.fileName.replace(/^.*[\\\\\\/]/, '');\n var lineNumber = source.lineNumber;\n return '\\n\\nCheck your code at ' + fileName + ':' + lineNumber + '.';\n }\n\n return '';\n }\n}\n/**\n * Warn if there's no key explicitly set on dynamic arrays of children or\n * object keys are not valid. This allows us to keep track of children between\n * updates.\n */\n\n\nvar ownerHasKeyUseWarning = {};\n\nfunction getCurrentComponentErrorInfo(parentType) {\n {\n var info = getDeclarationErrorAddendum();\n\n if (!info) {\n var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;\n\n if (parentName) {\n info = \"\\n\\nCheck the top-level render call using <\" + parentName + \">.\";\n }\n }\n\n return info;\n }\n}\n/**\n * Warn if the element doesn't have an explicit key assigned to it.\n * This element is in an array. The array could grow and shrink or be\n * reordered. All children that haven't already been validated are required to\n * have a \"key\" property assigned to it. Error statuses are cached so a warning\n * will only be shown once.\n *\n * @internal\n * @param {ReactElement} element Element that requires a key.\n * @param {*} parentType element's parent's type.\n */\n\n\nfunction validateExplicitKey(element, parentType) {\n {\n if (!element._store || element._store.validated || element.key != null) {\n return;\n }\n\n element._store.validated = true;\n var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);\n\n if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {\n return;\n }\n\n ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a\n // property, it may be the creator of the child that's responsible for\n // assigning it a key.\n\n var childOwner = '';\n\n if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) {\n // Give the component that originally created this child.\n childOwner = \" It was passed a child from \" + getComponentNameFromType(element._owner.type) + \".\";\n }\n\n setCurrentlyValidatingElement$1(element);\n\n error('Each child in a list should have a unique \"key\" prop.' + '%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner);\n\n setCurrentlyValidatingElement$1(null);\n }\n}\n/**\n * Ensure that every element either is passed in a static location, in an\n * array with an explicit keys property defined, or in an object literal\n * with valid key property.\n *\n * @internal\n * @param {ReactNode} node Statically passed child of any type.\n * @param {*} parentType node's parent's type.\n */\n\n\nfunction validateChildKeys(node, parentType) {\n {\n if (typeof node !== 'object') {\n return;\n }\n\n if (isArray(node)) {\n for (var i = 0; i < node.length; i++) {\n var child = node[i];\n\n if (isValidElement(child)) {\n validateExplicitKey(child, parentType);\n }\n }\n } else if (isValidElement(node)) {\n // This element was passed in a valid location.\n if (node._store) {\n node._store.validated = true;\n }\n } else if (node) {\n var iteratorFn = getIteratorFn(node);\n\n if (typeof iteratorFn === 'function') {\n // Entry iterators used to provide implicit keys,\n // but now we print a separate warning for them later.\n if (iteratorFn !== node.entries) {\n var iterator = iteratorFn.call(node);\n var step;\n\n while (!(step = iterator.next()).done) {\n if (isValidElement(step.value)) {\n validateExplicitKey(step.value, parentType);\n }\n }\n }\n }\n }\n }\n}\n/**\n * Given an element, validate that its props follow the propTypes definition,\n * provided by the type.\n *\n * @param {ReactElement} element\n */\n\n\nfunction validatePropTypes(element) {\n {\n var type = element.type;\n\n if (type === null || type === undefined || typeof type === 'string') {\n return;\n }\n\n var propTypes;\n\n if (typeof type === 'function') {\n propTypes = type.propTypes;\n } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.\n // Inner props are checked in the reconciler.\n type.$$typeof === REACT_MEMO_TYPE)) {\n propTypes = type.propTypes;\n } else {\n return;\n }\n\n if (propTypes) {\n // Intentionally inside to avoid triggering lazy initializers:\n var name = getComponentNameFromType(type);\n checkPropTypes(propTypes, element.props, 'prop', name, element);\n } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {\n propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers:\n\n var _name = getComponentNameFromType(type);\n\n error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown');\n }\n\n if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) {\n error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');\n }\n }\n}\n/**\n * Given a fragment, validate that it can only be provided with fragment props\n * @param {ReactElement} fragment\n */\n\n\nfunction validateFragmentProps(fragment) {\n {\n var keys = Object.keys(fragment.props);\n\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n\n if (key !== 'children' && key !== 'key') {\n setCurrentlyValidatingElement$1(fragment);\n\n error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);\n\n setCurrentlyValidatingElement$1(null);\n break;\n }\n }\n\n if (fragment.ref !== null) {\n setCurrentlyValidatingElement$1(fragment);\n\n error('Invalid attribute `ref` supplied to `React.Fragment`.');\n\n setCurrentlyValidatingElement$1(null);\n }\n }\n}\n\nvar didWarnAboutKeySpread = {};\nfunction jsxWithValidation(type, props, key, isStaticChildren, source, self) {\n {\n var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to\n // succeed and there will likely be errors in render.\n\n if (!validType) {\n var info = '';\n\n if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {\n info += ' You likely forgot to export your component from the file ' + \"it's defined in, or you might have mixed up default and named imports.\";\n }\n\n var sourceInfo = getSourceInfoErrorAddendum(source);\n\n if (sourceInfo) {\n info += sourceInfo;\n } else {\n info += getDeclarationErrorAddendum();\n }\n\n var typeString;\n\n if (type === null) {\n typeString = 'null';\n } else if (isArray(type)) {\n typeString = 'array';\n } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {\n typeString = \"<\" + (getComponentNameFromType(type.type) || 'Unknown') + \" />\";\n info = ' Did you accidentally export a JSX literal instead of a component?';\n } else {\n typeString = typeof type;\n }\n\n error('React.jsx: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info);\n }\n\n var element = jsxDEV(type, props, key, source, self); // The result can be nullish if a mock or a custom function is used.\n // TODO: Drop this when these are no longer allowed as the type argument.\n\n if (element == null) {\n return element;\n } // Skip key warning if the type isn't valid since our key validation logic\n // doesn't expect a non-string/function type and can throw confusing errors.\n // We don't want exception behavior to differ between dev and prod.\n // (Rendering will throw with a helpful message and as soon as the type is\n // fixed, the key warnings will appear.)\n\n\n if (validType) {\n var children = props.children;\n\n if (children !== undefined) {\n if (isStaticChildren) {\n if (isArray(children)) {\n for (var i = 0; i < children.length; i++) {\n validateChildKeys(children[i], type);\n }\n\n if (Object.freeze) {\n Object.freeze(children);\n }\n } else {\n error('React.jsx: Static children should always be an array. ' + 'You are likely explicitly calling React.jsxs or React.jsxDEV. ' + 'Use the Babel transform instead.');\n }\n } else {\n validateChildKeys(children, type);\n }\n }\n }\n\n {\n if (hasOwnProperty.call(props, 'key')) {\n var componentName = getComponentNameFromType(type);\n var keys = Object.keys(props).filter(function (k) {\n return k !== 'key';\n });\n var beforeExample = keys.length > 0 ? '{key: someKey, ' + keys.join(': ..., ') + ': ...}' : '{key: someKey}';\n\n if (!didWarnAboutKeySpread[componentName + beforeExample]) {\n var afterExample = keys.length > 0 ? '{' + keys.join(': ..., ') + ': ...}' : '{}';\n\n error('A props object containing a \"key\" prop is being spread into JSX:\\n' + ' let props = %s;\\n' + ' <%s {...props} />\\n' + 'React keys must be passed directly to JSX without using spread:\\n' + ' let props = %s;\\n' + ' <%s key={someKey} {...props} />', beforeExample, componentName, afterExample, componentName);\n\n didWarnAboutKeySpread[componentName + beforeExample] = true;\n }\n }\n }\n\n if (type === REACT_FRAGMENT_TYPE) {\n validateFragmentProps(element);\n } else {\n validatePropTypes(element);\n }\n\n return element;\n }\n} // These two functions exist to still get child warnings in dev\n// even with the prod transform. This means that jsxDEV is purely\n// opt-in behavior for better messages but that we won't stop\n// giving you warnings if you use production apis.\n\nfunction jsxWithValidationStatic(type, props, key) {\n {\n return jsxWithValidation(type, props, key, true);\n }\n}\nfunction jsxWithValidationDynamic(type, props, key) {\n {\n return jsxWithValidation(type, props, key, false);\n }\n}\n\nvar jsx = jsxWithValidationDynamic ; // we may want to special case jsxs internally to take advantage of static children.\n// for now we can ship identical prod functions\n\nvar jsxs = jsxWithValidationStatic ;\n\nexports.Fragment = REACT_FRAGMENT_TYPE;\nexports.jsx = jsx;\nexports.jsxs = jsxs;\n })();\n}\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-jsx-runtime.production.min.js');\n} else {\n module.exports = require('./cjs/react-jsx-runtime.development.js');\n}\n","/**\n * @license React\n * scheduler.development.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nif (process.env.NODE_ENV !== \"production\") {\n (function() {\n\n 'use strict';\n\n/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */\nif (\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart ===\n 'function'\n) {\n __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());\n}\n var enableSchedulerDebugging = false;\nvar enableProfiling = false;\nvar frameYieldMs = 5;\n\nfunction push(heap, node) {\n var index = heap.length;\n heap.push(node);\n siftUp(heap, node, index);\n}\nfunction peek(heap) {\n return heap.length === 0 ? null : heap[0];\n}\nfunction pop(heap) {\n if (heap.length === 0) {\n return null;\n }\n\n var first = heap[0];\n var last = heap.pop();\n\n if (last !== first) {\n heap[0] = last;\n siftDown(heap, last, 0);\n }\n\n return first;\n}\n\nfunction siftUp(heap, node, i) {\n var index = i;\n\n while (index > 0) {\n var parentIndex = index - 1 >>> 1;\n var parent = heap[parentIndex];\n\n if (compare(parent, node) > 0) {\n // The parent is larger. Swap positions.\n heap[parentIndex] = node;\n heap[index] = parent;\n index = parentIndex;\n } else {\n // The parent is smaller. Exit.\n return;\n }\n }\n}\n\nfunction siftDown(heap, node, i) {\n var index = i;\n var length = heap.length;\n var halfLength = length >>> 1;\n\n while (index < halfLength) {\n var leftIndex = (index + 1) * 2 - 1;\n var left = heap[leftIndex];\n var rightIndex = leftIndex + 1;\n var right = heap[rightIndex]; // If the left or right node is smaller, swap with the smaller of those.\n\n if (compare(left, node) < 0) {\n if (rightIndex < length && compare(right, left) < 0) {\n heap[index] = right;\n heap[rightIndex] = node;\n index = rightIndex;\n } else {\n heap[index] = left;\n heap[leftIndex] = node;\n index = leftIndex;\n }\n } else if (rightIndex < length && compare(right, node) < 0) {\n heap[index] = right;\n heap[rightIndex] = node;\n index = rightIndex;\n } else {\n // Neither child is smaller. Exit.\n return;\n }\n }\n}\n\nfunction compare(a, b) {\n // Compare sort index first, then task id.\n var diff = a.sortIndex - b.sortIndex;\n return diff !== 0 ? diff : a.id - b.id;\n}\n\n// TODO: Use symbols?\nvar ImmediatePriority = 1;\nvar UserBlockingPriority = 2;\nvar NormalPriority = 3;\nvar LowPriority = 4;\nvar IdlePriority = 5;\n\nfunction markTaskErrored(task, ms) {\n}\n\n/* eslint-disable no-var */\n\nvar hasPerformanceNow = typeof performance === 'object' && typeof performance.now === 'function';\n\nif (hasPerformanceNow) {\n var localPerformance = performance;\n\n exports.unstable_now = function () {\n return localPerformance.now();\n };\n} else {\n var localDate = Date;\n var initialTime = localDate.now();\n\n exports.unstable_now = function () {\n return localDate.now() - initialTime;\n };\n} // Max 31 bit integer. The max integer size in V8 for 32-bit systems.\n// Math.pow(2, 30) - 1\n// 0b111111111111111111111111111111\n\n\nvar maxSigned31BitInt = 1073741823; // Times out immediately\n\nvar IMMEDIATE_PRIORITY_TIMEOUT = -1; // Eventually times out\n\nvar USER_BLOCKING_PRIORITY_TIMEOUT = 250;\nvar NORMAL_PRIORITY_TIMEOUT = 5000;\nvar LOW_PRIORITY_TIMEOUT = 10000; // Never times out\n\nvar IDLE_PRIORITY_TIMEOUT = maxSigned31BitInt; // Tasks are stored on a min heap\n\nvar taskQueue = [];\nvar timerQueue = []; // Incrementing id counter. Used to maintain insertion order.\n\nvar taskIdCounter = 1; // Pausing the scheduler is useful for debugging.\nvar currentTask = null;\nvar currentPriorityLevel = NormalPriority; // This is set while performing work, to prevent re-entrance.\n\nvar isPerformingWork = false;\nvar isHostCallbackScheduled = false;\nvar isHostTimeoutScheduled = false; // Capture local references to native APIs, in case a polyfill overrides them.\n\nvar localSetTimeout = typeof setTimeout === 'function' ? setTimeout : null;\nvar localClearTimeout = typeof clearTimeout === 'function' ? clearTimeout : null;\nvar localSetImmediate = typeof setImmediate !== 'undefined' ? setImmediate : null; // IE and Node.js + jsdom\n\nvar isInputPending = typeof navigator !== 'undefined' && navigator.scheduling !== undefined && navigator.scheduling.isInputPending !== undefined ? navigator.scheduling.isInputPending.bind(navigator.scheduling) : null;\n\nfunction advanceTimers(currentTime) {\n // Check for tasks that are no longer delayed and add them to the queue.\n var timer = peek(timerQueue);\n\n while (timer !== null) {\n if (timer.callback === null) {\n // Timer was cancelled.\n pop(timerQueue);\n } else if (timer.startTime <= currentTime) {\n // Timer fired. Transfer to the task queue.\n pop(timerQueue);\n timer.sortIndex = timer.expirationTime;\n push(taskQueue, timer);\n } else {\n // Remaining timers are pending.\n return;\n }\n\n timer = peek(timerQueue);\n }\n}\n\nfunction handleTimeout(currentTime) {\n isHostTimeoutScheduled = false;\n advanceTimers(currentTime);\n\n if (!isHostCallbackScheduled) {\n if (peek(taskQueue) !== null) {\n isHostCallbackScheduled = true;\n requestHostCallback(flushWork);\n } else {\n var firstTimer = peek(timerQueue);\n\n if (firstTimer !== null) {\n requestHostTimeout(handleTimeout, firstTimer.startTime - currentTime);\n }\n }\n }\n}\n\nfunction flushWork(hasTimeRemaining, initialTime) {\n\n\n isHostCallbackScheduled = false;\n\n if (isHostTimeoutScheduled) {\n // We scheduled a timeout but it's no longer needed. Cancel it.\n isHostTimeoutScheduled = false;\n cancelHostTimeout();\n }\n\n isPerformingWork = true;\n var previousPriorityLevel = currentPriorityLevel;\n\n try {\n if (enableProfiling) {\n try {\n return workLoop(hasTimeRemaining, initialTime);\n } catch (error) {\n if (currentTask !== null) {\n var currentTime = exports.unstable_now();\n markTaskErrored(currentTask, currentTime);\n currentTask.isQueued = false;\n }\n\n throw error;\n }\n } else {\n // No catch in prod code path.\n return workLoop(hasTimeRemaining, initialTime);\n }\n } finally {\n currentTask = null;\n currentPriorityLevel = previousPriorityLevel;\n isPerformingWork = false;\n }\n}\n\nfunction workLoop(hasTimeRemaining, initialTime) {\n var currentTime = initialTime;\n advanceTimers(currentTime);\n currentTask = peek(taskQueue);\n\n while (currentTask !== null && !(enableSchedulerDebugging )) {\n if (currentTask.expirationTime > currentTime && (!hasTimeRemaining || shouldYieldToHost())) {\n // This currentTask hasn't expired, and we've reached the deadline.\n break;\n }\n\n var callback = currentTask.callback;\n\n if (typeof callback === 'function') {\n currentTask.callback = null;\n currentPriorityLevel = currentTask.priorityLevel;\n var didUserCallbackTimeout = currentTask.expirationTime <= currentTime;\n\n var continuationCallback = callback(didUserCallbackTimeout);\n currentTime = exports.unstable_now();\n\n if (typeof continuationCallback === 'function') {\n currentTask.callback = continuationCallback;\n } else {\n\n if (currentTask === peek(taskQueue)) {\n pop(taskQueue);\n }\n }\n\n advanceTimers(currentTime);\n } else {\n pop(taskQueue);\n }\n\n currentTask = peek(taskQueue);\n } // Return whether there's additional work\n\n\n if (currentTask !== null) {\n return true;\n } else {\n var firstTimer = peek(timerQueue);\n\n if (firstTimer !== null) {\n requestHostTimeout(handleTimeout, firstTimer.startTime - currentTime);\n }\n\n return false;\n }\n}\n\nfunction unstable_runWithPriority(priorityLevel, eventHandler) {\n switch (priorityLevel) {\n case ImmediatePriority:\n case UserBlockingPriority:\n case NormalPriority:\n case LowPriority:\n case IdlePriority:\n break;\n\n default:\n priorityLevel = NormalPriority;\n }\n\n var previousPriorityLevel = currentPriorityLevel;\n currentPriorityLevel = priorityLevel;\n\n try {\n return eventHandler();\n } finally {\n currentPriorityLevel = previousPriorityLevel;\n }\n}\n\nfunction unstable_next(eventHandler) {\n var priorityLevel;\n\n switch (currentPriorityLevel) {\n case ImmediatePriority:\n case UserBlockingPriority:\n case NormalPriority:\n // Shift down to normal priority\n priorityLevel = NormalPriority;\n break;\n\n default:\n // Anything lower than normal priority should remain at the current level.\n priorityLevel = currentPriorityLevel;\n break;\n }\n\n var previousPriorityLevel = currentPriorityLevel;\n currentPriorityLevel = priorityLevel;\n\n try {\n return eventHandler();\n } finally {\n currentPriorityLevel = previousPriorityLevel;\n }\n}\n\nfunction unstable_wrapCallback(callback) {\n var parentPriorityLevel = currentPriorityLevel;\n return function () {\n // This is a fork of runWithPriority, inlined for performance.\n var previousPriorityLevel = currentPriorityLevel;\n currentPriorityLevel = parentPriorityLevel;\n\n try {\n return callback.apply(this, arguments);\n } finally {\n currentPriorityLevel = previousPriorityLevel;\n }\n };\n}\n\nfunction unstable_scheduleCallback(priorityLevel, callback, options) {\n var currentTime = exports.unstable_now();\n var startTime;\n\n if (typeof options === 'object' && options !== null) {\n var delay = options.delay;\n\n if (typeof delay === 'number' && delay > 0) {\n startTime = currentTime + delay;\n } else {\n startTime = currentTime;\n }\n } else {\n startTime = currentTime;\n }\n\n var timeout;\n\n switch (priorityLevel) {\n case ImmediatePriority:\n timeout = IMMEDIATE_PRIORITY_TIMEOUT;\n break;\n\n case UserBlockingPriority:\n timeout = USER_BLOCKING_PRIORITY_TIMEOUT;\n break;\n\n case IdlePriority:\n timeout = IDLE_PRIORITY_TIMEOUT;\n break;\n\n case LowPriority:\n timeout = LOW_PRIORITY_TIMEOUT;\n break;\n\n case NormalPriority:\n default:\n timeout = NORMAL_PRIORITY_TIMEOUT;\n break;\n }\n\n var expirationTime = startTime + timeout;\n var newTask = {\n id: taskIdCounter++,\n callback: callback,\n priorityLevel: priorityLevel,\n startTime: startTime,\n expirationTime: expirationTime,\n sortIndex: -1\n };\n\n if (startTime > currentTime) {\n // This is a delayed task.\n newTask.sortIndex = startTime;\n push(timerQueue, newTask);\n\n if (peek(taskQueue) === null && newTask === peek(timerQueue)) {\n // All tasks are delayed, and this is the task with the earliest delay.\n if (isHostTimeoutScheduled) {\n // Cancel an existing timeout.\n cancelHostTimeout();\n } else {\n isHostTimeoutScheduled = true;\n } // Schedule a timeout.\n\n\n requestHostTimeout(handleTimeout, startTime - currentTime);\n }\n } else {\n newTask.sortIndex = expirationTime;\n push(taskQueue, newTask);\n // wait until the next time we yield.\n\n\n if (!isHostCallbackScheduled && !isPerformingWork) {\n isHostCallbackScheduled = true;\n requestHostCallback(flushWork);\n }\n }\n\n return newTask;\n}\n\nfunction unstable_pauseExecution() {\n}\n\nfunction unstable_continueExecution() {\n\n if (!isHostCallbackScheduled && !isPerformingWork) {\n isHostCallbackScheduled = true;\n requestHostCallback(flushWork);\n }\n}\n\nfunction unstable_getFirstCallbackNode() {\n return peek(taskQueue);\n}\n\nfunction unstable_cancelCallback(task) {\n // remove from the queue because you can't remove arbitrary nodes from an\n // array based heap, only the first one.)\n\n\n task.callback = null;\n}\n\nfunction unstable_getCurrentPriorityLevel() {\n return currentPriorityLevel;\n}\n\nvar isMessageLoopRunning = false;\nvar scheduledHostCallback = null;\nvar taskTimeoutID = -1; // Scheduler periodically yields in case there is other work on the main\n// thread, like user events. By default, it yields multiple times per frame.\n// It does not attempt to align with frame boundaries, since most tasks don't\n// need to be frame aligned; for those that do, use requestAnimationFrame.\n\nvar frameInterval = frameYieldMs;\nvar startTime = -1;\n\nfunction shouldYieldToHost() {\n var timeElapsed = exports.unstable_now() - startTime;\n\n if (timeElapsed < frameInterval) {\n // The main thread has only been blocked for a really short amount of time;\n // smaller than a single frame. Don't yield yet.\n return false;\n } // The main thread has been blocked for a non-negligible amount of time. We\n\n\n return true;\n}\n\nfunction requestPaint() {\n\n}\n\nfunction forceFrameRate(fps) {\n if (fps < 0 || fps > 125) {\n // Using console['error'] to evade Babel and ESLint\n console['error']('forceFrameRate takes a positive int between 0 and 125, ' + 'forcing frame rates higher than 125 fps is not supported');\n return;\n }\n\n if (fps > 0) {\n frameInterval = Math.floor(1000 / fps);\n } else {\n // reset the framerate\n frameInterval = frameYieldMs;\n }\n}\n\nvar performWorkUntilDeadline = function () {\n if (scheduledHostCallback !== null) {\n var currentTime = exports.unstable_now(); // Keep track of the start time so we can measure how long the main thread\n // has been blocked.\n\n startTime = currentTime;\n var hasTimeRemaining = true; // If a scheduler task throws, exit the current browser task so the\n // error can be observed.\n //\n // Intentionally not using a try-catch, since that makes some debugging\n // techniques harder. Instead, if `scheduledHostCallback` errors, then\n // `hasMoreWork` will remain true, and we'll continue the work loop.\n\n var hasMoreWork = true;\n\n try {\n hasMoreWork = scheduledHostCallback(hasTimeRemaining, currentTime);\n } finally {\n if (hasMoreWork) {\n // If there's more work, schedule the next message event at the end\n // of the preceding one.\n schedulePerformWorkUntilDeadline();\n } else {\n isMessageLoopRunning = false;\n scheduledHostCallback = null;\n }\n }\n } else {\n isMessageLoopRunning = false;\n } // Yielding to the browser will give it a chance to paint, so we can\n};\n\nvar schedulePerformWorkUntilDeadline;\n\nif (typeof localSetImmediate === 'function') {\n // Node.js and old IE.\n // There's a few reasons for why we prefer setImmediate.\n //\n // Unlike MessageChannel, it doesn't prevent a Node.js process from exiting.\n // (Even though this is a DOM fork of the Scheduler, you could get here\n // with a mix of Node.js 15+, which has a MessageChannel, and jsdom.)\n // https://github.com/facebook/react/issues/20756\n //\n // But also, it runs earlier which is the semantic we want.\n // If other browsers ever implement it, it's better to use it.\n // Although both of these would be inferior to native scheduling.\n schedulePerformWorkUntilDeadline = function () {\n localSetImmediate(performWorkUntilDeadline);\n };\n} else if (typeof MessageChannel !== 'undefined') {\n // DOM and Worker environments.\n // We prefer MessageChannel because of the 4ms setTimeout clamping.\n var channel = new MessageChannel();\n var port = channel.port2;\n channel.port1.onmessage = performWorkUntilDeadline;\n\n schedulePerformWorkUntilDeadline = function () {\n port.postMessage(null);\n };\n} else {\n // We should only fallback here in non-browser environments.\n schedulePerformWorkUntilDeadline = function () {\n localSetTimeout(performWorkUntilDeadline, 0);\n };\n}\n\nfunction requestHostCallback(callback) {\n scheduledHostCallback = callback;\n\n if (!isMessageLoopRunning) {\n isMessageLoopRunning = true;\n schedulePerformWorkUntilDeadline();\n }\n}\n\nfunction requestHostTimeout(callback, ms) {\n taskTimeoutID = localSetTimeout(function () {\n callback(exports.unstable_now());\n }, ms);\n}\n\nfunction cancelHostTimeout() {\n localClearTimeout(taskTimeoutID);\n taskTimeoutID = -1;\n}\n\nvar unstable_requestPaint = requestPaint;\nvar unstable_Profiling = null;\n\nexports.unstable_IdlePriority = IdlePriority;\nexports.unstable_ImmediatePriority = ImmediatePriority;\nexports.unstable_LowPriority = LowPriority;\nexports.unstable_NormalPriority = NormalPriority;\nexports.unstable_Profiling = unstable_Profiling;\nexports.unstable_UserBlockingPriority = UserBlockingPriority;\nexports.unstable_cancelCallback = unstable_cancelCallback;\nexports.unstable_continueExecution = unstable_continueExecution;\nexports.unstable_forceFrameRate = forceFrameRate;\nexports.unstable_getCurrentPriorityLevel = unstable_getCurrentPriorityLevel;\nexports.unstable_getFirstCallbackNode = unstable_getFirstCallbackNode;\nexports.unstable_next = unstable_next;\nexports.unstable_pauseExecution = unstable_pauseExecution;\nexports.unstable_requestPaint = unstable_requestPaint;\nexports.unstable_runWithPriority = unstable_runWithPriority;\nexports.unstable_scheduleCallback = unstable_scheduleCallback;\nexports.unstable_shouldYield = shouldYieldToHost;\nexports.unstable_wrapCallback = unstable_wrapCallback;\n /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */\nif (\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop ===\n 'function'\n) {\n __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());\n}\n \n })();\n}\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/scheduler.production.min.js');\n} else {\n module.exports = require('./cjs/scheduler.development.js');\n}\n","/**\n * @license React\n * react-dom.development.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nif (process.env.NODE_ENV !== \"production\") {\n (function() {\n\n 'use strict';\n\n/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */\nif (\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart ===\n 'function'\n) {\n __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());\n}\n var React = require('react');\nvar Scheduler = require('scheduler');\n\nvar ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;\n\nvar suppressWarning = false;\nfunction setSuppressWarning(newSuppressWarning) {\n {\n suppressWarning = newSuppressWarning;\n }\n} // In DEV, calls to console.warn and console.error get replaced\n// by calls to these methods by a Babel plugin.\n//\n// In PROD (or in packages without access to React internals),\n// they are left as they are instead.\n\nfunction warn(format) {\n {\n if (!suppressWarning) {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n printWarning('warn', format, args);\n }\n }\n}\nfunction error(format) {\n {\n if (!suppressWarning) {\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n\n printWarning('error', format, args);\n }\n }\n}\n\nfunction printWarning(level, format, args) {\n // When changing this logic, you might want to also\n // update consoleWithStackDev.www.js as well.\n {\n var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\n var stack = ReactDebugCurrentFrame.getStackAddendum();\n\n if (stack !== '') {\n format += '%s';\n args = args.concat([stack]);\n } // eslint-disable-next-line react-internal/safe-string-coercion\n\n\n var argsWithFormat = args.map(function (item) {\n return String(item);\n }); // Careful: RN currently depends on this prefix\n\n argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it\n // breaks IE9: https://github.com/facebook/react/issues/13610\n // eslint-disable-next-line react-internal/no-production-logging\n\n Function.prototype.apply.call(console[level], console, argsWithFormat);\n }\n}\n\nvar FunctionComponent = 0;\nvar ClassComponent = 1;\nvar IndeterminateComponent = 2; // Before we know whether it is function or class\n\nvar HostRoot = 3; // Root of a host tree. Could be nested inside another node.\n\nvar HostPortal = 4; // A subtree. Could be an entry point to a different renderer.\n\nvar HostComponent = 5;\nvar HostText = 6;\nvar Fragment = 7;\nvar Mode = 8;\nvar ContextConsumer = 9;\nvar ContextProvider = 10;\nvar ForwardRef = 11;\nvar Profiler = 12;\nvar SuspenseComponent = 13;\nvar MemoComponent = 14;\nvar SimpleMemoComponent = 15;\nvar LazyComponent = 16;\nvar IncompleteClassComponent = 17;\nvar DehydratedFragment = 18;\nvar SuspenseListComponent = 19;\nvar ScopeComponent = 21;\nvar OffscreenComponent = 22;\nvar LegacyHiddenComponent = 23;\nvar CacheComponent = 24;\nvar TracingMarkerComponent = 25;\n\n// -----------------------------------------------------------------------------\n\nvar enableClientRenderFallbackOnTextMismatch = true; // TODO: Need to review this code one more time before landing\n// the react-reconciler package.\n\nvar enableNewReconciler = false; // Support legacy Primer support on internal FB www\n\nvar enableLazyContextPropagation = false; // FB-only usage. The new API has different semantics.\n\nvar enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber\n\nvar enableSuspenseAvoidThisFallback = false; // Enables unstable_avoidThisFallback feature in Fizz\n// React DOM Chopping Block\n//\n// Similar to main Chopping Block but only flags related to React DOM. These are\n// grouped because we will likely batch all of them into a single major release.\n// -----------------------------------------------------------------------------\n// Disable support for comment nodes as React DOM containers. Already disabled\n// in open source, but www codebase still relies on it. Need to remove.\n\nvar disableCommentsAsDOMContainers = true; // Disable javascript: URL strings in href for XSS protection.\n// and client rendering, mostly to allow JSX attributes to apply to the custom\n// element's object properties instead of only HTML attributes.\n// https://github.com/facebook/react/issues/11347\n\nvar enableCustomElementPropertySupport = false; // Disables children for