@gumlet/insights-js-core 1.1.59 → 1.1.60

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
1
  /*! For license information please see gumlet-insights.min.js.LICENSE.txt */
2
- !function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var a=e();for(var i in a)("object"==typeof exports?exports:t)[i]=a[i]}}(self,()=>(()=>{var t={595(t,e){var a;a={VERSION:"2.4.0",Result:{SUCCEEDED:1,NOTRANSITION:2,CANCELLED:3,PENDING:4},Error:{INVALID_TRANSITION:100,PENDING_TRANSITION:200,INVALID_CALLBACK:300},WILDCARD:"*",ASYNC:"async",create:function(t,e){var i="string"==typeof t.initial?{state:t.initial}:t.initial,r=t.terminal||t.final,n=e||t.target||{},s=t.events||[],o=t.callbacks||{},l={},c={},u=function(t){var e=Array.isArray(t.from)?t.from:t.from?[t.from]:[a.WILDCARD];l[t.name]=l[t.name]||{};for(var i=0;i<e.length;i++)c[e[i]]=c[e[i]]||[],c[e[i]].push(t.name),l[t.name][e[i]]=t.to||e[i];t.to&&(c[t.to]=c[t.to]||[])};i&&(i.event=i.event||"startup",u({name:i.event,from:"none",to:i.state}));for(var m=0;m<s.length;m++)u(s[m]);for(var h in l)l.hasOwnProperty(h)&&(n[h]=a.buildEvent(h,l[h]));for(var h in o)o.hasOwnProperty(h)&&(n[h]=o[h]);return n.current="none",n.is=function(t){return Array.isArray(t)?t.indexOf(this.current)>=0:this.current===t},n.can=function(t){return!this.transition&&void 0!==l[t]&&(l[t].hasOwnProperty(this.current)||l[t].hasOwnProperty(a.WILDCARD))},n.cannot=function(t){return!this.can(t)},n.transitions=function(){return(c[this.current]||[]).concat(c[a.WILDCARD]||[])},n.isFinished=function(){return this.is(r)},n.error=t.error||function(t,e,a,i,r,n,s){throw s||n},n.states=function(){return Object.keys(c).sort()},i&&!i.defer&&n[i.event](),n},doCallback:function(t,e,i,r,n,s){if(e)try{return e.apply(t,[i,r,n].concat(s))}catch(e){return t.error(i,r,n,s,a.Error.INVALID_CALLBACK,"an exception occurred in a caller-provided callback function",e)}},beforeAnyEvent:function(t,e,i,r,n){return a.doCallback(t,t.onbeforeevent,e,i,r,n)},afterAnyEvent:function(t,e,i,r,n){return a.doCallback(t,t.onafterevent||t.onevent,e,i,r,n)},leaveAnyState:function(t,e,i,r,n){return a.doCallback(t,t.onleavestate,e,i,r,n)},enterAnyState:function(t,e,i,r,n){return a.doCallback(t,t.onenterstate||t.onstate,e,i,r,n)},changeState:function(t,e,i,r,n){return a.doCallback(t,t.onchangestate,e,i,r,n)},beforeThisEvent:function(t,e,i,r,n){return a.doCallback(t,t["onbefore"+e],e,i,r,n)},afterThisEvent:function(t,e,i,r,n){return a.doCallback(t,t["onafter"+e]||t["on"+e],e,i,r,n)},leaveThisState:function(t,e,i,r,n){return a.doCallback(t,t["onleave"+i],e,i,r,n)},enterThisState:function(t,e,i,r,n){return a.doCallback(t,t["onenter"+r]||t["on"+r],e,i,r,n)},beforeEvent:function(t,e,i,r,n){if(!1===a.beforeThisEvent(t,e,i,r,n)||!1===a.beforeAnyEvent(t,e,i,r,n))return!1},afterEvent:function(t,e,i,r,n){a.afterThisEvent(t,e,i,r,n),a.afterAnyEvent(t,e,i,r,n)},leaveState:function(t,e,i,r,n){var s=a.leaveThisState(t,e,i,r,n),o=a.leaveAnyState(t,e,i,r,n);return!1!==s&&!1!==o&&(a.ASYNC===s||a.ASYNC===o?a.ASYNC:void 0)},enterState:function(t,e,i,r,n){a.enterThisState(t,e,i,r,n),a.enterAnyState(t,e,i,r,n)},buildEvent:function(t,e){return function(){var i=this.current,r=e[i]||(e[a.WILDCARD]!=a.WILDCARD?e[a.WILDCARD]:i)||i,n=Array.prototype.slice.call(arguments);if(this.transition)return this.error(t,i,r,n,a.Error.PENDING_TRANSITION,"event "+t+" inappropriate because previous transition did not complete");if(this.cannot(t))return this.error(t,i,r,n,a.Error.INVALID_TRANSITION,"event "+t+" inappropriate in current state "+this.current);if(!1===a.beforeEvent(this,t,i,r,n))return a.Result.CANCELLED;if(i===r)return a.afterEvent(this,t,i,r,n),a.Result.NOTRANSITION;var s=this;this.transition=function(){return s.transition=null,s.current=r,a.enterState(s,t,i,r,n),a.changeState(s,t,i,r,n),a.afterEvent(s,t,i,r,n),a.Result.SUCCEEDED},this.transition.cancel=function(){s.transition=null,a.afterEvent(s,t,i,r,n)};var o=a.leaveState(this,t,i,r,n);return!1===o?(this.transition=null,a.Result.CANCELLED):a.ASYNC===o?a.Result.PENDING:this.transition?this.transition():void 0}}},t.exports&&(e=t.exports=a),e.StateMachine=a},503(t,e,a){var i;t=a.nmd(t),function(){"use strict";var r={function:!0,object:!0},n=r[typeof window]&&window||this,s=r[typeof e]&&e,o=r.object&&t&&!t.nodeType&&t,l=s&&o&&"object"==typeof a.g&&a.g;!l||l.global!==l&&l.window!==l&&l.self!==l||(n=l);var c=Math.pow(2,53)-1,u=/\bOpera/,m=Object.prototype,h=m.hasOwnProperty,E=m.toString;function S(t){return(t=String(t)).charAt(0).toUpperCase()+t.slice(1)}function d(t){return t=v(t),/^(?:webOS|i(?:OS|P))/.test(t)?t:S(t)}function f(t,e){for(var a in t)h.call(t,a)&&e(t[a],a,t)}function p(t){return null==t?S(t):E.call(t).slice(8,-1)}function y(t){return String(t).replace(/([ -])(?!$)/g,"$1?")}function A(t,e){var a=null;return function(t,e){var a=-1,i=t?t.length:0;if("number"==typeof i&&i>-1&&i<=c)for(;++a<i;)e(t[a],a,t);else f(t,e)}(t,function(i,r){a=e(a,i,r,t)}),a}function v(t){return String(t).replace(/^ +| +$/g,"")}var _=function t(e){var a=n,i=e&&"object"==typeof e&&"String"!=p(e);i&&(a=e,e=null);var r=a.navigator||{},s=r.userAgent||"";e||(e=s);var o,l,c,m,h,S=i?!!r.likeChrome:/\bChrome\b/.test(e)&&!/internal|\n/i.test(E.toString()),_="Object",b=i?_:"ScriptBridgingProxyObject",N=i?_:"Environment",g=i&&a.java?"JavaPackage":p(a.java),T=i?_:"RuntimeObject",D=/\bJava/.test(g)&&a.java,I=D&&p(a.environment)==N,P=D?"a":"α",C=D?"b":"β",U=a.document||{},R=a.operamini||a.opera,G=u.test(G=i&&R?R["[[Class]]"]:p(R))?G:R=null,L=e,k=[],Y=null,O=e==s,w=O&&R&&"function"==typeof R.version&&R.version(),F=A([{label:"EdgeHTML",pattern:"Edge"},"Trident",{label:"WebKit",pattern:"AppleWebKit"},"iCab","Presto","NetFront","Tasman","KHTML","Gecko"],function(t,a){return t||RegExp("\\b"+(a.pattern||y(a))+"\\b","i").exec(e)&&(a.label||a)}),M=function(t){return A(t,function(t,a){return t||RegExp("\\b"+(a.pattern||y(a))+"\\b","i").exec(e)&&(a.label||a)})}(["Adobe AIR","Arora","Avant Browser","Breach","Camino","Electron","Epiphany","Fennec","Flock","Galeon","GreenBrowser","iCab","Iceweasel","K-Meleon","Konqueror","Lunascape","Maxthon",{label:"Microsoft Edge",pattern:"(?:Edge|Edg|EdgA|EdgiOS)"},"Midori","Nook Browser","PaleMoon","PhantomJS","Raven","Rekonq","RockMelt",{label:"Samsung Internet",pattern:"SamsungBrowser"},"SeaMonkey",{label:"Silk",pattern:"(?:Cloud9|Silk-Accelerated)"},"Sleipnir","SlimBrowser",{label:"SRWare Iron",pattern:"Iron"},"Sunrise","Swiftfox","Vivaldi","Waterfox","WebPositive",{label:"Yandex Browser",pattern:"YaBrowser"},{label:"UC Browser",pattern:"UCBrowser"},"Opera Mini",{label:"Opera Mini",pattern:"OPiOS"},"Opera",{label:"Opera",pattern:"OPR"},"Chromium","Chrome",{label:"Chrome",pattern:"(?:HeadlessChrome)"},{label:"Chrome Mobile",pattern:"(?:CriOS|CrMo)"},{label:"Firefox",pattern:"(?:Firefox|Minefield)"},{label:"Firefox for iOS",pattern:"FxiOS"},{label:"IE",pattern:"IEMobile"},{label:"IE",pattern:"MSIE"},"Safari"]),H=B([{label:"BlackBerry",pattern:"BB10"},"BlackBerry",{label:"Galaxy S",pattern:"GT-I9000"},{label:"Galaxy S2",pattern:"GT-I9100"},{label:"Galaxy S3",pattern:"GT-I9300"},{label:"Galaxy S4",pattern:"GT-I9500"},{label:"Galaxy S5",pattern:"SM-G900"},{label:"Galaxy S6",pattern:"SM-G920"},{label:"Galaxy S6 Edge",pattern:"SM-G925"},{label:"Galaxy S7",pattern:"SM-G930"},{label:"Galaxy S7 Edge",pattern:"SM-G935"},"Google TV","Lumia","iPad","iPod","iPhone","Kindle",{label:"Kindle Fire",pattern:"(?:Cloud9|Silk-Accelerated)"},"Nexus","Nook","PlayBook","PlayStation Vita","PlayStation","TouchPad","Transformer",{label:"Wii U",pattern:"WiiU"},"Wii","Xbox One",{label:"Xbox 360",pattern:"Xbox"},"Xoom"]),K=function(t){return A(t,function(t,a,i){return t||(a[H]||a[/^[a-z]+(?: +[a-z]+\b)*/i.exec(H)]||RegExp("\\b"+y(i)+"(?:\\b|\\w*\\d)","i").exec(e))&&i})}({Apple:{iPad:1,iPhone:1,iPod:1},Alcatel:{},Archos:{},Amazon:{Kindle:1,"Kindle Fire":1},Asus:{Transformer:1},"Barnes & Noble":{Nook:1},BlackBerry:{PlayBook:1},Google:{"Google TV":1,Nexus:1},HP:{TouchPad:1},HTC:{},Huawei:{},Lenovo:{},LG:{},Microsoft:{Xbox:1,"Xbox One":1},Motorola:{Xoom:1},Nintendo:{"Wii U":1,Wii:1},Nokia:{Lumia:1},Oppo:{},Samsung:{"Galaxy S":1,"Galaxy S2":1,"Galaxy S3":1,"Galaxy S4":1},Sony:{PlayStation:1,"PlayStation Vita":1},Xiaomi:{Mi:1,Redmi:1}}),V=function(t){return A(t,function(t,a){var i=a.pattern||y(a);return!t&&(t=RegExp("\\b"+i+"(?:/[\\d.]+|[ \\w.]*)","i").exec(e))&&(t=function(t,e,a){var i={"10.0":"10",6.4:"10 Technical Preview",6.3:"8.1",6.2:"8",6.1:"Server 2008 R2 / 7","6.0":"Server 2008 / Vista",5.2:"Server 2003 / XP 64-bit",5.1:"XP",5.01:"2000 SP1","5.0":"2000","4.0":"NT","4.90":"ME"};return e&&a&&/^Win/i.test(t)&&!/^Windows Phone /i.test(t)&&(i=i[/[\d.]+$/.exec(t)])&&(t="Windows "+i),t=String(t),e&&a&&(t=t.replace(RegExp(e,"i"),a)),d(t.replace(/ ce$/i," CE").replace(/\bhpw/i,"web").replace(/\bMacintosh\b/,"Mac OS").replace(/_PowerPC\b/i," OS").replace(/\b(OS X) [^ \d]+/i,"$1").replace(/\bMac (OS X)\b/,"$1").replace(/\/(\d)/," $1").replace(/_/g,".").replace(/(?: BePC|[ .]*fc[ \d.]+)$/i,"").replace(/\bx86\.64\b/gi,"x86_64").replace(/\b(Windows Phone) OS\b/,"$1").replace(/\b(Chrome OS \w+) [\d.]+\b/,"$1").split(" on ")[0])}(t,i,a.label||a)),t})}(["Windows Phone","KaiOS","Android","CentOS",{label:"Chrome OS",pattern:"CrOS"},"Debian",{label:"DragonFly BSD",pattern:"DragonFly"},"Fedora","FreeBSD","Gentoo","Haiku","Kubuntu","Linux Mint","OpenBSD","Red Hat","SuSE","Ubuntu","Xubuntu","Cygwin","Symbian OS","hpwOS","webOS ","webOS","Tablet OS","Tizen","Linux","Mac OS X","Macintosh","Mac","Windows 98;","Windows "]);function B(t){return A(t,function(t,a){var i=a.pattern||y(a);return!t&&(t=RegExp("\\b"+i+" *\\d+[.\\w_]*","i").exec(e)||RegExp("\\b"+i+" *\\w+-[\\w]*","i").exec(e)||RegExp("\\b"+i+"(?:; *(?:[a-z]+[_-])?[a-z]+\\d+|[^ ();-]*)","i").exec(e))&&((t=String(a.label&&!RegExp(i,"i").test(a.label)?a.label:t).split("/"))[1]&&!/[\d.]+/.test(t[0])&&(t[0]+=" "+t[1]),a=a.label||a,t=d(t[0].replace(RegExp(i,"i"),a).replace(RegExp("; *(?:"+a+"[_-])?","i")," ").replace(RegExp("("+a+")[-_.]?(\\w)","i"),"$1 $2"))),t})}function j(t){return A(t,function(t,a){return t||(RegExp(a+"(?:-[\\d.]+/|(?: for [\\w-]+)?[ /-])([\\d.]+[^ ();/_-]*)","i").exec(e)||0)[1]||null})}if(F&&(F=[F]),/\bAndroid\b/.test(V)&&!H&&(o=/\bAndroid[^;]*;(.*?)(?:Build|\) AppleWebKit)\b/i.exec(e))&&(H=v(o[1]).replace(/^[a-z]{2}-[a-z]{2};\s*/i,"")||null),K&&!H?H=B([K]):K&&H&&(H=H.replace(RegExp("^("+y(K)+")[-_.\\s]","i"),K+" ").replace(RegExp("^("+y(K)+")[-_.]?(\\w)","i"),K+" $2")),(o=/\bGoogle TV\b/.exec(H))&&(H=o[0]),/\bSimulator\b/i.test(e)&&(H=(H?H+" ":"")+"Simulator"),"Opera Mini"==M&&/\bOPiOS\b/.test(e)&&k.push("running in Turbo/Uncompressed mode"),"IE"==M&&/\blike iPhone OS\b/.test(e)?(K=(o=t(e.replace(/like iPhone OS/,""))).manufacturer,H=o.product):/^iP/.test(H)?(M||(M="Safari"),V="iOS"+((o=/ OS ([\d_]+)/i.exec(e))?" "+o[1].replace(/_/g,"."):"")):"Konqueror"==M&&/^Linux\b/i.test(V)?V="Kubuntu":K&&"Google"!=K&&(/Chrome/.test(M)&&!/\bMobile Safari\b/i.test(e)||/\bVita\b/.test(H))||/\bAndroid\b/.test(V)&&/^Chrome/.test(M)&&/\bVersion\//i.test(e)?(M="Android Browser",V=/\bAndroid\b/.test(V)?V:"Android"):"Silk"==M?(/\bMobi/i.test(e)||(V="Android",k.unshift("desktop mode")),/Accelerated *= *true/i.test(e)&&k.unshift("accelerated")):"UC Browser"==M&&/\bUCWEB\b/.test(e)?k.push("speed mode"):"PaleMoon"==M&&(o=/\bFirefox\/([\d.]+)\b/.exec(e))?k.push("identifying as Firefox "+o[1]):"Firefox"==M&&(o=/\b(Mobile|Tablet|TV)\b/i.exec(e))?(V||(V="Firefox OS"),H||(H=o[1])):!M||(o=!/\bMinefield\b/i.test(e)&&/\b(?:Firefox|Safari)\b/.exec(M))?(M&&!H&&/[\/,]|^[^(]+?\)/.test(e.slice(e.indexOf(o+"/")+8))&&(M=null),(o=H||K||V)&&(H||K||/\b(?:Android|Symbian OS|Tablet OS|webOS)\b/.test(V))&&(M=/[a-z]+(?: Hat)?/i.exec(/\bAndroid\b/.test(V)?V:o)+" Browser")):"Electron"==M&&(o=(/\bChrome\/([\d.]+)\b/.exec(e)||0)[1])&&k.push("Chromium "+o),w||(w=j(["(?:Cloud9|CriOS|CrMo|Edge|Edg|EdgA|EdgiOS|FxiOS|HeadlessChrome|IEMobile|Iron|Opera ?Mini|OPiOS|OPR|Raven|SamsungBrowser|Silk(?!/[\\d.]+$)|UCBrowser|YaBrowser)","Version",y(M),"(?:Firefox|Minefield|NetFront)"])),(o=("iCab"==F&&parseFloat(w)>3?"WebKit":/\bOpera\b/.test(M)&&(/\bOPR\b/.test(e)?"Blink":"Presto"))||/\b(?:Midori|Nook|Safari)\b/i.test(e)&&!/^(?:Trident|EdgeHTML)$/.test(F)&&"WebKit"||!F&&/\bMSIE\b/i.test(e)&&("Mac OS"==V?"Tasman":"Trident")||"WebKit"==F&&/\bPlayStation\b(?! Vita\b)/i.test(M)&&"NetFront")&&(F=[o]),"IE"==M&&(o=(/; *(?:XBLWP|ZuneWP)(\d+)/i.exec(e)||0)[1])?(M+=" Mobile",V="Windows Phone "+(/\+$/.test(o)?o:o+".x"),k.unshift("desktop mode")):/\bWPDesktop\b/i.test(e)?(M="IE Mobile",V="Windows Phone 8.x",k.unshift("desktop mode"),w||(w=(/\brv:([\d.]+)/.exec(e)||0)[1])):"IE"!=M&&"Trident"==F&&(o=/\brv:([\d.]+)/.exec(e))&&(M&&k.push("identifying as "+M+(w?" "+w:"")),M="IE",w=o[1]),O){if(m="global",h=null!=(c=a)?typeof c[m]:"number",/^(?:boolean|number|string|undefined)$/.test(h)||"object"==h&&!c[m])p(o=a.runtime)==b?(M="Adobe AIR",V=o.flash.system.Capabilities.os):p(o=a.phantom)==T?(M="PhantomJS",w=(o=o.version||null)&&o.major+"."+o.minor+"."+o.patch):"number"==typeof U.documentMode&&(o=/\bTrident\/(\d+)/i.exec(e))?(w=[w,U.documentMode],(o=+o[1]+4)!=w[1]&&(k.push("IE "+w[1]+" mode"),F&&(F[1]=""),w[1]=o),w="IE"==M?String(w[1].toFixed(1)):w[0]):"number"==typeof U.documentMode&&/^(?:Chrome|Firefox)\b/.test(M)&&(k.push("masking as "+M+" "+w),M="IE",w="11.0",F=["Trident"],V="Windows");else if(D&&(L=(o=D.lang.System).getProperty("os.arch"),V=V||o.getProperty("os.name")+" "+o.getProperty("os.version")),I){try{w=a.require("ringo/engine").version.join("."),M="RingoJS"}catch(t){(o=a.system)&&o.global.system==a.system&&(M="Narwhal",V||(V=o[0].os||null))}M||(M="Rhino")}else"object"==typeof a.process&&!a.process.browser&&(o=a.process)&&("object"==typeof o.versions&&("string"==typeof o.versions.electron?(k.push("Node "+o.versions.node),M="Electron",w=o.versions.electron):"string"==typeof o.versions.nw&&(k.push("Chromium "+w,"Node "+o.versions.node),M="NW.js",w=o.versions.nw)),M||(M="Node.js",L=o.arch,V=o.platform,w=(w=/[\d.]+/.exec(o.version))?w[0]:null));V=V&&d(V)}if(w&&(o=/(?:[ab]|dp|pre|[ab]\d+pre)(?:\d+\+?)?$/i.exec(w)||/(?:alpha|beta)(?: ?\d)?/i.exec(e+";"+(O&&r.appMinorVersion))||/\bMinefield\b/i.test(e)&&"a")&&(Y=/b/i.test(o)?"beta":"alpha",w=w.replace(RegExp(o+"\\+?$"),"")+("beta"==Y?C:P)+(/\d+\+?/.exec(o)||"")),"Fennec"==M||"Firefox"==M&&/\b(?:Android|Firefox OS|KaiOS)\b/.test(V))M="Firefox Mobile";else if("Maxthon"==M&&w)w=w.replace(/\.[\d.]+/,".x");else if(/\bXbox\b/i.test(H))"Xbox 360"==H&&(V=null),"Xbox 360"==H&&/\bIEMobile\b/.test(e)&&k.unshift("mobile mode");else if(!/^(?:Chrome|IE|Opera)$/.test(M)&&(!M||H||/Browser|Mobi/.test(M))||"Windows CE"!=V&&!/Mobi/i.test(e))if("IE"==M&&O)try{null===a.external&&k.unshift("platform preview")}catch(t){k.unshift("embedded")}else(/\bBlackBerry\b/.test(H)||/\bBB10\b/.test(e))&&(o=(RegExp(H.replace(/ +/g," *")+"/([.\\d]+)","i").exec(e)||0)[1]||w)?(V=((o=[o,/BB10/.test(e)])[1]?(H=null,K="BlackBerry"):"Device Software")+" "+o[0],w=null):this!=f&&"Wii"!=H&&(O&&R||/Opera/.test(M)&&/\b(?:MSIE|Firefox)\b/i.test(e)||"Firefox"==M&&/\bOS X (?:\d+\.){2,}/.test(V)||"IE"==M&&(V&&!/^Win/.test(V)&&w>5.5||/\bWindows XP\b/.test(V)&&w>8||8==w&&!/\bTrident\b/.test(e)))&&!u.test(o=t.call(f,e.replace(u,"")+";"))&&o.name&&(o="ing as "+o.name+((o=o.version)?" "+o:""),u.test(M)?(/\bIE\b/.test(o)&&"Mac OS"==V&&(V=null),o="identify"+o):(o="mask"+o,M=G?d(G.replace(/([a-z])([A-Z])/g,"$1 $2")):"Opera",/\bIE\b/.test(o)&&(V=null),O||(w=null)),F=["Presto"],k.push(o));else M+=" Mobile";(o=(/\bAppleWebKit\/([\d.]+\+?)/i.exec(e)||0)[1])&&(o=[parseFloat(o.replace(/\.(\d)$/,".0$1")),o],"Safari"==M&&"+"==o[1].slice(-1)?(M="WebKit Nightly",Y="alpha",w=o[1].slice(0,-1)):w!=o[1]&&w!=(o[2]=(/\bSafari\/([\d.]+\+?)/i.exec(e)||0)[1])||(w=null),o[1]=(/\b(?:Headless)?Chrome\/([\d.]+)/i.exec(e)||0)[1],537.36==o[0]&&537.36==o[2]&&parseFloat(o[1])>=28&&"WebKit"==F&&(F=["Blink"]),O&&(S||o[1])?(F&&(F[1]="like Chrome"),o=o[1]||((o=o[0])<530?1:o<532?2:o<532.05?3:o<533?4:o<534.03?5:o<534.07?6:o<534.1?7:o<534.13?8:o<534.16?9:o<534.24?10:o<534.3?11:o<535.01?12:o<535.02?"13+":o<535.07?15:o<535.11?16:o<535.19?17:o<536.05?18:o<536.1?19:o<537.01?20:o<537.11?"21+":o<537.13?23:o<537.18?24:o<537.24?25:o<537.36?26:"Blink"!=F?"27":"28")):(F&&(F[1]="like Safari"),o=(o=o[0])<400?1:o<500?2:o<526?3:o<533?4:o<534?"4+":o<535?5:o<537?6:o<538?7:o<601?8:o<602?9:o<604?10:o<606?11:o<608?12:"12"),F&&(F[1]+=" "+(o+="number"==typeof o?".x":/[.+]/.test(o)?"":"+")),"Safari"==M&&(!w||parseInt(w)>45)?w=o:"Chrome"==M&&/\bHeadlessChrome/i.test(e)&&k.unshift("headless")),"Opera"==M&&(o=/\bzbov|zvav$/.exec(V))?(M+=" ",k.unshift("desktop mode"),"zvav"==o?(M+="Mini",w=null):M+="Mobile",V=V.replace(RegExp(" *"+o+"$"),"")):"Safari"==M&&/\bChrome\b/.exec(F&&F[1])?(k.unshift("desktop mode"),M="Chrome Mobile",w=null,/\bOS X\b/.test(V)?(K="Apple",V="iOS 4.3+"):V=null):/\bSRWare Iron\b/.test(M)&&!w&&(w=j("Chrome")),w&&0==w.indexOf(o=/[\d.]+$/.exec(V))&&e.indexOf("/"+o+"-")>-1&&(V=v(V.replace(o,""))),V&&-1!=V.indexOf(M)&&!RegExp(M+" OS").test(V)&&(V=V.replace(RegExp(" *"+y(M)+" *"),"")),F&&!/\b(?:Avant|Nook)\b/.test(M)&&(/Browser|Lunascape|Maxthon/.test(M)||"Safari"!=M&&/^iOS/.test(V)&&/\bSafari\b/.test(F[1])||/^(?:Adobe|Arora|Breach|Midori|Opera|Phantom|Rekonq|Rock|Samsung Internet|Sleipnir|SRWare Iron|Vivaldi|Web)/.test(M)&&F[1])&&(o=F[F.length-1])&&k.push(o),k.length&&(k=["("+k.join("; ")+")"]),K&&H&&H.indexOf(K)<0&&k.push("on "+K),H&&k.push((/^on /.test(k[k.length-1])?"":"on ")+H),V&&(o=/ ([\d.+]+)$/.exec(V),l=o&&"/"==V.charAt(V.length-o[0].length-1),V={architecture:32,family:o&&!l?V.replace(o[0],""):V,version:o?o[1]:null,toString:function(){var t=this.version;return this.family+(t&&!l?" "+t:"")+(64==this.architecture?" 64-bit":"")}}),(o=/\b(?:AMD|IA|Win|WOW|x86_|x)64\b/i.exec(L))&&!/\bi686\b/i.test(L)?(V&&(V.architecture=64,V.family=V.family.replace(RegExp(" *"+o),"")),M&&(/\bWOW64\b/i.test(e)||O&&/\w(?:86|32)$/.test(r.cpuClass||r.platform)&&!/\bWin64; x64\b/i.test(e))&&k.unshift("32-bit")):V&&/^OS X/.test(V.family)&&"Chrome"==M&&parseFloat(w)>=39&&(V.architecture=64),e||(e=null);var W={};return W.description=e,W.layout=F&&F[0],W.manufacturer=K,W.name=M,W.prerelease=Y,W.product=H,W.ua=e,W.version=M&&w,W.os=V||{architecture:null,family:null,version:null,toString:function(){return"null"}},W.parse=t,W.toString=function(){return this.description||""},W.version&&k.unshift(w),W.name&&k.unshift(M),V&&M&&(V!=String(V).split(" ")[0]||V!=M.split(" ")[0]&&!H)&&k.push(H?"("+V+")":"on "+V),k.length&&(W.description=k.join(" ")),W}();n.platform=_,void 0===(i=function(){return _}.call(e,a,e,t))||(t.exports=i)}.call(this)}},e={};function a(i){var r=e[i];if(void 0!==r)return r.exports;var n=e[i]={id:i,loaded:!1,exports:{}};return t[i].call(n.exports,n,n.exports,a),n.loaded=!0,n.exports}a.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return a.d(e,{a:e}),e},a.d=(t,e)=>{for(var i in e)a.o(e,i)&&!a.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),a.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),a.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},a.nmd=t=>(t.paths=[],t.children||(t.children=[]),t);var i={};return(()=>{"use strict";a.r(i),a.d(i,{default:()=>Ca});var t="undefined"==typeof arguments?void 0:arguments;function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(t)}var r=function(){return Date.now()},n=function(){return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,function(t){return(t^crypto.getRandomValues(new Uint8Array(1))[0]&15>>t/4).toString(16).toUpperCase()})},s=function(e,a){var i,r=0;return function(){return r>=a||(i=e.apply(null,t),r++),i}},o=function(t){return"object"===e(t)?JSON.stringify(t):"function"==typeof t?o(t()):void 0===t?t:"string"!=typeof t?String(t):t};const l={validString:function(t){return void 0!==t&&"string"==typeof t},validBoolean:function(t){return void 0!==t&&"boolean"==typeof t},validNumber:function(t){return void 0!==t&&"number"==typeof t},sanitizePath:function(t){return t.replace(/\/$/g,"")},calculateTime:function(t){return t*=1e3,Math.round(t)},getCurrentTimestamp:r,getDurationFromTimestampToNow:function(t){return r()-t},uuidv4:n,getCookie:function(t){var e=t+"=",a=[];try{a=document.cookie.split(";")}catch(t){return""}for(var i="",r=0;r<a.length;r++){for(var n=a[r];" "===n.charAt(0);)n=n.substring(1);0===n.indexOf(e)&&(i=n.substring(e.length,n.length))}if(!i){try{i=localStorage.getItem(t)}catch(t){return""}var s=null;if(!i)return"";try{s=JSON.parse(i)}catch(t){return""}var o=null;if(!s.expires)return"";if(o=new Date(s.expires),"[object Date]"!==Object.prototype.toString.call(o))return"";if(isNaN(o))return"";if(!(o.getTime()>(new Date).getTime()))return"";i=s.value?s.value:""}return i},setCookie:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:30,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=new Date;i.setTime(i.getTime()+60*e*1e3);var r=a||n();try{document.cookie="".concat(t,"=").concat(r,"; expires=").concat(i.toUTCString(),"; path=/"),localStorage.setItem(t,JSON.stringify({expires:i.getTime(),value:r}))}catch(t){}return r},noOp:function(){},times:s,once:function(t){return s(t,1)},getHiddenProp:function(){var t=["webkit","moz","ms","o"];if("hidden"in document)return"hidden";for(var e=0;e<t.length;e++)if("".concat(t[e],"Hidden")in document)return"".concat(t[e],"Hidden");return null},getCustomDataString:o,jsonToQueryString:function(t){return"?"+Object.keys(t).map(function(e){return encodeURIComponent(e)+"="+encodeURIComponent(t[e])}).join("&")},currentDateTimeFormatString:function(){return(new Date).toISOString()},convertEpochTime:function(t){var e=t.toString().length;if(13===e)return t;var a=13-e;return t*Math.pow(10,a)}};function c(t){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},c(t)}function u(t,e){for(var a=0;a<e.length;a++){var i=e[a];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,m(i.key),i)}}function m(t){var e=function(t,e){if("object"!=c(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,e||"default");if("object"!=c(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==c(e)?e:e+""}const h=function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)},e=[{key:"get",value:function(t,e,a){var i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];e.z=Date.now()/1e3;var r,n=[void 0,null,!1];Object.keys(e).forEach(function(t){-1!==n.indexOf(e[t])&&delete e[t]}),Object.keys(e).forEach(function(t){Number.isNaN(e[t])&&delete e[t]});var s=!1;window.XDomainRequest&&(s=!0),r=s?new window.XDomainRequest:new XMLHttpRequest;var o=function(){if(r.readyState===XMLHttpRequest.DONE){if(r.responseText<=0)return;a(r.responseText)}};s?r.onload=o:r.onreadystatechange=o,t+=l.jsonToQueryString(e),r.open("GET",t,i),r.send(null)}},{key:"asyncGet",value:function(t,e){return new Promise(function(a,i){e.z=Date.now()/1e3;var r,n=[void 0,null,!1];Object.keys(e).forEach(function(t){-1!==n.indexOf(e[t])&&delete e[t]}),Object.keys(e).forEach(function(t){Number.isNaN(e[t])&&delete e[t]});var s=!1;window.XDomainRequest&&(s=!0),(r=s?new window.XDomainRequest:new XMLHttpRequest).onload=function(){this.status>=200&&this.status<300?a(r.response):i({status:this.status,statusText:r.statusText})};var o=l.jsonToQueryString(e);t+=o,r.open("GET",t),r.onerror=function(){i({status:this.status,statusText:r.statusText})},r.send()})}}],e&&u(t.prototype,e),a&&u(t,a),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,a}();var E="urn:x-cast:com.gumlet.ingest.cast",S="https://ingest.gumlytics.com",d=1e4;function f(t){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},f(t)}function p(t,e){for(var a=0;a<e.length;a++){var i=e[a];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,N(i.key),i)}}function y(t,e,a){return e=v(e),function(t,e){if(e&&("object"==f(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,A()?Reflect.construct(e,a||[],v(t).constructor):e.apply(t,a))}function A(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(A=function(){return!!t})()}function v(t){return v=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},v(t)}function _(t,e){return _=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_(t,e)}function b(t,e,a){return(e=N(e))in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}function N(t){var e=function(t,e){if("object"!=f(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,e||"default");if("object"!=f(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==f(e)?e:e+""}var g=function(t){function e(){var t;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);for(var a=arguments.length,i=new Array(a),r=0;r<a;r++)i[r]=arguments[r];return b(t=y(this,e,[].concat(i)),"sendRequest",function(t,a){t.event_family="session_event",this.get(e.analyticsServerUrl,t,a)}),b(t,"sendRequestAsync",function(t){var a=this;return t.event_family="session_event",new Promise(function(i,r){a.asyncGet(e.analyticsServerUrl,t).then(function(t){i(t)}).catch(function(t){r(t)})})}),b(t,"sendRequestSynchronous",function(t,a){t.event_family="session_event",this.get(e.analyticsServerUrl,t,a,!1)}),b(t,"getAnalyticsServerUrl",function(){return e.analyticsServerUrl}),t}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_(t,e)}(e,t),a=e,i&&p(a.prototype,i),r&&p(a,r),Object.defineProperty(a,"prototype",{writable:!1}),a;var a,i,r}(h);b(g,"analyticsServerUrl",S);const T=g;function D(t){return D="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},D(t)}function I(t,e){for(var a=0;a<e.length;a++){var i=e[a];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,L(i.key),i)}}function P(t,e,a){return e=U(e),function(t,e){if(e&&("object"==D(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,C()?Reflect.construct(e,a||[],U(t).constructor):e.apply(t,a))}function C(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(C=function(){return!!t})()}function U(t){return U=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},U(t)}function R(t,e){return R=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},R(t,e)}function G(t,e,a){return(e=L(e))in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}function L(t){var e=function(t,e){if("object"!=D(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,e||"default");if("object"!=D(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==D(e)?e:e+""}var k=function(t){function e(){var t;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);for(var a=arguments.length,i=new Array(a),r=0;r<a;r++)i[r]=arguments[r];return G(t=P(this,e,[].concat(i)),"sendRequest",function(t,a){t.event_family="session",this.get(e.analyticsServerUrl,t,a)}),G(t,"sendRequestSynchronous",function(t,a){t.event_family="session",this.get(e.analyticsServerUrl,t,a,!1)}),G(t,"getAnalyticsServerUrl",function(){return e.analyticsServerUrl}),t}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&R(t,e)}(e,t),a=e,i&&I(a.prototype,i),r&&I(a,r),Object.defineProperty(a,"prototype",{writable:!1}),a;var a,i,r}(h);G(k,"analyticsServerUrl",S);const Y=k;function O(t){return O="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},O(t)}function w(t,e){for(var a=0;a<e.length;a++){var i=e[a];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,B(i.key),i)}}function F(t,e,a){return e=H(e),function(t,e){if(e&&("object"==O(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,M()?Reflect.construct(e,a||[],H(t).constructor):e.apply(t,a))}function M(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(M=function(){return!!t})()}function H(t){return H=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},H(t)}function K(t,e){return K=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},K(t,e)}function V(t,e,a){return(e=B(e))in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}function B(t){var e=function(t,e){if("object"!=O(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,e||"default");if("object"!=O(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==O(e)?e:e+""}var j=function(t){function e(){var t;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);for(var a=arguments.length,i=new Array(a),r=0;r<a;r++)i[r]=arguments[r];return V(t=F(this,e,[].concat(i)),"sendRequest",function(t,a){t.event_family="player_init",this.get(e.analyticsServerUrl,t,a)}),V(t,"sendRequestSynchronous",function(t,a){t.event_family="player_init",this.get(e.analyticsServerUrl,t,a,!1)}),V(t,"getAnalyticsServerUrl",function(){return e.analyticsServerUrl}),t}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&K(t,e)}(e,t),a=e,i&&w(a.prototype,i),r&&w(a,r),Object.defineProperty(a,"prototype",{writable:!1}),a;var a,i,r}(h);V(j,"analyticsServerUrl",S);const W=j;const x=function(){var t=window.navigator.userAgent;return/(tablet|ipad|playbook|silk)|(android(?!.*mobi))/i.test(t)?"tablet":/Mobile|iP(hone|od)|Android|BlackBerry|IEMobile|Kindle|Silk-Accelerated|(hpw|web)OS|Opera M(obi|ini)/.test(t)?"mobile":"desktop"};function Q(t){return Q="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Q(t)}function q(t,e){for(var a=0;a<e.length;a++){var i=e[a];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,$(i.key),i)}}function J(t,e,a){return(e=$(e))in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}function $(t){var e=function(t,e){if("object"!=Q(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,e||"default");if("object"!=Q(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Q(e)?e:e+""}const X=new(function(){return t=function t(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),J(this,"log",function(t){this.showLogs&&console.log(t)}),J(this,"error",function(t){this.showLogs&&console.error(t)}),J(this,"warning",function(t){this.showLogs&&console.warn(t)}),this.showLogs=e},(e=[{key:"setLogging",value:function(t){this.showLogs=t}},{key:"isLogging",value:function(){return this.showLogs}}])&&q(t.prototype,e),a&&q(t,a),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,a}());var z;function Z(t){return Z="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Z(t)}function tt(t,e){for(var a=0;a<e.length;a++){var i=e[a];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,at(i.key),i)}}function et(t,e,a){return(e=at(e))in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}function at(t){var e=function(t,e){if("object"!=Z(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,e||"default");if("object"!=Z(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Z(e)?e:e+""}var it=function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)},a=[{key:"isShaka",value:function(t){return!!window.shaka&&"function"==typeof shaka.Player&&t.constructor===shaka.Player}},{key:"isDashjs",value:function(t){return"function"==typeof t.addABRCustomRule}},{key:"isHlsjs",value:function(t){return!!window.Hls&&"function"==typeof window.Hls&&t.constructor===window.Hls}}],(e=null)&&tt(t.prototype,e),a&&tt(t,a),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,a}();z=it,et(it,"isBitmovinVersionPre7",function(t){return!z.isDashjs(t)&&("function"==typeof t.getVersion&&t.getVersion()<"7")}),et(it,"isBitmovinVersion7Plus",function(t){return"string"==typeof t.version&&t.version>="7"}),et(it,"isVideoJs",function(t){if("function"==typeof videojs)try{if(videojs(t.id_)===t)return!0}catch(t){}return!1});const rt=it;const nt={READY:"ready",STARTUP:"startup",SOURCE_LOADED:"sourceLoaded",PLAY:"play",PAUSE:"pause",TIMECHANGED:"timechanged",SEEK:"seek",SEEKED:"seeked",START_CAST:"startCasting",END_CAST:"endCasting",START_BUFFERING:"startBuffering",END_BUFFERING:"endBuffering",AUDIO_CHANGE:"audioChange",VIDEO_CHANGE:"videoChange",START_FULLSCREEN:"startFullscreen",END_FULLSCREEN:"endFullscreen",START_AD:"adStart",END_AD:"adEnd",MUTE:"mute",UN_MUTE:"unMute",ERROR:"playerError",PLAYBACK_FINISHED:"end",SCREEN_RESIZE:"resize",UNLOAD:"unload",END:"end",METADATA_LOADED:"metadataLoaded",SOURCE_UNLOADED:"sourceUnloaded",PLAYBACK_PLAYING:"playback_playing"};function st(t){return st="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},st(t)}function ot(t,e){for(var a=0;a<e.length;a++){var i=e[a];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,lt(i.key),i)}}function lt(t){var e=function(t,e){if("object"!=st(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,e||"default");if("object"!=st(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==st(e)?e:e+""}const ct=function(){return t=function t(e,a){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.onBeforeUnLoadEvent=!1,this.player=e,this.eventCallback=a,this.register()},(e=[{key:"register",value:function(){var t=this;this.player.addEventHandler(this.player.EVENT.ON_SOURCE_LOADED,function(){t.eventCallback(nt.SOURCE_LOADED)}),this.player.addEventHandler(this.player.EVENT.ON_READY,function(){var e=!1;t.player.getConfig().playback&&t.player.getConfig().playback.autoplay&&(e=t.player.getConfig().playback.autoplay),t.eventCallback(nt.READY,{isLive:t.player.isLive(),version:t.player.getVersion(),type:t.player.getPlayerType(),duration:t.player.getDuration(),streamType:t.player.getStreamType(),videoId:t.player.getConfig().source.videoId,userId:t.player.getConfig().source.userId,mpdUrl:t.player.getConfig().source.dash,m3u8Url:t.player.getConfig().source.hls,progUrl:t.player.getConfig().source.progressive,videoWindowWidth:t.player.getFigure().offsetWidth,videoWindowHeight:t.player.getFigure().offsetHeight,isMuted:t.player.isMuted(),autoplay:e})}),this.player.addEventHandler(this.player.EVENT.ON_CAST_START,function(){t.eventCallback(nt.START_CAST)}),this.player.addEventHandler(this.player.EVENT.ON_CAST_STOP,function(){t.eventCallback(nt.END_CAST)}),this.player.addEventHandler(this.player.EVENT.ON_PLAY,function(){t.eventCallback(nt.PLAY,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames()})}),this.player.addEventHandler(this.player.EVENT.ON_PAUSE,function(){t.eventCallback(nt.PAUSE,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames()})}),this.player.addEventHandler(this.player.EVENT.ON_TIME_CHANGED,function(){t.eventCallback(nt.TIMECHANGED,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames()})}),this.player.addEventHandler(this.player.EVENT.ON_SEEK,function(){t.eventCallback(nt.SEEK,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames()})}),this.player.addEventHandler(this.player.EVENT.ON_SEEKED,function(){t.eventCallback(nt.SEEKED,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames()})}),this.player.addEventHandler(this.player.EVENT.ON_START_BUFFERING,function(){t.eventCallback(nt.START_BUFFERING)}),this.player.addEventHandler(this.player.EVENT.ON_STOP_BUFFERING,function(){t.eventCallback(nt.END_BUFFERING,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames()})}),this.player.addEventHandler(this.player.EVENT.ON_AUDIO_PLAYBACK_QUALITY_CHANGE,function(){var e=t.player.getPlaybackAudioData();t.eventCallback(nt.AUDIO_CHANGE,{bitrate:e.bitrate,currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames()})}),this.player.addEventHandler(this.player.EVENT.ON_VIDEO_PLAYBACK_QUALITY_CHANGE,function(){var e=t.player.getPlaybackVideoData();t.eventCallback(nt.VIDEO_CHANGE,{width:e.width,height:e.height,bitrate:e.bitrate,currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames()})}),this.player.addEventHandler(this.player.EVENT.ON_FULLSCREEN_ENTER,function(){t.eventCallback(nt.START_FULLSCREEN,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames()})}),this.onBeforeUnLoadEvent=!1,this.player.addEventHandler(this.player.EVENT.ON_FULLSCREEN_EXIT,function(){t.eventCallback(nt.END_FULLSCREEN,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames()})}),this.player.addEventHandler(this.player.EVENT.ON_AD_STARTED,function(){t.eventCallback(nt.START_AD,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames()})}),this.player.addEventHandler(this.player.EVENT.ON_AD_FINISHED,function(){t.eventCallback(nt.END_AD,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames()})}),this.player.addEventHandler(this.player.EVENT.ON_MUTE,function(){t.eventCallback(nt.MUTE,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames()})}),this.player.addEventHandler(this.player.EVENT.ON_UNMUTE,function(){t.eventCallback(nt.UN_MUTE,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames()})}),this.player.addEventHandler(this.player.EVENT.ON_ERROR,function(e){t.eventCallback(nt.ERROR,{code:e&&e.code,message:e&&e.message})}),this.player.addEventHandler(this.player.EVENT.ON_PLAYBACK_FINISHED,function(){t.eventCallback(nt.PLAYBACK_FINISHED,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames()})}),"undefined"!=typeof window?window.onunload=window.onbeforeunload=function(){t.onBeforeUnLoadEvent||(t.onBeforeUnLoadEvent=!0,t.eventCallback(nt.UNLOAD,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames()}))}:this.onBeforeUnLoadEvent||(this.onBeforeUnLoadEvent=!0,this.eventCallback(nt.UNLOAD,{currentTime:this.player.getCurrentTime(),droppedFrames:this.player.getDroppedFrames()}))}}])&&ot(t.prototype,e),a&&ot(t,a),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,a}();function ut(t){return ut="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ut(t)}function mt(t,e){for(var a=0;a<e.length;a++){var i=e[a];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,ht(i.key),i)}}function ht(t){var e=function(t,e){if("object"!=ut(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,e||"default");if("object"!=ut(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==ut(e)?e:e+""}const Et=function(){return t=function t(e,a){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.onBeforeUnLoadEvent=!1,this.player=e,this.eventCallback=a,this.register()},(e=[{key:"register",value:function(){var t=this,e=function(e){if(!e)return{progUrl:void 0,progBitrate:void 0};if("string"==typeof e)return{progUrl:e,progBitrate:0};if(Array.isArray(e)){var a=t.player.getPlaybackVideoData(),i=parseInt(a.id)||0;return{progUrl:e[i].url,progBitrate:e[i].bitrate||0}}return"object"===ut(e)?{progUrl:e.url,progBitrate:e.bitrate||0}:void 0};this.player.addEventHandler(this.player.EVENT.ON_SOURCE_UNLOADED,function(e){t.eventCallback(nt.SOURCE_UNLOADED,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames()})}),this.player.addEventHandler(this.player.EVENT.ON_SOURCE_LOADED,function(a){var i=!1;t.player.getConfig().playback&&t.player.getConfig().playback.autoplay&&(i=t.player.getConfig().playback.autoplay);var r=t.player.getConfig(),n={},s=e(r.source.progressive);r.source&&(n={mpdUrl:r.source.dash,m3u8Url:r.source.hls,progUrl:s.progUrl,progBitrate:s.progBitrate}),t.eventCallback(nt.SOURCE_LOADED,{isLive:t.player.isLive(),version:t.player.version,type:t.player.getPlayerType(),duration:t.player.getDuration(),streamType:t.player.getStreamType(),mpdUrl:n.mpdUrl,m3u8Url:n.m3u8Url,progUrl:n.progUrl,progBitrate:n.progBitrate,videoWindowWidth:t.player.getFigure().offsetWidth,videoWindowHeight:t.player.getFigure().offsetHeight,isMuted:t.player.isMuted(),autoplay:i})}),this.player.addEventHandler(this.player.EVENT.ON_READY,function(){var a=!1;t.player.getConfig().playback&&t.player.getConfig().playback.autoplay&&(a=t.player.getConfig().playback.autoplay);var i=t.player.getConfig(),r={},n=e(i.source.progressive);i.source&&(r={videoId:i.source.videoId,userId:i.source.userId,mpdUrl:i.source.dash,m3u8Url:i.source.hls,progUrl:n.progUrl,progBitrate:n.progBitrate});var s=!0;void 0!==t.player.getConfig().adaptation.preload&&"boolean"==typeof t.player.getConfig().adaptation.preload&&(s=t.player.getConfig().adaptation.preload);var o=t.player.getAudio();o||(o="undetected"),t.eventCallback(nt.READY,{isLive:t.player.isLive(),version:t.player.version,type:t.player.getPlayerType(),duration:t.player.getDuration(),streamType:t.player.getStreamType(),videoId:r.videoId,userId:r.userId,mpdUrl:r.mpdUrl,m3u8Url:r.m3u8Url,progUrl:r.progUrl,progBitrate:r.progBitrate,videoWindowWidth:t.player.getFigure().offsetWidth,videoWindowHeight:t.player.getFigure().offsetHeight,isMuted:t.player.isMuted(),preload:s,audioLanguage:o,isFullScreen:t.player.isFullscreen(),autoplay:a})}),this.player.addEventHandler(this.player.EVENT.ON_CAST_STARTED,function(e){t.eventCallback(nt.START_CAST,e)}),this.player.addEventHandler(this.player.EVENT.ON_CAST_STOPPED,function(){t.eventCallback(nt.END_CAST,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames(),currentVideoData:t.player.getPlaybackVideoData(),isFullScreen:t.player.isFullscreen(),isCasting:t.player.isCasting()})}),this.player.addEventHandler(this.player.EVENT.ON_PLAY,function(){t.eventCallback(nt.PLAY,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames(),currentVideoData:t.player.getPlaybackVideoData(),isFullScreen:t.player.isFullscreen(),isCasting:t.player.isCasting()})}),this.player.addEventHandler(this.player.EVENT.ON_PAUSED,function(){t.eventCallback(nt.PAUSE,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames(),currentVideoData:t.player.getPlaybackVideoData(),isFullScreen:t.player.isFullscreen(),isCasting:t.player.isCasting()})}),this.player.addEventHandler(this.player.EVENT.ON_TIME_CHANGED,function(){t.eventCallback(nt.TIMECHANGED,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames(),currentVideoData:t.player.getPlaybackVideoData(),isFullScreen:t.player.isFullscreen(),isCasting:t.player.isCasting()})}),this.player.addEventHandler(this.player.EVENT.ON_SEEK,function(){t.eventCallback(nt.SEEK,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames(),currentVideoData:t.player.getPlaybackVideoData(),isFullScreen:t.player.isFullscreen(),isCasting:t.player.isCasting()})}),this.player.addEventHandler(this.player.EVENT.ON_SEEKED,function(){t.eventCallback(nt.SEEKED,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames(),currentVideoData:t.player.getPlaybackVideoData(),isFullScreen:t.player.isFullscreen(),isCasting:t.player.isCasting()})}),this.player.addEventHandler(this.player.EVENT.ON_STALL_STARTED,function(){t.eventCallback(nt.START_BUFFERING,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames(),currentVideoData:t.player.getPlaybackVideoData(),isFullScreen:t.player.isFullscreen(),isCasting:t.player.isCasting()})}),this.player.addEventHandler(this.player.EVENT.ON_STALL_ENDED,function(){t.eventCallback(nt.END_BUFFERING,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames(),currentVideoData:t.player.getPlaybackVideoData(),isFullScreen:t.player.isFullscreen(),isCasting:t.player.isCasting()})}),this.player.addEventHandler(this.player.EVENT.ON_AUDIO_PLAYBACK_QUALITY_CHANGED,function(){var e=t.player.getPlaybackAudioData();t.eventCallback(nt.AUDIO_CHANGE,{bitrate:e.bitrate,currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames(),currentVideoData:t.player.getPlaybackVideoData(),isFullScreen:t.player.isFullscreen(),isCasting:t.player.isCasting()})}),this.player.addEventHandler(this.player.EVENT.ON_VIDEO_PLAYBACK_QUALITY_CHANGED,function(){var e=t.player.getPlaybackVideoData();t.eventCallback(nt.VIDEO_CHANGE,{width:e.width,height:e.height,bitrate:e.bitrate,currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames(),currentVideoData:t.player.getPlaybackVideoData(),isFullScreen:t.player.isFullscreen(),isCasting:t.player.isCasting()})}),this.player.addEventHandler(this.player.EVENT.ON_FULLSCREEN_ENTER,function(){t.eventCallback(nt.START_FULLSCREEN,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames(),currentVideoData:t.player.getPlaybackVideoData(),isFullScreen:t.player.isFullscreen(),isCasting:t.player.isCasting()})}),this.player.addEventHandler(this.player.EVENT.ON_FULLSCREEN_EXIT,function(){t.eventCallback(nt.END_FULLSCREEN,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames(),currentVideoData:t.player.getPlaybackVideoData(),isFullScreen:t.player.isFullscreen(),isCasting:t.player.isCasting()})}),this.player.addEventHandler(this.player.EVENT.ON_AD_STARTED,function(){t.eventCallback(nt.START_AD,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames(),currentVideoData:t.player.getPlaybackVideoData(),isFullScreen:t.player.isFullscreen(),isCasting:t.player.isCasting()})}),this.player.addEventHandler(this.player.EVENT.ON_AD_FINISHED,function(){t.eventCallback(nt.END_AD,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames(),currentVideoData:t.player.getPlaybackVideoData(),isFullScreen:t.player.isFullscreen(),isCasting:t.player.isCasting()})}),this.player.addEventHandler(this.player.EVENT.ON_MUTED,function(){t.eventCallback(nt.MUTE,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames(),currentVideoData:t.player.getPlaybackVideoData(),isFullScreen:t.player.isFullscreen(),isCasting:t.player.isCasting()})}),this.player.addEventHandler(this.player.EVENT.ON_UNMUTED,function(){t.eventCallback(nt.UN_MUTE,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames(),currentVideoData:t.player.getPlaybackVideoData(),isFullScreen:t.player.isFullscreen(),isCasting:t.player.isCasting()})}),this.player.addEventHandler(this.player.EVENT.ON_ERROR,function(e){t.eventCallback(nt.ERROR,{code:e&&e.code,message:e&&e.message,currentTime:t.player.getCurrentTime()})}),this.player.addEventHandler(this.player.EVENT.ON_PLAYBACK_FINISHED,function(){t.eventCallback(nt.PLAYBACK_FINISHED,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames()})}),"undefined"!=typeof window?window.onunload=window.onbeforeunload=function(){t.onBeforeUnLoadEvent||(t.onBeforeUnLoadEvent=!0,t.eventCallback(nt.UNLOAD,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames()}))}:this.onBeforeUnLoadEvent||(this.onBeforeUnLoadEvent=!0,this.eventCallback(nt.UNLOAD,{currentTime:this.player.getCurrentTime(),droppedFrames:this.player.getDroppedFrames()}))}}])&&mt(t.prototype,e),a&&mt(t,a),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,a}();function St(t){return St="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},St(t)}function dt(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),a.push.apply(a,i)}return a}function ft(t){for(var e=1;e<arguments.length;e++){var a=null!=arguments[e]?arguments[e]:{};e%2?dt(Object(a),!0).forEach(function(e){pt(t,e,a[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):dt(Object(a)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(a,e))})}return t}function pt(t,e,a){return(e=At(e))in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}function yt(t,e){for(var a=0;a<e.length;a++){var i=e[a];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,At(i.key),i)}}function At(t){var e=function(t,e){if("object"!=St(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,e||"default");if("object"!=St(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==St(e)?e:e+""}const vt=function(){return t=function t(e,a,i){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.onBeforeUnLoadEvent=!1,this.player=e,this.eventCallback=a,this.stateMachine=i,this.register()},(e=[{key:"getStreamType",value:function(t){return t.endsWith(".m3u8")?"hls":t.endsWith(".mpd")?"dash":"progressive"}},{key:"getStreamSources",value:function(t){var e=null,a=null,i=null;switch(this.getStreamType(t)){case"hls":a=t;break;case"dash":e=t;break;default:i=t}return{mpdUrl:e,m3u8Url:a,progUrl:i}}},{key:"getVideoWindowDimensions",value:function(t){return{width:t.el_.clientWidth,height:t.el_.clientHeight}}},{key:"getVideoSourceDimensions",value:function(t){return{videoWidth:t.videoWidth(),videoHeight:t.videoHeight()}}},{key:"getVideojsSourceHandlerMode_",value:function(){var t=this.player.tech({IWillNotUseThisInPlugins:!0});return t.sourceHandler_?t.sourceHandler_.options_.mode:"native"}},{key:"register",value:function(){var t,e,a=this,i=this;this.player.on("loadedmetadata",function(){var t=i.getStreamType(this.currentSrc()),e=i.getStreamSources(this.currentSrc()),a=i.getVideojsSourceHandlerMode_(),r=ft(ft(ft({isLive:this.duration()===1/0,version:videojs.VERSION,type:a,duration:this.duration(),streamType:t,autoplay:this.autoplay()},e),i.getVideoWindowDimensions(this)),{},{videoWindowWidth:this.videoWidth(),videoWindowHeight:this.videoHeight(),muted:this.muted()});i.stateMachine.updateMetadata(r),i.eventCallback(nt.SOURCE_LOADED,r)}),this.player.on("loadeddata",function(){}),this.player.ready(function(){var t=i.getStreamType(this.currentSrc()),e=i.getStreamSources(this.currentSrc()),a=i.getVideojsSourceHandlerMode_(),r=i.getVideoWindowDimensions(this),n={width:null,height:null,bitrate:null};if(this.tech_.hls){var s=this.tech_.hls.playlists.media();if(s){var o=s.attributes;n.bitrate=o.BANDWIDTH,n.width=o.RESOLUTION.width,n.height=o.RESOLUTION.height,n.videoCodec=o.CODECS.split(",")[0],n.audioCodec=o.CODECS.split(",")[1]}}var l=ft(ft(ft({isLive:!1,version:videojs.VERSION,type:a,duration:this.duration(),streamType:t,autoplay:this.autoplay()},e),i.getVideoWindowDimensions(this)),{},{videoWindowWidth:r.width,videoWindowHeight:r.height,muted:this.muted(),currentVideoData:n});i.eventCallback(nt.READY,l)}),this.player.on("play",function(){var t={width:null,height:null,bitrate:null};if(this.tech_.hls){var e=this.tech_.hls.playlists.media();if(e){var a=e.attributes;t.bitrate=a.BANDWIDTH,t.width=a.RESOLUTION.width,t.height=a.RESOLUTION.height,t.videoCodec=a.CODECS.split(",")[0],t.audioCodec=a.CODECS.split(",")[1]}}i.eventCallback(nt.PLAY,{currentTime:this.currentTime(),currentVideoData:t})}),this.player.on("pause",function(){var t={width:null,height:null,bitrate:null};if(this.tech_.hls){var e=this.tech_.hls.playlists.media();if(e){var a=e.attributes;t.bitrate=a.BANDWIDTH,t.width=a.RESOLUTION.width,t.height=a.RESOLUTION.height,t.videoCodec=a.CODECS.split(",")[0],t.audioCodec=a.CODECS.split(",")[1]}}i.eventCallback(nt.PAUSE,{currentTime:this.currentTime(),currentVideoData:t})}),this.player.on("ended",function(){var t={width:null,height:null,bitrate:null};if(this.tech_.hls){var e=this.tech_.hls.playlists.media();if(e){var a=e.attributes;t.bitrate=a.BANDWIDTH,t.width=a.RESOLUTION.width,t.height=a.RESOLUTION.height,t.videoCodec=a.CODECS.split(",")[0],t.audioCodec=a.CODECS.split(",")[1]}}i.eventCallback(nt.END,{currentTime:this.currentTime()})}),this.player.on("error",function(){var t={width:null,height:null,bitrate:null};if(this.tech_.hls){var e=this.tech_.hls.playlists.media();if(e){var a=e.attributes;t.bitrate=a.BANDWIDTH,t.width=a.RESOLUTION.width,t.height=a.RESOLUTION.height}}var r=this.player().error();i.eventCallback(nt.ERROR,{currentTime:this.currentTime(),code:r?r.code:-1,message:r?r.message:"Unknown error"})}),this.player.on("volumechange",function(){var t={width:null,height:null,bitrate:null};if(this.tech_.hls){var e=this.tech_.hls.playlists.media();if(e){var a=e.attributes;t.bitrate=a.BANDWIDTH,t.width=a.RESOLUTION.width,t.height=a.RESOLUTION.height,t.videoCodec=a.CODECS.split(",")[0],t.audioCodec=a.CODECS.split(",")[1]}}this.muted()?i.eventCallback(nt.MUTE,{currentTime:this.currentTime(),currentVideoData:t}):i.eventCallback(nt.UN_MUTE,{currentTime:this.currentTime(),currentVideoData:t})}),this.player.on("seeking",function(){var t={width:null,height:null,bitrate:null};if(this.tech_.hls){var e=this.tech_.hls.playlists.media();if(e){var a=e.attributes;t.bitrate=a.BANDWIDTH,t.width=a.RESOLUTION.width,t.height=a.RESOLUTION.height,t.videoCodec=a.CODECS.split(",")[0],t.audioCodec=a.CODECS.split(",")[1]}}i.eventCallback(nt.SEEK,{currentTime:this.currentTime(),droppedFrames:0,currentVideoData:t})}),this.player.on("seeked",function(){var t={width:null,height:null,bitrate:null};if(this.tech_.hls){var e=this.tech_.hls.playlists.media();if(e){var a=e.attributes;t.bitrate=a.BANDWIDTH,t.width=a.RESOLUTION.width,t.height=a.RESOLUTION.height,t.videoCodec=a.CODECS.split(",")[0],t.audioCodec=a.CODECS.split(",")[1]}}i.eventCallback(nt.SEEKED,{currentTime:this.currentTime(),droppedFrames:0,currentVideoData:t})}),Date.now();var r=!1;this.player.on("timeupdate",function(){var a=this;clearTimeout(e),r=!1,Date.now();var n={width:null,height:null,bitrate:null},s=null;if(this.tech_.hls&&(s=this.tech_.hls.playlists.media())){var o=s.attributes;n.bitrate=o.BANDWIDTH,n.width=o.RESOLUTION.width,n.height=o.RESOLUTION.height,n.videoCodec=o.CODECS.split(",")[0],n.audioCodec=o.CODECS.split(",")[1]}if(i.eventCallback(nt.TIMECHANGED,{currentTime:this.currentTime(),currentVideoData:n}),s){var l=s.attributes,c=l.BANDWIDTH,u=l.RESOLUTION.width,m=l.RESOLUTION.height,h=l.CODECS.split(",")[0],E=l.CODECS.split(",")[1];if(t!==c){var S={width:u,height:m,bitrate:c,videoCodec:h,audioCodec:E,currentTime:this.currentTime(),currentVideoData:n};i.eventCallback(nt.VIDEO_CHANGE,S),t=c}if(e=setTimeout(function(){(!a.paused()&&!a.ended()||r)&&i.eventCallback(nt.START_BUFFERING,{currentTime:a.currentTime()})},1e3),this.tech({IWillNotUseThisInPlugins:!0}).hls){var d=this.tech_.hls;if(!d.playlists||"function"!=typeof d.playlists.media)return;var f=d.playlists.media();if(!f)return;var p=f.attributes,y=p.BANDWIDTH,A=p.RESOLUTION.width,v=p.RESOLUTION.height,_={width:A,height:v,bitrate:y,videoCodec:p.CODECS.split(",")[0],audioCodec:p.CODECS.split(",")[1]};if(isNaN(t)||t!==y){var b={width:A,height:v,bitrate:y,currentTime:this.currentTime(),currentVideoData:_};i.eventCallback(nt.VIDEO_CHANGE,b),t=y}}}}),this.player.on("stalled",function(){r=!0}),"undefined"!=typeof window?window.onunload=window.onbeforeunload=function(){a.onBeforeUnLoadEvent||(a.onBeforeUnLoadEvent=!0,a.eventCallback(nt.UNLOAD,{currentTime:a.player.currentTime()}))}:this.onBeforeUnLoadEvent||(this.onBeforeUnLoadEvent=!0,this.eventCallback(nt.UNLOAD,{currentTime:this.player.currentTime()}))}}])&&yt(t.prototype,e),a&&yt(t,a),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,a}();var _t="video/mp4",bt="video/webm",Nt="application/x-mpegURL",gt="application/dash+xml",Tt=Nt,Dt=gt;function It(t){return It="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},It(t)}function Pt(t,e,a){return(e=function(t){var e=function(t,e){if("object"!=It(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,e||"default");if("object"!=It(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==It(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}var Ct=bt,Ut=Tt,Rt=Dt,Gt=Pt(Pt(Pt(Pt({},_t,"mp4"),Ct,"webm"),Ut,"hls"),Rt,"dash");var Lt={BITMOVIN:"bitmovin",JW:"jw",RADIANT:"radiant",VIDEOJS:"videojs",HLSJS:"hlsjs",SHAKA:"shaka",DASHJS:"dashjs",HTML:"html5",REACTNATIVEVIDEO:"react-native-video"};function kt(t){return kt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},kt(t)}function Yt(t,e){for(var a=0;a<e.length;a++){var i=e[a];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,Ot(i.key),i)}}function Ot(t){var e=function(t,e){if("object"!=kt(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,e||"default");if("object"!=kt(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==kt(e)?e:e+""}var wt=function(){return t=function t(e,a,i){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.eventCallback=a,this.playerSoftwareName=r||Lt.HTML,this.stateMachine=i,this.mediaEl=e,this.mediaElEventHandlers=[],this.analyticsBitrate_=-1,this.audioCodec_="",this.videoCodec_="",this.bufferingTimeout_=null,this.isBuffering_=!1,this.isLive_=!1,this.isPaused_=!1,this.previousMediaTime_=null,this.needsReadyEvent_=!0,this.needsFirstPlayIntent_=!0,this.mediaElementSet_=!1,this.playbackReadySet_=!1,e&&this.setMediaElement()},e=[{key:"setMediaElement",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(t&&this.mediaEl&&(this.unregisterMediaElement(),this.mediaElementSet_=!1),t&&(this.mediaEl=t),!this.mediaEl)throw new Error("No media element owned");if(this.mediaElementSet_)throw new Error("Media element already set (only call this once)");this.mediaElementSet_=!0,this.registerMediaElement(),this.onMaybeReady()}},{key:"getCurrentQualityLevelInfo",value:function(){return null}},{key:"isLive",value:function(){return!1}},{key:"getMIMEType",value:function(){var t,e=this.mediaEl,a="";return e||(a=null),a=e&&e.src?e.src:e&&e.querySelector("source")&&e.querySelector("source").src?e.querySelector("source").src:null,(t=(t=a).toLowerCase()).endsWith(".m3u8")?Nt:t.endsWith(".mp4")||t.endsWith(".m4v")||t.endsWith(".m4a")?_t:t.endsWith(".webm")?bt:t.endsWith(".mpd")?gt:null}},{key:"getStreamType",value:function(){return t=this.getMIMEType(),Gt[t];var t}},{key:"getPlayerVersion",value:function(){return null}},{key:"getStreamURL",value:function(){var t=this.mediaEl;return t?t&&t.src?t.src:t&&t.querySelector("source")&&t.querySelector("source").src?t.querySelector("source").src:null:null}},{key:"resetMedia",value:function(){this.mediaEl=null,this.mediaElEventHandlers=[]}},{key:"registerMediaElement",value:function(){var t=this,e=this.mediaEl;e&&(this.listenToMediaElementEvent("loadedmetadata",function(){if(1===e.readyState){t.checkQualityLevelAttributes(!0);var a=e.duration,i=e.autoplay,r=e.videoWidth,n=e.videoHeight,s=e.muted,o=e.clientWidth,l=e.clientHeight,c={type:"html5",isLive:t.isLive(),version:t.getPlayerVersion()||"html5",streamType:t.getStreamType(),streamUrl:t.getStreamURL(),duration:a,autoplay:i,currentVideoData:{height:n,width:r,bitrate:t.analyticsBitrate_,audioCodec:t.audioCodec_,videoCodec:t.videoCodec_},videoWindowWidth:parseInt(o),videoWindowHeight:parseInt(l),muted:s};t.needsFirstPlayIntent_||t.eventCallback(nt.METADATA_LOADED,c)}}),this.listenToMediaElementEvent("canplay",function(){if(!t.playbackReadySet_){t.playbackReadySet_=!0;var a=e.duration,i=e.autoplay,r=e.videoWidth,n=e.videoHeight,s=e.muted,o=e.clientWidth,l=e.clientHeight,c={type:"html5",isLive:t.isLive(),version:t.getPlayerVersion()||"html5",streamType:t.getStreamType(),streamUrl:t.getStreamURL(),duration:a,autoplay:i,playerSoftware:t.playerSoftwareName,videoWindowWidth:parseInt(o),videoWindowHeight:parseInt(l),currentVideoData:{height:n,width:r,bitrate:t.analyticsBitrate_,audioCodec:t.audioCodec_,videoCodec:t.videoCodec_},muted:s};t.eventCallback(nt.SOURCE_LOADED,c)}}),this.listenToMediaElementEvent("play",function(){var a=e.currentTime,i=e.videoWidth,r=e.videoHeight;t.needsFirstPlayIntent_=!1,t.eventCallback(nt.PLAY,{currentVideoData:{height:r,width:i,bitrate:t.analyticsBitrate_,audioCodec:t.audioCodec_,videoCodec:t.videoCodec_},currentTime:a})}),this.listenToMediaElementEvent("pause",function(){t.onPaused()}),this.listenToMediaElementEvent("playing",function(){var a=e.currentTime,i=e.videoWidth,r=e.videoHeight;t.isPaused_=!1,t.needsFirstPlayIntent_||t.eventCallback(nt.TIMECHANGED,{currentVideoData:{height:r,width:i,bitrate:t.analyticsBitrate_,audioCodec:t.audioCodec_,videoCodec:t.videoCodec_},currentTime:a})}),this.listenToMediaElementEvent("error",function(){X.log("HTML5 ERROR!!");var a=e.currentTime,i=e.error;t.eventCallback(nt.ERROR,{currentTime:a,code:i&&i.code,message:i&&i.message})}),this.listenToMediaElementEvent("volumechange",function(){var a=e.muted,i=e.currentTime;a?t.eventCallback(nt.MUTE,{currentTime:i}):t.eventCallback(nt.UN_MUTE,{currentTime:i})}),this.listenToMediaElementEvent("seeking",function(){var a=e.currentTime,i=e.videoWidth,r=e.videoHeight;t.eventCallback(nt.SEEK,{currentVideoData:{height:r,width:i,bitrate:t.analyticsBitrate_,audioCodec:t.audioCodec_,videoCodec:t.videoCodec_},currentTime:a,droppedFrames:0})}),this.listenToMediaElementEvent("seeked",function(){var a=e.currentTime,i=e.videoWidth,r=e.videoHeight;t.bufferingTimeout_&&clearTimeout(t.bufferingTimeout_),t.eventCallback(nt.SEEKED,{currentVideoData:{height:r,width:i,bitrate:t.analyticsBitrate_,audioCodec:t.audioCodec_,videoCodec:t.videoCodec_},currentTime:a,droppedFrames:0})}),this.listenToMediaElementEvent("ended",function(){var a=e.currentTime,i=e.videoWidth,r=e.videoHeight;t.eventCallback(nt.END,{currentVideoData:{height:r,width:i,bitrate:t.analyticsBitrate_,audioCodec:t.audioCodec_,videoCodec:t.videoCodec_},currentTime:a})}),this.listenToMediaElementEvent("timeupdate",function(){var a=e.currentTime,i=e.videoHeight,r=e.videoWidth;t.isBuffering_=!1,t.needsFirstPlayIntent_||(t.isPaused_||t.eventCallback(nt.TIMECHANGED,{currentVideoData:{height:i,width:r,bitrate:t.analyticsBitrate_,audioCodec:t.audioCodec_,videoCodec:t.videoCodec_},currentTime:a}),t.checkQualityLevelAttributes(),t.checkPlayheadProgress(),t.previousMediaTime_=a)}),this.listenToMediaElementEvent("stalled",function(){}),this.listenToMediaElementEvent("waiting",function(){t.onBuffering()}))}},{key:"listenToMediaElementEvent",value:function(t,e){if(!this.mediaEl)throw new Error("No media attached");var a=e.bind(this);this.mediaElEventHandlers.push({handler:a,event:t}),this.mediaEl.addEventListener(t,a,!1)}},{key:"onMaybeReady",value:function(){if(this.needsReadyEvent_&&this.mediaEl){this.needsReadyEvent_=!1;var t=!1,e=this.mediaEl,a=e.duration,i=e.autoplay,r=e.videoWidth,n=e.videoHeight,s=e.muted,o=e.preload;this.mediaEl&&this.mediaEl.src?this.mediaEl.src:this.mediaEl&&this.mediaEl.querySelector("source")&&this.mediaEl.querySelector("source").src&&this.mediaEl.querySelector("source").src;var l=this.mediaEl.clientWidth,c=this.mediaEl.clientHeight;"none"!==o&&(t=!0);var u={type:"html5",isLive:this.isLive(),version:this.getPlayerVersion()||"html5",streamType:this.getStreamType(),streamUrl:this.getStreamURL(),duration:a,autoplay:i,preload:t,playerSoftware:this.playerSoftwareName,currentVideoData:{height:n,width:r,bitrate:this.analyticsBitrate_,audioCodec:this.audioCodec_,videoCodec:this.videoCodec_},videoWindowWidth:parseInt(l),videoWindowHeight:parseInt(c),muted:s};this.stateMachine.updateMetadata(u),this.eventCallback(nt.READY,u)}}},{key:"unregisterMediaElement",value:function(){var t=this;if(!this.mediaEl)throw new Error("No media attached");this.mediaElEventHandlers.forEach(function(e){t.mediaEl.removeEventListener(e.event,e.handler,!1)}),this.resetMedia()}},{key:"onBuffering",value:function(){var t=this.mediaEl.currentTime;this.isBuffering_||this.isPaused_||(this.eventCallback(nt.START_BUFFERING,{currentTime:t}),this.isBuffering_=!0)}},{key:"onPaused",value:function(){if(!this.isPaused_){var t=this.mediaEl,e=t.currentTime,a=t.videoHeight,i=t.videoWidth;this.eventCallback(nt.PAUSE,{currentVideoData:{height:a,width:i,bitrate:this.analyticsBitrate_,audioCodec:this.audioCodec_,videoCodec:this.videoCodec_},currentTime:e}),this.isPaused_=!0}}},{key:"checkPlayheadProgress",value:function(){var t=this,e=this.mediaEl;e.paused&&this.onPaused(),this.bufferingTimeout_&&clearTimeout(this.bufferingTimeout_),this.bufferingTimeout_=setTimeout(function(){e.paused||e.ended&&!t.isBuffering_||e.currentTime-t.previousMediaTime_<1e3&&t.onBuffering()},1e3)}},{key:"checkQualityLevelAttributes",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this.mediaEl,a=this.getCurrentQualityLevelInfo();if(a){var i=a.bitrate,r=a.width,n=a.height,s=a.videoCodec,o=a.audioCodec,l=this.isLive();if(l!==this.isLive_&&(this.isLive_=l,t||this.stateMachine.updateMetadata({isLive:l})),this.audioCodec_=o,this.videoCodec_=s,this.analyticsBitrate_!==i){var c={width:r,height:n,bitrate:i,videoCodec:s,audioCodec:o,currentTime:e.currentTime};t||this.eventCallback(nt.VIDEO_CHANGE,c),this.analyticsBitrate_=i}}}}],e&&Yt(t.prototype,e),a&&Yt(t,a),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,a}();function Ft(t){return Ft="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ft(t)}function Mt(t,e){for(var a=0;a<e.length;a++){var i=e[a];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,Ht(i.key),i)}}function Ht(t){var e=function(t,e){if("object"!=Ft(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,e||"default");if("object"!=Ft(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Ft(e)?e:e+""}function Kt(t,e,a){return e=Bt(e),function(t,e){if(e&&("object"==Ft(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Vt()?Reflect.construct(e,a||[],Bt(t).constructor):e.apply(t,a))}function Vt(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Vt=function(){return!!t})()}function Bt(t){return Bt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Bt(t)}function jt(t,e){return jt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},jt(t,e)}var Wt=function(t){function e(t,a,i){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=Kt(this,e,[null,a,i,Lt.HLSJS])).hls=t,r.playerSoftwareName=Lt.HLSJS,r.resetMedia(),r.registerHlsEvents(),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&jt(t,e)}(e,t),a=e,(i=[{key:"getCurrentQualityLevelInfo",value:function(){var t=this.hls,e=t.levels[t.currentLevel];if(e){var a=e.attrs,i=a.BANDWIDTH?parseInt(a.BANDWIDTH,10):0,r=a.RESOLUTION&&a.RESOLUTION.width?parseInt(a.RESOLUTION.width,10):0,n=a.RESOLUTION&&a.RESOLUTION.height?parseInt(a.RESOLUTION.height,10):0,s=null,o=null;return a.CODECS&&(s=a.CODECS.split(",").length>1?a.CODECS.split(",")[1]:"",o=a.CODECS.split(",").length>1?a.CODECS.split(",")[0]:""),{bitrate:i,width:r,height:n,audioCodec:s,videoCodec:o}}}},{key:"isLive",value:function(){var t=this.hls;if(t.currentLevel<0)return!1;var e=t.levels[t.currentLevel];return!!e&&e.details.live}},{key:"getPlayerVersion",value:function(){return Hls.version}},{key:"getMIMEType",value:function(){return Tt}},{key:"getStreamURL",value:function(){return this.hls.url}},{key:"registerHlsEvents",value:function(){var t=this,e=this.hls;if(!Hls)throw new Error("Hls.js is not defined installed (must be loaded before analytics module)");e.on(Hls.Events.MEDIA_ATTACHING,this.onMediaAttaching.bind(this)),e.on(Hls.Events.MEDIA_DETACHING,this.onMediaDetaching.bind(this)),e.on(Hls.Events.MANIFEST_LOADING,this.onManifestLoading.bind(this)),e.on(Hls.Events.ERROR,function(e,a){t.onError(a)}),e.media&&this.onMediaAttaching(),e.url&&this.onManifestLoading()}},{key:"onMediaAttaching",value:function(){this.mediaEl||(this.mediaEl=this.hls.media,this.registerMediaElement(),this.onMaybeReady())}},{key:"onMediaDetaching",value:function(){this.unregisterMediaElement()}},{key:"onManifestLoading",value:function(){this.onMaybeReady()}},{key:"onError",value:function(t){var e,a,i,r,n,s,o,l,c;console.log("HLS ERROR!!"),X.log("HLS ERROR!!");var u=this.mediaEl.currentTime;Object.hasOwn(t,"fatal")&&t.fatal&&Object.hasOwn(t,"details")&&"internalException"===t.details&&console.error(t),this.eventCallback(nt.ERROR,{currentTime:u,code:null==t?void 0:t.type,message:JSON.stringify({details:null==t?void 0:t.details,fatal:null==t?void 0:t.fatal,type:null==t?void 0:t.type,fragment_url:null==t?void 0:t.url,error:{message:null==t||null===(e=t.error)||void 0===e?void 0:e.message,stack:null==t||null===(a=t.error)||void 0===a?void 0:a.stack},extra:{networkDetails:{status:null==t||null===(i=t.networkDetails)||void 0===i?void 0:i.status,statusText:null==t||null===(r=t.networkDetails)||void 0===r?void 0:r.statusText,url:null==t||null===(n=t.networkDetails)||void 0===n?void 0:n.url,responseHeaders:null==t||null===(s=t.networkDetails)||void 0===s?void 0:s.responseHeaders,responseText:null==t||null===(o=t.networkDetails)||void 0===o?void 0:o.responseText,responseURL:null==t||null===(l=t.networkDetails)||void 0===l?void 0:l.responseURL,data:null==t||null===(c=t.networkDetails)||void 0===c?void 0:c.data}}})})}}])&&Mt(a.prototype,i),r&&Mt(a,r),Object.defineProperty(a,"prototype",{writable:!1}),a;var a,i,r}(wt);function xt(t){return xt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xt(t)}function Qt(){var t,e,a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",r=a.toStringTag||"@@toStringTag";function n(a,i,r,n){var l=i&&i.prototype instanceof o?i:o,c=Object.create(l.prototype);return qt(c,"_invoke",function(a,i,r){var n,o,l,c=0,u=r||[],m=!1,h={p:0,n:0,v:t,a:E,f:E.bind(t,4),d:function(e,a){return n=e,o=0,l=t,h.n=a,s}};function E(a,i){for(o=a,l=i,e=0;!m&&c&&!r&&e<u.length;e++){var r,n=u[e],E=h.p,S=n[2];a>3?(r=S===i)&&(l=n[(o=n[4])?5:(o=3,3)],n[4]=n[5]=t):n[0]<=E&&((r=a<2&&E<n[1])?(o=0,h.v=i,h.n=n[1]):E<S&&(r=a<3||n[0]>i||i>S)&&(n[4]=a,n[5]=i,h.n=S,o=0))}if(r||a>1)return s;throw m=!0,i}return function(r,u,S){if(c>1)throw TypeError("Generator is already running");for(m&&1===u&&E(u,S),o=u,l=S;(e=o<2?t:l)||!m;){n||(o?o<3?(o>1&&(h.n=-1),E(o,l)):h.n=l:h.v=l);try{if(c=2,n){if(o||(r="next"),e=n[r]){if(!(e=e.call(n,l)))throw TypeError("iterator result is not an object");if(!e.done)return e;l=e.value,o<2&&(o=0)}else 1===o&&(e=n.return)&&e.call(n),o<2&&(l=TypeError("The iterator does not provide a '"+r+"' method"),o=1);n=t}else if((e=(m=h.n<0)?l:a.call(i,h))!==s)break}catch(e){n=t,o=1,l=e}finally{c=1}}return{value:e,done:m}}}(a,r,n),!0),c}var s={};function o(){}function l(){}function c(){}e=Object.getPrototypeOf;var u=[][i]?e(e([][i]())):(qt(e={},i,function(){return this}),e),m=c.prototype=o.prototype=Object.create(u);function h(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,c):(t.__proto__=c,qt(t,r,"GeneratorFunction")),t.prototype=Object.create(m),t}return l.prototype=c,qt(m,"constructor",c),qt(c,"constructor",l),l.displayName="GeneratorFunction",qt(c,r,"GeneratorFunction"),qt(m),qt(m,r,"Generator"),qt(m,i,function(){return this}),qt(m,"toString",function(){return"[object Generator]"}),(Qt=function(){return{w:n,m:h}})()}function qt(t,e,a,i){var r=Object.defineProperty;try{r({},"",{})}catch(t){r=0}qt=function(t,e,a,i){function n(e,a){qt(t,e,function(t){return this._invoke(e,a,t)})}e?r?r(t,e,{value:a,enumerable:!i,configurable:!i,writable:!i}):t[e]=a:(n("next",0),n("throw",1),n("return",2))},qt(t,e,a,i)}function Jt(t,e){var a="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!a){if(Array.isArray(t)||(a=function(t,e){if(t){if("string"==typeof t)return $t(t,e);var a={}.toString.call(t).slice(8,-1);return"Object"===a&&t.constructor&&(a=t.constructor.name),"Map"===a||"Set"===a?Array.from(t):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?$t(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){a&&(t=a);var i=0,r=function(){};return{s:r,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var n,s=!0,o=!1;return{s:function(){a=a.call(t)},n:function(){var t=a.next();return s=t.done,t},e:function(t){o=!0,n=t},f:function(){try{s||null==a.return||a.return()}finally{if(o)throw n}}}}function $t(t,e){(null==e||e>t.length)&&(e=t.length);for(var a=0,i=Array(e);a<e;a++)i[a]=t[a];return i}function Xt(t,e,a,i,r,n,s){try{var o=t[n](s),l=o.value}catch(t){return void a(t)}o.done?e(l):Promise.resolve(l).then(i,r)}function zt(t,e){for(var a=0;a<e.length;a++){var i=e[a];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,Zt(i.key),i)}}function Zt(t){var e=function(t,e){if("object"!=xt(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,e||"default");if("object"!=xt(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==xt(e)?e:e+""}function te(t,e,a){return e=ae(e),function(t,e){if(e&&("object"==xt(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,ee()?Reflect.construct(e,a||[],ae(t).constructor):e.apply(t,a))}function ee(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(ee=function(){return!!t})()}function ae(t){return ae=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ae(t)}function ie(t,e){return ie=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ie(t,e)}var re=function(t){function e(t,a,i,r){var n;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),n=te(this,e,[r,a,i,Lt.SHAKA]),!shaka)throw new Error("`shaka` lib is not installed (must be loaded before analytics module)");return n.shakaPlayer=t,n.playerSoftwareName=Lt.SHAKA,n.registerShakaEvents(),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ie(t,e)}(e,t),a=e,i=[{key:"getPlayerVersion",value:function(){return shaka.Player.version}},{key:"isLive",value:function(){return!!this.shakaPlayer&&this.shakaPlayer.isLive()}},{key:"getMIMEType",value:function(){return Dt}},{key:"getStreamURL",value:function(){return this.shakaPlayer?this.shakaPlayer.getAssetUri():null}},{key:"registerShakaEvents",value:function(){var t=this,e=this.shakaPlayer;if(!e)throw new Error("Shaka player object is not defined");e.addEventListener("error",function(e){t.onGumletShakaError(e,t.eventCallback,t.mediaEl)})}},{key:"onGumletShakaError",value:(n=Qt().m(function t(e,a,i){var r,n,s,o,l,c,u,m,h,E,S;return Qt().w(function(t){for(;;)switch(t.p=t.n){case 0:if(console.log("Shaka ERROR!!"),X.log("Shaka ERROR!!"),r=0,i&&(r=this.mediaEl.currentTime),!e.detail){t.n=9;break}if(n=e.detail,s=[],e.detail.data&&e.detail.data.forEach(function(t){s.push(t)}),o=[],this.shakaPlayer.getVariantTracks().forEach(function(t){o.push({width:t.width,height:t.height,bitrate:t.videoBandwidth||t.bandwidth,framerate:t.frameRate,contentType:"".concat(t.mimeType,'; codecs="').concat(t.videoCodec,'"')})}),l=[],!(navigator&&navigator.mediaCapabilities&&navigator.mediaCapabilities.decodingInfo)){t.n=8;break}c=Jt(o),t.p=1,c.s();case 2:if((u=c.n()).done){t.n=5;break}return m=u.value,h=m,t.n=3,navigator.mediaCapabilities.decodingInfo({type:"media-source",video:m});case 3:h.mediaCapabilities=t.v,l.push(h);case 4:t.n=2;break;case 5:t.n=7;break;case 6:t.p=6,S=t.v,c.e(S);case 7:return t.p=7,c.f(),t.f(7);case 8:E=this.getCurrentQualityLevelInfo(),null==n||n.code,a(nt.ERROR,{currentTime:r,code:n.code,message:JSON.stringify({category:null==n?void 0:n.v,code:null==n?void 0:n.code,severity:null==n?void 0:n.severity,handled:null==n?void 0:n.handled,timestamp:null==e?void 0:e.timestamp,extra_data:s,media_capabilities:l,selected_quality_info:E})}),t.n=10;break;case 9:eventCallback(nt.ERROR,{currentTime:r,code:"not_set_by_shaka",message:"{}"});case 10:return t.a(2)}},t,this,[[1,6,7,8]])}),s=function(){var t=this,e=arguments;return new Promise(function(a,i){var r=n.apply(t,e);function s(t){Xt(r,a,i,s,o,"next",t)}function o(t){Xt(r,a,i,s,o,"throw",t)}s(void 0)})},function(t,e,a){return s.apply(this,arguments)})},{key:"getCurrentQualityLevelInfo",value:function(){var t=this.shakaPlayer.getVariantTracks().filter(function(t){return t.active}).filter(function(t){return t.videoCodec||void 0!==t.videoId})[0];return t?{bitrate:t.videoBandwidth||t.bandwidth,width:t.width,height:t.height,videoCodec:t.videoCodec,audioCodec:t.audioCodec}:null}}],i&&zt(a.prototype,i),r&&zt(a,r),Object.defineProperty(a,"prototype",{writable:!1}),a;var a,i,r,n,s}(wt);function ne(t){return ne="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ne(t)}function se(t,e){for(var a=0;a<e.length;a++){var i=e[a];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,oe(i.key),i)}}function oe(t){var e=function(t,e){if("object"!=ne(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,e||"default");if("object"!=ne(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==ne(e)?e:e+""}function le(t,e,a){return e=ue(e),function(t,e){if(e&&("object"==ne(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,ce()?Reflect.construct(e,a||[],ue(t).constructor):e.apply(t,a))}function ce(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(ce=function(){return!!t})()}function ue(t){return ue=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ue(t)}function me(t,e){return me=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},me(t,e)}var he=function(t){function e(t,a,i){var r;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),r=le(this,e,[null,a,i,Lt.DASHJS]);var n=null,s=!1;r.playerSoftwareName=Lt.DASHJS;try{n=t.getVideoElement()}catch(t){}return n?r._initialize(t,n):t.on(dashjs.MediaPlayer.events.CAN_PLAY,function(){if(!s){n=t.getVideoElement(),s=!0,r._initialize(t,n);var e=n,a=e.duration,i=e.autoplay,o=e.videoWidth,l=e.videoHeight,c=e.muted,u=n.clientWidth,m=n.clientHeight,h={type:"html5",isLive:r.isLive(),version:r.getPlayerVersion()||"html5",streamType:r.getStreamType(),streamUrl:r.getStreamURL(),duration:a,autoplay:i,playerSoftware:r.playerSoftwareName,videoWindowWidth:parseInt(u),videoWindowHeight:parseInt(m),currentVideoData:{height:l,width:o,bitrate:r.analyticsBitrate_,audioCodec:r.audioCodec_,videoCodec:r.videoCodec_},muted:c};r.eventCallback(nt.SOURCE_LOADED,h)}},r),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&me(t,e)}(e,t),a=e,(i=[{key:"_initialize",value:function(t,e){this.mediaPlayer=t,this.setMediaElement(e)}},{key:"getPlayerVersion",value:function(){return this.mediaPlayer.getVersion()}},{key:"isLive",value:function(){return!1}},{key:"getMIMEType",value:function(){return Dt}},{key:"getStreamURL",value:function(){return this.mediaPlayer?this.mediaPlayer.getSource():null}},{key:"getCurrentQualityLevelInfo",value:function(){if(this.mediaPlayer){var t=this.mediaPlayer.getBitrateInfoListFor("video")[this.mediaPlayer.getQualityFor("video")],e=this.mediaPlayer.getCurrentTrackFor("video"),a=this.mediaPlayer.getCurrentTrackFor("audio"),i=t.width,r=t.height,n=t.bitrate,s=null,o=null;return e&&(o=e.codec.split('"').length>0?e.codec.split('"')[1]:e.codec),a&&(s=a.codec.split('"').length>0?a.codec.split('"')[1]:a.codec),{width:i,height:r,bitrate:n,audioCodec:s,videoCodec:o}}return null}}])&&se(a.prototype,i),r&&se(a,r),Object.defineProperty(a,"prototype",{writable:!1}),a;var a,i,r}(wt);function Ee(t){return Ee="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ee(t)}function Se(t,e){for(var a=0;a<e.length;a++){var i=e[a];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,de(i.key),i)}}function de(t){var e=function(t,e){if("object"!=Ee(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,e||"default");if("object"!=Ee(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Ee(e)?e:e+""}const fe=function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)},a=[{key:"getAdapter",value:function(t,e,a){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return rt.isBitmovinVersionPre7(t)?new ct(t,e):rt.isBitmovinVersion7Plus(t)?new Et(t,e):rt.isVideoJs(t)?new vt(t,e,a):rt.isHlsjs(t)?new Wt(t,e,a):rt.isShaka(t)?new re(t,e,a,i):rt.isDashjs(t)?new he(t,e,a):new wt(t,e,a)}}],(e=null)&&Se(t.prototype,e),a&&Se(t,a),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,a}();var pe=a(595),ye=a.n(pe);function Ae(t){return Ae="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ae(t)}function ve(t,e){for(var a=0;a<e.length;a++){var i=e[a];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,be(i.key),i)}}function _e(t,e,a){return(e=be(e))in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}function be(t){var e=function(t,e){if("object"!=Ae(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,e||"default");if("object"!=Ae(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Ae(e)?e:e+""}var Ne=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.stateMachineCallbacks=e,this.customData={previousRecordTime:0,playbackWatchTime:0},this.pausedTimestamp=null,this.seekTimestamp=0,this.seekedTimestamp=0,this.seekedTimeout=0,this.onEnterStateTimestamp=0,this.States={SETUP:"SETUP",STARTUP:"STARTUP",READY:"READY",PLAYING:"PLAYING",REBUFFERING:"REBUFFERING",PAUSE:"PAUSE",QUALITYCHANGE:"QUALITYCHANGE",PAUSED_SEEKING:"PAUSED_SEEKING",PLAY_SEEKING:"PLAY_SEEKING",END_PLAY_SEEKING:"END_PLAY_SEEKING",QUALITYCHANGE_PAUSE:"QUALITYCHANGE_PAUSE",END:"END",ERROR:"ERROR",AD:"AD",MUTING_READY:"MUTING_READY",MUTING_PLAY:"MUTING_PLAY",MUTING_PAUSE:"MUTING_PAUSE"},this.createStateMachine()}return e=t,i=[{key:"pad",value:function(t,e){return(t+new Array(e).join(" ")).slice(0,e)}}],(a=[{key:"createStateMachine",value:function(){var e=this,a=[nt.PLAY,nt.PAUSE,nt.SEEK,nt.SEEKED,nt.PLAYBACK_PLAYING,nt.PLAYBACK_FINISHED,nt.READY,nt.SCREEN_RESIZE,nt.END,nt.ERROR,nt.UN_MUTE,nt.MUTE];this.stateMachine=ye().create({initial:this.States.SETUP,error:function(t,e,a,i,r,n,s){X.error(n)},events:[{name:nt.READY,from:[this.States.SETUP,this.States.ERROR],to:this.States.READY},{name:nt.PLAY,from:this.States.READY,to:this.States.STARTUP},{name:nt.START_BUFFERING,from:this.States.STARTUP,to:this.States.STARTUP},{name:nt.END_BUFFERING,from:this.States.STARTUP,to:this.States.STARTUP},{name:nt.TIMECHANGED,from:this.States.STARTUP,to:this.States.PLAYING},{name:nt.TIMECHANGED,from:this.States.PLAYING,to:this.States.PLAYING},{name:nt.END_BUFFERING,from:this.States.PLAYING,to:this.States.PLAYING},{name:nt.START_BUFFERING,from:this.States.PLAYING,to:this.States.REBUFFERING},{name:nt.END_BUFFERING,from:this.States.REBUFFERING,to:this.States.PLAYING},{name:nt.TIMECHANGED,from:this.States.REBUFFERING,to:this.States.REBUFFERING},{name:nt.PAUSE,from:this.States.PLAYING,to:this.States.PAUSE},{name:nt.PAUSE,from:this.States.REBUFFERING,to:this.States.PAUSE},{name:nt.PLAY,from:this.States.PAUSE,to:this.States.PLAYING},{name:nt.VIDEO_CHANGE,from:this.States.PLAYING,to:this.States.QUALITYCHANGE},{name:nt.AUDIO_CHANGE,from:this.States.PLAYING,to:this.States.QUALITYCHANGE},{name:nt.VIDEO_CHANGE,from:this.States.QUALITYCHANGE,to:this.States.QUALITYCHANGE},{name:nt.AUDIO_CHANGE,from:this.States.QUALITYCHANGE,to:this.States.QUALITYCHANGE},{name:"FINISH_QUALITYCHANGE",from:this.States.QUALITYCHANGE,to:this.States.PLAYING},{name:nt.VIDEO_CHANGE,from:this.States.PAUSE,to:this.States.QUALITYCHANGE_PAUSE},{name:nt.AUDIO_CHANGE,from:this.States.PAUSE,to:this.States.QUALITYCHANGE_PAUSE},{name:nt.VIDEO_CHANGE,from:this.States.QUALITYCHANGE_PAUSE,to:this.States.QUALITYCHANGE_PAUSE},{name:nt.AUDIO_CHANGE,from:this.States.QUALITYCHANGE_PAUSE,to:this.States.QUALITYCHANGE_PAUSE},{name:"FINISH_QUALITYCHANGE_PAUSE",from:this.States.QUALITYCHANGE_PAUSE,to:this.States.PAUSE},{name:nt.SEEK,from:this.States.PAUSE,to:this.States.PAUSED_SEEKING},{name:nt.SEEK,from:this.States.PAUSED_SEEKING,to:this.States.PAUSED_SEEKING},{name:nt.AUDIO_CHANGE,from:this.States.PAUSED_SEEKING,to:this.States.PAUSED_SEEKING},{name:nt.VIDEO_CHANGE,from:this.States.PAUSED_SEEKING,to:this.States.PAUSED_SEEKING},{name:nt.START_BUFFERING,from:this.States.PAUSED_SEEKING,to:this.States.PAUSED_SEEKING},{name:nt.END_BUFFERING,from:this.States.PAUSED_SEEKING,to:this.States.PAUSED_SEEKING},{name:nt.SEEKED,from:this.States.PAUSED_SEEKING,to:this.States.PAUSE},{name:nt.PLAY,from:this.States.PAUSED_SEEKING,to:this.States.PLAYING},{name:nt.PAUSE,from:this.States.PAUSED_SEEKING,to:this.States.PAUSE},{name:"PLAY_SEEK",from:this.States.PAUSE,to:this.States.PLAY_SEEKING},{name:"PLAY_SEEK",from:this.States.PAUSED_SEEKING,to:this.States.PLAY_SEEKING},{name:"PLAY_SEEK",from:this.States.PLAY_SEEKING,to:this.States.PLAY_SEEKING},{name:nt.SEEK,from:this.States.PLAY_SEEKING,to:this.States.PLAY_SEEKING},{name:nt.AUDIO_CHANGE,from:this.States.PLAY_SEEKING,to:this.States.PLAY_SEEKING},{name:nt.VIDEO_CHANGE,from:this.States.PLAY_SEEKING,to:this.States.PLAY_SEEKING},{name:nt.START_BUFFERING,from:this.States.PLAY_SEEKING,to:this.States.PLAY_SEEKING},{name:nt.END_BUFFERING,from:this.States.PLAY_SEEKING,to:this.States.PLAY_SEEKING},{name:nt.SEEKED,from:this.States.PLAY_SEEKING,to:this.States.PLAY_SEEKING},{name:nt.PLAY,from:this.States.PLAY_SEEKING,to:this.States.END_PLAY_SEEKING},{name:nt.START_BUFFERING,from:this.States.END_PLAY_SEEKING,to:this.States.END_PLAY_SEEKING},{name:nt.END_BUFFERING,from:this.States.END_PLAY_SEEKING,to:this.States.END_PLAY_SEEKING},{name:nt.SEEKED,from:this.States.END_PLAY_SEEKING,to:this.States.END_PLAY_SEEKING},{name:nt.TIMECHANGED,from:this.States.END_PLAY_SEEKING,to:this.States.PLAYING},{name:nt.END,from:this.States.PLAY_SEEKING,to:this.States.END},{name:nt.END,from:this.States.PAUSED_SEEKING,to:this.States.END},{name:nt.END,from:this.States.PLAYING,to:this.States.END},{name:nt.END,from:this.States.PAUSE,to:this.States.END},{name:nt.SEEK,from:this.States.END,to:this.States.END},{name:nt.SEEKED,from:this.States.END,to:this.States.END},{name:nt.TIMECHANGED,from:this.States.END,to:this.States.END},{name:nt.END_BUFFERING,from:this.States.END,to:this.States.END},{name:nt.START_BUFFERING,from:this.States.END,to:this.States.END},{name:nt.END,from:this.States.END,to:this.States.END},{name:nt.PLAY,from:this.States.END,to:this.States.PLAYING},{name:nt.ERROR,from:[this.States.SETUP,this.States.STARTUP,this.States.READY,this.States.PLAYING,this.States.REBUFFERING,this.States.PAUSE,this.States.QUALITYCHANGE,this.States.PAUSED_SEEKING,this.States.PLAY_SEEKING,this.States.END_PLAY_SEEKING,this.States.QUALITYCHANGE_PAUSE,"FINISH_PLAY_SEEKING","PLAY_SEEK","FINISH_QUALITYCHANGE_PAUSE","FINISH_QUALITYCHANGE",this.States.END,this.States.ERROR],to:this.States.ERROR},{name:nt.SEEK,from:this.States.END_PLAY_SEEKING,to:this.States.PLAY_SEEKING},{name:"FINISH_PLAY_SEEKING",from:this.States.END_PLAY_SEEKING,to:this.States.PLAYING},{name:nt.UNLOAD,from:[this.States.PLAYING,this.States.PAUSE],to:this.States.END},{name:nt.START_AD,from:this.States.PLAYING,to:this.States.AD},{name:nt.END_AD,from:this.States.AD,to:this.States.PLAYING},{name:nt.MUTE,from:this.States.READY,to:this.States.MUTING_READY},{name:nt.UN_MUTE,from:this.States.READY,to:this.States.MUTING_READY},{name:"FINISH_MUTING",from:this.States.MUTING_READY,to:this.States.READY},{name:nt.MUTE,from:this.States.PLAYING,to:this.States.MUTING_PLAY},{name:nt.UN_MUTE,from:this.States.PLAYING,to:this.States.MUTING_PLAY},{name:"FINISH_MUTING",from:this.States.MUTING_PLAY,to:this.States.PLAYING},{name:nt.MUTE,from:this.States.PAUSE,to:this.States.MUTING_PAUSE},{name:nt.UN_MUTE,from:this.States.PAUSE,to:this.States.MUTING_PAUSE},{name:"FINISH_MUTING",from:this.States.MUTING_PAUSE,to:this.States.PAUSE}],callbacks:{onpause:function(t,a,i,r){e.stateMachineCallbacks.playbackWatchTime(e.customData.playbackWatchTime),a===e.States.PLAYING&&(e.pausedTimestamp=r)},onbeforeevent:function(i,r,n,s,o){return e.stateMachineCallbacks.playbackWatchTime(e.customData.playbackWatchTime),a.includes(i)&&(i===nt.PLAYBACK_FINISHED&&(e.customData.previousRecordTime=0),e.customData.previousRecordTime=o.currentTime),i===nt.SEEK&&r===e.States.PAUSE&&s-e.pausedTimestamp<t.PAUSE_SEEK_DELAY?(e.stateMachine.PLAY_SEEK(s),!1):(i===nt.SEEK&&clearTimeout(e.seekedTimeout),i===nt.SEEKED&&r===e.States.PAUSED_SEEKING?(e.seekedTimestamp=s,e.seekedTimeout=setTimeout(function(){e.stateMachine.pause(s,o)},t.SEEKED_PAUSE_DELAY),!1):void 0)},onafterevent:function(i,r,n,s,o){e.stateMachineCallbacks.playbackWatchTime(e.customData.playbackWatchTime),a.includes(i)&&(i===nt.PLAYBACK_FINISHED&&(e.customData.previousRecordTime=0),e.customData.previousRecordTime=o.currentTime),X.log(t.pad(s,20)+"EVENT: "+t.pad(i,20)+" from "+t.pad(r,14)+"-> "+t.pad(n,14)),n===e.States.QUALITYCHANGE_PAUSE&&e.stateMachine.FINISH_QUALITYCHANGE_PAUSE(s),n===e.States.QUALITYCHANGE&&e.stateMachine.FINISH_QUALITYCHANGE(s),n!==e.States.MUTING_READY&&n!==e.States.MUTING_PLAY&&n!==e.States.MUTING_PAUSE||e.stateMachine.FINISH_MUTING(s)},onenterstate:function(t,i,r,n,s){e.stateMachineCallbacks.playbackWatchTime(e.customData.playbackWatchTime),a.includes(t)&&(t===nt.PLAYBACK_FINISHED&&(e.customData.previousRecordTime=0),e.customData.previousRecordTime=s.currentTime),e.onEnterStateTimestamp=n||(new Date).getTime(),X.log("Entering State "+r+" with "+t),s&&r!==e.States.PAUSED_SEEKING&&e.stateMachineCallbacks.setVideoTimeStartFromEvent(s)},onleavestate:function(t,i,r,n,s){if(e.stateMachineCallbacks.playbackWatchTime(e.customData.playbackWatchTime),a.includes(t)&&(t===nt.PLAYBACK_FINISHED&&(e.customData.previousRecordTime=0),e.customData.previousRecordTime=s.currentTime),n){var o=n-e.onEnterStateTimestamp;X.log("State "+i+" was "+o+" ms event:"+t),s&&r!==e.States.PAUSED_SEEKING&&e.stateMachineCallbacks.setVideoTimeEndFromEvent(s);var l=i.toLowerCase();if(i===e.States.END_PLAY_SEEKING||i===e.States.PAUSED_SEEKING){var c=e.seekedTimestamp-e.seekTimestamp;e.stateMachineCallbacks[l](c,l,s),X.log("Seek was "+c+"ms")}else if(t===nt.UNLOAD&&i===e.States.PLAYING)e.stateMachineCallbacks.playingAndBye(o,l,s);else if(i===e.States.PAUSE&&r!==e.States.PAUSED_SEEKING)e.stateMachineCallbacks.setVideoTimeStartFromEvent(t),e.stateMachineCallbacks.pause(o,l,s),e.stateMachineCallbacks.heartbeat(n,l,s);else{var u=e.stateMachineCallbacks[l];"function"==typeof u?u(o,l,s):X.error("Could not find callback function for "+l)}s&&r!==e.States.PAUSED_SEEKING&&e.stateMachineCallbacks.setVideoTimeStartFromEvent(s),t===nt.VIDEO_CHANGE?e.stateMachineCallbacks.videoChange(s):t===nt.AUDIO_CHANGE?e.stateMachineCallbacks.audioChange(s):t===nt.MUTE?(X.log("Setting sample to muted"),e.stateMachineCallbacks.mute()):t===nt.UN_MUTE&&(X.log("Setting sample to unmuted"),e.stateMachineCallbacks.unMute())}},onseek:function(t,a,i,r,n){e.customData.previousRecordTime=n.currentTime,e.stateMachineCallbacks.playbackWatchTime(e.customData.playbackWatchTime),e.seekTimestamp=r},onseeked:function(t,a,i,r,n){e.customData.previousRecordTime=n.currentTime,e.stateMachineCallbacks.playbackWatchTime(e.customData.playbackWatchTime),e.seekedTimestamp=r},ontimechanged:function(t,a,i,r,n){e.stateMachineCallbacks.playbackWatchTime(e.customData.playbackWatchTime);var s=n.currentTime-e.customData.previousRecordTime;s>0&&s<5&&(e.customData.playbackWatchTime+=Math.round(1e3*(n.currentTime-e.customData.previousRecordTime)),e.customData.previousRecordTime=n.currentTime);var o=r-e.onEnterStateTimestamp;o>59700&&(e.stateMachineCallbacks.setVideoTimeEndFromEvent(n),X.log("Sending heartbeat"),e.stateMachineCallbacks.heartbeat(o,a.toLowerCase(),n),e.onEnterStateTimestamp=r,e.stateMachineCallbacks.setVideoTimeStartFromEvent(n))},onplayerError:function(t,a,i,r,n){e.stateMachineCallbacks.error(n)}}})}},{key:"callEvent",value:function(t,e,a){var i=this.stateMachine[t];i?i.call(this.stateMachine,a,e):X.log("Ignored Event: "+t)}}])&&ve(e.prototype,a),i&&ve(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,a,i}();function ge(t){return ge="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ge(t)}function Te(t){return function(t){if(Array.isArray(t))return De(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return De(t,e);var a={}.toString.call(t).slice(8,-1);return"Object"===a&&t.constructor&&(a=t.constructor.name),"Map"===a||"Set"===a?Array.from(t):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?De(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function De(t,e){(null==e||e>t.length)&&(e=t.length);for(var a=0,i=Array(e);a<e;a++)i[a]=t[a];return i}function Ie(t,e){for(var a=0;a<e.length;a++){var i=e[a];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,Ce(i.key),i)}}function Pe(t,e,a){return(e=Ce(e))in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}function Ce(t){var e=function(t,e){if("object"!=ge(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,e||"default");if("object"!=ge(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==ge(e)?e:e+""}_e(Ne,"PAUSE_SEEK_DELAY",60),_e(Ne,"SEEKED_PAUSE_DELAY",120);var Ue=function(){function t(e){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.stateMachineCallbacks=e,this.customData={previousRecordTime:0,playbackWatchTime:0},this.pausedTimestamp=null,this.seekTimestamp=0,this.seekedTimestamp=0,this.seekedTimeout=0,this.seekedFrom=0,this.onEnterStateTimestamp=0,this.lastPlayHeadDuration=0,this.States={SETUP:"SETUP",STARTUP:"STARTUP",READY:"READY",PLAYING:"PLAYING",REBUFFERING:"REBUFFERING",PAUSE:"PAUSE",QUALITYCHANGE:"QUALITYCHANGE",PAUSED_SEEKING:"PAUSED_SEEKING",PLAY_SEEKING:"PLAY_SEEKING",END_PLAY_SEEKING:"END_PLAY_SEEKING",QUALITYCHANGE_PAUSE:"QUALITYCHANGE_PAUSE",QUALITYCHANGE_REBUFFERING:"QUALITYCHANGE_REBUFFERING",END:"END",ERROR:"ERROR",AD:"AD",MUTING_READY:"MUTING_READY",MUTING_PLAY:"MUTING_PLAY",MUTING_PAUSE:"MUTING_PAUSE",CASTING:"CASTING",SOURCE_CHANGING:"SOURCE_CHANGING"},this.createStateMachine(a)}return e=t,a=[{key:"getAllStates",value:function(){var t=this;return[].concat(Te(Object.keys(this.States).map(function(e){return t.States[e]})),["FINISH_PLAY_SEEKING","PLAY_SEEK","FINISH_QUALITYCHANGE_PAUSE","FINISH_QUALITYCHANGE","FINISH_QUALITYCHANGE_REBUFFERING"])}},{key:"createStateMachine",value:function(){var e=this,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=[nt.PLAY,nt.PAUSE,nt.SEEK,nt.SEEKED,nt.PLAYBACK_PLAYING,nt.PLAYBACK_FINISHED,nt.READY,nt.SCREEN_RESIZE,nt.END,nt.ERROR,nt.UN_MUTE,nt.MUTE];this.stateMachine=ye().create({initial:this.States.SETUP,error:function(t,e,a,i,r,n){X.error("Error in statemachine: "+n)},events:[{name:nt.READY,from:[this.States.SETUP,this.States.ERROR],to:this.States.READY},{name:nt.PLAY,from:this.States.READY,to:this.States.STARTUP},{name:nt.START_BUFFERING,from:this.States.STARTUP,to:this.States.STARTUP},{name:nt.END_BUFFERING,from:this.States.STARTUP,to:this.States.STARTUP},{name:nt.VIDEO_CHANGE,from:this.States.STARTUP,to:this.States.STARTUP},{name:nt.AUDIO_CHANGE,from:this.States.STARTUP,to:this.States.STARTUP},{name:nt.TIMECHANGED,from:this.States.STARTUP,to:this.States.PLAYING},{name:nt.TIMECHANGED,from:this.States.PLAYING,to:this.States.PLAYING},{name:nt.END_BUFFERING,from:this.States.PLAYING,to:this.States.PLAYING},{name:nt.START_BUFFERING,from:this.States.PLAYING,to:this.States.REBUFFERING},{name:nt.END_BUFFERING,from:this.States.REBUFFERING,to:this.States.PLAYING},{name:nt.TIMECHANGED,from:this.States.REBUFFERING,to:this.States.REBUFFERING},{name:nt.PAUSE,from:this.States.PLAYING,to:this.States.PAUSE},{name:nt.PAUSE,from:this.States.REBUFFERING,to:this.States.PAUSE},{name:nt.PLAY,from:this.States.PAUSE,to:this.States.PLAYING},{name:nt.VIDEO_CHANGE,from:this.States.PLAYING,to:this.States.QUALITYCHANGE},{name:nt.AUDIO_CHANGE,from:this.States.PLAYING,to:this.States.QUALITYCHANGE},{name:nt.VIDEO_CHANGE,from:this.States.QUALITYCHANGE,to:this.States.QUALITYCHANGE},{name:nt.AUDIO_CHANGE,from:this.States.QUALITYCHANGE,to:this.States.QUALITYCHANGE},{name:"FINISH_QUALITYCHANGE",from:this.States.QUALITYCHANGE,to:this.States.PLAYING},{name:nt.VIDEO_CHANGE,from:this.States.PAUSE,to:this.States.QUALITYCHANGE_PAUSE},{name:nt.AUDIO_CHANGE,from:this.States.PAUSE,to:this.States.QUALITYCHANGE_PAUSE},{name:nt.VIDEO_CHANGE,from:this.States.QUALITYCHANGE_PAUSE,to:this.States.QUALITYCHANGE_PAUSE},{name:nt.AUDIO_CHANGE,from:this.States.QUALITYCHANGE_PAUSE,to:this.States.QUALITYCHANGE_PAUSE},{name:"FINISH_QUALITYCHANGE_PAUSE",from:this.States.QUALITYCHANGE_PAUSE,to:this.States.PAUSE},{name:nt.SEEK,from:this.States.PAUSE,to:this.States.PAUSED_SEEKING},{name:nt.SEEK,from:this.States.PAUSED_SEEKING,to:this.States.PAUSED_SEEKING},{name:nt.AUDIO_CHANGE,from:this.States.PAUSED_SEEKING,to:this.States.PAUSED_SEEKING},{name:nt.VIDEO_CHANGE,from:this.States.PAUSED_SEEKING,to:this.States.PAUSED_SEEKING},{name:nt.START_BUFFERING,from:this.States.PAUSED_SEEKING,to:this.States.PAUSED_SEEKING},{name:nt.END_BUFFERING,from:this.States.PAUSED_SEEKING,to:this.States.PAUSED_SEEKING},{name:nt.SEEKED,from:this.States.PAUSED_SEEKING,to:this.States.PAUSE},{name:nt.PLAY,from:this.States.PAUSED_SEEKING,to:this.States.PLAYING},{name:nt.PAUSE,from:this.States.PAUSED_SEEKING,to:this.States.PAUSE},{name:"PLAY_SEEK",from:this.States.PAUSE,to:this.States.PLAY_SEEKING},{name:"PLAY_SEEK",from:this.States.PAUSED_SEEKING,to:this.States.PLAY_SEEKING},{name:"PLAY_SEEK",from:this.States.PLAY_SEEKING,to:this.States.PLAY_SEEKING},{name:nt.SEEK,from:this.States.PLAY_SEEKING,to:this.States.PLAY_SEEKING},{name:nt.AUDIO_CHANGE,from:this.States.PLAY_SEEKING,to:this.States.PLAY_SEEKING},{name:nt.VIDEO_CHANGE,from:this.States.PLAY_SEEKING,to:this.States.PLAY_SEEKING},{name:nt.START_BUFFERING,from:this.States.PLAY_SEEKING,to:this.States.PLAY_SEEKING},{name:nt.END_BUFFERING,from:this.States.PLAY_SEEKING,to:this.States.PLAY_SEEKING},{name:nt.SEEKED,from:this.States.PLAY_SEEKING,to:this.States.PLAY_SEEKING},{name:nt.PLAY,from:this.States.PLAY_SEEKING,to:this.States.END_PLAY_SEEKING},{name:nt.START_BUFFERING,from:this.States.END_PLAY_SEEKING,to:this.States.END_PLAY_SEEKING},{name:nt.END_BUFFERING,from:this.States.END_PLAY_SEEKING,to:this.States.END_PLAY_SEEKING},{name:nt.SEEKED,from:this.States.END_PLAY_SEEKING,to:this.States.END_PLAY_SEEKING},{name:nt.TIMECHANGED,from:this.States.END_PLAY_SEEKING,to:this.States.PLAYING},{name:nt.END,from:this.States.PLAY_SEEKING,to:this.States.END},{name:nt.END,from:this.States.PAUSED_SEEKING,to:this.States.END},{name:nt.END,from:this.States.PLAYING,to:this.States.END},{name:nt.END,from:this.States.PAUSE,to:this.States.END},{name:nt.SEEK,from:this.States.END,to:this.States.END},{name:nt.SEEKED,from:this.States.END,to:this.States.END},{name:nt.TIMECHANGED,from:this.States.END,to:this.States.END},{name:nt.END_BUFFERING,from:this.States.END,to:this.States.END},{name:nt.START_BUFFERING,from:this.States.END,to:this.States.END},{name:nt.END,from:this.States.END,to:this.States.END},{name:nt.PLAY,from:this.States.END,to:this.States.PLAYING},{name:nt.ERROR,from:this.getAllStates(),to:this.States.ERROR},{name:nt.SEEK,from:this.States.END_PLAY_SEEKING,to:this.States.PLAY_SEEKING},{name:"FINISH_PLAY_SEEKING",from:this.States.END_PLAY_SEEKING,to:this.States.PLAYING},{name:nt.UNLOAD,from:this.getAllStates(),to:this.States.END},{name:nt.START_AD,from:this.States.PLAYING,to:this.States.AD},{name:nt.END_AD,from:this.States.AD,to:this.States.PLAYING},{name:nt.MUTE,from:this.States.READY,to:this.States.MUTING_READY},{name:nt.UN_MUTE,from:this.States.READY,to:this.States.MUTING_READY},{name:"FINISH_MUTING",from:this.States.MUTING_READY,to:this.States.READY},{name:nt.MUTE,from:this.States.PLAYING,to:this.States.MUTING_PLAY},{name:nt.UN_MUTE,from:this.States.PLAYING,to:this.States.MUTING_PLAY},{name:"FINISH_MUTING",from:this.States.MUTING_PLAY,to:this.States.PLAYING},{name:nt.MUTE,from:this.States.PAUSE,to:this.States.MUTING_PAUSE},{name:nt.UN_MUTE,from:this.States.PAUSE,to:this.States.MUTING_PAUSE},{name:"FINISH_MUTING",from:this.States.MUTING_PAUSE,to:this.States.PAUSE},{name:nt.START_CAST,from:[this.States.READY,this.States.PAUSE],to:this.States.CASTING},{name:nt.PAUSE,from:this.States.CASTING,to:this.States.CASTING},{name:nt.PLAY,from:this.States.CASTING,to:this.States.CASTING},{name:nt.TIMECHANGED,from:this.States.CASTING,to:this.States.CASTING},{name:nt.MUTE,from:this.States.CASTING,to:this.States.CASTING},{name:nt.SEEK,from:this.States.CASTING,to:this.States.CASTING},{name:nt.SEEKED,from:this.States.CASTING,to:this.States.CASTING},{name:nt.END_CAST,from:this.States.CASTING,to:this.States.READY},{name:nt.SEEK,from:this.States.READY,to:this.States.READY},{name:nt.SEEKED,from:this.States.READY,to:this.States.READY},{name:nt.SEEKED,from:this.States.STARTUP,to:this.States.STARTUP},{name:nt.SOURCE_UNLOADED,from:this.getAllStates(),to:this.States.SOURCE_CHANGING},{name:nt.READY,from:this.States.SOURCE_CHANGING,to:this.States.READY},{name:nt.SOURCE_LOADED,from:this.States.SETUP,to:this.States.SETUP},{name:nt.SOURCE_LOADED,from:this.States.READY,to:this.States.READY},{name:nt.VIDEO_CHANGE,from:this.States.REBUFFERING,to:this.States.QUALITYCHANGE_REBUFFERING},{name:nt.AUDIO_CHANGE,from:this.States.REBUFFERING,to:this.States.QUALITYCHANGE_REBUFFERING},{name:nt.VIDEO_CHANGE,from:this.States.QUALITYCHANGE_REBUFFERING,to:this.States.QUALITYCHANGE_REBUFFERING},{name:nt.AUDIO_CHANGE,from:this.States.QUALITYCHANGE_REBUFFERING,to:this.States.QUALITYCHANGE_REBUFFERING},{name:"FINISH_QUALITYCHANGE_REBUFFERING",from:this.States.QUALITYCHANGE_REBUFFERING,to:this.States.REBUFFERING}],callbacks:{onpause:function(t,a,i,r){e.stateMachineCallbacks.playbackWatchTime(e.customData.playbackWatchTime),a===e.States.PLAYING&&(e.pausedTimestamp=r)},onbeforeevent:function(a,r,n,s,o){return e.stateMachineCallbacks.playbackWatchTime(e.customData.playbackWatchTime),i.includes(a)&&(a===nt.PLAYBACK_FINISHED&&(e.customData.previousRecordTime=0),e.customData.previousRecordTime=o.currentTime),a===nt.SEEK&&r===e.States.PAUSE&&(e.seekedFrom=e.lastPlayHeadDuration,e.seekTimestamp=s,s-e.pausedTimestamp<t.PAUSE_SEEK_DELAY)?(e.stateMachine.PLAY_SEEK(s),!1):(a===nt.SEEK&&clearTimeout(e.seekedTimeout),a!==nt.SOURCE_LOADED?a===nt.SEEKED&&r===e.States.PAUSED_SEEKING?(e.seekedTimestamp=s,e.seekedTimeout=setTimeout(function(){e.stateMachine.pause(s,o)},t.SEEKED_PAUSE_DELAY),!1):(r!==e.States.REBUFFERING||n!==e.States.QUALITYCHANGE_REBUFFERING)&&void(o&&(e.lastPlayHeadDuration=1e3*o.currentTime)):void e.stateMachineCallbacks.loaded(s,e.States.READY,o))},onafterevent:function(t,a,r,n,s){e.stateMachineCallbacks.playbackWatchTime(e.customData.playbackWatchTime),i.includes(t)&&(t===nt.PLAYBACK_FINISHED&&(e.customData.previousRecordTime=0),e.customData.previousRecordTime=s.currentTime),r===e.States.QUALITYCHANGE_PAUSE&&e.stateMachine.FINISH_QUALITYCHANGE_PAUSE(n),r===e.States.QUALITYCHANGE&&e.stateMachine.FINISH_QUALITYCHANGE(n),r===e.States.QUALITYCHANGE_REBUFFERING&&e.stateMachine.FINISH_QUALITYCHANGE_REBUFFERING(n),r!==e.States.MUTING_READY&&r!==e.States.MUTING_PLAY&&r!==e.States.MUTING_PAUSE||e.stateMachine.FINISH_MUTING(n)},onenterstate:function(t,r,n,s,o){e.stateMachineCallbacks.playbackWatchTime(e.customData.playbackWatchTime),i.includes(t)&&(t===nt.PLAYBACK_FINISHED&&(e.customData.previousRecordTime=0),e.customData.previousRecordTime=o.currentTime),n===e.States.SETUP?e.stateMachineCallbacks.setup(s,e.States.SETUP,o,a):n===e.States.READY?(o.playerSoftware="Bitmovin",e.stateMachineCallbacks.ready(s,e.States.READY,o)):"play"===t&&n===e.States.STARTUP?e.stateMachineCallbacks.first_play(s,e.States.PLAY,o):"play"===t&&r===e.States.PAUSE?(e.stateMachineCallbacks.play(s,e.States.PLAY,o),e.stateMachineCallbacks.playing(s,e.States.PLAYING,o),e.stateMachineCallbacks.heartbeat(s,e.States.PLAY,o)):"timechanged"===t&&r===e.States.STARTUP&&n===e.States.PLAYING?(e.stateMachineCallbacks.playing(s,e.States.PLAYING,o),e.stateMachineCallbacks.playback_started(o)):n===e.States.PAUSE&&r===e.States.PLAYING?(e.stateMachineCallbacks.pause(s,e.States.PAUSE,o),e.stateMachineCallbacks.heartbeat(s,e.States.PAUSE,o)):n===e.States.END?(e.stateMachineCallbacks.end(s,e.States.END,o),e.stateMachineCallbacks.heartbeat(s,e.States.END,o)):n===e.States.MUTING_PAUSE?e.stateMachineCallbacks.mute(s,o):t===nt.START_BUFFERING?e.stateMachineCallbacks.start_rebuffer(s,e.States.REBUFFERING,o):t===nt.END_BUFFERING&&e.stateMachineCallbacks.end_rebuffer(s,e.States.REBUFFERING,o),"none"===r&&a.starttime?e.onEnterStateTimestamp=a.starttime:e.onEnterStateTimestamp=s||(new Date).getTime(),o&&n!==e.States.PAUSED_SEEKING&&n!==e.States.PLAY_SEEKING&&n!==e.States.END_PLAY_SEEKING&&e.stateMachineCallbacks.setVideoTimeStartFromEvent(o),"PLAY_SEEK"===t&&n===e.States.PLAY_SEEKING&&n!==e.States.PLAY_SEEKING&&n!==e.States.END_PLAY_SEEKING&&(e.seekTimestamp=e.onEnterStateTimestamp)},onleavestate:function(t,a,r,n,s){if(e.stateMachineCallbacks.playbackWatchTime(e.customData.playbackWatchTime),n){i.includes(t)&&(t===nt.PLAYBACK_FINISHED&&(e.customData.previousRecordTime=0),e.customData.previousRecordTime=s.currentTime);var o=n-e.onEnterStateTimestamp;if(s&&r!==e.States.PAUSED_SEEKING&&r!==e.States.PLAY_SEEKING&&r!==e.States.END_PLAY_SEEKING&&(console.log("ERRRRRRRRRR"),X.log("ERRRRRRRRRR"),X.log("Setting video time end to "+s.currentTime+", going to "+r),e.stateMachineCallbacks.setVideoTimeEndFromEvent(s)),"PLAY_SEEK"===t&&a===e.States.PAUSE)return!0;var l=a.toLowerCase();if(a===e.States.END_PLAY_SEEKING||a===e.States.PAUSED_SEEKING){var c=e.seekedTimestamp-e.seekTimestamp;e.stateMachineCallbacks.playback_seeked(e.seekedFrom,1e3*s.currentTime,c,r),e.stateMachineCallbacks.heartbeat(n,e.States.PLAY,s),X.log("Seek was "+c+"ms")}else t===nt.UNLOAD&&a===e.States.PLAYING?e.stateMachineCallbacks.playingAndBye(o,l,s):a===e.States.PAUSE&&r!==e.States.PAUSED_SEEKING&&e.stateMachineCallbacks.setVideoTimeStartFromEvent(t);t===nt.VIDEO_CHANGE?e.stateMachineCallbacks.videoChange(s):t===nt.AUDIO_CHANGE?e.stateMachineCallbacks.audioChange(s):t===nt.MUTE?(X.log("Setting sample to muted"),e.stateMachineCallbacks.mute()):t===nt.UN_MUTE&&(X.log("Setting sample to unmuted"),e.stateMachineCallbacks.unMute())}},onseek:function(t,a,i,r,n){e.customData.previousRecordTime=n.currentTime,e.stateMachineCallbacks.playbackWatchTime(e.customData.playbackWatchTime),e.seekTimestamp=r},onseeked:function(t,a,i,r,n){e.customData.previousRecordTime=n.currentTime,e.stateMachineCallbacks.playbackWatchTime(e.customData.playbackWatchTime),e.seekedTimestamp=r},ontimechanged:function(t,a,i,r,n){e.stateMachineCallbacks.playbackWatchTime(e.customData.playbackWatchTime);var s=n.currentTime-e.customData.previousRecordTime;s>0&&s<5&&(e.customData.playbackWatchTime+=Math.round(1e3*(n.currentTime-e.customData.previousRecordTime)),e.customData.previousRecordTime=n.currentTime);var o=r-e.onEnterStateTimestamp;o>{HEARTBEAT_THRESHOLD:d}&&(e.stateMachineCallbacks.setVideoTimeEndFromEvent(n),X.log("Sending heartbeat"),e.stateMachineCallbacks.heartbeat(o,a.toLowerCase(),n),e.onEnterStateTimestamp=r,e.stateMachineCallbacks.setVideoTimeStartFromEvent(n))},onplayerError:function(t,a,i,r,n){e.stateMachineCallbacks.error(n)}}})}},{key:"callEvent",value:function(t,e,a){var i=this.stateMachine[t];i?i.call(this.stateMachine,a,e):X.log("Ignored Event: "+t)}}],i=[{key:"pad",value:function(t,e){return(t+new Array(e).join(" ")).slice(0,e)}}],a&&Ie(e.prototype,a),i&&Ie(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,a,i}();function Re(t){return Re="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Re(t)}function Ge(t){return function(t){if(Array.isArray(t))return Le(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return Le(t,e);var a={}.toString.call(t).slice(8,-1);return"Object"===a&&t.constructor&&(a=t.constructor.name),"Map"===a||"Set"===a?Array.from(t):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?Le(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Le(t,e){(null==e||e>t.length)&&(e=t.length);for(var a=0,i=Array(e);a<e;a++)i[a]=t[a];return i}function ke(t,e){for(var a=0;a<e.length;a++){var i=e[a];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,Oe(i.key),i)}}function Ye(t,e,a){return(e=Oe(e))in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}function Oe(t){var e=function(t,e){if("object"!=Re(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,e||"default");if("object"!=Re(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Re(e)?e:e+""}Pe(Ue,"PAUSE_SEEK_DELAY",200),Pe(Ue,"SEEKED_PAUSE_DELAY",300);var we=function(){function t(e){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.stateMachineCallbacks=e,this.customData={previousRecordTime:0,playbackWatchTime:0},this.pausedTimestamp=null,this.seekTimestamp=0,this.seekedTimestamp=0,this.seekedTimeout=0,this.onEnterStateTimestamp=0,this.lastPlayHeadDuration=0,this.autoPlay=!1,this.States={SETUP:"SETUP",STARTUP:"STARTUP",READY:"READY",PLAYING:"PLAYING",REBUFFERING:"REBUFFERING",PAUSE:"PAUSE",QUALITYCHANGE:"QUALITYCHANGE",PAUSED_SEEKING:"PAUSED_SEEKING",PLAY_SEEKING:"PLAY_SEEKING",END_PLAY_SEEKING:"END_PLAY_SEEKING",QUALITYCHANGE_PAUSE:"QUALITYCHANGE_PAUSE",QUALITYCHANGE_REBUFFERING:"QUALITYCHANGE_REBUFFERING",END:"END",ERROR:"ERROR",MUTING_READY:"MUTING_READY",MUTING_PLAY:"MUTING_PLAY",MUTING_PAUSE:"MUTING_PAUSE",CASTING:"CASTING"},this.createStateMachine(a)}return e=t,a=[{key:"getAllStates",value:function(){var t=this;return[].concat(Ge(Object.keys(this.States).map(function(e){return t.States[e]})),["FINISH_PLAY_SEEKING","PLAY_SEEK","FINISH_QUALITYCHANGE_PAUSE","FINISH_QUALITYCHANGE","FINISH_QUALITYCHANGE_REBUFFERING"])}},{key:"createStateMachine",value:function(){var e=this,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=[nt.PLAY,nt.PAUSE,nt.SEEK,nt.SEEKED,nt.PLAYBACK_PLAYING,nt.PLAYBACK_FINISHED,nt.READY,nt.SCREEN_RESIZE,nt.END,nt.ERROR,nt.UN_MUTE,nt.MUTE];this.stateMachine=ye().create({initial:this.States.SETUP,error:function(t,e,a,i,r,n){X.error("Error in statemachine: "+n)},events:[{name:nt.TIMECHANGED,from:this.States.SETUP,to:this.States.SETUP},{name:nt.READY,from:[this.States.SETUP,this.States.ERROR],to:this.States.READY},{name:nt.PLAY,from:this.States.READY,to:this.States.STARTUP},{name:nt.PLAY,from:this.States.SETUP,to:this.States.SETUP},{name:nt.TIMECHANGED,from:this.States.READY,to:this.States.STARTUP},{name:nt.START_BUFFERING,from:this.States.STARTUP,to:this.States.STARTUP},{name:nt.END_BUFFERING,from:this.States.STARTUP,to:this.States.STARTUP},{name:nt.VIDEO_CHANGE,from:this.States.STARTUP,to:this.States.STARTUP},{name:nt.AUDIO_CHANGE,from:this.States.STARTUP,to:this.States.STARTUP},{name:nt.TIMECHANGED,from:this.States.STARTUP,to:this.States.PLAYING},{name:nt.TIMECHANGED,from:this.States.PLAYING,to:this.States.PLAYING},{name:nt.END_BUFFERING,from:this.States.PLAYING,to:this.States.PLAYING},{name:nt.START_BUFFERING,from:this.States.PLAYING,to:this.States.REBUFFERING},{name:nt.START_BUFFERING,from:this.States.REBUFFERING,to:this.States.REBUFFERING},{name:nt.TIMECHANGED,from:this.States.REBUFFERING,to:this.States.PLAYING},{name:nt.SEEK,from:this.States.STARTUP,to:this.States.STARTUP},{name:nt.SEEK,from:this.States.PLAYING,to:this.States.PLAY_SEEKING},{name:nt.TIMECHANGED,from:this.States.PLAY_SEEKING,to:this.States.PLAY_SEEKING},{name:nt.TIMECHANGED,from:this.States.PAUSED_SEEKING,to:this.States.PAUSED_SEEKING},{name:nt.PAUSE,from:this.States.PLAYING,to:this.States.PAUSE},{name:nt.PAUSE,from:this.States.REBUFFERING,to:this.States.PAUSE},{name:nt.TIMECHANGED,from:this.States.PAUSE,to:this.States.PAUSE},{name:nt.PLAY,from:this.States.PAUSE,to:this.States.PLAYING},{name:nt.VIDEO_CHANGE,from:this.States.PLAYING,to:this.States.QUALITYCHANGE},{name:nt.AUDIO_CHANGE,from:this.States.PLAYING,to:this.States.QUALITYCHANGE},{name:nt.VIDEO_CHANGE,from:this.States.QUALITYCHANGE,to:this.States.QUALITYCHANGE},{name:nt.AUDIO_CHANGE,from:this.States.QUALITYCHANGE,to:this.States.QUALITYCHANGE},{name:"FINISH_QUALITYCHANGE",from:this.States.QUALITYCHANGE,to:this.States.PLAYING},{name:nt.VIDEO_CHANGE,from:this.States.PAUSE,to:this.States.QUALITYCHANGE_PAUSE},{name:nt.AUDIO_CHANGE,from:this.States.PAUSE,to:this.States.QUALITYCHANGE_PAUSE},{name:nt.VIDEO_CHANGE,from:this.States.QUALITYCHANGE_PAUSE,to:this.States.QUALITYCHANGE_PAUSE},{name:nt.AUDIO_CHANGE,from:this.States.QUALITYCHANGE_PAUSE,to:this.States.QUALITYCHANGE_PAUSE},{name:"FINISH_QUALITYCHANGE_PAUSE",from:this.States.QUALITYCHANGE_PAUSE,to:this.States.PAUSE},{name:nt.SEEK,from:this.States.PAUSE,to:this.States.PAUSED_SEEKING},{name:nt.SEEK,from:this.States.PAUSED_SEEKING,to:this.States.PAUSED_SEEKING},{name:nt.AUDIO_CHANGE,from:this.States.PAUSED_SEEKING,to:this.States.PAUSED_SEEKING},{name:nt.VIDEO_CHANGE,from:this.States.PAUSED_SEEKING,to:this.States.PAUSED_SEEKING},{name:nt.START_BUFFERING,from:this.States.PAUSED_SEEKING,to:this.States.PAUSED_SEEKING},{name:nt.END_BUFFERING,from:this.States.PAUSED_SEEKING,to:this.States.PAUSED_SEEKING},{name:nt.SEEKED,from:this.States.PAUSED_SEEKING,to:this.States.PAUSE},{name:nt.PLAY,from:this.States.PAUSED_SEEKING,to:this.States.PLAYING},{name:nt.PAUSE,from:this.States.PAUSED_SEEKING,to:this.States.PAUSE},{name:"PLAY_SEEK",from:this.States.PAUSE,to:this.States.PLAY_SEEKING},{name:"PLAY_SEEK",from:this.States.PAUSED_SEEKING,to:this.States.PLAY_SEEKING},{name:"PLAY_SEEK",from:this.States.PLAY_SEEKING,to:this.States.PLAY_SEEKING},{name:nt.SEEK,from:this.States.PLAY_SEEKING,to:this.States.PLAY_SEEKING},{name:nt.AUDIO_CHANGE,from:this.States.PLAY_SEEKING,to:this.States.PLAY_SEEKING},{name:nt.VIDEO_CHANGE,from:this.States.PLAY_SEEKING,to:this.States.PLAY_SEEKING},{name:nt.START_BUFFERING,from:this.States.PLAY_SEEKING,to:this.States.PLAY_SEEKING},{name:nt.END_BUFFERING,from:this.States.PLAY_SEEKING,to:this.States.PLAY_SEEKING},{name:nt.SEEKED,from:this.States.PLAY_SEEKING,to:this.States.PLAY_SEEKING},{name:nt.SEEKED,from:this.States.PLAY_SEEKING,to:this.States.END_PLAY_SEEKING},{name:nt.START_BUFFERING,from:this.States.END_PLAY_SEEKING,to:this.States.END_PLAY_SEEKING},{name:nt.END_BUFFERING,from:this.States.END_PLAY_SEEKING,to:this.States.END_PLAY_SEEKING},{name:nt.SEEKED,from:this.States.END_PLAY_SEEKING,to:this.States.END_PLAY_SEEKING},{name:nt.TIMECHANGED,from:this.States.END_PLAY_SEEKING,to:this.States.PLAYING},{name:nt.END,from:this.States.PLAY_SEEKING,to:this.States.END},{name:nt.END,from:this.States.PAUSED_SEEKING,to:this.States.END},{name:nt.END,from:this.States.PLAYING,to:this.States.END},{name:nt.END,from:this.States.PAUSE,to:this.States.END},{name:nt.SEEK,from:this.States.END,to:this.States.END},{name:nt.SEEKED,from:this.States.END,to:this.States.END},{name:nt.TIMECHANGED,from:this.States.END,to:this.States.END},{name:nt.END_BUFFERING,from:this.States.END,to:this.States.END},{name:nt.START_BUFFERING,from:this.States.END,to:this.States.END},{name:nt.END,from:this.States.END,to:this.States.END},{name:nt.SEEKED,from:this.States.PLAYING,to:this.States.PLAYING},{name:nt.PLAY,from:this.States.END,to:this.States.PLAYING},{name:nt.ERROR,from:this.getAllStates(),to:this.States.ERROR},{name:nt.PAUSE,from:this.States.ERROR,to:this.States.ERROR},{name:nt.SEEK,from:this.States.END_PLAY_SEEKING,to:this.States.PLAY_SEEKING},{name:"FINISH_PLAY_SEEKING",from:this.States.END_PLAY_SEEKING,to:this.States.PLAYING},{name:nt.UNLOAD,from:this.getAllStates(),to:this.States.END},{name:nt.START_AD,from:this.States.PLAYING,to:this.States.AD},{name:nt.END_AD,from:this.States.AD,to:this.States.PLAYING},{name:nt.MUTE,from:this.States.READY,to:this.States.MUTING_READY},{name:nt.UN_MUTE,from:this.States.READY,to:this.States.MUTING_READY},{name:"FINISH_MUTING",from:this.States.MUTING_READY,to:this.States.READY},{name:nt.MUTE,from:this.States.PLAYING,to:this.States.MUTING_PLAY},{name:nt.UN_MUTE,from:this.States.PLAYING,to:this.States.MUTING_PLAY},{name:"FINISH_MUTING",from:this.States.MUTING_PLAY,to:this.States.PLAYING},{name:nt.MUTE,from:this.States.PAUSE,to:this.States.MUTING_PAUSE},{name:nt.UN_MUTE,from:this.States.PAUSE,to:this.States.MUTING_PAUSE},{name:"FINISH_MUTING",from:this.States.MUTING_PAUSE,to:this.States.PAUSE},{name:nt.START_CAST,from:[this.States.READY,this.States.PAUSE],to:this.States.CASTING},{name:nt.PAUSE,from:this.States.CASTING,to:this.States.CASTING},{name:nt.PLAY,from:this.States.CASTING,to:this.States.CASTING},{name:nt.TIMECHANGED,from:this.States.CASTING,to:this.States.CASTING},{name:nt.MUTE,from:this.States.CASTING,to:this.States.CASTING},{name:nt.SEEK,from:this.States.CASTING,to:this.States.CASTING},{name:nt.SEEKED,from:this.States.CASTING,to:this.States.CASTING},{name:nt.END_CAST,from:this.States.CASTING,to:this.States.READY},{name:nt.SEEK,from:this.States.READY,to:this.States.READY},{name:nt.SEEKED,from:this.States.READY,to:this.States.READY},{name:nt.SEEKED,from:this.States.STARTUP,to:this.States.STARTUP},{name:nt.SOURCE_LOADED,from:this.getAllStates(),to:this.States.SETUP},{name:nt.SOURCE_LOADED,from:this.States.SETUP,to:this.States.SETUP},{name:nt.SOURCE_LOADED,from:this.States.READY,to:this.States.READY},{name:nt.VIDEO_CHANGE,from:this.States.REBUFFERING,to:this.States.QUALITYCHANGE_REBUFFERING},{name:nt.AUDIO_CHANGE,from:this.States.REBUFFERING,to:this.States.QUALITYCHANGE_REBUFFERING},{name:nt.VIDEO_CHANGE,from:this.States.QUALITYCHANGE_REBUFFERING,to:this.States.QUALITYCHANGE_REBUFFERING},{name:nt.AUDIO_CHANGE,from:this.States.QUALITYCHANGE_REBUFFERING,to:this.States.QUALITYCHANGE_REBUFFERING},{name:"FINISH_QUALITYCHANGE_REBUFFERING",from:this.States.QUALITYCHANGE_REBUFFERING,to:this.States.REBUFFERING}],callbacks:{onpause:function(t,a,i,r){e.stateMachineCallbacks.playbackWatchTime(e.customData.playbackWatchTime),a===e.States.PLAYING&&(e.pausedTimestamp=r)},onbeforeevent:function(a,r,n,s,o){return e.stateMachineCallbacks.playbackWatchTime(e.customData.playbackWatchTime),i.includes(a)&&(a===nt.PLAYBACK_FINISHED&&(e.customData.previousRecordTime=0),e.customData.previousRecordTime=o.currentTime),a===nt.PLAY&&r===e.States.SETUP&&n===e.States.SETUP&&(e.autoPlay=!0),a===nt.SEEK&&(r===e.States.PAUSE||r===e.States.PLAYING)&&(e.seekedFrom=e.lastPlayHeadDuration,e.seekTimestamp=s,s-e.pausedTimestamp<t.PAUSE_SEEK_DELAY)?(e.stateMachine.PLAY_SEEK(s),!1):(a===nt.SEEK&&clearTimeout(e.seekedTimeout),a!==nt.SOURCE_LOADED?a===nt.SEEKED&&r===e.States.PAUSED_SEEKING?(e.seekedTimestamp=s,e.seekedTimeout=setTimeout(function(){e.stateMachine.pause(s,o)},t.SEEKED_PAUSE_DELAY),!1):(r!==e.States.REBUFFERING||n!==e.States.QUALITYCHANGE_REBUFFERING)&&void(o&&(e.lastPlayHeadDuration=1e3*o.currentTime)):void e.stateMachineCallbacks.loaded(s,e.States.READY,o))},onenterstate:function(t,r,n,s,o){e.stateMachineCallbacks.playbackWatchTime(e.customData.playbackWatchTime),i.includes(t)&&(t===nt.PLAYBACK_FINISHED&&(e.customData.previousRecordTime=0),e.customData.previousRecordTime=o.currentTime),n===e.States.SETUP?e.stateMachineCallbacks.setup(s,e.States.SETUP,o,a):n===e.States.READY?(o.playerSoftware=Lt.VIDEOJS,e.stateMachineCallbacks.ready(s,e.States.READY,o)):"play"===t&&n===e.States.STARTUP?e.stateMachineCallbacks.first_play(s,e.States.PLAY,o):"timechanged"===t&&r===e.States.STARTUP&&n===e.States.PLAYING&&e.autoPlay?(e.stateMachineCallbacks.first_play(s,e.States.PLAY,o),e.stateMachineCallbacks.playing(s,e.States.PLAYING,o),e.stateMachineCallbacks.playback_started(o)):"play"===t&&r===e.States.PAUSE?(e.stateMachineCallbacks.play(s,e.States.PLAY,o),e.stateMachineCallbacks.playing(s,e.States.PLAYING,o),e.stateMachineCallbacks.heartbeat(s,e.States.PLAY,o)):"timechanged"!==t||r!==e.States.STARTUP||n!==e.States.PLAYING||e.autoPlay?n===e.States.PAUSE&&r===e.States.PLAYING?(e.stateMachineCallbacks.pause(s,e.States.PAUSE,o),e.stateMachineCallbacks.heartbeat(s,e.States.PAUSE,o)):n===e.States.END?(e.stateMachineCallbacks.end(s,e.States.END,o),e.stateMachineCallbacks.heartbeat(s,e.States.END,o)):n===e.States.MUTING_PAUSE?e.stateMachineCallbacks.mute(s,o):t===nt.START_BUFFERING?e.stateMachineCallbacks.start_rebuffer(s,e.States.REBUFFERING,o):"timechanged"===t&&r===e.States.REBUFFERING&&n===e.States.PLAYING&&e.stateMachineCallbacks.end_rebuffer(s,e.States.REBUFFERING,o):(e.stateMachineCallbacks.playing(s,e.States.PLAYING,o),e.stateMachineCallbacks.playback_started(o)),"none"===r&&a.starttime?e.onEnterStateTimestamp=a.starttime:e.onEnterStateTimestamp=s||(new Date).getTime(),o&&n!==e.States.PAUSED_SEEKING&&n!==e.States.PLAY_SEEKING&&n!==e.States.END_PLAY_SEEKING&&e.stateMachineCallbacks.setVideoTimeStartFromEvent(o),"PLAY_SEEK"===t&&n===e.States.PLAY_SEEKING&&n!==e.States.PLAY_SEEKING&&n!==e.States.END_PLAY_SEEKING&&(e.seekTimestamp=e.onEnterStateTimestamp)},onafterevent:function(t,a,r,n,s){e.stateMachineCallbacks.playbackWatchTime(e.customData.playbackWatchTime),i.includes(t)&&(t===nt.PLAYBACK_FINISHED&&(e.customData.previousRecordTime=0),e.customData.previousRecordTime=s.currentTime),r===e.States.QUALITYCHANGE&&e.stateMachine.FINISH_QUALITYCHANGE(n),r!==e.States.MUTING_READY&&r!==e.States.MUTING_PLAY&&r!==e.States.MUTING_PAUSE||e.stateMachine.FINISH_MUTING(n)},onleavestate:function(t,a,r,n,s){if(e.stateMachineCallbacks.playbackWatchTime(e.customData.playbackWatchTime),i.includes(t)&&(t===nt.PLAYBACK_FINISHED&&(e.customData.previousRecordTime=0),e.customData.previousRecordTime=s.currentTime),e.stateMachineCallbacks.resetSessionExpiry(),n){var o=n-e.onEnterStateTimestamp;if(s&&r!==e.States.PAUSED_SEEKING&&r!==e.States.PLAY_SEEKING&&r!==e.States.END_PLAY_SEEKING&&(console.log("ERRRRRRRRRR"),X.log("ERRRRRRRRRR"),X.log("Setting video time end to "+s.currentTime+", going to "+r),e.stateMachineCallbacks.setVideoTimeEndFromEvent(s)),"PLAY_SEEK"===t&&a===e.States.PAUSE)return!0;var l=a.toLowerCase();if(a===e.States.END_PLAY_SEEKING||a===e.States.PAUSED_SEEKING){var c=e.seekedTimestamp-e.seekTimestamp;e.stateMachineCallbacks.playback_seeked(e.seekedFrom,1e3*s.currentTime,c,r),e.stateMachineCallbacks.heartbeat(n,e.States.PLAY,s),X.log("Seek was "+c+"ms")}else t===nt.UNLOAD&&a===e.States.PLAYING?e.stateMachineCallbacks.playingAndBye(o,l,s):a===e.States.PAUSE&&r!==e.States.PAUSED_SEEKING&&e.stateMachineCallbacks.setVideoTimeStartFromEvent(t);t===nt.VIDEO_CHANGE?e.stateMachineCallbacks.videoChange(s):t===nt.AUDIO_CHANGE?e.stateMachineCallbacks.audioChange(s):t===nt.MUTE?(X.log("Setting sample to muted"),e.stateMachineCallbacks.mute()):t===nt.UN_MUTE&&(X.log("Setting sample to unmuted"),e.stateMachineCallbacks.unMute())}},onseek:function(t,a,i,r){e.stateMachineCallbacks.playbackWatchTime(e.customData.playbackWatchTime),e.seekTimestamp=r},onseeked:function(t,a,i,r){e.stateMachineCallbacks.playbackWatchTime(e.customData.playbackWatchTime),e.seekedTimestamp=r},ontimechanged:function(t,a,i,r,n){e.stateMachineCallbacks.playbackWatchTime(e.customData.playbackWatchTime);var s=r-e.onEnterStateTimestamp,o=n.currentTime-e.customData.previousRecordTime;o>0&&o<5&&(e.customData.playbackWatchTime+=Math.round(1e3*(n.currentTime-e.customData.previousRecordTime)),e.customData.previousRecordTime=n.currentTime),s>d&&(e.stateMachineCallbacks.setVideoTimeEndFromEvent(n),X.log("Sending heartbeat"),e.stateMachineCallbacks.heartbeat(s,a.toLowerCase(),n),e.onEnterStateTimestamp=r,e.stateMachineCallbacks.setVideoTimeStartFromEvent(n),e.stateMachineCallbacks.resetSessionExpiry())},onplayerError:function(t,a,i,r,n){e.stateMachineCallbacks.error(n)}}})}},{key:"callEvent",value:function(t,e,a){var i=this.stateMachine[t];i?i.call(this.stateMachine,a,e):X.log("Ignored Event: "+t)}},{key:"updateMetadata",value:function(t){this.stateMachineCallbacks.updateSample(t)}}],i=[{key:"pad",value:function(t,e){return(t+new Array(e).join(" ")).slice(0,e)}}],a&&ke(e.prototype,a),i&&ke(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,a,i}();function Fe(t){return Fe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Fe(t)}function Me(t){return function(t){if(Array.isArray(t))return He(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return He(t,e);var a={}.toString.call(t).slice(8,-1);return"Object"===a&&t.constructor&&(a=t.constructor.name),"Map"===a||"Set"===a?Array.from(t):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?He(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function He(t,e){(null==e||e>t.length)&&(e=t.length);for(var a=0,i=Array(e);a<e;a++)i[a]=t[a];return i}function Ke(t,e){for(var a=0;a<e.length;a++){var i=e[a];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,Ve(i.key),i)}}function Ve(t){var e=function(t,e){if("object"!=Fe(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,e||"default");if("object"!=Fe(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Fe(e)?e:e+""}Ye(we,"PAUSE_SEEK_DELAY",200),Ye(we,"SEEKED_PAUSE_DELAY",300);var Be=function(){return t=function t(e){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.stateMachineCallbacks=e,this.customData={previousRecordTime:0,playbackWatchTime:0},this.pausedTimestamp=null,this.onEnterStateTimestamp=0,this.seekStartedAt=null,this.seekTimestamp=0,this.seekedTimestamp=0,this.seekedFrom=0,this.lastPlayHeadDuration=0,this.playTimeStamp=null,this.States={SETUP:"SETUP",STARTUP:"STARTUP",READY:"READY",PLAYING:"PLAYING",REBUFFERING:"REBUFFERING",PAUSE:"PAUSE",QUALITYCHANGE:"QUALITYCHANGE",PAUSED_SEEKING:"PAUSED_SEEKING",QUALITYCHANGE_PAUSE:"QUALITYCHANGE_PAUSE",QUALITYCHANGE_REBUFFERING:"QUALITYCHANGE_REBUFFERING",END:"END",ERROR:"ERROR",MUTING_READY:"MUTING_READY",MUTING_PLAY:"MUTING_PLAY",MUTING_PAUSE:"MUTING_PAUSE",CASTING:"CASTING"},this.createStateMachine(a)},e=[{key:"getAllStates",value:function(){var t=this;return[].concat(Me(Object.keys(this.States).map(function(e){return t.States[e]})),["FINISH_QUALITYCHANGE_PAUSE","FINISH_QUALITYCHANGE","FINISH_QUALITYCHANGE_REBUFFERING"])}},{key:"createStateMachine",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=[nt.PLAY,nt.PAUSE,nt.SEEK,nt.SEEKED,nt.PLAYBACK_PLAYING,nt.PLAYBACK_FINISHED,nt.READY,nt.SCREEN_RESIZE,nt.END,nt.ERROR,nt.UN_MUTE,nt.MUTE];this.stateMachine=ye().create({initial:this.States.SETUP,error:function(t,e,a,i,r,n){X.error("Error in statemachine: "+n)},events:[{name:nt.TIMECHANGED,from:this.States.SETUP,to:this.States.SETUP},{name:nt.READY,from:[this.States.SETUP,this.States.ERROR],to:this.States.READY},{name:nt.PLAY,from:this.States.READY,to:this.States.STARTUP},{name:nt.START_BUFFERING,from:this.States.STARTUP,to:this.States.STARTUP},{name:nt.END_BUFFERING,from:this.States.STARTUP,to:this.States.STARTUP},{name:nt.VIDEO_CHANGE,from:this.States.STARTUP,to:this.States.STARTUP},{name:nt.AUDIO_CHANGE,from:this.States.STARTUP,to:this.States.STARTUP},{name:nt.TIMECHANGED,from:this.States.STARTUP,to:this.States.PLAYING},{name:nt.TIMECHANGED,from:this.States.PLAYING,to:this.States.PLAYING},{name:nt.TIMECHANGED,from:this.States.PAUSE,to:this.States.PAUSE},{name:nt.SEEKED,from:this.States.PAUSE,to:this.States.PAUSE},{name:nt.END_BUFFERING,from:this.States.PLAYING,to:this.States.PLAYING},{name:nt.START_BUFFERING,from:this.States.PLAYING,to:this.States.REBUFFERING},{name:nt.START_BUFFERING,from:this.States.REBUFFERING,to:this.States.REBUFFERING},{name:nt.PLAY,from:this.States.REBUFFERING,to:this.States.PLAYING},{name:nt.TIMECHANGED,from:this.States.REBUFFERING,to:this.States.PLAYING},{name:nt.SEEK,from:this.States.STARTUP,to:this.States.STARTUP},{name:nt.PLAY,from:this.States.PAUSED_SEEKING,to:this.States.PAUSED_SEEKING},{name:nt.PAUSE,from:this.States.PLAYING,to:this.States.PAUSE},{name:nt.PAUSE,from:this.States.REBUFFERING,to:this.States.PAUSE},{name:nt.PLAY,from:this.States.PAUSE,to:this.States.PLAYING},{name:nt.TIMECHANGED,from:this.States.PAUSE,to:this.States.PLAYING},{name:nt.VIDEO_CHANGE,from:this.States.PLAYING,to:this.States.QUALITYCHANGE},{name:nt.AUDIO_CHANGE,from:this.States.PLAYING,to:this.States.QUALITYCHANGE},{name:nt.VIDEO_CHANGE,from:this.States.QUALITYCHANGE,to:this.States.QUALITYCHANGE},{name:nt.AUDIO_CHANGE,from:this.States.QUALITYCHANGE,to:this.States.QUALITYCHANGE},{name:"FINISH_QUALITYCHANGE",from:this.States.QUALITYCHANGE,to:this.States.PLAYING},{name:nt.VIDEO_CHANGE,from:this.States.PAUSE,to:this.States.QUALITYCHANGE_PAUSE},{name:nt.AUDIO_CHANGE,from:this.States.PAUSE,to:this.States.QUALITYCHANGE_PAUSE},{name:nt.VIDEO_CHANGE,from:this.States.QUALITYCHANGE_PAUSE,to:this.States.QUALITYCHANGE_PAUSE},{name:nt.AUDIO_CHANGE,from:this.States.QUALITYCHANGE_PAUSE,to:this.States.QUALITYCHANGE_PAUSE},{name:"FINISH_QUALITYCHANGE_PAUSE",from:this.States.QUALITYCHANGE_PAUSE,to:this.States.PAUSE},{name:nt.SEEK,from:this.States.PAUSE,to:this.States.PAUSED_SEEKING},{name:nt.SEEK,from:this.States.PAUSED_SEEKING,to:this.States.PAUSED_SEEKING},{name:nt.AUDIO_CHANGE,from:this.States.PAUSED_SEEKING,to:this.States.PAUSED_SEEKING},{name:nt.VIDEO_CHANGE,from:this.States.PAUSED_SEEKING,to:this.States.PAUSED_SEEKING},{name:nt.START_BUFFERING,from:this.States.PAUSED_SEEKING,to:this.States.PAUSED_SEEKING},{name:nt.END_BUFFERING,from:this.States.PAUSED_SEEKING,to:this.States.PAUSED_SEEKING},{name:nt.SEEKED,from:this.States.PAUSED_SEEKING,to:this.States.PAUSE},{name:nt.TIMECHANGED,from:this.States.PAUSED_SEEKING,to:this.States.PLAYING},{name:nt.PAUSE,from:this.States.PAUSED_SEEKING,to:this.States.PAUSE},{name:nt.END,from:this.States.PAUSED_SEEKING,to:this.States.END},{name:nt.END,from:this.States.PLAYING,to:this.States.END},{name:nt.END,from:this.States.PAUSE,to:this.States.END},{name:nt.SEEK,from:this.States.END,to:this.States.END},{name:nt.SEEKED,from:this.States.END,to:this.States.END},{name:nt.TIMECHANGED,from:this.States.END,to:this.States.END},{name:nt.END_BUFFERING,from:this.States.END,to:this.States.END},{name:nt.START_BUFFERING,from:this.States.END,to:this.States.END},{name:nt.END,from:this.States.END,to:this.States.END},{name:nt.SEEKED,from:this.States.PLAYING,to:this.States.PLAYING},{name:nt.PLAY,from:this.States.END,to:this.States.PLAYING},{name:nt.ERROR,from:this.getAllStates(),to:this.States.ERROR},{name:nt.PAUSE,from:this.States.ERROR,to:this.States.ERROR},{name:nt.PLAY,from:this.States.ERROR,to:this.States.PLAYING},{name:nt.TIMECHANGED,from:this.States.ERROR,to:this.States.PLAYING},{name:nt.UNLOAD,from:this.getAllStates(),to:this.States.END},{name:nt.START_AD,from:this.States.PLAYING,to:this.States.AD},{name:nt.END_AD,from:this.States.AD,to:this.States.PLAYING},{name:nt.MUTE,from:this.States.READY,to:this.States.MUTING_READY},{name:nt.UN_MUTE,from:this.States.READY,to:this.States.MUTING_READY},{name:"FINISH_MUTING",from:this.States.MUTING_READY,to:this.States.READY},{name:nt.MUTE,from:this.States.PLAYING,to:this.States.MUTING_PLAY},{name:nt.UN_MUTE,from:this.States.PLAYING,to:this.States.MUTING_PLAY},{name:"FINISH_MUTING",from:this.States.MUTING_PLAY,to:this.States.PLAYING},{name:nt.MUTE,from:this.States.PAUSE,to:this.States.MUTING_PAUSE},{name:nt.UN_MUTE,from:this.States.PAUSE,to:this.States.MUTING_PAUSE},{name:"FINISH_MUTING",from:this.States.MUTING_PAUSE,to:this.States.PAUSE},{name:nt.START_CAST,from:[this.States.READY,this.States.PAUSE],to:this.States.CASTING},{name:nt.PAUSE,from:this.States.CASTING,to:this.States.CASTING},{name:nt.PLAY,from:this.States.CASTING,to:this.States.CASTING},{name:nt.TIMECHANGED,from:this.States.CASTING,to:this.States.CASTING},{name:nt.MUTE,from:this.States.CASTING,to:this.States.CASTING},{name:nt.SEEK,from:this.States.CASTING,to:this.States.CASTING},{name:nt.SEEKED,from:this.States.CASTING,to:this.States.CASTING},{name:nt.END_CAST,from:this.States.CASTING,to:this.States.READY},{name:nt.SEEK,from:this.States.READY,to:this.States.READY},{name:nt.SEEKED,from:this.States.READY,to:this.States.READY},{name:nt.SEEKED,from:this.States.STARTUP,to:this.States.STARTUP},{name:nt.SOURCE_LOADED,from:this.States.SETUP,to:this.States.SETUP},{name:nt.SOURCE_LOADED,from:this.States.READY,to:this.States.READY},{name:nt.SOURCE_LOADED,from:this.States.STARTUP,to:this.States.STARTUP},{name:nt.SOURCE_LOADED,from:this.States.PLAYING,to:this.States.PLAYING},{name:nt.VIDEO_CHANGE,from:this.States.REBUFFERING,to:this.States.QUALITYCHANGE_REBUFFERING},{name:nt.AUDIO_CHANGE,from:this.States.REBUFFERING,to:this.States.QUALITYCHANGE_REBUFFERING},{name:nt.VIDEO_CHANGE,from:this.States.QUALITYCHANGE_REBUFFERING,to:this.States.QUALITYCHANGE_REBUFFERING},{name:nt.AUDIO_CHANGE,from:this.States.QUALITYCHANGE_REBUFFERING,to:this.States.QUALITYCHANGE_REBUFFERING},{name:"FINISH_QUALITYCHANGE_REBUFFERING",from:this.States.QUALITYCHANGE_REBUFFERING,to:this.States.REBUFFERING}],callbacks:{onbeforeevent:function(e,i,r,n,s){if(t.stateMachineCallbacks.playbackWatchTime(t.customData.playbackWatchTime),a.includes(e)&&(e===nt.PLAYBACK_FINISHED&&(t.customData.previousRecordTime=0),t.customData.previousRecordTime=s.currentTime),e===nt.SEEK&&i===t.States.PAUSE&&(t.seekedFrom=t.lastPlayHeadDuration),e!==nt.SOURCE_LOADED)s&&(t.lastPlayHeadDuration=1e3*s.currentTime);else{var o=null;i===t.States.PLAYING&&(o=(new Date).getTime()-t.playTimeStamp.getTime()),t.stateMachineCallbacks.loaded(n,t.States.READY,s,o)}},onenterstate:function(i,r,n,s,o){t.stateMachineCallbacks.playbackWatchTime(t.customData.playbackWatchTime),a.includes(i)&&(i===nt.PLAYBACK_FINISHED&&(t.customData.previousRecordTime=0),t.customData.previousRecordTime=o.currentTime),n===t.States.SETUP&&"none"===r?t.stateMachineCallbacks.setup(s,t.States.SETUP,o,e):n===t.States.READY&&r===t.States.SETUP?t.stateMachineCallbacks.ready(s,t.States.READY,o):"play"===i&&n===t.States.STARTUP?(t.playTimeStamp=new Date,t.stateMachineCallbacks.first_play(s,t.States.PLAY,o)):"play"===i&&r===t.States.PAUSE?(t.stateMachineCallbacks.play(s,t.States.PLAY,o),t.stateMachineCallbacks.playing(s,t.States.PLAYING,o),t.stateMachineCallbacks.heartbeat(s,t.States.PLAY,o)):"timechanged"===i&&r===t.States.STARTUP&&n===t.States.PLAYING?(t.stateMachineCallbacks.playing(s,t.States.PLAYING,o),t.stateMachineCallbacks.playback_started(o)):"timechanged"===i&&r===t.States.PAUSE&&n===t.States.PLAYING?t.stateMachineCallbacks.playing(s,t.States.PLAYING,o):n===t.States.PAUSE&&r===t.States.PLAYING?(t.stateMachineCallbacks.pause(s,t.States.PAUSE,o),t.stateMachineCallbacks.heartbeat(s,t.States.PAUSE,o)):n===t.States.END?(t.stateMachineCallbacks.end(s,t.States.END,o),t.stateMachineCallbacks.heartbeat(s,t.States.END,o)):i===nt.START_BUFFERING?t.stateMachineCallbacks.start_rebuffer(s,t.States.REBUFFERING,o):"timechanged"===i&&r===t.States.REBUFFERING&&n===t.States.PLAYING&&t.stateMachineCallbacks.end_rebuffer(s,t.States.REBUFFERING,o),"none"===r&&e.starttime?t.onEnterStateTimestamp=e.starttime:t.onEnterStateTimestamp=s||(new Date).getTime(),o&&n!==t.States.PAUSED_SEEKING&&t.stateMachineCallbacks.setVideoTimeStartFromEvent(o)},onafterevent:function(e,i,r,n,s){t.stateMachineCallbacks.playbackWatchTime(t.customData.playbackWatchTime),a.includes(e)&&(e===nt.PLAYBACK_FINISHED&&(t.customData.previousRecordTime=0),t.customData.previousRecordTime=s.currentTime),r===t.States.QUALITYCHANGE&&t.stateMachine.FINISH_QUALITYCHANGE(n),r!==t.States.MUTING_READY&&r!==t.States.MUTING_PLAY&&r!==t.States.MUTING_PAUSE||t.stateMachine.FINISH_MUTING(n)},onleavestate:function(e,i,r,n,s){if(t.stateMachineCallbacks.playbackWatchTime(t.customData.playbackWatchTime),a.includes(e)&&(e===nt.PLAYBACK_FINISHED&&(t.customData.previousRecordTime=0),t.customData.previousRecordTime=s.currentTime),t.stateMachineCallbacks.resetSessionExpiry(),n){var o=n-t.onEnterStateTimestamp;s&&r!==t.States.PAUSED_SEEKING&&(console.log("ERRRRRRRRRR"),X.log("ERRRRRRRRRR"),X.log("Setting video time end to "+s.currentTime+", going to "+r),t.stateMachineCallbacks.setVideoTimeEndFromEvent(s));var l=i.toLowerCase();if(i===t.States.PAUSED_SEEKING){var c=n-t.seekStartedAt;t.seekStartedAt=null,t.stateMachineCallbacks.playback_seeked(t.seekedFrom,1e3*s.currentTime,c,r),t.stateMachineCallbacks.heartbeat(n,t.States.PLAY,s),X.log("Seek was "+c+"ms")}else e===nt.UNLOAD&&i===t.States.PLAYING?t.stateMachineCallbacks.playingAndBye(o,l,s):i===t.States.PAUSE&&r!==t.States.PAUSED_SEEKING&&r!==t.States.PLAYING&&(t.stateMachineCallbacks.setVideoTimeStartFromEvent(e),t.stateMachineCallbacks.pause(o,l,s),t.stateMachineCallbacks.heartbeat(n,l,s));e===nt.VIDEO_CHANGE?t.stateMachineCallbacks.videoChange(s):e===nt.AUDIO_CHANGE?t.stateMachineCallbacks.audioChange(s):e===nt.MUTE?(X.log("Setting sample to muted"),t.stateMachineCallbacks.mute(n,s)):e===nt.UN_MUTE&&(X.log("Setting sample to unmuted"),t.stateMachineCallbacks.unMute(n,s))}},onseek:function(e,a,i,r,n){t.customData.previousRecordTime=n.currentTime,t.stateMachineCallbacks.playbackWatchTime(t.customData.playbackWatchTime),t.seekStartedAt=t.seekStartedAt||r},onseeked:function(e,a,i,r,n){t.customData.previousRecordTime=n.currentTime,t.stateMachineCallbacks.playbackWatchTime(t.customData.playbackWatchTime),t.seekedTimestamp=r},ontimechanged:function(e,a,i,r,n){t.stateMachineCallbacks.playbackWatchTime(t.customData.playbackWatchTime);var s=r-t.onEnterStateTimestamp,o=n.currentTime-t.customData.previousRecordTime;o>0&&o<5&&(t.customData.playbackWatchTime+=Math.round(1e3*(n.currentTime-t.customData.previousRecordTime)),t.customData.previousRecordTime=n.currentTime),s>d&&(t.stateMachineCallbacks.setVideoTimeEndFromEvent(n),X.log("Sending heartbeat"),t.stateMachineCallbacks.heartbeat(s,a.toLowerCase(),n),t.onEnterStateTimestamp=r,t.stateMachineCallbacks.setVideoTimeStartFromEvent(n),t.stateMachineCallbacks.resetSessionExpiry())},onplayerError:function(e,a,i,r,n){t.stateMachineCallbacks.error(n)}}})}},{key:"callEvent",value:function(t,e,a){var i=this.stateMachine[t];i?i.call(this.stateMachine,a,e):X.log("Ignored Event: "+t)}},{key:"updateMetadata",value:function(t){this.stateMachineCallbacks.updateSample(t)}}],a=[{key:"pad",value:function(t,e){return(t+new Array(e).join(" ")).slice(0,e)}}],e&&Ke(t.prototype,e),a&&Ke(t,a),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,a}();function je(t){return je="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},je(t)}function We(t,e){for(var a=0;a<e.length;a++){var i=e[a];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,xe(i.key),i)}}function xe(t){var e=function(t,e){if("object"!=je(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,e||"default");if("object"!=je(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==je(e)?e:e+""}const Qe=function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)},a=[{key:"getAnalyticsStateMachine",value:function(t,e){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return rt.isBitmovinVersionPre7(t)?new Ne(e,a):rt.isBitmovinVersion7Plus(t)?new Ue(e,a):rt.isVideoJs(t)?new we(e,a):(rt.isHlsjs(t)||rt.isDashjs(t)||rt.isShaka(t),new Be(e,a))}}],(e=null)&&We(t.prototype,e),a&&We(t,a),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,a}();function qe(t){return qe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},qe(t)}function Je(t,e){for(var a=0;a<e.length;a++){var i=e[a];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,$e(i.key),i)}}function $e(t){var e=function(t,e){if("object"!=qe(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,e||"default");if("object"!=qe(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==qe(e)?e:e+""}const Xe=function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)},(e=[{key:"setUp",value:function(){X.log("setting up cast session"),this.castSession=cast.framework.CastContext.getInstance().getCurrentSession(),this.addMessageListener()}},{key:"addMessageListener",value:function(){var t=this,e=this.castSession.getApplicationMetadata();!e||e.namespaces.indexOf(E)<0?X.log("No analytics on chrome cast receiver enabled!"):(X.log("adding message listener"),this.castSession.addMessageListener(E,function(e,a){X.log("Received: "+e+" "+a);try{var i=JSON.parse(a);t.handleReceiverMessage(i)}catch(t){X.error("Message parsing failed "+a)}}))}},{key:"handleReceiverMessage",value:function(t){X.log(t)}},{key:"sendMessage",value:function(t){var e=this.castSession.getApplicationMetadata();!e||e.namespaces.indexOf(E)<0?X.log("No analytics on chrome cast receiver enabled!"):(X.log("Sending message: "+JSON.stringify(t)),this.castSession.sendMessage(E,t))}}])&&Je(t.prototype,e),a&&Je(t,a),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,a}();function ze(t){return ze="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ze(t)}function Ze(t,e){for(var a=0;a<e.length;a++){var i=e[a];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,ta(i.key),i)}}function ta(t){var e=function(t,e){if("object"!=ze(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,e||"default");if("object"!=ze(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==ze(e)?e:e+""}const ea=function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)},(e=[{key:"setUp",value:function(){var t=this,e=cast.receiver.CastReceiverManager.getInstance();this.messageBus=e.getCastMessageBus(E,cast.receiver.CastMessageBus.MessageType.JSON),X.log(this.messageBus),this.messageBus.onMessage=function(e){X.log("Received message from cast client: "+JSON.stringify(e));var a=e.data;t.handleClientMessage(a)}}},{key:"setCallback",value:function(t){this.callback=t}},{key:"handleClientMessage",value:function(t){this.callback(t)}},{key:"sendMessage",value:function(t){this.messageBus.broadcast(t)}}])&&Ze(t.prototype,e),a&&Ze(t,a),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,a}();const aa={SETUP:"event_setup",PLAYER_READY:"event_player_ready",PLAYBACK_READY:"event_playback_ready",PLAYBACK_STARTED:"event_playback_started",PAUSE:"event_pause",PLAY:"event_play",PLAYING:"event_playing",PLAYBACK_UPDATE:"event_playback_update",END:"event_ended",MUTE:"event_muted",UNMUTE:"event_unmute",SEEKED:"event_seeked",START_REBUFFER:"event_rebuffer_start",END_REBUFFER:"event_rebuffer_end",ERROR:"event_error"};var ia=a(503),ra=a.n(ia);function na(t){return na="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},na(t)}function sa(t,e){for(var a=0;a<e.length;a++){var i=e[a];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,la(i.key),i)}}function oa(t,e,a){return(e=la(e))in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}function la(t){var e=function(t,e){if("object"!=na(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,e||"default");if("object"!=na(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==na(e)?e:e+""}var ca=function(){function t(e){var a=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),oa(this,"register",function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!t)return a.analyticsStateMachine=new Be(a.stateMachineCallbacks,e),a.analyticsStateMachine;e.starttime?e.starttime=l.convertEpochTime(e.starttime):e.starttime=l.getCurrentTimestamp(),a.analyticsStateMachine=Qe.getAnalyticsStateMachine(t,a.stateMachineCallbacks,e),a.adapter=fe.getAdapter(t,a.record,a.analyticsStateMachine,e.mediaElement),a.adapter||X.error("Could not detect player.")}),oa(this,"registerVideoJSPlayer",function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e.starttime?e.starttime=l.convertEpochTime(e.starttime):e.starttime=l.getCurrentTimestamp(),a.analyticsStateMachine=new we(a.stateMachineCallbacks,e),a.adapter=new vt(t,a.record,a.analyticsStateMachine)}),oa(this,"registerHLSJSPlayer",function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e.starttime?e.starttime=l.convertEpochTime(e.starttime):e.starttime=l.getCurrentTimestamp(),a.analyticsStateMachine=new Be(a.stateMachineCallbacks,e),a.adapter=new Wt(t,a.record,a.analyticsStateMachine)}),oa(this,"registerShakaPlayer",function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e.starttime?e.starttime=l.convertEpochTime(e.starttime):e.starttime=l.getCurrentTimestamp(),a.analyticsStateMachine=new Be(a.stateMachineCallbacks,e),a.adapter=new re(t,a.record,a.analyticsStateMachine,e.mediaElement)}),oa(this,"registerHTML5Player",function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e.starttime?e.starttime=l.convertEpochTime(e.starttime):e.starttime=l.getCurrentTimestamp(),a.analyticsStateMachine=new Be(a.stateMachineCallbacks,e),a.adapter=new wt(t,a.record,a.analyticsStateMachine)}),oa(this,"customEventHandler",function(t,e){a.customEventData=JSON.stringify(e),a.sendAnalyticsRequestAndClearValues(t,{custom_event_data:a.customEventData})}),oa(this,"customEventHandlerAsync",function(t,e){return new Promise(function(i,r){a.customEventData=JSON.stringify(e),a.sendAnalyticsRequestAndClearValuesAsync(t,{custom_event_data:a.customEventData}).then(function(t){i(t)}).catch(function(t){r(t)})})}),oa(this,"registerDashJSPlayer",function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e.starttime?e.starttime=l.convertEpochTime(e.starttime):e.starttime=l.getCurrentTimestamp(),a.analyticsStateMachine=new Be(a.stateMachineCallbacks,e),a.adapter=new he(t,a.record,a.analyticsStateMachine)}),oa(this,"registerReactNativeVideoPlayer",function(t){return t.starttime?t.starttime=l.convertEpochTime(t.starttime):t.starttime=l.getCurrentTimestamp(),a.analyticsStateMachine=new Be(a.stateMachineCallbacks,t),a.analyticsStateMachine}),oa(this,"getCurrentImpressionId",function(){return a.sample.impressionId}),oa(this,"record",function(t,e){e=e||{},a.analyticsStateMachine.callEvent(t,e,l.getCurrentTimestamp())}),oa(this,"setDroppedFrames",function(t){}),this.config=e,this.analyticsCall=new T,this.sessionCreationCall=new Y,this.playerInitCall=new W,this.castClient=new Xe,this.castReceiver=new ea,this.droppedSampleFrames=0,this.licensing="granted",this.startupTime=0,this.pageLoadType=t.PAGE_LOAD_TYPE.FOREGROUND,this.autoplay=void 0,this.isCastClient=!1,this.isCastReceiver=!1,this.isAllowedToSendSamples=!1,this.samplesQueue=[],this.previousState=void 0,this.previousStateTimeStamp=new Date,this.firstPlayTimestamp=0,this.isMuted=!1,this.isFullScreen=void 0,this.videoWidthPixels=void 0,this.videoHeightPixels=void 0,this.upscalePercentage=void 0,this.downscalePercentage=void 0,this.videoBitrate=void 0,this.audioCodec=void 0,this.videoCodec=void 0,this.currentTime=0;try{this.orientation=screen.orientation.type.match(/\w+/)[0],screen.orientation.onchange=function(){this.orientation=screen.orientation.type.match(/\w+/)[0]}}catch(t){this.orientation="undetected"}this.setConfigParameters(),this.init(),this.setupSample(),this.setupStateMachineCallbacks()}return e=t,a=[{key:"init",value:function(){if(this.isCastReceiver||""!==this.config.property_id&&l.validString(this.config.property_id)){X.setLogging(this.config.debug||!1),this.propertyId=this.config.property_id,"undefined"!=typeof window&&void 0!==window.parent?this.pageURL=window.location!==window.parent.location?document.referrer:document.location.href:this.config.page_url?this.pageURL=this.config.page_url:this.pageURL=null;var t=!1;this.config.test&&(t=!0);var e=null;this.config.sessionID&&(e=this.config.sessionID);var a=!0;Object.hasOwn(this.config,"sendSessionRequest")&&(a=this.config.sendSessionRequest);var i=null;this.config.userID&&(i=this.config.userID),this.setUserId(t,i),this.setSessionId(t,e,a),this.setPlayerInstanceId(),this.setPlaybackId()}else console.error("Invalid analytics property_id provided")}},{key:"setConfigParameters",value:function(){arguments.length>0&&void 0!==arguments[0]||this.sample;var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.config;this.customData1=l.getCustomDataString(t.customData1),this.customData2=l.getCustomDataString(t.customData2),this.customData3=l.getCustomDataString(t.customData3),this.customData4=l.getCustomDataString(t.customData4),this.customData5=l.getCustomDataString(t.customData5),this.customData6=l.getCustomDataString(t.customData6),this.customData7=l.getCustomDataString(t.customData7),this.customData8=l.getCustomDataString(t.customData8),this.customData9=l.getCustomDataString(t.customData9),this.customData10=l.getCustomDataString(t.customData10),this.customPlayerIntegrationVersion=l.getCustomDataString(t.customPlayerIntegrationVersion),this.customPlayerName=l.getCustomDataString(t.customPlayerName),this.customPageType=l.getCustomDataString(t.customPageType),this.customUserId=l.getCustomDataString(t.userId),this.userName=l.getCustomDataString(t.userName),this.userEMail=l.getCustomDataString(t.userEMail),this.userPhone=l.getCustomDataString(t.userPhone),this.userProfileImage=l.getCustomDataString(t.userProfileImage),this.userAddressLine1=l.getCustomDataString(t.userAddressLine1),this.userAddressLine2=l.getCustomDataString(t.userAddressLine2),this.userCity=l.getCustomDataString(t.userCity),this.userState=l.getCustomDataString(t.userState),this.userCountry=l.getCustomDataString(t.userCountry),this.userZipcode=l.getCustomDataString(t.userZipcode),this.customContentType=l.getCustomDataString(t.customContentType),this.customVideoDurationMillis=l.getCustomDataString(t.customVideoDurationMillis),this.customEncodingVariant=l.getCustomDataString(t.customEncodingVariant),this.customVideoLanguage=l.getCustomDataString(t.customVideoLanguage),this.customVideoId=l.getCustomDataString(t.customVideoId),this.customVideoSeries=l.getCustomDataString(t.customVideoSeries),this.customVideoProducer=l.getCustomDataString(t.customVideoProducer),this.customVideoTitle=l.getCustomDataString(t.customVideoTitle),this.customVideoVariantName=l.getCustomDataString(t.customVideoVariantName),this.customVideoVariant=l.getCustomDataString(t.customVideoVariant),this.SDKVersion="1.0.0",this.experimentName=t.experimentName}},{key:"updateCustomUserData",value:function(t){this.customUserId=l.getCustomDataString(t.userId),this.userName=l.getCustomDataString(t.userName),this.userEMail=l.getCustomDataString(t.userEMail),this.userPhone=l.getCustomDataString(t.userPhone),this.userProfileImage=l.getCustomDataString(t.userProfileImage),this.userAddressLine1=l.getCustomDataString(t.userAddressLine1),this.userAddressLine2=l.getCustomDataString(t.userAddressLine2),this.userCity=l.getCustomDataString(t.userCity),this.userState=l.getCustomDataString(t.userState),this.userCountry=l.getCustomDataString(t.userCountry),this.userZipcode=l.getCustomDataString(t.userZipcode)}},{key:"updateCustomVideoData",value:function(t){this.customContentType=l.getCustomDataString(t.customContentType),this.customVideoDurationMillis=l.getCustomDataString(t.customVideoDurationMillis),this.customEncodingVariant=l.getCustomDataString(t.customEncodingVariant),this.customVideoLanguage=l.getCustomDataString(t.customVideoLanguage),this.customVideoId=l.getCustomDataString(t.customVideoId),this.customVideoSeries=l.getCustomDataString(t.customVideoSeries),this.customVideoProducer=l.getCustomDataString(t.customVideoProducer),this.customVideoTitle=l.getCustomDataString(t.customVideoTitle),this.customVideoVariantName=l.getCustomDataString(t.customVideoVariantName),this.customVideoVariant=l.getCustomDataString(t.customVideoVariant)}},{key:"updateCustomData",value:function(t){this.customData1=l.getCustomDataString(t.customData1),this.customData2=l.getCustomDataString(t.customData2),this.customData3=l.getCustomDataString(t.customData3),this.customData4=l.getCustomDataString(t.customData4),this.customData5=l.getCustomDataString(t.customData5),this.customData6=l.getCustomDataString(t.customData6),this.customData7=l.getCustomDataString(t.customData7),this.customData8=l.getCustomDataString(t.customData8),this.customData9=l.getCustomDataString(t.customData9),this.customData10=l.getCustomDataString(t.customData10)}},{key:"updateCustomPlayerData",value:function(t){this.customPlayerIntegrationVersion=l.getCustomDataString(t.customPlayerIntegrationVersion),this.customPlayerName=l.getCustomDataString(t.customPlayerName),this.customPageType=l.getCustomDataString(t.customPageType)}},{key:"setSessionData",value:function(){this.sessionData={session_id:this.sessionId,property_id:this.propertyId,user_id:this.userId,custom_user_id:this.customUserId,custom_data_1:this.customData1,custom_data_2:this.customData2,custom_data_3:this.customData3,custom_data_4:this.customData4,custom_data_5:this.customData5,custom_data_6:this.customData6,custom_data_7:this.customData7,custom_data_8:this.customData8,custom_data_9:this.customData9,custom_data_10:this.customData10,user_name:this.userName,user_email:this.userEMail,user_phone:this.userPhone,user_profile_image:this.userProfileImage,user_address_line1:this.userAddressLine1,user_address_line2:this.userAddressLine2,user_city:this.userCity,user_state:this.userState,user_country:this.userCountry,user_zipcode:this.userZipcode,viewer_client_version:this.SDKVersion,meta_browser:this.meta_browser,meta_device_manufacturer:this.meta_device_manufacturer,meta_operating_system_version:this.meta_operating_system_version,meta_operating_system:this.meta_operating_system,meta_device_name:this.meta_device_name,meta_browser_version:this.meta_browser_version,meta_device_category:this.meta_device_category,meta_device_architecture:this.meta_device_architecture,meta_device_display_width:this.meta_device_display_width,meta_device_display_height:this.meta_device_display_height,meta_device_is_touchscreen:this.meta_device_is_touchscreen,meta_device_display_dpr:this.meta_device_display_dpr,meta_browser_language:this.meta_browser_language},this.config.deviceData?(this.sessionData.meta_device_name=this.config.deviceData.meta_device_name,this.sessionData.meta_device_manufacturer=this.config.deviceData.meta_device_manufacturer,this.sessionData.meta_operating_system_version=this.config.deviceData.meta_operating_system_version,this.sessionData.meta_operating_system=this.config.deviceData.meta_operating_system,this.sessionData.meta_browser=this.config.deviceData.meta_browser,this.sessionData.meta_device_display_dpr=this.config.deviceData.meta_device_display_dpr,this.sessionData.meta_browser_version=this.config.deviceData.meta_browser_version,this.sessionData.meta_device_category=this.config.deviceData.meta_device_category,this.sessionData.meta_device_architecture=this.config.deviceData.meta_device_architecture,this.sessionData.meta_device_display_width=this.config.deviceData.meta_device_display_width,this.sessionData.meta_device_display_height=this.config.deviceData.meta_device_display_height,this.sessionData.meta_device_is_touchscreen=this.config.deviceData.meta_device_is_touchscreen,this.sessionData.meta_browser_language=this.config.deviceData.meta_browser_language):(this.sessionData.meta_device_name=ra().product,this.sessionData.meta_device_manufacturer=ra().manufacturer,this.sessionData.meta_operating_system_version=ra().os.version,this.sessionData.meta_operating_system=ra().os.family,this.sessionData.meta_browser=ra().name,this.sessionData.meta_browser_version=ra().version,this.sessionData.meta_device_category=x(),this.sessionData.meta_device_architecture=ra().os.architecture,this.sessionData.meta_device_display_dpr=window.devicePixelRatio,this.sessionData.meta_device_display_width=window.screen.width,this.sessionData.meta_device_display_height=window.screen.height,this.sessionData.meta_device_display_dpr=parseInt(window.devicePixelRatio),this.sessionData.meta_browser_language=navigator?navigator.language||navigator.userLanguage:"","ontouchstart"in document.documentElement&&(this.sessionData.meta_device_is_touchscreen="true"))}},{key:"setPlayerData",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.playerData={player_instance_id:this.playerInstanceId,property_id:this.propertyId,session_id:this.sessionId,user_id:this.userId,custom_user_id:this.customUserId,custom_data_1:this.customData1,custom_data_2:this.customData2,custom_data_3:this.customData3,custom_data_4:this.customData4,custom_data_5:this.customData5,custom_data_6:this.customData6,custom_data_7:this.customData7,custom_data_8:this.customData8,custom_data_9:this.customData9,custom_data_10:this.customData10,player_integration_version:this.customPlayerIntegrationVersion,meta_page_type:this.customPageType,meta_page_url:this.pageURL},this.config.deviceData&&(this.playerData.player_preload=this.config.playerData.player_preload,this.playerData.player_autoplay=this.config.playerData.player_autoplay,this.playerData.player_software_version=this.config.playerData.player_software_version,this.playerData.player_integration_version=this.config.playerData.player_integration_version,this.playerData.player_name=this.config.playerData.player_name,this.playerData.player_language_code=this.config.playerData.player_language_code,this.playerData.player_software=this.config.playerData.player_software,this.playerData.meta_page_url=this.config.playerData.meta_page_url,this.playerData.meta_page_type=this.config.playerData.meta_page_type,this.playerData.player_height_pixels=this.config.playerData.player_height_pixels,this.playerData.player_width_pixels=this.config.playerData.player_width_pixels),t&&l.validNumber(t.videoWindowHeight)&&(this.playerData.player_height_pixels=t.videoWindowHeight),t&&l.validNumber(t.videoWindowWidth)&&(this.playerData.player_width_pixels=t.videoWindowWidth),t&&l.validBoolean(t.autoplay)&&(this.playerData.player_autoplay=t.autoplay),t&&l.validBoolean(t.preload)&&(this.playerData.player_preload=t.preload),t&&l.validString(t.version)&&(this.playerData.player_software_version=t.version),t&&l.validString(t.audioLanguage)&&(this.playerData.player_language_code=t.audioLanguage),t&&l.validString(t.playerSoftware)&&(this.playerData.player_software=t.playerSoftware)}},{key:"setUserId",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(e)this.userId=e;else if(t)this.userId=l.uuidv4();else{var a=l.getCookie("gumlet_user_id");this.userId=a&&""!==a?a:l.setCookie("gumlet_user_id",43200)}}},{key:"setPlayerInstanceId",value:function(){this.config.getUUID?this.playerInstanceId=this.config.getUUID():this.playerInstanceId=l.uuidv4(),this.setPlayerData()}},{key:"setPlaybackId",value:function(){this.config.getUUID?this.playbackId=this.config.getUUID():this.playbackId=l.uuidv4()}},{key:"setSessionId",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,a=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(e)return this.sessionId=e,this.setSessionData(),void(a&&this.sessionCreationCall.sendRequest(this.sessionData,l.noOp));if(t)this.sessionId=l.uuidv4();else{var i=l.getCookie("gumlet_session_id");i&&""!==i?(this.sessionId=i,this.setSessionData()):(this.sessionId=l.setCookie("gumlet_session_id",30),this.setSessionData(),this.sessionCreationCall.sendRequest(this.sessionData,l.noOp))}}},{key:"sendAnalyticsSetupCall",value:function(){this.sendAnalyticsRequestAndClearValues(aa.SETUP,{millis_from_previous_event:0}),this.setState(aa.SETUP)}},{key:"getMillisFromPreviousState",value:function(){return(new Date).getTime()-this.previousStateTimeStamp.getTime()}},{key:"getPlaybackWatchTime",value:function(){return this.playbackWatchTime}},{key:"setPlaybackWatchTime",value:function(t){this.playbackWatchTime=t}},{key:"setVideoData",value:function(t){t&&l.validNumber(t.duration)&&(this.videoDuration=l.calculateTime(t.duration)),t&&l.validString(t.streamType)&&(this.videoSourceType=t.streamType,"dash"===t.streamType&&l.validString(t.mpdUrl)?(this.videoSourceUrl=t.mpdUrl,this.videoSourceHostname=new URL(this.videoSourceUrl).hostname):"hls"===t.streamType&&l.validString(t.m3u8Url)?(this.videoSourceUrl=t.m3u8Url,this.videoSourceHostname=new URL(this.videoSourceUrl).hostname):"hls"===t.streamType&&l.validString(t.streamUrl)?(this.videoSourceUrl=t.streamUrl,this.videoSourceHostname=new URL(this.videoSourceUrl).hostname):"progressive"===t.streamType&&l.validString(t.progUrl)?(this.videoSourceUrl=t.progUrl,this.videoSourceHostname=new URL(this.videoSourceUrl).hostname):t&&t.streamUrl&&(this.videoSourceUrl=t.streamUrl,this.videoSourceHostname=new URL(this.videoSourceUrl).hostname)),t&&t.streamUrl&&(this.videoSourceUrl=t.streamUrl),t&&t.sourceHostName&&(this.videoSourceHostname=t.sourceHostName),t&&Object.hasOwn(t,"muted")&&(this.isMuted=t.muted),t&&t.currentVideoData&&l.validNumber(t.currentVideoData.height)&&t.currentVideoData.height>0&&(this.videoHeightPixels=t.currentVideoData.height),t&&t.currentVideoData&&l.validNumber(t.currentVideoData.width)&&t.currentVideoData.width>0&&(this.videoWidthPixels=t.currentVideoData.width),t&&t.currentVideoData&&l.validNumber(t.currentVideoData.bitrate)&&t.currentVideoData.bitrate>-1&&(this.videoBitrate=t.currentVideoData.bitrate/1e6),t&&t.currentVideoData&&l.validString(t.currentVideoData.audioCodec)&&t.currentVideoData.audioCodec.length>0&&(this.audioCodec=t.currentVideoData.audioCodec),t&&t.currentVideoData&&l.validString(t.currentVideoData.videoCodec)&&t.currentVideoData.videoCodec.length>0&&(this.videoCodec=t.currentVideoData.videoCodec);var e=0;if(!(this.videoHeightPixels&&this.playerData.player_height_pixels&&this.sessionData.meta_device_display_dpr))return this.upscalePercentage=void 0,void(this.downscalePercentage=void 0);(e=this.playerData.player_height_pixels*this.sessionData.meta_device_display_dpr/this.videoHeightPixels-1)>0?(this.upscalePercentage=100*e,this.downscalePercentage=0):e<0?(this.upscalePercentage=0,this.downscalePercentage=100*e*-1):(this.upscalePercentage=0,this.downscalePercentage=0);var a=new URL(this.videoSourceUrl);"video.gumlet.io"!==a.hostname||this.customVideoId||(this.customVideoId=a.pathname.split("/")[2])}},{key:"setupStateMachineCallbacks",value:function(){var e=this;this.stateMachineCallbacks={setup:function(t,a,i,r){X.log("Setup Gumlet analytics "+e.analyticsVersion),e.setDuration(t),e.setVideoData(i);var n=0;r&&r.starttime&&(n=(new Date).getTime()-r.starttime),e.sendAnalyticsRequestAndClearValues(aa.SETUP,{millis_from_previous_event:n}),e.setState(aa.SETUP)},ready:function(t,a,i){e.setDuration(t),e.setVideoData(i),e.setPlaybackSettingsFromLoadedEvent(i),e.sendAnalyticsRequestAndClearValues(aa.PLAYER_READY),e.setState(aa.PLAYER_READY),e.setPlayerData(i),e.playerInitCall.sendRequest(e.playerData,l.noOp)},loaded:function(t,a,i){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;e.setDuration(t),e.setVideoData(i),e.setPlaybackSettingsFromLoadedEvent(i);var n={};null!==r&&(n={millis_from_previous_event:r,previous_event:aa.PLAYER_READY}),e.sendAnalyticsRequestAndClearValues(aa.PLAYBACK_READY,n),null===r&&e.setState(aa.PLAYBACK_READY)},startup:function(t,a){e.setDuration(t)},first_play:function(t,a,i){e.setDuration(t),e.setVideoData(i),e.setPlaybackSettingsFromLoadedEvent(i),e.sendAnalyticsRequestAndClearValues(aa.PLAY),e.setState(aa.PLAY),e.firstPlayTimestamp=new Date},play:function(t,a,i){e.setDuration(t),e.setVideoData(i),e.setPlaybackSettingsFromLoadedEvent(i),e.sendAnalyticsRequestAndClearValues(aa.PLAY),e.setState(aa.PLAY)},updateSample:function(t){e.setPlaybackSettingsFromLoadedEvent(t)},playing:function(t,a,i){e.setDuration(t),e.setVideoData(i),e.setPlaybackSettingsFromLoadedEvent(i),e.sendAnalyticsRequestAndClearValues(aa.PLAYING),e.setState(aa.PLAYING)},playback_started:function(t,a,i){e.setDuration(t),e.setVideoData(i),e.setPlaybackSettingsFromLoadedEvent(i);var r=(new Date).getTime()-e.firstPlayTimestamp.getTime();e.sendAnalyticsRequestAndClearValues(aa.PLAYBACK_STARTED,{millis_from_previous_event:r}),e.setState(aa.PLAYBACK_STARTED)},playingAndBye:function(t,a,i){e.setDuration(t),e.setDroppedFrames(i),e.sendUnloadRequest()},heartbeat:function(t,a,i){e.setDuration(t),e.setVideoData(i),e.setPlaybackSettingsFromLoadedEvent(i),e.sendAnalyticsRequestAndClearValues(aa.PLAYBACK_UPDATE),e.setState(aa.PLAYBACK_UPDATE)},playbackWatchTime:function(t){e.setPlaybackWatchTime(t)},qualitychange:function(t,a){e.setDuration(t)},qualitychange_pause:function(t,a){e.setDuration(t)},qualitychange_rebuffering:function(t,a){e.setDuration(t)},videoChange:function(t){e.stateMachineCallbacks.setVideoTimeEndFromEvent(t),e.stateMachineCallbacks.setVideoTimeStartFromEvent(t),e.setPlaybackSettingsFromLoadedEvent(t)},audioChange:function(t){e.stateMachineCallbacks.setVideoTimeEndFromEvent(t),e.stateMachineCallbacks.setVideoTimeStartFromEvent(t)},pause:function(t,a,i){e.setDuration(t),e.setVideoData(i),e.setPlaybackSettingsFromLoadedEvent(i),e.sendAnalyticsRequestAndClearValues(aa.PAUSE),e.setState(aa.PAUSE)},start_rebuffer:function(t,a,i){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];e.setDuration(t),e.setVideoData(i),e.setPlaybackSettingsFromLoadedEvent(i),r||e.sendAnalyticsRequestAndClearValues(aa.START_REBUFFER),e.setState(aa.START_REBUFFER)},end_rebuffer:function(t,a,i){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(e.setDuration(t),e.setVideoData(i),e.setPlaybackSettingsFromLoadedEvent(i),r)return e.getSample(aa.END_REBUFFER);e.sendAnalyticsRequestAndClearValues(aa.END_REBUFFER),e.setState(aa.END_REBUFFER)},playback_seeked:function(t,a,i,r){e.sendAnalyticsRequestAndClearValues(aa.SEEKED,{from:t,to:a}),e.setState(aa.SEEKED),e.setupSample(),"PAUSE"===r?(e.sendAnalyticsRequestAndClearValues(aa.PAUSE,{millis_from_previous_event:i}),e.setState(aa.PAUSE)):"PLAYING"===r&&(e.sendAnalyticsRequestAndClearValues(aa.PLAYING,{millis_from_previous_event:i}),e.setState(aa.PLAYING))},paused_seeking:function(t,a,i){e.setDuration(t)},play_seeking:l.noOp,end_play_seeking:function(t,a,i){e.setDuration(t)},rebuffering:function(t,a,i){e.setDuration(t)},error:function(t){e.stateMachineCallbacks.setVideoTimeEndFromEvent(t),e.stateMachineCallbacks.setVideoTimeStartFromEvent(t),e.sendAnalyticsRequestAndClearValues(aa.ERROR,{error_code:t&&t.code,error:t&&t.message}),e.setState(aa.ERROR),e.setupSample()},end:function(t,a,i){e.setPlaybackId(),e.setDuration(t),e.sendAnalyticsRequestAndClearValues(aa.END),e.setState(aa.END)},ad:function(t,a,i){e.setDuration(t),e.setDroppedFrames(i)},mute:function(t,a){e.isMuted=!0,e.setPlaybackSettingsFromLoadedEvent(a),e.sendAnalyticsRequestAndClearValues(aa.MUTE)},unMute:function(t,a){e.isMuted=!1,e.setPlaybackSettingsFromLoadedEvent(a),e.sendAnalyticsRequestAndClearValues(aa.UNMUTE)},muting_ready:l.noOp,muting_play:l.noOp,muting_pause:l.noOp,setVideoTimeEndFromEvent:function(t){},setVideoTimeStartFromEvent:function(t){},startCasting:function(a,i){if(i&&i.resuming)return e.isAllowedToSendSamples=!1,void X.warning("Player started casting but a session is already casting!");e.isCastClient=!0,e.isAllowedToSendSamples=!1;var r=e.sample,n=r.domain,s=r.path,o=r.language,l=r.userAgent,c=r.userId,u=r.impressionId,m={type:t.CAST_RECEIVER_CONFIG_MESSAGE,data:{config:e.config,userId:c,domain:n,path:s,language:o,userAgent:l,impressionId:u}};e.castClient.setUp(),e.castClient.sendMessage(m)},casting:function(){e.isCastClient=!1,e.samplesQueue=[],e.isAllowedToSendSamples=!0},source_changing:function(){},resetSessionExpiry:function(){e.config.test||e.config.sessionID||(l.setCookie("gumlet_session_id",30,e.sessionId),l.setCookie("gumlet_user_id",43200,e.userId))}}}},{key:"setDuration",value:function(t){}},{key:"setState",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;t&&(this.previousState=t,this.previousStateTimeStamp=new Date)}},{key:"setPlaybackSettingsFromLoadedEvent",value:function(t){t&&l.validNumber(t.currentTime)&&(this.currentTime=l.calculateTime(t.currentTime)),t&&l.validBoolean(t.isFullScreen)&&(this.isFullScreen=t.isFullScreen),t&&l.validBoolean(t.isCasting)&&(this.isCasting=t.isCasting)}},{key:"setupSample",value:function(){this.sample={property_id:this.propertyId,session_id:this.sessionId,user_id:this.userId,player_instance_id:this.playerInstanceId,playback_id:this.playbackId,from:void 0,to:void 0,playback_time_instant_millis:void 0,bitrate_mbps:this.videoBitrate,error_code:void 0,error:void 0,error_text:void 0,video_cover:void 0,video_cover_reference:void 0,player_remote_played:void 0,video_total_duration_millis:this.videoDuration,video_width_pixels:void 0,video_height_pixels:void 0,video_source_url:void 0,video_source_hostname:void 0,video_source_type:void 0,custom_content_type:this.customContentType,custom_video_duration_millis:this.customVideoDurationMillis,custom_encoding_variant:this.customEncodingVariant,custom_video_language:this.customVideoLanguage,custom_video_id:this.customVideoId,custom_video_series:this.customVideoSeries,custom_video_producer:this.customVideoProducer,custom_video_title:this.customVideoTitle,custom_video_variant_name:this.customVideoVariantName,custom_video_variant:this.customVideoVariant,muted:this.isMuted,casting:void 0,fullscreen:this.isFullScreen,video_downscale_percentage:void 0,video_upscale_percentage:void 0,orientation:void 0,orientation_from:void 0,quality:void 0,quality_from:void 0,previous_event:void 0,millis_from_previous_event:void 0,video_codec:void 0,audio_codec:void 0,custom_data_1:this.customData1,custom_data_2:this.customData2,custom_data_3:this.customData3,custom_data_4:this.customData4,custom_data_5:this.customData5,custom_data_6:this.customData6,custom_data_7:this.customData7,custom_data_8:this.customData8,custom_data_9:this.customData9,custom_data_10:this.customData10,custom_event_data:void 0,playback_watch_time:void 0}}},{key:"getSample",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=this.sample;if(a.event=t,this.config.getUUID?a.event_id=this.config.getUUID():a.event_id=l.uuidv4(),a.custom_data_1=this.customData1,a.custom_data_2=this.customData2,a.custom_data_3=this.customData3,a.custom_data_4=this.customData4,a.custom_data_5=this.customData5,a.custom_data_6=this.customData6,a.custom_data_7=this.customData7,a.custom_data_8=this.customData8,a.custom_data_9=this.customData9,a.custom_data_10=this.customData1,a.custom_content_type=this.customContentType,a.custom_video_duration_millis=this.customVideoDurationMillis,a.custom_encoding_variant=this.customEncodingVariant,a.custom_video_language=this.customVideoLanguage,a.custom_video_id=this.customVideoId,a.custom_video_series=this.customVideoSeries,a.custom_video_producer=this.customVideoProducer,a.custom_video_title=this.customVideoTitle,a.custom_video_variant_name=this.customVideoVariantName,a.custom_video_variant=this.customVideoVariant,a.millis_from_previous_event=this.getMillisFromPreviousState(),a.previous_event=this.previousState,a.fullscreen=this.isFullScreen,a.muted=this.isMuted,a.video_width_pixels=this.videoWidthPixels,a.video_height_pixels=this.videoHeightPixels,a.video_total_duration_millis=this.videoDuration,a.bitrate=this.videoBitrate,a.audio_codec=this.audioCodec,a.video_codec=this.videoCodec,a.orientation=this.orientation,a.playback_time_instant_millis=this.currentTime,a.video_source_type=this.videoSourceType,a.video_source_url=this.videoSourceUrl,a.video_upscale_percentage=this.upscalePercentage,a.video_downscale_percentage=this.downscalePercentage,a.video_source_hostname=this.videoSourceHostname,a.custom_event_data=void 0,a.playback_watch_time=this.playbackWatchTime,Object.keys(e).forEach(function(t){a[t]=e[t]}),"undefined"!=typeof window&&void 0!==window.parent&&window.navigator)try{"function"==typeof window.navigator.getBattery&&window.navigator.getBattery().then(function(t){t&&(a.battery_level_percentage=100*t.level,a.battery_charging=t.charging)})}catch(t){}return a}},{key:"sendAnalyticsRequest",value:function(t,e){var a=this.getSample(t,e);a.playback_time_instant_millis&&a.video_total_duration_millis&&a.playback_time_instant_millis>a.video_total_duration_millis||this.analyticsCall.sendRequest(a,l.noOp)}},{key:"sendAnalyticsRequestAsync",value:function(t,e){var a=this;return new Promise(function(i,r){var n=a.getSample(t,e);n.playback_time_instant_millis&&n.video_total_duration_millis&&n.playback_time_instant_millis>n.video_total_duration_millis?i(406):a.analyticsCall.sendRequestAsync(n).then(function(t){i(t)}).catch(function(t){r(t)})})}},{key:"sendAnalyticsRequestAndClearValues",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!t)return X.log("event null passed not hitting the injestion API"),False;this.videoDuration&&this.videoDuration>864e5||this.sendAnalyticsRequest(t,e)}},{key:"sendAnalyticsRequestAndClearValuesAsync",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise(function(i,r){e||(X.log("event null passed not hitting the injestion API"),r("event null passed not hitting the injestion API")),t.sendAnalyticsRequestAsync(e,a).then(function(t){i(t)}).catch(function(t){r(t)})})}},{key:"sendUnloadRequest",value:function(){var t=this;"denied"!==this.licensing&&(void 0===navigator.sendBeacon?this.sendAnalyticsRequestSynchronous():fetch(this.analyticsCall.getAnalyticsServerUrl(),{method:"POST",body:JSON.stringify(this.sample),headers:{"Content-Type":"application/json"}}).then(function(e){e.ok||t.sendAnalyticsRequestSynchronous()}).catch(function(e){t.sendAnalyticsRequestSynchronous()}))}},{key:"sendAnalyticsRequestSynchronous",value:function(){"denied"!==this.licensing&&this.analyticsCall.sendRequestSynchronous(this.sample,l.noOp)}},{key:"clearValues",value:function(){this.sample.ad=0,this.sample.paused=0,this.sample.played=0,this.sample.seeked=0,this.sample.buffered=0,this.sample.playerStartupTime=0,this.sample.videoStartupTime=0,this.sample.startupTime=0,this.sample.duration=0,this.sample.droppedFrames=0,this.sample.pageLoadType=0}},{key:"getDroppedFrames",value:function(t){if(void 0!==t&&0!==t){var e=t-this.droppedSampleFrames;return this.droppedSampleFrames=t,e}return 0}}],a&&sa(e.prototype,a),i&&sa(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,a,i}();oa(ca,"PAGE_LOAD_TYPE",{FOREGROUND:1,BACKGROUND:2}),oa(ca,"LICENSE_CALL_PENDING_TIMEOUT",200),oa(ca,"PAGE_LOAD_TYPE_TIMEOUT",200),oa(ca,"CAST_RECEIVER_CONFIG_MESSAGE","CAST_RECEIVER_CONFIG_MESSAGE");const ua=ca;const ma={CLOUDFLARE:"cloudflare",AKAMAI:"akamai",FASTLY:"fastly",MAXCDN:"maxcdn",CLOUDFRONT:"cloudfront",CHINACACHE:"chinacache",BITGRAVITY:"bitgravity"};var ha,Ea=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return ha.register(t,e)},Sa=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return ha.registerVideoJSPlayer(t,e)},da=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return ha.registerDashJSPlayer(t,e)},fa=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return ha.registerHLSJSPlayer(t,e)},pa=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return ha.registerShakaPlayer(t,e)},ya=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return ha.registerHTML5Player(t,e)},Aa=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return ha.registerReactNativeVideoPlayer(t,e)},va=function(){return ha.getCurrentImpressionId()},_a=function(){return ha.analyticsStateMachine},ba=function(t){return ha.updateCustomData(t)},Na=function(t){return ha.updateCustomVideoData(t)},ga=function(t){return ha.updateCustomUserData(t)},Ta=function(t){return ha.updateCustomPlayerData(t)},Da=function(t,e){return ha.customEventHandler(t,e)},Ia=function(t,e){return new Promise(function(a,i){ha.customEventHandlerAsync(t,e).then(function(t){a(t)}).catch(function(t){i(t)})})},Pa=function(t){return ha=new ua(t),{register:Ea,registerVideoJSPlayer:Sa,registerDashJSPlayer:da,registerHLSJSPlayer:fa,registerShakaPlayer:pa,registerHTML5Player:ya,registerReactNativeVideoPlayer:Aa,getCurrentImpressionId:va,stateMachine:_a,updateCustomData:ba,updateCustomVideoData:Na,updateCustomUserData:ga,updateCustomPlayerData:Ta,setCustomData:ha.setCustomData,setCustomDataOnce:ha.setCustomDataOnce,customEventHandler:Da,customEventHandlerAsync:Ia}};Pa.Players=Lt,Pa.CdnProviders=ma,Pa.gumletInsightsEvents=nt,Pa.gumletSupportedPlayers=Lt,"undefined"!=typeof window&&(window.gumlet=window.gumlet||{},window.gumlet.insights=Pa,window.gumletInsightsEvents=nt,window.gumletSupportedPlayers=Lt);const Ca={insights:Pa,gumletInsightsEvents,gumletSupportedPlayers}})(),i})());
2
+ !function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var a=e();for(var i in a)("object"==typeof exports?exports:t)[i]=a[i]}}(self,()=>(()=>{var t={595(t,e){var a;a={VERSION:"2.4.0",Result:{SUCCEEDED:1,NOTRANSITION:2,CANCELLED:3,PENDING:4},Error:{INVALID_TRANSITION:100,PENDING_TRANSITION:200,INVALID_CALLBACK:300},WILDCARD:"*",ASYNC:"async",create:function(t,e){var i="string"==typeof t.initial?{state:t.initial}:t.initial,r=t.terminal||t.final,n=e||t.target||{},s=t.events||[],o=t.callbacks||{},l={},c={},u=function(t){var e=Array.isArray(t.from)?t.from:t.from?[t.from]:[a.WILDCARD];l[t.name]=l[t.name]||{};for(var i=0;i<e.length;i++)c[e[i]]=c[e[i]]||[],c[e[i]].push(t.name),l[t.name][e[i]]=t.to||e[i];t.to&&(c[t.to]=c[t.to]||[])};i&&(i.event=i.event||"startup",u({name:i.event,from:"none",to:i.state}));for(var m=0;m<s.length;m++)u(s[m]);for(var h in l)l.hasOwnProperty(h)&&(n[h]=a.buildEvent(h,l[h]));for(var h in o)o.hasOwnProperty(h)&&(n[h]=o[h]);return n.current="none",n.is=function(t){return Array.isArray(t)?t.indexOf(this.current)>=0:this.current===t},n.can=function(t){return!this.transition&&void 0!==l[t]&&(l[t].hasOwnProperty(this.current)||l[t].hasOwnProperty(a.WILDCARD))},n.cannot=function(t){return!this.can(t)},n.transitions=function(){return(c[this.current]||[]).concat(c[a.WILDCARD]||[])},n.isFinished=function(){return this.is(r)},n.error=t.error||function(t,e,a,i,r,n,s){throw s||n},n.states=function(){return Object.keys(c).sort()},i&&!i.defer&&n[i.event](),n},doCallback:function(t,e,i,r,n,s){if(e)try{return e.apply(t,[i,r,n].concat(s))}catch(e){return t.error(i,r,n,s,a.Error.INVALID_CALLBACK,"an exception occurred in a caller-provided callback function",e)}},beforeAnyEvent:function(t,e,i,r,n){return a.doCallback(t,t.onbeforeevent,e,i,r,n)},afterAnyEvent:function(t,e,i,r,n){return a.doCallback(t,t.onafterevent||t.onevent,e,i,r,n)},leaveAnyState:function(t,e,i,r,n){return a.doCallback(t,t.onleavestate,e,i,r,n)},enterAnyState:function(t,e,i,r,n){return a.doCallback(t,t.onenterstate||t.onstate,e,i,r,n)},changeState:function(t,e,i,r,n){return a.doCallback(t,t.onchangestate,e,i,r,n)},beforeThisEvent:function(t,e,i,r,n){return a.doCallback(t,t["onbefore"+e],e,i,r,n)},afterThisEvent:function(t,e,i,r,n){return a.doCallback(t,t["onafter"+e]||t["on"+e],e,i,r,n)},leaveThisState:function(t,e,i,r,n){return a.doCallback(t,t["onleave"+i],e,i,r,n)},enterThisState:function(t,e,i,r,n){return a.doCallback(t,t["onenter"+r]||t["on"+r],e,i,r,n)},beforeEvent:function(t,e,i,r,n){if(!1===a.beforeThisEvent(t,e,i,r,n)||!1===a.beforeAnyEvent(t,e,i,r,n))return!1},afterEvent:function(t,e,i,r,n){a.afterThisEvent(t,e,i,r,n),a.afterAnyEvent(t,e,i,r,n)},leaveState:function(t,e,i,r,n){var s=a.leaveThisState(t,e,i,r,n),o=a.leaveAnyState(t,e,i,r,n);return!1!==s&&!1!==o&&(a.ASYNC===s||a.ASYNC===o?a.ASYNC:void 0)},enterState:function(t,e,i,r,n){a.enterThisState(t,e,i,r,n),a.enterAnyState(t,e,i,r,n)},buildEvent:function(t,e){return function(){var i=this.current,r=e[i]||(e[a.WILDCARD]!=a.WILDCARD?e[a.WILDCARD]:i)||i,n=Array.prototype.slice.call(arguments);if(this.transition)return this.error(t,i,r,n,a.Error.PENDING_TRANSITION,"event "+t+" inappropriate because previous transition did not complete");if(this.cannot(t))return this.error(t,i,r,n,a.Error.INVALID_TRANSITION,"event "+t+" inappropriate in current state "+this.current);if(!1===a.beforeEvent(this,t,i,r,n))return a.Result.CANCELLED;if(i===r)return a.afterEvent(this,t,i,r,n),a.Result.NOTRANSITION;var s=this;this.transition=function(){return s.transition=null,s.current=r,a.enterState(s,t,i,r,n),a.changeState(s,t,i,r,n),a.afterEvent(s,t,i,r,n),a.Result.SUCCEEDED},this.transition.cancel=function(){s.transition=null,a.afterEvent(s,t,i,r,n)};var o=a.leaveState(this,t,i,r,n);return!1===o?(this.transition=null,a.Result.CANCELLED):a.ASYNC===o?a.Result.PENDING:this.transition?this.transition():void 0}}},t.exports&&(e=t.exports=a),e.StateMachine=a},503(t,e,a){var i;t=a.nmd(t),function(){"use strict";var r={function:!0,object:!0},n=r[typeof window]&&window||this,s=r[typeof e]&&e,o=r.object&&t&&!t.nodeType&&t,l=s&&o&&"object"==typeof a.g&&a.g;!l||l.global!==l&&l.window!==l&&l.self!==l||(n=l);var c=Math.pow(2,53)-1,u=/\bOpera/,m=Object.prototype,h=m.hasOwnProperty,E=m.toString;function S(t){return(t=String(t)).charAt(0).toUpperCase()+t.slice(1)}function d(t){return t=v(t),/^(?:webOS|i(?:OS|P))/.test(t)?t:S(t)}function f(t,e){for(var a in t)h.call(t,a)&&e(t[a],a,t)}function p(t){return null==t?S(t):E.call(t).slice(8,-1)}function y(t){return String(t).replace(/([ -])(?!$)/g,"$1?")}function A(t,e){var a=null;return function(t,e){var a=-1,i=t?t.length:0;if("number"==typeof i&&i>-1&&i<=c)for(;++a<i;)e(t[a],a,t);else f(t,e)}(t,function(i,r){a=e(a,i,r,t)}),a}function v(t){return String(t).replace(/^ +| +$/g,"")}var _=function t(e){var a=n,i=e&&"object"==typeof e&&"String"!=p(e);i&&(a=e,e=null);var r=a.navigator||{},s=r.userAgent||"";e||(e=s);var o,l,c,m,h,S=i?!!r.likeChrome:/\bChrome\b/.test(e)&&!/internal|\n/i.test(E.toString()),_="Object",b=i?_:"ScriptBridgingProxyObject",N=i?_:"Environment",g=i&&a.java?"JavaPackage":p(a.java),T=i?_:"RuntimeObject",D=/\bJava/.test(g)&&a.java,I=D&&p(a.environment)==N,P=D?"a":"α",C=D?"b":"β",U=a.document||{},R=a.operamini||a.opera,G=u.test(G=i&&R?R["[[Class]]"]:p(R))?G:R=null,L=e,k=[],Y=null,O=e==s,w=O&&R&&"function"==typeof R.version&&R.version(),F=A([{label:"EdgeHTML",pattern:"Edge"},"Trident",{label:"WebKit",pattern:"AppleWebKit"},"iCab","Presto","NetFront","Tasman","KHTML","Gecko"],function(t,a){return t||RegExp("\\b"+(a.pattern||y(a))+"\\b","i").exec(e)&&(a.label||a)}),M=function(t){return A(t,function(t,a){return t||RegExp("\\b"+(a.pattern||y(a))+"\\b","i").exec(e)&&(a.label||a)})}(["Adobe AIR","Arora","Avant Browser","Breach","Camino","Electron","Epiphany","Fennec","Flock","Galeon","GreenBrowser","iCab","Iceweasel","K-Meleon","Konqueror","Lunascape","Maxthon",{label:"Microsoft Edge",pattern:"(?:Edge|Edg|EdgA|EdgiOS)"},"Midori","Nook Browser","PaleMoon","PhantomJS","Raven","Rekonq","RockMelt",{label:"Samsung Internet",pattern:"SamsungBrowser"},"SeaMonkey",{label:"Silk",pattern:"(?:Cloud9|Silk-Accelerated)"},"Sleipnir","SlimBrowser",{label:"SRWare Iron",pattern:"Iron"},"Sunrise","Swiftfox","Vivaldi","Waterfox","WebPositive",{label:"Yandex Browser",pattern:"YaBrowser"},{label:"UC Browser",pattern:"UCBrowser"},"Opera Mini",{label:"Opera Mini",pattern:"OPiOS"},"Opera",{label:"Opera",pattern:"OPR"},"Chromium","Chrome",{label:"Chrome",pattern:"(?:HeadlessChrome)"},{label:"Chrome Mobile",pattern:"(?:CriOS|CrMo)"},{label:"Firefox",pattern:"(?:Firefox|Minefield)"},{label:"Firefox for iOS",pattern:"FxiOS"},{label:"IE",pattern:"IEMobile"},{label:"IE",pattern:"MSIE"},"Safari"]),H=B([{label:"BlackBerry",pattern:"BB10"},"BlackBerry",{label:"Galaxy S",pattern:"GT-I9000"},{label:"Galaxy S2",pattern:"GT-I9100"},{label:"Galaxy S3",pattern:"GT-I9300"},{label:"Galaxy S4",pattern:"GT-I9500"},{label:"Galaxy S5",pattern:"SM-G900"},{label:"Galaxy S6",pattern:"SM-G920"},{label:"Galaxy S6 Edge",pattern:"SM-G925"},{label:"Galaxy S7",pattern:"SM-G930"},{label:"Galaxy S7 Edge",pattern:"SM-G935"},"Google TV","Lumia","iPad","iPod","iPhone","Kindle",{label:"Kindle Fire",pattern:"(?:Cloud9|Silk-Accelerated)"},"Nexus","Nook","PlayBook","PlayStation Vita","PlayStation","TouchPad","Transformer",{label:"Wii U",pattern:"WiiU"},"Wii","Xbox One",{label:"Xbox 360",pattern:"Xbox"},"Xoom"]),K=function(t){return A(t,function(t,a,i){return t||(a[H]||a[/^[a-z]+(?: +[a-z]+\b)*/i.exec(H)]||RegExp("\\b"+y(i)+"(?:\\b|\\w*\\d)","i").exec(e))&&i})}({Apple:{iPad:1,iPhone:1,iPod:1},Alcatel:{},Archos:{},Amazon:{Kindle:1,"Kindle Fire":1},Asus:{Transformer:1},"Barnes & Noble":{Nook:1},BlackBerry:{PlayBook:1},Google:{"Google TV":1,Nexus:1},HP:{TouchPad:1},HTC:{},Huawei:{},Lenovo:{},LG:{},Microsoft:{Xbox:1,"Xbox One":1},Motorola:{Xoom:1},Nintendo:{"Wii U":1,Wii:1},Nokia:{Lumia:1},Oppo:{},Samsung:{"Galaxy S":1,"Galaxy S2":1,"Galaxy S3":1,"Galaxy S4":1},Sony:{PlayStation:1,"PlayStation Vita":1},Xiaomi:{Mi:1,Redmi:1}}),V=function(t){return A(t,function(t,a){var i=a.pattern||y(a);return!t&&(t=RegExp("\\b"+i+"(?:/[\\d.]+|[ \\w.]*)","i").exec(e))&&(t=function(t,e,a){var i={"10.0":"10",6.4:"10 Technical Preview",6.3:"8.1",6.2:"8",6.1:"Server 2008 R2 / 7","6.0":"Server 2008 / Vista",5.2:"Server 2003 / XP 64-bit",5.1:"XP",5.01:"2000 SP1","5.0":"2000","4.0":"NT","4.90":"ME"};return e&&a&&/^Win/i.test(t)&&!/^Windows Phone /i.test(t)&&(i=i[/[\d.]+$/.exec(t)])&&(t="Windows "+i),t=String(t),e&&a&&(t=t.replace(RegExp(e,"i"),a)),d(t.replace(/ ce$/i," CE").replace(/\bhpw/i,"web").replace(/\bMacintosh\b/,"Mac OS").replace(/_PowerPC\b/i," OS").replace(/\b(OS X) [^ \d]+/i,"$1").replace(/\bMac (OS X)\b/,"$1").replace(/\/(\d)/," $1").replace(/_/g,".").replace(/(?: BePC|[ .]*fc[ \d.]+)$/i,"").replace(/\bx86\.64\b/gi,"x86_64").replace(/\b(Windows Phone) OS\b/,"$1").replace(/\b(Chrome OS \w+) [\d.]+\b/,"$1").split(" on ")[0])}(t,i,a.label||a)),t})}(["Windows Phone","KaiOS","Android","CentOS",{label:"Chrome OS",pattern:"CrOS"},"Debian",{label:"DragonFly BSD",pattern:"DragonFly"},"Fedora","FreeBSD","Gentoo","Haiku","Kubuntu","Linux Mint","OpenBSD","Red Hat","SuSE","Ubuntu","Xubuntu","Cygwin","Symbian OS","hpwOS","webOS ","webOS","Tablet OS","Tizen","Linux","Mac OS X","Macintosh","Mac","Windows 98;","Windows "]);function B(t){return A(t,function(t,a){var i=a.pattern||y(a);return!t&&(t=RegExp("\\b"+i+" *\\d+[.\\w_]*","i").exec(e)||RegExp("\\b"+i+" *\\w+-[\\w]*","i").exec(e)||RegExp("\\b"+i+"(?:; *(?:[a-z]+[_-])?[a-z]+\\d+|[^ ();-]*)","i").exec(e))&&((t=String(a.label&&!RegExp(i,"i").test(a.label)?a.label:t).split("/"))[1]&&!/[\d.]+/.test(t[0])&&(t[0]+=" "+t[1]),a=a.label||a,t=d(t[0].replace(RegExp(i,"i"),a).replace(RegExp("; *(?:"+a+"[_-])?","i")," ").replace(RegExp("("+a+")[-_.]?(\\w)","i"),"$1 $2"))),t})}function j(t){return A(t,function(t,a){return t||(RegExp(a+"(?:-[\\d.]+/|(?: for [\\w-]+)?[ /-])([\\d.]+[^ ();/_-]*)","i").exec(e)||0)[1]||null})}if(F&&(F=[F]),/\bAndroid\b/.test(V)&&!H&&(o=/\bAndroid[^;]*;(.*?)(?:Build|\) AppleWebKit)\b/i.exec(e))&&(H=v(o[1]).replace(/^[a-z]{2}-[a-z]{2};\s*/i,"")||null),K&&!H?H=B([K]):K&&H&&(H=H.replace(RegExp("^("+y(K)+")[-_.\\s]","i"),K+" ").replace(RegExp("^("+y(K)+")[-_.]?(\\w)","i"),K+" $2")),(o=/\bGoogle TV\b/.exec(H))&&(H=o[0]),/\bSimulator\b/i.test(e)&&(H=(H?H+" ":"")+"Simulator"),"Opera Mini"==M&&/\bOPiOS\b/.test(e)&&k.push("running in Turbo/Uncompressed mode"),"IE"==M&&/\blike iPhone OS\b/.test(e)?(K=(o=t(e.replace(/like iPhone OS/,""))).manufacturer,H=o.product):/^iP/.test(H)?(M||(M="Safari"),V="iOS"+((o=/ OS ([\d_]+)/i.exec(e))?" "+o[1].replace(/_/g,"."):"")):"Konqueror"==M&&/^Linux\b/i.test(V)?V="Kubuntu":K&&"Google"!=K&&(/Chrome/.test(M)&&!/\bMobile Safari\b/i.test(e)||/\bVita\b/.test(H))||/\bAndroid\b/.test(V)&&/^Chrome/.test(M)&&/\bVersion\//i.test(e)?(M="Android Browser",V=/\bAndroid\b/.test(V)?V:"Android"):"Silk"==M?(/\bMobi/i.test(e)||(V="Android",k.unshift("desktop mode")),/Accelerated *= *true/i.test(e)&&k.unshift("accelerated")):"UC Browser"==M&&/\bUCWEB\b/.test(e)?k.push("speed mode"):"PaleMoon"==M&&(o=/\bFirefox\/([\d.]+)\b/.exec(e))?k.push("identifying as Firefox "+o[1]):"Firefox"==M&&(o=/\b(Mobile|Tablet|TV)\b/i.exec(e))?(V||(V="Firefox OS"),H||(H=o[1])):!M||(o=!/\bMinefield\b/i.test(e)&&/\b(?:Firefox|Safari)\b/.exec(M))?(M&&!H&&/[\/,]|^[^(]+?\)/.test(e.slice(e.indexOf(o+"/")+8))&&(M=null),(o=H||K||V)&&(H||K||/\b(?:Android|Symbian OS|Tablet OS|webOS)\b/.test(V))&&(M=/[a-z]+(?: Hat)?/i.exec(/\bAndroid\b/.test(V)?V:o)+" Browser")):"Electron"==M&&(o=(/\bChrome\/([\d.]+)\b/.exec(e)||0)[1])&&k.push("Chromium "+o),w||(w=j(["(?:Cloud9|CriOS|CrMo|Edge|Edg|EdgA|EdgiOS|FxiOS|HeadlessChrome|IEMobile|Iron|Opera ?Mini|OPiOS|OPR|Raven|SamsungBrowser|Silk(?!/[\\d.]+$)|UCBrowser|YaBrowser)","Version",y(M),"(?:Firefox|Minefield|NetFront)"])),(o=("iCab"==F&&parseFloat(w)>3?"WebKit":/\bOpera\b/.test(M)&&(/\bOPR\b/.test(e)?"Blink":"Presto"))||/\b(?:Midori|Nook|Safari)\b/i.test(e)&&!/^(?:Trident|EdgeHTML)$/.test(F)&&"WebKit"||!F&&/\bMSIE\b/i.test(e)&&("Mac OS"==V?"Tasman":"Trident")||"WebKit"==F&&/\bPlayStation\b(?! Vita\b)/i.test(M)&&"NetFront")&&(F=[o]),"IE"==M&&(o=(/; *(?:XBLWP|ZuneWP)(\d+)/i.exec(e)||0)[1])?(M+=" Mobile",V="Windows Phone "+(/\+$/.test(o)?o:o+".x"),k.unshift("desktop mode")):/\bWPDesktop\b/i.test(e)?(M="IE Mobile",V="Windows Phone 8.x",k.unshift("desktop mode"),w||(w=(/\brv:([\d.]+)/.exec(e)||0)[1])):"IE"!=M&&"Trident"==F&&(o=/\brv:([\d.]+)/.exec(e))&&(M&&k.push("identifying as "+M+(w?" "+w:"")),M="IE",w=o[1]),O){if(m="global",h=null!=(c=a)?typeof c[m]:"number",/^(?:boolean|number|string|undefined)$/.test(h)||"object"==h&&!c[m])p(o=a.runtime)==b?(M="Adobe AIR",V=o.flash.system.Capabilities.os):p(o=a.phantom)==T?(M="PhantomJS",w=(o=o.version||null)&&o.major+"."+o.minor+"."+o.patch):"number"==typeof U.documentMode&&(o=/\bTrident\/(\d+)/i.exec(e))?(w=[w,U.documentMode],(o=+o[1]+4)!=w[1]&&(k.push("IE "+w[1]+" mode"),F&&(F[1]=""),w[1]=o),w="IE"==M?String(w[1].toFixed(1)):w[0]):"number"==typeof U.documentMode&&/^(?:Chrome|Firefox)\b/.test(M)&&(k.push("masking as "+M+" "+w),M="IE",w="11.0",F=["Trident"],V="Windows");else if(D&&(L=(o=D.lang.System).getProperty("os.arch"),V=V||o.getProperty("os.name")+" "+o.getProperty("os.version")),I){try{w=a.require("ringo/engine").version.join("."),M="RingoJS"}catch(t){(o=a.system)&&o.global.system==a.system&&(M="Narwhal",V||(V=o[0].os||null))}M||(M="Rhino")}else"object"==typeof a.process&&!a.process.browser&&(o=a.process)&&("object"==typeof o.versions&&("string"==typeof o.versions.electron?(k.push("Node "+o.versions.node),M="Electron",w=o.versions.electron):"string"==typeof o.versions.nw&&(k.push("Chromium "+w,"Node "+o.versions.node),M="NW.js",w=o.versions.nw)),M||(M="Node.js",L=o.arch,V=o.platform,w=(w=/[\d.]+/.exec(o.version))?w[0]:null));V=V&&d(V)}if(w&&(o=/(?:[ab]|dp|pre|[ab]\d+pre)(?:\d+\+?)?$/i.exec(w)||/(?:alpha|beta)(?: ?\d)?/i.exec(e+";"+(O&&r.appMinorVersion))||/\bMinefield\b/i.test(e)&&"a")&&(Y=/b/i.test(o)?"beta":"alpha",w=w.replace(RegExp(o+"\\+?$"),"")+("beta"==Y?C:P)+(/\d+\+?/.exec(o)||"")),"Fennec"==M||"Firefox"==M&&/\b(?:Android|Firefox OS|KaiOS)\b/.test(V))M="Firefox Mobile";else if("Maxthon"==M&&w)w=w.replace(/\.[\d.]+/,".x");else if(/\bXbox\b/i.test(H))"Xbox 360"==H&&(V=null),"Xbox 360"==H&&/\bIEMobile\b/.test(e)&&k.unshift("mobile mode");else if(!/^(?:Chrome|IE|Opera)$/.test(M)&&(!M||H||/Browser|Mobi/.test(M))||"Windows CE"!=V&&!/Mobi/i.test(e))if("IE"==M&&O)try{null===a.external&&k.unshift("platform preview")}catch(t){k.unshift("embedded")}else(/\bBlackBerry\b/.test(H)||/\bBB10\b/.test(e))&&(o=(RegExp(H.replace(/ +/g," *")+"/([.\\d]+)","i").exec(e)||0)[1]||w)?(V=((o=[o,/BB10/.test(e)])[1]?(H=null,K="BlackBerry"):"Device Software")+" "+o[0],w=null):this!=f&&"Wii"!=H&&(O&&R||/Opera/.test(M)&&/\b(?:MSIE|Firefox)\b/i.test(e)||"Firefox"==M&&/\bOS X (?:\d+\.){2,}/.test(V)||"IE"==M&&(V&&!/^Win/.test(V)&&w>5.5||/\bWindows XP\b/.test(V)&&w>8||8==w&&!/\bTrident\b/.test(e)))&&!u.test(o=t.call(f,e.replace(u,"")+";"))&&o.name&&(o="ing as "+o.name+((o=o.version)?" "+o:""),u.test(M)?(/\bIE\b/.test(o)&&"Mac OS"==V&&(V=null),o="identify"+o):(o="mask"+o,M=G?d(G.replace(/([a-z])([A-Z])/g,"$1 $2")):"Opera",/\bIE\b/.test(o)&&(V=null),O||(w=null)),F=["Presto"],k.push(o));else M+=" Mobile";(o=(/\bAppleWebKit\/([\d.]+\+?)/i.exec(e)||0)[1])&&(o=[parseFloat(o.replace(/\.(\d)$/,".0$1")),o],"Safari"==M&&"+"==o[1].slice(-1)?(M="WebKit Nightly",Y="alpha",w=o[1].slice(0,-1)):w!=o[1]&&w!=(o[2]=(/\bSafari\/([\d.]+\+?)/i.exec(e)||0)[1])||(w=null),o[1]=(/\b(?:Headless)?Chrome\/([\d.]+)/i.exec(e)||0)[1],537.36==o[0]&&537.36==o[2]&&parseFloat(o[1])>=28&&"WebKit"==F&&(F=["Blink"]),O&&(S||o[1])?(F&&(F[1]="like Chrome"),o=o[1]||((o=o[0])<530?1:o<532?2:o<532.05?3:o<533?4:o<534.03?5:o<534.07?6:o<534.1?7:o<534.13?8:o<534.16?9:o<534.24?10:o<534.3?11:o<535.01?12:o<535.02?"13+":o<535.07?15:o<535.11?16:o<535.19?17:o<536.05?18:o<536.1?19:o<537.01?20:o<537.11?"21+":o<537.13?23:o<537.18?24:o<537.24?25:o<537.36?26:"Blink"!=F?"27":"28")):(F&&(F[1]="like Safari"),o=(o=o[0])<400?1:o<500?2:o<526?3:o<533?4:o<534?"4+":o<535?5:o<537?6:o<538?7:o<601?8:o<602?9:o<604?10:o<606?11:o<608?12:"12"),F&&(F[1]+=" "+(o+="number"==typeof o?".x":/[.+]/.test(o)?"":"+")),"Safari"==M&&(!w||parseInt(w)>45)?w=o:"Chrome"==M&&/\bHeadlessChrome/i.test(e)&&k.unshift("headless")),"Opera"==M&&(o=/\bzbov|zvav$/.exec(V))?(M+=" ",k.unshift("desktop mode"),"zvav"==o?(M+="Mini",w=null):M+="Mobile",V=V.replace(RegExp(" *"+o+"$"),"")):"Safari"==M&&/\bChrome\b/.exec(F&&F[1])?(k.unshift("desktop mode"),M="Chrome Mobile",w=null,/\bOS X\b/.test(V)?(K="Apple",V="iOS 4.3+"):V=null):/\bSRWare Iron\b/.test(M)&&!w&&(w=j("Chrome")),w&&0==w.indexOf(o=/[\d.]+$/.exec(V))&&e.indexOf("/"+o+"-")>-1&&(V=v(V.replace(o,""))),V&&-1!=V.indexOf(M)&&!RegExp(M+" OS").test(V)&&(V=V.replace(RegExp(" *"+y(M)+" *"),"")),F&&!/\b(?:Avant|Nook)\b/.test(M)&&(/Browser|Lunascape|Maxthon/.test(M)||"Safari"!=M&&/^iOS/.test(V)&&/\bSafari\b/.test(F[1])||/^(?:Adobe|Arora|Breach|Midori|Opera|Phantom|Rekonq|Rock|Samsung Internet|Sleipnir|SRWare Iron|Vivaldi|Web)/.test(M)&&F[1])&&(o=F[F.length-1])&&k.push(o),k.length&&(k=["("+k.join("; ")+")"]),K&&H&&H.indexOf(K)<0&&k.push("on "+K),H&&k.push((/^on /.test(k[k.length-1])?"":"on ")+H),V&&(o=/ ([\d.+]+)$/.exec(V),l=o&&"/"==V.charAt(V.length-o[0].length-1),V={architecture:32,family:o&&!l?V.replace(o[0],""):V,version:o?o[1]:null,toString:function(){var t=this.version;return this.family+(t&&!l?" "+t:"")+(64==this.architecture?" 64-bit":"")}}),(o=/\b(?:AMD|IA|Win|WOW|x86_|x)64\b/i.exec(L))&&!/\bi686\b/i.test(L)?(V&&(V.architecture=64,V.family=V.family.replace(RegExp(" *"+o),"")),M&&(/\bWOW64\b/i.test(e)||O&&/\w(?:86|32)$/.test(r.cpuClass||r.platform)&&!/\bWin64; x64\b/i.test(e))&&k.unshift("32-bit")):V&&/^OS X/.test(V.family)&&"Chrome"==M&&parseFloat(w)>=39&&(V.architecture=64),e||(e=null);var W={};return W.description=e,W.layout=F&&F[0],W.manufacturer=K,W.name=M,W.prerelease=Y,W.product=H,W.ua=e,W.version=M&&w,W.os=V||{architecture:null,family:null,version:null,toString:function(){return"null"}},W.parse=t,W.toString=function(){return this.description||""},W.version&&k.unshift(w),W.name&&k.unshift(M),V&&M&&(V!=String(V).split(" ")[0]||V!=M.split(" ")[0]&&!H)&&k.push(H?"("+V+")":"on "+V),k.length&&(W.description=k.join(" ")),W}();n.platform=_,void 0===(i=function(){return _}.call(e,a,e,t))||(t.exports=i)}.call(this)}},e={};function a(i){var r=e[i];if(void 0!==r)return r.exports;var n=e[i]={id:i,loaded:!1,exports:{}};return t[i].call(n.exports,n,n.exports,a),n.loaded=!0,n.exports}a.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return a.d(e,{a:e}),e},a.d=(t,e)=>{for(var i in e)a.o(e,i)&&!a.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),a.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),a.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},a.nmd=t=>(t.paths=[],t.children||(t.children=[]),t);var i={};return(()=>{"use strict";a.r(i),a.d(i,{default:()=>Ca});var t="undefined"==typeof arguments?void 0:arguments;function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(t)}var r=function(){return Date.now()},n=function(){return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,function(t){return(t^crypto.getRandomValues(new Uint8Array(1))[0]&15>>t/4).toString(16).toUpperCase()})},s=function(e,a){var i,r=0;return function(){return r>=a||(i=e.apply(null,t),r++),i}},o=function(t){return"object"===e(t)?JSON.stringify(t):"function"==typeof t?o(t()):void 0===t?t:"string"!=typeof t?String(t):t};const l={validString:function(t){return void 0!==t&&"string"==typeof t},validBoolean:function(t){return void 0!==t&&"boolean"==typeof t},validNumber:function(t){return void 0!==t&&"number"==typeof t},sanitizePath:function(t){return t.replace(/\/$/g,"")},calculateTime:function(t){return t*=1e3,Math.round(t)},getCurrentTimestamp:r,getDurationFromTimestampToNow:function(t){return r()-t},uuidv4:n,getCookie:function(t){var e=t+"=",a=[];try{a=document.cookie.split(";")}catch(t){return""}for(var i="",r=0;r<a.length;r++){for(var n=a[r];" "===n.charAt(0);)n=n.substring(1);0===n.indexOf(e)&&(i=n.substring(e.length,n.length))}if(!i){try{i=localStorage.getItem(t)}catch(t){return""}var s=null;if(!i)return"";try{s=JSON.parse(i)}catch(t){return""}var o=null;if(!s.expires)return"";if(o=new Date(s.expires),"[object Date]"!==Object.prototype.toString.call(o))return"";if(isNaN(o))return"";if(!(o.getTime()>(new Date).getTime()))return"";i=s.value?s.value:""}return i},setCookie:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:30,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=new Date;i.setTime(i.getTime()+60*e*1e3);var r=a||n();try{document.cookie="".concat(t,"=").concat(r,"; expires=").concat(i.toUTCString(),"; path=/"),localStorage.setItem(t,JSON.stringify({expires:i.getTime(),value:r}))}catch(t){}return r},noOp:function(){},times:s,once:function(t){return s(t,1)},getHiddenProp:function(){var t=["webkit","moz","ms","o"];if("hidden"in document)return"hidden";for(var e=0;e<t.length;e++)if("".concat(t[e],"Hidden")in document)return"".concat(t[e],"Hidden");return null},getCustomDataString:o,jsonToQueryString:function(t){return"?"+Object.keys(t).map(function(e){return encodeURIComponent(e)+"="+encodeURIComponent(t[e])}).join("&")},currentDateTimeFormatString:function(){return(new Date).toISOString()},convertEpochTime:function(t){var e=t.toString().length;if(13===e)return t;var a=13-e;return t*Math.pow(10,a)}};function c(t){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},c(t)}function u(t,e){for(var a=0;a<e.length;a++){var i=e[a];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,m(i.key),i)}}function m(t){var e=function(t,e){if("object"!=c(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,e||"default");if("object"!=c(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==c(e)?e:e+""}const h=function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)},e=[{key:"get",value:function(t,e,a){var i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];e.z=Date.now()/1e3;var r,n=[void 0,null,!1];Object.keys(e).forEach(function(t){-1!==n.indexOf(e[t])&&delete e[t]}),Object.keys(e).forEach(function(t){Number.isNaN(e[t])&&delete e[t]});var s=!1;window.XDomainRequest&&(s=!0),r=s?new window.XDomainRequest:new XMLHttpRequest;var o=function(){if(r.readyState===XMLHttpRequest.DONE){if(r.responseText<=0)return;a(r.responseText)}};s?r.onload=o:r.onreadystatechange=o,t+=l.jsonToQueryString(e),r.open("GET",t,i),r.send(null)}},{key:"asyncGet",value:function(t,e){return new Promise(function(a,i){e.z=Date.now()/1e3;var r,n=[void 0,null,!1];Object.keys(e).forEach(function(t){-1!==n.indexOf(e[t])&&delete e[t]}),Object.keys(e).forEach(function(t){Number.isNaN(e[t])&&delete e[t]});var s=!1;window.XDomainRequest&&(s=!0),(r=s?new window.XDomainRequest:new XMLHttpRequest).onload=function(){this.status>=200&&this.status<300?a(r.response):i({status:this.status,statusText:r.statusText})};var o=l.jsonToQueryString(e);t+=o,r.open("GET",t),r.onerror=function(){i({status:this.status,statusText:r.statusText})},r.send()})}}],e&&u(t.prototype,e),a&&u(t,a),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,a}();var E="urn:x-cast:com.gumlet.ingest.cast",S="https://ingest.gumlytics.com",d=1e4;function f(t){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},f(t)}function p(t,e){for(var a=0;a<e.length;a++){var i=e[a];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,N(i.key),i)}}function y(t,e,a){return e=v(e),function(t,e){if(e&&("object"==f(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,A()?Reflect.construct(e,a||[],v(t).constructor):e.apply(t,a))}function A(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(A=function(){return!!t})()}function v(t){return v=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},v(t)}function _(t,e){return _=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_(t,e)}function b(t,e,a){return(e=N(e))in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}function N(t){var e=function(t,e){if("object"!=f(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,e||"default");if("object"!=f(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==f(e)?e:e+""}var g=function(t){function e(){var t;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);for(var a=arguments.length,i=new Array(a),r=0;r<a;r++)i[r]=arguments[r];return b(t=y(this,e,[].concat(i)),"sendRequest",function(t,a){t.event_family="session_event",this.get(e.analyticsServerUrl,t,a)}),b(t,"sendRequestAsync",function(t){var a=this;return t.event_family="session_event",new Promise(function(i,r){a.asyncGet(e.analyticsServerUrl,t).then(function(t){i(t)}).catch(function(t){r(t)})})}),b(t,"sendRequestSynchronous",function(t,a){t.event_family="session_event",this.get(e.analyticsServerUrl,t,a,!1)}),b(t,"getAnalyticsServerUrl",function(){return e.analyticsServerUrl}),t}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_(t,e)}(e,t),a=e,i&&p(a.prototype,i),r&&p(a,r),Object.defineProperty(a,"prototype",{writable:!1}),a;var a,i,r}(h);b(g,"analyticsServerUrl",S);const T=g;function D(t){return D="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},D(t)}function I(t,e){for(var a=0;a<e.length;a++){var i=e[a];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,L(i.key),i)}}function P(t,e,a){return e=U(e),function(t,e){if(e&&("object"==D(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,C()?Reflect.construct(e,a||[],U(t).constructor):e.apply(t,a))}function C(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(C=function(){return!!t})()}function U(t){return U=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},U(t)}function R(t,e){return R=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},R(t,e)}function G(t,e,a){return(e=L(e))in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}function L(t){var e=function(t,e){if("object"!=D(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,e||"default");if("object"!=D(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==D(e)?e:e+""}var k=function(t){function e(){var t;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);for(var a=arguments.length,i=new Array(a),r=0;r<a;r++)i[r]=arguments[r];return G(t=P(this,e,[].concat(i)),"sendRequest",function(t,a){t.event_family="session",this.get(e.analyticsServerUrl,t,a)}),G(t,"sendRequestSynchronous",function(t,a){t.event_family="session",this.get(e.analyticsServerUrl,t,a,!1)}),G(t,"getAnalyticsServerUrl",function(){return e.analyticsServerUrl}),t}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&R(t,e)}(e,t),a=e,i&&I(a.prototype,i),r&&I(a,r),Object.defineProperty(a,"prototype",{writable:!1}),a;var a,i,r}(h);G(k,"analyticsServerUrl",S);const Y=k;function O(t){return O="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},O(t)}function w(t,e){for(var a=0;a<e.length;a++){var i=e[a];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,B(i.key),i)}}function F(t,e,a){return e=H(e),function(t,e){if(e&&("object"==O(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,M()?Reflect.construct(e,a||[],H(t).constructor):e.apply(t,a))}function M(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(M=function(){return!!t})()}function H(t){return H=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},H(t)}function K(t,e){return K=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},K(t,e)}function V(t,e,a){return(e=B(e))in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}function B(t){var e=function(t,e){if("object"!=O(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,e||"default");if("object"!=O(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==O(e)?e:e+""}var j=function(t){function e(){var t;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);for(var a=arguments.length,i=new Array(a),r=0;r<a;r++)i[r]=arguments[r];return V(t=F(this,e,[].concat(i)),"sendRequest",function(t,a){t.event_family="player_init",this.get(e.analyticsServerUrl,t,a)}),V(t,"sendRequestSynchronous",function(t,a){t.event_family="player_init",this.get(e.analyticsServerUrl,t,a,!1)}),V(t,"getAnalyticsServerUrl",function(){return e.analyticsServerUrl}),t}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&K(t,e)}(e,t),a=e,i&&w(a.prototype,i),r&&w(a,r),Object.defineProperty(a,"prototype",{writable:!1}),a;var a,i,r}(h);V(j,"analyticsServerUrl",S);const W=j;const x=function(){var t=window.navigator.userAgent;return/(tablet|ipad|playbook|silk)|(android(?!.*mobi))/i.test(t)?"tablet":/Mobile|iP(hone|od)|Android|BlackBerry|IEMobile|Kindle|Silk-Accelerated|(hpw|web)OS|Opera M(obi|ini)/.test(t)?"mobile":"desktop"};function Q(t){return Q="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Q(t)}function q(t,e){for(var a=0;a<e.length;a++){var i=e[a];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,$(i.key),i)}}function J(t,e,a){return(e=$(e))in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}function $(t){var e=function(t,e){if("object"!=Q(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,e||"default");if("object"!=Q(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Q(e)?e:e+""}const X=new(function(){return t=function t(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),J(this,"log",function(t){this.showLogs&&console.log(t)}),J(this,"error",function(t){this.showLogs&&console.error(t)}),J(this,"warning",function(t){this.showLogs&&console.warn(t)}),this.showLogs=e},(e=[{key:"setLogging",value:function(t){this.showLogs=t}},{key:"isLogging",value:function(){return this.showLogs}}])&&q(t.prototype,e),a&&q(t,a),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,a}());var z;function Z(t){return Z="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Z(t)}function tt(t,e){for(var a=0;a<e.length;a++){var i=e[a];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,at(i.key),i)}}function et(t,e,a){return(e=at(e))in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}function at(t){var e=function(t,e){if("object"!=Z(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,e||"default");if("object"!=Z(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Z(e)?e:e+""}var it=function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)},a=[{key:"isShaka",value:function(t){return!!window.shaka&&"function"==typeof shaka.Player&&t.constructor===shaka.Player}},{key:"isDashjs",value:function(t){return"function"==typeof t.addABRCustomRule}},{key:"isHlsjs",value:function(t){return!!window.Hls&&"function"==typeof window.Hls&&t.constructor===window.Hls}}],(e=null)&&tt(t.prototype,e),a&&tt(t,a),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,a}();z=it,et(it,"isBitmovinVersionPre7",function(t){return!z.isDashjs(t)&&("function"==typeof t.getVersion&&t.getVersion()<"7")}),et(it,"isBitmovinVersion7Plus",function(t){return"string"==typeof t.version&&t.version>="7"}),et(it,"isVideoJs",function(t){if("function"==typeof videojs)try{if(videojs(t.id_)===t)return!0}catch(t){}return!1});const rt=it;const nt={READY:"ready",STARTUP:"startup",SOURCE_LOADED:"sourceLoaded",PLAY:"play",PAUSE:"pause",TIMECHANGED:"timechanged",SEEK:"seek",SEEKED:"seeked",START_CAST:"startCasting",END_CAST:"endCasting",START_BUFFERING:"startBuffering",END_BUFFERING:"endBuffering",AUDIO_CHANGE:"audioChange",VIDEO_CHANGE:"videoChange",START_FULLSCREEN:"startFullscreen",END_FULLSCREEN:"endFullscreen",START_AD:"adStart",END_AD:"adEnd",MUTE:"mute",UN_MUTE:"unMute",ERROR:"playerError",PLAYBACK_FINISHED:"end",SCREEN_RESIZE:"resize",UNLOAD:"unload",END:"end",METADATA_LOADED:"metadataLoaded",SOURCE_UNLOADED:"sourceUnloaded",PLAYBACK_PLAYING:"playback_playing"};function st(t){return st="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},st(t)}function ot(t,e){for(var a=0;a<e.length;a++){var i=e[a];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,lt(i.key),i)}}function lt(t){var e=function(t,e){if("object"!=st(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,e||"default");if("object"!=st(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==st(e)?e:e+""}const ct=function(){return t=function t(e,a){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.onBeforeUnLoadEvent=!1,this.player=e,this.eventCallback=a,this.register()},(e=[{key:"register",value:function(){var t=this;this.player.addEventHandler(this.player.EVENT.ON_SOURCE_LOADED,function(){t.eventCallback(nt.SOURCE_LOADED)}),this.player.addEventHandler(this.player.EVENT.ON_READY,function(){var e=!1;t.player.getConfig().playback&&t.player.getConfig().playback.autoplay&&(e=t.player.getConfig().playback.autoplay),t.eventCallback(nt.READY,{isLive:t.player.isLive(),version:t.player.getVersion(),type:t.player.getPlayerType(),duration:t.player.getDuration(),streamType:t.player.getStreamType(),videoId:t.player.getConfig().source.videoId,userId:t.player.getConfig().source.userId,mpdUrl:t.player.getConfig().source.dash,m3u8Url:t.player.getConfig().source.hls,progUrl:t.player.getConfig().source.progressive,videoWindowWidth:t.player.getFigure().offsetWidth,videoWindowHeight:t.player.getFigure().offsetHeight,isMuted:t.player.isMuted(),autoplay:e})}),this.player.addEventHandler(this.player.EVENT.ON_CAST_START,function(){t.eventCallback(nt.START_CAST)}),this.player.addEventHandler(this.player.EVENT.ON_CAST_STOP,function(){t.eventCallback(nt.END_CAST)}),this.player.addEventHandler(this.player.EVENT.ON_PLAY,function(){t.eventCallback(nt.PLAY,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames()})}),this.player.addEventHandler(this.player.EVENT.ON_PAUSE,function(){t.eventCallback(nt.PAUSE,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames()})}),this.player.addEventHandler(this.player.EVENT.ON_TIME_CHANGED,function(){t.eventCallback(nt.TIMECHANGED,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames()})}),this.player.addEventHandler(this.player.EVENT.ON_SEEK,function(){t.eventCallback(nt.SEEK,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames()})}),this.player.addEventHandler(this.player.EVENT.ON_SEEKED,function(){t.eventCallback(nt.SEEKED,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames()})}),this.player.addEventHandler(this.player.EVENT.ON_START_BUFFERING,function(){t.eventCallback(nt.START_BUFFERING)}),this.player.addEventHandler(this.player.EVENT.ON_STOP_BUFFERING,function(){t.eventCallback(nt.END_BUFFERING,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames()})}),this.player.addEventHandler(this.player.EVENT.ON_AUDIO_PLAYBACK_QUALITY_CHANGE,function(){var e=t.player.getPlaybackAudioData();t.eventCallback(nt.AUDIO_CHANGE,{bitrate:e.bitrate,currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames()})}),this.player.addEventHandler(this.player.EVENT.ON_VIDEO_PLAYBACK_QUALITY_CHANGE,function(){var e=t.player.getPlaybackVideoData();t.eventCallback(nt.VIDEO_CHANGE,{width:e.width,height:e.height,bitrate:e.bitrate,currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames()})}),this.player.addEventHandler(this.player.EVENT.ON_FULLSCREEN_ENTER,function(){t.eventCallback(nt.START_FULLSCREEN,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames()})}),this.onBeforeUnLoadEvent=!1,this.player.addEventHandler(this.player.EVENT.ON_FULLSCREEN_EXIT,function(){t.eventCallback(nt.END_FULLSCREEN,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames()})}),this.player.addEventHandler(this.player.EVENT.ON_AD_STARTED,function(){t.eventCallback(nt.START_AD,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames()})}),this.player.addEventHandler(this.player.EVENT.ON_AD_FINISHED,function(){t.eventCallback(nt.END_AD,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames()})}),this.player.addEventHandler(this.player.EVENT.ON_MUTE,function(){t.eventCallback(nt.MUTE,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames()})}),this.player.addEventHandler(this.player.EVENT.ON_UNMUTE,function(){t.eventCallback(nt.UN_MUTE,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames()})}),this.player.addEventHandler(this.player.EVENT.ON_ERROR,function(e){t.eventCallback(nt.ERROR,{code:e&&e.code,message:e&&e.message})}),this.player.addEventHandler(this.player.EVENT.ON_PLAYBACK_FINISHED,function(){t.eventCallback(nt.PLAYBACK_FINISHED,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames()})}),"undefined"!=typeof window?window.onunload=window.onbeforeunload=function(){t.onBeforeUnLoadEvent||(t.onBeforeUnLoadEvent=!0,t.eventCallback(nt.UNLOAD,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames()}))}:this.onBeforeUnLoadEvent||(this.onBeforeUnLoadEvent=!0,this.eventCallback(nt.UNLOAD,{currentTime:this.player.getCurrentTime(),droppedFrames:this.player.getDroppedFrames()}))}}])&&ot(t.prototype,e),a&&ot(t,a),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,a}();function ut(t){return ut="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ut(t)}function mt(t,e){for(var a=0;a<e.length;a++){var i=e[a];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,ht(i.key),i)}}function ht(t){var e=function(t,e){if("object"!=ut(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,e||"default");if("object"!=ut(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==ut(e)?e:e+""}const Et=function(){return t=function t(e,a){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.onBeforeUnLoadEvent=!1,this.player=e,this.eventCallback=a,this.register()},(e=[{key:"register",value:function(){var t=this,e=function(e){if(!e)return{progUrl:void 0,progBitrate:void 0};if("string"==typeof e)return{progUrl:e,progBitrate:0};if(Array.isArray(e)){var a=t.player.getPlaybackVideoData(),i=parseInt(a.id)||0;return{progUrl:e[i].url,progBitrate:e[i].bitrate||0}}return"object"===ut(e)?{progUrl:e.url,progBitrate:e.bitrate||0}:void 0};this.player.addEventHandler(this.player.EVENT.ON_SOURCE_UNLOADED,function(e){t.eventCallback(nt.SOURCE_UNLOADED,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames()})}),this.player.addEventHandler(this.player.EVENT.ON_SOURCE_LOADED,function(a){var i=!1;t.player.getConfig().playback&&t.player.getConfig().playback.autoplay&&(i=t.player.getConfig().playback.autoplay);var r=t.player.getConfig(),n={},s=e(r.source.progressive);r.source&&(n={mpdUrl:r.source.dash,m3u8Url:r.source.hls,progUrl:s.progUrl,progBitrate:s.progBitrate}),t.eventCallback(nt.SOURCE_LOADED,{isLive:t.player.isLive(),version:t.player.version,type:t.player.getPlayerType(),duration:t.player.getDuration(),streamType:t.player.getStreamType(),mpdUrl:n.mpdUrl,m3u8Url:n.m3u8Url,progUrl:n.progUrl,progBitrate:n.progBitrate,videoWindowWidth:t.player.getFigure().offsetWidth,videoWindowHeight:t.player.getFigure().offsetHeight,isMuted:t.player.isMuted(),autoplay:i})}),this.player.addEventHandler(this.player.EVENT.ON_READY,function(){var a=!1;t.player.getConfig().playback&&t.player.getConfig().playback.autoplay&&(a=t.player.getConfig().playback.autoplay);var i=t.player.getConfig(),r={},n=e(i.source.progressive);i.source&&(r={videoId:i.source.videoId,userId:i.source.userId,mpdUrl:i.source.dash,m3u8Url:i.source.hls,progUrl:n.progUrl,progBitrate:n.progBitrate});var s=!0;void 0!==t.player.getConfig().adaptation.preload&&"boolean"==typeof t.player.getConfig().adaptation.preload&&(s=t.player.getConfig().adaptation.preload);var o=t.player.getAudio();o||(o="undetected"),t.eventCallback(nt.READY,{isLive:t.player.isLive(),version:t.player.version,type:t.player.getPlayerType(),duration:t.player.getDuration(),streamType:t.player.getStreamType(),videoId:r.videoId,userId:r.userId,mpdUrl:r.mpdUrl,m3u8Url:r.m3u8Url,progUrl:r.progUrl,progBitrate:r.progBitrate,videoWindowWidth:t.player.getFigure().offsetWidth,videoWindowHeight:t.player.getFigure().offsetHeight,isMuted:t.player.isMuted(),preload:s,audioLanguage:o,isFullScreen:t.player.isFullscreen(),autoplay:a})}),this.player.addEventHandler(this.player.EVENT.ON_CAST_STARTED,function(e){t.eventCallback(nt.START_CAST,e)}),this.player.addEventHandler(this.player.EVENT.ON_CAST_STOPPED,function(){t.eventCallback(nt.END_CAST,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames(),currentVideoData:t.player.getPlaybackVideoData(),isFullScreen:t.player.isFullscreen(),isCasting:t.player.isCasting()})}),this.player.addEventHandler(this.player.EVENT.ON_PLAY,function(){t.eventCallback(nt.PLAY,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames(),currentVideoData:t.player.getPlaybackVideoData(),isFullScreen:t.player.isFullscreen(),isCasting:t.player.isCasting()})}),this.player.addEventHandler(this.player.EVENT.ON_PAUSED,function(){t.eventCallback(nt.PAUSE,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames(),currentVideoData:t.player.getPlaybackVideoData(),isFullScreen:t.player.isFullscreen(),isCasting:t.player.isCasting()})}),this.player.addEventHandler(this.player.EVENT.ON_TIME_CHANGED,function(){t.eventCallback(nt.TIMECHANGED,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames(),currentVideoData:t.player.getPlaybackVideoData(),isFullScreen:t.player.isFullscreen(),isCasting:t.player.isCasting()})}),this.player.addEventHandler(this.player.EVENT.ON_SEEK,function(){t.eventCallback(nt.SEEK,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames(),currentVideoData:t.player.getPlaybackVideoData(),isFullScreen:t.player.isFullscreen(),isCasting:t.player.isCasting()})}),this.player.addEventHandler(this.player.EVENT.ON_SEEKED,function(){t.eventCallback(nt.SEEKED,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames(),currentVideoData:t.player.getPlaybackVideoData(),isFullScreen:t.player.isFullscreen(),isCasting:t.player.isCasting()})}),this.player.addEventHandler(this.player.EVENT.ON_STALL_STARTED,function(){t.eventCallback(nt.START_BUFFERING,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames(),currentVideoData:t.player.getPlaybackVideoData(),isFullScreen:t.player.isFullscreen(),isCasting:t.player.isCasting()})}),this.player.addEventHandler(this.player.EVENT.ON_STALL_ENDED,function(){t.eventCallback(nt.END_BUFFERING,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames(),currentVideoData:t.player.getPlaybackVideoData(),isFullScreen:t.player.isFullscreen(),isCasting:t.player.isCasting()})}),this.player.addEventHandler(this.player.EVENT.ON_AUDIO_PLAYBACK_QUALITY_CHANGED,function(){var e=t.player.getPlaybackAudioData();t.eventCallback(nt.AUDIO_CHANGE,{bitrate:e.bitrate,currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames(),currentVideoData:t.player.getPlaybackVideoData(),isFullScreen:t.player.isFullscreen(),isCasting:t.player.isCasting()})}),this.player.addEventHandler(this.player.EVENT.ON_VIDEO_PLAYBACK_QUALITY_CHANGED,function(){var e=t.player.getPlaybackVideoData();t.eventCallback(nt.VIDEO_CHANGE,{width:e.width,height:e.height,bitrate:e.bitrate,currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames(),currentVideoData:t.player.getPlaybackVideoData(),isFullScreen:t.player.isFullscreen(),isCasting:t.player.isCasting()})}),this.player.addEventHandler(this.player.EVENT.ON_FULLSCREEN_ENTER,function(){t.eventCallback(nt.START_FULLSCREEN,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames(),currentVideoData:t.player.getPlaybackVideoData(),isFullScreen:t.player.isFullscreen(),isCasting:t.player.isCasting()})}),this.player.addEventHandler(this.player.EVENT.ON_FULLSCREEN_EXIT,function(){t.eventCallback(nt.END_FULLSCREEN,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames(),currentVideoData:t.player.getPlaybackVideoData(),isFullScreen:t.player.isFullscreen(),isCasting:t.player.isCasting()})}),this.player.addEventHandler(this.player.EVENT.ON_AD_STARTED,function(){t.eventCallback(nt.START_AD,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames(),currentVideoData:t.player.getPlaybackVideoData(),isFullScreen:t.player.isFullscreen(),isCasting:t.player.isCasting()})}),this.player.addEventHandler(this.player.EVENT.ON_AD_FINISHED,function(){t.eventCallback(nt.END_AD,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames(),currentVideoData:t.player.getPlaybackVideoData(),isFullScreen:t.player.isFullscreen(),isCasting:t.player.isCasting()})}),this.player.addEventHandler(this.player.EVENT.ON_MUTED,function(){t.eventCallback(nt.MUTE,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames(),currentVideoData:t.player.getPlaybackVideoData(),isFullScreen:t.player.isFullscreen(),isCasting:t.player.isCasting()})}),this.player.addEventHandler(this.player.EVENT.ON_UNMUTED,function(){t.eventCallback(nt.UN_MUTE,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames(),currentVideoData:t.player.getPlaybackVideoData(),isFullScreen:t.player.isFullscreen(),isCasting:t.player.isCasting()})}),this.player.addEventHandler(this.player.EVENT.ON_ERROR,function(e){t.eventCallback(nt.ERROR,{code:e&&e.code,message:e&&e.message,currentTime:t.player.getCurrentTime()})}),this.player.addEventHandler(this.player.EVENT.ON_PLAYBACK_FINISHED,function(){t.eventCallback(nt.PLAYBACK_FINISHED,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames()})}),"undefined"!=typeof window?window.onunload=window.onbeforeunload=function(){t.onBeforeUnLoadEvent||(t.onBeforeUnLoadEvent=!0,t.eventCallback(nt.UNLOAD,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames()}))}:this.onBeforeUnLoadEvent||(this.onBeforeUnLoadEvent=!0,this.eventCallback(nt.UNLOAD,{currentTime:this.player.getCurrentTime(),droppedFrames:this.player.getDroppedFrames()}))}}])&&mt(t.prototype,e),a&&mt(t,a),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,a}();function St(t){return St="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},St(t)}function dt(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),a.push.apply(a,i)}return a}function ft(t){for(var e=1;e<arguments.length;e++){var a=null!=arguments[e]?arguments[e]:{};e%2?dt(Object(a),!0).forEach(function(e){pt(t,e,a[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):dt(Object(a)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(a,e))})}return t}function pt(t,e,a){return(e=At(e))in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}function yt(t,e){for(var a=0;a<e.length;a++){var i=e[a];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,At(i.key),i)}}function At(t){var e=function(t,e){if("object"!=St(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,e||"default");if("object"!=St(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==St(e)?e:e+""}const vt=function(){return t=function t(e,a,i){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.onBeforeUnLoadEvent=!1,this.player=e,this.eventCallback=a,this.stateMachine=i,this.register()},(e=[{key:"getStreamType",value:function(t){return t.endsWith(".m3u8")?"hls":t.endsWith(".mpd")?"dash":"progressive"}},{key:"getStreamSources",value:function(t){var e=null,a=null,i=null;switch(this.getStreamType(t)){case"hls":a=t;break;case"dash":e=t;break;default:i=t}return{mpdUrl:e,m3u8Url:a,progUrl:i}}},{key:"getVideoWindowDimensions",value:function(t){return{width:t.el_.clientWidth,height:t.el_.clientHeight}}},{key:"getVideoSourceDimensions",value:function(t){return{videoWidth:t.videoWidth(),videoHeight:t.videoHeight()}}},{key:"getVideojsSourceHandlerMode_",value:function(){var t=this.player.tech({IWillNotUseThisInPlugins:!0});return t.sourceHandler_?t.sourceHandler_.options_.mode:"native"}},{key:"register",value:function(){var t,e,a=this,i=this;this.player.on("loadedmetadata",function(){var t=i.getStreamType(this.currentSrc()),e=i.getStreamSources(this.currentSrc()),a=i.getVideojsSourceHandlerMode_(),r=ft(ft(ft({isLive:this.duration()===1/0,version:videojs.VERSION,type:a,duration:this.duration(),streamType:t,autoplay:this.autoplay()},e),i.getVideoWindowDimensions(this)),{},{videoWindowWidth:this.videoWidth(),videoWindowHeight:this.videoHeight(),muted:this.muted()});i.stateMachine.updateMetadata(r),i.eventCallback(nt.SOURCE_LOADED,r)}),this.player.on("loadeddata",function(){}),this.player.ready(function(){var t=i.getStreamType(this.currentSrc()),e=i.getStreamSources(this.currentSrc()),a=i.getVideojsSourceHandlerMode_(),r=i.getVideoWindowDimensions(this),n={width:null,height:null,bitrate:null};if(this.tech_.hls){var s=this.tech_.hls.playlists.media();if(s){var o=s.attributes;n.bitrate=o.BANDWIDTH,n.width=o.RESOLUTION.width,n.height=o.RESOLUTION.height,n.videoCodec=o.CODECS.split(",")[0],n.audioCodec=o.CODECS.split(",")[1]}}var l=ft(ft(ft({isLive:!1,version:videojs.VERSION,type:a,duration:this.duration(),streamType:t,autoplay:this.autoplay()},e),i.getVideoWindowDimensions(this)),{},{videoWindowWidth:r.width,videoWindowHeight:r.height,muted:this.muted(),currentVideoData:n});i.eventCallback(nt.READY,l)}),this.player.on("play",function(){var t={width:null,height:null,bitrate:null};if(this.tech_.hls){var e=this.tech_.hls.playlists.media();if(e){var a=e.attributes;t.bitrate=a.BANDWIDTH,t.width=a.RESOLUTION.width,t.height=a.RESOLUTION.height,t.videoCodec=a.CODECS.split(",")[0],t.audioCodec=a.CODECS.split(",")[1]}}i.eventCallback(nt.PLAY,{currentTime:this.currentTime(),currentVideoData:t})}),this.player.on("pause",function(){var t={width:null,height:null,bitrate:null};if(this.tech_.hls){var e=this.tech_.hls.playlists.media();if(e){var a=e.attributes;t.bitrate=a.BANDWIDTH,t.width=a.RESOLUTION.width,t.height=a.RESOLUTION.height,t.videoCodec=a.CODECS.split(",")[0],t.audioCodec=a.CODECS.split(",")[1]}}i.eventCallback(nt.PAUSE,{currentTime:this.currentTime(),currentVideoData:t})}),this.player.on("ended",function(){var t={width:null,height:null,bitrate:null};if(this.tech_.hls){var e=this.tech_.hls.playlists.media();if(e){var a=e.attributes;t.bitrate=a.BANDWIDTH,t.width=a.RESOLUTION.width,t.height=a.RESOLUTION.height,t.videoCodec=a.CODECS.split(",")[0],t.audioCodec=a.CODECS.split(",")[1]}}i.eventCallback(nt.END,{currentTime:this.currentTime()})}),this.player.on("error",function(){var t={width:null,height:null,bitrate:null};if(this.tech_.hls){var e=this.tech_.hls.playlists.media();if(e){var a=e.attributes;t.bitrate=a.BANDWIDTH,t.width=a.RESOLUTION.width,t.height=a.RESOLUTION.height}}var r=this.player().error();i.eventCallback(nt.ERROR,{currentTime:this.currentTime(),code:r?r.code:-1,message:r?r.message:"Unknown error"})}),this.player.on("volumechange",function(){var t={width:null,height:null,bitrate:null};if(this.tech_.hls){var e=this.tech_.hls.playlists.media();if(e){var a=e.attributes;t.bitrate=a.BANDWIDTH,t.width=a.RESOLUTION.width,t.height=a.RESOLUTION.height,t.videoCodec=a.CODECS.split(",")[0],t.audioCodec=a.CODECS.split(",")[1]}}this.muted()?i.eventCallback(nt.MUTE,{currentTime:this.currentTime(),currentVideoData:t}):i.eventCallback(nt.UN_MUTE,{currentTime:this.currentTime(),currentVideoData:t})}),this.player.on("seeking",function(){var t={width:null,height:null,bitrate:null};if(this.tech_.hls){var e=this.tech_.hls.playlists.media();if(e){var a=e.attributes;t.bitrate=a.BANDWIDTH,t.width=a.RESOLUTION.width,t.height=a.RESOLUTION.height,t.videoCodec=a.CODECS.split(",")[0],t.audioCodec=a.CODECS.split(",")[1]}}i.eventCallback(nt.SEEK,{currentTime:this.currentTime(),droppedFrames:0,currentVideoData:t})}),this.player.on("seeked",function(){var t={width:null,height:null,bitrate:null};if(this.tech_.hls){var e=this.tech_.hls.playlists.media();if(e){var a=e.attributes;t.bitrate=a.BANDWIDTH,t.width=a.RESOLUTION.width,t.height=a.RESOLUTION.height,t.videoCodec=a.CODECS.split(",")[0],t.audioCodec=a.CODECS.split(",")[1]}}i.eventCallback(nt.SEEKED,{currentTime:this.currentTime(),droppedFrames:0,currentVideoData:t})}),Date.now();var r=!1;this.player.on("timeupdate",function(){var a=this;clearTimeout(e),r=!1,Date.now();var n={width:null,height:null,bitrate:null},s=null;if(this.tech_.hls&&(s=this.tech_.hls.playlists.media())){var o=s.attributes;n.bitrate=o.BANDWIDTH,n.width=o.RESOLUTION.width,n.height=o.RESOLUTION.height,n.videoCodec=o.CODECS.split(",")[0],n.audioCodec=o.CODECS.split(",")[1]}if(i.eventCallback(nt.TIMECHANGED,{currentTime:this.currentTime(),currentVideoData:n}),s){var l=s.attributes,c=l.BANDWIDTH,u=l.RESOLUTION.width,m=l.RESOLUTION.height,h=l.CODECS.split(",")[0],E=l.CODECS.split(",")[1];if(t!==c){var S={width:u,height:m,bitrate:c,videoCodec:h,audioCodec:E,currentTime:this.currentTime(),currentVideoData:n};i.eventCallback(nt.VIDEO_CHANGE,S),t=c}if(e=setTimeout(function(){(!a.paused()&&!a.ended()||r)&&i.eventCallback(nt.START_BUFFERING,{currentTime:a.currentTime()})},1e3),this.tech({IWillNotUseThisInPlugins:!0}).hls){var d=this.tech_.hls;if(!d.playlists||"function"!=typeof d.playlists.media)return;var f=d.playlists.media();if(!f)return;var p=f.attributes,y=p.BANDWIDTH,A=p.RESOLUTION.width,v=p.RESOLUTION.height,_={width:A,height:v,bitrate:y,videoCodec:p.CODECS.split(",")[0],audioCodec:p.CODECS.split(",")[1]};if(isNaN(t)||t!==y){var b={width:A,height:v,bitrate:y,currentTime:this.currentTime(),currentVideoData:_};i.eventCallback(nt.VIDEO_CHANGE,b),t=y}}}}),this.player.on("stalled",function(){r=!0}),"undefined"!=typeof window?window.onunload=window.onbeforeunload=function(){a.onBeforeUnLoadEvent||(a.onBeforeUnLoadEvent=!0,a.eventCallback(nt.UNLOAD,{currentTime:a.player.currentTime()}))}:this.onBeforeUnLoadEvent||(this.onBeforeUnLoadEvent=!0,this.eventCallback(nt.UNLOAD,{currentTime:this.player.currentTime()}))}}])&&yt(t.prototype,e),a&&yt(t,a),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,a}();var _t="video/mp4",bt="video/webm",Nt="application/x-mpegURL",gt="application/dash+xml",Tt=Nt,Dt=gt;function It(t){return It="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},It(t)}function Pt(t,e,a){return(e=function(t){var e=function(t,e){if("object"!=It(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,e||"default");if("object"!=It(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==It(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}var Ct=bt,Ut=Tt,Rt=Dt,Gt=Pt(Pt(Pt(Pt({},_t,"mp4"),Ct,"webm"),Ut,"hls"),Rt,"dash");var Lt={BITMOVIN:"bitmovin",JW:"jw",RADIANT:"radiant",VIDEOJS:"videojs",HLSJS:"hlsjs",SHAKA:"shaka",DASHJS:"dashjs",HTML:"html5",REACTNATIVEVIDEO:"react-native-video"};function kt(t){return kt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},kt(t)}function Yt(t,e){for(var a=0;a<e.length;a++){var i=e[a];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,Ot(i.key),i)}}function Ot(t){var e=function(t,e){if("object"!=kt(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,e||"default");if("object"!=kt(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==kt(e)?e:e+""}var wt=function(){return t=function t(e,a,i){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.eventCallback=a,this.playerSoftwareName=r||Lt.HTML,this.stateMachine=i,this.mediaEl=e,this.mediaElEventHandlers=[],this.analyticsBitrate_=-1,this.audioCodec_="",this.videoCodec_="",this.bufferingTimeout_=null,this.isBuffering_=!1,this.isLive_=!1,this.isPaused_=!1,this.previousMediaTime_=null,this.needsReadyEvent_=!0,this.needsFirstPlayIntent_=!0,this.mediaElementSet_=!1,this.playbackReadySet_=!1,e&&this.setMediaElement()},e=[{key:"setMediaElement",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(t&&this.mediaEl&&(this.unregisterMediaElement(),this.mediaElementSet_=!1),t&&(this.mediaEl=t),!this.mediaEl)throw new Error("No media element owned");if(this.mediaElementSet_)throw new Error("Media element already set (only call this once)");this.mediaElementSet_=!0,this.registerMediaElement(),this.onMaybeReady()}},{key:"getCurrentQualityLevelInfo",value:function(){return null}},{key:"isLive",value:function(){return!1}},{key:"getMIMEType",value:function(){var t,e=this.mediaEl,a="";return e||(a=null),a=e&&e.src?e.src:e&&e.querySelector("source")&&e.querySelector("source").src?e.querySelector("source").src:null,(t=(t=a).toLowerCase()).endsWith(".m3u8")?Nt:t.endsWith(".mp4")||t.endsWith(".m4v")||t.endsWith(".m4a")?_t:t.endsWith(".webm")?bt:t.endsWith(".mpd")?gt:null}},{key:"getStreamType",value:function(){return t=this.getMIMEType(),Gt[t];var t}},{key:"getPlayerVersion",value:function(){return null}},{key:"getStreamURL",value:function(){var t=this.mediaEl;return t?t&&t.src?t.src:t&&t.querySelector("source")&&t.querySelector("source").src?t.querySelector("source").src:null:null}},{key:"resetMedia",value:function(){this.mediaEl=null,this.mediaElEventHandlers=[]}},{key:"registerMediaElement",value:function(){var t=this,e=this.mediaEl;e&&(this.listenToMediaElementEvent("loadedmetadata",function(){if(1===e.readyState){t.checkQualityLevelAttributes(!0);var a=e.duration,i=e.autoplay,r=e.videoWidth,n=e.videoHeight,s=e.muted,o=e.clientWidth,l=e.clientHeight,c={type:"html5",isLive:t.isLive(),version:t.getPlayerVersion()||"html5",streamType:t.getStreamType(),streamUrl:t.getStreamURL(),duration:a,autoplay:i,currentVideoData:{height:n,width:r,bitrate:t.analyticsBitrate_,audioCodec:t.audioCodec_,videoCodec:t.videoCodec_},videoWindowWidth:parseInt(o),videoWindowHeight:parseInt(l),muted:s};t.needsFirstPlayIntent_||t.eventCallback(nt.METADATA_LOADED,c)}}),this.listenToMediaElementEvent("canplay",function(){if(!t.playbackReadySet_){t.playbackReadySet_=!0;var a=e.duration,i=e.autoplay,r=e.videoWidth,n=e.videoHeight,s=e.muted,o=e.clientWidth,l=e.clientHeight,c={type:"html5",isLive:t.isLive(),version:t.getPlayerVersion()||"html5",streamType:t.getStreamType(),streamUrl:t.getStreamURL(),duration:a,autoplay:i,playerSoftware:t.playerSoftwareName,videoWindowWidth:parseInt(o),videoWindowHeight:parseInt(l),currentVideoData:{height:n,width:r,bitrate:t.analyticsBitrate_,audioCodec:t.audioCodec_,videoCodec:t.videoCodec_},muted:s};t.eventCallback(nt.SOURCE_LOADED,c)}}),this.listenToMediaElementEvent("play",function(){var a=e.currentTime,i=e.videoWidth,r=e.videoHeight;t.needsFirstPlayIntent_=!1,t.eventCallback(nt.PLAY,{currentVideoData:{height:r,width:i,bitrate:t.analyticsBitrate_,audioCodec:t.audioCodec_,videoCodec:t.videoCodec_},currentTime:a})}),this.listenToMediaElementEvent("pause",function(){t.onPaused()}),this.listenToMediaElementEvent("playing",function(){var a=e.currentTime,i=e.videoWidth,r=e.videoHeight;t.isPaused_=!1,t.needsFirstPlayIntent_||t.eventCallback(nt.TIMECHANGED,{currentVideoData:{height:r,width:i,bitrate:t.analyticsBitrate_,audioCodec:t.audioCodec_,videoCodec:t.videoCodec_},currentTime:a})}),this.listenToMediaElementEvent("error",function(){X.log("HTML5 ERROR!!");var a=e.currentTime,i=e.error;t.eventCallback(nt.ERROR,{currentTime:a,code:i&&i.code,message:i&&i.message})}),this.listenToMediaElementEvent("volumechange",function(){var a=e.muted,i=e.currentTime;a?t.eventCallback(nt.MUTE,{currentTime:i}):t.eventCallback(nt.UN_MUTE,{currentTime:i})}),this.listenToMediaElementEvent("seeking",function(){var a=e.currentTime,i=e.videoWidth,r=e.videoHeight;t.eventCallback(nt.SEEK,{currentVideoData:{height:r,width:i,bitrate:t.analyticsBitrate_,audioCodec:t.audioCodec_,videoCodec:t.videoCodec_},currentTime:a,droppedFrames:0})}),this.listenToMediaElementEvent("seeked",function(){var a=e.currentTime,i=e.videoWidth,r=e.videoHeight;t.bufferingTimeout_&&clearTimeout(t.bufferingTimeout_),t.eventCallback(nt.SEEKED,{currentVideoData:{height:r,width:i,bitrate:t.analyticsBitrate_,audioCodec:t.audioCodec_,videoCodec:t.videoCodec_},currentTime:a,droppedFrames:0})}),this.listenToMediaElementEvent("ended",function(){var a=e.currentTime,i=e.videoWidth,r=e.videoHeight;t.eventCallback(nt.END,{currentVideoData:{height:r,width:i,bitrate:t.analyticsBitrate_,audioCodec:t.audioCodec_,videoCodec:t.videoCodec_},currentTime:a})}),this.listenToMediaElementEvent("timeupdate",function(){var a=e.currentTime,i=e.videoHeight,r=e.videoWidth;t.isBuffering_=!1,t.needsFirstPlayIntent_||(t.isPaused_||t.eventCallback(nt.TIMECHANGED,{currentVideoData:{height:i,width:r,bitrate:t.analyticsBitrate_,audioCodec:t.audioCodec_,videoCodec:t.videoCodec_},currentTime:a}),t.checkQualityLevelAttributes(),t.checkPlayheadProgress(),t.previousMediaTime_=a)}),this.listenToMediaElementEvent("stalled",function(){}),this.listenToMediaElementEvent("waiting",function(){t.onBuffering()}))}},{key:"listenToMediaElementEvent",value:function(t,e){if(!this.mediaEl)throw new Error("No media attached");var a=e.bind(this);this.mediaElEventHandlers.push({handler:a,event:t}),this.mediaEl.addEventListener(t,a,!1)}},{key:"onMaybeReady",value:function(){if(this.needsReadyEvent_&&this.mediaEl){this.needsReadyEvent_=!1;var t=!1,e=this.mediaEl,a=e.duration,i=e.autoplay,r=e.videoWidth,n=e.videoHeight,s=e.muted,o=e.preload;this.mediaEl&&this.mediaEl.src?this.mediaEl.src:this.mediaEl&&this.mediaEl.querySelector("source")&&this.mediaEl.querySelector("source").src&&this.mediaEl.querySelector("source").src;var l=this.mediaEl.clientWidth,c=this.mediaEl.clientHeight;"none"!==o&&(t=!0);var u={type:"html5",isLive:this.isLive(),version:this.getPlayerVersion()||"html5",streamType:this.getStreamType(),streamUrl:this.getStreamURL(),duration:a,autoplay:i,preload:t,playerSoftware:this.playerSoftwareName,currentVideoData:{height:n,width:r,bitrate:this.analyticsBitrate_,audioCodec:this.audioCodec_,videoCodec:this.videoCodec_},videoWindowWidth:parseInt(l),videoWindowHeight:parseInt(c),muted:s};this.stateMachine.updateMetadata(u),this.eventCallback(nt.READY,u)}}},{key:"unregisterMediaElement",value:function(){var t=this;if(!this.mediaEl)throw new Error("No media attached");this.mediaElEventHandlers.forEach(function(e){t.mediaEl.removeEventListener(e.event,e.handler,!1)}),this.resetMedia()}},{key:"onBuffering",value:function(){var t=this.mediaEl.currentTime;this.isBuffering_||this.isPaused_||(this.eventCallback(nt.START_BUFFERING,{currentTime:t}),this.isBuffering_=!0)}},{key:"onPaused",value:function(){if(!this.isPaused_){var t=this.mediaEl,e=t.currentTime,a=t.videoHeight,i=t.videoWidth;this.eventCallback(nt.PAUSE,{currentVideoData:{height:a,width:i,bitrate:this.analyticsBitrate_,audioCodec:this.audioCodec_,videoCodec:this.videoCodec_},currentTime:e}),this.isPaused_=!0}}},{key:"checkPlayheadProgress",value:function(){var t=this,e=this.mediaEl;e.paused&&this.onPaused(),this.bufferingTimeout_&&clearTimeout(this.bufferingTimeout_),this.bufferingTimeout_=setTimeout(function(){e.paused||e.ended&&!t.isBuffering_||e.currentTime-t.previousMediaTime_<1e3&&t.onBuffering()},1e3)}},{key:"checkQualityLevelAttributes",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this.mediaEl,a=this.getCurrentQualityLevelInfo();if(a){var i=a.bitrate,r=a.width,n=a.height,s=a.videoCodec,o=a.audioCodec,l=this.isLive();if(l!==this.isLive_&&(this.isLive_=l,t||this.stateMachine.updateMetadata({isLive:l})),this.audioCodec_=o,this.videoCodec_=s,this.analyticsBitrate_!==i){var c={width:r,height:n,bitrate:i,videoCodec:s,audioCodec:o,currentTime:e.currentTime};t||this.eventCallback(nt.VIDEO_CHANGE,c),this.analyticsBitrate_=i}}}}],e&&Yt(t.prototype,e),a&&Yt(t,a),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,a}();function Ft(t){return Ft="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ft(t)}function Mt(t,e){for(var a=0;a<e.length;a++){var i=e[a];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,Ht(i.key),i)}}function Ht(t){var e=function(t,e){if("object"!=Ft(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,e||"default");if("object"!=Ft(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Ft(e)?e:e+""}function Kt(t,e,a){return e=Bt(e),function(t,e){if(e&&("object"==Ft(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Vt()?Reflect.construct(e,a||[],Bt(t).constructor):e.apply(t,a))}function Vt(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Vt=function(){return!!t})()}function Bt(t){return Bt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Bt(t)}function jt(t,e){return jt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},jt(t,e)}var Wt=function(t){function e(t,a,i){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=Kt(this,e,[null,a,i,Lt.HLSJS])).hls=t,r.playerSoftwareName=Lt.HLSJS,r.resetMedia(),r.registerHlsEvents(),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&jt(t,e)}(e,t),a=e,(i=[{key:"getCurrentQualityLevelInfo",value:function(){var t=this.hls,e=t.levels[t.currentLevel];if(e){var a=e.attrs,i=a.BANDWIDTH?parseInt(a.BANDWIDTH,10):0,r=a.RESOLUTION&&a.RESOLUTION.width?parseInt(a.RESOLUTION.width,10):0,n=a.RESOLUTION&&a.RESOLUTION.height?parseInt(a.RESOLUTION.height,10):0,s=null,o=null;return a.CODECS&&(s=a.CODECS.split(",").length>1?a.CODECS.split(",")[1]:"",o=a.CODECS.split(",").length>1?a.CODECS.split(",")[0]:""),{bitrate:i,width:r,height:n,audioCodec:s,videoCodec:o}}}},{key:"isLive",value:function(){var t=this.hls;if(t.currentLevel<0)return!1;var e=t.levels[t.currentLevel];return!!e&&e.details.live}},{key:"getPlayerVersion",value:function(){return Hls.version}},{key:"getMIMEType",value:function(){return Tt}},{key:"getStreamURL",value:function(){return this.hls.url}},{key:"registerHlsEvents",value:function(){var t=this,e=this.hls;if(!Hls)throw new Error("Hls.js is not defined installed (must be loaded before analytics module)");e.on(Hls.Events.MEDIA_ATTACHING,this.onMediaAttaching.bind(this)),e.on(Hls.Events.MEDIA_DETACHING,this.onMediaDetaching.bind(this)),e.on(Hls.Events.MANIFEST_LOADING,this.onManifestLoading.bind(this)),e.on(Hls.Events.ERROR,function(e,a){t.onError(a)}),e.media&&this.onMediaAttaching(),e.url&&this.onManifestLoading()}},{key:"onMediaAttaching",value:function(){this.mediaEl||(this.mediaEl=this.hls.media,this.registerMediaElement(),this.onMaybeReady())}},{key:"onMediaDetaching",value:function(){this.unregisterMediaElement()}},{key:"onManifestLoading",value:function(){this.onMaybeReady()}},{key:"onError",value:function(t){var e,a,i,r,n,s,o,l,c;console.log("HLS ERROR!!"),X.log("HLS ERROR!!");var u=this.mediaEl.currentTime;Object.hasOwn(t,"fatal")&&t.fatal&&Object.hasOwn(t,"details")&&"internalException"===t.details&&console.error(t),this.eventCallback(nt.ERROR,{currentTime:u,code:null==t?void 0:t.type,message:JSON.stringify({details:null==t?void 0:t.details,fatal:null==t?void 0:t.fatal,type:null==t?void 0:t.type,fragment_url:null==t?void 0:t.url,error:{message:null==t||null===(e=t.error)||void 0===e?void 0:e.message,stack:null==t||null===(a=t.error)||void 0===a?void 0:a.stack},extra:{networkDetails:{status:null==t||null===(i=t.networkDetails)||void 0===i?void 0:i.status,statusText:null==t||null===(r=t.networkDetails)||void 0===r?void 0:r.statusText,url:null==t||null===(n=t.networkDetails)||void 0===n?void 0:n.url,responseHeaders:null==t||null===(s=t.networkDetails)||void 0===s?void 0:s.responseHeaders,responseText:null==t||null===(o=t.networkDetails)||void 0===o?void 0:o.responseText,responseURL:null==t||null===(l=t.networkDetails)||void 0===l?void 0:l.responseURL,data:null==t||null===(c=t.networkDetails)||void 0===c?void 0:c.data}}})})}}])&&Mt(a.prototype,i),r&&Mt(a,r),Object.defineProperty(a,"prototype",{writable:!1}),a;var a,i,r}(wt);function xt(t){return xt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xt(t)}function Qt(){var t,e,a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",r=a.toStringTag||"@@toStringTag";function n(a,i,r,n){var l=i&&i.prototype instanceof o?i:o,c=Object.create(l.prototype);return qt(c,"_invoke",function(a,i,r){var n,o,l,c=0,u=r||[],m=!1,h={p:0,n:0,v:t,a:E,f:E.bind(t,4),d:function(e,a){return n=e,o=0,l=t,h.n=a,s}};function E(a,i){for(o=a,l=i,e=0;!m&&c&&!r&&e<u.length;e++){var r,n=u[e],E=h.p,S=n[2];a>3?(r=S===i)&&(l=n[(o=n[4])?5:(o=3,3)],n[4]=n[5]=t):n[0]<=E&&((r=a<2&&E<n[1])?(o=0,h.v=i,h.n=n[1]):E<S&&(r=a<3||n[0]>i||i>S)&&(n[4]=a,n[5]=i,h.n=S,o=0))}if(r||a>1)return s;throw m=!0,i}return function(r,u,S){if(c>1)throw TypeError("Generator is already running");for(m&&1===u&&E(u,S),o=u,l=S;(e=o<2?t:l)||!m;){n||(o?o<3?(o>1&&(h.n=-1),E(o,l)):h.n=l:h.v=l);try{if(c=2,n){if(o||(r="next"),e=n[r]){if(!(e=e.call(n,l)))throw TypeError("iterator result is not an object");if(!e.done)return e;l=e.value,o<2&&(o=0)}else 1===o&&(e=n.return)&&e.call(n),o<2&&(l=TypeError("The iterator does not provide a '"+r+"' method"),o=1);n=t}else if((e=(m=h.n<0)?l:a.call(i,h))!==s)break}catch(e){n=t,o=1,l=e}finally{c=1}}return{value:e,done:m}}}(a,r,n),!0),c}var s={};function o(){}function l(){}function c(){}e=Object.getPrototypeOf;var u=[][i]?e(e([][i]())):(qt(e={},i,function(){return this}),e),m=c.prototype=o.prototype=Object.create(u);function h(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,c):(t.__proto__=c,qt(t,r,"GeneratorFunction")),t.prototype=Object.create(m),t}return l.prototype=c,qt(m,"constructor",c),qt(c,"constructor",l),l.displayName="GeneratorFunction",qt(c,r,"GeneratorFunction"),qt(m),qt(m,r,"Generator"),qt(m,i,function(){return this}),qt(m,"toString",function(){return"[object Generator]"}),(Qt=function(){return{w:n,m:h}})()}function qt(t,e,a,i){var r=Object.defineProperty;try{r({},"",{})}catch(t){r=0}qt=function(t,e,a,i){function n(e,a){qt(t,e,function(t){return this._invoke(e,a,t)})}e?r?r(t,e,{value:a,enumerable:!i,configurable:!i,writable:!i}):t[e]=a:(n("next",0),n("throw",1),n("return",2))},qt(t,e,a,i)}function Jt(t,e){var a="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!a){if(Array.isArray(t)||(a=function(t,e){if(t){if("string"==typeof t)return $t(t,e);var a={}.toString.call(t).slice(8,-1);return"Object"===a&&t.constructor&&(a=t.constructor.name),"Map"===a||"Set"===a?Array.from(t):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?$t(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){a&&(t=a);var i=0,r=function(){};return{s:r,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var n,s=!0,o=!1;return{s:function(){a=a.call(t)},n:function(){var t=a.next();return s=t.done,t},e:function(t){o=!0,n=t},f:function(){try{s||null==a.return||a.return()}finally{if(o)throw n}}}}function $t(t,e){(null==e||e>t.length)&&(e=t.length);for(var a=0,i=Array(e);a<e;a++)i[a]=t[a];return i}function Xt(t,e,a,i,r,n,s){try{var o=t[n](s),l=o.value}catch(t){return void a(t)}o.done?e(l):Promise.resolve(l).then(i,r)}function zt(t,e){for(var a=0;a<e.length;a++){var i=e[a];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,Zt(i.key),i)}}function Zt(t){var e=function(t,e){if("object"!=xt(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,e||"default");if("object"!=xt(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==xt(e)?e:e+""}function te(t,e,a){return e=ae(e),function(t,e){if(e&&("object"==xt(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,ee()?Reflect.construct(e,a||[],ae(t).constructor):e.apply(t,a))}function ee(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(ee=function(){return!!t})()}function ae(t){return ae=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ae(t)}function ie(t,e){return ie=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ie(t,e)}var re=function(t){function e(t,a,i,r){var n;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),n=te(this,e,[r,a,i,Lt.SHAKA]),!shaka)throw new Error("`shaka` lib is not installed (must be loaded before analytics module)");return n.shakaPlayer=t,n.playerSoftwareName=Lt.SHAKA,n.registerShakaEvents(),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ie(t,e)}(e,t),a=e,i=[{key:"getPlayerVersion",value:function(){return shaka.Player.version}},{key:"isLive",value:function(){return!!this.shakaPlayer&&this.shakaPlayer.isLive()}},{key:"getMIMEType",value:function(){return Dt}},{key:"getStreamURL",value:function(){return this.shakaPlayer?this.shakaPlayer.getAssetUri():null}},{key:"registerShakaEvents",value:function(){var t=this,e=this.shakaPlayer;if(!e)throw new Error("Shaka player object is not defined");e.addEventListener("error",function(e){t.onGumletShakaError(e,t.eventCallback,t.mediaEl)})}},{key:"onGumletShakaError",value:(n=Qt().m(function t(e,a,i){var r,n,s,o,l,c,u,m,h,E,S;return Qt().w(function(t){for(;;)switch(t.p=t.n){case 0:if(console.log("Shaka ERROR!!"),X.log("Shaka ERROR!!"),r=0,i&&(r=this.mediaEl.currentTime),!e.detail){t.n=9;break}if(n=e.detail,s=[],e.detail.data&&e.detail.data.forEach(function(t){s.push(t)}),o=[],this.shakaPlayer.getVariantTracks().forEach(function(t){o.push({width:t.width,height:t.height,bitrate:t.videoBandwidth||t.bandwidth,framerate:t.frameRate,contentType:"".concat(t.mimeType,'; codecs="').concat(t.videoCodec,'"')})}),l=[],!(navigator&&navigator.mediaCapabilities&&navigator.mediaCapabilities.decodingInfo)){t.n=8;break}c=Jt(o),t.p=1,c.s();case 2:if((u=c.n()).done){t.n=5;break}return m=u.value,h=m,t.n=3,navigator.mediaCapabilities.decodingInfo({type:"media-source",video:m});case 3:h.mediaCapabilities=t.v,l.push(h);case 4:t.n=2;break;case 5:t.n=7;break;case 6:t.p=6,S=t.v,c.e(S);case 7:return t.p=7,c.f(),t.f(7);case 8:E=this.getCurrentQualityLevelInfo(),null==n||n.code,a(nt.ERROR,{currentTime:r,code:n.code,message:JSON.stringify({category:null==n?void 0:n.v,code:null==n?void 0:n.code,severity:null==n?void 0:n.severity,handled:null==n?void 0:n.handled,timestamp:null==e?void 0:e.timestamp,extra_data:s,media_capabilities:l,selected_quality_info:E})}),t.n=10;break;case 9:eventCallback(nt.ERROR,{currentTime:r,code:"not_set_by_shaka",message:"{}"});case 10:return t.a(2)}},t,this,[[1,6,7,8]])}),s=function(){var t=this,e=arguments;return new Promise(function(a,i){var r=n.apply(t,e);function s(t){Xt(r,a,i,s,o,"next",t)}function o(t){Xt(r,a,i,s,o,"throw",t)}s(void 0)})},function(t,e,a){return s.apply(this,arguments)})},{key:"getCurrentQualityLevelInfo",value:function(){var t=this.shakaPlayer.getVariantTracks().filter(function(t){return t.active}).filter(function(t){return t.videoCodec||void 0!==t.videoId})[0];return t?{bitrate:t.videoBandwidth||t.bandwidth,width:t.width,height:t.height,videoCodec:t.videoCodec,audioCodec:t.audioCodec}:null}}],i&&zt(a.prototype,i),r&&zt(a,r),Object.defineProperty(a,"prototype",{writable:!1}),a;var a,i,r,n,s}(wt);function ne(t){return ne="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ne(t)}function se(t,e){for(var a=0;a<e.length;a++){var i=e[a];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,oe(i.key),i)}}function oe(t){var e=function(t,e){if("object"!=ne(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,e||"default");if("object"!=ne(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==ne(e)?e:e+""}function le(t,e,a){return e=ue(e),function(t,e){if(e&&("object"==ne(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,ce()?Reflect.construct(e,a||[],ue(t).constructor):e.apply(t,a))}function ce(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(ce=function(){return!!t})()}function ue(t){return ue=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ue(t)}function me(t,e){return me=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},me(t,e)}var he=function(t){function e(t,a,i){var r;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),r=le(this,e,[null,a,i,Lt.DASHJS]);var n=null,s=!1;r.playerSoftwareName=Lt.DASHJS;try{n=t.getVideoElement()}catch(t){}return n?r._initialize(t,n):t.on(dashjs.MediaPlayer.events.CAN_PLAY,function(){if(!s){n=t.getVideoElement(),s=!0,r._initialize(t,n);var e=n,a=e.duration,i=e.autoplay,o=e.videoWidth,l=e.videoHeight,c=e.muted,u=n.clientWidth,m=n.clientHeight,h={type:"html5",isLive:r.isLive(),version:r.getPlayerVersion()||"html5",streamType:r.getStreamType(),streamUrl:r.getStreamURL(),duration:a,autoplay:i,playerSoftware:r.playerSoftwareName,videoWindowWidth:parseInt(u),videoWindowHeight:parseInt(m),currentVideoData:{height:l,width:o,bitrate:r.analyticsBitrate_,audioCodec:r.audioCodec_,videoCodec:r.videoCodec_},muted:c};r.eventCallback(nt.SOURCE_LOADED,h)}},r),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&me(t,e)}(e,t),a=e,(i=[{key:"_initialize",value:function(t,e){this.mediaPlayer=t,this.setMediaElement(e)}},{key:"getPlayerVersion",value:function(){return this.mediaPlayer.getVersion()}},{key:"isLive",value:function(){return!1}},{key:"getMIMEType",value:function(){return Dt}},{key:"getStreamURL",value:function(){return this.mediaPlayer?this.mediaPlayer.getSource():null}},{key:"getCurrentQualityLevelInfo",value:function(){if(this.mediaPlayer){var t=this.mediaPlayer.getBitrateInfoListFor("video")[this.mediaPlayer.getQualityFor("video")],e=this.mediaPlayer.getCurrentTrackFor("video"),a=this.mediaPlayer.getCurrentTrackFor("audio"),i=t.width,r=t.height,n=t.bitrate,s=null,o=null;return e&&(o=e.codec.split('"').length>0?e.codec.split('"')[1]:e.codec),a&&(s=a.codec.split('"').length>0?a.codec.split('"')[1]:a.codec),{width:i,height:r,bitrate:n,audioCodec:s,videoCodec:o}}return null}}])&&se(a.prototype,i),r&&se(a,r),Object.defineProperty(a,"prototype",{writable:!1}),a;var a,i,r}(wt);function Ee(t){return Ee="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ee(t)}function Se(t,e){for(var a=0;a<e.length;a++){var i=e[a];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,de(i.key),i)}}function de(t){var e=function(t,e){if("object"!=Ee(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,e||"default");if("object"!=Ee(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Ee(e)?e:e+""}const fe=function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)},a=[{key:"getAdapter",value:function(t,e,a){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return rt.isBitmovinVersionPre7(t)?new ct(t,e):rt.isBitmovinVersion7Plus(t)?new Et(t,e):rt.isVideoJs(t)?new vt(t,e,a):rt.isHlsjs(t)?new Wt(t,e,a):rt.isShaka(t)?new re(t,e,a,i):rt.isDashjs(t)?new he(t,e,a):new wt(t,e,a)}}],(e=null)&&Se(t.prototype,e),a&&Se(t,a),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,a}();var pe=a(595),ye=a.n(pe);function Ae(t){return Ae="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ae(t)}function ve(t,e){for(var a=0;a<e.length;a++){var i=e[a];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,be(i.key),i)}}function _e(t,e,a){return(e=be(e))in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}function be(t){var e=function(t,e){if("object"!=Ae(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,e||"default");if("object"!=Ae(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Ae(e)?e:e+""}var Ne=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.stateMachineCallbacks=e,this.customData={previousRecordTime:0,playbackWatchTime:0},this.pausedTimestamp=null,this.seekTimestamp=0,this.seekedTimestamp=0,this.seekedTimeout=0,this.onEnterStateTimestamp=0,this.States={SETUP:"SETUP",STARTUP:"STARTUP",READY:"READY",PLAYING:"PLAYING",REBUFFERING:"REBUFFERING",PAUSE:"PAUSE",QUALITYCHANGE:"QUALITYCHANGE",PAUSED_SEEKING:"PAUSED_SEEKING",PLAY_SEEKING:"PLAY_SEEKING",END_PLAY_SEEKING:"END_PLAY_SEEKING",QUALITYCHANGE_PAUSE:"QUALITYCHANGE_PAUSE",END:"END",ERROR:"ERROR",AD:"AD",MUTING_READY:"MUTING_READY",MUTING_PLAY:"MUTING_PLAY",MUTING_PAUSE:"MUTING_PAUSE"},this.createStateMachine()}return e=t,i=[{key:"pad",value:function(t,e){return(t+new Array(e).join(" ")).slice(0,e)}}],(a=[{key:"createStateMachine",value:function(){var e=this,a=[nt.PLAY,nt.PAUSE,nt.SEEK,nt.SEEKED,nt.PLAYBACK_PLAYING,nt.PLAYBACK_FINISHED,nt.READY,nt.SCREEN_RESIZE,nt.END,nt.ERROR,nt.UN_MUTE,nt.MUTE];this.stateMachine=ye().create({initial:this.States.SETUP,error:function(t,e,a,i,r,n,s){X.error(n)},events:[{name:nt.READY,from:[this.States.SETUP,this.States.ERROR],to:this.States.READY},{name:nt.PLAY,from:this.States.READY,to:this.States.STARTUP},{name:nt.START_BUFFERING,from:this.States.STARTUP,to:this.States.STARTUP},{name:nt.END_BUFFERING,from:this.States.STARTUP,to:this.States.STARTUP},{name:nt.TIMECHANGED,from:this.States.STARTUP,to:this.States.PLAYING},{name:nt.TIMECHANGED,from:this.States.PLAYING,to:this.States.PLAYING},{name:nt.END_BUFFERING,from:this.States.PLAYING,to:this.States.PLAYING},{name:nt.START_BUFFERING,from:this.States.PLAYING,to:this.States.REBUFFERING},{name:nt.END_BUFFERING,from:this.States.REBUFFERING,to:this.States.PLAYING},{name:nt.TIMECHANGED,from:this.States.REBUFFERING,to:this.States.REBUFFERING},{name:nt.PAUSE,from:this.States.PLAYING,to:this.States.PAUSE},{name:nt.PAUSE,from:this.States.REBUFFERING,to:this.States.PAUSE},{name:nt.PLAY,from:this.States.PAUSE,to:this.States.PLAYING},{name:nt.VIDEO_CHANGE,from:this.States.PLAYING,to:this.States.QUALITYCHANGE},{name:nt.AUDIO_CHANGE,from:this.States.PLAYING,to:this.States.QUALITYCHANGE},{name:nt.VIDEO_CHANGE,from:this.States.QUALITYCHANGE,to:this.States.QUALITYCHANGE},{name:nt.AUDIO_CHANGE,from:this.States.QUALITYCHANGE,to:this.States.QUALITYCHANGE},{name:"FINISH_QUALITYCHANGE",from:this.States.QUALITYCHANGE,to:this.States.PLAYING},{name:nt.VIDEO_CHANGE,from:this.States.PAUSE,to:this.States.QUALITYCHANGE_PAUSE},{name:nt.AUDIO_CHANGE,from:this.States.PAUSE,to:this.States.QUALITYCHANGE_PAUSE},{name:nt.VIDEO_CHANGE,from:this.States.QUALITYCHANGE_PAUSE,to:this.States.QUALITYCHANGE_PAUSE},{name:nt.AUDIO_CHANGE,from:this.States.QUALITYCHANGE_PAUSE,to:this.States.QUALITYCHANGE_PAUSE},{name:"FINISH_QUALITYCHANGE_PAUSE",from:this.States.QUALITYCHANGE_PAUSE,to:this.States.PAUSE},{name:nt.SEEK,from:this.States.PAUSE,to:this.States.PAUSED_SEEKING},{name:nt.SEEK,from:this.States.PAUSED_SEEKING,to:this.States.PAUSED_SEEKING},{name:nt.AUDIO_CHANGE,from:this.States.PAUSED_SEEKING,to:this.States.PAUSED_SEEKING},{name:nt.VIDEO_CHANGE,from:this.States.PAUSED_SEEKING,to:this.States.PAUSED_SEEKING},{name:nt.START_BUFFERING,from:this.States.PAUSED_SEEKING,to:this.States.PAUSED_SEEKING},{name:nt.END_BUFFERING,from:this.States.PAUSED_SEEKING,to:this.States.PAUSED_SEEKING},{name:nt.SEEKED,from:this.States.PAUSED_SEEKING,to:this.States.PAUSE},{name:nt.PLAY,from:this.States.PAUSED_SEEKING,to:this.States.PLAYING},{name:nt.PAUSE,from:this.States.PAUSED_SEEKING,to:this.States.PAUSE},{name:"PLAY_SEEK",from:this.States.PAUSE,to:this.States.PLAY_SEEKING},{name:"PLAY_SEEK",from:this.States.PAUSED_SEEKING,to:this.States.PLAY_SEEKING},{name:"PLAY_SEEK",from:this.States.PLAY_SEEKING,to:this.States.PLAY_SEEKING},{name:nt.SEEK,from:this.States.PLAY_SEEKING,to:this.States.PLAY_SEEKING},{name:nt.AUDIO_CHANGE,from:this.States.PLAY_SEEKING,to:this.States.PLAY_SEEKING},{name:nt.VIDEO_CHANGE,from:this.States.PLAY_SEEKING,to:this.States.PLAY_SEEKING},{name:nt.START_BUFFERING,from:this.States.PLAY_SEEKING,to:this.States.PLAY_SEEKING},{name:nt.END_BUFFERING,from:this.States.PLAY_SEEKING,to:this.States.PLAY_SEEKING},{name:nt.SEEKED,from:this.States.PLAY_SEEKING,to:this.States.PLAY_SEEKING},{name:nt.PLAY,from:this.States.PLAY_SEEKING,to:this.States.END_PLAY_SEEKING},{name:nt.START_BUFFERING,from:this.States.END_PLAY_SEEKING,to:this.States.END_PLAY_SEEKING},{name:nt.END_BUFFERING,from:this.States.END_PLAY_SEEKING,to:this.States.END_PLAY_SEEKING},{name:nt.SEEKED,from:this.States.END_PLAY_SEEKING,to:this.States.END_PLAY_SEEKING},{name:nt.TIMECHANGED,from:this.States.END_PLAY_SEEKING,to:this.States.PLAYING},{name:nt.END,from:this.States.PLAY_SEEKING,to:this.States.END},{name:nt.END,from:this.States.PAUSED_SEEKING,to:this.States.END},{name:nt.END,from:this.States.PLAYING,to:this.States.END},{name:nt.END,from:this.States.PAUSE,to:this.States.END},{name:nt.SEEK,from:this.States.END,to:this.States.END},{name:nt.SEEKED,from:this.States.END,to:this.States.END},{name:nt.TIMECHANGED,from:this.States.END,to:this.States.END},{name:nt.END_BUFFERING,from:this.States.END,to:this.States.END},{name:nt.START_BUFFERING,from:this.States.END,to:this.States.END},{name:nt.END,from:this.States.END,to:this.States.END},{name:nt.PLAY,from:this.States.END,to:this.States.PLAYING},{name:nt.ERROR,from:[this.States.SETUP,this.States.STARTUP,this.States.READY,this.States.PLAYING,this.States.REBUFFERING,this.States.PAUSE,this.States.QUALITYCHANGE,this.States.PAUSED_SEEKING,this.States.PLAY_SEEKING,this.States.END_PLAY_SEEKING,this.States.QUALITYCHANGE_PAUSE,"FINISH_PLAY_SEEKING","PLAY_SEEK","FINISH_QUALITYCHANGE_PAUSE","FINISH_QUALITYCHANGE",this.States.END,this.States.ERROR],to:this.States.ERROR},{name:nt.SEEK,from:this.States.END_PLAY_SEEKING,to:this.States.PLAY_SEEKING},{name:"FINISH_PLAY_SEEKING",from:this.States.END_PLAY_SEEKING,to:this.States.PLAYING},{name:nt.UNLOAD,from:[this.States.PLAYING,this.States.PAUSE],to:this.States.END},{name:nt.START_AD,from:this.States.PLAYING,to:this.States.AD},{name:nt.END_AD,from:this.States.AD,to:this.States.PLAYING},{name:nt.MUTE,from:this.States.READY,to:this.States.MUTING_READY},{name:nt.UN_MUTE,from:this.States.READY,to:this.States.MUTING_READY},{name:"FINISH_MUTING",from:this.States.MUTING_READY,to:this.States.READY},{name:nt.MUTE,from:this.States.PLAYING,to:this.States.MUTING_PLAY},{name:nt.UN_MUTE,from:this.States.PLAYING,to:this.States.MUTING_PLAY},{name:"FINISH_MUTING",from:this.States.MUTING_PLAY,to:this.States.PLAYING},{name:nt.MUTE,from:this.States.PAUSE,to:this.States.MUTING_PAUSE},{name:nt.UN_MUTE,from:this.States.PAUSE,to:this.States.MUTING_PAUSE},{name:"FINISH_MUTING",from:this.States.MUTING_PAUSE,to:this.States.PAUSE}],callbacks:{onpause:function(t,a,i,r){e.stateMachineCallbacks.playbackWatchTime(e.customData.playbackWatchTime),a===e.States.PLAYING&&(e.pausedTimestamp=r)},onbeforeevent:function(i,r,n,s,o){return e.stateMachineCallbacks.playbackWatchTime(e.customData.playbackWatchTime),a.includes(i)&&(i===nt.PLAYBACK_FINISHED&&(e.customData.previousRecordTime=0),e.customData.previousRecordTime=o.currentTime),i===nt.SEEK&&r===e.States.PAUSE&&s-e.pausedTimestamp<t.PAUSE_SEEK_DELAY?(e.stateMachine.PLAY_SEEK(s),!1):(i===nt.SEEK&&clearTimeout(e.seekedTimeout),i===nt.SEEKED&&r===e.States.PAUSED_SEEKING?(e.seekedTimestamp=s,e.seekedTimeout=setTimeout(function(){e.stateMachine.pause(s,o)},t.SEEKED_PAUSE_DELAY),!1):void 0)},onafterevent:function(i,r,n,s,o){e.stateMachineCallbacks.playbackWatchTime(e.customData.playbackWatchTime),a.includes(i)&&(i===nt.PLAYBACK_FINISHED&&(e.customData.previousRecordTime=0),e.customData.previousRecordTime=o.currentTime),X.log(t.pad(s,20)+"EVENT: "+t.pad(i,20)+" from "+t.pad(r,14)+"-> "+t.pad(n,14)),n===e.States.QUALITYCHANGE_PAUSE&&e.stateMachine.FINISH_QUALITYCHANGE_PAUSE(s),n===e.States.QUALITYCHANGE&&e.stateMachine.FINISH_QUALITYCHANGE(s),n!==e.States.MUTING_READY&&n!==e.States.MUTING_PLAY&&n!==e.States.MUTING_PAUSE||e.stateMachine.FINISH_MUTING(s)},onenterstate:function(t,i,r,n,s){e.stateMachineCallbacks.playbackWatchTime(e.customData.playbackWatchTime),a.includes(t)&&(t===nt.PLAYBACK_FINISHED&&(e.customData.previousRecordTime=0),e.customData.previousRecordTime=s.currentTime),e.onEnterStateTimestamp=n||(new Date).getTime(),X.log("Entering State "+r+" with "+t),s&&r!==e.States.PAUSED_SEEKING&&e.stateMachineCallbacks.setVideoTimeStartFromEvent(s)},onleavestate:function(t,i,r,n,s){if(e.stateMachineCallbacks.playbackWatchTime(e.customData.playbackWatchTime),a.includes(t)&&(t===nt.PLAYBACK_FINISHED&&(e.customData.previousRecordTime=0),e.customData.previousRecordTime=s.currentTime),n){var o=n-e.onEnterStateTimestamp;X.log("State "+i+" was "+o+" ms event:"+t),s&&r!==e.States.PAUSED_SEEKING&&e.stateMachineCallbacks.setVideoTimeEndFromEvent(s);var l=i.toLowerCase();if(i===e.States.END_PLAY_SEEKING||i===e.States.PAUSED_SEEKING){var c=e.seekedTimestamp-e.seekTimestamp;e.stateMachineCallbacks[l](c,l,s),X.log("Seek was "+c+"ms")}else if(t===nt.UNLOAD&&i===e.States.PLAYING)e.stateMachineCallbacks.playingAndBye(o,l,s);else if(i===e.States.PAUSE&&r!==e.States.PAUSED_SEEKING)e.stateMachineCallbacks.setVideoTimeStartFromEvent(t),e.stateMachineCallbacks.pause(o,l,s),e.stateMachineCallbacks.heartbeat(n,l,s);else{var u=e.stateMachineCallbacks[l];"function"==typeof u?u(o,l,s):X.error("Could not find callback function for "+l)}s&&r!==e.States.PAUSED_SEEKING&&e.stateMachineCallbacks.setVideoTimeStartFromEvent(s),t===nt.VIDEO_CHANGE?e.stateMachineCallbacks.videoChange(s):t===nt.AUDIO_CHANGE?e.stateMachineCallbacks.audioChange(s):t===nt.MUTE?(X.log("Setting sample to muted"),e.stateMachineCallbacks.mute()):t===nt.UN_MUTE&&(X.log("Setting sample to unmuted"),e.stateMachineCallbacks.unMute())}},onseek:function(t,a,i,r,n){e.customData.previousRecordTime=n.currentTime,e.stateMachineCallbacks.playbackWatchTime(e.customData.playbackWatchTime),e.seekTimestamp=r},onseeked:function(t,a,i,r,n){e.customData.previousRecordTime=n.currentTime,e.stateMachineCallbacks.playbackWatchTime(e.customData.playbackWatchTime),e.seekedTimestamp=r},ontimechanged:function(t,a,i,r,n){e.stateMachineCallbacks.playbackWatchTime(e.customData.playbackWatchTime);var s=n.currentTime-e.customData.previousRecordTime;s>0&&s<5&&(e.customData.playbackWatchTime+=Math.round(1e3*(n.currentTime-e.customData.previousRecordTime)),e.customData.previousRecordTime=n.currentTime);var o=r-e.onEnterStateTimestamp;o>59700&&(e.stateMachineCallbacks.setVideoTimeEndFromEvent(n),X.log("Sending heartbeat"),e.stateMachineCallbacks.heartbeat(o,a.toLowerCase(),n),e.onEnterStateTimestamp=r,e.stateMachineCallbacks.setVideoTimeStartFromEvent(n))},onplayerError:function(t,a,i,r,n){e.stateMachineCallbacks.error(n)}}})}},{key:"callEvent",value:function(t,e,a){var i=this.stateMachine[t];i?i.call(this.stateMachine,a,e):X.log("Ignored Event: "+t)}}])&&ve(e.prototype,a),i&&ve(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,a,i}();function ge(t){return ge="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ge(t)}function Te(t){return function(t){if(Array.isArray(t))return De(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return De(t,e);var a={}.toString.call(t).slice(8,-1);return"Object"===a&&t.constructor&&(a=t.constructor.name),"Map"===a||"Set"===a?Array.from(t):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?De(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function De(t,e){(null==e||e>t.length)&&(e=t.length);for(var a=0,i=Array(e);a<e;a++)i[a]=t[a];return i}function Ie(t,e){for(var a=0;a<e.length;a++){var i=e[a];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,Ce(i.key),i)}}function Pe(t,e,a){return(e=Ce(e))in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}function Ce(t){var e=function(t,e){if("object"!=ge(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,e||"default");if("object"!=ge(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==ge(e)?e:e+""}_e(Ne,"PAUSE_SEEK_DELAY",60),_e(Ne,"SEEKED_PAUSE_DELAY",120);var Ue=function(){function t(e){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.stateMachineCallbacks=e,this.customData={previousRecordTime:0,playbackWatchTime:0},this.pausedTimestamp=null,this.seekTimestamp=0,this.seekedTimestamp=0,this.seekedTimeout=0,this.seekedFrom=0,this.onEnterStateTimestamp=0,this.lastPlayHeadDuration=0,this.States={SETUP:"SETUP",STARTUP:"STARTUP",READY:"READY",PLAYING:"PLAYING",REBUFFERING:"REBUFFERING",PAUSE:"PAUSE",QUALITYCHANGE:"QUALITYCHANGE",PAUSED_SEEKING:"PAUSED_SEEKING",PLAY_SEEKING:"PLAY_SEEKING",END_PLAY_SEEKING:"END_PLAY_SEEKING",QUALITYCHANGE_PAUSE:"QUALITYCHANGE_PAUSE",QUALITYCHANGE_REBUFFERING:"QUALITYCHANGE_REBUFFERING",END:"END",ERROR:"ERROR",AD:"AD",MUTING_READY:"MUTING_READY",MUTING_PLAY:"MUTING_PLAY",MUTING_PAUSE:"MUTING_PAUSE",CASTING:"CASTING",SOURCE_CHANGING:"SOURCE_CHANGING"},this.createStateMachine(a)}return e=t,a=[{key:"getAllStates",value:function(){var t=this;return[].concat(Te(Object.keys(this.States).map(function(e){return t.States[e]})),["FINISH_PLAY_SEEKING","PLAY_SEEK","FINISH_QUALITYCHANGE_PAUSE","FINISH_QUALITYCHANGE","FINISH_QUALITYCHANGE_REBUFFERING"])}},{key:"createStateMachine",value:function(){var e=this,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=[nt.PLAY,nt.PAUSE,nt.SEEK,nt.SEEKED,nt.PLAYBACK_PLAYING,nt.PLAYBACK_FINISHED,nt.READY,nt.SCREEN_RESIZE,nt.END,nt.ERROR,nt.UN_MUTE,nt.MUTE];this.stateMachine=ye().create({initial:this.States.SETUP,error:function(t,e,a,i,r,n){X.error("Error in statemachine: "+n)},events:[{name:nt.READY,from:[this.States.SETUP,this.States.ERROR],to:this.States.READY},{name:nt.PLAY,from:this.States.READY,to:this.States.STARTUP},{name:nt.START_BUFFERING,from:this.States.STARTUP,to:this.States.STARTUP},{name:nt.END_BUFFERING,from:this.States.STARTUP,to:this.States.STARTUP},{name:nt.VIDEO_CHANGE,from:this.States.STARTUP,to:this.States.STARTUP},{name:nt.AUDIO_CHANGE,from:this.States.STARTUP,to:this.States.STARTUP},{name:nt.TIMECHANGED,from:this.States.STARTUP,to:this.States.PLAYING},{name:nt.TIMECHANGED,from:this.States.PLAYING,to:this.States.PLAYING},{name:nt.END_BUFFERING,from:this.States.PLAYING,to:this.States.PLAYING},{name:nt.START_BUFFERING,from:this.States.PLAYING,to:this.States.REBUFFERING},{name:nt.END_BUFFERING,from:this.States.REBUFFERING,to:this.States.PLAYING},{name:nt.TIMECHANGED,from:this.States.REBUFFERING,to:this.States.REBUFFERING},{name:nt.PAUSE,from:this.States.PLAYING,to:this.States.PAUSE},{name:nt.PAUSE,from:this.States.REBUFFERING,to:this.States.PAUSE},{name:nt.PLAY,from:this.States.PAUSE,to:this.States.PLAYING},{name:nt.VIDEO_CHANGE,from:this.States.PLAYING,to:this.States.QUALITYCHANGE},{name:nt.AUDIO_CHANGE,from:this.States.PLAYING,to:this.States.QUALITYCHANGE},{name:nt.VIDEO_CHANGE,from:this.States.QUALITYCHANGE,to:this.States.QUALITYCHANGE},{name:nt.AUDIO_CHANGE,from:this.States.QUALITYCHANGE,to:this.States.QUALITYCHANGE},{name:"FINISH_QUALITYCHANGE",from:this.States.QUALITYCHANGE,to:this.States.PLAYING},{name:nt.VIDEO_CHANGE,from:this.States.PAUSE,to:this.States.QUALITYCHANGE_PAUSE},{name:nt.AUDIO_CHANGE,from:this.States.PAUSE,to:this.States.QUALITYCHANGE_PAUSE},{name:nt.VIDEO_CHANGE,from:this.States.QUALITYCHANGE_PAUSE,to:this.States.QUALITYCHANGE_PAUSE},{name:nt.AUDIO_CHANGE,from:this.States.QUALITYCHANGE_PAUSE,to:this.States.QUALITYCHANGE_PAUSE},{name:"FINISH_QUALITYCHANGE_PAUSE",from:this.States.QUALITYCHANGE_PAUSE,to:this.States.PAUSE},{name:nt.SEEK,from:this.States.PAUSE,to:this.States.PAUSED_SEEKING},{name:nt.SEEK,from:this.States.PAUSED_SEEKING,to:this.States.PAUSED_SEEKING},{name:nt.AUDIO_CHANGE,from:this.States.PAUSED_SEEKING,to:this.States.PAUSED_SEEKING},{name:nt.VIDEO_CHANGE,from:this.States.PAUSED_SEEKING,to:this.States.PAUSED_SEEKING},{name:nt.START_BUFFERING,from:this.States.PAUSED_SEEKING,to:this.States.PAUSED_SEEKING},{name:nt.END_BUFFERING,from:this.States.PAUSED_SEEKING,to:this.States.PAUSED_SEEKING},{name:nt.SEEKED,from:this.States.PAUSED_SEEKING,to:this.States.PAUSE},{name:nt.PLAY,from:this.States.PAUSED_SEEKING,to:this.States.PLAYING},{name:nt.PAUSE,from:this.States.PAUSED_SEEKING,to:this.States.PAUSE},{name:"PLAY_SEEK",from:this.States.PAUSE,to:this.States.PLAY_SEEKING},{name:"PLAY_SEEK",from:this.States.PAUSED_SEEKING,to:this.States.PLAY_SEEKING},{name:"PLAY_SEEK",from:this.States.PLAY_SEEKING,to:this.States.PLAY_SEEKING},{name:nt.SEEK,from:this.States.PLAY_SEEKING,to:this.States.PLAY_SEEKING},{name:nt.AUDIO_CHANGE,from:this.States.PLAY_SEEKING,to:this.States.PLAY_SEEKING},{name:nt.VIDEO_CHANGE,from:this.States.PLAY_SEEKING,to:this.States.PLAY_SEEKING},{name:nt.START_BUFFERING,from:this.States.PLAY_SEEKING,to:this.States.PLAY_SEEKING},{name:nt.END_BUFFERING,from:this.States.PLAY_SEEKING,to:this.States.PLAY_SEEKING},{name:nt.SEEKED,from:this.States.PLAY_SEEKING,to:this.States.PLAY_SEEKING},{name:nt.PLAY,from:this.States.PLAY_SEEKING,to:this.States.END_PLAY_SEEKING},{name:nt.START_BUFFERING,from:this.States.END_PLAY_SEEKING,to:this.States.END_PLAY_SEEKING},{name:nt.END_BUFFERING,from:this.States.END_PLAY_SEEKING,to:this.States.END_PLAY_SEEKING},{name:nt.SEEKED,from:this.States.END_PLAY_SEEKING,to:this.States.END_PLAY_SEEKING},{name:nt.TIMECHANGED,from:this.States.END_PLAY_SEEKING,to:this.States.PLAYING},{name:nt.END,from:this.States.PLAY_SEEKING,to:this.States.END},{name:nt.END,from:this.States.PAUSED_SEEKING,to:this.States.END},{name:nt.END,from:this.States.PLAYING,to:this.States.END},{name:nt.END,from:this.States.PAUSE,to:this.States.END},{name:nt.SEEK,from:this.States.END,to:this.States.END},{name:nt.SEEKED,from:this.States.END,to:this.States.END},{name:nt.TIMECHANGED,from:this.States.END,to:this.States.END},{name:nt.END_BUFFERING,from:this.States.END,to:this.States.END},{name:nt.START_BUFFERING,from:this.States.END,to:this.States.END},{name:nt.END,from:this.States.END,to:this.States.END},{name:nt.PLAY,from:this.States.END,to:this.States.PLAYING},{name:nt.ERROR,from:this.getAllStates(),to:this.States.ERROR},{name:nt.SEEK,from:this.States.END_PLAY_SEEKING,to:this.States.PLAY_SEEKING},{name:"FINISH_PLAY_SEEKING",from:this.States.END_PLAY_SEEKING,to:this.States.PLAYING},{name:nt.UNLOAD,from:this.getAllStates(),to:this.States.END},{name:nt.START_AD,from:this.States.PLAYING,to:this.States.AD},{name:nt.END_AD,from:this.States.AD,to:this.States.PLAYING},{name:nt.MUTE,from:this.States.READY,to:this.States.MUTING_READY},{name:nt.UN_MUTE,from:this.States.READY,to:this.States.MUTING_READY},{name:"FINISH_MUTING",from:this.States.MUTING_READY,to:this.States.READY},{name:nt.MUTE,from:this.States.PLAYING,to:this.States.MUTING_PLAY},{name:nt.UN_MUTE,from:this.States.PLAYING,to:this.States.MUTING_PLAY},{name:"FINISH_MUTING",from:this.States.MUTING_PLAY,to:this.States.PLAYING},{name:nt.MUTE,from:this.States.PAUSE,to:this.States.MUTING_PAUSE},{name:nt.UN_MUTE,from:this.States.PAUSE,to:this.States.MUTING_PAUSE},{name:"FINISH_MUTING",from:this.States.MUTING_PAUSE,to:this.States.PAUSE},{name:nt.START_CAST,from:[this.States.READY,this.States.PAUSE],to:this.States.CASTING},{name:nt.PAUSE,from:this.States.CASTING,to:this.States.CASTING},{name:nt.PLAY,from:this.States.CASTING,to:this.States.CASTING},{name:nt.TIMECHANGED,from:this.States.CASTING,to:this.States.CASTING},{name:nt.MUTE,from:this.States.CASTING,to:this.States.CASTING},{name:nt.SEEK,from:this.States.CASTING,to:this.States.CASTING},{name:nt.SEEKED,from:this.States.CASTING,to:this.States.CASTING},{name:nt.END_CAST,from:this.States.CASTING,to:this.States.READY},{name:nt.SEEK,from:this.States.READY,to:this.States.READY},{name:nt.SEEKED,from:this.States.READY,to:this.States.READY},{name:nt.SEEKED,from:this.States.STARTUP,to:this.States.STARTUP},{name:nt.SOURCE_UNLOADED,from:this.getAllStates(),to:this.States.SOURCE_CHANGING},{name:nt.READY,from:this.States.SOURCE_CHANGING,to:this.States.READY},{name:nt.SOURCE_LOADED,from:this.States.SETUP,to:this.States.SETUP},{name:nt.SOURCE_LOADED,from:this.States.READY,to:this.States.READY},{name:nt.VIDEO_CHANGE,from:this.States.REBUFFERING,to:this.States.QUALITYCHANGE_REBUFFERING},{name:nt.AUDIO_CHANGE,from:this.States.REBUFFERING,to:this.States.QUALITYCHANGE_REBUFFERING},{name:nt.VIDEO_CHANGE,from:this.States.QUALITYCHANGE_REBUFFERING,to:this.States.QUALITYCHANGE_REBUFFERING},{name:nt.AUDIO_CHANGE,from:this.States.QUALITYCHANGE_REBUFFERING,to:this.States.QUALITYCHANGE_REBUFFERING},{name:"FINISH_QUALITYCHANGE_REBUFFERING",from:this.States.QUALITYCHANGE_REBUFFERING,to:this.States.REBUFFERING}],callbacks:{onpause:function(t,a,i,r){e.stateMachineCallbacks.playbackWatchTime(e.customData.playbackWatchTime),a===e.States.PLAYING&&(e.pausedTimestamp=r)},onbeforeevent:function(a,r,n,s,o){return e.stateMachineCallbacks.playbackWatchTime(e.customData.playbackWatchTime),i.includes(a)&&(a===nt.PLAYBACK_FINISHED&&(e.customData.previousRecordTime=0),e.customData.previousRecordTime=o.currentTime),a===nt.SEEK&&r===e.States.PAUSE&&(e.seekedFrom=e.lastPlayHeadDuration,e.seekTimestamp=s,s-e.pausedTimestamp<t.PAUSE_SEEK_DELAY)?(e.stateMachine.PLAY_SEEK(s),!1):(a===nt.SEEK&&clearTimeout(e.seekedTimeout),a!==nt.SOURCE_LOADED?a===nt.SEEKED&&r===e.States.PAUSED_SEEKING?(e.seekedTimestamp=s,e.seekedTimeout=setTimeout(function(){e.stateMachine.pause(s,o)},t.SEEKED_PAUSE_DELAY),!1):(r!==e.States.REBUFFERING||n!==e.States.QUALITYCHANGE_REBUFFERING)&&void(o&&(e.lastPlayHeadDuration=1e3*o.currentTime)):void e.stateMachineCallbacks.loaded(s,e.States.READY,o))},onafterevent:function(t,a,r,n,s){e.stateMachineCallbacks.playbackWatchTime(e.customData.playbackWatchTime),i.includes(t)&&(t===nt.PLAYBACK_FINISHED&&(e.customData.previousRecordTime=0),e.customData.previousRecordTime=s.currentTime),r===e.States.QUALITYCHANGE_PAUSE&&e.stateMachine.FINISH_QUALITYCHANGE_PAUSE(n),r===e.States.QUALITYCHANGE&&e.stateMachine.FINISH_QUALITYCHANGE(n),r===e.States.QUALITYCHANGE_REBUFFERING&&e.stateMachine.FINISH_QUALITYCHANGE_REBUFFERING(n),r!==e.States.MUTING_READY&&r!==e.States.MUTING_PLAY&&r!==e.States.MUTING_PAUSE||e.stateMachine.FINISH_MUTING(n)},onenterstate:function(t,r,n,s,o){e.stateMachineCallbacks.playbackWatchTime(e.customData.playbackWatchTime),i.includes(t)&&(t===nt.PLAYBACK_FINISHED&&(e.customData.previousRecordTime=0),e.customData.previousRecordTime=o.currentTime),n===e.States.SETUP?e.stateMachineCallbacks.setup(s,e.States.SETUP,o,a):n===e.States.READY?(o.playerSoftware="Bitmovin",e.stateMachineCallbacks.ready(s,e.States.READY,o)):"play"===t&&n===e.States.STARTUP?e.stateMachineCallbacks.first_play(s,e.States.PLAY,o):"play"===t&&r===e.States.PAUSE?(e.stateMachineCallbacks.play(s,e.States.PLAY,o),e.stateMachineCallbacks.playing(s,e.States.PLAYING,o),e.stateMachineCallbacks.heartbeat(s,e.States.PLAY,o)):"timechanged"===t&&r===e.States.STARTUP&&n===e.States.PLAYING?(e.stateMachineCallbacks.playing(s,e.States.PLAYING,o),e.stateMachineCallbacks.playback_started(o)):n===e.States.PAUSE&&r===e.States.PLAYING?(e.stateMachineCallbacks.pause(s,e.States.PAUSE,o),e.stateMachineCallbacks.heartbeat(s,e.States.PAUSE,o)):n===e.States.END?(e.stateMachineCallbacks.end(s,e.States.END,o),e.stateMachineCallbacks.heartbeat(s,e.States.END,o)):n===e.States.MUTING_PAUSE?e.stateMachineCallbacks.mute(s,o):t===nt.START_BUFFERING?e.stateMachineCallbacks.start_rebuffer(s,e.States.REBUFFERING,o):t===nt.END_BUFFERING&&e.stateMachineCallbacks.end_rebuffer(s,e.States.REBUFFERING,o),"none"===r&&a.starttime?e.onEnterStateTimestamp=a.starttime:e.onEnterStateTimestamp=s||(new Date).getTime(),o&&n!==e.States.PAUSED_SEEKING&&n!==e.States.PLAY_SEEKING&&n!==e.States.END_PLAY_SEEKING&&e.stateMachineCallbacks.setVideoTimeStartFromEvent(o),"PLAY_SEEK"===t&&n===e.States.PLAY_SEEKING&&n!==e.States.PLAY_SEEKING&&n!==e.States.END_PLAY_SEEKING&&(e.seekTimestamp=e.onEnterStateTimestamp)},onleavestate:function(t,a,r,n,s){if(e.stateMachineCallbacks.playbackWatchTime(e.customData.playbackWatchTime),n){i.includes(t)&&(t===nt.PLAYBACK_FINISHED&&(e.customData.previousRecordTime=0),e.customData.previousRecordTime=s.currentTime);var o=n-e.onEnterStateTimestamp;if(s&&r!==e.States.PAUSED_SEEKING&&r!==e.States.PLAY_SEEKING&&r!==e.States.END_PLAY_SEEKING&&(console.log("ERRRRRRRRRR"),X.log("ERRRRRRRRRR"),X.log("-> Setting video time end to "+s.currentTime+", going to "+r),e.stateMachineCallbacks.setVideoTimeEndFromEvent(s)),"PLAY_SEEK"===t&&a===e.States.PAUSE)return!0;var l=a.toLowerCase();if(a===e.States.END_PLAY_SEEKING||a===e.States.PAUSED_SEEKING){var c=e.seekedTimestamp-e.seekTimestamp;e.stateMachineCallbacks.playback_seeked(e.seekedFrom,1e3*s.currentTime,c,r),e.stateMachineCallbacks.heartbeat(n,e.States.PLAY,s),X.log("Seek was "+c+"ms")}else t===nt.UNLOAD&&a===e.States.PLAYING?e.stateMachineCallbacks.playingAndBye(o,l,s):a===e.States.PAUSE&&r!==e.States.PAUSED_SEEKING&&e.stateMachineCallbacks.setVideoTimeStartFromEvent(t);t===nt.VIDEO_CHANGE?e.stateMachineCallbacks.videoChange(s):t===nt.AUDIO_CHANGE?e.stateMachineCallbacks.audioChange(s):t===nt.MUTE?(X.log("Setting sample to muted"),e.stateMachineCallbacks.mute()):t===nt.UN_MUTE&&(X.log("Setting sample to unmuted"),e.stateMachineCallbacks.unMute())}},onseek:function(t,a,i,r,n){e.customData.previousRecordTime=n.currentTime,e.stateMachineCallbacks.playbackWatchTime(e.customData.playbackWatchTime),e.seekTimestamp=r},onseeked:function(t,a,i,r,n){e.customData.previousRecordTime=n.currentTime,e.stateMachineCallbacks.playbackWatchTime(e.customData.playbackWatchTime),e.seekedTimestamp=r},ontimechanged:function(t,a,i,r,n){e.stateMachineCallbacks.playbackWatchTime(e.customData.playbackWatchTime);var s=n.currentTime-e.customData.previousRecordTime;s>0&&s<5&&(e.customData.playbackWatchTime+=Math.round(1e3*(n.currentTime-e.customData.previousRecordTime)),e.customData.previousRecordTime=n.currentTime);var o=r-e.onEnterStateTimestamp;o>{HEARTBEAT_THRESHOLD:d}&&(e.stateMachineCallbacks.setVideoTimeEndFromEvent(n),X.log("Sending heartbeat"),e.stateMachineCallbacks.heartbeat(o,a.toLowerCase(),n),e.onEnterStateTimestamp=r,e.stateMachineCallbacks.setVideoTimeStartFromEvent(n))},onplayerError:function(t,a,i,r,n){e.stateMachineCallbacks.error(n)}}})}},{key:"callEvent",value:function(t,e,a){var i=this.stateMachine[t];i?i.call(this.stateMachine,a,e):X.log("Ignored Event: "+t)}}],i=[{key:"pad",value:function(t,e){return(t+new Array(e).join(" ")).slice(0,e)}}],a&&Ie(e.prototype,a),i&&Ie(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,a,i}();function Re(t){return Re="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Re(t)}function Ge(t){return function(t){if(Array.isArray(t))return Le(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return Le(t,e);var a={}.toString.call(t).slice(8,-1);return"Object"===a&&t.constructor&&(a=t.constructor.name),"Map"===a||"Set"===a?Array.from(t):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?Le(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Le(t,e){(null==e||e>t.length)&&(e=t.length);for(var a=0,i=Array(e);a<e;a++)i[a]=t[a];return i}function ke(t,e){for(var a=0;a<e.length;a++){var i=e[a];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,Oe(i.key),i)}}function Ye(t,e,a){return(e=Oe(e))in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}function Oe(t){var e=function(t,e){if("object"!=Re(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,e||"default");if("object"!=Re(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Re(e)?e:e+""}Pe(Ue,"PAUSE_SEEK_DELAY",200),Pe(Ue,"SEEKED_PAUSE_DELAY",300);var we=function(){function t(e){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.stateMachineCallbacks=e,this.customData={previousRecordTime:0,playbackWatchTime:0},this.pausedTimestamp=null,this.seekTimestamp=0,this.seekedTimestamp=0,this.seekedTimeout=0,this.onEnterStateTimestamp=0,this.lastPlayHeadDuration=0,this.autoPlay=!1,this.States={SETUP:"SETUP",STARTUP:"STARTUP",READY:"READY",PLAYING:"PLAYING",REBUFFERING:"REBUFFERING",PAUSE:"PAUSE",QUALITYCHANGE:"QUALITYCHANGE",PAUSED_SEEKING:"PAUSED_SEEKING",PLAY_SEEKING:"PLAY_SEEKING",END_PLAY_SEEKING:"END_PLAY_SEEKING",QUALITYCHANGE_PAUSE:"QUALITYCHANGE_PAUSE",QUALITYCHANGE_REBUFFERING:"QUALITYCHANGE_REBUFFERING",END:"END",ERROR:"ERROR",MUTING_READY:"MUTING_READY",MUTING_PLAY:"MUTING_PLAY",MUTING_PAUSE:"MUTING_PAUSE",CASTING:"CASTING"},this.createStateMachine(a)}return e=t,a=[{key:"getAllStates",value:function(){var t=this;return[].concat(Ge(Object.keys(this.States).map(function(e){return t.States[e]})),["FINISH_PLAY_SEEKING","PLAY_SEEK","FINISH_QUALITYCHANGE_PAUSE","FINISH_QUALITYCHANGE","FINISH_QUALITYCHANGE_REBUFFERING"])}},{key:"createStateMachine",value:function(){var e=this,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=[nt.PLAY,nt.PAUSE,nt.SEEK,nt.SEEKED,nt.PLAYBACK_PLAYING,nt.PLAYBACK_FINISHED,nt.READY,nt.SCREEN_RESIZE,nt.END,nt.ERROR,nt.UN_MUTE,nt.MUTE];this.stateMachine=ye().create({initial:this.States.SETUP,error:function(t,e,a,i,r,n){X.error("Error in statemachine: "+n)},events:[{name:nt.TIMECHANGED,from:this.States.SETUP,to:this.States.SETUP},{name:nt.READY,from:[this.States.SETUP,this.States.ERROR],to:this.States.READY},{name:nt.PLAY,from:this.States.READY,to:this.States.STARTUP},{name:nt.PLAY,from:this.States.SETUP,to:this.States.SETUP},{name:nt.TIMECHANGED,from:this.States.READY,to:this.States.STARTUP},{name:nt.START_BUFFERING,from:this.States.STARTUP,to:this.States.STARTUP},{name:nt.END_BUFFERING,from:this.States.STARTUP,to:this.States.STARTUP},{name:nt.VIDEO_CHANGE,from:this.States.STARTUP,to:this.States.STARTUP},{name:nt.AUDIO_CHANGE,from:this.States.STARTUP,to:this.States.STARTUP},{name:nt.TIMECHANGED,from:this.States.STARTUP,to:this.States.PLAYING},{name:nt.TIMECHANGED,from:this.States.PLAYING,to:this.States.PLAYING},{name:nt.END_BUFFERING,from:this.States.PLAYING,to:this.States.PLAYING},{name:nt.START_BUFFERING,from:this.States.PLAYING,to:this.States.REBUFFERING},{name:nt.START_BUFFERING,from:this.States.REBUFFERING,to:this.States.REBUFFERING},{name:nt.TIMECHANGED,from:this.States.REBUFFERING,to:this.States.PLAYING},{name:nt.SEEK,from:this.States.STARTUP,to:this.States.STARTUP},{name:nt.SEEK,from:this.States.PLAYING,to:this.States.PLAY_SEEKING},{name:nt.TIMECHANGED,from:this.States.PLAY_SEEKING,to:this.States.PLAY_SEEKING},{name:nt.TIMECHANGED,from:this.States.PAUSED_SEEKING,to:this.States.PAUSED_SEEKING},{name:nt.PAUSE,from:this.States.PLAYING,to:this.States.PAUSE},{name:nt.PAUSE,from:this.States.REBUFFERING,to:this.States.PAUSE},{name:nt.TIMECHANGED,from:this.States.PAUSE,to:this.States.PAUSE},{name:nt.PLAY,from:this.States.PAUSE,to:this.States.PLAYING},{name:nt.VIDEO_CHANGE,from:this.States.PLAYING,to:this.States.QUALITYCHANGE},{name:nt.AUDIO_CHANGE,from:this.States.PLAYING,to:this.States.QUALITYCHANGE},{name:nt.VIDEO_CHANGE,from:this.States.QUALITYCHANGE,to:this.States.QUALITYCHANGE},{name:nt.AUDIO_CHANGE,from:this.States.QUALITYCHANGE,to:this.States.QUALITYCHANGE},{name:"FINISH_QUALITYCHANGE",from:this.States.QUALITYCHANGE,to:this.States.PLAYING},{name:nt.VIDEO_CHANGE,from:this.States.PAUSE,to:this.States.QUALITYCHANGE_PAUSE},{name:nt.AUDIO_CHANGE,from:this.States.PAUSE,to:this.States.QUALITYCHANGE_PAUSE},{name:nt.VIDEO_CHANGE,from:this.States.QUALITYCHANGE_PAUSE,to:this.States.QUALITYCHANGE_PAUSE},{name:nt.AUDIO_CHANGE,from:this.States.QUALITYCHANGE_PAUSE,to:this.States.QUALITYCHANGE_PAUSE},{name:"FINISH_QUALITYCHANGE_PAUSE",from:this.States.QUALITYCHANGE_PAUSE,to:this.States.PAUSE},{name:nt.SEEK,from:this.States.PAUSE,to:this.States.PAUSED_SEEKING},{name:nt.SEEK,from:this.States.PAUSED_SEEKING,to:this.States.PAUSED_SEEKING},{name:nt.AUDIO_CHANGE,from:this.States.PAUSED_SEEKING,to:this.States.PAUSED_SEEKING},{name:nt.VIDEO_CHANGE,from:this.States.PAUSED_SEEKING,to:this.States.PAUSED_SEEKING},{name:nt.START_BUFFERING,from:this.States.PAUSED_SEEKING,to:this.States.PAUSED_SEEKING},{name:nt.END_BUFFERING,from:this.States.PAUSED_SEEKING,to:this.States.PAUSED_SEEKING},{name:nt.SEEKED,from:this.States.PAUSED_SEEKING,to:this.States.PAUSE},{name:nt.PLAY,from:this.States.PAUSED_SEEKING,to:this.States.PLAYING},{name:nt.PAUSE,from:this.States.PAUSED_SEEKING,to:this.States.PAUSE},{name:"PLAY_SEEK",from:this.States.PAUSE,to:this.States.PLAY_SEEKING},{name:"PLAY_SEEK",from:this.States.PAUSED_SEEKING,to:this.States.PLAY_SEEKING},{name:"PLAY_SEEK",from:this.States.PLAY_SEEKING,to:this.States.PLAY_SEEKING},{name:nt.SEEK,from:this.States.PLAY_SEEKING,to:this.States.PLAY_SEEKING},{name:nt.AUDIO_CHANGE,from:this.States.PLAY_SEEKING,to:this.States.PLAY_SEEKING},{name:nt.VIDEO_CHANGE,from:this.States.PLAY_SEEKING,to:this.States.PLAY_SEEKING},{name:nt.START_BUFFERING,from:this.States.PLAY_SEEKING,to:this.States.PLAY_SEEKING},{name:nt.END_BUFFERING,from:this.States.PLAY_SEEKING,to:this.States.PLAY_SEEKING},{name:nt.SEEKED,from:this.States.PLAY_SEEKING,to:this.States.PLAY_SEEKING},{name:nt.SEEKED,from:this.States.PLAY_SEEKING,to:this.States.END_PLAY_SEEKING},{name:nt.START_BUFFERING,from:this.States.END_PLAY_SEEKING,to:this.States.END_PLAY_SEEKING},{name:nt.END_BUFFERING,from:this.States.END_PLAY_SEEKING,to:this.States.END_PLAY_SEEKING},{name:nt.SEEKED,from:this.States.END_PLAY_SEEKING,to:this.States.END_PLAY_SEEKING},{name:nt.TIMECHANGED,from:this.States.END_PLAY_SEEKING,to:this.States.PLAYING},{name:nt.END,from:this.States.PLAY_SEEKING,to:this.States.END},{name:nt.END,from:this.States.PAUSED_SEEKING,to:this.States.END},{name:nt.END,from:this.States.PLAYING,to:this.States.END},{name:nt.END,from:this.States.PAUSE,to:this.States.END},{name:nt.SEEK,from:this.States.END,to:this.States.END},{name:nt.SEEKED,from:this.States.END,to:this.States.END},{name:nt.TIMECHANGED,from:this.States.END,to:this.States.END},{name:nt.END_BUFFERING,from:this.States.END,to:this.States.END},{name:nt.START_BUFFERING,from:this.States.END,to:this.States.END},{name:nt.END,from:this.States.END,to:this.States.END},{name:nt.SEEKED,from:this.States.PLAYING,to:this.States.PLAYING},{name:nt.PLAY,from:this.States.END,to:this.States.PLAYING},{name:nt.ERROR,from:this.getAllStates(),to:this.States.ERROR},{name:nt.PAUSE,from:this.States.ERROR,to:this.States.ERROR},{name:nt.SEEK,from:this.States.END_PLAY_SEEKING,to:this.States.PLAY_SEEKING},{name:"FINISH_PLAY_SEEKING",from:this.States.END_PLAY_SEEKING,to:this.States.PLAYING},{name:nt.UNLOAD,from:this.getAllStates(),to:this.States.END},{name:nt.START_AD,from:this.States.PLAYING,to:this.States.AD},{name:nt.END_AD,from:this.States.AD,to:this.States.PLAYING},{name:nt.MUTE,from:this.States.READY,to:this.States.MUTING_READY},{name:nt.UN_MUTE,from:this.States.READY,to:this.States.MUTING_READY},{name:"FINISH_MUTING",from:this.States.MUTING_READY,to:this.States.READY},{name:nt.MUTE,from:this.States.PLAYING,to:this.States.MUTING_PLAY},{name:nt.UN_MUTE,from:this.States.PLAYING,to:this.States.MUTING_PLAY},{name:"FINISH_MUTING",from:this.States.MUTING_PLAY,to:this.States.PLAYING},{name:nt.MUTE,from:this.States.PAUSE,to:this.States.MUTING_PAUSE},{name:nt.UN_MUTE,from:this.States.PAUSE,to:this.States.MUTING_PAUSE},{name:"FINISH_MUTING",from:this.States.MUTING_PAUSE,to:this.States.PAUSE},{name:nt.START_CAST,from:[this.States.READY,this.States.PAUSE],to:this.States.CASTING},{name:nt.PAUSE,from:this.States.CASTING,to:this.States.CASTING},{name:nt.PLAY,from:this.States.CASTING,to:this.States.CASTING},{name:nt.TIMECHANGED,from:this.States.CASTING,to:this.States.CASTING},{name:nt.MUTE,from:this.States.CASTING,to:this.States.CASTING},{name:nt.SEEK,from:this.States.CASTING,to:this.States.CASTING},{name:nt.SEEKED,from:this.States.CASTING,to:this.States.CASTING},{name:nt.END_CAST,from:this.States.CASTING,to:this.States.READY},{name:nt.SEEK,from:this.States.READY,to:this.States.READY},{name:nt.SEEKED,from:this.States.READY,to:this.States.READY},{name:nt.SEEKED,from:this.States.STARTUP,to:this.States.STARTUP},{name:nt.SOURCE_LOADED,from:this.getAllStates(),to:this.States.SETUP},{name:nt.SOURCE_LOADED,from:this.States.SETUP,to:this.States.SETUP},{name:nt.SOURCE_LOADED,from:this.States.READY,to:this.States.READY},{name:nt.VIDEO_CHANGE,from:this.States.REBUFFERING,to:this.States.QUALITYCHANGE_REBUFFERING},{name:nt.AUDIO_CHANGE,from:this.States.REBUFFERING,to:this.States.QUALITYCHANGE_REBUFFERING},{name:nt.VIDEO_CHANGE,from:this.States.QUALITYCHANGE_REBUFFERING,to:this.States.QUALITYCHANGE_REBUFFERING},{name:nt.AUDIO_CHANGE,from:this.States.QUALITYCHANGE_REBUFFERING,to:this.States.QUALITYCHANGE_REBUFFERING},{name:"FINISH_QUALITYCHANGE_REBUFFERING",from:this.States.QUALITYCHANGE_REBUFFERING,to:this.States.REBUFFERING}],callbacks:{onpause:function(t,a,i,r){e.stateMachineCallbacks.playbackWatchTime(e.customData.playbackWatchTime),a===e.States.PLAYING&&(e.pausedTimestamp=r)},onbeforeevent:function(a,r,n,s,o){return e.stateMachineCallbacks.playbackWatchTime(e.customData.playbackWatchTime),i.includes(a)&&(a===nt.PLAYBACK_FINISHED&&(e.customData.previousRecordTime=0),e.customData.previousRecordTime=o.currentTime),a===nt.PLAY&&r===e.States.SETUP&&n===e.States.SETUP&&(e.autoPlay=!0),a===nt.SEEK&&(r===e.States.PAUSE||r===e.States.PLAYING)&&(e.seekedFrom=e.lastPlayHeadDuration,e.seekTimestamp=s,s-e.pausedTimestamp<t.PAUSE_SEEK_DELAY)?(e.stateMachine.PLAY_SEEK(s),!1):(a===nt.SEEK&&clearTimeout(e.seekedTimeout),a!==nt.SOURCE_LOADED?a===nt.SEEKED&&r===e.States.PAUSED_SEEKING?(e.seekedTimestamp=s,e.seekedTimeout=setTimeout(function(){e.stateMachine.pause(s,o)},t.SEEKED_PAUSE_DELAY),!1):(r!==e.States.REBUFFERING||n!==e.States.QUALITYCHANGE_REBUFFERING)&&void(o&&(e.lastPlayHeadDuration=1e3*o.currentTime)):void e.stateMachineCallbacks.loaded(s,e.States.READY,o))},onenterstate:function(t,r,n,s,o){e.stateMachineCallbacks.playbackWatchTime(e.customData.playbackWatchTime),i.includes(t)&&(t===nt.PLAYBACK_FINISHED&&(e.customData.previousRecordTime=0),e.customData.previousRecordTime=o.currentTime),n===e.States.SETUP?e.stateMachineCallbacks.setup(s,e.States.SETUP,o,a):n===e.States.READY?(o.playerSoftware=Lt.VIDEOJS,e.stateMachineCallbacks.ready(s,e.States.READY,o)):"play"===t&&n===e.States.STARTUP?e.stateMachineCallbacks.first_play(s,e.States.PLAY,o):"timechanged"===t&&r===e.States.STARTUP&&n===e.States.PLAYING&&e.autoPlay?(e.stateMachineCallbacks.first_play(s,e.States.PLAY,o),e.stateMachineCallbacks.playing(s,e.States.PLAYING,o),e.stateMachineCallbacks.playback_started(o)):"play"===t&&r===e.States.PAUSE?(e.stateMachineCallbacks.play(s,e.States.PLAY,o),e.stateMachineCallbacks.playing(s,e.States.PLAYING,o),e.stateMachineCallbacks.heartbeat(s,e.States.PLAY,o)):"timechanged"!==t||r!==e.States.STARTUP||n!==e.States.PLAYING||e.autoPlay?n===e.States.PAUSE&&r===e.States.PLAYING?(e.stateMachineCallbacks.pause(s,e.States.PAUSE,o),e.stateMachineCallbacks.heartbeat(s,e.States.PAUSE,o)):n===e.States.END?(e.stateMachineCallbacks.end(s,e.States.END,o),e.stateMachineCallbacks.heartbeat(s,e.States.END,o)):n===e.States.MUTING_PAUSE?e.stateMachineCallbacks.mute(s,o):t===nt.START_BUFFERING?e.stateMachineCallbacks.start_rebuffer(s,e.States.REBUFFERING,o):"timechanged"===t&&r===e.States.REBUFFERING&&n===e.States.PLAYING&&e.stateMachineCallbacks.end_rebuffer(s,e.States.REBUFFERING,o):(e.stateMachineCallbacks.playing(s,e.States.PLAYING,o),e.stateMachineCallbacks.playback_started(o)),"none"===r&&a.starttime?e.onEnterStateTimestamp=a.starttime:e.onEnterStateTimestamp=s||(new Date).getTime(),o&&n!==e.States.PAUSED_SEEKING&&n!==e.States.PLAY_SEEKING&&n!==e.States.END_PLAY_SEEKING&&e.stateMachineCallbacks.setVideoTimeStartFromEvent(o),"PLAY_SEEK"===t&&n===e.States.PLAY_SEEKING&&n!==e.States.PLAY_SEEKING&&n!==e.States.END_PLAY_SEEKING&&(e.seekTimestamp=e.onEnterStateTimestamp)},onafterevent:function(t,a,r,n,s){e.stateMachineCallbacks.playbackWatchTime(e.customData.playbackWatchTime),i.includes(t)&&(t===nt.PLAYBACK_FINISHED&&(e.customData.previousRecordTime=0),e.customData.previousRecordTime=s.currentTime),r===e.States.QUALITYCHANGE&&e.stateMachine.FINISH_QUALITYCHANGE(n),r!==e.States.MUTING_READY&&r!==e.States.MUTING_PLAY&&r!==e.States.MUTING_PAUSE||e.stateMachine.FINISH_MUTING(n)},onleavestate:function(t,a,r,n,s){if(e.stateMachineCallbacks.playbackWatchTime(e.customData.playbackWatchTime),i.includes(t)&&(t===nt.PLAYBACK_FINISHED&&(e.customData.previousRecordTime=0),e.customData.previousRecordTime=s.currentTime),e.stateMachineCallbacks.resetSessionExpiry(),n){var o=n-e.onEnterStateTimestamp;if(s&&r!==e.States.PAUSED_SEEKING&&r!==e.States.PLAY_SEEKING&&r!==e.States.END_PLAY_SEEKING&&(console.log("ERRRRRRRRRR"),X.log("ERRRRRRRRRR"),X.log("-----\x3e Setting video time end to "+s.currentTime+", going to "+r),e.stateMachineCallbacks.setVideoTimeEndFromEvent(s)),"PLAY_SEEK"===t&&a===e.States.PAUSE)return!0;var l=a.toLowerCase();if(a===e.States.END_PLAY_SEEKING||a===e.States.PAUSED_SEEKING){var c=e.seekedTimestamp-e.seekTimestamp;e.stateMachineCallbacks.playback_seeked(e.seekedFrom,1e3*s.currentTime,c,r),e.stateMachineCallbacks.heartbeat(n,e.States.PLAY,s),X.log("Seek was "+c+"ms")}else t===nt.UNLOAD&&a===e.States.PLAYING?e.stateMachineCallbacks.playingAndBye(o,l,s):a===e.States.PAUSE&&r!==e.States.PAUSED_SEEKING&&e.stateMachineCallbacks.setVideoTimeStartFromEvent(t);t===nt.VIDEO_CHANGE?e.stateMachineCallbacks.videoChange(s):t===nt.AUDIO_CHANGE?e.stateMachineCallbacks.audioChange(s):t===nt.MUTE?(X.log("Setting sample to muted"),e.stateMachineCallbacks.mute()):t===nt.UN_MUTE&&(X.log("Setting sample to unmuted"),e.stateMachineCallbacks.unMute())}},onseek:function(t,a,i,r){e.stateMachineCallbacks.playbackWatchTime(e.customData.playbackWatchTime),e.seekTimestamp=r},onseeked:function(t,a,i,r){e.stateMachineCallbacks.playbackWatchTime(e.customData.playbackWatchTime),e.seekedTimestamp=r},ontimechanged:function(t,a,i,r,n){e.stateMachineCallbacks.playbackWatchTime(e.customData.playbackWatchTime);var s=r-e.onEnterStateTimestamp,o=n.currentTime-e.customData.previousRecordTime;o>0&&o<5&&(e.customData.playbackWatchTime+=Math.round(1e3*(n.currentTime-e.customData.previousRecordTime)),e.customData.previousRecordTime=n.currentTime),s>d&&(e.stateMachineCallbacks.setVideoTimeEndFromEvent(n),X.log("Sending heartbeat"),e.stateMachineCallbacks.heartbeat(s,a.toLowerCase(),n),e.onEnterStateTimestamp=r,e.stateMachineCallbacks.setVideoTimeStartFromEvent(n),e.stateMachineCallbacks.resetSessionExpiry())},onplayerError:function(t,a,i,r,n){e.stateMachineCallbacks.error(n)}}})}},{key:"callEvent",value:function(t,e,a){var i=this.stateMachine[t];i?i.call(this.stateMachine,a,e):X.log("Ignored Event: "+t)}},{key:"updateMetadata",value:function(t){this.stateMachineCallbacks.updateSample(t)}}],i=[{key:"pad",value:function(t,e){return(t+new Array(e).join(" ")).slice(0,e)}}],a&&ke(e.prototype,a),i&&ke(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,a,i}();function Fe(t){return Fe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Fe(t)}function Me(t){return function(t){if(Array.isArray(t))return He(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return He(t,e);var a={}.toString.call(t).slice(8,-1);return"Object"===a&&t.constructor&&(a=t.constructor.name),"Map"===a||"Set"===a?Array.from(t):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?He(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function He(t,e){(null==e||e>t.length)&&(e=t.length);for(var a=0,i=Array(e);a<e;a++)i[a]=t[a];return i}function Ke(t,e){for(var a=0;a<e.length;a++){var i=e[a];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,Ve(i.key),i)}}function Ve(t){var e=function(t,e){if("object"!=Fe(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,e||"default");if("object"!=Fe(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Fe(e)?e:e+""}Ye(we,"PAUSE_SEEK_DELAY",200),Ye(we,"SEEKED_PAUSE_DELAY",300);var Be=function(){return t=function t(e){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.stateMachineCallbacks=e,this.customData={previousRecordTime:0,playbackWatchTime:0},this.pausedTimestamp=null,this.onEnterStateTimestamp=0,this.seekStartedAt=null,this.seekTimestamp=0,this.seekedTimestamp=0,this.seekedFrom=0,this.lastPlayHeadDuration=0,this.playTimeStamp=null,this.States={SETUP:"SETUP",STARTUP:"STARTUP",READY:"READY",PLAYING:"PLAYING",REBUFFERING:"REBUFFERING",PAUSE:"PAUSE",QUALITYCHANGE:"QUALITYCHANGE",PAUSED_SEEKING:"PAUSED_SEEKING",QUALITYCHANGE_PAUSE:"QUALITYCHANGE_PAUSE",QUALITYCHANGE_REBUFFERING:"QUALITYCHANGE_REBUFFERING",END:"END",ERROR:"ERROR",MUTING_READY:"MUTING_READY",MUTING_PLAY:"MUTING_PLAY",MUTING_PAUSE:"MUTING_PAUSE",CASTING:"CASTING"},this.createStateMachine(a)},e=[{key:"getAllStates",value:function(){var t=this;return[].concat(Me(Object.keys(this.States).map(function(e){return t.States[e]})),["FINISH_QUALITYCHANGE_PAUSE","FINISH_QUALITYCHANGE","FINISH_QUALITYCHANGE_REBUFFERING"])}},{key:"createStateMachine",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=[nt.PLAY,nt.PAUSE,nt.SEEK,nt.SEEKED,nt.PLAYBACK_PLAYING,nt.PLAYBACK_FINISHED,nt.READY,nt.SCREEN_RESIZE,nt.END,nt.ERROR,nt.UN_MUTE,nt.MUTE];this.stateMachine=ye().create({initial:this.States.SETUP,error:function(t,e,a,i,r,n){X.error("Error in statemachine: "+n)},events:[{name:nt.TIMECHANGED,from:this.States.SETUP,to:this.States.SETUP},{name:nt.READY,from:[this.States.SETUP,this.States.ERROR],to:this.States.READY},{name:nt.PLAY,from:this.States.READY,to:this.States.STARTUP},{name:nt.START_BUFFERING,from:this.States.STARTUP,to:this.States.STARTUP},{name:nt.END_BUFFERING,from:this.States.STARTUP,to:this.States.STARTUP},{name:nt.VIDEO_CHANGE,from:this.States.STARTUP,to:this.States.STARTUP},{name:nt.AUDIO_CHANGE,from:this.States.STARTUP,to:this.States.STARTUP},{name:nt.TIMECHANGED,from:this.States.STARTUP,to:this.States.PLAYING},{name:nt.TIMECHANGED,from:this.States.PLAYING,to:this.States.PLAYING},{name:nt.TIMECHANGED,from:this.States.PAUSE,to:this.States.PAUSE},{name:nt.SEEKED,from:this.States.PAUSE,to:this.States.PAUSE},{name:nt.END_BUFFERING,from:this.States.PLAYING,to:this.States.PLAYING},{name:nt.START_BUFFERING,from:this.States.PLAYING,to:this.States.REBUFFERING},{name:nt.START_BUFFERING,from:this.States.REBUFFERING,to:this.States.REBUFFERING},{name:nt.PLAY,from:this.States.REBUFFERING,to:this.States.PLAYING},{name:nt.TIMECHANGED,from:this.States.REBUFFERING,to:this.States.PLAYING},{name:nt.SEEK,from:this.States.STARTUP,to:this.States.STARTUP},{name:nt.PLAY,from:this.States.PAUSED_SEEKING,to:this.States.PAUSED_SEEKING},{name:nt.PAUSE,from:this.States.PLAYING,to:this.States.PAUSE},{name:nt.PAUSE,from:this.States.REBUFFERING,to:this.States.PAUSE},{name:nt.PLAY,from:this.States.PAUSE,to:this.States.PLAYING},{name:nt.TIMECHANGED,from:this.States.PAUSE,to:this.States.PLAYING},{name:nt.VIDEO_CHANGE,from:this.States.PLAYING,to:this.States.QUALITYCHANGE},{name:nt.AUDIO_CHANGE,from:this.States.PLAYING,to:this.States.QUALITYCHANGE},{name:nt.VIDEO_CHANGE,from:this.States.QUALITYCHANGE,to:this.States.QUALITYCHANGE},{name:nt.AUDIO_CHANGE,from:this.States.QUALITYCHANGE,to:this.States.QUALITYCHANGE},{name:"FINISH_QUALITYCHANGE",from:this.States.QUALITYCHANGE,to:this.States.PLAYING},{name:nt.VIDEO_CHANGE,from:this.States.PAUSE,to:this.States.QUALITYCHANGE_PAUSE},{name:nt.AUDIO_CHANGE,from:this.States.PAUSE,to:this.States.QUALITYCHANGE_PAUSE},{name:nt.VIDEO_CHANGE,from:this.States.QUALITYCHANGE_PAUSE,to:this.States.QUALITYCHANGE_PAUSE},{name:nt.AUDIO_CHANGE,from:this.States.QUALITYCHANGE_PAUSE,to:this.States.QUALITYCHANGE_PAUSE},{name:"FINISH_QUALITYCHANGE_PAUSE",from:this.States.QUALITYCHANGE_PAUSE,to:this.States.PAUSE},{name:nt.SEEK,from:this.States.PAUSE,to:this.States.PAUSED_SEEKING},{name:nt.SEEK,from:this.States.PAUSED_SEEKING,to:this.States.PAUSED_SEEKING},{name:nt.AUDIO_CHANGE,from:this.States.PAUSED_SEEKING,to:this.States.PAUSED_SEEKING},{name:nt.VIDEO_CHANGE,from:this.States.PAUSED_SEEKING,to:this.States.PAUSED_SEEKING},{name:nt.START_BUFFERING,from:this.States.PAUSED_SEEKING,to:this.States.PAUSED_SEEKING},{name:nt.END_BUFFERING,from:this.States.PAUSED_SEEKING,to:this.States.PAUSED_SEEKING},{name:nt.SEEKED,from:this.States.PAUSED_SEEKING,to:this.States.PAUSE},{name:nt.TIMECHANGED,from:this.States.PAUSED_SEEKING,to:this.States.PLAYING},{name:nt.PAUSE,from:this.States.PAUSED_SEEKING,to:this.States.PAUSE},{name:nt.END,from:this.States.PAUSED_SEEKING,to:this.States.END},{name:nt.END,from:this.States.PLAYING,to:this.States.END},{name:nt.END,from:this.States.PAUSE,to:this.States.END},{name:nt.SEEK,from:this.States.END,to:this.States.END},{name:nt.SEEKED,from:this.States.END,to:this.States.END},{name:nt.TIMECHANGED,from:this.States.END,to:this.States.END},{name:nt.END_BUFFERING,from:this.States.END,to:this.States.END},{name:nt.START_BUFFERING,from:this.States.END,to:this.States.END},{name:nt.END,from:this.States.END,to:this.States.END},{name:nt.SEEKED,from:this.States.PLAYING,to:this.States.PLAYING},{name:nt.PLAY,from:this.States.END,to:this.States.PLAYING},{name:nt.ERROR,from:this.getAllStates(),to:this.States.ERROR},{name:nt.PAUSE,from:this.States.ERROR,to:this.States.ERROR},{name:nt.PLAY,from:this.States.ERROR,to:this.States.PLAYING},{name:nt.TIMECHANGED,from:this.States.ERROR,to:this.States.PLAYING},{name:nt.UNLOAD,from:this.getAllStates(),to:this.States.END},{name:nt.START_AD,from:this.States.PLAYING,to:this.States.AD},{name:nt.END_AD,from:this.States.AD,to:this.States.PLAYING},{name:nt.MUTE,from:this.States.READY,to:this.States.MUTING_READY},{name:nt.UN_MUTE,from:this.States.READY,to:this.States.MUTING_READY},{name:"FINISH_MUTING",from:this.States.MUTING_READY,to:this.States.READY},{name:nt.MUTE,from:this.States.PLAYING,to:this.States.MUTING_PLAY},{name:nt.UN_MUTE,from:this.States.PLAYING,to:this.States.MUTING_PLAY},{name:"FINISH_MUTING",from:this.States.MUTING_PLAY,to:this.States.PLAYING},{name:nt.MUTE,from:this.States.PAUSE,to:this.States.MUTING_PAUSE},{name:nt.UN_MUTE,from:this.States.PAUSE,to:this.States.MUTING_PAUSE},{name:"FINISH_MUTING",from:this.States.MUTING_PAUSE,to:this.States.PAUSE},{name:nt.START_CAST,from:[this.States.READY,this.States.PAUSE],to:this.States.CASTING},{name:nt.PAUSE,from:this.States.CASTING,to:this.States.CASTING},{name:nt.PLAY,from:this.States.CASTING,to:this.States.CASTING},{name:nt.TIMECHANGED,from:this.States.CASTING,to:this.States.CASTING},{name:nt.MUTE,from:this.States.CASTING,to:this.States.CASTING},{name:nt.SEEK,from:this.States.CASTING,to:this.States.CASTING},{name:nt.SEEKED,from:this.States.CASTING,to:this.States.CASTING},{name:nt.END_CAST,from:this.States.CASTING,to:this.States.READY},{name:nt.SEEK,from:this.States.READY,to:this.States.READY},{name:nt.SEEKED,from:this.States.READY,to:this.States.READY},{name:nt.SEEKED,from:this.States.STARTUP,to:this.States.STARTUP},{name:nt.SOURCE_LOADED,from:this.States.SETUP,to:this.States.SETUP},{name:nt.SOURCE_LOADED,from:this.States.READY,to:this.States.READY},{name:nt.SOURCE_LOADED,from:this.States.STARTUP,to:this.States.STARTUP},{name:nt.SOURCE_LOADED,from:this.States.PLAYING,to:this.States.PLAYING},{name:nt.VIDEO_CHANGE,from:this.States.REBUFFERING,to:this.States.QUALITYCHANGE_REBUFFERING},{name:nt.AUDIO_CHANGE,from:this.States.REBUFFERING,to:this.States.QUALITYCHANGE_REBUFFERING},{name:nt.VIDEO_CHANGE,from:this.States.QUALITYCHANGE_REBUFFERING,to:this.States.QUALITYCHANGE_REBUFFERING},{name:nt.AUDIO_CHANGE,from:this.States.QUALITYCHANGE_REBUFFERING,to:this.States.QUALITYCHANGE_REBUFFERING},{name:"FINISH_QUALITYCHANGE_REBUFFERING",from:this.States.QUALITYCHANGE_REBUFFERING,to:this.States.REBUFFERING}],callbacks:{onbeforeevent:function(e,i,r,n,s){if(t.stateMachineCallbacks.playbackWatchTime(t.customData.playbackWatchTime),a.includes(e)&&(e===nt.PLAYBACK_FINISHED&&(t.customData.previousRecordTime=0),t.customData.previousRecordTime=s.currentTime),e===nt.SEEK&&i===t.States.PAUSE&&(t.seekedFrom=t.lastPlayHeadDuration),e!==nt.SOURCE_LOADED)s&&(t.lastPlayHeadDuration=1e3*s.currentTime);else{var o=null;i===t.States.PLAYING&&(o=(new Date).getTime()-t.playTimeStamp.getTime()),t.stateMachineCallbacks.loaded(n,t.States.READY,s,o)}},onenterstate:function(i,r,n,s,o){t.stateMachineCallbacks.playbackWatchTime(t.customData.playbackWatchTime),a.includes(i)&&(i===nt.PLAYBACK_FINISHED&&(t.customData.previousRecordTime=0),t.customData.previousRecordTime=o.currentTime),n===t.States.SETUP&&"none"===r?t.stateMachineCallbacks.setup(s,t.States.SETUP,o,e):n===t.States.READY&&r===t.States.SETUP?t.stateMachineCallbacks.ready(s,t.States.READY,o):"play"===i&&n===t.States.STARTUP?(t.playTimeStamp=new Date,t.stateMachineCallbacks.first_play(s,t.States.PLAY,o)):"play"===i&&r===t.States.PAUSE?(t.stateMachineCallbacks.play(s,t.States.PLAY,o),t.stateMachineCallbacks.playing(s,t.States.PLAYING,o),t.stateMachineCallbacks.heartbeat(s,t.States.PLAY,o)):"timechanged"===i&&r===t.States.STARTUP&&n===t.States.PLAYING?(t.stateMachineCallbacks.playing(s,t.States.PLAYING,o),t.stateMachineCallbacks.playback_started(o)):"timechanged"===i&&r===t.States.PAUSE&&n===t.States.PLAYING?t.stateMachineCallbacks.playing(s,t.States.PLAYING,o):n===t.States.PAUSE&&r===t.States.PLAYING?(t.stateMachineCallbacks.pause(s,t.States.PAUSE,o),t.stateMachineCallbacks.heartbeat(s,t.States.PAUSE,o)):n===t.States.END?(t.stateMachineCallbacks.end(s,t.States.END,o),t.stateMachineCallbacks.heartbeat(s,t.States.END,o)):i===nt.START_BUFFERING?t.stateMachineCallbacks.start_rebuffer(s,t.States.REBUFFERING,o):"timechanged"===i&&r===t.States.REBUFFERING&&n===t.States.PLAYING&&t.stateMachineCallbacks.end_rebuffer(s,t.States.REBUFFERING,o),"none"===r&&e.starttime?t.onEnterStateTimestamp=e.starttime:t.onEnterStateTimestamp=s||(new Date).getTime(),o&&n!==t.States.PAUSED_SEEKING&&t.stateMachineCallbacks.setVideoTimeStartFromEvent(o)},onafterevent:function(e,i,r,n,s){t.stateMachineCallbacks.playbackWatchTime(t.customData.playbackWatchTime),a.includes(e)&&(e===nt.PLAYBACK_FINISHED&&(t.customData.previousRecordTime=0),t.customData.previousRecordTime=s.currentTime),r===t.States.QUALITYCHANGE&&t.stateMachine.FINISH_QUALITYCHANGE(n),r!==t.States.MUTING_READY&&r!==t.States.MUTING_PLAY&&r!==t.States.MUTING_PAUSE||t.stateMachine.FINISH_MUTING(n)},onleavestate:function(e,i,r,n,s){if(t.stateMachineCallbacks.playbackWatchTime(t.customData.playbackWatchTime),a.includes(e)&&(e===nt.PLAYBACK_FINISHED&&(t.customData.previousRecordTime=0),t.customData.previousRecordTime=s.currentTime),t.stateMachineCallbacks.resetSessionExpiry(),n){var o=n-t.onEnterStateTimestamp;s&&r!==t.States.PAUSED_SEEKING&&(console.log("ERRRRRRRRRR"),X.log("ERRRRRRRRRR"),X.log("--\x3e Setting video time end to "+s.currentTime+", going to "+r),t.stateMachineCallbacks.setVideoTimeEndFromEvent(s));var l=i.toLowerCase();if(i===t.States.PAUSED_SEEKING){var c=n-t.seekStartedAt;t.seekStartedAt=null,t.stateMachineCallbacks.playback_seeked(t.seekedFrom,1e3*s.currentTime,c,r),t.stateMachineCallbacks.heartbeat(n,t.States.PLAY,s),X.log("Seek was "+c+"ms")}else e===nt.UNLOAD&&i===t.States.PLAYING?t.stateMachineCallbacks.playingAndBye(o,l,s):i===t.States.PAUSE&&r!==t.States.PAUSED_SEEKING&&r!==t.States.PLAYING&&(t.stateMachineCallbacks.setVideoTimeStartFromEvent(e),t.stateMachineCallbacks.pause(o,l,s),t.stateMachineCallbacks.heartbeat(n,l,s));e===nt.VIDEO_CHANGE?t.stateMachineCallbacks.videoChange(s):e===nt.AUDIO_CHANGE?t.stateMachineCallbacks.audioChange(s):e===nt.MUTE?(X.log("Setting sample to muted"),t.stateMachineCallbacks.mute(n,s)):e===nt.UN_MUTE&&(X.log("Setting sample to unmuted"),t.stateMachineCallbacks.unMute(n,s))}},onseek:function(e,a,i,r,n){t.customData.previousRecordTime=n.currentTime,t.stateMachineCallbacks.playbackWatchTime(t.customData.playbackWatchTime),t.seekStartedAt=t.seekStartedAt||r},onseeked:function(e,a,i,r,n){t.customData.previousRecordTime=n.currentTime,t.stateMachineCallbacks.playbackWatchTime(t.customData.playbackWatchTime),t.seekedTimestamp=r},ontimechanged:function(e,a,i,r,n){t.stateMachineCallbacks.playbackWatchTime(t.customData.playbackWatchTime);var s=r-t.onEnterStateTimestamp,o=n.currentTime-t.customData.previousRecordTime;o>0&&o<5&&(t.customData.playbackWatchTime+=Math.round(1e3*(n.currentTime-t.customData.previousRecordTime)),t.customData.previousRecordTime=n.currentTime),s>d&&(t.stateMachineCallbacks.setVideoTimeEndFromEvent(n),X.log("Sending heartbeat"),t.stateMachineCallbacks.heartbeat(s,a.toLowerCase(),n),t.onEnterStateTimestamp=r,t.stateMachineCallbacks.setVideoTimeStartFromEvent(n),t.stateMachineCallbacks.resetSessionExpiry())},onplayerError:function(e,a,i,r,n){t.stateMachineCallbacks.error(n)}}})}},{key:"callEvent",value:function(t,e,a){var i=this.stateMachine[t];i?i.call(this.stateMachine,a,e):X.log("Ignored Event: "+t)}},{key:"updateMetadata",value:function(t){this.stateMachineCallbacks.updateSample(t)}}],a=[{key:"pad",value:function(t,e){return(t+new Array(e).join(" ")).slice(0,e)}}],e&&Ke(t.prototype,e),a&&Ke(t,a),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,a}();function je(t){return je="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},je(t)}function We(t,e){for(var a=0;a<e.length;a++){var i=e[a];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,xe(i.key),i)}}function xe(t){var e=function(t,e){if("object"!=je(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,e||"default");if("object"!=je(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==je(e)?e:e+""}const Qe=function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)},a=[{key:"getAnalyticsStateMachine",value:function(t,e){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return rt.isBitmovinVersionPre7(t)?new Ne(e,a):rt.isBitmovinVersion7Plus(t)?new Ue(e,a):rt.isVideoJs(t)?new we(e,a):(rt.isHlsjs(t)||rt.isDashjs(t)||rt.isShaka(t),new Be(e,a))}}],(e=null)&&We(t.prototype,e),a&&We(t,a),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,a}();function qe(t){return qe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},qe(t)}function Je(t,e){for(var a=0;a<e.length;a++){var i=e[a];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,$e(i.key),i)}}function $e(t){var e=function(t,e){if("object"!=qe(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,e||"default");if("object"!=qe(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==qe(e)?e:e+""}const Xe=function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)},(e=[{key:"setUp",value:function(){X.log("setting up cast session"),this.castSession=cast.framework.CastContext.getInstance().getCurrentSession(),this.addMessageListener()}},{key:"addMessageListener",value:function(){var t=this,e=this.castSession.getApplicationMetadata();!e||e.namespaces.indexOf(E)<0?X.log("No analytics on chrome cast receiver enabled!"):(X.log("adding message listener"),this.castSession.addMessageListener(E,function(e,a){X.log("Received: "+e+" "+a);try{var i=JSON.parse(a);t.handleReceiverMessage(i)}catch(t){X.error("Message parsing failed "+a)}}))}},{key:"handleReceiverMessage",value:function(t){X.log(t)}},{key:"sendMessage",value:function(t){var e=this.castSession.getApplicationMetadata();!e||e.namespaces.indexOf(E)<0?X.log("No analytics on chrome cast receiver enabled!"):(X.log("Sending message: "+JSON.stringify(t)),this.castSession.sendMessage(E,t))}}])&&Je(t.prototype,e),a&&Je(t,a),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,a}();function ze(t){return ze="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ze(t)}function Ze(t,e){for(var a=0;a<e.length;a++){var i=e[a];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,ta(i.key),i)}}function ta(t){var e=function(t,e){if("object"!=ze(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,e||"default");if("object"!=ze(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==ze(e)?e:e+""}const ea=function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)},(e=[{key:"setUp",value:function(){var t=this,e=cast.receiver.CastReceiverManager.getInstance();this.messageBus=e.getCastMessageBus(E,cast.receiver.CastMessageBus.MessageType.JSON),X.log(this.messageBus),this.messageBus.onMessage=function(e){X.log("Received message from cast client: "+JSON.stringify(e));var a=e.data;t.handleClientMessage(a)}}},{key:"setCallback",value:function(t){this.callback=t}},{key:"handleClientMessage",value:function(t){this.callback(t)}},{key:"sendMessage",value:function(t){this.messageBus.broadcast(t)}}])&&Ze(t.prototype,e),a&&Ze(t,a),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,a}();const aa={SETUP:"event_setup",PLAYER_READY:"event_player_ready",PLAYBACK_READY:"event_playback_ready",PLAYBACK_STARTED:"event_playback_started",PAUSE:"event_pause",PLAY:"event_play",PLAYING:"event_playing",PLAYBACK_UPDATE:"event_playback_update",END:"event_ended",MUTE:"event_muted",UNMUTE:"event_unmute",SEEKED:"event_seeked",START_REBUFFER:"event_rebuffer_start",END_REBUFFER:"event_rebuffer_end",ERROR:"event_error"};var ia=a(503),ra=a.n(ia);function na(t){return na="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},na(t)}function sa(t,e){for(var a=0;a<e.length;a++){var i=e[a];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,la(i.key),i)}}function oa(t,e,a){return(e=la(e))in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}function la(t){var e=function(t,e){if("object"!=na(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,e||"default");if("object"!=na(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==na(e)?e:e+""}var ca=function(){function t(e){var a=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),oa(this,"register",function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!t)return a.analyticsStateMachine=new Be(a.stateMachineCallbacks,e),a.analyticsStateMachine;e.starttime?e.starttime=l.convertEpochTime(e.starttime):e.starttime=l.getCurrentTimestamp(),a.analyticsStateMachine=Qe.getAnalyticsStateMachine(t,a.stateMachineCallbacks,e),a.adapter=fe.getAdapter(t,a.record,a.analyticsStateMachine,e.mediaElement),a.adapter||X.error("Could not detect player.")}),oa(this,"registerVideoJSPlayer",function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e.starttime?e.starttime=l.convertEpochTime(e.starttime):e.starttime=l.getCurrentTimestamp(),a.analyticsStateMachine=new we(a.stateMachineCallbacks,e),a.adapter=new vt(t,a.record,a.analyticsStateMachine)}),oa(this,"registerHLSJSPlayer",function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e.starttime?e.starttime=l.convertEpochTime(e.starttime):e.starttime=l.getCurrentTimestamp(),a.analyticsStateMachine=new Be(a.stateMachineCallbacks,e),a.adapter=new Wt(t,a.record,a.analyticsStateMachine)}),oa(this,"registerShakaPlayer",function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e.starttime?e.starttime=l.convertEpochTime(e.starttime):e.starttime=l.getCurrentTimestamp(),a.analyticsStateMachine=new Be(a.stateMachineCallbacks,e),a.adapter=new re(t,a.record,a.analyticsStateMachine,e.mediaElement)}),oa(this,"registerHTML5Player",function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e.starttime?e.starttime=l.convertEpochTime(e.starttime):e.starttime=l.getCurrentTimestamp(),a.analyticsStateMachine=new Be(a.stateMachineCallbacks,e),a.adapter=new wt(t,a.record,a.analyticsStateMachine)}),oa(this,"customEventHandler",function(t,e){a.customEventData=JSON.stringify(e),a.sendAnalyticsRequestAndClearValues(t,{custom_event_data:a.customEventData})}),oa(this,"customEventHandlerAsync",function(t,e){return new Promise(function(i,r){a.customEventData=JSON.stringify(e),a.sendAnalyticsRequestAndClearValuesAsync(t,{custom_event_data:a.customEventData}).then(function(t){i(t)}).catch(function(t){r(t)})})}),oa(this,"registerDashJSPlayer",function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e.starttime?e.starttime=l.convertEpochTime(e.starttime):e.starttime=l.getCurrentTimestamp(),a.analyticsStateMachine=new Be(a.stateMachineCallbacks,e),a.adapter=new he(t,a.record,a.analyticsStateMachine)}),oa(this,"registerReactNativeVideoPlayer",function(t){return t.starttime?t.starttime=l.convertEpochTime(t.starttime):t.starttime=l.getCurrentTimestamp(),a.analyticsStateMachine=new Be(a.stateMachineCallbacks,t),a.analyticsStateMachine}),oa(this,"getCurrentImpressionId",function(){return a.sample.impressionId}),oa(this,"record",function(t,e){e=e||{},a.analyticsStateMachine.callEvent(t,e,l.getCurrentTimestamp())}),oa(this,"setDroppedFrames",function(t){}),this.config=e,this.analyticsCall=new T,this.sessionCreationCall=new Y,this.playerInitCall=new W,this.castClient=new Xe,this.castReceiver=new ea,this.droppedSampleFrames=0,this.licensing="granted",this.startupTime=0,this.pageLoadType=t.PAGE_LOAD_TYPE.FOREGROUND,this.autoplay=void 0,this.isCastClient=!1,this.isCastReceiver=!1,this.isAllowedToSendSamples=!1,this.samplesQueue=[],this.previousState=void 0,this.previousStateTimeStamp=new Date,this.firstPlayTimestamp=0,this.isMuted=!1,this.isFullScreen=void 0,this.videoWidthPixels=void 0,this.videoHeightPixels=void 0,this.upscalePercentage=void 0,this.downscalePercentage=void 0,this.videoBitrate=void 0,this.audioCodec=void 0,this.videoCodec=void 0,this.currentTime=0;try{this.orientation=screen.orientation.type.match(/\w+/)[0],screen.orientation.onchange=function(){this.orientation=screen.orientation.type.match(/\w+/)[0]}}catch(t){this.orientation="undetected"}this.setConfigParameters(),this.init(),this.setupSample(),this.setupStateMachineCallbacks()}return e=t,a=[{key:"init",value:function(){if(this.isCastReceiver||""!==this.config.property_id&&l.validString(this.config.property_id)){X.setLogging(this.config.debug||!1),this.propertyId=this.config.property_id,"undefined"!=typeof window&&void 0!==window.parent?this.pageURL=window.location!==window.parent.location?document.referrer:document.location.href:this.config.page_url?this.pageURL=this.config.page_url:this.pageURL=null;var t=!1;this.config.test&&(t=!0);var e=null;this.config.sessionID&&(e=this.config.sessionID);var a=!0;Object.hasOwn(this.config,"sendSessionRequest")&&(a=this.config.sendSessionRequest);var i=null;this.config.userID&&(i=this.config.userID),this.setUserId(t,i),this.setSessionId(t,e,a),this.setPlayerInstanceId(),this.setPlaybackId()}else console.error("Invalid analytics property_id provided")}},{key:"setConfigParameters",value:function(){arguments.length>0&&void 0!==arguments[0]||this.sample;var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.config;this.customData1=l.getCustomDataString(t.customData1),this.customData2=l.getCustomDataString(t.customData2),this.customData3=l.getCustomDataString(t.customData3),this.customData4=l.getCustomDataString(t.customData4),this.customData5=l.getCustomDataString(t.customData5),this.customData6=l.getCustomDataString(t.customData6),this.customData7=l.getCustomDataString(t.customData7),this.customData8=l.getCustomDataString(t.customData8),this.customData9=l.getCustomDataString(t.customData9),this.customData10=l.getCustomDataString(t.customData10),this.customPlayerIntegrationVersion=l.getCustomDataString(t.customPlayerIntegrationVersion),this.customPlayerName=l.getCustomDataString(t.customPlayerName),this.customPageType=l.getCustomDataString(t.customPageType),this.customUserId=l.getCustomDataString(t.userId),this.userName=l.getCustomDataString(t.userName),this.userEMail=l.getCustomDataString(t.userEMail),this.userPhone=l.getCustomDataString(t.userPhone),this.userProfileImage=l.getCustomDataString(t.userProfileImage),this.userAddressLine1=l.getCustomDataString(t.userAddressLine1),this.userAddressLine2=l.getCustomDataString(t.userAddressLine2),this.userCity=l.getCustomDataString(t.userCity),this.userState=l.getCustomDataString(t.userState),this.userCountry=l.getCustomDataString(t.userCountry),this.userZipcode=l.getCustomDataString(t.userZipcode),this.customContentType=l.getCustomDataString(t.customContentType),this.customVideoDurationMillis=l.getCustomDataString(t.customVideoDurationMillis),this.customEncodingVariant=l.getCustomDataString(t.customEncodingVariant),this.customVideoLanguage=l.getCustomDataString(t.customVideoLanguage),this.customVideoId=l.getCustomDataString(t.customVideoId),this.customVideoSeries=l.getCustomDataString(t.customVideoSeries),this.customVideoProducer=l.getCustomDataString(t.customVideoProducer),this.customVideoTitle=l.getCustomDataString(t.customVideoTitle),this.customVideoVariantName=l.getCustomDataString(t.customVideoVariantName),this.customVideoVariant=l.getCustomDataString(t.customVideoVariant),this.SDKVersion="1.0.0",this.experimentName=t.experimentName}},{key:"updateCustomUserData",value:function(t){this.customUserId=l.getCustomDataString(t.userId),this.userName=l.getCustomDataString(t.userName),this.userEMail=l.getCustomDataString(t.userEMail),this.userPhone=l.getCustomDataString(t.userPhone),this.userProfileImage=l.getCustomDataString(t.userProfileImage),this.userAddressLine1=l.getCustomDataString(t.userAddressLine1),this.userAddressLine2=l.getCustomDataString(t.userAddressLine2),this.userCity=l.getCustomDataString(t.userCity),this.userState=l.getCustomDataString(t.userState),this.userCountry=l.getCustomDataString(t.userCountry),this.userZipcode=l.getCustomDataString(t.userZipcode)}},{key:"updateCustomVideoData",value:function(t){this.customContentType=l.getCustomDataString(t.customContentType),this.customVideoDurationMillis=l.getCustomDataString(t.customVideoDurationMillis),this.customEncodingVariant=l.getCustomDataString(t.customEncodingVariant),this.customVideoLanguage=l.getCustomDataString(t.customVideoLanguage),this.customVideoId=l.getCustomDataString(t.customVideoId),this.customVideoSeries=l.getCustomDataString(t.customVideoSeries),this.customVideoProducer=l.getCustomDataString(t.customVideoProducer),this.customVideoTitle=l.getCustomDataString(t.customVideoTitle),this.customVideoVariantName=l.getCustomDataString(t.customVideoVariantName),this.customVideoVariant=l.getCustomDataString(t.customVideoVariant)}},{key:"updateCustomData",value:function(t){this.customData1=l.getCustomDataString(t.customData1),this.customData2=l.getCustomDataString(t.customData2),this.customData3=l.getCustomDataString(t.customData3),this.customData4=l.getCustomDataString(t.customData4),this.customData5=l.getCustomDataString(t.customData5),this.customData6=l.getCustomDataString(t.customData6),this.customData7=l.getCustomDataString(t.customData7),this.customData8=l.getCustomDataString(t.customData8),this.customData9=l.getCustomDataString(t.customData9),this.customData10=l.getCustomDataString(t.customData10)}},{key:"updateCustomPlayerData",value:function(t){this.customPlayerIntegrationVersion=l.getCustomDataString(t.customPlayerIntegrationVersion),this.customPlayerName=l.getCustomDataString(t.customPlayerName),this.customPageType=l.getCustomDataString(t.customPageType)}},{key:"setSessionData",value:function(){this.sessionData={session_id:this.sessionId,property_id:this.propertyId,user_id:this.userId,custom_user_id:this.customUserId,custom_data_1:this.customData1,custom_data_2:this.customData2,custom_data_3:this.customData3,custom_data_4:this.customData4,custom_data_5:this.customData5,custom_data_6:this.customData6,custom_data_7:this.customData7,custom_data_8:this.customData8,custom_data_9:this.customData9,custom_data_10:this.customData10,user_name:this.userName,user_email:this.userEMail,user_phone:this.userPhone,user_profile_image:this.userProfileImage,user_address_line1:this.userAddressLine1,user_address_line2:this.userAddressLine2,user_city:this.userCity,user_state:this.userState,user_country:this.userCountry,user_zipcode:this.userZipcode,viewer_client_version:this.SDKVersion,meta_browser:this.meta_browser,meta_device_manufacturer:this.meta_device_manufacturer,meta_operating_system_version:this.meta_operating_system_version,meta_operating_system:this.meta_operating_system,meta_device_name:this.meta_device_name,meta_browser_version:this.meta_browser_version,meta_device_category:this.meta_device_category,meta_device_architecture:this.meta_device_architecture,meta_device_display_width:this.meta_device_display_width,meta_device_display_height:this.meta_device_display_height,meta_device_is_touchscreen:this.meta_device_is_touchscreen,meta_device_display_dpr:this.meta_device_display_dpr,meta_browser_language:this.meta_browser_language},this.config.deviceData?(this.sessionData.meta_device_name=this.config.deviceData.meta_device_name,this.sessionData.meta_device_manufacturer=this.config.deviceData.meta_device_manufacturer,this.sessionData.meta_operating_system_version=this.config.deviceData.meta_operating_system_version,this.sessionData.meta_operating_system=this.config.deviceData.meta_operating_system,this.sessionData.meta_browser=this.config.deviceData.meta_browser,this.sessionData.meta_device_display_dpr=this.config.deviceData.meta_device_display_dpr,this.sessionData.meta_browser_version=this.config.deviceData.meta_browser_version,this.sessionData.meta_device_category=this.config.deviceData.meta_device_category,this.sessionData.meta_device_architecture=this.config.deviceData.meta_device_architecture,this.sessionData.meta_device_display_width=this.config.deviceData.meta_device_display_width,this.sessionData.meta_device_display_height=this.config.deviceData.meta_device_display_height,this.sessionData.meta_device_is_touchscreen=this.config.deviceData.meta_device_is_touchscreen,this.sessionData.meta_browser_language=this.config.deviceData.meta_browser_language):(this.sessionData.meta_device_name=ra().product,this.sessionData.meta_device_manufacturer=ra().manufacturer,this.sessionData.meta_operating_system_version=ra().os.version,this.sessionData.meta_operating_system=ra().os.family,this.sessionData.meta_browser=ra().name,this.sessionData.meta_browser_version=ra().version,this.sessionData.meta_device_category=x(),this.sessionData.meta_device_architecture=ra().os.architecture,this.sessionData.meta_device_display_dpr=window.devicePixelRatio,this.sessionData.meta_device_display_width=window.screen.width,this.sessionData.meta_device_display_height=window.screen.height,this.sessionData.meta_device_display_dpr=parseInt(window.devicePixelRatio),this.sessionData.meta_browser_language=navigator?navigator.language||navigator.userLanguage:"","ontouchstart"in document.documentElement&&(this.sessionData.meta_device_is_touchscreen="true"))}},{key:"setPlayerData",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.playerData={player_instance_id:this.playerInstanceId,property_id:this.propertyId,session_id:this.sessionId,user_id:this.userId,custom_user_id:this.customUserId,custom_data_1:this.customData1,custom_data_2:this.customData2,custom_data_3:this.customData3,custom_data_4:this.customData4,custom_data_5:this.customData5,custom_data_6:this.customData6,custom_data_7:this.customData7,custom_data_8:this.customData8,custom_data_9:this.customData9,custom_data_10:this.customData10,player_integration_version:this.customPlayerIntegrationVersion,meta_page_type:this.customPageType,meta_page_url:this.pageURL},this.config.deviceData&&(this.playerData.player_preload=this.config.playerData.player_preload,this.playerData.player_autoplay=this.config.playerData.player_autoplay,this.playerData.player_software_version=this.config.playerData.player_software_version,this.playerData.player_integration_version=this.config.playerData.player_integration_version,this.playerData.player_name=this.config.playerData.player_name,this.playerData.player_language_code=this.config.playerData.player_language_code,this.playerData.player_software=this.config.playerData.player_software,this.playerData.meta_page_url=this.config.playerData.meta_page_url,this.playerData.meta_page_type=this.config.playerData.meta_page_type,this.playerData.player_height_pixels=this.config.playerData.player_height_pixels,this.playerData.player_width_pixels=this.config.playerData.player_width_pixels),t&&l.validNumber(t.videoWindowHeight)&&(this.playerData.player_height_pixels=t.videoWindowHeight),t&&l.validNumber(t.videoWindowWidth)&&(this.playerData.player_width_pixels=t.videoWindowWidth),t&&l.validBoolean(t.autoplay)&&(this.playerData.player_autoplay=t.autoplay),t&&l.validBoolean(t.preload)&&(this.playerData.player_preload=t.preload),t&&l.validString(t.version)&&(this.playerData.player_software_version=t.version),t&&l.validString(t.audioLanguage)&&(this.playerData.player_language_code=t.audioLanguage),t&&l.validString(t.playerSoftware)&&(this.playerData.player_software=t.playerSoftware)}},{key:"setUserId",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(e)this.userId=e;else if(t)this.userId=l.uuidv4();else{var a=l.getCookie("gumlet_user_id");this.userId=a&&""!==a?a:l.setCookie("gumlet_user_id",43200)}}},{key:"setPlayerInstanceId",value:function(){this.config.getUUID?this.playerInstanceId=this.config.getUUID():this.playerInstanceId=l.uuidv4(),this.setPlayerData()}},{key:"setPlaybackId",value:function(){this.config.getUUID?this.playbackId=this.config.getUUID():this.playbackId=l.uuidv4()}},{key:"setSessionId",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,a=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(e)return this.sessionId=e,this.setSessionData(),void(a&&this.sessionCreationCall.sendRequest(this.sessionData,l.noOp));if(t)this.sessionId=l.uuidv4();else{var i=l.getCookie("gumlet_session_id");i&&""!==i?(this.sessionId=i,this.setSessionData()):(this.sessionId=l.setCookie("gumlet_session_id",30),this.setSessionData(),this.sessionCreationCall.sendRequest(this.sessionData,l.noOp))}}},{key:"sendAnalyticsSetupCall",value:function(){this.sendAnalyticsRequestAndClearValues(aa.SETUP,{millis_from_previous_event:0}),this.setState(aa.SETUP)}},{key:"getMillisFromPreviousState",value:function(){return(new Date).getTime()-this.previousStateTimeStamp.getTime()}},{key:"getPlaybackWatchTime",value:function(){return this.playbackWatchTime}},{key:"setPlaybackWatchTime",value:function(t){this.playbackWatchTime=t}},{key:"setVideoData",value:function(t){t&&l.validNumber(t.duration)&&(this.videoDuration=l.calculateTime(t.duration)),t&&l.validString(t.streamType)&&(this.videoSourceType=t.streamType,"dash"===t.streamType&&l.validString(t.mpdUrl)?(this.videoSourceUrl=t.mpdUrl,this.videoSourceHostname=new URL(this.videoSourceUrl).hostname):"hls"===t.streamType&&l.validString(t.m3u8Url)?(this.videoSourceUrl=t.m3u8Url,this.videoSourceHostname=new URL(this.videoSourceUrl).hostname):"hls"===t.streamType&&l.validString(t.streamUrl)?(this.videoSourceUrl=t.streamUrl,this.videoSourceHostname=new URL(this.videoSourceUrl).hostname):"progressive"===t.streamType&&l.validString(t.progUrl)?(this.videoSourceUrl=t.progUrl,this.videoSourceHostname=new URL(this.videoSourceUrl).hostname):t&&t.streamUrl&&(this.videoSourceUrl=t.streamUrl,this.videoSourceHostname=new URL(this.videoSourceUrl).hostname)),t&&t.streamUrl&&(this.videoSourceUrl=t.streamUrl),t&&t.sourceHostName&&(this.videoSourceHostname=t.sourceHostName),t&&Object.hasOwn(t,"muted")&&(this.isMuted=t.muted),t&&t.currentVideoData&&l.validNumber(t.currentVideoData.height)&&t.currentVideoData.height>0&&(this.videoHeightPixels=t.currentVideoData.height),t&&t.currentVideoData&&l.validNumber(t.currentVideoData.width)&&t.currentVideoData.width>0&&(this.videoWidthPixels=t.currentVideoData.width),t&&t.currentVideoData&&l.validNumber(t.currentVideoData.bitrate)&&t.currentVideoData.bitrate>-1&&(this.videoBitrate=t.currentVideoData.bitrate/1e6),t&&t.currentVideoData&&l.validString(t.currentVideoData.audioCodec)&&t.currentVideoData.audioCodec.length>0&&(this.audioCodec=t.currentVideoData.audioCodec),t&&t.currentVideoData&&l.validString(t.currentVideoData.videoCodec)&&t.currentVideoData.videoCodec.length>0&&(this.videoCodec=t.currentVideoData.videoCodec);var e=0;if(!(this.videoHeightPixels&&this.playerData.player_height_pixels&&this.sessionData.meta_device_display_dpr))return this.upscalePercentage=void 0,void(this.downscalePercentage=void 0);(e=this.playerData.player_height_pixels*this.sessionData.meta_device_display_dpr/this.videoHeightPixels-1)>0?(this.upscalePercentage=100*e,this.downscalePercentage=0):e<0?(this.upscalePercentage=0,this.downscalePercentage=100*e*-1):(this.upscalePercentage=0,this.downscalePercentage=0);var a=new URL(this.videoSourceUrl);"video.gumlet.io"!==a.hostname||this.customVideoId||(this.customVideoId=a.pathname.split("/")[2])}},{key:"setupStateMachineCallbacks",value:function(){var e=this;this.stateMachineCallbacks={setup:function(t,a,i,r){X.log("Setup Gumlet analytics "+e.analyticsVersion),e.setDuration(t),e.setVideoData(i);var n=0;r&&r.starttime&&(n=(new Date).getTime()-r.starttime),e.sendAnalyticsRequestAndClearValues(aa.SETUP,{millis_from_previous_event:n}),e.setState(aa.SETUP)},ready:function(t,a,i){e.setDuration(t),e.setVideoData(i),e.setPlaybackSettingsFromLoadedEvent(i),e.sendAnalyticsRequestAndClearValues(aa.PLAYER_READY),e.setState(aa.PLAYER_READY),e.setPlayerData(i),e.playerInitCall.sendRequest(e.playerData,l.noOp)},loaded:function(t,a,i){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;e.setDuration(t),e.setVideoData(i),e.setPlaybackSettingsFromLoadedEvent(i);var n={};null!==r&&(n={millis_from_previous_event:r,previous_event:aa.PLAYER_READY}),e.sendAnalyticsRequestAndClearValues(aa.PLAYBACK_READY,n),null===r&&e.setState(aa.PLAYBACK_READY)},startup:function(t,a){e.setDuration(t)},first_play:function(t,a,i){e.setDuration(t),e.setVideoData(i),e.setPlaybackSettingsFromLoadedEvent(i),e.sendAnalyticsRequestAndClearValues(aa.PLAY),e.setState(aa.PLAY),e.firstPlayTimestamp=new Date},play:function(t,a,i){e.setDuration(t),e.setVideoData(i),e.setPlaybackSettingsFromLoadedEvent(i),e.sendAnalyticsRequestAndClearValues(aa.PLAY),e.setState(aa.PLAY)},updateSample:function(t){e.setPlaybackSettingsFromLoadedEvent(t)},playing:function(t,a,i){e.setDuration(t),e.setVideoData(i),e.setPlaybackSettingsFromLoadedEvent(i),e.sendAnalyticsRequestAndClearValues(aa.PLAYING),e.setState(aa.PLAYING)},playback_started:function(t,a,i){e.setDuration(t),e.setVideoData(i),e.setPlaybackSettingsFromLoadedEvent(i);var r=(new Date).getTime()-e.firstPlayTimestamp.getTime();e.sendAnalyticsRequestAndClearValues(aa.PLAYBACK_STARTED,{millis_from_previous_event:r}),e.setState(aa.PLAYBACK_STARTED)},playingAndBye:function(t,a,i){e.setDuration(t),e.setDroppedFrames(i),e.sendUnloadRequest()},heartbeat:function(t,a,i){e.setDuration(t),e.setVideoData(i),e.setPlaybackSettingsFromLoadedEvent(i),e.sendAnalyticsRequestAndClearValues(aa.PLAYBACK_UPDATE),e.setState(aa.PLAYBACK_UPDATE)},playbackWatchTime:function(t){e.setPlaybackWatchTime(t)},qualitychange:function(t,a){e.setDuration(t)},qualitychange_pause:function(t,a){e.setDuration(t)},qualitychange_rebuffering:function(t,a){e.setDuration(t)},videoChange:function(t){e.stateMachineCallbacks.setVideoTimeEndFromEvent(t),e.stateMachineCallbacks.setVideoTimeStartFromEvent(t),e.setPlaybackSettingsFromLoadedEvent(t)},audioChange:function(t){e.stateMachineCallbacks.setVideoTimeEndFromEvent(t),e.stateMachineCallbacks.setVideoTimeStartFromEvent(t)},pause:function(t,a,i){e.setDuration(t),e.setVideoData(i),e.setPlaybackSettingsFromLoadedEvent(i),e.sendAnalyticsRequestAndClearValues(aa.PAUSE),e.setState(aa.PAUSE)},start_rebuffer:function(t,a,i){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];e.setDuration(t),e.setVideoData(i),e.setPlaybackSettingsFromLoadedEvent(i),r||e.sendAnalyticsRequestAndClearValues(aa.START_REBUFFER),e.setState(aa.START_REBUFFER)},end_rebuffer:function(t,a,i){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(e.setDuration(t),e.setVideoData(i),e.setPlaybackSettingsFromLoadedEvent(i),r)return e.getSample(aa.END_REBUFFER);e.sendAnalyticsRequestAndClearValues(aa.END_REBUFFER),e.setState(aa.END_REBUFFER)},playback_seeked:function(t,a,i,r){e.sendAnalyticsRequestAndClearValues(aa.SEEKED,{from:t,to:a}),e.setState(aa.SEEKED),e.setupSample(),"PAUSE"===r?(e.sendAnalyticsRequestAndClearValues(aa.PAUSE,{millis_from_previous_event:i}),e.setState(aa.PAUSE)):"PLAYING"===r&&(e.sendAnalyticsRequestAndClearValues(aa.PLAYING,{millis_from_previous_event:i}),e.setState(aa.PLAYING))},paused_seeking:function(t,a,i){e.setDuration(t)},play_seeking:l.noOp,end_play_seeking:function(t,a,i){e.setDuration(t)},rebuffering:function(t,a,i){e.setDuration(t)},error:function(t){e.stateMachineCallbacks.setVideoTimeEndFromEvent(t),e.stateMachineCallbacks.setVideoTimeStartFromEvent(t),e.sendAnalyticsRequestAndClearValues(aa.ERROR,{error_code:t&&t.code,error:t&&t.message}),e.setState(aa.ERROR),e.setupSample()},end:function(t,a,i){e.setPlaybackId(),e.setDuration(t),e.sendAnalyticsRequestAndClearValues(aa.END),e.setState(aa.END)},ad:function(t,a,i){e.setDuration(t),e.setDroppedFrames(i)},mute:function(t,a){e.isMuted=!0,e.setPlaybackSettingsFromLoadedEvent(a),e.sendAnalyticsRequestAndClearValues(aa.MUTE)},unMute:function(t,a){e.isMuted=!1,e.setPlaybackSettingsFromLoadedEvent(a),e.sendAnalyticsRequestAndClearValues(aa.UNMUTE)},muting_ready:l.noOp,muting_play:l.noOp,muting_pause:l.noOp,setVideoTimeEndFromEvent:function(t){},setVideoTimeStartFromEvent:function(t){},startCasting:function(a,i){if(i&&i.resuming)return e.isAllowedToSendSamples=!1,void X.warning("Player started casting but a session is already casting!");e.isCastClient=!0,e.isAllowedToSendSamples=!1;var r=e.sample,n=r.domain,s=r.path,o=r.language,l=r.userAgent,c=r.userId,u=r.impressionId,m={type:t.CAST_RECEIVER_CONFIG_MESSAGE,data:{config:e.config,userId:c,domain:n,path:s,language:o,userAgent:l,impressionId:u}};e.castClient.setUp(),e.castClient.sendMessage(m)},casting:function(){e.isCastClient=!1,e.samplesQueue=[],e.isAllowedToSendSamples=!0},source_changing:function(){},resetSessionExpiry:function(){e.config.test||e.config.sessionID||(l.setCookie("gumlet_session_id",30,e.sessionId),l.setCookie("gumlet_user_id",43200,e.userId))}}}},{key:"setDuration",value:function(t){}},{key:"setState",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;t&&(this.previousState=t,this.previousStateTimeStamp=new Date)}},{key:"setPlaybackSettingsFromLoadedEvent",value:function(t){t&&l.validNumber(t.currentTime)&&(this.currentTime=l.calculateTime(t.currentTime)),t&&l.validBoolean(t.isFullScreen)&&(this.isFullScreen=t.isFullScreen),t&&l.validBoolean(t.isCasting)&&(this.isCasting=t.isCasting)}},{key:"setupSample",value:function(){this.sample={property_id:this.propertyId,session_id:this.sessionId,user_id:this.userId,player_instance_id:this.playerInstanceId,playback_id:this.playbackId,from:void 0,to:void 0,playback_time_instant_millis:void 0,bitrate_mbps:this.videoBitrate,error_code:void 0,error:void 0,error_text:void 0,video_cover:void 0,video_cover_reference:void 0,player_remote_played:void 0,video_total_duration_millis:this.videoDuration,video_width_pixels:void 0,video_height_pixels:void 0,video_source_url:void 0,video_source_hostname:void 0,video_source_type:void 0,custom_content_type:this.customContentType,custom_video_duration_millis:this.customVideoDurationMillis,custom_encoding_variant:this.customEncodingVariant,custom_video_language:this.customVideoLanguage,custom_video_id:this.customVideoId,custom_video_series:this.customVideoSeries,custom_video_producer:this.customVideoProducer,custom_video_title:this.customVideoTitle,custom_video_variant_name:this.customVideoVariantName,custom_video_variant:this.customVideoVariant,muted:this.isMuted,casting:void 0,fullscreen:this.isFullScreen,video_downscale_percentage:void 0,video_upscale_percentage:void 0,orientation:void 0,orientation_from:void 0,quality:void 0,quality_from:void 0,previous_event:void 0,millis_from_previous_event:void 0,video_codec:void 0,audio_codec:void 0,custom_data_1:this.customData1,custom_data_2:this.customData2,custom_data_3:this.customData3,custom_data_4:this.customData4,custom_data_5:this.customData5,custom_data_6:this.customData6,custom_data_7:this.customData7,custom_data_8:this.customData8,custom_data_9:this.customData9,custom_data_10:this.customData10,custom_event_data:void 0,playback_watch_time:void 0}}},{key:"getSample",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=this.sample;if(a.event=t,this.config.getUUID?a.event_id=this.config.getUUID():a.event_id=l.uuidv4(),a.custom_data_1=this.customData1,a.custom_data_2=this.customData2,a.custom_data_3=this.customData3,a.custom_data_4=this.customData4,a.custom_data_5=this.customData5,a.custom_data_6=this.customData6,a.custom_data_7=this.customData7,a.custom_data_8=this.customData8,a.custom_data_9=this.customData9,a.custom_data_10=this.customData1,a.custom_content_type=this.customContentType,a.custom_video_duration_millis=this.customVideoDurationMillis,a.custom_encoding_variant=this.customEncodingVariant,a.custom_video_language=this.customVideoLanguage,a.custom_video_id=this.customVideoId,a.custom_video_series=this.customVideoSeries,a.custom_video_producer=this.customVideoProducer,a.custom_video_title=this.customVideoTitle,a.custom_video_variant_name=this.customVideoVariantName,a.custom_video_variant=this.customVideoVariant,a.millis_from_previous_event=this.getMillisFromPreviousState(),a.previous_event=this.previousState,a.fullscreen=this.isFullScreen,a.muted=this.isMuted,a.video_width_pixels=this.videoWidthPixels,a.video_height_pixels=this.videoHeightPixels,a.video_total_duration_millis=this.videoDuration,a.bitrate=this.videoBitrate,a.audio_codec=this.audioCodec,a.video_codec=this.videoCodec,a.orientation=this.orientation,a.playback_time_instant_millis=this.currentTime,a.video_source_type=this.videoSourceType,a.video_source_url=this.videoSourceUrl,a.video_upscale_percentage=this.upscalePercentage,a.video_downscale_percentage=this.downscalePercentage,a.video_source_hostname=this.videoSourceHostname,a.custom_event_data=void 0,a.playback_watch_time=this.playbackWatchTime,Object.keys(e).forEach(function(t){a[t]=e[t]}),"undefined"!=typeof window&&void 0!==window.parent&&window.navigator)try{"function"==typeof window.navigator.getBattery&&window.navigator.getBattery().then(function(t){t&&(a.battery_level_percentage=100*t.level,a.battery_charging=t.charging)})}catch(t){}return a}},{key:"sendAnalyticsRequest",value:function(t,e){var a=this.getSample(t,e);a.playback_time_instant_millis&&a.video_total_duration_millis&&a.playback_time_instant_millis>a.video_total_duration_millis||this.analyticsCall.sendRequest(a,l.noOp)}},{key:"sendAnalyticsRequestAsync",value:function(t,e){var a=this;return new Promise(function(i,r){var n=a.getSample(t,e);n.playback_time_instant_millis&&n.video_total_duration_millis&&n.playback_time_instant_millis>n.video_total_duration_millis?i(406):a.analyticsCall.sendRequestAsync(n).then(function(t){i(t)}).catch(function(t){r(t)})})}},{key:"sendAnalyticsRequestAndClearValues",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!t)return X.log("event null passed not hitting the injestion API"),False;this.videoDuration&&this.videoDuration>864e5||this.sendAnalyticsRequest(t,e)}},{key:"sendAnalyticsRequestAndClearValuesAsync",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise(function(i,r){e||(X.log("event null passed not hitting the injestion API"),r("event null passed not hitting the injestion API")),t.sendAnalyticsRequestAsync(e,a).then(function(t){i(t)}).catch(function(t){r(t)})})}},{key:"sendUnloadRequest",value:function(){var t=this;"denied"!==this.licensing&&(void 0===navigator.sendBeacon?this.sendAnalyticsRequestSynchronous():fetch(this.analyticsCall.getAnalyticsServerUrl(),{method:"POST",body:JSON.stringify(this.sample),headers:{"Content-Type":"application/json"}}).then(function(e){e.ok||t.sendAnalyticsRequestSynchronous()}).catch(function(e){t.sendAnalyticsRequestSynchronous()}))}},{key:"sendAnalyticsRequestSynchronous",value:function(){"denied"!==this.licensing&&this.analyticsCall.sendRequestSynchronous(this.sample,l.noOp)}},{key:"clearValues",value:function(){this.sample.ad=0,this.sample.paused=0,this.sample.played=0,this.sample.seeked=0,this.sample.buffered=0,this.sample.playerStartupTime=0,this.sample.videoStartupTime=0,this.sample.startupTime=0,this.sample.duration=0,this.sample.droppedFrames=0,this.sample.pageLoadType=0}},{key:"getDroppedFrames",value:function(t){if(void 0!==t&&0!==t){var e=t-this.droppedSampleFrames;return this.droppedSampleFrames=t,e}return 0}}],a&&sa(e.prototype,a),i&&sa(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,a,i}();oa(ca,"PAGE_LOAD_TYPE",{FOREGROUND:1,BACKGROUND:2}),oa(ca,"LICENSE_CALL_PENDING_TIMEOUT",200),oa(ca,"PAGE_LOAD_TYPE_TIMEOUT",200),oa(ca,"CAST_RECEIVER_CONFIG_MESSAGE","CAST_RECEIVER_CONFIG_MESSAGE");const ua=ca;const ma={CLOUDFLARE:"cloudflare",AKAMAI:"akamai",FASTLY:"fastly",MAXCDN:"maxcdn",CLOUDFRONT:"cloudfront",CHINACACHE:"chinacache",BITGRAVITY:"bitgravity"};var ha,Ea=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return ha.register(t,e)},Sa=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return ha.registerVideoJSPlayer(t,e)},da=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return ha.registerDashJSPlayer(t,e)},fa=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return ha.registerHLSJSPlayer(t,e)},pa=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return ha.registerShakaPlayer(t,e)},ya=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return ha.registerHTML5Player(t,e)},Aa=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return ha.registerReactNativeVideoPlayer(t,e)},va=function(){return ha.getCurrentImpressionId()},_a=function(){return ha.analyticsStateMachine},ba=function(t){return ha.updateCustomData(t)},Na=function(t){return ha.updateCustomVideoData(t)},ga=function(t){return ha.updateCustomUserData(t)},Ta=function(t){return ha.updateCustomPlayerData(t)},Da=function(t,e){return ha.customEventHandler(t,e)},Ia=function(t,e){return new Promise(function(a,i){ha.customEventHandlerAsync(t,e).then(function(t){a(t)}).catch(function(t){i(t)})})},Pa=function(t){return ha=new ua(t),{register:Ea,registerVideoJSPlayer:Sa,registerDashJSPlayer:da,registerHLSJSPlayer:fa,registerShakaPlayer:pa,registerHTML5Player:ya,registerReactNativeVideoPlayer:Aa,getCurrentImpressionId:va,stateMachine:_a,updateCustomData:ba,updateCustomVideoData:Na,updateCustomUserData:ga,updateCustomPlayerData:Ta,setCustomData:ha.setCustomData,setCustomDataOnce:ha.setCustomDataOnce,customEventHandler:Da,customEventHandlerAsync:Ia}};Pa.Players=Lt,Pa.CdnProviders=ma,Pa.gumletInsightsEvents=nt,Pa.gumletSupportedPlayers=Lt,"undefined"!=typeof window&&(window.gumlet=window.gumlet||{},window.gumlet.insights=Pa,window.gumletInsightsEvents=nt,window.gumletSupportedPlayers=Lt);const Ca={insights:Pa,gumletInsightsEvents,gumletSupportedPlayers}})(),i})());
@@ -5,7 +5,7 @@
5
5
  * This source code and its use and distribution, is subject to the terms
6
6
  * and conditions of the applicable license agreement.
7
7
  *
8
- * @gumlet/insights-js-core version 1.1.59
8
+ * @gumlet/insights-js-core version 1.1.60
9
9
  *
10
10
  */
11
11
 
@@ -1 +1 @@
1
- {"name":"@gumlet/insights-js-core","version":"1.1.59","description":"Gumlet Insights allows you to collect data from Video playback.","license":"MIT","repository":{"type":"git","url":"https://gitlab.com/gumlet/insights-js-core.git"},"main":"gumlet-insights.min.js","readme":"Please visit: https://docs.gumlet.com/docs/insights-getting-started","author":"Gumlet Pte. Ltd.","homepage":"https://docs.gumlet.com/docs/insights-getting-started","bugs":{"url":"https://www.gumlet.com/contact/"},"maintainers":[{"name":"Gumlet Team","email":"support@gumlet.com"}]}
1
+ {"name":"@gumlet/insights-js-core","version":"1.1.60","description":"Gumlet Insights allows you to collect data from Video playback.","license":"MIT","repository":{"type":"git","url":"https://gitlab.com/gumlet/insights-js-core.git"},"main":"gumlet-insights.min.js","readme":"Please visit: https://docs.gumlet.com/docs/insights-getting-started","author":"Gumlet Pte. Ltd.","homepage":"https://docs.gumlet.com/docs/insights-getting-started","bugs":{"url":"https://www.gumlet.com/contact/"},"maintainers":[{"name":"Gumlet Team","email":"support@gumlet.com"}]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gumlet/insights-js-core",
3
- "version": "1.1.59",
3
+ "version": "1.1.60",
4
4
  "description": "",
5
5
  "main": "build/release/gumlet-insights.min.js",
6
6
  "files": [