function e(e){return e?/youtube\.com|youtu\.be/i.test(e)?`youtube`:/vimeo\.com/i.test(e)?`vimeo`:/instagram\.com/i.test(e)?`instagram`:/\.(jpg|jpeg|png|gif|webp|avif|svg)(\?|$)/i.test(e)?`image`:/\.(mp4|webm|mov|ogg|avi)(\?|$)/i.test(e)||/supabase\.co\/storage\/.*\.(mp4|webm|mov)/i.test(e)?`video`:`unknown`:`unknown`}function t(t){let n=e(t);switch(n){case`youtube`:{let e=``,r=t.match(/youtu\.be\/([^?&]+)/),i=t.match(/[?&]v=([^&]+)/);return e=r?.[1]||i?.[1]||``,{platform:n,embedUrl:`https://www.youtube.com/embed/${e}?autoplay=0&rel=0`,originalUrl:t}}case`vimeo`:return{platform:n,embedUrl:`https://player.vimeo.com/video/${t.match(/vimeo\.com\/(\d+)/)?.[1]||``}?badge=0&autopause=0`,originalUrl:t};case`instagram`:return{platform:n,embedUrl:`${t.replace(/\/$/,``)}/embed`,originalUrl:t};default:return{platform:n,embedUrl:t,originalUrl:t}}}export{t as n,e as t};