import"http://approjects.co.za/?big=videoplayer/ump.mjs";(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))o(a);new MutationObserver(a=>{for(const r of a)if(r.type==="childList")for(const n of r.addedNodes)n.tagName==="LINK"&&n.rel==="modulepreload"&&o(n)}).observe(document,{childList:!0,subtree:!0});function s(a){const r={};return a.integrity&&(r.integrity=a.integrity),a.referrerPolicy&&(r.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?r.credentials="include":a.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function o(a){if(a.ep)return;a.ep=!0;const r=s(a);fetch(a.href,r)}})();const u={layout:"fill"},p=["HD","HQ","SD","LO"],f=new Set(["??-??-????????","???-????-??","??-????-??","???-????","??-????","???-??","??-??","???","??"]),m=Array.from(f).map(t=>`(?:${t.replace(/\?/g,"[a-zA-Z]")})`).join("|"),b=new Set(["ageGate","autoplay","disableKeyboardEvents","loop","muted","playFullScreen","reporting","share","showImageOnError","showQualityMenu","showDownloadMenu"]),h=new Set(["aspectRatio","dir","hideControls","language","layout","partnerName","playButtonSize","playButtonTheme","title","unlocalizedTitle","poster","qualityBehavior"]),y=new Set(["maskLevel","percentage","startTime"]);function g(t,e){const s=e[0];try{const o=JSON.parse(s);Array.isArray(o)?t.playbackRates=o:console.error("UMP playbackRates is not an array.",s)}catch(o){console.error("UMP could not parse playbackRates.",o,s)}}function w(t,e){t.plugins={powerCms:{videoId:e[0]}}}function l(t,e,s){t.adobeCms=t.adobeCms||{operatingGroup:"",videoId:""},t.adobeCms[e]=s[0]}function c(t,e,s,o){for(const a of o){const r=new RegExp(`^(${m}),(https?://[^/]+.*)$`),n=a.match(r);n?(t[e]=t[e]||[],t[e].push({...s,locale:n[1].toLowerCase(),url:n[2]})):console.error(`UMP ${e} has an invalid value.`,a)}}function i(t,e,s){s.length>0?(t.sources=t.sources||[],t.sources.push({type:e,src:s[0]})):console.error(`UMP was provided with invalid source(s): ${s}`)}const P=p.map(t=>`(?:${t})`).join("|");function k(t,e){for(const s of e){const o=new RegExp(`^(${P}),(https?://[^/]+.*)$`),a=s.match(o);a?(t.sources=t.sources||[],t.sources.push({type:"MP4",quality:a[1],src:a[2]})):console.error("UMP failed to parse MP4 file option.",s)}}function O(t,e,s){const o=s[0];if(b.has(e))t[e]=o.toLowerCase()==="true";else if(h.has(e))t[e]=o;else if(y.has(e)){const a=parseInt(o,10);!isNaN(a)&&a>=0&&(t[e]=parseInt(o,10))}}function C(t){if(Object.prototype.hasOwnProperty.call(t,"options")){const e=t.options[0];try{const s=JSON.parse(e);if(typeof s=="object"&&s!==null)return s;console.error("UMP options is not an object.",e)}catch(s){console.error("UMP options failed to be parsed.",s,e)}}return{}}function d(){const t=M(),e=C(t);for(const[s,o]of Object.entries(t))switch(s){case"options":break;case"playbackRates":g(e,o);break;case"powerCmsVideoId":w(e,o);break;case"adobeCmsOperatingGroup":l(e,"operatingGroup",o);break;case"adobeCmsVideoId":l(e,"videoId",o);break;case"ttml":c(e,"ccFiles",{ccType:"TTML"},o);break;case"vtt":c(e,"ccFiles",{ccType:"VTT"},o);break;case"transcript":c(e,"downloadableFiles",{mediaType:"transcript"},o);break;case"dlAudio":c(e,"downloadableFiles",{mediaType:"audio"},o);break;case"dlVideo":c(e,"downloadableFiles",{mediaType:"video"},o);break;case"dlVideoWithCC":c(e,"downloadableFiles",{mediaType:"videoWithCC"},o);break;case"dash":i(e,"DASH",o);break;case"hls":i(e,"HLS",o);break;case"mss":i(e,"MSS",o);break;case"mp4":k(e,o);break;default:O(e,s,o)}return e}function M(){const t=new URLSearchParams(window.location.search),e={};for(const[s,o]of t.entries())o&&(e[s]?e[s].push(o):e[s]=[o]);return e}document.addEventListener("DOMContentLoaded",()=>{const t=window.ump,e=d();e.title&&(document.title=e.title),t("ump",{...u,...d()})});