@fu-css/fu-player 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,3 @@
1
- (function(f,C){typeof exports=="object"&&typeof module<"u"?C(exports):typeof define=="function"&&define.amd?define(["exports"],C):(f=typeof globalThis<"u"?globalThis:f||self,C(f.FuPlayer={}))})(this,(function(f){"use strict";const C=/^(\d{4})-(\d{2})-(\d{2})(?:T(\d{2}):(\d{2}):(\d{2})(?:\.\d{1,3})?(?:Z|([+-])(\d{2}):(\d{2})))?$/,q=/^P(?:(\d+)D)?(?:T(?=\d)(?:(\d+)H)?(?:(\d+)M)?(?:(\d+)S)?)?$/,G=new Set;function ke(e){return Z(e)}function F(e){k(Z(e))}function Te(e){k(U([{path:"thumbnailUrl",value:e.thumbnailUrl,required:!0},{path:"contentUrl",value:e.contentUrl},{path:"embedUrl",value:e.embedUrl}]))}function we(e){k(U([{path:"head.canonicalUrl",value:e.canonicalUrl},{path:"head.image",value:e.image},{path:"head.videoUrl",value:e.videoUrl}]))}function Pe(e){k(U([{path:"sitemap.loc",value:e.loc,required:!0},{path:"sitemap.thumbnailUrl",value:e.thumbnailUrl,required:!0},{path:"sitemap.contentUrl",value:e.contentUrl},{path:"sitemap.playerUrl",value:e.playerUrl}]))}function W(e){const t=e.match(q);if(!t||!X(t))return 0;const[,r="0",n="0",i="0",s="0"]=t;return Number(r)*86400+Number(n)*3600+Number(i)*60+Number(s)}function Z(e){const t=[],r=Q(e.thumbnailUrl);return r.length||t.push({code:"missing_url",path:"thumbnailUrl",message:"should include at least one absolute http(s) URL.",value:e.thumbnailUrl}),r.forEach((n,i)=>{T(t,Array.isArray(e.thumbnailUrl)?`thumbnailUrl[${i}]`:"thumbnailUrl",n)}),e.contentUrl!==void 0&&T(t,"contentUrl",e.contentUrl),e.embedUrl!==void 0&&T(t,"embedUrl",e.embedUrl),xe(e.uploadDate)||t.push({code:"invalid_date",path:"uploadDate",message:"should be an ISO 8601 date or datetime.",value:e.uploadDate}),Ve(e.duration)||t.push({code:"invalid_duration",path:"duration",message:"should be an ISO 8601 duration string such as PT1M5S, or a non-negative seconds number.",value:e.duration}),t}function U(e){const t=[];return e.forEach(r=>{if(r.value===void 0){r.required&&t.push({code:"missing_url",path:r.path,message:"should include at least one absolute http(s) URL.",value:r.value});return}const n=Q(r.value);r.required&&!n.length&&t.push({code:"missing_url",path:r.path,message:"should include at least one absolute http(s) URL.",value:r.value}),n.forEach((i,s)=>{T(t,Array.isArray(r.value)?`${r.path}[${s}]`:r.path,i)})}),t}function k(e){typeof console>"u"||typeof console.warn!="function"||e.forEach(t=>{const r=Ae(t);G.has(r)||(G.add(r),Le(t))})}function T(e,t,r){Oe(r)||e.push({code:"invalid_url",path:t,message:"should be an absolute http(s) URL.",value:r})}function Ae(e){return`${e.path}:${J(e.value)}`}function Le(e){console.warn(`[FuPlayer SEO] ${e.path} ${e.message} Received: ${J(e.value)}`)}function J(e){if(e instanceof Date)return Number.isFinite(e.getTime())?e.toISOString():"Invalid Date";if(typeof e=="string")return e||'""';if(e===void 0)return"undefined";try{return JSON.stringify(e)}catch{return String(e)}}function Q(e){return Array.isArray(e)?e:[e]}function Oe(e){if(e.trim()!==e||!e)return!1;try{const t=new URL(e);return t.protocol==="http:"||t.protocol==="https:"}catch{return!1}}function xe(e){if(e instanceof Date)return Number.isFinite(e.getTime());const t=e.match(C);if(!t)return!1;const[,r,n,i,s,a,o,,l,h]=t,p=Number(r),c=Number(n),u=Number(i);if(!_e(p,c,u))return!1;if(s===void 0)return!0;const d=Number(s),j=Number(a),z=Number(o);return!(d>23||j>59||z>59||l!==void 0&&(Number(l)>23||Number(h)>59))}function _e(e,t,r){if(t<1||t>12)return!1;const n=new Date(Date.UTC(e,t-1,r));return n.getUTCFullYear()===e&&n.getUTCMonth()===t-1&&n.getUTCDate()===r}function Ve(e){if(typeof e=="number")return Number.isFinite(e)&&e>=0;const t=e.match(q);return!!(t&&X(t))}function X(e){return!!(e[1]||e[2]||e[3]||e[4])}function Y(e,t,r={}){const n={"@context":"https://schema.org","@type":"VideoObject",name:e.name,description:e.description,thumbnailUrl:Fe(e.thumbnailUrl),uploadDate:Re(e.uploadDate),duration:Ie(e.duration),contentUrl:e.contentUrl??t,embedUrl:e.embedUrl,inLanguage:e.inLanguage,keywords:Array.isArray(e.keywords)?e.keywords.join(", "):e.keywords,transcript:e.transcript,publisher:e.publisher?re(e.publisher):void 0,author:e.author?re(e.author):void 0,hasPart:e.chapters?.map(s=>Ue(s,e.seekToActionUrlTemplate)),potentialAction:e.seekToActionUrlTemplate?{"@type":"SeekToAction",target:e.seekToActionUrlTemplate,"startOffset-input":"required name=seek_to_second_number"}:void 0,...e.extraSchema};typeof e.userInteractionCount=="number"&&(n.interactionStatistic={"@type":"InteractionCounter",interactionType:{"@type":"WatchAction"},userInteractionCount:e.userInteractionCount});const i=M(n);return r.seoWarnings!==!1&&(F(e),Te({thumbnailUrl:i.thumbnailUrl,contentUrl:i.contentUrl,embedUrl:i.embedUrl})),i}function ee(e){return JSON.stringify(e).replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/&/g,"\\u0026").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}function te(e){return W(e)}function Fe(e){return Array.isArray(e)?e:[e]}function re(e){return M({"@type":e.type??"Organization",name:e.name,url:e.url,logo:e.logo})}function Ue(e,t){return M({"@type":"Clip",name:e.name,startOffset:e.startOffset,endOffset:e.endOffset,url:e.url??Me(t,e.startOffset)})}function Me(e,t){return e?.replace("{seek_to_second_number}",String(t))}function Re(e){return e instanceof Date?Number.isFinite(e.getTime())?e.toISOString():void 0:e}function Ie(e){if(typeof e=="string")return e;const t=Math.max(0,Math.floor(e)),r=Math.floor(t/3600),n=Math.floor(t%3600/60),i=t%60;return`PT${r?`${r}H`:""}${n?`${n}M`:""}${i||!r&&!n?`${i}S`:""}`}function M(e){return Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0))}const Ne=new Set(["http:","https:","mailto:","tel:"]),ne=new Set;function w(e,t){if(e!==void 0){if(De(e))return e;$e(t,e)}}function R(e,t){if(e?.trim().toLowerCase()!=="_blank")return t;const r=new Set(t?.split(/\s+/).filter(Boolean));return r.add("noreferrer"),r.add("noopener"),[...r].join(" ")}function De(e){if(!e||e.trim()!==e||/[\u0000-\u001F\u007F]/.test(e))return!1;const t=e.match(/^([a-zA-Z][a-zA-Z\d+.-]*):/);return t?Ne.has(t[1].toLowerCase()+":"):!0}function $e(e,t){if(typeof console>"u"||typeof console.warn!="function")return;const r=`${e}:${t}`;ne.has(r)||(ne.add(r),console.warn(`[FuPlayer] ${e} href uses an unsafe URL protocol. Received: ${t}`))}function I(e){return{share:"M18 16.1c-.76 0-1.45.3-1.96.77L8.91 12.7c.05-.23.09-.46.09-.7s-.04-.47-.09-.7l7.05-4.11A2.99 2.99 0 1 0 15 5c0 .24.04.47.09.7L8.04 9.81A3 3 0 1 0 8.04 14l7.12 4.18c-.04.2-.06.41-.06.62a2.9 2.9 0 1 0 2.9-2.7Z",play:"M8 5v14l11-7z",pause:"M7 5h4v14H7V5Zm6 0h4v14h-4V5Z",volume:"M4 9v6h4l5 4V5L8 9H4Zm12.5 3a4.5 4.5 0 0 0-2.1-3.8v7.6a4.5 4.5 0 0 0 2.1-3.8Zm-2.1-7.3v2.1a6.5 6.5 0 0 1 0 10.4v2.1a8.5 8.5 0 0 0 0-14.6Z",muted:"M4 9v6h4l5 4V5L8 9H4Zm13.6 3 2.4-2.4-1.4-1.4-2.4 2.4-2.4-2.4-1.4 1.4 2.4 2.4-2.4 2.4 1.4 1.4 2.4-2.4 2.4 2.4 1.4-1.4L17.6 12Z",fullscreen:"M5 5h6v2H7v4H5V5Zm12 2h-4V5h6v6h-2V7ZM7 17h4v2H5v-6h2v4Zm10-4h2v6h-6v-2h4v-4Z",fullscreenExit:"M9 9H5V7h6v6H9V9Zm6 0v4h-2V7h6v2h-4ZM9 15v-4h2v6H5v-2h4Zm6 0h4v2h-6v-6h2v4Z",phone:"M6.6 10.8c1.4 2.8 3.8 5.1 6.6 6.6l2.2-2.2c.3-.3.8-.4 1.2-.3 1.3.4 2.6.6 4 .6.7 0 1.2.5 1.2 1.2v3.6c0 .7-.5 1.2-1.2 1.2C10.6 22 2 13.4 2 2.8 2 2.1 2.5 1.6 3.2 1.6h3.6c.7 0 1.2.5 1.2 1.2 0 1.4.2 2.8.6 4 .1.4 0 .9-.3 1.2l-1.7 2.8Z",email:"M4 5h16a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V7a2 2 0 0 1 2-2Zm8 7.3L4.4 7H4v.8l8 5.6 8-5.6V7h-.4L12 12.3Z",whatsapp:"M12 4a7.8 7.8 0 0 0-6.7 11.8L4 20l4.3-1.1A7.8 7.8 0 1 0 12 4Zm0 2a5.8 5.8 0 1 1 0 11.6 6 6 0 0 1-3-.8l-.4-.2-1.7.4.5-1.6-.3-.4A5.8 5.8 0 0 1 12 6Zm-2.2 3.1c-.2 0-.5.1-.7.4-.2.3-.8.8-.8 2 0 1.1.8 2.2.9 2.3.1.2 1.6 2.5 4 3.4 2 .8 2.4.5 2.8.5.4-.1 1.3-.6 1.5-1.1.2-.5.2-1 .1-1.1-.1-.1-.2-.2-.5-.3l-1.6-.8c-.2-.1-.4-.1-.6.1l-.7.9c-.1.2-.3.2-.5.1a5.1 5.1 0 0 1-2.6-2.2c-.2-.3 0-.4.1-.6l.4-.4c.1-.2.2-.3.3-.5.1-.2 0-.4 0-.5l-.7-1.7c-.2-.4-.4-.5-.7-.5h-.7Z",copy:"M10.6 13.4a1 1 0 0 0 1.4 0l4.1-4.1a3 3 0 1 0-4.2-4.2l-1.2 1.2a1 1 0 0 0 1.4 1.4l1.2-1.2a1 1 0 1 1 1.4 1.4l-4.1 4.1a1 1 0 0 0 0 1.4Zm2.8-2.8a1 1 0 0 0-1.4 0l-4.1 4.1a3 3 0 1 0 4.2 4.2l1.2-1.2a1 1 0 0 0-1.4-1.4l-1.2 1.2a1 1 0 1 1-1.4-1.4l4.1-4.1a1 1 0 0 0 0-1.4Z"}[e]}function Be(e,t){t.forEach((r,n)=>{e.children[n]!==r&&e.insertBefore(r,e.children[n]??null)}),Array.from(e.children).forEach(r=>{t.includes(r)||r.remove()})}function v(e,t){if(t){if(typeof t=="string"){t.split(/\s+/).filter(Boolean).forEach(r=>e.classList.add(r));return}if(Array.isArray(t)){t.forEach(r=>v(e,r));return}typeof t=="object"&&Object.entries(t).forEach(([r,n])=>{n&&e.classList.add(r)})}}function P(e,t){t&&Object.entries(t).forEach(([r,n])=>{if(n!=null){if(r.startsWith("--")||r.includes("-")){e.style.setProperty(r,String(n));return}e.style.setProperty(Ke(r),String(n))}})}function ie(e,t,r=new Set){t&&Object.entries(t).forEach(([n,i])=>{if(!(r.has(n)||n.startsWith("on"))){if(i===!1||i===null||i===void 0){e.removeAttribute(n);return}e.setAttribute(n,i===!0?"":String(i))}})}function y(e,t,r){if(r===!1||r===null||r===void 0||r===""){e.removeAttribute(t);return}e.setAttribute(t,r===!0?"":String(r))}function He(e,t){const r=new Set(["alt","children","class","decoding","height","loading","src","width"]);Object.entries(t??{}).forEach(([n,i])=>{r.has(n)||i===void 0||i===null||n.startsWith("on")||e.setAttribute(n,String(i))})}function S(e){return A(I(e))}function A(e){const t=document.createElementNS("http://www.w3.org/2000/svg","svg");t.setAttribute("viewBox","0 0 24 24"),t.setAttribute("aria-hidden","true"),t.setAttribute("focusable","false");const r=document.createElementNS("http://www.w3.org/2000/svg","path");return r.setAttribute("d",e),t.appendChild(r),t}function Ke(e){return e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}const se=["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],L=new Set,O=new Set;let x=!1,_=!1;function ae(){const e=document;return e.fullscreenElement??e.webkitFullscreenElement??e.mozFullScreenElement??e.msFullscreenElement??null}function je(e){const t=e;return(t.requestFullscreen??t.webkitRequestFullscreen??t.webkitRequestFullScreen??t.mozRequestFullScreen??t.msRequestFullscreen)?.call(t)}function ze(){const e=document;return(e.exitFullscreen??e.webkitExitFullscreen??e.webkitCancelFullScreen??e.mozCancelFullScreen??e.msExitFullscreen)?.call(e)}function qe(e){return L.add(e),We(),e(),()=>{L.delete(e),L.size||Ze()}}function Ge(e){return O.add(e),Je(),()=>{O.delete(e),O.size||Qe()}}function We(){x||(se.forEach(e=>{document.addEventListener(e,oe)}),x=!0)}function Ze(){x&&(se.forEach(e=>{document.removeEventListener(e,oe)}),x=!1)}function oe(){L.forEach(e=>{e()})}function Je(){_||(document.addEventListener("keydown",le),_=!0)}function Qe(){_&&(document.removeEventListener("keydown",le),_=!1)}function le(e){O.forEach(t=>{t(e)})}function Xe(e,t){if(t)for(const r of e){const n=tt(r);if(!n)continue;const i=t[n];if(i)return{adapterKey:n,adapter:i,source:r}}}function ce(e){if(typeof e=="function")return e;if(e?.destroy)return()=>e.destroy?.();if(e?.dispose)return()=>e.dispose?.()}function Ye(e){return e.map((t,r)=>({track:t,index:r})).filter(({track:t})=>ue(t.kind)).map(({track:t,index:r})=>({key:`track-${r}`,label:rt(t,r),trackIndex:r,default:t.default}))}function ue(e){return e==="subtitles"||e==="captions"}function et(e){return e?e.message?e.message:{1:"Video loading was aborted.",2:"Video failed because of a network error.",3:"Video decoding failed.",4:"Video source is not supported."}[e.code]??"Video failed to load.":"Video failed to load."}function de(e,t){return e instanceof Error&&e.message?e.message:typeof e=="string"&&e?e:t}function E(e){const t=Number.isFinite(e)?Math.max(0,Math.floor(e)):0,r=Math.floor(t/60),n=t%60;return`${String(r).padStart(2,"0")}:${String(n).padStart(2,"0")}`}function tt(e){if(e.adapter==="native")return;if(e.adapter)return e.adapter;const t=e.type?.toLowerCase(),r=e.src.toLowerCase();if(t==="application/vnd.apple.mpegurl"||t==="application/x-mpegurl"||r.includes(".m3u8"))return"hls";if(t==="application/dash+xml"||r.includes(".mpd"))return"dash"}function rt(e,t){return e.label??e.srcLang?.toUpperCase()??`${e.kind} ${t+1}`}const N="off",nt="16 / 9",it="Video",st="Video",at="1970-01-01";function ot(e,t={}){return typeof e=="string"?{...t,src:e}:Array.isArray(e)?{...t,sources:e}:{...t,...e}}function he(e,t){const{aliases:r,playerOptions:n}=lt(e),i=ct(e,t),s=ut(e,t),a=dt(r,e.seo,e.geo,t,i,s),o=ht(r,n.geo,t,a),l=pt(o),h=n.renderJsonLd??t?.renderJsonLd??(Object.hasOwn(e,"seo")&&e.seo!==void 0),p=Object.hasOwn(n,"renderGeoText"),c=p||!!t?.renderGeoTextExplicit,u=p?!!n.renderGeoText:t?.renderGeoTextExplicit?t.renderGeoText:l;return{aspectRatio:nt,seoMode:"indexable",lazy:!0,rootMargin:"240px 0px",tracks:[],quickActions:[],nativeControls:!1,preload:"metadata",playsInline:!0,controls:!0,pauseOtherPlayers:!1,...t,...n,sources:i,poster:s,seo:a,geo:o,renderJsonLd:h,renderGeoText:u,renderGeoTextExplicit:c}}function lt(e){const{title:t,description:r,thumbnailUrl:n,uploadDate:i,duration:s,contentUrl:a,embedUrl:o,summary:l,keyTakeaways:h,transcript:p,chapters:c,type:u,media:d,adapter:j,...z}=e;return{aliases:{title:t,description:r,thumbnailUrl:n,uploadDate:i,duration:s,contentUrl:a,embedUrl:o,summary:l,keyTakeaways:h,transcript:p,chapters:c,type:u,media:d,adapter:j},playerOptions:z}}function ct(e,t){if(Object.hasOwn(e,"sources"))return e.sources??[];if(Object.hasOwn(e,"src")||Object.hasOwn(e,"type")||Object.hasOwn(e,"media")||Object.hasOwn(e,"adapter")){const r=t?.sources[0],n=Object.hasOwn(e,"src")?e.src:r?.src;return n?[{src:n,type:Object.hasOwn(e,"type")?e.type:r?.type,media:Object.hasOwn(e,"media")?e.media:r?.media,adapter:Object.hasOwn(e,"adapter")?e.adapter:r?.adapter}]:[]}return t?.sources??[]}function ut(e,t){return Object.hasOwn(e,"poster")?e.poster??"":t?.poster??""}function dt(e,t,r,n,i,s){const a=n?.seo,o=i[0]?.src,l=e.title??t?.name??a?.name??it,h=e.description??t?.description??a?.description??st,p=e.thumbnailUrl??t?.thumbnailUrl??a?.thumbnailUrl??s,c=e.contentUrl!==void 0||t?.contentUrl!==void 0||o!==n?.sources[0]?.src;return{...a,...t,name:l,description:h,thumbnailUrl:p,uploadDate:e.uploadDate??t?.uploadDate??a?.uploadDate??at,duration:e.duration??t?.duration??a?.duration??0,contentUrl:e.contentUrl??t?.contentUrl??(c?o:a?.contentUrl??o),embedUrl:e.embedUrl??t?.embedUrl??a?.embedUrl??mt(),transcript:e.transcript??t?.transcript??r?.transcript??a?.transcript,chapters:e.chapters??t?.chapters??r?.chapters??a?.chapters}}function ht(e,t,r,n){return{...r?.geo,...t,summary:e.summary??t?.summary??r?.geo?.summary,keyTakeaways:e.keyTakeaways??t?.keyTakeaways??r?.geo?.keyTakeaways,transcript:e.transcript??t?.transcript??n.transcript??r?.geo?.transcript,chapters:e.chapters??t?.chapters??n.chapters??r?.geo?.chapters}}function pt(e){return!!(e.summary?.trim()||e.transcript?.trim()||e.keyTakeaways?.some(t=>t.trim())||e.chapters?.length)}function mt(){return typeof window<"u"?window.location.href:void 0}function ft(e){if(typeof e!="string")return e;const t=document.querySelector(e);if(!t)throw new Error(`FuPlayer target was not found: ${e}`);return t}function pe(e){e.preventDefault()}const yt=["whatsapp","linkedin","x","facebook","copy"],gt="_blank",me="noreferrer noopener";function D(e){return e==="phone"||e==="email"||e==="whatsapp"}function bt(e,t){const r=w(e.href,`rightMenu.actions[${t}].href`),n=$(e.target,r);if(!(!r&&!e.onClick))return{...e,href:r,target:n,rel:R(n,e.rel)}}function vt(e){return!!e}function St(e,t,r){return e||(typeof window<"u"&&window.location.href?window.location.href:t.embedUrl??t.contentUrl??r??"")}function Et(e,t,r){if(typeof e=="string")return fe(e,void 0,t,r);if(Ct(e))return fe(e.preset,e,t,r);const n=typeof e.href=="function"?e.href(r):e.href,i=w(n,`share.targets.${e.id}.href`),s=$(e.target,i);return{id:e.id,target:e.id,label:e.label,ariaLabel:e.ariaLabel,href:i,icon:e.icon,iconPath:e.iconPath,className:e.className,iconClassName:e.iconClassName,targetWindow:s,rel:R(s,e.rel??(i?me:void 0)),onClick:e.onClick}}function fe(e,t,r,n){const i=t?.href!==void 0?kt(t.href,n):Tt(e,n),s=w(i,`share.targets.${t?.id??e}.href`),a=$(t?.target,s);return{id:t?.id??e,target:t?.id??e,builtInTarget:e,label:t?.label??At(e,r),ariaLabel:t?.ariaLabel,href:s,icon:t?.icon,iconPath:t?.iconPath,className:t?.className,iconClassName:t?.iconClassName,targetWindow:a,rel:R(a,t?.rel??(s?me:void 0)),onClick:t?.onClick}}function Ct(e){return typeof e=="object"&&"preset"in e}function kt(e,t){return typeof e=="function"?e(t):e}function Tt(e,t){return e==="copy"?void 0:Lt(e,t.url,t.title,t.text)}async function wt(e){if(typeof navigator<"u"&&navigator.clipboard?.writeText)try{return await navigator.clipboard.writeText(e),!0}catch{}const t=document.createElement("textarea");t.value=e,t.setAttribute("readonly",""),t.style.position="fixed",t.style.top="-9999px",document.body.appendChild(t),t.select();try{return document.execCommand("copy")}finally{document.body.removeChild(t)}}function Pt(e){return e==="linkedin"?"in":e==="facebook"?"f":"X"}function At(e,t){return e==="copy"?t?.copyLabel??"Copy link":{whatsapp:"WhatsApp",linkedin:"LinkedIn",x:"X",facebook:"Facebook"}[e]}function Lt(e,t,r,n){const i=encodeURIComponent(t),s=encodeURIComponent(r),a=encodeURIComponent(n);return{whatsapp:`https://wa.me/?text=${encodeURIComponent(`${r} ${t}`.trim())}`,linkedin:`https://www.linkedin.com/sharing/share-offsite/?url=${i}`,x:`https://twitter.com/intent/tweet?url=${i}&text=${s}`,facebook:`https://www.facebook.com/sharer/sharer.php?u=${i}&quote=${a}`}[e]}function $(e,t){if(t)return e?.trim()||gt}function Ot({actions:e,ariaLabel:t}){if(!e.length)return;const r=document.createElement("div");return r.className="fu-player__quick-actions",r.setAttribute("aria-label",t),e.forEach(n=>{const i=n.href,s=i?document.createElement("a"):document.createElement("button");v(s,Nt(n)),P(s,n.style),s.setAttribute("aria-label",n.ariaLabel??n.label??ye(n.kind)),s instanceof HTMLAnchorElement?(s.href=i??"",y(s,"target",n.target),y(s,"rel",n.rel)):s.type="button",s.addEventListener("click",o=>{n.onClick?.(o,n)});const a=Dt(n);if(a){const o=A(a);P(o,n.iconStyle),s.appendChild(o)}else{const o=document.createElement("span");o.className="fu-player__quick-action-mark",o.setAttribute("aria-hidden","true"),P(o,n.iconStyle),o.textContent=n.icon??ye(n.kind).slice(0,2),s.appendChild(o)}r.appendChild(s)}),r}function xt(e){if(!e.shouldRenderBottomControls)return{};const t=document.createElement("div");t.className="fu-player__chrome";const r=_t(e);t.appendChild(r);const n=document.createElement("div");n.className="fu-player__control-row";const i=Vt(e),s=Ft(e);return n.appendChild(i.element),n.appendChild(s),t.appendChild(n),{element:t,progressInput:r,timeElement:i.timeElement}}function _t(e){const t=document.createElement("input");return t.className="fu-player__progress",t.type="range",t.min="0",t.max=String(e.videoMax),t.step="0.1",t.value=String(Math.min(e.currentTime,e.visibleDuration||e.currentTime)),t.style.setProperty("--fu-player-progress",`${Math.min(e.progressPercent,100)}%`),t.setAttribute("aria-label","Video progress"),t.disabled=!e.shouldExposeVideoElement&&!e.visibleDuration,t.addEventListener("input",e.onProgressChange),t.addEventListener("change",e.onProgressChange),t}function Vt(e){const t=document.createElement("div");t.className="fu-player__control-left";const r=document.createElement("button");r.className="fu-player__control-button",r.type="button",r.setAttribute("aria-label",e.isPlaying?"Pause video":"Play video"),r.appendChild(S(e.isPlaying?"pause":"play")),r.addEventListener("click",e.onTogglePlayback),t.appendChild(r);const n=document.createElement("span");return n.className="fu-player__time",n.textContent=`${E(e.currentTime)} / ${E(e.visibleDuration)}`,t.appendChild(n),{element:t,timeElement:n}}function Ft(e){const t=document.createElement("div");t.className="fu-player__control-right";const r=Ut(e);r&&t.appendChild(r);const n=Mt(e);n&&t.appendChild(n);const i=document.createElement("button");i.className="fu-player__control-button",i.type="button",i.setAttribute("aria-label",e.isMuted?"Unmute video":"Mute video"),i.appendChild(S(e.isMuted||e.volume===0?"muted":"volume")),i.addEventListener("click",e.onToggleMute),t.appendChild(i);const s=document.createElement("input");s.className="fu-player__volume",s.type="range",s.min="0",s.max="1",s.step="0.05",s.value=String(e.isMuted?0:e.volume),s.setAttribute("aria-label","Video volume"),s.addEventListener("input",e.onVolumeChange),s.addEventListener("change",e.onVolumeChange),t.appendChild(s);const a=document.createElement("button");return a.className="fu-player__control-button",a.type="button",a.setAttribute("aria-label",e.isFullscreenActive?"Exit fullscreen":"Enter fullscreen"),a.appendChild(S(e.isFullscreenActive?"fullscreenExit":"fullscreen")),a.addEventListener("click",e.onToggleFullscreen),t.appendChild(a),t}function Ut(e){if(e.textTrackOptions.length<=1)return;const t=document.createElement("label");t.className="fu-player__subtitle";const r=document.createElement("span");r.className="fu-player__visually-hidden",r.textContent=e.subtitleMenuLabel??"Subtitles",t.appendChild(r);const n=document.createElement("select");return n.className="fu-player__subtitle-select",n.value=e.selectedTextTrackKey,n.setAttribute("aria-label",e.subtitleMenuLabel??"Subtitles"),n.addEventListener("change",e.onTextTrackChange),e.textTrackOptions.forEach(i=>{const s=document.createElement("option");s.value=i.key,s.textContent=i.label,s.selected=i.key===e.selectedTextTrackKey,n.appendChild(s)}),t.appendChild(n),t}function Mt(e){if(!e.isShareEnabled)return;const t=document.createElement("div");t.className="fu-player__share";const r=document.createElement("button");if(v(r,["fu-player__share-trigger",e.shareButtonClassName]),r.type="button",r.setAttribute("aria-label",e.shareButtonLabel??"Share video"),r.setAttribute("aria-expanded",String(e.isShareOpen)),r.appendChild(It(e)),r.addEventListener("click",e.onToggleShare),t.appendChild(r),e.isShareOpen){const n=document.createElement("div");v(n,["fu-player__share-menu",e.shareMenuClassName]),n.setAttribute("role","menu"),n.setAttribute("aria-label",e.shareMenuLabel??"Share video"),e.shareOptions.forEach(i=>{n.appendChild(Rt(i,e))}),t.appendChild(n)}return t}function Rt(e,t){const r=$t(e),n=r?document.createElement("button"):document.createElement("a");if(v(n,["fu-player__share-option",e.className]),n.setAttribute("role","menuitem"),n.setAttribute("aria-label",e.ariaLabel??e.label),r){const o=n;o.type="button",o.disabled=Bt(e,t.shareUrl)}else{const o=n;y(o,"href",e.href),y(o,"target",e.targetWindow),y(o,"rel",e.rel)}n.addEventListener("click",o=>{t.onShareOptionClick(e,o)});const i=document.createElement("span");v(i,Ht(e)),i.setAttribute("aria-hidden","true");const s=Kt(e);s?i.appendChild(A(s)):i.textContent=jt(e),n.appendChild(i);const a=document.createElement("span");return a.className="fu-player__share-label",a.textContent=e.builtInTarget==="copy"&&t.copyState==="copied"?t.copiedLabel??"Copied":e.label,n.appendChild(a),n}function It(e){if(e.shareButtonIconPath)return A(e.shareButtonIconPath);if(e.shareButtonIcon){const t=document.createElement("span");return t.className="fu-player__share-trigger-mark",t.setAttribute("aria-hidden","true"),t.textContent=e.shareButtonIcon,t}return S("share")}function Nt(e){return["fu-player__quick-action",D(e.kind)?`fu-player__quick-action--${e.kind}`:"fu-player__quick-action--custom",e.className]}function Dt(e){if(e.iconPath)return e.iconPath;if(!e.icon)return D(e.kind)?I(e.kind):void 0}function ye(e){const t={phone:"Call",email:"Email",whatsapp:"WhatsApp"};return D(e)?t[e]:e}function $t(e){return e.builtInTarget==="copy"||!e.href}function Bt(e,t){return e.builtInTarget==="copy"?!t:!e.href&&!e.onClick}function Ht(e){return["fu-player__share-icon",e.builtInTarget?`fu-player__share-icon--${e.builtInTarget}`:"fu-player__share-icon--custom",e.iconClassName]}function Kt(e){if(e.iconPath)return e.iconPath;if(!e.icon&&(e.builtInTarget==="copy"||e.builtInTarget==="whatsapp"))return I(e.builtInTarget)}function jt(e){return e.icon?e.icon:e.builtInTarget&&e.builtInTarget!=="copy"&&e.builtInTarget!=="whatsapp"?Pt(e.builtInTarget):e.label.slice(0,2)}function zt({root:e,lazy:t,rootMargin:r,onNearViewport:n}){if(!t){n("disabled");return}if(typeof window>"u"||!("IntersectionObserver"in window)){n("unsupported");return}const i=new IntersectionObserver(s=>{s.some(a=>a.isIntersecting||a.intersectionRatio>0)&&(i.disconnect(),n("intersecting"))},{rootMargin:r});return i.observe(e),i}class qt{currentState="idle";currentError;currentlyPlaying=!1;get state(){return this.currentState}get error(){return this.currentError}get isPlaying(){return this.currentlyPlaying}resetForAutoPlay(t){this.currentlyPlaying=t,this.currentError=void 0,this.currentState=t?"loading":"idle"}requestPlayback(){this.currentError=void 0,this.currentState==="error"&&(this.currentState="loading")}markLoading(){this.currentError=void 0,this.currentState="loading"}markReadyFromVideo(t){this.currentState!=="error"&&(this.currentError=void 0,this.currentState=t.paused?"ready":"playing")}markAdapterReady(t){this.currentError=void 0,this.currentState=t}markPlaying(){this.currentlyPlaying=!0,this.currentError=void 0,this.currentState="playing"}markPaused(){this.currentlyPlaying=!1,this.currentState!=="error"&&(this.currentState="paused")}markEnded(){this.currentlyPlaying=!1,this.currentState="ended"}markWaiting(){this.currentState!=="error"&&(this.currentState="buffering")}markStalled(t){this.currentState!=="error"&&(t||this.currentlyPlaying)&&(this.currentState="buffering")}reportError(t){this.currentError=t,this.currentState="error"}}function Gt(e,t){return{type:"playback",message:de(e,"Video playback failed."),source:t,error:e}}function Wt(e,t,r){return{type:"media",message:et(e.error),source:t,event:r,mediaError:e.error}}class Zt{cleanup;runId=0;signature="";resetSignature(){this.signature=""}cancelPending(){this.runId+=1}dispose(){if(!this.cleanup)return;const t=this.cleanup;this.cleanup=void 0;try{t()}catch{}}destroy(){this.cancelPending(),this.resetSignature(),this.dispose()}async setup(t){const{video:r,binding:n,sources:i,shouldExposeVideoElement:s}=t,a=Jt(r,n,s);if(a===this.signature)return;this.signature=a;const o=++this.runId;if(this.dispose(),!r||!s||!n){Qt(r,n,i);return}t.onLoading();try{const l=await n.adapter({video:r,source:n.source,sources:i,adapter:n.adapterKey});if(o!==this.runId){ce(l)?.();return}this.cleanup=ce(l),r.readyState>=2&&t.onReady(r.paused?"ready":"playing")}catch(l){if(o!==this.runId)return;t.onError({message:de(l,"Video source adapter failed."),source:n.source,error:l})}}}function Jt(e,t,r){return e&&r&&t?`${t.adapterKey}:${t.source.src}:${t.source.type??""}:${t.source.media??""}:${t.source.adapter??""}`:""}function Qt(e,t,r){e&&!t&&e.hasAttribute("src")&&r.length&&(e.removeAttribute("src"),e.load())}const B=new Set;class ge{root;container;options;scriptElement;videoElement=null;mediaChildrenSignature="";hasRequestedPlayback=!1;isNearViewport=!1;currentTime=0;durationSeconds=0;isMuted=!1;volume=1;selectedTextTrackKey=N;isFullscreen=!1;isPseudoFullscreen=!1;previousBodyOverflow;isShareOpen=!1;copyState="idle";copyResetTimer;lazyObserver;playbackStateRuntime=new qt;sourceAdapterRuntime=new Zt;unsubscribeFullscreenState;unsubscribeFullscreenKeyDown;removeShareListeners;videoListenerRemovers=[];progressInputElement;timeElement;schemaJson="";schemaDurationSecondsValue=0;destroyed=!1;constructor(t,r){this.container=ft(t),this.options=he(r),this.root=document.createElement("div"),this.isNearViewport=!this.options.lazy,this.isMuted=this.effectiveMuted,this.playbackStateRuntime.resetForAutoPlay(this.effectiveAutoPlay),this.selectedTextTrackKey=this.getDefaultTextTrackKey(),this.refreshSeoCache(),this.root.addEventListener("contextmenu",pe),this.container.appendChild(this.root),B.add(this),this.unsubscribeFullscreenState=qe(()=>this.updateFullscreenState()),this.render(),this.setupLazyObserver(),this.setupSourceAdapter(),this.effectiveAutoPlay&&(this.hasRequestedPlayback=!0,this.playVideo())}get video(){return this.videoElement}get isPlaying(){return this.playbackStateRuntime.isPlaying}get playbackState(){return this.playbackStateRuntime.state}get playbackError(){return this.playbackStateRuntime.error}update(t){if(this.destroyed)return;const r=Object.hasOwn(t,"muted")||Object.hasOwn(t,"autoPlay"),n=Object.hasOwn(t,"src")||Object.hasOwn(t,"sources")||Object.hasOwn(t,"type")||Object.hasOwn(t,"media")||Object.hasOwn(t,"adapter")||Object.hasOwn(t,"sourceAdapters");this.options=he(t,this.options),r&&this.setMutedState(this.effectiveMuted),n&&(this.sourceAdapterRuntime.resetSignature(),this.mediaChildrenSignature=""),this.refreshSeoCache(),this.getTextTrackOptions().some(i=>i.key===this.selectedTextTrackKey)||(this.selectedTextTrackKey=this.getDefaultTextTrackKey()),(!this.shouldRenderBottomControls||!this.isShareEnabled)&&this.closeShareMenu(),this.render(),this.setupLazyObserver(),this.setupSourceAdapter(),this.syncTextTracks(),this.effectiveAutoPlay&&(this.hasRequestedPlayback=!0,this.playVideo())}async play(){this.hasRequestedPlayback=!0,this.playbackStateRuntime.requestPlayback(),this.render(),await this.playVideo()}pause(){this.videoElement?.pause()}destroy(){this.destroyed||(this.destroyed=!0,this.lazyObserver?.disconnect(),this.lazyObserver=void 0,this.sourceAdapterRuntime.destroy(),B.delete(this),this.destroyVideo(),this.closeShareMenu(),this.removeShareListeners?.(),this.removeShareListeners=void 0,this.clearCopyTimer(),this.unsubscribeFullscreenState?.(),this.unsubscribeFullscreenState=void 0,this.exitPseudoFullscreen(),this.root.removeEventListener("contextmenu",pe),this.root.remove())}get normalizedSources(){return this.options.sources}get effectiveAutoPlay(){return!!this.options.autoPlay}get effectiveLoop(){return!!this.options.loop}get effectiveMuted(){return this.effectiveAutoPlay||!!this.options.muted}get effectiveHideMenu(){return!!this.options.hideMenu}get effectiveHideControls(){return!!this.options.hideControls}get effectiveSeoWarnings(){return this.options.seoWarnings!==!1}get shouldPrepareVideo(){return this.effectiveAutoPlay||!this.options.lazy||this.isNearViewport||this.hasRequestedPlayback}get shouldExposeVideoElement(){return this.options.seoMode==="indexable"||this.shouldPrepareVideo}get visibleDuration(){return this.durationSeconds||this.schemaDurationSecondsValue}get videoMax(){return Math.max(this.visibleDuration,this.currentTime,0)}get shouldRenderCustomControls(){return!!(this.options.controls&&!this.options.nativeControls)}get shouldRenderBottomControls(){return this.shouldRenderCustomControls&&!this.effectiveHideControls}get statusOverlayKind(){return this.playbackState==="error"?"error":this.playbackState==="buffering"?"buffering":this.playbackState==="loading"&&(this.hasRequestedPlayback||this.effectiveAutoPlay)?"loading":""}get isFullscreenActive(){return this.isFullscreen||this.isPseudoFullscreen}get shareConfig(){return typeof this.options.share=="object"?this.options.share:void 0}get isShareEnabled(){return!this.effectiveHideMenu&&this.options.share!==!1&&this.shareConfig?.enabled!==!1}render(){if(this.destroyed)return;this.progressInputElement=void 0,this.timeElement=void 0,this.syncRootAttributes();const t=[],r=this.renderJsonLd(),n=this.renderMedia(),i=this.renderStatusOverlay(),s=this.renderCenterPlayButton(),a=this.renderQuickActions(),o=this.renderControls(),l=this.renderGeoText();r&&t.push(r),n&&t.push(n),i&&t.push(i),s&&t.push(s),a&&t.push(a),o&&t.push(o),l&&t.push(l),Be(this.root,t),this.syncShareListeners()}syncRootAttributes(){this.root.className="",this.root.classList.add("fu-player"),this.isPseudoFullscreen&&this.root.classList.add("fu-player--fullscreen"),v(this.root,this.options.className),this.root.removeAttribute("style"),P(this.root,this.options.wrapperStyle),this.root.style.setProperty("--fu-player-aspect-ratio",this.options.aspectRatio),ie(this.root,this.options.rootAttributes,new Set(["class","style"]))}renderJsonLd(){if(!this.options.renderJsonLd){this.scriptElement=void 0;return}return this.scriptElement||(this.scriptElement=document.createElement("script"),this.scriptElement.type="application/ld+json"),this.scriptElement.textContent=this.schemaJson,this.scriptElement}refreshSeoCache(){const t=Y(this.options.seo,this.normalizedSources[0]?.src,{seoWarnings:this.options.renderJsonLd&&this.effectiveSeoWarnings});this.schemaJson=ee(t),this.schemaDurationSecondsValue=te(t.duration)}renderMedia(){if(this.shouldExposeVideoElement){this.destroyPosterOnly();const t=this.ensureVideo();return this.syncVideoAttributes(t),this.syncVideoChildren(t),t}return this.destroyVideo(),this.createPosterButton()}ensureVideo(){if(this.videoElement)return this.videoElement;const t=document.createElement("video");return t.className="fu-player__media",this.videoElement=t,this.sourceAdapterRuntime.resetSignature(),this.addVideoListener("loadstart",this.handleLoadStart),this.addVideoListener("loadedmetadata",this.handleLoadedMetadata),this.addVideoListener("loadeddata",this.handleLoadedData),this.addVideoListener("canplay",this.handleCanPlay),this.addVideoListener("timeupdate",this.handleTimeUpdate),this.addVideoListener("play",this.handlePlay),this.addVideoListener("playing",this.handlePlaying),this.addVideoListener("pause",this.handlePause),this.addVideoListener("ended",this.handleEnded),this.addVideoListener("waiting",this.handleWaiting),this.addVideoListener("stalled",this.handleStalled),this.addVideoListener("error",this.handleError),this.addVideoListener("volumechange",this.handleVolumeChangeEvent),this.addVideoListener("webkitbeginfullscreen",()=>this.handleNativeVideoFullscreenChange(!0)),this.addVideoListener("webkitendfullscreen",()=>this.handleNativeVideoFullscreenChange(!1)),t}addVideoListener(t,r){this.videoElement&&(this.videoElement.addEventListener(t,r),this.videoListenerRemovers.push(()=>{this.videoElement?.removeEventListener(t,r)}))}syncVideoAttributes(t){ie(t,this.options.videoAttributes,new Set(["class"])),t.className="fu-player__media",t.poster=this.options.poster,t.preload=this.options.preload,t.autoplay=!!(this.effectiveAutoPlay||this.hasRequestedPlayback),t.muted=this.isMuted,t.playsInline=this.options.playsInline,t.controls=!!(this.options.nativeControls&&this.options.controls&&!this.effectiveHideControls),t.loop=this.effectiveLoop,t.disablePictureInPicture=!!this.options.disablePictureInPicture,y(t,"crossorigin",this.options.crossOrigin),y(t,"controlslist",this.options.controlsList)}syncVideoChildren(t){const r=this.sourceAdapterBinding?[]:this.normalizedSources,n=JSON.stringify({sources:r,tracks:this.options.tracks,fallback:this.options.fallback??""});n!==this.mediaChildrenSignature&&(this.mediaChildrenSignature=n,t.replaceChildren(),r.forEach(i=>{const s=document.createElement("source");s.src=i.src,y(s,"type",i.type),y(s,"media",i.media),t.appendChild(s)}),this.options.tracks.forEach(i=>{const s=document.createElement("track");s.src=i.src,s.kind=i.kind,y(s,"srclang",i.srcLang),y(s,"label",i.label),i.default&&(s.default=!0),t.appendChild(s)}),this.options.fallback&&t.appendChild(document.createTextNode(this.options.fallback)))}createPosterButton(){const t=document.createElement("button");t.className="fu-player__poster",t.type="button",t.setAttribute("aria-label",this.options.playButtonLabel??`Play video: ${this.options.seo.name}`),t.addEventListener("click",()=>{this.play()});const r=document.createElement("img");r.className="fu-player__poster-image",r.loading="lazy",r.decoding="async",He(r,this.options.posterImageProps),r.src=this.options.poster,r.alt=this.options.posterAlt??this.options.seo.name,t.appendChild(r);const n=document.createElement("span");return n.className="fu-player__play",n.setAttribute("aria-hidden","true"),n.appendChild(S("play")),t.appendChild(n),t}renderStatusOverlay(){const t=this.statusOverlayKind;if(!t)return;const r=document.createElement("div");if(r.className=`fu-player__status fu-player__status--${t}`,r.setAttribute("role",t==="error"?"alert":"status"),r.setAttribute("aria-live",t==="error"?"assertive":"polite"),t!=="error"){const i=document.createElement("span");i.className="fu-player__status-spinner",i.setAttribute("aria-hidden","true"),r.appendChild(i)}const n=document.createElement("span");if(n.className="fu-player__status-message",n.textContent=this.getStatusOverlayText(),r.appendChild(n),t==="error"){const i=document.createElement("button");i.className="fu-player__status-retry",i.type="button",i.textContent=this.options.retryButtonLabel??"Retry",i.addEventListener("click",()=>{this.retryPlayback()}),r.appendChild(i)}return r}renderCenterPlayButton(){if(!this.shouldRenderCustomControls||!this.shouldExposeVideoElement||this.isPlaying||this.statusOverlayKind)return;const t=document.createElement("button");return t.className="fu-player__center-play",t.type="button",t.setAttribute("aria-label",this.options.playButtonLabel??`Play video: ${this.options.seo.name}`),t.appendChild(S("play")),t.addEventListener("click",()=>{this.togglePlayback()}),t}renderQuickActions(){return Ot({actions:this.getRightMenuActions(),ariaLabel:this.getRightMenuAriaLabel()})}renderControls(){const r=this.shouldRenderBottomControls&&this.isShareEnabled?this.getSharePayload():void 0,n=xt({shouldRenderBottomControls:this.shouldRenderBottomControls,currentTime:this.currentTime,visibleDuration:this.visibleDuration,videoMax:this.videoMax,progressPercent:this.progressPercent,shouldExposeVideoElement:this.shouldExposeVideoElement,isPlaying:this.isPlaying,isMuted:this.isMuted,volume:this.volume,isFullscreenActive:this.isFullscreenActive,textTrackOptions:this.getTextTrackOptions(),selectedTextTrackKey:this.selectedTextTrackKey,subtitleMenuLabel:this.options.subtitleMenuLabel,isShareEnabled:this.isShareEnabled,shareButtonIcon:this.shareConfig?.buttonIcon,shareButtonIconPath:this.shareConfig?.buttonIconPath,shareButtonClassName:this.shareConfig?.buttonClassName,shareButtonLabel:this.shareConfig?.buttonLabel,isShareOpen:this.isShareOpen,shareMenuClassName:this.shareConfig?.menuClassName,shareMenuLabel:this.shareConfig?.menuLabel,shareOptions:r?this.getShareOptions(r):[],shareUrl:r?.url??"",copyState:this.copyState,copiedLabel:this.shareConfig?.copiedLabel,onProgressChange:this.handleProgressChange,onTogglePlayback:()=>{this.togglePlayback()},onVolumeChange:this.handleVolumeChange,onToggleMute:()=>this.toggleMute(),onTextTrackChange:this.handleTextTrackChange,onToggleShare:()=>{this.isShareOpen=!this.isShareOpen,this.render()},onShareOptionClick:(i,s)=>{this.handleShareOptionClick(i,s)},onToggleFullscreen:()=>this.toggleFullscreen()});return this.progressInputElement=n.progressInput,this.timeElement=n.timeElement,n.element}renderGeoText(){if(!this.options.renderGeoText||!this.hasGeoTextContent())return;const t=document.createElement("section");t.className="fu-player__geo fu-player__visually-hidden",t.setAttribute("aria-label","Video content details");const r=document.createElement("h2");if(r.textContent=this.options.seo.name,t.appendChild(r),this.options.seo.description){const n=document.createElement("p");n.textContent=this.options.seo.description,t.appendChild(n)}return this.appendGeoSummary(t),this.appendGeoKeyTakeaways(t),this.appendGeoChapters(t),this.appendGeoTranscript(t),t}appendGeoSummary(t){const r=this.options.geo?.summary?.trim();if(!r)return;const n=document.createElement("h3");n.textContent="Summary",t.appendChild(n);const i=document.createElement("p");i.textContent=r,t.appendChild(i)}appendGeoKeyTakeaways(t){const r=this.options.geo?.keyTakeaways?.filter(s=>s.trim());if(!r?.length)return;const n=document.createElement("h3");n.textContent="Key takeaways",t.appendChild(n);const i=document.createElement("ul");r.forEach(s=>{const a=document.createElement("li");a.textContent=s,i.appendChild(a)}),t.appendChild(i)}appendGeoChapters(t){const r=this.options.geo?.chapters;if(!r?.length)return;const n=document.createElement("h3");n.textContent="Chapters",t.appendChild(n);const i=document.createElement("ol");r.forEach((s,a)=>{const o=document.createElement("li"),l=this.formatChapterTimeRange(s.startOffset,s.endOffset),h=l?`${l} ${s.name}`:s.name,p=w(s.url,`geo.chapters[${a}].url`);if(p){const c=document.createElement("a");c.href=p,c.textContent=h,o.appendChild(c)}else o.textContent=h;i.appendChild(o)}),t.appendChild(i)}appendGeoTranscript(t){const r=this.options.geo?.transcript?.trim();if(!r)return;const n=document.createElement("h3");n.textContent="Transcript",t.appendChild(n);const i=document.createElement("p");i.textContent=r,t.appendChild(i)}hasGeoTextContent(){const t=this.options.geo;return!!(t?.summary?.trim()||t?.transcript?.trim()||t?.keyTakeaways?.some(r=>r.trim())||t?.chapters?.length)}formatChapterTimeRange(t,r){if(!Number.isFinite(t))return"";const n=E(t);return typeof r=="number"&&Number.isFinite(r)?`${n}-${E(r)}`:n}get progressPercent(){return this.visibleDuration>0?this.currentTime/this.visibleDuration*100:0}getStatusOverlayText(){return this.statusOverlayKind==="loading"?this.options.loadingLabel??"Loading video...":this.statusOverlayKind==="buffering"?this.options.bufferingLabel??"Buffering...":this.statusOverlayKind==="error"?this.options.errorLabel??this.playbackError?.message??"Video failed to load.":""}async retryPlayback(){this.hasRequestedPlayback=!0,this.playbackStateRuntime.markLoading(),this.sourceAdapterRuntime.resetSignature(),this.render(),this.sourceAdapterBinding?await this.setupSourceAdapter():this.videoElement?.load(),await this.playVideo()}async playVideo(){this.videoElement||this.render();const t=this.videoElement;if(t)try{await t.play()}catch(r){this.reportPlaybackError(Gt(r,this.getCurrentSource()))}}async togglePlayback(){const t=this.videoElement;if(!t||t.paused||t.ended){await this.play();return}t.pause()}handleProgressChange=t=>{const r=Number(t.target.value);this.currentTime=r,this.videoElement&&(this.videoElement.currentTime=r),this.syncProgressDom()};handleVolumeChange=t=>{const r=Number(t.target.value);this.volume=r,this.isMuted=r===0,this.videoElement&&(this.videoElement.volume=r,this.videoElement.muted=r===0),this.render()};toggleMute(){const t=!this.isMuted;this.setMutedState(t),this.videoElement&&!t&&this.videoElement.volume===0&&(this.videoElement.volume=.8,this.volume=.8),this.render()}setMutedState(t){this.isMuted=t,this.videoElement&&(this.videoElement.muted=t)}handleTextTrackChange=t=>{this.selectedTextTrackKey=t.target.value,this.syncTextTracks(),this.render()};handleLoadStart=t=>{this.playbackStateRuntime.markLoading(),this.callVideoHandler("onLoadStart",t),this.render()};handleLoadedMetadata=t=>{const r=t.currentTarget,n=r.duration;this.durationSeconds=Number.isFinite(n)?n:0,this.volume=r.volume,this.callVideoHandler("onLoadedMetadata",t),this.render(),this.syncProgressDom()};handleLoadedData=t=>{this.setReadyState(t.currentTarget),this.callVideoHandler("onLoadedData",t),this.render()};handleCanPlay=t=>{this.setReadyState(t.currentTarget),this.callVideoHandler("onCanPlay",t),this.render()};handleTimeUpdate=t=>{this.currentTime=t.currentTarget.currentTime,this.callVideoHandler("onTimeUpdate",t),this.syncProgressDom()};handlePlay=t=>{this.playbackStateRuntime.markPlaying(),this.pausePeerPlayers(),this.callVideoHandler("onPlay",t),this.render()};handlePlaying=t=>{this.playbackStateRuntime.markPlaying(),this.callVideoHandler("onPlaying",t),this.render()};handlePause=t=>{this.playbackStateRuntime.markPaused(),this.callVideoHandler("onPause",t),this.render()};handleEnded=t=>{this.playbackStateRuntime.markEnded(),this.callVideoHandler("onEnded",t),this.render()};handleWaiting=t=>{this.playbackStateRuntime.markWaiting(),this.callVideoHandler("onWaiting",t),this.render()};handleStalled=t=>{this.playbackStateRuntime.markStalled(this.hasRequestedPlayback),this.callVideoHandler("onStalled",t),this.render()};handleError=t=>{const r=t.currentTarget;this.reportPlaybackError(Wt(r,this.getCurrentSource(),t)),this.callVideoHandler("onError",t),this.render()};handleVolumeChangeEvent=t=>{const r=t.currentTarget;this.isMuted=r.muted,this.volume=r.volume,this.callVideoHandler("onVolumeChange",t),this.render()};setReadyState(t){this.playbackStateRuntime.markReadyFromVideo(t)}reportPlaybackError(t){this.playbackStateRuntime.reportError(t),this.options.onPlaybackError?.(t)}syncProgressDom(){this.progressInputElement&&(this.progressInputElement.max=String(this.videoMax),this.progressInputElement.value=String(Math.min(this.currentTime,this.visibleDuration||this.currentTime)),this.progressInputElement.style.setProperty("--fu-player-progress",`${Math.min(this.progressPercent,100)}%`),this.progressInputElement.disabled=!this.shouldExposeVideoElement&&!this.visibleDuration),this.timeElement&&(this.timeElement.textContent=`${E(this.currentTime)} / ${E(this.visibleDuration)}`)}pausePeerPlayers(){this.options.pauseOtherPlayers&&B.forEach(t=>{t!==this&&t.pause()})}getCurrentSource(){return this.sourceAdapterBinding?.source??this.normalizedSources[0]}callVideoHandler(t,r){const n=this.options[t];n?.(r)}get sourceAdapterBinding(){return Xe(this.normalizedSources,this.options.sourceAdapters)}async setupSourceAdapter(){await this.sourceAdapterRuntime.setup({video:this.videoElement,binding:this.sourceAdapterBinding,sources:this.normalizedSources,shouldExposeVideoElement:this.shouldExposeVideoElement,onLoading:()=>{this.playbackStateRuntime.markLoading(),this.render()},onReady:t=>{this.playbackStateRuntime.markAdapterReady(t),this.render()},onError:({message:t,source:r,error:n})=>{this.reportPlaybackError({type:"adapter",message:t,source:r,error:n}),this.render()}})}setupLazyObserver(){this.lazyObserver?.disconnect(),this.lazyObserver=zt({root:this.root,lazy:this.options.lazy,rootMargin:this.options.rootMargin,onNearViewport:t=>{this.isNearViewport=!0,t!=="disabled"&&(t==="intersecting"&&(this.lazyObserver=void 0),this.render(),this.setupSourceAdapter())}})}getTextTrackOptions(){return[{key:N,label:this.options.subtitlesOffLabel??"Subtitles off"},...Ye(this.options.tracks)]}getDefaultTextTrackKey(){return this.getTextTrackOptions().find(r=>r.default)?.key??N}syncTextTracks(){const t=this.videoElement;if(!t?.textTracks)return;const r=this.getTextTrackOptions().find(n=>n.key===this.selectedTextTrackKey)?.trackIndex;for(let n=0;n<t.textTracks.length;n+=1){const i=this.options.tracks[n];if(!(!i||!ue(i.kind)))try{t.textTracks[n].mode=n===r?"showing":"disabled"}catch{}}}getRightMenuConfig(){const t=this.options.rightMenu!==void 0?this.options.rightMenu:this.options.quickActions;return t?Array.isArray(t)?{actions:t}:t:{actions:[]}}getRightMenuActions(){const t=this.getRightMenuConfig();return this.effectiveHideMenu||t.enabled===!1?[]:(t.actions??[]).map(bt).filter(vt)}getRightMenuAriaLabel(){return this.getRightMenuConfig().ariaLabel??"Quick actions"}getSharePayload(){return{url:St(this.shareConfig?.url,this.options.seo,this.normalizedSources[0]?.src),title:this.shareConfig?.title??this.options.seo.name,text:this.shareConfig?.text??this.options.seo.description}}getShareOptions(t=this.getSharePayload()){return(this.shareConfig?.targets??yt).map(n=>Et(n,this.shareConfig,t))}async handleShareOptionClick(t,r){if(t.onClick){await t.onClick(this.getSharePayload(),r),r.defaultPrevented||(this.closeShareMenu(),this.render());return}if(t.builtInTarget==="copy"){await this.handleCopyShareUrl(r);return}r.defaultPrevented||(this.closeShareMenu(),this.render())}async handleCopyShareUrl(t){t.preventDefault();const r=this.getSharePayload().url;if(!r)return;await wt(r)&&(this.clearCopyTimer(),this.copyState="copied",this.copyResetTimer=window.setTimeout(()=>{this.copyResetTimer=void 0,this.copyState="idle",this.render()},1800),this.render())}clearCopyTimer(){this.copyResetTimer!==void 0&&(window.clearTimeout(this.copyResetTimer),this.copyResetTimer=void 0)}syncShareListeners(){if(this.removeShareListeners?.(),this.removeShareListeners=void 0,!this.isShareOpen){this.clearCopyTimer(),this.copyState="idle";return}const t=n=>{this.root&&n.target instanceof Node&&!this.root.querySelector(".fu-player__share")?.contains(n.target)&&(this.closeShareMenu(),this.render())},r=n=>{n.key==="Escape"&&(this.closeShareMenu(),this.render())};document.addEventListener("pointerdown",t),document.addEventListener("keydown",r),this.removeShareListeners=()=>{document.removeEventListener("pointerdown",t),document.removeEventListener("keydown",r)}}closeShareMenu(){this.isShareOpen=!1,this.removeShareListeners?.(),this.removeShareListeners=void 0,this.clearCopyTimer(),this.copyState="idle"}toggleFullscreen(){if(this.isPseudoFullscreen){this.exitPseudoFullscreen(),this.render();return}if(ae()){Promise.resolve(ze()).then(()=>this.updateFullscreenState()).catch(()=>{});return}const t=je(this.root);if(t!==void 0){Promise.resolve(t).then(()=>this.updateFullscreenState()).catch(()=>{this.enterNativeVideoFullscreen()||this.enterPseudoFullscreen(),this.render()});return}this.enterNativeVideoFullscreen()||this.enterPseudoFullscreen(),this.render()}handleNativeVideoFullscreenChange(t){this.isFullscreen=t,this.render()}enterNativeVideoFullscreen(){const t=this.videoElement;try{if(t?.webkitEnterFullscreen)return t.webkitEnterFullscreen(),this.isFullscreen=!0,!0;if(t?.webkitEnterFullScreen)return t.webkitEnterFullScreen(),this.isFullscreen=!0,!0}catch{return!1}return!1}enterPseudoFullscreen(){this.isPseudoFullscreen||(this.previousBodyOverflow===void 0&&(this.previousBodyOverflow=document.body.style.overflow,document.body.style.overflow="hidden"),this.isPseudoFullscreen=!0,this.unsubscribeFullscreenKeyDown=Ge(t=>{t.key==="Escape"&&this.isPseudoFullscreen&&(this.exitPseudoFullscreen(),this.render())}))}exitPseudoFullscreen(){this.isPseudoFullscreen=!1,this.unsubscribeFullscreenKeyDown?.(),this.unsubscribeFullscreenKeyDown=void 0,this.previousBodyOverflow!==void 0&&(document.body.style.overflow=this.previousBodyOverflow,this.previousBodyOverflow=void 0)}updateFullscreenState(){const t=ae();this.isFullscreen=!!(t&&(t===this.root||this.root.contains(t)||t.contains(this.root))),this.render()}destroyVideo(){this.videoListenerRemovers.forEach(t=>t()),this.videoListenerRemovers=[],this.videoElement?.remove(),this.videoElement=null,this.mediaChildrenSignature="",this.sourceAdapterRuntime.destroy()}destroyPosterOnly(){this.root.querySelector(".fu-player__poster")?.remove()}}function Xt(e,t,r){return new ge(e,ot(t,r))}function be(e,t={}){t.seoWarnings!==!1&&F(e);const r=t.title??e.name,n=er(r,t.titleTemplate),i=t.description??e.description,s=t.canonicalUrl??e.embedUrl,a=t.image??ve(e.thumbnailUrl),o=e.embedUrl??e.contentUrl,l=H(t.publishedTime??e.uploadDate),h=H(t.modifiedTime),p=nr(t.locale??e.inLanguage),c=t.twitterCard??"summary_large_image";t.seoWarnings!==!1&&we({canonicalUrl:s,image:a,videoUrl:o});const u=[{name:"description",content:i},m("name","robots",t.robots),{property:"og:type",content:t.ogType??"video.other"},{property:"og:title",content:n},{property:"og:description",content:i},m("property","og:url",s),m("property","og:image",a),m("property","og:site_name",t.siteName),m("property","og:locale",p),m("property","og:video",o),m("property","og:video:url",o),m("property","og:video:secure_url",ir(o)?o:void 0),m("property","video:release_date",l),m("property","article:published_time",l),m("property","article:modified_time",h),{name:"twitter:card",content:c},{name:"twitter:title",content:n},{name:"twitter:description",content:i},m("name","twitter:image",a),m("name","twitter:site",t.twitterSite),m("name","twitter:creator",t.twitterCreator),m("name","twitter:player",c==="player"?e.embedUrl:void 0),m("name","twitter:player:width",Se(t.twitterPlayerWidth)),m("name","twitter:player:height",Se(t.twitterPlayerHeight)),...t.extraMeta??[]].filter(tr),d=[...s?[{rel:"canonical",href:s}]:[],...t.extraLinks??[]];return{title:n,meta:ar(u),links:or(d)}}function Yt(e,t={}){return['<?xml version="1.0" encoding="UTF-8"?>','<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:video="http://www.google.com/schemas/sitemap-video/1.1">',...e.map(n=>{const i=n.seo;t.seoWarnings!==!1&&F(i);const s=ve(i.thumbnailUrl),a=n.contentUrl??i.contentUrl,o=n.playerUrl??i.embedUrl,l=sr(i.duration),h=H(i.uploadDate),p=n.tags??rr(i.keywords);return t.seoWarnings!==!1&&Pe({loc:n.loc,thumbnailUrl:s,contentUrl:a,playerUrl:o}),[" <url>",` <loc>${g(n.loc)}</loc>`," <video:video>",` <video:thumbnail_loc>${g(s)}</video:thumbnail_loc>`,` <video:title>${g(i.name)}</video:title>`,` <video:description>${g(i.description)}</video:description>`,a?` <video:content_loc>${g(a)}</video:content_loc>`:"",o?` <video:player_loc>${g(o)}</video:player_loc>`:"",l?` <video:duration>${l}</video:duration>`:"",h?` <video:publication_date>${g(h)}</video:publication_date>`:"",...p.slice(0,32).map(c=>` <video:tag>${g(c)}</video:tag>`)," </video:video>"," </url>"].filter(Boolean).join(`
1
+ (function(f,k){typeof exports=="object"&&typeof module<"u"?k(exports):typeof define=="function"&&define.amd?define(["exports"],k):(f=typeof globalThis<"u"?globalThis:f||self,k(f.FuPlayer={}))})(this,(function(f){"use strict";const k=/^(\d{4})-(\d{2})-(\d{2})(?:T(\d{2}):(\d{2}):(\d{2})(?:\.\d{1,3})?(?:Z|([+-])(\d{2}):(\d{2})))?$/,J=/^P(?:(\d+)D)?(?:T(?=\d)(?:(\d+)H)?(?:(\d+)M)?(?:(\d+)S)?)?$/,Q=new Set;function xe(e){return Y(e)}function D(e){P(Y(e))}function _e(e){P(N([{path:"thumbnailUrl",value:e.thumbnailUrl,required:!0},{path:"contentUrl",value:e.contentUrl},{path:"embedUrl",value:e.embedUrl}]))}function Fe(e){P(N([{path:"head.canonicalUrl",value:e.canonicalUrl},{path:"head.image",value:e.image},{path:"head.videoUrl",value:e.videoUrl}]))}function Ve(e){P(N([{path:"sitemap.loc",value:e.loc,required:!0},{path:"sitemap.thumbnailUrl",value:e.thumbnailUrl,required:!0},{path:"sitemap.contentUrl",value:e.contentUrl},{path:"sitemap.playerUrl",value:e.playerUrl}]))}function X(e){const t=e.match(J);if(!t||!re(t))return 0;const[,r="0",n="0",i="0",s="0"]=t;return Number(r)*86400+Number(n)*3600+Number(i)*60+Number(s)}function Y(e){const t=[],r=te(e.thumbnailUrl);return r.length||t.push({code:"missing_url",path:"thumbnailUrl",message:"should include at least one absolute http(s) URL.",value:e.thumbnailUrl}),r.forEach((n,i)=>{A(t,Array.isArray(e.thumbnailUrl)?`thumbnailUrl[${i}]`:"thumbnailUrl",n)}),e.contentUrl!==void 0&&A(t,"contentUrl",e.contentUrl),e.embedUrl!==void 0&&A(t,"embedUrl",e.embedUrl),Ie(e.uploadDate)||t.push({code:"invalid_date",path:"uploadDate",message:"should be an ISO 8601 date or datetime.",value:e.uploadDate}),Ne(e.duration)||t.push({code:"invalid_duration",path:"duration",message:"should be an ISO 8601 duration string such as PT1M5S, or a non-negative seconds number.",value:e.duration}),t}function N(e){const t=[];return e.forEach(r=>{if(r.value===void 0){r.required&&t.push({code:"missing_url",path:r.path,message:"should include at least one absolute http(s) URL.",value:r.value});return}const n=te(r.value);r.required&&!n.length&&t.push({code:"missing_url",path:r.path,message:"should include at least one absolute http(s) URL.",value:r.value}),n.forEach((i,s)=>{A(t,Array.isArray(r.value)?`${r.path}[${s}]`:r.path,i)})}),t}function P(e){typeof console>"u"||typeof console.warn!="function"||e.forEach(t=>{const r=Ue(t);Q.has(r)||(Q.add(r),Me(t))})}function A(e,t,r){Re(r)||e.push({code:"invalid_url",path:t,message:"should be an absolute http(s) URL.",value:r})}function Ue(e){return`${e.path}:${ee(e.value)}`}function Me(e){console.warn(`[FuPlayer SEO] ${e.path} ${e.message} Received: ${ee(e.value)}`)}function ee(e){if(e instanceof Date)return Number.isFinite(e.getTime())?e.toISOString():"Invalid Date";if(typeof e=="string")return e||'""';if(e===void 0)return"undefined";try{return JSON.stringify(e)}catch{return String(e)}}function te(e){return Array.isArray(e)?e:[e]}function Re(e){if(e.trim()!==e||!e)return!1;try{const t=new URL(e);return t.protocol==="http:"||t.protocol==="https:"}catch{return!1}}function Ie(e){if(e instanceof Date)return Number.isFinite(e.getTime());const t=e.match(k);if(!t)return!1;const[,r,n,i,s,a,o,,l,h]=t,p=Number(r),c=Number(n),d=Number(i);if(!De(p,c,d))return!1;if(s===void 0)return!0;const u=Number(s),T=Number(a),w=Number(o);return!(u>23||T>59||w>59||l!==void 0&&(Number(l)>23||Number(h)>59))}function De(e,t,r){if(t<1||t>12)return!1;const n=new Date(Date.UTC(e,t-1,r));return n.getUTCFullYear()===e&&n.getUTCMonth()===t-1&&n.getUTCDate()===r}function Ne(e){if(typeof e=="number")return Number.isFinite(e)&&e>=0;const t=e.match(J);return!!(t&&re(t))}function re(e){return!!(e[1]||e[2]||e[3]||e[4])}function ne(e,t,r={}){const n={"@context":"https://schema.org","@type":"VideoObject",name:e.name,description:e.description,thumbnailUrl:$e(e.thumbnailUrl),uploadDate:je(e.uploadDate),duration:Ke(e.duration),contentUrl:e.contentUrl??t,embedUrl:e.embedUrl,inLanguage:e.inLanguage,keywords:Array.isArray(e.keywords)?e.keywords.join(", "):e.keywords,transcript:e.transcript,publisher:e.publisher?ae(e.publisher):void 0,author:e.author?ae(e.author):void 0,hasPart:e.chapters?.map(s=>Be(s,e.seekToActionUrlTemplate)),potentialAction:e.seekToActionUrlTemplate?{"@type":"SeekToAction",target:e.seekToActionUrlTemplate,"startOffset-input":"required name=seek_to_second_number"}:void 0,...e.extraSchema};typeof e.userInteractionCount=="number"&&(n.interactionStatistic={"@type":"InteractionCounter",interactionType:{"@type":"WatchAction"},userInteractionCount:e.userInteractionCount});const i=$(n);return r.seoWarnings!==!1&&(D(e),_e({thumbnailUrl:i.thumbnailUrl,contentUrl:i.contentUrl,embedUrl:i.embedUrl})),i}function ie(e){return JSON.stringify(e).replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/&/g,"\\u0026").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}function se(e){return X(e)}function $e(e){return Array.isArray(e)?e:[e]}function ae(e){return $({"@type":e.type??"Organization",name:e.name,url:e.url,logo:e.logo})}function Be(e,t){return $({"@type":"Clip",name:e.name,startOffset:e.startOffset,endOffset:e.endOffset,url:e.url??He(t,e.startOffset)})}function He(e,t){return e?.replace("{seek_to_second_number}",String(t))}function je(e){return e instanceof Date?Number.isFinite(e.getTime())?e.toISOString():void 0:e}function Ke(e){if(typeof e=="string")return e;const t=Math.max(0,Math.floor(e)),r=Math.floor(t/3600),n=Math.floor(t%3600/60),i=t%60;return`PT${r?`${r}H`:""}${n?`${n}M`:""}${i||!r&&!n?`${i}S`:""}`}function $(e){return Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0))}const ze=new Set(["http:","https:","mailto:","tel:"]),oe=new Set;function L(e,t){if(e!==void 0){if(qe(e))return e;Ge(t,e)}}function B(e,t){if(e?.trim().toLowerCase()!=="_blank")return t;const r=new Set(t?.split(/\s+/).filter(Boolean));return r.add("noreferrer"),r.add("noopener"),[...r].join(" ")}function qe(e){if(!e||e.trim()!==e||/[\u0000-\u001F\u007F]/.test(e))return!1;const t=e.match(/^([a-zA-Z][a-zA-Z\d+.-]*):/);return t?ze.has(t[1].toLowerCase()+":"):!0}function Ge(e,t){if(typeof console>"u"||typeof console.warn!="function")return;const r=`${e}:${t}`;oe.has(r)||(oe.add(r),console.warn(`[FuPlayer] ${e} href uses an unsafe URL protocol. Received: ${t}`))}function H(e){return{share:"M18 16.1c-.76 0-1.45.3-1.96.77L8.91 12.7c.05-.23.09-.46.09-.7s-.04-.47-.09-.7l7.05-4.11A2.99 2.99 0 1 0 15 5c0 .24.04.47.09.7L8.04 9.81A3 3 0 1 0 8.04 14l7.12 4.18c-.04.2-.06.41-.06.62a2.9 2.9 0 1 0 2.9-2.7Z",play:"M8 5v14l11-7z",pause:"M7 5h4v14H7V5Zm6 0h4v14h-4V5Z",volume:"M4 9v6h4l5 4V5L8 9H4Zm12.5 3a4.5 4.5 0 0 0-2.1-3.8v7.6a4.5 4.5 0 0 0 2.1-3.8Zm-2.1-7.3v2.1a6.5 6.5 0 0 1 0 10.4v2.1a8.5 8.5 0 0 0 0-14.6Z",muted:"M4 9v6h4l5 4V5L8 9H4Zm13.6 3 2.4-2.4-1.4-1.4-2.4 2.4-2.4-2.4-1.4 1.4 2.4 2.4-2.4 2.4 1.4 1.4 2.4-2.4 2.4 2.4 1.4-1.4L17.6 12Z",fullscreen:"M5 5h6v2H7v4H5V5Zm12 2h-4V5h6v6h-2V7ZM7 17h4v2H5v-6h2v4Zm10-4h2v6h-6v-2h4v-4Z",fullscreenExit:"M9 9H5V7h6v6H9V9Zm6 0v4h-2V7h6v2h-4ZM9 15v-4h2v6H5v-2h4Zm6 0h4v2h-6v-6h2v4Z",phone:"M6.6 10.8c1.4 2.8 3.8 5.1 6.6 6.6l2.2-2.2c.3-.3.8-.4 1.2-.3 1.3.4 2.6.6 4 .6.7 0 1.2.5 1.2 1.2v3.6c0 .7-.5 1.2-1.2 1.2C10.6 22 2 13.4 2 2.8 2 2.1 2.5 1.6 3.2 1.6h3.6c.7 0 1.2.5 1.2 1.2 0 1.4.2 2.8.6 4 .1.4 0 .9-.3 1.2l-1.7 2.8Z",email:"M4 5h16a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V7a2 2 0 0 1 2-2Zm8 7.3L4.4 7H4v.8l8 5.6 8-5.6V7h-.4L12 12.3Z",whatsapp:"M12 4a7.8 7.8 0 0 0-6.7 11.8L4 20l4.3-1.1A7.8 7.8 0 1 0 12 4Zm0 2a5.8 5.8 0 1 1 0 11.6 6 6 0 0 1-3-.8l-.4-.2-1.7.4.5-1.6-.3-.4A5.8 5.8 0 0 1 12 6Zm-2.2 3.1c-.2 0-.5.1-.7.4-.2.3-.8.8-.8 2 0 1.1.8 2.2.9 2.3.1.2 1.6 2.5 4 3.4 2 .8 2.4.5 2.8.5.4-.1 1.3-.6 1.5-1.1.2-.5.2-1 .1-1.1-.1-.1-.2-.2-.5-.3l-1.6-.8c-.2-.1-.4-.1-.6.1l-.7.9c-.1.2-.3.2-.5.1a5.1 5.1 0 0 1-2.6-2.2c-.2-.3 0-.4.1-.6l.4-.4c.1-.2.2-.3.3-.5.1-.2 0-.4 0-.5l-.7-1.7c-.2-.4-.4-.5-.7-.5h-.7Z",copy:"M10.6 13.4a1 1 0 0 0 1.4 0l4.1-4.1a3 3 0 1 0-4.2-4.2l-1.2 1.2a1 1 0 0 0 1.4 1.4l1.2-1.2a1 1 0 1 1 1.4 1.4l-4.1 4.1a1 1 0 0 0 0 1.4Zm2.8-2.8a1 1 0 0 0-1.4 0l-4.1 4.1a3 3 0 1 0 4.2 4.2l1.2-1.2a1 1 0 0 0-1.4-1.4l-1.2 1.2a1 1 0 1 1-1.4-1.4l4.1-4.1a1 1 0 0 0 0-1.4Z"}[e]}function Ze(e,t){t.forEach((r,n)=>{e.children[n]!==r&&e.insertBefore(r,e.children[n]??null)}),Array.from(e.children).forEach(r=>{t.includes(r)||r.remove()})}function v(e,t){if(t){if(typeof t=="string"){t.split(/\s+/).filter(Boolean).forEach(r=>e.classList.add(r));return}if(Array.isArray(t)){t.forEach(r=>v(e,r));return}typeof t=="object"&&Object.entries(t).forEach(([r,n])=>{n&&e.classList.add(r)})}}function O(e,t){t&&Object.entries(t).forEach(([r,n])=>{if(n!=null){if(r.startsWith("--")||r.includes("-")){e.style.setProperty(r,String(n));return}e.style.setProperty(Je(r),String(n))}})}function le(e,t,r=new Set){t&&Object.entries(t).forEach(([n,i])=>{if(!(r.has(n)||n.startsWith("on"))){if(i===!1||i===null||i===void 0){e.removeAttribute(n);return}e.setAttribute(n,i===!0?"":String(i))}})}function y(e,t,r){if(r===!1||r===null||r===void 0||r===""){e.removeAttribute(t);return}e.setAttribute(t,r===!0?"":String(r))}function We(e,t){const r=new Set(["alt","children","class","decoding","height","loading","src","width"]);Object.entries(t??{}).forEach(([n,i])=>{r.has(n)||i===void 0||i===null||n.startsWith("on")||e.setAttribute(n,String(i))})}function S(e){return x(H(e))}function x(e){const t=document.createElementNS("http://www.w3.org/2000/svg","svg");t.setAttribute("viewBox","0 0 24 24"),t.setAttribute("aria-hidden","true"),t.setAttribute("focusable","false");const r=document.createElementNS("http://www.w3.org/2000/svg","path");return r.setAttribute("d",e),t.appendChild(r),t}function Je(e){return e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}const ce=["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],_=new Set,F=new Set;let V=!1,U=!1;function ue(){const e=document;return e.fullscreenElement??e.webkitFullscreenElement??e.mozFullScreenElement??e.msFullscreenElement??null}function Qe(e){const t=e;return(t.requestFullscreen??t.webkitRequestFullscreen??t.webkitRequestFullScreen??t.mozRequestFullScreen??t.msRequestFullscreen)?.call(t)}function Xe(){const e=document;return(e.exitFullscreen??e.webkitExitFullscreen??e.webkitCancelFullScreen??e.mozCancelFullScreen??e.msExitFullscreen)?.call(e)}function Ye(e){return _.add(e),tt(),e(),()=>{_.delete(e),_.size||rt()}}function et(e){return F.add(e),nt(),()=>{F.delete(e),F.size||it()}}function tt(){V||(ce.forEach(e=>{document.addEventListener(e,de)}),V=!0)}function rt(){V&&(ce.forEach(e=>{document.removeEventListener(e,de)}),V=!1)}function de(){_.forEach(e=>{e()})}function nt(){U||(document.addEventListener("keydown",he),U=!0)}function it(){U&&(document.removeEventListener("keydown",he),U=!1)}function he(e){F.forEach(t=>{t(e)})}function st(e,t){if(t)for(const r of e){const n=lt(r);if(!n)continue;const i=t[n];if(i)return{adapterKey:n,adapter:i,source:r}}}function pe(e){if(typeof e=="function")return e;if(e?.destroy)return()=>e.destroy?.();if(e?.dispose)return()=>e.dispose?.()}function at(e){return e.map((t,r)=>({track:t,index:r})).filter(({track:t})=>me(t.kind)).map(({track:t,index:r})=>({key:`track-${r}`,label:ct(t,r),trackIndex:r,default:t.default}))}function me(e){return e==="subtitles"||e==="captions"}function ot(e){return e?e.message?e.message:{1:"Video loading was aborted.",2:"Video failed because of a network error.",3:"Video decoding failed.",4:"Video source is not supported."}[e.code]??"Video failed to load.":"Video failed to load."}function fe(e,t){return e instanceof Error&&e.message?e.message:typeof e=="string"&&e?e:t}function E(e){const t=Number.isFinite(e)?Math.max(0,Math.floor(e)):0,r=Math.floor(t/60),n=t%60;return`${String(r).padStart(2,"0")}:${String(n).padStart(2,"0")}`}function lt(e){if(e.adapter==="native")return;if(e.adapter)return e.adapter;const t=e.type?.toLowerCase(),r=e.src.toLowerCase();if(t==="application/vnd.apple.mpegurl"||t==="application/x-mpegurl"||r.includes(".m3u8"))return"hls";if(t==="application/dash+xml"||r.includes(".mpd"))return"dash"}function ct(e,t){return e.label??e.srcLang?.toUpperCase()??`${e.kind} ${t+1}`}const j="off",ut="16 / 9",dt="Video",ht="Video",pt="1970-01-01",K={aspectRatio:ut,seoMode:"indexable",lazy:!0,rootMargin:"240px 0px",tracks:[],quickActions:[],nativeControls:!1,preload:"metadata",playsInline:!0,controls:!0,pauseOtherPlayers:!1};function mt(e,t={}){return typeof e=="string"?{...t,src:e}:Array.isArray(e)?{...t,sources:e}:{...t,...e}}function M(...e){return e.reduce((t,r)=>r?ge(t,r):t,{})}function ye(e,t){const{aliases:r,playerOptions:n}=yt(e),{display:i,...s}=n,a={...i??{},...s},o=gt(e,t),l=bt(e,t),h=vt(r,e.seo,e.geo,t,o,l),p=St(r,a.geo,t,h),c=Et(p),d=a.renderJsonLd??t?.renderJsonLd??(Object.hasOwn(e,"seo")&&e.seo!==void 0),u=Object.hasOwn(a,"renderGeoText"),T=u||!!t?.renderGeoTextExplicit,w=u?!!a.renderGeoText:t?.renderGeoTextExplicit?t.renderGeoText:c;return{...ft(),...t,...a,sources:o,poster:l,seo:h,geo:p,renderJsonLd:d,renderGeoText:w,renderGeoTextExplicit:T}}function ft(){return{...K,tracks:[...K.tracks],quickActions:[...K.quickActions]}}function ge(e,t){const r={...e};return Object.entries(t).forEach(([n,i])=>{if(i===void 0)return;const s=r[n];r[n]=be(s)&&be(i)?ge(s,i):i}),r}function be(e){return Object.prototype.toString.call(e)==="[object Object]"}function yt(e){const{title:t,description:r,thumbnailUrl:n,uploadDate:i,duration:s,contentUrl:a,embedUrl:o,summary:l,keyTakeaways:h,transcript:p,chapters:c,type:d,media:u,adapter:T,...w}=e;return{aliases:{title:t,description:r,thumbnailUrl:n,uploadDate:i,duration:s,contentUrl:a,embedUrl:o,summary:l,keyTakeaways:h,transcript:p,chapters:c,type:d,media:u,adapter:T},playerOptions:w}}function gt(e,t){if(Object.hasOwn(e,"sources"))return e.sources??[];if(Object.hasOwn(e,"src")||Object.hasOwn(e,"type")||Object.hasOwn(e,"media")||Object.hasOwn(e,"adapter")){const r=t?.sources[0],n=Object.hasOwn(e,"src")?e.src:r?.src;return n?[{src:n,type:Object.hasOwn(e,"type")?e.type:r?.type,media:Object.hasOwn(e,"media")?e.media:r?.media,adapter:Object.hasOwn(e,"adapter")?e.adapter:r?.adapter}]:[]}return t?.sources??[]}function bt(e,t){return Object.hasOwn(e,"poster")?e.poster??"":t?.poster??""}function vt(e,t,r,n,i,s){const a=n?.seo,o=i[0]?.src,l=e.title??t?.name??a?.name??dt,h=e.description??t?.description??a?.description??ht,p=e.thumbnailUrl??t?.thumbnailUrl??a?.thumbnailUrl??s,c=e.contentUrl!==void 0||t?.contentUrl!==void 0||o!==n?.sources[0]?.src;return{...a,...t,name:l,description:h,thumbnailUrl:p,uploadDate:e.uploadDate??t?.uploadDate??a?.uploadDate??pt,duration:e.duration??t?.duration??a?.duration??0,contentUrl:e.contentUrl??t?.contentUrl??(c?o:a?.contentUrl??o),embedUrl:e.embedUrl??t?.embedUrl??a?.embedUrl??Ct(),transcript:e.transcript??t?.transcript??r?.transcript??a?.transcript,chapters:e.chapters??t?.chapters??r?.chapters??a?.chapters}}function St(e,t,r,n){return{...r?.geo,...t,summary:e.summary??t?.summary??r?.geo?.summary,keyTakeaways:e.keyTakeaways??t?.keyTakeaways??r?.geo?.keyTakeaways,transcript:e.transcript??t?.transcript??n.transcript??r?.geo?.transcript,chapters:e.chapters??t?.chapters??n.chapters??r?.geo?.chapters}}function Et(e){return!!(e.summary?.trim()||e.transcript?.trim()||e.keyTakeaways?.some(t=>t.trim())||e.chapters?.length)}function Ct(){return typeof window<"u"?window.location.href:void 0}function kt(e){if(typeof e!="string")return e;const t=document.querySelector(e);if(!t)throw new Error(`FuPlayer target was not found: ${e}`);return t}function ve(e){e.preventDefault()}const Tt=["whatsapp","linkedin","x","facebook","copy"],wt="_blank",Se="noreferrer noopener";function z(e){return e==="phone"||e==="email"||e==="whatsapp"}function Pt(e,t){const r=L(e.href,`rightMenu.actions[${t}].href`),n=q(e.target,r);if(!(!r&&!e.onClick))return{...e,href:r,target:n,rel:B(n,e.rel)}}function At(e){return!!e}function Lt(e,t,r){return e||(typeof window<"u"&&window.location.href?window.location.href:t.embedUrl??t.contentUrl??r??"")}function Ot(e,t,r){if(typeof e=="string")return Ee(e,void 0,t,r);if(xt(e))return Ee(e.preset,e,t,r);const n=typeof e.href=="function"?e.href(r):e.href,i=L(n,`share.targets.${e.id}.href`),s=q(e.target,i);return{id:e.id,target:e.id,label:e.label,ariaLabel:e.ariaLabel,href:i,icon:e.icon,iconPath:e.iconPath,className:e.className,iconClassName:e.iconClassName,targetWindow:s,rel:B(s,e.rel??(i?Se:void 0)),onClick:e.onClick}}function Ee(e,t,r,n){const i=t?.href!==void 0?_t(t.href,n):Ft(e,n),s=L(i,`share.targets.${t?.id??e}.href`),a=q(t?.target,s);return{id:t?.id??e,target:t?.id??e,builtInTarget:e,label:t?.label??Mt(e,r),ariaLabel:t?.ariaLabel,href:s,icon:t?.icon,iconPath:t?.iconPath,className:t?.className,iconClassName:t?.iconClassName,targetWindow:a,rel:B(a,t?.rel??(s?Se:void 0)),onClick:t?.onClick}}function xt(e){return typeof e=="object"&&"preset"in e}function _t(e,t){return typeof e=="function"?e(t):e}function Ft(e,t){return e==="copy"?void 0:Rt(e,t.url,t.title,t.text)}async function Vt(e){if(typeof navigator<"u"&&navigator.clipboard?.writeText)try{return await navigator.clipboard.writeText(e),!0}catch{}const t=document.createElement("textarea");t.value=e,t.setAttribute("readonly",""),t.style.position="fixed",t.style.top="-9999px",document.body.appendChild(t),t.select();try{return document.execCommand("copy")}finally{document.body.removeChild(t)}}function Ut(e){return e==="linkedin"?"in":e==="facebook"?"f":"X"}function Mt(e,t){return e==="copy"?t?.copyLabel??"Copy link":{whatsapp:"WhatsApp",linkedin:"LinkedIn",x:"X",facebook:"Facebook"}[e]}function Rt(e,t,r,n){const i=encodeURIComponent(t),s=encodeURIComponent(r),a=encodeURIComponent(n);return{whatsapp:`https://wa.me/?text=${encodeURIComponent(`${r} ${t}`.trim())}`,linkedin:`https://www.linkedin.com/sharing/share-offsite/?url=${i}`,x:`https://twitter.com/intent/tweet?url=${i}&text=${s}`,facebook:`https://www.facebook.com/sharer/sharer.php?u=${i}&quote=${a}`}[e]}function q(e,t){if(t)return e?.trim()||wt}function It({actions:e,ariaLabel:t}){if(!e.length)return;const r=document.createElement("div");return r.className="fu-player__quick-actions",r.setAttribute("aria-label",t),e.forEach(n=>{const i=n.href,s=i?document.createElement("a"):document.createElement("button");v(s,qt(n)),O(s,n.style),s.setAttribute("aria-label",n.ariaLabel??n.label??Ce(n.kind)),s instanceof HTMLAnchorElement?(s.href=i??"",y(s,"target",n.target),y(s,"rel",n.rel)):s.type="button",s.addEventListener("click",o=>{n.onClick?.(o,n)});const a=Gt(n);if(a){const o=x(a);O(o,n.iconStyle),s.appendChild(o)}else{const o=document.createElement("span");o.className="fu-player__quick-action-mark",o.setAttribute("aria-hidden","true"),O(o,n.iconStyle),o.textContent=n.icon??Ce(n.kind).slice(0,2),s.appendChild(o)}r.appendChild(s)}),r}function Dt(e){if(!e.shouldRenderBottomControls)return{};const t=document.createElement("div");t.className="fu-player__chrome";const r=Nt(e);t.appendChild(r);const n=document.createElement("div");n.className="fu-player__control-row";const i=$t(e),s=Bt(e);return n.appendChild(i.element),n.appendChild(s),t.appendChild(n),{element:t,progressInput:r,timeElement:i.timeElement}}function Nt(e){const t=document.createElement("input");return t.className="fu-player__progress",t.type="range",t.min="0",t.max=String(e.videoMax),t.step="0.1",t.value=String(Math.min(e.currentTime,e.visibleDuration||e.currentTime)),t.style.setProperty("--fu-player-progress",`${Math.min(e.progressPercent,100)}%`),t.setAttribute("aria-label","Video progress"),t.disabled=!e.shouldExposeVideoElement&&!e.visibleDuration,t.addEventListener("input",e.onProgressChange),t.addEventListener("change",e.onProgressChange),t}function $t(e){const t=document.createElement("div");t.className="fu-player__control-left";const r=document.createElement("button");r.className="fu-player__control-button",r.type="button",r.setAttribute("aria-label",e.isPlaying?"Pause video":"Play video"),r.appendChild(S(e.isPlaying?"pause":"play")),r.addEventListener("click",e.onTogglePlayback),t.appendChild(r);const n=document.createElement("span");return n.className="fu-player__time",n.textContent=`${E(e.currentTime)} / ${E(e.visibleDuration)}`,t.appendChild(n),{element:t,timeElement:n}}function Bt(e){const t=document.createElement("div");t.className="fu-player__control-right";const r=Ht(e);r&&t.appendChild(r);const n=jt(e);n&&t.appendChild(n);const i=document.createElement("button");i.className="fu-player__control-button",i.type="button",i.setAttribute("aria-label",e.isMuted?"Unmute video":"Mute video"),i.appendChild(S(e.isMuted||e.volume===0?"muted":"volume")),i.addEventListener("click",e.onToggleMute),t.appendChild(i);const s=document.createElement("input");s.className="fu-player__volume",s.type="range",s.min="0",s.max="1",s.step="0.05",s.value=String(e.isMuted?0:e.volume),s.setAttribute("aria-label","Video volume"),s.addEventListener("input",e.onVolumeChange),s.addEventListener("change",e.onVolumeChange),t.appendChild(s);const a=document.createElement("button");return a.className="fu-player__control-button",a.type="button",a.setAttribute("aria-label",e.isFullscreenActive?"Exit fullscreen":"Enter fullscreen"),a.appendChild(S(e.isFullscreenActive?"fullscreenExit":"fullscreen")),a.addEventListener("click",e.onToggleFullscreen),t.appendChild(a),t}function Ht(e){if(e.textTrackOptions.length<=1)return;const t=document.createElement("label");t.className="fu-player__subtitle";const r=document.createElement("span");r.className="fu-player__visually-hidden",r.textContent=e.subtitleMenuLabel??"Subtitles",t.appendChild(r);const n=document.createElement("select");return n.className="fu-player__subtitle-select",n.value=e.selectedTextTrackKey,n.setAttribute("aria-label",e.subtitleMenuLabel??"Subtitles"),n.addEventListener("change",e.onTextTrackChange),e.textTrackOptions.forEach(i=>{const s=document.createElement("option");s.value=i.key,s.textContent=i.label,s.selected=i.key===e.selectedTextTrackKey,n.appendChild(s)}),t.appendChild(n),t}function jt(e){if(!e.isShareEnabled)return;const t=document.createElement("div");t.className="fu-player__share";const r=document.createElement("button");if(v(r,["fu-player__share-trigger",e.shareButtonClassName]),r.type="button",r.setAttribute("aria-label",e.shareButtonLabel??"Share video"),r.setAttribute("aria-expanded",String(e.isShareOpen)),r.appendChild(zt(e)),r.addEventListener("click",e.onToggleShare),t.appendChild(r),e.isShareOpen){const n=document.createElement("div");v(n,["fu-player__share-menu",e.shareMenuClassName]),n.setAttribute("role","menu"),n.setAttribute("aria-label",e.shareMenuLabel??"Share video"),e.shareOptions.forEach(i=>{n.appendChild(Kt(i,e))}),t.appendChild(n)}return t}function Kt(e,t){const r=Zt(e),n=r?document.createElement("button"):document.createElement("a");if(v(n,["fu-player__share-option",e.className]),n.setAttribute("role","menuitem"),n.setAttribute("aria-label",e.ariaLabel??e.label),r){const o=n;o.type="button",o.disabled=Wt(e,t.shareUrl)}else{const o=n;y(o,"href",e.href),y(o,"target",e.targetWindow),y(o,"rel",e.rel)}n.addEventListener("click",o=>{t.onShareOptionClick(e,o)});const i=document.createElement("span");v(i,Jt(e)),i.setAttribute("aria-hidden","true");const s=Qt(e);s?i.appendChild(x(s)):i.textContent=Xt(e),n.appendChild(i);const a=document.createElement("span");return a.className="fu-player__share-label",a.textContent=e.builtInTarget==="copy"&&t.copyState==="copied"?t.copiedLabel??"Copied":e.label,n.appendChild(a),n}function zt(e){if(e.shareButtonIconPath)return x(e.shareButtonIconPath);if(e.shareButtonIcon){const t=document.createElement("span");return t.className="fu-player__share-trigger-mark",t.setAttribute("aria-hidden","true"),t.textContent=e.shareButtonIcon,t}return S("share")}function qt(e){return["fu-player__quick-action",z(e.kind)?`fu-player__quick-action--${e.kind}`:"fu-player__quick-action--custom",e.className]}function Gt(e){if(e.iconPath)return e.iconPath;if(!e.icon)return z(e.kind)?H(e.kind):void 0}function Ce(e){const t={phone:"Call",email:"Email",whatsapp:"WhatsApp"};return z(e)?t[e]:e}function Zt(e){return e.builtInTarget==="copy"||!e.href}function Wt(e,t){return e.builtInTarget==="copy"?!t:!e.href&&!e.onClick}function Jt(e){return["fu-player__share-icon",e.builtInTarget?`fu-player__share-icon--${e.builtInTarget}`:"fu-player__share-icon--custom",e.iconClassName]}function Qt(e){if(e.iconPath)return e.iconPath;if(!e.icon&&(e.builtInTarget==="copy"||e.builtInTarget==="whatsapp"))return H(e.builtInTarget)}function Xt(e){return e.icon?e.icon:e.builtInTarget&&e.builtInTarget!=="copy"&&e.builtInTarget!=="whatsapp"?Ut(e.builtInTarget):e.label.slice(0,2)}function Yt({root:e,lazy:t,rootMargin:r,onNearViewport:n}){if(!t){n("disabled");return}if(typeof window>"u"||!("IntersectionObserver"in window)){n("unsupported");return}const i=new IntersectionObserver(s=>{s.some(a=>a.isIntersecting||a.intersectionRatio>0)&&(i.disconnect(),n("intersecting"))},{rootMargin:r});return i.observe(e),i}class er{currentState="idle";currentError;currentlyPlaying=!1;get state(){return this.currentState}get error(){return this.currentError}get isPlaying(){return this.currentlyPlaying}resetForAutoPlay(t){this.currentlyPlaying=t,this.currentError=void 0,this.currentState=t?"loading":"idle"}requestPlayback(){this.currentError=void 0,this.currentState==="error"&&(this.currentState="loading")}markLoading(){this.currentError=void 0,this.currentState="loading"}markReadyFromVideo(t){this.currentState!=="error"&&(this.currentError=void 0,this.currentState=t.paused?"ready":"playing")}markAdapterReady(t){this.currentError=void 0,this.currentState=t}markPlaying(){this.currentlyPlaying=!0,this.currentError=void 0,this.currentState="playing"}markPaused(){this.currentlyPlaying=!1,this.currentState!=="error"&&(this.currentState="paused")}markEnded(){this.currentlyPlaying=!1,this.currentState="ended"}markWaiting(){this.currentState!=="error"&&(this.currentState="buffering")}markStalled(t){this.currentState!=="error"&&(t||this.currentlyPlaying)&&(this.currentState="buffering")}reportError(t){this.currentError=t,this.currentState="error"}}function tr(e,t){return{type:"playback",message:fe(e,"Video playback failed."),source:t,error:e}}function rr(e,t,r){return{type:"media",message:ot(e.error),source:t,event:r,mediaError:e.error}}class nr{cleanup;runId=0;signature="";resetSignature(){this.signature=""}cancelPending(){this.runId+=1}dispose(){if(!this.cleanup)return;const t=this.cleanup;this.cleanup=void 0;try{t()}catch{}}destroy(){this.cancelPending(),this.resetSignature(),this.dispose()}async setup(t){const{video:r,binding:n,sources:i,shouldExposeVideoElement:s}=t,a=ir(r,n,s);if(a===this.signature)return;this.signature=a;const o=++this.runId;if(this.dispose(),!r||!s||!n){sr(r,n,i);return}t.onLoading();try{const l=await n.adapter({video:r,source:n.source,sources:i,adapter:n.adapterKey});if(o!==this.runId){pe(l)?.();return}this.cleanup=pe(l),r.readyState>=2&&t.onReady(r.paused?"ready":"playing")}catch(l){if(o!==this.runId)return;t.onError({message:fe(l,"Video source adapter failed."),source:n.source,error:l})}}}function ir(e,t,r){return e&&r&&t?`${t.adapterKey}:${t.source.src}:${t.source.type??""}:${t.source.media??""}:${t.source.adapter??""}`:""}function sr(e,t,r){e&&!t&&e.hasAttribute("src")&&r.length&&(e.removeAttribute("src"),e.load())}const G=new Set;class ke{root;container;options;scriptElement;videoElement=null;mediaChildrenSignature="";hasRequestedPlayback=!1;isNearViewport=!1;currentTime=0;durationSeconds=0;isMuted=!1;volume=1;selectedTextTrackKey=j;isFullscreen=!1;isPseudoFullscreen=!1;previousBodyOverflow;isShareOpen=!1;copyState="idle";copyResetTimer;lazyObserver;playbackStateRuntime=new er;sourceAdapterRuntime=new nr;unsubscribeFullscreenState;unsubscribeFullscreenKeyDown;removeShareListeners;videoListenerRemovers=[];progressInputElement;timeElement;schemaJson="";schemaDurationSecondsValue=0;destroyed=!1;constructor(t,r){this.container=kt(t),this.options=ye(r),this.root=document.createElement("div"),this.isNearViewport=!this.options.lazy,this.isMuted=this.effectiveMuted,this.playbackStateRuntime.resetForAutoPlay(this.effectiveAutoPlay),this.selectedTextTrackKey=this.getDefaultTextTrackKey(),this.refreshSeoCache(),this.root.addEventListener("contextmenu",ve),this.container.appendChild(this.root),G.add(this),this.unsubscribeFullscreenState=Ye(()=>this.updateFullscreenState()),this.render(),this.setupLazyObserver(),this.setupSourceAdapter(),this.effectiveAutoPlay&&(this.hasRequestedPlayback=!0,this.playVideo())}get video(){return this.videoElement}get isPlaying(){return this.playbackStateRuntime.isPlaying}get playbackState(){return this.playbackStateRuntime.state}get playbackError(){return this.playbackStateRuntime.error}update(t){if(this.destroyed)return;const r=Object.hasOwn(t,"muted")||Object.hasOwn(t,"autoPlay"),n=Object.hasOwn(t,"src")||Object.hasOwn(t,"sources")||Object.hasOwn(t,"type")||Object.hasOwn(t,"media")||Object.hasOwn(t,"adapter")||Object.hasOwn(t,"sourceAdapters");this.options=ye(t,this.options),r&&this.setMutedState(this.effectiveMuted),n&&(this.sourceAdapterRuntime.resetSignature(),this.mediaChildrenSignature=""),this.refreshSeoCache(),this.getTextTrackOptions().some(i=>i.key===this.selectedTextTrackKey)||(this.selectedTextTrackKey=this.getDefaultTextTrackKey()),(!this.shouldRenderBottomControls||!this.isShareEnabled)&&this.closeShareMenu(),this.render(),this.setupLazyObserver(),this.setupSourceAdapter(),this.syncTextTracks(),this.effectiveAutoPlay&&(this.hasRequestedPlayback=!0,this.playVideo())}async play(){this.hasRequestedPlayback=!0,this.playbackStateRuntime.requestPlayback(),this.render(),await this.playVideo()}pause(){this.videoElement?.pause()}destroy(){this.destroyed||(this.destroyed=!0,this.lazyObserver?.disconnect(),this.lazyObserver=void 0,this.sourceAdapterRuntime.destroy(),G.delete(this),this.destroyVideo(),this.closeShareMenu(),this.removeShareListeners?.(),this.removeShareListeners=void 0,this.clearCopyTimer(),this.unsubscribeFullscreenState?.(),this.unsubscribeFullscreenState=void 0,this.exitPseudoFullscreen(),this.root.removeEventListener("contextmenu",ve),this.root.remove())}get normalizedSources(){return this.options.sources}get effectiveAutoPlay(){return!!this.options.autoPlay}get effectiveLoop(){return!!this.options.loop}get effectiveMuted(){return this.effectiveAutoPlay||!!this.options.muted}get effectiveHideMenu(){return!!this.options.hideMenu}get effectiveHideControls(){return!!this.options.hideControls}get effectiveSeoWarnings(){return this.options.seoWarnings!==!1}get shouldPrepareVideo(){return this.effectiveAutoPlay||!this.options.lazy||this.isNearViewport||this.hasRequestedPlayback}get shouldExposeVideoElement(){return this.options.seoMode==="indexable"||this.shouldPrepareVideo}get visibleDuration(){return this.durationSeconds||this.schemaDurationSecondsValue}get videoMax(){return Math.max(this.visibleDuration,this.currentTime,0)}get shouldRenderCustomControls(){return!!(this.options.controls&&!this.options.nativeControls)}get shouldRenderBottomControls(){return this.shouldRenderCustomControls&&!this.effectiveHideControls}get statusOverlayKind(){return this.playbackState==="error"?"error":this.playbackState==="buffering"?"buffering":this.playbackState==="loading"&&(this.hasRequestedPlayback||this.effectiveAutoPlay)?"loading":""}get isFullscreenActive(){return this.isFullscreen||this.isPseudoFullscreen}get shareConfig(){return typeof this.options.share=="object"?this.options.share:void 0}get isShareEnabled(){return!this.effectiveHideMenu&&this.options.share!==!1&&this.shareConfig?.enabled!==!1}render(){if(this.destroyed)return;this.progressInputElement=void 0,this.timeElement=void 0,this.syncRootAttributes();const t=[],r=this.renderJsonLd(),n=this.renderMedia(),i=this.renderStatusOverlay(),s=this.renderCenterPlayButton(),a=this.renderQuickActions(),o=this.renderControls(),l=this.renderGeoText();r&&t.push(r),n&&t.push(n),i&&t.push(i),s&&t.push(s),a&&t.push(a),o&&t.push(o),l&&t.push(l),Ze(this.root,t),this.syncShareListeners()}syncRootAttributes(){this.root.className="",this.root.classList.add("fu-player"),this.isPseudoFullscreen&&this.root.classList.add("fu-player--fullscreen"),v(this.root,this.options.className),this.root.removeAttribute("style"),O(this.root,this.options.wrapperStyle),this.root.style.setProperty("--fu-player-aspect-ratio",this.options.aspectRatio),le(this.root,this.options.rootAttributes,new Set(["class","style"]))}renderJsonLd(){if(!this.options.renderJsonLd){this.scriptElement=void 0;return}return this.scriptElement||(this.scriptElement=document.createElement("script"),this.scriptElement.type="application/ld+json"),this.scriptElement.textContent=this.schemaJson,this.scriptElement}refreshSeoCache(){const t=ne(this.options.seo,this.normalizedSources[0]?.src,{seoWarnings:this.options.renderJsonLd&&this.effectiveSeoWarnings});this.schemaJson=ie(t),this.schemaDurationSecondsValue=se(t.duration)}renderMedia(){if(this.shouldExposeVideoElement){this.destroyPosterOnly();const t=this.ensureVideo();return this.syncVideoAttributes(t),this.syncVideoChildren(t),t}return this.destroyVideo(),this.createPosterButton()}ensureVideo(){if(this.videoElement)return this.videoElement;const t=document.createElement("video");return t.className="fu-player__media",this.videoElement=t,this.sourceAdapterRuntime.resetSignature(),this.addVideoListener("loadstart",this.handleLoadStart),this.addVideoListener("loadedmetadata",this.handleLoadedMetadata),this.addVideoListener("loadeddata",this.handleLoadedData),this.addVideoListener("canplay",this.handleCanPlay),this.addVideoListener("timeupdate",this.handleTimeUpdate),this.addVideoListener("play",this.handlePlay),this.addVideoListener("playing",this.handlePlaying),this.addVideoListener("pause",this.handlePause),this.addVideoListener("ended",this.handleEnded),this.addVideoListener("waiting",this.handleWaiting),this.addVideoListener("stalled",this.handleStalled),this.addVideoListener("error",this.handleError),this.addVideoListener("volumechange",this.handleVolumeChangeEvent),this.addVideoListener("webkitbeginfullscreen",()=>this.handleNativeVideoFullscreenChange(!0)),this.addVideoListener("webkitendfullscreen",()=>this.handleNativeVideoFullscreenChange(!1)),t}addVideoListener(t,r){this.videoElement&&(this.videoElement.addEventListener(t,r),this.videoListenerRemovers.push(()=>{this.videoElement?.removeEventListener(t,r)}))}syncVideoAttributes(t){le(t,this.options.videoAttributes,new Set(["class"])),t.className="fu-player__media",t.poster=this.options.poster,t.preload=this.options.preload,t.autoplay=!!(this.effectiveAutoPlay||this.hasRequestedPlayback),t.muted=this.isMuted,t.playsInline=this.options.playsInline,t.controls=!!(this.options.nativeControls&&this.options.controls&&!this.effectiveHideControls),t.loop=this.effectiveLoop,t.disablePictureInPicture=!!this.options.disablePictureInPicture,y(t,"crossorigin",this.options.crossOrigin),y(t,"controlslist",this.options.controlsList)}syncVideoChildren(t){const r=this.sourceAdapterBinding?[]:this.normalizedSources,n=JSON.stringify({sources:r,tracks:this.options.tracks,fallback:this.options.fallback??""});n!==this.mediaChildrenSignature&&(this.mediaChildrenSignature=n,t.replaceChildren(),r.forEach(i=>{const s=document.createElement("source");s.src=i.src,y(s,"type",i.type),y(s,"media",i.media),t.appendChild(s)}),this.options.tracks.forEach(i=>{const s=document.createElement("track");s.src=i.src,s.kind=i.kind,y(s,"srclang",i.srcLang),y(s,"label",i.label),i.default&&(s.default=!0),t.appendChild(s)}),this.options.fallback&&t.appendChild(document.createTextNode(this.options.fallback)))}createPosterButton(){const t=document.createElement("button");t.className="fu-player__poster",t.type="button",t.setAttribute("aria-label",this.options.playButtonLabel??`Play video: ${this.options.seo.name}`),t.addEventListener("click",()=>{this.play()});const r=document.createElement("img");r.className="fu-player__poster-image",r.loading="lazy",r.decoding="async",We(r,this.options.posterImageProps),r.src=this.options.poster,r.alt=this.options.posterAlt??this.options.seo.name,t.appendChild(r);const n=document.createElement("span");return n.className="fu-player__play",n.setAttribute("aria-hidden","true"),n.appendChild(S("play")),t.appendChild(n),t}renderStatusOverlay(){const t=this.statusOverlayKind;if(!t)return;const r=document.createElement("div");if(r.className=`fu-player__status fu-player__status--${t}`,r.setAttribute("role",t==="error"?"alert":"status"),r.setAttribute("aria-live",t==="error"?"assertive":"polite"),t!=="error"){const i=document.createElement("span");i.className="fu-player__status-spinner",i.setAttribute("aria-hidden","true"),r.appendChild(i)}const n=document.createElement("span");if(n.className="fu-player__status-message",n.textContent=this.getStatusOverlayText(),r.appendChild(n),t==="error"){const i=document.createElement("button");i.className="fu-player__status-retry",i.type="button",i.textContent=this.options.retryButtonLabel??"Retry",i.addEventListener("click",()=>{this.retryPlayback()}),r.appendChild(i)}return r}renderCenterPlayButton(){if(!this.shouldRenderCustomControls||!this.shouldExposeVideoElement||this.isPlaying||this.statusOverlayKind)return;const t=document.createElement("button");return t.className="fu-player__center-play",t.type="button",t.setAttribute("aria-label",this.options.playButtonLabel??`Play video: ${this.options.seo.name}`),t.appendChild(S("play")),t.addEventListener("click",()=>{this.togglePlayback()}),t}renderQuickActions(){return It({actions:this.getRightMenuActions(),ariaLabel:this.getRightMenuAriaLabel()})}renderControls(){const r=this.shouldRenderBottomControls&&this.isShareEnabled?this.getSharePayload():void 0,n=Dt({shouldRenderBottomControls:this.shouldRenderBottomControls,currentTime:this.currentTime,visibleDuration:this.visibleDuration,videoMax:this.videoMax,progressPercent:this.progressPercent,shouldExposeVideoElement:this.shouldExposeVideoElement,isPlaying:this.isPlaying,isMuted:this.isMuted,volume:this.volume,isFullscreenActive:this.isFullscreenActive,textTrackOptions:this.getTextTrackOptions(),selectedTextTrackKey:this.selectedTextTrackKey,subtitleMenuLabel:this.options.subtitleMenuLabel,isShareEnabled:this.isShareEnabled,shareButtonIcon:this.shareConfig?.buttonIcon,shareButtonIconPath:this.shareConfig?.buttonIconPath,shareButtonClassName:this.shareConfig?.buttonClassName,shareButtonLabel:this.shareConfig?.buttonLabel,isShareOpen:this.isShareOpen,shareMenuClassName:this.shareConfig?.menuClassName,shareMenuLabel:this.shareConfig?.menuLabel,shareOptions:r?this.getShareOptions(r):[],shareUrl:r?.url??"",copyState:this.copyState,copiedLabel:this.shareConfig?.copiedLabel,onProgressChange:this.handleProgressChange,onTogglePlayback:()=>{this.togglePlayback()},onVolumeChange:this.handleVolumeChange,onToggleMute:()=>this.toggleMute(),onTextTrackChange:this.handleTextTrackChange,onToggleShare:()=>{this.isShareOpen=!this.isShareOpen,this.render()},onShareOptionClick:(i,s)=>{this.handleShareOptionClick(i,s)},onToggleFullscreen:()=>this.toggleFullscreen()});return this.progressInputElement=n.progressInput,this.timeElement=n.timeElement,n.element}renderGeoText(){if(!this.options.renderGeoText||!this.hasGeoTextContent())return;const t=document.createElement("section");t.className="fu-player__geo fu-player__visually-hidden",t.setAttribute("aria-label","Video content details");const r=document.createElement("h2");if(r.textContent=this.options.seo.name,t.appendChild(r),this.options.seo.description){const n=document.createElement("p");n.textContent=this.options.seo.description,t.appendChild(n)}return this.appendGeoSummary(t),this.appendGeoKeyTakeaways(t),this.appendGeoChapters(t),this.appendGeoTranscript(t),t}appendGeoSummary(t){const r=this.options.geo?.summary?.trim();if(!r)return;const n=document.createElement("h3");n.textContent="Summary",t.appendChild(n);const i=document.createElement("p");i.textContent=r,t.appendChild(i)}appendGeoKeyTakeaways(t){const r=this.options.geo?.keyTakeaways?.filter(s=>s.trim());if(!r?.length)return;const n=document.createElement("h3");n.textContent="Key takeaways",t.appendChild(n);const i=document.createElement("ul");r.forEach(s=>{const a=document.createElement("li");a.textContent=s,i.appendChild(a)}),t.appendChild(i)}appendGeoChapters(t){const r=this.options.geo?.chapters;if(!r?.length)return;const n=document.createElement("h3");n.textContent="Chapters",t.appendChild(n);const i=document.createElement("ol");r.forEach((s,a)=>{const o=document.createElement("li"),l=this.formatChapterTimeRange(s.startOffset,s.endOffset),h=l?`${l} ${s.name}`:s.name,p=L(s.url,`geo.chapters[${a}].url`);if(p){const c=document.createElement("a");c.href=p,c.textContent=h,o.appendChild(c)}else o.textContent=h;i.appendChild(o)}),t.appendChild(i)}appendGeoTranscript(t){const r=this.options.geo?.transcript?.trim();if(!r)return;const n=document.createElement("h3");n.textContent="Transcript",t.appendChild(n);const i=document.createElement("p");i.textContent=r,t.appendChild(i)}hasGeoTextContent(){const t=this.options.geo;return!!(t?.summary?.trim()||t?.transcript?.trim()||t?.keyTakeaways?.some(r=>r.trim())||t?.chapters?.length)}formatChapterTimeRange(t,r){if(!Number.isFinite(t))return"";const n=E(t);return typeof r=="number"&&Number.isFinite(r)?`${n}-${E(r)}`:n}get progressPercent(){return this.visibleDuration>0?this.currentTime/this.visibleDuration*100:0}getStatusOverlayText(){return this.statusOverlayKind==="loading"?this.options.loadingLabel??"Loading video...":this.statusOverlayKind==="buffering"?this.options.bufferingLabel??"Buffering...":this.statusOverlayKind==="error"?this.options.errorLabel??this.playbackError?.message??"Video failed to load.":""}async retryPlayback(){this.hasRequestedPlayback=!0,this.playbackStateRuntime.markLoading(),this.sourceAdapterRuntime.resetSignature(),this.render(),this.sourceAdapterBinding?await this.setupSourceAdapter():this.videoElement?.load(),await this.playVideo()}async playVideo(){this.videoElement||this.render();const t=this.videoElement;if(t)try{await t.play()}catch(r){this.reportPlaybackError(tr(r,this.getCurrentSource()))}}async togglePlayback(){const t=this.videoElement;if(!t||t.paused||t.ended){await this.play();return}t.pause()}handleProgressChange=t=>{const r=Number(t.target.value);this.currentTime=r,this.videoElement&&(this.videoElement.currentTime=r),this.syncProgressDom()};handleVolumeChange=t=>{const r=Number(t.target.value);this.volume=r,this.isMuted=r===0,this.videoElement&&(this.videoElement.volume=r,this.videoElement.muted=r===0),this.render()};toggleMute(){const t=!this.isMuted;this.setMutedState(t),this.videoElement&&!t&&this.videoElement.volume===0&&(this.videoElement.volume=.8,this.volume=.8),this.render()}setMutedState(t){this.isMuted=t,this.videoElement&&(this.videoElement.muted=t)}handleTextTrackChange=t=>{this.selectedTextTrackKey=t.target.value,this.syncTextTracks(),this.render()};handleLoadStart=t=>{this.playbackStateRuntime.markLoading(),this.callVideoHandler("onLoadStart",t),this.render()};handleLoadedMetadata=t=>{const r=t.currentTarget,n=r.duration;this.durationSeconds=Number.isFinite(n)?n:0,this.volume=r.volume,this.callVideoHandler("onLoadedMetadata",t),this.render(),this.syncProgressDom()};handleLoadedData=t=>{this.setReadyState(t.currentTarget),this.callVideoHandler("onLoadedData",t),this.render()};handleCanPlay=t=>{this.setReadyState(t.currentTarget),this.callVideoHandler("onCanPlay",t),this.render()};handleTimeUpdate=t=>{this.currentTime=t.currentTarget.currentTime,this.callVideoHandler("onTimeUpdate",t),this.syncProgressDom()};handlePlay=t=>{this.playbackStateRuntime.markPlaying(),this.pausePeerPlayers(),this.callVideoHandler("onPlay",t),this.render()};handlePlaying=t=>{this.playbackStateRuntime.markPlaying(),this.callVideoHandler("onPlaying",t),this.render()};handlePause=t=>{this.playbackStateRuntime.markPaused(),this.callVideoHandler("onPause",t),this.render()};handleEnded=t=>{this.playbackStateRuntime.markEnded(),this.callVideoHandler("onEnded",t),this.render()};handleWaiting=t=>{this.playbackStateRuntime.markWaiting(),this.callVideoHandler("onWaiting",t),this.render()};handleStalled=t=>{this.playbackStateRuntime.markStalled(this.hasRequestedPlayback),this.callVideoHandler("onStalled",t),this.render()};handleError=t=>{const r=t.currentTarget;this.reportPlaybackError(rr(r,this.getCurrentSource(),t)),this.callVideoHandler("onError",t),this.render()};handleVolumeChangeEvent=t=>{const r=t.currentTarget;this.isMuted=r.muted,this.volume=r.volume,this.callVideoHandler("onVolumeChange",t),this.render()};setReadyState(t){this.playbackStateRuntime.markReadyFromVideo(t)}reportPlaybackError(t){this.playbackStateRuntime.reportError(t),this.options.onPlaybackError?.(t)}syncProgressDom(){this.progressInputElement&&(this.progressInputElement.max=String(this.videoMax),this.progressInputElement.value=String(Math.min(this.currentTime,this.visibleDuration||this.currentTime)),this.progressInputElement.style.setProperty("--fu-player-progress",`${Math.min(this.progressPercent,100)}%`),this.progressInputElement.disabled=!this.shouldExposeVideoElement&&!this.visibleDuration),this.timeElement&&(this.timeElement.textContent=`${E(this.currentTime)} / ${E(this.visibleDuration)}`)}pausePeerPlayers(){this.options.pauseOtherPlayers&&G.forEach(t=>{t!==this&&t.pause()})}getCurrentSource(){return this.sourceAdapterBinding?.source??this.normalizedSources[0]}callVideoHandler(t,r){const n=this.options[t];n?.(r)}get sourceAdapterBinding(){return st(this.normalizedSources,this.options.sourceAdapters)}async setupSourceAdapter(){await this.sourceAdapterRuntime.setup({video:this.videoElement,binding:this.sourceAdapterBinding,sources:this.normalizedSources,shouldExposeVideoElement:this.shouldExposeVideoElement,onLoading:()=>{this.playbackStateRuntime.markLoading(),this.render()},onReady:t=>{this.playbackStateRuntime.markAdapterReady(t),this.render()},onError:({message:t,source:r,error:n})=>{this.reportPlaybackError({type:"adapter",message:t,source:r,error:n}),this.render()}})}setupLazyObserver(){this.lazyObserver?.disconnect(),this.lazyObserver=Yt({root:this.root,lazy:this.options.lazy,rootMargin:this.options.rootMargin,onNearViewport:t=>{this.isNearViewport=!0,t!=="disabled"&&(t==="intersecting"&&(this.lazyObserver=void 0),this.render(),this.setupSourceAdapter())}})}getTextTrackOptions(){return[{key:j,label:this.options.subtitlesOffLabel??"Subtitles off"},...at(this.options.tracks)]}getDefaultTextTrackKey(){return this.getTextTrackOptions().find(r=>r.default)?.key??j}syncTextTracks(){const t=this.videoElement;if(!t?.textTracks)return;const r=this.getTextTrackOptions().find(n=>n.key===this.selectedTextTrackKey)?.trackIndex;for(let n=0;n<t.textTracks.length;n+=1){const i=this.options.tracks[n];if(!(!i||!me(i.kind)))try{t.textTracks[n].mode=n===r?"showing":"disabled"}catch{}}}getRightMenuConfig(){const t=this.options.rightMenu!==void 0?this.options.rightMenu:this.options.quickActions;return t?Array.isArray(t)?{actions:t}:t:{actions:[]}}getRightMenuActions(){const t=this.getRightMenuConfig();return this.effectiveHideMenu||t.enabled===!1?[]:(t.actions??[]).map(Pt).filter(At)}getRightMenuAriaLabel(){return this.getRightMenuConfig().ariaLabel??"Quick actions"}getSharePayload(){return{url:Lt(this.shareConfig?.url,this.options.seo,this.normalizedSources[0]?.src),title:this.shareConfig?.title??this.options.seo.name,text:this.shareConfig?.text??this.options.seo.description}}getShareOptions(t=this.getSharePayload()){return(this.shareConfig?.targets??Tt).map(n=>Ot(n,this.shareConfig,t))}async handleShareOptionClick(t,r){if(t.onClick){await t.onClick(this.getSharePayload(),r),r.defaultPrevented||(this.closeShareMenu(),this.render());return}if(t.builtInTarget==="copy"){await this.handleCopyShareUrl(r);return}r.defaultPrevented||(this.closeShareMenu(),this.render())}async handleCopyShareUrl(t){t.preventDefault();const r=this.getSharePayload().url;if(!r)return;await Vt(r)&&(this.clearCopyTimer(),this.copyState="copied",this.copyResetTimer=window.setTimeout(()=>{this.copyResetTimer=void 0,this.copyState="idle",this.render()},1800),this.render())}clearCopyTimer(){this.copyResetTimer!==void 0&&(window.clearTimeout(this.copyResetTimer),this.copyResetTimer=void 0)}syncShareListeners(){if(this.removeShareListeners?.(),this.removeShareListeners=void 0,!this.isShareOpen){this.clearCopyTimer(),this.copyState="idle";return}const t=n=>{this.root&&n.target instanceof Node&&!this.root.querySelector(".fu-player__share")?.contains(n.target)&&(this.closeShareMenu(),this.render())},r=n=>{n.key==="Escape"&&(this.closeShareMenu(),this.render())};document.addEventListener("pointerdown",t),document.addEventListener("keydown",r),this.removeShareListeners=()=>{document.removeEventListener("pointerdown",t),document.removeEventListener("keydown",r)}}closeShareMenu(){this.isShareOpen=!1,this.removeShareListeners?.(),this.removeShareListeners=void 0,this.clearCopyTimer(),this.copyState="idle"}toggleFullscreen(){if(this.isPseudoFullscreen){this.exitPseudoFullscreen(),this.render();return}if(ue()){Promise.resolve(Xe()).then(()=>this.updateFullscreenState()).catch(()=>{});return}const t=Qe(this.root);if(t!==void 0){Promise.resolve(t).then(()=>this.updateFullscreenState()).catch(()=>{this.enterNativeVideoFullscreen()||this.enterPseudoFullscreen(),this.render()});return}this.enterNativeVideoFullscreen()||this.enterPseudoFullscreen(),this.render()}handleNativeVideoFullscreenChange(t){this.isFullscreen=t,this.render()}enterNativeVideoFullscreen(){const t=this.videoElement;try{if(t?.webkitEnterFullscreen)return t.webkitEnterFullscreen(),this.isFullscreen=!0,!0;if(t?.webkitEnterFullScreen)return t.webkitEnterFullScreen(),this.isFullscreen=!0,!0}catch{return!1}return!1}enterPseudoFullscreen(){this.isPseudoFullscreen||(this.previousBodyOverflow===void 0&&(this.previousBodyOverflow=document.body.style.overflow,document.body.style.overflow="hidden"),this.isPseudoFullscreen=!0,this.unsubscribeFullscreenKeyDown=et(t=>{t.key==="Escape"&&this.isPseudoFullscreen&&(this.exitPseudoFullscreen(),this.render())}))}exitPseudoFullscreen(){this.isPseudoFullscreen=!1,this.unsubscribeFullscreenKeyDown?.(),this.unsubscribeFullscreenKeyDown=void 0,this.previousBodyOverflow!==void 0&&(document.body.style.overflow=this.previousBodyOverflow,this.previousBodyOverflow=void 0)}updateFullscreenState(){const t=ue();this.isFullscreen=!!(t&&(t===this.root||this.root.contains(t)||t.contains(this.root))),this.render()}destroyVideo(){this.videoListenerRemovers.forEach(t=>t()),this.videoListenerRemovers=[],this.videoElement?.remove(),this.videoElement=null,this.mediaChildrenSignature="",this.sourceAdapterRuntime.destroy()}destroyPosterOnly(){this.root.querySelector(".fu-player__poster")?.remove()}}function ar(e,t,r){return new ke(e,mt(t,r))}function or(e){const t=lr(e),r=R(C(e.options));return r?M(t,r):M(t,Te(e.commonOptions),Te(e.personalizedOptions))}function lr(e){return R(C({sources:e.sources,tracks:e.tracks,chapters:e.chapters,seo:e.seo,geo:e.geo}))}function Te(e){if(!e)return;const t=C(e.player),r=R(C(e.display));return R(M(t,r?{display:r}:void 0))}function C(e){if(e==null)return;if(Array.isArray(e))return e.map(r=>C(r)).filter(r=>r!==void 0);if(!cr(e))return e;const t={};return Object.entries(e).forEach(([r,n])=>{const i=C(n);i!==void 0&&(t[r]=i)}),t}function R(e){if(!(!e||Object.keys(e).length===0))return e}function cr(e){return Object.prototype.toString.call(e)==="[object Object]"}function we(e,t={}){t.seoWarnings!==!1&&D(e);const r=t.title??e.name,n=dr(r,t.titleTemplate),i=t.description??e.description,s=t.canonicalUrl??e.embedUrl,a=t.image??Pe(e.thumbnailUrl),o=e.embedUrl??e.contentUrl,l=Z(t.publishedTime??e.uploadDate),h=Z(t.modifiedTime),p=mr(t.locale??e.inLanguage),c=t.twitterCard??"summary_large_image";t.seoWarnings!==!1&&Fe({canonicalUrl:s,image:a,videoUrl:o});const d=[{name:"description",content:i},m("name","robots",t.robots),{property:"og:type",content:t.ogType??"video.other"},{property:"og:title",content:n},{property:"og:description",content:i},m("property","og:url",s),m("property","og:image",a),m("property","og:site_name",t.siteName),m("property","og:locale",p),m("property","og:video",o),m("property","og:video:url",o),m("property","og:video:secure_url",fr(o)?o:void 0),m("property","video:release_date",l),m("property","article:published_time",l),m("property","article:modified_time",h),{name:"twitter:card",content:c},{name:"twitter:title",content:n},{name:"twitter:description",content:i},m("name","twitter:image",a),m("name","twitter:site",t.twitterSite),m("name","twitter:creator",t.twitterCreator),m("name","twitter:player",c==="player"?e.embedUrl:void 0),m("name","twitter:player:width",Ae(t.twitterPlayerWidth)),m("name","twitter:player:height",Ae(t.twitterPlayerHeight)),...t.extraMeta??[]].filter(hr),u=[...s?[{rel:"canonical",href:s}]:[],...t.extraLinks??[]];return{title:n,meta:gr(d),links:br(u)}}function ur(e,t={}){return['<?xml version="1.0" encoding="UTF-8"?>','<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:video="http://www.google.com/schemas/sitemap-video/1.1">',...e.map(n=>{const i=n.seo;t.seoWarnings!==!1&&D(i);const s=Pe(i.thumbnailUrl),a=n.contentUrl??i.contentUrl,o=n.playerUrl??i.embedUrl,l=yr(i.duration),h=Z(i.uploadDate),p=n.tags??pr(i.keywords);return t.seoWarnings!==!1&&Ve({loc:n.loc,thumbnailUrl:s,contentUrl:a,playerUrl:o}),[" <url>",` <loc>${g(n.loc)}</loc>`," <video:video>",` <video:thumbnail_loc>${g(s)}</video:thumbnail_loc>`,` <video:title>${g(i.name)}</video:title>`,` <video:description>${g(i.description)}</video:description>`,a?` <video:content_loc>${g(a)}</video:content_loc>`:"",o?` <video:player_loc>${g(o)}</video:player_loc>`:"",l?` <video:duration>${l}</video:duration>`:"",h?` <video:publication_date>${g(h)}</video:publication_date>`:"",...p.slice(0,32).map(c=>` <video:tag>${g(c)}</video:tag>`)," </video:video>"," </url>"].filter(Boolean).join(`
2
2
  `)}),"</urlset>"].join(`
3
- `)}function er(e,t){return t?t.includes("%s")?t.replace("%s",e):`${e}${t}`:e}function m(e,t,r){return r?{[e]:t,content:r}:void 0}function tr(e){return!!(e?.content&&(e.name||e.property))}function ve(e){return Array.isArray(e)?e[0]:e}function rr(e){return e?Array.isArray(e)?e:e.split(",").map(t=>t.trim()).filter(Boolean):[]}function H(e){if(e)return e instanceof Date?Number.isFinite(e.getTime())?e.toISOString():void 0:e}function Se(e){return typeof e=="number"?String(e):void 0}function nr(e){return e?.replace("-","_")}function ir(e){return!!e?.startsWith("https://")}function sr(e){const t=typeof e=="number"?e:W(e);return!Number.isFinite(t)||t<=0?0:Math.floor(t)}function ar(e){const t=new Map;return e.forEach(r=>{const n=r.name?`name:${r.name}`:`property:${r.property}`;t.set(n,r)}),[...t.values()]}function or(e){const t=new Map;return e.forEach(r=>{t.set(`${r.rel}:${r.hreflang??""}:${r.type??""}`,r)}),[...t.values()]}function g(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")}const Ee="data-fu-player-seo-head",K="data-fu-player-seo-head-id";let lr=0,V;const b=[];function cr(e,t={}){const r=`fu-player-seo-head-${++lr}`,n=`[${K}="${r}"]`;let i=e,s=t,a=!1;h();function o(c,u={}){a||(i=c,s=u,h())}function l(){a||(a=!0,p(),dr(r))}function h(){const c=be(i,s);ur(r,c.title),p(),c.meta.forEach(u=>{const d=document.createElement("meta");u.name&&d.setAttribute("name",u.name),u.property&&d.setAttribute("property",u.property),d.setAttribute("content",u.content),d.setAttribute(Ee,"true"),d.setAttribute(K,r),document.head.appendChild(d)}),c.links.forEach(u=>{const d=document.createElement("link");d.setAttribute("rel",u.rel),d.setAttribute("href",u.href),u.hreflang&&d.setAttribute("hreflang",u.hreflang),u.type&&d.setAttribute("type",u.type),d.setAttribute(Ee,"true"),d.setAttribute(K,r),document.head.appendChild(d)})}function p(){document.head.querySelectorAll(n).forEach(c=>{c.remove()})}return{update:o,destroy:l}}function ur(e,t){b.length===0&&(V=document.title);const r=b.find(n=>n.id===e);r?r.title=t:b.push({id:e,title:t}),Ce()}function dr(e){const t=b.findIndex(r=>r.id===e);if(t!==-1){if(b.splice(t,1),b.length===0){V!==void 0&&(document.title=V),V=void 0;return}Ce()}}function Ce(){const e=b[b.length-1];e&&(document.title=e.title)}f.FuPlayer=ge,f.applyFuPlayerSeoHead=cr,f.buildFuPlayerSeoHead=be,f.buildFuPlayerVideoSitemapXml=Yt,f.buildVideoObjectSchema=Y,f.createFuPlayer=Xt,f.parseDurationToSeconds=te,f.stringifyVideoObjectJsonLd=ee,f.validateFuPlayerSeo=ke,Object.defineProperty(f,Symbol.toStringTag,{value:"Module"})}));
3
+ `)}function dr(e,t){return t?t.includes("%s")?t.replace("%s",e):`${e}${t}`:e}function m(e,t,r){return r?{[e]:t,content:r}:void 0}function hr(e){return!!(e?.content&&(e.name||e.property))}function Pe(e){return Array.isArray(e)?e[0]:e}function pr(e){return e?Array.isArray(e)?e:e.split(",").map(t=>t.trim()).filter(Boolean):[]}function Z(e){if(e)return e instanceof Date?Number.isFinite(e.getTime())?e.toISOString():void 0:e}function Ae(e){return typeof e=="number"?String(e):void 0}function mr(e){return e?.replace("-","_")}function fr(e){return!!e?.startsWith("https://")}function yr(e){const t=typeof e=="number"?e:X(e);return!Number.isFinite(t)||t<=0?0:Math.floor(t)}function gr(e){const t=new Map;return e.forEach(r=>{const n=r.name?`name:${r.name}`:`property:${r.property}`;t.set(n,r)}),[...t.values()]}function br(e){const t=new Map;return e.forEach(r=>{t.set(`${r.rel}:${r.hreflang??""}:${r.type??""}`,r)}),[...t.values()]}function g(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")}const Le="data-fu-player-seo-head",W="data-fu-player-seo-head-id";let vr=0,I;const b=[];function Sr(e,t={}){const r=`fu-player-seo-head-${++vr}`,n=`[${W}="${r}"]`;let i=e,s=t,a=!1;h();function o(c,d={}){a||(i=c,s=d,h())}function l(){a||(a=!0,p(),Cr(r))}function h(){const c=we(i,s);Er(r,c.title),p(),c.meta.forEach(d=>{const u=document.createElement("meta");d.name&&u.setAttribute("name",d.name),d.property&&u.setAttribute("property",d.property),u.setAttribute("content",d.content),u.setAttribute(Le,"true"),u.setAttribute(W,r),document.head.appendChild(u)}),c.links.forEach(d=>{const u=document.createElement("link");u.setAttribute("rel",d.rel),u.setAttribute("href",d.href),d.hreflang&&u.setAttribute("hreflang",d.hreflang),d.type&&u.setAttribute("type",d.type),u.setAttribute(Le,"true"),u.setAttribute(W,r),document.head.appendChild(u)})}function p(){document.head.querySelectorAll(n).forEach(c=>{c.remove()})}return{update:o,destroy:l}}function Er(e,t){b.length===0&&(I=document.title);const r=b.find(n=>n.id===e);r?r.title=t:b.push({id:e,title:t}),Oe()}function Cr(e){const t=b.findIndex(r=>r.id===e);if(t!==-1){if(b.splice(t,1),b.length===0){I!==void 0&&(document.title=I),I=void 0;return}Oe()}}function Oe(){const e=b[b.length-1];e&&(document.title=e.title)}f.FuPlayer=ke,f.applyFuPlayerSeoHead=Sr,f.buildFuPlayerOptionsFromDto=or,f.buildFuPlayerSeoHead=we,f.buildFuPlayerVideoSitemapXml=ur,f.buildVideoObjectSchema=ne,f.createFuPlayer=ar,f.mergeFuPlayerOptions=M,f.parseDurationToSeconds=se,f.stringifyVideoObjectJsonLd=ie,f.validateFuPlayerSeo=xe,Object.defineProperty(f,Symbol.toStringTag,{value:"Module"})}));
@@ -201,6 +201,13 @@ export interface FuPlayerRightMenuConfig {
201
201
  actions?: FuPlayerQuickAction[];
202
202
  }
203
203
  export type FuPlayerRightMenu = false | FuPlayerQuickAction[] | FuPlayerRightMenuConfig;
204
+ export interface FuPlayerDisplayConfig {
205
+ share?: boolean | FuPlayerShareConfig;
206
+ rightMenu?: FuPlayerRightMenu;
207
+ quickActions?: FuPlayerQuickAction[];
208
+ hideMenu?: boolean;
209
+ hideControls?: boolean;
210
+ }
204
211
  export interface VideoObjectSchema {
205
212
  "@context": "https://schema.org";
206
213
  "@type": "VideoObject";
@@ -248,10 +255,16 @@ export interface FuPlayerOptions {
248
255
  tracks?: FuPlayerTrack[];
249
256
  className?: string;
250
257
  playButtonLabel?: string;
258
+ display?: FuPlayerDisplayConfig;
259
+ /** @deprecated Use display.share instead. */
251
260
  share?: boolean | FuPlayerShareConfig;
261
+ /** @deprecated Use display.rightMenu instead. */
252
262
  rightMenu?: FuPlayerRightMenu;
263
+ /** @deprecated Use display.quickActions instead. */
253
264
  quickActions?: FuPlayerQuickAction[];
265
+ /** @deprecated Use display.hideMenu instead. */
254
266
  hideMenu?: boolean;
267
+ /** @deprecated Use display.hideControls instead. */
255
268
  hideControls?: boolean;
256
269
  nativeControls?: boolean;
257
270
  wrapperStyle?: FuPlayerStyleProperties;
@@ -1,5 +1,8 @@
1
1
  export { createFuPlayer, FuPlayer } from "./player";
2
+ export { buildFuPlayerOptionsFromDto } from "./playerConfigDto";
3
+ export { mergeFuPlayerOptions } from "./playerOptions";
2
4
  export { applyFuPlayerSeoHead } from "./seoHeadManager";
5
+ export type { FuPlayerConfigActionBinding, FuPlayerConfigBuiltInShareTargetConfig, FuPlayerConfigCustomShareTarget, FuPlayerConfigDisplayConfig, FuPlayerConfigDto, FuPlayerConfigJsonValue, FuPlayerConfigOptions, FuPlayerConfigOptionsLayerDto, FuPlayerConfigPlayerOptions, FuPlayerConfigQuickAction, FuPlayerConfigRightMenu, FuPlayerConfigRightMenuConfig, FuPlayerConfigShareConfig, FuPlayerConfigShareTarget, FuPlayerConfigShareTargetBase } from "./playerConfigDto";
3
6
  export { buildFuPlayerSeoHead, buildFuPlayerVideoSitemapXml, validateFuPlayerSeo } from "./components/seoHead";
4
7
  export { buildVideoObjectSchema, parseDurationToSeconds, stringifyVideoObjectJsonLd } from "./components/videoSchema";
5
- export type { FuPlayerBuiltInQuickActionKind, FuPlayerBuiltInShareTarget, FuPlayerBuiltInShareTargetConfig, FuPlayerCreateInput, FuPlayerVideoData, FuPlayerCustomShareTarget, FuPlayerEntity, FuPlayerGeoData, FuPlayerInstance, FuPlayerOptions, FuPlayerProps, FuPlayerPlaybackError, FuPlayerPlaybackErrorHandler, FuPlayerPlaybackErrorType, FuPlayerPlaybackState, FuPlayerQuickAction, FuPlayerQuickActionClickHandler, FuPlayerQuickActionKind, FuPlayerRightMenu, FuPlayerRightMenuConfig, FuPlayerChapter, FuPlayerSeoHeadDescriptor, FuPlayerSeoHeadOptions, FuPlayerSeoLinkDefinition, FuPlayerSeoMetaDefinition, FuPlayerSeoMode, FuPlayerSeoValidationIssue, FuPlayerSeoValidationIssueCode, FuPlayerShareConfig, FuPlayerShareClickHandler, FuPlayerShareHrefResolver, FuPlayerSharePayload, FuPlayerShareTargetBase, FuPlayerShareTarget, FuPlayerSimpleOptions, FuPlayerSource, FuPlayerSourceAdapter, FuPlayerSourceAdapterContext, FuPlayerSourceAdapterDisposable, FuPlayerSourceAdapterKind, FuPlayerSourceAdapterResult, FuPlayerSourceAdapters, FuPlayerStyleProperties, FuPlayerStyleValue, FuPlayerTarget, FuPlayerTwitterCard, FuPlayerTrack, FuPlayerVideoSitemapEntry, FuPlayerVideoSitemapOptions, VideoObjectSchema } from "./components/types";
8
+ export type { FuPlayerBuiltInQuickActionKind, FuPlayerBuiltInShareTarget, FuPlayerBuiltInShareTargetConfig, FuPlayerCreateInput, FuPlayerDisplayConfig, FuPlayerVideoData, FuPlayerCustomShareTarget, FuPlayerEntity, FuPlayerGeoData, FuPlayerInstance, FuPlayerOptions, FuPlayerProps, FuPlayerPlaybackError, FuPlayerPlaybackErrorHandler, FuPlayerPlaybackErrorType, FuPlayerPlaybackState, FuPlayerQuickAction, FuPlayerQuickActionClickHandler, FuPlayerQuickActionKind, FuPlayerRightMenu, FuPlayerRightMenuConfig, FuPlayerChapter, FuPlayerSeoHeadDescriptor, FuPlayerSeoHeadOptions, FuPlayerSeoLinkDefinition, FuPlayerSeoMetaDefinition, FuPlayerSeoMode, FuPlayerSeoValidationIssue, FuPlayerSeoValidationIssueCode, FuPlayerShareConfig, FuPlayerShareClickHandler, FuPlayerShareHrefResolver, FuPlayerSharePayload, FuPlayerShareTargetBase, FuPlayerShareTarget, FuPlayerSimpleOptions, FuPlayerSource, FuPlayerSourceAdapter, FuPlayerSourceAdapterContext, FuPlayerSourceAdapterDisposable, FuPlayerSourceAdapterKind, FuPlayerSourceAdapterResult, FuPlayerSourceAdapters, FuPlayerStyleProperties, FuPlayerStyleValue, FuPlayerTarget, FuPlayerTwitterCard, FuPlayerTrack, FuPlayerVideoSitemapEntry, FuPlayerVideoSitemapOptions, VideoObjectSchema } from "./components/types";
@@ -0,0 +1,65 @@
1
+ import type { FuPlayerBuiltInShareTarget, FuPlayerChapter, FuPlayerGeoData, FuPlayerQuickAction, FuPlayerRightMenuConfig, FuPlayerShareConfig, FuPlayerShareTargetBase, FuPlayerSimpleOptions, FuPlayerSource, FuPlayerTrack, FuPlayerVideoData } from "./components/types";
2
+ export type FuPlayerConfigJsonValue = string | number | boolean | null | FuPlayerConfigJsonValue[] | {
3
+ [key: string]: FuPlayerConfigJsonValue | undefined;
4
+ };
5
+ export interface FuPlayerConfigActionBinding {
6
+ actionKey?: string;
7
+ actionPayload?: FuPlayerConfigJsonValue;
8
+ }
9
+ export interface FuPlayerConfigQuickAction extends Omit<FuPlayerQuickAction, "onClick">, FuPlayerConfigActionBinding {
10
+ }
11
+ export interface FuPlayerConfigRightMenuConfig extends Omit<FuPlayerRightMenuConfig, "actions"> {
12
+ actions?: FuPlayerConfigQuickAction[];
13
+ }
14
+ export type FuPlayerConfigRightMenu = false | FuPlayerConfigQuickAction[] | FuPlayerConfigRightMenuConfig;
15
+ export interface FuPlayerConfigShareTargetBase extends Omit<FuPlayerShareTargetBase, "href" | "onClick">, FuPlayerConfigActionBinding {
16
+ href?: string;
17
+ }
18
+ export interface FuPlayerConfigCustomShareTarget extends FuPlayerConfigShareTargetBase {
19
+ id: string;
20
+ label: string;
21
+ }
22
+ export interface FuPlayerConfigBuiltInShareTargetConfig extends FuPlayerConfigShareTargetBase {
23
+ preset: FuPlayerBuiltInShareTarget;
24
+ id?: string;
25
+ }
26
+ export type FuPlayerConfigShareTarget = FuPlayerBuiltInShareTarget | FuPlayerConfigCustomShareTarget | FuPlayerConfigBuiltInShareTargetConfig;
27
+ export interface FuPlayerConfigShareConfig extends Omit<FuPlayerShareConfig, "targets"> {
28
+ targets?: FuPlayerConfigShareTarget[];
29
+ }
30
+ export interface FuPlayerConfigDisplayConfig {
31
+ share?: boolean | FuPlayerConfigShareConfig;
32
+ rightMenu?: FuPlayerConfigRightMenu;
33
+ quickActions?: FuPlayerConfigQuickAction[];
34
+ hideMenu?: boolean;
35
+ hideControls?: boolean;
36
+ }
37
+ type FuPlayerDisplayOptionKey = keyof FuPlayerConfigDisplayConfig | "display";
38
+ type FuPlayerContentOptionKey = "src" | "sources" | "tracks" | "chapters" | "seo" | "geo" | "poster" | "title" | "description" | "thumbnailUrl" | "uploadDate" | "duration" | "contentUrl" | "embedUrl" | "summary" | "keyTakeaways" | "transcript" | "type" | "media" | "adapter";
39
+ type FuPlayerRuntimeOnlyOptionKey = "sourceAdapters" | "posterImageProps" | "onLoadStart" | "onLoadedMetadata" | "onLoadedData" | "onCanPlay" | "onTimeUpdate" | "onPlay" | "onPlaying" | "onPause" | "onEnded" | "onWaiting" | "onStalled" | "onError" | "onVolumeChange" | "onPlaybackError";
40
+ export type FuPlayerConfigPlayerOptions = Omit<FuPlayerSimpleOptions, FuPlayerDisplayOptionKey | FuPlayerContentOptionKey | FuPlayerRuntimeOnlyOptionKey>;
41
+ export type FuPlayerConfigOptions = FuPlayerConfigPlayerOptions & {
42
+ display?: FuPlayerConfigDisplayConfig;
43
+ };
44
+ type NullableConfig<T> = T extends (...args: any[]) => unknown ? T | null : T extends Array<infer Item> ? Array<NullableConfig<Item>> | null : T extends object ? {
45
+ [Key in keyof T]?: NullableConfig<T[Key]> | null;
46
+ } | null : T | null;
47
+ export interface FuPlayerConfigOptionsLayerDto {
48
+ profileId?: number | string;
49
+ profileKey?: string;
50
+ player?: NullableConfig<FuPlayerConfigPlayerOptions>;
51
+ display?: NullableConfig<FuPlayerConfigDisplayConfig>;
52
+ }
53
+ export interface FuPlayerConfigDto {
54
+ video?: unknown;
55
+ sources?: NullableConfig<FuPlayerSource[]>;
56
+ tracks?: NullableConfig<FuPlayerTrack[]>;
57
+ chapters?: NullableConfig<FuPlayerChapter[]>;
58
+ seo?: NullableConfig<Partial<FuPlayerVideoData>>;
59
+ geo?: NullableConfig<FuPlayerGeoData>;
60
+ commonOptions?: FuPlayerConfigOptionsLayerDto | null;
61
+ personalizedOptions?: FuPlayerConfigOptionsLayerDto | null;
62
+ options?: NullableConfig<FuPlayerConfigOptions>;
63
+ }
64
+ export declare function buildFuPlayerOptionsFromDto(dto: FuPlayerConfigDto): FuPlayerSimpleOptions;
65
+ export {};
@@ -0,0 +1,24 @@
1
+ import type { FuPlayerCreateInput, FuPlayerOptions, FuPlayerQuickAction, FuPlayerSimpleOptions, FuPlayerSource, FuPlayerTarget, FuPlayerTrack } from "./components/types";
2
+ export interface NormalizedFuPlayerOptions extends Omit<FuPlayerOptions, "sources"> {
3
+ aspectRatio: string;
4
+ seoMode: "indexable" | "lazy";
5
+ lazy: boolean;
6
+ rootMargin: string;
7
+ renderJsonLd: boolean;
8
+ sources: FuPlayerSource[];
9
+ tracks: FuPlayerTrack[];
10
+ quickActions: FuPlayerQuickAction[];
11
+ nativeControls: boolean;
12
+ preload: "auto" | "metadata" | "none";
13
+ playsInline: boolean;
14
+ controls: boolean;
15
+ pauseOtherPlayers: boolean;
16
+ renderGeoText: boolean;
17
+ renderGeoTextExplicit: boolean;
18
+ }
19
+ export declare const TEXT_TRACK_OFF_KEY = "off";
20
+ export declare function normalizeCreateInput(input: FuPlayerCreateInput, options?: FuPlayerSimpleOptions): FuPlayerSimpleOptions;
21
+ export declare function mergeFuPlayerOptions(...configs: Array<FuPlayerSimpleOptions | null | undefined>): FuPlayerSimpleOptions;
22
+ export declare function normalizeOptions(options: FuPlayerSimpleOptions, previous?: NormalizedFuPlayerOptions): NormalizedFuPlayerOptions;
23
+ export declare function resolveTarget(target: FuPlayerTarget): HTMLElement;
24
+ export declare function preventDefault(event: Event): void;
package/package.json CHANGED
@@ -4,7 +4,20 @@
4
4
  "registry": "https://registry.npmjs.org/",
5
5
  "access": "public"
6
6
  },
7
- "version": "0.1.0",
7
+ "version": "0.2.0",
8
+ "description": "Framework-free TypeScript video player with SEO metadata, share menus, quick actions, and layered configuration.",
9
+ "keywords": [
10
+ "video-player",
11
+ "html5-video",
12
+ "typescript",
13
+ "vanilla-js",
14
+ "seo",
15
+ "video-seo",
16
+ "json-ld",
17
+ "schema-org",
18
+ "share-menu",
19
+ "configurable-player"
20
+ ],
8
21
  "license": "SEE LICENSE IN LICENSE",
9
22
  "type": "module",
10
23
  "main": "./dist/fu-player.umd.cjs",