@gumlet/insights-js-core 2.0.2 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +29 -1
- package/dist/{Events-DF47Pb9M.mjs → Events-C63wBhV3.mjs} +1 -1
- package/dist/GumletStateMachine-C24imGQ5.mjs +9 -0
- package/dist/{HTML5Adapter-Bl3zPGp9.mjs → HTML5Adapter-CZqoUTTi.mjs} +2 -2
- package/dist/{HlsjsAdapter-b3kyU55D.mjs → HlsjsAdapter-CFz6-RzE.mjs} +2 -2
- package/dist/Logger-CI5ZEMmu.mjs +9 -0
- package/dist/{Players-6Wg2mBMU.mjs → Players-D1WY0Vuh.mjs} +1 -1
- package/dist/ShakaAdapter-BporBfea.mjs +9 -0
- package/dist/main.iife.js +2 -2
- package/dist/main.mjs +2 -2
- package/package.json +1 -1
- package/dist/GumletStateMachine-ri1uyQ8A.mjs +0 -9
- package/dist/Logger-BBKq4lgP.mjs +0 -9
- package/dist/ShakaAdapter-CYdEiZ5C.mjs +0 -9
package/dist/main.iife.js
CHANGED
|
@@ -4,6 +4,6 @@
|
|
|
4
4
|
// This source code and its use and distribution, is subject to the terms
|
|
5
5
|
// and conditions of the applicable license agreement.
|
|
6
6
|
|
|
7
|
-
// @gumlet/insights-js-core version 2.0
|
|
7
|
+
// @gumlet/insights-js-core version 2.1.0
|
|
8
8
|
|
|
9
|
-
var gminsights=(function(e){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var t=Object.create,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.getPrototypeOf,o=Object.prototype.hasOwnProperty,s=(e,t)=>()=>(e&&(t=e(e=0)),t),c=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),l=(e,t)=>{let r={};for(var i in e)n(r,i,{get:e[i],enumerable:!0});return t||n(r,Symbol.toStringTag,{value:`Module`}),r},u=(e,t,a,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var c=i(t),l=0,u=c.length,d;l<u;l++)d=c[l],!o.call(e,d)&&d!==a&&n(e,d,{get:(e=>t[e]).bind(null,d),enumerable:!(s=r(t,d))||s.enumerable});return e},d=(e,r,i)=>(i=e==null?{}:t(a(e)),u(r||!e||!e.__esModule?n(i,`default`,{value:e,enumerable:!0}):i,e));let f=e=>e!==void 0&&typeof e==`string`,ee=e=>e!==void 0&&typeof e==`boolean`,te=e=>e!==void 0&&typeof e==`number`,ne=e=>e.replace(/\/$/g,``),re=e=>(e*=1e3,Math.round(e)),ie=e=>{let t=e.toString().length;return t===13?e:e*10**(13-t)},ae=()=>Date.now(),oe=e=>ae()-e,se=()=>{if(crypto&&crypto.randomUUID)return crypto.randomUUID();let e=new Uint8Array(16);crypto.getRandomValues(e),e[6]=e[6]&15|64,e[8]=e[8]&63|128;let t=[...e].map(e=>e.toString(16).padStart(2,`0`));return t.slice(0,4).join(``)+`-`+t.slice(4,6).join(``)+`-`+t.slice(6,8).join(``)+`-`+t.slice(8,10).join(``)+`-`+t.slice(10,16).join(``)},ce=e=>{let t=`${e}=`,n=[];try{n=document.cookie.split(`;`)}catch{return``}let r=null;for(let e=0;e<n.length;e++){let i=n[e];for(;i.charAt(0)===` `;)i=i.substring(1);i.indexOf(t)===0&&(r=i.substring(t.length,i.length))}if(!r){try{r=localStorage.getItem(e)}catch{return``}let t=null;if(r)try{t=JSON.parse(r)}catch{return``}else return``;let n=null;if(t.expires)n=new Date(t.expires);else return``;if(Object.prototype.toString.call(n)===`[object Date]`){if(!(n instanceof Date&&!isNaN(n.getTime())))return``}else return``;if(n.getTime()>new Date().getTime())r=t.value?t.value:``;else return``}return r},le=(e,t=30,n=null)=>{let r=new Date;r.setTime(r.getTime()+t*60*1e3);let i=n||se();try{document.cookie=`${e}=${i}; expires=${r.toUTCString()}; path=/`,localStorage.setItem(e,JSON.stringify({expires:r.getTime(),value:i}))}catch{}return i},ue=()=>{},de=(e,t)=>{let n=0,r;return()=>n>=t?r:(r=e.apply(null,arguments),n++,r)},fe=e=>de(e,1),pe=()=>{let e=[`webkit`,`moz`,`ms`,`o`];if(`hidden`in document)return`hidden`;for(let t=0;t<e.length;t++)if(`${e[t]}Hidden`in document)return`${e[t]}Hidden`;return null},me=e=>typeof e==`object`?JSON.stringify(e):typeof e==`function`?me(e()):e===void 0||typeof e==`string`?e:String(e);var p={validString:f,validBoolean:ee,validNumber:te,sanitizePath:ne,calculateTime:re,getCurrentTimestamp:ae,getDurationFromTimestampToNow:oe,uuidv4:se,getCookie:ce,setCookie:le,noOp:ue,times:de,once:fe,getHiddenProp:pe,getCustomDataString:me,jsonToQueryString:e=>`?`+Object.keys(e).map(t=>encodeURIComponent(t)+`=`+encodeURIComponent(e[t])).join(`&`),currentDateTimeFormatString:()=>new Date().toISOString(),convertEpochTime:ie};function he(e){e.z=Date.now()/1e3;let t=[void 0,null,!1];Object.keys(e).forEach(n=>{t.indexOf(e[n])!==-1&&delete e[n]}),Object.keys(e).forEach(t=>{Number.isNaN(e[t])&&delete e[t]})}var ge=class{get(e,t,n,r=!0){he(t);let i=p.jsonToQueryString(t);e+=i,fetch(e,{method:`GET`,keepalive:r===!1}).then(e=>e.text()).then(e=>{e&&e.length>0&&n(e)}).catch(()=>{})}asyncGet(e,t){return new Promise((n,r)=>{he(t);let i=p.jsonToQueryString(t);e+=i,fetch(e,{method:`GET`}).then(e=>e.ok?e.text():Promise.reject({status:e.status,statusText:e.statusText})).then(e=>n(e)).catch(e=>{e&&typeof e.status==`number`?r(e):r({status:0,statusText:``})})})}},_e,ve,m=s((()=>{_e=`urn:x-cast:com.gumlet.ingest.cast`,ve=`https://ingest.gumlytics.com`}));m();var ye=class e extends ge{constructor(...t){super(...t),this.sendRequest=function(t,n){t.event_family=`session_event`,this.get(e.analyticsServerUrl,t,n)},this.sendRequestAsync=function(t){return t.event_family=`session_event`,new Promise((n,r)=>{this.asyncGet(e.analyticsServerUrl,t).then(e=>{n(e)}).catch(e=>{r(e)})})},this.sendRequestSynchronous=function(t,n){t.event_family=`session_event`,this.get(e.analyticsServerUrl,t,n,!1)},this.getAnalyticsServerUrl=()=>e.analyticsServerUrl}static{this.analyticsServerUrl=ve}},be,h,xe=s((()=>{be=class{constructor(e=!1){this.log=e=>{this.showLogs&&console.log(e)},this.error=e=>{this.showLogs&&console.error(e)},this.warning=e=>{this.showLogs&&console.warn(e)},this.showLogs=e}setLogging(e){this.showLogs=e}isLogging(){return this.showLogs}},h=new be}));xe();function Se(e){return typeof window>`u`||!window.shaka?!1:typeof shaka.Player==`function`&&e?.constructor===shaka.Player}function Ce(e){return typeof window>`u`||!window.Hls?!1:typeof Hls==`function`&&e?.constructor===Hls}let we={isShaka:Se,isHlsjs:Ce};m();var Te=class{setUp(){h.log(`setting up cast session`),this.castSession=cast.framework.CastContext.getInstance().getCurrentSession(),this.addMessageListener()}addMessageListener(){let e=this.castSession.getApplicationMetadata();if(!e||e.namespaces.indexOf(`urn:x-cast:com.gumlet.ingest.cast`)<0){h.log(`No analytics on chrome cast receiver enabled!`);return}h.log(`adding message listener`),this.castSession.addMessageListener(_e,(e,t)=>{h.log(`Received: ${e} ${t}`);try{let e=JSON.parse(t);this.handleReceiverMessage(e)}catch{h.error(`Message parsing failed ${t}`)}})}handleReceiverMessage(e){h.log(e)}sendMessage(e){let t=this.castSession.getApplicationMetadata();if(!t||t.namespaces.indexOf(`urn:x-cast:com.gumlet.ingest.cast`)<0){h.log(`No analytics on chrome cast receiver enabled!`);return}h.log(`Sending message: ${JSON.stringify(e)}`),this.castSession.sendMessage(_e,e)}};m(),xe();var Ee=class{setUp(){this.messageBus=cast.receiver.CastReceiverManager.getInstance().getCastMessageBus(_e,cast.receiver.CastMessageBus.MessageType.JSON),h.log(this.messageBus),this.messageBus.onMessage=e=>{h.log(`Received message from cast client: ${JSON.stringify(e)}`);let t=e.data;this.handleClientMessage(t)}}setCallback(e){this.callback=e}handleClientMessage(e){this.callback(e)}sendMessage(e){this.messageBus.broadcast(e)}};let g={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`,ERROR_RECOVERED:`event_error_recovered`};m();var De=class e extends ge{constructor(...t){super(...t),this.sendRequest=function(t,n){t.event_family=`session`,this.get(e.analyticsServerUrl,t,n)},this.sendRequestSynchronous=function(t,n){t.event_family=`session`,this.get(e.analyticsServerUrl,t,n,!1)},this.getAnalyticsServerUrl=()=>e.analyticsServerUrl}static{this.analyticsServerUrl=ve}};m();var Oe=class e extends ge{constructor(...t){super(...t),this.sendRequest=function(t,n){t.event_family=`player_init`,this.get(e.analyticsServerUrl,t,n)},this.sendRequestSynchronous=function(t,n){t.event_family=`player_init`,this.get(e.analyticsServerUrl,t,n,!1)},this.getAnalyticsServerUrl=()=>e.analyticsServerUrl}static{this.analyticsServerUrl=ve}};let ke=()=>{let e=window.navigator.userAgent;return/(tablet|ipad|playbook|silk)|(android(?!.*mobi))/i.test(e)?`tablet`:/Mobile|iP(hone|od)|Android|BlackBerry|IEMobile|Kindle|Silk-Accelerated|(hpw|web)OS|Opera M(obi|ini)/.test(e)?`mobile`:`desktop`};var Ae=`2.0.9`,je=500,Me=`user-agent`,_=``,Ne=`?`,v={FUNCTION:`function`,OBJECT:`object`,STRING:`string`,UNDEFINED:`undefined`},y=`browser`,b=`cpu`,x=`device`,S=`engine`,C=`os`,w=`result`,T=`name`,E=`type`,D=`vendor`,O=`version`,k=`architecture`,Pe=`major`,A=`model`,Fe=`console`,j=`mobile`,M=`tablet`,N=`smarttv`,P=`wearable`,Ie=`xr`,Le=`embedded`,Re=`fetcher`,F=`inapp`,ze=`brands`,I=`formFactors`,Be=`fullVersionList`,L=`platform`,Ve=`platformVersion`,He=`bitness`,R=`sec-ch-ua`,Ue=R+`-full-version-list`,We=R+`-arch`,Ge=R+`-`+He,Ke=R+`-form-factors`,qe=R+`-`+j,Je=R+`-`+A,Ye=R+`-`+L,Xe=Ye+`-version`,Ze=[ze,Be,j,A,L,Ve,k,I,He],Qe=`Amazon`,z=`Apple`,$e=`ASUS`,et=`BlackBerry`,B=`Google`,tt=`Huawei`,nt=`Lenovo`,rt=`Honor`,it=`LG`,at=`Microsoft`,ot=`Motorola`,st=`Nvidia`,ct=`OnePlus`,lt=`OPPO`,ut=`Samsung`,dt=`Sharp`,ft=`Sony`,pt=`Xiaomi`,mt=`Zebra`,ht=`Chrome`,gt=`Chromium`,V=`Chromecast`,_t=`Edge`,vt=`Firefox`,yt=`Opera`,bt=`Facebook`,xt=`Sogou`,St=`Mobile `,Ct=` Browser`,wt=`Windows`,H=typeof window!==v.UNDEFINED&&window.navigator?window.navigator:void 0,U=H&&H.userAgentData?H.userAgentData:void 0,Tt=function(e,t){var n={},r=t;if(!Ot(t))for(var i in r={},t)for(var a in t[i])r[a]=t[i][a].concat(r[a]?r[a]:[]);for(var o in e)n[o]=r[o]&&r[o].length%2==0?r[o].concat(e[o]):e[o];return n},Et=function(e){for(var t={},n=0;n<e.length;n++)t[e[n].toUpperCase()]=e[n];return t},Dt=function(e,t){if(typeof e===v.OBJECT&&e.length>0){for(var n in e)if(W(t)==W(e[n]))return!0;return!1}return kt(e)?W(t)==W(e):!1},Ot=function(e,t){for(var n in e)return/^(browser|cpu|device|engine|os)$/.test(n)||(t?Ot(e[n]):!1)},kt=function(e){return typeof e===v.STRING},At=function(e){if(e){for(var t=[],n=Mt(/\\?\"/g,e).split(`,`),r=0;r<n.length;r++)if(n[r].indexOf(`;`)>-1){var i=Pt(n[r]).split(`;v=`);t[r]={brand:i[0],version:i[1]}}else t[r]=Pt(n[r]);return t}},W=function(e){return kt(e)?e.toLowerCase():e},jt=function(e){return kt(e)?Mt(/[^\d\.]/g,e).split(`.`)[0]:void 0},G=function(e){for(var t in e)if(e.hasOwnProperty(t)){var n=e[t];typeof n==v.OBJECT&&n.length==2?this[n[0]]=n[1]:this[n]=void 0}return this},Mt=function(e,t){return kt(t)?t.replace(e,_):t},Nt=function(e){return Mt(/\\?\"/g,e)},Pt=function(e,t){return e=Mt(/^\s\s*/,String(e)),typeof t===v.UNDEFINED?e:e.substring(0,t)},Ft=function(e,t){if(!(!e||!t))for(var n=0,r,i,a,o,s,c;n<t.length&&!s;){var l=t[n],u=t[n+1];for(r=i=0;r<l.length&&!s&&l[r];)if(s=l[r++].exec(e),s)for(a=0;a<u.length;a++)c=s[++i],o=u[a],typeof o===v.OBJECT&&o.length>0?o.length===2?typeof o[1]==v.FUNCTION?this[o[0]]=o[1].call(this,c):this[o[0]]=o[1]:o.length>=3&&(typeof o[1]===v.FUNCTION&&!(o[1].exec&&o[1].test)?o.length>3?this[o[0]]=c?o[1].apply(this,o.slice(2)):void 0:this[o[0]]=c?o[1].call(this,c,o[2]):void 0:o.length==3?this[o[0]]=c?c.replace(o[1],o[2]):void 0:o.length==4?this[o[0]]=c?o[3].call(this,c.replace(o[1],o[2])):void 0:o.length>4&&(this[o[0]]=c?o[3].apply(this,[c.replace(o[1],o[2])].concat(o.slice(4))):void 0)):this[o]=c||void 0;n+=2}},K=function(e,t){for(var n in t)if(typeof t[n]===v.OBJECT&&t[n].length>0){for(var r=0;r<t[n].length;r++)if(Dt(t[n][r],e))return n===Ne?void 0:n}else if(Dt(t[n],e))return n===Ne?void 0:n;return t.hasOwnProperty(`*`)?t[`*`]:e},It={ME:`4.90`,"NT 3.51":`3.51`,"NT 4.0":`4.0`,2e3:[`5.0`,`5.01`],XP:[`5.1`,`5.2`],Vista:`6.0`,7:`6.1`,8:`6.2`,"8.1":`6.3`,10:[`6.4`,`10.0`],NT:``},Lt={embedded:`Automotive`,mobile:`Mobile`,tablet:[`Tablet`,`EInk`],smarttv:`TV`,wearable:`Watch`,xr:[`VR`,`XR`],"?":[`Desktop`,`Unknown`],"*":void 0},Rt={Chrome:`Google Chrome`,Edge:`Microsoft Edge`,"Edge WebView2":`Microsoft Edge WebView2`,"Chrome WebView":`Android WebView`,"Chrome Headless":`HeadlessChrome`,"Huawei Browser":`HuaweiBrowser`,"MIUI Browser":`Miui Browser`,"Opera Mobi":`OperaMobile`,Yandex:`YaBrowser`},zt={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[O,[T,St+`Chrome`]],[/webview.+edge\/([\w\.]+)/i],[O,[T,_t+` WebView`]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[O,[T,`Edge`]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[T,O],[/opios[\/ ]+([\w\.]+)/i],[O,[T,yt+` Mini`]],[/\bop(?:rg)?x\/([\w\.]+)/i],[O,[T,yt+` GX`]],[/\bopr\/([\w\.]+)/i],[O,[T,yt]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[O,[T,`Baidu`]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[O,[T,`Maxthon`]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(atlas|flock|rockmelt|midori|epiphany|silk|skyfire|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon|otter|dooble|(?:hi|lg |ovi|qute)browser|palemoon)\/v?([-\w\.]+)/i,/(brave)(?: chrome)?\/([\d\.]+)/i,/(aloha|heytap|ovi|115|surf|qwant)browser\/([\d\.]+)/i,/(qwant)(?:ios|mobile)\/([\d\.]+)/i,/(ecosia|weibo)(?:__| \w+@)([\d\.]+)/i],[T,O],[/quark(?:pc)?\/([-\w\.]+)/i],[O,[T,`Quark`]],[/\bddg\/([\w\.]+)/i],[O,[T,`DuckDuckGo`]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[O,[T,`UCBrowser`]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[O,[T,`WeChat`]],[/konqueror\/([\w\.]+)/i],[O,[T,`Konqueror`]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[O,[T,`IE`]],[/ya(?:search)?browser\/([\w\.]+)/i],[O,[T,`Yandex`]],[/slbrowser\/([\w\.]+)/i],[O,[T,`Smart `+nt+Ct]],[/(av(?:ast|g|ira))\/([\w\.]+)/i],[[T,/(.+)/,`$1 Secure`+Ct],O],[/norton\/([\w\.]+)/i],[O,[T,`Norton Private`+Ct]],[/\bfocus\/([\w\.]+)/i],[O,[T,vt+` Focus`]],[/ mms\/([\w\.]+)$/i],[O,[T,yt+` Neon`]],[/ opt\/([\w\.]+)$/i],[O,[T,yt+` Touch`]],[/coc_coc\w+\/([\w\.]+)/i],[O,[T,`Coc Coc`]],[/dolfin\/([\w\.]+)/i],[O,[T,`Dolphin`]],[/coast\/([\w\.]+)/i],[O,[T,yt+` Coast`]],[/miuibrowser\/([\w\.]+)/i],[O,[T,`MIUI`+Ct]],[/fxios\/([\w\.-]+)/i],[O,[T,St+vt]],[/\bqihoobrowser\/?([\w\.]*)/i],[O,[T,`360`]],[/\b(qq)\/([\w\.]+)/i],[[T,/(.+)/,`$1Browser`],O],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[T,/(.+)/,`$1`+Ct],O],[/samsungbrowser\/([\w\.]+)/i],[O,[T,ut+` Internet`]],[/metasr[\/ ]?([\d\.]+)/i],[O,[T,xt+` Explorer`]],[/(sogou)mo\w+\/([\d\.]+)/i],[[T,xt+` Mobile`],O],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[T,O],[/(lbbrowser|luakit|rekonq|steam(?= (clie|tenf|gameo)))/i],[T],[/ome\/([\w\.]+).+(iron(?= saf)|360(?=[es]e$))/i],[O,T],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[T,bt],O,[E,F]],[/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/(daum)apps[\/ ]([\w\.]+)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(bing)(?:web|sapphire)\/([\w\.]+)/i,/(instagram|snapchat|klarna)[\/ ]([-\w\.]+)/i],[T,O,[E,F]],[/\bgsa\/([\w\.]+) .*safari\//i],[O,[T,`GSA`],[E,F]],[/(?:musical_ly|trill)(?:.+app_?version\/|_)([\w\.]+)/i],[O,[T,`TikTok`],[E,F]],[/\[(linkedin)app\]/i],[T,[E,F]],[/(zalo(?:app)?)[\/\sa-z]*([\w\.-]+)/i],[[T,/(.+)/,`Zalo`],O,[E,F]],[/(chromium)[\/ ]([-\w\.]+)/i],[T,O],[/ome-(lighthouse)$/i],[T,[E,Re]],[/headlesschrome(?:\/([\w\.]+)| )/i],[O,[T,ht+` Headless`]],[/wv\).+chrome\/([\w\.]+).+edgw\//i],[O,[T,_t+` WebView2`]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[T,ht+` WebView`],O],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[O,[T,`Android`+Ct]],[/chrome\/([\w\.]+) mobile/i],[O,[T,St+`Chrome`]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[T,O],[/version\/([\w\.\,]+) .*mobile(?:\/\w+ | ?)safari/i],[O,[T,St+`Safari`]],[/iphone .*mobile(?:\/\w+ | ?)safari/i],[[T,St+`Safari`]],[/version\/([\w\.\,]+) .*(safari)/i],[O,T],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[T,[O,`1`]],[/(webkit|khtml)\/([\w\.]+)/i],[T,O],[/(?:mobile|tablet);.*(firefox)\/([\w\.-]+)/i],[[T,St+vt],O],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[T,`Netscape`],O],[/(wolvic|librewolf)\/([\w\.]+)/i],[T,O],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[O,[T,vt+` Reality`]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+(?= .+rv\:.+gecko\/\d+)|[0-4][\w\.]+(?!.+compatible))/i,/(amaya|dillo|doris|icab|ladybird|lynx|mosaic|netsurf|obigo|polaris|w3m|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/\b(links) \(([\w\.]+)/i],[T,[O,/_/g,`.`]],[/(cobalt)\/([\w\.]+)/i],[T,[O,/[^\d\.]+./,_]]],cpu:[[/\b((amd|x|x86[-_]?|wow|win)64)\b/i],[[k,`amd64`]],[/(ia32(?=;))/i,/\b((i[346]|x)86)(pc)?\b/i],[[k,`ia32`]],[/\b(aarch64|arm(v?[89]e?l?|_?64))\b/i],[[k,`arm64`]],[/\b(arm(v[67])?ht?n?[fl]p?)\b/i],[[k,`armhf`]],[/( (ce|mobile); ppc;|\/[\w\.]+arm\b)/i],[[k,`arm`]],[/ sun4\w[;\)]/i],[[k,`sparc`]],[/\b(avr32|ia64(?=;)|68k(?=\))|\barm(?=v([1-7]|[5-7]1)l?|;|eabi)|(irix|mips|sparc)(64)?\b|pa-risc)/i,/((ppc|powerpc)(64)?)( mac|;|\))/i,/(?:osf1|[freopnt]{3,4}bsd) (alpha)/i],[[k,/ower/,_,W]],[/mc680.0/i],[[k,`68k`]],[/winnt.+\[axp/i],[[k,`alpha`]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[A,[D,ut],[E,M]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr]|browser)[-\w]+)/i,/sec-(sgh\w+)/i],[A,[D,ut],[E,j]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)[\/\);]/i],[A,[D,z],[E,j]],[/\b(?:ios|apple\w+)\/.+[\(\/](ipad)/i,/\b(ipad)[\d,]*[;\] ].+(mac |i(pad)?)os/i],[A,[D,z],[E,M]],[/(macintosh);/i],[A,[D,z]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[A,[D,dt],[E,j]],[/\b((?:brt|eln|hey2?|gdi|jdn)-a?[lnw]09|(?:ag[rm]3?|jdn2|kob2)-a?[lw]0[09]hn)(?: bui|\)|;)/i],[A,[D,rt],[E,M]],[/honor([-\w ]+)[;\)]/i],[A,[D,rt],[E,j]],[/\b((?:ag[rs][2356]?k?|bah[234]?|bg[2o]|bt[kv]|cmr|cpn|db[ry]2?|jdn2|got|kob2?k?|mon|pce|scm|sht?|[tw]gr|vrd)-[ad]?[lw][0125][09]b?|605hw|bg2-u03|(?:gem|fdr|m2|ple|t1)-[7a]0[1-4][lu]|t1-a2[13][lw]|mediapad[\w\. ]*(?= bui|\)))\b(?!.+d\/s)/i],[A,[D,tt],[E,M]],[/(?:huawei) ?([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][\dc][adnt]?)\b(?!.+d\/s)/i],[A,[D,tt],[E,j]],[/oid[^\)]+; (2[\dbc]{4}(182|283|rp\w{2})[cgl]|m2105k81a?c)(?: bui|\))/i,/\b(?:xiao)?((?:red)?mi[-_ ]?pad[\w- ]*)(?: bui|\))/i],[[A,/_/g,` `],[D,pt],[E,M]],[/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/oid[^\)]+; (redmi[\-_ ]?(?:note|k)?[\w_ ]+|m?[12]\d[01]\d\w{3,6}|poco[\w ]+|(shark )?\w{3}-[ah]0|qin ?[1-3](s\+|ultra| pro)?)( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note|max|cc)?[_ ]?(?:\d{0,2}\w?)[_ ]?(?:plus|se|lite|pro)?( 5g|lte)?)(?: bui|\))/i,/ ([\w ]+) miui\/v?\d/i],[[A,/_/g,` `],[D,pt],[E,j]],[/droid.+; (cph2[3-6]\d[13579]|((gm|hd)19|(ac|be|in|kb)20|(d[en]|eb|le|mt)21|ne22)[0-2]\d|p[g-l]\w[1m]10)\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[A,[D,ct],[E,j]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[A,[D,lt],[E,j]],[/\b(opd2(\d{3}a?))(?: bui|\))/i],[A,[D,K,{OnePlus:[`203`,`304`,`403`,`404`,`413`,`415`],"*":lt}],[E,M]],[/(vivo (5r?|6|8l?|go|one|s|x[il]?[2-4]?)[\w\+ ]*)(?: bui|\))/i],[A,[D,`BLU`],[E,j]],[/; vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[A,[D,`Vivo`],[E,j]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[A,[D,`Realme`],[E,j]],[/(ideatab[-\w ]+|602lv|d-42a|a101lv|a2109a|a3500-hv|s[56]000|pb-6505[my]|tb-?x?\d{3,4}(?:f[cu]|xu|[av])|yt\d?-[jx]?\d+[lfmx])( bui|;|\)|\/)/i,/lenovo ?(b[68]0[08]0-?[hf]?|tab(?:[\w- ]+?)|tb[\w-]{6,7})( bui|;|\)|\/)/i],[A,[D,nt],[E,M]],[/lenovo[-_ ]?([-\w ]+?)(?: bui|\)|\/)/i],[A,[D,nt],[E,j]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ]([\w\s]+)(\)| bui)/i,/((?:moto(?! 360)[-\w\(\) ]+|xt\d{3,4}[cgkosw\+]?[-\d]*|nexus 6)(?= bui|\)))/i],[A,[D,ot],[E,j]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[A,[D,ot],[E,M]],[/\b(?:lg)?([vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[A,[D,it],[E,M]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+(?!.*(?:browser|netcast|android tv|watch|webos))(\w+)/i,/\blg-?([\d\w]+) bui/i],[A,[D,it],[E,j]],[/(nokia) (t[12][01])/i],[D,A,[E,M]],[/(?:maemo|nokia).*(n900|lumia \d+|rm-\d+)/i,/nokia[-_ ]?(([-\w\. ]*?))( bui|\)|;|\/)/i],[[A,/_/g,` `],[E,j],[D,`Nokia`]],[/(pixel (c|tablet))\b/i],[A,[D,B],[E,M]],[/droid.+;(?: google)? (g(01[13]a|020[aem]|025[jn]|1b60|1f8f|2ybb|4s1m|576d|5nz6|8hhn|8vou|a02099|c15s|d1yq|e2ae|ec77|gh2x|kv4x|p4bc|pj41|r83y|tt9q|ur25|wvk6)|pixel[\d ]*a?( pro)?( xl)?( fold)?( \(5g\))?)( bui|\))/i],[A,[D,B],[E,j]],[/(google) (pixelbook( go)?)/i],[D,A],[/droid.+; (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-\w\w\d\d)(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[A,[D,ft],[E,j]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[A,`Xperia Tablet`],[D,ft],[E,M]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[A,[D,Qe],[E,M]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[A,/(.+)/g,`Fire Phone $1`],[D,Qe],[E,j]],[/(playbook);[-\w\),; ]+(rim)/i],[A,D,[E,M]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/(?:blackberry|\(bb10;) (\w+)/i],[A,[D,et],[E,j]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[A,[D,$e],[E,M]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[A,[D,$e],[E,j]],[/(nexus 9)/i],[A,[D,`HTC`],[E,M]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[D,[A,/_/g,` `],[E,j]],[/tcl (xess p17aa)/i,/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])(_\w(\w|\w\w))?(\)| bui)/i],[A,[D,`TCL`],[E,M]],[/droid [\w\.]+; (418(?:7d|8v)|5087z|5102l|61(?:02[dh]|25[adfh]|27[ai]|56[dh]|59k|65[ah])|a509dl|t(?:43(?:0w|1[adepqu])|50(?:6d|7[adju])|6(?:09dl|10k|12b|71[efho]|76[hjk])|7(?:66[ahju]|67[hw]|7[045][bh]|71[hk]|73o|76[ho]|79w|81[hks]?|82h|90[bhsy]|99b)|810[hs]))(_\w(\w|\w\w))?(\)| bui)/i],[A,[D,`TCL`],[E,j]],[/(itel) ((\w+))/i],[[D,W],A,[E,K,{tablet:[`p10001l`,`w7001`],"*":`mobile`}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[A,[D,`Acer`],[E,M]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[A,[D,`Meizu`],[E,j]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[A,[D,`Ulefone`],[E,j]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[A,[D,`Energizer`],[E,j]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[A,[D,`Cat`],[E,j]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[A,[D,`Smartfren`],[E,j]],[/droid.+; (a(in)?(0(15|59|6[35])|142)p?)/i],[A,[D,`Nothing`],[E,j]],[/; (x67 5g|tikeasy \w+|ac[1789]\d\w+)( b|\))/i,/archos ?(5|gamepad2?|([\w ]*[t1789]|hello) ?\d+[\w ]*)( b|\))/i],[A,[D,`Archos`],[E,M]],[/archos ([\w ]+)( b|\))/i,/; (ac[3-6]\d\w{2,8})( b|\))/i],[A,[D,`Archos`],[E,j]],[/; (n159v)/i],[A,[D,`HMD`],[E,j]],[/(imo) (tab \w+)/i,/(infinix|tecno) (x1101b?|p904|dp(7c|8d|10a)( pro)?|p70[1-3]a?|p904|t1101)/i],[D,A,[E,M]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus(?! zenw)|dell|jolla|meizu|motorola|polytron|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (blu|hmd|imo|infinix|lava|oneplus|tcl|wiko)[_ ]([\w\+ ]+?)(?: bui|\)|; r)/i,/(hp) ([\w ]+\w)/i,/(microsoft); (lumia[\w ]+)/i,/(oppo) ?([\w ]+) bui/i,/(hisense) ([ehv][\w ]+)\)/i,/droid[^;]+; (philips)[_ ]([sv-x][\d]{3,4}[xz]?)/i],[D,A,[E,j]],[/(kobo)\s(ereader|touch)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i],[D,A,[E,M]],[/(surface duo)/i],[A,[D,at],[E,M]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[A,[D,`Fairphone`],[E,j]],[/((?:tegranote|shield t(?!.+d tv))[\w- ]*?)(?: b|\))/i],[A,[D,st],[E,M]],[/(sprint) (\w+)/i],[D,A,[E,j]],[/(kin\.[onetw]{3})/i],[[A,/\./g,` `],[D,at],[E,j]],[/droid.+; ([c6]+|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[A,[D,mt],[E,M]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[A,[D,mt],[E,j]],[/(philips)[\w ]+tv/i,/smart-tv.+(samsung)/i],[D,[E,N]],[/hbbtv.+maple;(\d+)/i],[[A,/^/,`SmartTV`],[D,ut],[E,N]],[/(vizio)(?: |.+model\/)(\w+-\w+)/i,/tcast.+(lg)e?. ([-\w]+)/i],[D,A,[E,N]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[D,it],[E,N]],[/(apple) ?tv/i],[D,[A,z+` TV`],[E,N]],[/crkey.*devicetype\/chromecast/i],[[A,V+` Third Generation`],[D,B],[E,N]],[/crkey.*devicetype\/([^/]*)/i],[[A,/^/,`Chromecast `],[D,B],[E,N]],[/fuchsia.*crkey/i],[[A,V+` Nest Hub`],[D,B],[E,N]],[/crkey/i],[[A,V],[D,B],[E,N]],[/(portaltv)/i],[A,[D,bt],[E,N]],[/droid.+aft(\w+)( bui|\))/i],[A,[D,Qe],[E,N]],[/(shield \w+ tv)/i],[A,[D,st],[E,N]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[A,[D,dt],[E,N]],[/(bravia[\w ]+)( bui|\))/i],[A,[D,ft],[E,N]],[/(mi(tv|box)-?\w+) bui/i],[A,[D,pt],[E,N]],[/Hbbtv.*(technisat) (.*);/i],[D,A,[E,N]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[D,/.+\/(\w+)/,`$1`,K,{LG:`lge`}],[A,Pt],[E,N]],[/(playstation \w+)/i],[A,[D,ft],[E,Fe]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[A,[D,at],[E,Fe]],[/(ouya)/i,/(nintendo) (\w+)/i,/(retroid) (pocket ([^\)]+))/i,/(valve).+(steam deck)/i,/droid.+; ((shield|rgcube|gr0006))( bui|\))/i],[[D,K,{Nvidia:`Shield`,Anbernic:`RGCUBE`,Logitech:`GR0006`}],A,[E,Fe]],[/\b(sm-[lr]\d\d[0156][fnuw]?s?|gear live)\b/i],[A,[D,ut],[E,P]],[/((pebble))app/i,/(asus|google|lg|oppo|xiaomi) ((pixel |zen)?watch[\w ]*)( bui|\))/i],[D,A,[E,P]],[/(ow(?:19|20)?we?[1-3]{1,3})/i],[A,[D,lt],[E,P]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[A,[D,z],[E,P]],[/(opwwe\d{3})/i],[A,[D,ct],[E,P]],[/(moto 360)/i],[A,[D,ot],[E,P]],[/(smartwatch 3)/i],[A,[D,ft],[E,P]],[/(g watch r)/i],[A,[D,it],[E,P]],[/droid.+; (wt63?0{2,3})\)/i],[A,[D,mt],[E,P]],[/droid.+; (glass) \d/i],[A,[D,B],[E,Ie]],[/(pico) ([\w ]+) os\d/i],[D,A,[E,Ie]],[/(quest( \d| pro)?s?).+vr/i],[A,[D,bt],[E,Ie]],[/mobile vr; rv.+firefox/i],[[E,Ie]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[D,[E,Le]],[/(aeobc)\b/i],[A,[D,Qe],[E,Le]],[/(homepod).+mac os/i],[A,[D,z],[E,Le]],[/windows iot/i],[[E,Le]],[/droid.+; ([\w- ]+) (4k|android|smart|google)[- ]?tv/i],[A,[E,N]],[/\b((4k|android|smart|opera)[- ]?tv|tv; rv:|large screen[\w ]+safari)\b/i],[[E,N]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew|; hmsc).+?(mobile|vr|\d) safari/i],[A,[E,K,{mobile:`Mobile`,xr:`VR`,"*":M}]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[E,M]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[E,j]],[/droid .+?; ([\w\. -]+)( bui|\))/i],[A,[D,`Generic`]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[O,[T,_t+`HTML`]],[/(arkweb)\/([\w\.]+)/i],[T,O],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[O,[T,`Blink`]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links|dillo)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[T,O],[/ladybird\//i],[[T,`LibWeb`]],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[O,T]],os:[[/(windows nt) (6\.[23]); arm/i],[[T,/N/,`R`],[O,K,It]],[/(windows (?:phone|mobile|iot))(?: os)?[\/ ]?([\d\.]*( se)?)/i,/(windows)[\/ ](1[01]|2000|3\.1|7|8(\.1)?|9[58]|me|server 20\d\d( r2)?|vista|xp)/i],[T,O],[/windows nt ?([\d\.\)]*)(?!.+xbox)/i,/\bwin(?=3| ?9|n)(?:nt| 9x )?([\d\.;]*)/i],[[O,/(;|\))/g,``,K,It],[T,wt]],[/(windows ce)\/?([\d\.]*)/i],[T,O],[/[adehimnop]{4,7}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv|ios(?=.+ip(?:ad|hone)|.+apple ?tv)|ip(?:ad|hone)(?: |.+i(?:pad)?)os|apple ?tv.+ios)[\/ ]([\w\.]+)/i,/\btvos ?([\w\.]+)/i,/cfnetwork\/.+darwin/i],[[O,/_/g,`.`],[T,`iOS`]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+(haiku|morphos))/i],[[T,`macOS`],[O,/_/g,`.`]],[/android ([\d\.]+).*crkey/i],[O,[T,V+` Android`]],[/fuchsia.*crkey\/([\d\.]+)/i],[O,[T,V+` Fuchsia`]],[/crkey\/([\d\.]+).*devicetype\/smartspeaker/i],[O,[T,V+` SmartSpeaker`]],[/linux.*crkey\/([\d\.]+)/i],[O,[T,V+` Linux`]],[/crkey\/([\d\.]+)/i],[O,[T,V]],[/droid ([\w\.]+)\b.+(android[- ]x86)/i],[O,T],[/(ubuntu) ([\w\.]+) like android/i],[[T,/(.+)/,`$1 Touch`],O],[/(harmonyos)[\/ ]?([\d\.]*)/i,/(android|bada|blackberry|kaios|maemo|meego|openharmony|qnx|rim tablet os|sailfish|series40|symbian|tizen)\w*[-\/\.; ]?([\d\.]*)/i],[T,O],[/\(bb(10);/i],[O,[T,et]],[/(?:symbian ?os|symbos|s60(?=;)|series ?60)[-\/ ]?([\w\.]*)/i],[O,[T,`Symbian`]],[/mozilla\/[\d\.]+ \((?:mobile[;\w ]*|tablet|tv|[^\)]*(?:viera|lg(?:l25|-d300)|alcatel ?o.+|y300-f1)); rv:([\w\.]+)\).+gecko\//i],[O,[T,vt+` OS`]],[/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i,/webos(?:[ \/]?|\.tv-20(?=2[2-9]))(\d[\d\.]*)/i],[O,[T,`webOS`]],[/web0s;.+?(?:chr[o0]me|safari)\/(\d+)/i],[[O,K,{25:`120`,24:`108`,23:`94`,22:`87`,6:`79`,5:`68`,4:`53`,3:`38`,2:`538`,1:`537`,"*":`TV`}],[T,`webOS`]],[/watch(?: ?os[,\/ ]|\d,\d\/)([\d\.]+)/i],[O,[T,`watchOS`]],[/cros [\w]+(?:\)| ([\w\.]+)\b)/i],[O,[T,`Chrome OS`]],[/kepler ([\w\.]+); (aft|aeo)/i],[O,[T,`Vega OS`]],[/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) (\w+)/i,/(xbox); +xbox ([^\);]+)/i,/(pico) .+os([\w\.]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/linux.+(mint)[\/\(\) ]?([\w\.]*)/i,/(mageia|vectorlinux|fuchsia|arcaos|arch(?= ?linux))[;l ]([\d\.]*)/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire|knoppix)(?: gnu[\/ ]linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/\b(aix)[; ]([1-9\.]{0,4})/i,/(hurd|linux|morphos)(?: (?:arm|x86|ppc)\w*| ?)([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) ?(r\d)?/i],[T,O],[/(sunos) ?([\d\.]*)/i],[[T,`Solaris`],O],[/\b(beos|os\/2|amigaos|openvms|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[T,O]]},Bt=(function(){var e={init:{},isIgnore:{},isIgnoreRgx:{},toString:{}};return G.call(e.init,[[y,[T,O,Pe,E]],[b,[k]],[x,[E,A,D]],[S,[T,O]],[C,[T,O]]]),G.call(e.isIgnore,[[y,[O,Pe]],[S,[O]],[C,[O]]]),G.call(e.isIgnoreRgx,[[y,/ ?browser$/i],[C,/ ?os$/i]]),G.call(e.toString,[[y,[T,O]],[b,[k]],[x,[D,A]],[S,[T,O]],[C,[T,O]]]),e})(),Vt=function(e,t){var n=Bt.init[t],r=Bt.isIgnore[t]||0,i=Bt.isIgnoreRgx[t]||0,a=Bt.toString[t]||0;function o(){G.call(this,n)}return o.prototype.getItem=function(){return e},o.prototype.withClientHints=function(){return U?U.getHighEntropyValues(Ze).then(function(t){return e.setCH(new Ht(t,!1)).parseCH().get()}):e.parseCH().get()},o.prototype.withFeatureCheck=function(){return e.detectFeature().get()},t!=w&&(o.prototype.is=function(e){var t=!1;for(var n in this)if(this.hasOwnProperty(n)&&!Dt(r,n)&&W(i?Mt(i,this[n]):this[n])==W(i?Mt(i,e):e)){if(t=!0,e!=v.UNDEFINED)break}else if(e==v.UNDEFINED&&t){t=!t;break}return t},o.prototype.toString=function(){var e=_;for(var t in a)typeof this[a[t]]!==v.UNDEFINED&&(e+=(e?` `:_)+this[a[t]]);return e||v.UNDEFINED}),o.prototype.then=function(e){var t=this,n=function(){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e])};n.prototype={is:o.prototype.is,toString:o.prototype.toString,withClientHints:o.prototype.withClientHints,withFeatureCheck:o.prototype.withFeatureCheck};var r=new n;return e(r),r},new o};function Ht(e,t){if(e||={},G.call(this,Ze),t)G.call(this,[[ze,At(e[R])],[Be,At(e[Ue])],[j,/\?1/.test(e[qe])],[A,Nt(e[Je])],[L,Nt(e[Ye])],[Ve,Nt(e[Xe])],[k,Nt(e[We])],[I,At(e[Ke])],[He,Nt(e[Ge])]]);else for(var n in e)this.hasOwnProperty(n)&&typeof e[n]!==v.UNDEFINED&&(this[n]=e[n])}function q(e,t,n,r){return G.call(this,[[`itemType`,e],[`ua`,t],[`uaCH`,r],[`rgxMap`,n],[`data`,Vt(this,e)]]),this}q.prototype.get=function(e){return e?this.data.hasOwnProperty(e)?this.data[e]:void 0:this.data},q.prototype.set=function(e,t){return this.data[e]=t,this},q.prototype.setCH=function(e){return this.uaCH=e,this},q.prototype.detectFeature=function(){if(H&&H.userAgent==this.ua)switch(this.itemType){case y:H.brave&&typeof H.brave.isBrave==v.FUNCTION&&this.set(T,`Brave`);break;case x:!this.get(E)&&U&&U[j]&&this.set(E,j),this.get(A)==`Macintosh`&&H&&typeof H.standalone!==v.UNDEFINED&&H.maxTouchPoints&&H.maxTouchPoints>2&&this.set(A,`iPad`).set(E,M);break;case C:!this.get(T)&&U&&U[L]&&this.set(T,U[L]);break;case w:var e=this.data,t=function(t){return e[t].getItem().detectFeature().get()};this.set(y,t(y)).set(b,t(b)).set(x,t(x)).set(S,t(S)).set(C,t(C))}return this},q.prototype.parseUA=function(){switch(this.itemType!=w&&Ft.call(this.data,this.ua,this.rgxMap),this.itemType){case y:this.set(Pe,jt(this.get(O)));break;case C:if(this.get(T)==`iOS`&&this.get(O)==`18.6`){var e=/\) Version\/([\d\.]+)/.exec(this.ua);e&&parseInt(e[1].substring(0,2),10)>=26&&this.set(O,e[1])}break}return this},q.prototype.parseCH=function(){var e=this.uaCH,t=this.rgxMap;switch(this.itemType){case y:case S:var n=e[Be]||e[ze],r;if(n)for(var i=0;i<n.length;i++){var a=n[i].brand||n[i],o=n[i].version;this.itemType==y&&!/not.a.brand/i.test(a)&&(!r||/Chrom/.test(r)&&a!=gt||r==_t&&/WebView2/.test(a))&&(a=K(a,Rt),r=this.get(T),r&&!/Chrom/.test(r)&&/Chrom/.test(a)||this.set(T,a).set(O,o).set(Pe,jt(o)),r=a),this.itemType==S&&a==gt&&this.set(O,o)}break;case b:var s=e[k];s&&(s&&e[He]==`64`&&(s+=`64`),Ft.call(this.data,s+`;`,t));break;case x:if(e[j]&&this.set(E,j),e[A]&&(this.set(A,e[A]),!this.get(E)||!this.get(D))){var c={};Ft.call(c,`droid 9; `+e[A]+`)`,t),!this.get(E)&&c.type&&this.set(E,c.type),!this.get(D)&&c.vendor&&this.set(D,c.vendor)}if(e[I]){var l;if(typeof e[I]!=`string`)for(var u=0;!l&&u<e[I].length;)l=K(e[I][u++],Lt);else l=K(e[I],Lt);this.set(E,l)}break;case C:var d=e[L];if(d){var f=e[Ve];d==wt&&(f=parseInt(jt(f),10)>=13?`11`:`10`),this.set(T,d).set(O,f)}this.get(T)==wt&&e[A]==`Xbox`&&this.set(T,`Xbox`).set(O,void 0);break;case w:var ee=this.data,te=function(t){return ee[t].getItem().setCH(e).parseCH().get()};this.set(y,te(y)).set(b,te(b)).set(x,te(x)).set(S,te(S)).set(C,te(C))}return this};function J(e,t,n){if(typeof e===v.OBJECT?(Ot(e,!0)?(typeof t===v.OBJECT&&(n=t),t=e):(n=e,t=void 0),e=void 0):typeof e===v.STRING&&!Ot(t,!0)&&(n=t,t=void 0),n)if(typeof n.append===v.FUNCTION){var r={};n.forEach(function(e,t){r[String(t).toLowerCase()]=e}),n=r}else{var i={};for(var a in n)n.hasOwnProperty(a)&&(i[String(a).toLowerCase()]=n[a]);n=i}if(!(this instanceof J))return new J(e,t,n).getResult();var o=typeof e===v.STRING?e:n&&n[Me]?n[Me]:H&&H.userAgent?H.userAgent:_,s=new Ht(n,!0),c=t?Tt(zt,t):zt,l=function(e){return e==w?function(){return new q(e,o,c,s).set(`ua`,o).set(y,this.getBrowser()).set(b,this.getCPU()).set(x,this.getDevice()).set(S,this.getEngine()).set(C,this.getOS()).get()}:function(){return new q(e,o,c[e],s).parseUA().get()}};return G.call(this,[[`getBrowser`,l(y)],[`getCPU`,l(b)],[`getDevice`,l(x)],[`getEngine`,l(S)],[`getOS`,l(C)],[`getResult`,l(w)],[`getUA`,function(){return o}],[`setUA`,function(e){return kt(e)&&(o=Pt(e,je)),this}]]).setUA(o),this}J.VERSION=Ae,J.BROWSER=Et([T,O,Pe,E]),J.CPU=Et([k]),J.DEVICE=Et([A,D,E,Fe,j,N,M,P,Le]),J.ENGINE=J.OS=Et([T,O]);let Y=new J().getResult();var Ut=class{constructor(e){this.SDKVersion=`1.0.0`,this.config=e,this.sessionCreationCall=new De,this.playerInitCall=new Oe,this.setConfigParameters()}setConfigParameters(e=this.config){this.customData1=p.getCustomDataString(e.customData1),this.customData2=p.getCustomDataString(e.customData2),this.customData3=p.getCustomDataString(e.customData3),this.customData4=p.getCustomDataString(e.customData4),this.customData5=p.getCustomDataString(e.customData5),this.customData6=p.getCustomDataString(e.customData6),this.customData7=p.getCustomDataString(e.customData7),this.customData8=p.getCustomDataString(e.customData8),this.customData9=p.getCustomDataString(e.customData9),this.customData10=p.getCustomDataString(e.customData10),this.customPlayerIntegrationVersion=p.getCustomDataString(e.customPlayerIntegrationVersion),this.customPlayerName=p.getCustomDataString(e.customPlayerName),this.customPageType=p.getCustomDataString(e.customPageType),this.customUserId=p.getCustomDataString(e.userId),this.userName=p.getCustomDataString(e.userName),this.userEMail=p.getCustomDataString(e.userEMail),this.userPhone=p.getCustomDataString(e.userPhone),this.userProfileImage=p.getCustomDataString(e.userProfileImage),this.userAddressLine1=p.getCustomDataString(e.userAddressLine1),this.userAddressLine2=p.getCustomDataString(e.userAddressLine2),this.userCity=p.getCustomDataString(e.userCity),this.userState=p.getCustomDataString(e.userState),this.userCountry=p.getCustomDataString(e.userCountry),this.userZipcode=p.getCustomDataString(e.userZipcode),this.customContentType=p.getCustomDataString(e.customContentType),this.customVideoDurationMillis=p.getCustomDataString(e.customVideoDurationMillis),this.customEncodingVariant=p.getCustomDataString(e.customEncodingVariant),this.customVideoLanguage=p.getCustomDataString(e.customVideoLanguage),this.customVideoId=p.getCustomDataString(e.customVideoId),this.customVideoSeries=p.getCustomDataString(e.customVideoSeries),this.customVideoProducer=p.getCustomDataString(e.customVideoProducer),this.customVideoTitle=p.getCustomDataString(e.customVideoTitle),this.customVideoVariantName=p.getCustomDataString(e.customVideoVariantName),this.customVideoVariant=p.getCustomDataString(e.customVideoVariant),this.SDKVersion=`1.0.0`,this.experimentName=e.experimentName}updateCustomData(e){this.customData1=p.getCustomDataString(e.customData1),this.customData2=p.getCustomDataString(e.customData2),this.customData3=p.getCustomDataString(e.customData3),this.customData4=p.getCustomDataString(e.customData4),this.customData5=p.getCustomDataString(e.customData5),this.customData6=p.getCustomDataString(e.customData6),this.customData7=p.getCustomDataString(e.customData7),this.customData8=p.getCustomDataString(e.customData8),this.customData9=p.getCustomDataString(e.customData9),this.customData10=p.getCustomDataString(e.customData10)}updateCustomUserData(e){this.customUserId=p.getCustomDataString(e.userId),this.userName=p.getCustomDataString(e.userName),this.userEMail=p.getCustomDataString(e.userEMail),this.userPhone=p.getCustomDataString(e.userPhone),this.userProfileImage=p.getCustomDataString(e.userProfileImage),this.userAddressLine1=p.getCustomDataString(e.userAddressLine1),this.userAddressLine2=p.getCustomDataString(e.userAddressLine2),this.userCity=p.getCustomDataString(e.userCity),this.userState=p.getCustomDataString(e.userState),this.userCountry=p.getCustomDataString(e.userCountry),this.userZipcode=p.getCustomDataString(e.userZipcode)}updateCustomVideoData(e){this.customContentType=p.getCustomDataString(e.customContentType),this.customVideoDurationMillis=p.getCustomDataString(e.customVideoDurationMillis),this.customEncodingVariant=p.getCustomDataString(e.customEncodingVariant),this.customVideoLanguage=p.getCustomDataString(e.customVideoLanguage),this.customVideoId=p.getCustomDataString(e.customVideoId),this.customVideoSeries=p.getCustomDataString(e.customVideoSeries),this.customVideoProducer=p.getCustomDataString(e.customVideoProducer),this.customVideoTitle=p.getCustomDataString(e.customVideoTitle),this.customVideoVariantName=p.getCustomDataString(e.customVideoVariantName),this.customVideoVariant=p.getCustomDataString(e.customVideoVariant)}updateCustomPlayerData(e){this.customPlayerIntegrationVersion=p.getCustomDataString(e.customPlayerIntegrationVersion),this.customPlayerName=p.getCustomDataString(e.customPlayerName),this.customPageType=p.getCustomDataString(e.customPageType)}setUserId(e=!1,t=null){if(t){this.userId=t;return}if(e){this.userId=p.uuidv4();return}let n=p.getCookie(`gumlet_user_id`);!n||n===``?this.userId=p.setCookie(`gumlet_user_id`,720*60):this.userId=n}setSessionId(e=!1,t=null,n=!0){if(t){this.sessionId=t,this.setSessionData(),n&&this.sessionCreationCall.sendRequest(this.sessionData,p.noOp);return}if(e){this.sessionId=p.uuidv4();return}let r=p.getCookie(`gumlet_session_id`);!r||r===``?(this.sessionId=p.setCookie(`gumlet_session_id`,30),this.setSessionData(),this.sessionCreationCall.sendRequest(this.sessionData,p.noOp)):(this.sessionId=r,this.setSessionData())}setPlayerInstanceId(e){this.playerInstanceId=e?e():p.uuidv4(),this.setPlayerData()}setPlaybackId(e){this.playbackId=e?e():p.uuidv4()}resetSessionExpiry(){this.config.test||this.config.sessionID||(p.setCookie(`gumlet_session_id`,30,this.sessionId),p.setCookie(`gumlet_user_id`,720*60,this.userId))}setSessionData(){if(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},this.config.deviceData){let e=this.config.deviceData;this.sessionData.meta_device_name=e.meta_device_name,this.sessionData.meta_device_manufacturer=e.meta_device_manufacturer,this.sessionData.meta_operating_system_version=e.meta_operating_system_version,this.sessionData.meta_operating_system=e.meta_operating_system,this.sessionData.meta_browser=e.meta_browser,this.sessionData.meta_device_display_dpr=e.meta_device_display_dpr,this.sessionData.meta_browser_version=e.meta_browser_version,this.sessionData.meta_device_category=e.meta_device_category,this.sessionData.meta_device_architecture=e.meta_device_architecture,this.sessionData.meta_device_display_width=e.meta_device_display_width,this.sessionData.meta_device_display_height=e.meta_device_display_height,this.sessionData.meta_device_is_touchscreen=e.meta_device_is_touchscreen,this.sessionData.meta_browser_language=e.meta_browser_language}else this.sessionData.meta_device_name=Y.device.model,this.sessionData.meta_device_manufacturer=Y.device.vendor,this.sessionData.meta_operating_system_version=Y.os.version,this.sessionData.meta_operating_system=Y.os.name,this.sessionData.meta_browser=Y.browser.name,this.sessionData.meta_browser_version=Y.browser.version,this.sessionData.meta_device_category=ke(),this.sessionData.meta_device_architecture=Y.cpu.architecture,typeof window<`u`&&(this.sessionData.meta_device_display_dpr=parseInt(String(window.devicePixelRatio),10),this.sessionData.meta_device_display_width=window.screen.width,this.sessionData.meta_device_display_height=window.screen.height,this.sessionData.meta_browser_language=navigator?navigator.language||navigator.userLanguage:``,`ontouchstart`in document.documentElement&&(this.sessionData.meta_device_is_touchscreen=`true`))}setPlayerData(e){if(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){let e=this.config.playerData||{};this.playerData.player_preload=e.player_preload,this.playerData.player_autoplay=e.player_autoplay,this.playerData.player_software_version=e.player_software_version,this.playerData.player_integration_version=e.player_integration_version,this.playerData.player_name=e.player_name,this.playerData.player_language_code=e.player_language_code,this.playerData.player_software=e.player_software,this.playerData.meta_page_url=e.meta_page_url,this.playerData.meta_page_type=e.meta_page_type,this.playerData.player_height_pixels=e.player_height_pixels,this.playerData.player_width_pixels=e.player_width_pixels}e&&p.validNumber(e.videoWindowHeight)&&(this.playerData.player_height_pixels=e.videoWindowHeight),e&&p.validNumber(e.videoWindowWidth)&&(this.playerData.player_width_pixels=e.videoWindowWidth),e&&p.validBoolean(e.autoplay)&&(this.playerData.player_autoplay=e.autoplay),e&&p.validBoolean(e.preload)&&(this.playerData.player_preload=e.preload),e&&p.validString(e.version)&&(this.playerData.player_software_version=e.version),e&&p.validString(e.audioLanguage)&&(this.playerData.player_language_code=e.audioLanguage),e&&p.validString(e.playerSoftware)&&(this.playerData.player_software=e.playerSoftware)}},Wt=class{constructor(e,t){this.sample={},this.currentTime=0,this.isMuted=!1,this.orientation=`undetected`,this.playbackWatchTime=0,this.config=e,this.session=t;try{this.orientation=screen.orientation.type.match(/\w+/)[0],screen.orientation.addEventListener(`change`,()=>{this.orientation=screen.orientation.type.match(/\w+/)[0]})}catch{this.orientation=`undetected`}}setDuration(e){}setPlaybackWatchTime(e){this.playbackWatchTime=e}getPlaybackWatchTime(){return this.playbackWatchTime}setVideoData(e){e&&p.validNumber(e.duration)&&(this.videoDuration=p.calculateTime(e.duration)),e&&p.validString(e.streamType)&&(this.videoSourceType=e.streamType,e.streamType===`dash`&&p.validString(e.mpdUrl)?(this.videoSourceUrl=e.mpdUrl,this.videoSourceHostname=new URL(this.videoSourceUrl).hostname):e.streamType===`hls`&&p.validString(e.m3u8Url)?(this.videoSourceUrl=e.m3u8Url,this.videoSourceHostname=new URL(this.videoSourceUrl).hostname):e.streamType===`hls`&&p.validString(e.streamUrl)?(this.videoSourceUrl=e.streamUrl,this.videoSourceHostname=new URL(this.videoSourceUrl).hostname):e.streamType===`progressive`&&p.validString(e.progUrl)?(this.videoSourceUrl=e.progUrl,this.videoSourceHostname=new URL(this.videoSourceUrl).hostname):e?.streamUrl&&(this.videoSourceUrl=e.streamUrl,this.videoSourceHostname=new URL(this.videoSourceUrl).hostname)),e?.streamUrl&&(this.videoSourceUrl=e.streamUrl),e?.sourceHostName&&(this.videoSourceHostname=e.sourceHostName),e?.muted&&(this.isMuted=e.muted),e?.currentVideoData?.height&&p.validNumber(e.currentVideoData.height)&&e.currentVideoData.height>0&&(this.videoHeightPixels=e.currentVideoData.height),e?.currentVideoData?.width&&p.validNumber(e.currentVideoData.width)&&e.currentVideoData.width>0&&(this.videoWidthPixels=e.currentVideoData.width),e?.currentVideoData?.bitrate&&p.validNumber(e.currentVideoData.bitrate)&&e.currentVideoData.bitrate>-1&&(this.videoBitrate=e.currentVideoData.bitrate/1e6),e?.currentVideoData?.audioCodec&&p.validString(e.currentVideoData.audioCodec)&&e.currentVideoData.audioCodec.length>0&&(this.audioCodec=e.currentVideoData.audioCodec),e?.currentVideoData&&p.validString(e.currentVideoData.videoCodec)&&e.currentVideoData.videoCodec.length>0&&(this.videoCodec=e.currentVideoData.videoCodec);let t=this.session,n=0;if(this.videoHeightPixels&&t.playerData?.player_height_pixels&&t.sessionData?.meta_device_display_dpr?n=t.playerData.player_height_pixels*t.sessionData.meta_device_display_dpr/this.videoHeightPixels-1:(this.upscalePercentage=void 0,this.downscalePercentage=void 0),this.videoHeightPixels&&t.playerData?.player_height_pixels&&t.sessionData?.meta_device_display_dpr&&(n>0?(this.upscalePercentage=n*100,this.downscalePercentage=0):n<0?(this.upscalePercentage=0,this.downscalePercentage=n*100*-1):(this.upscalePercentage=0,this.downscalePercentage=0)),this.videoSourceUrl)try{let e=new URL(this.videoSourceUrl);e.hostname===`video.gumlet.io`&&!t.customVideoId&&(t.customVideoId=e.pathname.split(`/`)[2])}catch{}}setPlaybackSettingsFromLoadedEvent(e){e&&p.validNumber(e.currentTime)&&(this.currentTime=p.calculateTime(e.currentTime)),e&&p.validBoolean(e.isFullScreen)&&(this.isFullScreen=e.isFullScreen),e&&p.validBoolean(e.isCasting)&&(this.isCasting=e.isCasting)}setupSample(){let e=this.session;this.sample={property_id:e.propertyId,session_id:e.sessionId,user_id:e.userId,player_instance_id:e.playerInstanceId,playback_id:e.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:e.customContentType,custom_video_duration_millis:e.customVideoDurationMillis,custom_encoding_variant:e.customEncodingVariant,custom_video_language:e.customVideoLanguage,custom_video_id:e.customVideoId,custom_video_series:e.customVideoSeries,custom_video_producer:e.customVideoProducer,custom_video_title:e.customVideoTitle,custom_video_variant_name:e.customVideoVariantName,custom_video_variant:e.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:e.customData1,custom_data_2:e.customData2,custom_data_3:e.customData3,custom_data_4:e.customData4,custom_data_5:e.customData5,custom_data_6:e.customData6,custom_data_7:e.customData7,custom_data_8:e.customData8,custom_data_9:e.customData9,custom_data_10:e.customData10,custom_event_data:void 0,playback_watch_time:void 0}}getSample(e=null,t={}){let n=this.session,r=this.sample;if(r.event=e,r.event_id=n.config?.getUUID?n.config.getUUID():p.uuidv4(),r.custom_data_1=n.customData1,r.custom_data_2=n.customData2,r.custom_data_3=n.customData3,r.custom_data_4=n.customData4,r.custom_data_5=n.customData5,r.custom_data_6=n.customData6,r.custom_data_7=n.customData7,r.custom_data_8=n.customData8,r.custom_data_9=n.customData9,r.custom_data_10=n.customData10,r.custom_content_type=n.customContentType,r.custom_video_duration_millis=n.customVideoDurationMillis,r.custom_encoding_variant=n.customEncodingVariant,r.custom_video_language=n.customVideoLanguage,r.custom_video_id=n.customVideoId,r.custom_video_series=n.customVideoSeries,r.custom_video_producer=n.customVideoProducer,r.custom_video_title=n.customVideoTitle,r.custom_video_variant_name=n.customVideoVariantName,r.custom_video_variant=n.customVideoVariant,r.fullscreen=this.isFullScreen,r.muted=this.isMuted,r.video_width_pixels=this.videoWidthPixels,r.video_height_pixels=this.videoHeightPixels,r.video_total_duration_millis=this.videoDuration,r.bitrate=this.videoBitrate,r.audio_codec=this.audioCodec,r.video_codec=this.videoCodec,r.orientation=this.orientation,r.playback_time_instant_millis=this.currentTime,r.video_source_type=this.videoSourceType,r.video_source_url=this.videoSourceUrl,r.video_upscale_percentage=this.upscalePercentage,r.video_downscale_percentage=this.downscalePercentage,r.video_source_hostname=this.videoSourceHostname,r.custom_event_data=void 0,r.playback_watch_time=this.playbackWatchTime,Object.keys(t).forEach(e=>{r[e]=t[e]}),typeof window<`u`&&window.parent!==void 0&&window.navigator)try{typeof window.navigator.getBattery==`function`&&window.navigator.getBattery().then(e=>{e&&(r.battery_level_percentage=e.level*100,r.battery_charging=e.charging)})}catch{}return r}};xe();var Gt=class{constructor(e,t){this.licensing=`granted`,this.analyticsCall=e,this.sampleBuilder=t}sendRequest(e,t={}){let n=this.sampleBuilder.getSample(e,t);if(e!==g.END){if(n.playback_time_instant_millis&&n.video_total_duration_millis&&n.playback_time_instant_millis>n.video_total_duration_millis)return}else n.video_total_duration_millis&&(n.playback_time_instant_millis=Math.min(n.playback_time_instant_millis??0,n.video_total_duration_millis));this.analyticsCall.sendRequest(n,p.noOp)}sendRequestAsync(e,t={}){return new Promise((n,r)=>{let i=this.sampleBuilder.getSample(e,t);if(i.playback_time_instant_millis&&i.video_total_duration_millis&&i.playback_time_instant_millis>i.video_total_duration_millis){n(406);return}this.analyticsCall.sendRequestAsync(i).then(e=>n(e)).catch(e=>r(e))})}sendAndClear(e=null,t={}){if(!e){h.log(`event null passed not hitting the ingestion API`);return}this.sampleBuilder.videoDuration&&this.sampleBuilder.videoDuration>864e5||this.sendRequest(e,t)}sendAndClearAsync(e=null,t={}){return new Promise((n,r)=>{if(!e){h.log(`event null passed not hitting the ingestion API`),r(`event null passed not hitting the ingestion API`);return}this.sendRequestAsync(e,t).then(e=>n(e)).catch(e=>r(e))})}sendUnload(){if(this.licensing===`denied`)return;let e=this.sampleBuilder.sample;if(navigator.sendBeacon===void 0){this.sendSynchronous();return}fetch(this.analyticsCall.getAnalyticsServerUrl(),{method:`POST`,body:JSON.stringify(e),headers:{"Content-Type":`application/json`}}).then(e=>{e.ok||this.sendSynchronous()}).catch(()=>{this.sendSynchronous()})}sendSynchronous(){this.licensing!==`denied`&&this.analyticsCall.sendRequestSynchronous(this.sampleBuilder.sample,p.noOp)}},Kt=c(((e,t)=>{(function(n,r){typeof e==`object`&&typeof t==`object`?t.exports=r():typeof define==`function`&&define.amd?define(`StateMachine`,[],r):typeof e==`object`?e.StateMachine=r():n.StateMachine=r()})(e,function(){return(function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.i=function(e){return e},n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,`a`,t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p=``,n(n.s=5)})([(function(e,t,n){"use strict";e.exports=function(e,t){var n,r,i;for(n=1;n<arguments.length;n++)for(i in r=arguments[n],r)r.hasOwnProperty(i)&&(e[i]=r[i]);return e}}),(function(e,t,n){"use strict";var r=n(0);e.exports={build:function(e,t){var n,i,a,o=t.plugins;for(n=0,i=o.length;n<i;n++)a=o[n],a.methods&&r(e,a.methods),a.properties&&Object.defineProperties(e,a.properties)},hook:function(e,t,n){var r,i,a,o,s=e.config.plugins,c=[e.context];for(n&&(c=c.concat(n)),r=0,i=s.length;r<i;r++)o=s[r],a=s[r][t],a&&a.apply(o,c)}}}),(function(e,t,n){"use strict";function r(e){if(e.length===0)return e;var t,n,r=e.split(/[_-]/);if(r.length===1&&r[0][0].toLowerCase()===r[0][0])return e;for(n=r[0].toLowerCase(),t=1;t<r.length;t++)n=n+r[t].charAt(0).toUpperCase()+r[t].substring(1).toLowerCase();return n}r.prepended=function(e,t){return t=r(t),e+t[0].toUpperCase()+t.substring(1)},e.exports=r}),(function(e,t,n){"use strict";var r=n(0),i=n(2);function a(e,t){e||={},this.options=e,this.defaults=t.defaults,this.states=[],this.transitions=[],this.map={},this.lifecycle=this.configureLifecycle(),this.init=this.configureInitTransition(e.init),this.data=this.configureData(e.data),this.methods=this.configureMethods(e.methods),this.map[this.defaults.wildcard]={},this.configureTransitions(e.transitions||[]),this.plugins=this.configurePlugins(e.plugins,t.plugin)}r(a.prototype,{addState:function(e){this.map[e]||(this.states.push(e),this.addStateLifecycleNames(e),this.map[e]={})},addStateLifecycleNames:function(e){this.lifecycle.onEnter[e]=i.prepended(`onEnter`,e),this.lifecycle.onLeave[e]=i.prepended(`onLeave`,e),this.lifecycle.on[e]=i.prepended(`on`,e)},addTransition:function(e){this.transitions.indexOf(e)<0&&(this.transitions.push(e),this.addTransitionLifecycleNames(e))},addTransitionLifecycleNames:function(e){this.lifecycle.onBefore[e]=i.prepended(`onBefore`,e),this.lifecycle.onAfter[e]=i.prepended(`onAfter`,e),this.lifecycle.on[e]=i.prepended(`on`,e)},mapTransition:function(e){var t=e.name,n=e.from,r=e.to;return this.addState(n),typeof r!=`function`&&this.addState(r),this.addTransition(t),this.map[n][t]=e,e},configureLifecycle:function(){return{onBefore:{transition:`onBeforeTransition`},onAfter:{transition:`onAfterTransition`},onEnter:{state:`onEnterState`},onLeave:{state:`onLeaveState`},on:{transition:`onTransition`}}},configureInitTransition:function(e){return typeof e==`string`?this.mapTransition(r({},this.defaults.init,{to:e,active:!0})):typeof e==`object`?this.mapTransition(r({},this.defaults.init,e,{active:!0})):(this.addState(this.defaults.init.from),this.defaults.init)},configureData:function(e){return typeof e==`function`?e:typeof e==`object`?function(){return e}:function(){return{}}},configureMethods:function(e){return e||{}},configurePlugins:function(e,t){e||=[];var n,r,i;for(n=0,r=e.length;n<r;n++)i=e[n],typeof i==`function`&&(e[n]=i=i()),i.configure&&i.configure(this);return e},configureTransitions:function(e){var t,n,r,i,a,o=this.defaults.wildcard;for(n=0;n<e.length;n++)for(r=e[n],i=Array.isArray(r.from)?r.from:[r.from||o],a=r.to||o,t=0;t<i.length;t++)this.mapTransition({name:r.name,from:i[t],to:a})},transitionFor:function(e,t){var n=this.defaults.wildcard;return this.map[e][t]||this.map[n][t]},transitionsFor:function(e){var t=this.defaults.wildcard;return Object.keys(this.map[e]).concat(Object.keys(this.map[t]))},allStates:function(){return this.states},allTransitions:function(){return this.transitions}}),e.exports=a}),(function(e,t,n){var r=n(0),i=n(6),a=n(1),o=[null,[]];function s(e,t){this.context=e,this.config=t,this.state=t.init.from,this.observers=[e]}r(s.prototype,{init:function(e){if(r(this.context,this.config.data.apply(this.context,e)),a.hook(this,`init`),this.config.init.active)return this.fire(this.config.init.name,[])},is:function(e){return Array.isArray(e)?e.indexOf(this.state)>=0:this.state===e},isPending:function(){return this.pending},can:function(e){return!this.isPending()&&!!this.seek(e)},cannot:function(e){return!this.can(e)},allStates:function(){return this.config.allStates()},allTransitions:function(){return this.config.allTransitions()},transitions:function(){return this.config.transitionsFor(this.state)},seek:function(e,t){var n=this.config.defaults.wildcard,r=this.config.transitionFor(this.state,e),i=r&&r.to;return typeof i==`function`?i.apply(this.context,t):i===n?this.state:i},fire:function(e,t){return this.transit(e,this.state,this.seek(e,t),t)},transit:function(e,t,n,r){var i=this.config.lifecycle,a=this.config.options.observeUnchangedState||t!==n;return n?this.isPending()?this.context.onPendingTransition(e,t,n):(this.config.addState(n),this.beginTransit(),r.unshift({transition:e,from:t,to:n,fsm:this.context}),this.observeEvents([this.observersForEvent(i.onBefore.transition),this.observersForEvent(i.onBefore[e]),a?this.observersForEvent(i.onLeave.state):o,a?this.observersForEvent(i.onLeave[t]):o,this.observersForEvent(i.on.transition),a?[`doTransit`,[this]]:o,a?this.observersForEvent(i.onEnter.state):o,a?this.observersForEvent(i.onEnter[n]):o,a?this.observersForEvent(i.on[n]):o,this.observersForEvent(i.onAfter.transition),this.observersForEvent(i.onAfter[e]),this.observersForEvent(i.on[e])],r)):this.context.onInvalidTransition(e,t,n)},beginTransit:function(){this.pending=!0},endTransit:function(e){return this.pending=!1,e},failTransit:function(e){throw this.pending=!1,e},doTransit:function(e){this.state=e.to},observe:function(e){if(e.length===2){var t={};t[e[0]]=e[1],this.observers.push(t)}else this.observers.push(e[0])},observersForEvent:function(e){for(var t=0,n=this.observers.length,r,i=[];t<n;t++)r=this.observers[t],r[e]&&i.push(r);return[e,i,!0]},observeEvents:function(e,t,n,r){if(e.length===0)return this.endTransit(r===void 0?!0:r);var i=e[0][0],o=e[0][1],s=e[0][2];if(t[0].event=i,i&&s&&i!==n&&a.hook(this,`lifecycle`,t),o.length===0)return e.shift(),this.observeEvents(e,t,i,r);var c=o.shift(),l=c[i].apply(c,t);return l&&typeof l.then==`function`?l.then(this.observeEvents.bind(this,e,t,i)).catch(this.failTransit.bind(this)):l===!1?this.endTransit(!1):this.observeEvents(e,t,i,l)},onInvalidTransition:function(e,t,n){throw new i(`transition is invalid in current state`,e,t,n,this.state)},onPendingTransition:function(e,t,n){throw new i(`transition is invalid while previous transition is still in progress`,e,t,n,this.state)}}),e.exports=s}),(function(e,t,n){"use strict";var r=n(0),i=n(2),a=n(1),o=n(3),s=n(4),c={is:function(e){return this._fsm.is(e)},can:function(e){return this._fsm.can(e)},cannot:function(e){return this._fsm.cannot(e)},observe:function(){return this._fsm.observe(arguments)},transitions:function(){return this._fsm.transitions()},allTransitions:function(){return this._fsm.allTransitions()},allStates:function(){return this._fsm.allStates()},onInvalidTransition:function(e,t,n){return this._fsm.onInvalidTransition(e,t,n)},onPendingTransition:function(e,t,n){return this._fsm.onPendingTransition(e,t,n)}},l={state:{configurable:!1,enumerable:!0,get:function(){return this._fsm.state},set:function(e){throw Error(`use transitions to change state`)}}};function u(e){return f(this||{},e)}function d(){var e,t;typeof arguments[0]==`function`?(e=arguments[0],t=arguments[1]||{}):(e=function(){this._fsm.apply(this,arguments)},t=arguments[0]||{});var n=new o(t,u);return ee(e.prototype,n),e.prototype._fsm.config=n,e}function f(e,t){return ee(e,new o(t,u)),e._fsm(),e}function ee(e,t){if(typeof e!=`object`||Array.isArray(e))throw Error(`StateMachine can only be applied to objects`);a.build(e,t),Object.defineProperties(e,l),r(e,c),r(e,t.methods),t.allTransitions().forEach(function(t){e[i(t)]=function(){return this._fsm.fire(t,[].slice.call(arguments))}}),e._fsm=function(){this._fsm=new s(this,t),this._fsm.init(arguments)}}u.version=`3.0.1`,u.factory=d,u.apply=f,u.defaults={wildcard:`*`,init:{name:`init`,from:`none`}},e.exports=u}),(function(e,t,n){"use strict";e.exports=function(e,t,n,r,i){this.message=e,this.transition=t,this.from=n,this.to=r,this.current=i}})])})})),X,qt=s((()=>{X={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`,NON_FATAL_ERROR:`playerNonFatalError`,PLAYBACK_FINISHED:`end`,SCREEN_RESIZE:`resize`,UNLOAD:`unload`,END:`end`,METADATA_LOADED:`metadataLoaded`,SOURCE_UNLOADED:`sourceUnloaded`,PLAYBACK_PLAYING:`playback_playing`}})),Jt=l({GumletStateMachine:()=>Xt}),Yt,Xt,Zt=s((()=>{Yt=d(Kt(),1),xe(),qt(),m(),Xt=class{constructor(e,t={}){this.previousRecordTime=0,this.playbackWatchTime=0,this.lastPlayHeadDuration=0,this.onEnterStateTimestamp=0,this.heartbeatTimestamp=0,this.seekStartedAt=null,this.seekedFrom=0,this.seekedTimestamp=0,this.playTimeStamp=null,this.startupBufferingPending=!1,this.pendingErrorRecovery_=!1,this.States={SETUP:`SETUP`,STARTUP:`STARTUP`,READY:`READY`,PLAYING:`PLAYING`,REBUFFERING:`REBUFFERING`,PAUSE:`PAUSE`,PAUSED_SEEKING:`PAUSED_SEEKING`,END:`END`,ERROR:`ERROR`,CASTING:`CASTING`},this.callbacks=e,this.opts=t,this.createStateMachine()}callEvent(e,t,n){this.fsm.can(e)?this.fsm[e](n,t):h.log(`Ignored Event: ${e}`)}updateMetadata(e){this.callbacks.updateSample(e)}allStates(){return Object.values(this.States)}createStateMachine(){let e=this,t=this.States,n=this.opts,r=[X.PLAY,X.PAUSE,X.SEEK,X.SEEKED,X.PLAYBACK_PLAYING,X.PLAYBACK_FINISHED,X.READY,X.SCREEN_RESIZE,X.END,X.ERROR,X.NON_FATAL_ERROR,X.UN_MUTE,X.MUTE];this.fsm=new Yt.default({init:t.SETUP,transitions:[{name:X.TIMECHANGED,from:t.SETUP,to:t.SETUP},{name:X.READY,from:[t.SETUP,t.ERROR],to:t.READY},{name:X.SOURCE_LOADED,from:t.SETUP,to:t.SETUP},{name:X.PLAY,from:t.READY,to:t.STARTUP},{name:X.SOURCE_LOADED,from:t.READY,to:t.READY},{name:X.SEEK,from:t.READY,to:t.READY},{name:X.SEEKED,from:t.READY,to:t.READY},{name:X.MUTE,from:t.READY,to:t.READY},{name:X.UN_MUTE,from:t.READY,to:t.READY},{name:X.VIDEO_CHANGE,from:t.READY,to:t.READY},{name:X.AUDIO_CHANGE,from:t.READY,to:t.READY},{name:X.TIMECHANGED,from:t.STARTUP,to:t.PLAYING},{name:X.START_BUFFERING,from:t.STARTUP,to:t.STARTUP},{name:X.END_BUFFERING,from:t.STARTUP,to:t.STARTUP},{name:X.VIDEO_CHANGE,from:t.STARTUP,to:t.STARTUP},{name:X.AUDIO_CHANGE,from:t.STARTUP,to:t.STARTUP},{name:X.SEEK,from:t.STARTUP,to:t.STARTUP},{name:X.SEEKED,from:t.STARTUP,to:t.STARTUP},{name:X.SOURCE_LOADED,from:t.STARTUP,to:t.STARTUP},{name:X.END,from:t.STARTUP,to:t.END},{name:X.TIMECHANGED,from:t.PLAYING,to:t.PLAYING},{name:X.END_BUFFERING,from:t.PLAYING,to:t.PLAYING},{name:X.SEEKED,from:t.PLAYING,to:t.PLAYING},{name:X.SOURCE_LOADED,from:t.PLAYING,to:t.PLAYING},{name:X.VIDEO_CHANGE,from:t.PLAYING,to:t.PLAYING},{name:X.AUDIO_CHANGE,from:t.PLAYING,to:t.PLAYING},{name:X.MUTE,from:t.PLAYING,to:t.PLAYING},{name:X.UN_MUTE,from:t.PLAYING,to:t.PLAYING},{name:X.PAUSE,from:t.PLAYING,to:t.PAUSE},{name:X.START_BUFFERING,from:t.PLAYING,to:t.REBUFFERING},{name:X.END,from:t.PLAYING,to:t.END},{name:X.START_BUFFERING,from:t.REBUFFERING,to:t.REBUFFERING},{name:X.VIDEO_CHANGE,from:t.REBUFFERING,to:t.REBUFFERING},{name:X.AUDIO_CHANGE,from:t.REBUFFERING,to:t.REBUFFERING},{name:X.PLAY,from:t.REBUFFERING,to:t.PLAYING},{name:X.TIMECHANGED,from:t.REBUFFERING,to:t.PLAYING},{name:X.PAUSE,from:t.REBUFFERING,to:t.PAUSE},{name:X.END,from:t.REBUFFERING,to:t.END},{name:X.TIMECHANGED,from:t.PAUSE,to:t.PAUSE},{name:X.SEEKED,from:t.PAUSE,to:t.PAUSE},{name:X.VIDEO_CHANGE,from:t.PAUSE,to:t.PAUSE},{name:X.AUDIO_CHANGE,from:t.PAUSE,to:t.PAUSE},{name:X.MUTE,from:t.PAUSE,to:t.PAUSE},{name:X.UN_MUTE,from:t.PAUSE,to:t.PAUSE},{name:X.PLAY,from:t.PAUSE,to:t.PLAYING},{name:X.SEEK,from:t.PAUSE,to:t.PAUSED_SEEKING},{name:X.END,from:t.PAUSE,to:t.END},{name:X.SEEK,from:t.PAUSED_SEEKING,to:t.PAUSED_SEEKING},{name:X.AUDIO_CHANGE,from:t.PAUSED_SEEKING,to:t.PAUSED_SEEKING},{name:X.VIDEO_CHANGE,from:t.PAUSED_SEEKING,to:t.PAUSED_SEEKING},{name:X.START_BUFFERING,from:t.PAUSED_SEEKING,to:t.PAUSED_SEEKING},{name:X.END_BUFFERING,from:t.PAUSED_SEEKING,to:t.PAUSED_SEEKING},{name:X.PLAY,from:t.PAUSED_SEEKING,to:t.PAUSED_SEEKING},{name:X.SEEKED,from:t.PAUSED_SEEKING,to:t.PAUSE},{name:X.TIMECHANGED,from:t.PAUSED_SEEKING,to:t.PLAYING},{name:X.PAUSE,from:t.PAUSED_SEEKING,to:t.PAUSE},{name:X.END,from:t.PAUSED_SEEKING,to:t.END},{name:X.SEEK,from:t.END,to:t.END},{name:X.SEEKED,from:t.END,to:t.END},{name:X.TIMECHANGED,from:t.END,to:t.END},{name:X.END_BUFFERING,from:t.END,to:t.END},{name:X.START_BUFFERING,from:t.END,to:t.END},{name:X.END,from:t.END,to:t.END},{name:X.PLAY,from:t.END,to:t.PLAYING},{name:X.ERROR,from:this.allStates(),to:t.ERROR},{name:X.PAUSE,from:t.ERROR,to:t.ERROR},{name:X.PLAY,from:t.ERROR,to:t.PLAYING},{name:X.TIMECHANGED,from:t.ERROR,to:t.PLAYING},{name:X.SOURCE_LOADED,from:t.ERROR,to:t.ERROR},{name:X.METADATA_LOADED,from:t.ERROR,to:t.ERROR},{name:X.START_BUFFERING,from:t.ERROR,to:t.REBUFFERING},{name:X.SEEK,from:t.ERROR,to:t.ERROR},{name:X.SEEKED,from:t.ERROR,to:t.ERROR},{name:X.MUTE,from:t.ERROR,to:t.ERROR},{name:X.UN_MUTE,from:t.ERROR,to:t.ERROR},{name:X.VIDEO_CHANGE,from:t.ERROR,to:t.ERROR},{name:X.AUDIO_CHANGE,from:t.ERROR,to:t.ERROR},{name:X.END_BUFFERING,from:t.ERROR,to:t.ERROR},{name:X.END,from:t.ERROR,to:t.END},...this.allStates().map(e=>({name:X.NON_FATAL_ERROR,from:e,to:e})),{name:X.UNLOAD,from:this.allStates(),to:t.END},{name:X.START_CAST,from:[t.READY,t.PAUSE],to:t.CASTING},{name:X.PAUSE,from:t.CASTING,to:t.CASTING},{name:X.PLAY,from:t.CASTING,to:t.CASTING},{name:X.TIMECHANGED,from:t.CASTING,to:t.CASTING},{name:X.MUTE,from:t.CASTING,to:t.CASTING},{name:X.SEEK,from:t.CASTING,to:t.CASTING},{name:X.SEEKED,from:t.CASTING,to:t.CASTING},{name:X.END_CAST,from:t.CASTING,to:t.READY}],methods:{onBeforeTransition(n,i,a){e.callbacks.playbackWatchTime(e.playbackWatchTime),r.includes(n.transition)&&(n.transition===X.PLAYBACK_FINISHED&&(e.previousRecordTime=0),a&&(e.previousRecordTime=a.currentTime)),n.transition===X.SEEK&&n.from===t.PAUSE&&(e.seekedFrom=e.lastPlayHeadDuration),a&&n.transition!==X.SOURCE_LOADED&&(e.lastPlayHeadDuration=a.currentTime*1e3)},onLeaveState(n,r,i){if(!r)return;let a=r-e.onEnterStateTimestamp;i&&n.to!==t.PAUSED_SEEKING&&(h.log(`Setting video time end to ${i.currentTime}, going to ${n.to}`),e.callbacks.setVideoTimeEndFromEvent(i));let o=n.from.toLowerCase();if(n.from===t.PAUSED_SEEKING){let a=r-(e.seekStartedAt??r);e.seekStartedAt=null,e.callbacks.playback_seeked(e.seekedFrom,i.currentTime*1e3,a,n.to),e.callbacks.heartbeat(r,t.PAUSE.toLowerCase(),i),h.log(`Seek was ${a}ms`)}else n.transition===X.UNLOAD&&n.from===t.PLAYING?e.callbacks.playingAndBye(a,o,i):n.from===t.PAUSE&&n.to!==t.PAUSED_SEEKING&&n.to!==t.PLAYING&&(e.callbacks.setVideoTimeStartFromEvent(n.transition),e.callbacks.pause(a,o,i),e.callbacks.heartbeat(r,o,i))},onAfterTransition(t,n,r){e.callbacks.resetSessionExpiry(),t.transition===X.VIDEO_CHANGE?e.callbacks.videoChange(r):t.transition===X.AUDIO_CHANGE?e.callbacks.audioChange(r):t.transition===X.MUTE?(h.log(`Setting sample to muted`),e.callbacks.mute(n,r)):t.transition===X.UN_MUTE&&(h.log(`Setting sample to unmuted`),e.callbacks.unMute(n,r))},onEnterState(i,a,o){i.to===t.ERROR&&(e.pendingErrorRecovery_=!1),e.callbacks.playbackWatchTime(e.playbackWatchTime),r.includes(i.transition)&&o&&(e.previousRecordTime=o.currentTime),i.transition!==X.NON_FATAL_ERROR&&(i.from===`none`&&n.starttime?e.onEnterStateTimestamp=n.starttime:e.onEnterStateTimestamp=a||Date.now()),(i.to===t.PLAYING&&(i.from===t.STARTUP||i.from===t.PAUSE||i.from===t.REBUFFERING||i.from===t.PAUSED_SEEKING||i.from===t.ERROR)||i.from===`none`&&i.to===t.SETUP)&&(e.heartbeatTimestamp=i.from===`none`&&n.starttime?n.starttime:a||Date.now()),o&&i.to!==t.PAUSED_SEEKING&&e.callbacks.setVideoTimeStartFromEvent(o)},onEnterSetup(r,i,a){r.from===`none`&&e.callbacks.setup(i,t.SETUP,a,n)},onEnterReady(n,r,i){n.from===t.SETUP&&e.callbacks.ready(r,t.READY,i)},onEnterStartup(n,r,i){n.transition===X.PLAY&&(e.playTimeStamp=new Date,e.callbacks.first_play(r,t.STARTUP,i))},onEnterPlaying(n,r,i){n.transition===X.PLAY&&n.from===t.PAUSE?(e.callbacks.play(r,t.PLAYING,i),e.callbacks.playing(r,t.PLAYING,i),e.callbacks.heartbeat(r,t.PLAYING,i)):n.from===t.STARTUP?(e.startupBufferingPending&&(e.startupBufferingPending=!1,e.callbacks.start_rebuffer(r,t.REBUFFERING,i),e.callbacks.end_rebuffer(r,t.REBUFFERING,i)),e.callbacks.playing(r,t.PLAYING,i),e.callbacks.playback_started(i)):n.from===t.REBUFFERING?(e.callbacks.end_rebuffer(r,t.REBUFFERING,i),e.pendingErrorRecovery_&&(e.pendingErrorRecovery_=!1,e.callbacks.error_recovered(r,t.ERROR,i))):n.from===t.ERROR&&e.callbacks.error_recovered(r,t.ERROR,i)},onEnterPause(n,r,i){n.from===t.PLAYING&&(e.callbacks.pause(r,t.PAUSE,i),e.callbacks.heartbeat(r,t.PAUSE,i))},onEnterRebuffering(n,r,i){n.transition===X.START_BUFFERING&&(e.callbacks.start_rebuffer(r,t.REBUFFERING,i),n.from===t.ERROR&&(e.pendingErrorRecovery_=!0))},onBeforeStartBuffering(n,r,i){n.from===t.STARTUP&&(e.startupBufferingPending=!0)},onEnterEnd(n,r,i){e.callbacks.end(r,t.END,i),e.callbacks.heartbeat(r,t.END,i)},onBeforeSourceLoaded(n,r,i){let a=n.from===t.PLAYING&&e.playTimeStamp?Date.now()-e.playTimeStamp.getTime():null;e.callbacks.loaded(r,t.READY,i,a)},onSeek(t,n,r){r&&(e.previousRecordTime=r.currentTime),e.callbacks.playbackWatchTime(e.playbackWatchTime),e.seekStartedAt=e.seekStartedAt??n},onSeeked(t,n,r){r&&(e.previousRecordTime=r.currentTime),e.callbacks.playbackWatchTime(e.playbackWatchTime),e.seekedTimestamp=n},onTimechanged(t,n,r){e.callbacks.playbackWatchTime(e.playbackWatchTime);let i=r.currentTime-e.previousRecordTime;i>0&&i<5&&(e.playbackWatchTime+=Math.round(i*1e3),e.previousRecordTime=r.currentTime);let a=n-e.heartbeatTimestamp;a>1e4&&(e.callbacks.setVideoTimeEndFromEvent(r),h.log(`Sending heartbeat`),e.callbacks.heartbeat(a,t.from.toLowerCase(),r),e.heartbeatTimestamp=n,e.callbacks.setVideoTimeStartFromEvent(r),e.callbacks.resetSessionExpiry())},onPlayerError(t,n,r){e.callbacks.error(r)},onPlayerNonFatalError(t,n,r){e.callbacks.error(r)}}})}static pad(e,t){return(e+Array(t).join(` `)).slice(0,t)}}}));function Qt(e){return e=e.toLowerCase(),e.endsWith(`.m3u8`)?tn:e.endsWith(`.mp4`)||e.endsWith(`.m4v`)||e.endsWith(`.m4a`)?$t:e.endsWith(`.webm`)?en:e.endsWith(`.mpd`)?nn:null}var $t,en,tn,nn,rn,an=s((()=>{$t=`video/mp4`,en=`video/webm`,tn=`application/x-mpegURL`,nn=`application/dash+xml`,rn={MP4:$t,WEBM:en,HLS:tn,DASH:nn}}));function on(e){return dn[e]}var sn,cn,ln,un,dn,fn=s((()=>{an(),{MP4:sn,WEBM:cn,HLS:ln,DASH:un}=rn,dn={[sn]:`mp4`,[cn]:`webm`,[ln]:`hls`,[un]:`dash`}})),Z,pn=s((()=>{Z={JW:`jw`,RADIANT:`radiant`,HLSJS:`hlsjs`,SHAKA:`shaka`,HTML:`html5`,REACTNATIVEVIDEO:`react-native-video`}})),mn=l({HTML5Adapter:()=>gn}),hn,gn,_n=s((()=>{qt(),an(),fn(),pn(),hn=1e3,gn=class{constructor(e,t,n,r=null){this.lastKnownCurrentTime_=0,this.sourceSwitching_=!1,this.eventCallback=t,this.playerSoftwareName=r??Z.HTML,this.stateMachine=n,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()}getCurrentQualityLevelInfo(){return null}isLive(){return!1}getMIMEType(){let e=this.mediaEl;if(!e)return null;let t=e.src||e.querySelector(`source`)?.src||null;return t?Qt(t):null}getStreamType(){return on(this.getMIMEType()??``)}getPlayerVersion(){return null}getStreamURL(){let e=this.mediaEl;return e&&(e.src||e.querySelector(`source`)?.src)||null}destroy(){this.mediaEl&&this.unregisterMediaElement()}setMediaElement(e=null){if(e&&this.mediaEl&&(this.unregisterMediaElement(),this.mediaElementSet_=!1),e&&(this.mediaEl=e),!this.mediaEl)throw Error(`No media element owned`);if(this.mediaElementSet_)throw Error(`Media element already set (only call this once)`);this.mediaElementSet_=!0,this.registerMediaElement(),this.onMaybeReady()}resetMedia(){this.mediaEl=null,this.mediaElEventHandlers=[]}registerMediaElement(){let e=this.mediaEl;e&&(this.listenToMediaElementEvent(`loadedmetadata`,()=>{if(e.readyState!==1)return;this.checkQualityLevelAttributes(!0);let{duration:t,autoplay:n,videoWidth:r,videoHeight:i,muted:a}=e,o={type:`html5`,isLive:this.isLive(),version:this.getPlayerVersion()??`html5`,streamType:this.getStreamType(),streamUrl:this.getStreamURL(),duration:t,autoplay:n,currentVideoData:{height:i,width:r,bitrate:this.analyticsBitrate_,audioCodec:this.audioCodec_,videoCodec:this.videoCodec_},videoWindowWidth:e.clientWidth,videoWindowHeight:e.clientHeight,muted:a};this.needsFirstPlayIntent_||this.eventCallback(X.METADATA_LOADED,o)}),this.listenToMediaElementEvent(`canplay`,()=>{if(this.playbackReadySet_)return;this.playbackReadySet_=!0;let{duration:t,autoplay:n,videoWidth:r,videoHeight:i,muted:a}=e,o={type:`html5`,isLive:this.isLive(),version:this.getPlayerVersion()??`html5`,streamType:this.getStreamType(),streamUrl:this.getStreamURL(),duration:t,autoplay:n,playerSoftware:this.playerSoftwareName,videoWindowWidth:e.clientWidth,videoWindowHeight:e.clientHeight,currentVideoData:{height:i,width:r,bitrate:this.analyticsBitrate_,audioCodec:this.audioCodec_,videoCodec:this.videoCodec_},muted:a};this.eventCallback(X.SOURCE_LOADED,o)}),this.listenToMediaElementEvent(`emptied`,()=>{this.sourceSwitching_=!0}),this.listenToMediaElementEvent(`play`,()=>{let{currentTime:t,videoWidth:n,videoHeight:r}=e;this.needsFirstPlayIntent_=!1,this.eventCallback(X.PLAY,{currentVideoData:{height:r,width:n,bitrate:this.analyticsBitrate_,audioCodec:this.audioCodec_,videoCodec:this.videoCodec_},currentTime:t})}),this.listenToMediaElementEvent(`pause`,()=>{this.onPaused()}),this.listenToMediaElementEvent(`playing`,()=>{let{currentTime:t,videoWidth:n,videoHeight:r}=e;this.isPaused_=!1,!this.needsFirstPlayIntent_&&(this.sourceSwitching_||this.eventCallback(X.TIMECHANGED,{currentVideoData:{height:r,width:n,bitrate:this.analyticsBitrate_,audioCodec:this.audioCodec_,videoCodec:this.videoCodec_},currentTime:t}))}),this.listenToMediaElementEvent(`error`,()=>{let{error:t}=e;this.eventCallback(X.ERROR,{currentTime:this.lastKnownCurrentTime_,code:t?.code,message:t?.message})}),this.listenToMediaElementEvent(`volumechange`,()=>{let{muted:t,currentTime:n}=e;t?this.eventCallback(X.MUTE,{currentTime:n}):this.eventCallback(X.UN_MUTE,{currentTime:n})}),this.listenToMediaElementEvent(`seeking`,()=>{let{currentTime:t,videoWidth:n,videoHeight:r}=e;this.eventCallback(X.SEEK,{currentVideoData:{height:r,width:n,bitrate:this.analyticsBitrate_,audioCodec:this.audioCodec_,videoCodec:this.videoCodec_},currentTime:t,droppedFrames:0})}),this.listenToMediaElementEvent(`seeked`,()=>{let{currentTime:t,videoWidth:n,videoHeight:r}=e;this.bufferingTimeout_&&clearTimeout(this.bufferingTimeout_),this.eventCallback(X.SEEKED,{currentVideoData:{height:r,width:n,bitrate:this.analyticsBitrate_,audioCodec:this.audioCodec_,videoCodec:this.videoCodec_},currentTime:t,droppedFrames:0})}),this.listenToMediaElementEvent(`ended`,()=>{let{currentTime:t,videoWidth:n,videoHeight:r}=e;this.eventCallback(X.END,{currentVideoData:{height:r,width:n,bitrate:this.analyticsBitrate_,audioCodec:this.audioCodec_,videoCodec:this.videoCodec_},currentTime:t})}),this.listenToMediaElementEvent(`timeupdate`,()=>{let{currentTime:t,videoHeight:n,videoWidth:r}=e;this.isBuffering_=!1,t>0&&(this.lastKnownCurrentTime_=t,this.sourceSwitching_=!1),!this.needsFirstPlayIntent_&&(!this.isPaused_&&!this.sourceSwitching_&&this.eventCallback(X.TIMECHANGED,{currentVideoData:{height:n,width:r,bitrate:this.analyticsBitrate_,audioCodec:this.audioCodec_,videoCodec:this.videoCodec_},currentTime:t}),this.checkQualityLevelAttributes(),this.checkPlayheadProgress(),this.previousMediaTime_=t)}),this.listenToMediaElementEvent(`stalled`,()=>{}),this.listenToMediaElementEvent(`waiting`,()=>{this.onBuffering()}))}listenToMediaElementEvent(e,t){if(!this.mediaEl)throw Error(`No media attached`);let n=t.bind(this);this.mediaElEventHandlers.push({event:e,handler:n}),this.mediaEl.addEventListener(e,n,!1)}unregisterMediaElement(){if(!this.mediaEl)throw Error(`No media attached`);for(let{event:e,handler:t}of this.mediaElEventHandlers)this.mediaEl.removeEventListener(e,t,!1);this.resetMedia()}onMaybeReady(){if(!this.needsReadyEvent_||!this.mediaEl)return;this.needsReadyEvent_=!1;let{duration:e,autoplay:t,videoWidth:n,videoHeight:r,muted:i,preload:a}=this.mediaEl,o=this.getStreamURL(),s=a!==`none`,c={type:`html5`,isLive:this.isLive(),version:this.getPlayerVersion()??`html5`,streamType:this.getStreamType(),streamUrl:o,duration:e,autoplay:t,preload:s,playerSoftware:this.playerSoftwareName,currentVideoData:{height:r,width:n,bitrate:this.analyticsBitrate_,audioCodec:this.audioCodec_,videoCodec:this.videoCodec_},videoWindowWidth:this.mediaEl.clientWidth,videoWindowHeight:this.mediaEl.clientHeight,muted:i};this.stateMachine.updateMetadata(c),this.eventCallback(X.READY,c)}onBuffering(){let{currentTime:e}=this.mediaEl;this.isBuffering_||this.isPaused_||(this.eventCallback(X.START_BUFFERING,{currentTime:e}),this.isBuffering_=!0)}onPaused(){if(this.isPaused_)return;if(this.sourceSwitching_){this.isPaused_=!0;return}let{videoHeight:e,videoWidth:t}=this.mediaEl,n=this.lastKnownCurrentTime_>0?this.lastKnownCurrentTime_:this.mediaEl.currentTime??0;this.eventCallback(X.PAUSE,{currentVideoData:{height:e,width:t,bitrate:this.analyticsBitrate_,audioCodec:this.audioCodec_,videoCodec:this.videoCodec_},currentTime:n}),this.isPaused_=!0}checkPlayheadProgress(){let e=this.mediaEl;e.paused&&this.onPaused(),this.bufferingTimeout_&&clearTimeout(this.bufferingTimeout_),this.bufferingTimeout_=setTimeout(()=>{(e.paused||e.ended)&&!this.isBuffering_||e.currentTime-(this.previousMediaTime_??e.currentTime)<hn&&this.onBuffering()},hn)}checkQualityLevelAttributes(e=!1){let t=this.mediaEl,n=this.getCurrentQualityLevelInfo();if(!n)return;let{bitrate:r,width:i,height:a,videoCodec:o,audioCodec:s}=n,c=this.isLive();if(c!==this.isLive_&&(this.isLive_=c,e||this.stateMachine.updateMetadata({isLive:c})),this.audioCodec_=s??``,this.videoCodec_=o??``,this.analyticsBitrate_!==r){let n={width:i,height:a,bitrate:r,videoCodec:o,audioCodec:s,currentTime:t.currentTime};e||this.eventCallback(X.VIDEO_CHANGE,n),this.analyticsBitrate_=r??-1}}}})),vn=l({HlsjsAdapter:()=>yn}),yn,bn=s((()=>{qt(),_n(),an(),pn(),yn=class extends gn{constructor(e,t,n){super(null,t,n,Z.HLSJS),this.hls=e,this.playerSoftwareName=Z.HLSJS,this.boundOnMediaAttaching=this.onMediaAttaching.bind(this),this.boundOnMediaDetaching=this.onMediaDetaching.bind(this),this.boundOnManifestLoading=this.onManifestLoading.bind(this),this.hlsErrorHandler=(e,t)=>this.onError(t),this.resetMedia(),this.registerHlsEvents()}getCurrentQualityLevelInfo(){let e=this.hls,t=e.levels?.[e.currentLevel];if(!t)return null;let n=t.attrs,r=n.BANDWIDTH?parseInt(n.BANDWIDTH,10):0,i=n.RESOLUTION?.width?parseInt(n.RESOLUTION.width,10):0,a=n.RESOLUTION?.height?parseInt(n.RESOLUTION.height,10):0,o=null,s=null;if(n.CODECS){let e=n.CODECS.split(`,`);s=e[0]??null,o=e.length>1?e[1]:null}return{bitrate:r,width:i,height:a,audioCodec:o,videoCodec:s}}isLive(){let e=this.hls;return e.currentLevel<0?!1:!!(e.levels?.[e.currentLevel])?.details?.live}getPlayerVersion(){return Hls.version}getMIMEType(){return rn.HLS}getStreamURL(){return this.hls.url??null}destroy(){let e=this.hls;e.off(Hls.Events.MEDIA_ATTACHING,this.boundOnMediaAttaching),e.off(Hls.Events.MEDIA_DETACHING,this.boundOnMediaDetaching),e.off(Hls.Events.MANIFEST_LOADING,this.boundOnManifestLoading),e.off(Hls.Events.ERROR,this.hlsErrorHandler),super.destroy()}registerHlsEvents(){let e=this.hls;if(!Hls)throw Error(`Hls.js is not installed (must be loaded before analytics module)`);e.on(Hls.Events.MEDIA_ATTACHING,this.boundOnMediaAttaching),e.on(Hls.Events.MEDIA_DETACHING,this.boundOnMediaDetaching),e.on(Hls.Events.MANIFEST_LOADING,this.boundOnManifestLoading),e.on(Hls.Events.ERROR,this.hlsErrorHandler),e.media&&this.onMediaAttaching(),e.url&&this.onManifestLoading()}onMediaAttaching(){this.mediaEl||(this.mediaEl=this.hls.media,this.registerMediaElement(),this.onMaybeReady())}onMediaDetaching(){this.unregisterMediaElement()}onManifestLoading(){this.onMaybeReady()}onError(e){let t=e,n=this.lastKnownCurrentTime_>0?this.lastKnownCurrentTime_:this.mediaEl?.currentTime??0;t?.fatal===!0&&t?.details===`internalException`&&console.error(e),this.eventCallback(X.ERROR,{currentTime:n,code:t?.type,message:JSON.stringify({details:t?.details,fatal:t?.fatal,type:t?.type,fragment_url:t?.url,error:{message:t?.error?.message,stack:t?.error?.stack},extra:{networkDetails:{status:t?.networkDetails?.status,statusText:t?.networkDetails?.statusText,url:t?.networkDetails?.url,responseHeaders:t?.networkDetails?.responseHeaders,responseText:t?.networkDetails?.responseText,responseURL:t?.networkDetails?.responseURL,data:t?.networkDetails?.data}}})})}}})),xn=l({ShakaAdapter:()=>Sn}),Sn,Cn=s((()=>{_n(),an(),pn(),qt(),Sn=class extends gn{constructor(e,t,n,r){if(super(r,t,n,Z.SHAKA),typeof shaka>`u`)throw Error("`shaka` lib is not installed (must be loaded before analytics module)");this.shakaPlayer=e,this.playerSoftwareName=Z.SHAKA,this.shakaErrorHandler=e=>{this.onGumletShakaError(e,this.eventCallback,this.mediaEl).catch(()=>{let e=this.lastKnownCurrentTime_>0?this.lastKnownCurrentTime_:this.mediaEl?.currentTime??0;this.eventCallback(X.ERROR,{currentTime:e,code:`error_handler_exception`,message:`Shaka error handler threw before firing callback`})})},this.registerShakaEvents()}getPlayerVersion(){return shaka.Player.version}isLive(){return this.shakaPlayer?.isLive()??!1}getMIMEType(){return this.shakaPlayer?.getManifestType?.()===`HLS`?rn.HLS:rn.DASH}getStreamURL(){return this.shakaPlayer?.getAssetUri()??null}getCurrentQualityLevelInfo(){let e=this.shakaPlayer.getVariantTracks().filter(e=>e.active).find(e=>e.videoCodec!==null||e.videoId!==null);return e?{bitrate:e.videoBandwidth??e.bandwidth??null,width:e.width??null,height:e.height??null,videoCodec:e.videoCodec??null,audioCodec:e.audioCodec??null}:null}destroy(){this.shakaPlayer.removeEventListener(`error`,this.shakaErrorHandler),super.destroy()}registerShakaEvents(){if(!this.shakaPlayer)throw Error(`Shaka player object is not defined`);this.shakaPlayer.addEventListener(`error`,this.shakaErrorHandler)}async onGumletShakaError(e,t,n){let r=this.lastKnownCurrentTime_>0?this.lastKnownCurrentTime_:n?.currentTime??0,i=e;if(!i.detail){t(X.ERROR,{currentTime:r,code:`not_set_by_shaka`,message:`{}`});return}let a=i.detail,o=[];if(a.data)for(let e of a.data)o.push(e);let s=[],c=null;try{let e=[];if(this.shakaPlayer.getVariantTracks().forEach(t=>{e.push({width:t.width,height:t.height,bitrate:t.videoBandwidth??t.bandwidth,framerate:t.frameRate,contentType:`${t.mimeType}; codecs="${t.videoCodec}"`})}),navigator?.mediaCapabilities?.decodingInfo)for(let t of e)try{let e={type:`media-source`,video:{contentType:t.contentType,width:t.width??0,height:t.height??0,bitrate:t.bitrate??0,framerate:t.framerate??0},keySystemConfiguration:{keySystem:`com.widevine.alpha`,video:{contentType:t.contentType}}},n=await navigator.mediaCapabilities.decodingInfo(e);s.push({...n,keySystemAccess:n.keySystemAccess?.getConfiguration()})}catch{}c=this.getCurrentQualityLevelInfo()}catch{}t(!a.severity||a.severity===2?X.ERROR:X.NON_FATAL_ERROR,{currentTime:r,code:a.code,message:JSON.stringify({category:a.v,code:a.code,severity:a.severity,handled:a.handled,timestamp:i.timestamp,extra_data:o,media_capabilities:s,selected_quality_info:c})})}}}));xe();var wn=class e{static{this.PAGE_LOAD_TYPE={FOREGROUND:1,BACKGROUND:2}}static{this.LICENSE_CALL_PENDING_TIMEOUT=200}static{this.PAGE_LOAD_TYPE_TIMEOUT=200}static{this.CAST_RECEIVER_CONFIG_MESSAGE=`CAST_RECEIVER_CONFIG_MESSAGE`}constructor(t){this.previousState=void 0,this.previousStateTimeStamp=new Date,this.previousStateMono=0,this.firstPlayTimestamp=0,this.startupTime=0,this.pageLoadType=e.PAGE_LOAD_TYPE.FOREGROUND,this.droppedSampleFrames=0,this.autoplay=void 0,this.isCastClient=!1,this.isCastReceiver=!1,this.isAllowedToSendSamples=!1,this.samplesQueue=[],this.customEventHandler=(e,t)=>{this.sampleBuilder.sample.custom_event_data=JSON.stringify(t),this.sendAnalyticsRequestAndClearValues(e,{custom_event_data:JSON.stringify(t)})},this.customEventHandlerAsync=(e,t)=>new Promise((n,r)=>{let i=JSON.stringify(t);this.sendAnalyticsRequestAndClearValuesAsync(e,{custom_event_data:i}).then(e=>n(e)).catch(e=>r(e))}),this.getCurrentImpressionId=()=>this.sample.impressionId,this.setDroppedFrames=e=>{},this.register=async(e,t={})=>{t.starttime?t.starttime=p.convertEpochTime(t.starttime):t.starttime=p.getCurrentTimestamp();let{GumletStateMachine:n}=await Promise.resolve().then(()=>(Zt(),Jt));if(this.analyticsStateMachine=new n(this.stateMachineCallbacks,t),!e){let{HTML5Adapter:e}=await Promise.resolve().then(()=>(_n(),mn));return this.adapter=new e(this.mediaElement,this.record,this.analyticsStateMachine),this.analyticsStateMachine}if(we.isHlsjs(e)){let{HlsjsAdapter:t}=await Promise.resolve().then(()=>(bn(),vn));this.adapter=new t(e,this.record,this.analyticsStateMachine)}else if(we.isShaka(e)){let{ShakaAdapter:n}=await Promise.resolve().then(()=>(Cn(),xn));this.adapter=new n(e,this.record,this.analyticsStateMachine,t.mediaElement??null)}else{let{HTML5Adapter:t}=await Promise.resolve().then(()=>(_n(),mn));this.adapter=new t(e,this.record,this.analyticsStateMachine)}this.adapter||h.error(`Could not detect player.`)},this.registerHLSJSPlayer=async(e,t={})=>{t.starttime?t.starttime=p.convertEpochTime(t.starttime):t.starttime=p.getCurrentTimestamp();let{GumletStateMachine:n}=await Promise.resolve().then(()=>(Zt(),Jt));this.analyticsStateMachine=new n(this.stateMachineCallbacks,t);let{HlsjsAdapter:r}=await Promise.resolve().then(()=>(bn(),vn));this.adapter=new r(e,this.record,this.analyticsStateMachine)},this.registerShakaPlayer=async(e,t={})=>{t.starttime?t.starttime=p.convertEpochTime(t.starttime):t.starttime=p.getCurrentTimestamp();let{GumletStateMachine:n}=await Promise.resolve().then(()=>(Zt(),Jt));this.analyticsStateMachine=new n(this.stateMachineCallbacks,t);let{ShakaAdapter:r}=await Promise.resolve().then(()=>(Cn(),xn));this.adapter=new r(e,this.record,this.analyticsStateMachine,t.mediaElement)},this.registerHTML5Player=async(e,t={})=>{t.starttime?t.starttime=p.convertEpochTime(t.starttime):t.starttime=p.getCurrentTimestamp();let{GumletStateMachine:n}=await Promise.resolve().then(()=>(Zt(),Jt));this.analyticsStateMachine=new n(this.stateMachineCallbacks,t);let{HTML5Adapter:r}=await Promise.resolve().then(()=>(_n(),mn));this.adapter=new r(e,this.record,this.analyticsStateMachine)},this.registerReactNativeVideoPlayer=async e=>{e.starttime?e.starttime=p.convertEpochTime(e.starttime):e.starttime=p.getCurrentTimestamp();let{GumletStateMachine:t}=await Promise.resolve().then(()=>(Zt(),Jt));return this.analyticsStateMachine=new t(this.stateMachineCallbacks,e),this.analyticsStateMachine},this.record=(e,t)=>{t||={},this.analyticsStateMachine.callEvent(e,t,p.getCurrentTimestamp())},this.config=t,this.analyticsCall=new ye,this.castClient=new Te,this.castReceiver=new Ee,this.session=new Ut(t),this.sampleBuilder=new Wt(t,this.session),this.publisher=new Gt(this.analyticsCall,this.sampleBuilder),this.init(),this.setupSample(),this.setupStateMachineCallbacks(),typeof performance<`u`&&typeof performance.now==`function`?this.previousStateMono=performance.now():this.previousStateMono=this.previousStateTimeStamp.getTime()}init(){if(!this.isCastReceiver&&(this.config.property_id===``||!p.validString(this.config.property_id))){console.error(`Invalid analytics property_id provided`);return}h.setLogging(this.config.debug||!1),this.session.propertyId=this.config.property_id,typeof window<`u`&&window.parent!==void 0?this.session.pageURL=window.location===window.parent.location?document.location.href:document.referrer:this.config.page_url?this.session.pageURL=this.config.page_url:this.session.pageURL=null;let e=!!this.config.test,t=this.config.sessionID||null,n=this.config.userID||null,r=Object.hasOwn(this.config,`sendSessionRequest`)?this.config.sendSessionRequest:!0;this.session.setUserId(e,n),this.session.setSessionId(e,t,r),this.session.setPlayerInstanceId(this.config.getUUID),this.session.setPlaybackId(this.config.getUUID)}setConfigParameters(e=this.config){this.session.setConfigParameters(e)}updateCustomData(e){this.session.updateCustomData(e)}updateCustomUserData(e){this.session.updateCustomUserData(e)}updateCustomVideoData(e){this.session.updateCustomVideoData(e)}updateCustomPlayerData(e){this.session.updateCustomPlayerData(e)}get userId(){return this.session.userId}get sessionId(){return this.session.sessionId}get propertyId(){return this.session.propertyId}get playerData(){return this.session.playerData}get sessionData(){return this.session.sessionData}get playerInitCall(){return this.session.playerInitCall}get isMuted(){return this.sampleBuilder.isMuted}set isMuted(e){this.sampleBuilder.isMuted=e}get sample(){return this.sampleBuilder.sample}setupSample(){this.sampleBuilder.setupSample()}setDuration(e){this.sampleBuilder.setDuration(e)}setVideoData(e){this.sampleBuilder.setVideoData(e)}setPlaybackSettingsFromLoadedEvent(e){this.sampleBuilder.setPlaybackSettingsFromLoadedEvent(e)}setPlaybackWatchTime(e){this.sampleBuilder.setPlaybackWatchTime(e)}getPlaybackWatchTime(){return this.sampleBuilder.getPlaybackWatchTime()}getSample(e=null,t={}){let n=this.sampleBuilder.getSample(e,t);return n.millis_from_previous_event=this.getMillisFromPreviousState(),n.previous_event=this.previousState,n}setPlayerData(e){this.session.setPlayerData(e)}setSessionData(){this.session.setSessionData()}setPlaybackId(){this.session.setPlaybackId(this.config.getUUID)}setUserId(e=!1,t=null){this.session.setUserId(e,t)}setSessionId(e=!1,t=null,n=!0){this.session.setSessionId(e,t,n)}setPlayerInstanceId(){this.session.setPlayerInstanceId(this.config.getUUID)}sendAnalyticsRequest(e,t){this.publisher.sendRequest(e,t)}sendAnalyticsRequestAsync(e,t){return this.publisher.sendRequestAsync(e,t)}sendAnalyticsRequestAndClearValues(e=null,t={}){let n={millis_from_previous_event:this.getMillisFromPreviousState(),previous_event:this.previousState,...t};this.publisher.sendAndClear(e,n)}sendAnalyticsRequestAndClearValuesAsync(e=null,t={}){return this.publisher.sendAndClearAsync(e,t)}sendUnloadRequest(){this.publisher.sendUnload()}sendAnalyticsRequestSynchronous(){this.publisher.sendSynchronous()}getMillisFromPreviousState(){let e;e=typeof performance<`u`&&typeof performance.now==`function`?performance.now()-this.previousStateMono:new Date().getTime()-this.previousStateTimeStamp.getTime();let t=Math.round(e);return t<=0&&this.previousState!==void 0?1:Math.max(0,t)}setState(e=void 0){e&&(this.previousState=e,this.previousStateTimeStamp=new Date,typeof performance<`u`&&typeof performance.now==`function`?this.previousStateMono=performance.now():this.previousStateMono=this.previousStateTimeStamp.getTime())}getDroppedFrames(e){if(e!==void 0&&e!==0){let t=e-this.droppedSampleFrames;return this.droppedSampleFrames=e,t}return 0}setupStateMachineCallbacks(){this.stateMachineCallbacks={setup:(e,t,n,r)=>{h.log(`Setup Gumlet analytics `+this.analyticsVersion),this.setDuration(e),this.setVideoData(n);let i=0;r?.starttime&&(i=new Date().getTime()-r.starttime),this.sendAnalyticsRequestAndClearValues(g.SETUP,{millis_from_previous_event:i}),this.setState(g.SETUP)},ready:(e,t,n)=>{this.setDuration(e),this.setVideoData(n),this.setPlaybackSettingsFromLoadedEvent(n),this.sendAnalyticsRequestAndClearValues(g.PLAYER_READY),this.setState(g.PLAYER_READY),this.setPlayerData(n),this.playerInitCall.sendRequest(this.playerData,p.noOp)},loaded:(e,t,n,r=null)=>{this.setDuration(e),this.setVideoData(n),this.setPlaybackSettingsFromLoadedEvent(n);let i={};r!==null&&(i={millis_from_previous_event:r,previous_event:g.PLAYER_READY}),this.sendAnalyticsRequestAndClearValues(g.PLAYBACK_READY,i),r===null&&this.setState(g.PLAYBACK_READY)},startup:(e,t)=>{this.setDuration(e)},first_play:(e,t,n)=>{this.setDuration(e),this.setVideoData(n),this.setPlaybackSettingsFromLoadedEvent(n),this.sendAnalyticsRequestAndClearValues(g.PLAY),this.setState(g.PLAY),this.firstPlayTimestamp=new Date},play:(e,t,n)=>{this.setDuration(e),this.setVideoData(n),this.setPlaybackSettingsFromLoadedEvent(n),this.sendAnalyticsRequestAndClearValues(g.PLAY),this.setState(g.PLAY)},updateSample:e=>{this.setPlaybackSettingsFromLoadedEvent(e)},playing:(e,t,n)=>{this.setDuration(e),this.setVideoData(n),this.setPlaybackSettingsFromLoadedEvent(n),this.sendAnalyticsRequestAndClearValues(g.PLAYING),this.setState(g.PLAYING)},playback_started:(e,t,n)=>{this.setDuration(e),this.setVideoData(n),this.setPlaybackSettingsFromLoadedEvent(n);let r=new Date().getTime()-this.firstPlayTimestamp.getTime();this.sendAnalyticsRequestAndClearValues(g.PLAYBACK_STARTED,{millis_from_previous_event:r}),this.setState(g.PLAYBACK_STARTED)},playingAndBye:(e,t,n)=>{this.setDuration(e),this.setDroppedFrames(n),this.sendUnloadRequest()},heartbeat:(e,t,n)=>{this.setDuration(e),this.setVideoData(n),this.setPlaybackSettingsFromLoadedEvent(n),this.sendAnalyticsRequestAndClearValues(g.PLAYBACK_UPDATE),this.setState(g.PLAYBACK_UPDATE)},playbackWatchTime:e=>{this.setPlaybackWatchTime(e)},qualitychange:(e,t)=>{this.setDuration(e)},qualitychange_pause:(e,t)=>{this.setDuration(e)},qualitychange_rebuffering:(e,t)=>{this.setDuration(e)},videoChange:e=>{this.stateMachineCallbacks.setVideoTimeEndFromEvent(e),this.stateMachineCallbacks.setVideoTimeStartFromEvent(e),this.setPlaybackSettingsFromLoadedEvent(e)},audioChange:e=>{this.stateMachineCallbacks.setVideoTimeEndFromEvent(e),this.stateMachineCallbacks.setVideoTimeStartFromEvent(e)},pause:(e,t,n)=>{this.setDuration(e),this.setVideoData(n),this.setPlaybackSettingsFromLoadedEvent(n),this.sendAnalyticsRequestAndClearValues(g.PAUSE),this.setState(g.PAUSE)},start_rebuffer:(e,t,n,r=!1)=>{this.setDuration(e),this.setVideoData(n),this.setPlaybackSettingsFromLoadedEvent(n),r||this.sendAnalyticsRequestAndClearValues(g.START_REBUFFER),this.setState(g.START_REBUFFER)},end_rebuffer:(e,t,n,r=!1)=>{if(this.setDuration(e),this.setVideoData(n),this.setPlaybackSettingsFromLoadedEvent(n),!r)this.sendAnalyticsRequestAndClearValues(g.END_REBUFFER);else return this.getSample(g.END_REBUFFER);this.setState(g.END_REBUFFER)},playback_seeked:(e,t,n,r)=>{this.sendAnalyticsRequestAndClearValues(g.SEEKED,{from:e,to:t}),this.setState(g.SEEKED),this.setupSample(),r===`PAUSE`?(this.sendAnalyticsRequestAndClearValues(g.PAUSE,{millis_from_previous_event:n}),this.setState(g.PAUSE)):r===`PLAYING`&&(this.sendAnalyticsRequestAndClearValues(g.PLAYING,{millis_from_previous_event:n}),this.setState(g.PLAYING))},paused_seeking:(e,t,n)=>{this.setDuration(e)},play_seeking:p.noOp,end_play_seeking:(e,t,n)=>{this.setDuration(e)},rebuffering:(e,t,n)=>{this.setDuration(e)},error:e=>{this.setPlaybackSettingsFromLoadedEvent(e),this.stateMachineCallbacks.setVideoTimeEndFromEvent(e),this.stateMachineCallbacks.setVideoTimeStartFromEvent(e),this.sendAnalyticsRequestAndClearValues(g.ERROR,{error_code:e&&e.code,error:e&&e.message}),this.setState(g.ERROR),this.setupSample()},error_recovered:(e,t,n)=>{this.setPlaybackSettingsFromLoadedEvent(n),this.stateMachineCallbacks.setVideoTimeEndFromEvent(n),this.stateMachineCallbacks.setVideoTimeStartFromEvent(n),this.sendAnalyticsRequestAndClearValues(g.ERROR_RECOVERED,{})},end:(e,t,n)=>{this.setPlaybackId(),this.setDuration(e),this.sendAnalyticsRequestAndClearValues(g.END),this.setState(g.END)},ad:(e,t,n)=>{this.setDuration(e),this.setDroppedFrames(n)},mute:(e,t)=>{this.isMuted=!0,this.setPlaybackSettingsFromLoadedEvent(t),this.sendAnalyticsRequestAndClearValues(g.MUTE)},unMute:(e,t)=>{this.isMuted=!1,this.setPlaybackSettingsFromLoadedEvent(t),this.sendAnalyticsRequestAndClearValues(g.UNMUTE)},muting_ready:p.noOp,muting_play:p.noOp,muting_pause:p.noOp,setVideoTimeEndFromEvent:e=>{},setVideoTimeStartFromEvent:e=>{},startCasting:(t,n)=>{if(n&&n.resuming){this.isAllowedToSendSamples=!1,h.warning(`Player started casting but a session is already casting!`);return}this.isCastClient=!0,this.isAllowedToSendSamples=!1;let{domain:r,path:i,language:a,userAgent:o,userId:s,impressionId:c}=this.sample,l={type:e.CAST_RECEIVER_CONFIG_MESSAGE,data:{config:this.config,userId:s,domain:r,path:i,language:a,userAgent:o,impressionId:c}};this.castClient.setUp(),this.castClient.sendMessage(l)},casting:()=>{this.isCastClient=!1,this.samplesQueue=[],this.isAllowedToSendSamples=!0},source_changing:()=>{},resetSessionExpiry:()=>{this.session.resetSessionExpiry()}}}};let Q=`[GumletInsights]`;var Tn=class{constructor(e){if(this.analytics_=null,this.ready_=!1,this.attached_=!1,!e||!p.validString(e.property_id)||e.property_id===``){console.error(`${Q} A valid property_id is required. No analytics events will be sent until the SDK is re-constructed with a valid config.`);return}this.analytics_=new wn(e),this.ready_=!0}async attach(e,t={}){if(!this.ready_||!this.analytics_){console.error(`${Q} attach() called but the SDK is not initialized. Check that you passed a valid property_id to the constructor.`);return}this.attached_&&(console.warn(`${Q} attach() called while a player is already attached. Detaching the previous player first.`),this.detach());let n=t.mediaElement??null;if(n!==null&&!this.isHTMLVideoElement_(n)){console.error(`${Q} opts.mediaElement must be an HTMLVideoElement, got: ${Object.prototype.toString.call(n)}`);return}if(e==null){if(!n){console.error(`${Q} HTML5 mode requires opts.mediaElement (an HTMLVideoElement). Pass the <video> element as opts.mediaElement, or pass it directly as the player argument.`);return}}else if(Ce(e)){if(!this.isValidHlsPlayer_(e)){console.error(`${Q} HLS.js player is not in a valid state. The player may have been destroyed. Create a new Hls() instance before attaching.`);return}}else if(Se(e)){let t=typeof e.getMediaElement==`function`?e.getMediaElement():null;if(!n&&!t){console.error(`${Q} Shaka Player requires opts.mediaElement — pass the HTMLVideoElement that Shaka is rendering into.`);return}if(!this.isValidShakaPlayer_(e)){console.error(`${Q} Shaka Player is not in a valid state. The player may have been destroyed. Create a new shaka.Player() before attaching.`);return}}else if(!this.isHTMLVideoElement_(e)){console.error(`${Q} Unrecognized player type (${Object.prototype.toString.call(e)}). Supported players: HLS.js (Hls instance), Shaka Player (shaka.Player instance), HTMLVideoElement, or null/undefined (HTML5 mode with opts.mediaElement).`);return}await this.analytics_.register(e,{...t,mediaElement:n}),this.attached_=!0}detach(){this.attached_&&=(this.analytics_?.adapter?.destroy?.(),!1)}get isAttached(){return this.attached_}getImpressionId(){return this.analytics_?.getCurrentImpressionId()??void 0}updateConfig(e){!this.ready_||!this.analytics_||(this.analytics_.updateCustomData(e),this.analytics_.updateCustomVideoData(e),this.analytics_.updateCustomUserData(e),this.analytics_.updateCustomPlayerData(e))}updateCustomData(e){this.analytics_?.updateCustomData(e)}updateCustomVideoData(e){this.analytics_?.updateCustomVideoData(e)}updateCustomUserData(e){this.analytics_?.updateCustomUserData(e)}updateCustomPlayerData(e){this.analytics_?.updateCustomPlayerData(e)}customEventHandler(e,t){if(!this.ready_||!this.analytics_){console.warn(`${Q} customEventHandler ignored — SDK not initialized (check property_id).`);return}this.analytics_.customEventHandler(e,t)}customEventHandlerAsync(e,t){return!this.ready_||!this.analytics_?Promise.reject(Error(`${Q} customEventHandlerAsync — SDK not initialized (check property_id).`)):this.analytics_.customEventHandlerAsync(e,t)}isHTMLVideoElement_(e){return typeof HTMLVideoElement<`u`?e instanceof HTMLVideoElement:typeof e==`object`&&!!e&&typeof e.play==`function`&&typeof e.pause==`function`&&typeof e.addEventListener==`function`}isValidHlsPlayer_(e){return typeof e==`object`&&!!e&&typeof e.loadSource==`function`&&typeof e.attachMedia==`function`&&typeof e.destroy==`function`}isValidShakaPlayer_(e){return typeof e!=`object`||!e?!1:typeof e.isDestroyed==`function`?!e.isDestroyed():typeof e.load==`function`&&typeof e.unload==`function`&&typeof e.addEventListener==`function`}};let En={CLOUDFLARE:`cloudflare`,AKAMAI:`akamai`,FASTLY:`fastly`,MAXCDN:`maxcdn`,CLOUDFRONT:`cloudfront`,CHINACACHE:`chinacache`,BITGRAVITY:`bitgravity`};pn(),qt();let $,Dn=(e,t={})=>$.register(e,t),On=(e,t={})=>$.registerHLSJSPlayer(e,t),kn=(e,t={})=>$.registerShakaPlayer(e,t),An=(e,t={})=>$.registerHTML5Player(e,t),jn=(e,t={})=>$.registerReactNativeVideoPlayer(e,t),Mn=()=>$.getCurrentImpressionId(),Nn=()=>$.analyticsStateMachine,Pn=e=>$.updateCustomData(e),Fn=e=>$.updateCustomVideoData(e),In=e=>$.updateCustomUserData(e),Ln=e=>$.updateCustomPlayerData(e),Rn=(e,t)=>$.customEventHandler(e,t),zn=(e,t)=>new Promise((n,r)=>{$.customEventHandlerAsync(e,t).then(e=>{n(e)}).catch(e=>{r(e)})}),Bn=e=>($=new wn(e),{register:Dn,registerHLSJSPlayer:On,registerShakaPlayer:kn,registerHTML5Player:An,registerReactNativeVideoPlayer:jn,getCurrentImpressionId:Mn,stateMachine:Nn,updateCustomData:Pn,updateCustomVideoData:Fn,updateCustomUserData:In,updateCustomPlayerData:Ln,setCustomData:$.setCustomData,setCustomDataOnce:$.setCustomDataOnce,customEventHandler:Rn,customEventHandlerAsync:zn});Bn.Players=Z,Bn.CdnProviders=En,Bn.gumletInsightsEvents=X,Bn.gumletSupportedPlayers=Z,typeof window<`u`&&(window.gumlet=window.gumlet||{},window.gumlet.insights=Bn,window.gumlet.GumletInsights=Tn,window.gumletInsightsEvents=X,window.gumletSupportedPlayers=Z);var Vn={insights:Bn,gumletInsightsEvents:X,gumletSupportedPlayers:Z};return e.GumletInsights=Tn,e.default=Vn,e})({});
|
|
9
|
+
var gminsights=(function(e){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var t=Object.create,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.getPrototypeOf,o=Object.prototype.hasOwnProperty,s=(e,t)=>()=>(e&&(t=e(e=0)),t),c=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),l=(e,t)=>{let r={};for(var i in e)n(r,i,{get:e[i],enumerable:!0});return t||n(r,Symbol.toStringTag,{value:`Module`}),r},u=(e,t,a,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var c=i(t),l=0,u=c.length,d;l<u;l++)d=c[l],!o.call(e,d)&&d!==a&&n(e,d,{get:(e=>t[e]).bind(null,d),enumerable:!(s=r(t,d))||s.enumerable});return e},d=(e,r,i)=>(i=e==null?{}:t(a(e)),u(r||!e||!e.__esModule?n(i,`default`,{value:e,enumerable:!0}):i,e));let f={CLOUDFLARE:`cloudflare`,AKAMAI:`akamai`,FASTLY:`fastly`,MAXCDN:`maxcdn`,CLOUDFRONT:`cloudfront`,CHINACACHE:`chinacache`,BITGRAVITY:`bitgravity`};var p,m=s((()=>{p={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`,NON_FATAL_ERROR:`playerNonFatalError`,PLAYBACK_FINISHED:`end`,SCREEN_RESIZE:`resize`,UNLOAD:`unload`,END:`end`,METADATA_LOADED:`metadataLoaded`,SOURCE_UNLOADED:`sourceUnloaded`,PLAYBACK_PLAYING:`playback_playing`}})),h,ee=s((()=>{h={JW:`jw`,RADIANT:`radiant`,HLSJS:`hlsjs`,SHAKA:`shaka`,HTML:`html5`,REACTNATIVEVIDEO:`react-native-video`}}));m(),ee();let te={experimentName:`insights-test-experiment`,customData1:`custom_data_1:test-slot-1`,customData2:`custom_data_2:test-slot-2`,customData3:`custom_data_3:test-slot-3`,customData4:`custom_data_4:test-slot-4`,customData5:`custom_data_5:test-slot-5`,customData6:`custom_data_6:test-slot-6`,customData7:`custom_data_7:test-slot-7`,customData8:`custom_data_8:test-slot-8`,customData9:`custom_data_9:test-slot-9`,customData10:`custom_data_10:test-slot-10`,customPlayerIntegrationVersion:`custom_player_integration_version:1.2.3-test`,customPlayerName:`custom_player_name:TestPlayerShell`,customPageType:`custom_page_type:article`,userId:`custom_user_id:test-user-42`,userName:`custom_user_name:Ada Test`,userEMail:`custom_user_email:test@example.com`,userPhone:`custom_user_phone:+1-555-0100`,userProfileImage:`custom_user_profile_image:https://example.com/avatar.png`,userAddressLine1:`custom_user_address_line_1:1 Test Street`,userAddressLine2:`custom_user_address_line_2:Suite 100`,userCity:`custom_user_city:Testville`,userState:`custom_user_state:TS`,userCountry:`custom_user_country:Testland`,userZipcode:`custom_user_zipcode:99999`,customContentType:`custom_content_type:application/x-test-stream`,customVideoDurationMillis:`custom_video_duration_millis:12345678`,customEncodingVariant:`custom_encoding_variant:h264-720p-test`,customVideoLanguage:`custom_video_language:en-TEST`,customVideoId:`custom_video_id:vid-integration-001`,customVideoSeries:`custom_video_series:Series Test Pack`,customVideoProducer:`custom_video_producer:QA Producer`,customVideoTitle:`custom_video_title:Full metadata smoke test`,customVideoVariantName:`custom_video_variant_name:main-feed`,customVideoVariant:`custom_video_variant:abr-ladder-a`},ne=e=>e!==void 0&&typeof e==`string`,re=e=>e!==void 0&&typeof e==`boolean`,ie=e=>e!==void 0&&typeof e==`number`,ae=e=>e.replace(/\/$/g,``),oe=e=>(e*=1e3,Math.round(e)),se=e=>{let t=e.toString().length;return t===13?e:e*10**(13-t)},ce=()=>Date.now(),le=e=>ce()-e,ue=()=>{if(crypto&&crypto.randomUUID)return crypto.randomUUID();let e=new Uint8Array(16);crypto.getRandomValues(e),e[6]=e[6]&15|64,e[8]=e[8]&63|128;let t=[...e].map(e=>e.toString(16).padStart(2,`0`));return t.slice(0,4).join(``)+`-`+t.slice(4,6).join(``)+`-`+t.slice(6,8).join(``)+`-`+t.slice(8,10).join(``)+`-`+t.slice(10,16).join(``)},de=e=>{let t=`${e}=`,n=[];try{n=document.cookie.split(`;`)}catch{return``}let r=null;for(let e=0;e<n.length;e++){let i=n[e];for(;i.charAt(0)===` `;)i=i.substring(1);i.indexOf(t)===0&&(r=i.substring(t.length,i.length))}if(!r){try{r=localStorage.getItem(e)}catch{return``}let t=null;if(r)try{t=JSON.parse(r)}catch{return``}else return``;let n=null;if(t.expires)n=new Date(t.expires);else return``;if(Object.prototype.toString.call(n)===`[object Date]`){if(!(n instanceof Date&&!isNaN(n.getTime())))return``}else return``;if(n.getTime()>new Date().getTime())r=t.value?t.value:``;else return``}return r},fe=(e,t=30,n=null)=>{let r=new Date;r.setTime(r.getTime()+t*60*1e3);let i=n||ue();try{document.cookie=`${e}=${i}; expires=${r.toUTCString()}; path=/`,localStorage.setItem(e,JSON.stringify({expires:r.getTime(),value:i}))}catch{}return i},pe=()=>{},me=(e,t)=>{let n=0,r;return()=>n>=t?r:(r=e.apply(null,arguments),n++,r)},he=e=>me(e,1),ge=()=>{let e=[`webkit`,`moz`,`ms`,`o`];if(`hidden`in document)return`hidden`;for(let t=0;t<e.length;t++)if(`${e[t]}Hidden`in document)return`${e[t]}Hidden`;return null},_e=e=>typeof e==`object`?JSON.stringify(e):typeof e==`function`?_e(e()):e===void 0||typeof e==`string`?e:String(e);var g={validString:ne,validBoolean:re,validNumber:ie,sanitizePath:ae,calculateTime:oe,getCurrentTimestamp:ce,getDurationFromTimestampToNow:le,uuidv4:ue,getCookie:de,setCookie:fe,noOp:pe,times:me,once:he,getHiddenProp:ge,getCustomDataString:_e,jsonToQueryString:e=>`?`+Object.keys(e).map(t=>encodeURIComponent(t)+`=`+encodeURIComponent(e[t])).join(`&`),currentDateTimeFormatString:()=>new Date().toISOString(),convertEpochTime:se};function ve(){return typeof performance<`u`&&typeof performance.timeOrigin==`number`&&!Number.isNaN(performance.timeOrigin)&&typeof performance.now==`function`?((performance.timeOrigin+performance.now())/1e3).toFixed(9):(Date.now()/1e3).toFixed(9)}function ye(e){e.z=ve();let t=[void 0,null,!1];Object.keys(e).forEach(n=>{t.indexOf(e[n])!==-1&&delete e[n]}),Object.keys(e).forEach(t=>{Number.isNaN(e[t])&&delete e[t]})}var be=class{get(e,t,n,r=!0){ye(t);let i=g.jsonToQueryString(t);e+=i,fetch(e,{method:`GET`,keepalive:r===!1}).then(e=>e.text()).then(e=>{e&&e.length>0&&n(e)}).catch(()=>{})}asyncGet(e,t){return new Promise((n,r)=>{ye(t);let i=g.jsonToQueryString(t);e+=i,fetch(e,{method:`GET`}).then(e=>e.ok?e.text():Promise.reject({status:e.status,statusText:e.statusText})).then(e=>n(e)).catch(e=>{e&&typeof e.status==`number`?r(e):r({status:0,statusText:``})})})}};let xe=!1;function Se(e){xe=e}function Ce(){return xe}function we(){try{let e=_.trim(),t=new URL(e.includes(`://`)?e:`http://${e}`);return t.hostname===`localhost`||t.hostname===`127.0.0.1`||t.hostname===`[::1]`}catch{return!1}}var Te,_,Ee,De,v=s((()=>{Te=`urn:x-cast:com.gumlet.ingest.cast`,_=`https://ingest.gumlytics.com`,Ee=`https://ingest.gumlytics.com`.endsWith(`/`)?_:`${_}/`,De=new URL(`v2`,Ee).href.replace(/\/+$/,``)}));v();function Oe(){return{}}let ke=Oe;function Ae(e){ke=e}function je(e){if(!(e.meta_user_agent!=null&&e.meta_user_agent!==``))try{typeof navigator<`u`&&navigator.userAgent&&(e.meta_user_agent=navigator.userAgent)}catch{}}function Me(e){if(e.event_duration_millis!=null)return;let t=e.from,n=e.to;typeof t==`number`&&typeof n==`number`&&!Number.isNaN(t)&&!Number.isNaN(n)&&(e.event_duration_millis=n-t)}function Ne(e){let t=e.user_email;t!=null&&t!==``&&(e.custom_user_email==null||e.custom_user_email===``)&&(e.custom_user_email=t)}function Pe(e,t){let n={...e};for(let[e,r]of Object.entries(t))r!==void 0&&(n[e]=r);return n}function Fe(e){let t=Pe(ke(),e);return t.bitrate_mbps==null&&t.bitrate!=null&&(t.bitrate_mbps=t.bitrate),t.player_software==null&&t.player_name!=null&&(t.player_software=t.player_name),je(t),Me(t),Ne(t),t}var Ie=class e extends be{constructor(...t){super(...t),this.sendRequest=function(t,n){t.event_family=`session_event`;let r=Ce()?Fe({...t}):null;this.get(e.analyticsServerUrl,t,n),r&&this.get(e.analyticsServerUrlV2,r,g.noOp)},this.sendRequestAsync=function(t){t.event_family=`session_event`;let n=Ce()?Fe({...t}):null,r=this.asyncGet(e.analyticsServerUrl,t);return n&&this.asyncGet(e.analyticsServerUrlV2,n).catch(()=>{}),r},this.sendRequestSynchronous=function(t,n){t.event_family=`session_event`;let r=Ce()?Fe({...t}):null;this.get(e.analyticsServerUrl,t,n,!1),r&&this.get(e.analyticsServerUrlV2,r,g.noOp,!1)},this.getAnalyticsServerUrl=()=>e.analyticsServerUrl}static{this.analyticsServerUrl=_}static{this.analyticsServerUrlV2=De}},Le,y,Re=s((()=>{Le=class{constructor(e=!1){this.log=e=>{this.showLogs&&console.log(e)},this.error=e=>{this.showLogs&&console.error(e)},this.warning=e=>{this.showLogs&&console.warn(e)},this.showLogs=e}setLogging(e){this.showLogs=e}isLogging(){return this.showLogs}},y=new Le}));Re();function ze(e){return typeof window>`u`||!window.shaka?!1:typeof shaka.Player==`function`&&e?.constructor===shaka.Player}function Be(e){return typeof window>`u`||!window.Hls?!1:typeof Hls==`function`&&e?.constructor===Hls}let Ve={isShaka:ze,isHlsjs:Be};v();var He=class{setUp(){y.log(`setting up cast session`),this.castSession=cast.framework.CastContext.getInstance().getCurrentSession(),this.addMessageListener()}addMessageListener(){let e=this.castSession.getApplicationMetadata();if(!e||e.namespaces.indexOf(`urn:x-cast:com.gumlet.ingest.cast`)<0){y.log(`No analytics on chrome cast receiver enabled!`);return}y.log(`adding message listener`),this.castSession.addMessageListener(Te,(e,t)=>{y.log(`Received: ${e} ${t}`);try{let e=JSON.parse(t);this.handleReceiverMessage(e)}catch{y.error(`Message parsing failed ${t}`)}})}handleReceiverMessage(e){y.log(e)}sendMessage(e){let t=this.castSession.getApplicationMetadata();if(!t||t.namespaces.indexOf(`urn:x-cast:com.gumlet.ingest.cast`)<0){y.log(`No analytics on chrome cast receiver enabled!`);return}y.log(`Sending message: ${JSON.stringify(e)}`),this.castSession.sendMessage(Te,e)}};v(),Re();var Ue=class{setUp(){this.messageBus=cast.receiver.CastReceiverManager.getInstance().getCastMessageBus(Te,cast.receiver.CastMessageBus.MessageType.JSON),y.log(this.messageBus),this.messageBus.onMessage=e=>{y.log(`Received message from cast client: ${JSON.stringify(e)}`);let t=e.data;this.handleClientMessage(t)}}setCallback(e){this.callback=e}handleClientMessage(e){this.callback(e)}sendMessage(e){this.messageBus.broadcast(e)}};let b={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`,ERROR_RECOVERED:`event_error_recovered`};var We=`2.0.9`,Ge=500,Ke=`user-agent`,x=``,qe=`?`,S={FUNCTION:`function`,OBJECT:`object`,STRING:`string`,UNDEFINED:`undefined`},C=`browser`,w=`cpu`,T=`device`,E=`engine`,D=`os`,Je=`result`,O=`name`,k=`type`,A=`vendor`,j=`version`,M=`architecture`,Ye=`major`,N=`model`,Xe=`console`,P=`mobile`,F=`tablet`,I=`smarttv`,L=`wearable`,Ze=`xr`,Qe=`embedded`,$e=`fetcher`,R=`inapp`,et=`brands`,z=`formFactors`,tt=`fullVersionList`,B=`platform`,nt=`platformVersion`,rt=`bitness`,V=`sec-ch-ua`,it=V+`-full-version-list`,at=V+`-arch`,ot=V+`-`+rt,st=V+`-form-factors`,ct=V+`-`+P,lt=V+`-`+N,ut=V+`-`+B,dt=ut+`-version`,ft=[et,tt,P,N,B,nt,M,z,rt],pt=`Amazon`,mt=`Apple`,ht=`ASUS`,gt=`BlackBerry`,H=`Google`,_t=`Huawei`,vt=`Lenovo`,yt=`Honor`,bt=`LG`,xt=`Microsoft`,St=`Motorola`,Ct=`Nvidia`,wt=`OnePlus`,Tt=`OPPO`,Et=`Samsung`,Dt=`Sharp`,Ot=`Sony`,kt=`Xiaomi`,At=`Zebra`,jt=`Chrome`,Mt=`Chromium`,U=`Chromecast`,Nt=`Edge`,Pt=`Firefox`,Ft=`Opera`,It=`Facebook`,Lt=`Sogou`,Rt=`Mobile `,zt=` Browser`,Bt=`Windows`,W=typeof window!==S.UNDEFINED&&window.navigator?window.navigator:void 0,G=W&&W.userAgentData?W.userAgentData:void 0,Vt=function(e,t){var n={},r=t;if(!Wt(t))for(var i in r={},t)for(var a in t[i])r[a]=t[i][a].concat(r[a]?r[a]:[]);for(var o in e)n[o]=r[o]&&r[o].length%2==0?r[o].concat(e[o]):e[o];return n},Ht=function(e){for(var t={},n=0;n<e.length;n++)t[e[n].toUpperCase()]=e[n];return t},Ut=function(e,t){if(typeof e===S.OBJECT&&e.length>0){for(var n in e)if(K(t)==K(e[n]))return!0;return!1}return Gt(e)?K(t)==K(e):!1},Wt=function(e,t){for(var n in e)return/^(browser|cpu|device|engine|os)$/.test(n)||(t?Wt(e[n]):!1)},Gt=function(e){return typeof e===S.STRING},Kt=function(e){if(e){for(var t=[],n=Jt(/\\?\"/g,e).split(`,`),r=0;r<n.length;r++)if(n[r].indexOf(`;`)>-1){var i=Xt(n[r]).split(`;v=`);t[r]={brand:i[0],version:i[1]}}else t[r]=Xt(n[r]);return t}},K=function(e){return Gt(e)?e.toLowerCase():e},qt=function(e){return Gt(e)?Jt(/[^\d\.]/g,e).split(`.`)[0]:void 0},q=function(e){for(var t in e)if(e.hasOwnProperty(t)){var n=e[t];typeof n==S.OBJECT&&n.length==2?this[n[0]]=n[1]:this[n]=void 0}return this},Jt=function(e,t){return Gt(t)?t.replace(e,x):t},Yt=function(e){return Jt(/\\?\"/g,e)},Xt=function(e,t){return e=Jt(/^\s\s*/,String(e)),typeof t===S.UNDEFINED?e:e.substring(0,t)},Zt=function(e,t){if(!(!e||!t))for(var n=0,r,i,a,o,s,c;n<t.length&&!s;){var l=t[n],u=t[n+1];for(r=i=0;r<l.length&&!s&&l[r];)if(s=l[r++].exec(e),s)for(a=0;a<u.length;a++)c=s[++i],o=u[a],typeof o===S.OBJECT&&o.length>0?o.length===2?typeof o[1]==S.FUNCTION?this[o[0]]=o[1].call(this,c):this[o[0]]=o[1]:o.length>=3&&(typeof o[1]===S.FUNCTION&&!(o[1].exec&&o[1].test)?o.length>3?this[o[0]]=c?o[1].apply(this,o.slice(2)):void 0:this[o[0]]=c?o[1].call(this,c,o[2]):void 0:o.length==3?this[o[0]]=c?c.replace(o[1],o[2]):void 0:o.length==4?this[o[0]]=c?o[3].call(this,c.replace(o[1],o[2])):void 0:o.length>4&&(this[o[0]]=c?o[3].apply(this,[c.replace(o[1],o[2])].concat(o.slice(4))):void 0)):this[o]=c||void 0;n+=2}},J=function(e,t){for(var n in t)if(typeof t[n]===S.OBJECT&&t[n].length>0){for(var r=0;r<t[n].length;r++)if(Ut(t[n][r],e))return n===qe?void 0:n}else if(Ut(t[n],e))return n===qe?void 0:n;return t.hasOwnProperty(`*`)?t[`*`]:e},Qt={ME:`4.90`,"NT 3.51":`3.51`,"NT 4.0":`4.0`,2e3:[`5.0`,`5.01`],XP:[`5.1`,`5.2`],Vista:`6.0`,7:`6.1`,8:`6.2`,"8.1":`6.3`,10:[`6.4`,`10.0`],NT:``},$t={embedded:`Automotive`,mobile:`Mobile`,tablet:[`Tablet`,`EInk`],smarttv:`TV`,wearable:`Watch`,xr:[`VR`,`XR`],"?":[`Desktop`,`Unknown`],"*":void 0},en={Chrome:`Google Chrome`,Edge:`Microsoft Edge`,"Edge WebView2":`Microsoft Edge WebView2`,"Chrome WebView":`Android WebView`,"Chrome Headless":`HeadlessChrome`,"Huawei Browser":`HuaweiBrowser`,"MIUI Browser":`Miui Browser`,"Opera Mobi":`OperaMobile`,Yandex:`YaBrowser`},tn={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[j,[O,Rt+`Chrome`]],[/webview.+edge\/([\w\.]+)/i],[j,[O,Nt+` WebView`]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[j,[O,`Edge`]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[O,j],[/opios[\/ ]+([\w\.]+)/i],[j,[O,Ft+` Mini`]],[/\bop(?:rg)?x\/([\w\.]+)/i],[j,[O,Ft+` GX`]],[/\bopr\/([\w\.]+)/i],[j,[O,Ft]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[j,[O,`Baidu`]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[j,[O,`Maxthon`]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(atlas|flock|rockmelt|midori|epiphany|silk|skyfire|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon|otter|dooble|(?:hi|lg |ovi|qute)browser|palemoon)\/v?([-\w\.]+)/i,/(brave)(?: chrome)?\/([\d\.]+)/i,/(aloha|heytap|ovi|115|surf|qwant)browser\/([\d\.]+)/i,/(qwant)(?:ios|mobile)\/([\d\.]+)/i,/(ecosia|weibo)(?:__| \w+@)([\d\.]+)/i],[O,j],[/quark(?:pc)?\/([-\w\.]+)/i],[j,[O,`Quark`]],[/\bddg\/([\w\.]+)/i],[j,[O,`DuckDuckGo`]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[j,[O,`UCBrowser`]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[j,[O,`WeChat`]],[/konqueror\/([\w\.]+)/i],[j,[O,`Konqueror`]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[j,[O,`IE`]],[/ya(?:search)?browser\/([\w\.]+)/i],[j,[O,`Yandex`]],[/slbrowser\/([\w\.]+)/i],[j,[O,`Smart `+vt+zt]],[/(av(?:ast|g|ira))\/([\w\.]+)/i],[[O,/(.+)/,`$1 Secure`+zt],j],[/norton\/([\w\.]+)/i],[j,[O,`Norton Private`+zt]],[/\bfocus\/([\w\.]+)/i],[j,[O,Pt+` Focus`]],[/ mms\/([\w\.]+)$/i],[j,[O,Ft+` Neon`]],[/ opt\/([\w\.]+)$/i],[j,[O,Ft+` Touch`]],[/coc_coc\w+\/([\w\.]+)/i],[j,[O,`Coc Coc`]],[/dolfin\/([\w\.]+)/i],[j,[O,`Dolphin`]],[/coast\/([\w\.]+)/i],[j,[O,Ft+` Coast`]],[/miuibrowser\/([\w\.]+)/i],[j,[O,`MIUI`+zt]],[/fxios\/([\w\.-]+)/i],[j,[O,Rt+Pt]],[/\bqihoobrowser\/?([\w\.]*)/i],[j,[O,`360`]],[/\b(qq)\/([\w\.]+)/i],[[O,/(.+)/,`$1Browser`],j],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[O,/(.+)/,`$1`+zt],j],[/samsungbrowser\/([\w\.]+)/i],[j,[O,Et+` Internet`]],[/metasr[\/ ]?([\d\.]+)/i],[j,[O,Lt+` Explorer`]],[/(sogou)mo\w+\/([\d\.]+)/i],[[O,Lt+` Mobile`],j],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[O,j],[/(lbbrowser|luakit|rekonq|steam(?= (clie|tenf|gameo)))/i],[O],[/ome\/([\w\.]+).+(iron(?= saf)|360(?=[es]e$))/i],[j,O],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[O,It],j,[k,R]],[/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/(daum)apps[\/ ]([\w\.]+)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(bing)(?:web|sapphire)\/([\w\.]+)/i,/(instagram|snapchat|klarna)[\/ ]([-\w\.]+)/i],[O,j,[k,R]],[/\bgsa\/([\w\.]+) .*safari\//i],[j,[O,`GSA`],[k,R]],[/(?:musical_ly|trill)(?:.+app_?version\/|_)([\w\.]+)/i],[j,[O,`TikTok`],[k,R]],[/\[(linkedin)app\]/i],[O,[k,R]],[/(zalo(?:app)?)[\/\sa-z]*([\w\.-]+)/i],[[O,/(.+)/,`Zalo`],j,[k,R]],[/(chromium)[\/ ]([-\w\.]+)/i],[O,j],[/ome-(lighthouse)$/i],[O,[k,$e]],[/headlesschrome(?:\/([\w\.]+)| )/i],[j,[O,jt+` Headless`]],[/wv\).+chrome\/([\w\.]+).+edgw\//i],[j,[O,Nt+` WebView2`]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[O,jt+` WebView`],j],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[j,[O,`Android`+zt]],[/chrome\/([\w\.]+) mobile/i],[j,[O,Rt+`Chrome`]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[O,j],[/version\/([\w\.\,]+) .*mobile(?:\/\w+ | ?)safari/i],[j,[O,Rt+`Safari`]],[/iphone .*mobile(?:\/\w+ | ?)safari/i],[[O,Rt+`Safari`]],[/version\/([\w\.\,]+) .*(safari)/i],[j,O],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[O,[j,`1`]],[/(webkit|khtml)\/([\w\.]+)/i],[O,j],[/(?:mobile|tablet);.*(firefox)\/([\w\.-]+)/i],[[O,Rt+Pt],j],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[O,`Netscape`],j],[/(wolvic|librewolf)\/([\w\.]+)/i],[O,j],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[j,[O,Pt+` Reality`]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+(?= .+rv\:.+gecko\/\d+)|[0-4][\w\.]+(?!.+compatible))/i,/(amaya|dillo|doris|icab|ladybird|lynx|mosaic|netsurf|obigo|polaris|w3m|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/\b(links) \(([\w\.]+)/i],[O,[j,/_/g,`.`]],[/(cobalt)\/([\w\.]+)/i],[O,[j,/[^\d\.]+./,x]]],cpu:[[/\b((amd|x|x86[-_]?|wow|win)64)\b/i],[[M,`amd64`]],[/(ia32(?=;))/i,/\b((i[346]|x)86)(pc)?\b/i],[[M,`ia32`]],[/\b(aarch64|arm(v?[89]e?l?|_?64))\b/i],[[M,`arm64`]],[/\b(arm(v[67])?ht?n?[fl]p?)\b/i],[[M,`armhf`]],[/( (ce|mobile); ppc;|\/[\w\.]+arm\b)/i],[[M,`arm`]],[/ sun4\w[;\)]/i],[[M,`sparc`]],[/\b(avr32|ia64(?=;)|68k(?=\))|\barm(?=v([1-7]|[5-7]1)l?|;|eabi)|(irix|mips|sparc)(64)?\b|pa-risc)/i,/((ppc|powerpc)(64)?)( mac|;|\))/i,/(?:osf1|[freopnt]{3,4}bsd) (alpha)/i],[[M,/ower/,x,K]],[/mc680.0/i],[[M,`68k`]],[/winnt.+\[axp/i],[[M,`alpha`]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[N,[A,Et],[k,F]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr]|browser)[-\w]+)/i,/sec-(sgh\w+)/i],[N,[A,Et],[k,P]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)[\/\);]/i],[N,[A,mt],[k,P]],[/\b(?:ios|apple\w+)\/.+[\(\/](ipad)/i,/\b(ipad)[\d,]*[;\] ].+(mac |i(pad)?)os/i],[N,[A,mt],[k,F]],[/(macintosh);/i],[N,[A,mt]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[N,[A,Dt],[k,P]],[/\b((?:brt|eln|hey2?|gdi|jdn)-a?[lnw]09|(?:ag[rm]3?|jdn2|kob2)-a?[lw]0[09]hn)(?: bui|\)|;)/i],[N,[A,yt],[k,F]],[/honor([-\w ]+)[;\)]/i],[N,[A,yt],[k,P]],[/\b((?:ag[rs][2356]?k?|bah[234]?|bg[2o]|bt[kv]|cmr|cpn|db[ry]2?|jdn2|got|kob2?k?|mon|pce|scm|sht?|[tw]gr|vrd)-[ad]?[lw][0125][09]b?|605hw|bg2-u03|(?:gem|fdr|m2|ple|t1)-[7a]0[1-4][lu]|t1-a2[13][lw]|mediapad[\w\. ]*(?= bui|\)))\b(?!.+d\/s)/i],[N,[A,_t],[k,F]],[/(?:huawei) ?([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][\dc][adnt]?)\b(?!.+d\/s)/i],[N,[A,_t],[k,P]],[/oid[^\)]+; (2[\dbc]{4}(182|283|rp\w{2})[cgl]|m2105k81a?c)(?: bui|\))/i,/\b(?:xiao)?((?:red)?mi[-_ ]?pad[\w- ]*)(?: bui|\))/i],[[N,/_/g,` `],[A,kt],[k,F]],[/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/oid[^\)]+; (redmi[\-_ ]?(?:note|k)?[\w_ ]+|m?[12]\d[01]\d\w{3,6}|poco[\w ]+|(shark )?\w{3}-[ah]0|qin ?[1-3](s\+|ultra| pro)?)( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note|max|cc)?[_ ]?(?:\d{0,2}\w?)[_ ]?(?:plus|se|lite|pro)?( 5g|lte)?)(?: bui|\))/i,/ ([\w ]+) miui\/v?\d/i],[[N,/_/g,` `],[A,kt],[k,P]],[/droid.+; (cph2[3-6]\d[13579]|((gm|hd)19|(ac|be|in|kb)20|(d[en]|eb|le|mt)21|ne22)[0-2]\d|p[g-l]\w[1m]10)\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[N,[A,wt],[k,P]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[N,[A,Tt],[k,P]],[/\b(opd2(\d{3}a?))(?: bui|\))/i],[N,[A,J,{OnePlus:[`203`,`304`,`403`,`404`,`413`,`415`],"*":Tt}],[k,F]],[/(vivo (5r?|6|8l?|go|one|s|x[il]?[2-4]?)[\w\+ ]*)(?: bui|\))/i],[N,[A,`BLU`],[k,P]],[/; vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[N,[A,`Vivo`],[k,P]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[N,[A,`Realme`],[k,P]],[/(ideatab[-\w ]+|602lv|d-42a|a101lv|a2109a|a3500-hv|s[56]000|pb-6505[my]|tb-?x?\d{3,4}(?:f[cu]|xu|[av])|yt\d?-[jx]?\d+[lfmx])( bui|;|\)|\/)/i,/lenovo ?(b[68]0[08]0-?[hf]?|tab(?:[\w- ]+?)|tb[\w-]{6,7})( bui|;|\)|\/)/i],[N,[A,vt],[k,F]],[/lenovo[-_ ]?([-\w ]+?)(?: bui|\)|\/)/i],[N,[A,vt],[k,P]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ]([\w\s]+)(\)| bui)/i,/((?:moto(?! 360)[-\w\(\) ]+|xt\d{3,4}[cgkosw\+]?[-\d]*|nexus 6)(?= bui|\)))/i],[N,[A,St],[k,P]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[N,[A,St],[k,F]],[/\b(?:lg)?([vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[N,[A,bt],[k,F]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+(?!.*(?:browser|netcast|android tv|watch|webos))(\w+)/i,/\blg-?([\d\w]+) bui/i],[N,[A,bt],[k,P]],[/(nokia) (t[12][01])/i],[A,N,[k,F]],[/(?:maemo|nokia).*(n900|lumia \d+|rm-\d+)/i,/nokia[-_ ]?(([-\w\. ]*?))( bui|\)|;|\/)/i],[[N,/_/g,` `],[k,P],[A,`Nokia`]],[/(pixel (c|tablet))\b/i],[N,[A,H],[k,F]],[/droid.+;(?: google)? (g(01[13]a|020[aem]|025[jn]|1b60|1f8f|2ybb|4s1m|576d|5nz6|8hhn|8vou|a02099|c15s|d1yq|e2ae|ec77|gh2x|kv4x|p4bc|pj41|r83y|tt9q|ur25|wvk6)|pixel[\d ]*a?( pro)?( xl)?( fold)?( \(5g\))?)( bui|\))/i],[N,[A,H],[k,P]],[/(google) (pixelbook( go)?)/i],[A,N],[/droid.+; (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-\w\w\d\d)(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[N,[A,Ot],[k,P]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[N,`Xperia Tablet`],[A,Ot],[k,F]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[N,[A,pt],[k,F]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[N,/(.+)/g,`Fire Phone $1`],[A,pt],[k,P]],[/(playbook);[-\w\),; ]+(rim)/i],[N,A,[k,F]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/(?:blackberry|\(bb10;) (\w+)/i],[N,[A,gt],[k,P]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[N,[A,ht],[k,F]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[N,[A,ht],[k,P]],[/(nexus 9)/i],[N,[A,`HTC`],[k,F]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[A,[N,/_/g,` `],[k,P]],[/tcl (xess p17aa)/i,/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])(_\w(\w|\w\w))?(\)| bui)/i],[N,[A,`TCL`],[k,F]],[/droid [\w\.]+; (418(?:7d|8v)|5087z|5102l|61(?:02[dh]|25[adfh]|27[ai]|56[dh]|59k|65[ah])|a509dl|t(?:43(?:0w|1[adepqu])|50(?:6d|7[adju])|6(?:09dl|10k|12b|71[efho]|76[hjk])|7(?:66[ahju]|67[hw]|7[045][bh]|71[hk]|73o|76[ho]|79w|81[hks]?|82h|90[bhsy]|99b)|810[hs]))(_\w(\w|\w\w))?(\)| bui)/i],[N,[A,`TCL`],[k,P]],[/(itel) ((\w+))/i],[[A,K],N,[k,J,{tablet:[`p10001l`,`w7001`],"*":`mobile`}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[N,[A,`Acer`],[k,F]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[N,[A,`Meizu`],[k,P]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[N,[A,`Ulefone`],[k,P]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[N,[A,`Energizer`],[k,P]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[N,[A,`Cat`],[k,P]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[N,[A,`Smartfren`],[k,P]],[/droid.+; (a(in)?(0(15|59|6[35])|142)p?)/i],[N,[A,`Nothing`],[k,P]],[/; (x67 5g|tikeasy \w+|ac[1789]\d\w+)( b|\))/i,/archos ?(5|gamepad2?|([\w ]*[t1789]|hello) ?\d+[\w ]*)( b|\))/i],[N,[A,`Archos`],[k,F]],[/archos ([\w ]+)( b|\))/i,/; (ac[3-6]\d\w{2,8})( b|\))/i],[N,[A,`Archos`],[k,P]],[/; (n159v)/i],[N,[A,`HMD`],[k,P]],[/(imo) (tab \w+)/i,/(infinix|tecno) (x1101b?|p904|dp(7c|8d|10a)( pro)?|p70[1-3]a?|p904|t1101)/i],[A,N,[k,F]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus(?! zenw)|dell|jolla|meizu|motorola|polytron|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (blu|hmd|imo|infinix|lava|oneplus|tcl|wiko)[_ ]([\w\+ ]+?)(?: bui|\)|; r)/i,/(hp) ([\w ]+\w)/i,/(microsoft); (lumia[\w ]+)/i,/(oppo) ?([\w ]+) bui/i,/(hisense) ([ehv][\w ]+)\)/i,/droid[^;]+; (philips)[_ ]([sv-x][\d]{3,4}[xz]?)/i],[A,N,[k,P]],[/(kobo)\s(ereader|touch)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i],[A,N,[k,F]],[/(surface duo)/i],[N,[A,xt],[k,F]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[N,[A,`Fairphone`],[k,P]],[/((?:tegranote|shield t(?!.+d tv))[\w- ]*?)(?: b|\))/i],[N,[A,Ct],[k,F]],[/(sprint) (\w+)/i],[A,N,[k,P]],[/(kin\.[onetw]{3})/i],[[N,/\./g,` `],[A,xt],[k,P]],[/droid.+; ([c6]+|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[N,[A,At],[k,F]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[N,[A,At],[k,P]],[/(philips)[\w ]+tv/i,/smart-tv.+(samsung)/i],[A,[k,I]],[/hbbtv.+maple;(\d+)/i],[[N,/^/,`SmartTV`],[A,Et],[k,I]],[/(vizio)(?: |.+model\/)(\w+-\w+)/i,/tcast.+(lg)e?. ([-\w]+)/i],[A,N,[k,I]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[A,bt],[k,I]],[/(apple) ?tv/i],[A,[N,mt+` TV`],[k,I]],[/crkey.*devicetype\/chromecast/i],[[N,U+` Third Generation`],[A,H],[k,I]],[/crkey.*devicetype\/([^/]*)/i],[[N,/^/,`Chromecast `],[A,H],[k,I]],[/fuchsia.*crkey/i],[[N,U+` Nest Hub`],[A,H],[k,I]],[/crkey/i],[[N,U],[A,H],[k,I]],[/(portaltv)/i],[N,[A,It],[k,I]],[/droid.+aft(\w+)( bui|\))/i],[N,[A,pt],[k,I]],[/(shield \w+ tv)/i],[N,[A,Ct],[k,I]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[N,[A,Dt],[k,I]],[/(bravia[\w ]+)( bui|\))/i],[N,[A,Ot],[k,I]],[/(mi(tv|box)-?\w+) bui/i],[N,[A,kt],[k,I]],[/Hbbtv.*(technisat) (.*);/i],[A,N,[k,I]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[A,/.+\/(\w+)/,`$1`,J,{LG:`lge`}],[N,Xt],[k,I]],[/(playstation \w+)/i],[N,[A,Ot],[k,Xe]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[N,[A,xt],[k,Xe]],[/(ouya)/i,/(nintendo) (\w+)/i,/(retroid) (pocket ([^\)]+))/i,/(valve).+(steam deck)/i,/droid.+; ((shield|rgcube|gr0006))( bui|\))/i],[[A,J,{Nvidia:`Shield`,Anbernic:`RGCUBE`,Logitech:`GR0006`}],N,[k,Xe]],[/\b(sm-[lr]\d\d[0156][fnuw]?s?|gear live)\b/i],[N,[A,Et],[k,L]],[/((pebble))app/i,/(asus|google|lg|oppo|xiaomi) ((pixel |zen)?watch[\w ]*)( bui|\))/i],[A,N,[k,L]],[/(ow(?:19|20)?we?[1-3]{1,3})/i],[N,[A,Tt],[k,L]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[N,[A,mt],[k,L]],[/(opwwe\d{3})/i],[N,[A,wt],[k,L]],[/(moto 360)/i],[N,[A,St],[k,L]],[/(smartwatch 3)/i],[N,[A,Ot],[k,L]],[/(g watch r)/i],[N,[A,bt],[k,L]],[/droid.+; (wt63?0{2,3})\)/i],[N,[A,At],[k,L]],[/droid.+; (glass) \d/i],[N,[A,H],[k,Ze]],[/(pico) ([\w ]+) os\d/i],[A,N,[k,Ze]],[/(quest( \d| pro)?s?).+vr/i],[N,[A,It],[k,Ze]],[/mobile vr; rv.+firefox/i],[[k,Ze]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[A,[k,Qe]],[/(aeobc)\b/i],[N,[A,pt],[k,Qe]],[/(homepod).+mac os/i],[N,[A,mt],[k,Qe]],[/windows iot/i],[[k,Qe]],[/droid.+; ([\w- ]+) (4k|android|smart|google)[- ]?tv/i],[N,[k,I]],[/\b((4k|android|smart|opera)[- ]?tv|tv; rv:|large screen[\w ]+safari)\b/i],[[k,I]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew|; hmsc).+?(mobile|vr|\d) safari/i],[N,[k,J,{mobile:`Mobile`,xr:`VR`,"*":F}]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[k,F]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[k,P]],[/droid .+?; ([\w\. -]+)( bui|\))/i],[N,[A,`Generic`]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[j,[O,Nt+`HTML`]],[/(arkweb)\/([\w\.]+)/i],[O,j],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[j,[O,`Blink`]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links|dillo)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[O,j],[/ladybird\//i],[[O,`LibWeb`]],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[j,O]],os:[[/(windows nt) (6\.[23]); arm/i],[[O,/N/,`R`],[j,J,Qt]],[/(windows (?:phone|mobile|iot))(?: os)?[\/ ]?([\d\.]*( se)?)/i,/(windows)[\/ ](1[01]|2000|3\.1|7|8(\.1)?|9[58]|me|server 20\d\d( r2)?|vista|xp)/i],[O,j],[/windows nt ?([\d\.\)]*)(?!.+xbox)/i,/\bwin(?=3| ?9|n)(?:nt| 9x )?([\d\.;]*)/i],[[j,/(;|\))/g,``,J,Qt],[O,Bt]],[/(windows ce)\/?([\d\.]*)/i],[O,j],[/[adehimnop]{4,7}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv|ios(?=.+ip(?:ad|hone)|.+apple ?tv)|ip(?:ad|hone)(?: |.+i(?:pad)?)os|apple ?tv.+ios)[\/ ]([\w\.]+)/i,/\btvos ?([\w\.]+)/i,/cfnetwork\/.+darwin/i],[[j,/_/g,`.`],[O,`iOS`]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+(haiku|morphos))/i],[[O,`macOS`],[j,/_/g,`.`]],[/android ([\d\.]+).*crkey/i],[j,[O,U+` Android`]],[/fuchsia.*crkey\/([\d\.]+)/i],[j,[O,U+` Fuchsia`]],[/crkey\/([\d\.]+).*devicetype\/smartspeaker/i],[j,[O,U+` SmartSpeaker`]],[/linux.*crkey\/([\d\.]+)/i],[j,[O,U+` Linux`]],[/crkey\/([\d\.]+)/i],[j,[O,U]],[/droid ([\w\.]+)\b.+(android[- ]x86)/i],[j,O],[/(ubuntu) ([\w\.]+) like android/i],[[O,/(.+)/,`$1 Touch`],j],[/(harmonyos)[\/ ]?([\d\.]*)/i,/(android|bada|blackberry|kaios|maemo|meego|openharmony|qnx|rim tablet os|sailfish|series40|symbian|tizen)\w*[-\/\.; ]?([\d\.]*)/i],[O,j],[/\(bb(10);/i],[j,[O,gt]],[/(?:symbian ?os|symbos|s60(?=;)|series ?60)[-\/ ]?([\w\.]*)/i],[j,[O,`Symbian`]],[/mozilla\/[\d\.]+ \((?:mobile[;\w ]*|tablet|tv|[^\)]*(?:viera|lg(?:l25|-d300)|alcatel ?o.+|y300-f1)); rv:([\w\.]+)\).+gecko\//i],[j,[O,Pt+` OS`]],[/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i,/webos(?:[ \/]?|\.tv-20(?=2[2-9]))(\d[\d\.]*)/i],[j,[O,`webOS`]],[/web0s;.+?(?:chr[o0]me|safari)\/(\d+)/i],[[j,J,{25:`120`,24:`108`,23:`94`,22:`87`,6:`79`,5:`68`,4:`53`,3:`38`,2:`538`,1:`537`,"*":`TV`}],[O,`webOS`]],[/watch(?: ?os[,\/ ]|\d,\d\/)([\d\.]+)/i],[j,[O,`watchOS`]],[/cros [\w]+(?:\)| ([\w\.]+)\b)/i],[j,[O,`Chrome OS`]],[/kepler ([\w\.]+); (aft|aeo)/i],[j,[O,`Vega OS`]],[/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) (\w+)/i,/(xbox); +xbox ([^\);]+)/i,/(pico) .+os([\w\.]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/linux.+(mint)[\/\(\) ]?([\w\.]*)/i,/(mageia|vectorlinux|fuchsia|arcaos|arch(?= ?linux))[;l ]([\d\.]*)/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire|knoppix)(?: gnu[\/ ]linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/\b(aix)[; ]([1-9\.]{0,4})/i,/(hurd|linux|morphos)(?: (?:arm|x86|ppc)\w*| ?)([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) ?(r\d)?/i],[O,j],[/(sunos) ?([\d\.]*)/i],[[O,`Solaris`],j],[/\b(beos|os\/2|amigaos|openvms|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[O,j]]},nn=(function(){var e={init:{},isIgnore:{},isIgnoreRgx:{},toString:{}};return q.call(e.init,[[C,[O,j,Ye,k]],[w,[M]],[T,[k,N,A]],[E,[O,j]],[D,[O,j]]]),q.call(e.isIgnore,[[C,[j,Ye]],[E,[j]],[D,[j]]]),q.call(e.isIgnoreRgx,[[C,/ ?browser$/i],[D,/ ?os$/i]]),q.call(e.toString,[[C,[O,j]],[w,[M]],[T,[A,N]],[E,[O,j]],[D,[O,j]]]),e})(),rn=function(e,t){var n=nn.init[t],r=nn.isIgnore[t]||0,i=nn.isIgnoreRgx[t]||0,a=nn.toString[t]||0;function o(){q.call(this,n)}return o.prototype.getItem=function(){return e},o.prototype.withClientHints=function(){return G?G.getHighEntropyValues(ft).then(function(t){return e.setCH(new an(t,!1)).parseCH().get()}):e.parseCH().get()},o.prototype.withFeatureCheck=function(){return e.detectFeature().get()},t!=Je&&(o.prototype.is=function(e){var t=!1;for(var n in this)if(this.hasOwnProperty(n)&&!Ut(r,n)&&K(i?Jt(i,this[n]):this[n])==K(i?Jt(i,e):e)){if(t=!0,e!=S.UNDEFINED)break}else if(e==S.UNDEFINED&&t){t=!t;break}return t},o.prototype.toString=function(){var e=x;for(var t in a)typeof this[a[t]]!==S.UNDEFINED&&(e+=(e?` `:x)+this[a[t]]);return e||S.UNDEFINED}),o.prototype.then=function(e){var t=this,n=function(){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e])};n.prototype={is:o.prototype.is,toString:o.prototype.toString,withClientHints:o.prototype.withClientHints,withFeatureCheck:o.prototype.withFeatureCheck};var r=new n;return e(r),r},new o};function an(e,t){if(e||={},q.call(this,ft),t)q.call(this,[[et,Kt(e[V])],[tt,Kt(e[it])],[P,/\?1/.test(e[ct])],[N,Yt(e[lt])],[B,Yt(e[ut])],[nt,Yt(e[dt])],[M,Yt(e[at])],[z,Kt(e[st])],[rt,Yt(e[ot])]]);else for(var n in e)this.hasOwnProperty(n)&&typeof e[n]!==S.UNDEFINED&&(this[n]=e[n])}function Y(e,t,n,r){return q.call(this,[[`itemType`,e],[`ua`,t],[`uaCH`,r],[`rgxMap`,n],[`data`,rn(this,e)]]),this}Y.prototype.get=function(e){return e?this.data.hasOwnProperty(e)?this.data[e]:void 0:this.data},Y.prototype.set=function(e,t){return this.data[e]=t,this},Y.prototype.setCH=function(e){return this.uaCH=e,this},Y.prototype.detectFeature=function(){if(W&&W.userAgent==this.ua)switch(this.itemType){case C:W.brave&&typeof W.brave.isBrave==S.FUNCTION&&this.set(O,`Brave`);break;case T:!this.get(k)&&G&&G[P]&&this.set(k,P),this.get(N)==`Macintosh`&&W&&typeof W.standalone!==S.UNDEFINED&&W.maxTouchPoints&&W.maxTouchPoints>2&&this.set(N,`iPad`).set(k,F);break;case D:!this.get(O)&&G&&G[B]&&this.set(O,G[B]);break;case Je:var e=this.data,t=function(t){return e[t].getItem().detectFeature().get()};this.set(C,t(C)).set(w,t(w)).set(T,t(T)).set(E,t(E)).set(D,t(D))}return this},Y.prototype.parseUA=function(){switch(this.itemType!=Je&&Zt.call(this.data,this.ua,this.rgxMap),this.itemType){case C:this.set(Ye,qt(this.get(j)));break;case D:if(this.get(O)==`iOS`&&this.get(j)==`18.6`){var e=/\) Version\/([\d\.]+)/.exec(this.ua);e&&parseInt(e[1].substring(0,2),10)>=26&&this.set(j,e[1])}break}return this},Y.prototype.parseCH=function(){var e=this.uaCH,t=this.rgxMap;switch(this.itemType){case C:case E:var n=e[tt]||e[et],r;if(n)for(var i=0;i<n.length;i++){var a=n[i].brand||n[i],o=n[i].version;this.itemType==C&&!/not.a.brand/i.test(a)&&(!r||/Chrom/.test(r)&&a!=Mt||r==Nt&&/WebView2/.test(a))&&(a=J(a,en),r=this.get(O),r&&!/Chrom/.test(r)&&/Chrom/.test(a)||this.set(O,a).set(j,o).set(Ye,qt(o)),r=a),this.itemType==E&&a==Mt&&this.set(j,o)}break;case w:var s=e[M];s&&(s&&e[rt]==`64`&&(s+=`64`),Zt.call(this.data,s+`;`,t));break;case T:if(e[P]&&this.set(k,P),e[N]&&(this.set(N,e[N]),!this.get(k)||!this.get(A))){var c={};Zt.call(c,`droid 9; `+e[N]+`)`,t),!this.get(k)&&c.type&&this.set(k,c.type),!this.get(A)&&c.vendor&&this.set(A,c.vendor)}if(e[z]){var l;if(typeof e[z]!=`string`)for(var u=0;!l&&u<e[z].length;)l=J(e[z][u++],$t);else l=J(e[z],$t);this.set(k,l)}break;case D:var d=e[B];if(d){var f=e[nt];d==Bt&&(f=parseInt(qt(f),10)>=13?`11`:`10`),this.set(O,d).set(j,f)}this.get(O)==Bt&&e[N]==`Xbox`&&this.set(O,`Xbox`).set(j,void 0);break;case Je:var p=this.data,m=function(t){return p[t].getItem().setCH(e).parseCH().get()};this.set(C,m(C)).set(w,m(w)).set(T,m(T)).set(E,m(E)).set(D,m(D))}return this};function X(e,t,n){if(typeof e===S.OBJECT?(Wt(e,!0)?(typeof t===S.OBJECT&&(n=t),t=e):(n=e,t=void 0),e=void 0):typeof e===S.STRING&&!Wt(t,!0)&&(n=t,t=void 0),n)if(typeof n.append===S.FUNCTION){var r={};n.forEach(function(e,t){r[String(t).toLowerCase()]=e}),n=r}else{var i={};for(var a in n)n.hasOwnProperty(a)&&(i[String(a).toLowerCase()]=n[a]);n=i}if(!(this instanceof X))return new X(e,t,n).getResult();var o=typeof e===S.STRING?e:n&&n[Ke]?n[Ke]:W&&W.userAgent?W.userAgent:x,s=new an(n,!0),c=t?Vt(tn,t):tn,l=function(e){return e==Je?function(){return new Y(e,o,c,s).set(`ua`,o).set(C,this.getBrowser()).set(w,this.getCPU()).set(T,this.getDevice()).set(E,this.getEngine()).set(D,this.getOS()).get()}:function(){return new Y(e,o,c[e],s).parseUA().get()}};return q.call(this,[[`getBrowser`,l(C)],[`getCPU`,l(w)],[`getDevice`,l(T)],[`getEngine`,l(E)],[`getOS`,l(D)],[`getResult`,l(Je)],[`getUA`,function(){return o}],[`setUA`,function(e){return Gt(e)&&(o=Xt(e,Ge)),this}]]).setUA(o),this}X.VERSION=We,X.BROWSER=Ht([O,j,Ye,k]),X.CPU=Ht([M]),X.DEVICE=Ht([N,A,k,Xe,P,I,F,L,Qe]),X.ENGINE=X.OS=Ht([O,j]);let on=()=>{let e=window.navigator.userAgent;return/(tablet|ipad|playbook|silk)|(android(?!.*mobi))/i.test(e)?`tablet`:/Mobile|iP(hone|od)|Android|BlackBerry|IEMobile|Kindle|Silk-Accelerated|(hpw|web)OS|Opera M(obi|ini)/.test(e)?`mobile`:`desktop`};v();var sn=class e extends be{constructor(...t){super(...t),this.sendRequest=function(t,n){t.event_family=`player_init`,this.get(e.analyticsServerUrl,t,n)},this.sendRequestSynchronous=function(t,n){t.event_family=`player_init`,this.get(e.analyticsServerUrl,t,n,!1)},this.getAnalyticsServerUrl=()=>e.analyticsServerUrl}static{this.analyticsServerUrl=_}};v();var cn=class e extends be{constructor(...t){super(...t),this.sendRequest=function(t,n){t.event_family=`session`;let r=Ce()?Fe({...t}):null;this.get(e.analyticsServerUrl,t,n),r&&this.get(e.analyticsServerUrlV2,r,g.noOp)},this.sendRequestSynchronous=function(t,n){t.event_family=`session`;let r=Ce()?Fe({...t}):null;this.get(e.analyticsServerUrl,t,n,!1),r&&this.get(e.analyticsServerUrlV2,r,g.noOp,!1)},this.getAnalyticsServerUrl=()=>e.analyticsServerUrl}static{this.analyticsServerUrl=_}static{this.analyticsServerUrlV2=De}};let Z=new X().getResult();var ln=class{constructor(e){this.SDKVersion=`1.0.0`,this.config=e,this.sessionCreationCall=new cn,this.playerInitCall=new sn,this.setConfigParameters()}setConfigParameters(e=this.config){this.customData1=g.getCustomDataString(e.customData1),this.customData2=g.getCustomDataString(e.customData2),this.customData3=g.getCustomDataString(e.customData3),this.customData4=g.getCustomDataString(e.customData4),this.customData5=g.getCustomDataString(e.customData5),this.customData6=g.getCustomDataString(e.customData6),this.customData7=g.getCustomDataString(e.customData7),this.customData8=g.getCustomDataString(e.customData8),this.customData9=g.getCustomDataString(e.customData9),this.customData10=g.getCustomDataString(e.customData10),this.customPlayerIntegrationVersion=g.getCustomDataString(e.customPlayerIntegrationVersion),this.customPlayerName=g.getCustomDataString(e.customPlayerName),this.customPageType=g.getCustomDataString(e.customPageType),this.customUserId=g.getCustomDataString(e.userId),this.userName=g.getCustomDataString(e.userName),this.userEMail=g.getCustomDataString(e.userEMail??e.userEmail),this.userPhone=g.getCustomDataString(e.userPhone),this.userProfileImage=g.getCustomDataString(e.userProfileImage),this.userAddressLine1=g.getCustomDataString(e.userAddressLine1),this.userAddressLine2=g.getCustomDataString(e.userAddressLine2),this.userCity=g.getCustomDataString(e.userCity),this.userState=g.getCustomDataString(e.userState),this.userCountry=g.getCustomDataString(e.userCountry),this.userZipcode=g.getCustomDataString(e.userZipcode),this.customContentType=g.getCustomDataString(e.customContentType),this.customVideoDurationMillis=g.getCustomDataString(e.customVideoDurationMillis),this.customEncodingVariant=g.getCustomDataString(e.customEncodingVariant),this.customVideoLanguage=g.getCustomDataString(e.customVideoLanguage),this.customVideoId=g.getCustomDataString(e.customVideoId),this.customVideoSeries=g.getCustomDataString(e.customVideoSeries),this.customVideoProducer=g.getCustomDataString(e.customVideoProducer),this.customVideoTitle=g.getCustomDataString(e.customVideoTitle),this.customVideoVariantName=g.getCustomDataString(e.customVideoVariantName),this.customVideoVariant=g.getCustomDataString(e.customVideoVariant),this.SDKVersion=`1.0.0`,this.experimentName=e.experimentName}updateCustomData(e){this.customData1=g.getCustomDataString(e.customData1),this.customData2=g.getCustomDataString(e.customData2),this.customData3=g.getCustomDataString(e.customData3),this.customData4=g.getCustomDataString(e.customData4),this.customData5=g.getCustomDataString(e.customData5),this.customData6=g.getCustomDataString(e.customData6),this.customData7=g.getCustomDataString(e.customData7),this.customData8=g.getCustomDataString(e.customData8),this.customData9=g.getCustomDataString(e.customData9),this.customData10=g.getCustomDataString(e.customData10)}updateCustomUserData(e){this.customUserId=g.getCustomDataString(e.userId),this.userName=g.getCustomDataString(e.userName),this.userEMail=g.getCustomDataString(e.userEMail??e.userEmail),this.userPhone=g.getCustomDataString(e.userPhone),this.userProfileImage=g.getCustomDataString(e.userProfileImage),this.userAddressLine1=g.getCustomDataString(e.userAddressLine1),this.userAddressLine2=g.getCustomDataString(e.userAddressLine2),this.userCity=g.getCustomDataString(e.userCity),this.userState=g.getCustomDataString(e.userState),this.userCountry=g.getCustomDataString(e.userCountry),this.userZipcode=g.getCustomDataString(e.userZipcode)}updateCustomVideoData(e){this.customContentType=g.getCustomDataString(e.customContentType),this.customVideoDurationMillis=g.getCustomDataString(e.customVideoDurationMillis),this.customEncodingVariant=g.getCustomDataString(e.customEncodingVariant),this.customVideoLanguage=g.getCustomDataString(e.customVideoLanguage),this.customVideoId=g.getCustomDataString(e.customVideoId),this.customVideoSeries=g.getCustomDataString(e.customVideoSeries),this.customVideoProducer=g.getCustomDataString(e.customVideoProducer),this.customVideoTitle=g.getCustomDataString(e.customVideoTitle),this.customVideoVariantName=g.getCustomDataString(e.customVideoVariantName),this.customVideoVariant=g.getCustomDataString(e.customVideoVariant)}updateCustomPlayerData(e){this.customPlayerIntegrationVersion=g.getCustomDataString(e.customPlayerIntegrationVersion),this.customPlayerName=g.getCustomDataString(e.customPlayerName),this.customPageType=g.getCustomDataString(e.customPageType)}setUserId(e=!1,t=null){if(t){this.userId=t;return}if(e){this.userId=g.uuidv4();return}let n=g.getCookie(`gumlet_user_id`);!n||n===``?this.userId=g.setCookie(`gumlet_user_id`,720*60):this.userId=n}setSessionId(e=!1,t=null,n=!0){if(t){this.sessionId=t,this.setSessionData(),n&&this.sessionCreationCall.sendRequest(this.sessionData,g.noOp);return}if(e){this.sessionId=g.uuidv4();return}let r=g.getCookie(`gumlet_session_id`);!r||r===``?(this.sessionId=g.setCookie(`gumlet_session_id`,30),this.setSessionData(),this.sessionCreationCall.sendRequest(this.sessionData,g.noOp)):(this.sessionId=r,this.setSessionData())}setPlayerInstanceId(e){this.playerInstanceId=e?e():g.uuidv4(),this.setPlayerData()}setPlaybackId(e){this.playbackId=e?e():g.uuidv4()}resetSessionExpiry(){this.config.test||this.config.sessionID||(g.setCookie(`gumlet_session_id`,30,this.sessionId),g.setCookie(`gumlet_user_id`,720*60,this.userId))}setSessionData(){if(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,custom_user_email:this.userEMail,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},this.config.deviceData){let e=this.config.deviceData;this.sessionData.meta_device_name=e.meta_device_name,this.sessionData.meta_device_manufacturer=e.meta_device_manufacturer,this.sessionData.meta_operating_system_version=e.meta_operating_system_version,this.sessionData.meta_operating_system=e.meta_operating_system,this.sessionData.meta_browser=e.meta_browser,this.sessionData.meta_device_display_dpr=e.meta_device_display_dpr,this.sessionData.meta_browser_version=e.meta_browser_version,this.sessionData.meta_device_category=e.meta_device_category,this.sessionData.meta_device_architecture=e.meta_device_architecture,this.sessionData.meta_device_display_width=e.meta_device_display_width,this.sessionData.meta_device_display_height=e.meta_device_display_height,this.sessionData.meta_device_is_touchscreen=e.meta_device_is_touchscreen,this.sessionData.meta_browser_language=e.meta_browser_language}else this.sessionData.meta_device_name=Z.device.model,this.sessionData.meta_device_manufacturer=Z.device.vendor,this.sessionData.meta_operating_system_version=Z.os.version,this.sessionData.meta_operating_system=Z.os.name,this.sessionData.meta_browser=Z.browser.name,this.sessionData.meta_browser_version=Z.browser.version,this.sessionData.meta_device_category=on(),this.sessionData.meta_device_architecture=Z.cpu.architecture,typeof window<`u`&&(this.sessionData.meta_device_display_dpr=parseInt(String(window.devicePixelRatio),10),this.sessionData.meta_device_display_width=window.screen.width,this.sessionData.meta_device_display_height=window.screen.height,this.sessionData.meta_browser_language=navigator?navigator.language||navigator.userLanguage:``,`ontouchstart`in document.documentElement&&(this.sessionData.meta_device_is_touchscreen=`true`))}setPlayerData(e){if(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){let e=this.config.playerData||{};this.playerData.player_preload=e.player_preload,this.playerData.player_autoplay=e.player_autoplay,this.playerData.player_software_version=e.player_software_version,this.playerData.player_integration_version=e.player_integration_version,this.playerData.player_name=e.player_name,this.playerData.player_language_code=e.player_language_code,this.playerData.player_software=e.player_software,this.playerData.meta_page_url=e.meta_page_url,this.playerData.meta_page_type=e.meta_page_type,this.playerData.player_height_pixels=e.player_height_pixels,this.playerData.player_width_pixels=e.player_width_pixels}e&&g.validNumber(e.videoWindowHeight)&&(this.playerData.player_height_pixels=e.videoWindowHeight),e&&g.validNumber(e.videoWindowWidth)&&(this.playerData.player_width_pixels=e.videoWindowWidth),e&&g.validBoolean(e.autoplay)&&(this.playerData.player_autoplay=e.autoplay),e&&g.validBoolean(e.preload)&&(this.playerData.player_preload=e.preload),e&&g.validString(e.version)&&(this.playerData.player_software_version=e.version),e&&g.validString(e.audioLanguage)&&(this.playerData.player_language_code=e.audioLanguage),e&&g.validString(e.playerSoftware)&&(this.playerData.player_software=e.playerSoftware)}},un=class{constructor(e,t){this.sample={},this.currentTime=0,this.isMuted=!1,this.orientation=`undetected`,this.playbackWatchTime=0,this.config=e,this.session=t;try{this.orientation=screen.orientation.type.match(/\w+/)[0],screen.orientation.addEventListener(`change`,()=>{this.orientation=screen.orientation.type.match(/\w+/)[0]})}catch{this.orientation=`undetected`}}setDuration(e){}setPlaybackWatchTime(e){this.playbackWatchTime=e}getPlaybackWatchTime(){return this.playbackWatchTime}setVideoData(e){e&&g.validNumber(e.duration)&&(this.videoDuration=g.calculateTime(e.duration)),e&&g.validString(e.streamType)&&(this.videoSourceType=e.streamType,e.streamType===`dash`&&g.validString(e.mpdUrl)?(this.videoSourceUrl=e.mpdUrl,this.videoSourceHostname=new URL(this.videoSourceUrl).hostname):e.streamType===`hls`&&g.validString(e.m3u8Url)?(this.videoSourceUrl=e.m3u8Url,this.videoSourceHostname=new URL(this.videoSourceUrl).hostname):e.streamType===`hls`&&g.validString(e.streamUrl)?(this.videoSourceUrl=e.streamUrl,this.videoSourceHostname=new URL(this.videoSourceUrl).hostname):e.streamType===`progressive`&&g.validString(e.progUrl)?(this.videoSourceUrl=e.progUrl,this.videoSourceHostname=new URL(this.videoSourceUrl).hostname):e?.streamUrl&&(this.videoSourceUrl=e.streamUrl,this.videoSourceHostname=new URL(this.videoSourceUrl).hostname)),e?.streamUrl&&(this.videoSourceUrl=e.streamUrl),e?.sourceHostName&&(this.videoSourceHostname=e.sourceHostName),e?.muted&&(this.isMuted=e.muted),e?.currentVideoData?.height&&g.validNumber(e.currentVideoData.height)&&e.currentVideoData.height>0&&(this.videoHeightPixels=e.currentVideoData.height),e?.currentVideoData?.width&&g.validNumber(e.currentVideoData.width)&&e.currentVideoData.width>0&&(this.videoWidthPixels=e.currentVideoData.width),e?.currentVideoData?.bitrate&&g.validNumber(e.currentVideoData.bitrate)&&e.currentVideoData.bitrate>-1&&(this.videoBitrate=e.currentVideoData.bitrate/1e6),e?.currentVideoData?.audioCodec&&g.validString(e.currentVideoData.audioCodec)&&e.currentVideoData.audioCodec.length>0&&(this.audioCodec=e.currentVideoData.audioCodec),e?.currentVideoData&&g.validString(e.currentVideoData.videoCodec)&&e.currentVideoData.videoCodec.length>0&&(this.videoCodec=e.currentVideoData.videoCodec);let t=this.session,n=0;if(this.videoHeightPixels&&t.playerData?.player_height_pixels&&t.sessionData?.meta_device_display_dpr?n=t.playerData.player_height_pixels*t.sessionData.meta_device_display_dpr/this.videoHeightPixels-1:(this.upscalePercentage=void 0,this.downscalePercentage=void 0),this.videoHeightPixels&&t.playerData?.player_height_pixels&&t.sessionData?.meta_device_display_dpr&&(n>0?(this.upscalePercentage=n*100,this.downscalePercentage=0):n<0?(this.upscalePercentage=0,this.downscalePercentage=n*100*-1):(this.upscalePercentage=0,this.downscalePercentage=0)),this.videoSourceUrl)try{let e=new URL(this.videoSourceUrl);e.hostname===`video.gumlet.io`&&!t.customVideoId&&(t.customVideoId=e.pathname.split(`/`)[2])}catch{}}setPlaybackSettingsFromLoadedEvent(e){e&&g.validNumber(e.currentTime)&&(this.currentTime=g.calculateTime(e.currentTime)),e&&g.validBoolean(e.isFullScreen)&&(this.isFullScreen=e.isFullScreen),e&&g.validBoolean(e.isCasting)&&(this.isCasting=e.isCasting)}setupSample(){let e=this.session;this.sample={property_id:e.propertyId,session_id:e.sessionId,user_id:e.userId,player_instance_id:e.playerInstanceId,playback_id:e.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:e.customContentType,custom_video_duration_millis:e.customVideoDurationMillis,custom_encoding_variant:e.customEncodingVariant,custom_video_language:e.customVideoLanguage,custom_video_id:e.customVideoId,custom_video_series:e.customVideoSeries,custom_video_producer:e.customVideoProducer,custom_video_title:e.customVideoTitle,custom_video_variant_name:e.customVideoVariantName,custom_video_variant:e.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:e.customData1,custom_data_2:e.customData2,custom_data_3:e.customData3,custom_data_4:e.customData4,custom_data_5:e.customData5,custom_data_6:e.customData6,custom_data_7:e.customData7,custom_data_8:e.customData8,custom_data_9:e.customData9,custom_data_10:e.customData10,custom_event_data:void 0,playback_watch_time:void 0}}getSample(e=null,t={}){let n=this.session,r=this.sample;if(r.event=e,r.event_id=n.config?.getUUID?n.config.getUUID():g.uuidv4(),r.custom_data_1=n.customData1,r.custom_data_2=n.customData2,r.custom_data_3=n.customData3,r.custom_data_4=n.customData4,r.custom_data_5=n.customData5,r.custom_data_6=n.customData6,r.custom_data_7=n.customData7,r.custom_data_8=n.customData8,r.custom_data_9=n.customData9,r.custom_data_10=n.customData10,r.custom_content_type=n.customContentType,r.custom_video_duration_millis=n.customVideoDurationMillis,r.custom_encoding_variant=n.customEncodingVariant,r.custom_video_language=n.customVideoLanguage,r.custom_video_id=n.customVideoId,r.custom_video_series=n.customVideoSeries,r.custom_video_producer=n.customVideoProducer,r.custom_video_title=n.customVideoTitle,r.custom_video_variant_name=n.customVideoVariantName,r.custom_video_variant=n.customVideoVariant,r.fullscreen=this.isFullScreen,r.muted=this.isMuted,r.video_width_pixels=this.videoWidthPixels,r.video_height_pixels=this.videoHeightPixels,r.video_total_duration_millis=this.videoDuration,r.bitrate=this.videoBitrate,r.audio_codec=this.audioCodec,r.video_codec=this.videoCodec,r.orientation=this.orientation,r.playback_time_instant_millis=this.currentTime,r.video_source_type=this.videoSourceType,r.video_source_url=this.videoSourceUrl,r.video_upscale_percentage=this.upscalePercentage,r.video_downscale_percentage=this.downscalePercentage,r.video_source_hostname=this.videoSourceHostname,r.custom_event_data=void 0,r.playback_watch_time=this.playbackWatchTime,Object.keys(t).forEach(e=>{r[e]=t[e]}),typeof window<`u`&&window.parent!==void 0&&window.navigator)try{typeof window.navigator.getBattery==`function`&&window.navigator.getBattery().then(e=>{e&&(r.battery_level_percentage=e.level*100,r.battery_charging=e.charging)})}catch{}return r}};Re();var dn=class{constructor(e,t){this.licensing=`granted`,this.analyticsCall=e,this.sampleBuilder=t}sendRequest(e,t={}){let n=this.sampleBuilder.getSample(e,t);if(e!==b.END){if(n.playback_time_instant_millis&&n.video_total_duration_millis&&n.playback_time_instant_millis>n.video_total_duration_millis)return}else n.video_total_duration_millis&&(n.playback_time_instant_millis=Math.min(n.playback_time_instant_millis??0,n.video_total_duration_millis));this.analyticsCall.sendRequest(n,g.noOp)}sendRequestAsync(e,t={}){return new Promise((n,r)=>{let i=this.sampleBuilder.getSample(e,t);if(i.playback_time_instant_millis&&i.video_total_duration_millis&&i.playback_time_instant_millis>i.video_total_duration_millis){n(406);return}this.analyticsCall.sendRequestAsync(i).then(e=>n(e)).catch(e=>r(e))})}sendAndClear(e=null,t={}){if(!e){y.log(`event null passed not hitting the ingestion API`);return}this.sampleBuilder.videoDuration&&this.sampleBuilder.videoDuration>864e5||this.sendRequest(e,t)}sendAndClearAsync(e=null,t={}){return new Promise((n,r)=>{if(!e){y.log(`event null passed not hitting the ingestion API`),r(`event null passed not hitting the ingestion API`);return}this.sendRequestAsync(e,t).then(e=>n(e)).catch(e=>r(e))})}sendUnload(){if(this.licensing===`denied`)return;let e=this.sampleBuilder.sample;if(navigator.sendBeacon===void 0){this.sendSynchronous();return}fetch(this.analyticsCall.getAnalyticsServerUrl(),{method:`POST`,body:JSON.stringify(e),headers:{"Content-Type":`application/json`}}).then(e=>{e.ok||this.sendSynchronous()}).catch(()=>{this.sendSynchronous()})}sendSynchronous(){this.licensing!==`denied`&&this.analyticsCall.sendRequestSynchronous(this.sampleBuilder.sample,g.noOp)}},fn=c(((e,t)=>{(function(n,r){typeof e==`object`&&typeof t==`object`?t.exports=r():typeof define==`function`&&define.amd?define(`StateMachine`,[],r):typeof e==`object`?e.StateMachine=r():n.StateMachine=r()})(e,function(){return(function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.i=function(e){return e},n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,`a`,t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p=``,n(n.s=5)})([(function(e,t,n){"use strict";e.exports=function(e,t){var n,r,i;for(n=1;n<arguments.length;n++)for(i in r=arguments[n],r)r.hasOwnProperty(i)&&(e[i]=r[i]);return e}}),(function(e,t,n){"use strict";var r=n(0);e.exports={build:function(e,t){var n,i,a,o=t.plugins;for(n=0,i=o.length;n<i;n++)a=o[n],a.methods&&r(e,a.methods),a.properties&&Object.defineProperties(e,a.properties)},hook:function(e,t,n){var r,i,a,o,s=e.config.plugins,c=[e.context];for(n&&(c=c.concat(n)),r=0,i=s.length;r<i;r++)o=s[r],a=s[r][t],a&&a.apply(o,c)}}}),(function(e,t,n){"use strict";function r(e){if(e.length===0)return e;var t,n,r=e.split(/[_-]/);if(r.length===1&&r[0][0].toLowerCase()===r[0][0])return e;for(n=r[0].toLowerCase(),t=1;t<r.length;t++)n=n+r[t].charAt(0).toUpperCase()+r[t].substring(1).toLowerCase();return n}r.prepended=function(e,t){return t=r(t),e+t[0].toUpperCase()+t.substring(1)},e.exports=r}),(function(e,t,n){"use strict";var r=n(0),i=n(2);function a(e,t){e||={},this.options=e,this.defaults=t.defaults,this.states=[],this.transitions=[],this.map={},this.lifecycle=this.configureLifecycle(),this.init=this.configureInitTransition(e.init),this.data=this.configureData(e.data),this.methods=this.configureMethods(e.methods),this.map[this.defaults.wildcard]={},this.configureTransitions(e.transitions||[]),this.plugins=this.configurePlugins(e.plugins,t.plugin)}r(a.prototype,{addState:function(e){this.map[e]||(this.states.push(e),this.addStateLifecycleNames(e),this.map[e]={})},addStateLifecycleNames:function(e){this.lifecycle.onEnter[e]=i.prepended(`onEnter`,e),this.lifecycle.onLeave[e]=i.prepended(`onLeave`,e),this.lifecycle.on[e]=i.prepended(`on`,e)},addTransition:function(e){this.transitions.indexOf(e)<0&&(this.transitions.push(e),this.addTransitionLifecycleNames(e))},addTransitionLifecycleNames:function(e){this.lifecycle.onBefore[e]=i.prepended(`onBefore`,e),this.lifecycle.onAfter[e]=i.prepended(`onAfter`,e),this.lifecycle.on[e]=i.prepended(`on`,e)},mapTransition:function(e){var t=e.name,n=e.from,r=e.to;return this.addState(n),typeof r!=`function`&&this.addState(r),this.addTransition(t),this.map[n][t]=e,e},configureLifecycle:function(){return{onBefore:{transition:`onBeforeTransition`},onAfter:{transition:`onAfterTransition`},onEnter:{state:`onEnterState`},onLeave:{state:`onLeaveState`},on:{transition:`onTransition`}}},configureInitTransition:function(e){return typeof e==`string`?this.mapTransition(r({},this.defaults.init,{to:e,active:!0})):typeof e==`object`?this.mapTransition(r({},this.defaults.init,e,{active:!0})):(this.addState(this.defaults.init.from),this.defaults.init)},configureData:function(e){return typeof e==`function`?e:typeof e==`object`?function(){return e}:function(){return{}}},configureMethods:function(e){return e||{}},configurePlugins:function(e,t){e||=[];var n,r,i;for(n=0,r=e.length;n<r;n++)i=e[n],typeof i==`function`&&(e[n]=i=i()),i.configure&&i.configure(this);return e},configureTransitions:function(e){var t,n,r,i,a,o=this.defaults.wildcard;for(n=0;n<e.length;n++)for(r=e[n],i=Array.isArray(r.from)?r.from:[r.from||o],a=r.to||o,t=0;t<i.length;t++)this.mapTransition({name:r.name,from:i[t],to:a})},transitionFor:function(e,t){var n=this.defaults.wildcard;return this.map[e][t]||this.map[n][t]},transitionsFor:function(e){var t=this.defaults.wildcard;return Object.keys(this.map[e]).concat(Object.keys(this.map[t]))},allStates:function(){return this.states},allTransitions:function(){return this.transitions}}),e.exports=a}),(function(e,t,n){var r=n(0),i=n(6),a=n(1),o=[null,[]];function s(e,t){this.context=e,this.config=t,this.state=t.init.from,this.observers=[e]}r(s.prototype,{init:function(e){if(r(this.context,this.config.data.apply(this.context,e)),a.hook(this,`init`),this.config.init.active)return this.fire(this.config.init.name,[])},is:function(e){return Array.isArray(e)?e.indexOf(this.state)>=0:this.state===e},isPending:function(){return this.pending},can:function(e){return!this.isPending()&&!!this.seek(e)},cannot:function(e){return!this.can(e)},allStates:function(){return this.config.allStates()},allTransitions:function(){return this.config.allTransitions()},transitions:function(){return this.config.transitionsFor(this.state)},seek:function(e,t){var n=this.config.defaults.wildcard,r=this.config.transitionFor(this.state,e),i=r&&r.to;return typeof i==`function`?i.apply(this.context,t):i===n?this.state:i},fire:function(e,t){return this.transit(e,this.state,this.seek(e,t),t)},transit:function(e,t,n,r){var i=this.config.lifecycle,a=this.config.options.observeUnchangedState||t!==n;return n?this.isPending()?this.context.onPendingTransition(e,t,n):(this.config.addState(n),this.beginTransit(),r.unshift({transition:e,from:t,to:n,fsm:this.context}),this.observeEvents([this.observersForEvent(i.onBefore.transition),this.observersForEvent(i.onBefore[e]),a?this.observersForEvent(i.onLeave.state):o,a?this.observersForEvent(i.onLeave[t]):o,this.observersForEvent(i.on.transition),a?[`doTransit`,[this]]:o,a?this.observersForEvent(i.onEnter.state):o,a?this.observersForEvent(i.onEnter[n]):o,a?this.observersForEvent(i.on[n]):o,this.observersForEvent(i.onAfter.transition),this.observersForEvent(i.onAfter[e]),this.observersForEvent(i.on[e])],r)):this.context.onInvalidTransition(e,t,n)},beginTransit:function(){this.pending=!0},endTransit:function(e){return this.pending=!1,e},failTransit:function(e){throw this.pending=!1,e},doTransit:function(e){this.state=e.to},observe:function(e){if(e.length===2){var t={};t[e[0]]=e[1],this.observers.push(t)}else this.observers.push(e[0])},observersForEvent:function(e){for(var t=0,n=this.observers.length,r,i=[];t<n;t++)r=this.observers[t],r[e]&&i.push(r);return[e,i,!0]},observeEvents:function(e,t,n,r){if(e.length===0)return this.endTransit(r===void 0?!0:r);var i=e[0][0],o=e[0][1],s=e[0][2];if(t[0].event=i,i&&s&&i!==n&&a.hook(this,`lifecycle`,t),o.length===0)return e.shift(),this.observeEvents(e,t,i,r);var c=o.shift(),l=c[i].apply(c,t);return l&&typeof l.then==`function`?l.then(this.observeEvents.bind(this,e,t,i)).catch(this.failTransit.bind(this)):l===!1?this.endTransit(!1):this.observeEvents(e,t,i,l)},onInvalidTransition:function(e,t,n){throw new i(`transition is invalid in current state`,e,t,n,this.state)},onPendingTransition:function(e,t,n){throw new i(`transition is invalid while previous transition is still in progress`,e,t,n,this.state)}}),e.exports=s}),(function(e,t,n){"use strict";var r=n(0),i=n(2),a=n(1),o=n(3),s=n(4),c={is:function(e){return this._fsm.is(e)},can:function(e){return this._fsm.can(e)},cannot:function(e){return this._fsm.cannot(e)},observe:function(){return this._fsm.observe(arguments)},transitions:function(){return this._fsm.transitions()},allTransitions:function(){return this._fsm.allTransitions()},allStates:function(){return this._fsm.allStates()},onInvalidTransition:function(e,t,n){return this._fsm.onInvalidTransition(e,t,n)},onPendingTransition:function(e,t,n){return this._fsm.onPendingTransition(e,t,n)}},l={state:{configurable:!1,enumerable:!0,get:function(){return this._fsm.state},set:function(e){throw Error(`use transitions to change state`)}}};function u(e){return f(this||{},e)}function d(){var e,t;typeof arguments[0]==`function`?(e=arguments[0],t=arguments[1]||{}):(e=function(){this._fsm.apply(this,arguments)},t=arguments[0]||{});var n=new o(t,u);return p(e.prototype,n),e.prototype._fsm.config=n,e}function f(e,t){return p(e,new o(t,u)),e._fsm(),e}function p(e,t){if(typeof e!=`object`||Array.isArray(e))throw Error(`StateMachine can only be applied to objects`);a.build(e,t),Object.defineProperties(e,l),r(e,c),r(e,t.methods),t.allTransitions().forEach(function(t){e[i(t)]=function(){return this._fsm.fire(t,[].slice.call(arguments))}}),e._fsm=function(){this._fsm=new s(this,t),this._fsm.init(arguments)}}u.version=`3.0.1`,u.factory=d,u.apply=f,u.defaults={wildcard:`*`,init:{name:`init`,from:`none`}},e.exports=u}),(function(e,t,n){"use strict";e.exports=function(e,t,n,r,i){this.message=e,this.transition=t,this.from=n,this.to=r,this.current=i}})])})})),pn=l({GumletStateMachine:()=>hn}),mn,hn,gn=s((()=>{mn=d(fn(),1),Re(),v(),hn=class{constructor(e,t={}){this.previousRecordTime=0,this.playbackWatchTime=0,this.lastPlayHeadDuration=0,this.onEnterStateTimestamp=0,this.heartbeatTimestamp=0,this.seekStartedAt=null,this.seekedFrom=0,this.seekedTimestamp=0,this.pausedAtPlayheadMs=0,this.lastPreJumpPlayheadSec=null,this.playTimeStamp=null,this.startupBufferingPending=!1,this.pendingErrorRecovery_=!1,this.States={SETUP:`SETUP`,STARTUP:`STARTUP`,READY:`READY`,PLAYING:`PLAYING`,REBUFFERING:`REBUFFERING`,PAUSE:`PAUSE`,PAUSED_SEEKING:`PAUSED_SEEKING`,END:`END`,ERROR:`ERROR`,CASTING:`CASTING`},this.callbacks=e,this.opts=t,this.createStateMachine()}callEvent(e,t,n){this.fsm.can(e)?this.fsm[e](n,t):y.log(`Ignored Event: ${e}`)}updateMetadata(e){this.callbacks.updateSample(e)}allStates(){return Object.values(this.States)}createStateMachine(){let e=this,t=this.States,n=this.opts,r=[p.PLAY,p.PAUSE,p.SEEK,p.SEEKED,p.PLAYBACK_PLAYING,p.PLAYBACK_FINISHED,p.READY,p.SCREEN_RESIZE,p.END,p.ERROR,p.NON_FATAL_ERROR,p.UN_MUTE,p.MUTE];this.fsm=new mn.default({init:t.SETUP,transitions:[{name:p.TIMECHANGED,from:t.SETUP,to:t.SETUP},{name:p.READY,from:[t.SETUP,t.ERROR],to:t.READY},{name:p.SOURCE_LOADED,from:t.SETUP,to:t.SETUP},{name:p.PLAY,from:t.READY,to:t.STARTUP},{name:p.SOURCE_LOADED,from:t.READY,to:t.READY},{name:p.SEEK,from:t.READY,to:t.READY},{name:p.SEEKED,from:t.READY,to:t.READY},{name:p.MUTE,from:t.READY,to:t.READY},{name:p.UN_MUTE,from:t.READY,to:t.READY},{name:p.VIDEO_CHANGE,from:t.READY,to:t.READY},{name:p.AUDIO_CHANGE,from:t.READY,to:t.READY},{name:p.TIMECHANGED,from:t.STARTUP,to:t.PLAYING},{name:p.START_BUFFERING,from:t.STARTUP,to:t.STARTUP},{name:p.END_BUFFERING,from:t.STARTUP,to:t.STARTUP},{name:p.VIDEO_CHANGE,from:t.STARTUP,to:t.STARTUP},{name:p.AUDIO_CHANGE,from:t.STARTUP,to:t.STARTUP},{name:p.SEEK,from:t.STARTUP,to:t.STARTUP},{name:p.SEEKED,from:t.STARTUP,to:t.STARTUP},{name:p.SOURCE_LOADED,from:t.STARTUP,to:t.STARTUP},{name:p.END,from:t.STARTUP,to:t.END},{name:p.TIMECHANGED,from:t.PLAYING,to:t.PLAYING},{name:p.END_BUFFERING,from:t.PLAYING,to:t.PLAYING},{name:p.SEEK,from:t.PLAYING,to:t.PLAYING},{name:p.SEEKED,from:t.PLAYING,to:t.PLAYING},{name:p.SOURCE_LOADED,from:t.PLAYING,to:t.PLAYING},{name:p.VIDEO_CHANGE,from:t.PLAYING,to:t.PLAYING},{name:p.AUDIO_CHANGE,from:t.PLAYING,to:t.PLAYING},{name:p.MUTE,from:t.PLAYING,to:t.PLAYING},{name:p.UN_MUTE,from:t.PLAYING,to:t.PLAYING},{name:p.PAUSE,from:t.PLAYING,to:t.PAUSE},{name:p.START_BUFFERING,from:t.PLAYING,to:t.REBUFFERING},{name:p.END,from:t.PLAYING,to:t.END},{name:p.START_BUFFERING,from:t.REBUFFERING,to:t.REBUFFERING},{name:p.VIDEO_CHANGE,from:t.REBUFFERING,to:t.REBUFFERING},{name:p.AUDIO_CHANGE,from:t.REBUFFERING,to:t.REBUFFERING},{name:p.PLAY,from:t.REBUFFERING,to:t.PLAYING},{name:p.TIMECHANGED,from:t.REBUFFERING,to:t.PLAYING},{name:p.SEEKED,from:t.REBUFFERING,to:t.PLAYING},{name:p.PAUSE,from:t.REBUFFERING,to:t.PAUSE},{name:p.END,from:t.REBUFFERING,to:t.END},{name:p.TIMECHANGED,from:t.PAUSE,to:t.PAUSE},{name:p.SEEKED,from:t.PAUSE,to:t.PAUSE},{name:p.VIDEO_CHANGE,from:t.PAUSE,to:t.PAUSE},{name:p.AUDIO_CHANGE,from:t.PAUSE,to:t.PAUSE},{name:p.MUTE,from:t.PAUSE,to:t.PAUSE},{name:p.UN_MUTE,from:t.PAUSE,to:t.PAUSE},{name:p.PLAY,from:t.PAUSE,to:t.PLAYING},{name:p.SEEK,from:t.PAUSE,to:t.PAUSED_SEEKING},{name:p.END,from:t.PAUSE,to:t.END},{name:p.SEEK,from:t.PAUSED_SEEKING,to:t.PAUSED_SEEKING},{name:p.AUDIO_CHANGE,from:t.PAUSED_SEEKING,to:t.PAUSED_SEEKING},{name:p.VIDEO_CHANGE,from:t.PAUSED_SEEKING,to:t.PAUSED_SEEKING},{name:p.START_BUFFERING,from:t.PAUSED_SEEKING,to:t.PAUSED_SEEKING},{name:p.END_BUFFERING,from:t.PAUSED_SEEKING,to:t.PAUSED_SEEKING},{name:p.PLAY,from:t.PAUSED_SEEKING,to:t.PAUSED_SEEKING},{name:p.SEEKED,from:t.PAUSED_SEEKING,to:t.PAUSE},{name:p.TIMECHANGED,from:t.PAUSED_SEEKING,to:t.PLAYING},{name:p.PAUSE,from:t.PAUSED_SEEKING,to:t.PAUSE},{name:p.END,from:t.PAUSED_SEEKING,to:t.END},{name:p.SEEK,from:t.END,to:t.END},{name:p.SEEKED,from:t.END,to:t.END},{name:p.TIMECHANGED,from:t.END,to:t.END},{name:p.END_BUFFERING,from:t.END,to:t.END},{name:p.START_BUFFERING,from:t.END,to:t.END},{name:p.END,from:t.END,to:t.END},{name:p.PLAY,from:t.END,to:t.PLAYING},{name:p.ERROR,from:this.allStates(),to:t.ERROR},{name:p.PAUSE,from:t.ERROR,to:t.ERROR},{name:p.PLAY,from:t.ERROR,to:t.PLAYING},{name:p.TIMECHANGED,from:t.ERROR,to:t.PLAYING},{name:p.SOURCE_LOADED,from:t.ERROR,to:t.ERROR},{name:p.METADATA_LOADED,from:t.ERROR,to:t.ERROR},{name:p.START_BUFFERING,from:t.ERROR,to:t.REBUFFERING},{name:p.SEEK,from:t.ERROR,to:t.ERROR},{name:p.SEEKED,from:t.ERROR,to:t.ERROR},{name:p.MUTE,from:t.ERROR,to:t.ERROR},{name:p.UN_MUTE,from:t.ERROR,to:t.ERROR},{name:p.VIDEO_CHANGE,from:t.ERROR,to:t.ERROR},{name:p.AUDIO_CHANGE,from:t.ERROR,to:t.ERROR},{name:p.END_BUFFERING,from:t.ERROR,to:t.ERROR},{name:p.END,from:t.ERROR,to:t.END},...this.allStates().map(e=>({name:p.NON_FATAL_ERROR,from:e,to:e})),{name:p.UNLOAD,from:this.allStates(),to:t.END},{name:p.START_CAST,from:[t.READY,t.PAUSE],to:t.CASTING},{name:p.PAUSE,from:t.CASTING,to:t.CASTING},{name:p.PLAY,from:t.CASTING,to:t.CASTING},{name:p.TIMECHANGED,from:t.CASTING,to:t.CASTING},{name:p.MUTE,from:t.CASTING,to:t.CASTING},{name:p.SEEK,from:t.CASTING,to:t.CASTING},{name:p.SEEKED,from:t.CASTING,to:t.CASTING},{name:p.END_CAST,from:t.CASTING,to:t.READY}],methods:{onBeforeTransition(n,i,a){if(e.callbacks.playbackWatchTime(e.playbackWatchTime),n.transition===p.SEEK&&(n.from===t.PLAYING||n.from===t.CASTING)&&e.seekStartedAt===null&&(e.seekedFrom=Math.round(e.previousRecordTime*1e3)),n.transition===p.SEEK&&n.from===t.PAUSE&&(e.seekedFrom=e.pausedAtPlayheadMs),n.transition===p.PAUSE&&n.from!==t.PAUSED_SEEKING){let t=a?.currentTime;if(typeof t==`number`)if(e.lastPreJumpPlayheadSec!=null)e.pausedAtPlayheadMs=Math.round(e.lastPreJumpPlayheadSec*1e3),e.lastPreJumpPlayheadSec=null;else{let n=e.previousRecordTime;e.pausedAtPlayheadMs=Math.abs(t-n)>=5?Math.round(n*1e3):Math.round(t*1e3)}}r.includes(n.transition)&&(n.transition===p.PLAYBACK_FINISHED&&(e.previousRecordTime=0),a&&(e.previousRecordTime=a.currentTime)),a&&n.transition!==p.SOURCE_LOADED&&(e.lastPlayHeadDuration=a.currentTime*1e3)},onLeaveState(n,r,i){if(!r)return;let a=r-e.onEnterStateTimestamp;i&&n.to!==t.PAUSED_SEEKING&&(y.log(`Setting video time end to ${i.currentTime}, going to ${n.to}`),e.callbacks.setVideoTimeEndFromEvent(i));let o=n.from.toLowerCase();if(n.from===t.PAUSED_SEEKING){let a=r-(e.seekStartedAt??r);e.seekStartedAt=null,e.callbacks.playback_seeked(e.seekedFrom,i.currentTime*1e3,a,n.to),e.callbacks.heartbeat(r,t.PAUSE.toLowerCase(),i),y.log(`Seek was ${a}ms`)}else n.transition===p.UNLOAD&&n.from===t.PLAYING?e.callbacks.playingAndBye(a,o,i):n.from===t.PAUSE&&n.to!==t.PAUSED_SEEKING&&n.to!==t.PLAYING&&(e.callbacks.setVideoTimeStartFromEvent(n.transition),e.callbacks.pause(a,o,i),e.callbacks.heartbeat(r,o,i))},onAfterTransition(t,n,r){e.callbacks.resetSessionExpiry(),t.transition===p.VIDEO_CHANGE?e.callbacks.videoChange(r):t.transition===p.AUDIO_CHANGE?e.callbacks.audioChange(r):t.transition===p.MUTE?(y.log(`Setting sample to muted`),e.callbacks.mute(n,r)):t.transition===p.UN_MUTE&&(y.log(`Setting sample to unmuted`),e.callbacks.unMute(n,r))},onEnterState(i,a,o){i.to===t.ERROR&&(e.pendingErrorRecovery_=!1),e.callbacks.playbackWatchTime(e.playbackWatchTime),r.includes(i.transition)&&o&&(e.previousRecordTime=o.currentTime),i.transition!==p.NON_FATAL_ERROR&&(i.from===`none`&&n.starttime?e.onEnterStateTimestamp=n.starttime:e.onEnterStateTimestamp=a||Date.now()),(i.to===t.PLAYING&&(i.from===t.STARTUP||i.from===t.PAUSE||i.from===t.REBUFFERING||i.from===t.PAUSED_SEEKING||i.from===t.ERROR)||i.from===`none`&&i.to===t.SETUP)&&(e.heartbeatTimestamp=i.from===`none`&&n.starttime?n.starttime:a||Date.now()),o&&i.to!==t.PAUSED_SEEKING&&e.callbacks.setVideoTimeStartFromEvent(o)},onEnterSetup(r,i,a){r.from===`none`&&e.callbacks.setup(i,t.SETUP,a,n)},onEnterReady(n,r,i){n.from===t.SETUP&&e.callbacks.ready(r,t.READY,i)},onEnterStartup(n,r,i){n.transition===p.PLAY&&(e.playTimeStamp=new Date,e.callbacks.first_play(r,t.STARTUP,i))},onEnterPlaying(n,r,i){n.transition===p.PLAY&&n.from===t.PAUSE?(e.callbacks.play(r,t.PLAYING,i),e.callbacks.playing(r,t.PLAYING,i),e.callbacks.heartbeat(r,t.PLAYING,i)):n.from===t.STARTUP?(e.startupBufferingPending&&(e.startupBufferingPending=!1,e.callbacks.start_rebuffer(r,t.REBUFFERING,i),e.callbacks.end_rebuffer(r,t.REBUFFERING,i)),e.callbacks.playing(r,t.PLAYING,i),e.callbacks.playback_started(i)):n.from===t.REBUFFERING?(e.callbacks.end_rebuffer(r,t.REBUFFERING,i),e.pendingErrorRecovery_&&(e.pendingErrorRecovery_=!1,e.callbacks.error_recovered(r,t.ERROR,i))):n.from===t.ERROR&&e.callbacks.error_recovered(r,t.ERROR,i)},onEnterPause(n,r,i){n.from===t.PAUSED_SEEKING&&i&&typeof i.currentTime==`number`&&(e.pausedAtPlayheadMs=i.currentTime*1e3),n.from===t.PLAYING&&(e.callbacks.pause(r,t.PAUSE,i),e.callbacks.heartbeat(r,t.PAUSE,i))},onEnterRebuffering(n,r,i){n.transition===p.START_BUFFERING&&(e.callbacks.start_rebuffer(r,t.REBUFFERING,i),n.from===t.ERROR&&(e.pendingErrorRecovery_=!0))},onBeforeStartBuffering(n,r,i){n.from===t.STARTUP&&(e.startupBufferingPending=!0)},onEnterEnd(n,r,i){e.callbacks.end(r,t.END,i),e.callbacks.heartbeat(r,t.END,i)},onBeforeSourceLoaded(n,r,i){let a=n.from===t.PLAYING&&e.playTimeStamp?Date.now()-e.playTimeStamp.getTime():null;e.callbacks.loaded(r,t.READY,i,a)},onSeek(t,n,r){r&&(e.previousRecordTime=r.currentTime),e.callbacks.playbackWatchTime(e.playbackWatchTime),e.seekStartedAt=e.seekStartedAt??n},onSeeked(n,r,i){if(i&&(e.previousRecordTime=i.currentTime),e.callbacks.playbackWatchTime(e.playbackWatchTime),e.seekedTimestamp=r,i&&(n.from===t.PLAYING&&n.to===t.PLAYING||n.from===t.CASTING&&n.to===t.CASTING)){let t=e.seekStartedAt==null?0:r-e.seekStartedAt;e.callbacks.playback_seeked(e.seekedFrom,i.currentTime*1e3,t,null),y.log(`Seek was ${t}ms`)}e.seekStartedAt=null},onTimechanged(t,n,r){e.callbacks.playbackWatchTime(e.playbackWatchTime);let i=r.currentTime-e.previousRecordTime;i>0&&i<5?(e.playbackWatchTime+=Math.round(i*1e3),e.previousRecordTime=r.currentTime,e.lastPreJumpPlayheadSec=null):(e.lastPreJumpPlayheadSec=e.previousRecordTime,e.previousRecordTime=r.currentTime);let a=n-e.heartbeatTimestamp;a>1e4&&(e.callbacks.setVideoTimeEndFromEvent(r),y.log(`Sending heartbeat`),e.callbacks.heartbeat(a,t.from.toLowerCase(),r),e.heartbeatTimestamp=n,e.callbacks.setVideoTimeStartFromEvent(r),e.callbacks.resetSessionExpiry())},onPlayerError(t,n,r){e.callbacks.error(r)},onPlayerNonFatalError(t,n,r){e.callbacks.error(r)}}})}static pad(e,t){return(e+Array(t).join(` `)).slice(0,t)}}}));function _n(e){return e=e.toLowerCase(),e.endsWith(`.m3u8`)?bn:e.endsWith(`.mp4`)||e.endsWith(`.m4v`)||e.endsWith(`.m4a`)?vn:e.endsWith(`.webm`)?yn:e.endsWith(`.mpd`)?xn:null}var vn,yn,bn,xn,Sn,Cn=s((()=>{vn=`video/mp4`,yn=`video/webm`,bn=`application/x-mpegURL`,xn=`application/dash+xml`,Sn={MP4:vn,WEBM:yn,HLS:bn,DASH:xn}}));function wn(e){return kn[e]}var Tn,En,Dn,On,kn,An=s((()=>{Cn(),{MP4:Tn,WEBM:En,HLS:Dn,DASH:On}=Sn,kn={[Tn]:`mp4`,[En]:`webm`,[Dn]:`hls`,[On]:`dash`}})),jn=l({HTML5Adapter:()=>Nn}),Mn,Nn,Pn=s((()=>{m(),Cn(),An(),Mn=1e3,Nn=class{constructor(e,t,n,r=null){this.lastKnownCurrentTime_=0,this.sourceSwitching_=!1,this.eventCallback=t,this.playerSoftwareName=r??h.HTML,this.stateMachine=n,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()}getCurrentQualityLevelInfo(){return null}isLive(){return!1}getMIMEType(){let e=this.mediaEl;if(!e)return null;let t=e.src||e.querySelector(`source`)?.src||null;return t?_n(t):null}getStreamType(){return wn(this.getMIMEType()??``)}getPlayerVersion(){return null}getStreamURL(){let e=this.mediaEl;return e&&(e.src||e.querySelector(`source`)?.src)||null}destroy(){this.mediaEl&&this.unregisterMediaElement()}setMediaElement(e=null){if(e&&this.mediaEl&&(this.unregisterMediaElement(),this.mediaElementSet_=!1),e&&(this.mediaEl=e),!this.mediaEl)throw Error(`No media element owned`);if(this.mediaElementSet_)throw Error(`Media element already set (only call this once)`);this.mediaElementSet_=!0,this.registerMediaElement(),this.onMaybeReady()}resetMedia(){this.mediaEl=null,this.mediaElEventHandlers=[]}registerMediaElement(){let e=this.mediaEl;e&&(this.listenToMediaElementEvent(`loadedmetadata`,()=>{if(e.readyState!==1)return;this.checkQualityLevelAttributes(!0);let{duration:t,autoplay:n,videoWidth:r,videoHeight:i,muted:a}=e,o={type:`html5`,isLive:this.isLive(),version:this.getPlayerVersion()??`html5`,streamType:this.getStreamType(),streamUrl:this.getStreamURL(),duration:t,autoplay:n,currentVideoData:{height:i,width:r,bitrate:this.analyticsBitrate_,audioCodec:this.audioCodec_,videoCodec:this.videoCodec_},videoWindowWidth:e.clientWidth,videoWindowHeight:e.clientHeight,muted:a};this.needsFirstPlayIntent_||this.eventCallback(p.METADATA_LOADED,o)}),this.listenToMediaElementEvent(`canplay`,()=>{if(this.playbackReadySet_)return;this.playbackReadySet_=!0;let{duration:t,autoplay:n,videoWidth:r,videoHeight:i,muted:a}=e,o={type:`html5`,isLive:this.isLive(),version:this.getPlayerVersion()??`html5`,streamType:this.getStreamType(),streamUrl:this.getStreamURL(),duration:t,autoplay:n,playerSoftware:this.playerSoftwareName,videoWindowWidth:e.clientWidth,videoWindowHeight:e.clientHeight,currentVideoData:{height:i,width:r,bitrate:this.analyticsBitrate_,audioCodec:this.audioCodec_,videoCodec:this.videoCodec_},muted:a};this.eventCallback(p.SOURCE_LOADED,o)}),this.listenToMediaElementEvent(`emptied`,()=>{this.sourceSwitching_=!0}),this.listenToMediaElementEvent(`play`,()=>{let{currentTime:t,videoWidth:n,videoHeight:r}=e;this.needsFirstPlayIntent_=!1,this.eventCallback(p.PLAY,{currentVideoData:{height:r,width:n,bitrate:this.analyticsBitrate_,audioCodec:this.audioCodec_,videoCodec:this.videoCodec_},currentTime:t})}),this.listenToMediaElementEvent(`pause`,()=>{this.onPaused()}),this.listenToMediaElementEvent(`playing`,()=>{let{currentTime:t,videoWidth:n,videoHeight:r}=e;this.isPaused_=!1,!this.needsFirstPlayIntent_&&(this.sourceSwitching_||this.eventCallback(p.TIMECHANGED,{currentVideoData:{height:r,width:n,bitrate:this.analyticsBitrate_,audioCodec:this.audioCodec_,videoCodec:this.videoCodec_},currentTime:t}))}),this.listenToMediaElementEvent(`error`,()=>{let{error:t}=e;this.eventCallback(p.ERROR,{currentTime:this.lastKnownCurrentTime_,code:t?.code,message:t?.message})}),this.listenToMediaElementEvent(`volumechange`,()=>{let{muted:t,currentTime:n}=e;t?this.eventCallback(p.MUTE,{currentTime:n}):this.eventCallback(p.UN_MUTE,{currentTime:n})}),this.listenToMediaElementEvent(`seeking`,()=>{let{currentTime:t,videoWidth:n,videoHeight:r}=e;this.eventCallback(p.SEEK,{currentVideoData:{height:r,width:n,bitrate:this.analyticsBitrate_,audioCodec:this.audioCodec_,videoCodec:this.videoCodec_},currentTime:t,droppedFrames:0})}),this.listenToMediaElementEvent(`seeked`,()=>{let{currentTime:t,videoWidth:n,videoHeight:r}=e;this.bufferingTimeout_&&clearTimeout(this.bufferingTimeout_),this.eventCallback(p.SEEKED,{currentVideoData:{height:r,width:n,bitrate:this.analyticsBitrate_,audioCodec:this.audioCodec_,videoCodec:this.videoCodec_},currentTime:t,droppedFrames:0})}),this.listenToMediaElementEvent(`ended`,()=>{let{currentTime:t,videoWidth:n,videoHeight:r}=e;this.eventCallback(p.END,{currentVideoData:{height:r,width:n,bitrate:this.analyticsBitrate_,audioCodec:this.audioCodec_,videoCodec:this.videoCodec_},currentTime:t})}),this.listenToMediaElementEvent(`timeupdate`,()=>{let{currentTime:t,videoHeight:n,videoWidth:r}=e;this.isBuffering_=!1,t>0&&(this.lastKnownCurrentTime_=t,this.sourceSwitching_=!1),!this.needsFirstPlayIntent_&&(!this.isPaused_&&!this.sourceSwitching_&&this.eventCallback(p.TIMECHANGED,{currentVideoData:{height:n,width:r,bitrate:this.analyticsBitrate_,audioCodec:this.audioCodec_,videoCodec:this.videoCodec_},currentTime:t}),this.checkQualityLevelAttributes(),this.checkPlayheadProgress(),this.previousMediaTime_=t)}),this.listenToMediaElementEvent(`stalled`,()=>{}),this.listenToMediaElementEvent(`waiting`,()=>{this.onBuffering()}))}listenToMediaElementEvent(e,t){if(!this.mediaEl)throw Error(`No media attached`);let n=t.bind(this);this.mediaElEventHandlers.push({event:e,handler:n}),this.mediaEl.addEventListener(e,n,!1)}unregisterMediaElement(){if(!this.mediaEl)throw Error(`No media attached`);for(let{event:e,handler:t}of this.mediaElEventHandlers)this.mediaEl.removeEventListener(e,t,!1);this.resetMedia()}onMaybeReady(){if(!this.needsReadyEvent_||!this.mediaEl)return;this.needsReadyEvent_=!1;let{duration:e,autoplay:t,videoWidth:n,videoHeight:r,muted:i,preload:a}=this.mediaEl,o=this.getStreamURL(),s=a!==`none`,c={type:`html5`,isLive:this.isLive(),version:this.getPlayerVersion()??`html5`,streamType:this.getStreamType(),streamUrl:o,duration:e,autoplay:t,preload:s,playerSoftware:this.playerSoftwareName,currentVideoData:{height:r,width:n,bitrate:this.analyticsBitrate_,audioCodec:this.audioCodec_,videoCodec:this.videoCodec_},videoWindowWidth:this.mediaEl.clientWidth,videoWindowHeight:this.mediaEl.clientHeight,muted:i};this.stateMachine.updateMetadata(c),this.eventCallback(p.READY,c)}onBuffering(){let{currentTime:e}=this.mediaEl;this.isBuffering_||this.isPaused_||(this.eventCallback(p.START_BUFFERING,{currentTime:e}),this.isBuffering_=!0)}onPaused(){if(this.isPaused_)return;if(this.sourceSwitching_){this.isPaused_=!0;return}let{videoHeight:e,videoWidth:t}=this.mediaEl,n=this.lastKnownCurrentTime_>0?this.lastKnownCurrentTime_:this.mediaEl.currentTime??0;this.eventCallback(p.PAUSE,{currentVideoData:{height:e,width:t,bitrate:this.analyticsBitrate_,audioCodec:this.audioCodec_,videoCodec:this.videoCodec_},currentTime:n}),this.isPaused_=!0}checkPlayheadProgress(){let e=this.mediaEl;e.paused&&this.onPaused(),this.bufferingTimeout_&&clearTimeout(this.bufferingTimeout_),this.bufferingTimeout_=setTimeout(()=>{(e.paused||e.ended)&&!this.isBuffering_||e.currentTime-(this.previousMediaTime_??e.currentTime)<Mn&&this.onBuffering()},Mn)}checkQualityLevelAttributes(e=!1){let t=this.mediaEl,n=this.getCurrentQualityLevelInfo();if(!n)return;let{bitrate:r,width:i,height:a,videoCodec:o,audioCodec:s}=n,c=this.isLive();if(c!==this.isLive_&&(this.isLive_=c,e||this.stateMachine.updateMetadata({isLive:c})),this.audioCodec_=s??``,this.videoCodec_=o??``,this.analyticsBitrate_!==r){let n={width:i,height:a,bitrate:r,videoCodec:o,audioCodec:s,currentTime:t.currentTime};e||this.eventCallback(p.VIDEO_CHANGE,n),this.analyticsBitrate_=r??-1}}}})),Fn=l({HlsjsAdapter:()=>In}),In,Ln=s((()=>{m(),Pn(),Cn(),ee(),In=class extends Nn{constructor(e,t,n){super(null,t,n,h.HLSJS),this.hls=e,this.playerSoftwareName=h.HLSJS,this.boundOnMediaAttaching=this.onMediaAttaching.bind(this),this.boundOnMediaDetaching=this.onMediaDetaching.bind(this),this.boundOnManifestLoading=this.onManifestLoading.bind(this),this.hlsErrorHandler=(e,t)=>this.onError(t),this.resetMedia(),this.registerHlsEvents()}getCurrentQualityLevelInfo(){let e=this.hls,t=e.levels?.[e.currentLevel];if(!t)return null;let n=t.attrs,r=n.BANDWIDTH?parseInt(n.BANDWIDTH,10):0,i=n.RESOLUTION?.width?parseInt(n.RESOLUTION.width,10):0,a=n.RESOLUTION?.height?parseInt(n.RESOLUTION.height,10):0,o=null,s=null;if(n.CODECS){let e=n.CODECS.split(`,`);s=e[0]??null,o=e.length>1?e[1]:null}return{bitrate:r,width:i,height:a,audioCodec:o,videoCodec:s}}isLive(){let e=this.hls;return e.currentLevel<0?!1:!!(e.levels?.[e.currentLevel])?.details?.live}getPlayerVersion(){return Hls.version}getMIMEType(){return Sn.HLS}getStreamURL(){return this.hls.url??null}destroy(){let e=this.hls;e.off(Hls.Events.MEDIA_ATTACHING,this.boundOnMediaAttaching),e.off(Hls.Events.MEDIA_DETACHING,this.boundOnMediaDetaching),e.off(Hls.Events.MANIFEST_LOADING,this.boundOnManifestLoading),e.off(Hls.Events.ERROR,this.hlsErrorHandler),super.destroy()}registerHlsEvents(){let e=this.hls;if(!Hls)throw Error(`Hls.js is not installed (must be loaded before analytics module)`);e.on(Hls.Events.MEDIA_ATTACHING,this.boundOnMediaAttaching),e.on(Hls.Events.MEDIA_DETACHING,this.boundOnMediaDetaching),e.on(Hls.Events.MANIFEST_LOADING,this.boundOnManifestLoading),e.on(Hls.Events.ERROR,this.hlsErrorHandler),e.media&&this.onMediaAttaching(),e.url&&this.onManifestLoading()}onMediaAttaching(){this.mediaEl||(this.mediaEl=this.hls.media,this.registerMediaElement(),this.onMaybeReady())}onMediaDetaching(){this.unregisterMediaElement()}onManifestLoading(){this.onMaybeReady()}onError(e){let t=e,n=this.lastKnownCurrentTime_>0?this.lastKnownCurrentTime_:this.mediaEl?.currentTime??0;t?.fatal===!0&&t?.details===`internalException`&&console.error(e),this.eventCallback(p.ERROR,{currentTime:n,code:t?.type,message:JSON.stringify({details:t?.details,fatal:t?.fatal,type:t?.type,fragment_url:t?.url,error:{message:t?.error?.message,stack:t?.error?.stack},extra:{networkDetails:{status:t?.networkDetails?.status,statusText:t?.networkDetails?.statusText,url:t?.networkDetails?.url,responseHeaders:t?.networkDetails?.responseHeaders,responseText:t?.networkDetails?.responseText,responseURL:t?.networkDetails?.responseURL,data:t?.networkDetails?.data}}})})}}})),Rn=l({ShakaAdapter:()=>zn}),zn,Bn=s((()=>{Pn(),Cn(),ee(),m(),zn=class extends Nn{constructor(e,t,n,r){if(super(r,t,n,h.SHAKA),typeof shaka>`u`)throw Error("`shaka` lib is not installed (must be loaded before analytics module)");this.shakaPlayer=e,this.playerSoftwareName=h.SHAKA,this.shakaErrorHandler=e=>{this.onGumletShakaError(e,this.eventCallback,this.mediaEl).catch(()=>{let e=this.lastKnownCurrentTime_>0?this.lastKnownCurrentTime_:this.mediaEl?.currentTime??0;this.eventCallback(p.ERROR,{currentTime:e,code:`error_handler_exception`,message:`Shaka error handler threw before firing callback`})})},this.registerShakaEvents()}getPlayerVersion(){return shaka.Player.version}isLive(){return this.shakaPlayer?.isLive()??!1}getMIMEType(){return this.shakaPlayer?.getManifestType?.()===`HLS`?Sn.HLS:Sn.DASH}getStreamURL(){return this.shakaPlayer?.getAssetUri()??null}getCurrentQualityLevelInfo(){let e=this.shakaPlayer.getVariantTracks().filter(e=>e.active).find(e=>e.videoCodec!==null||e.videoId!==null);return e?{bitrate:e.videoBandwidth??e.bandwidth??null,width:e.width??null,height:e.height??null,videoCodec:e.videoCodec??null,audioCodec:e.audioCodec??null}:null}destroy(){this.shakaPlayer.removeEventListener(`error`,this.shakaErrorHandler),super.destroy()}registerShakaEvents(){if(!this.shakaPlayer)throw Error(`Shaka player object is not defined`);this.shakaPlayer.addEventListener(`error`,this.shakaErrorHandler)}getEnumNameFromValue(e,t){if(!e||t==null)return null;for(let[n,r]of Object.entries(e))if(r===t)return n;return null}getShakaErrorCodeName(e){let t=globalThis.shaka?.util?.Error?.Code;return this.getEnumNameFromValue(t,e)}getShakaErrorCategoryName(e){let t=globalThis.shaka?.util?.Error?.Category;return this.getEnumNameFromValue(t,e)}getBufferedRanges(e){if(!e?.buffered)return[];let t=[];for(let n=0;n<e.buffered.length;n+=1)t.push({start:e.buffered.start(n),end:e.buffered.end(n)});return t}getPlaybackQuality(e){if(!e?.getVideoPlaybackQuality)return null;let t=e.getVideoPlaybackQuality();return{droppedVideoFrames:t.droppedVideoFrames,totalVideoFrames:t.totalVideoFrames,corruptedVideoFrames:t.corruptedVideoFrames}}getMediaElementState(e,t){return{readyState:e?.readyState??null,networkState:e?.networkState??null,currentSrc:e?.currentSrc??null,currentTime:e?.currentTime??t??null,paused:e?.paused??null,ended:e?.ended??null,seeking:e?.seeking??null,playbackRate:e?.playbackRate??null,muted:e?.muted??null,videoWidth:e?.videoWidth??null,videoHeight:e?.videoHeight??null}}getHtml5MediaError(e){let t=e?.error;return t?{code:t.code??null,message:t?.message??null}:null}getQualityLevelInfoFallback(){let e=this.shakaPlayer.getVariantTracks().find(e=>e.videoCodec!==null||e.videoId!==null);return e?{bitrate:e.videoBandwidth??e.bandwidth??null,width:e.width??null,height:e.height??null,videoCodec:e.videoCodec??null,audioCodec:e.audioCodec??null}:null}getExtraDataHint(e,t){if(!Array.isArray(e))return null;let n={item_count:e.length,item_types:e.map(e=>e===null?`null`:Array.isArray(e)?`array`:typeof e)};return t?.includes(`DECODE`)&&(n.decode_context={first:e[0]??null,second:e[1]??null}),n}async onGumletShakaError(e,t,n){let r=this.lastKnownCurrentTime_>0?this.lastKnownCurrentTime_:n?.currentTime??0,i=e;if(!i.detail){t(p.ERROR,{currentTime:r,code:`not_set_by_shaka`,message:`{}`});return}let a=i.detail,o=[];if(a.data)for(let e of a.data)o.push(e);let s=[],c=null,l=null,u=null;try{let e=[],t=this.shakaPlayer.getVariantTracks();if(t.forEach(t=>{e.push({width:t.width,height:t.height,bitrate:t.videoBandwidth??t.bandwidth,framerate:t.frameRate,contentType:`${t.mimeType}; codecs="${t.videoCodec}"`})}),navigator?.mediaCapabilities?.decodingInfo)for(let t of e)try{let e={type:`media-source`,video:{contentType:t.contentType,width:t.width??0,height:t.height??0,bitrate:t.bitrate??0,framerate:t.framerate??0},keySystemConfiguration:{keySystem:`com.widevine.alpha`,video:{contentType:t.contentType}}},n=await navigator.mediaCapabilities.decodingInfo(e);s.push({...n,keySystemAccess:n.keySystemAccess?.getConfiguration()})}catch{}c=this.getCurrentQualityLevelInfo(),c||(l=this.getQualityLevelInfoFallback()),u={manifest_type:this.shakaPlayer.getManifestType?.()??null,asset_uri:this.shakaPlayer.getAssetUri?.()??null,is_live:this.shakaPlayer.isLive?.()??null,player_version:this.getPlayerVersion(),variant_track_count:t.length}}catch{}let d=!a.severity||a.severity===2?p.ERROR:p.NON_FATAL_ERROR,f=a.category??a.v??null,m=this.getShakaErrorCodeName(a.code),h=this.getShakaErrorCategoryName(f);t(d,{currentTime:r,code:a.code,message:JSON.stringify({category:f,category_name:h,code:a.code,code_name:m,severity:a.severity,handled:a.handled,timestamp:i.timestamp,extra_data:o,extra_data_hint:this.getExtraDataHint(o,m),media_capabilities:s,selected_quality_info:c,selected_quality_info_fallback:l,html5_media_error:this.getHtml5MediaError(n),media_element_state:this.getMediaElementState(n,r),buffered_ranges:this.getBufferedRanges(n),playback_quality:this.getPlaybackQuality(n),shaka_runtime_context:u})})}}}));v(),Re();var Vn=class e{static{this.PAGE_LOAD_TYPE={FOREGROUND:1,BACKGROUND:2}}static{this.LICENSE_CALL_PENDING_TIMEOUT=200}static{this.PAGE_LOAD_TYPE_TIMEOUT=200}static{this.CAST_RECEIVER_CONFIG_MESSAGE=`CAST_RECEIVER_CONFIG_MESSAGE`}constructor(t){this.previousState=void 0,this.previousStateTimeStamp=new Date,this.previousStateMono=0,this.firstPlayTimestamp=0,this.startupTime=0,this.pageLoadType=e.PAGE_LOAD_TYPE.FOREGROUND,this.droppedSampleFrames=0,this.autoplay=void 0,this.isCastClient=!1,this.isCastReceiver=!1,this.isAllowedToSendSamples=!1,this.samplesQueue=[],this.customEventHandler=(e,t)=>{this.sampleBuilder.sample.custom_event_data=JSON.stringify(t),this.sendAnalyticsRequestAndClearValues(e,{custom_event_data:JSON.stringify(t)})},this.customEventHandlerAsync=(e,t)=>new Promise((n,r)=>{let i=JSON.stringify(t);this.sendAnalyticsRequestAndClearValuesAsync(e,{custom_event_data:i}).then(e=>n(e)).catch(e=>r(e))}),this.getCurrentImpressionId=()=>this.sample.impressionId,this.setDroppedFrames=e=>{},this.register=async(e,t={})=>{t.starttime?t.starttime=g.convertEpochTime(t.starttime):t.starttime=g.getCurrentTimestamp();let{GumletStateMachine:n}=await Promise.resolve().then(()=>(gn(),pn));if(this.analyticsStateMachine=new n(this.stateMachineCallbacks,t),!e){let{HTML5Adapter:e}=await Promise.resolve().then(()=>(Pn(),jn));return this.adapter=new e(this.mediaElement,this.record,this.analyticsStateMachine),this.analyticsStateMachine}if(Ve.isHlsjs(e)){let{HlsjsAdapter:t}=await Promise.resolve().then(()=>(Ln(),Fn));this.adapter=new t(e,this.record,this.analyticsStateMachine)}else if(Ve.isShaka(e)){let{ShakaAdapter:n}=await Promise.resolve().then(()=>(Bn(),Rn));this.adapter=new n(e,this.record,this.analyticsStateMachine,t.mediaElement??null)}else{let{HTML5Adapter:t}=await Promise.resolve().then(()=>(Pn(),jn));this.adapter=new t(e,this.record,this.analyticsStateMachine)}this.adapter||y.error(`Could not detect player.`)},this.registerHLSJSPlayer=async(e,t={})=>{t.starttime?t.starttime=g.convertEpochTime(t.starttime):t.starttime=g.getCurrentTimestamp();let{GumletStateMachine:n}=await Promise.resolve().then(()=>(gn(),pn));this.analyticsStateMachine=new n(this.stateMachineCallbacks,t);let{HlsjsAdapter:r}=await Promise.resolve().then(()=>(Ln(),Fn));this.adapter=new r(e,this.record,this.analyticsStateMachine)},this.registerShakaPlayer=async(e,t={})=>{t.starttime?t.starttime=g.convertEpochTime(t.starttime):t.starttime=g.getCurrentTimestamp();let{GumletStateMachine:n}=await Promise.resolve().then(()=>(gn(),pn));this.analyticsStateMachine=new n(this.stateMachineCallbacks,t);let{ShakaAdapter:r}=await Promise.resolve().then(()=>(Bn(),Rn));this.adapter=new r(e,this.record,this.analyticsStateMachine,t.mediaElement)},this.registerHTML5Player=async(e,t={})=>{t.starttime?t.starttime=g.convertEpochTime(t.starttime):t.starttime=g.getCurrentTimestamp();let{GumletStateMachine:n}=await Promise.resolve().then(()=>(gn(),pn));this.analyticsStateMachine=new n(this.stateMachineCallbacks,t);let{HTML5Adapter:r}=await Promise.resolve().then(()=>(Pn(),jn));this.adapter=new r(e,this.record,this.analyticsStateMachine)},this.registerReactNativeVideoPlayer=async e=>{e.starttime?e.starttime=g.convertEpochTime(e.starttime):e.starttime=g.getCurrentTimestamp();let{GumletStateMachine:t}=await Promise.resolve().then(()=>(gn(),pn));return this.analyticsStateMachine=new t(this.stateMachineCallbacks,e),this.analyticsStateMachine},this.record=(e,t)=>{t||={},this.analyticsStateMachine.callEvent(e,t,g.getCurrentTimestamp())},this.config=t,Se((t.enable_analytics_v2===!0||we())&&t.disable_analytics_v2!==!0),this.analyticsCall=new Ie,this.castClient=new He,this.castReceiver=new Ue,this.session=new ln(t),Ae(()=>{let e=this.session.sessionData,t=this.session.playerData;return{...e&&typeof e==`object`?e:{},...t&&typeof t==`object`?t:{}}}),this.sampleBuilder=new un(t,this.session),this.publisher=new dn(this.analyticsCall,this.sampleBuilder),this.init(),this.setupSample(),this.setupStateMachineCallbacks(),typeof performance<`u`&&typeof performance.now==`function`?this.previousStateMono=performance.now():this.previousStateMono=this.previousStateTimeStamp.getTime()}init(){if(!this.isCastReceiver&&(this.config.property_id===``||!g.validString(this.config.property_id))){console.error(`Invalid analytics property_id provided`);return}y.setLogging(this.config.debug||!1),this.session.propertyId=this.config.property_id,typeof window<`u`&&window.parent!==void 0?this.session.pageURL=window.location===window.parent.location?document.location.href:document.referrer:this.config.page_url?this.session.pageURL=this.config.page_url:this.session.pageURL=null;let e=!!this.config.test,t=this.config.sessionID||null,n=this.config.userID||null,r=Object.hasOwn(this.config,`sendSessionRequest`)?this.config.sendSessionRequest:!0;this.session.setUserId(e,n),this.session.setSessionId(e,t,r),this.session.setPlayerInstanceId(this.config.getUUID),this.session.setPlaybackId(this.config.getUUID)}setConfigParameters(e=this.config){this.session.setConfigParameters(e)}updateCustomData(e){this.session.updateCustomData(e)}updateCustomUserData(e){this.session.updateCustomUserData(e)}updateCustomVideoData(e){this.session.updateCustomVideoData(e)}updateCustomPlayerData(e){this.session.updateCustomPlayerData(e)}get userId(){return this.session.userId}get sessionId(){return this.session.sessionId}get propertyId(){return this.session.propertyId}get playerData(){return this.session.playerData}get sessionData(){return this.session.sessionData}get playerInitCall(){return this.session.playerInitCall}get isMuted(){return this.sampleBuilder.isMuted}set isMuted(e){this.sampleBuilder.isMuted=e}get sample(){return this.sampleBuilder.sample}setupSample(){this.sampleBuilder.setupSample()}setDuration(e){this.sampleBuilder.setDuration(e)}setVideoData(e){this.sampleBuilder.setVideoData(e)}setPlaybackSettingsFromLoadedEvent(e){this.sampleBuilder.setPlaybackSettingsFromLoadedEvent(e)}setPlaybackWatchTime(e){this.sampleBuilder.setPlaybackWatchTime(e)}getPlaybackWatchTime(){return this.sampleBuilder.getPlaybackWatchTime()}getSample(e=null,t={}){let n=this.sampleBuilder.getSample(e,t);return n.millis_from_previous_event=this.getMillisFromPreviousState(),n.previous_event=this.previousState,n}setPlayerData(e){this.session.setPlayerData(e)}setSessionData(){this.session.setSessionData()}setPlaybackId(){this.session.setPlaybackId(this.config.getUUID)}setUserId(e=!1,t=null){this.session.setUserId(e,t)}setSessionId(e=!1,t=null,n=!0){this.session.setSessionId(e,t,n)}setPlayerInstanceId(){this.session.setPlayerInstanceId(this.config.getUUID)}sendAnalyticsRequest(e,t){this.publisher.sendRequest(e,t)}sendAnalyticsRequestAsync(e,t){return this.publisher.sendRequestAsync(e,t)}sendAnalyticsRequestAndClearValues(e=null,t={}){let n={millis_from_previous_event:this.getMillisFromPreviousState(),previous_event:this.previousState,...t};this.publisher.sendAndClear(e,n)}sendAnalyticsRequestAndClearValuesAsync(e=null,t={}){return this.publisher.sendAndClearAsync(e,t)}sendUnloadRequest(){this.publisher.sendUnload()}sendAnalyticsRequestSynchronous(){this.publisher.sendSynchronous()}getMillisFromPreviousState(){let e;e=typeof performance<`u`&&typeof performance.now==`function`?performance.now()-this.previousStateMono:new Date().getTime()-this.previousStateTimeStamp.getTime();let t=Math.round(e);return t<=0&&this.previousState!==void 0?1:Math.max(0,t)}setState(e=void 0){e&&(this.previousState=e,this.previousStateTimeStamp=new Date,typeof performance<`u`&&typeof performance.now==`function`?this.previousStateMono=performance.now():this.previousStateMono=this.previousStateTimeStamp.getTime())}getDroppedFrames(e){if(e!==void 0&&e!==0){let t=e-this.droppedSampleFrames;return this.droppedSampleFrames=e,t}return 0}setupStateMachineCallbacks(){this.stateMachineCallbacks={setup:(e,t,n,r)=>{y.log(`Setup Gumlet analytics `+this.analyticsVersion),this.setDuration(e),this.setVideoData(n);let i=0;r?.starttime&&(i=new Date().getTime()-r.starttime),this.sendAnalyticsRequestAndClearValues(b.SETUP,{millis_from_previous_event:i}),this.setState(b.SETUP)},ready:(e,t,n)=>{this.setDuration(e),this.setVideoData(n),this.setPlaybackSettingsFromLoadedEvent(n),this.sendAnalyticsRequestAndClearValues(b.PLAYER_READY),this.setState(b.PLAYER_READY),this.setPlayerData(n),this.playerInitCall.sendRequest(this.playerData,g.noOp)},loaded:(e,t,n,r=null)=>{this.setDuration(e),this.setVideoData(n),this.setPlaybackSettingsFromLoadedEvent(n);let i={};r!==null&&(i={millis_from_previous_event:r,previous_event:b.PLAYER_READY}),this.sendAnalyticsRequestAndClearValues(b.PLAYBACK_READY,i),r===null&&this.setState(b.PLAYBACK_READY)},startup:(e,t)=>{this.setDuration(e)},first_play:(e,t,n)=>{this.setDuration(e),this.setVideoData(n),this.setPlaybackSettingsFromLoadedEvent(n),this.sendAnalyticsRequestAndClearValues(b.PLAY),this.setState(b.PLAY),this.firstPlayTimestamp=new Date},play:(e,t,n)=>{this.setDuration(e),this.setVideoData(n),this.setPlaybackSettingsFromLoadedEvent(n),this.sendAnalyticsRequestAndClearValues(b.PLAY),this.setState(b.PLAY)},updateSample:e=>{this.setPlaybackSettingsFromLoadedEvent(e)},playing:(e,t,n)=>{this.setDuration(e),this.setVideoData(n),this.setPlaybackSettingsFromLoadedEvent(n),this.sendAnalyticsRequestAndClearValues(b.PLAYING),this.setState(b.PLAYING)},playback_started:(e,t,n)=>{this.setDuration(e),this.setVideoData(n),this.setPlaybackSettingsFromLoadedEvent(n);let r=new Date().getTime()-this.firstPlayTimestamp.getTime();this.sendAnalyticsRequestAndClearValues(b.PLAYBACK_STARTED,{millis_from_previous_event:r}),this.setState(b.PLAYBACK_STARTED)},playingAndBye:(e,t,n)=>{this.setDuration(e),this.setDroppedFrames(n),this.sendUnloadRequest()},heartbeat:(e,t,n)=>{this.setDuration(e),this.setVideoData(n),this.setPlaybackSettingsFromLoadedEvent(n),this.sendAnalyticsRequestAndClearValues(b.PLAYBACK_UPDATE),this.setState(b.PLAYBACK_UPDATE)},playbackWatchTime:e=>{this.setPlaybackWatchTime(e)},qualitychange:(e,t)=>{this.setDuration(e)},qualitychange_pause:(e,t)=>{this.setDuration(e)},qualitychange_rebuffering:(e,t)=>{this.setDuration(e)},videoChange:e=>{this.stateMachineCallbacks.setVideoTimeEndFromEvent(e),this.stateMachineCallbacks.setVideoTimeStartFromEvent(e),this.setPlaybackSettingsFromLoadedEvent(e)},audioChange:e=>{this.stateMachineCallbacks.setVideoTimeEndFromEvent(e),this.stateMachineCallbacks.setVideoTimeStartFromEvent(e)},pause:(e,t,n)=>{this.setDuration(e),this.setVideoData(n),this.setPlaybackSettingsFromLoadedEvent(n),this.sendAnalyticsRequestAndClearValues(b.PAUSE),this.setState(b.PAUSE)},start_rebuffer:(e,t,n,r=!1)=>{this.setDuration(e),this.setVideoData(n),this.setPlaybackSettingsFromLoadedEvent(n),r||this.sendAnalyticsRequestAndClearValues(b.START_REBUFFER),this.setState(b.START_REBUFFER)},end_rebuffer:(e,t,n,r=!1)=>{if(this.setDuration(e),this.setVideoData(n),this.setPlaybackSettingsFromLoadedEvent(n),!r)this.sendAnalyticsRequestAndClearValues(b.END_REBUFFER);else return this.getSample(b.END_REBUFFER);this.setState(b.END_REBUFFER)},playback_seeked:(e,t,n,r)=>{this.sendAnalyticsRequestAndClearValues(b.SEEKED,{from:e,to:t}),this.setState(b.SEEKED),this.setupSample(),r===`PAUSE`?(this.sendAnalyticsRequestAndClearValues(b.PAUSE,{millis_from_previous_event:n}),this.setState(b.PAUSE)):r===`PLAYING`&&(this.sendAnalyticsRequestAndClearValues(b.PLAYING,{millis_from_previous_event:n}),this.setState(b.PLAYING))},paused_seeking:(e,t,n)=>{this.setDuration(e)},play_seeking:g.noOp,end_play_seeking:(e,t,n)=>{this.setDuration(e)},rebuffering:(e,t,n)=>{this.setDuration(e)},error:e=>{this.setPlaybackSettingsFromLoadedEvent(e),this.stateMachineCallbacks.setVideoTimeEndFromEvent(e),this.stateMachineCallbacks.setVideoTimeStartFromEvent(e),this.sendAnalyticsRequestAndClearValues(b.ERROR,{error_code:e&&e.code,error:e&&e.message}),this.setState(b.ERROR),this.setupSample()},error_recovered:(e,t,n)=>{this.setPlaybackSettingsFromLoadedEvent(n),this.stateMachineCallbacks.setVideoTimeEndFromEvent(n),this.stateMachineCallbacks.setVideoTimeStartFromEvent(n),this.sendAnalyticsRequestAndClearValues(b.ERROR_RECOVERED,{})},end:(e,t,n)=>{this.setPlaybackId(),this.setDuration(e),this.sendAnalyticsRequestAndClearValues(b.END),this.setState(b.END)},ad:(e,t,n)=>{this.setDuration(e),this.setDroppedFrames(n)},mute:(e,t)=>{this.isMuted=!0,this.setPlaybackSettingsFromLoadedEvent(t),this.sendAnalyticsRequestAndClearValues(b.MUTE)},unMute:(e,t)=>{this.isMuted=!1,this.setPlaybackSettingsFromLoadedEvent(t),this.sendAnalyticsRequestAndClearValues(b.UNMUTE)},muting_ready:g.noOp,muting_play:g.noOp,muting_pause:g.noOp,setVideoTimeEndFromEvent:e=>{},setVideoTimeStartFromEvent:e=>{},startCasting:(t,n)=>{if(n&&n.resuming){this.isAllowedToSendSamples=!1,y.warning(`Player started casting but a session is already casting!`);return}this.isCastClient=!0,this.isAllowedToSendSamples=!1;let{domain:r,path:i,language:a,userAgent:o,userId:s,impressionId:c}=this.sample,l={type:e.CAST_RECEIVER_CONFIG_MESSAGE,data:{config:this.config,userId:s,domain:r,path:i,language:a,userAgent:o,impressionId:c}};this.castClient.setUp(),this.castClient.sendMessage(l)},casting:()=>{this.isCastClient=!1,this.samplesQueue=[],this.isAllowedToSendSamples=!0},source_changing:()=>{},resetSessionExpiry:()=>{this.session.resetSessionExpiry()}}}};let Q=`[GumletInsights]`;var Hn=class{constructor(e){if(this.analytics_=null,this.ready_=!1,this.attached_=!1,!e||!g.validString(e.property_id)||e.property_id===``){console.error(`${Q} A valid property_id is required. No analytics events will be sent until the SDK is re-constructed with a valid config.`);return}this.analytics_=new Vn(e),this.ready_=!0}async attach(e,t={}){if(!this.ready_||!this.analytics_){console.error(`${Q} attach() called but the SDK is not initialized. Check that you passed a valid property_id to the constructor.`);return}this.attached_&&(console.warn(`${Q} attach() called while a player is already attached. Detaching the previous player first.`),this.detach());let n=t.mediaElement??null;if(n!==null&&!this.isHTMLVideoElement_(n)){console.error(`${Q} opts.mediaElement must be an HTMLVideoElement, got: ${Object.prototype.toString.call(n)}`);return}if(e==null){if(!n){console.error(`${Q} HTML5 mode requires opts.mediaElement (an HTMLVideoElement). Pass the <video> element as opts.mediaElement, or pass it directly as the player argument.`);return}}else if(Be(e)){if(!this.isValidHlsPlayer_(e)){console.error(`${Q} HLS.js player is not in a valid state. The player may have been destroyed. Create a new Hls() instance before attaching.`);return}}else if(ze(e)){let t=typeof e.getMediaElement==`function`?e.getMediaElement():null;if(!n&&!t){console.error(`${Q} Shaka Player requires opts.mediaElement — pass the HTMLVideoElement that Shaka is rendering into.`);return}if(!this.isValidShakaPlayer_(e)){console.error(`${Q} Shaka Player is not in a valid state. The player may have been destroyed. Create a new shaka.Player() before attaching.`);return}}else if(!this.isHTMLVideoElement_(e)){console.error(`${Q} Unrecognized player type (${Object.prototype.toString.call(e)}). Supported players: HLS.js (Hls instance), Shaka Player (shaka.Player instance), HTMLVideoElement, or null/undefined (HTML5 mode with opts.mediaElement).`);return}await this.analytics_.register(e,{...t,mediaElement:n}),this.attached_=!0}detach(){this.attached_&&=(this.analytics_?.adapter?.destroy?.(),!1)}get isAttached(){return this.attached_}getImpressionId(){return this.analytics_?.getCurrentImpressionId()??void 0}updateConfig(e){!this.ready_||!this.analytics_||(this.analytics_.updateCustomData(e),this.analytics_.updateCustomVideoData(e),this.analytics_.updateCustomUserData(e),this.analytics_.updateCustomPlayerData(e))}updateCustomData(e){this.analytics_?.updateCustomData(e)}updateCustomVideoData(e){this.analytics_?.updateCustomVideoData(e)}updateCustomUserData(e){this.analytics_?.updateCustomUserData(e)}updateCustomPlayerData(e){this.analytics_?.updateCustomPlayerData(e)}customEventHandler(e,t){if(!this.ready_||!this.analytics_){console.warn(`${Q} customEventHandler ignored — SDK not initialized (check property_id).`);return}this.analytics_.customEventHandler(e,t)}customEventHandlerAsync(e,t){return!this.ready_||!this.analytics_?Promise.reject(Error(`${Q} customEventHandlerAsync — SDK not initialized (check property_id).`)):this.analytics_.customEventHandlerAsync(e,t)}isHTMLVideoElement_(e){return typeof HTMLVideoElement<`u`?e instanceof HTMLVideoElement:typeof e==`object`&&!!e&&typeof e.play==`function`&&typeof e.pause==`function`&&typeof e.addEventListener==`function`}isValidHlsPlayer_(e){return typeof e==`object`&&!!e&&typeof e.loadSource==`function`&&typeof e.attachMedia==`function`&&typeof e.destroy==`function`}isValidShakaPlayer_(e){return typeof e!=`object`||!e?!1:typeof e.isDestroyed==`function`?!e.isDestroyed():typeof e.load==`function`&&typeof e.unload==`function`&&typeof e.addEventListener==`function`}};m(),ee();let $,Un=(e,t={})=>$.register(e,t),Wn=(e,t={})=>$.registerHLSJSPlayer(e,t),Gn=(e,t={})=>$.registerShakaPlayer(e,t),Kn=(e,t={})=>$.registerHTML5Player(e,t),qn=(e,t={})=>$.registerReactNativeVideoPlayer(e,t),Jn=()=>$.getCurrentImpressionId(),Yn=()=>$.analyticsStateMachine,Xn=e=>$.updateCustomData(e),Zn=e=>$.updateCustomVideoData(e),Qn=e=>$.updateCustomUserData(e),$n=e=>$.updateCustomPlayerData(e),er=(e,t)=>$.customEventHandler(e,t),tr=(e,t)=>new Promise((n,r)=>{$.customEventHandlerAsync(e,t).then(e=>{n(e)}).catch(e=>{r(e)})}),nr=e=>($=new Vn(e),{register:Un,registerHLSJSPlayer:Wn,registerShakaPlayer:Gn,registerHTML5Player:Kn,registerReactNativeVideoPlayer:qn,getCurrentImpressionId:Jn,stateMachine:Yn,updateCustomData:Xn,updateCustomVideoData:Zn,updateCustomUserData:Qn,updateCustomPlayerData:$n,setCustomData:$.setCustomData,setCustomDataOnce:$.setCustomDataOnce,customEventHandler:er,customEventHandlerAsync:tr});nr.Players=h,nr.CdnProviders=f,nr.gumletInsightsEvents=p,nr.gumletSupportedPlayers=h,typeof window<`u`&&(window.gumlet=window.gumlet||{},window.gumlet.insights=nr,window.gumlet.GumletInsights=Hn,window.gumletInsightsEvents=p,window.gumletSupportedPlayers=h,window.gumlet.insightsFullCustomTestConfig=te);var rr={insights:nr,gumletInsightsEvents:p,gumletSupportedPlayers:h,fullCustomAnalyticsConfig:te};return e.GumletInsights=Hn,e.default=rr,e.fullCustomAnalyticsConfig=te,e})({});
|