@flowplayer/player 3.0.1-canary.48 → 3.0.1-canary.49

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.
package/core.js CHANGED
@@ -12,4 +12,4 @@
12
12
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13
13
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14
14
  PERFORMANCE OF THIS SOFTWARE.
15
- ***************************************************************************** */function R(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}function k(e){const t=document.createElement("a");t.href=e;const n=t.pathname&&t.pathname.split(".");return n.length>1&&n[n.length-1]}function I(e){switch(e){case"video/mpd":return"application/dash+xml";case"video/m3u8":return"application/x-mpegurl";default:return e}}const D=e=>{var{src:t}=e,n=R(e,["src"]);return[Object.assign({src:t,type:t?I("video/"+k(t)):""},n)]};function P(e){return D({src:e})}function U(e){var{src:t,type:n}=e,r=R(e,["src","type"]);return t&&n?[Object.assign({src:t,type:n},r)]:n&&!t?[Object.assign({type:n},r)]:D(Object.assign({src:t},r))}var C;function M(e,t,n,r={safari:!1}){const o=function(e){return"string"==typeof e?P(e):Array.isArray(e)||"object"!=typeof e?e.reduce((function(e,t){return"string"==typeof t&&(t=P(t)),"object"!=typeof t||Array.isArray(t)||(t=U(t)),e.concat(t)}),[]):U(e)}(n);return e.currentSrc&&(e.innerHTML=""),Array(...Array(o.length)).map((e,t)=>t).some(n=>{const i=o[n];if(C.Ok==function(e,t,n){e.emit("src",n),"string"==typeof n.src&&(e.original_src=n.src);const r=function(e,t,n){return e.plugins.filter(e=>{return(t=e)&&"wants"in t;var t}).find(e=>e.wants(n.src||"",n,t))}(e,t,n);return r?(r.onload(t,e.root,e,n),C.Ok):C.Err}(e,t,i)||C.Ok==function(e,t,n,r={safari:!1}){/^audio\//.test(n.type||"")&&e.emit("audioonlysource");t.start_time&&(n.src=n.src+"#t="+t.start_time);if(""==e.canPlayType(n.type||""))return C.Err;if(n.drm&&(!n.drm["com.apple.fps.1_0"]||!r.safari))return C.Err;"string"==typeof n.src&&(e.src=n.src);return C.Ok}(e,t,i,r))return!0;n==o.length-1&&"string"==typeof i.src&&(e.src=i.src)}),function(e,t){(function(e,t){if(!e.currentSrc)return;if("none"==e.opt("preload"))return;if(t.autoplay&&t.autoplay>0)return;e.load()})(e,t),"none"==e.opt("preload")&&e.render()}(e,t),e}!function(e){e[e.Err=0]="Err",e[e.Ok=1]="Ok"}(C||(C={}));const x=["reap","seeking","src","seek:cancel"];var j;function W(e,t,n){return isNaN(e.duration)||isNaN(e.currentTime)?{}:(t.offset+=n,0==t.offset?G(e,t):(t.timer&&clearTimeout(t.timer),t.timer=setTimeout((function(){0!=e.reaper&&(e.currentTime=function(e,t,n=0){return Math.max(Math.min(t,e),n)}(e.currentTime+t.offset,e.duration),t.timer=0,G(e,t))}),1e3),function(e,t){e.setState("will-seek",!0),e.setState(j.BACKWARD,t.offset<0),e.setState(j.FORWARD,t.offset>0)}(e,t),e.emit("seek:queued",t),t))}function G(e,t){t.timer&&clearTimeout(t.timer),t.timer=t.offset=0,function(e){e.setState(j.FORWARD,!1),e.setState(j.BACKWARD,!1),e.setState("will-seek",!1)}(e)}function H(){if("undefined"==typeof document)return!1;const e=document.documentElement;return e&&"rtl"==e.getAttribute("dir")}function V(e,t,n){const r=function(e){return Array.isArray(e)?e.slice(0):e.split(".")}(t);for(;r.length;){if(null==e)return n;const t=r.shift();if("string"!=typeof t)return n;e=e[t]}return null==e?n:e}!function(e){e.FORWARD="forward",e.BACKWARD="backward"}(j||(j={}));const K={3:!0,5:!0,7:!0,9:!0};function F(){return(e=Array(16),Array.from({length:e.length}).map((e,t)=>t).forEach(t=>{let n;0==(3&t)&&(n=4294967296*Math.random()),e[t]=(n||0)>>>((3&t)<<3)&255}),e).reduce((function(e,t,n){const r=(t+256).toString(16).substr(1);return e+(n.toString()in K?"-":"")+r}),"");var e}let Y="";!function(){let e=!1;try{const t=Object.defineProperty({},"passive",{get:function(){e=!0}});window.addEventListener("testPassive",null,t),window.removeEventListener("testPassive",null,t)}catch(e){}}();const B=["touchstart","touchmove"];function q(e,t){const n=new CustomEvent(e,{detail:t});return t&&Object.defineProperty(n,"data",{get:()=>t}),n}function Q(e,t,n){const r=q(t,n);return e.dispatchEvent(r),e}function z(e,t,n){const r=q(t,n);return e.dispatchEvent(r),r}function J(e,t,n,r){Array.isArray(t)?t.forEach(t=>X(e,t,n,r)):X(e,t,n,r)}function X(e,t,n,r){if(o=t,!~B.indexOf(o))return e.addEventListener(t,n,r),e;var o;const i=Object.assign(r||{},{passive:!0});return e.addEventListener(t,n,i),e}function Z(e,t,n,r){return J(e,t,n,Object.assign(r||{},{once:!0}))}const $={preload:"none",rtl:!1,controls:!0},ee=["loop","muted","preload"];function te(e,r,o){o.toJSON=function(){return{duration:o.duration,volume:o.volume,currentTime:o.currentTime,states:o.root.className}},o.setSrc=function(t){return M(o,e,t,n())},o.playerState=o.playerState||{},o.setState=function(e,t){if(o.playerState[e]===!!t)return o;const n=Object.assign({},o.playerState,{[e]:t});return n[g]&&(n[l]=!1),o.playerState=n,Q(o,"state",o.playerState),o},o.hasState=function(e){return!!o.playerState[e]},o.transitionState=function(e,t,n){o.hasState(e)&&(n=0),n&&o.setState("is-toggling",!0),o.setState(t,!1),o.setState(e,!0),n&&setTimeout((function(){o.setState("is-toggling",!1)}),n)},o.render=function(e,t){return"string"==typeof e?A.render(e,t):(Q(o,n().ios?s:u),Q(o,"canplay"),o)},o.emit=(e,t)=>(Q(o,e,t),o),o.on=(e,t)=>(J(o,e,t),o),o.once=(e,t)=>(Z(o,e,t),o),o.off=(e,t)=>{var n,r;return n=e,r=t,o.removeEventListener(n,r),o},o.poll=(e,t)=>z(o,e,t),o.togglePlay=function(t){return T(o,e,t)},o.toggleMute=function(e){e=null==e?!o.muted:!!e,o.muted=e,o.muted||o.volume||(o.volume=1),Q(o,"volumechange")},o.toggleDisable=function(e){e=null==e?!o.disabled:!!e,o.setState("is-disabled",e),o.disabled=e},o.destroy=function(){o.pause();const e=t.indexOf(o);~e&&t.splice(e,1),setTimeout((function(){o.setSrc([]),o.reaper&&o.reaper.clear(),Q(o,"reap")}),0)},o.setAttrs=function(e){return ee.forEach(t=>{if(!(t in e))return;const n=e[t];n?o.setAttribute(t,n.toString()):o.removeAttribute(t)}),o},o.opt=function(t,n){return n=void 0===n?V($,t):n,V(e,t,n)},o.i18n=function(e,t){if(!o.reaper)return"";const n=o.reaper.get("translations");return n?function e(t,n,r,o){return(o=o||0)>=t.length?r:V(t[o],n,e(t,n,r,o+1))}(n,e,t||""):t||""},o.setOpts=function(t){Object.assign(e,t),"disabled"in t&&void 0!==t.disabled&&o.toggleDisable(t.disabled),"muted"in t&&void 0!==t.muted&&o.toggleMute(t.muted);const n=!!e.autoplay&&!o.hasState("no-autoplay");o.setState("is-autoplay",n),o.setState("is-rtl",o.opt("rtl",function(e){if(!e)return H();const t=e.getAttribute("dir");return t?"rtl"==t:H()}(r))),o.setState("is-live",!!e.live),o.setState("no-timeline",!(!e.live||e.dvr)),o.setState("has-poster","string"==typeof e.poster&&e.poster.length>0),o.setState("is-seekable",!!e.seekable),r.style.backgroundImage=o.hasState("has-poster")?"url('"+e.poster+"')":"",Q(o,"config",e)},o.renderPlugin=function(e){z(o,"renderplugin",e).defaultPrevented||o.root.appendChild(e)};const i={offset:0,timer:0};var a,c;c=i,(a=o).on(x,(function(){G(a,c)})),o.enqueueSeek=function(e){if(0!=o.opts.seekable&&!(1==o.opts.disabled&&e>0))return W(o,i,e)},o.deviceId=function(){return function(){if(Y)return Y;try{const e=localStorage.getItem("flowplayer/uuid");if(e)return e;const t=F();return localStorage.setItem("flowplayer/uuid",t),t}catch(e){return Y=F()}}()}}function ne(e,t){const n=t.querySelector("video"),r=n||(e._video_element_callback?e._video_element_callback(e):document.createElement("video"));return r.classList.add("fp-engine"),r.playsInline=!0,n||t.append(r),r}const re=["localhost","127.0.0.1","0.0.0.0","s.codepen.io","cdpn.io","try.flowplayer.com"];function oe(e,t){return!!~re.indexOf(e)||e.indexOf(t)===e.length-t.length}oe.check_whitelist=function(e){return!!~re.indexOf(e)};const ie="production";function ae(e,t){const n={valid_jwt:!1,raw:"",data:{acl:0},exp:0};let r={c:"{}",exp:0};t=t||{};try{r=_(e),n.valid_jwt=!0}catch(e){}return n.raw=e,n.data=JSON.parse(r.c),n.exp=r.exp,t.require_valid_token&&ae.validate(n),n}function se(e){try{return ae.validate(e),{success:!0,message:""}}catch(e){return{success:!1,message:e.message}}}var ue;function ce(e){return{grant:e,is_granted:t=>(e&t)===t}}function le(e,t,n){t&&t.destroy(),console.error(new Error(n.details||n.reason)),e.innerHTML="",e.classList.remove("flowplayer"),e.classList.add("flowplayer-fatal"),e.innerHTML='\n <h2>Playback Error</h2>\n <p>Are you the site owner?</p>\n <a class="troubleshoot" target="_blank" href="https://flowplayer.com/help/developers/troubleshooting">Troubleshoot?</a>\n <img src=""https://flowplayer.com/user/pages/images/logo-white.png""/>\n '}function de(e,t){const n=t.clientWidth;t.classList.toggle("is-small",n<600),t.classList.toggle("is-tiny",n<400)}function fe(e,t,r){let o=!0;t.classList.add("flowplayer"),de(0,t),J(r,["loadstart",a],(function(){de(0,t)})),J(r,"state",(function(){Object.entries(r.playerState).forEach((function([e,n]){t.classList.toggle(e,n)}))})),J(r,"timeupdate",(function(){r.setState(g,!1)})),J(r,"config",(function(){const n=r.paused&&(!e.autoplay||t.classList.contains("no-autoplay"))&&0==r.currentTime;[f,p].forEach((function(e){r.setState(e,n)}))})),J(r,"ended",(function(t){setTimeout((function(){t.defaultPrevented||(e.rewind&&!r.loop&&(e.autoplay&&(e.autoplay=0,r.setState("is-autoplay",!1)),r.setState(E,!0),Z(r,"seeked",(function(){r.setState(E,!1),r.pause(),r.setState(p,!0)})),r.currentTime=0),Z(r,"timeupdate",(function(){r.setState(y,!1)})),r.transitionState(y,l,e.loop||e.rewind?0:300))}),0)})),J(r,["seeking","seeked"],(function(e){r.setState(E,"seeking"==e.type),r.setState(d,r.paused),r.setState(l,!r.paused)})),J(r,"ended",(function(){r.setState(l,!1),o=!0})),J(r,n().ios?s:u,(function(e){const t="src"!=e.type||"none"!==r.opt("preload");r.setState("is-loaded",t),r.setState(f,!t)})),J(r,["waiting","canplay","loadstart"],(function(t){if(!r.hasState(E)&&("canplay"!=t.type||e.autoplay||r.setState(g,!1),"loadstart"!=t.type||"none"!=r.opt("preload")||e.autoplay)){if("loadstart"==t.type&&e.autoplay)return Z(r,"playing",(function(){r.setState(g,!1)}));"waiting"==t.type&&[l,d,p].forEach((function(e){r.setState(e,!1)})),r.setState(y,!1),r.setState(g,"waiting"==t.type)}})),J(r,["playing","pause"],(function(t){setTimeout(()=>{const e=new CustomEvent("flowplayer/"+t.type,{detail:r});document.dispatchEvent(e)},0);const n="playing"==t.type,i=r.currentTime==r.duration,a=n&&o&&e.autoplay||r.hasState(g);if(n&&(r.started=!0,o=!1),r.setState(g,!1).setState(p,!1),i||r.hasState(E))return;const s=n?l:d,u=n?d:l;r.transitionState(s,u,a?0:300),n&&r.setState("no-autoplay",!1)}))}function pe(e){const t=function(e){const t=e.getBoundingClientRect(),n=window.innerHeight,r=t.height,o=t.bottom,i=r/5;return t.top<=i&&t.top+r>n-i||o-r+i>=0&&o<n+i}(e.root);return e.in_viewport===t||(e.in_viewport=t,Q(e,t?"viewenter":"viewleave")),e}function Ee(e,n,o){pe(o);const a={should_resume:!!e.autoplay,has_user_gesture:!1,locked:!1};[i,r].forEach(e=>Z(o,e,()=>a.has_user_gesture=!0)),J(o,"play",(function(){a.locked||(a.should_resume=!0)})),J(o,"pause",(function(){a.locked||(a.should_resume=!1)})),J(o,"canplay",(function(n){e.autoplay&&!t.filter((function(e){return!e.paused})).length&&o.in_viewport&&o.paused&&a.should_resume&&o.togglePlay(!0)})),e.autopause&&(J(o,"viewenter",(function(){a.should_resume&&o.togglePlay(!0)})),J(o,"viewleave",(function(){const e=!o.paused;a.locked=!0,o.pause(),setTimeout((function(){a.should_resume=e,a.locked=!1}),0)})))}ae.validate=function(e){if("string"==typeof e&&(e=ae(e)),!e||!e.raw){if(oe.check_whitelist(window.location.hostname)||"dev"===ie.toString())return!0;throw new Error("No token provided in configuration")}if(!e.valid_jwt)throw new Error("Invalid token provided");const t=window.location.hostname,n=oe.bind(null,t);if("dev"!==ie.toString()&&e.data.domain&&e.data.domain.length&&!e.data.domain.some(n))throw new Error("Domain not allowed");if("dev"!==ie.toString()&&1e3*e.exp-Date.now()<0)throw new Error("Expired token");return!0},ae.id=function(e){if(e)return"string"==typeof e&&(e=ae(e)),e.data.id},function(e){e[e.ADS=2]="ADS",e[e.ANALYTICS=4]="ANALYTICS",e[e.NO_METERING=8]="NO_METERING",e[e.DEVELOPER_PLAN=16]="DEVELOPER_PLAN"}(ue||(ue={})),ce.of=ce,ce.from_token=function(e){const t=ae(e,{require_valid_token:!0});return ce.of(t.data.acl)},ce.permissions=ue,[o,a].forEach(e=>{window.addEventListener(e,(function(){t.forEach((function(e){const t=e.root;t.prevWidth!=t.clientWidth&&(Q(e,a),t.prevWidth=t.clientWidth)}))}))}),window.addEventListener("scroll",(function(){t.forEach(pe)}));function ye(e){if("number"==typeof e&&!isNaN(e))return Number(e);if("string"==typeof e){const t=e.split(":");return Number(t[1])/Number(t[0])}return e}function ge(e,t,n){const r=document.createElement("div");r.classList.add("fp-ratio"),t.append(r);let o=ye(e.ratio||.5625);r.style.paddingTop=100*o+"%";const i=[u,s];n.on(i,(function(){const e=n.videoHeight&&n.videoWidth&&n.videoHeight/n.videoWidth;e&&n.setOpts({ratio:e})})),n.on("config",(function(){const t=n.videoHeight&&n.videoWidth&&n.videoHeight/n.videoWidth,i=ye((null==e?void 0:e.ratio)||t||.5625);o!==i&&(o=i,r.style.paddingTop=100*i+"%")}))}function me(e){const t=t=>{if(t.detail===e)return;const n=e.opt("multiplay");"boolean"==typeof n&&!1===n&&e.pause()};e.on("reap",()=>document.removeEventListener("flowplayer/playing",t)),document.addEventListener("flowplayer/playing",t)}const he=function(){const e="undefined"!=typeof window?window:"undefined"!=typeof global?global:{},t=e.flowplayer?e.flowplayer:{extensions:[]};return Array.isArray(t.extensions)||(t.extensions=[]),t}();function ve(n,r){if("function"==typeof n)return e.push(...[...arguments].filter(e=>"function"==typeof e)),ve;"string"==typeof r&&(r={src:r}),r||(r={}),r.token||"string"!=typeof window.__FLOWPLAYER_TOKEN||(r.token=window.__FLOWPLAYER_TOKEN);const o="string"==typeof n?document.querySelector(n):n;if(!o)return console.error(new Error("Flowplayer: '"+n.toString()+"' not found"));const i=o.querySelector("video.fp-engine");if(i)return i;const a=se(r.token);if(!a.success)return le(o,null,{reason:"token",details:a.message});const u=new Map,c=ne(r,o);if(c.reaper=u,Object.defineProperty(c,"token",{value:"string"==typeof r.token?ae.id(r.token):"",writable:!1}),c.addEventListener("reap",()=>{u.clear(),c.reaper=0,delete c.root}),c.root=o,r.token&&ce.from_token(r.token).is_granted(ce.permissions.DEVELOPER_PLAN))return le(o,null,{reason:"developer_plan",details:"Using developer plan tokens is not currently supported"});!~t.indexOf(c)&&t.push(c),te(r,o,c),c.setAttrs(r),c.plugins=ve.extensions.map(e=>new e(ve,c)),fe(r,o,c),Ee(r,0,c),ge(r,o,c),me(c),c.plugins.forEach(e=>{try{e.init(r,o,c)}catch(t){console.log("Error(plugin/%s)",e.constructor.name,t)}}),c.setOpts(r),c.opts=r,r.src&&c.setSrc(r.src);const l=c.readyState;return l>0&&c.currentSrc&&c.emit(s),l>2&&c.currentSrc&&c.emit("canplay"),"none"==c.opt("preload")&&c.paused&&c.currentSrc&&c.render(),c.emit("mount"),c.on("error:fatal",(function(e){le(o,c,e.data||{})})),c}return Object.assign(ve,he),function(r){Array.isArray(r.extensions)&&r.extensions.forEach(t=>e.push(t)),r.components=A,r.version="3.0.0-rc6",r.commit="3ff5575be008bca83fb98f88bd7b5012f71fbe28",r.instances=t,r.extensions=e,r.support=n,r.events=c,r.states=m,r.jwt=_,r.autoplay=O,r.quality=b}(ve),"object"==typeof document&&setTimeout(Q,0,document,"flowplayer:umd",ve),ve}));
15
+ ***************************************************************************** */function R(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}function k(e){const t=document.createElement("a");t.href=e;const n=t.pathname&&t.pathname.split(".");return n.length>1&&n[n.length-1]}function I(e){switch(e){case"video/mpd":return"application/dash+xml";case"video/m3u8":return"application/x-mpegurl";default:return e}}const D=e=>{var{src:t}=e,n=R(e,["src"]);return[Object.assign({src:t,type:t?I("video/"+k(t)):""},n)]};function P(e){return D({src:e})}function U(e){var{src:t,type:n}=e,r=R(e,["src","type"]);return t&&n?[Object.assign({src:t,type:n},r)]:n&&!t?[Object.assign({type:n},r)]:D(Object.assign({src:t},r))}var C;function M(e,t,n,r={safari:!1}){const o=function(e){return"string"==typeof e?P(e):Array.isArray(e)||"object"!=typeof e?e.reduce((function(e,t){return"string"==typeof t&&(t=P(t)),"object"!=typeof t||Array.isArray(t)||(t=U(t)),e.concat(t)}),[]):U(e)}(n);return e.currentSrc&&(e.innerHTML=""),Array(...Array(o.length)).map((e,t)=>t).some(n=>{const i=o[n];if(C.Ok==function(e,t,n){e.emit("src",n),"string"==typeof n.src&&(e.original_src=n.src);const r=function(e,t,n){return e.plugins.filter(e=>{return(t=e)&&"wants"in t;var t}).find(e=>e.wants(n.src||"",n,t))}(e,t,n);return r?(r.onload(t,e.root,e,n),C.Ok):C.Err}(e,t,i)||C.Ok==function(e,t,n,r={safari:!1}){/^audio\//.test(n.type||"")&&e.emit("audioonlysource");t.start_time&&(n.src=n.src+"#t="+t.start_time);if(""==e.canPlayType(n.type||""))return C.Err;if(n.drm&&(!n.drm["com.apple.fps.1_0"]||!r.safari))return C.Err;"string"==typeof n.src&&(e.src=n.src);return C.Ok}(e,t,i,r))return!0;n==o.length-1&&"string"==typeof i.src&&(e.src=i.src)}),function(e,t){(function(e,t){if(!e.currentSrc)return;if("none"==e.opt("preload"))return;if(t.autoplay&&t.autoplay>0)return;e.load()})(e,t),"none"==e.opt("preload")&&e.render()}(e,t),e}!function(e){e[e.Err=0]="Err",e[e.Ok=1]="Ok"}(C||(C={}));const x=["reap","seeking","src","seek:cancel"];var j;function W(e,t,n){return isNaN(e.duration)||isNaN(e.currentTime)?{}:(t.offset+=n,0==t.offset?G(e,t):(t.timer&&clearTimeout(t.timer),t.timer=setTimeout((function(){0!=e.reaper&&(e.currentTime=function(e,t,n=0){return Math.max(Math.min(t,e),n)}(e.currentTime+t.offset,e.duration),t.timer=0,G(e,t))}),1e3),function(e,t){e.setState("will-seek",!0),e.setState(j.BACKWARD,t.offset<0),e.setState(j.FORWARD,t.offset>0)}(e,t),e.emit("seek:queued",t),t))}function G(e,t){t.timer&&clearTimeout(t.timer),t.timer=t.offset=0,function(e){e.setState(j.FORWARD,!1),e.setState(j.BACKWARD,!1),e.setState("will-seek",!1)}(e)}function H(){if("undefined"==typeof document)return!1;const e=document.documentElement;return e&&"rtl"==e.getAttribute("dir")}function V(e,t,n){const r=function(e){return Array.isArray(e)?e.slice(0):e.split(".")}(t);for(;r.length;){if(null==e)return n;const t=r.shift();if("string"!=typeof t)return n;e=e[t]}return null==e?n:e}!function(e){e.FORWARD="forward",e.BACKWARD="backward"}(j||(j={}));const K={3:!0,5:!0,7:!0,9:!0};function F(){return(e=Array(16),Array.from({length:e.length}).map((e,t)=>t).forEach(t=>{let n;0==(3&t)&&(n=4294967296*Math.random()),e[t]=(n||0)>>>((3&t)<<3)&255}),e).reduce((function(e,t,n){const r=(t+256).toString(16).substr(1);return e+(n.toString()in K?"-":"")+r}),"");var e}let Y="";!function(){let e=!1;try{const t=Object.defineProperty({},"passive",{get:function(){e=!0}});window.addEventListener("testPassive",null,t),window.removeEventListener("testPassive",null,t)}catch(e){}}();const B=["touchstart","touchmove"];function q(e,t){const n=new CustomEvent(e,{detail:t});return t&&Object.defineProperty(n,"data",{get:()=>t}),n}function Q(e,t,n){const r=q(t,n);return e.dispatchEvent(r),e}function z(e,t,n){const r=q(t,n);return e.dispatchEvent(r),r}function J(e,t,n,r){Array.isArray(t)?t.forEach(t=>X(e,t,n,r)):X(e,t,n,r)}function X(e,t,n,r){if(o=t,!~B.indexOf(o))return e.addEventListener(t,n,r),e;var o;const i=Object.assign(r||{},{passive:!0});return e.addEventListener(t,n,i),e}function Z(e,t,n,r){return J(e,t,n,Object.assign(r||{},{once:!0}))}const $={preload:"none",rtl:!1,controls:!0},ee=["loop","muted","preload"];function te(e,r,o){o.toJSON=function(){return{duration:o.duration,volume:o.volume,currentTime:o.currentTime,states:o.root.className}},o.setSrc=function(t){return M(o,e,t,n())},o.playerState=o.playerState||{},o.setState=function(e,t){if(o.playerState[e]===!!t)return o;const n=Object.assign({},o.playerState,{[e]:t});return n[g]&&(n[l]=!1),o.playerState=n,Q(o,"state",o.playerState),o},o.hasState=function(e){return!!o.playerState[e]},o.transitionState=function(e,t,n){o.hasState(e)&&(n=0),n&&o.setState("is-toggling",!0),o.setState(t,!1),o.setState(e,!0),n&&setTimeout((function(){o.setState("is-toggling",!1)}),n)},o.render=function(e,t){return"string"==typeof e?A.render(e,t):(Q(o,n().ios?s:u),Q(o,"canplay"),o)},o.emit=(e,t)=>(Q(o,e,t),o),o.on=(e,t)=>(J(o,e,t),o),o.once=(e,t)=>(Z(o,e,t),o),o.off=(e,t)=>{var n,r;return n=e,r=t,o.removeEventListener(n,r),o},o.poll=(e,t)=>z(o,e,t),o.togglePlay=function(t){return T(o,e,t)},o.toggleMute=function(e){e=null==e?!o.muted:!!e,o.muted=e,o.muted||o.volume||(o.volume=1),Q(o,"volumechange")},o.toggleDisable=function(e){e=null==e?!o.disabled:!!e,o.setState("is-disabled",e),o.disabled=e},o.destroy=function(){o.pause();const e=t.indexOf(o);~e&&t.splice(e,1),setTimeout((function(){o.setSrc([]),o.reaper&&o.reaper.clear(),Q(o,"reap")}),0)},o.setAttrs=function(e){return ee.forEach(t=>{if(!(t in e))return;const n=e[t];n?o.setAttribute(t,n.toString()):o.removeAttribute(t)}),o},o.opt=function(t,n){return n=void 0===n?V($,t):n,V(e,t,n)},o.i18n=function(e,t){if(!o.reaper)return"";const n=o.reaper.get("translations");return n?function e(t,n,r,o){return(o=o||0)>=t.length?r:V(t[o],n,e(t,n,r,o+1))}(n,e,t||""):t||""},o.setOpts=function(t){Object.assign(e,t),"disabled"in t&&void 0!==t.disabled&&o.toggleDisable(t.disabled),"muted"in t&&void 0!==t.muted&&o.toggleMute(t.muted);const n=!!e.autoplay&&!o.hasState("no-autoplay");o.setState("is-autoplay",n),o.setState("is-rtl",o.opt("rtl",function(e){if(!e)return H();const t=e.getAttribute("dir");return t?"rtl"==t:H()}(r))),o.setState("is-live",!!e.live),o.setState("no-timeline",!(!e.live||e.dvr)),o.setState("has-poster","string"==typeof e.poster&&e.poster.length>0),o.setState("is-seekable",!!e.seekable),r.style.backgroundImage=o.hasState("has-poster")?"url('"+e.poster+"')":"",Q(o,"config",e)},o.renderPlugin=function(e){z(o,"renderplugin",e).defaultPrevented||o.root.appendChild(e)};const i={offset:0,timer:0};var a,c;c=i,(a=o).on(x,(function(){G(a,c)})),o.enqueueSeek=function(e){if(0!=o.opts.seekable&&!(1==o.opts.disabled&&e>0))return W(o,i,e)},o.deviceId=function(){return function(){if(Y)return Y;try{const e=localStorage.getItem("flowplayer/uuid");if(e)return e;const t=F();return localStorage.setItem("flowplayer/uuid",t),t}catch(e){return Y=F()}}()}}function ne(e,t){const n=t.querySelector("video"),r=n||(e._video_element_callback?e._video_element_callback(e):document.createElement("video"));return r.classList.add("fp-engine"),r.playsInline=!0,n||t.append(r),r}const re=["localhost","127.0.0.1","0.0.0.0","s.codepen.io","cdpn.io","try.flowplayer.com"];function oe(e,t){return!!~re.indexOf(e)||e.indexOf(t)===e.length-t.length}oe.check_whitelist=function(e){return!!~re.indexOf(e)};const ie="production";function ae(e,t){const n={valid_jwt:!1,raw:"",data:{acl:0},exp:0};let r={c:"{}",exp:0};t=t||{};try{r=_(e),n.valid_jwt=!0}catch(e){}return n.raw=e,n.data=JSON.parse(r.c),n.exp=r.exp,t.require_valid_token&&ae.validate(n),n}function se(e){try{return ae.validate(e),{success:!0,message:""}}catch(e){return{success:!1,message:e.message}}}var ue;function ce(e){return{grant:e,is_granted:t=>(e&t)===t}}function le(e,t,n){t&&t.destroy(),console.error(new Error(n.details||n.reason)),e.innerHTML="",e.classList.remove("flowplayer"),e.classList.add("flowplayer-fatal"),e.innerHTML='\n <h2>Playback Error</h2>\n <p>Are you the site owner?</p>\n <a class="troubleshoot" target="_blank" href="https://flowplayer.com/help/developers/troubleshooting">Troubleshoot?</a>\n <img src=""https://flowplayer.com/user/pages/images/logo-white.png""/>\n '}function de(e,t){const n=t.clientWidth;t.classList.toggle("is-small",n<600),t.classList.toggle("is-tiny",n<400)}function fe(e,t,r){let o=!0;t.classList.add("flowplayer"),de(0,t),J(r,["loadstart",a],(function(){de(0,t)})),J(r,"state",(function(){Object.entries(r.playerState).forEach((function([e,n]){t.classList.toggle(e,n)}))})),J(r,"timeupdate",(function(){r.setState(g,!1)})),J(r,"config",(function(){const n=r.paused&&(!e.autoplay||t.classList.contains("no-autoplay"))&&0==r.currentTime;[f,p].forEach((function(e){r.setState(e,n)}))})),J(r,"ended",(function(t){setTimeout((function(){t.defaultPrevented||(e.rewind&&!r.loop&&(e.autoplay&&(e.autoplay=0,r.setState("is-autoplay",!1)),r.setState(E,!0),Z(r,"seeked",(function(){r.setState(E,!1),r.pause(),r.setState(p,!0)})),r.currentTime=0),Z(r,"timeupdate",(function(){r.setState(y,!1)})),r.transitionState(y,l,e.loop||e.rewind?0:300))}),0)})),J(r,["seeking","seeked"],(function(e){r.setState(E,"seeking"==e.type),r.setState(d,r.paused),r.setState(l,!r.paused)})),J(r,"ended",(function(){r.setState(l,!1),o=!0})),J(r,n().ios?s:u,(function(e){const t="src"!=e.type||"none"!==r.opt("preload");r.setState("is-loaded",t),r.setState(f,!t)})),J(r,["waiting","canplay","loadstart"],(function(t){if(!r.hasState(E)&&("canplay"!=t.type||e.autoplay||r.setState(g,!1),"loadstart"!=t.type||"none"!=r.opt("preload")||e.autoplay)){if("loadstart"==t.type&&e.autoplay)return Z(r,"playing",(function(){r.setState(g,!1)}));"waiting"==t.type&&[l,d,p].forEach((function(e){r.setState(e,!1)})),r.setState(y,!1),r.setState(g,"waiting"==t.type)}})),J(r,["playing","pause"],(function(t){setTimeout(()=>{const e=new CustomEvent("flowplayer/"+t.type,{detail:r});document.dispatchEvent(e)},0);const n="playing"==t.type,i=r.currentTime==r.duration,a=n&&o&&e.autoplay||r.hasState(g);if(n&&(r.started=!0,o=!1),r.setState(g,!1).setState(p,!1),i||r.hasState(E))return;const s=n?l:d,u=n?d:l;r.transitionState(s,u,a?0:300),n&&r.setState("no-autoplay",!1)}))}function pe(e){const t=function(e){const t=e.getBoundingClientRect(),n=window.innerHeight,r=t.height,o=t.bottom,i=r/5;return t.top<=i&&t.top+r>n-i||o-r+i>=0&&o<n+i}(e.root);return e.in_viewport===t||(e.in_viewport=t,Q(e,t?"viewenter":"viewleave")),e}function Ee(e,n,o){pe(o);const a={should_resume:!!e.autoplay,has_user_gesture:!1,locked:!1};[i,r].forEach(e=>Z(o,e,()=>a.has_user_gesture=!0)),J(o,"play",(function(){a.locked||(a.should_resume=!0)})),J(o,"pause",(function(){a.locked||(a.should_resume=!1)})),J(o,"canplay",(function(n){e.autoplay&&!t.filter((function(e){return!e.paused})).length&&o.in_viewport&&o.paused&&a.should_resume&&o.togglePlay(!0)})),e.autopause&&(J(o,"viewenter",(function(){a.should_resume&&o.togglePlay(!0)})),J(o,"viewleave",(function(){const e=!o.paused;a.locked=!0,o.pause(),setTimeout((function(){a.should_resume=e,a.locked=!1}),0)})))}ae.validate=function(e){if("string"==typeof e&&(e=ae(e)),!e||!e.raw){if(oe.check_whitelist(window.location.hostname)||"dev"===ie.toString())return!0;throw new Error("No token provided in configuration")}if(!e.valid_jwt)throw new Error("Invalid token provided");const t=window.location.hostname,n=oe.bind(null,t);if("dev"!==ie.toString()&&e.data.domain&&e.data.domain.length&&!e.data.domain.some(n))throw new Error("Domain not allowed");if("dev"!==ie.toString()&&1e3*e.exp-Date.now()<0)throw new Error("Expired token");return!0},ae.id=function(e){if(e)return"string"==typeof e&&(e=ae(e)),e.data.id},function(e){e[e.ADS=2]="ADS",e[e.ANALYTICS=4]="ANALYTICS",e[e.NO_METERING=8]="NO_METERING",e[e.DEVELOPER_PLAN=16]="DEVELOPER_PLAN"}(ue||(ue={})),ce.of=ce,ce.from_token=function(e){const t=ae(e,{require_valid_token:!0});return ce.of(t.data.acl)},ce.permissions=ue,[o,a].forEach(e=>{window.addEventListener(e,(function(){t.forEach((function(e){const t=e.root;t.prevWidth!=t.clientWidth&&(Q(e,a),t.prevWidth=t.clientWidth)}))}))}),window.addEventListener("scroll",(function(){t.forEach(pe)}));function ye(e){if("number"==typeof e&&!isNaN(e))return Number(e);if("string"==typeof e){const t=e.split(":");return Number(t[1])/Number(t[0])}return e}function ge(e,t,n){const r=document.createElement("div");r.classList.add("fp-ratio"),t.append(r);let o=ye(e.ratio||.5625);r.style.paddingTop=100*o+"%";const i=[u,s];n.on(i,(function(){const e=n.videoHeight&&n.videoWidth&&n.videoHeight/n.videoWidth;e&&n.setOpts({ratio:e})})),n.on("config",(function(){const t=n.videoHeight&&n.videoWidth&&n.videoHeight/n.videoWidth,i=ye((null==e?void 0:e.ratio)||t||.5625);o!==i&&(o=i,r.style.paddingTop=100*i+"%")}))}function me(e){const t=t=>{if(t.detail===e)return;const n=e.opt("multiplay");"boolean"==typeof n&&!1===n&&e.pause()};e.on("reap",()=>document.removeEventListener("flowplayer/playing",t)),document.addEventListener("flowplayer/playing",t)}const he=function(){const e="undefined"!=typeof window?window:"undefined"!=typeof global?global:{},t=e.flowplayer?e.flowplayer:{extensions:[]};return Array.isArray(t.extensions)||(t.extensions=[]),t}();function ve(n,r){if("function"==typeof n)return e.push(...[...arguments].filter(e=>"function"==typeof e)),ve;"string"==typeof r&&(r={src:r}),r||(r={}),r.token||"string"!=typeof window.__FLOWPLAYER_TOKEN||(r.token=window.__FLOWPLAYER_TOKEN);const o="string"==typeof n?document.querySelector(n):n;if(!o)return console.error(new Error("Flowplayer: '"+n.toString()+"' not found"));const i=o.querySelector("video.fp-engine");if(i)return i;const a=se(r.token);if(!a.success)return le(o,null,{reason:"token",details:a.message});const u=new Map,c=ne(r,o);if(c.reaper=u,Object.defineProperty(c,"token",{value:"string"==typeof r.token?ae.id(r.token):"",writable:!1}),c.addEventListener("reap",()=>{u.clear(),c.reaper=0,delete c.root}),c.root=o,r.token&&ce.from_token(r.token).is_granted(ce.permissions.DEVELOPER_PLAN))return le(o,null,{reason:"developer_plan",details:"Using developer plan tokens is not currently supported"});!~t.indexOf(c)&&t.push(c),te(r,o,c),c.setAttrs(r),c.plugins=ve.extensions.map(e=>new e(ve,c)),fe(r,o,c),Ee(r,0,c),ge(r,o,c),me(c),c.plugins.forEach(e=>{try{e.init(r,o,c)}catch(t){console.log("Error(plugin/%s)",e.constructor.name,t)}}),c.setOpts(r),c.opts=r,r.src&&c.setSrc(r.src);const l=c.readyState;return l>0&&c.currentSrc&&c.emit(s),l>2&&c.currentSrc&&c.emit("canplay"),"none"==c.opt("preload")&&c.paused&&c.currentSrc&&c.render(),c.emit("mount"),c.on("error:fatal",(function(e){le(o,c,e.data||{})})),c}return Object.assign(ve,he),function(r){Array.isArray(r.extensions)&&r.extensions.forEach(t=>e.push(t)),r.components=A,r.version="3.0.0-rc6",r.commit="6d66ffa737639c623b6ecccdefd3d118199516a8",r.instances=t,r.extensions=e,r.support=n,r.events=c,r.states=m,r.jwt=_,r.autoplay=O,r.quality=b}(ve),"object"==typeof document&&setTimeout(Q,0,document,"flowplayer:umd",ve),ve}));
package/default.js CHANGED
@@ -12,4 +12,4 @@
12
12
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13
13
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14
14
  PERFORMANCE OF THIS SOFTWARE.
15
- ***************************************************************************** */function j(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}function F(e){const t=document.createElement("a");t.href=e;const n=t.pathname&&t.pathname.split(".");return n.length>1&&n[n.length-1]}function q(e){switch(e){case"video/mpd":return"application/dash+xml";case"video/m3u8":return"application/x-mpegurl";default:return e}}const H=e=>{var{src:t}=e,n=j(e,["src"]);return[Object.assign({src:t,type:t?q("video/"+F(t)):""},n)]};function B(e){return H({src:e})}function W(e){var{src:t,type:n}=e,r=j(e,["src","type"]);return t&&n?[Object.assign({src:t,type:n},r)]:n&&!t?[Object.assign({type:n},r)]:H(Object.assign({src:t},r))}var V;function K(e,t,n,r={safari:!1}){const o=function(e){return"string"==typeof e?B(e):Array.isArray(e)||"object"!=typeof e?e.reduce((function(e,t){return"string"==typeof t&&(t=B(t)),"object"!=typeof t||Array.isArray(t)||(t=W(t)),e.concat(t)}),[]):W(e)}(n);return e.currentSrc&&(e.innerHTML=""),Array(...Array(o.length)).map((e,t)=>t).some(n=>{const i=o[n];if(V.Ok==function(e,t,n){e.emit("src",n),"string"==typeof n.src&&(e.original_src=n.src);const r=function(e,t,n){return e.plugins.filter(e=>{return(t=e)&&"wants"in t;var t}).find(e=>e.wants(n.src||"",n,t))}(e,t,n);return r?(r.onload(t,e.root,e,n),V.Ok):V.Err}(e,t,i)||V.Ok==function(e,t,n,r={safari:!1}){/^audio\//.test(n.type||"")&&e.emit("audioonlysource");t.start_time&&(n.src=n.src+"#t="+t.start_time);if(""==e.canPlayType(n.type||""))return V.Err;if(n.drm&&(!n.drm["com.apple.fps.1_0"]||!r.safari))return V.Err;"string"==typeof n.src&&(e.src=n.src);return V.Ok}(e,t,i,r))return!0;n==o.length-1&&"string"==typeof i.src&&(e.src=i.src)}),function(e,t){(function(e,t){if(!e.currentSrc)return;if("none"==e.opt("preload"))return;if(t.autoplay&&t.autoplay>0)return;e.load()})(e,t),"none"==e.opt("preload")&&e.render()}(e,t),e}!function(e){e[e.Err=0]="Err",e[e.Ok=1]="Ok"}(V||(V={}));const Y=[m,"seeking","src","seek:cancel"];var z;function X(e,t,n){return isNaN(e.duration)||isNaN(e.currentTime)?{}:(t.offset+=n,0==t.offset?Q(e,t):(t.timer&&clearTimeout(t.timer),t.timer=setTimeout((function(){0!=e.reaper&&(e.currentTime=function(e,t,n=0){return Math.max(Math.min(t,e),n)}(e.currentTime+t.offset,e.duration),t.timer=0,Q(e,t))}),1e3),function(e,t){e.setState("will-seek",!0),e.setState(z.BACKWARD,t.offset<0),e.setState(z.FORWARD,t.offset>0)}(e,t),e.emit("seek:queued",t),t))}function Q(e,t){t.timer&&clearTimeout(t.timer),t.timer=t.offset=0,function(e){e.setState(z.FORWARD,!1),e.setState(z.BACKWARD,!1),e.setState("will-seek",!1)}(e)}function J(){if("undefined"==typeof document)return!1;const e=document.documentElement;return e&&"rtl"==e.getAttribute("dir")}function Z(...e){const t=document.createElement("div");return 0==e.length||t.classList.add(...e),t}function $(e,t,n){const r=function(e){return Array.isArray(e)?e.slice(0):e.split(".")}(t);for(;r.length;){if(null==e)return n;const t=r.shift();if("string"!=typeof t)return n;e=e[t]}return null==e?n:e}function ee(e){const t="number"==typeof e?e:parseInt(e,10);return(t>9?"":"0")+t}function te(e){if(isNaN(e)||e>=Number.MAX_SAFE_INTEGER)return"";const t=e<0?"-":"";e=Math.round(Math.abs(e));const n=Math.floor(e/3600);let r=Math.floor(e/60);return e-=60*r,n>=1?(r-=60*n,t+n+":"+ee(r)+":"+ee(e)):t+ee(r)+":"+ee(e)}!function(e){e.FORWARD="forward",e.BACKWARD="backward"}(z||(z={}));const ne=navigator.languages||[navigator.language];function re(e,t,n){const r={};return n=t.lang||n,e[n]&&(r[n]=e[n]),function(){try{return ne.reduce((e,t)=>~t.indexOf("-")?e.concat(t,t.split("-")[0]):e.concat(t),[])}catch(e){return[]}}().forEach((function(t){e[t]&&!r[t]&&(r[t]=e[t])})),Object.values(r)}const oe={3:!0,5:!0,7:!0,9:!0};function ie(){return(e=Array(16),Array.from({length:e.length}).map((e,t)=>t).forEach(t=>{let n;0==(3&t)&&(n=4294967296*Math.random()),e[t]=(n||0)>>>((3&t)<<3)&255}),e).reduce((function(e,t,n){const r=(t+256).toString(16).substr(1);return e+(n.toString()in oe?"-":"")+r}),"");var e}let ae="";!function(){let e=!1;try{const t=Object.defineProperty({},"passive",{get:function(){e=!0}});window.addEventListener("testPassive",null,t),window.removeEventListener("testPassive",null,t)}catch(e){}}();const se=["touchstart","touchmove"];function ue(e,t){const n=new CustomEvent(e,{detail:t});return t&&Object.defineProperty(n,"data",{get:()=>t}),n}function ce(e,t,n){const r=ue(t,n);return e.dispatchEvent(r),e}function le(e,t,n){const r=ue(t,n);return e.dispatchEvent(r),r}function de(e,t,n,r){Array.isArray(t)?t.forEach(t=>fe(e,t,n,r)):fe(e,t,n,r)}function fe(e,t,n,r){if(o=t,!~se.indexOf(o))return e.addEventListener(t,n,r),e;var o;const i=Object.assign(r||{},{passive:!0});return e.addEventListener(t,n,i),e}function pe(e,t,n,r){return de(e,t,n,Object.assign(r||{},{once:!0}))}const me={preload:"none",rtl:!1,controls:!0},he=["loop","muted","preload"];function ve(e,r,o){o.toJSON=function(){return{duration:o.duration,volume:o.volume,currentTime:o.currentTime,states:o.root.className}},o.setSrc=function(t){return K(o,e,t,n())},o.playerState=o.playerState||{},o.setState=function(e,t){if(o.playerState[e]===!!t)return o;const n=Object.assign({},o.playerState,{[e]:t});return n[A]&&(n[_]=!1),o.playerState=n,ce(o,"state",o.playerState),o},o.hasState=function(e){return!!o.playerState[e]},o.transitionState=function(e,t,n){o.hasState(e)&&(n=0),n&&o.setState("is-toggling",!0),o.setState(t,!1),o.setState(e,!0),n&&setTimeout((function(){o.setState("is-toggling",!1)}),n)},o.render=function(e,t){return"string"==typeof e?x.render(e,t):(ce(o,n().ios?l:d),ce(o,"canplay"),o)},o.emit=(e,t)=>(ce(o,e,t),o),o.on=(e,t)=>(de(o,e,t),o),o.once=(e,t)=>(pe(o,e,t),o),o.off=(e,t)=>{var n,r;return n=e,r=t,o.removeEventListener(n,r),o},o.poll=(e,t)=>le(o,e,t),o.togglePlay=function(t){return D(o,e,t)},o.toggleMute=function(e){e=null==e?!o.muted:!!e,o.muted=e,o.muted||o.volume||(o.volume=1),ce(o,"volumechange")},o.toggleDisable=function(e){e=null==e?!o.disabled:!!e,o.setState("is-disabled",e),o.disabled=e},o.destroy=function(){o.pause();const e=t.indexOf(o);~e&&t.splice(e,1),setTimeout((function(){o.setSrc([]),o.reaper&&o.reaper.clear(),ce(o,m)}),0)},o.setAttrs=function(e){return he.forEach(t=>{if(!(t in e))return;const n=e[t];n?o.setAttribute(t,n.toString()):o.removeAttribute(t)}),o},o.opt=function(t,n){return n=void 0===n?$(me,t):n,$(e,t,n)},o.i18n=function(e,t){if(!o.reaper)return"";const n=o.reaper.get("translations");return n?function e(t,n,r,o){return(o=o||0)>=t.length?r:$(t[o],n,e(t,n,r,o+1))}(n,e,t||""):t||""},o.setOpts=function(t){Object.assign(e,t),"disabled"in t&&void 0!==t.disabled&&o.toggleDisable(t.disabled),"muted"in t&&void 0!==t.muted&&o.toggleMute(t.muted);const n=!!e.autoplay&&!o.hasState("no-autoplay");o.setState("is-autoplay",n),o.setState("is-rtl",o.opt("rtl",function(e){if(!e)return J();const t=e.getAttribute("dir");return t?"rtl"==t:J()}(r))),o.setState("is-live",!!e.live),o.setState("no-timeline",!(!e.live||e.dvr)),o.setState("has-poster","string"==typeof e.poster&&e.poster.length>0),o.setState("is-seekable",!!e.seekable),r.style.backgroundImage=o.hasState("has-poster")?"url('"+e.poster+"')":"",ce(o,h,e)},o.renderPlugin=function(e){le(o,"renderplugin",e).defaultPrevented||o.root.appendChild(e)};const i={offset:0,timer:0};var a,s;s=i,(a=o).on(Y,(function(){Q(a,s)})),o.enqueueSeek=function(e){if(0!=o.opts.seekable&&!(1==o.opts.disabled&&e>0))return X(o,i,e)},o.deviceId=function(){return function(){if(ae)return ae;try{const e=localStorage.getItem("flowplayer/uuid");if(e)return e;const t=ie();return localStorage.setItem("flowplayer/uuid",t),t}catch(e){return ae=ie()}}()}}function ge(e,t){const n=t.querySelector("video"),r=n||(e._video_element_callback?e._video_element_callback(e):document.createElement("video"));return r.classList.add("fp-engine"),r.playsInline=!0,n||t.append(r),r}function ye(e,t){if("object"==typeof exports&&"undefined"!=typeof module)return t;"flowplayer"in e||(e.flowplayer={extensions:[]});const n=e.flowplayer;return"function"==typeof n?(n(t),t):(Array.isArray(n.extensions)||(n.extensions=[]),~n.extensions.indexOf(t)||n.extensions.push(t),t)}function _e(){return"undefined"!=typeof window?window:"undefined"!=typeof global?global:{}}const Ee=["localhost","127.0.0.1","0.0.0.0","s.codepen.io","cdpn.io","try.flowplayer.com"];function be(e,t){return!!~Ee.indexOf(e)||e.indexOf(t)===e.length-t.length}be.check_whitelist=function(e){return!!~Ee.indexOf(e)};const we="production";function Se(e,t){const n={valid_jwt:!1,raw:"",data:{acl:0},exp:0};let r={c:"{}",exp:0};t=t||{};try{r=M(e),n.valid_jwt=!0}catch(e){}return n.raw=e,n.data=JSON.parse(r.c),n.exp=r.exp,t.require_valid_token&&Se.validate(n),n}function ke(e){try{return Se.validate(e),{success:!0,message:""}}catch(e){return{success:!1,message:e.message}}}var Ae;function Oe(e){return{grant:e,is_granted:t=>(e&t)===t}}function Te(e,t,n){t&&t.destroy(),console.error(new Error(n.details||n.reason)),e.innerHTML="",e.classList.remove("flowplayer"),e.classList.add("flowplayer-fatal"),e.innerHTML='\n <h2>Playback Error</h2>\n <p>Are you the site owner?</p>\n <a class="troubleshoot" target="_blank" href="https://flowplayer.com/help/developers/troubleshooting">Troubleshoot?</a>\n <img src=""https://flowplayer.com/user/pages/images/logo-white.png""/>\n '}function Ne(e,t){const n=t.clientWidth;t.classList.toggle("is-small",n<600),t.classList.toggle("is-tiny",n<400)}function Le(e,t,r){let o=!0;t.classList.add("flowplayer"),Ne(0,t),de(r,["loadstart",c],(function(){Ne(0,t)})),de(r,"state",(function(){Object.entries(r.playerState).forEach((function([e,n]){t.classList.toggle(e,n)}))})),de(r,"timeupdate",(function(){r.setState(A,!1)})),de(r,h,(function(){const n=r.paused&&(!e.autoplay||t.classList.contains("no-autoplay"))&&0==r.currentTime;[b,w].forEach((function(e){r.setState(e,n)}))})),de(r,"ended",(function(t){setTimeout((function(){t.defaultPrevented||(e.rewind&&!r.loop&&(e.autoplay&&(e.autoplay=0,r.setState("is-autoplay",!1)),r.setState(S,!0),pe(r,p,(function(){r.setState(S,!1),r.pause(),r.setState(w,!0)})),r.currentTime=0),pe(r,"timeupdate",(function(){r.setState(k,!1)})),r.transitionState(k,_,e.loop||e.rewind?0:300))}),0)})),de(r,["seeking",p],(function(e){r.setState(S,"seeking"==e.type),r.setState(E,r.paused),r.setState(_,!r.paused)})),de(r,"ended",(function(){r.setState(_,!1),o=!0})),de(r,n().ios?l:d,(function(e){const t="src"!=e.type||"none"!==r.opt("preload");r.setState("is-loaded",t),r.setState(b,!t)})),de(r,["waiting","canplay","loadstart"],(function(t){if(!r.hasState(S)&&("canplay"!=t.type||e.autoplay||r.setState(A,!1),"loadstart"!=t.type||"none"!=r.opt("preload")||e.autoplay)){if("loadstart"==t.type&&e.autoplay)return pe(r,f,(function(){r.setState(A,!1)}));"waiting"==t.type&&[_,E,w].forEach((function(e){r.setState(e,!1)})),r.setState(k,!1),r.setState(A,"waiting"==t.type)}})),de(r,[f,"pause"],(function(t){setTimeout(()=>{const e=new CustomEvent("flowplayer/"+t.type,{detail:r});document.dispatchEvent(e)},0);const n=t.type==f,i=r.currentTime==r.duration,a=n&&o&&e.autoplay||r.hasState(A);if(n&&(r.started=!0,o=!1),r.setState(A,!1).setState(w,!1),i||r.hasState(S))return;const s=n?_:E,u=n?E:_;r.transitionState(s,u,a?0:300),n&&r.setState("no-autoplay",!1)}))}function Re(e){const t=function(e){const t=e.getBoundingClientRect(),n=window.innerHeight,r=t.height,o=t.bottom,i=r/5;return t.top<=i&&t.top+r>n-i||o-r+i>=0&&o<n+i}(e.root);return e.in_viewport===t||(e.in_viewport=t,ce(e,t?"viewenter":"viewleave")),e}function Ie(e,n,o){Re(o);const i={should_resume:!!e.autoplay,has_user_gesture:!1,locked:!1};[u,r].forEach(e=>pe(o,e,()=>i.has_user_gesture=!0)),de(o,"play",(function(){i.locked||(i.should_resume=!0)})),de(o,"pause",(function(){i.locked||(i.should_resume=!1)})),de(o,"canplay",(function(n){e.autoplay&&!t.filter((function(e){return!e.paused})).length&&o.in_viewport&&o.paused&&i.should_resume&&o.togglePlay(!0)})),e.autopause&&(de(o,"viewenter",(function(){i.should_resume&&o.togglePlay(!0)})),de(o,"viewleave",(function(){const e=!o.paused;i.locked=!0,o.pause(),setTimeout((function(){i.should_resume=e,i.locked=!1}),0)})))}Se.validate=function(e){if("string"==typeof e&&(e=Se(e)),!e||!e.raw){if(be.check_whitelist(window.location.hostname)||"dev"===we.toString())return!0;throw new Error("No token provided in configuration")}if(!e.valid_jwt)throw new Error("Invalid token provided");const t=window.location.hostname,n=be.bind(null,t);if("dev"!==we.toString()&&e.data.domain&&e.data.domain.length&&!e.data.domain.some(n))throw new Error("Domain not allowed");if("dev"!==we.toString()&&1e3*e.exp-Date.now()<0)throw new Error("Expired token");return!0},Se.id=function(e){if(e)return"string"==typeof e&&(e=Se(e)),e.data.id},function(e){e[e.ADS=2]="ADS",e[e.ANALYTICS=4]="ANALYTICS",e[e.NO_METERING=8]="NO_METERING",e[e.DEVELOPER_PLAN=16]="DEVELOPER_PLAN"}(Ae||(Ae={})),Oe.of=Oe,Oe.from_token=function(e){const t=Se(e,{require_valid_token:!0});return Oe.of(t.data.acl)},Oe.permissions=Ae,[i,c].forEach(e=>{window.addEventListener(e,(function(){t.forEach((function(e){const t=e.root;t.prevWidth!=t.clientWidth&&(ce(e,c),t.prevWidth=t.clientWidth)}))}))}),window.addEventListener("scroll",(function(){t.forEach(Re)}));function Pe(e){if("number"==typeof e&&!isNaN(e))return Number(e);if("string"==typeof e){const t=e.split(":");return Number(t[1])/Number(t[0])}return e}function Me(e,t,n){const r=document.createElement("div");r.classList.add("fp-ratio"),t.append(r);let o=Pe(e.ratio||.5625);r.style.paddingTop=100*o+"%";const i=[d,l];n.on(i,(function(){const e=n.videoHeight&&n.videoWidth&&n.videoHeight/n.videoWidth;e&&n.setOpts({ratio:e})})),n.on(h,(function(){const t=n.videoHeight&&n.videoWidth&&n.videoHeight/n.videoWidth,i=Pe((null==e?void 0:e.ratio)||t||.5625);o!==i&&(o=i,r.style.paddingTop=100*i+"%")}))}const xe="flowplayer/"+f;function Ue(e){const t=t=>{if(t.detail===e)return;const n=e.opt("multiplay");"boolean"==typeof n&&!1===n&&e.pause()};e.on(m,()=>document.removeEventListener(xe,t)),document.addEventListener(xe,t)}const De=function(){const e=_e(),t=e.flowplayer?e.flowplayer:{extensions:[]};return Array.isArray(t.extensions)||(t.extensions=[]),t}();function Ce(n,r){if("function"==typeof n)return e.push(...[...arguments].filter(e=>"function"==typeof e)),Ce;"string"==typeof r&&(r={src:r}),r||(r={}),r.token||"string"!=typeof window.__FLOWPLAYER_TOKEN||(r.token=window.__FLOWPLAYER_TOKEN);const o="string"==typeof n?document.querySelector(n):n;if(!o)return console.error(new Error("Flowplayer: '"+n.toString()+"' not found"));const i=o.querySelector("video.fp-engine");if(i)return i;const a=ke(r.token);if(!a.success)return Te(o,null,{reason:"token",details:a.message});const s=new Map,u=ge(r,o);if(u.reaper=s,Object.defineProperty(u,"token",{value:"string"==typeof r.token?Se.id(r.token):"",writable:!1}),u.addEventListener(m,()=>{s.clear(),u.reaper=0,delete u.root}),u.root=o,r.token&&Oe.from_token(r.token).is_granted(Oe.permissions.DEVELOPER_PLAN))return Te(o,null,{reason:"developer_plan",details:"Using developer plan tokens is not currently supported"});!~t.indexOf(u)&&t.push(u),ve(r,o,u),u.setAttrs(r),u.plugins=Ce.extensions.map(e=>new e(Ce,u)),Le(r,o,u),Ie(r,0,u),Me(r,o,u),Ue(u),u.plugins.forEach(e=>{try{e.init(r,o,u)}catch(t){console.log("Error(plugin/%s)",e.constructor.name,t)}}),u.setOpts(r),u.opts=r,r.src&&u.setSrc(r.src);const c=u.readyState;return c>0&&u.currentSrc&&u.emit(l),c>2&&u.currentSrc&&u.emit("canplay"),"none"==u.opt("preload")&&u.paused&&u.currentSrc&&u.render(),u.emit("mount"),u.on("error:fatal",(function(e){Te(o,u,e.data||{})})),u}Object.assign(Ce,De),function(r){Array.isArray(r.extensions)&&r.extensions.forEach(t=>e.push(t)),r.components=x,r.version="3.0.0-rc6",r.commit="3ff5575be008bca83fb98f88bd7b5012f71fbe28",r.instances=t,r.extensions=e,r.support=n,r.events=y,r.states=T,r.jwt=M,r.autoplay=P,r.quality=U}(Ce),"object"==typeof document&&setTimeout(ce,0,document,"flowplayer:umd",Ce);var Ge="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function je(e){var t={exports:{}};return e(t,t.exports),t.exports}var Fe=je((function(e,t){var n=Ge&&Ge.__assign||function(){return(n=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};t.__esModule=!0,t.remove=t.downcase=t.pluck=t.merge=void 0,t.merge=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.reduce((function(e,t){return n(n({},e),t)}),{})},t.pluck=function(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];return Object.keys(e).filter((function(e){return~n.indexOf(e)})).reduce((function(n,r){var o;return t.merge(n,((o={})[r]=e[r],o))}),{})},t.downcase=function(e){return(e||"").toString().toLowerCase()},t.remove=function(e,t){var n=e.lastIndexOf(t);return~n&&e.splice(n,1),e}})),qe=je((function(e,t){var n=Ge&&Ge.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),r=Ge&&Ge.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=Ge&&Ge.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)"default"!==o&&Object.hasOwnProperty.call(e,o)&&n(t,e,o);return r(t,e),t};t.__esModule=!0;var i=o(Fe),a=function(){function e(){this.pending=[],this.open=[],this.stats={failures:0,ttl:0}}return e.of=function(){return new e},e.is_empty=function(e){return 0==e.pending.length},e.is_high_water=function(t){return t.open.length==e.MAX_OPEN_REQUESTS},e.maybe_spawn_req=function(t){if(e.is_empty(t))return t;if(e.is_high_water(t))return t;try{var n=e.lpop(t);n&&e.request(t,n)}catch(e){}},e.increment_failures=function(t){return t.stats.failures++,t.stats.failures>e.MAX_FAILURE_COUNT&&(t.stats.ttl=Date.now()+e.REQUEST_TTL_MS),t},e.handle_error=function(t,n){e.rm(t,n),e.increment_failures(t)},e.request=function(t,n){var r=n[0],o=n[1],i=n[2];if(!(Date.now()<t.stats.ttl)){var a=new XMLHttpRequest;t.open.push(a),a.timeout=e.REQUEST_TIMEOUT_MS,a.ontimeout=function(){e.handle_error(t,a)},a.onerror=function(n){e.handle_error(t,a)},a.onreadystatechange=function(){a.readyState==XMLHttpRequest.DONE&&e.rm(t,a),Math.floor(a.status/100)},a.onload=function(){e.rm(t,a),t.stats.failures&&t.stats.failures--},a.open(o,r),a.setRequestHeader("Content-Type","text/plain;charset=UTF-8");try{a.send(JSON.stringify(i))}catch(e){}}},e.rpush=function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];return n.forEach((function(n){t.pending.length>=e.MAX_PENDING||(t.pending.push(n),e.maybe_spawn_req(t))})),t},e.lpop=function(e){return e.pending.shift()},e.rm=function(e,t){return i.remove(e.open,t),e},e.MAX_OPEN_REQUESTS=3,e.MAX_PENDING=5,e.REQUEST_TIMEOUT_MS=4e3,e.REQUEST_TTL_MS=5e3,e.MAX_FAILURE_COUNT=3,e}();t.default=a})),He=je((function(e,t){var n=Ge&&Ge.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};t.__esModule=!0;var r=n(qe);t.default=r.default.of()})),Be=je((function(e,t){t.__esModule=!0,t.prepare_url=t.URL_PARAM=void 0,t.URL_PARAM=/:([a-zA-Z_]+)/g,t.prepare_url=function(e,n){return e.url.replace(t.URL_PARAM,(function(t){if((t=t.slice(1,t.length))in n)return n[t].toString();e.log.error(new Error("\n preparing url["+e.url+"] failed\n \n parameter["+t+"] not detected in params:\n \n "+JSON.stringify(n,null,2)+"\n "))}))}})),We=je((function(e,t){t.__esModule=!0,t.Log=void 0;var n=function(){function e(e){this.emitter=e}return e.prepare=function(e,t){var n=document.createEvent("Event");return n.initEvent(e,!1,!0),n.ns=e,n.data=t,n},e.of=function(t){return new e(t)},e.prototype.info=function(t){this.emitter.dispatchEvent(e.prepare(e.NAMESPACE.INFO,t))},e.prototype.error=function(t){this.emitter.dispatchEvent(e.prepare(e.NAMESPACE.ERROR,t))},e.prototype.warn=function(t){this.emitter.dispatchEvent(e.prepare(e.NAMESPACE.WARN,t))},e.NAMESPACE={INFO:"tracker:info",ERROR:"tracker:err",WARN:"tracker:warn"},e}();t.Log=n})),Ve=je((function(e,t){var n;t.__esModule=!0,t.Verb=void 0,(n=t.Verb||(t.Verb={})).POST="POST",n.PUT="PUT",n.GET="GET"})),Ke=je((function(e,t){var n=Ge&&Ge.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),r=Ge&&Ge.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=Ge&&Ge.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)"default"!==o&&Object.hasOwnProperty.call(e,o)&&n(t,e,o);return r(t,e),t},i=Ge&&Ge.__spreadArrays||function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),o=0;for(t=0;t<n;t++)for(var i=arguments[t],a=0,s=i.length;a<s;a++,o++)r[o]=i[a];return r},a=Ge&&Ge.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};t.__esModule=!0;var s=a(He),u=a(qe),c=o(Be),l=o(Fe),d=function(){function e(t,n){var r=this;void 0===n&&(n={});var o=this;if(this.emitter=t,this.url=n.url,this.log=We.Log.of(this.emitter),this.verb=n.verb,this.metadata=l.merge({},n.metadata||{}),this.rq=n.rq||s.default,this.events=n.events||[],this.required_keys=n.required_keys||[],this.optional_keys=n.optional_keys||[],this.listeners=[],this.valid_keys=this.required_keys.slice(0).concat(this.optional_keys),e.assert_emitter_api(this.emitter),void 0===e.verb[this.verb])throw new Error("invalid HTTP verb["+this.verb+"] passed");if("string"!=typeof this.url)throw new Error("invalid API url["+this.url+"] passed");e.TRACKERS.push(this),o.events.forEach((function(t){e.create_listener(r,t,(function(n){void 0===n&&(n={});var i=l.merge(o.metadata,{event_type:t},n.data||n),a=c.prepare_url(o,i),s=e.pluck_valid_keys(o,i),d=e.ensure_required_keys(o,s);if(d.length)return o.log.error("Tracker.validate_metadata() failed for \n Event["+t+"]\n missing keys: "+d+"\n payload:\n "+JSON.stringify(s,null,2));u.default.rpush(r.rq,[a,r.verb,s])}))}))}return e.of=function(t,n){return new e(t,n)},e.ensure_required_keys=function(e,t){return e.required_keys.filter((function(e){return!(e in t)}))},e.pluck_valid_keys=function(e,t){return l.pluck.apply(l,i([t],e.valid_keys))},e.merge_metadata=function(t,n){return void 0===n&&(n={}),t.metadata=e.pluck_valid_keys(t,l.merge(t.metadata,n)),t},e.assert_emitter_api=function(e){if("function"!=typeof(e||{}).addEventListener)throw new Error("Tracker() received an emitter that does not implement the addEventListener method");if("function"!=typeof(e||{}).removeEventListener)throw new Error("Tracker() received an emitter that does not implement the removeEventListener method")},e.create_listener=function(e,t,n){e.listeners.push([t,n]),e.emitter.addEventListener(t,n)},e.prototype.destroy=function(){var t=this;this.listeners.forEach((function(e){var n=e[0],r=e[1];return t.emitter.removeEventListener(n,r)})),delete this.rq,delete this.emitter,l.remove(e.TRACKERS,this)},e.prototype.put=function(t){return void 0===t&&(t={}),e.merge_metadata(this,t),this},e.TRACKERS=[],e.QUEUE=s.default,e.verb=Ve.Verb,e}();t.default=d})),Ye=je((function(e,t){var n=Ge&&Ge.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),r=Ge&&Ge.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=Ge&&Ge.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)"default"!==o&&Object.hasOwnProperty.call(e,o)&&n(t,e,o);return r(t,e),t},i=Ge&&Ge.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};t.__esModule=!0,t.API=t.Tracker=void 0;var a=i(Ke);t.Tracker=a.default;var s=o(Be);t.API=s})),ze="ping",Xe="display",Qe="view";const Je=["sitegroup_id","session_id","media_id","site_id","player_id","video_type"],Ze=["created","position"],$e=["player_version","created","source","category","category_id","autoplay","muted","customer_user_id"];function et(e,t){return e.duration/1===e.duration&&Object.assign(t,function(e){const t=e/100;return{segment_duration:t,breakpoints:Array(...Array(100)).map((function(e,n){return Math.floor(n*t*1e3)/1e3}))}}(e.duration))}function tt(e,t,n){if(!t.segment_duration&&!et(e,t))return;const r=function(e,t,n){const r=t.last_idx,o=n?99:nt(e,t);return t.last_idx=o,o<=r?[]:t.breakpoints.slice(r,99==o?100:o).map((function(e){return t.breakpoints.indexOf(e)}))}(e,t,n);0!=r.length&&e.emit(ze,{position:r})}function nt(e,t){return Math.min(Math.floor(e.currentTime/t.segment_duration),99)}const rt="vod",ot="live",it=[Xe,ze,Qe];function at(e,t,n){switch(null==t?void 0:t.kind){case"live":return function(e,t){const n=Date.now();n-t.last_tracked_ts<6e4||(t.last_tracked_ts=n,++t.ticks,e.emit(ze,{position:60*t.ticks}))}(e,t);case"vod":return tt(e,t,"boolean"==typeof n&&n)}}function st(e){const t=e.ads;return void 0!==t&&(void 0!==t.schedule&&("function"==typeof t.hasPreroll&&(t.currentRequests?t.currentRequests:!!t.adPlaying||!(!t.hasPreroll()||0!=t.nextIndex))))}function ut(){try{return window.location!==window.parent.location?document.referrer:document.location.href}catch(e){return!1}}class ct{init(e,t,n){if(!Oe.from_token(e.token||"").is_granted(Oe.permissions.ANALYTICS))return;if(n.analytics)return;const r=n.analytics={ticker:void 0,last_media_id:"",ended:!1},o={locked:!1,ttl:6e3,task:()=>{at(n,r.ticker)}};const i={session_id:n.deviceId(),autoplay:n.autoplay,muted:n.muted,player_id:e.player_id,customer_user_id:e.customer_user_id},a=Ye.Tracker.of(n,{verb:Ye.Tracker.verb.POST,url:"https://ptm.flowplayer.com/:video_type/:sitegroup_id/:event_type",events:it,required_keys:Je,optional_keys:$e.concat(Ze).slice(0),metadata:i});n.on(m,(function(){a&&a.destroy()})),n.on(h,(function(t){if(!a)return;const o=$(t,"data.metadata",{});if(!o.media_id)return;const i=$(a,"metadata.media_id");if(i&&o.media_id==i)return;const s=$(e,"analytics",{});a.put(o),a.put(s);const u=$(e,"metadata.live_start_time",e.live)?ot:rt;a.put({video_type:u,source:e.source||ut()||""}),r.ticker=e.live?{ticks:0,last_tracked_ts:Date.now(),kind:"live"}:{last_idx:0,segment_duration:0,breakpoints:[],kind:"vod"},r.ended=!1,n.emit(Xe)}));let s=0;n.on(f,(function(){if(!a)return;if(s||function(e,t){return e.metadata.media_id&&e.metadata.media_id==t.last_media_id}(a,r))return;a.put({muted:n.muted});const e=st(n);if(e)return s=Promise.resolve(e).then((function(){r.last_media_id=a.metadata.media_id,n.emit(Qe),s=0})).catch((function(){s=0}));r.last_media_id=a.metadata.media_id,n.emit(Qe)})),n.on("timeupdate",(function(){var t;a&&(s||st(n)||r.ended||(!e.live&&n.currentTime+.25>=n.duration&&at(n,r.ticker,!0),(t=o).locked||(t.locked=setTimeout((function(){return t.task(),function(e){return e.locked=!1,e}(t)}),t.ttl))))})),n.on(p,(function(){a&&r.ticker&&"vod"==r.ticker.kind&&function(e,t){et(e,t),t.last_idx=nt(e,t)}(n,r.ticker)})),n.on("ended",(function(){a&&function(e,t){t.ended||(t.ended=!0,at(e,t.ticker))}(n,r)}))}}function lt(e,t,n){!function(e,t,n){"undefined"!=typeof window&&"ontouchstart"in window&&n.setState("is-touch-device",!0);let r=!1;n.setState("is-accessibility",!1);const o=t.querySelector(".fp-middle");o&&o.addEventListener(u,(function(e){0!=e.cancelable&&(e.preventDefault(),n.emit(e.type,{source:e}))})),n.on(u,(function(e){setTimeout((function(){if(e.defaultPrevented)return;if(n.hasState(A))return;if(n.ended)return n.togglePlay(!0);const t=n.hasState(w);r&&clearTimeout(r),(t||n.hasState(O)||n.hasState("no-autoplay"))&&(n.hasState(O)&&(n.setState(O,!1),n.setState("is-hovered",!1)),n.togglePlay(),t)||(n.setState(O,!0),n.paused||(r=setTimeout((function(){r=!1,n.setState(O,!1),n.setState("is-hovered",!1)}),2e3)))}),0)}))}(0,t,n)}function dt(e,t,n){let r=()=>document.fullscreenElement,i="fullscreenchange";if(!Element.prototype.requestFullscreen){const e=Element.prototype,t=document;e.webkitRequestFullScreen&&(e.requestFullscreen=e.webkitRequestFullScreen,t.fullscreenEnabled=!0),t.webkitCancelFullScreen&&(document.exitFullscreen=t.webkitCancelFullScreen),i="webkit"+i,r=()=>t.webkitCurrentFullScreenElement}n.toggleFullScreen=function(e,r){n.ios_fullscreen_disabled||("boolean"!=typeof e&&(e=!n.in_fullscreen),ft(n)&&(e?function(e){e.getAttribute("playsinline")&&e.removeAttribute("playsinline");e.getAttribute("webkit-playsinline")&&e.removeAttribute("webkit-playsinline");e.webkitEnterFullScreen()}(n):function(e,t){e.getAttribute("playsinline")||e.setAttribute("playsinline","");e.getAttribute("webkit-playsinline")||e.setAttribute("webkit-playsinline","");t||e.webkitExitFullScreen();e.togglePlay(!1),e.hasState(O)||e.setState(O,!0)}(n,r)),document.fullscreenEnabled&&(e?t.requestFullscreen():document.exitFullscreen()))},ft(n)&&(n.ios_fullscreen_disabled=!0,n.once("beforeplay",(function(){n.ios_fullscreen_disabled=!1})),n.on("webkitendfullscreen",(function(){n.toggleFullScreen(!1,!0)}))),t.addEventListener(i,(function(){const e=r(),o=e===t||e==n;n.in_fullscreen=o,n.emit(o?"fullscreenenter":"fullscreenexit"),n.setState("is-fullscreen",o),n.emit(c)})),!1!==e.doubleclick&&t.addEventListener(o,(function(e){var t;e.target&&(null===(t=e.target)||void 0===t?void 0:t.classList.contains("fp-ui"))&&n.toggleFullScreen()}))}function ft(e){return n().ios&&"function"==typeof e.webkitEnterFullScreen&&"function"==typeof e.webkitExitFullScreen}ye(_e(),ct),"undefined"!=typeof window&&window.matchMedia&&[v,g].forEach((function(e){window.matchMedia("(orientation: "+e+")").addListener((function(n){t.length&&t.forEach((function(t){n.matches&&t.emit(e)}))}))}));const pt={name:"fp-fullscreen",translation_key:"core.fullscreen"},mt={name:"fp-fullscreen-exit",translation_key:"core.exit_fullscreen"},ht={name:"fp-play",translation_key:"core.play"},vt={name:"fp-pause",translation_key:"core.pause"},gt={translation_key:"core.mute",name:"fp-volume-mute-unmute"},yt={translation_key:"core.play",name:"fp-small-play"},_t={translation_key:"core.pause",name:"fp-small-pause"},Et={name:"fp-fast-forward"};function bt(e){const t=document.createElement("div");return t.classList.add("fp-icon",e.name),e.title&&t.setAttribute("title",e.title),e.title&&t.setAttribute("aria-label",e.title),t.setAttribute("tabindex","0"),t.setAttribute("focusable","true"),t}function wt(e,t,n){const o=Z("fp-header"),i=Z("fp-primary"),a=Z("fp-duration"),s=function(e,t){const n=Z();n.classList.add("fp-secondary","fp-togglable"),dt(e,t.root,t);const o=bt(pt);o.setAttribute("role","button"),o.setAttribute("aria-label",t.i18n("core.fullscreen"));const i=bt(mt);return i.setAttribute("role","button"),i.setAttribute("aria-label",t.i18n("core.fullscreen_exit")),o.addEventListener(r,()=>t.toggleFullScreen()),i.addEventListener(r,()=>t.toggleFullScreen()),n.append(o,i),n}(e,n),u={logo:""};n.on(h,(function(e){var t,n,r,o,s;o=a,s=(null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.duration)||NaN,o.innerText=isFinite(s)?te(s):"";const c=u.logo,l=(null===(n=null==e?void 0:e.data)||void 0===n?void 0:n.logo)||"";c!=l&&(u.logo=l,function(e,t,n){if(e.innerHTML="",!t)return;const r=document.createElement("img");if(r.classList.add("fp-logo"),r.src=t,!n)return e.append(r);const o=document.createElement("a");o.href=n,o.append(r),e.append(o)}(i,l,null===(r=null==e?void 0:e.data)||void 0===r?void 0:r.logo_href))})),o.append(i,a,s),t.append(o),n.reaper&&(n.reaper.set("header",o),n.reaper.set("header.secondary",s))}var St=Object.freeze({__proto__:null,NO_FULLSCREEN:1,NO_VOLUME_CONTROL:2,NO_MUTE:4,LOGO_ON_RIGHT:8,USE_DRAG_HANDLE:16,USE_PLAY_2:32,USE_PLAY_3:64,USE_THIN_CONTROLBAR:128,NO_TITLE:256,NO_DESCRIPTION:512,NO_CONTROLS:1024,NO_DURATION:2048,NO_HEADER:4096,AUDIO_ONLY:8192,NO_TOUCH_ZONES:16384});function kt(e,t,n){if(!n.reaper)return;const i=Z("fp-middle"),a=Z("fp-left-zone"),s=Z("fp-middle-zone"),c=Z("fp-right-zone"),l=[a,s,c];!function(e,t){const n=t[0],r=t[1];e.on(p,(function(){t.forEach(Ot)})),e.on("seek:queued",(function(e){const o=e.data;if(!o)return;if("number"!=typeof o.offset)return;const i=o.offset;if(0==i)return t.forEach(Ot);const a=i>0?r:n;return Ot(a==r?n:r),function(e,t){const n=e.querySelector(".fp-zone-seconds");n&&(n.innerText=Math.abs(t)+"")}(a,i)})),e.on("seek:cancel",(function(){t.forEach(Ot)})),t.forEach((function(t){const r=t==n?-1:1,o=document.createElement("span"),i=At(Et);o.classList.add("fp-zone-seconds"),t.append(o,i),Ot(t),t.addEventListener(u,(function(t){isNaN(e.duration)||isNaN(e.currentTime)||16384&e.opt("ui")||e.hasState("no-timeline")||!e.hasState("will-seek")&&!e.hasState(O)||e.enqueueSeek(5*r)&&(t.stopPropagation(),t.preventDefault())}))}))}(n,[a,c]),l.forEach((function(e){i.append(e)})),n.reaper.set("middle",i),function(e,t){[r,o].forEach(n=>e.addEventListener(n,(function(e){if(!e.defaultPrevented)return e.preventDefault(),t.emit(e.type),!1}))),t.on(r,(function(e){setTimeout((function(){e.defaultPrevented||t.hasState(A)||t.togglePlay()}),0)})),t.on(o,(function(e){setTimeout((function(){e.defaultPrevented||t.toggleFullScreen()}),0)}))}(i,n),function(e){const t=Z("fp-wait");Array(...Array(4)).map((e,t)=>t).forEach(()=>{t.append(document.createElement("b"))}),e.append(t)}(s);const d=Z("fp-switch");return d.append(...[ht,vt].map(At)),s.append(d),t.append(i),i.setAttribute("tabindex","0"),i.setAttribute("role","button"),i.setAttribute("aria-label",n.i18n("core.play")),[f,p].forEach(e=>n.once(e,(function(){i.removeAttribute("tabindex"),i.removeAttribute("role"),i.removeAttribute("aria-label")}))),i}function At(e){const t=bt(e);return t.removeAttribute("tabindex"),t}function Ot(e){const t=e.querySelector(".fp-zone-seconds");t&&(t.innerText="")}function Tt(){}document.addEventListener(r,(function(e){this.active_menu&&!this.active_menu.contains(e.target)&&(Array.from(document.querySelectorAll(".fp-engine")).forEach(e=>{const t=e.root.querySelector("details[open].fp-menu-container");t&&(t.open=!1,e.root.classList.toggle("has-menu-opened",!1))}),this.active_menu=void 0)}));const Nt={passive:!0};var Lt;function Rt(e,t){let n=0,r=-1,o=-1;const i=Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5),a=e.classList;e.id=i,a.remove(Lt.GRABBING),a.remove(Lt.TOUCHING);const s=t.onseek||Tt,c=t.onstart||Tt,l=t.onend||Tt,d=t.onmouse||Tt,f=t.ontouch||Tt,p=t.ontouchend||Tt;function m(t){!function(){const t=e.getBoundingClientRect();n=t.left,r=t.width}();let o=(function(e){return"function"==typeof window.TouchEvent&&e instanceof TouchEvent}(t)?t.changedTouches[0].pageX:t.pageX)-n;return o>r&&(o=r),o<0&&(o=0),o/r*100}function h(t){const n=m(t);n!=o&&(s(e,n),o=n)}return e.addEventListener("touchstart",(function(t){It(e,t)&&(a.add(Lt.TOUCHING),Pt(e.parentElement)&&(t.preventDefault(),a.add(Lt.GRABBING),f(e,m(t)),c(e,m(t)),h(t)))}),Nt),e.addEventListener("touchmove",(function(t){t.preventDefault(),h(t),d(e,m(t))}),Nt),e.addEventListener(u,(function(t){setTimeout((function(){a.remove(Lt.TOUCHING)}),500),It(e,t)&&(t.preventDefault(),a.remove(Lt.GRABBING),p(e,m(t)),l(e,m(t)),r=0)}),Nt),e.addEventListener("touchcancel",(function(){a.remove(Lt.GRABBING,Lt.TOUCHING),r=0}),Nt),e.addEventListener("mousedown",(function(t){a.contains(Lt.TOUCHING)||(document.addEventListener("mousemove",h),a.add(Lt.GRABBING),c(e,m(t)),t.preventDefault(),h(t))})),e.addEventListener("mousemove",(function(t){a.contains(Lt.TOUCHING)||d(e,m(t))})),document.addEventListener("mouseup",(function(t){a.contains(Lt.TOUCHING)||(document.removeEventListener("mousemove",h),a.contains(Lt.GRABBING)&&(a.remove(Lt.GRABBING),l(e,m(t)),r=0))})),e}function It(e,t){const n=t.target;return!!n&&(n&&!n.closest(e.id)||!Pt(e.parentElement)||!e.classList.contains(Lt.TOUCHING))}function Pt(e){if(!e)return!1;const t=window.getComputedStyle(e);return"0"!==t.width&&"0"!==t.height&&"0"!==t.opacity&&"none"!==t.display&&"hidden"!==t.visibility}!function(e){e.GRABBING="has-grab",e.TOUCHING="has-touch"}(Lt||(Lt={}));function Mt(e){if("object"!=typeof e.opts)return{head:0,tail:0};if(0==e.seekable.length)return{head:0,tail:0};const t=e.opt("live_dvr_window",0),n=e.seekable.end(e.seekable.length-1);return{head:n,tail:Math.max(e.seekable.start(0),n-t)}}function xt(e){return e.opt("live",!1)||e.duration>=Number.MAX_SAFE_INTEGER}function Ut(e){return isFinite(e.duration)?e.duration:0==e.seekable.length?0:e.seekable.end(0)}function Dt(e){return function(e){return Mt(e).head}(e)-.5}function Ct(e,t){if(!e.parentElement)return;const n=e.clientWidth/e.parentElement.clientWidth*100/2;e.style.left=t-n+"%",e.style.display="block"}function Gt(e,t){if(isNaN(e.duration))return;const n=e.buffered;n.length&&(t.style.width=Math.min(n.end(n.length-1)/e.duration*100,100)+"%")}function jt(e,t){e.style.width="0",t.style.width="0",t.style.display="none"}function Ft(e,t,n){if(t.seeking||!t.seekable||0==t.seekable.length)return;const r=qt(t,e/100);Ct(n,e);const o=isFinite(t.duration)?r:t.seekable.start(0)+r;n.innerText=te(o)}function qt(e,t){if(t>1||t<0)return console.warn("cannot calculate a percent outside of range(0..1)"),0;if(isFinite(e.duration))return Ut(e)*t;const n=e.seekable.start(0);return n+t*(e.seekable.end(0)-n)}function Ht(e,t){e.style.width="0",t.style.display="none"}const Bt=requestAnimationFrame;function Wt(e,t,n){const o=Z("fp-controls","fp-togglable"),i=Z("fp-timeline","fp-bar"),a=Z("fp-btns","fp-small-switch"),u=Z("fp-live-status"),c=Z("fp-live-indicator","fp-color"),d=Z("fp-live-text"),p=Z("fp-buffer"),m=Z("fp-progress","fp-color"),v=Z("fp-hover"),g=Z("fp-timestamp"),y=Z("fp-duration"),_=Z("fp-dragger","fp-color"),E=document.createElement("span");d.innerHTML="live",g.style.display="none",E.classList.add("fp-elapsed"),E.innerText=te(0),i.setAttribute("role","slider"),i.setAttribute("tabindex","0"),i.setAttribute("aria-label",n.i18n("timeline","Timeline")),i.append(p,m,v,g),o.append(a,u,E,i,y),u.append(c,d);const b=bt(_t);b.setAttribute("role","button");const w=bt(yt);w.setAttribute("role","button"),b.addEventListener("click",(function(){n.togglePlay(),setTimeout((function(){w.focus&&w.focus()}),100)})),w.addEventListener("click",(function(){n.togglePlay(),setTimeout((function(){b.focus&&b.focus()}),100)})),a.append(b,w),m.append(_),u.addEventListener(r,(function(){!function(e,t){try{if(!e.hasState("is-live-seeked"))return;e.dvr_offset=0;const n=Dt(e);e.currentTime=n,e.setState("is-live-seeked",!1),t.style.width="0"}catch(e){console.warn("failed to seek to now: %j",e)}}(n,m)})),n.on(h,(function(t){if(0==n.reaper)return;if(!t.data)return;e.seekable=void 0===t.data.seekable||t.data.seekable;const r=xt(n)?NaN:t.data.duration||0;if(isNaN(r)||r>=Number.MAX_SAFE_INTEGER)return y.style.display="none";y.style.display="inline-block",y.innerText=te(r)}));let k=performance.now();const A=()=>{if(0==n.reaper||e.live)return;const t=performance.now();var r;t-k>1e3/30&&(r=n,m.style.width=r.currentTime/r.duration*100+"%",k=t),n.paused||i.classList.contains(Lt.GRABBING)||Bt(A)};n.on(f,()=>Bt(A)),n.on("timeupdate",(function(){var t;0!=n.reaper&&(Bt(A),i.setAttribute("aria-valuenow",n.currentTime+""),e.live?function(e,t){t.innerText=te(e.currentTime)}(n,E):(t=n,E.innerText=te(t.currentTime)),e.live||Gt(n,p),e.live&&function(e){return!("dvr"in e)||1==e.dvr}(e)&&function(e,t){if(0==t)return!0;const n=Mt(e);return n.head-n.tail>=t}(n,e.seconds_to_dvr||0)&&n.setOpts({dvr:n.seekable.length>0}))})),n.on("progress",(function(){0!=n.reaper&&(e.live||Gt(n,p))})),n.on("live",(function(){n.setState("is-live-seeked",!1),m.style.width="0%"})),n.on("dvr",(function(){const e=Ut(n),t=n.seekable.end(0)-n.seekable.start(0),r=(e-n.currentTime)/t*100,o=Math.round(r);n.setState("is-live-seeked",o>0),m.style.width=o+"%"})),n.on("seeking",(function(){if(!xt(n))return;if(0==n.seekable.length||0==n.played.length)return;if(0==Ut(n))return;const e=Dt(n),t=n.currentTime>=e?"live":"dvr";n.emit(t)})),n.on(l,(function(){var t,r;0!=n.reaper&&(n.setOpts({live:xt(n)}),e.live||(r=y,(t=n).duration&&(r.innerText=te(t.duration)),Gt(n,p)))})),n.on("durationchange",(function(e){if(0==n.reaper)return;const t=xt(n),r=t?Ut(n):e.data||n.duration;isNaN(r)||(n.setOpts({live:t,duration:r}),i.setAttribute("aria-valuemax",r+""),i.setAttribute("aria-valuemin","0"))}));let O=!1;return Rt(i,{onseek:function(t,r){if(Vt(n))switch(!!e.live){case!0:Ft(r,n,g);break;case!1:!function(e,t,n){const r=t.duration*(e/100);if(t.disabled&&r>t.currentTime)return!1;n.style.width=e+"%",t.currentTime=r}(r,n,m),Ct(g,r)}},onstart:function(){Vt(n)&&(n.emit("timeline/gesture/start"),n.setState(S,!0),e.live||function(e){!function(e){e.style.display="block"}(e)}(g))},onend:function(t,r){Bt(A),0!=e.seekable&&(n.setState(S,!1),e.live&&function(e,t){e/=100,t.currentTime=qt(t,e)}(r,n))},ontouch:function(){n.paused||(O=!0,n.pause())},ontouchend:function(){O&&(O=!1,n.play()),e.live?Ht(v,g):jt(v,g)},onmouse:function(t,r){if(Vt(n)&&!i.classList.contains(Lt.GRABBING))switch(n.emit("timeline/gesture/move",{percent:r}),!!e.live){case!0:!function(e,t){t.style.width=function(e){return 100-e}(e)+"%"}(r,v),Ft(r,n,g);break;case!1:!function(e,t){t.style.width=e+"%"}(r,v),function(e,t,n){if(isNaN(e)||isNaN(t.duration))return;Ct(n,e),n.innerHTML="";const r=document.createElement("span");r.innerText=te(e/100*t.duration),n.append(r)}(r,n,g)}}}),i.addEventListener(s,(function(){n.emit("timeline/gesture/end"),e.live?Ht(v,g):jt(v,g)})),o}function Vt(e){return 0!=e.opt("opts.seekable",!0)&&!isNaN(e.duration)}function Kt(e){try{return localStorage.getItem(e)}catch(e){return null}}function Yt(e,t){try{localStorage.setItem(e,t)}catch(e){}}function zt(e,t,o){const i=document.createElement("div");i.className="fp-volumebtn",i.append(bt(gt)),o.append(i),i.addEventListener(r,(function(){t.toggleMute()}));const a=!n().ios&&function(e){const t=function(e,t){const n=document.createElement("div");n.className="fp-volume";const r=e.classList;let o=10;r.contains("is-small")&&(o=8);r.contains("is-tiny")&&(o=6);const i=Array.from({length:o}).map(()=>{const e=document.createElement("i");return e.className="fp-tick",e});return n.append(...i),Rt(n,{onseek:t})}(e.root,(n,r)=>{r>0&&(e.muted=!1,function(e){try{localStorage.removeItem(e)}catch(e){}}("mute")),Yt("volume",(e.volume=r/100).toString()),Xt(t,e.volume)});return t.setAttribute("tabindex","0"),t.setAttribute("role","slider"),t.setAttribute("aria-valuemin","0"),t.setAttribute("aria-valuemax","1"),t.setAttribute("aria-label",e.i18n("core.volume","volume")),t}(t);a&&o.append(a),t.on("volumechange",(function(){const e=0==t.volume||t.muted;t.setState("is-muted",e),Yt("mute",e.toString()),i.setAttribute("aria-label",e?t.i18n("unmute","unmute"):t.i18n("mute","mute")),a&&(e&&Xt(a,0),a.classList.contains(Lt.GRABBING)||Xt(a,t.volume))})),"true"==Kt("mute")&&(t.muted=!0,t.setState("is-muted",t.muted));const s=Kt("volume");s&&!isNaN(Number(s))&&(t.volume=Number(s)),t.emit("volumechange")}function Xt(e,t){e.setAttribute("aria-valuenow",t.toString());const n=Array.from(e.querySelectorAll(".fp-tick")),r=Math.round(t*n.length);n.forEach((e,t)=>{e.classList.toggle("fp-color",t<r)})}const Qt={"-1":"an unknown error occurred",1:"media playback was aborted",2:"a network error occurred",3:"unable to decode media content",4:"unsupported media type",1001:"cannot load insecure content in a secure context",1002:"no internet connection detected"};function Jt(){return!0===(navigator||{}).onLine}function Zt(e){try{return"https:"===location.protocol&&"http:"==function(e){const t=document.createElement("a");return t.href=e,t}(e).protocol}catch(e){return!1}}function $t(e,t,n){n.on("error",(function(e){const t=e.data||n.error||new Error,r=e.code||t.code,o="Error: %s\n"+(null===(i=(new Error).stack)||void 0===i?void 0:i.split("\n").slice(2).join("\n"));var i;setTimeout((function(){if(e.defaultPrevented)return;if("AbortError"==t.name)return;n.setState("is-error",!0),8===r||t.fatal||function(e){const t=e.togglePlay,n=e.root;e.togglePlay=Tt,e.once("recover",(function(){e.togglePlay=t,e.setState("is-error",!1);const r=n.querySelector(".fp-error");r&&r.remove()}))}(n);const i=function(e,t,n){switch(t){case"http:0":return function(e){return Zt(e.original_src)?{code:1001}:Jt()?{code:2}:Jt()?{code:-1}:{code:1002}}(e);case 4:return e.once("loadstart",(function(){e.emit("recover")})),n;default:return n}}(n,r,t),a=function(e,t){if(t.message)return t.message;if(t.stack)return t.stack;const n=(t.code||-1).toString();return e.i18n("media_errors."+n,Qt[n]||Qt[-1])}(n,i);console.error(o,a);const s=n.reaper&&n.reaper.get("ui");return s&&function(e,t,n,r){if(!e)return;const o=document.createElement("div");if(o.classList.add("fp-error"),o.innerText=t,r){const t=e.querySelector("#"+r);t&&e.removeChild(t),o.id=r}if(e.append(o),n){const e=document.createElement("div");e.classList.add("fp-error-details"),e.innerText=n,o.append(e)}}(s,a,t.details)}))}))}function en(e,t,n){if(!n.reaper)return;const r=document.createDocumentFragment(),o=Z("fp-ui");r.appendChild(o),n.reaper.set("ui",o),~t.className.indexOf("use-play-")||t.classList.add("use-play-1"),function(e,t,n){const r=Z("fp-footer");t.append(r),n.on(h,(function(e){var t,n;const o=null===(t=e.data)||void 0===t?void 0:t.description,i=null===(n=e.data)||void 0===n?void 0:n.title;if(r.innerHTML="","string"==typeof i){const e=Z("fp-title");e.innerText=i,r.append(e)}if("string"==typeof o){const e=o.split(" "),t=Z("fp-desc");for(t.innerText=e.join(" "),r.append(t);e.length>1&&t.scrollHeight>t.offsetHeight;)e.pop(),t.innerText=e.join(" ")+"..."}}))}(0,t,n),wt(e,o,n),kt(0,o,n);const i=Wt(e,0,n);o.append(i),zt(0,n,i),$t(0,0,n),t.appendChild(r),[a,s].forEach(e=>{t.addEventListener(e,(function(e){n.setState("is-hovered",e.type==a),n.setState("is-accessibility",!1)}))}),n.on(h,(function(e){var n;const r=null===(n=e.data)||void 0===n?void 0:n.ui;if("number"!=typeof r)return;const o=t.classList;o.toggle("use-play-1",!(32&r||64&r)),o.toggle("use-play-2",(32&r)>0),o.toggle("use-play-3",(64&r)>0),o.toggle("use-thin-controlbar",(128&r)>0),o.toggle("no-title",(256&r)>0),o.toggle("no-description",(512&r)>0),o.toggle("logo-on-right",(8&r)>0),o.toggle("use-drag-handle",(16&r)>0),o.toggle("no-controls",(1024&r)>0),o.toggle("no-duration",(2048&r)>0),o.toggle("no-header",(4096&r)>0),o.toggle("no-mute",(4&r)>0),o.toggle("no-volume",(2&r)>0),o.toggle("no-fullscreen",(1&r)>0),o.toggle("no-touch-zones",(16384&r)>0)}));let u=null;o.addEventListener("mousemove",(function(){"number"==typeof u&&clearTimeout(u),n.setState("is-hovered",!0),u=0==n.paused&&setTimeout((function(){n.setState("is-hovered",!1)}),2e3)}))}function tn(e,t,n){if(Oe.from_token(e.token||"").is_granted(Oe.permissions.NO_METERING))return;const r=Se.id(e.token||"");r&&n.once(f,()=>function(e,t){fetch("https://pmi.flowplayer.com/in",{method:"POST",body:JSON.stringify({token_id:t,factor:1,rnd:Math.random().toString(36).substring(2)})}).then(t=>{401==t.status&&e.emit("error:fatal",{reason:"token",details:"The token online validation failed"})})}(n,r))}var nn={ads:{ad:"Ad",ads:"Ads",advertisement:"Advertisement"},audio:{button_txt:"Audio",menu_title:"Audio"},core:{exit_fullscreen:"Exit fullscreen",fullscreen:"Fullscreen",mute:"Mute",pause:"Pause",play:"Play",unmute:"Unmute",volume:"Volume"},ovp:{starting_in:"Countdown"},playlist:{cancel:"Cancel",up_next:"Up next"},qsel:{menu_title:"Quality"},share:{clipboard_failure:"Access to clipboard failed",clipboard_success:"The text is now on your clipboard",embed:"Embed",link:"Link",menu_title:"Share"},speed:{menu_title:"Speed"}};class rn{init(e,t,n){n.reaper&&n.reaper.set("translations",re(rn,e,"en"))}}rn.en=nn;const on=Date.now(),an={session_id:Math.random().toString(36).substring(2)+performance.now().toString(36)};class sn{constructor(){this._summary={},this._session_id=an,this.start_time=on}increment(e,t){if("string"!=typeof e||"number"!=typeof t)return;const n=this._summary[e]||0;this._summary[e]=n+t}set(e,t){"string"==typeof e&&(this._summary[e]=t)}duration(){return Date.now()-this.start_time}summary(e){return Object.assign("object"==typeof e?e:{},{event:"health_summary"},this._summary,this._session_id,{duration:this.duration()})}sessionize(e){return Object.assign(e,this._session_id)}}function un(e,t){return function(e,t){return"function"==typeof navigator.sendBeacon&&navigator.sendBeacon(e,t)}(e,JSON.stringify({events:t}))}class cn{constructor(e){this.middleware=e,this._pending=[]}pending(){return this._pending}_run_middleware(e,t){return e=Object.assign({},e),this.middleware.forEach((function(n){const r=n(t);if("object"==typeof r)return Object.assign(e,r);console.warn("KPI::middleware did not return an Object\nreturn: %o\n\nfn: %s",r,n)})),e}push(e,t){e=this._run_middleware(e,t),this.push_finalized(e)}push_finalized(e){this._pending.push(e),this.send()}send(e){if(this._pending.length<20&&!e)return;const t=this._pending.slice(0);this._pending.length=0,un("https://health.flowplayer.com/v1/health/events",t)}}function ln(){return $(window,"navigator.connection.downlink")}function dn(e){const t=e.hls;if(!t)return;const n=t.abrController._bwEstimator;return n?.001*n.getEstimate():void 0}function fn(e){const t=[dn,ln];for(;t.length;){const n=t.shift(),r="function"==typeof n&&n(e);if("number"==typeof r)return{downlink_mbs:Number(r.toFixed(2))}}return{}}const pn=document.createElement("a");function mn(e){const t=e.original_src;return"string"!=typeof t?{}:(pn.href=t,"string"==typeof pn.pathname?{media_type:pn.pathname.split(".").pop()}:{})}function hn(e){return{preload:e.opt("preload"),autoplay:e.opt("autoplay",e.autoplay)}}function vn(e){return{player_id:e.opt("metadata.player_id"),media_id:e.opt("metadata.media_id"),site_id:e.opt("metadata.site_id"),category_id:e.opt("metadata.category_id"),sitegroup_id:e.opt("metadata.sitegroup_id"),token:e.token}}function gn(){return{timestamp:Date.now()}}function yn(){return{ua:navigator.userAgent,version:"3.0.0-rc6",commit:"3ff5575be008bca83fb98f88bd7b5012f71fbe28"}}const _n=["error","rebuffer"],En=_n.concat([i,"loadstart",l,d,"error:fatal",f,p,"quality:set","pause","ended","seeking"]);function bn(e,t,n){e.push_finalized(Object.assign(t.summary({}),hn(n),vn(n),gn(),yn())),e.send(!0)}function wn(e){try{return!!new URL(e)}catch(e){return!1}}pe(window,"flowplayer:umd",(function(e){const t=e.data;t&&window.addEventListener("unload",(function(){t.instances.forEach(e=>e.emit("unload"))}))}));class Sn{init(e,t,n){if(n._health)return;const r=n._health=new sn,o=n._kpis=new cn([mn,hn,vn,fn,gn,yn]);_n.forEach(e=>{r.set(e,0)}),function(e){e.on("waiting",(function(t){e.seeking||e.networkState===e.NETWORK_LOADING&&e.readyState!==e.HAVE_NOTHING&&e.emit("rebuffer")}))}(n),n.on(m,(function(){o.send(),n._kpis=n._health=void 0})),n.on("health:summary:increment",(function(e){e.data&&Object.keys(e.data).forEach((function(t){e.data&&r.increment(t,e.data[t])}))})),n.on("health:summary:set",(function(e){e.data&&Object.keys(e.data).forEach((function(t){e.data&&r.set(t,e.data[t])}))})),n.on(_n,(function(e){setTimeout(()=>{e.defaultPrevented||n.emit("health:summary:increment",{[e.type]:1})})})),n.on(En,(function(e){setTimeout(()=>{e.defaultPrevented||n.emit("health:kpi:track",{event:e.type})},0)})),n.on("health:kpi:track",(function(e){if(!e.data)return;const t=r.sessionize(e.data);o.push(t,n)})),n.on("src",(function(e){const t=e.data&&e.data.src;"string"==typeof t&&wn(n.original_src)&&wn(t)&&t!=n.original_src&&bn(o,r,n)})),n.on("unload",(function(){bn(o,r,n)}))}}ye(window,Sn);return Ce.extensions.unshift.apply(Ce.extensions,[rn,ct,Sn,class{init(e,t,n){tn(e,0,n),en(e,t,n),lt(0,t,n)}}]),Object.assign(Ce,{ui:St,i18n:rn})}));
15
+ ***************************************************************************** */function j(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}function F(e){const t=document.createElement("a");t.href=e;const n=t.pathname&&t.pathname.split(".");return n.length>1&&n[n.length-1]}function q(e){switch(e){case"video/mpd":return"application/dash+xml";case"video/m3u8":return"application/x-mpegurl";default:return e}}const H=e=>{var{src:t}=e,n=j(e,["src"]);return[Object.assign({src:t,type:t?q("video/"+F(t)):""},n)]};function B(e){return H({src:e})}function W(e){var{src:t,type:n}=e,r=j(e,["src","type"]);return t&&n?[Object.assign({src:t,type:n},r)]:n&&!t?[Object.assign({type:n},r)]:H(Object.assign({src:t},r))}var V;function K(e,t,n,r={safari:!1}){const o=function(e){return"string"==typeof e?B(e):Array.isArray(e)||"object"!=typeof e?e.reduce((function(e,t){return"string"==typeof t&&(t=B(t)),"object"!=typeof t||Array.isArray(t)||(t=W(t)),e.concat(t)}),[]):W(e)}(n);return e.currentSrc&&(e.innerHTML=""),Array(...Array(o.length)).map((e,t)=>t).some(n=>{const i=o[n];if(V.Ok==function(e,t,n){e.emit("src",n),"string"==typeof n.src&&(e.original_src=n.src);const r=function(e,t,n){return e.plugins.filter(e=>{return(t=e)&&"wants"in t;var t}).find(e=>e.wants(n.src||"",n,t))}(e,t,n);return r?(r.onload(t,e.root,e,n),V.Ok):V.Err}(e,t,i)||V.Ok==function(e,t,n,r={safari:!1}){/^audio\//.test(n.type||"")&&e.emit("audioonlysource");t.start_time&&(n.src=n.src+"#t="+t.start_time);if(""==e.canPlayType(n.type||""))return V.Err;if(n.drm&&(!n.drm["com.apple.fps.1_0"]||!r.safari))return V.Err;"string"==typeof n.src&&(e.src=n.src);return V.Ok}(e,t,i,r))return!0;n==o.length-1&&"string"==typeof i.src&&(e.src=i.src)}),function(e,t){(function(e,t){if(!e.currentSrc)return;if("none"==e.opt("preload"))return;if(t.autoplay&&t.autoplay>0)return;e.load()})(e,t),"none"==e.opt("preload")&&e.render()}(e,t),e}!function(e){e[e.Err=0]="Err",e[e.Ok=1]="Ok"}(V||(V={}));const Y=[m,"seeking","src","seek:cancel"];var z;function X(e,t,n){return isNaN(e.duration)||isNaN(e.currentTime)?{}:(t.offset+=n,0==t.offset?Q(e,t):(t.timer&&clearTimeout(t.timer),t.timer=setTimeout((function(){0!=e.reaper&&(e.currentTime=function(e,t,n=0){return Math.max(Math.min(t,e),n)}(e.currentTime+t.offset,e.duration),t.timer=0,Q(e,t))}),1e3),function(e,t){e.setState("will-seek",!0),e.setState(z.BACKWARD,t.offset<0),e.setState(z.FORWARD,t.offset>0)}(e,t),e.emit("seek:queued",t),t))}function Q(e,t){t.timer&&clearTimeout(t.timer),t.timer=t.offset=0,function(e){e.setState(z.FORWARD,!1),e.setState(z.BACKWARD,!1),e.setState("will-seek",!1)}(e)}function J(){if("undefined"==typeof document)return!1;const e=document.documentElement;return e&&"rtl"==e.getAttribute("dir")}function Z(...e){const t=document.createElement("div");return 0==e.length||t.classList.add(...e),t}function $(e,t,n){const r=function(e){return Array.isArray(e)?e.slice(0):e.split(".")}(t);for(;r.length;){if(null==e)return n;const t=r.shift();if("string"!=typeof t)return n;e=e[t]}return null==e?n:e}function ee(e){const t="number"==typeof e?e:parseInt(e,10);return(t>9?"":"0")+t}function te(e){if(isNaN(e)||e>=Number.MAX_SAFE_INTEGER)return"";const t=e<0?"-":"";e=Math.round(Math.abs(e));const n=Math.floor(e/3600);let r=Math.floor(e/60);return e-=60*r,n>=1?(r-=60*n,t+n+":"+ee(r)+":"+ee(e)):t+ee(r)+":"+ee(e)}!function(e){e.FORWARD="forward",e.BACKWARD="backward"}(z||(z={}));const ne=navigator.languages||[navigator.language];function re(e,t,n){const r={};return n=t.lang||n,e[n]&&(r[n]=e[n]),function(){try{return ne.reduce((e,t)=>~t.indexOf("-")?e.concat(t,t.split("-")[0]):e.concat(t),[])}catch(e){return[]}}().forEach((function(t){e[t]&&!r[t]&&(r[t]=e[t])})),Object.values(r)}const oe={3:!0,5:!0,7:!0,9:!0};function ie(){return(e=Array(16),Array.from({length:e.length}).map((e,t)=>t).forEach(t=>{let n;0==(3&t)&&(n=4294967296*Math.random()),e[t]=(n||0)>>>((3&t)<<3)&255}),e).reduce((function(e,t,n){const r=(t+256).toString(16).substr(1);return e+(n.toString()in oe?"-":"")+r}),"");var e}let ae="";!function(){let e=!1;try{const t=Object.defineProperty({},"passive",{get:function(){e=!0}});window.addEventListener("testPassive",null,t),window.removeEventListener("testPassive",null,t)}catch(e){}}();const se=["touchstart","touchmove"];function ue(e,t){const n=new CustomEvent(e,{detail:t});return t&&Object.defineProperty(n,"data",{get:()=>t}),n}function ce(e,t,n){const r=ue(t,n);return e.dispatchEvent(r),e}function le(e,t,n){const r=ue(t,n);return e.dispatchEvent(r),r}function de(e,t,n,r){Array.isArray(t)?t.forEach(t=>fe(e,t,n,r)):fe(e,t,n,r)}function fe(e,t,n,r){if(o=t,!~se.indexOf(o))return e.addEventListener(t,n,r),e;var o;const i=Object.assign(r||{},{passive:!0});return e.addEventListener(t,n,i),e}function pe(e,t,n,r){return de(e,t,n,Object.assign(r||{},{once:!0}))}const me={preload:"none",rtl:!1,controls:!0},he=["loop","muted","preload"];function ve(e,r,o){o.toJSON=function(){return{duration:o.duration,volume:o.volume,currentTime:o.currentTime,states:o.root.className}},o.setSrc=function(t){return K(o,e,t,n())},o.playerState=o.playerState||{},o.setState=function(e,t){if(o.playerState[e]===!!t)return o;const n=Object.assign({},o.playerState,{[e]:t});return n[A]&&(n[_]=!1),o.playerState=n,ce(o,"state",o.playerState),o},o.hasState=function(e){return!!o.playerState[e]},o.transitionState=function(e,t,n){o.hasState(e)&&(n=0),n&&o.setState("is-toggling",!0),o.setState(t,!1),o.setState(e,!0),n&&setTimeout((function(){o.setState("is-toggling",!1)}),n)},o.render=function(e,t){return"string"==typeof e?x.render(e,t):(ce(o,n().ios?l:d),ce(o,"canplay"),o)},o.emit=(e,t)=>(ce(o,e,t),o),o.on=(e,t)=>(de(o,e,t),o),o.once=(e,t)=>(pe(o,e,t),o),o.off=(e,t)=>{var n,r;return n=e,r=t,o.removeEventListener(n,r),o},o.poll=(e,t)=>le(o,e,t),o.togglePlay=function(t){return D(o,e,t)},o.toggleMute=function(e){e=null==e?!o.muted:!!e,o.muted=e,o.muted||o.volume||(o.volume=1),ce(o,"volumechange")},o.toggleDisable=function(e){e=null==e?!o.disabled:!!e,o.setState("is-disabled",e),o.disabled=e},o.destroy=function(){o.pause();const e=t.indexOf(o);~e&&t.splice(e,1),setTimeout((function(){o.setSrc([]),o.reaper&&o.reaper.clear(),ce(o,m)}),0)},o.setAttrs=function(e){return he.forEach(t=>{if(!(t in e))return;const n=e[t];n?o.setAttribute(t,n.toString()):o.removeAttribute(t)}),o},o.opt=function(t,n){return n=void 0===n?$(me,t):n,$(e,t,n)},o.i18n=function(e,t){if(!o.reaper)return"";const n=o.reaper.get("translations");return n?function e(t,n,r,o){return(o=o||0)>=t.length?r:$(t[o],n,e(t,n,r,o+1))}(n,e,t||""):t||""},o.setOpts=function(t){Object.assign(e,t),"disabled"in t&&void 0!==t.disabled&&o.toggleDisable(t.disabled),"muted"in t&&void 0!==t.muted&&o.toggleMute(t.muted);const n=!!e.autoplay&&!o.hasState("no-autoplay");o.setState("is-autoplay",n),o.setState("is-rtl",o.opt("rtl",function(e){if(!e)return J();const t=e.getAttribute("dir");return t?"rtl"==t:J()}(r))),o.setState("is-live",!!e.live),o.setState("no-timeline",!(!e.live||e.dvr)),o.setState("has-poster","string"==typeof e.poster&&e.poster.length>0),o.setState("is-seekable",!!e.seekable),r.style.backgroundImage=o.hasState("has-poster")?"url('"+e.poster+"')":"",ce(o,h,e)},o.renderPlugin=function(e){le(o,"renderplugin",e).defaultPrevented||o.root.appendChild(e)};const i={offset:0,timer:0};var a,s;s=i,(a=o).on(Y,(function(){Q(a,s)})),o.enqueueSeek=function(e){if(0!=o.opts.seekable&&!(1==o.opts.disabled&&e>0))return X(o,i,e)},o.deviceId=function(){return function(){if(ae)return ae;try{const e=localStorage.getItem("flowplayer/uuid");if(e)return e;const t=ie();return localStorage.setItem("flowplayer/uuid",t),t}catch(e){return ae=ie()}}()}}function ge(e,t){const n=t.querySelector("video"),r=n||(e._video_element_callback?e._video_element_callback(e):document.createElement("video"));return r.classList.add("fp-engine"),r.playsInline=!0,n||t.append(r),r}function ye(e,t){if("object"==typeof exports&&"undefined"!=typeof module)return t;"flowplayer"in e||(e.flowplayer={extensions:[]});const n=e.flowplayer;return"function"==typeof n?(n(t),t):(Array.isArray(n.extensions)||(n.extensions=[]),~n.extensions.indexOf(t)||n.extensions.push(t),t)}function _e(){return"undefined"!=typeof window?window:"undefined"!=typeof global?global:{}}const Ee=["localhost","127.0.0.1","0.0.0.0","s.codepen.io","cdpn.io","try.flowplayer.com"];function be(e,t){return!!~Ee.indexOf(e)||e.indexOf(t)===e.length-t.length}be.check_whitelist=function(e){return!!~Ee.indexOf(e)};const we="production";function Se(e,t){const n={valid_jwt:!1,raw:"",data:{acl:0},exp:0};let r={c:"{}",exp:0};t=t||{};try{r=M(e),n.valid_jwt=!0}catch(e){}return n.raw=e,n.data=JSON.parse(r.c),n.exp=r.exp,t.require_valid_token&&Se.validate(n),n}function ke(e){try{return Se.validate(e),{success:!0,message:""}}catch(e){return{success:!1,message:e.message}}}var Ae;function Oe(e){return{grant:e,is_granted:t=>(e&t)===t}}function Te(e,t,n){t&&t.destroy(),console.error(new Error(n.details||n.reason)),e.innerHTML="",e.classList.remove("flowplayer"),e.classList.add("flowplayer-fatal"),e.innerHTML='\n <h2>Playback Error</h2>\n <p>Are you the site owner?</p>\n <a class="troubleshoot" target="_blank" href="https://flowplayer.com/help/developers/troubleshooting">Troubleshoot?</a>\n <img src=""https://flowplayer.com/user/pages/images/logo-white.png""/>\n '}function Ne(e,t){const n=t.clientWidth;t.classList.toggle("is-small",n<600),t.classList.toggle("is-tiny",n<400)}function Le(e,t,r){let o=!0;t.classList.add("flowplayer"),Ne(0,t),de(r,["loadstart",c],(function(){Ne(0,t)})),de(r,"state",(function(){Object.entries(r.playerState).forEach((function([e,n]){t.classList.toggle(e,n)}))})),de(r,"timeupdate",(function(){r.setState(A,!1)})),de(r,h,(function(){const n=r.paused&&(!e.autoplay||t.classList.contains("no-autoplay"))&&0==r.currentTime;[b,w].forEach((function(e){r.setState(e,n)}))})),de(r,"ended",(function(t){setTimeout((function(){t.defaultPrevented||(e.rewind&&!r.loop&&(e.autoplay&&(e.autoplay=0,r.setState("is-autoplay",!1)),r.setState(S,!0),pe(r,p,(function(){r.setState(S,!1),r.pause(),r.setState(w,!0)})),r.currentTime=0),pe(r,"timeupdate",(function(){r.setState(k,!1)})),r.transitionState(k,_,e.loop||e.rewind?0:300))}),0)})),de(r,["seeking",p],(function(e){r.setState(S,"seeking"==e.type),r.setState(E,r.paused),r.setState(_,!r.paused)})),de(r,"ended",(function(){r.setState(_,!1),o=!0})),de(r,n().ios?l:d,(function(e){const t="src"!=e.type||"none"!==r.opt("preload");r.setState("is-loaded",t),r.setState(b,!t)})),de(r,["waiting","canplay","loadstart"],(function(t){if(!r.hasState(S)&&("canplay"!=t.type||e.autoplay||r.setState(A,!1),"loadstart"!=t.type||"none"!=r.opt("preload")||e.autoplay)){if("loadstart"==t.type&&e.autoplay)return pe(r,f,(function(){r.setState(A,!1)}));"waiting"==t.type&&[_,E,w].forEach((function(e){r.setState(e,!1)})),r.setState(k,!1),r.setState(A,"waiting"==t.type)}})),de(r,[f,"pause"],(function(t){setTimeout(()=>{const e=new CustomEvent("flowplayer/"+t.type,{detail:r});document.dispatchEvent(e)},0);const n=t.type==f,i=r.currentTime==r.duration,a=n&&o&&e.autoplay||r.hasState(A);if(n&&(r.started=!0,o=!1),r.setState(A,!1).setState(w,!1),i||r.hasState(S))return;const s=n?_:E,u=n?E:_;r.transitionState(s,u,a?0:300),n&&r.setState("no-autoplay",!1)}))}function Re(e){const t=function(e){const t=e.getBoundingClientRect(),n=window.innerHeight,r=t.height,o=t.bottom,i=r/5;return t.top<=i&&t.top+r>n-i||o-r+i>=0&&o<n+i}(e.root);return e.in_viewport===t||(e.in_viewport=t,ce(e,t?"viewenter":"viewleave")),e}function Ie(e,n,o){Re(o);const i={should_resume:!!e.autoplay,has_user_gesture:!1,locked:!1};[u,r].forEach(e=>pe(o,e,()=>i.has_user_gesture=!0)),de(o,"play",(function(){i.locked||(i.should_resume=!0)})),de(o,"pause",(function(){i.locked||(i.should_resume=!1)})),de(o,"canplay",(function(n){e.autoplay&&!t.filter((function(e){return!e.paused})).length&&o.in_viewport&&o.paused&&i.should_resume&&o.togglePlay(!0)})),e.autopause&&(de(o,"viewenter",(function(){i.should_resume&&o.togglePlay(!0)})),de(o,"viewleave",(function(){const e=!o.paused;i.locked=!0,o.pause(),setTimeout((function(){i.should_resume=e,i.locked=!1}),0)})))}Se.validate=function(e){if("string"==typeof e&&(e=Se(e)),!e||!e.raw){if(be.check_whitelist(window.location.hostname)||"dev"===we.toString())return!0;throw new Error("No token provided in configuration")}if(!e.valid_jwt)throw new Error("Invalid token provided");const t=window.location.hostname,n=be.bind(null,t);if("dev"!==we.toString()&&e.data.domain&&e.data.domain.length&&!e.data.domain.some(n))throw new Error("Domain not allowed");if("dev"!==we.toString()&&1e3*e.exp-Date.now()<0)throw new Error("Expired token");return!0},Se.id=function(e){if(e)return"string"==typeof e&&(e=Se(e)),e.data.id},function(e){e[e.ADS=2]="ADS",e[e.ANALYTICS=4]="ANALYTICS",e[e.NO_METERING=8]="NO_METERING",e[e.DEVELOPER_PLAN=16]="DEVELOPER_PLAN"}(Ae||(Ae={})),Oe.of=Oe,Oe.from_token=function(e){const t=Se(e,{require_valid_token:!0});return Oe.of(t.data.acl)},Oe.permissions=Ae,[i,c].forEach(e=>{window.addEventListener(e,(function(){t.forEach((function(e){const t=e.root;t.prevWidth!=t.clientWidth&&(ce(e,c),t.prevWidth=t.clientWidth)}))}))}),window.addEventListener("scroll",(function(){t.forEach(Re)}));function Pe(e){if("number"==typeof e&&!isNaN(e))return Number(e);if("string"==typeof e){const t=e.split(":");return Number(t[1])/Number(t[0])}return e}function Me(e,t,n){const r=document.createElement("div");r.classList.add("fp-ratio"),t.append(r);let o=Pe(e.ratio||.5625);r.style.paddingTop=100*o+"%";const i=[d,l];n.on(i,(function(){const e=n.videoHeight&&n.videoWidth&&n.videoHeight/n.videoWidth;e&&n.setOpts({ratio:e})})),n.on(h,(function(){const t=n.videoHeight&&n.videoWidth&&n.videoHeight/n.videoWidth,i=Pe((null==e?void 0:e.ratio)||t||.5625);o!==i&&(o=i,r.style.paddingTop=100*i+"%")}))}const xe="flowplayer/"+f;function Ue(e){const t=t=>{if(t.detail===e)return;const n=e.opt("multiplay");"boolean"==typeof n&&!1===n&&e.pause()};e.on(m,()=>document.removeEventListener(xe,t)),document.addEventListener(xe,t)}const De=function(){const e=_e(),t=e.flowplayer?e.flowplayer:{extensions:[]};return Array.isArray(t.extensions)||(t.extensions=[]),t}();function Ce(n,r){if("function"==typeof n)return e.push(...[...arguments].filter(e=>"function"==typeof e)),Ce;"string"==typeof r&&(r={src:r}),r||(r={}),r.token||"string"!=typeof window.__FLOWPLAYER_TOKEN||(r.token=window.__FLOWPLAYER_TOKEN);const o="string"==typeof n?document.querySelector(n):n;if(!o)return console.error(new Error("Flowplayer: '"+n.toString()+"' not found"));const i=o.querySelector("video.fp-engine");if(i)return i;const a=ke(r.token);if(!a.success)return Te(o,null,{reason:"token",details:a.message});const s=new Map,u=ge(r,o);if(u.reaper=s,Object.defineProperty(u,"token",{value:"string"==typeof r.token?Se.id(r.token):"",writable:!1}),u.addEventListener(m,()=>{s.clear(),u.reaper=0,delete u.root}),u.root=o,r.token&&Oe.from_token(r.token).is_granted(Oe.permissions.DEVELOPER_PLAN))return Te(o,null,{reason:"developer_plan",details:"Using developer plan tokens is not currently supported"});!~t.indexOf(u)&&t.push(u),ve(r,o,u),u.setAttrs(r),u.plugins=Ce.extensions.map(e=>new e(Ce,u)),Le(r,o,u),Ie(r,0,u),Me(r,o,u),Ue(u),u.plugins.forEach(e=>{try{e.init(r,o,u)}catch(t){console.log("Error(plugin/%s)",e.constructor.name,t)}}),u.setOpts(r),u.opts=r,r.src&&u.setSrc(r.src);const c=u.readyState;return c>0&&u.currentSrc&&u.emit(l),c>2&&u.currentSrc&&u.emit("canplay"),"none"==u.opt("preload")&&u.paused&&u.currentSrc&&u.render(),u.emit("mount"),u.on("error:fatal",(function(e){Te(o,u,e.data||{})})),u}Object.assign(Ce,De),function(r){Array.isArray(r.extensions)&&r.extensions.forEach(t=>e.push(t)),r.components=x,r.version="3.0.0-rc6",r.commit="6d66ffa737639c623b6ecccdefd3d118199516a8",r.instances=t,r.extensions=e,r.support=n,r.events=y,r.states=T,r.jwt=M,r.autoplay=P,r.quality=U}(Ce),"object"==typeof document&&setTimeout(ce,0,document,"flowplayer:umd",Ce);var Ge="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function je(e){var t={exports:{}};return e(t,t.exports),t.exports}var Fe=je((function(e,t){var n=Ge&&Ge.__assign||function(){return(n=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};t.__esModule=!0,t.remove=t.downcase=t.pluck=t.merge=void 0,t.merge=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.reduce((function(e,t){return n(n({},e),t)}),{})},t.pluck=function(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];return Object.keys(e).filter((function(e){return~n.indexOf(e)})).reduce((function(n,r){var o;return t.merge(n,((o={})[r]=e[r],o))}),{})},t.downcase=function(e){return(e||"").toString().toLowerCase()},t.remove=function(e,t){var n=e.lastIndexOf(t);return~n&&e.splice(n,1),e}})),qe=je((function(e,t){var n=Ge&&Ge.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),r=Ge&&Ge.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=Ge&&Ge.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)"default"!==o&&Object.hasOwnProperty.call(e,o)&&n(t,e,o);return r(t,e),t};t.__esModule=!0;var i=o(Fe),a=function(){function e(){this.pending=[],this.open=[],this.stats={failures:0,ttl:0}}return e.of=function(){return new e},e.is_empty=function(e){return 0==e.pending.length},e.is_high_water=function(t){return t.open.length==e.MAX_OPEN_REQUESTS},e.maybe_spawn_req=function(t){if(e.is_empty(t))return t;if(e.is_high_water(t))return t;try{var n=e.lpop(t);n&&e.request(t,n)}catch(e){}},e.increment_failures=function(t){return t.stats.failures++,t.stats.failures>e.MAX_FAILURE_COUNT&&(t.stats.ttl=Date.now()+e.REQUEST_TTL_MS),t},e.handle_error=function(t,n){e.rm(t,n),e.increment_failures(t)},e.request=function(t,n){var r=n[0],o=n[1],i=n[2];if(!(Date.now()<t.stats.ttl)){var a=new XMLHttpRequest;t.open.push(a),a.timeout=e.REQUEST_TIMEOUT_MS,a.ontimeout=function(){e.handle_error(t,a)},a.onerror=function(n){e.handle_error(t,a)},a.onreadystatechange=function(){a.readyState==XMLHttpRequest.DONE&&e.rm(t,a),Math.floor(a.status/100)},a.onload=function(){e.rm(t,a),t.stats.failures&&t.stats.failures--},a.open(o,r),a.setRequestHeader("Content-Type","text/plain;charset=UTF-8");try{a.send(JSON.stringify(i))}catch(e){}}},e.rpush=function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];return n.forEach((function(n){t.pending.length>=e.MAX_PENDING||(t.pending.push(n),e.maybe_spawn_req(t))})),t},e.lpop=function(e){return e.pending.shift()},e.rm=function(e,t){return i.remove(e.open,t),e},e.MAX_OPEN_REQUESTS=3,e.MAX_PENDING=5,e.REQUEST_TIMEOUT_MS=4e3,e.REQUEST_TTL_MS=5e3,e.MAX_FAILURE_COUNT=3,e}();t.default=a})),He=je((function(e,t){var n=Ge&&Ge.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};t.__esModule=!0;var r=n(qe);t.default=r.default.of()})),Be=je((function(e,t){t.__esModule=!0,t.prepare_url=t.URL_PARAM=void 0,t.URL_PARAM=/:([a-zA-Z_]+)/g,t.prepare_url=function(e,n){return e.url.replace(t.URL_PARAM,(function(t){if((t=t.slice(1,t.length))in n)return n[t].toString();e.log.error(new Error("\n preparing url["+e.url+"] failed\n \n parameter["+t+"] not detected in params:\n \n "+JSON.stringify(n,null,2)+"\n "))}))}})),We=je((function(e,t){t.__esModule=!0,t.Log=void 0;var n=function(){function e(e){this.emitter=e}return e.prepare=function(e,t){var n=document.createEvent("Event");return n.initEvent(e,!1,!0),n.ns=e,n.data=t,n},e.of=function(t){return new e(t)},e.prototype.info=function(t){this.emitter.dispatchEvent(e.prepare(e.NAMESPACE.INFO,t))},e.prototype.error=function(t){this.emitter.dispatchEvent(e.prepare(e.NAMESPACE.ERROR,t))},e.prototype.warn=function(t){this.emitter.dispatchEvent(e.prepare(e.NAMESPACE.WARN,t))},e.NAMESPACE={INFO:"tracker:info",ERROR:"tracker:err",WARN:"tracker:warn"},e}();t.Log=n})),Ve=je((function(e,t){var n;t.__esModule=!0,t.Verb=void 0,(n=t.Verb||(t.Verb={})).POST="POST",n.PUT="PUT",n.GET="GET"})),Ke=je((function(e,t){var n=Ge&&Ge.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),r=Ge&&Ge.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=Ge&&Ge.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)"default"!==o&&Object.hasOwnProperty.call(e,o)&&n(t,e,o);return r(t,e),t},i=Ge&&Ge.__spreadArrays||function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),o=0;for(t=0;t<n;t++)for(var i=arguments[t],a=0,s=i.length;a<s;a++,o++)r[o]=i[a];return r},a=Ge&&Ge.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};t.__esModule=!0;var s=a(He),u=a(qe),c=o(Be),l=o(Fe),d=function(){function e(t,n){var r=this;void 0===n&&(n={});var o=this;if(this.emitter=t,this.url=n.url,this.log=We.Log.of(this.emitter),this.verb=n.verb,this.metadata=l.merge({},n.metadata||{}),this.rq=n.rq||s.default,this.events=n.events||[],this.required_keys=n.required_keys||[],this.optional_keys=n.optional_keys||[],this.listeners=[],this.valid_keys=this.required_keys.slice(0).concat(this.optional_keys),e.assert_emitter_api(this.emitter),void 0===e.verb[this.verb])throw new Error("invalid HTTP verb["+this.verb+"] passed");if("string"!=typeof this.url)throw new Error("invalid API url["+this.url+"] passed");e.TRACKERS.push(this),o.events.forEach((function(t){e.create_listener(r,t,(function(n){void 0===n&&(n={});var i=l.merge(o.metadata,{event_type:t},n.data||n),a=c.prepare_url(o,i),s=e.pluck_valid_keys(o,i),d=e.ensure_required_keys(o,s);if(d.length)return o.log.error("Tracker.validate_metadata() failed for \n Event["+t+"]\n missing keys: "+d+"\n payload:\n "+JSON.stringify(s,null,2));u.default.rpush(r.rq,[a,r.verb,s])}))}))}return e.of=function(t,n){return new e(t,n)},e.ensure_required_keys=function(e,t){return e.required_keys.filter((function(e){return!(e in t)}))},e.pluck_valid_keys=function(e,t){return l.pluck.apply(l,i([t],e.valid_keys))},e.merge_metadata=function(t,n){return void 0===n&&(n={}),t.metadata=e.pluck_valid_keys(t,l.merge(t.metadata,n)),t},e.assert_emitter_api=function(e){if("function"!=typeof(e||{}).addEventListener)throw new Error("Tracker() received an emitter that does not implement the addEventListener method");if("function"!=typeof(e||{}).removeEventListener)throw new Error("Tracker() received an emitter that does not implement the removeEventListener method")},e.create_listener=function(e,t,n){e.listeners.push([t,n]),e.emitter.addEventListener(t,n)},e.prototype.destroy=function(){var t=this;this.listeners.forEach((function(e){var n=e[0],r=e[1];return t.emitter.removeEventListener(n,r)})),delete this.rq,delete this.emitter,l.remove(e.TRACKERS,this)},e.prototype.put=function(t){return void 0===t&&(t={}),e.merge_metadata(this,t),this},e.TRACKERS=[],e.QUEUE=s.default,e.verb=Ve.Verb,e}();t.default=d})),Ye=je((function(e,t){var n=Ge&&Ge.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),r=Ge&&Ge.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=Ge&&Ge.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)"default"!==o&&Object.hasOwnProperty.call(e,o)&&n(t,e,o);return r(t,e),t},i=Ge&&Ge.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};t.__esModule=!0,t.API=t.Tracker=void 0;var a=i(Ke);t.Tracker=a.default;var s=o(Be);t.API=s})),ze="ping",Xe="display",Qe="view";const Je=["sitegroup_id","session_id","media_id","site_id","player_id","video_type"],Ze=["created","position"],$e=["player_version","created","source","category","category_id","autoplay","muted","customer_user_id"];function et(e,t){return e.duration/1===e.duration&&Object.assign(t,function(e){const t=e/100;return{segment_duration:t,breakpoints:Array(...Array(100)).map((function(e,n){return Math.floor(n*t*1e3)/1e3}))}}(e.duration))}function tt(e,t,n){if(!t.segment_duration&&!et(e,t))return;const r=function(e,t,n){const r=t.last_idx,o=n?99:nt(e,t);return t.last_idx=o,o<=r?[]:t.breakpoints.slice(r,99==o?100:o).map((function(e){return t.breakpoints.indexOf(e)}))}(e,t,n);0!=r.length&&e.emit(ze,{position:r})}function nt(e,t){return Math.min(Math.floor(e.currentTime/t.segment_duration),99)}const rt="vod",ot="live",it=[Xe,ze,Qe];function at(e,t,n){switch(null==t?void 0:t.kind){case"live":return function(e,t){const n=Date.now();n-t.last_tracked_ts<6e4||(t.last_tracked_ts=n,++t.ticks,e.emit(ze,{position:60*t.ticks}))}(e,t);case"vod":return tt(e,t,"boolean"==typeof n&&n)}}function st(e){const t=e.ads;return void 0!==t&&(void 0!==t.schedule&&("function"==typeof t.hasPreroll&&(t.currentRequests?t.currentRequests:!!t.adPlaying||!(!t.hasPreroll()||0!=t.nextIndex))))}function ut(){try{return window.location!==window.parent.location?document.referrer:document.location.href}catch(e){return!1}}class ct{init(e,t,n){if(!Oe.from_token(e.token||"").is_granted(Oe.permissions.ANALYTICS))return;if(n.analytics)return;const r=n.analytics={ticker:void 0,last_media_id:"",ended:!1},o={locked:!1,ttl:6e3,task:()=>{at(n,r.ticker)}};const i={session_id:n.deviceId(),autoplay:n.autoplay,muted:n.muted,player_id:e.player_id,customer_user_id:e.customer_user_id},a=Ye.Tracker.of(n,{verb:Ye.Tracker.verb.POST,url:"https://ptm.flowplayer.com/:video_type/:sitegroup_id/:event_type",events:it,required_keys:Je,optional_keys:$e.concat(Ze).slice(0),metadata:i});n.on(m,(function(){a&&a.destroy()})),n.on(h,(function(t){if(!a)return;const o=$(t,"data.metadata",{});if(!o.media_id)return;const i=$(a,"metadata.media_id");if(i&&o.media_id==i)return;const s=$(e,"analytics",{});a.put(o),a.put(s);const u=$(e,"metadata.live_start_time",e.live)?ot:rt;a.put({video_type:u,source:e.source||ut()||""}),r.ticker=e.live?{ticks:0,last_tracked_ts:Date.now(),kind:"live"}:{last_idx:0,segment_duration:0,breakpoints:[],kind:"vod"},r.ended=!1,n.emit(Xe)}));let s=0;n.on(f,(function(){if(!a)return;if(s||function(e,t){return e.metadata.media_id&&e.metadata.media_id==t.last_media_id}(a,r))return;a.put({muted:n.muted});const e=st(n);if(e)return s=Promise.resolve(e).then((function(){r.last_media_id=a.metadata.media_id,n.emit(Qe),s=0})).catch((function(){s=0}));r.last_media_id=a.metadata.media_id,n.emit(Qe)})),n.on("timeupdate",(function(){var t;a&&(s||st(n)||r.ended||(!e.live&&n.currentTime+.25>=n.duration&&at(n,r.ticker,!0),(t=o).locked||(t.locked=setTimeout((function(){return t.task(),function(e){return e.locked=!1,e}(t)}),t.ttl))))})),n.on(p,(function(){a&&r.ticker&&"vod"==r.ticker.kind&&function(e,t){et(e,t),t.last_idx=nt(e,t)}(n,r.ticker)})),n.on("ended",(function(){a&&function(e,t){t.ended||(t.ended=!0,at(e,t.ticker))}(n,r)}))}}function lt(e,t,n){!function(e,t,n){"undefined"!=typeof window&&"ontouchstart"in window&&n.setState("is-touch-device",!0);let r=!1;n.setState("is-accessibility",!1);const o=t.querySelector(".fp-middle");o&&o.addEventListener(u,(function(e){0!=e.cancelable&&(e.preventDefault(),n.emit(e.type,{source:e}))})),n.on(u,(function(e){setTimeout((function(){if(e.defaultPrevented)return;if(n.hasState(A))return;if(n.ended)return n.togglePlay(!0);const t=n.hasState(w);r&&clearTimeout(r),(t||n.hasState(O)||n.hasState("no-autoplay"))&&(n.hasState(O)&&(n.setState(O,!1),n.setState("is-hovered",!1)),n.togglePlay(),t)||(n.setState(O,!0),n.paused||(r=setTimeout((function(){r=!1,n.setState(O,!1),n.setState("is-hovered",!1)}),2e3)))}),0)}))}(0,t,n)}function dt(e,t,n){let r=()=>document.fullscreenElement,i="fullscreenchange";if(!Element.prototype.requestFullscreen){const e=Element.prototype,t=document;e.webkitRequestFullScreen&&(e.requestFullscreen=e.webkitRequestFullScreen,t.fullscreenEnabled=!0),t.webkitCancelFullScreen&&(document.exitFullscreen=t.webkitCancelFullScreen),i="webkit"+i,r=()=>t.webkitCurrentFullScreenElement}n.toggleFullScreen=function(e,r){n.ios_fullscreen_disabled||("boolean"!=typeof e&&(e=!n.in_fullscreen),ft(n)&&(e?function(e){e.getAttribute("playsinline")&&e.removeAttribute("playsinline");e.getAttribute("webkit-playsinline")&&e.removeAttribute("webkit-playsinline");e.webkitEnterFullScreen()}(n):function(e,t){e.getAttribute("playsinline")||e.setAttribute("playsinline","");e.getAttribute("webkit-playsinline")||e.setAttribute("webkit-playsinline","");t||e.webkitExitFullScreen();e.togglePlay(!1),e.hasState(O)||e.setState(O,!0)}(n,r)),document.fullscreenEnabled&&(e?t.requestFullscreen():document.exitFullscreen()))},ft(n)&&(n.ios_fullscreen_disabled=!0,n.once("beforeplay",(function(){n.ios_fullscreen_disabled=!1})),n.on("webkitendfullscreen",(function(){n.toggleFullScreen(!1,!0)}))),t.addEventListener(i,(function(){const e=r(),o=e===t||e==n;n.in_fullscreen=o,n.emit(o?"fullscreenenter":"fullscreenexit"),n.setState("is-fullscreen",o),n.emit(c)})),!1!==e.doubleclick&&t.addEventListener(o,(function(e){var t;e.target&&(null===(t=e.target)||void 0===t?void 0:t.classList.contains("fp-ui"))&&n.toggleFullScreen()}))}function ft(e){return n().ios&&"function"==typeof e.webkitEnterFullScreen&&"function"==typeof e.webkitExitFullScreen}ye(_e(),ct),"undefined"!=typeof window&&window.matchMedia&&[v,g].forEach((function(e){window.matchMedia("(orientation: "+e+")").addListener((function(n){t.length&&t.forEach((function(t){n.matches&&t.emit(e)}))}))}));const pt={name:"fp-fullscreen",translation_key:"core.fullscreen"},mt={name:"fp-fullscreen-exit",translation_key:"core.exit_fullscreen"},ht={name:"fp-play",translation_key:"core.play"},vt={name:"fp-pause",translation_key:"core.pause"},gt={translation_key:"core.mute",name:"fp-volume-mute-unmute"},yt={translation_key:"core.play",name:"fp-small-play"},_t={translation_key:"core.pause",name:"fp-small-pause"},Et={name:"fp-fast-forward"};function bt(e){const t=document.createElement("div");return t.classList.add("fp-icon",e.name),e.title&&t.setAttribute("title",e.title),e.title&&t.setAttribute("aria-label",e.title),t.setAttribute("tabindex","0"),t.setAttribute("focusable","true"),t}function wt(e,t,n){const o=Z("fp-header"),i=Z("fp-primary"),a=Z("fp-duration"),s=function(e,t){const n=Z();n.classList.add("fp-secondary","fp-togglable"),dt(e,t.root,t);const o=bt(pt);o.setAttribute("role","button"),o.setAttribute("aria-label",t.i18n("core.fullscreen"));const i=bt(mt);return i.setAttribute("role","button"),i.setAttribute("aria-label",t.i18n("core.fullscreen_exit")),o.addEventListener(r,()=>t.toggleFullScreen()),i.addEventListener(r,()=>t.toggleFullScreen()),n.append(o,i),n}(e,n),u={logo:""};n.on(h,(function(e){var t,n,r,o,s;o=a,s=(null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.duration)||NaN,o.innerText=isFinite(s)?te(s):"";const c=u.logo,l=(null===(n=null==e?void 0:e.data)||void 0===n?void 0:n.logo)||"";c!=l&&(u.logo=l,function(e,t,n){if(e.innerHTML="",!t)return;const r=document.createElement("img");if(r.classList.add("fp-logo"),r.src=t,!n)return e.append(r);const o=document.createElement("a");o.href=n,o.append(r),e.append(o)}(i,l,null===(r=null==e?void 0:e.data)||void 0===r?void 0:r.logo_href))})),o.append(i,a,s),t.append(o),n.reaper&&(n.reaper.set("header",o),n.reaper.set("header.secondary",s))}var St=Object.freeze({__proto__:null,NO_FULLSCREEN:1,NO_VOLUME_CONTROL:2,NO_MUTE:4,LOGO_ON_RIGHT:8,USE_DRAG_HANDLE:16,USE_PLAY_2:32,USE_PLAY_3:64,USE_THIN_CONTROLBAR:128,NO_TITLE:256,NO_DESCRIPTION:512,NO_CONTROLS:1024,NO_DURATION:2048,NO_HEADER:4096,AUDIO_ONLY:8192,NO_TOUCH_ZONES:16384});function kt(e,t,n){if(!n.reaper)return;const i=Z("fp-middle"),a=Z("fp-left-zone"),s=Z("fp-middle-zone"),c=Z("fp-right-zone"),l=[a,s,c];!function(e,t){const n=t[0],r=t[1];e.on(p,(function(){t.forEach(Ot)})),e.on("seek:queued",(function(e){const o=e.data;if(!o)return;if("number"!=typeof o.offset)return;const i=o.offset;if(0==i)return t.forEach(Ot);const a=i>0?r:n;return Ot(a==r?n:r),function(e,t){const n=e.querySelector(".fp-zone-seconds");n&&(n.innerText=Math.abs(t)+"")}(a,i)})),e.on("seek:cancel",(function(){t.forEach(Ot)})),t.forEach((function(t){const r=t==n?-1:1,o=document.createElement("span"),i=At(Et);o.classList.add("fp-zone-seconds"),t.append(o,i),Ot(t),t.addEventListener(u,(function(t){isNaN(e.duration)||isNaN(e.currentTime)||16384&e.opt("ui")||e.hasState("no-timeline")||!e.hasState("will-seek")&&!e.hasState(O)||e.enqueueSeek(5*r)&&(t.stopPropagation(),t.preventDefault())}))}))}(n,[a,c]),l.forEach((function(e){i.append(e)})),n.reaper.set("middle",i),function(e,t){[r,o].forEach(n=>e.addEventListener(n,(function(e){if(!e.defaultPrevented)return e.preventDefault(),t.emit(e.type),!1}))),t.on(r,(function(e){setTimeout((function(){e.defaultPrevented||t.hasState(A)||t.togglePlay()}),0)})),t.on(o,(function(e){setTimeout((function(){e.defaultPrevented||t.toggleFullScreen()}),0)}))}(i,n),function(e){const t=Z("fp-wait");Array(...Array(4)).map((e,t)=>t).forEach(()=>{t.append(document.createElement("b"))}),e.append(t)}(s);const d=Z("fp-switch");return d.append(...[ht,vt].map(At)),s.append(d),t.append(i),i.setAttribute("tabindex","0"),i.setAttribute("role","button"),i.setAttribute("aria-label",n.i18n("core.play")),[f,p].forEach(e=>n.once(e,(function(){i.removeAttribute("tabindex"),i.removeAttribute("role"),i.removeAttribute("aria-label")}))),i}function At(e){const t=bt(e);return t.removeAttribute("tabindex"),t}function Ot(e){const t=e.querySelector(".fp-zone-seconds");t&&(t.innerText="")}function Tt(){}document.addEventListener(r,(function(e){this.active_menu&&!this.active_menu.contains(e.target)&&(Array.from(document.querySelectorAll(".fp-engine")).forEach(e=>{const t=e.root.querySelector("details[open].fp-menu-container");t&&(t.open=!1,e.root.classList.toggle("has-menu-opened",!1))}),this.active_menu=void 0)}));const Nt={passive:!0};var Lt;function Rt(e,t){let n=0,r=-1,o=-1;const i=Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5),a=e.classList;e.id=i,a.remove(Lt.GRABBING),a.remove(Lt.TOUCHING);const s=t.onseek||Tt,c=t.onstart||Tt,l=t.onend||Tt,d=t.onmouse||Tt,f=t.ontouch||Tt,p=t.ontouchend||Tt;function m(t){!function(){const t=e.getBoundingClientRect();n=t.left,r=t.width}();let o=(function(e){return"function"==typeof window.TouchEvent&&e instanceof TouchEvent}(t)?t.changedTouches[0].pageX:t.pageX)-n;return o>r&&(o=r),o<0&&(o=0),o/r*100}function h(t){const n=m(t);n!=o&&(s(e,n),o=n)}return e.addEventListener("touchstart",(function(t){It(e,t)&&(a.add(Lt.TOUCHING),Pt(e.parentElement)&&(t.preventDefault(),a.add(Lt.GRABBING),f(e,m(t)),c(e,m(t)),h(t)))}),Nt),e.addEventListener("touchmove",(function(t){t.preventDefault(),h(t),d(e,m(t))}),Nt),e.addEventListener(u,(function(t){setTimeout((function(){a.remove(Lt.TOUCHING)}),500),It(e,t)&&(t.preventDefault(),a.remove(Lt.GRABBING),p(e,m(t)),l(e,m(t)),r=0)}),Nt),e.addEventListener("touchcancel",(function(){a.remove(Lt.GRABBING,Lt.TOUCHING),r=0}),Nt),e.addEventListener("mousedown",(function(t){a.contains(Lt.TOUCHING)||(document.addEventListener("mousemove",h),a.add(Lt.GRABBING),c(e,m(t)),t.preventDefault(),h(t))})),e.addEventListener("mousemove",(function(t){a.contains(Lt.TOUCHING)||d(e,m(t))})),document.addEventListener("mouseup",(function(t){a.contains(Lt.TOUCHING)||(document.removeEventListener("mousemove",h),a.contains(Lt.GRABBING)&&(a.remove(Lt.GRABBING),l(e,m(t)),r=0))})),e}function It(e,t){const n=t.target;return!!n&&(n&&!n.closest(e.id)||!Pt(e.parentElement)||!e.classList.contains(Lt.TOUCHING))}function Pt(e){if(!e)return!1;const t=window.getComputedStyle(e);return"0"!==t.width&&"0"!==t.height&&"0"!==t.opacity&&"none"!==t.display&&"hidden"!==t.visibility}!function(e){e.GRABBING="has-grab",e.TOUCHING="has-touch"}(Lt||(Lt={}));function Mt(e){if("object"!=typeof e.opts)return{head:0,tail:0};if(0==e.seekable.length)return{head:0,tail:0};const t=e.opt("live_dvr_window",0),n=e.seekable.end(e.seekable.length-1);return{head:n,tail:Math.max(e.seekable.start(0),n-t)}}function xt(e){return e.opt("live",!1)||e.duration>=Number.MAX_SAFE_INTEGER}function Ut(e){return isFinite(e.duration)?e.duration:0==e.seekable.length?0:e.seekable.end(0)}function Dt(e){return function(e){return Mt(e).head}(e)-.5}function Ct(e,t){if(!e.parentElement)return;const n=e.clientWidth/e.parentElement.clientWidth*100/2;e.style.left=t-n+"%",e.style.display="block"}function Gt(e,t){if(isNaN(e.duration))return;const n=e.buffered;n.length&&(t.style.width=Math.min(n.end(n.length-1)/e.duration*100,100)+"%")}function jt(e,t){e.style.width="0",t.style.width="0",t.style.display="none"}function Ft(e,t,n){if(t.seeking||!t.seekable||0==t.seekable.length)return;const r=qt(t,e/100);Ct(n,e);const o=isFinite(t.duration)?r:t.seekable.start(0)+r;n.innerText=te(o)}function qt(e,t){if(t>1||t<0)return console.warn("cannot calculate a percent outside of range(0..1)"),0;if(isFinite(e.duration))return Ut(e)*t;const n=e.seekable.start(0);return n+t*(e.seekable.end(0)-n)}function Ht(e,t){e.style.width="0",t.style.display="none"}const Bt=requestAnimationFrame;function Wt(e,t,n){const o=Z("fp-controls","fp-togglable"),i=Z("fp-timeline","fp-bar"),a=Z("fp-btns","fp-small-switch"),u=Z("fp-live-status"),c=Z("fp-live-indicator","fp-color"),d=Z("fp-live-text"),p=Z("fp-buffer"),m=Z("fp-progress","fp-color"),v=Z("fp-hover"),g=Z("fp-timestamp"),y=Z("fp-duration"),_=Z("fp-dragger","fp-color"),E=document.createElement("span");d.innerHTML="live",g.style.display="none",E.classList.add("fp-elapsed"),E.innerText=te(0),i.setAttribute("role","slider"),i.setAttribute("tabindex","0"),i.setAttribute("aria-label",n.i18n("timeline","Timeline")),i.append(p,m,v,g),o.append(a,u,E,i,y),u.append(c,d);const b=bt(_t);b.setAttribute("role","button");const w=bt(yt);w.setAttribute("role","button"),b.addEventListener("click",(function(){n.togglePlay(),setTimeout((function(){w.focus&&w.focus()}),100)})),w.addEventListener("click",(function(){n.togglePlay(),setTimeout((function(){b.focus&&b.focus()}),100)})),a.append(b,w),m.append(_),u.addEventListener(r,(function(){!function(e,t){try{if(!e.hasState("is-live-seeked"))return;e.dvr_offset=0;const n=Dt(e);e.currentTime=n,e.setState("is-live-seeked",!1),t.style.width="0"}catch(e){console.warn("failed to seek to now: %j",e)}}(n,m)})),n.on(h,(function(t){if(0==n.reaper)return;if(!t.data)return;e.seekable=void 0===t.data.seekable||t.data.seekable;const r=xt(n)?NaN:t.data.duration||0;if(isNaN(r)||r>=Number.MAX_SAFE_INTEGER)return y.style.display="none";y.style.display="inline-block",y.innerText=te(r)}));let k=performance.now();const A=()=>{if(0==n.reaper||e.live)return;const t=performance.now();var r;t-k>1e3/30&&(r=n,m.style.width=r.currentTime/r.duration*100+"%",k=t),n.paused||i.classList.contains(Lt.GRABBING)||Bt(A)};n.on(f,()=>Bt(A)),n.on("timeupdate",(function(){var t;0!=n.reaper&&(Bt(A),i.setAttribute("aria-valuenow",n.currentTime+""),e.live?function(e,t){t.innerText=te(e.currentTime)}(n,E):(t=n,E.innerText=te(t.currentTime)),e.live||Gt(n,p),e.live&&function(e){return!("dvr"in e)||1==e.dvr}(e)&&function(e,t){if(0==t)return!0;const n=Mt(e);return n.head-n.tail>=t}(n,e.seconds_to_dvr||0)&&n.setOpts({dvr:n.seekable.length>0}))})),n.on("progress",(function(){0!=n.reaper&&(e.live||Gt(n,p))})),n.on("live",(function(){n.setState("is-live-seeked",!1),m.style.width="0%"})),n.on("dvr",(function(){const e=Ut(n),t=n.seekable.end(0)-n.seekable.start(0),r=(e-n.currentTime)/t*100,o=Math.round(r);n.setState("is-live-seeked",o>0),m.style.width=o+"%"})),n.on("seeking",(function(){if(!xt(n))return;if(0==n.seekable.length||0==n.played.length)return;if(0==Ut(n))return;const e=Dt(n),t=n.currentTime>=e?"live":"dvr";n.emit(t)})),n.on(l,(function(){var t,r;0!=n.reaper&&(n.setOpts({live:xt(n)}),e.live||(r=y,(t=n).duration&&(r.innerText=te(t.duration)),Gt(n,p)))})),n.on("durationchange",(function(e){if(0==n.reaper)return;const t=xt(n),r=t?Ut(n):e.data||n.duration;isNaN(r)||(n.setOpts({live:t,duration:r}),i.setAttribute("aria-valuemax",r+""),i.setAttribute("aria-valuemin","0"))}));let O=!1;return Rt(i,{onseek:function(t,r){if(Vt(n))switch(!!e.live){case!0:Ft(r,n,g);break;case!1:!function(e,t,n){const r=t.duration*(e/100);if(t.disabled&&r>t.currentTime)return!1;n.style.width=e+"%",t.currentTime=r}(r,n,m),Ct(g,r)}},onstart:function(){Vt(n)&&(n.emit("timeline/gesture/start"),n.setState(S,!0),e.live||function(e){!function(e){e.style.display="block"}(e)}(g))},onend:function(t,r){Bt(A),0!=e.seekable&&(n.setState(S,!1),e.live&&function(e,t){e/=100,t.currentTime=qt(t,e)}(r,n))},ontouch:function(){n.paused||(O=!0,n.pause())},ontouchend:function(){O&&(O=!1,n.play()),e.live?Ht(v,g):jt(v,g)},onmouse:function(t,r){if(Vt(n)&&!i.classList.contains(Lt.GRABBING))switch(n.emit("timeline/gesture/move",{percent:r}),!!e.live){case!0:!function(e,t){t.style.width=function(e){return 100-e}(e)+"%"}(r,v),Ft(r,n,g);break;case!1:!function(e,t){t.style.width=e+"%"}(r,v),function(e,t,n){if(isNaN(e)||isNaN(t.duration))return;Ct(n,e),n.innerHTML="";const r=document.createElement("span");r.innerText=te(e/100*t.duration),n.append(r)}(r,n,g)}}}),i.addEventListener(s,(function(){n.emit("timeline/gesture/end"),e.live?Ht(v,g):jt(v,g)})),o}function Vt(e){return 0!=e.opt("opts.seekable",!0)&&!isNaN(e.duration)}function Kt(e){try{return localStorage.getItem(e)}catch(e){return null}}function Yt(e,t){try{localStorage.setItem(e,t)}catch(e){}}function zt(e,t,o){const i=document.createElement("div");i.className="fp-volumebtn",i.append(bt(gt)),o.append(i),i.addEventListener(r,(function(){t.toggleMute()}));const a=!n().ios&&function(e){const t=function(e,t){const n=document.createElement("div");n.className="fp-volume";const r=e.classList;let o=10;r.contains("is-small")&&(o=8);r.contains("is-tiny")&&(o=6);const i=Array.from({length:o}).map(()=>{const e=document.createElement("i");return e.className="fp-tick",e});return n.append(...i),Rt(n,{onseek:t})}(e.root,(n,r)=>{r>0&&(e.muted=!1,function(e){try{localStorage.removeItem(e)}catch(e){}}("mute")),Yt("volume",(e.volume=r/100).toString()),Xt(t,e.volume)});return t.setAttribute("tabindex","0"),t.setAttribute("role","slider"),t.setAttribute("aria-valuemin","0"),t.setAttribute("aria-valuemax","1"),t.setAttribute("aria-label",e.i18n("core.volume","volume")),t}(t);a&&o.append(a),t.on("volumechange",(function(){const e=0==t.volume||t.muted;t.setState("is-muted",e),Yt("mute",e.toString()),i.setAttribute("aria-label",e?t.i18n("unmute","unmute"):t.i18n("mute","mute")),a&&(e&&Xt(a,0),a.classList.contains(Lt.GRABBING)||Xt(a,t.volume))})),"true"==Kt("mute")&&(t.muted=!0,t.setState("is-muted",t.muted));const s=Kt("volume");s&&!isNaN(Number(s))&&(t.volume=Number(s)),t.emit("volumechange")}function Xt(e,t){e.setAttribute("aria-valuenow",t.toString());const n=Array.from(e.querySelectorAll(".fp-tick")),r=Math.round(t*n.length);n.forEach((e,t)=>{e.classList.toggle("fp-color",t<r)})}const Qt={"-1":"an unknown error occurred",1:"media playback was aborted",2:"a network error occurred",3:"unable to decode media content",4:"unsupported media type",1001:"cannot load insecure content in a secure context",1002:"no internet connection detected"};function Jt(){return!0===(navigator||{}).onLine}function Zt(e){try{return"https:"===location.protocol&&"http:"==function(e){const t=document.createElement("a");return t.href=e,t}(e).protocol}catch(e){return!1}}function $t(e,t,n){n.on("error",(function(e){const t=e.data||n.error||new Error,r=e.code||t.code,o="Error: %s\n"+(null===(i=(new Error).stack)||void 0===i?void 0:i.split("\n").slice(2).join("\n"));var i;setTimeout((function(){if(e.defaultPrevented)return;if("AbortError"==t.name)return;n.setState("is-error",!0),8===r||t.fatal||function(e){const t=e.togglePlay,n=e.root;e.togglePlay=Tt,e.once("recover",(function(){e.togglePlay=t,e.setState("is-error",!1);const r=n.querySelector(".fp-error");r&&r.remove()}))}(n);const i=function(e,t,n){switch(t){case"http:0":return function(e){return Zt(e.original_src)?{code:1001}:Jt()?{code:2}:Jt()?{code:-1}:{code:1002}}(e);case 4:return e.once("loadstart",(function(){e.emit("recover")})),n;default:return n}}(n,r,t),a=function(e,t){if(t.message)return t.message;if(t.stack)return t.stack;const n=(t.code||-1).toString();return e.i18n("media_errors."+n,Qt[n]||Qt[-1])}(n,i);console.error(o,a);const s=n.reaper&&n.reaper.get("ui");return s&&function(e,t,n,r){if(!e)return;const o=document.createElement("div");if(o.classList.add("fp-error"),o.innerText=t,r){const t=e.querySelector("#"+r);t&&e.removeChild(t),o.id=r}if(e.append(o),n){const e=document.createElement("div");e.classList.add("fp-error-details"),e.innerText=n,o.append(e)}}(s,a,t.details)}))}))}function en(e,t,n){if(!n.reaper)return;const r=document.createDocumentFragment(),o=Z("fp-ui");r.appendChild(o),n.reaper.set("ui",o),~t.className.indexOf("use-play-")||t.classList.add("use-play-1"),function(e,t,n){const r=Z("fp-footer");t.append(r),n.on(h,(function(e){var t,n;const o=null===(t=e.data)||void 0===t?void 0:t.description,i=null===(n=e.data)||void 0===n?void 0:n.title;if(r.innerHTML="","string"==typeof i){const e=Z("fp-title");e.innerText=i,r.append(e)}if("string"==typeof o){const e=o.split(" "),t=Z("fp-desc");for(t.innerText=e.join(" "),r.append(t);e.length>1&&t.scrollHeight>t.offsetHeight;)e.pop(),t.innerText=e.join(" ")+"..."}}))}(0,t,n),wt(e,o,n),kt(0,o,n);const i=Wt(e,0,n);o.append(i),zt(0,n,i),$t(0,0,n),t.appendChild(r),[a,s].forEach(e=>{t.addEventListener(e,(function(e){n.setState("is-hovered",e.type==a),n.setState("is-accessibility",!1)}))}),n.on(h,(function(e){var n;const r=null===(n=e.data)||void 0===n?void 0:n.ui;if("number"!=typeof r)return;const o=t.classList;o.toggle("use-play-1",!(32&r||64&r)),o.toggle("use-play-2",(32&r)>0),o.toggle("use-play-3",(64&r)>0),o.toggle("use-thin-controlbar",(128&r)>0),o.toggle("no-title",(256&r)>0),o.toggle("no-description",(512&r)>0),o.toggle("logo-on-right",(8&r)>0),o.toggle("use-drag-handle",(16&r)>0),o.toggle("no-controls",(1024&r)>0),o.toggle("no-duration",(2048&r)>0),o.toggle("no-header",(4096&r)>0),o.toggle("no-mute",(4&r)>0),o.toggle("no-volume",(2&r)>0),o.toggle("no-fullscreen",(1&r)>0),o.toggle("no-touch-zones",(16384&r)>0)}));let u=null;o.addEventListener("mousemove",(function(){"number"==typeof u&&clearTimeout(u),n.setState("is-hovered",!0),u=0==n.paused&&setTimeout((function(){n.setState("is-hovered",!1)}),2e3)}))}function tn(e,t,n){if(Oe.from_token(e.token||"").is_granted(Oe.permissions.NO_METERING))return;const r=Se.id(e.token||"");r&&n.once(f,()=>function(e,t){fetch("https://pmi.flowplayer.com/in",{method:"POST",body:JSON.stringify({token_id:t,factor:1,rnd:Math.random().toString(36).substring(2)})}).then(t=>{401==t.status&&e.emit("error:fatal",{reason:"token",details:"The token online validation failed"})})}(n,r))}var nn={ads:{ad:"Ad",ads:"Ads",advertisement:"Advertisement"},audio:{button_txt:"Audio",menu_title:"Audio"},core:{exit_fullscreen:"Exit fullscreen",fullscreen:"Fullscreen",mute:"Mute",pause:"Pause",play:"Play",unmute:"Unmute",volume:"Volume"},ovp:{starting_in:"Countdown"},playlist:{cancel:"Cancel",up_next:"Up next"},qsel:{menu_title:"Quality"},share:{clipboard_failure:"Access to clipboard failed",clipboard_success:"The text is now on your clipboard",embed:"Embed",link:"Link",menu_title:"Share"},speed:{menu_title:"Speed"}};class rn{init(e,t,n){n.reaper&&n.reaper.set("translations",re(rn,e,"en"))}}rn.en=nn;const on=Date.now(),an={session_id:Math.random().toString(36).substring(2)+performance.now().toString(36)};class sn{constructor(){this._summary={},this._session_id=an,this.start_time=on}increment(e,t){if("string"!=typeof e||"number"!=typeof t)return;const n=this._summary[e]||0;this._summary[e]=n+t}set(e,t){"string"==typeof e&&(this._summary[e]=t)}duration(){return Date.now()-this.start_time}summary(e){return Object.assign("object"==typeof e?e:{},{event:"health_summary"},this._summary,this._session_id,{duration:this.duration()})}sessionize(e){return Object.assign(e,this._session_id)}}function un(e,t){return function(e,t){return"function"==typeof navigator.sendBeacon&&navigator.sendBeacon(e,t)}(e,JSON.stringify({events:t}))}class cn{constructor(e){this.middleware=e,this._pending=[]}pending(){return this._pending}_run_middleware(e,t){return e=Object.assign({},e),this.middleware.forEach((function(n){const r=n(t);if("object"==typeof r)return Object.assign(e,r);console.warn("KPI::middleware did not return an Object\nreturn: %o\n\nfn: %s",r,n)})),e}push(e,t){e=this._run_middleware(e,t),this.push_finalized(e)}push_finalized(e){this._pending.push(e),this.send()}send(e){if(this._pending.length<20&&!e)return;const t=this._pending.slice(0);this._pending.length=0,un("https://health.flowplayer.com/v1/health/events",t)}}function ln(){return $(window,"navigator.connection.downlink")}function dn(e){const t=e.hls;if(!t)return;const n=t.abrController._bwEstimator;return n?.001*n.getEstimate():void 0}function fn(e){const t=[dn,ln];for(;t.length;){const n=t.shift(),r="function"==typeof n&&n(e);if("number"==typeof r)return{downlink_mbs:Number(r.toFixed(2))}}return{}}const pn=document.createElement("a");function mn(e){const t=e.original_src;return"string"!=typeof t?{}:(pn.href=t,"string"==typeof pn.pathname?{media_type:pn.pathname.split(".").pop()}:{})}function hn(e){return{preload:e.opt("preload"),autoplay:e.opt("autoplay",e.autoplay)}}function vn(e){return{player_id:e.opt("metadata.player_id"),media_id:e.opt("metadata.media_id"),site_id:e.opt("metadata.site_id"),category_id:e.opt("metadata.category_id"),sitegroup_id:e.opt("metadata.sitegroup_id"),token:e.token}}function gn(){return{timestamp:Date.now()}}function yn(){return{ua:navigator.userAgent,version:"3.0.0-rc6",commit:"6d66ffa737639c623b6ecccdefd3d118199516a8"}}const _n=["error","rebuffer"],En=_n.concat([i,"loadstart",l,d,"error:fatal",f,p,"quality:set","pause","ended","seeking"]);function bn(e,t,n){e.push_finalized(Object.assign(t.summary({}),hn(n),vn(n),gn(),yn())),e.send(!0)}function wn(e){try{return!!new URL(e)}catch(e){return!1}}pe(window,"flowplayer:umd",(function(e){const t=e.data;t&&window.addEventListener("unload",(function(){t.instances.forEach(e=>e.emit("unload"))}))}));class Sn{init(e,t,n){if(n._health)return;const r=n._health=new sn,o=n._kpis=new cn([mn,hn,vn,fn,gn,yn]);_n.forEach(e=>{r.set(e,0)}),function(e){e.on("waiting",(function(t){e.seeking||e.networkState===e.NETWORK_LOADING&&e.readyState!==e.HAVE_NOTHING&&e.emit("rebuffer")}))}(n),n.on(m,(function(){o.send(),n._kpis=n._health=void 0})),n.on("health:summary:increment",(function(e){e.data&&Object.keys(e.data).forEach((function(t){e.data&&r.increment(t,e.data[t])}))})),n.on("health:summary:set",(function(e){e.data&&Object.keys(e.data).forEach((function(t){e.data&&r.set(t,e.data[t])}))})),n.on(_n,(function(e){setTimeout(()=>{e.defaultPrevented||n.emit("health:summary:increment",{[e.type]:1})})})),n.on(En,(function(e){setTimeout(()=>{e.defaultPrevented||n.emit("health:kpi:track",{event:e.type})},0)})),n.on("health:kpi:track",(function(e){if(!e.data)return;const t=r.sessionize(e.data);o.push(t,n)})),n.on("src",(function(e){const t=e.data&&e.data.src;"string"==typeof t&&wn(n.original_src)&&wn(t)&&t!=n.original_src&&bn(o,r,n)})),n.on("unload",(function(){bn(o,r,n)}))}}ye(window,Sn);return Ce.extensions.unshift.apply(Ce.extensions,[rn,ct,Sn,class{init(e,t,n){tn(e,0,n),en(e,t,n),lt(0,t,n)}}]),Object.assign(Ce,{ui:St,i18n:rn})}));
package/embed.js CHANGED
@@ -12,7 +12,7 @@
12
12
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13
13
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14
14
  PERFORMANCE OF THIS SOFTWARE.
15
- ***************************************************************************** */function j(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]])}return r}function G(t){const e=document.createElement("a");e.href=t;const r=e.pathname&&e.pathname.split(".");return r.length>1&&r[r.length-1]}function H(t){switch(t){case"video/mpd":return"application/dash+xml";case"video/m3u8":return"application/x-mpegurl";default:return t}}const K=t=>{var{src:e}=t,r=j(t,["src"]);return[Object.assign({src:e,type:e?H("video/"+G(e)):""},r)]};function V(t){return K({src:t})}function W(t){var{src:e,type:r}=t,n=j(t,["src","type"]);return e&&r?[Object.assign({src:e,type:r},n)]:r&&!e?[Object.assign({type:r},n)]:K(Object.assign({src:e},n))}var q;function Y(t,e,r,n={safari:!1}){const i=function(t){return"string"==typeof t?V(t):Array.isArray(t)||"object"!=typeof t?t.reduce((function(t,e){return"string"==typeof e&&(e=V(e)),"object"!=typeof e||Array.isArray(e)||(e=W(e)),t.concat(e)}),[]):W(t)}(r);return t.currentSrc&&(t.innerHTML=""),Array(...Array(i.length)).map((t,e)=>e).some(r=>{const a=i[r];if(q.Ok==function(t,e,r){t.emit("src",r),"string"==typeof r.src&&(t.original_src=r.src);const n=function(t,e,r){return t.plugins.filter(t=>{return(e=t)&&"wants"in e;var e}).find(t=>t.wants(r.src||"",r,e))}(t,e,r);return n?(n.onload(e,t.root,t,r),q.Ok):q.Err}(t,e,a)||q.Ok==function(t,e,r,n={safari:!1}){/^audio\//.test(r.type||"")&&t.emit("audioonlysource");e.start_time&&(r.src=r.src+"#t="+e.start_time);if(""==t.canPlayType(r.type||""))return q.Err;if(r.drm&&(!r.drm["com.apple.fps.1_0"]||!n.safari))return q.Err;"string"==typeof r.src&&(t.src=r.src);return q.Ok}(t,e,a,n))return!0;r==i.length-1&&"string"==typeof a.src&&(t.src=a.src)}),function(t,e){(function(t,e){if(!t.currentSrc)return;if("none"==t.opt("preload"))return;if(e.autoplay&&e.autoplay>0)return;t.load()})(t,e),"none"==t.opt("preload")&&t.render()}(t,e),t}!function(t){t[t.Err=0]="Err",t[t.Ok=1]="Ok"}(q||(q={}));const z=[v,"seeking","src","seek:cancel"];var X;function Q(t,e,r){return isNaN(t.duration)||isNaN(t.currentTime)?{}:(e.offset+=r,0==e.offset?J(t,e):(e.timer&&clearTimeout(e.timer),e.timer=setTimeout((function(){0!=t.reaper&&(t.currentTime=function(t,e,r=0){return Math.max(Math.min(e,t),r)}(t.currentTime+e.offset,t.duration),e.timer=0,J(t,e))}),1e3),function(t,e){t.setState("will-seek",!0),t.setState(X.BACKWARD,e.offset<0),t.setState(X.FORWARD,e.offset>0)}(t,e),t.emit("seek:queued",e),e))}function J(t,e){e.timer&&clearTimeout(e.timer),e.timer=e.offset=0,function(t){t.setState(X.FORWARD,!1),t.setState(X.BACKWARD,!1),t.setState("will-seek",!1)}(t)}function Z(){if("undefined"==typeof document)return!1;const t=document.documentElement;return t&&"rtl"==t.getAttribute("dir")}function $(...t){const e=document.createElement("div");return 0==t.length||e.classList.add(...t),e}function tt(t,e,r){const n=function(t){return Array.isArray(t)?t.slice(0):t.split(".")}(e);for(;n.length;){if(null==t)return r;const e=n.shift();if("string"!=typeof e)return r;t=t[e]}return null==t?r:t}function et(t){const e="number"==typeof t?t:parseInt(t,10);return(e>9?"":"0")+e}function rt(t){if(isNaN(t)||t>=Number.MAX_SAFE_INTEGER)return"";const e=t<0?"-":"";t=Math.round(Math.abs(t));const r=Math.floor(t/3600);let n=Math.floor(t/60);return t-=60*n,r>=1?(n-=60*r,e+r+":"+et(n)+":"+et(t)):e+et(n)+":"+et(t)}!function(t){t.FORWARD="forward",t.BACKWARD="backward"}(X||(X={}));const nt=navigator.languages||[navigator.language];function it(t,e,r){const n={};return r=e.lang||r,t[r]&&(n[r]=t[r]),function(){try{return nt.reduce((t,e)=>~e.indexOf("-")?t.concat(e,e.split("-")[0]):t.concat(e),[])}catch(t){return[]}}().forEach((function(e){t[e]&&!n[e]&&(n[e]=t[e])})),Object.values(n)}const at={3:!0,5:!0,7:!0,9:!0};function st(){return(t=Array(16),Array.from({length:t.length}).map((t,e)=>e).forEach(e=>{let r;0==(3&e)&&(r=4294967296*Math.random()),t[e]=(r||0)>>>((3&e)<<3)&255}),t).reduce((function(t,e,r){const n=(e+256).toString(16).substr(1);return t+(r.toString()in at?"-":"")+n}),"");var t}let ot="";!function(){let t=!1;try{const e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("testPassive",null,e),window.removeEventListener("testPassive",null,e)}catch(t){}}();const ut=["touchstart","touchmove"];function lt(t,e){const r=new CustomEvent(t,{detail:e});return e&&Object.defineProperty(r,"data",{get:()=>e}),r}function ct(t,e,r){const n=lt(e,r);return t.dispatchEvent(n),t}function dt(t,e,r){const n=lt(e,r);return t.dispatchEvent(n),n}function ft(t,e,r,n){Array.isArray(e)?e.forEach(e=>ht(t,e,r,n)):ht(t,e,r,n)}function ht(t,e,r,n){if(i=e,!~ut.indexOf(i))return t.addEventListener(e,r,n),t;var i;const a=Object.assign(n||{},{passive:!0});return t.addEventListener(e,r,a),t}function pt(t,e,r,n){return ft(t,e,r,Object.assign(n||{},{once:!0}))}const vt={preload:"none",rtl:!1,controls:!0},gt=["loop","muted","preload"];function mt(t,n,i){i.toJSON=function(){return{duration:i.duration,volume:i.volume,currentTime:i.currentTime,states:i.root.className}},i.setSrc=function(e){return Y(i,t,e,r())},i.playerState=i.playerState||{},i.setState=function(t,e){if(i.playerState[t]===!!e)return i;const r=Object.assign({},i.playerState,{[t]:e});return r[k]&&(r[T]=!1),i.playerState=r,ct(i,"state",i.playerState),i},i.hasState=function(t){return!!i.playerState[t]},i.transitionState=function(t,e,r){i.hasState(t)&&(r=0),r&&i.setState("is-toggling",!0),i.setState(e,!1),i.setState(t,!0),r&&setTimeout((function(){i.setState("is-toggling",!1)}),r)},i.render=function(t,e){return"string"==typeof t?M.render(t,e):(ct(i,r().ios?d:f),ct(i,"canplay"),i)},i.emit=(t,e)=>(ct(i,t,e),i),i.on=(t,e)=>(ft(i,t,e),i),i.once=(t,e)=>(pt(i,t,e),i),i.off=(t,e)=>{var r,n;return r=t,n=e,i.removeEventListener(r,n),i},i.poll=(t,e)=>dt(i,t,e),i.togglePlay=function(e){return N(i,t,e)},i.toggleMute=function(t){t=null==t?!i.muted:!!t,i.muted=t,i.muted||i.volume||(i.volume=1),ct(i,"volumechange")},i.toggleDisable=function(t){t=null==t?!i.disabled:!!t,i.setState("is-disabled",t),i.disabled=t},i.destroy=function(){i.pause();const t=e.indexOf(i);~t&&e.splice(t,1),setTimeout((function(){i.setSrc([]),i.reaper&&i.reaper.clear(),ct(i,v)}),0)},i.setAttrs=function(t){return gt.forEach(e=>{if(!(e in t))return;const r=t[e];r?i.setAttribute(e,r.toString()):i.removeAttribute(e)}),i},i.opt=function(e,r){return r=void 0===r?tt(vt,e):r,tt(t,e,r)},i.i18n=function(t,e){if(!i.reaper)return"";const r=i.reaper.get("translations");return r?function t(e,r,n,i){return(i=i||0)>=e.length?n:tt(e[i],r,t(e,r,n,i+1))}(r,t,e||""):e||""},i.setOpts=function(e){Object.assign(t,e),"disabled"in e&&void 0!==e.disabled&&i.toggleDisable(e.disabled),"muted"in e&&void 0!==e.muted&&i.toggleMute(e.muted);const r=!!t.autoplay&&!i.hasState("no-autoplay");i.setState("is-autoplay",r),i.setState("is-rtl",i.opt("rtl",function(t){if(!t)return Z();const e=t.getAttribute("dir");return e?"rtl"==e:Z()}(n))),i.setState("is-live",!!t.live),i.setState("no-timeline",!(!t.live||t.dvr)),i.setState("has-poster","string"==typeof t.poster&&t.poster.length>0),i.setState("is-seekable",!!t.seekable),n.style.backgroundImage=i.hasState("has-poster")?"url('"+t.poster+"')":"",ct(i,g,t)},i.renderPlugin=function(t){dt(i,"renderplugin",t).defaultPrevented||i.root.appendChild(t)};const a={offset:0,timer:0};var s,o;o=a,(s=i).on(z,(function(){J(s,o)})),i.enqueueSeek=function(t){if(0!=i.opts.seekable&&!(1==i.opts.disabled&&t>0))return Q(i,a,t)},i.deviceId=function(){return function(){if(ot)return ot;try{const t=localStorage.getItem("flowplayer/uuid");if(t)return t;const e=st();return localStorage.setItem("flowplayer/uuid",e),e}catch(t){return ot=st()}}()}}function yt(t,e){const r=e.querySelector("video"),n=r||(t._video_element_callback?t._video_element_callback(t):document.createElement("video"));return n.classList.add("fp-engine"),n.playsInline=!0,r||e.append(n),n}function Et(t,e){if("object"==typeof exports&&"undefined"!=typeof module)return e;"flowplayer"in t||(t.flowplayer={extensions:[]});const r=t.flowplayer;return"function"==typeof r?(r(e),e):(Array.isArray(r.extensions)||(r.extensions=[]),~r.extensions.indexOf(e)||r.extensions.push(e),e)}function Tt(){return"undefined"!=typeof window?window:"undefined"!=typeof global?global:{}}const _t=["localhost","127.0.0.1","0.0.0.0","s.codepen.io","cdpn.io","try.flowplayer.com"];function bt(t,e){return!!~_t.indexOf(t)||t.indexOf(e)===t.length-e.length}bt.check_whitelist=function(t){return!!~_t.indexOf(t)};const St="production";function At(t,e){const r={valid_jwt:!1,raw:"",data:{acl:0},exp:0};let n={c:"{}",exp:0};e=e||{};try{n=P(t),r.valid_jwt=!0}catch(t){}return r.raw=t,r.data=JSON.parse(n.c),r.exp=n.exp,e.require_valid_token&&At.validate(r),r}function Lt(t){try{return At.validate(t),{success:!0,message:""}}catch(t){return{success:!1,message:t.message}}}var kt;function wt(t){return{grant:t,is_granted:e=>(t&e)===e}}function Dt(t,e,r){e&&e.destroy(),console.error(new Error(r.details||r.reason)),t.innerHTML="",t.classList.remove("flowplayer"),t.classList.add("flowplayer-fatal"),t.innerHTML='\n <h2>Playback Error</h2>\n <p>Are you the site owner?</p>\n <a class="troubleshoot" target="_blank" href="https://flowplayer.com/help/developers/troubleshooting">Troubleshoot?</a>\n <img src=""https://flowplayer.com/user/pages/images/logo-white.png""/>\n '}function Rt(t,e){const r=e.clientWidth;e.classList.toggle("is-small",r<600),e.classList.toggle("is-tiny",r<400)}function Ot(t,e,n){let i=!0;e.classList.add("flowplayer"),Rt(0,e),ft(n,["loadstart",c],(function(){Rt(0,e)})),ft(n,"state",(function(){Object.entries(n.playerState).forEach((function([t,r]){e.classList.toggle(t,r)}))})),ft(n,"timeupdate",(function(){n.setState(k,!1)})),ft(n,g,(function(){const r=n.paused&&(!t.autoplay||e.classList.contains("no-autoplay"))&&0==n.currentTime;[b,S].forEach((function(t){n.setState(t,r)}))})),ft(n,"ended",(function(e){setTimeout((function(){e.defaultPrevented||(t.rewind&&!n.loop&&(t.autoplay&&(t.autoplay=0,n.setState("is-autoplay",!1)),n.setState(A,!0),pt(n,p,(function(){n.setState(A,!1),n.pause(),n.setState(S,!0)})),n.currentTime=0),pt(n,"timeupdate",(function(){n.setState(L,!1)})),n.transitionState(L,T,t.loop||t.rewind?0:300))}),0)})),ft(n,["seeking",p],(function(t){n.setState(A,"seeking"==t.type),n.setState(_,n.paused),n.setState(T,!n.paused)})),ft(n,"ended",(function(){n.setState(T,!1),i=!0})),ft(n,r().ios?d:f,(function(t){const e="src"!=t.type||"none"!==n.opt("preload");n.setState("is-loaded",e),n.setState(b,!e)})),ft(n,["waiting","canplay","loadstart"],(function(e){if(!n.hasState(A)&&("canplay"!=e.type||t.autoplay||n.setState(k,!1),"loadstart"!=e.type||"none"!=n.opt("preload")||t.autoplay)){if("loadstart"==e.type&&t.autoplay)return pt(n,h,(function(){n.setState(k,!1)}));"waiting"==e.type&&[T,_,S].forEach((function(t){n.setState(t,!1)})),n.setState(L,!1),n.setState(k,"waiting"==e.type)}})),ft(n,[h,"pause"],(function(e){setTimeout(()=>{const t=new CustomEvent("flowplayer/"+e.type,{detail:n});document.dispatchEvent(t)},0);const r=e.type==h,a=n.currentTime==n.duration,s=r&&i&&t.autoplay||n.hasState(k);if(r&&(n.started=!0,i=!1),n.setState(k,!1).setState(S,!1),a||n.hasState(A))return;const o=r?T:_,u=r?_:T;n.transitionState(o,u,s?0:300),r&&n.setState("no-autoplay",!1)}))}function Ct(t){const e=function(t){const e=t.getBoundingClientRect(),r=window.innerHeight,n=e.height,i=e.bottom,a=n/5;return e.top<=a&&e.top+n>r-a||i-n+a>=0&&i<r+a}(t.root);return t.in_viewport===e||(t.in_viewport=e,ct(t,e?"viewenter":"viewleave")),t}function It(t,r,n){Ct(n);const a={should_resume:!!t.autoplay,has_user_gesture:!1,locked:!1};[l,i].forEach(t=>pt(n,t,()=>a.has_user_gesture=!0)),ft(n,"play",(function(){a.locked||(a.should_resume=!0)})),ft(n,"pause",(function(){a.locked||(a.should_resume=!1)})),ft(n,"canplay",(function(r){t.autoplay&&!e.filter((function(t){return!t.paused})).length&&n.in_viewport&&n.paused&&a.should_resume&&n.togglePlay(!0)})),t.autopause&&(ft(n,"viewenter",(function(){a.should_resume&&n.togglePlay(!0)})),ft(n,"viewleave",(function(){const t=!n.paused;a.locked=!0,n.pause(),setTimeout((function(){a.should_resume=t,a.locked=!1}),0)})))}At.validate=function(t){if("string"==typeof t&&(t=At(t)),!t||!t.raw){if(bt.check_whitelist(window.location.hostname)||"dev"===St.toString())return!0;throw new Error("No token provided in configuration")}if(!t.valid_jwt)throw new Error("Invalid token provided");const e=window.location.hostname,r=bt.bind(null,e);if("dev"!==St.toString()&&t.data.domain&&t.data.domain.length&&!t.data.domain.some(r))throw new Error("Domain not allowed");if("dev"!==St.toString()&&1e3*t.exp-Date.now()<0)throw new Error("Expired token");return!0},At.id=function(t){if(t)return"string"==typeof t&&(t=At(t)),t.data.id},function(t){t[t.ADS=2]="ADS",t[t.ANALYTICS=4]="ANALYTICS",t[t.NO_METERING=8]="NO_METERING",t[t.DEVELOPER_PLAN=16]="DEVELOPER_PLAN"}(kt||(kt={})),wt.of=wt,wt.from_token=function(t){const e=At(t,{require_valid_token:!0});return wt.of(e.data.acl)},wt.permissions=kt,[s,c].forEach(t=>{window.addEventListener(t,(function(){e.forEach((function(t){const e=t.root;e.prevWidth!=e.clientWidth&&(ct(t,c),e.prevWidth=e.clientWidth)}))}))}),window.addEventListener("scroll",(function(){e.forEach(Ct)}));function xt(t){if("number"==typeof t&&!isNaN(t))return Number(t);if("string"==typeof t){const e=t.split(":");return Number(e[1])/Number(e[0])}return t}function Pt(t,e,r){const n=document.createElement("div");n.classList.add("fp-ratio"),e.append(n);let i=xt(t.ratio||.5625);n.style.paddingTop=100*i+"%";const a=[f,d];r.on(a,(function(){const t=r.videoHeight&&r.videoWidth&&r.videoHeight/r.videoWidth;t&&r.setOpts({ratio:t})})),r.on(g,(function(){const e=r.videoHeight&&r.videoWidth&&r.videoHeight/r.videoWidth,a=xt((null==t?void 0:t.ratio)||e||.5625);i!==a&&(i=a,n.style.paddingTop=100*a+"%")}))}const Mt="flowplayer/"+h;function Ft(t){const e=e=>{if(e.detail===t)return;const r=t.opt("multiplay");"boolean"==typeof r&&!1===r&&t.pause()};t.on(v,()=>document.removeEventListener(Mt,e)),document.addEventListener(Mt,e)}const Nt=function(){const t=Tt(),e=t.flowplayer?t.flowplayer:{extensions:[]};return Array.isArray(e.extensions)||(e.extensions=[]),e}();function Ut(r,n){if("function"==typeof r)return t.push(...[...arguments].filter(t=>"function"==typeof t)),Ut;"string"==typeof n&&(n={src:n}),n||(n={}),n.token||"string"!=typeof window.__FLOWPLAYER_TOKEN||(n.token=window.__FLOWPLAYER_TOKEN);const i="string"==typeof r?document.querySelector(r):r;if(!i)return console.error(new Error("Flowplayer: '"+r.toString()+"' not found"));const a=i.querySelector("video.fp-engine");if(a)return a;const s=Lt(n.token);if(!s.success)return Dt(i,null,{reason:"token",details:s.message});const o=new Map,u=yt(n,i);if(u.reaper=o,Object.defineProperty(u,"token",{value:"string"==typeof n.token?At.id(n.token):"",writable:!1}),u.addEventListener(v,()=>{o.clear(),u.reaper=0,delete u.root}),u.root=i,n.token&&wt.from_token(n.token).is_granted(wt.permissions.DEVELOPER_PLAN))return Dt(i,null,{reason:"developer_plan",details:"Using developer plan tokens is not currently supported"});!~e.indexOf(u)&&e.push(u),mt(n,i,u),u.setAttrs(n),u.plugins=Ut.extensions.map(t=>new t(Ut,u)),Ot(n,i,u),It(n,0,u),Pt(n,i,u),Ft(u),u.plugins.forEach(t=>{try{t.init(n,i,u)}catch(e){console.log("Error(plugin/%s)",t.constructor.name,e)}}),u.setOpts(n),u.opts=n,n.src&&u.setSrc(n.src);const l=u.readyState;return l>0&&u.currentSrc&&u.emit(d),l>2&&u.currentSrc&&u.emit("canplay"),"none"==u.opt("preload")&&u.paused&&u.currentSrc&&u.render(),u.emit("mount"),u.on("error:fatal",(function(t){Dt(i,u,t.data||{})})),u}Object.assign(Ut,Nt),function(n){Array.isArray(n.extensions)&&n.extensions.forEach(e=>t.push(e)),n.components=M,n.version="3.0.0-rc6",n.commit="3ff5575be008bca83fb98f88bd7b5012f71fbe28",n.instances=e,n.extensions=t,n.support=r,n.events=E,n.states=D,n.jwt=P,n.autoplay=x,n.quality=F}(Ut),"object"==typeof document&&setTimeout(ct,0,document,"flowplayer:umd",Ut);var Bt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function jt(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Gt(t){var e={exports:{}};return t(e,e.exports),e.exports}var Ht=Gt((function(t,e){var r=Bt&&Bt.__assign||function(){return(r=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};e.__esModule=!0,e.remove=e.downcase=e.pluck=e.merge=void 0,e.merge=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t.reduce((function(t,e){return r(r({},t),e)}),{})},e.pluck=function(t){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];return Object.keys(t).filter((function(t){return~r.indexOf(t)})).reduce((function(r,n){var i;return e.merge(r,((i={})[n]=t[n],i))}),{})},e.downcase=function(t){return(t||"").toString().toLowerCase()},e.remove=function(t,e){var r=t.lastIndexOf(e);return~r&&t.splice(r,1),t}})),Kt=Gt((function(t,e){var r=Bt&&Bt.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),n=Bt&&Bt.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),i=Bt&&Bt.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var i in t)"default"!==i&&Object.hasOwnProperty.call(t,i)&&r(e,t,i);return n(e,t),e};e.__esModule=!0;var a=i(Ht),s=function(){function t(){this.pending=[],this.open=[],this.stats={failures:0,ttl:0}}return t.of=function(){return new t},t.is_empty=function(t){return 0==t.pending.length},t.is_high_water=function(e){return e.open.length==t.MAX_OPEN_REQUESTS},t.maybe_spawn_req=function(e){if(t.is_empty(e))return e;if(t.is_high_water(e))return e;try{var r=t.lpop(e);r&&t.request(e,r)}catch(t){}},t.increment_failures=function(e){return e.stats.failures++,e.stats.failures>t.MAX_FAILURE_COUNT&&(e.stats.ttl=Date.now()+t.REQUEST_TTL_MS),e},t.handle_error=function(e,r){t.rm(e,r),t.increment_failures(e)},t.request=function(e,r){var n=r[0],i=r[1],a=r[2];if(!(Date.now()<e.stats.ttl)){var s=new XMLHttpRequest;e.open.push(s),s.timeout=t.REQUEST_TIMEOUT_MS,s.ontimeout=function(){t.handle_error(e,s)},s.onerror=function(r){t.handle_error(e,s)},s.onreadystatechange=function(){s.readyState==XMLHttpRequest.DONE&&t.rm(e,s),Math.floor(s.status/100)},s.onload=function(){t.rm(e,s),e.stats.failures&&e.stats.failures--},s.open(i,n),s.setRequestHeader("Content-Type","text/plain;charset=UTF-8");try{s.send(JSON.stringify(a))}catch(t){}}},t.rpush=function(e){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];return r.forEach((function(r){e.pending.length>=t.MAX_PENDING||(e.pending.push(r),t.maybe_spawn_req(e))})),e},t.lpop=function(t){return t.pending.shift()},t.rm=function(t,e){return a.remove(t.open,e),t},t.MAX_OPEN_REQUESTS=3,t.MAX_PENDING=5,t.REQUEST_TIMEOUT_MS=4e3,t.REQUEST_TTL_MS=5e3,t.MAX_FAILURE_COUNT=3,t}();e.default=s})),Vt=Gt((function(t,e){var r=Bt&&Bt.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};e.__esModule=!0;var n=r(Kt);e.default=n.default.of()})),Wt=Gt((function(t,e){e.__esModule=!0,e.prepare_url=e.URL_PARAM=void 0,e.URL_PARAM=/:([a-zA-Z_]+)/g,e.prepare_url=function(t,r){return t.url.replace(e.URL_PARAM,(function(e){if((e=e.slice(1,e.length))in r)return r[e].toString();t.log.error(new Error("\n preparing url["+t.url+"] failed\n \n parameter["+e+"] not detected in params:\n \n "+JSON.stringify(r,null,2)+"\n "))}))}})),qt=Gt((function(t,e){e.__esModule=!0,e.Log=void 0;var r=function(){function t(t){this.emitter=t}return t.prepare=function(t,e){var r=document.createEvent("Event");return r.initEvent(t,!1,!0),r.ns=t,r.data=e,r},t.of=function(e){return new t(e)},t.prototype.info=function(e){this.emitter.dispatchEvent(t.prepare(t.NAMESPACE.INFO,e))},t.prototype.error=function(e){this.emitter.dispatchEvent(t.prepare(t.NAMESPACE.ERROR,e))},t.prototype.warn=function(e){this.emitter.dispatchEvent(t.prepare(t.NAMESPACE.WARN,e))},t.NAMESPACE={INFO:"tracker:info",ERROR:"tracker:err",WARN:"tracker:warn"},t}();e.Log=r})),Yt=Gt((function(t,e){var r;e.__esModule=!0,e.Verb=void 0,(r=e.Verb||(e.Verb={})).POST="POST",r.PUT="PUT",r.GET="GET"})),zt=Gt((function(t,e){var r=Bt&&Bt.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),n=Bt&&Bt.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),i=Bt&&Bt.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var i in t)"default"!==i&&Object.hasOwnProperty.call(t,i)&&r(e,t,i);return n(e,t),e},a=Bt&&Bt.__spreadArrays||function(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;var n=Array(t),i=0;for(e=0;e<r;e++)for(var a=arguments[e],s=0,o=a.length;s<o;s++,i++)n[i]=a[s];return n},s=Bt&&Bt.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};e.__esModule=!0;var o=s(Vt),u=s(Kt),l=i(Wt),c=i(Ht),d=function(){function t(e,r){var n=this;void 0===r&&(r={});var i=this;if(this.emitter=e,this.url=r.url,this.log=qt.Log.of(this.emitter),this.verb=r.verb,this.metadata=c.merge({},r.metadata||{}),this.rq=r.rq||o.default,this.events=r.events||[],this.required_keys=r.required_keys||[],this.optional_keys=r.optional_keys||[],this.listeners=[],this.valid_keys=this.required_keys.slice(0).concat(this.optional_keys),t.assert_emitter_api(this.emitter),void 0===t.verb[this.verb])throw new Error("invalid HTTP verb["+this.verb+"] passed");if("string"!=typeof this.url)throw new Error("invalid API url["+this.url+"] passed");t.TRACKERS.push(this),i.events.forEach((function(e){t.create_listener(n,e,(function(r){void 0===r&&(r={});var a=c.merge(i.metadata,{event_type:e},r.data||r),s=l.prepare_url(i,a),o=t.pluck_valid_keys(i,a),d=t.ensure_required_keys(i,o);if(d.length)return i.log.error("Tracker.validate_metadata() failed for \n Event["+e+"]\n missing keys: "+d+"\n payload:\n "+JSON.stringify(o,null,2));u.default.rpush(n.rq,[s,n.verb,o])}))}))}return t.of=function(e,r){return new t(e,r)},t.ensure_required_keys=function(t,e){return t.required_keys.filter((function(t){return!(t in e)}))},t.pluck_valid_keys=function(t,e){return c.pluck.apply(c,a([e],t.valid_keys))},t.merge_metadata=function(e,r){return void 0===r&&(r={}),e.metadata=t.pluck_valid_keys(e,c.merge(e.metadata,r)),e},t.assert_emitter_api=function(t){if("function"!=typeof(t||{}).addEventListener)throw new Error("Tracker() received an emitter that does not implement the addEventListener method");if("function"!=typeof(t||{}).removeEventListener)throw new Error("Tracker() received an emitter that does not implement the removeEventListener method")},t.create_listener=function(t,e,r){t.listeners.push([e,r]),t.emitter.addEventListener(e,r)},t.prototype.destroy=function(){var e=this;this.listeners.forEach((function(t){var r=t[0],n=t[1];return e.emitter.removeEventListener(r,n)})),delete this.rq,delete this.emitter,c.remove(t.TRACKERS,this)},t.prototype.put=function(e){return void 0===e&&(e={}),t.merge_metadata(this,e),this},t.TRACKERS=[],t.QUEUE=o.default,t.verb=Yt.Verb,t}();e.default=d})),Xt=Gt((function(t,e){var r=Bt&&Bt.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),n=Bt&&Bt.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),i=Bt&&Bt.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var i in t)"default"!==i&&Object.hasOwnProperty.call(t,i)&&r(e,t,i);return n(e,t),e},a=Bt&&Bt.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};e.__esModule=!0,e.API=e.Tracker=void 0;var s=a(zt);e.Tracker=s.default;var o=i(Wt);e.API=o})),Qt="ping",Jt="display",Zt="view";const $t=["sitegroup_id","session_id","media_id","site_id","player_id","video_type"],te=["created","position"],ee=["player_version","created","source","category","category_id","autoplay","muted","customer_user_id"];function re(t,e){return t.duration/1===t.duration&&Object.assign(e,function(t){const e=t/100;return{segment_duration:e,breakpoints:Array(...Array(100)).map((function(t,r){return Math.floor(r*e*1e3)/1e3}))}}(t.duration))}function ne(t,e,r){if(!e.segment_duration&&!re(t,e))return;const n=function(t,e,r){const n=e.last_idx,i=r?99:ie(t,e);return e.last_idx=i,i<=n?[]:e.breakpoints.slice(n,99==i?100:i).map((function(t){return e.breakpoints.indexOf(t)}))}(t,e,r);0!=n.length&&t.emit(Qt,{position:n})}function ie(t,e){return Math.min(Math.floor(t.currentTime/e.segment_duration),99)}const ae="vod",se="live",oe=[Jt,Qt,Zt];function ue(t,e,r){switch(null==e?void 0:e.kind){case"live":return function(t,e){const r=Date.now();r-e.last_tracked_ts<6e4||(e.last_tracked_ts=r,++e.ticks,t.emit(Qt,{position:60*e.ticks}))}(t,e);case"vod":return ne(t,e,"boolean"==typeof r&&r)}}function le(t){const e=t.ads;return void 0!==e&&(void 0!==e.schedule&&("function"==typeof e.hasPreroll&&(e.currentRequests?e.currentRequests:!!e.adPlaying||!(!e.hasPreroll()||0!=e.nextIndex))))}function ce(){try{return window.location!==window.parent.location?document.referrer:document.location.href}catch(t){return!1}}class de{init(t,e,r){if(!wt.from_token(t.token||"").is_granted(wt.permissions.ANALYTICS))return;if(r.analytics)return;const n=r.analytics={ticker:void 0,last_media_id:"",ended:!1},i={locked:!1,ttl:6e3,task:()=>{ue(r,n.ticker)}};const a={session_id:r.deviceId(),autoplay:r.autoplay,muted:r.muted,player_id:t.player_id,customer_user_id:t.customer_user_id},s=Xt.Tracker.of(r,{verb:Xt.Tracker.verb.POST,url:"https://ptm.flowplayer.com/:video_type/:sitegroup_id/:event_type",events:oe,required_keys:$t,optional_keys:ee.concat(te).slice(0),metadata:a});r.on(v,(function(){s&&s.destroy()})),r.on(g,(function(e){if(!s)return;const i=tt(e,"data.metadata",{});if(!i.media_id)return;const a=tt(s,"metadata.media_id");if(a&&i.media_id==a)return;const o=tt(t,"analytics",{});s.put(i),s.put(o);const u=tt(t,"metadata.live_start_time",t.live)?se:ae;s.put({video_type:u,source:t.source||ce()||""}),n.ticker=t.live?{ticks:0,last_tracked_ts:Date.now(),kind:"live"}:{last_idx:0,segment_duration:0,breakpoints:[],kind:"vod"},n.ended=!1,r.emit(Jt)}));let o=0;r.on(h,(function(){if(!s)return;if(o||function(t,e){return t.metadata.media_id&&t.metadata.media_id==e.last_media_id}(s,n))return;s.put({muted:r.muted});const t=le(r);if(t)return o=Promise.resolve(t).then((function(){n.last_media_id=s.metadata.media_id,r.emit(Zt),o=0})).catch((function(){o=0}));n.last_media_id=s.metadata.media_id,r.emit(Zt)})),r.on("timeupdate",(function(){var e;s&&(o||le(r)||n.ended||(!t.live&&r.currentTime+.25>=r.duration&&ue(r,n.ticker,!0),(e=i).locked||(e.locked=setTimeout((function(){return e.task(),function(t){return t.locked=!1,t}(e)}),e.ttl))))})),r.on(p,(function(){s&&n.ticker&&"vod"==n.ticker.kind&&function(t,e){re(t,e),e.last_idx=ie(t,e)}(r,n.ticker)})),r.on("ended",(function(){s&&function(t,e){e.ended||(e.ended=!0,ue(t,e.ticker))}(r,n)}))}}function fe(t,e,r){!function(t,e,r){"undefined"!=typeof window&&"ontouchstart"in window&&r.setState("is-touch-device",!0);let n=!1;r.setState("is-accessibility",!1);const i=e.querySelector(".fp-middle");i&&i.addEventListener(l,(function(t){0!=t.cancelable&&(t.preventDefault(),r.emit(t.type,{source:t}))})),r.on(l,(function(t){setTimeout((function(){if(t.defaultPrevented)return;if(r.hasState(k))return;if(r.ended)return r.togglePlay(!0);const e=r.hasState(S);n&&clearTimeout(n),(e||r.hasState(w)||r.hasState("no-autoplay"))&&(r.hasState(w)&&(r.setState(w,!1),r.setState("is-hovered",!1)),r.togglePlay(),e)||(r.setState(w,!0),r.paused||(n=setTimeout((function(){n=!1,r.setState(w,!1),r.setState("is-hovered",!1)}),2e3)))}),0)}))}(0,e,r)}function he(t,e,r){let n=()=>document.fullscreenElement,i="fullscreenchange";if(!Element.prototype.requestFullscreen){const t=Element.prototype,e=document;t.webkitRequestFullScreen&&(t.requestFullscreen=t.webkitRequestFullScreen,e.fullscreenEnabled=!0),e.webkitCancelFullScreen&&(document.exitFullscreen=e.webkitCancelFullScreen),i="webkit"+i,n=()=>e.webkitCurrentFullScreenElement}r.toggleFullScreen=function(t,n){r.ios_fullscreen_disabled||("boolean"!=typeof t&&(t=!r.in_fullscreen),pe(r)&&(t?function(t){t.getAttribute("playsinline")&&t.removeAttribute("playsinline");t.getAttribute("webkit-playsinline")&&t.removeAttribute("webkit-playsinline");t.webkitEnterFullScreen()}(r):function(t,e){t.getAttribute("playsinline")||t.setAttribute("playsinline","");t.getAttribute("webkit-playsinline")||t.setAttribute("webkit-playsinline","");e||t.webkitExitFullScreen();t.togglePlay(!1),t.hasState(w)||t.setState(w,!0)}(r,n)),document.fullscreenEnabled&&(t?e.requestFullscreen():document.exitFullscreen()))},pe(r)&&(r.ios_fullscreen_disabled=!0,r.once("beforeplay",(function(){r.ios_fullscreen_disabled=!1})),r.on("webkitendfullscreen",(function(){r.toggleFullScreen(!1,!0)}))),e.addEventListener(i,(function(){const t=n(),i=t===e||t==r;r.in_fullscreen=i,r.emit(i?"fullscreenenter":"fullscreenexit"),r.setState("is-fullscreen",i),r.emit(c)})),!1!==t.doubleclick&&e.addEventListener(a,(function(t){var e;t.target&&(null===(e=t.target)||void 0===e?void 0:e.classList.contains("fp-ui"))&&r.toggleFullScreen()}))}function pe(t){return r().ios&&"function"==typeof t.webkitEnterFullScreen&&"function"==typeof t.webkitExitFullScreen}Et(Tt(),de),"undefined"!=typeof window&&window.matchMedia&&[m,y].forEach((function(t){window.matchMedia("(orientation: "+t+")").addListener((function(r){e.length&&e.forEach((function(e){r.matches&&e.emit(t)}))}))}));const ve={name:"fp-fullscreen",translation_key:"core.fullscreen"},ge={name:"fp-fullscreen-exit",translation_key:"core.exit_fullscreen"},me={name:"fp-play",translation_key:"core.play"},ye={name:"fp-pause",translation_key:"core.pause"},Ee={translation_key:"core.mute",name:"fp-volume-mute-unmute"},Te={translation_key:"core.play",name:"fp-small-play"},_e={translation_key:"core.pause",name:"fp-small-pause"},be={name:"fp-fast-forward"};function Se(t){const e=document.createElement("div");return e.classList.add("fp-icon",t.name),t.title&&e.setAttribute("title",t.title),t.title&&e.setAttribute("aria-label",t.title),e.setAttribute("tabindex","0"),e.setAttribute("focusable","true"),e}function Ae(t,e,r){const n=$("fp-header"),a=$("fp-primary"),s=$("fp-duration"),o=function(t,e){const r=$();r.classList.add("fp-secondary","fp-togglable"),he(t,e.root,e);const n=Se(ve);n.setAttribute("role","button"),n.setAttribute("aria-label",e.i18n("core.fullscreen"));const a=Se(ge);return a.setAttribute("role","button"),a.setAttribute("aria-label",e.i18n("core.fullscreen_exit")),n.addEventListener(i,()=>e.toggleFullScreen()),a.addEventListener(i,()=>e.toggleFullScreen()),r.append(n,a),r}(t,r),u={logo:""};r.on(g,(function(t){var e,r,n,i,o;i=s,o=(null===(e=null==t?void 0:t.data)||void 0===e?void 0:e.duration)||NaN,i.innerText=isFinite(o)?rt(o):"";const l=u.logo,c=(null===(r=null==t?void 0:t.data)||void 0===r?void 0:r.logo)||"";l!=c&&(u.logo=c,function(t,e,r){if(t.innerHTML="",!e)return;const n=document.createElement("img");if(n.classList.add("fp-logo"),n.src=e,!r)return t.append(n);const i=document.createElement("a");i.href=r,i.append(n),t.append(i)}(a,c,null===(n=null==t?void 0:t.data)||void 0===n?void 0:n.logo_href))})),n.append(a,s,o),e.append(n),r.reaper&&(r.reaper.set("header",n),r.reaper.set("header.secondary",o))}var Le=Object.freeze({__proto__:null,NO_FULLSCREEN:1,NO_VOLUME_CONTROL:2,NO_MUTE:4,LOGO_ON_RIGHT:8,USE_DRAG_HANDLE:16,USE_PLAY_2:32,USE_PLAY_3:64,USE_THIN_CONTROLBAR:128,NO_TITLE:256,NO_DESCRIPTION:512,NO_CONTROLS:1024,NO_DURATION:2048,NO_HEADER:4096,AUDIO_ONLY:8192,NO_TOUCH_ZONES:16384});function ke(t,e,r){if(!r.reaper)return;const n=$("fp-middle"),s=$("fp-left-zone"),o=$("fp-middle-zone"),u=$("fp-right-zone"),c=[s,o,u];!function(t,e){const r=e[0],n=e[1];t.on(p,(function(){e.forEach(De)})),t.on("seek:queued",(function(t){const i=t.data;if(!i)return;if("number"!=typeof i.offset)return;const a=i.offset;if(0==a)return e.forEach(De);const s=a>0?n:r;return De(s==n?r:n),function(t,e){const r=t.querySelector(".fp-zone-seconds");r&&(r.innerText=Math.abs(e)+"")}(s,a)})),t.on("seek:cancel",(function(){e.forEach(De)})),e.forEach((function(e){const n=e==r?-1:1,i=document.createElement("span"),a=we(be);i.classList.add("fp-zone-seconds"),e.append(i,a),De(e),e.addEventListener(l,(function(e){isNaN(t.duration)||isNaN(t.currentTime)||16384&t.opt("ui")||t.hasState("no-timeline")||!t.hasState("will-seek")&&!t.hasState(w)||t.enqueueSeek(5*n)&&(e.stopPropagation(),e.preventDefault())}))}))}(r,[s,u]),c.forEach((function(t){n.append(t)})),r.reaper.set("middle",n),function(t,e){[i,a].forEach(r=>t.addEventListener(r,(function(t){if(!t.defaultPrevented)return t.preventDefault(),e.emit(t.type),!1}))),e.on(i,(function(t){setTimeout((function(){t.defaultPrevented||e.hasState(k)||e.togglePlay()}),0)})),e.on(a,(function(t){setTimeout((function(){t.defaultPrevented||e.toggleFullScreen()}),0)}))}(n,r),function(t){const e=$("fp-wait");Array(...Array(4)).map((t,e)=>e).forEach(()=>{e.append(document.createElement("b"))}),t.append(e)}(o);const d=$("fp-switch");return d.append(...[me,ye].map(we)),o.append(d),e.append(n),n.setAttribute("tabindex","0"),n.setAttribute("role","button"),n.setAttribute("aria-label",r.i18n("core.play")),[h,p].forEach(t=>r.once(t,(function(){n.removeAttribute("tabindex"),n.removeAttribute("role"),n.removeAttribute("aria-label")}))),n}function we(t){const e=Se(t);return e.removeAttribute("tabindex"),e}function De(t){const e=t.querySelector(".fp-zone-seconds");e&&(e.innerText="")}function Re(){}document.addEventListener(i,(function(t){this.active_menu&&!this.active_menu.contains(t.target)&&(Array.from(document.querySelectorAll(".fp-engine")).forEach(t=>{const e=t.root.querySelector("details[open].fp-menu-container");e&&(e.open=!1,t.root.classList.toggle("has-menu-opened",!1))}),this.active_menu=void 0)}));const Oe={passive:!0};var Ce;function Ie(t,e){let r=0,n=-1,i=-1;const a=Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5),s=t.classList;t.id=a,s.remove(Ce.GRABBING),s.remove(Ce.TOUCHING);const o=e.onseek||Re,u=e.onstart||Re,c=e.onend||Re,d=e.onmouse||Re,f=e.ontouch||Re,h=e.ontouchend||Re;function p(e){!function(){const e=t.getBoundingClientRect();r=e.left,n=e.width}();let i=(function(t){return"function"==typeof window.TouchEvent&&t instanceof TouchEvent}(e)?e.changedTouches[0].pageX:e.pageX)-r;return i>n&&(i=n),i<0&&(i=0),i/n*100}function v(e){const r=p(e);r!=i&&(o(t,r),i=r)}return t.addEventListener("touchstart",(function(e){xe(t,e)&&(s.add(Ce.TOUCHING),Pe(t.parentElement)&&(e.preventDefault(),s.add(Ce.GRABBING),f(t,p(e)),u(t,p(e)),v(e)))}),Oe),t.addEventListener("touchmove",(function(e){e.preventDefault(),v(e),d(t,p(e))}),Oe),t.addEventListener(l,(function(e){setTimeout((function(){s.remove(Ce.TOUCHING)}),500),xe(t,e)&&(e.preventDefault(),s.remove(Ce.GRABBING),h(t,p(e)),c(t,p(e)),n=0)}),Oe),t.addEventListener("touchcancel",(function(){s.remove(Ce.GRABBING,Ce.TOUCHING),n=0}),Oe),t.addEventListener("mousedown",(function(e){s.contains(Ce.TOUCHING)||(document.addEventListener("mousemove",v),s.add(Ce.GRABBING),u(t,p(e)),e.preventDefault(),v(e))})),t.addEventListener("mousemove",(function(e){s.contains(Ce.TOUCHING)||d(t,p(e))})),document.addEventListener("mouseup",(function(e){s.contains(Ce.TOUCHING)||(document.removeEventListener("mousemove",v),s.contains(Ce.GRABBING)&&(s.remove(Ce.GRABBING),c(t,p(e)),n=0))})),t}function xe(t,e){const r=e.target;return!!r&&(r&&!r.closest(t.id)||!Pe(t.parentElement)||!t.classList.contains(Ce.TOUCHING))}function Pe(t){if(!t)return!1;const e=window.getComputedStyle(t);return"0"!==e.width&&"0"!==e.height&&"0"!==e.opacity&&"none"!==e.display&&"hidden"!==e.visibility}!function(t){t.GRABBING="has-grab",t.TOUCHING="has-touch"}(Ce||(Ce={}));function Me(t){if("object"!=typeof t.opts)return{head:0,tail:0};if(0==t.seekable.length)return{head:0,tail:0};const e=t.opt("live_dvr_window",0),r=t.seekable.end(t.seekable.length-1);return{head:r,tail:Math.max(t.seekable.start(0),r-e)}}function Fe(t){return t.opt("live",!1)||t.duration>=Number.MAX_SAFE_INTEGER}function Ne(t){return isFinite(t.duration)?t.duration:0==t.seekable.length?0:t.seekable.end(0)}function Ue(t){return function(t){return Me(t).head}(t)-.5}function Be(t,e){if(!t.parentElement)return;const r=t.clientWidth/t.parentElement.clientWidth*100/2;t.style.left=e-r+"%",t.style.display="block"}function je(t,e){if(isNaN(t.duration))return;const r=t.buffered;r.length&&(e.style.width=Math.min(r.end(r.length-1)/t.duration*100,100)+"%")}function Ge(t,e){t.style.width="0",e.style.width="0",e.style.display="none"}function He(t,e,r){if(e.seeking||!e.seekable||0==e.seekable.length)return;const n=Ke(e,t/100);Be(r,t);const i=isFinite(e.duration)?n:e.seekable.start(0)+n;r.innerText=rt(i)}function Ke(t,e){if(e>1||e<0)return console.warn("cannot calculate a percent outside of range(0..1)"),0;if(isFinite(t.duration))return Ne(t)*e;const r=t.seekable.start(0);return r+e*(t.seekable.end(0)-r)}function Ve(t,e){t.style.width="0",e.style.display="none"}const We=requestAnimationFrame;function qe(t,e,r){const n=$("fp-controls","fp-togglable"),a=$("fp-timeline","fp-bar"),s=$("fp-btns","fp-small-switch"),o=$("fp-live-status"),l=$("fp-live-indicator","fp-color"),c=$("fp-live-text"),f=$("fp-buffer"),p=$("fp-progress","fp-color"),v=$("fp-hover"),m=$("fp-timestamp"),y=$("fp-duration"),E=$("fp-dragger","fp-color"),T=document.createElement("span");c.innerHTML="live",m.style.display="none",T.classList.add("fp-elapsed"),T.innerText=rt(0),a.setAttribute("role","slider"),a.setAttribute("tabindex","0"),a.setAttribute("aria-label",r.i18n("timeline","Timeline")),a.append(f,p,v,m),n.append(s,o,T,a,y),o.append(l,c);const _=Se(_e);_.setAttribute("role","button");const b=Se(Te);b.setAttribute("role","button"),_.addEventListener("click",(function(){r.togglePlay(),setTimeout((function(){b.focus&&b.focus()}),100)})),b.addEventListener("click",(function(){r.togglePlay(),setTimeout((function(){_.focus&&_.focus()}),100)})),s.append(_,b),p.append(E),o.addEventListener(i,(function(){!function(t,e){try{if(!t.hasState("is-live-seeked"))return;t.dvr_offset=0;const r=Ue(t);t.currentTime=r,t.setState("is-live-seeked",!1),e.style.width="0"}catch(t){console.warn("failed to seek to now: %j",t)}}(r,p)})),r.on(g,(function(e){if(0==r.reaper)return;if(!e.data)return;t.seekable=void 0===e.data.seekable||e.data.seekable;const n=Fe(r)?NaN:e.data.duration||0;if(isNaN(n)||n>=Number.MAX_SAFE_INTEGER)return y.style.display="none";y.style.display="inline-block",y.innerText=rt(n)}));let S=performance.now();const L=()=>{if(0==r.reaper||t.live)return;const e=performance.now();var n;e-S>1e3/30&&(n=r,p.style.width=n.currentTime/n.duration*100+"%",S=e),r.paused||a.classList.contains(Ce.GRABBING)||We(L)};r.on(h,()=>We(L)),r.on("timeupdate",(function(){var e;0!=r.reaper&&(We(L),a.setAttribute("aria-valuenow",r.currentTime+""),t.live?function(t,e){e.innerText=rt(t.currentTime)}(r,T):(e=r,T.innerText=rt(e.currentTime)),t.live||je(r,f),t.live&&function(t){return!("dvr"in t)||1==t.dvr}(t)&&function(t,e){if(0==e)return!0;const r=Me(t);return r.head-r.tail>=e}(r,t.seconds_to_dvr||0)&&r.setOpts({dvr:r.seekable.length>0}))})),r.on("progress",(function(){0!=r.reaper&&(t.live||je(r,f))})),r.on("live",(function(){r.setState("is-live-seeked",!1),p.style.width="0%"})),r.on("dvr",(function(){const t=Ne(r),e=r.seekable.end(0)-r.seekable.start(0),n=(t-r.currentTime)/e*100,i=Math.round(n);r.setState("is-live-seeked",i>0),p.style.width=i+"%"})),r.on("seeking",(function(){if(!Fe(r))return;if(0==r.seekable.length||0==r.played.length)return;if(0==Ne(r))return;const t=Ue(r),e=r.currentTime>=t?"live":"dvr";r.emit(e)})),r.on(d,(function(){var e,n;0!=r.reaper&&(r.setOpts({live:Fe(r)}),t.live||(n=y,(e=r).duration&&(n.innerText=rt(e.duration)),je(r,f)))})),r.on("durationchange",(function(t){if(0==r.reaper)return;const e=Fe(r),n=e?Ne(r):t.data||r.duration;isNaN(n)||(r.setOpts({live:e,duration:n}),a.setAttribute("aria-valuemax",n+""),a.setAttribute("aria-valuemin","0"))}));let k=!1;return Ie(a,{onseek:function(e,n){if(Ye(r))switch(!!t.live){case!0:He(n,r,m);break;case!1:!function(t,e,r){const n=e.duration*(t/100);if(e.disabled&&n>e.currentTime)return!1;r.style.width=t+"%",e.currentTime=n}(n,r,p),Be(m,n)}},onstart:function(){Ye(r)&&(r.emit("timeline/gesture/start"),r.setState(A,!0),t.live||function(t){!function(t){t.style.display="block"}(t)}(m))},onend:function(e,n){We(L),0!=t.seekable&&(r.setState(A,!1),t.live&&function(t,e){t/=100,e.currentTime=Ke(e,t)}(n,r))},ontouch:function(){r.paused||(k=!0,r.pause())},ontouchend:function(){k&&(k=!1,r.play()),t.live?Ve(v,m):Ge(v,m)},onmouse:function(e,n){if(Ye(r)&&!a.classList.contains(Ce.GRABBING))switch(r.emit("timeline/gesture/move",{percent:n}),!!t.live){case!0:!function(t,e){e.style.width=function(t){return 100-t}(t)+"%"}(n,v),He(n,r,m);break;case!1:!function(t,e){e.style.width=t+"%"}(n,v),function(t,e,r){if(isNaN(t)||isNaN(e.duration))return;Be(r,t),r.innerHTML="";const n=document.createElement("span");n.innerText=rt(t/100*e.duration),r.append(n)}(n,r,m)}}}),a.addEventListener(u,(function(){r.emit("timeline/gesture/end"),t.live?Ve(v,m):Ge(v,m)})),n}function Ye(t){return 0!=t.opt("opts.seekable",!0)&&!isNaN(t.duration)}function ze(t){try{return localStorage.getItem(t)}catch(t){return null}}function Xe(t,e){try{localStorage.setItem(t,e)}catch(t){}}function Qe(t,e,n){const a=document.createElement("div");a.className="fp-volumebtn",a.append(Se(Ee)),n.append(a),a.addEventListener(i,(function(){e.toggleMute()}));const s=!r().ios&&function(t){const e=function(t,e){const r=document.createElement("div");r.className="fp-volume";const n=t.classList;let i=10;n.contains("is-small")&&(i=8);n.contains("is-tiny")&&(i=6);const a=Array.from({length:i}).map(()=>{const t=document.createElement("i");return t.className="fp-tick",t});return r.append(...a),Ie(r,{onseek:e})}(t.root,(r,n)=>{n>0&&(t.muted=!1,function(t){try{localStorage.removeItem(t)}catch(t){}}("mute")),Xe("volume",(t.volume=n/100).toString()),Je(e,t.volume)});return e.setAttribute("tabindex","0"),e.setAttribute("role","slider"),e.setAttribute("aria-valuemin","0"),e.setAttribute("aria-valuemax","1"),e.setAttribute("aria-label",t.i18n("core.volume","volume")),e}(e);s&&n.append(s),e.on("volumechange",(function(){const t=0==e.volume||e.muted;e.setState("is-muted",t),Xe("mute",t.toString()),a.setAttribute("aria-label",t?e.i18n("unmute","unmute"):e.i18n("mute","mute")),s&&(t&&Je(s,0),s.classList.contains(Ce.GRABBING)||Je(s,e.volume))})),"true"==ze("mute")&&(e.muted=!0,e.setState("is-muted",e.muted));const o=ze("volume");o&&!isNaN(Number(o))&&(e.volume=Number(o)),e.emit("volumechange")}function Je(t,e){t.setAttribute("aria-valuenow",e.toString());const r=Array.from(t.querySelectorAll(".fp-tick")),n=Math.round(e*r.length);r.forEach((t,e)=>{t.classList.toggle("fp-color",e<n)})}function Ze(){return"https:"===location.protocol}function $e(t){const e=document.createElement("a");return e.href=t,e}const tr={"-1":"an unknown error occurred",1:"media playback was aborted",2:"a network error occurred",3:"unable to decode media content",4:"unsupported media type",1001:"cannot load insecure content in a secure context",1002:"no internet connection detected"};function er(){return!0===(navigator||{}).onLine}function rr(t,e,r){r.on(n,(function(t){const e=t.data||r.error||new Error,n=t.code||e.code,i="Error: %s\n"+(null===(a=(new Error).stack)||void 0===a?void 0:a.split("\n").slice(2).join("\n"));var a;setTimeout((function(){if(t.defaultPrevented)return;if("AbortError"==e.name)return;r.setState("is-error",!0),8===n||e.fatal||function(t){const e=t.togglePlay,r=t.root;t.togglePlay=Re,t.once("recover",(function(){t.togglePlay=e,t.setState("is-error",!1);const n=r.querySelector(".fp-error");n&&n.remove()}))}(r);const a=function(t,e,r){switch(e){case"http:0":return function(t){return function(t){try{return Ze()&&"http:"==$e(t).protocol}catch(t){return!1}}(t.original_src)?{code:1001}:er()?{code:2}:er()?{code:-1}:{code:1002}}(t);case 4:return t.once("loadstart",(function(){t.emit("recover")})),r;default:return r}}(r,n,e),s=function(t,e){if(e.message)return e.message;if(e.stack)return e.stack;const r=(e.code||-1).toString();return t.i18n("media_errors."+r,tr[r]||tr[-1])}(r,a);console.error(i,s);const o=r.reaper&&r.reaper.get("ui");return o&&function(t,e,r,n){if(!t)return;const i=document.createElement("div");if(i.classList.add("fp-error"),i.innerText=e,n){const e=t.querySelector("#"+n);e&&t.removeChild(e),i.id=n}if(t.append(i),r){const t=document.createElement("div");t.classList.add("fp-error-details"),t.innerText=r,i.append(t)}}(o,s,e.details)}))}))}function nr(t,e,r){if(!r.reaper)return;const n=document.createDocumentFragment(),i=$("fp-ui");n.appendChild(i),r.reaper.set("ui",i),~e.className.indexOf("use-play-")||e.classList.add("use-play-1"),function(t,e,r){const n=$("fp-footer");e.append(n),r.on(g,(function(t){var e,r;const i=null===(e=t.data)||void 0===e?void 0:e.description,a=null===(r=t.data)||void 0===r?void 0:r.title;if(n.innerHTML="","string"==typeof a){const t=$("fp-title");t.innerText=a,n.append(t)}if("string"==typeof i){const t=i.split(" "),e=$("fp-desc");for(e.innerText=t.join(" "),n.append(e);t.length>1&&e.scrollHeight>e.offsetHeight;)t.pop(),e.innerText=t.join(" ")+"..."}}))}(0,e,r),Ae(t,i,r),ke(0,i,r);const a=qe(t,0,r);i.append(a),Qe(0,r,a),rr(0,0,r),e.appendChild(n),[o,u].forEach(t=>{e.addEventListener(t,(function(t){r.setState("is-hovered",t.type==o),r.setState("is-accessibility",!1)}))}),r.on(g,(function(t){var r;const n=null===(r=t.data)||void 0===r?void 0:r.ui;if("number"!=typeof n)return;const i=e.classList;i.toggle("use-play-1",!(32&n||64&n)),i.toggle("use-play-2",(32&n)>0),i.toggle("use-play-3",(64&n)>0),i.toggle("use-thin-controlbar",(128&n)>0),i.toggle("no-title",(256&n)>0),i.toggle("no-description",(512&n)>0),i.toggle("logo-on-right",(8&n)>0),i.toggle("use-drag-handle",(16&n)>0),i.toggle("no-controls",(1024&n)>0),i.toggle("no-duration",(2048&n)>0),i.toggle("no-header",(4096&n)>0),i.toggle("no-mute",(4&n)>0),i.toggle("no-volume",(2&n)>0),i.toggle("no-fullscreen",(1&n)>0),i.toggle("no-touch-zones",(16384&n)>0)}));let s=null;i.addEventListener("mousemove",(function(){"number"==typeof s&&clearTimeout(s),r.setState("is-hovered",!0),s=0==r.paused&&setTimeout((function(){r.setState("is-hovered",!1)}),2e3)}))}function ir(t,e,r){if(wt.from_token(t.token||"").is_granted(wt.permissions.NO_METERING))return;const n=At.id(t.token||"");n&&r.once(h,()=>function(t,e){fetch("https://pmi.flowplayer.com/in",{method:"POST",body:JSON.stringify({token_id:e,factor:1,rnd:Math.random().toString(36).substring(2)})}).then(e=>{401==e.status&&t.emit("error:fatal",{reason:"token",details:"The token online validation failed"})})}(r,n))}var ar={ads:{ad:"Ad",ads:"Ads",advertisement:"Advertisement"},audio:{button_txt:"Audio",menu_title:"Audio"},core:{exit_fullscreen:"Exit fullscreen",fullscreen:"Fullscreen",mute:"Mute",pause:"Pause",play:"Play",unmute:"Unmute",volume:"Volume"},ovp:{starting_in:"Countdown"},playlist:{cancel:"Cancel",up_next:"Up next"},qsel:{menu_title:"Quality"},share:{clipboard_failure:"Access to clipboard failed",clipboard_success:"The text is now on your clipboard",embed:"Embed",link:"Link",menu_title:"Share"},speed:{menu_title:"Speed"}};class sr{init(t,e,r){r.reaper&&r.reaper.set("translations",it(sr,t,"en"))}}sr.en=ar;const or=Date.now(),ur={session_id:Math.random().toString(36).substring(2)+performance.now().toString(36)};class lr{constructor(){this._summary={},this._session_id=ur,this.start_time=or}increment(t,e){if("string"!=typeof t||"number"!=typeof e)return;const r=this._summary[t]||0;this._summary[t]=r+e}set(t,e){"string"==typeof t&&(this._summary[t]=e)}duration(){return Date.now()-this.start_time}summary(t){return Object.assign("object"==typeof t?t:{},{event:"health_summary"},this._summary,this._session_id,{duration:this.duration()})}sessionize(t){return Object.assign(t,this._session_id)}}function cr(t,e){return function(t,e){return"function"==typeof navigator.sendBeacon&&navigator.sendBeacon(t,e)}(t,JSON.stringify({events:e}))}class dr{constructor(t){this.middleware=t,this._pending=[]}pending(){return this._pending}_run_middleware(t,e){return t=Object.assign({},t),this.middleware.forEach((function(r){const n=r(e);if("object"==typeof n)return Object.assign(t,n);console.warn("KPI::middleware did not return an Object\nreturn: %o\n\nfn: %s",n,r)})),t}push(t,e){t=this._run_middleware(t,e),this.push_finalized(t)}push_finalized(t){this._pending.push(t),this.send()}send(t){if(this._pending.length<20&&!t)return;const e=this._pending.slice(0);this._pending.length=0,cr("https://health.flowplayer.com/v1/health/events",e)}}function fr(){return tt(window,"navigator.connection.downlink")}function hr(t){const e=t.hls;if(!e)return;const r=e.abrController._bwEstimator;return r?.001*r.getEstimate():void 0}function pr(t){const e=[hr,fr];for(;e.length;){const r=e.shift(),n="function"==typeof r&&r(t);if("number"==typeof n)return{downlink_mbs:Number(n.toFixed(2))}}return{}}const vr=document.createElement("a");function gr(t){const e=t.original_src;return"string"!=typeof e?{}:(vr.href=e,"string"==typeof vr.pathname?{media_type:vr.pathname.split(".").pop()}:{})}function mr(t){return{preload:t.opt("preload"),autoplay:t.opt("autoplay",t.autoplay)}}function yr(t){return{player_id:t.opt("metadata.player_id"),media_id:t.opt("metadata.media_id"),site_id:t.opt("metadata.site_id"),category_id:t.opt("metadata.category_id"),sitegroup_id:t.opt("metadata.sitegroup_id"),token:t.token}}function Er(){return{timestamp:Date.now()}}function Tr(){return{ua:navigator.userAgent,version:"3.0.0-rc6",commit:"3ff5575be008bca83fb98f88bd7b5012f71fbe28"}}const _r=[n,"rebuffer"],br=_r.concat([s,"loadstart",d,f,"error:fatal",h,p,"quality:set","pause","ended","seeking"]);function Sr(t,e,r){t.push_finalized(Object.assign(e.summary({}),mr(r),yr(r),Er(),Tr())),t.send(!0)}function Ar(t){try{return!!new URL(t)}catch(t){return!1}}pt(window,"flowplayer:umd",(function(t){const e=t.data;e&&window.addEventListener("unload",(function(){e.instances.forEach(t=>t.emit("unload"))}))}));class Lr{init(t,e,r){if(r._health)return;const n=r._health=new lr,i=r._kpis=new dr([gr,mr,yr,pr,Er,Tr]);_r.forEach(t=>{n.set(t,0)}),function(t){t.on("waiting",(function(e){t.seeking||t.networkState===t.NETWORK_LOADING&&t.readyState!==t.HAVE_NOTHING&&t.emit("rebuffer")}))}(r),r.on(v,(function(){i.send(),r._kpis=r._health=void 0})),r.on("health:summary:increment",(function(t){t.data&&Object.keys(t.data).forEach((function(e){t.data&&n.increment(e,t.data[e])}))})),r.on("health:summary:set",(function(t){t.data&&Object.keys(t.data).forEach((function(e){t.data&&n.set(e,t.data[e])}))})),r.on(_r,(function(t){setTimeout(()=>{t.defaultPrevented||r.emit("health:summary:increment",{[t.type]:1})})})),r.on(br,(function(t){setTimeout(()=>{t.defaultPrevented||r.emit("health:kpi:track",{event:t.type})},0)})),r.on("health:kpi:track",(function(t){if(!t.data)return;const e=n.sessionize(t.data);i.push(e,r)})),r.on("src",(function(t){const e=t.data&&t.data.src;"string"==typeof e&&Ar(r.original_src)&&Ar(e)&&e!=r.original_src&&Sr(i,n,r)})),r.on("unload",(function(){Sr(i,n,r)}))}}Et(window,Lr);Ut.extensions.unshift.apply(Ut.extensions,[sr,de,Lr,class{init(t,e,r){ir(t,0,r),nr(t,e,r),fe(0,e,r)}}]);var kr=Object.assign(Ut,{ui:Le,i18n:sr}),wr=jt(Gt((function(t,e){var r;"undefined"!=typeof window&&(r=function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="/dist/",r(r.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":
15
+ ***************************************************************************** */function j(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]])}return r}function G(t){const e=document.createElement("a");e.href=t;const r=e.pathname&&e.pathname.split(".");return r.length>1&&r[r.length-1]}function H(t){switch(t){case"video/mpd":return"application/dash+xml";case"video/m3u8":return"application/x-mpegurl";default:return t}}const K=t=>{var{src:e}=t,r=j(t,["src"]);return[Object.assign({src:e,type:e?H("video/"+G(e)):""},r)]};function V(t){return K({src:t})}function W(t){var{src:e,type:r}=t,n=j(t,["src","type"]);return e&&r?[Object.assign({src:e,type:r},n)]:r&&!e?[Object.assign({type:r},n)]:K(Object.assign({src:e},n))}var q;function Y(t,e,r,n={safari:!1}){const i=function(t){return"string"==typeof t?V(t):Array.isArray(t)||"object"!=typeof t?t.reduce((function(t,e){return"string"==typeof e&&(e=V(e)),"object"!=typeof e||Array.isArray(e)||(e=W(e)),t.concat(e)}),[]):W(t)}(r);return t.currentSrc&&(t.innerHTML=""),Array(...Array(i.length)).map((t,e)=>e).some(r=>{const a=i[r];if(q.Ok==function(t,e,r){t.emit("src",r),"string"==typeof r.src&&(t.original_src=r.src);const n=function(t,e,r){return t.plugins.filter(t=>{return(e=t)&&"wants"in e;var e}).find(t=>t.wants(r.src||"",r,e))}(t,e,r);return n?(n.onload(e,t.root,t,r),q.Ok):q.Err}(t,e,a)||q.Ok==function(t,e,r,n={safari:!1}){/^audio\//.test(r.type||"")&&t.emit("audioonlysource");e.start_time&&(r.src=r.src+"#t="+e.start_time);if(""==t.canPlayType(r.type||""))return q.Err;if(r.drm&&(!r.drm["com.apple.fps.1_0"]||!n.safari))return q.Err;"string"==typeof r.src&&(t.src=r.src);return q.Ok}(t,e,a,n))return!0;r==i.length-1&&"string"==typeof a.src&&(t.src=a.src)}),function(t,e){(function(t,e){if(!t.currentSrc)return;if("none"==t.opt("preload"))return;if(e.autoplay&&e.autoplay>0)return;t.load()})(t,e),"none"==t.opt("preload")&&t.render()}(t,e),t}!function(t){t[t.Err=0]="Err",t[t.Ok=1]="Ok"}(q||(q={}));const z=[v,"seeking","src","seek:cancel"];var X;function Q(t,e,r){return isNaN(t.duration)||isNaN(t.currentTime)?{}:(e.offset+=r,0==e.offset?J(t,e):(e.timer&&clearTimeout(e.timer),e.timer=setTimeout((function(){0!=t.reaper&&(t.currentTime=function(t,e,r=0){return Math.max(Math.min(e,t),r)}(t.currentTime+e.offset,t.duration),e.timer=0,J(t,e))}),1e3),function(t,e){t.setState("will-seek",!0),t.setState(X.BACKWARD,e.offset<0),t.setState(X.FORWARD,e.offset>0)}(t,e),t.emit("seek:queued",e),e))}function J(t,e){e.timer&&clearTimeout(e.timer),e.timer=e.offset=0,function(t){t.setState(X.FORWARD,!1),t.setState(X.BACKWARD,!1),t.setState("will-seek",!1)}(t)}function Z(){if("undefined"==typeof document)return!1;const t=document.documentElement;return t&&"rtl"==t.getAttribute("dir")}function $(...t){const e=document.createElement("div");return 0==t.length||e.classList.add(...t),e}function tt(t,e,r){const n=function(t){return Array.isArray(t)?t.slice(0):t.split(".")}(e);for(;n.length;){if(null==t)return r;const e=n.shift();if("string"!=typeof e)return r;t=t[e]}return null==t?r:t}function et(t){const e="number"==typeof t?t:parseInt(t,10);return(e>9?"":"0")+e}function rt(t){if(isNaN(t)||t>=Number.MAX_SAFE_INTEGER)return"";const e=t<0?"-":"";t=Math.round(Math.abs(t));const r=Math.floor(t/3600);let n=Math.floor(t/60);return t-=60*n,r>=1?(n-=60*r,e+r+":"+et(n)+":"+et(t)):e+et(n)+":"+et(t)}!function(t){t.FORWARD="forward",t.BACKWARD="backward"}(X||(X={}));const nt=navigator.languages||[navigator.language];function it(t,e,r){const n={};return r=e.lang||r,t[r]&&(n[r]=t[r]),function(){try{return nt.reduce((t,e)=>~e.indexOf("-")?t.concat(e,e.split("-")[0]):t.concat(e),[])}catch(t){return[]}}().forEach((function(e){t[e]&&!n[e]&&(n[e]=t[e])})),Object.values(n)}const at={3:!0,5:!0,7:!0,9:!0};function st(){return(t=Array(16),Array.from({length:t.length}).map((t,e)=>e).forEach(e=>{let r;0==(3&e)&&(r=4294967296*Math.random()),t[e]=(r||0)>>>((3&e)<<3)&255}),t).reduce((function(t,e,r){const n=(e+256).toString(16).substr(1);return t+(r.toString()in at?"-":"")+n}),"");var t}let ot="";!function(){let t=!1;try{const e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("testPassive",null,e),window.removeEventListener("testPassive",null,e)}catch(t){}}();const ut=["touchstart","touchmove"];function lt(t,e){const r=new CustomEvent(t,{detail:e});return e&&Object.defineProperty(r,"data",{get:()=>e}),r}function ct(t,e,r){const n=lt(e,r);return t.dispatchEvent(n),t}function dt(t,e,r){const n=lt(e,r);return t.dispatchEvent(n),n}function ft(t,e,r,n){Array.isArray(e)?e.forEach(e=>ht(t,e,r,n)):ht(t,e,r,n)}function ht(t,e,r,n){if(i=e,!~ut.indexOf(i))return t.addEventListener(e,r,n),t;var i;const a=Object.assign(n||{},{passive:!0});return t.addEventListener(e,r,a),t}function pt(t,e,r,n){return ft(t,e,r,Object.assign(n||{},{once:!0}))}const vt={preload:"none",rtl:!1,controls:!0},gt=["loop","muted","preload"];function mt(t,n,i){i.toJSON=function(){return{duration:i.duration,volume:i.volume,currentTime:i.currentTime,states:i.root.className}},i.setSrc=function(e){return Y(i,t,e,r())},i.playerState=i.playerState||{},i.setState=function(t,e){if(i.playerState[t]===!!e)return i;const r=Object.assign({},i.playerState,{[t]:e});return r[k]&&(r[T]=!1),i.playerState=r,ct(i,"state",i.playerState),i},i.hasState=function(t){return!!i.playerState[t]},i.transitionState=function(t,e,r){i.hasState(t)&&(r=0),r&&i.setState("is-toggling",!0),i.setState(e,!1),i.setState(t,!0),r&&setTimeout((function(){i.setState("is-toggling",!1)}),r)},i.render=function(t,e){return"string"==typeof t?M.render(t,e):(ct(i,r().ios?d:f),ct(i,"canplay"),i)},i.emit=(t,e)=>(ct(i,t,e),i),i.on=(t,e)=>(ft(i,t,e),i),i.once=(t,e)=>(pt(i,t,e),i),i.off=(t,e)=>{var r,n;return r=t,n=e,i.removeEventListener(r,n),i},i.poll=(t,e)=>dt(i,t,e),i.togglePlay=function(e){return N(i,t,e)},i.toggleMute=function(t){t=null==t?!i.muted:!!t,i.muted=t,i.muted||i.volume||(i.volume=1),ct(i,"volumechange")},i.toggleDisable=function(t){t=null==t?!i.disabled:!!t,i.setState("is-disabled",t),i.disabled=t},i.destroy=function(){i.pause();const t=e.indexOf(i);~t&&e.splice(t,1),setTimeout((function(){i.setSrc([]),i.reaper&&i.reaper.clear(),ct(i,v)}),0)},i.setAttrs=function(t){return gt.forEach(e=>{if(!(e in t))return;const r=t[e];r?i.setAttribute(e,r.toString()):i.removeAttribute(e)}),i},i.opt=function(e,r){return r=void 0===r?tt(vt,e):r,tt(t,e,r)},i.i18n=function(t,e){if(!i.reaper)return"";const r=i.reaper.get("translations");return r?function t(e,r,n,i){return(i=i||0)>=e.length?n:tt(e[i],r,t(e,r,n,i+1))}(r,t,e||""):e||""},i.setOpts=function(e){Object.assign(t,e),"disabled"in e&&void 0!==e.disabled&&i.toggleDisable(e.disabled),"muted"in e&&void 0!==e.muted&&i.toggleMute(e.muted);const r=!!t.autoplay&&!i.hasState("no-autoplay");i.setState("is-autoplay",r),i.setState("is-rtl",i.opt("rtl",function(t){if(!t)return Z();const e=t.getAttribute("dir");return e?"rtl"==e:Z()}(n))),i.setState("is-live",!!t.live),i.setState("no-timeline",!(!t.live||t.dvr)),i.setState("has-poster","string"==typeof t.poster&&t.poster.length>0),i.setState("is-seekable",!!t.seekable),n.style.backgroundImage=i.hasState("has-poster")?"url('"+t.poster+"')":"",ct(i,g,t)},i.renderPlugin=function(t){dt(i,"renderplugin",t).defaultPrevented||i.root.appendChild(t)};const a={offset:0,timer:0};var s,o;o=a,(s=i).on(z,(function(){J(s,o)})),i.enqueueSeek=function(t){if(0!=i.opts.seekable&&!(1==i.opts.disabled&&t>0))return Q(i,a,t)},i.deviceId=function(){return function(){if(ot)return ot;try{const t=localStorage.getItem("flowplayer/uuid");if(t)return t;const e=st();return localStorage.setItem("flowplayer/uuid",e),e}catch(t){return ot=st()}}()}}function yt(t,e){const r=e.querySelector("video"),n=r||(t._video_element_callback?t._video_element_callback(t):document.createElement("video"));return n.classList.add("fp-engine"),n.playsInline=!0,r||e.append(n),n}function Et(t,e){if("object"==typeof exports&&"undefined"!=typeof module)return e;"flowplayer"in t||(t.flowplayer={extensions:[]});const r=t.flowplayer;return"function"==typeof r?(r(e),e):(Array.isArray(r.extensions)||(r.extensions=[]),~r.extensions.indexOf(e)||r.extensions.push(e),e)}function Tt(){return"undefined"!=typeof window?window:"undefined"!=typeof global?global:{}}const _t=["localhost","127.0.0.1","0.0.0.0","s.codepen.io","cdpn.io","try.flowplayer.com"];function bt(t,e){return!!~_t.indexOf(t)||t.indexOf(e)===t.length-e.length}bt.check_whitelist=function(t){return!!~_t.indexOf(t)};const St="production";function At(t,e){const r={valid_jwt:!1,raw:"",data:{acl:0},exp:0};let n={c:"{}",exp:0};e=e||{};try{n=P(t),r.valid_jwt=!0}catch(t){}return r.raw=t,r.data=JSON.parse(n.c),r.exp=n.exp,e.require_valid_token&&At.validate(r),r}function Lt(t){try{return At.validate(t),{success:!0,message:""}}catch(t){return{success:!1,message:t.message}}}var kt;function wt(t){return{grant:t,is_granted:e=>(t&e)===e}}function Dt(t,e,r){e&&e.destroy(),console.error(new Error(r.details||r.reason)),t.innerHTML="",t.classList.remove("flowplayer"),t.classList.add("flowplayer-fatal"),t.innerHTML='\n <h2>Playback Error</h2>\n <p>Are you the site owner?</p>\n <a class="troubleshoot" target="_blank" href="https://flowplayer.com/help/developers/troubleshooting">Troubleshoot?</a>\n <img src=""https://flowplayer.com/user/pages/images/logo-white.png""/>\n '}function Rt(t,e){const r=e.clientWidth;e.classList.toggle("is-small",r<600),e.classList.toggle("is-tiny",r<400)}function Ot(t,e,n){let i=!0;e.classList.add("flowplayer"),Rt(0,e),ft(n,["loadstart",c],(function(){Rt(0,e)})),ft(n,"state",(function(){Object.entries(n.playerState).forEach((function([t,r]){e.classList.toggle(t,r)}))})),ft(n,"timeupdate",(function(){n.setState(k,!1)})),ft(n,g,(function(){const r=n.paused&&(!t.autoplay||e.classList.contains("no-autoplay"))&&0==n.currentTime;[b,S].forEach((function(t){n.setState(t,r)}))})),ft(n,"ended",(function(e){setTimeout((function(){e.defaultPrevented||(t.rewind&&!n.loop&&(t.autoplay&&(t.autoplay=0,n.setState("is-autoplay",!1)),n.setState(A,!0),pt(n,p,(function(){n.setState(A,!1),n.pause(),n.setState(S,!0)})),n.currentTime=0),pt(n,"timeupdate",(function(){n.setState(L,!1)})),n.transitionState(L,T,t.loop||t.rewind?0:300))}),0)})),ft(n,["seeking",p],(function(t){n.setState(A,"seeking"==t.type),n.setState(_,n.paused),n.setState(T,!n.paused)})),ft(n,"ended",(function(){n.setState(T,!1),i=!0})),ft(n,r().ios?d:f,(function(t){const e="src"!=t.type||"none"!==n.opt("preload");n.setState("is-loaded",e),n.setState(b,!e)})),ft(n,["waiting","canplay","loadstart"],(function(e){if(!n.hasState(A)&&("canplay"!=e.type||t.autoplay||n.setState(k,!1),"loadstart"!=e.type||"none"!=n.opt("preload")||t.autoplay)){if("loadstart"==e.type&&t.autoplay)return pt(n,h,(function(){n.setState(k,!1)}));"waiting"==e.type&&[T,_,S].forEach((function(t){n.setState(t,!1)})),n.setState(L,!1),n.setState(k,"waiting"==e.type)}})),ft(n,[h,"pause"],(function(e){setTimeout(()=>{const t=new CustomEvent("flowplayer/"+e.type,{detail:n});document.dispatchEvent(t)},0);const r=e.type==h,a=n.currentTime==n.duration,s=r&&i&&t.autoplay||n.hasState(k);if(r&&(n.started=!0,i=!1),n.setState(k,!1).setState(S,!1),a||n.hasState(A))return;const o=r?T:_,u=r?_:T;n.transitionState(o,u,s?0:300),r&&n.setState("no-autoplay",!1)}))}function Ct(t){const e=function(t){const e=t.getBoundingClientRect(),r=window.innerHeight,n=e.height,i=e.bottom,a=n/5;return e.top<=a&&e.top+n>r-a||i-n+a>=0&&i<r+a}(t.root);return t.in_viewport===e||(t.in_viewport=e,ct(t,e?"viewenter":"viewleave")),t}function It(t,r,n){Ct(n);const a={should_resume:!!t.autoplay,has_user_gesture:!1,locked:!1};[l,i].forEach(t=>pt(n,t,()=>a.has_user_gesture=!0)),ft(n,"play",(function(){a.locked||(a.should_resume=!0)})),ft(n,"pause",(function(){a.locked||(a.should_resume=!1)})),ft(n,"canplay",(function(r){t.autoplay&&!e.filter((function(t){return!t.paused})).length&&n.in_viewport&&n.paused&&a.should_resume&&n.togglePlay(!0)})),t.autopause&&(ft(n,"viewenter",(function(){a.should_resume&&n.togglePlay(!0)})),ft(n,"viewleave",(function(){const t=!n.paused;a.locked=!0,n.pause(),setTimeout((function(){a.should_resume=t,a.locked=!1}),0)})))}At.validate=function(t){if("string"==typeof t&&(t=At(t)),!t||!t.raw){if(bt.check_whitelist(window.location.hostname)||"dev"===St.toString())return!0;throw new Error("No token provided in configuration")}if(!t.valid_jwt)throw new Error("Invalid token provided");const e=window.location.hostname,r=bt.bind(null,e);if("dev"!==St.toString()&&t.data.domain&&t.data.domain.length&&!t.data.domain.some(r))throw new Error("Domain not allowed");if("dev"!==St.toString()&&1e3*t.exp-Date.now()<0)throw new Error("Expired token");return!0},At.id=function(t){if(t)return"string"==typeof t&&(t=At(t)),t.data.id},function(t){t[t.ADS=2]="ADS",t[t.ANALYTICS=4]="ANALYTICS",t[t.NO_METERING=8]="NO_METERING",t[t.DEVELOPER_PLAN=16]="DEVELOPER_PLAN"}(kt||(kt={})),wt.of=wt,wt.from_token=function(t){const e=At(t,{require_valid_token:!0});return wt.of(e.data.acl)},wt.permissions=kt,[s,c].forEach(t=>{window.addEventListener(t,(function(){e.forEach((function(t){const e=t.root;e.prevWidth!=e.clientWidth&&(ct(t,c),e.prevWidth=e.clientWidth)}))}))}),window.addEventListener("scroll",(function(){e.forEach(Ct)}));function xt(t){if("number"==typeof t&&!isNaN(t))return Number(t);if("string"==typeof t){const e=t.split(":");return Number(e[1])/Number(e[0])}return t}function Pt(t,e,r){const n=document.createElement("div");n.classList.add("fp-ratio"),e.append(n);let i=xt(t.ratio||.5625);n.style.paddingTop=100*i+"%";const a=[f,d];r.on(a,(function(){const t=r.videoHeight&&r.videoWidth&&r.videoHeight/r.videoWidth;t&&r.setOpts({ratio:t})})),r.on(g,(function(){const e=r.videoHeight&&r.videoWidth&&r.videoHeight/r.videoWidth,a=xt((null==t?void 0:t.ratio)||e||.5625);i!==a&&(i=a,n.style.paddingTop=100*a+"%")}))}const Mt="flowplayer/"+h;function Ft(t){const e=e=>{if(e.detail===t)return;const r=t.opt("multiplay");"boolean"==typeof r&&!1===r&&t.pause()};t.on(v,()=>document.removeEventListener(Mt,e)),document.addEventListener(Mt,e)}const Nt=function(){const t=Tt(),e=t.flowplayer?t.flowplayer:{extensions:[]};return Array.isArray(e.extensions)||(e.extensions=[]),e}();function Ut(r,n){if("function"==typeof r)return t.push(...[...arguments].filter(t=>"function"==typeof t)),Ut;"string"==typeof n&&(n={src:n}),n||(n={}),n.token||"string"!=typeof window.__FLOWPLAYER_TOKEN||(n.token=window.__FLOWPLAYER_TOKEN);const i="string"==typeof r?document.querySelector(r):r;if(!i)return console.error(new Error("Flowplayer: '"+r.toString()+"' not found"));const a=i.querySelector("video.fp-engine");if(a)return a;const s=Lt(n.token);if(!s.success)return Dt(i,null,{reason:"token",details:s.message});const o=new Map,u=yt(n,i);if(u.reaper=o,Object.defineProperty(u,"token",{value:"string"==typeof n.token?At.id(n.token):"",writable:!1}),u.addEventListener(v,()=>{o.clear(),u.reaper=0,delete u.root}),u.root=i,n.token&&wt.from_token(n.token).is_granted(wt.permissions.DEVELOPER_PLAN))return Dt(i,null,{reason:"developer_plan",details:"Using developer plan tokens is not currently supported"});!~e.indexOf(u)&&e.push(u),mt(n,i,u),u.setAttrs(n),u.plugins=Ut.extensions.map(t=>new t(Ut,u)),Ot(n,i,u),It(n,0,u),Pt(n,i,u),Ft(u),u.plugins.forEach(t=>{try{t.init(n,i,u)}catch(e){console.log("Error(plugin/%s)",t.constructor.name,e)}}),u.setOpts(n),u.opts=n,n.src&&u.setSrc(n.src);const l=u.readyState;return l>0&&u.currentSrc&&u.emit(d),l>2&&u.currentSrc&&u.emit("canplay"),"none"==u.opt("preload")&&u.paused&&u.currentSrc&&u.render(),u.emit("mount"),u.on("error:fatal",(function(t){Dt(i,u,t.data||{})})),u}Object.assign(Ut,Nt),function(n){Array.isArray(n.extensions)&&n.extensions.forEach(e=>t.push(e)),n.components=M,n.version="3.0.0-rc6",n.commit="6d66ffa737639c623b6ecccdefd3d118199516a8",n.instances=e,n.extensions=t,n.support=r,n.events=E,n.states=D,n.jwt=P,n.autoplay=x,n.quality=F}(Ut),"object"==typeof document&&setTimeout(ct,0,document,"flowplayer:umd",Ut);var Bt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function jt(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Gt(t){var e={exports:{}};return t(e,e.exports),e.exports}var Ht=Gt((function(t,e){var r=Bt&&Bt.__assign||function(){return(r=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};e.__esModule=!0,e.remove=e.downcase=e.pluck=e.merge=void 0,e.merge=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t.reduce((function(t,e){return r(r({},t),e)}),{})},e.pluck=function(t){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];return Object.keys(t).filter((function(t){return~r.indexOf(t)})).reduce((function(r,n){var i;return e.merge(r,((i={})[n]=t[n],i))}),{})},e.downcase=function(t){return(t||"").toString().toLowerCase()},e.remove=function(t,e){var r=t.lastIndexOf(e);return~r&&t.splice(r,1),t}})),Kt=Gt((function(t,e){var r=Bt&&Bt.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),n=Bt&&Bt.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),i=Bt&&Bt.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var i in t)"default"!==i&&Object.hasOwnProperty.call(t,i)&&r(e,t,i);return n(e,t),e};e.__esModule=!0;var a=i(Ht),s=function(){function t(){this.pending=[],this.open=[],this.stats={failures:0,ttl:0}}return t.of=function(){return new t},t.is_empty=function(t){return 0==t.pending.length},t.is_high_water=function(e){return e.open.length==t.MAX_OPEN_REQUESTS},t.maybe_spawn_req=function(e){if(t.is_empty(e))return e;if(t.is_high_water(e))return e;try{var r=t.lpop(e);r&&t.request(e,r)}catch(t){}},t.increment_failures=function(e){return e.stats.failures++,e.stats.failures>t.MAX_FAILURE_COUNT&&(e.stats.ttl=Date.now()+t.REQUEST_TTL_MS),e},t.handle_error=function(e,r){t.rm(e,r),t.increment_failures(e)},t.request=function(e,r){var n=r[0],i=r[1],a=r[2];if(!(Date.now()<e.stats.ttl)){var s=new XMLHttpRequest;e.open.push(s),s.timeout=t.REQUEST_TIMEOUT_MS,s.ontimeout=function(){t.handle_error(e,s)},s.onerror=function(r){t.handle_error(e,s)},s.onreadystatechange=function(){s.readyState==XMLHttpRequest.DONE&&t.rm(e,s),Math.floor(s.status/100)},s.onload=function(){t.rm(e,s),e.stats.failures&&e.stats.failures--},s.open(i,n),s.setRequestHeader("Content-Type","text/plain;charset=UTF-8");try{s.send(JSON.stringify(a))}catch(t){}}},t.rpush=function(e){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];return r.forEach((function(r){e.pending.length>=t.MAX_PENDING||(e.pending.push(r),t.maybe_spawn_req(e))})),e},t.lpop=function(t){return t.pending.shift()},t.rm=function(t,e){return a.remove(t.open,e),t},t.MAX_OPEN_REQUESTS=3,t.MAX_PENDING=5,t.REQUEST_TIMEOUT_MS=4e3,t.REQUEST_TTL_MS=5e3,t.MAX_FAILURE_COUNT=3,t}();e.default=s})),Vt=Gt((function(t,e){var r=Bt&&Bt.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};e.__esModule=!0;var n=r(Kt);e.default=n.default.of()})),Wt=Gt((function(t,e){e.__esModule=!0,e.prepare_url=e.URL_PARAM=void 0,e.URL_PARAM=/:([a-zA-Z_]+)/g,e.prepare_url=function(t,r){return t.url.replace(e.URL_PARAM,(function(e){if((e=e.slice(1,e.length))in r)return r[e].toString();t.log.error(new Error("\n preparing url["+t.url+"] failed\n \n parameter["+e+"] not detected in params:\n \n "+JSON.stringify(r,null,2)+"\n "))}))}})),qt=Gt((function(t,e){e.__esModule=!0,e.Log=void 0;var r=function(){function t(t){this.emitter=t}return t.prepare=function(t,e){var r=document.createEvent("Event");return r.initEvent(t,!1,!0),r.ns=t,r.data=e,r},t.of=function(e){return new t(e)},t.prototype.info=function(e){this.emitter.dispatchEvent(t.prepare(t.NAMESPACE.INFO,e))},t.prototype.error=function(e){this.emitter.dispatchEvent(t.prepare(t.NAMESPACE.ERROR,e))},t.prototype.warn=function(e){this.emitter.dispatchEvent(t.prepare(t.NAMESPACE.WARN,e))},t.NAMESPACE={INFO:"tracker:info",ERROR:"tracker:err",WARN:"tracker:warn"},t}();e.Log=r})),Yt=Gt((function(t,e){var r;e.__esModule=!0,e.Verb=void 0,(r=e.Verb||(e.Verb={})).POST="POST",r.PUT="PUT",r.GET="GET"})),zt=Gt((function(t,e){var r=Bt&&Bt.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),n=Bt&&Bt.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),i=Bt&&Bt.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var i in t)"default"!==i&&Object.hasOwnProperty.call(t,i)&&r(e,t,i);return n(e,t),e},a=Bt&&Bt.__spreadArrays||function(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;var n=Array(t),i=0;for(e=0;e<r;e++)for(var a=arguments[e],s=0,o=a.length;s<o;s++,i++)n[i]=a[s];return n},s=Bt&&Bt.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};e.__esModule=!0;var o=s(Vt),u=s(Kt),l=i(Wt),c=i(Ht),d=function(){function t(e,r){var n=this;void 0===r&&(r={});var i=this;if(this.emitter=e,this.url=r.url,this.log=qt.Log.of(this.emitter),this.verb=r.verb,this.metadata=c.merge({},r.metadata||{}),this.rq=r.rq||o.default,this.events=r.events||[],this.required_keys=r.required_keys||[],this.optional_keys=r.optional_keys||[],this.listeners=[],this.valid_keys=this.required_keys.slice(0).concat(this.optional_keys),t.assert_emitter_api(this.emitter),void 0===t.verb[this.verb])throw new Error("invalid HTTP verb["+this.verb+"] passed");if("string"!=typeof this.url)throw new Error("invalid API url["+this.url+"] passed");t.TRACKERS.push(this),i.events.forEach((function(e){t.create_listener(n,e,(function(r){void 0===r&&(r={});var a=c.merge(i.metadata,{event_type:e},r.data||r),s=l.prepare_url(i,a),o=t.pluck_valid_keys(i,a),d=t.ensure_required_keys(i,o);if(d.length)return i.log.error("Tracker.validate_metadata() failed for \n Event["+e+"]\n missing keys: "+d+"\n payload:\n "+JSON.stringify(o,null,2));u.default.rpush(n.rq,[s,n.verb,o])}))}))}return t.of=function(e,r){return new t(e,r)},t.ensure_required_keys=function(t,e){return t.required_keys.filter((function(t){return!(t in e)}))},t.pluck_valid_keys=function(t,e){return c.pluck.apply(c,a([e],t.valid_keys))},t.merge_metadata=function(e,r){return void 0===r&&(r={}),e.metadata=t.pluck_valid_keys(e,c.merge(e.metadata,r)),e},t.assert_emitter_api=function(t){if("function"!=typeof(t||{}).addEventListener)throw new Error("Tracker() received an emitter that does not implement the addEventListener method");if("function"!=typeof(t||{}).removeEventListener)throw new Error("Tracker() received an emitter that does not implement the removeEventListener method")},t.create_listener=function(t,e,r){t.listeners.push([e,r]),t.emitter.addEventListener(e,r)},t.prototype.destroy=function(){var e=this;this.listeners.forEach((function(t){var r=t[0],n=t[1];return e.emitter.removeEventListener(r,n)})),delete this.rq,delete this.emitter,c.remove(t.TRACKERS,this)},t.prototype.put=function(e){return void 0===e&&(e={}),t.merge_metadata(this,e),this},t.TRACKERS=[],t.QUEUE=o.default,t.verb=Yt.Verb,t}();e.default=d})),Xt=Gt((function(t,e){var r=Bt&&Bt.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),n=Bt&&Bt.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),i=Bt&&Bt.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var i in t)"default"!==i&&Object.hasOwnProperty.call(t,i)&&r(e,t,i);return n(e,t),e},a=Bt&&Bt.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};e.__esModule=!0,e.API=e.Tracker=void 0;var s=a(zt);e.Tracker=s.default;var o=i(Wt);e.API=o})),Qt="ping",Jt="display",Zt="view";const $t=["sitegroup_id","session_id","media_id","site_id","player_id","video_type"],te=["created","position"],ee=["player_version","created","source","category","category_id","autoplay","muted","customer_user_id"];function re(t,e){return t.duration/1===t.duration&&Object.assign(e,function(t){const e=t/100;return{segment_duration:e,breakpoints:Array(...Array(100)).map((function(t,r){return Math.floor(r*e*1e3)/1e3}))}}(t.duration))}function ne(t,e,r){if(!e.segment_duration&&!re(t,e))return;const n=function(t,e,r){const n=e.last_idx,i=r?99:ie(t,e);return e.last_idx=i,i<=n?[]:e.breakpoints.slice(n,99==i?100:i).map((function(t){return e.breakpoints.indexOf(t)}))}(t,e,r);0!=n.length&&t.emit(Qt,{position:n})}function ie(t,e){return Math.min(Math.floor(t.currentTime/e.segment_duration),99)}const ae="vod",se="live",oe=[Jt,Qt,Zt];function ue(t,e,r){switch(null==e?void 0:e.kind){case"live":return function(t,e){const r=Date.now();r-e.last_tracked_ts<6e4||(e.last_tracked_ts=r,++e.ticks,t.emit(Qt,{position:60*e.ticks}))}(t,e);case"vod":return ne(t,e,"boolean"==typeof r&&r)}}function le(t){const e=t.ads;return void 0!==e&&(void 0!==e.schedule&&("function"==typeof e.hasPreroll&&(e.currentRequests?e.currentRequests:!!e.adPlaying||!(!e.hasPreroll()||0!=e.nextIndex))))}function ce(){try{return window.location!==window.parent.location?document.referrer:document.location.href}catch(t){return!1}}class de{init(t,e,r){if(!wt.from_token(t.token||"").is_granted(wt.permissions.ANALYTICS))return;if(r.analytics)return;const n=r.analytics={ticker:void 0,last_media_id:"",ended:!1},i={locked:!1,ttl:6e3,task:()=>{ue(r,n.ticker)}};const a={session_id:r.deviceId(),autoplay:r.autoplay,muted:r.muted,player_id:t.player_id,customer_user_id:t.customer_user_id},s=Xt.Tracker.of(r,{verb:Xt.Tracker.verb.POST,url:"https://ptm.flowplayer.com/:video_type/:sitegroup_id/:event_type",events:oe,required_keys:$t,optional_keys:ee.concat(te).slice(0),metadata:a});r.on(v,(function(){s&&s.destroy()})),r.on(g,(function(e){if(!s)return;const i=tt(e,"data.metadata",{});if(!i.media_id)return;const a=tt(s,"metadata.media_id");if(a&&i.media_id==a)return;const o=tt(t,"analytics",{});s.put(i),s.put(o);const u=tt(t,"metadata.live_start_time",t.live)?se:ae;s.put({video_type:u,source:t.source||ce()||""}),n.ticker=t.live?{ticks:0,last_tracked_ts:Date.now(),kind:"live"}:{last_idx:0,segment_duration:0,breakpoints:[],kind:"vod"},n.ended=!1,r.emit(Jt)}));let o=0;r.on(h,(function(){if(!s)return;if(o||function(t,e){return t.metadata.media_id&&t.metadata.media_id==e.last_media_id}(s,n))return;s.put({muted:r.muted});const t=le(r);if(t)return o=Promise.resolve(t).then((function(){n.last_media_id=s.metadata.media_id,r.emit(Zt),o=0})).catch((function(){o=0}));n.last_media_id=s.metadata.media_id,r.emit(Zt)})),r.on("timeupdate",(function(){var e;s&&(o||le(r)||n.ended||(!t.live&&r.currentTime+.25>=r.duration&&ue(r,n.ticker,!0),(e=i).locked||(e.locked=setTimeout((function(){return e.task(),function(t){return t.locked=!1,t}(e)}),e.ttl))))})),r.on(p,(function(){s&&n.ticker&&"vod"==n.ticker.kind&&function(t,e){re(t,e),e.last_idx=ie(t,e)}(r,n.ticker)})),r.on("ended",(function(){s&&function(t,e){e.ended||(e.ended=!0,ue(t,e.ticker))}(r,n)}))}}function fe(t,e,r){!function(t,e,r){"undefined"!=typeof window&&"ontouchstart"in window&&r.setState("is-touch-device",!0);let n=!1;r.setState("is-accessibility",!1);const i=e.querySelector(".fp-middle");i&&i.addEventListener(l,(function(t){0!=t.cancelable&&(t.preventDefault(),r.emit(t.type,{source:t}))})),r.on(l,(function(t){setTimeout((function(){if(t.defaultPrevented)return;if(r.hasState(k))return;if(r.ended)return r.togglePlay(!0);const e=r.hasState(S);n&&clearTimeout(n),(e||r.hasState(w)||r.hasState("no-autoplay"))&&(r.hasState(w)&&(r.setState(w,!1),r.setState("is-hovered",!1)),r.togglePlay(),e)||(r.setState(w,!0),r.paused||(n=setTimeout((function(){n=!1,r.setState(w,!1),r.setState("is-hovered",!1)}),2e3)))}),0)}))}(0,e,r)}function he(t,e,r){let n=()=>document.fullscreenElement,i="fullscreenchange";if(!Element.prototype.requestFullscreen){const t=Element.prototype,e=document;t.webkitRequestFullScreen&&(t.requestFullscreen=t.webkitRequestFullScreen,e.fullscreenEnabled=!0),e.webkitCancelFullScreen&&(document.exitFullscreen=e.webkitCancelFullScreen),i="webkit"+i,n=()=>e.webkitCurrentFullScreenElement}r.toggleFullScreen=function(t,n){r.ios_fullscreen_disabled||("boolean"!=typeof t&&(t=!r.in_fullscreen),pe(r)&&(t?function(t){t.getAttribute("playsinline")&&t.removeAttribute("playsinline");t.getAttribute("webkit-playsinline")&&t.removeAttribute("webkit-playsinline");t.webkitEnterFullScreen()}(r):function(t,e){t.getAttribute("playsinline")||t.setAttribute("playsinline","");t.getAttribute("webkit-playsinline")||t.setAttribute("webkit-playsinline","");e||t.webkitExitFullScreen();t.togglePlay(!1),t.hasState(w)||t.setState(w,!0)}(r,n)),document.fullscreenEnabled&&(t?e.requestFullscreen():document.exitFullscreen()))},pe(r)&&(r.ios_fullscreen_disabled=!0,r.once("beforeplay",(function(){r.ios_fullscreen_disabled=!1})),r.on("webkitendfullscreen",(function(){r.toggleFullScreen(!1,!0)}))),e.addEventListener(i,(function(){const t=n(),i=t===e||t==r;r.in_fullscreen=i,r.emit(i?"fullscreenenter":"fullscreenexit"),r.setState("is-fullscreen",i),r.emit(c)})),!1!==t.doubleclick&&e.addEventListener(a,(function(t){var e;t.target&&(null===(e=t.target)||void 0===e?void 0:e.classList.contains("fp-ui"))&&r.toggleFullScreen()}))}function pe(t){return r().ios&&"function"==typeof t.webkitEnterFullScreen&&"function"==typeof t.webkitExitFullScreen}Et(Tt(),de),"undefined"!=typeof window&&window.matchMedia&&[m,y].forEach((function(t){window.matchMedia("(orientation: "+t+")").addListener((function(r){e.length&&e.forEach((function(e){r.matches&&e.emit(t)}))}))}));const ve={name:"fp-fullscreen",translation_key:"core.fullscreen"},ge={name:"fp-fullscreen-exit",translation_key:"core.exit_fullscreen"},me={name:"fp-play",translation_key:"core.play"},ye={name:"fp-pause",translation_key:"core.pause"},Ee={translation_key:"core.mute",name:"fp-volume-mute-unmute"},Te={translation_key:"core.play",name:"fp-small-play"},_e={translation_key:"core.pause",name:"fp-small-pause"},be={name:"fp-fast-forward"};function Se(t){const e=document.createElement("div");return e.classList.add("fp-icon",t.name),t.title&&e.setAttribute("title",t.title),t.title&&e.setAttribute("aria-label",t.title),e.setAttribute("tabindex","0"),e.setAttribute("focusable","true"),e}function Ae(t,e,r){const n=$("fp-header"),a=$("fp-primary"),s=$("fp-duration"),o=function(t,e){const r=$();r.classList.add("fp-secondary","fp-togglable"),he(t,e.root,e);const n=Se(ve);n.setAttribute("role","button"),n.setAttribute("aria-label",e.i18n("core.fullscreen"));const a=Se(ge);return a.setAttribute("role","button"),a.setAttribute("aria-label",e.i18n("core.fullscreen_exit")),n.addEventListener(i,()=>e.toggleFullScreen()),a.addEventListener(i,()=>e.toggleFullScreen()),r.append(n,a),r}(t,r),u={logo:""};r.on(g,(function(t){var e,r,n,i,o;i=s,o=(null===(e=null==t?void 0:t.data)||void 0===e?void 0:e.duration)||NaN,i.innerText=isFinite(o)?rt(o):"";const l=u.logo,c=(null===(r=null==t?void 0:t.data)||void 0===r?void 0:r.logo)||"";l!=c&&(u.logo=c,function(t,e,r){if(t.innerHTML="",!e)return;const n=document.createElement("img");if(n.classList.add("fp-logo"),n.src=e,!r)return t.append(n);const i=document.createElement("a");i.href=r,i.append(n),t.append(i)}(a,c,null===(n=null==t?void 0:t.data)||void 0===n?void 0:n.logo_href))})),n.append(a,s,o),e.append(n),r.reaper&&(r.reaper.set("header",n),r.reaper.set("header.secondary",o))}var Le=Object.freeze({__proto__:null,NO_FULLSCREEN:1,NO_VOLUME_CONTROL:2,NO_MUTE:4,LOGO_ON_RIGHT:8,USE_DRAG_HANDLE:16,USE_PLAY_2:32,USE_PLAY_3:64,USE_THIN_CONTROLBAR:128,NO_TITLE:256,NO_DESCRIPTION:512,NO_CONTROLS:1024,NO_DURATION:2048,NO_HEADER:4096,AUDIO_ONLY:8192,NO_TOUCH_ZONES:16384});function ke(t,e,r){if(!r.reaper)return;const n=$("fp-middle"),s=$("fp-left-zone"),o=$("fp-middle-zone"),u=$("fp-right-zone"),c=[s,o,u];!function(t,e){const r=e[0],n=e[1];t.on(p,(function(){e.forEach(De)})),t.on("seek:queued",(function(t){const i=t.data;if(!i)return;if("number"!=typeof i.offset)return;const a=i.offset;if(0==a)return e.forEach(De);const s=a>0?n:r;return De(s==n?r:n),function(t,e){const r=t.querySelector(".fp-zone-seconds");r&&(r.innerText=Math.abs(e)+"")}(s,a)})),t.on("seek:cancel",(function(){e.forEach(De)})),e.forEach((function(e){const n=e==r?-1:1,i=document.createElement("span"),a=we(be);i.classList.add("fp-zone-seconds"),e.append(i,a),De(e),e.addEventListener(l,(function(e){isNaN(t.duration)||isNaN(t.currentTime)||16384&t.opt("ui")||t.hasState("no-timeline")||!t.hasState("will-seek")&&!t.hasState(w)||t.enqueueSeek(5*n)&&(e.stopPropagation(),e.preventDefault())}))}))}(r,[s,u]),c.forEach((function(t){n.append(t)})),r.reaper.set("middle",n),function(t,e){[i,a].forEach(r=>t.addEventListener(r,(function(t){if(!t.defaultPrevented)return t.preventDefault(),e.emit(t.type),!1}))),e.on(i,(function(t){setTimeout((function(){t.defaultPrevented||e.hasState(k)||e.togglePlay()}),0)})),e.on(a,(function(t){setTimeout((function(){t.defaultPrevented||e.toggleFullScreen()}),0)}))}(n,r),function(t){const e=$("fp-wait");Array(...Array(4)).map((t,e)=>e).forEach(()=>{e.append(document.createElement("b"))}),t.append(e)}(o);const d=$("fp-switch");return d.append(...[me,ye].map(we)),o.append(d),e.append(n),n.setAttribute("tabindex","0"),n.setAttribute("role","button"),n.setAttribute("aria-label",r.i18n("core.play")),[h,p].forEach(t=>r.once(t,(function(){n.removeAttribute("tabindex"),n.removeAttribute("role"),n.removeAttribute("aria-label")}))),n}function we(t){const e=Se(t);return e.removeAttribute("tabindex"),e}function De(t){const e=t.querySelector(".fp-zone-seconds");e&&(e.innerText="")}function Re(){}document.addEventListener(i,(function(t){this.active_menu&&!this.active_menu.contains(t.target)&&(Array.from(document.querySelectorAll(".fp-engine")).forEach(t=>{const e=t.root.querySelector("details[open].fp-menu-container");e&&(e.open=!1,t.root.classList.toggle("has-menu-opened",!1))}),this.active_menu=void 0)}));const Oe={passive:!0};var Ce;function Ie(t,e){let r=0,n=-1,i=-1;const a=Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5),s=t.classList;t.id=a,s.remove(Ce.GRABBING),s.remove(Ce.TOUCHING);const o=e.onseek||Re,u=e.onstart||Re,c=e.onend||Re,d=e.onmouse||Re,f=e.ontouch||Re,h=e.ontouchend||Re;function p(e){!function(){const e=t.getBoundingClientRect();r=e.left,n=e.width}();let i=(function(t){return"function"==typeof window.TouchEvent&&t instanceof TouchEvent}(e)?e.changedTouches[0].pageX:e.pageX)-r;return i>n&&(i=n),i<0&&(i=0),i/n*100}function v(e){const r=p(e);r!=i&&(o(t,r),i=r)}return t.addEventListener("touchstart",(function(e){xe(t,e)&&(s.add(Ce.TOUCHING),Pe(t.parentElement)&&(e.preventDefault(),s.add(Ce.GRABBING),f(t,p(e)),u(t,p(e)),v(e)))}),Oe),t.addEventListener("touchmove",(function(e){e.preventDefault(),v(e),d(t,p(e))}),Oe),t.addEventListener(l,(function(e){setTimeout((function(){s.remove(Ce.TOUCHING)}),500),xe(t,e)&&(e.preventDefault(),s.remove(Ce.GRABBING),h(t,p(e)),c(t,p(e)),n=0)}),Oe),t.addEventListener("touchcancel",(function(){s.remove(Ce.GRABBING,Ce.TOUCHING),n=0}),Oe),t.addEventListener("mousedown",(function(e){s.contains(Ce.TOUCHING)||(document.addEventListener("mousemove",v),s.add(Ce.GRABBING),u(t,p(e)),e.preventDefault(),v(e))})),t.addEventListener("mousemove",(function(e){s.contains(Ce.TOUCHING)||d(t,p(e))})),document.addEventListener("mouseup",(function(e){s.contains(Ce.TOUCHING)||(document.removeEventListener("mousemove",v),s.contains(Ce.GRABBING)&&(s.remove(Ce.GRABBING),c(t,p(e)),n=0))})),t}function xe(t,e){const r=e.target;return!!r&&(r&&!r.closest(t.id)||!Pe(t.parentElement)||!t.classList.contains(Ce.TOUCHING))}function Pe(t){if(!t)return!1;const e=window.getComputedStyle(t);return"0"!==e.width&&"0"!==e.height&&"0"!==e.opacity&&"none"!==e.display&&"hidden"!==e.visibility}!function(t){t.GRABBING="has-grab",t.TOUCHING="has-touch"}(Ce||(Ce={}));function Me(t){if("object"!=typeof t.opts)return{head:0,tail:0};if(0==t.seekable.length)return{head:0,tail:0};const e=t.opt("live_dvr_window",0),r=t.seekable.end(t.seekable.length-1);return{head:r,tail:Math.max(t.seekable.start(0),r-e)}}function Fe(t){return t.opt("live",!1)||t.duration>=Number.MAX_SAFE_INTEGER}function Ne(t){return isFinite(t.duration)?t.duration:0==t.seekable.length?0:t.seekable.end(0)}function Ue(t){return function(t){return Me(t).head}(t)-.5}function Be(t,e){if(!t.parentElement)return;const r=t.clientWidth/t.parentElement.clientWidth*100/2;t.style.left=e-r+"%",t.style.display="block"}function je(t,e){if(isNaN(t.duration))return;const r=t.buffered;r.length&&(e.style.width=Math.min(r.end(r.length-1)/t.duration*100,100)+"%")}function Ge(t,e){t.style.width="0",e.style.width="0",e.style.display="none"}function He(t,e,r){if(e.seeking||!e.seekable||0==e.seekable.length)return;const n=Ke(e,t/100);Be(r,t);const i=isFinite(e.duration)?n:e.seekable.start(0)+n;r.innerText=rt(i)}function Ke(t,e){if(e>1||e<0)return console.warn("cannot calculate a percent outside of range(0..1)"),0;if(isFinite(t.duration))return Ne(t)*e;const r=t.seekable.start(0);return r+e*(t.seekable.end(0)-r)}function Ve(t,e){t.style.width="0",e.style.display="none"}const We=requestAnimationFrame;function qe(t,e,r){const n=$("fp-controls","fp-togglable"),a=$("fp-timeline","fp-bar"),s=$("fp-btns","fp-small-switch"),o=$("fp-live-status"),l=$("fp-live-indicator","fp-color"),c=$("fp-live-text"),f=$("fp-buffer"),p=$("fp-progress","fp-color"),v=$("fp-hover"),m=$("fp-timestamp"),y=$("fp-duration"),E=$("fp-dragger","fp-color"),T=document.createElement("span");c.innerHTML="live",m.style.display="none",T.classList.add("fp-elapsed"),T.innerText=rt(0),a.setAttribute("role","slider"),a.setAttribute("tabindex","0"),a.setAttribute("aria-label",r.i18n("timeline","Timeline")),a.append(f,p,v,m),n.append(s,o,T,a,y),o.append(l,c);const _=Se(_e);_.setAttribute("role","button");const b=Se(Te);b.setAttribute("role","button"),_.addEventListener("click",(function(){r.togglePlay(),setTimeout((function(){b.focus&&b.focus()}),100)})),b.addEventListener("click",(function(){r.togglePlay(),setTimeout((function(){_.focus&&_.focus()}),100)})),s.append(_,b),p.append(E),o.addEventListener(i,(function(){!function(t,e){try{if(!t.hasState("is-live-seeked"))return;t.dvr_offset=0;const r=Ue(t);t.currentTime=r,t.setState("is-live-seeked",!1),e.style.width="0"}catch(t){console.warn("failed to seek to now: %j",t)}}(r,p)})),r.on(g,(function(e){if(0==r.reaper)return;if(!e.data)return;t.seekable=void 0===e.data.seekable||e.data.seekable;const n=Fe(r)?NaN:e.data.duration||0;if(isNaN(n)||n>=Number.MAX_SAFE_INTEGER)return y.style.display="none";y.style.display="inline-block",y.innerText=rt(n)}));let S=performance.now();const L=()=>{if(0==r.reaper||t.live)return;const e=performance.now();var n;e-S>1e3/30&&(n=r,p.style.width=n.currentTime/n.duration*100+"%",S=e),r.paused||a.classList.contains(Ce.GRABBING)||We(L)};r.on(h,()=>We(L)),r.on("timeupdate",(function(){var e;0!=r.reaper&&(We(L),a.setAttribute("aria-valuenow",r.currentTime+""),t.live?function(t,e){e.innerText=rt(t.currentTime)}(r,T):(e=r,T.innerText=rt(e.currentTime)),t.live||je(r,f),t.live&&function(t){return!("dvr"in t)||1==t.dvr}(t)&&function(t,e){if(0==e)return!0;const r=Me(t);return r.head-r.tail>=e}(r,t.seconds_to_dvr||0)&&r.setOpts({dvr:r.seekable.length>0}))})),r.on("progress",(function(){0!=r.reaper&&(t.live||je(r,f))})),r.on("live",(function(){r.setState("is-live-seeked",!1),p.style.width="0%"})),r.on("dvr",(function(){const t=Ne(r),e=r.seekable.end(0)-r.seekable.start(0),n=(t-r.currentTime)/e*100,i=Math.round(n);r.setState("is-live-seeked",i>0),p.style.width=i+"%"})),r.on("seeking",(function(){if(!Fe(r))return;if(0==r.seekable.length||0==r.played.length)return;if(0==Ne(r))return;const t=Ue(r),e=r.currentTime>=t?"live":"dvr";r.emit(e)})),r.on(d,(function(){var e,n;0!=r.reaper&&(r.setOpts({live:Fe(r)}),t.live||(n=y,(e=r).duration&&(n.innerText=rt(e.duration)),je(r,f)))})),r.on("durationchange",(function(t){if(0==r.reaper)return;const e=Fe(r),n=e?Ne(r):t.data||r.duration;isNaN(n)||(r.setOpts({live:e,duration:n}),a.setAttribute("aria-valuemax",n+""),a.setAttribute("aria-valuemin","0"))}));let k=!1;return Ie(a,{onseek:function(e,n){if(Ye(r))switch(!!t.live){case!0:He(n,r,m);break;case!1:!function(t,e,r){const n=e.duration*(t/100);if(e.disabled&&n>e.currentTime)return!1;r.style.width=t+"%",e.currentTime=n}(n,r,p),Be(m,n)}},onstart:function(){Ye(r)&&(r.emit("timeline/gesture/start"),r.setState(A,!0),t.live||function(t){!function(t){t.style.display="block"}(t)}(m))},onend:function(e,n){We(L),0!=t.seekable&&(r.setState(A,!1),t.live&&function(t,e){t/=100,e.currentTime=Ke(e,t)}(n,r))},ontouch:function(){r.paused||(k=!0,r.pause())},ontouchend:function(){k&&(k=!1,r.play()),t.live?Ve(v,m):Ge(v,m)},onmouse:function(e,n){if(Ye(r)&&!a.classList.contains(Ce.GRABBING))switch(r.emit("timeline/gesture/move",{percent:n}),!!t.live){case!0:!function(t,e){e.style.width=function(t){return 100-t}(t)+"%"}(n,v),He(n,r,m);break;case!1:!function(t,e){e.style.width=t+"%"}(n,v),function(t,e,r){if(isNaN(t)||isNaN(e.duration))return;Be(r,t),r.innerHTML="";const n=document.createElement("span");n.innerText=rt(t/100*e.duration),r.append(n)}(n,r,m)}}}),a.addEventListener(u,(function(){r.emit("timeline/gesture/end"),t.live?Ve(v,m):Ge(v,m)})),n}function Ye(t){return 0!=t.opt("opts.seekable",!0)&&!isNaN(t.duration)}function ze(t){try{return localStorage.getItem(t)}catch(t){return null}}function Xe(t,e){try{localStorage.setItem(t,e)}catch(t){}}function Qe(t,e,n){const a=document.createElement("div");a.className="fp-volumebtn",a.append(Se(Ee)),n.append(a),a.addEventListener(i,(function(){e.toggleMute()}));const s=!r().ios&&function(t){const e=function(t,e){const r=document.createElement("div");r.className="fp-volume";const n=t.classList;let i=10;n.contains("is-small")&&(i=8);n.contains("is-tiny")&&(i=6);const a=Array.from({length:i}).map(()=>{const t=document.createElement("i");return t.className="fp-tick",t});return r.append(...a),Ie(r,{onseek:e})}(t.root,(r,n)=>{n>0&&(t.muted=!1,function(t){try{localStorage.removeItem(t)}catch(t){}}("mute")),Xe("volume",(t.volume=n/100).toString()),Je(e,t.volume)});return e.setAttribute("tabindex","0"),e.setAttribute("role","slider"),e.setAttribute("aria-valuemin","0"),e.setAttribute("aria-valuemax","1"),e.setAttribute("aria-label",t.i18n("core.volume","volume")),e}(e);s&&n.append(s),e.on("volumechange",(function(){const t=0==e.volume||e.muted;e.setState("is-muted",t),Xe("mute",t.toString()),a.setAttribute("aria-label",t?e.i18n("unmute","unmute"):e.i18n("mute","mute")),s&&(t&&Je(s,0),s.classList.contains(Ce.GRABBING)||Je(s,e.volume))})),"true"==ze("mute")&&(e.muted=!0,e.setState("is-muted",e.muted));const o=ze("volume");o&&!isNaN(Number(o))&&(e.volume=Number(o)),e.emit("volumechange")}function Je(t,e){t.setAttribute("aria-valuenow",e.toString());const r=Array.from(t.querySelectorAll(".fp-tick")),n=Math.round(e*r.length);r.forEach((t,e)=>{t.classList.toggle("fp-color",e<n)})}function Ze(){return"https:"===location.protocol}function $e(t){const e=document.createElement("a");return e.href=t,e}const tr={"-1":"an unknown error occurred",1:"media playback was aborted",2:"a network error occurred",3:"unable to decode media content",4:"unsupported media type",1001:"cannot load insecure content in a secure context",1002:"no internet connection detected"};function er(){return!0===(navigator||{}).onLine}function rr(t,e,r){r.on(n,(function(t){const e=t.data||r.error||new Error,n=t.code||e.code,i="Error: %s\n"+(null===(a=(new Error).stack)||void 0===a?void 0:a.split("\n").slice(2).join("\n"));var a;setTimeout((function(){if(t.defaultPrevented)return;if("AbortError"==e.name)return;r.setState("is-error",!0),8===n||e.fatal||function(t){const e=t.togglePlay,r=t.root;t.togglePlay=Re,t.once("recover",(function(){t.togglePlay=e,t.setState("is-error",!1);const n=r.querySelector(".fp-error");n&&n.remove()}))}(r);const a=function(t,e,r){switch(e){case"http:0":return function(t){return function(t){try{return Ze()&&"http:"==$e(t).protocol}catch(t){return!1}}(t.original_src)?{code:1001}:er()?{code:2}:er()?{code:-1}:{code:1002}}(t);case 4:return t.once("loadstart",(function(){t.emit("recover")})),r;default:return r}}(r,n,e),s=function(t,e){if(e.message)return e.message;if(e.stack)return e.stack;const r=(e.code||-1).toString();return t.i18n("media_errors."+r,tr[r]||tr[-1])}(r,a);console.error(i,s);const o=r.reaper&&r.reaper.get("ui");return o&&function(t,e,r,n){if(!t)return;const i=document.createElement("div");if(i.classList.add("fp-error"),i.innerText=e,n){const e=t.querySelector("#"+n);e&&t.removeChild(e),i.id=n}if(t.append(i),r){const t=document.createElement("div");t.classList.add("fp-error-details"),t.innerText=r,i.append(t)}}(o,s,e.details)}))}))}function nr(t,e,r){if(!r.reaper)return;const n=document.createDocumentFragment(),i=$("fp-ui");n.appendChild(i),r.reaper.set("ui",i),~e.className.indexOf("use-play-")||e.classList.add("use-play-1"),function(t,e,r){const n=$("fp-footer");e.append(n),r.on(g,(function(t){var e,r;const i=null===(e=t.data)||void 0===e?void 0:e.description,a=null===(r=t.data)||void 0===r?void 0:r.title;if(n.innerHTML="","string"==typeof a){const t=$("fp-title");t.innerText=a,n.append(t)}if("string"==typeof i){const t=i.split(" "),e=$("fp-desc");for(e.innerText=t.join(" "),n.append(e);t.length>1&&e.scrollHeight>e.offsetHeight;)t.pop(),e.innerText=t.join(" ")+"..."}}))}(0,e,r),Ae(t,i,r),ke(0,i,r);const a=qe(t,0,r);i.append(a),Qe(0,r,a),rr(0,0,r),e.appendChild(n),[o,u].forEach(t=>{e.addEventListener(t,(function(t){r.setState("is-hovered",t.type==o),r.setState("is-accessibility",!1)}))}),r.on(g,(function(t){var r;const n=null===(r=t.data)||void 0===r?void 0:r.ui;if("number"!=typeof n)return;const i=e.classList;i.toggle("use-play-1",!(32&n||64&n)),i.toggle("use-play-2",(32&n)>0),i.toggle("use-play-3",(64&n)>0),i.toggle("use-thin-controlbar",(128&n)>0),i.toggle("no-title",(256&n)>0),i.toggle("no-description",(512&n)>0),i.toggle("logo-on-right",(8&n)>0),i.toggle("use-drag-handle",(16&n)>0),i.toggle("no-controls",(1024&n)>0),i.toggle("no-duration",(2048&n)>0),i.toggle("no-header",(4096&n)>0),i.toggle("no-mute",(4&n)>0),i.toggle("no-volume",(2&n)>0),i.toggle("no-fullscreen",(1&n)>0),i.toggle("no-touch-zones",(16384&n)>0)}));let s=null;i.addEventListener("mousemove",(function(){"number"==typeof s&&clearTimeout(s),r.setState("is-hovered",!0),s=0==r.paused&&setTimeout((function(){r.setState("is-hovered",!1)}),2e3)}))}function ir(t,e,r){if(wt.from_token(t.token||"").is_granted(wt.permissions.NO_METERING))return;const n=At.id(t.token||"");n&&r.once(h,()=>function(t,e){fetch("https://pmi.flowplayer.com/in",{method:"POST",body:JSON.stringify({token_id:e,factor:1,rnd:Math.random().toString(36).substring(2)})}).then(e=>{401==e.status&&t.emit("error:fatal",{reason:"token",details:"The token online validation failed"})})}(r,n))}var ar={ads:{ad:"Ad",ads:"Ads",advertisement:"Advertisement"},audio:{button_txt:"Audio",menu_title:"Audio"},core:{exit_fullscreen:"Exit fullscreen",fullscreen:"Fullscreen",mute:"Mute",pause:"Pause",play:"Play",unmute:"Unmute",volume:"Volume"},ovp:{starting_in:"Countdown"},playlist:{cancel:"Cancel",up_next:"Up next"},qsel:{menu_title:"Quality"},share:{clipboard_failure:"Access to clipboard failed",clipboard_success:"The text is now on your clipboard",embed:"Embed",link:"Link",menu_title:"Share"},speed:{menu_title:"Speed"}};class sr{init(t,e,r){r.reaper&&r.reaper.set("translations",it(sr,t,"en"))}}sr.en=ar;const or=Date.now(),ur={session_id:Math.random().toString(36).substring(2)+performance.now().toString(36)};class lr{constructor(){this._summary={},this._session_id=ur,this.start_time=or}increment(t,e){if("string"!=typeof t||"number"!=typeof e)return;const r=this._summary[t]||0;this._summary[t]=r+e}set(t,e){"string"==typeof t&&(this._summary[t]=e)}duration(){return Date.now()-this.start_time}summary(t){return Object.assign("object"==typeof t?t:{},{event:"health_summary"},this._summary,this._session_id,{duration:this.duration()})}sessionize(t){return Object.assign(t,this._session_id)}}function cr(t,e){return function(t,e){return"function"==typeof navigator.sendBeacon&&navigator.sendBeacon(t,e)}(t,JSON.stringify({events:e}))}class dr{constructor(t){this.middleware=t,this._pending=[]}pending(){return this._pending}_run_middleware(t,e){return t=Object.assign({},t),this.middleware.forEach((function(r){const n=r(e);if("object"==typeof n)return Object.assign(t,n);console.warn("KPI::middleware did not return an Object\nreturn: %o\n\nfn: %s",n,r)})),t}push(t,e){t=this._run_middleware(t,e),this.push_finalized(t)}push_finalized(t){this._pending.push(t),this.send()}send(t){if(this._pending.length<20&&!t)return;const e=this._pending.slice(0);this._pending.length=0,cr("https://health.flowplayer.com/v1/health/events",e)}}function fr(){return tt(window,"navigator.connection.downlink")}function hr(t){const e=t.hls;if(!e)return;const r=e.abrController._bwEstimator;return r?.001*r.getEstimate():void 0}function pr(t){const e=[hr,fr];for(;e.length;){const r=e.shift(),n="function"==typeof r&&r(t);if("number"==typeof n)return{downlink_mbs:Number(n.toFixed(2))}}return{}}const vr=document.createElement("a");function gr(t){const e=t.original_src;return"string"!=typeof e?{}:(vr.href=e,"string"==typeof vr.pathname?{media_type:vr.pathname.split(".").pop()}:{})}function mr(t){return{preload:t.opt("preload"),autoplay:t.opt("autoplay",t.autoplay)}}function yr(t){return{player_id:t.opt("metadata.player_id"),media_id:t.opt("metadata.media_id"),site_id:t.opt("metadata.site_id"),category_id:t.opt("metadata.category_id"),sitegroup_id:t.opt("metadata.sitegroup_id"),token:t.token}}function Er(){return{timestamp:Date.now()}}function Tr(){return{ua:navigator.userAgent,version:"3.0.0-rc6",commit:"6d66ffa737639c623b6ecccdefd3d118199516a8"}}const _r=[n,"rebuffer"],br=_r.concat([s,"loadstart",d,f,"error:fatal",h,p,"quality:set","pause","ended","seeking"]);function Sr(t,e,r){t.push_finalized(Object.assign(e.summary({}),mr(r),yr(r),Er(),Tr())),t.send(!0)}function Ar(t){try{return!!new URL(t)}catch(t){return!1}}pt(window,"flowplayer:umd",(function(t){const e=t.data;e&&window.addEventListener("unload",(function(){e.instances.forEach(t=>t.emit("unload"))}))}));class Lr{init(t,e,r){if(r._health)return;const n=r._health=new lr,i=r._kpis=new dr([gr,mr,yr,pr,Er,Tr]);_r.forEach(t=>{n.set(t,0)}),function(t){t.on("waiting",(function(e){t.seeking||t.networkState===t.NETWORK_LOADING&&t.readyState!==t.HAVE_NOTHING&&t.emit("rebuffer")}))}(r),r.on(v,(function(){i.send(),r._kpis=r._health=void 0})),r.on("health:summary:increment",(function(t){t.data&&Object.keys(t.data).forEach((function(e){t.data&&n.increment(e,t.data[e])}))})),r.on("health:summary:set",(function(t){t.data&&Object.keys(t.data).forEach((function(e){t.data&&n.set(e,t.data[e])}))})),r.on(_r,(function(t){setTimeout(()=>{t.defaultPrevented||r.emit("health:summary:increment",{[t.type]:1})})})),r.on(br,(function(t){setTimeout(()=>{t.defaultPrevented||r.emit("health:kpi:track",{event:t.type})},0)})),r.on("health:kpi:track",(function(t){if(!t.data)return;const e=n.sessionize(t.data);i.push(e,r)})),r.on("src",(function(t){const e=t.data&&t.data.src;"string"==typeof e&&Ar(r.original_src)&&Ar(e)&&e!=r.original_src&&Sr(i,n,r)})),r.on("unload",(function(){Sr(i,n,r)}))}}Et(window,Lr);Ut.extensions.unshift.apply(Ut.extensions,[sr,de,Lr,class{init(t,e,r){ir(t,0,r),nr(t,e,r),fe(0,e,r)}}]);var kr=Object.assign(Ut,{ui:Le,i18n:sr}),wr=jt(Gt((function(t,e){var r;"undefined"!=typeof window&&(r=function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="/dist/",r(r.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":
16
16
  /*!*********************************************!*\
17
17
  !*** ./node_modules/eventemitter3/index.js ***!
18
18
  \*********************************************/
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flowplayer/player",
3
- "version": "3.0.1-canary.48",
3
+ "version": "3.0.1-canary.49",
4
4
  "description": "video player for the future",
5
5
  "license": "https://flowplayer.com/commercial-license",
6
6
  "main": "default.js",
package/plugins/health.js CHANGED
@@ -1 +1 @@
1
- !function(t,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):((t="undefined"!=typeof globalThis?globalThis:t||self).flowplayer=t.flowplayer||{},t.flowplayer.health=n())}(this,(function(){"use strict";const t=Date.now(),n={session_id:Math.random().toString(36).substring(2)+performance.now().toString(36)};class e{constructor(){this._summary={},this._session_id=n,this.start_time=t}increment(t,n){if("string"!=typeof t||"number"!=typeof n)return;const e=this._summary[t]||0;this._summary[t]=e+n}set(t,n){"string"==typeof t&&(this._summary[t]=n)}duration(){return Date.now()-this.start_time}summary(t){return Object.assign("object"==typeof t?t:{},{event:"health_summary"},this._summary,this._session_id,{duration:this.duration()})}sessionize(t){return Object.assign(t,this._session_id)}}function i(t,n){return function(t,n){return"function"==typeof navigator.sendBeacon&&navigator.sendBeacon(t,n)}(t,JSON.stringify({events:n}))}class o{constructor(t){this.middleware=t,this._pending=[]}pending(){return this._pending}_run_middleware(t,n){return t=Object.assign({},t),this.middleware.forEach((function(e){const i=e(n);if("object"==typeof i)return Object.assign(t,i);console.warn("KPI::middleware did not return an Object\nreturn: %o\n\nfn: %s",i,e)})),t}push(t,n){t=this._run_middleware(t,n),this.push_finalized(t)}push_finalized(t){this._pending.push(t),this.send()}send(t){if(this._pending.length<20&&!t)return;const n=this._pending.slice(0);this._pending.length=0,i("https://health.flowplayer.com/v1/health/events",n)}}function r(t,n,e){const i=function(t){return Array.isArray(t)?t.slice(0):t.split(".")}(n);for(;i.length;){if(null==t)return e;const n=i.shift();if("string"!=typeof n)return e;t=t[n]}return null==t?e:t}function s(){return r(window,"navigator.connection.downlink")}function a(t){const n=t.hls;if(!n)return;const e=n.abrController._bwEstimator;return e?.001*e.getEstimate():void 0}function u(t){const n=[a,s];for(;n.length;){const e=n.shift(),i="function"==typeof e&&e(t);if("number"==typeof i)return{downlink_mbs:Number(i.toFixed(2))}}return{}}const c=document.createElement("a");function d(t){const n=t.original_src;return"string"!=typeof n?{}:(c.href=n,"string"==typeof c.pathname?{media_type:c.pathname.split(".").pop()}:{})}function f(t){return{preload:t.opt("preload"),autoplay:t.opt("autoplay",t.autoplay)}}function l(t){return{player_id:t.opt("metadata.player_id"),media_id:t.opt("metadata.media_id"),site_id:t.opt("metadata.site_id"),category_id:t.opt("metadata.category_id"),sitegroup_id:t.opt("metadata.sitegroup_id"),token:t.token}}function p(){return{timestamp:Date.now()}}function h(){return{ua:navigator.userAgent,version:"3.0.0-rc6",commit:"3ff5575be008bca83fb98f88bd7b5012f71fbe28"}}!function(){let t=!1;try{const n=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("testPassive",null,n),window.removeEventListener("testPassive",null,n)}catch(t){}}();const m=["touchstart","touchmove"];function y(t,n,e,i){if(o=n,!~m.indexOf(o))return t.addEventListener(n,e,i),t;var o;const r=Object.assign(i||{},{passive:!0});return t.addEventListener(n,e,r),t}const _=["error","rebuffer"],g=_.concat(["load","loadstart","loadedmetadata","loadeddata","error:fatal","playing","seeked","quality:set","pause","ended","seeking"]);function w(t,n,e){t.push_finalized(Object.assign(n.summary({}),f(e),l(e),p(),h())),t.send(!0)}function b(t){try{return!!new URL(t)}catch(t){return!1}}var v;(function(t,n,e,i){Array.isArray(n)?n.forEach(n=>y(t,n,e,i)):y(t,n,e,i)})(window,"flowplayer:umd",(function(t){const n=t.data;n&&window.addEventListener("unload",(function(){n.instances.forEach(t=>t.emit("unload"))}))}),Object.assign(v||{},{once:!0}));class O{init(t,n,i){if(i._health)return;const r=i._health=new e,s=i._kpis=new o([d,f,l,u,p,h]);_.forEach(t=>{r.set(t,0)}),function(t){t.on("waiting",(function(n){t.seeking||t.networkState===t.NETWORK_LOADING&&t.readyState!==t.HAVE_NOTHING&&t.emit("rebuffer")}))}(i),i.on("reap",(function(){s.send(),i._kpis=i._health=void 0})),i.on("health:summary:increment",(function(t){t.data&&Object.keys(t.data).forEach((function(n){t.data&&r.increment(n,t.data[n])}))})),i.on("health:summary:set",(function(t){t.data&&Object.keys(t.data).forEach((function(n){t.data&&r.set(n,t.data[n])}))})),i.on(_,(function(t){setTimeout(()=>{t.defaultPrevented||i.emit("health:summary:increment",{[t.type]:1})})})),i.on(g,(function(t){setTimeout(()=>{t.defaultPrevented||i.emit("health:kpi:track",{event:t.type})},0)})),i.on("health:kpi:track",(function(t){if(!t.data)return;const n=r.sessionize(t.data);s.push(n,i)})),i.on("src",(function(t){const n=t.data&&t.data.src;"string"==typeof n&&b(i.original_src)&&b(n)&&n!=i.original_src&&w(s,r,i)})),i.on("unload",(function(){w(s,r,i)}))}}return function(t,n){if("object"==typeof exports&&"undefined"!=typeof module)return n;"flowplayer"in t||(t.flowplayer={extensions:[]});const e=t.flowplayer;"function"==typeof e?e(n):(Array.isArray(e.extensions)||(e.extensions=[]),~e.extensions.indexOf(n)||e.extensions.push(n))}(window,O),O}));
1
+ !function(t,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):((t="undefined"!=typeof globalThis?globalThis:t||self).flowplayer=t.flowplayer||{},t.flowplayer.health=n())}(this,(function(){"use strict";const t=Date.now(),n={session_id:Math.random().toString(36).substring(2)+performance.now().toString(36)};class e{constructor(){this._summary={},this._session_id=n,this.start_time=t}increment(t,n){if("string"!=typeof t||"number"!=typeof n)return;const e=this._summary[t]||0;this._summary[t]=e+n}set(t,n){"string"==typeof t&&(this._summary[t]=n)}duration(){return Date.now()-this.start_time}summary(t){return Object.assign("object"==typeof t?t:{},{event:"health_summary"},this._summary,this._session_id,{duration:this.duration()})}sessionize(t){return Object.assign(t,this._session_id)}}function i(t,n){return function(t,n){return"function"==typeof navigator.sendBeacon&&navigator.sendBeacon(t,n)}(t,JSON.stringify({events:n}))}class o{constructor(t){this.middleware=t,this._pending=[]}pending(){return this._pending}_run_middleware(t,n){return t=Object.assign({},t),this.middleware.forEach((function(e){const i=e(n);if("object"==typeof i)return Object.assign(t,i);console.warn("KPI::middleware did not return an Object\nreturn: %o\n\nfn: %s",i,e)})),t}push(t,n){t=this._run_middleware(t,n),this.push_finalized(t)}push_finalized(t){this._pending.push(t),this.send()}send(t){if(this._pending.length<20&&!t)return;const n=this._pending.slice(0);this._pending.length=0,i("https://health.flowplayer.com/v1/health/events",n)}}function r(t,n,e){const i=function(t){return Array.isArray(t)?t.slice(0):t.split(".")}(n);for(;i.length;){if(null==t)return e;const n=i.shift();if("string"!=typeof n)return e;t=t[n]}return null==t?e:t}function a(){return r(window,"navigator.connection.downlink")}function s(t){const n=t.hls;if(!n)return;const e=n.abrController._bwEstimator;return e?.001*e.getEstimate():void 0}function u(t){const n=[s,a];for(;n.length;){const e=n.shift(),i="function"==typeof e&&e(t);if("number"==typeof i)return{downlink_mbs:Number(i.toFixed(2))}}return{}}const c=document.createElement("a");function d(t){const n=t.original_src;return"string"!=typeof n?{}:(c.href=n,"string"==typeof c.pathname?{media_type:c.pathname.split(".").pop()}:{})}function f(t){return{preload:t.opt("preload"),autoplay:t.opt("autoplay",t.autoplay)}}function l(t){return{player_id:t.opt("metadata.player_id"),media_id:t.opt("metadata.media_id"),site_id:t.opt("metadata.site_id"),category_id:t.opt("metadata.category_id"),sitegroup_id:t.opt("metadata.sitegroup_id"),token:t.token}}function p(){return{timestamp:Date.now()}}function h(){return{ua:navigator.userAgent,version:"3.0.0-rc6",commit:"6d66ffa737639c623b6ecccdefd3d118199516a8"}}!function(){let t=!1;try{const n=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("testPassive",null,n),window.removeEventListener("testPassive",null,n)}catch(t){}}();const m=["touchstart","touchmove"];function y(t,n,e,i){if(o=n,!~m.indexOf(o))return t.addEventListener(n,e,i),t;var o;const r=Object.assign(i||{},{passive:!0});return t.addEventListener(n,e,r),t}const _=["error","rebuffer"],g=_.concat(["load","loadstart","loadedmetadata","loadeddata","error:fatal","playing","seeked","quality:set","pause","ended","seeking"]);function w(t,n,e){t.push_finalized(Object.assign(n.summary({}),f(e),l(e),p(),h())),t.send(!0)}function b(t){try{return!!new URL(t)}catch(t){return!1}}var v;(function(t,n,e,i){Array.isArray(n)?n.forEach(n=>y(t,n,e,i)):y(t,n,e,i)})(window,"flowplayer:umd",(function(t){const n=t.data;n&&window.addEventListener("unload",(function(){n.instances.forEach(t=>t.emit("unload"))}))}),Object.assign(v||{},{once:!0}));class O{init(t,n,i){if(i._health)return;const r=i._health=new e,a=i._kpis=new o([d,f,l,u,p,h]);_.forEach(t=>{r.set(t,0)}),function(t){t.on("waiting",(function(n){t.seeking||t.networkState===t.NETWORK_LOADING&&t.readyState!==t.HAVE_NOTHING&&t.emit("rebuffer")}))}(i),i.on("reap",(function(){a.send(),i._kpis=i._health=void 0})),i.on("health:summary:increment",(function(t){t.data&&Object.keys(t.data).forEach((function(n){t.data&&r.increment(n,t.data[n])}))})),i.on("health:summary:set",(function(t){t.data&&Object.keys(t.data).forEach((function(n){t.data&&r.set(n,t.data[n])}))})),i.on(_,(function(t){setTimeout(()=>{t.defaultPrevented||i.emit("health:summary:increment",{[t.type]:1})})})),i.on(g,(function(t){setTimeout(()=>{t.defaultPrevented||i.emit("health:kpi:track",{event:t.type})},0)})),i.on("health:kpi:track",(function(t){if(!t.data)return;const n=r.sessionize(t.data);a.push(n,i)})),i.on("src",(function(t){const n=t.data&&t.data.src;"string"==typeof n&&b(i.original_src)&&b(n)&&n!=i.original_src&&w(a,r,i)})),i.on("unload",(function(){w(a,r,i)}))}}return function(t,n){if("object"==typeof exports&&"undefined"!=typeof module)return n;"flowplayer"in t||(t.flowplayer={extensions:[]});const e=t.flowplayer;"function"==typeof e?e(n):(Array.isArray(e.extensions)||(e.extensions=[]),~e.extensions.indexOf(n)||e.extensions.push(n))}(window,O),O}));
package/plugins/share.js CHANGED
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):((e="undefined"!=typeof globalThis?globalThis:e||self).flowplayer=e.flowplayer||{},e.flowplayer.share=t())}(this,(function(){"use strict";const e={name:"fp-facebook"},t={name:"fp-link"},n={name:"fp-share"},o={name:"fp-embed"},i={name:"fp-twitter"};function s(e,t,n){const o=function(e){return Array.isArray(e)?e.slice(0):e.split(".")}(t);for(;o.length;){if(null==e)return n;const t=o.shift();if("string"!=typeof t)return n;e=e[t]}return null==e?n:e}function r(){try{return(document.querySelector("meta[name='description']")||{content:""}).content}catch(e){return""}}function c(e){if("string"==typeof e.link)return e.link;const t=document.querySelector("link[rel=canonical]");return t?t.href:window.location.toString()}function a(e){const t=document.createElement("div");return t.classList.add("fp-icon",e.name),e.title&&t.setAttribute("title",e.title),e.title&&t.setAttribute("aria-label",e.title),t.setAttribute("tabindex","0"),t.setAttribute("focusable","true"),t}const l="fp-on",u="fp-invis";function d(e,t){const n=document.createElement("details"),o=document.createElement("summary"),i=document.createElement("ol"),s=document.createElement("div"),r=document.createElement("span");if(n.classList.add("fp-menu-container",u,t.class),n.setAttribute("aria-controls",t.id||Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5)),n.setAttribute("aria-label",t.menuTitle||""),t.summaryTitle&&(o.textContent=t.summaryTitle),t.summaryIcon){const e=a(t.summaryIcon);e.setAttribute("tabindex",""),o.append(e)}if(t.menuTitle){const e=document.createElement("h3");e.textContent=t.menuTitle,s.append(e)}return t.icons&&s.classList.add("fp-icons"),s.classList.add("fp-menu"),s.append(r),s.append(i),r.classList.add("fp-close"),r.innerHTML="&times;",n.append(o),n.append(s),n.addEventListener("click",(function(t){t.preventDefault(),!this.open&&document.active_menu&&h(),document.active_menu=this.open?void 0:this,this.open=!this.open,e.classList.toggle("has-menu-opened",this.open)})),i.unselectMenuOption=t.unselectMenuOption,t.options&&p(n,t.options),n}function p(e,t){const n=e.querySelector("ol");n&&(n.innerHTML="",t&&t.forEach(f,n),e.classList.toggle(u,0==(null==t?void 0:t.length)),delete n.idx)}function f(e,t){const n=document.createElement("li");n.setAttribute("tabindex","0"),n.setAttribute("role","menuitem"),e.icon&&n.append(e.icon instanceof HTMLElement?e.icon:a(e.icon));const o=document.createElement("span");o.textContent=e.text,n.append(o),n.addEventListener("click",n=>{m(this,t,!this.unselectMenuOption),"function"==typeof e.onclick&&e.onclick(n,e,t,this)}),n.idx=t,this.append(n)}function m(e,t,n){void 0===e.idx||e.idx!==t||n?e.idx=t:delete e.idx,function(e){(function(e){return Array.from(e.querySelectorAll("li"))})(e).forEach(t=>{t.classList.toggle(l,t.idx===e.idx)})}(e)}document.addEventListener("click",(function(e){this.active_menu&&!this.active_menu.contains(e.target)&&(h(),this.active_menu=void 0)}));function h(){Array.from(document.querySelectorAll(".fp-engine")).forEach(e=>{const t=e.root.querySelector("details[open].fp-menu-container");t&&(t.open=!1,e.root.classList.toggle("has-menu-opened",!1))})}class y{constructor(){this.share_options=[]}init(a,l,u){const f=d(l,{menuTitle:u.i18n("share.menu_title"),summaryIcon:n,class:"fp-share-menu",icons:!0}),m=f.querySelector(".fp-menu"),h=f.querySelector("ol");if(!m)return;if(!h)return;const y={prev_config:0,webshare_listener:0};u.on("mount",(function(){var e;l.querySelector(".fp-secondary")&&(null===(e=l.querySelector(".fp-secondary"))||void 0===e||e.append(f))})),f.addEventListener("toggle",(function(){l.classList.toggle("is-share-menu",this.open),this.open&&l.classList.contains("is-small")&&u.pause()})),u.on("config",n=>{const l=s(n,"data.share",{});if(!1===l)return void f.classList.remove("webshare-enabled");if(y.prev_config===l)return;if(y.prev_config=l,function(){try{return"https:"===window.location.protocol&&"function"==typeof navigator.share}catch(e){return!1}}()&&s(l,"web_share",!0))return function(e){e.classList.add("webshare-enabled")}(f),f.removeChild(m),y.webshare_listener||function(e,t,n){n.webshare_listener=!0,t.addEventListener("click",(function(n){if(!t.classList.contains("webshare-enabled"))return;n.preventDefault();navigator.share({title:s(e,"share.title",document.title),text:s(e,"share.text",r()),url:c(s(e,"share",{}))}).catch((function(){}))}))}(a,f,y);this.share_options=[];const d="string"==typeof l.link?l.link:window.location.toString();if(l.iframe){const e="string"==typeof l.iframe?l.iframe:d;this.share_options.push(b(u,h,"share.embed",v.bind(null,e,u),o))}l.link&&this.share_options.push(b(u,h,"share.link",w.bind(null,d),t)),l.facebook&&this.share_options.push(b(u,h,"Facebook",x.bind(null,d),e)),l.twitter&&this.share_options.push(b(u,h,"Twitter",A.bind(null,d),i)),p(f,this.share_options)})}add_option(e,t){const n=e.root.querySelector(".fp-menu-container.fp-share-menu"),o=null==n?void 0:n.querySelector("ol");o&&n&&(this.share_options.push(b(e,o,t.text,t.onClick,t.icon)),p(n,this.share_options))}}function b(e,t,n,o,i){return{text:_(e,n),icon:i,onclick:g.bind(null,e,t,o)}}function _(e,t){return 0===t.indexOf("share.")?e.i18n(t):t}function g(e,t,n){!function(e){m(e,e.idx)}(t);const o=n();o.success&&o.message&&e.message&&e.emit(e.message.events.SHOW_MESSAGE,{message:o.message})}function v(e,t){const n=t.videoHeight/t.videoWidth;return w('<div style="position:relative;width:100%;display:inline-block;"><iframe src="__IFRAME_SRC__" allowfullscreen style="border:none;position:absolute;top:0;left:0;width:100%;height:100%;"></iframe><div style="padding-top: __RATIO__%;"></div></div>'.replace("__IFRAME_SRC__",encodeURI(e)).replace("__RATIO__",""+100*n))}function w(e){const t=document.createElement("textarea");t.setAttribute("style","position:absolute;opacity:0"),t.value=e;const n=document.body;n.append(t),t.select();const o=document.execCommand("copy");return n.removeChild(t),{success:o,message:o?"<trans share.clipboard_success trans>":"<trans share.clipboard_failure trans>"}}function x(e){return E("https://www.facebook.com/sharer.php?u="+encodeURIComponent(e)),{success:!0}}function A(e){return E("https://twitter.com/intent/tweet?url="+encodeURIComponent(e)),{success:!0}}function E(e){let t;const n=screen.height,o=screen.width,i=Math.round(o/2-275);t=0,n>420&&(t=Math.round(n/2-210)),window.open(e,"sharer","scrollbars=yes,resizable=yes,toolbar=no,location=yes,width=550,height=420,left="+i+",top="+t)}return y.SHARE_MENU_ACTIVE_CLASS="is-share-menu",function(e,t){if("object"==typeof exports&&"undefined"!=typeof module)return t;"flowplayer"in e||(e.flowplayer={extensions:[]});const n=e.flowplayer;"function"==typeof n?n(t):(Array.isArray(n.extensions)||(n.extensions=[]),~n.extensions.indexOf(t)||n.extensions.push(t))}(window,y),y}));
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):((e="undefined"!=typeof globalThis?globalThis:e||self).flowplayer=e.flowplayer||{},e.flowplayer.share=t())}(this,(function(){"use strict";const e={name:"fp-facebook"},t={name:"fp-link"},n={name:"fp-share"},o={name:"fp-embed"},i={name:"fp-twitter"};function s(e,t,n){const o=function(e){return Array.isArray(e)?e.slice(0):e.split(".")}(t);for(;o.length;){if(null==e)return n;const t=o.shift();if("string"!=typeof t)return n;e=e[t]}return null==e?n:e}function r(){try{return(document.querySelector("meta[name='description']")||{content:""}).content}catch(e){return""}}function c(e){if("string"==typeof e.link)return e.link;const t=document.querySelector("link[rel=canonical]");return t?t.href:window.location.toString()}function a(e){const t=document.createElement("div");return t.classList.add("fp-icon",e.name),e.title&&t.setAttribute("title",e.title),e.title&&t.setAttribute("aria-label",e.title),t.setAttribute("tabindex","0"),t.setAttribute("focusable","true"),t}const l="fp-on",u="fp-invis";function d(e,t){const n=document.createElement("details"),o=document.createElement("summary"),i=document.createElement("ol"),s=document.createElement("div"),r=document.createElement("span");if(n.classList.add("fp-menu-container",u,t.class),n.setAttribute("aria-controls",t.id||Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5)),n.setAttribute("aria-label",t.menuTitle||""),t.summaryTitle&&(o.textContent=t.summaryTitle),t.summaryIcon){const e=a(t.summaryIcon);e.setAttribute("tabindex",""),o.append(e)}if(t.menuTitle){const e=document.createElement("h3");e.textContent=t.menuTitle,s.append(e)}return t.icons&&s.classList.add("fp-icons"),s.classList.add("fp-menu"),s.append(r),s.append(i),r.classList.add("fp-close"),r.innerHTML="&times;",n.append(o),n.append(s),n.addEventListener("click",(function(t){t.preventDefault(),!this.open&&document.active_menu&&h(),document.active_menu=this.open?void 0:this,this.open=!this.open,e.classList.toggle("has-menu-opened",this.open)})),i.unselectMenuOption=t.unselectMenuOption,t.options&&p(n,t.options),n}function p(e,t){const n=e.querySelector("ol");n&&(n.innerHTML="",t&&t.forEach(f,n),e.classList.toggle(u,0==(null==t?void 0:t.length)),delete n.idx)}function f(e,t){const n=document.createElement("li");n.setAttribute("tabindex","0"),n.setAttribute("role","menuitem"),e.icon&&n.append(e.icon instanceof HTMLElement?e.icon:a(e.icon));const o=document.createElement("span");o.textContent=e.text,n.append(o),n.addEventListener("click",n=>{m(this,t,!this.unselectMenuOption),"function"==typeof e.onclick&&e.onclick(n,e,t,this)}),n.idx=t,this.append(n)}function m(e,t,n){void 0===e.idx||e.idx!==t||n?e.idx=t:delete e.idx,function(e){(function(e){return Array.from(e.querySelectorAll("li"))})(e).forEach(t=>{t.classList.toggle(l,t.idx===e.idx)})}(e)}document.addEventListener("click",(function(e){this.active_menu&&!this.active_menu.contains(e.target)&&(h(),this.active_menu=void 0)}));function h(){Array.from(document.querySelectorAll(".fp-engine")).forEach(e=>{const t=e.root.querySelector("details[open].fp-menu-container");t&&(t.open=!1,e.root.classList.toggle("has-menu-opened",!1))})}class y{constructor(){this.share_options=[]}init(a,l,u){const f=d(l,{menuTitle:u.i18n("share.menu_title"),summaryIcon:n,class:"fp-share-menu",icons:!0}),m=f.querySelector(".fp-menu"),h=f.querySelector("ol");if(!m)return;if(!h)return;const y={prev_config:0,webshare_listener:0};u.on("mount",(function(){var e;l.querySelector(".fp-secondary")&&(null===(e=l.querySelector(".fp-secondary"))||void 0===e||e.append(f))})),f.addEventListener("toggle",(function(){l.classList.toggle("is-share-menu",this.open),this.open&&l.classList.contains("is-small")&&u.pause()})),u.on("config",n=>{const l=s(n,"data.share",{});if(!1===l)return void f.classList.remove("webshare-enabled");if(y.prev_config===l)return;if(y.prev_config=l,function(){try{return"https:"===window.location.protocol&&"function"==typeof navigator.share}catch(e){return!1}}()&&s(l,"web_share",!0))return function(e){e.classList.add("webshare-enabled")}(f),y.webshare_listener||function(e,t,n){n.webshare_listener=!0,t.addEventListener("click",(function(){if(!t.classList.contains("webshare-enabled"))return;this.open=!1;navigator.share({title:s(e,"share.title",document.title),text:s(e,"share.text",r()),url:c(s(e,"share",{}))}).catch((function(){}))}))}(a,f,y);this.share_options=[];const d="string"==typeof l.link?l.link:window.location.toString();if(l.iframe){const e="string"==typeof l.iframe?l.iframe:d;this.share_options.push(b(u,h,"share.embed",v.bind(null,e,u),o))}l.link&&this.share_options.push(b(u,h,"share.link",w.bind(null,d),t)),l.facebook&&this.share_options.push(b(u,h,"Facebook",x.bind(null,d),e)),l.twitter&&this.share_options.push(b(u,h,"Twitter",A.bind(null,d),i)),p(f,this.share_options)})}add_option(e,t){const n=e.root.querySelector(".fp-menu-container.fp-share-menu"),o=null==n?void 0:n.querySelector("ol");o&&n&&(this.share_options.push(b(e,o,t.text,t.onClick,t.icon)),p(n,this.share_options))}}function b(e,t,n,o,i){return{text:_(e,n),icon:i,onclick:g.bind(null,e,t,o)}}function _(e,t){return 0===t.indexOf("share.")?e.i18n(t):t}function g(e,t,n){!function(e){m(e,e.idx)}(t);const o=n();o.success&&o.message&&e.message&&e.emit(e.message.events.SHOW_MESSAGE,{message:o.message})}function v(e,t){const n=t.videoHeight/t.videoWidth;return w('<div style="position:relative;width:100%;display:inline-block;"><iframe src="__IFRAME_SRC__" allowfullscreen style="border:none;position:absolute;top:0;left:0;width:100%;height:100%;"></iframe><div style="padding-top: __RATIO__%;"></div></div>'.replace("__IFRAME_SRC__",encodeURI(e)).replace("__RATIO__",""+100*n))}function w(e){const t=document.createElement("textarea");t.setAttribute("style","position:absolute;opacity:0"),t.value=e;const n=document.body;n.append(t),t.select();const o=document.execCommand("copy");return n.removeChild(t),{success:o,message:o?"<trans share.clipboard_success trans>":"<trans share.clipboard_failure trans>"}}function x(e){return E("https://www.facebook.com/sharer.php?u="+encodeURIComponent(e)),{success:!0}}function A(e){return E("https://twitter.com/intent/tweet?url="+encodeURIComponent(e)),{success:!0}}function E(e){let t;const n=screen.height,o=screen.width,i=Math.round(o/2-275);t=0,n>420&&(t=Math.round(n/2-210)),window.open(e,"sharer","scrollbars=yes,resizable=yes,toolbar=no,location=yes,width=550,height=420,left="+i+",top="+t)}return y.SHARE_MENU_ACTIVE_CLASS="is-share-menu",function(e,t){if("object"==typeof exports&&"undefined"!=typeof module)return t;"flowplayer"in e||(e.flowplayer={extensions:[]});const n=e.flowplayer;"function"==typeof n?n(t):(Array.isArray(n.extensions)||(n.extensions=[]),~n.extensions.indexOf(t)||n.extensions.push(t))}(window,y),y}));