Tutor LMS – eLearning and online course solution - Version 1.8.7

Version Description

  • April 01, 2021 =

Update: Improved Queuing system for Tutor LMS announcement and content drip email Fix: Users were not able to answer to a Q&A Fix: Custom player didnt work for Vimeo Fix: The user-submitted reviews for the first time didnt show up Fix: Line break in Quiz description not working Fix: An instructor couldnt see his/her own courses if the preview was disabled Fix: Page not found for imported quizzes

Download this release

Release Info

Developer themeum
Plugin Icon wp plugin Tutor LMS – eLearning and online course solution
Version 1.8.7
Comparing to
See all releases

Code changes from version 1.8.6 to 1.8.7

assets/js/tutor-front.js CHANGED
@@ -487,6 +487,7 @@ jQuery(document).ready(function ($) {
487
  $wrap.html(data.data.html);
488
  videoPlayer.init();
489
  $('.tutor-lesson-sidebar').css('display', '');
 
490
  },
491
  complete: function () {
492
  $wrap.removeClass('loading-lesson');
487
  $wrap.html(data.data.html);
488
  videoPlayer.init();
489
  $('.tutor-lesson-sidebar').css('display', '');
490
+ window.dispatchEvent(new window.Event('tutor_ajax_lesson_loaded')); // Some plugins like h5p needs notification on ajax load
491
  },
492
  complete: function () {
493
  $wrap.removeClass('loading-lesson');
assets/packages/plyr/plyr.min.js CHANGED
@@ -1,4 +1,3 @@
1
- "object"==typeof navigator&&function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define("Plyr",t):(e=e||self).Plyr=t()}(this,(function(){"use strict";function e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function t(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function i(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}function n(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function a(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function s(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?a(Object(i),!0).forEach((function(t){n(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):a(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function r(e,t){if(null==e)return{};var i,n,a=function(e,t){if(null==e)return{};var i,n,a={},s=Object.keys(e);for(n=0;n<s.length;n++)i=s[n],t.indexOf(i)>=0||(a[i]=e[i]);return a}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(n=0;n<s.length;n++)i=s[n],t.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(e,i)&&(a[i]=e[i])}return a}function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var i=[],n=!0,a=!1,s=void 0;try{for(var r,o=e[Symbol.iterator]();!(n=(r=o.next()).done)&&(i.push(r.value),!t||i.length!==t);n=!0);}catch(e){a=!0,s=e}finally{try{n||null==o.return||o.return()}finally{if(a)throw s}}return i}(e,t)||c(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(e){return function(e){if(Array.isArray(e))return u(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||c(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(e,t){if(e){if("string"==typeof e)return u(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?u(e,t):void 0}}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}function d(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function h(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function p(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function m(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?p(Object(i),!0).forEach((function(t){h(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):p(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var f={addCSS:!0,thumbWidth:15,watch:!0};function g(e,t){return function(){return Array.from(document.querySelectorAll(t)).includes(this)}.call(e,t)}var y=function(e){return null!=e?e.constructor:null},v=function(e,t){return!!(e&&t&&e instanceof t)},b=function(e){return null==e},w=function(e){return y(e)===Object},k=function(e){return y(e)===String},T=function(e){return Array.isArray(e)},C=function(e){return v(e,NodeList)},A=k,S=T,P=C,E=function(e){return v(e,Element)},N=function(e){return v(e,Event)},M=function(e){return b(e)||(k(e)||T(e)||C(e))&&!e.length||w(e)&&!Object.keys(e).length};function x(e,t){if(1>t){var i=function(e){var t="".concat(e).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return t?Math.max(0,(t[1]?t[1].length:0)-(t[2]?+t[2]:0)):0}(t);return parseFloat(e.toFixed(i))}return Math.round(e/t)*t}var I,L,O,_=function(){function e(t,i){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),E(t)?this.element=t:A(t)&&(this.element=document.querySelector(t)),E(this.element)&&M(this.element.rangeTouch)&&(this.config=m({},f,{},i),this.init())}return function(e,t,i){t&&d(e.prototype,t),i&&d(e,i)}(e,[{key:"init",value:function(){e.enabled&&(this.config.addCSS&&(this.element.style.userSelect="none",this.element.style.webKitUserSelect="none",this.element.style.touchAction="manipulation"),this.listeners(!0),this.element.rangeTouch=this)}},{key:"destroy",value:function(){e.enabled&&(this.config.addCSS&&(this.element.style.userSelect="",this.element.style.webKitUserSelect="",this.element.style.touchAction=""),this.listeners(!1),this.element.rangeTouch=null)}},{key:"listeners",value:function(e){var t=this,i=e?"addEventListener":"removeEventListener";["touchstart","touchmove","touchend"].forEach((function(e){t.element[i](e,(function(e){return t.set(e)}),!1)}))}},{key:"get",value:function(t){if(!e.enabled||!N(t))return null;var i,n=t.target,a=t.changedTouches[0],s=parseFloat(n.getAttribute("min"))||0,r=parseFloat(n.getAttribute("max"))||100,o=parseFloat(n.getAttribute("step"))||1,l=n.getBoundingClientRect(),c=100/l.width*(this.config.thumbWidth/2)/100;return 0>(i=100/l.width*(a.clientX-l.left))?i=0:100<i&&(i=100),50>i?i-=(100-2*i)*c:50<i&&(i+=2*(i-50)*c),s+x(i/100*(r-s),o)}},{key:"set",value:function(t){e.enabled&&N(t)&&!t.target.disabled&&(t.preventDefault(),t.target.value=this.get(t),function(e,t){if(e&&t){var i=new Event(t,{bubbles:!0});e.dispatchEvent(i)}}(t.target,"touchend"===t.type?"change":"input"))}}],[{key:"setup",value:function(t){var i=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},n=null;if(M(t)||A(t)?n=Array.from(document.querySelectorAll(A(t)?t:'input[type="range"]')):E(t)?n=[t]:P(t)?n=Array.from(t):S(t)&&(n=t.filter(E)),M(n))return null;var a=m({},f,{},i);if(A(t)&&a.watch){var s=new MutationObserver((function(i){Array.from(i).forEach((function(i){Array.from(i.addedNodes).forEach((function(i){E(i)&&g(i,t)&&new e(i,a)}))}))}));s.observe(document.body,{childList:!0,subtree:!0})}return n.map((function(t){return new e(t,i)}))}},{key:"enabled",get:function(){return"ontouchstart"in document.documentElement}}]),e}(),j=function(e){return null!=e?e.constructor:null},q=function(e,t){return Boolean(e&&t&&e instanceof t)},D=function(e){return null==e},H=function(e){return j(e)===Object},F=function(e){return j(e)===String},R=function(e){return j(e)===Function},V=function(e){return Array.isArray(e)},B=function(e){return q(e,NodeList)},U=function(e){return D(e)||(F(e)||V(e)||B(e))&&!e.length||H(e)&&!Object.keys(e).length},W=D,z=H,K=function(e){return j(e)===Number&&!Number.isNaN(e)},Y=F,Q=function(e){return j(e)===Boolean},X=R,$=V,J=B,G=function(e){return q(e,Element)},Z=function(e){return q(e,Event)},ee=function(e){return q(e,KeyboardEvent)},te=function(e){return q(e,TextTrack)||!D(e)&&F(e.kind)},ie=function(e){return q(e,Promise)&&R(e.then)},ne=function(e){if(q(e,window.URL))return!0;if(!F(e))return!1;var t=e;e.startsWith("http://")&&e.startsWith("https://")||(t="http://".concat(e));try{return!U(new URL(t).hostname)}catch(e){return!1}},ae=U,se=(I=document.createElement("span"),L={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"},O=Object.keys(L).find((function(e){return void 0!==I.style[e]})),!!Y(O)&&L[O]);function re(e,t){setTimeout((function(){try{e.hidden=!0,e.offsetHeight,e.hidden=!1}catch(e){}}),t)}var oe={isIE:
2
  /* @cc_on!@ */
3
- !!document.documentMode,isEdge:window.navigator.userAgent.includes("Edge"),isWebkit:"WebkitAppearance"in document.documentElement.style&&!/Edge/.test(navigator.userAgent),isIPhone:/(iPhone|iPod)/gi.test(navigator.platform),isIos:/(iPad|iPhone|iPod)/gi.test(navigator.platform)};function le(e,t){return t.split(".").reduce((function(e,t){return e&&e[t]}),e)}function ce(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length,i=new Array(t>1?t-1:0),a=1;a<t;a++)i[a-1]=arguments[a];if(!i.length)return e;var s=i.shift();return z(s)?(Object.keys(s).forEach((function(t){z(s[t])?(Object.keys(e).includes(t)||Object.assign(e,n({},t,{})),ce(e[t],s[t])):Object.assign(e,n({},t,s[t]))})),ce.apply(void 0,[e].concat(i))):e}function ue(e,t){var i=e.length?e:[e];Array.from(i).reverse().forEach((function(e,i){var n=i>0?t.cloneNode(!0):t,a=e.parentNode,s=e.nextSibling;n.appendChild(e),s?a.insertBefore(n,s):a.appendChild(n)}))}function de(e,t){G(e)&&!ae(t)&&Object.entries(t).filter((function(e){var t=o(e,2)[1];return!W(t)})).forEach((function(t){var i=o(t,2),n=i[0],a=i[1];return e.setAttribute(n,a)}))}function he(e,t,i){var n=document.createElement(e);return z(t)&&de(n,t),Y(i)&&(n.innerText=i),n}function pe(e,t,i,n){G(t)&&t.appendChild(he(e,i,n))}function me(e){J(e)||$(e)?Array.from(e).forEach(me):G(e)&&G(e.parentNode)&&e.parentNode.removeChild(e)}function fe(e){if(G(e))for(var t=e.childNodes.length;t>0;)e.removeChild(e.lastChild),t-=1}function ge(e,t){return G(t)&&G(t.parentNode)&&G(e)?(t.parentNode.replaceChild(e,t),e):null}function ye(e,t){if(!Y(e)||ae(e))return{};var i={},n=ce({},t);return e.split(",").forEach((function(e){var t=e.trim(),a=t.replace(".",""),s=t.replace(/[[\]]/g,"").split("="),r=o(s,1)[0],l=s.length>1?s[1].replace(/["']/g,""):"";switch(t.charAt(0)){case".":Y(n.class)?i.class="".concat(n.class," ").concat(a):i.class=a;break;case"#":i.id=t.replace("#","");break;case"[":i[r]=l}})),ce(n,i)}function ve(e,t){if(G(e)){var i=t;Q(i)||(i=!e.hidden),e.hidden=i}}function be(e,t,i){if(J(e))return Array.from(e).map((function(e){return be(e,t,i)}));if(G(e)){var n="toggle";return void 0!==i&&(n=i?"add":"remove"),e.classList[n](t),e.classList.contains(t)}return!1}function we(e,t){return G(e)&&e.classList.contains(t)}function ke(e,t){var i=Element.prototype;return(i.matches||i.webkitMatchesSelector||i.mozMatchesSelector||i.msMatchesSelector||function(){return Array.from(document.querySelectorAll(t)).includes(this)}).call(e,t)}function Te(e){return this.elements.container.querySelectorAll(e)}function Ce(e){return this.elements.container.querySelector(e)}function Ae(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];G(e)&&(e.focus({preventScroll:!0}),t&&be(e,this.config.classNames.tabFocus))}var Se,Pe={"audio/ogg":"vorbis","audio/wav":"1","video/webm":"vp8, vorbis","video/mp4":"avc1.42E01E, mp4a.40.2","video/ogg":"theora"},Ee={audio:"canPlayType"in document.createElement("audio"),video:"canPlayType"in document.createElement("video"),check:function(e,t,i){var n=oe.isIPhone&&i&&Ee.playsinline,a=Ee[e]||"html5"!==t;return{api:a,ui:a&&Ee.rangeInput&&("video"!==e||!oe.isIPhone||n)}},pip:!(oe.isIPhone||!X(he("video").webkitSetPresentationMode)&&(!document.pictureInPictureEnabled||he("video").disablePictureInPicture)),airplay:X(window.WebKitPlaybackTargetAvailabilityEvent),playsinline:"playsInline"in document.createElement("video"),mime:function(e){if(ae(e))return!1;var t=o(e.split("/"),1)[0],i=e;if(!this.isHTML5||t!==this.type)return!1;Object.keys(Pe).includes(i)&&(i+='; codecs="'.concat(Pe[e],'"'));try{return Boolean(i&&this.media.canPlayType(i).replace(/no/,""))}catch(e){return!1}},textTracks:"textTracks"in document.createElement("video"),rangeInput:(Se=document.createElement("input"),Se.type="range","range"===Se.type),touch:"ontouchstart"in document.documentElement,transitions:!1!==se,reducedMotion:"matchMedia"in window&&window.matchMedia("(prefers-reduced-motion)").matches},Ne=function(){var e=!1;try{var t=Object.defineProperty({},"passive",{get:function(){return e=!0,null}});window.addEventListener("test",null,t),window.removeEventListener("test",null,t)}catch(e){}return e}();function Me(e,t,i){var n=this,a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],r=arguments.length>5&&void 0!==arguments[5]&&arguments[5];if(e&&"addEventListener"in e&&!ae(t)&&X(i)){var o=t.split(" "),l=r;Ne&&(l={passive:s,capture:r}),o.forEach((function(t){n&&n.eventListeners&&a&&n.eventListeners.push({element:e,type:t,callback:i,options:l}),e[a?"addEventListener":"removeEventListener"](t,i,l)}))}}function xe(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2?arguments[2]:void 0,n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],a=arguments.length>4&&void 0!==arguments[4]&&arguments[4];Me.call(this,e,t,i,!0,n,a)}function Ie(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2?arguments[2]:void 0,n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],a=arguments.length>4&&void 0!==arguments[4]&&arguments[4];Me.call(this,e,t,i,!1,n,a)}function Le(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2?arguments[2]:void 0,a=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],s=arguments.length>4&&void 0!==arguments[4]&&arguments[4],r=function r(){Ie(e,i,r,a,s);for(var o=arguments.length,l=new Array(o),c=0;c<o;c++)l[c]=arguments[c];n.apply(t,l)};Me.call(this,e,i,r,!0,a,s)}function Oe(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(G(e)&&!ae(t)){var a=new CustomEvent(t,{bubbles:i,detail:s(s({},n),{},{plyr:this})});e.dispatchEvent(a)}}function _e(){this&&this.eventListeners&&(this.eventListeners.forEach((function(e){var t=e.element,i=e.type,n=e.callback,a=e.options;t.removeEventListener(i,n,a)})),this.eventListeners=[])}function je(){var e=this;return new Promise((function(t){return e.ready?setTimeout(t,0):xe.call(e,e.elements.container,"ready",t)})).then((function(){}))}function qe(e){ie(e)&&e.then(null,(function(){}))}function De(e){return!!($(e)||Y(e)&&e.includes(":"))&&($(e)?e:e.split(":")).map(Number).every(K)}function He(e){if(!$(e)||!e.every(K))return null;var t=o(e,2),i=t[0],n=t[1],a=function e(t,i){return 0===i?t:e(i,t%i)}(i,n);return[i/a,n/a]}function Fe(e){var t=function(e){return De(e)?e.split(":").map(Number):null},i=t(e);if(null===i&&(i=t(this.config.ratio)),null===i&&!ae(this.embed)&&$(this.embed.ratio)&&(i=this.embed.ratio),null===i&&this.isHTML5){var n=this.media;i=He([n.videoWidth,n.videoHeight])}return i}function Re(e){if(!this.isVideo)return{};var t=this.elements.wrapper,i=Fe.call(this,e),n=o($(i)?i:[0,0],2),a=100/n[0]*n[1];if(t.style.paddingBottom="".concat(a,"%"),this.isVimeo&&!this.config.vimeo.premium&&this.supported.ui){var s=100/this.media.offsetWidth*parseInt(window.getComputedStyle(this.media).paddingBottom,10),r=(s-a)/(s/50);this.media.style.transform="translateY(-".concat(r,"%)")}else this.isHTML5&&t.classList.toggle(this.config.classNames.videoFixedRatio,null!==i);return{padding:a,ratio:i}}var Ve={getSources:function(){var e=this;return this.isHTML5?Array.from(this.media.querySelectorAll("source")).filter((function(t){var i=t.getAttribute("type");return!!ae(i)||Ee.mime.call(e,i)})):[]},getQualityOptions:function(){return this.config.quality.forced?this.config.quality.options:Ve.getSources.call(this).map((function(e){return Number(e.getAttribute("size"))})).filter(Boolean)},setup:function(){if(this.isHTML5){var e=this;e.options.speed=e.config.speed.options,ae(this.config.ratio)||Re.call(e),Object.defineProperty(e.media,"quality",{get:function(){var t=Ve.getSources.call(e).find((function(t){return t.getAttribute("src")===e.source}));return t&&Number(t.getAttribute("size"))},set:function(t){if(e.quality!==t){if(e.config.quality.forced&&X(e.config.quality.onChange))e.config.quality.onChange(t);else{var i=Ve.getSources.call(e).find((function(e){return Number(e.getAttribute("size"))===t}));if(!i)return;var n=e.media,a=n.currentTime,s=n.paused,r=n.preload,o=n.readyState,l=n.playbackRate;e.media.src=i.getAttribute("src"),("none"!==r||o)&&(e.once("loadedmetadata",(function(){e.speed=l,e.currentTime=a,s||qe(e.play())})),e.media.load())}Oe.call(e,e.media,"qualitychange",!1,{quality:t})}}})}},cancelRequests:function(){this.isHTML5&&(me(Ve.getSources.call(this)),this.media.setAttribute("src",this.config.blankVideo),this.media.load(),this.debug.log("Cancelled network requests"))}};function Be(e){return $(e)?e.filter((function(t,i){return e.indexOf(t)===i})):e}function Ue(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];return ae(e)?e:e.toString().replace(/{(\d+)}/g,(function(e,t){return i[t].toString()}))}var We=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return e.replace(new RegExp(t.toString().replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1"),"g"),i.toString())},ze=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e.toString().replace(/\w\S*/g,(function(e){return e.charAt(0).toUpperCase()+e.substr(1).toLowerCase()}))};function Ke(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=e.toString();return t=We(t,"-"," "),t=We(t,"_"," "),t=ze(t),We(t," ","")}function Ye(e){var t=document.createElement("div");return t.appendChild(e),t.innerHTML}var Qe={pip:"PIP",airplay:"AirPlay",html5:"HTML5",vimeo:"Vimeo",youtube:"YouTube"},Xe=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(ae(e)||ae(t))return"";var i=le(t.i18n,e);if(ae(i))return Object.keys(Qe).includes(e)?Qe[e]:"";var n={"{seektime}":t.seekTime,"{title}":t.title};return Object.entries(n).forEach((function(e){var t=o(e,2),n=t[0],a=t[1];i=We(i,n,a)})),i},$e=function(){function t(i){e(this,t),this.enabled=i.config.storage.enabled,this.key=i.config.storage.key}return i(t,[{key:"get",value:function(e){if(!t.supported||!this.enabled)return null;var i=window.localStorage.getItem(this.key);if(ae(i))return null;var n=JSON.parse(i);return Y(e)&&e.length?n[e]:n}},{key:"set",value:function(e){if(t.supported&&this.enabled&&z(e)){var i=this.get();ae(i)&&(i={}),ce(i,e),window.localStorage.setItem(this.key,JSON.stringify(i))}}}],[{key:"supported",get:function(){try{if(!("localStorage"in window))return!1;return window.localStorage.setItem("___test","___test"),window.localStorage.removeItem("___test"),!0}catch(e){return!1}}}]),t}();function Je(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"text";return new Promise((function(i,n){try{var a=new XMLHttpRequest;if(!("withCredentials"in a))return;a.addEventListener("load",(function(){if("text"===t)try{i(JSON.parse(a.responseText))}catch(e){i(a.responseText)}else i(a.response)})),a.addEventListener("error",(function(){throw new Error(a.status)})),a.open("GET",e,!0),a.responseType=t,a.send()}catch(e){n(e)}}))}function Ge(e,t){if(Y(e)){var i=Y(t),n=function(){return null!==document.getElementById(t)},a=function(e,t){e.innerHTML=t,i&&n()||document.body.insertAdjacentElement("afterbegin",e)};if(!i||!n()){var s=$e.supported,r=document.createElement("div");if(r.setAttribute("hidden",""),i&&r.setAttribute("id",t),s){var o=window.localStorage.getItem("".concat("cache","-").concat(t));if(null!==o){var l=JSON.parse(o);a(r,l.content)}}Je(e).then((function(e){ae(e)||(s&&window.localStorage.setItem("".concat("cache","-").concat(t),JSON.stringify({content:e})),a(r,e))})).catch((function(){}))}}}var Ze=function(e){return Math.trunc(e/60/60%60,10)},et=function(e){return Math.trunc(e/60%60,10)},tt=function(e){return Math.trunc(e%60,10)};function it(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!K(e))return it(void 0,t,i);var n=function(e){return"0".concat(e).slice(-2)},a=Ze(e),s=et(e),r=tt(e);return a=t||a>0?"".concat(a,":"):"","".concat(i&&e>0?"-":"").concat(a).concat(n(s),":").concat(n(r))}var nt={getIconUrl:function(){var e=new URL(this.config.iconUrl,window.location).host!==window.location.host||oe.isIE&&!window.svg4everybody;return{url:this.config.iconUrl,cors:e}},findElements:function(){try{return this.elements.controls=Ce.call(this,this.config.selectors.controls.wrapper),this.elements.buttons={play:Te.call(this,this.config.selectors.buttons.play),pause:Ce.call(this,this.config.selectors.buttons.pause),restart:Ce.call(this,this.config.selectors.buttons.restart),rewind:Ce.call(this,this.config.selectors.buttons.rewind),fastForward:Ce.call(this,this.config.selectors.buttons.fastForward),mute:Ce.call(this,this.config.selectors.buttons.mute),pip:Ce.call(this,this.config.selectors.buttons.pip),airplay:Ce.call(this,this.config.selectors.buttons.airplay),settings:Ce.call(this,this.config.selectors.buttons.settings),captions:Ce.call(this,this.config.selectors.buttons.captions),fullscreen:Ce.call(this,this.config.selectors.buttons.fullscreen)},this.elements.progress=Ce.call(this,this.config.selectors.progress),this.elements.inputs={seek:Ce.call(this,this.config.selectors.inputs.seek),volume:Ce.call(this,this.config.selectors.inputs.volume)},this.elements.display={buffer:Ce.call(this,this.config.selectors.display.buffer),currentTime:Ce.call(this,this.config.selectors.display.currentTime),duration:Ce.call(this,this.config.selectors.display.duration)},G(this.elements.progress)&&(this.elements.display.seekTooltip=this.elements.progress.querySelector(".".concat(this.config.classNames.tooltip))),!0}catch(e){return this.debug.warn("It looks like there is a problem with your custom controls HTML",e),this.toggleNativeControls(!0),!1}},createIcon:function(e,t){var i=nt.getIconUrl.call(this),n="".concat(i.cors?"":i.url,"#").concat(this.config.iconPrefix),a=document.createElementNS("http://www.w3.org/2000/svg","svg");de(a,ce(t,{"aria-hidden":"true",focusable:"false"}));var s=document.createElementNS("http://www.w3.org/2000/svg","use"),r="".concat(n,"-").concat(e);return"href"in s&&s.setAttributeNS("http://www.w3.org/1999/xlink","href",r),s.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",r),a.appendChild(s),a},createLabel:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=Xe(e,this.config),n=s(s({},t),{},{class:[t.class,this.config.classNames.hidden].filter(Boolean).join(" ")});return he("span",n,i)},createBadge:function(e){if(ae(e))return null;var t=he("span",{class:this.config.classNames.menu.value});return t.appendChild(he("span",{class:this.config.classNames.menu.badge},e)),t},createButton:function(e,t){var i=this,n=ce({},t),a=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=e.toString();return(t=Ke(t)).charAt(0).toLowerCase()+t.slice(1)}(e),s={element:"button",toggle:!1,label:null,icon:null,labelPressed:null,iconPressed:null};switch(["element","icon","label"].forEach((function(e){Object.keys(n).includes(e)&&(s[e]=n[e],delete n[e])})),"button"!==s.element||Object.keys(n).includes("type")||(n.type="button"),Object.keys(n).includes("class")?n.class.split(" ").some((function(e){return e===i.config.classNames.control}))||ce(n,{class:"".concat(n.class," ").concat(this.config.classNames.control)}):n.class=this.config.classNames.control,e){case"play":s.toggle=!0,s.label="play",s.labelPressed="pause",s.icon="play",s.iconPressed="pause";break;case"mute":s.toggle=!0,s.label="mute",s.labelPressed="unmute",s.icon="volume",s.iconPressed="muted";break;case"captions":s.toggle=!0,s.label="enableCaptions",s.labelPressed="disableCaptions",s.icon="captions-off",s.iconPressed="captions-on";break;case"fullscreen":s.toggle=!0,s.label="enterFullscreen",s.labelPressed="exitFullscreen",s.icon="enter-fullscreen",s.iconPressed="exit-fullscreen";break;case"play-large":n.class+=" ".concat(this.config.classNames.control,"--overlaid"),a="play",s.label="play",s.icon="play";break;default:ae(s.label)&&(s.label=a),ae(s.icon)&&(s.icon=e)}var r=he(s.element);return s.toggle?(r.appendChild(nt.createIcon.call(this,s.iconPressed,{class:"icon--pressed"})),r.appendChild(nt.createIcon.call(this,s.icon,{class:"icon--not-pressed"})),r.appendChild(nt.createLabel.call(this,s.labelPressed,{class:"label--pressed"})),r.appendChild(nt.createLabel.call(this,s.label,{class:"label--not-pressed"}))):(r.appendChild(nt.createIcon.call(this,s.icon)),r.appendChild(nt.createLabel.call(this,s.label))),ce(n,ye(this.config.selectors.buttons[a],n)),de(r,n),"play"===a?($(this.elements.buttons[a])||(this.elements.buttons[a]=[]),this.elements.buttons[a].push(r)):this.elements.buttons[a]=r,r},createRange:function(e,t){var i=he("input",ce(ye(this.config.selectors.inputs[e]),{type:"range",min:0,max:100,step:.01,value:0,autocomplete:"off",role:"slider","aria-label":Xe(e,this.config),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":0},t));return this.elements.inputs[e]=i,nt.updateRangeFill.call(this,i),_.setup(i),i},createProgress:function(e,t){var i=he("progress",ce(ye(this.config.selectors.display[e]),{min:0,max:100,value:0,role:"progressbar","aria-hidden":!0},t));if("volume"!==e){i.appendChild(he("span",null,"0"));var n={played:"played",buffer:"buffered"}[e],a=n?Xe(n,this.config):"";i.innerText="% ".concat(a.toLowerCase())}return this.elements.display[e]=i,i},createTime:function(e,t){var i=ye(this.config.selectors.display[e],t),n=he("div",ce(i,{class:"".concat(i.class?i.class:""," ").concat(this.config.classNames.display.time," ").trim(),"aria-label":Xe(e,this.config)}),"00:00");return this.elements.display[e]=n,n},bindMenuItemShortcuts:function(e,t){var i=this;xe.call(this,e,"keydown keyup",(function(n){if([32,38,39,40].includes(n.which)&&(n.preventDefault(),n.stopPropagation(),"keydown"!==n.type)){var a,s=ke(e,'[role="menuitemradio"]');if(!s&&[32,39].includes(n.which))nt.showMenuPanel.call(i,t,!0);else 32!==n.which&&(40===n.which||s&&39===n.which?(a=e.nextElementSibling,G(a)||(a=e.parentNode.firstElementChild)):(a=e.previousElementSibling,G(a)||(a=e.parentNode.lastElementChild)),Ae.call(i,a,!0))}}),!1),xe.call(this,e,"keyup",(function(e){13===e.which&&nt.focusFirstMenuItem.call(i,null,!0)}))},createMenuItem:function(e){var t=this,i=e.value,n=e.list,a=e.type,s=e.title,r=e.badge,o=void 0===r?null:r,l=e.checked,c=void 0!==l&&l,u=ye(this.config.selectors.inputs[a]),d=he("button",ce(u,{type:"button",role:"menuitemradio",class:"".concat(this.config.classNames.control," ").concat(u.class?u.class:"").trim(),"aria-checked":c,value:i})),h=he("span");h.innerHTML=s,G(o)&&h.appendChild(o),d.appendChild(h),Object.defineProperty(d,"checked",{enumerable:!0,get:function(){return"true"===d.getAttribute("aria-checked")},set:function(e){e&&Array.from(d.parentNode.children).filter((function(e){return ke(e,'[role="menuitemradio"]')})).forEach((function(e){return e.setAttribute("aria-checked","false")})),d.setAttribute("aria-checked",e?"true":"false")}}),this.listeners.bind(d,"click keyup",(function(e){if(!ee(e)||32===e.which){switch(e.preventDefault(),e.stopPropagation(),d.checked=!0,a){case"language":t.currentTrack=Number(i);break;case"quality":t.quality=i;break;case"speed":t.speed=parseFloat(i)}nt.showMenuPanel.call(t,"home",ee(e))}}),a,!1),nt.bindMenuItemShortcuts.call(this,d,a),n.appendChild(d)},formatTime:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!K(e))return e;var i=Ze(this.duration)>0;return it(e,i,t)},updateTimeDisplay:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];G(e)&&K(t)&&(e.innerText=nt.formatTime(t,i))},updateVolume:function(){this.supported.ui&&(G(this.elements.inputs.volume)&&nt.setRange.call(this,this.elements.inputs.volume,this.muted?0:this.volume),G(this.elements.buttons.mute)&&(this.elements.buttons.mute.pressed=this.muted||0===this.volume))},setRange:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;G(e)&&(e.value=t,nt.updateRangeFill.call(this,e))},updateProgress:function(e){var t=this;if(this.supported.ui&&Z(e)){var i,n,a=0;if(e)switch(e.type){case"timeupdate":case"seeking":case"seeked":i=this.currentTime,n=this.duration,a=0===i||0===n||Number.isNaN(i)||Number.isNaN(n)?0:(i/n*100).toFixed(2),"timeupdate"===e.type&&nt.setRange.call(this,this.elements.inputs.seek,a);break;case"playing":case"progress":!function(e,i){var n=K(i)?i:0,a=G(e)?e:t.elements.display.buffer;if(G(a)){a.value=n;var s=a.getElementsByTagName("span")[0];G(s)&&(s.childNodes[0].nodeValue=n)}}(this.elements.display.buffer,100*this.buffered)}}},updateRangeFill:function(e){var t=Z(e)?e.target:e;if(G(t)&&"range"===t.getAttribute("type")){if(ke(t,this.config.selectors.inputs.seek)){t.setAttribute("aria-valuenow",this.currentTime);var i=nt.formatTime(this.currentTime),n=nt.formatTime(this.duration),a=Xe("seekLabel",this.config);t.setAttribute("aria-valuetext",a.replace("{currentTime}",i).replace("{duration}",n))}else if(ke(t,this.config.selectors.inputs.volume)){var s=100*t.value;t.setAttribute("aria-valuenow",s),t.setAttribute("aria-valuetext","".concat(s.toFixed(1),"%"))}else t.setAttribute("aria-valuenow",t.value);oe.isWebkit&&t.style.setProperty("--value","".concat(t.value/t.max*100,"%"))}},updateSeekTooltip:function(e){var t=this;if(this.config.tooltips.seek&&G(this.elements.inputs.seek)&&G(this.elements.display.seekTooltip)&&0!==this.duration){var i="".concat(this.config.classNames.tooltip,"--visible"),n=function(e){return be(t.elements.display.seekTooltip,i,e)};if(this.touch)n(!1);else{var a=0,s=this.elements.progress.getBoundingClientRect();if(Z(e))a=100/s.width*(e.pageX-s.left);else{if(!we(this.elements.display.seekTooltip,i))return;a=parseFloat(this.elements.display.seekTooltip.style.left,10)}a<0?a=0:a>100&&(a=100),nt.updateTimeDisplay.call(this,this.elements.display.seekTooltip,this.duration/100*a),this.elements.display.seekTooltip.style.left="".concat(a,"%"),Z(e)&&["mouseenter","mouseleave"].includes(e.type)&&n("mouseenter"===e.type)}}},timeUpdate:function(e){var t=!G(this.elements.display.duration)&&this.config.invertTime;nt.updateTimeDisplay.call(this,this.elements.display.currentTime,t?this.duration-this.currentTime:this.currentTime,t),e&&"timeupdate"===e.type&&this.media.seeking||nt.updateProgress.call(this,e)},durationUpdate:function(){if(this.supported.ui&&(this.config.invertTime||!this.currentTime)){if(this.duration>=Math.pow(2,32))return ve(this.elements.display.currentTime,!0),void ve(this.elements.progress,!0);G(this.elements.inputs.seek)&&this.elements.inputs.seek.setAttribute("aria-valuemax",this.duration);var e=G(this.elements.display.duration);!e&&this.config.displayDuration&&this.paused&&nt.updateTimeDisplay.call(this,this.elements.display.currentTime,this.duration),e&&nt.updateTimeDisplay.call(this,this.elements.display.duration,this.duration),nt.updateSeekTooltip.call(this)}},toggleMenuButton:function(e,t){ve(this.elements.settings.buttons[e],!t)},updateSetting:function(e,t,i){var n=this.elements.settings.panels[e],a=null,s=t;if("captions"===e)a=this.currentTrack;else{if(a=ae(i)?this[e]:i,ae(a)&&(a=this.config[e].default),!ae(this.options[e])&&!this.options[e].includes(a))return void this.debug.warn("Unsupported value of '".concat(a,"' for ").concat(e));if(!this.config[e].options.includes(a))return void this.debug.warn("Disabled value of '".concat(a,"' for ").concat(e))}if(G(s)||(s=n&&n.querySelector('[role="menu"]')),G(s)){this.elements.settings.buttons[e].querySelector(".".concat(this.config.classNames.menu.value)).innerHTML=nt.getLabel.call(this,e,a);var r=s&&s.querySelector('[value="'.concat(a,'"]'));G(r)&&(r.checked=!0)}},getLabel:function(e,t){switch(e){case"speed":return 1===t?Xe("normal",this.config):"".concat(t,"&times;");case"quality":if(K(t)){var i=Xe("qualityLabel.".concat(t),this.config);return i.length?i:"".concat(t,"p")}return ze(t);case"captions":return rt.getLabel.call(this);default:return null}},setQualityMenu:function(e){var t=this;if(G(this.elements.settings.panels.quality)){var i=this.elements.settings.panels.quality.querySelector('[role="menu"]');$(e)&&(this.options.quality=Be(e).filter((function(e){return t.config.quality.options.includes(e)})));var n=!ae(this.options.quality)&&this.options.quality.length>1;if(nt.toggleMenuButton.call(this,"quality",n),fe(i),nt.checkMenu.call(this),n){var a=function(e){var i=Xe("qualityBadge.".concat(e),t.config);return i.length?nt.createBadge.call(t,i):null};this.options.quality.sort((function(e,i){var n=t.config.quality.options;return n.indexOf(e)>n.indexOf(i)?1:-1})).forEach((function(e){nt.createMenuItem.call(t,{value:e,list:i,type:"quality",title:nt.getLabel.call(t,"quality",e),badge:a(e)})})),nt.updateSetting.call(this,"quality",i)}}},setCaptionsMenu:function(){var e=this;if(G(this.elements.settings.panels.captions)){var t=this.elements.settings.panels.captions.querySelector('[role="menu"]'),i=rt.getTracks.call(this),n=Boolean(i.length);if(nt.toggleMenuButton.call(this,"captions",n),fe(t),nt.checkMenu.call(this),n){var a=i.map((function(i,n){return{value:n,checked:e.captions.toggled&&e.currentTrack===n,title:rt.getLabel.call(e,i),badge:i.language&&nt.createBadge.call(e,i.language.toUpperCase()),list:t,type:"language"}}));a.unshift({value:-1,checked:!this.captions.toggled,title:Xe("disabled",this.config),list:t,type:"language"}),a.forEach(nt.createMenuItem.bind(this)),nt.updateSetting.call(this,"captions",t)}}},setSpeedMenu:function(){var e=this;if(G(this.elements.settings.panels.speed)){var t=this.elements.settings.panels.speed.querySelector('[role="menu"]');this.options.speed=this.options.speed.filter((function(t){return t>=e.minimumSpeed&&t<=e.maximumSpeed}));var i=!ae(this.options.speed)&&this.options.speed.length>1;nt.toggleMenuButton.call(this,"speed",i),fe(t),nt.checkMenu.call(this),i&&(this.options.speed.forEach((function(i){nt.createMenuItem.call(e,{value:i,list:t,type:"speed",title:nt.getLabel.call(e,"speed",i)})})),nt.updateSetting.call(this,"speed",t))}},checkMenu:function(){var e=this.elements.settings.buttons,t=!ae(e)&&Object.values(e).some((function(e){return!e.hidden}));ve(this.elements.settings.menu,!t)},focusFirstMenuItem:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!this.elements.settings.popup.hidden){var i=e;G(i)||(i=Object.values(this.elements.settings.panels).find((function(e){return!e.hidden})));var n=i.querySelector('[role^="menuitem"]');Ae.call(this,n,t)}},toggleMenu:function(e){var t=this.elements.settings.popup,i=this.elements.buttons.settings;if(G(t)&&G(i)){var n=t.hidden,a=n;if(Q(e))a=e;else if(ee(e)&&27===e.which)a=!1;else if(Z(e)){var s=X(e.composedPath)?e.composedPath()[0]:e.target,r=t.contains(s);if(r||!r&&e.target!==i&&a)return}i.setAttribute("aria-expanded",a),ve(t,!a),be(this.elements.container,this.config.classNames.menu.open,a),a&&ee(e)?nt.focusFirstMenuItem.call(this,null,!0):a||n||Ae.call(this,i,ee(e))}},getMenuSize:function(e){var t=e.cloneNode(!0);t.style.position="absolute",t.style.opacity=0,t.removeAttribute("hidden"),e.parentNode.appendChild(t);var i=t.scrollWidth,n=t.scrollHeight;return me(t),{width:i,height:n}},showMenuPanel:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.elements.container.querySelector("#plyr-settings-".concat(this.id,"-").concat(t));if(G(n)){var a=n.parentNode,s=Array.from(a.children).find((function(e){return!e.hidden}));if(Ee.transitions&&!Ee.reducedMotion){a.style.width="".concat(s.scrollWidth,"px"),a.style.height="".concat(s.scrollHeight,"px");var r=nt.getMenuSize.call(this,n),o=function t(i){i.target===a&&["width","height"].includes(i.propertyName)&&(a.style.width="",a.style.height="",Ie.call(e,a,se,t))};xe.call(this,a,se,o),a.style.width="".concat(r.width,"px"),a.style.height="".concat(r.height,"px")}ve(s,!0),ve(n,!1),nt.focusFirstMenuItem.call(this,n,i)}},setDownloadUrl:function(){var e=this.elements.buttons.download;G(e)&&e.setAttribute("href",this.download)},create:function(e){var t=this,i=nt.bindMenuItemShortcuts,n=nt.createButton,a=nt.createProgress,s=nt.createRange,r=nt.createTime,o=nt.setQualityMenu,l=nt.setSpeedMenu,c=nt.showMenuPanel;this.elements.controls=null,$(this.config.controls)&&this.config.controls.includes("play-large")&&this.elements.container.appendChild(n.call(this,"play-large"));var u=he("div",ye(this.config.selectors.controls.wrapper));this.elements.controls=u;var d={class:"plyr__controls__item"};return Be($(this.config.controls)?this.config.controls:[]).forEach((function(o){if("restart"===o&&u.appendChild(n.call(t,"restart",d)),"rewind"===o&&u.appendChild(n.call(t,"rewind",d)),"play"===o&&u.appendChild(n.call(t,"play",d)),"fast-forward"===o&&u.appendChild(n.call(t,"fast-forward",d)),"progress"===o){var l=he("div",{class:"".concat(d.class," plyr__progress__container")}),h=he("div",ye(t.config.selectors.progress));if(h.appendChild(s.call(t,"seek",{id:"plyr-seek-".concat(e.id)})),h.appendChild(a.call(t,"buffer")),t.config.tooltips.seek){var p=he("span",{class:t.config.classNames.tooltip},"00:00");h.appendChild(p),t.elements.display.seekTooltip=p}t.elements.progress=h,l.appendChild(t.elements.progress),u.appendChild(l)}if("current-time"===o&&u.appendChild(r.call(t,"currentTime",d)),"duration"===o&&u.appendChild(r.call(t,"duration",d)),"mute"===o||"volume"===o){var m=t.elements.volume;if(G(m)&&u.contains(m)||(m=he("div",ce({},d,{class:"".concat(d.class," plyr__volume").trim()})),t.elements.volume=m,u.appendChild(m)),"mute"===o&&m.appendChild(n.call(t,"mute")),"volume"===o&&!oe.isIos){var f={max:1,step:.05,value:t.config.volume};m.appendChild(s.call(t,"volume",ce(f,{id:"plyr-volume-".concat(e.id)})))}}if("captions"===o&&u.appendChild(n.call(t,"captions",d)),"settings"===o&&!ae(t.config.settings)){var g=he("div",ce({},d,{class:"".concat(d.class," plyr__menu").trim(),hidden:""}));g.appendChild(n.call(t,"settings",{"aria-haspopup":!0,"aria-controls":"plyr-settings-".concat(e.id),"aria-expanded":!1}));var y=he("div",{class:"plyr__menu__container",id:"plyr-settings-".concat(e.id),hidden:""}),v=he("div"),b=he("div",{id:"plyr-settings-".concat(e.id,"-home")}),w=he("div",{role:"menu"});b.appendChild(w),v.appendChild(b),t.elements.settings.panels.home=b,t.config.settings.forEach((function(n){var a=he("button",ce(ye(t.config.selectors.buttons.settings),{type:"button",class:"".concat(t.config.classNames.control," ").concat(t.config.classNames.control,"--forward"),role:"menuitem","aria-haspopup":!0,hidden:""}));i.call(t,a,n),xe.call(t,a,"click",(function(){c.call(t,n,!1)}));var s=he("span",null,Xe(n,t.config)),r=he("span",{class:t.config.classNames.menu.value});r.innerHTML=e[n],s.appendChild(r),a.appendChild(s),w.appendChild(a);var o=he("div",{id:"plyr-settings-".concat(e.id,"-").concat(n),hidden:""}),l=he("button",{type:"button",class:"".concat(t.config.classNames.control," ").concat(t.config.classNames.control,"--back")});l.appendChild(he("span",{"aria-hidden":!0},Xe(n,t.config))),l.appendChild(he("span",{class:t.config.classNames.hidden},Xe("menuBack",t.config))),xe.call(t,o,"keydown",(function(e){37===e.which&&(e.preventDefault(),e.stopPropagation(),c.call(t,"home",!0))}),!1),xe.call(t,l,"click",(function(){c.call(t,"home",!1)})),o.appendChild(l),o.appendChild(he("div",{role:"menu"})),v.appendChild(o),t.elements.settings.buttons[n]=a,t.elements.settings.panels[n]=o})),y.appendChild(v),g.appendChild(y),u.appendChild(g),t.elements.settings.popup=y,t.elements.settings.menu=g}if("pip"===o&&Ee.pip&&u.appendChild(n.call(t,"pip",d)),"airplay"===o&&Ee.airplay&&u.appendChild(n.call(t,"airplay",d)),"download"===o){var k=ce({},d,{element:"a",href:t.download,target:"_blank"});t.isHTML5&&(k.download="");var T=t.config.urls.download;!ne(T)&&t.isEmbed&&ce(k,{icon:"logo-".concat(t.provider),label:t.provider}),u.appendChild(n.call(t,"download",k))}"fullscreen"===o&&u.appendChild(n.call(t,"fullscreen",d))})),this.isHTML5&&o.call(this,Ve.getQualityOptions.call(this)),l.call(this),u},inject:function(){var e=this;if(this.config.loadSprite){var t=nt.getIconUrl.call(this);t.cors&&Ge(t.url,"sprite-plyr")}this.id=Math.floor(1e4*Math.random());var i=null;this.elements.controls=null;var n={id:this.id,seektime:this.config.seekTime,title:this.config.title},a=!0;X(this.config.controls)&&(this.config.controls=this.config.controls.call(this,n)),this.config.controls||(this.config.controls=[]),G(this.config.controls)||Y(this.config.controls)?i=this.config.controls:(i=nt.create.call(this,{id:this.id,seektime:this.config.seekTime,speed:this.speed,quality:this.quality,captions:rt.getLabel.call(this)}),a=!1);var s,r;if(a&&Y(this.config.controls)&&(s=i,Object.entries(n).forEach((function(e){var t=o(e,2),i=t[0],n=t[1];s=We(s,"{".concat(i,"}"),n)})),i=s),Y(this.config.selectors.controls.container)&&(r=document.querySelector(this.config.selectors.controls.container)),G(r)||(r=this.elements.container),r[G(i)?"insertAdjacentElement":"insertAdjacentHTML"]("afterbegin",i),G(this.elements.controls)||nt.findElements.call(this),!ae(this.elements.buttons)){var l=function(t){var i=e.config.classNames.controlPressed;Object.defineProperty(t,"pressed",{enumerable:!0,get:function(){return we(t,i)},set:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];be(t,i,e)}})};Object.values(this.elements.buttons).filter(Boolean).forEach((function(e){$(e)||J(e)?Array.from(e).filter(Boolean).forEach(l):l(e)}))}if(oe.isEdge&&re(r),this.config.tooltips.controls){var c=this.config,u=c.classNames,d=c.selectors,h="".concat(d.controls.wrapper," ").concat(d.labels," .").concat(u.hidden),p=Te.call(this,h);Array.from(p).forEach((function(t){be(t,e.config.classNames.hidden,!1),be(t,e.config.classNames.tooltip,!0)}))}}};function at(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=e;if(t){var n=document.createElement("a");n.href=i,i=n.href}try{return new URL(i)}catch(e){return null}}function st(e){var t=new URLSearchParams;return z(e)&&Object.entries(e).forEach((function(e){var i=o(e,2),n=i[0],a=i[1];t.set(n,a)})),t}var rt={setup:function(){if(this.supported.ui)if(!this.isVideo||this.isYouTube||this.isHTML5&&!Ee.textTracks)$(this.config.controls)&&this.config.controls.includes("settings")&&this.config.settings.includes("captions")&&nt.setCaptionsMenu.call(this);else{if(G(this.elements.captions)||(this.elements.captions=he("div",ye(this.config.selectors.captions)),function(e,t){G(e)&&G(t)&&t.parentNode.insertBefore(e,t.nextSibling)}(this.elements.captions,this.elements.wrapper)),oe.isIE&&window.URL){var e=this.media.querySelectorAll("track");Array.from(e).forEach((function(e){var t=e.getAttribute("src"),i=at(t);null!==i&&i.hostname!==window.location.href.hostname&&["http:","https:"].includes(i.protocol)&&Je(t,"blob").then((function(t){e.setAttribute("src",window.URL.createObjectURL(t))})).catch((function(){me(e)}))}))}var t=Be((navigator.languages||[navigator.language||navigator.userLanguage||"en"]).map((function(e){return e.split("-")[0]}))),i=(this.storage.get("language")||this.config.captions.language||"auto").toLowerCase();if("auto"===i)i=o(t,1)[0];var n=this.storage.get("captions");if(Q(n)||(n=this.config.captions.active),Object.assign(this.captions,{toggled:!1,active:n,language:i,languages:t}),this.isHTML5){var a=this.config.captions.update?"addtrack removetrack":"removetrack";xe.call(this,this.media.textTracks,a,rt.update.bind(this))}setTimeout(rt.update.bind(this),0)}},update:function(){var e=this,t=rt.getTracks.call(this,!0),i=this.captions,n=i.active,a=i.language,s=i.meta,r=i.currentTrackNode,o=Boolean(t.find((function(e){return e.language===a})));this.isHTML5&&this.isVideo&&t.filter((function(e){return!s.get(e)})).forEach((function(t){e.debug.log("Track added",t),s.set(t,{default:"showing"===t.mode}),"showing"===t.mode&&(t.mode="hidden"),xe.call(e,t,"cuechange",(function(){return rt.updateCues.call(e)}))})),(o&&this.language!==a||!t.includes(r))&&(rt.setLanguage.call(this,a),rt.toggle.call(this,n&&o)),be(this.elements.container,this.config.classNames.captions.enabled,!ae(t)),$(this.config.controls)&&this.config.controls.includes("settings")&&this.config.settings.includes("captions")&&nt.setCaptionsMenu.call(this)},toggle:function(e){var t=this,i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.supported.ui){var n=this.captions.toggled,a=this.config.classNames.captions.active,s=W(e)?!n:e;if(s!==n){if(i||(this.captions.active=s,this.storage.set({captions:s})),!this.language&&s&&!i){var r=rt.getTracks.call(this),o=rt.findTrack.call(this,[this.captions.language].concat(l(this.captions.languages)),!0);return this.captions.language=o.language,void rt.set.call(this,r.indexOf(o))}this.elements.buttons.captions&&(this.elements.buttons.captions.pressed=s),be(this.elements.container,a,s),this.captions.toggled=s,nt.updateSetting.call(this,"captions"),Oe.call(this,this.media,s?"captionsenabled":"captionsdisabled")}setTimeout((function(){s&&t.captions.toggled&&(t.captions.currentTrackNode.mode="hidden")}))}},set:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=rt.getTracks.call(this);if(-1!==e)if(K(e))if(e in i){if(this.captions.currentTrack!==e){this.captions.currentTrack=e;var n=i[e],a=n||{},s=a.language;this.captions.currentTrackNode=n,nt.updateSetting.call(this,"captions"),t||(this.captions.language=s,this.storage.set({language:s})),this.isVimeo&&this.embed.enableTextTrack(s),Oe.call(this,this.media,"languagechange")}rt.toggle.call(this,!0,t),this.isHTML5&&this.isVideo&&rt.updateCues.call(this)}else this.debug.warn("Track not found",e);else this.debug.warn("Invalid caption argument",e);else rt.toggle.call(this,!1,t)},setLanguage:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(Y(e)){var i=e.toLowerCase();this.captions.language=i;var n=rt.getTracks.call(this),a=rt.findTrack.call(this,[i]);rt.set.call(this,n.indexOf(a),t)}else this.debug.warn("Invalid language argument",e)},getTracks:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],i=Array.from((this.media||{}).textTracks||[]);return i.filter((function(i){return!e.isHTML5||t||e.captions.meta.has(i)})).filter((function(e){return["captions","subtitles"].includes(e.kind)}))},findTrack:function(e){var t,i=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],a=rt.getTracks.call(this),s=function(e){return Number((i.captions.meta.get(e)||{}).default)},r=Array.from(a).sort((function(e,t){return s(t)-s(e)}));return e.every((function(e){return!(t=r.find((function(t){return t.language===e})))})),t||(n?r[0]:void 0)},getCurrentTrack:function(){return rt.getTracks.call(this)[this.currentTrack]},getLabel:function(e){var t=e;return!te(t)&&Ee.textTracks&&this.captions.toggled&&(t=rt.getCurrentTrack.call(this)),te(t)?ae(t.label)?ae(t.language)?Xe("enabled",this.config):e.language.toUpperCase():t.label:Xe("disabled",this.config)},updateCues:function(e){if(this.supported.ui)if(G(this.elements.captions))if(W(e)||Array.isArray(e)){var t=e;if(!t){var i=rt.getCurrentTrack.call(this);t=Array.from((i||{}).activeCues||[]).map((function(e){return e.getCueAsHTML()})).map(Ye)}var n=t.map((function(e){return e.trim()})).join("\n");if(n!==this.elements.captions.innerHTML){fe(this.elements.captions);var a=he("span",ye(this.config.selectors.caption));a.innerHTML=n,this.elements.captions.appendChild(a),Oe.call(this,this.media,"cuechange")}}else this.debug.warn("updateCues: Invalid input",e);else this.debug.warn("No captions element to render to")}},ot={enabled:!0,title:"",debug:!1,autoplay:!1,autopause:!0,playsinline:!0,seekTime:10,volume:1,muted:!1,duration:null,displayDuration:!0,invertTime:!0,toggleInvert:!0,ratio:null,clickToPlay:!0,hideControls:!0,resetOnEnd:!1,disableContextMenu:!0,loadSprite:!0,iconPrefix:"plyr",iconUrl:"https://cdn.plyr.io/3.6.2/plyr.svg",blankVideo:"https://cdn.plyr.io/static/blank.mp4",quality:{default:576,options:[4320,2880,2160,1440,1080,720,576,480,360,240],forced:!1,onChange:null},loop:{active:!1},speed:{selected:1,options:[.5,.75,1,1.25,1.5,1.75,2,4]},keyboard:{focused:!0,global:!1},tooltips:{controls:!1,seek:!0},captions:{active:!1,language:"auto",update:!1},fullscreen:{enabled:!0,fallback:!0,iosNative:!1},storage:{enabled:!0,key:"plyr"},controls:["play-large","play","progress","current-time","mute","volume","captions","settings","pip","airplay","fullscreen"],settings:["captions","quality","speed"],i18n:{restart:"Restart",rewind:"Rewind {seektime}s",play:"Play",pause:"Pause",fastForward:"Forward {seektime}s",seek:"Seek",seekLabel:"{currentTime} of {duration}",played:"Played",buffered:"Buffered",currentTime:"Current time",duration:"Duration",volume:"Volume",mute:"Mute",unmute:"Unmute",enableCaptions:"Enable captions",disableCaptions:"Disable captions",download:"Download",enterFullscreen:"Enter fullscreen",exitFullscreen:"Exit fullscreen",frameTitle:"Player for {title}",captions:"Captions",settings:"Settings",pip:"PIP",menuBack:"Go back to previous menu",speed:"Speed",normal:"Normal",quality:"Quality",loop:"Loop",start:"Start",end:"End",all:"All",reset:"Reset",disabled:"Disabled",enabled:"Enabled",advertisement:"Ad",qualityBadge:{2160:"4K",1440:"HD",1080:"HD",720:"HD",576:"SD",480:"SD"}},urls:{download:null,vimeo:{sdk:"https://player.vimeo.com/api/player.js",iframe:"https://player.vimeo.com/video/{0}?{1}",api:"https://vimeo.com/api/v2/video/{0}.json"},youtube:{sdk:"https://www.youtube.com/iframe_api",api:"https://noembed.com/embed?url=https://www.youtube.com/watch?v={0}"},googleIMA:{sdk:"https://imasdk.googleapis.com/js/sdkloader/ima3.js"}},listeners:{seek:null,play:null,pause:null,restart:null,rewind:null,fastForward:null,mute:null,volume:null,captions:null,download:null,fullscreen:null,pip:null,airplay:null,speed:null,quality:null,loop:null,language:null},events:["ended","progress","stalled","playing","waiting","canplay","canplaythrough","loadstart","loadeddata","loadedmetadata","timeupdate","volumechange","play","pause","error","seeking","seeked","emptied","ratechange","cuechange","download","enterfullscreen","exitfullscreen","captionsenabled","captionsdisabled","languagechange","controlshidden","controlsshown","ready","statechange","qualitychange","adsloaded","adscontentpause","adscontentresume","adstarted","adsmidpoint","adscomplete","adsallcomplete","adsimpression","adsclick"],selectors:{editable:"input, textarea, select, [contenteditable]",container:".plyr",controls:{container:null,wrapper:".plyr__controls"},labels:"[data-plyr]",buttons:{play:'[data-plyr="play"]',pause:'[data-plyr="pause"]',restart:'[data-plyr="restart"]',rewind:'[data-plyr="rewind"]',fastForward:'[data-plyr="fast-forward"]',mute:'[data-plyr="mute"]',captions:'[data-plyr="captions"]',download:'[data-plyr="download"]',fullscreen:'[data-plyr="fullscreen"]',pip:'[data-plyr="pip"]',airplay:'[data-plyr="airplay"]',settings:'[data-plyr="settings"]',loop:'[data-plyr="loop"]'},inputs:{seek:'[data-plyr="seek"]',volume:'[data-plyr="volume"]',speed:'[data-plyr="speed"]',language:'[data-plyr="language"]',quality:'[data-plyr="quality"]'},display:{currentTime:".plyr__time--current",duration:".plyr__time--duration",buffer:".plyr__progress__buffer",loop:".plyr__progress__loop",volume:".plyr__volume--display"},progress:".plyr__progress",captions:".plyr__captions",caption:".plyr__caption"},classNames:{type:"plyr--{0}",provider:"plyr--{0}",video:"plyr__video-wrapper",embed:"plyr__video-embed",videoFixedRatio:"plyr__video-wrapper--fixed-ratio",embedContainer:"plyr__video-embed__container",poster:"plyr__poster",posterEnabled:"plyr__poster-enabled",ads:"plyr__ads",control:"plyr__control",controlPressed:"plyr__control--pressed",playing:"plyr--playing",paused:"plyr--paused",stopped:"plyr--stopped",loading:"plyr--loading",hover:"plyr--hover",tooltip:"plyr__tooltip",cues:"plyr__cues",hidden:"plyr__sr-only",hideControls:"plyr--hide-controls",isIos:"plyr--is-ios",isTouch:"plyr--is-touch",uiSupported:"plyr--full-ui",noTransition:"plyr--no-transition",display:{time:"plyr__time"},menu:{value:"plyr__menu__value",badge:"plyr__badge",open:"plyr--menu-open"},captions:{enabled:"plyr--captions-enabled",active:"plyr--captions-active"},fullscreen:{enabled:"plyr--fullscreen-enabled",fallback:"plyr--fullscreen-fallback"},pip:{supported:"plyr--pip-supported",active:"plyr--pip-active"},airplay:{supported:"plyr--airplay-supported",active:"plyr--airplay-active"},tabFocus:"plyr__tab-focus",previewThumbnails:{thumbContainer:"plyr__preview-thumb",thumbContainerShown:"plyr__preview-thumb--is-shown",imageContainer:"plyr__preview-thumb__image-container",timeContainer:"plyr__preview-thumb__time-container",scrubbingContainer:"plyr__preview-scrubbing",scrubbingContainerShown:"plyr__preview-scrubbing--is-shown"}},attributes:{embed:{provider:"data-plyr-provider",id:"data-plyr-embed-id"}},ads:{enabled:!1,publisherId:"",tagUrl:""},previewThumbnails:{enabled:!1,src:""},vimeo:{byline:!1,portrait:!1,title:!1,speed:!0,transparent:!1,premium:!1,referrerPolicy:null},youtube:{noCookie:!0,rel:0,showinfo:0,iv_load_policy:3,modestbranding:1}},lt="picture-in-picture",ct="inline",ut={html5:"html5",youtube:"youtube",vimeo:"vimeo"},dt="audio",ht="video";var pt=function(){},mt=function(){function t(){var i=arguments.length>0&&void 0!==arguments[0]&&arguments[0];e(this,t),this.enabled=window.console&&i,this.enabled&&this.log("Debugging enabled")}return i(t,[{key:"log",get:function(){return this.enabled?Function.prototype.bind.call(console.log,console):pt}},{key:"warn",get:function(){return this.enabled?Function.prototype.bind.call(console.warn,console):pt}},{key:"error",get:function(){return this.enabled?Function.prototype.bind.call(console.error,console):pt}}]),t}(),ft=function(){function t(i){var n=this;e(this,t),this.player=i,this.prefix=t.prefix,this.property=t.property,this.scrollPosition={x:0,y:0},this.forceFallback="force"===i.config.fullscreen.fallback,this.player.elements.fullscreen=i.config.fullscreen.container&&function(e,t){return(Element.prototype.closest||function(){var e=this;do{if(ke.matches(e,t))return e;e=e.parentElement||e.parentNode}while(null!==e&&1===e.nodeType);return null}).call(e,t)}(this.player.elements.container,i.config.fullscreen.container),xe.call(this.player,document,"ms"===this.prefix?"MSFullscreenChange":"".concat(this.prefix,"fullscreenchange"),(function(){n.onChange()})),xe.call(this.player,this.player.elements.container,"dblclick",(function(e){G(n.player.elements.controls)&&n.player.elements.controls.contains(e.target)||n.toggle()})),xe.call(this,this.player.elements.container,"keydown",(function(e){return n.trapFocus(e)})),this.update()}return i(t,[{key:"onChange",value:function(){if(this.enabled){var e=this.player.elements.buttons.fullscreen;G(e)&&(e.pressed=this.active),Oe.call(this.player,this.target,this.active?"enterfullscreen":"exitfullscreen",!0)}}},{key:"toggleFallback",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(e?this.scrollPosition={x:window.scrollX||0,y:window.scrollY||0}:window.scrollTo(this.scrollPosition.x,this.scrollPosition.y),document.body.style.overflow=e?"hidden":"",be(this.target,this.player.config.classNames.fullscreen.fallback,e),oe.isIos){var t=document.head.querySelector('meta[name="viewport"]'),i="viewport-fit=cover";t||(t=document.createElement("meta")).setAttribute("name","viewport");var n=Y(t.content)&&t.content.includes(i);e?(this.cleanupViewport=!n,n||(t.content+=",".concat(i))):this.cleanupViewport&&(t.content=t.content.split(",").filter((function(e){return e.trim()!==i})).join(","))}this.onChange()}},{key:"trapFocus",value:function(e){if(!oe.isIos&&this.active&&"Tab"===e.key&&9===e.keyCode){var t=document.activeElement,i=Te.call(this.player,"a[href], button:not(:disabled), input:not(:disabled), [tabindex]"),n=o(i,1)[0],a=i[i.length-1];t!==a||e.shiftKey?t===n&&e.shiftKey&&(a.focus(),e.preventDefault()):(n.focus(),e.preventDefault())}}},{key:"update",value:function(){var e;this.enabled?(e=this.forceFallback?"Fallback (forced)":t.native?"Native":"Fallback",this.player.debug.log("".concat(e," fullscreen enabled"))):this.player.debug.log("Fullscreen not supported and fallback disabled");be(this.player.elements.container,this.player.config.classNames.fullscreen.enabled,this.enabled)}},{key:"enter",value:function(){this.enabled&&(oe.isIos&&this.player.config.fullscreen.iosNative?this.target.webkitEnterFullscreen():!t.native||this.forceFallback?this.toggleFallback(!0):this.prefix?ae(this.prefix)||this.target["".concat(this.prefix,"Request").concat(this.property)]():this.target.requestFullscreen({navigationUI:"hide"}))}},{key:"exit",value:function(){if(this.enabled)if(oe.isIos&&this.player.config.fullscreen.iosNative)this.target.webkitExitFullscreen(),qe(this.player.play());else if(!t.native||this.forceFallback)this.toggleFallback(!1);else if(this.prefix){if(!ae(this.prefix)){var e="moz"===this.prefix?"Cancel":"Exit";document["".concat(this.prefix).concat(e).concat(this.property)]()}}else(document.cancelFullScreen||document.exitFullscreen).call(document)}},{key:"toggle",value:function(){this.active?this.exit():this.enter()}},{key:"usingNative",get:function(){return t.native&&!this.forceFallback}},{key:"enabled",get:function(){return(t.native||this.player.config.fullscreen.fallback)&&this.player.config.fullscreen.enabled&&this.player.supported.ui&&this.player.isVideo}},{key:"active",get:function(){if(!this.enabled)return!1;if(!t.native||this.forceFallback)return we(this.target,this.player.config.classNames.fullscreen.fallback);var e=this.prefix?document["".concat(this.prefix).concat(this.property,"Element")]:document.fullscreenElement;return e&&e.shadowRoot?e===this.target.getRootNode().host:e===this.target}},{key:"target",get:function(){return oe.isIos&&this.player.config.fullscreen.iosNative?this.player.media:this.player.elements.fullscreen||this.player.elements.container}}],[{key:"native",get:function(){return!!(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled)}},{key:"prefix",get:function(){if(X(document.exitFullscreen))return"";var e="";return["webkit","moz","ms"].some((function(t){return!(!X(document["".concat(t,"ExitFullscreen")])&&!X(document["".concat(t,"CancelFullScreen")]))&&(e=t,!0)})),e}},{key:"property",get:function(){return"moz"===this.prefix?"FullScreen":"Fullscreen"}}]),t}();function gt(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return new Promise((function(i,n){var a=new Image,s=function(){delete a.onload,delete a.onerror,(a.naturalWidth>=t?i:n)(a)};Object.assign(a,{onload:s,onerror:s,src:e})}))}var yt={addStyleHook:function(){be(this.elements.container,this.config.selectors.container.replace(".",""),!0),be(this.elements.container,this.config.classNames.uiSupported,this.supported.ui)},toggleNativeControls:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];e&&this.isHTML5?this.media.setAttribute("controls",""):this.media.removeAttribute("controls")},build:function(){var e=this;if(this.listeners.media(),!this.supported.ui)return this.debug.warn("Basic support only for ".concat(this.provider," ").concat(this.type)),void yt.toggleNativeControls.call(this,!0);G(this.elements.controls)||(nt.inject.call(this),this.listeners.controls()),yt.toggleNativeControls.call(this),this.isHTML5&&rt.setup.call(this),this.volume=null,this.muted=null,this.loop=null,this.quality=null,this.speed=null,nt.updateVolume.call(this),nt.timeUpdate.call(this),yt.checkPlaying.call(this),be(this.elements.container,this.config.classNames.pip.supported,Ee.pip&&this.isHTML5&&this.isVideo),be(this.elements.container,this.config.classNames.airplay.supported,Ee.airplay&&this.isHTML5),be(this.elements.container,this.config.classNames.isIos,oe.isIos),be(this.elements.container,this.config.classNames.isTouch,this.touch),this.ready=!0,setTimeout((function(){Oe.call(e,e.media,"ready")}),0),yt.setTitle.call(this),this.poster&&yt.setPoster.call(this,this.poster,!1).catch((function(){})),this.config.duration&&nt.durationUpdate.call(this)},setTitle:function(){var e=Xe("play",this.config);if(Y(this.config.title)&&!ae(this.config.title)&&(e+=", ".concat(this.config.title)),Array.from(this.elements.buttons.play||[]).forEach((function(t){t.setAttribute("aria-label",e)})),this.isEmbed){var t=Ce.call(this,"iframe");if(!G(t))return;var i=ae(this.config.title)?"video":this.config.title,n=Xe("frameTitle",this.config);t.setAttribute("title",n.replace("{title}",i))}},togglePoster:function(e){be(this.elements.container,this.config.classNames.posterEnabled,e)},setPoster:function(e){var t=this,i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return i&&this.poster?Promise.reject(new Error("Poster already set")):(this.media.setAttribute("data-poster",e),je.call(this).then((function(){return gt(e)})).catch((function(i){throw e===t.poster&&yt.togglePoster.call(t,!1),i})).then((function(){if(e!==t.poster)throw new Error("setPoster cancelled by later call to setPoster")})).then((function(){return Object.assign(t.elements.poster.style,{backgroundImage:"url('".concat(e,"')"),backgroundSize:""}),yt.togglePoster.call(t,!0),e})))},checkPlaying:function(e){var t=this;be(this.elements.container,this.config.classNames.playing,this.playing),be(this.elements.container,this.config.classNames.paused,this.paused),be(this.elements.container,this.config.classNames.stopped,this.stopped),Array.from(this.elements.buttons.play||[]).forEach((function(e){Object.assign(e,{pressed:t.playing}),e.setAttribute("aria-label",Xe(t.playing?"pause":"play",t.config))})),Z(e)&&"timeupdate"===e.type||yt.toggleControls.call(this)},checkLoading:function(e){var t=this;this.loading=["stalled","waiting"].includes(e.type),clearTimeout(this.timers.loading),this.timers.loading=setTimeout((function(){be(t.elements.container,t.config.classNames.loading,t.loading),yt.toggleControls.call(t)}),this.loading?250:0)},toggleControls:function(e){var t=this.elements.controls;if(t&&this.config.hideControls){var i=this.touch&&this.lastSeekTime+2e3>Date.now();this.toggleControls(Boolean(e||this.loading||this.paused||t.pressed||t.hover||i))}},migrateStyles:function(){var e=this;Object.values(s({},this.media.style)).filter((function(e){return!ae(e)&&e.startsWith("--plyr")})).forEach((function(t){e.elements.container.style.setProperty(t,e.media.style.getPropertyValue(t)),e.media.style.removeProperty(t)})),ae(this.media.style)&&this.media.removeAttribute("style")}},vt=function(){function t(i){e(this,t),this.player=i,this.lastKey=null,this.focusTimer=null,this.lastKeyDown=null,this.handleKey=this.handleKey.bind(this),this.toggleMenu=this.toggleMenu.bind(this),this.setTabFocus=this.setTabFocus.bind(this),this.firstTouch=this.firstTouch.bind(this)}return i(t,[{key:"handleKey",value:function(e){var t=this.player,i=t.elements,n=e.keyCode?e.keyCode:e.which,a="keydown"===e.type,s=a&&n===this.lastKey;if(!(e.altKey||e.ctrlKey||e.metaKey||e.shiftKey)&&K(n)){if(a){var r=document.activeElement;if(G(r)){var o=t.config.selectors.editable;if(r!==i.inputs.seek&&ke(r,o))return;if(32===e.which&&ke(r,'button, [role^="menuitem"]'))return}switch([32,37,38,39,40,48,49,50,51,52,53,54,56,57,67,70,73,75,76,77,79].includes(n)&&(e.preventDefault(),e.stopPropagation()),n){case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:s||(t.currentTime=t.duration/10*(n-48));break;case 32:case 75:s||qe(t.togglePlay());break;case 38:t.increaseVolume(.1);break;case 40:t.decreaseVolume(.1);break;case 77:s||(t.muted=!t.muted);break;case 39:t.forward();break;case 37:t.rewind();break;case 70:t.fullscreen.toggle();break;case 67:s||t.toggleCaptions();break;case 76:t.loop=!t.loop}27===n&&!t.fullscreen.usingNative&&t.fullscreen.active&&t.fullscreen.toggle(),this.lastKey=n}else this.lastKey=null}}},{key:"toggleMenu",value:function(e){nt.toggleMenu.call(this.player,e)}},{key:"firstTouch",value:function(){var e=this.player,t=e.elements;e.touch=!0,be(t.container,e.config.classNames.isTouch,!0)}},{key:"setTabFocus",value:function(e){var t=this.player,i=t.elements;if(clearTimeout(this.focusTimer),"keydown"!==e.type||9===e.which){"keydown"===e.type&&(this.lastKeyDown=e.timeStamp);var n,a=e.timeStamp-this.lastKeyDown<=20;if("focus"!==e.type||a)n=t.config.classNames.tabFocus,be(Te.call(t,".".concat(n)),n,!1),"focusout"!==e.type&&(this.focusTimer=setTimeout((function(){var e=document.activeElement;i.container.contains(e)&&be(document.activeElement,t.config.classNames.tabFocus,!0)}),10))}}},{key:"global",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=this.player;t.config.keyboard.global&&Me.call(t,window,"keydown keyup",this.handleKey,e,!1),Me.call(t,document.body,"click",this.toggleMenu,e),Le.call(t,document.body,"touchstart",this.firstTouch),Me.call(t,document.body,"keydown focus blur focusout",this.setTabFocus,e,!1,!0)}},{key:"container",value:function(){var e=this.player,t=e.config,i=e.elements,n=e.timers;!t.keyboard.global&&t.keyboard.focused&&xe.call(e,i.container,"keydown keyup",this.handleKey,!1),xe.call(e,i.container,"mousemove mouseleave touchstart touchmove enterfullscreen exitfullscreen",(function(t){var a=i.controls;a&&"enterfullscreen"===t.type&&(a.pressed=!1,a.hover=!1);var s=0;["touchstart","touchmove","mousemove"].includes(t.type)&&(yt.toggleControls.call(e,!0),s=e.touch?3e3:2e3),clearTimeout(n.controls),n.controls=setTimeout((function(){return yt.toggleControls.call(e,!1)}),s)}));var a=function(t){if(!t)return Re.call(e);var n=i.container.getBoundingClientRect(),a=n.width,s=n.height;return Re.call(e,"".concat(a,":").concat(s))},s=function(){clearTimeout(n.resized),n.resized=setTimeout(a,50)};xe.call(e,i.container,"enterfullscreen exitfullscreen",(function(t){var n=e.fullscreen,r=n.target,l=n.usingNative;if(r===i.container&&(e.isEmbed||!ae(e.config.ratio))){var c="enterfullscreen"===t.type,u=a(c);u.padding;!function(t,i,n){if(e.isVimeo&&!e.config.vimeo.premium){var a=e.elements.wrapper.firstChild,s=o(t,2)[1],r=o(Fe.call(e),2),l=r[0],c=r[1];a.style.maxWidth=n?"".concat(s/c*l,"px"):null,a.style.margin=n?"0 auto":null}}(u.ratio,0,c),l||(c?xe.call(e,window,"resize",s):Ie.call(e,window,"resize",s))}}))}},{key:"media",value:function(){var e=this,t=this.player,i=t.elements;if(xe.call(t,t.media,"timeupdate seeking seeked",(function(e){return nt.timeUpdate.call(t,e)})),xe.call(t,t.media,"durationchange loadeddata loadedmetadata",(function(e){return nt.durationUpdate.call(t,e)})),xe.call(t,t.media,"ended",(function(){t.isHTML5&&t.isVideo&&t.config.resetOnEnd&&(t.restart(),t.pause())})),xe.call(t,t.media,"progress playing seeking seeked",(function(e){return nt.updateProgress.call(t,e)})),xe.call(t,t.media,"volumechange",(function(e){return nt.updateVolume.call(t,e)})),xe.call(t,t.media,"playing play pause ended emptied timeupdate",(function(e){return yt.checkPlaying.call(t,e)})),xe.call(t,t.media,"waiting canplay seeked playing",(function(e){return yt.checkLoading.call(t,e)})),t.supported.ui&&t.config.clickToPlay&&!t.isAudio){var n=Ce.call(t,".".concat(t.config.classNames.video));if(!G(n))return;xe.call(t,i.container,"click",(function(a){([i.container,n].includes(a.target)||n.contains(a.target))&&(t.touch&&t.config.hideControls||(t.ended?(e.proxy(a,t.restart,"restart"),e.proxy(a,(function(){qe(t.play())}),"play")):e.proxy(a,(function(){qe(t.togglePlay())}),"play")))}))}t.supported.ui&&t.config.disableContextMenu&&xe.call(t,i.wrapper,"contextmenu",(function(e){e.preventDefault()}),!1),xe.call(t,t.media,"volumechange",(function(){t.storage.set({volume:t.volume,muted:t.muted})})),xe.call(t,t.media,"ratechange",(function(){nt.updateSetting.call(t,"speed"),t.storage.set({speed:t.speed})})),xe.call(t,t.media,"qualitychange",(function(e){nt.updateSetting.call(t,"quality",null,e.detail.quality)})),xe.call(t,t.media,"ready qualitychange",(function(){nt.setDownloadUrl.call(t)}));var a=t.config.events.concat(["keyup","keydown"]).join(" ");xe.call(t,t.media,a,(function(e){var n=e.detail,a=void 0===n?{}:n;"error"===e.type&&(a=t.media.error),Oe.call(t,i.container,e.type,!0,a)}))}},{key:"proxy",value:function(e,t,i){var n=this.player,a=n.config.listeners[i],s=!0;X(a)&&(s=a.call(n,e)),!1!==s&&X(t)&&t.call(n,e)}},{key:"bind",value:function(e,t,i,n){var a=this,s=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],r=this.player,o=r.config.listeners[n],l=X(o);xe.call(r,e,t,(function(e){return a.proxy(e,i,n)}),s&&!l)}},{key:"controls",value:function(){var e=this,t=this.player,i=t.elements,n=oe.isIE?"change":"input";if(i.buttons.play&&Array.from(i.buttons.play).forEach((function(i){e.bind(i,"click",(function(){qe(t.togglePlay())}),"play")})),this.bind(i.buttons.restart,"click",t.restart,"restart"),this.bind(i.buttons.rewind,"click",t.rewind,"rewind"),this.bind(i.buttons.fastForward,"click",t.forward,"fastForward"),this.bind(i.buttons.mute,"click",(function(){t.muted=!t.muted}),"mute"),this.bind(i.buttons.captions,"click",(function(){return t.toggleCaptions()})),this.bind(i.buttons.download,"click",(function(){Oe.call(t,t.media,"download")}),"download"),this.bind(i.buttons.fullscreen,"click",(function(){t.fullscreen.toggle()}),"fullscreen"),this.bind(i.buttons.pip,"click",(function(){t.pip="toggle"}),"pip"),this.bind(i.buttons.airplay,"click",t.airplay,"airplay"),this.bind(i.buttons.settings,"click",(function(e){e.stopPropagation(),e.preventDefault(),nt.toggleMenu.call(t,e)}),null,!1),this.bind(i.buttons.settings,"keyup",(function(e){var i=e.which;[13,32].includes(i)&&(13!==i?(e.preventDefault(),e.stopPropagation(),nt.toggleMenu.call(t,e)):nt.focusFirstMenuItem.call(t,null,!0))}),null,!1),this.bind(i.settings.menu,"keydown",(function(e){27===e.which&&nt.toggleMenu.call(t,e)})),this.bind(i.inputs.seek,"mousedown mousemove",(function(e){var t=i.progress.getBoundingClientRect(),n=100/t.width*(e.pageX-t.left);e.currentTarget.setAttribute("seek-value",n)})),this.bind(i.inputs.seek,"mousedown mouseup keydown keyup touchstart touchend",(function(e){var i=e.currentTarget,n=e.keyCode?e.keyCode:e.which;if(!ee(e)||39===n||37===n){t.lastSeekTime=Date.now();var a=i.hasAttribute("play-on-seeked"),s=["mouseup","touchend","keyup"].includes(e.type);a&&s?(i.removeAttribute("play-on-seeked"),qe(t.play())):!s&&t.playing&&(i.setAttribute("play-on-seeked",""),t.pause())}})),oe.isIos){var a=Te.call(t,'input[type="range"]');Array.from(a).forEach((function(t){return e.bind(t,n,(function(e){return re(e.target)}))}))}this.bind(i.inputs.seek,n,(function(e){var i=e.currentTarget,n=i.getAttribute("seek-value");ae(n)&&(n=i.value),i.removeAttribute("seek-value"),t.currentTime=n/i.max*t.duration}),"seek"),this.bind(i.progress,"mouseenter mouseleave mousemove",(function(e){return nt.updateSeekTooltip.call(t,e)})),this.bind(i.progress,"mousemove touchmove",(function(e){var i=t.previewThumbnails;i&&i.loaded&&i.startMove(e)})),this.bind(i.progress,"mouseleave touchend click",(function(){var e=t.previewThumbnails;e&&e.loaded&&e.endMove(!1,!0)})),this.bind(i.progress,"mousedown touchstart",(function(e){var i=t.previewThumbnails;i&&i.loaded&&i.startScrubbing(e)})),this.bind(i.progress,"mouseup touchend",(function(e){var i=t.previewThumbnails;i&&i.loaded&&i.endScrubbing(e)})),oe.isWebkit&&Array.from(Te.call(t,'input[type="range"]')).forEach((function(i){e.bind(i,"input",(function(e){return nt.updateRangeFill.call(t,e.target)}))})),t.config.toggleInvert&&!G(i.display.duration)&&this.bind(i.display.currentTime,"click",(function(){0!==t.currentTime&&(t.config.invertTime=!t.config.invertTime,nt.timeUpdate.call(t))})),this.bind(i.inputs.volume,n,(function(e){t.volume=e.target.value}),"volume"),this.bind(i.controls,"mouseenter mouseleave",(function(e){i.controls.hover=!t.touch&&"mouseenter"===e.type})),i.fullscreen&&Array.from(i.fullscreen.children).filter((function(e){return!e.contains(i.container)})).forEach((function(n){e.bind(n,"mouseenter mouseleave",(function(e){i.controls.hover=!t.touch&&"mouseenter"===e.type}))})),this.bind(i.controls,"mousedown mouseup touchstart touchend touchcancel",(function(e){i.controls.pressed=["mousedown","touchstart"].includes(e.type)})),this.bind(i.controls,"focusin",(function(){var n=t.config,a=t.timers;be(i.controls,n.classNames.noTransition,!0),yt.toggleControls.call(t,!0),setTimeout((function(){be(i.controls,n.classNames.noTransition,!1)}),0);var s=e.touch?3e3:4e3;clearTimeout(a.controls),a.controls=setTimeout((function(){return yt.toggleControls.call(t,!1)}),s)})),this.bind(i.inputs.volume,"wheel",(function(e){var i=e.webkitDirectionInvertedFromDevice,n=o([e.deltaX,-e.deltaY].map((function(e){return i?-e:e})),2),a=n[0],s=n[1],r=Math.sign(Math.abs(a)>Math.abs(s)?a:s);t.increaseVolume(r/50);var l=t.media.volume;(1===r&&l<1||-1===r&&l>0)&&e.preventDefault()}),"volume",!1)}}]),t}();"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var bt=function(e,t){return e(t={exports:{}},t.exports),t.exports}((function(e,t){e.exports=function(){var e=function(){},t={},i={},n={};function a(e,t){if(e){var a=n[e];if(i[e]=t,a)for(;a.length;)a[0](e,t),a.splice(0,1)}}function s(t,i){t.call&&(t={success:t}),i.length?(t.error||e)(i):(t.success||e)(t)}function r(t,i,n,a){var s,o,l=document,c=n.async,u=(n.numRetries||0)+1,d=n.before||e,h=t.replace(/[\?|#].*$/,""),p=t.replace(/^(css|img)!/,"");a=a||0,/(^css!|\.css$)/.test(h)?((o=l.createElement("link")).rel="stylesheet",o.href=p,(s="hideFocus"in o)&&o.relList&&(s=0,o.rel="preload",o.as="style")):/(^img!|\.(png|gif|jpg|svg|webp)$)/.test(h)?(o=l.createElement("img")).src=p:((o=l.createElement("script")).src=t,o.async=void 0===c||c),o.onload=o.onerror=o.onbeforeload=function(e){var l=e.type[0];if(s)try{o.sheet.cssText.length||(l="e")}catch(e){18!=e.code&&(l="e")}if("e"==l){if((a+=1)<u)return r(t,i,n,a)}else if("preload"==o.rel&&"style"==o.as)return o.rel="stylesheet";i(t,l,e.defaultPrevented)},!1!==d(t,o)&&l.head.appendChild(o)}function o(e,i,n){var o,l;if(i&&i.trim&&(o=i),l=(o?n:i)||{},o){if(o in t)throw"LoadJS";t[o]=!0}function c(t,i){!function(e,t,i){var n,a,s=(e=e.push?e:[e]).length,o=s,l=[];for(n=function(e,i,n){if("e"==i&&l.push(e),"b"==i){if(!n)return;l.push(e)}--s||t(l)},a=0;a<o;a++)r(e[a],n,i)}(e,(function(e){s(l,e),t&&s({success:t,error:i},e),a(o,e)}),l)}if(l.returnPromise)return new Promise(c);c()}return o.ready=function(e,t){return function(e,t){e=e.push?e:[e];var a,s,r,o=[],l=e.length,c=l;for(a=function(e,i){i.length&&o.push(e),--c||t(o)};l--;)s=e[l],(r=i[s])?a(s,r):(n[s]=n[s]||[]).push(a)}(e,(function(e){s(t,e)})),o},o.done=function(e){a(e,[])},o.reset=function(){t={},i={},n={}},o.isDefined=function(e){return e in t},o}()}));function wt(e){return new Promise((function(t,i){bt(e,{success:t,error:i})}))}function kt(e){e&&!this.embed.hasPlayed&&(this.embed.hasPlayed=!0),this.media.paused===e&&(this.media.paused=!e,Oe.call(this,this.media,e?"play":"pause"))}var Tt={setup:function(){var e=this;be(e.elements.wrapper,e.config.classNames.embed,!0),e.options.speed=e.config.speed.options,Re.call(e),z(window.Vimeo)?Tt.ready.call(e):wt(e.config.urls.vimeo.sdk).then((function(){Tt.ready.call(e)})).catch((function(t){e.debug.warn("Vimeo SDK (player.js) failed to load",t)}))},ready:function(){var e=this,t=this,i=t.config.vimeo,n=i.premium,a=i.referrerPolicy,l=r(i,["premium","referrerPolicy"]);n&&Object.assign(l,{controls:!1,sidedock:!1});var c=st(s({loop:t.config.loop.active,autoplay:t.autoplay,muted:t.muted,gesture:"media",playsinline:!this.config.fullscreen.iosNative},l)),u=t.media.getAttribute("src");ae(u)&&(u=t.media.getAttribute(t.config.attributes.embed.id));var d,h=ae(d=u)?null:K(Number(d))?d:d.match(/^.*(vimeo.com\/|video\/)(\d+).*/)?RegExp.$2:d,p=he("iframe"),m=Ue(t.config.urls.vimeo.iframe,h,c);p.setAttribute("src",m),p.setAttribute("allowfullscreen",""),p.setAttribute("allow","autoplay,fullscreen,picture-in-picture"),ae(a)||p.setAttribute("referrerPolicy",a);var f=t.poster;if(n)p.setAttribute("data-poster",f),t.media=ge(p,t.media);else{var g=he("div",{class:t.config.classNames.embedContainer,"data-poster":f});g.appendChild(p),t.media=ge(g,t.media)}Je(Ue(t.config.urls.vimeo.api,h),"json").then((function(e){if(!ae(e)){var i=new URL(e[0].thumbnail_large);i.pathname="".concat(i.pathname.split("_")[0],".jpg"),yt.setPoster.call(t,i.href).catch((function(){}))}})),t.embed=new window.Vimeo.Player(p,{autopause:t.config.autopause,muted:t.muted}),t.media.paused=!0,t.media.currentTime=0,t.supported.ui&&t.embed.disableTextTrack(),t.media.play=function(){return kt.call(t,!0),t.embed.play()},t.media.pause=function(){return kt.call(t,!1),t.embed.pause()},t.media.stop=function(){t.pause(),t.currentTime=0};var y=t.media.currentTime;Object.defineProperty(t.media,"currentTime",{get:function(){return y},set:function(e){var i=t.embed,n=t.media,a=t.paused,s=t.volume,r=a&&!i.hasPlayed;n.seeking=!0,Oe.call(t,n,"seeking"),Promise.resolve(r&&i.setVolume(0)).then((function(){return i.setCurrentTime(e)})).then((function(){return r&&i.pause()})).then((function(){return r&&i.setVolume(s)})).catch((function(){}))}});var v=t.config.speed.selected;Object.defineProperty(t.media,"playbackRate",{get:function(){return v},set:function(e){t.embed.setPlaybackRate(e).then((function(){v=e,Oe.call(t,t.media,"ratechange")})).catch((function(){t.options.speed=[1]}))}});var b=t.config.volume;Object.defineProperty(t.media,"volume",{get:function(){return b},set:function(e){t.embed.setVolume(e).then((function(){b=e,Oe.call(t,t.media,"volumechange")}))}});var w=t.config.muted;Object.defineProperty(t.media,"muted",{get:function(){return w},set:function(e){var i=!!Q(e)&&e;t.embed.setVolume(i?0:t.config.volume).then((function(){w=i,Oe.call(t,t.media,"volumechange")}))}});var k,T=t.config.loop;Object.defineProperty(t.media,"loop",{get:function(){return T},set:function(e){var i=Q(e)?e:t.config.loop.active;t.embed.setLoop(i).then((function(){T=i}))}}),t.embed.getVideoUrl().then((function(e){k=e,nt.setDownloadUrl.call(t)})).catch((function(t){e.debug.warn(t)})),Object.defineProperty(t.media,"currentSrc",{get:function(){return k}}),Object.defineProperty(t.media,"ended",{get:function(){return t.currentTime===t.duration}}),Promise.all([t.embed.getVideoWidth(),t.embed.getVideoHeight()]).then((function(i){var n=o(i,2),a=n[0],s=n[1];t.embed.ratio=[a,s],Re.call(e)})),t.embed.setAutopause(t.config.autopause).then((function(e){t.config.autopause=e})),t.embed.getVideoTitle().then((function(i){t.config.title=i,yt.setTitle.call(e)})),t.embed.getCurrentTime().then((function(e){y=e,Oe.call(t,t.media,"timeupdate")})),t.embed.getDuration().then((function(e){t.media.duration=e,Oe.call(t,t.media,"durationchange")})),t.embed.getTextTracks().then((function(e){t.media.textTracks=e,rt.setup.call(t)})),t.embed.on("cuechange",(function(e){var i=e.cues,n=(void 0===i?[]:i).map((function(e){return function(e){var t=document.createDocumentFragment(),i=document.createElement("div");return t.appendChild(i),i.innerHTML=e,t.firstChild.innerText}(e.text)}));rt.updateCues.call(t,n)})),t.embed.on("loaded",(function(){(t.embed.getPaused().then((function(e){kt.call(t,!e),e||Oe.call(t,t.media,"playing")})),G(t.embed.element)&&t.supported.ui)&&t.embed.element.setAttribute("tabindex",-1)})),t.embed.on("bufferstart",(function(){Oe.call(t,t.media,"waiting")})),t.embed.on("bufferend",(function(){Oe.call(t,t.media,"playing")})),t.embed.on("play",(function(){kt.call(t,!0),Oe.call(t,t.media,"playing")})),t.embed.on("pause",(function(){kt.call(t,!1)})),t.embed.on("timeupdate",(function(e){t.media.seeking=!1,y=e.seconds,Oe.call(t,t.media,"timeupdate")})),t.embed.on("progress",(function(e){t.media.buffered=e.percent,Oe.call(t,t.media,"progress"),1===parseInt(e.percent,10)&&Oe.call(t,t.media,"canplaythrough"),t.embed.getDuration().then((function(e){e!==t.media.duration&&(t.media.duration=e,Oe.call(t,t.media,"durationchange"))}))})),t.embed.on("seeked",(function(){t.media.seeking=!1,Oe.call(t,t.media,"seeked")})),t.embed.on("ended",(function(){t.media.paused=!0,Oe.call(t,t.media,"ended")})),t.embed.on("error",(function(e){t.media.error=e,Oe.call(t,t.media,"error")})),setTimeout((function(){return yt.build.call(t)}),0)}};function Ct(e){e&&!this.embed.hasPlayed&&(this.embed.hasPlayed=!0),this.media.paused===e&&(this.media.paused=!e,Oe.call(this,this.media,e?"play":"pause"))}function At(e){return e.noCookie?"https://www.youtube-nocookie.com":"http:"===window.location.protocol?"http://www.youtube.com":void 0}var St={setup:function(){var e=this;if(be(this.elements.wrapper,this.config.classNames.embed,!0),z(window.YT)&&X(window.YT.Player))St.ready.call(this);else{var t=window.onYouTubeIframeAPIReady;window.onYouTubeIframeAPIReady=function(){X(t)&&t(),St.ready.call(e)},wt(this.config.urls.youtube.sdk).catch((function(t){e.debug.warn("YouTube API failed to load",t)}))}},getTitle:function(e){var t=this;Je(Ue(this.config.urls.youtube.api,e)).then((function(e){if(z(e)){var i=e.title,n=e.height,a=e.width;t.config.title=i,yt.setTitle.call(t),t.embed.ratio=[a,n]}Re.call(t)})).catch((function(){Re.call(t)}))},ready:function(){var e=this,t=e.media&&e.media.getAttribute("id");if(ae(t)||!t.startsWith("youtube-")){var i=e.media.getAttribute("src");ae(i)&&(i=e.media.getAttribute(this.config.attributes.embed.id));var n,a,s=ae(n=i)?null:n.match(/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=)([^#&?]*).*/)?RegExp.$2:n,r=(a=e.provider,"".concat(a,"-").concat(Math.floor(1e4*Math.random()))),o=he("div",{id:r,"data-poster":e.poster});e.media=ge(o,e.media);var l=function(e){return"https://i.ytimg.com/vi/".concat(s,"/").concat(e,"default.jpg")};gt(l("maxres"),121).catch((function(){return gt(l("sd"),121)})).catch((function(){return gt(l("hq"))})).then((function(t){return yt.setPoster.call(e,t.src)})).then((function(t){t.includes("maxres")||(e.elements.poster.style.backgroundSize="cover")})).catch((function(){}));var c=e.config.youtube;e.embed=new window.YT.Player(r,{videoId:s,host:At(c),playerVars:ce({},{autoplay:e.config.autoplay?1:0,hl:e.config.hl,controls:e.supported.ui?0:1,disablekb:1,playsinline:e.config.fullscreen.iosNative?0:1,cc_load_policy:e.captions.active?1:0,cc_lang_pref:e.config.captions.language,widget_referrer:window?window.location.href:null},c),events:{onError:function(t){if(!e.media.error){var i=t.data,n={2:"The request contains an invalid parameter value. For example, this error occurs if you specify a video ID that does not have 11 characters, or if the video ID contains invalid characters, such as exclamation points or asterisks.",5:"The requested content cannot be played in an HTML5 player or another error related to the HTML5 player has occurred.",100:"The video requested was not found. This error occurs when a video has been removed (for any reason) or has been marked as private.",101:"The owner of the requested video does not allow it to be played in embedded players.",150:"The owner of the requested video does not allow it to be played in embedded players."}[i]||"An unknown error occured";e.media.error={code:i,message:n},Oe.call(e,e.media,"error")}},onPlaybackRateChange:function(t){var i=t.target;e.media.playbackRate=i.getPlaybackRate(),Oe.call(e,e.media,"ratechange")},onReady:function(t){if(!X(e.media.play)){var i=t.target;St.getTitle.call(e,s),e.media.play=function(){Ct.call(e,!0),i.playVideo()},e.media.pause=function(){Ct.call(e,!1),i.pauseVideo()},e.media.stop=function(){i.stopVideo()},e.media.duration=i.getDuration(),e.media.paused=!0,e.media.currentTime=0,Object.defineProperty(e.media,"currentTime",{get:function(){return Number(i.getCurrentTime())},set:function(t){e.paused&&!e.embed.hasPlayed&&e.embed.mute(),e.media.seeking=!0,Oe.call(e,e.media,"seeking"),i.seekTo(t)}}),Object.defineProperty(e.media,"playbackRate",{get:function(){return i.getPlaybackRate()},set:function(e){i.setPlaybackRate(e)}});var n=e.config.volume;Object.defineProperty(e.media,"volume",{get:function(){return n},set:function(t){n=t,i.setVolume(100*n),Oe.call(e,e.media,"volumechange")}});var a=e.config.muted;Object.defineProperty(e.media,"muted",{get:function(){return a},set:function(t){var n=Q(t)?t:a;a=n,i[n?"mute":"unMute"](),Oe.call(e,e.media,"volumechange")}}),Object.defineProperty(e.media,"currentSrc",{get:function(){return i.getVideoUrl()}}),Object.defineProperty(e.media,"ended",{get:function(){return e.currentTime===e.duration}});var r=i.getAvailablePlaybackRates();e.options.speed=r.filter((function(t){return e.config.speed.options.includes(t)})),e.supported.ui&&e.media.setAttribute("tabindex",-1),Oe.call(e,e.media,"timeupdate"),Oe.call(e,e.media,"durationchange"),clearInterval(e.timers.buffering),e.timers.buffering=setInterval((function(){e.media.buffered=i.getVideoLoadedFraction(),(null===e.media.lastBuffered||e.media.lastBuffered<e.media.buffered)&&Oe.call(e,e.media,"progress"),e.media.lastBuffered=e.media.buffered,1===e.media.buffered&&(clearInterval(e.timers.buffering),Oe.call(e,e.media,"canplaythrough"))}),200),setTimeout((function(){return yt.build.call(e)}),50)}},onStateChange:function(t){var i=t.target;switch(clearInterval(e.timers.playing),e.media.seeking&&[1,2].includes(t.data)&&(e.media.seeking=!1,Oe.call(e,e.media,"seeked")),t.data){case-1:Oe.call(e,e.media,"timeupdate"),e.media.buffered=i.getVideoLoadedFraction(),Oe.call(e,e.media,"progress");break;case 0:Ct.call(e,!1),e.media.loop?(i.stopVideo(),i.playVideo()):Oe.call(e,e.media,"ended");break;case 1:e.config.autoplay||!e.media.paused||e.embed.hasPlayed?(Ct.call(e,!0),Oe.call(e,e.media,"playing"),e.timers.playing=setInterval((function(){Oe.call(e,e.media,"timeupdate")}),50),e.media.duration!==i.getDuration()&&(e.media.duration=i.getDuration(),Oe.call(e,e.media,"durationchange"))):e.media.pause();break;case 2:e.muted||e.embed.unMute(),Ct.call(e,!1);break;case 3:Oe.call(e,e.media,"waiting")}Oe.call(e,e.elements.container,"statechange",!1,{code:t.data})}}})}}},Pt={setup:function(){this.media?(be(this.elements.container,this.config.classNames.type.replace("{0}",this.type),!0),be(this.elements.container,this.config.classNames.provider.replace("{0}",this.provider),!0),this.isEmbed&&be(this.elements.container,this.config.classNames.type.replace("{0}","video"),!0),this.isVideo&&(this.elements.wrapper=he("div",{class:this.config.classNames.video}),ue(this.media,this.elements.wrapper),this.elements.poster=he("div",{class:this.config.classNames.poster}),this.elements.wrapper.appendChild(this.elements.poster)),this.isHTML5?Ve.setup.call(this):this.isYouTube?St.setup.call(this):this.isVimeo&&Tt.setup.call(this)):this.debug.warn("No media element found!")}},Et=function(){function t(i){var n=this;e(this,t),this.player=i,this.config=i.config.ads,this.playing=!1,this.initialized=!1,this.elements={container:null,displayContainer:null},this.manager=null,this.loader=null,this.cuePoints=null,this.events={},this.safetyTimer=null,this.countdownTimer=null,this.managerPromise=new Promise((function(e,t){n.on("loaded",e),n.on("error",t)})),this.load()}return i(t,[{key:"load",value:function(){var e=this;this.enabled&&(z(window.google)&&z(window.google.ima)?this.ready():wt(this.player.config.urls.googleIMA.sdk).then((function(){e.ready()})).catch((function(){e.trigger("error",new Error("Google IMA SDK failed to load"))})))}},{key:"ready",value:function(){var e,t=this;this.enabled||((e=this).manager&&e.manager.destroy(),e.elements.displayContainer&&e.elements.displayContainer.destroy(),e.elements.container.remove()),this.startSafetyTimer(12e3,"ready()"),this.managerPromise.then((function(){t.clearSafetyTimer("onAdsManagerLoaded()")})),this.listeners(),this.setupIMA()}},{key:"setupIMA",value:function(){var e=this;this.elements.container=he("div",{class:this.player.config.classNames.ads}),this.player.elements.container.appendChild(this.elements.container),google.ima.settings.setVpaidMode(google.ima.ImaSdkSettings.VpaidMode.ENABLED),google.ima.settings.setLocale(this.player.config.ads.language),google.ima.settings.setDisableCustomPlaybackForIOS10Plus(this.player.config.playsinline),this.elements.displayContainer=new google.ima.AdDisplayContainer(this.elements.container,this.player.media),this.loader=new google.ima.AdsLoader(this.elements.displayContainer),this.loader.addEventListener(google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,(function(t){return e.onAdsManagerLoaded(t)}),!1),this.loader.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,(function(t){return e.onAdError(t)}),!1),this.requestAds()}},{key:"requestAds",value:function(){var e=this.player.elements.container;try{var t=new google.ima.AdsRequest;t.adTagUrl=this.tagUrl,t.linearAdSlotWidth=e.offsetWidth,t.linearAdSlotHeight=e.offsetHeight,t.nonLinearAdSlotWidth=e.offsetWidth,t.nonLinearAdSlotHeight=e.offsetHeight,t.forceNonLinearFullSlot=!1,t.setAdWillPlayMuted(!this.player.muted),this.loader.requestAds(t)}catch(e){this.onAdError(e)}}},{key:"pollCountdown",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!t)return clearInterval(this.countdownTimer),void this.elements.container.removeAttribute("data-badge-text");var i=function(){var t=it(Math.max(e.manager.getRemainingTime(),0)),i="".concat(Xe("advertisement",e.player.config)," - ").concat(t);e.elements.container.setAttribute("data-badge-text",i)};this.countdownTimer=setInterval(i,100)}},{key:"onAdsManagerLoaded",value:function(e){var t=this;if(this.enabled){var i=new google.ima.AdsRenderingSettings;i.restoreCustomPlaybackStateOnAdBreakComplete=!0,i.enablePreloading=!0,this.manager=e.getAdsManager(this.player,i),this.cuePoints=this.manager.getCuePoints(),this.manager.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,(function(e){return t.onAdError(e)})),Object.keys(google.ima.AdEvent.Type).forEach((function(e){t.manager.addEventListener(google.ima.AdEvent.Type[e],(function(e){return t.onAdEvent(e)}))})),this.trigger("loaded")}}},{key:"addCuePoints",value:function(){var e=this;ae(this.cuePoints)||this.cuePoints.forEach((function(t){if(0!==t&&-1!==t&&t<e.player.duration){var i=e.player.elements.progress;if(G(i)){var n=100/e.player.duration*t,a=he("span",{class:e.player.config.classNames.cues});a.style.left="".concat(n.toString(),"%"),i.appendChild(a)}}}))}},{key:"onAdEvent",value:function(e){var t=this,i=this.player.elements.container,n=e.getAd(),a=e.getAdData();switch(function(e){Oe.call(t.player,t.player.media,"ads".concat(e.replace(/_/g,"").toLowerCase()))}(e.type),e.type){case google.ima.AdEvent.Type.LOADED:this.trigger("loaded"),this.pollCountdown(!0),n.isLinear()||(n.width=i.offsetWidth,n.height=i.offsetHeight);break;case google.ima.AdEvent.Type.STARTED:this.manager.setVolume(this.player.volume);break;case google.ima.AdEvent.Type.ALL_ADS_COMPLETED:this.player.ended?this.loadAds():this.loader.contentComplete();break;case google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED:this.pauseContent();break;case google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED:this.pollCountdown(),this.resumeContent();break;case google.ima.AdEvent.Type.LOG:a.adError&&this.player.debug.warn("Non-fatal ad error: ".concat(a.adError.getMessage()))}}},{key:"onAdError",value:function(e){this.cancel(),this.player.debug.warn("Ads error",e)}},{key:"listeners",value:function(){var e,t=this,i=this.player.elements.container;this.player.on("canplay",(function(){t.addCuePoints()})),this.player.on("ended",(function(){t.loader.contentComplete()})),this.player.on("timeupdate",(function(){e=t.player.currentTime})),this.player.on("seeked",(function(){var i=t.player.currentTime;ae(t.cuePoints)||t.cuePoints.forEach((function(n,a){e<n&&n<i&&(t.manager.discardAdBreak(),t.cuePoints.splice(a,1))}))})),window.addEventListener("resize",(function(){t.manager&&t.manager.resize(i.offsetWidth,i.offsetHeight,google.ima.ViewMode.NORMAL)}))}},{key:"play",value:function(){var e=this,t=this.player.elements.container;this.managerPromise||this.resumeContent(),this.managerPromise.then((function(){e.manager.setVolume(e.player.volume),e.elements.displayContainer.initialize();try{e.initialized||(e.manager.init(t.offsetWidth,t.offsetHeight,google.ima.ViewMode.NORMAL),e.manager.start()),e.initialized=!0}catch(t){e.onAdError(t)}})).catch((function(){}))}},{key:"resumeContent",value:function(){this.elements.container.style.zIndex="",this.playing=!1,qe(this.player.media.play())}},{key:"pauseContent",value:function(){this.elements.container.style.zIndex=3,this.playing=!0,this.player.media.pause()}},{key:"cancel",value:function(){this.initialized&&this.resumeContent(),this.trigger("error"),this.loadAds()}},{key:"loadAds",value:function(){var e=this;this.managerPromise.then((function(){e.manager&&e.manager.destroy(),e.managerPromise=new Promise((function(t){e.on("loaded",t),e.player.debug.log(e.manager)})),e.initialized=!1,e.requestAds()})).catch((function(){}))}},{key:"trigger",value:function(e){for(var t=this,i=arguments.length,n=new Array(i>1?i-1:0),a=1;a<i;a++)n[a-1]=arguments[a];var s=this.events[e];$(s)&&s.forEach((function(e){X(e)&&e.apply(t,n)}))}},{key:"on",value:function(e,t){return $(this.events[e])||(this.events[e]=[]),this.events[e].push(t),this}},{key:"startSafetyTimer",value:function(e,t){var i=this;this.player.debug.log("Safety timer invoked from: ".concat(t)),this.safetyTimer=setTimeout((function(){i.cancel(),i.clearSafetyTimer("startSafetyTimer()")}),e)}},{key:"clearSafetyTimer",value:function(e){W(this.safetyTimer)||(this.player.debug.log("Safety timer cleared from: ".concat(e)),clearTimeout(this.safetyTimer),this.safetyTimer=null)}},{key:"enabled",get:function(){var e=this.config;return this.player.isHTML5&&this.player.isVideo&&e.enabled&&(!ae(e.publisherId)||ne(e.tagUrl))}},{key:"tagUrl",get:function(){var e=this.config;if(ne(e.tagUrl))return e.tagUrl;var t={AV_PUBLISHERID:"58c25bb0073ef448b1087ad6",AV_CHANNELID:"5a0458dc28a06145e4519d21",AV_URL:window.location.hostname,cb:Date.now(),AV_WIDTH:640,AV_HEIGHT:480,AV_CDIM2:e.publisherId};return"".concat("https://go.aniview.com/api/adserver6/vast/","?").concat(st(t))}}]),t}(),Nt=function(e,t){var i={};return e>t.width/t.height?(i.width=t.width,i.height=1/e*t.width):(i.height=t.height,i.width=e*t.height),i},Mt=function(){function t(i){e(this,t),this.player=i,this.thumbnails=[],this.loaded=!1,this.lastMouseMoveTime=Date.now(),this.mouseDown=!1,this.loadedImages=[],this.elements={thumb:{},scrubbing:{}},this.load()}return i(t,[{key:"load",value:function(){var e=this;this.player.elements.display.seekTooltip&&(this.player.elements.display.seekTooltip.hidden=this.enabled),this.enabled&&this.getThumbnails().then((function(){e.enabled&&(e.render(),e.determineContainerAutoSizing(),e.loaded=!0)}))}},{key:"getThumbnails",value:function(){var e=this;return new Promise((function(t){var i=e.player.config.previewThumbnails.src;if(ae(i))throw new Error("Missing previewThumbnails.src config attribute");var n=function(){e.thumbnails.sort((function(e,t){return e.height-t.height})),e.player.debug.log("Preview thumbnails",e.thumbnails),t()};if(X(i))i((function(t){e.thumbnails=t,n()}));else{var a=(Y(i)?[i]:i).map((function(t){return e.getThumbnail(t)}));Promise.all(a).then(n)}}))}},{key:"getThumbnail",value:function(e){var t=this;return new Promise((function(i){Je(e).then((function(n){var a,s,r={frames:(a=n,s=[],a.split(/\r\n\r\n|\n\n|\r\r/).forEach((function(e){var t={};e.split(/\r\n|\n|\r/).forEach((function(e){if(K(t.startTime)){if(!ae(e.trim())&&ae(t.text)){var i=e.trim().split("#xywh="),n=o(i,1);if(t.text=n[0],i[1]){var a=o(i[1].split(","),4);t.x=a[0],t.y=a[1],t.w=a[2],t.h=a[3]}}}else{var s=e.match(/([0-9]{2})?:?([0-9]{2}):([0-9]{2}).([0-9]{2,3})( ?--> ?)([0-9]{2})?:?([0-9]{2}):([0-9]{2}).([0-9]{2,3})/);s&&(t.startTime=60*Number(s[1]||0)*60+60*Number(s[2])+Number(s[3])+Number("0.".concat(s[4])),t.endTime=60*Number(s[6]||0)*60+60*Number(s[7])+Number(s[8])+Number("0.".concat(s[9])))}})),t.text&&s.push(t)})),s),height:null,urlPrefix:""};r.frames[0].text.startsWith("/")||r.frames[0].text.startsWith("http://")||r.frames[0].text.startsWith("https://")||(r.urlPrefix=e.substring(0,e.lastIndexOf("/")+1));var l=new Image;l.onload=function(){r.height=l.naturalHeight,r.width=l.naturalWidth,t.thumbnails.push(r),i()},l.src=r.urlPrefix+r.frames[0].text}))}))}},{key:"startMove",value:function(e){if(this.loaded&&Z(e)&&["touchmove","mousemove"].includes(e.type)&&this.player.media.duration){if("touchmove"===e.type)this.seekTime=this.player.media.duration*(this.player.elements.inputs.seek.value/100);else{var t=this.player.elements.progress.getBoundingClientRect(),i=100/t.width*(e.pageX-t.left);this.seekTime=this.player.media.duration*(i/100),this.seekTime<0&&(this.seekTime=0),this.seekTime>this.player.media.duration-1&&(this.seekTime=this.player.media.duration-1),this.mousePosX=e.pageX,this.elements.thumb.time.innerText=it(this.seekTime)}this.showImageAtCurrentTime()}}},{key:"endMove",value:function(){this.toggleThumbContainer(!1,!0)}},{key:"startScrubbing",value:function(e){(W(e.button)||!1===e.button||0===e.button)&&(this.mouseDown=!0,this.player.media.duration&&(this.toggleScrubbingContainer(!0),this.toggleThumbContainer(!1,!0),this.showImageAtCurrentTime()))}},{key:"endScrubbing",value:function(){var e=this;this.mouseDown=!1,Math.ceil(this.lastTime)===Math.ceil(this.player.media.currentTime)?this.toggleScrubbingContainer(!1):Le.call(this.player,this.player.media,"timeupdate",(function(){e.mouseDown||e.toggleScrubbingContainer(!1)}))}},{key:"listeners",value:function(){var e=this;this.player.on("play",(function(){e.toggleThumbContainer(!1,!0)})),this.player.on("seeked",(function(){e.toggleThumbContainer(!1)})),this.player.on("timeupdate",(function(){e.lastTime=e.player.media.currentTime}))}},{key:"render",value:function(){this.elements.thumb.container=he("div",{class:this.player.config.classNames.previewThumbnails.thumbContainer}),this.elements.thumb.imageContainer=he("div",{class:this.player.config.classNames.previewThumbnails.imageContainer}),this.elements.thumb.container.appendChild(this.elements.thumb.imageContainer);var e=he("div",{class:this.player.config.classNames.previewThumbnails.timeContainer});this.elements.thumb.time=he("span",{},"00:00"),e.appendChild(this.elements.thumb.time),this.elements.thumb.container.appendChild(e),G(this.player.elements.progress)&&this.player.elements.progress.appendChild(this.elements.thumb.container),this.elements.scrubbing.container=he("div",{class:this.player.config.classNames.previewThumbnails.scrubbingContainer}),this.player.elements.wrapper.appendChild(this.elements.scrubbing.container)}},{key:"destroy",value:function(){this.elements.thumb.container&&this.elements.thumb.container.remove(),this.elements.scrubbing.container&&this.elements.scrubbing.container.remove()}},{key:"showImageAtCurrentTime",value:function(){var e=this;this.mouseDown?this.setScrubbingContainerSize():this.setThumbContainerSizeAndPos();var t=this.thumbnails[0].frames.findIndex((function(t){return e.seekTime>=t.startTime&&e.seekTime<=t.endTime})),i=t>=0,n=0;this.mouseDown||this.toggleThumbContainer(i),i&&(this.thumbnails.forEach((function(i,a){e.loadedImages.includes(i.frames[t].text)&&(n=a)})),t!==this.showingThumb&&(this.showingThumb=t,this.loadImage(n)))}},{key:"loadImage",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=this.showingThumb,n=this.thumbnails[t],a=n.urlPrefix,s=n.frames[i],r=n.frames[i].text,o=a+r;if(this.currentImageElement&&this.currentImageElement.dataset.filename===r)this.showImage(this.currentImageElement,s,t,i,r,!1),this.currentImageElement.dataset.index=i,this.removeOldImages(this.currentImageElement);else{this.loadingImage&&this.usingSprites&&(this.loadingImage.onload=null);var l=new Image;l.src=o,l.dataset.index=i,l.dataset.filename=r,this.showingThumbFilename=r,this.player.debug.log("Loading image: ".concat(o)),l.onload=function(){return e.showImage(l,s,t,i,r,!0)},this.loadingImage=l,this.removeOldImages(l)}}},{key:"showImage",value:function(e,t,i,n,a){var s=!(arguments.length>5&&void 0!==arguments[5])||arguments[5];this.player.debug.log("Showing thumb: ".concat(a,". num: ").concat(n,". qual: ").concat(i,". newimg: ").concat(s)),this.setImageSizeAndOffset(e,t),s&&(this.currentImageContainer.appendChild(e),this.currentImageElement=e,this.loadedImages.includes(a)||this.loadedImages.push(a)),this.preloadNearby(n,!0).then(this.preloadNearby(n,!1)).then(this.getHigherQuality(i,e,t,a))}},{key:"removeOldImages",value:function(e){var t=this;Array.from(this.currentImageContainer.children).forEach((function(i){if("img"===i.tagName.toLowerCase()){var n=t.usingSprites?500:1e3;if(i.dataset.index!==e.dataset.index&&!i.dataset.deleting){i.dataset.deleting=!0;var a=t.currentImageContainer;setTimeout((function(){a.removeChild(i),t.player.debug.log("Removing thumb: ".concat(i.dataset.filename))}),n)}}}))}},{key:"preloadNearby",value:function(e){var t=this,i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return new Promise((function(n){setTimeout((function(){var a=t.thumbnails[0].frames[e].text;if(t.showingThumbFilename===a){var s;s=i?t.thumbnails[0].frames.slice(e):t.thumbnails[0].frames.slice(0,e).reverse();var r=!1;s.forEach((function(e){var i=e.text;if(i!==a&&!t.loadedImages.includes(i)){r=!0,t.player.debug.log("Preloading thumb filename: ".concat(i));var s=t.thumbnails[0].urlPrefix+i,o=new Image;o.src=s,o.onload=function(){t.player.debug.log("Preloaded thumb filename: ".concat(i)),t.loadedImages.includes(i)||t.loadedImages.push(i),n()}}})),r||n()}}),300)}))}},{key:"getHigherQuality",value:function(e,t,i,n){var a=this;if(e<this.thumbnails.length-1){var s=t.naturalHeight;this.usingSprites&&(s=i.h),s<this.thumbContainerHeight&&setTimeout((function(){a.showingThumbFilename===n&&(a.player.debug.log("Showing higher quality thumb for: ".concat(n)),a.loadImage(e+1))}),300)}}},{key:"toggleThumbContainer",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=this.player.config.classNames.previewThumbnails.thumbContainerShown;this.elements.thumb.container.classList.toggle(i,e),!e&&t&&(this.showingThumb=null,this.showingThumbFilename=null)}},{key:"toggleScrubbingContainer",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.player.config.classNames.previewThumbnails.scrubbingContainerShown;this.elements.scrubbing.container.classList.toggle(t,e),e||(this.showingThumb=null,this.showingThumbFilename=null)}},{key:"determineContainerAutoSizing",value:function(){(this.elements.thumb.imageContainer.clientHeight>20||this.elements.thumb.imageContainer.clientWidth>20)&&(this.sizeSpecifiedInCSS=!0)}},{key:"setThumbContainerSizeAndPos",value:function(){if(this.sizeSpecifiedInCSS){if(this.elements.thumb.imageContainer.clientHeight>20&&this.elements.thumb.imageContainer.clientWidth<20){var e=Math.floor(this.elements.thumb.imageContainer.clientHeight*this.thumbAspectRatio);this.elements.thumb.imageContainer.style.width="".concat(e,"px")}else if(this.elements.thumb.imageContainer.clientHeight<20&&this.elements.thumb.imageContainer.clientWidth>20){var t=Math.floor(this.elements.thumb.imageContainer.clientWidth/this.thumbAspectRatio);this.elements.thumb.imageContainer.style.height="".concat(t,"px")}}else{var i=Math.floor(this.thumbContainerHeight*this.thumbAspectRatio);this.elements.thumb.imageContainer.style.height="".concat(this.thumbContainerHeight,"px"),this.elements.thumb.imageContainer.style.width="".concat(i,"px")}this.setThumbContainerPos()}},{key:"setThumbContainerPos",value:function(){var e=this.player.elements.progress.getBoundingClientRect(),t=this.player.elements.container.getBoundingClientRect(),i=this.elements.thumb.container,n=t.left-e.left+10,a=t.right-e.left-i.clientWidth-10,s=this.mousePosX-e.left-i.clientWidth/2;s<n&&(s=n),s>a&&(s=a),i.style.left="".concat(s,"px")}},{key:"setScrubbingContainerSize",value:function(){var e=Nt(this.thumbAspectRatio,{width:this.player.media.clientWidth,height:this.player.media.clientHeight}),t=e.width,i=e.height;this.elements.scrubbing.container.style.width="".concat(t,"px"),this.elements.scrubbing.container.style.height="".concat(i,"px")}},{key:"setImageSizeAndOffset",value:function(e,t){if(this.usingSprites){var i=this.thumbContainerHeight/t.h;e.style.height="".concat(e.naturalHeight*i,"px"),e.style.width="".concat(e.naturalWidth*i,"px"),e.style.left="-".concat(t.x*i,"px"),e.style.top="-".concat(t.y*i,"px")}}},{key:"enabled",get:function(){return this.player.isHTML5&&this.player.isVideo&&this.player.config.previewThumbnails.enabled}},{key:"currentImageContainer",get:function(){return this.mouseDown?this.elements.scrubbing.container:this.elements.thumb.imageContainer}},{key:"usingSprites",get:function(){return Object.keys(this.thumbnails[0].frames[0]).includes("w")}},{key:"thumbAspectRatio",get:function(){return this.usingSprites?this.thumbnails[0].frames[0].w/this.thumbnails[0].frames[0].h:this.thumbnails[0].width/this.thumbnails[0].height}},{key:"thumbContainerHeight",get:function(){return this.mouseDown?Nt(this.thumbAspectRatio,{width:this.player.media.clientWidth,height:this.player.media.clientHeight}).height:this.sizeSpecifiedInCSS?this.elements.thumb.imageContainer.clientHeight:Math.floor(this.player.media.clientWidth/this.thumbAspectRatio/4)}},{key:"currentImageElement",get:function(){return this.mouseDown?this.currentScrubbingImageElement:this.currentThumbnailImageElement},set:function(e){this.mouseDown?this.currentScrubbingImageElement=e:this.currentThumbnailImageElement=e}}]),t}(),xt={insertElements:function(e,t){var i=this;Y(t)?pe(e,this.media,{src:t}):$(t)&&t.forEach((function(t){pe(e,i.media,t)}))},change:function(e){var t=this;le(e,"sources.length")?(Ve.cancelRequests.call(this),this.destroy.call(this,(function(){t.options.quality=[],me(t.media),t.media=null,G(t.elements.container)&&t.elements.container.removeAttribute("class");var i=e.sources,n=e.type,a=o(i,1)[0],s=a.provider,r=void 0===s?ut.html5:s,l=a.src,c="html5"===r?n:"div",u="html5"===r?{}:{src:l};Object.assign(t,{provider:r,type:n,supported:Ee.check(n,r,t.config.playsinline),media:he(c,u)}),t.elements.container.appendChild(t.media),Q(e.autoplay)&&(t.config.autoplay=e.autoplay),t.isHTML5&&(t.config.crossorigin&&t.media.setAttribute("crossorigin",""),t.config.autoplay&&t.media.setAttribute("autoplay",""),ae(e.poster)||(t.poster=e.poster),t.config.loop.active&&t.media.setAttribute("loop",""),t.config.muted&&t.media.setAttribute("muted",""),t.config.playsinline&&t.media.setAttribute("playsinline","")),yt.addStyleHook.call(t),t.isHTML5&&xt.insertElements.call(t,"source",i),t.config.title=e.title,Pt.setup.call(t),t.isHTML5&&Object.keys(e).includes("tracks")&&xt.insertElements.call(t,"track",e.tracks),(t.isHTML5||t.isEmbed&&!t.supported.ui)&&yt.build.call(t),t.isHTML5&&t.media.load(),ae(e.previewThumbnails)||(Object.assign(t.config.previewThumbnails,e.previewThumbnails),t.previewThumbnails&&t.previewThumbnails.loaded&&(t.previewThumbnails.destroy(),t.previewThumbnails=null),t.config.previewThumbnails.enabled&&(t.previewThumbnails=new Mt(t))),t.fullscreen.update()}),!0)):this.debug.warn("Invalid source format")}};var It,Lt=function(){function t(i,n){var a=this;if(e(this,t),this.timers={},this.ready=!1,this.loading=!1,this.failed=!1,this.touch=Ee.touch,this.media=i,Y(this.media)&&(this.media=document.querySelectorAll(this.media)),(window.jQuery&&this.media instanceof jQuery||J(this.media)||$(this.media))&&(this.media=this.media[0]),this.config=ce({},ot,t.defaults,n||{},function(){try{return JSON.parse(a.media.getAttribute("data-plyr-config"))}catch(e){return{}}}()),this.elements={container:null,fullscreen:null,captions:null,buttons:{},display:{},progress:{},inputs:{},settings:{popup:null,menu:null,panels:{},buttons:{}}},this.captions={active:null,currentTrack:-1,meta:new WeakMap},this.fullscreen={active:!1},this.options={speed:[],quality:[]},this.debug=new mt(this.config.debug),this.debug.log("Config",this.config),this.debug.log("Support",Ee),!W(this.media)&&G(this.media))if(this.media.plyr)this.debug.warn("Target already setup");else if(this.config.enabled)if(Ee.check().api){var s=this.media.cloneNode(!0);s.autoplay=!1,this.elements.original=s;var r=this.media.tagName.toLowerCase(),o=null,l=null;switch(r){case"div":if(o=this.media.querySelector("iframe"),G(o)){if(l=at(o.getAttribute("src")),this.provider=function(e){return/^(https?:\/\/)?(www\.)?(youtube\.com|youtube-nocookie\.com|youtu\.?be)\/.+$/.test(e)?ut.youtube:/^https?:\/\/player.vimeo.com\/video\/\d{0,9}(?=\b|\/)/.test(e)?ut.vimeo:null}(l.toString()),this.elements.container=this.media,this.media=o,this.elements.container.className="",l.search.length){var c=["1","true"];c.includes(l.searchParams.get("autoplay"))&&(this.config.autoplay=!0),c.includes(l.searchParams.get("loop"))&&(this.config.loop.active=!0),this.isYouTube?(this.config.playsinline=c.includes(l.searchParams.get("playsinline")),this.config.youtube.hl=l.searchParams.get("hl")):this.config.playsinline=!0}}else this.provider=this.media.getAttribute(this.config.attributes.embed.provider),this.media.removeAttribute(this.config.attributes.embed.provider);if(ae(this.provider)||!Object.keys(ut).includes(this.provider))return void this.debug.error("Setup failed: Invalid provider");this.type=ht;break;case"video":case"audio":this.type=r,this.provider=ut.html5,this.media.hasAttribute("crossorigin")&&(this.config.crossorigin=!0),this.media.hasAttribute("autoplay")&&(this.config.autoplay=!0),(this.media.hasAttribute("playsinline")||this.media.hasAttribute("webkit-playsinline"))&&(this.config.playsinline=!0),this.media.hasAttribute("muted")&&(this.config.muted=!0),this.media.hasAttribute("loop")&&(this.config.loop.active=!0);break;default:return void this.debug.error("Setup failed: unsupported type")}this.supported=Ee.check(this.type,this.provider,this.config.playsinline),this.supported.api?(this.eventListeners=[],this.listeners=new vt(this),this.storage=new $e(this),this.media.plyr=this,G(this.elements.container)||(this.elements.container=he("div",{tabindex:0}),ue(this.media,this.elements.container)),yt.migrateStyles.call(this),yt.addStyleHook.call(this),Pt.setup.call(this),this.config.debug&&xe.call(this,this.elements.container,this.config.events.join(" "),(function(e){a.debug.log("event: ".concat(e.type))})),this.fullscreen=new ft(this),(this.isHTML5||this.isEmbed&&!this.supported.ui)&&yt.build.call(this),this.listeners.container(),this.listeners.global(),this.config.ads.enabled&&(this.ads=new Et(this)),this.isHTML5&&this.config.autoplay&&setTimeout((function(){return qe(a.play())}),10),this.lastSeekTime=0,this.config.previewThumbnails.enabled&&(this.previewThumbnails=new Mt(this))):this.debug.error("Setup failed: no support")}else this.debug.error("Setup failed: no support");else this.debug.error("Setup failed: disabled by config");else this.debug.error("Setup failed: no suitable element passed")}return i(t,[{key:"play",value:function(){var e=this;return X(this.media.play)?(this.ads&&this.ads.enabled&&this.ads.managerPromise.then((function(){return e.ads.play()})).catch((function(){return qe(e.media.play())})),this.media.play()):null}},{key:"pause",value:function(){return this.playing&&X(this.media.pause)?this.media.pause():null}},{key:"togglePlay",value:function(e){return(Q(e)?e:!this.playing)?this.play():this.pause()}},{key:"stop",value:function(){this.isHTML5?(this.pause(),this.restart()):X(this.media.stop)&&this.media.stop()}},{key:"restart",value:function(){this.currentTime=0}},{key:"rewind",value:function(e){this.currentTime-=K(e)?e:this.config.seekTime}},{key:"forward",value:function(e){this.currentTime+=K(e)?e:this.config.seekTime}},{key:"increaseVolume",value:function(e){var t=this.media.muted?0:this.volume;this.volume=t+(K(e)?e:0)}},{key:"decreaseVolume",value:function(e){this.increaseVolume(-e)}},{key:"toggleCaptions",value:function(e){rt.toggle.call(this,e,!1)}},{key:"airplay",value:function(){Ee.airplay&&this.media.webkitShowPlaybackTargetPicker()}},{key:"toggleControls",value:function(e){if(this.supported.ui&&!this.isAudio){var t=we(this.elements.container,this.config.classNames.hideControls),i=void 0===e?void 0:!e,n=be(this.elements.container,this.config.classNames.hideControls,i);if(n&&$(this.config.controls)&&this.config.controls.includes("settings")&&!ae(this.config.settings)&&nt.toggleMenu.call(this,!1),n!==t){var a=n?"controlshidden":"controlsshown";Oe.call(this,this.media,a)}return!n}return!1}},{key:"on",value:function(e,t){xe.call(this,this.elements.container,e,t)}},{key:"once",value:function(e,t){Le.call(this,this.elements.container,e,t)}},{key:"off",value:function(e,t){Ie(this.elements.container,e,t)}},{key:"destroy",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this.ready){var n=function(){document.body.style.overflow="",t.embed=null,i?(Object.keys(t.elements).length&&(me(t.elements.buttons.play),me(t.elements.captions),me(t.elements.controls),me(t.elements.wrapper),t.elements.buttons.play=null,t.elements.captions=null,t.elements.controls=null,t.elements.wrapper=null),X(e)&&e()):(_e.call(t),ge(t.elements.original,t.elements.container),Oe.call(t,t.elements.original,"destroyed",!0),X(e)&&e.call(t.elements.original),t.ready=!1,setTimeout((function(){t.elements=null,t.media=null}),200))};this.stop(),clearTimeout(this.timers.loading),clearTimeout(this.timers.controls),clearTimeout(this.timers.resized),this.isHTML5?(yt.toggleNativeControls.call(this,!0),n()):this.isYouTube?(clearInterval(this.timers.buffering),clearInterval(this.timers.playing),null!==this.embed&&X(this.embed.destroy)&&this.embed.destroy(),n()):this.isVimeo&&(null!==this.embed&&this.embed.unload().then(n),setTimeout(n,200))}}},{key:"supports",value:function(e){return Ee.mime.call(this,e)}},{key:"isHTML5",get:function(){return this.provider===ut.html5}},{key:"isEmbed",get:function(){return this.isYouTube||this.isVimeo}},{key:"isYouTube",get:function(){return this.provider===ut.youtube}},{key:"isVimeo",get:function(){return this.provider===ut.vimeo}},{key:"isVideo",get:function(){return this.type===ht}},{key:"isAudio",get:function(){return this.type===dt}},{key:"playing",get:function(){return Boolean(this.ready&&!this.paused&&!this.ended)}},{key:"paused",get:function(){return Boolean(this.media.paused)}},{key:"stopped",get:function(){return Boolean(this.paused&&0===this.currentTime)}},{key:"ended",get:function(){return Boolean(this.media.ended)}},{key:"currentTime",set:function(e){if(this.duration){var t=K(e)&&e>0;this.media.currentTime=t?Math.min(e,this.duration):0,this.debug.log("Seeking to ".concat(this.currentTime," seconds"))}},get:function(){return Number(this.media.currentTime)}},{key:"buffered",get:function(){var e=this.media.buffered;return K(e)?e:e&&e.length&&this.duration>0?e.end(0)/this.duration:0}},{key:"seeking",get:function(){return Boolean(this.media.seeking)}},{key:"duration",get:function(){var e=parseFloat(this.config.duration),t=(this.media||{}).duration,i=K(t)&&t!==1/0?t:0;return e||i}},{key:"volume",set:function(e){var t=e;Y(t)&&(t=Number(t)),K(t)||(t=this.storage.get("volume")),K(t)||(t=this.config.volume),t>1&&(t=1),t<0&&(t=0),this.config.volume=t,this.media.volume=t,!ae(e)&&this.muted&&t>0&&(this.muted=!1)},get:function(){return Number(this.media.volume)}},{key:"muted",set:function(e){var t=e;Q(t)||(t=this.storage.get("muted")),Q(t)||(t=this.config.muted),this.config.muted=t,this.media.muted=t},get:function(){return Boolean(this.media.muted)}},{key:"hasAudio",get:function(){return!this.isHTML5||(!!this.isAudio||(Boolean(this.media.mozHasAudio)||Boolean(this.media.webkitAudioDecodedByteCount)||Boolean(this.media.audioTracks&&this.media.audioTracks.length)))}},{key:"speed",set:function(e){var t=this,i=null;K(e)&&(i=e),K(i)||(i=this.storage.get("speed")),K(i)||(i=this.config.speed.selected);var n=this.minimumSpeed,a=this.maximumSpeed;i=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:255;return Math.min(Math.max(e,t),i)}(i,n,a),this.config.speed.selected=i,setTimeout((function(){t.media.playbackRate=i}),0)},get:function(){return Number(this.media.playbackRate)}},{key:"minimumSpeed",get:function(){return this.isYouTube?Math.min.apply(Math,l(this.options.speed)):this.isVimeo?.5:.0625}},{key:"maximumSpeed",get:function(){return this.isYouTube?Math.max.apply(Math,l(this.options.speed)):this.isVimeo?2:16}},{key:"quality",set:function(e){var t=this.config.quality,i=this.options.quality;if(i.length){var n=[!ae(e)&&Number(e),this.storage.get("quality"),t.selected,t.default].find(K),a=!0;if(!i.includes(n)){var s=function(e,t){return $(e)&&e.length?e.reduce((function(e,i){return Math.abs(i-t)<Math.abs(e-t)?i:e})):null}(i,n);this.debug.warn("Unsupported quality option: ".concat(n,", using ").concat(s," instead")),n=s,a=!1}t.selected=n,this.media.quality=n,a&&this.storage.set({quality:n})}},get:function(){return this.media.quality}},{key:"loop",set:function(e){var t=Q(e)?e:this.config.loop.active;this.config.loop.active=t,this.media.loop=t},get:function(){return Boolean(this.media.loop)}},{key:"source",set:function(e){xt.change.call(this,e)},get:function(){return this.media.currentSrc}},{key:"download",get:function(){var e=this.config.urls.download;return ne(e)?e:this.source},set:function(e){ne(e)&&(this.config.urls.download=e,nt.setDownloadUrl.call(this))}},{key:"poster",set:function(e){this.isVideo?yt.setPoster.call(this,e,!1).catch((function(){})):this.debug.warn("Poster can only be set for video")},get:function(){return this.isVideo?this.media.getAttribute("poster")||this.media.getAttribute("data-poster"):null}},{key:"ratio",get:function(){if(!this.isVideo)return null;var e=He(Fe.call(this));return $(e)?e.join(":"):e},set:function(e){this.isVideo?Y(e)&&De(e)?(this.config.ratio=e,Re.call(this)):this.debug.error("Invalid aspect ratio specified (".concat(e,")")):this.debug.warn("Aspect ratio can only be set for video")}},{key:"autoplay",set:function(e){var t=Q(e)?e:this.config.autoplay;this.config.autoplay=t},get:function(){return Boolean(this.config.autoplay)}},{key:"currentTrack",set:function(e){rt.set.call(this,e,!1)},get:function(){var e=this.captions,t=e.toggled,i=e.currentTrack;return t?i:-1}},{key:"language",set:function(e){rt.setLanguage.call(this,e,!1)},get:function(){return(rt.getCurrentTrack.call(this)||{}).language}},{key:"pip",set:function(e){if(Ee.pip){var t=Q(e)?e:!this.pip;X(this.media.webkitSetPresentationMode)&&this.media.webkitSetPresentationMode(t?lt:ct),X(this.media.requestPictureInPicture)&&(!this.pip&&t?this.media.requestPictureInPicture():this.pip&&!t&&document.exitPictureInPicture())}},get:function(){return Ee.pip?ae(this.media.webkitPresentationMode)?this.media===document.pictureInPictureElement:this.media.webkitPresentationMode===lt:null}}],[{key:"supported",value:function(e,t,i){return Ee.check(e,t,i)}},{key:"loadSprite",value:function(e,t){return Ge(e,t)}},{key:"setup",value:function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=null;return Y(e)?n=Array.from(document.querySelectorAll(e)):J(e)?n=Array.from(e):$(e)&&(n=e.filter(G)),ae(n)?null:n.map((function(e){return new t(e,i)}))}}]),t}();return Lt.defaults=(It=ot,JSON.parse(JSON.stringify(It))),Lt}));
4
- //# sourceMappingURL=plyr.min.js.map
1
+ "object"==typeof navigator&&function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define("Plyr",t):(e="undefined"!=typeof globalThis?globalThis:e||self).Plyr=t()}(this,(function(){"use strict";function e(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function t(e,t){for(var i=0;i<t.length;i++){var s=t[i];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,s.key,s)}}function i(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function s(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,s)}return i}function n(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){i(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var a={addCSS:!0,thumbWidth:15,watch:!0};function l(e,t){return function(){return Array.from(document.querySelectorAll(t)).includes(this)}.call(e,t)}var o=function(e){return null!=e?e.constructor:null},r=function(e,t){return!!(e&&t&&e instanceof t)},c=function(e){return null==e},h=function(e){return o(e)===Object},u=function(e){return o(e)===String},d=function(e){return Array.isArray(e)},m=function(e){return r(e,NodeList)},p=u,g=d,f=m,b=function(e){return r(e,Element)},y=function(e){return r(e,Event)},v=function(e){return c(e)||(u(e)||d(e)||m(e))&&!e.length||h(e)&&!Object.keys(e).length};function w(e,t){if(1>t){var i=function(e){var t="".concat(e).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return t?Math.max(0,(t[1]?t[1].length:0)-(t[2]?+t[2]:0)):0}(t);return parseFloat(e.toFixed(i))}return Math.round(e/t)*t}var T=function(){function e(t,i){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),b(t)?this.element=t:p(t)&&(this.element=document.querySelector(t)),b(this.element)&&v(this.element.rangeTouch)&&(this.config=n({},a,{},i),this.init())}return function(e,i,s){i&&t(e.prototype,i),s&&t(e,s)}(e,[{key:"init",value:function(){e.enabled&&(this.config.addCSS&&(this.element.style.userSelect="none",this.element.style.webKitUserSelect="none",this.element.style.touchAction="manipulation"),this.listeners(!0),this.element.rangeTouch=this)}},{key:"destroy",value:function(){e.enabled&&(this.config.addCSS&&(this.element.style.userSelect="",this.element.style.webKitUserSelect="",this.element.style.touchAction=""),this.listeners(!1),this.element.rangeTouch=null)}},{key:"listeners",value:function(e){var t=this,i=e?"addEventListener":"removeEventListener";["touchstart","touchmove","touchend"].forEach((function(e){t.element[i](e,(function(e){return t.set(e)}),!1)}))}},{key:"get",value:function(t){if(!e.enabled||!y(t))return null;var i,s=t.target,n=t.changedTouches[0],a=parseFloat(s.getAttribute("min"))||0,l=parseFloat(s.getAttribute("max"))||100,o=parseFloat(s.getAttribute("step"))||1,r=s.getBoundingClientRect(),c=100/r.width*(this.config.thumbWidth/2)/100;return 0>(i=100/r.width*(n.clientX-r.left))?i=0:100<i&&(i=100),50>i?i-=(100-2*i)*c:50<i&&(i+=2*(i-50)*c),a+w(i/100*(l-a),o)}},{key:"set",value:function(t){e.enabled&&y(t)&&!t.target.disabled&&(t.preventDefault(),t.target.value=this.get(t),function(e,t){if(e&&t){var i=new Event(t,{bubbles:!0});e.dispatchEvent(i)}}(t.target,"touchend"===t.type?"change":"input"))}}],[{key:"setup",value:function(t){var i=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},s=null;if(v(t)||p(t)?s=Array.from(document.querySelectorAll(p(t)?t:'input[type="range"]')):b(t)?s=[t]:f(t)?s=Array.from(t):g(t)&&(s=t.filter(b)),v(s))return null;var o=n({},a,{},i);if(p(t)&&o.watch){var r=new MutationObserver((function(i){Array.from(i).forEach((function(i){Array.from(i.addedNodes).forEach((function(i){b(i)&&l(i,t)&&new e(i,o)}))}))}));r.observe(document.body,{childList:!0,subtree:!0})}return s.map((function(t){return new e(t,i)}))}},{key:"enabled",get:function(){return"ontouchstart"in document.documentElement}}]),e}();const k=e=>null!=e?e.constructor:null,C=(e,t)=>Boolean(e&&t&&e instanceof t),A=e=>null==e,S=e=>k(e)===Object,E=e=>k(e)===String,P=e=>k(e)===Function,N=e=>Array.isArray(e),x=e=>C(e,NodeList),M=e=>A(e)||(E(e)||N(e)||x(e))&&!e.length||S(e)&&!Object.keys(e).length;var I=A,L=S,$=e=>k(e)===Number&&!Number.isNaN(e),_=E,O=e=>k(e)===Boolean,q=P,j=N,D=x,H=e=>null!==e&&"object"==typeof e&&1===e.nodeType&&"object"==typeof e.style&&"object"==typeof e.ownerDocument,F=e=>C(e,Event),R=e=>C(e,KeyboardEvent),V=e=>C(e,TextTrack)||!A(e)&&E(e.kind),B=e=>C(e,Promise)&&P(e.then),U=e=>{if(C(e,window.URL))return!0;if(!E(e))return!1;let t=e;e.startsWith("http://")&&e.startsWith("https://")||(t=`http://${e}`);try{return!M(new URL(t).hostname)}catch(e){return!1}},W=M;const z=(()=>{const e=document.createElement("span"),t={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"},i=Object.keys(t).find((t=>void 0!==e.style[t]));return!!_(i)&&t[i]})();function K(e,t){setTimeout((()=>{try{e.hidden=!0,e.offsetHeight,e.hidden=!1}catch(e){}}),t)}const Y={isIE:
2
  /* @cc_on!@ */
3
+ !!document.documentMode,isEdge:window.navigator.userAgent.includes("Edge"),isWebkit:"WebkitAppearance"in document.documentElement.style&&!/Edge/.test(navigator.userAgent),isIPhone:/(iPhone|iPod)/gi.test(navigator.platform),isIos:/(iPad|iPhone|iPod)/gi.test(navigator.platform)};function Q(e,t){return t.split(".").reduce(((e,t)=>e&&e[t]),e)}function X(e={},...t){if(!t.length)return e;const i=t.shift();return L(i)?(Object.keys(i).forEach((t=>{L(i[t])?(Object.keys(e).includes(t)||Object.assign(e,{[t]:{}}),X(e[t],i[t])):Object.assign(e,{[t]:i[t]})})),X(e,...t)):e}function J(e,t){const i=e.length?e:[e];Array.from(i).reverse().forEach(((e,i)=>{const s=i>0?t.cloneNode(!0):t,n=e.parentNode,a=e.nextSibling;s.appendChild(e),a?n.insertBefore(s,a):n.appendChild(s)}))}function G(e,t){H(e)&&!W(t)&&Object.entries(t).filter((([,e])=>!I(e))).forEach((([t,i])=>e.setAttribute(t,i)))}function Z(e,t,i){const s=document.createElement(e);return L(t)&&G(s,t),_(i)&&(s.innerText=i),s}function ee(e,t,i,s){H(t)&&t.appendChild(Z(e,i,s))}function te(e){D(e)||j(e)?Array.from(e).forEach(te):H(e)&&H(e.parentNode)&&e.parentNode.removeChild(e)}function ie(e){if(!H(e))return;let{length:t}=e.childNodes;for(;t>0;)e.removeChild(e.lastChild),t-=1}function se(e,t){return H(t)&&H(t.parentNode)&&H(e)?(t.parentNode.replaceChild(e,t),e):null}function ne(e,t){if(!_(e)||W(e))return{};const i={},s=X({},t);return e.split(",").forEach((e=>{const t=e.trim(),n=t.replace(".",""),a=t.replace(/[[\]]/g,"").split("="),[l]=a,o=a.length>1?a[1].replace(/["']/g,""):"";switch(t.charAt(0)){case".":_(s.class)?i.class=`${s.class} ${n}`:i.class=n;break;case"#":i.id=t.replace("#","");break;case"[":i[l]=o}})),X(s,i)}function ae(e,t){if(!H(e))return;let i=t;O(i)||(i=!e.hidden),e.hidden=i}function le(e,t,i){if(D(e))return Array.from(e).map((e=>le(e,t,i)));if(H(e)){let s="toggle";return void 0!==i&&(s=i?"add":"remove"),e.classList[s](t),e.classList.contains(t)}return!1}function oe(e,t){return H(e)&&e.classList.contains(t)}function re(e,t){const{prototype:i}=Element;return(i.matches||i.webkitMatchesSelector||i.mozMatchesSelector||i.msMatchesSelector||function(){return Array.from(document.querySelectorAll(t)).includes(this)}).call(e,t)}function ce(e){return this.elements.container.querySelectorAll(e)}function he(e){return this.elements.container.querySelector(e)}function ue(e=null,t=!1){H(e)&&(e.focus({preventScroll:!0}),t&&le(e,this.config.classNames.tabFocus))}const de={"audio/ogg":"vorbis","audio/wav":"1","video/webm":"vp8, vorbis","video/mp4":"avc1.42E01E, mp4a.40.2","video/ogg":"theora"},me={audio:"canPlayType"in document.createElement("audio"),video:"canPlayType"in document.createElement("video"),check(e,t,i){const s=Y.isIPhone&&i&&me.playsinline,n=me[e]||"html5"!==t;return{api:n,ui:n&&me.rangeInput&&("video"!==e||!Y.isIPhone||s)}},pip:!(Y.isIPhone||!q(Z("video").webkitSetPresentationMode)&&(!document.pictureInPictureEnabled||Z("video").disablePictureInPicture)),airplay:q(window.WebKitPlaybackTargetAvailabilityEvent),playsinline:"playsInline"in document.createElement("video"),mime(e){if(W(e))return!1;const[t]=e.split("/");let i=e;if(!this.isHTML5||t!==this.type)return!1;Object.keys(de).includes(i)&&(i+=`; codecs="${de[e]}"`);try{return Boolean(i&&this.media.canPlayType(i).replace(/no/,""))}catch(e){return!1}},textTracks:"textTracks"in document.createElement("video"),rangeInput:(()=>{const e=document.createElement("input");return e.type="range","range"===e.type})(),touch:"ontouchstart"in document.documentElement,transitions:!1!==z,reducedMotion:"matchMedia"in window&&window.matchMedia("(prefers-reduced-motion)").matches},pe=(()=>{let e=!1;try{const t=Object.defineProperty({},"passive",{get:()=>(e=!0,null)});window.addEventListener("test",null,t),window.removeEventListener("test",null,t)}catch(e){}return e})();function ge(e,t,i,s=!1,n=!0,a=!1){if(!e||!("addEventListener"in e)||W(t)||!q(i))return;const l=t.split(" ");let o=a;pe&&(o={passive:n,capture:a}),l.forEach((t=>{this&&this.eventListeners&&s&&this.eventListeners.push({element:e,type:t,callback:i,options:o}),e[s?"addEventListener":"removeEventListener"](t,i,o)}))}function fe(e,t="",i,s=!0,n=!1){ge.call(this,e,t,i,!0,s,n)}function be(e,t="",i,s=!0,n=!1){ge.call(this,e,t,i,!1,s,n)}function ye(e,t="",i,s=!0,n=!1){const a=(...l)=>{be(e,t,a,s,n),i.apply(this,l)};ge.call(this,e,t,a,!0,s,n)}function ve(e,t="",i=!1,s={}){if(!H(e)||W(t))return;const n=new CustomEvent(t,{bubbles:i,detail:{...s,plyr:this}});e.dispatchEvent(n)}function we(){this&&this.eventListeners&&(this.eventListeners.forEach((e=>{const{element:t,type:i,callback:s,options:n}=e;t.removeEventListener(i,s,n)})),this.eventListeners=[])}function Te(){return new Promise((e=>this.ready?setTimeout(e,0):fe.call(this,this.elements.container,"ready",e))).then((()=>{}))}function ke(e){B(e)&&e.then(null,(()=>{}))}function Ce(e){if(!(j(e)||_(e)&&e.includes(":")))return!1;return(j(e)?e:e.split(":")).map(Number).every($)}function Ae(e){if(!j(e)||!e.every($))return null;const[t,i]=e,s=(e,t)=>0===t?e:s(t,e%t),n=s(t,i);return[t/n,i/n]}function Se(e){const t=e=>Ce(e)?e.split(":").map(Number):null;let i=t(e);if(null===i&&(i=t(this.config.ratio)),null===i&&!W(this.embed)&&j(this.embed.ratio)&&({ratio:i}=this.embed),null===i&&this.isHTML5){const{videoWidth:e,videoHeight:t}=this.media;i=Ae([e,t])}return i}function Ee(e){if(!this.isVideo)return{};const{wrapper:t}=this.elements,i=Se.call(this,e),[s,n]=j(i)?i:[0,0],a=100/s*n;if(t.style.paddingBottom=`${a}%`,this.isVimeo&&!this.config.vimeo.premium&&this.supported.ui){const e=100/this.media.offsetWidth*parseInt(window.getComputedStyle(this.media).paddingBottom,10),i=(e-a)/(e/50);this.fullscreen.active?t.style.paddingBottom=null:this.media.style.transform=`translateY(-${i}%)`}else this.isHTML5&&t.classList.toggle(this.config.classNames.videoFixedRatio,null!==i);return{padding:a,ratio:i}}const Pe={getSources(){if(!this.isHTML5)return[];return Array.from(this.media.querySelectorAll("source")).filter((e=>{const t=e.getAttribute("type");return!!W(t)||me.mime.call(this,t)}))},getQualityOptions(){return this.config.quality.forced?this.config.quality.options:Pe.getSources.call(this).map((e=>Number(e.getAttribute("size")))).filter(Boolean)},setup(){if(!this.isHTML5)return;const e=this;e.options.speed=e.config.speed.options,W(this.config.ratio)||Ee.call(e),Object.defineProperty(e.media,"quality",{get(){const t=Pe.getSources.call(e).find((t=>t.getAttribute("src")===e.source));return t&&Number(t.getAttribute("size"))},set(t){if(e.quality!==t){if(e.config.quality.forced&&q(e.config.quality.onChange))e.config.quality.onChange(t);else{const i=Pe.getSources.call(e).find((e=>Number(e.getAttribute("size"))===t));if(!i)return;const{currentTime:s,paused:n,preload:a,readyState:l,playbackRate:o}=e.media;e.media.src=i.getAttribute("src"),("none"!==a||l)&&(e.once("loadedmetadata",(()=>{e.speed=o,e.currentTime=s,n||ke(e.play())})),e.media.load())}ve.call(e,e.media,"qualitychange",!1,{quality:t})}}})},cancelRequests(){this.isHTML5&&(te(Pe.getSources.call(this)),this.media.setAttribute("src",this.config.blankVideo),this.media.load(),this.debug.log("Cancelled network requests"))}};function Ne(e){return j(e)?e.filter(((t,i)=>e.indexOf(t)===i)):e}function xe(e,...t){return W(e)?e:e.toString().replace(/{(\d+)}/g,((e,i)=>t[i].toString()))}const Me=(e="",t="",i="")=>e.replace(new RegExp(t.toString().replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1"),"g"),i.toString()),Ie=(e="")=>e.toString().replace(/\w\S*/g,(e=>e.charAt(0).toUpperCase()+e.substr(1).toLowerCase()));function Le(e=""){let t=e.toString();return t=function(e=""){let t=e.toString();return t=Me(t,"-"," "),t=Me(t,"_"," "),t=Ie(t),Me(t," ","")}(t),t.charAt(0).toLowerCase()+t.slice(1)}function $e(e){const t=document.createElement("div");return t.appendChild(e),t.innerHTML}const _e={pip:"PIP",airplay:"AirPlay",html5:"HTML5",vimeo:"Vimeo",youtube:"YouTube"},Oe={get(e="",t={}){if(W(e)||W(t))return"";let i=Q(t.i18n,e);if(W(i))return Object.keys(_e).includes(e)?_e[e]:"";const s={"{seektime}":t.seekTime,"{title}":t.title};return Object.entries(s).forEach((([e,t])=>{i=Me(i,e,t)})),i}};class qe{constructor(t){e(this,"get",(e=>{if(!qe.supported||!this.enabled)return null;const t=window.localStorage.getItem(this.key);if(W(t))return null;const i=JSON.parse(t);return _(e)&&e.length?i[e]:i})),e(this,"set",(e=>{if(!qe.supported||!this.enabled)return;if(!L(e))return;let t=this.get();W(t)&&(t={}),X(t,e),window.localStorage.setItem(this.key,JSON.stringify(t))})),this.enabled=t.config.storage.enabled,this.key=t.config.storage.key}static get supported(){try{if(!("localStorage"in window))return!1;const e="___test";return window.localStorage.setItem(e,e),window.localStorage.removeItem(e),!0}catch(e){return!1}}}function je(e,t="text"){return new Promise(((i,s)=>{try{const s=new XMLHttpRequest;if(!("withCredentials"in s))return;s.addEventListener("load",(()=>{if("text"===t)try{i(JSON.parse(s.responseText))}catch(e){i(s.responseText)}else i(s.response)})),s.addEventListener("error",(()=>{throw new Error(s.status)})),s.open("GET",e,!0),s.responseType=t,s.send()}catch(e){s(e)}}))}function De(e,t){if(!_(e))return;const i=_(t);let s=!1;const n=()=>null!==document.getElementById(t),a=(e,t)=>{e.innerHTML=t,i&&n()||document.body.insertAdjacentElement("afterbegin",e)};if(!i||!n()){const n=qe.supported,l=document.createElement("div");if(l.setAttribute("hidden",""),i&&l.setAttribute("id",t),n){const e=window.localStorage.getItem(`cache-${t}`);if(s=null!==e,s){const t=JSON.parse(e);a(l,t.content)}}je(e).then((e=>{W(e)||(n&&window.localStorage.setItem(`cache-${t}`,JSON.stringify({content:e})),a(l,e))})).catch((()=>{}))}}const He=e=>Math.trunc(e/60/60%60,10);function Fe(e=0,t=!1,i=!1){if(!$(e))return Fe(void 0,t,i);const s=e=>`0${e}`.slice(-2);let n=He(e);const a=(l=e,Math.trunc(l/60%60,10));var l;const o=(e=>Math.trunc(e%60,10))(e);return n=t||n>0?`${n}:`:"",`${i&&e>0?"-":""}${n}${s(a)}:${s(o)}`}const Re={getIconUrl(){const e=new URL(this.config.iconUrl,window.location).host!==window.location.host||Y.isIE&&!window.svg4everybody;return{url:this.config.iconUrl,cors:e}},findElements(){try{return this.elements.controls=he.call(this,this.config.selectors.controls.wrapper),this.elements.buttons={play:ce.call(this,this.config.selectors.buttons.play),pause:he.call(this,this.config.selectors.buttons.pause),restart:he.call(this,this.config.selectors.buttons.restart),rewind:he.call(this,this.config.selectors.buttons.rewind),fastForward:he.call(this,this.config.selectors.buttons.fastForward),mute:he.call(this,this.config.selectors.buttons.mute),pip:he.call(this,this.config.selectors.buttons.pip),airplay:he.call(this,this.config.selectors.buttons.airplay),settings:he.call(this,this.config.selectors.buttons.settings),captions:he.call(this,this.config.selectors.buttons.captions),fullscreen:he.call(this,this.config.selectors.buttons.fullscreen)},this.elements.progress=he.call(this,this.config.selectors.progress),this.elements.inputs={seek:he.call(this,this.config.selectors.inputs.seek),volume:he.call(this,this.config.selectors.inputs.volume)},this.elements.display={buffer:he.call(this,this.config.selectors.display.buffer),currentTime:he.call(this,this.config.selectors.display.currentTime),duration:he.call(this,this.config.selectors.display.duration)},H(this.elements.progress)&&(this.elements.display.seekTooltip=this.elements.progress.querySelector(`.${this.config.classNames.tooltip}`)),!0}catch(e){return this.debug.warn("It looks like there is a problem with your custom controls HTML",e),this.toggleNativeControls(!0),!1}},createIcon(e,t){const i="http://www.w3.org/2000/svg",s=Re.getIconUrl.call(this),n=`${s.cors?"":s.url}#${this.config.iconPrefix}`,a=document.createElementNS(i,"svg");G(a,X(t,{"aria-hidden":"true",focusable:"false"}));const l=document.createElementNS(i,"use"),o=`${n}-${e}`;return"href"in l&&l.setAttributeNS("http://www.w3.org/1999/xlink","href",o),l.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",o),a.appendChild(l),a},createLabel(e,t={}){const i=Oe.get(e,this.config);return Z("span",{...t,class:[t.class,this.config.classNames.hidden].filter(Boolean).join(" ")},i)},createBadge(e){if(W(e))return null;const t=Z("span",{class:this.config.classNames.menu.value});return t.appendChild(Z("span",{class:this.config.classNames.menu.badge},e)),t},createButton(e,t){const i=X({},t);let s=Le(e);const n={element:"button",toggle:!1,label:null,icon:null,labelPressed:null,iconPressed:null};switch(["element","icon","label"].forEach((e=>{Object.keys(i).includes(e)&&(n[e]=i[e],delete i[e])})),"button"!==n.element||Object.keys(i).includes("type")||(i.type="button"),Object.keys(i).includes("class")?i.class.split(" ").some((e=>e===this.config.classNames.control))||X(i,{class:`${i.class} ${this.config.classNames.control}`}):i.class=this.config.classNames.control,e){case"play":n.toggle=!0,n.label="play",n.labelPressed="pause",n.icon="play",n.iconPressed="pause";break;case"mute":n.toggle=!0,n.label="mute",n.labelPressed="unmute",n.icon="volume",n.iconPressed="muted";break;case"captions":n.toggle=!0,n.label="enableCaptions",n.labelPressed="disableCaptions",n.icon="captions-off",n.iconPressed="captions-on";break;case"fullscreen":n.toggle=!0,n.label="enterFullscreen",n.labelPressed="exitFullscreen",n.icon="enter-fullscreen",n.iconPressed="exit-fullscreen";break;case"play-large":i.class+=` ${this.config.classNames.control}--overlaid`,s="play",n.label="play",n.icon="play";break;default:W(n.label)&&(n.label=s),W(n.icon)&&(n.icon=e)}const a=Z(n.element);return n.toggle?(a.appendChild(Re.createIcon.call(this,n.iconPressed,{class:"icon--pressed"})),a.appendChild(Re.createIcon.call(this,n.icon,{class:"icon--not-pressed"})),a.appendChild(Re.createLabel.call(this,n.labelPressed,{class:"label--pressed"})),a.appendChild(Re.createLabel.call(this,n.label,{class:"label--not-pressed"}))):(a.appendChild(Re.createIcon.call(this,n.icon)),a.appendChild(Re.createLabel.call(this,n.label))),X(i,ne(this.config.selectors.buttons[s],i)),G(a,i),"play"===s?(j(this.elements.buttons[s])||(this.elements.buttons[s]=[]),this.elements.buttons[s].push(a)):this.elements.buttons[s]=a,a},createRange(e,t){const i=Z("input",X(ne(this.config.selectors.inputs[e]),{type:"range",min:0,max:100,step:.01,value:0,autocomplete:"off",role:"slider","aria-label":Oe.get(e,this.config),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":0},t));return this.elements.inputs[e]=i,Re.updateRangeFill.call(this,i),T.setup(i),i},createProgress(e,t){const i=Z("progress",X(ne(this.config.selectors.display[e]),{min:0,max:100,value:0,role:"progressbar","aria-hidden":!0},t));if("volume"!==e){i.appendChild(Z("span",null,"0"));const t={played:"played",buffer:"buffered"}[e],s=t?Oe.get(t,this.config):"";i.innerText=`% ${s.toLowerCase()}`}return this.elements.display[e]=i,i},createTime(e,t){const i=ne(this.config.selectors.display[e],t),s=Z("div",X(i,{class:`${i.class?i.class:""} ${this.config.classNames.display.time} `.trim(),"aria-label":Oe.get(e,this.config)}),"00:00");return this.elements.display[e]=s,s},bindMenuItemShortcuts(e,t){fe.call(this,e,"keydown keyup",(i=>{if(![32,38,39,40].includes(i.which))return;if(i.preventDefault(),i.stopPropagation(),"keydown"===i.type)return;const s=re(e,'[role="menuitemradio"]');if(!s&&[32,39].includes(i.which))Re.showMenuPanel.call(this,t,!0);else{let t;32!==i.which&&(40===i.which||s&&39===i.which?(t=e.nextElementSibling,H(t)||(t=e.parentNode.firstElementChild)):(t=e.previousElementSibling,H(t)||(t=e.parentNode.lastElementChild)),ue.call(this,t,!0))}}),!1),fe.call(this,e,"keyup",(e=>{13===e.which&&Re.focusFirstMenuItem.call(this,null,!0)}))},createMenuItem({value:e,list:t,type:i,title:s,badge:n=null,checked:a=!1}){const l=ne(this.config.selectors.inputs[i]),o=Z("button",X(l,{type:"button",role:"menuitemradio",class:`${this.config.classNames.control} ${l.class?l.class:""}`.trim(),"aria-checked":a,value:e})),r=Z("span");r.innerHTML=s,H(n)&&r.appendChild(n),o.appendChild(r),Object.defineProperty(o,"checked",{enumerable:!0,get:()=>"true"===o.getAttribute("aria-checked"),set(e){e&&Array.from(o.parentNode.children).filter((e=>re(e,'[role="menuitemradio"]'))).forEach((e=>e.setAttribute("aria-checked","false"))),o.setAttribute("aria-checked",e?"true":"false")}}),this.listeners.bind(o,"click keyup",(t=>{if(!R(t)||32===t.which){switch(t.preventDefault(),t.stopPropagation(),o.checked=!0,i){case"language":this.currentTrack=Number(e);break;case"quality":this.quality=e;break;case"speed":this.speed=parseFloat(e)}Re.showMenuPanel.call(this,"home",R(t))}}),i,!1),Re.bindMenuItemShortcuts.call(this,o,i),t.appendChild(o)},formatTime(e=0,t=!1){if(!$(e))return e;return Fe(e,He(this.duration)>0,t)},updateTimeDisplay(e=null,t=0,i=!1){H(e)&&$(t)&&(e.innerText=Re.formatTime(t,i))},updateVolume(){this.supported.ui&&(H(this.elements.inputs.volume)&&Re.setRange.call(this,this.elements.inputs.volume,this.muted?0:this.volume),H(this.elements.buttons.mute)&&(this.elements.buttons.mute.pressed=this.muted||0===this.volume))},setRange(e,t=0){H(e)&&(e.value=t,Re.updateRangeFill.call(this,e))},updateProgress(e){if(!this.supported.ui||!F(e))return;let t=0;const i=(e,t)=>{const i=$(t)?t:0,s=H(e)?e:this.elements.display.buffer;if(H(s)){s.value=i;const e=s.getElementsByTagName("span")[0];H(e)&&(e.childNodes[0].nodeValue=i)}};if(e)switch(e.type){case"timeupdate":case"seeking":case"seeked":s=this.currentTime,n=this.duration,t=0===s||0===n||Number.isNaN(s)||Number.isNaN(n)?0:(s/n*100).toFixed(2),"timeupdate"===e.type&&Re.setRange.call(this,this.elements.inputs.seek,t);break;case"playing":case"progress":i(this.elements.display.buffer,100*this.buffered)}var s,n},updateRangeFill(e){const t=F(e)?e.target:e;if(H(t)&&"range"===t.getAttribute("type")){if(re(t,this.config.selectors.inputs.seek)){t.setAttribute("aria-valuenow",this.currentTime);const e=Re.formatTime(this.currentTime),i=Re.formatTime(this.duration),s=Oe.get("seekLabel",this.config);t.setAttribute("aria-valuetext",s.replace("{currentTime}",e).replace("{duration}",i))}else if(re(t,this.config.selectors.inputs.volume)){const e=100*t.value;t.setAttribute("aria-valuenow",e),t.setAttribute("aria-valuetext",`${e.toFixed(1)}%`)}else t.setAttribute("aria-valuenow",t.value);Y.isWebkit&&t.style.setProperty("--value",t.value/t.max*100+"%")}},updateSeekTooltip(e){if(!this.config.tooltips.seek||!H(this.elements.inputs.seek)||!H(this.elements.display.seekTooltip)||0===this.duration)return;const t=`${this.config.classNames.tooltip}--visible`,i=e=>le(this.elements.display.seekTooltip,t,e);if(this.touch)return void i(!1);let s=0;const n=this.elements.progress.getBoundingClientRect();if(F(e))s=100/n.width*(e.pageX-n.left);else{if(!oe(this.elements.display.seekTooltip,t))return;s=parseFloat(this.elements.display.seekTooltip.style.left,10)}s<0?s=0:s>100&&(s=100),Re.updateTimeDisplay.call(this,this.elements.display.seekTooltip,this.duration/100*s),this.elements.display.seekTooltip.style.left=`${s}%`,F(e)&&["mouseenter","mouseleave"].includes(e.type)&&i("mouseenter"===e.type)},timeUpdate(e){const t=!H(this.elements.display.duration)&&this.config.invertTime;Re.updateTimeDisplay.call(this,this.elements.display.currentTime,t?this.duration-this.currentTime:this.currentTime,t),e&&"timeupdate"===e.type&&this.media.seeking||Re.updateProgress.call(this,e)},durationUpdate(){if(!this.supported.ui||!this.config.invertTime&&this.currentTime)return;if(this.duration>=2**32)return ae(this.elements.display.currentTime,!0),void ae(this.elements.progress,!0);H(this.elements.inputs.seek)&&this.elements.inputs.seek.setAttribute("aria-valuemax",this.duration);const e=H(this.elements.display.duration);!e&&this.config.displayDuration&&this.paused&&Re.updateTimeDisplay.call(this,this.elements.display.currentTime,this.duration),e&&Re.updateTimeDisplay.call(this,this.elements.display.duration,this.duration),Re.updateSeekTooltip.call(this)},toggleMenuButton(e,t){ae(this.elements.settings.buttons[e],!t)},updateSetting(e,t,i){const s=this.elements.settings.panels[e];let n=null,a=t;if("captions"===e)n=this.currentTrack;else{if(n=W(i)?this[e]:i,W(n)&&(n=this.config[e].default),!W(this.options[e])&&!this.options[e].includes(n))return void this.debug.warn(`Unsupported value of '${n}' for ${e}`);if(!this.config[e].options.includes(n))return void this.debug.warn(`Disabled value of '${n}' for ${e}`)}if(H(a)||(a=s&&s.querySelector('[role="menu"]')),!H(a))return;this.elements.settings.buttons[e].querySelector(`.${this.config.classNames.menu.value}`).innerHTML=Re.getLabel.call(this,e,n);const l=a&&a.querySelector(`[value="${n}"]`);H(l)&&(l.checked=!0)},getLabel(e,t){switch(e){case"speed":return 1===t?Oe.get("normal",this.config):`${t}&times;`;case"quality":if($(t)){const e=Oe.get(`qualityLabel.${t}`,this.config);return e.length?e:`${t}p`}return Ie(t);case"captions":return Ue.getLabel.call(this);default:return null}},setQualityMenu(e){if(!H(this.elements.settings.panels.quality))return;const t="quality",i=this.elements.settings.panels.quality.querySelector('[role="menu"]');j(e)&&(this.options.quality=Ne(e).filter((e=>this.config.quality.options.includes(e))));const s=!W(this.options.quality)&&this.options.quality.length>1;if(Re.toggleMenuButton.call(this,t,s),ie(i),Re.checkMenu.call(this),!s)return;const n=e=>{const t=Oe.get(`qualityBadge.${e}`,this.config);return t.length?Re.createBadge.call(this,t):null};this.options.quality.sort(((e,t)=>{const i=this.config.quality.options;return i.indexOf(e)>i.indexOf(t)?1:-1})).forEach((e=>{Re.createMenuItem.call(this,{value:e,list:i,type:t,title:Re.getLabel.call(this,"quality",e),badge:n(e)})})),Re.updateSetting.call(this,t,i)},setCaptionsMenu(){if(!H(this.elements.settings.panels.captions))return;const e="captions",t=this.elements.settings.panels.captions.querySelector('[role="menu"]'),i=Ue.getTracks.call(this),s=Boolean(i.length);if(Re.toggleMenuButton.call(this,e,s),ie(t),Re.checkMenu.call(this),!s)return;const n=i.map(((e,i)=>({value:i,checked:this.captions.toggled&&this.currentTrack===i,title:Ue.getLabel.call(this,e),badge:e.language&&Re.createBadge.call(this,e.language.toUpperCase()),list:t,type:"language"})));n.unshift({value:-1,checked:!this.captions.toggled,title:Oe.get("disabled",this.config),list:t,type:"language"}),n.forEach(Re.createMenuItem.bind(this)),Re.updateSetting.call(this,e,t)},setSpeedMenu(){if(!H(this.elements.settings.panels.speed))return;const e="speed",t=this.elements.settings.panels.speed.querySelector('[role="menu"]');this.options.speed=this.options.speed.filter((e=>e>=this.minimumSpeed&&e<=this.maximumSpeed));const i=!W(this.options.speed)&&this.options.speed.length>1;Re.toggleMenuButton.call(this,e,i),ie(t),Re.checkMenu.call(this),i&&(this.options.speed.forEach((i=>{Re.createMenuItem.call(this,{value:i,list:t,type:e,title:Re.getLabel.call(this,"speed",i)})})),Re.updateSetting.call(this,e,t))},checkMenu(){const{buttons:e}=this.elements.settings,t=!W(e)&&Object.values(e).some((e=>!e.hidden));ae(this.elements.settings.menu,!t)},focusFirstMenuItem(e,t=!1){if(this.elements.settings.popup.hidden)return;let i=e;H(i)||(i=Object.values(this.elements.settings.panels).find((e=>!e.hidden)));const s=i.querySelector('[role^="menuitem"]');ue.call(this,s,t)},toggleMenu(e){const{popup:t}=this.elements.settings,i=this.elements.buttons.settings;if(!H(t)||!H(i))return;const{hidden:s}=t;let n=s;if(O(e))n=e;else if(R(e)&&27===e.which)n=!1;else if(F(e)){const s=q(e.composedPath)?e.composedPath()[0]:e.target,a=t.contains(s);if(a||!a&&e.target!==i&&n)return}i.setAttribute("aria-expanded",n),ae(t,!n),le(this.elements.container,this.config.classNames.menu.open,n),n&&R(e)?Re.focusFirstMenuItem.call(this,null,!0):n||s||ue.call(this,i,R(e))},getMenuSize(e){const t=e.cloneNode(!0);t.style.position="absolute",t.style.opacity=0,t.removeAttribute("hidden"),e.parentNode.appendChild(t);const i=t.scrollWidth,s=t.scrollHeight;return te(t),{width:i,height:s}},showMenuPanel(e="",t=!1){const i=this.elements.container.querySelector(`#plyr-settings-${this.id}-${e}`);if(!H(i))return;const s=i.parentNode,n=Array.from(s.children).find((e=>!e.hidden));if(me.transitions&&!me.reducedMotion){s.style.width=`${n.scrollWidth}px`,s.style.height=`${n.scrollHeight}px`;const e=Re.getMenuSize.call(this,i),t=e=>{e.target===s&&["width","height"].includes(e.propertyName)&&(s.style.width="",s.style.height="",be.call(this,s,z,t))};fe.call(this,s,z,t),s.style.width=`${e.width}px`,s.style.height=`${e.height}px`}ae(n,!0),ae(i,!1),Re.focusFirstMenuItem.call(this,i,t)},setDownloadUrl(){const e=this.elements.buttons.download;H(e)&&e.setAttribute("href",this.download)},create(e){const{bindMenuItemShortcuts:t,createButton:i,createProgress:s,createRange:n,createTime:a,setQualityMenu:l,setSpeedMenu:o,showMenuPanel:r}=Re;this.elements.controls=null,j(this.config.controls)&&this.config.controls.includes("play-large")&&this.elements.container.appendChild(i.call(this,"play-large"));const c=Z("div",ne(this.config.selectors.controls.wrapper));this.elements.controls=c;const h={class:"plyr__controls__item"};return Ne(j(this.config.controls)?this.config.controls:[]).forEach((l=>{if("restart"===l&&c.appendChild(i.call(this,"restart",h)),"rewind"===l&&c.appendChild(i.call(this,"rewind",h)),"play"===l&&c.appendChild(i.call(this,"play",h)),"fast-forward"===l&&c.appendChild(i.call(this,"fast-forward",h)),"progress"===l){const t=Z("div",{class:`${h.class} plyr__progress__container`}),i=Z("div",ne(this.config.selectors.progress));if(i.appendChild(n.call(this,"seek",{id:`plyr-seek-${e.id}`})),i.appendChild(s.call(this,"buffer")),this.config.tooltips.seek){const e=Z("span",{class:this.config.classNames.tooltip},"00:00");i.appendChild(e),this.elements.display.seekTooltip=e}this.elements.progress=i,t.appendChild(this.elements.progress),c.appendChild(t)}if("current-time"===l&&c.appendChild(a.call(this,"currentTime",h)),"duration"===l&&c.appendChild(a.call(this,"duration",h)),"mute"===l||"volume"===l){let{volume:t}=this.elements;if(H(t)&&c.contains(t)||(t=Z("div",X({},h,{class:`${h.class} plyr__volume`.trim()})),this.elements.volume=t,c.appendChild(t)),"mute"===l&&t.appendChild(i.call(this,"mute")),"volume"===l&&!Y.isIos){const i={max:1,step:.05,value:this.config.volume};t.appendChild(n.call(this,"volume",X(i,{id:`plyr-volume-${e.id}`})))}}if("captions"===l&&c.appendChild(i.call(this,"captions",h)),"settings"===l&&!W(this.config.settings)){const s=Z("div",X({},h,{class:`${h.class} plyr__menu`.trim(),hidden:""}));s.appendChild(i.call(this,"settings",{"aria-haspopup":!0,"aria-controls":`plyr-settings-${e.id}`,"aria-expanded":!1}));const n=Z("div",{class:"plyr__menu__container",id:`plyr-settings-${e.id}`,hidden:""}),a=Z("div"),l=Z("div",{id:`plyr-settings-${e.id}-home`}),o=Z("div",{role:"menu"});l.appendChild(o),a.appendChild(l),this.elements.settings.panels.home=l,this.config.settings.forEach((i=>{const s=Z("button",X(ne(this.config.selectors.buttons.settings),{type:"button",class:`${this.config.classNames.control} ${this.config.classNames.control}--forward`,role:"menuitem","aria-haspopup":!0,hidden:""}));t.call(this,s,i),fe.call(this,s,"click",(()=>{r.call(this,i,!1)}));const n=Z("span",null,Oe.get(i,this.config)),l=Z("span",{class:this.config.classNames.menu.value});l.innerHTML=e[i],n.appendChild(l),s.appendChild(n),o.appendChild(s);const c=Z("div",{id:`plyr-settings-${e.id}-${i}`,hidden:""}),h=Z("button",{type:"button",class:`${this.config.classNames.control} ${this.config.classNames.control}--back`});h.appendChild(Z("span",{"aria-hidden":!0},Oe.get(i,this.config))),h.appendChild(Z("span",{class:this.config.classNames.hidden},Oe.get("menuBack",this.config))),fe.call(this,c,"keydown",(e=>{37===e.which&&(e.preventDefault(),e.stopPropagation(),r.call(this,"home",!0))}),!1),fe.call(this,h,"click",(()=>{r.call(this,"home",!1)})),c.appendChild(h),c.appendChild(Z("div",{role:"menu"})),a.appendChild(c),this.elements.settings.buttons[i]=s,this.elements.settings.panels[i]=c})),n.appendChild(a),s.appendChild(n),c.appendChild(s),this.elements.settings.popup=n,this.elements.settings.menu=s}if("pip"===l&&me.pip&&c.appendChild(i.call(this,"pip",h)),"airplay"===l&&me.airplay&&c.appendChild(i.call(this,"airplay",h)),"download"===l){const e=X({},h,{element:"a",href:this.download,target:"_blank"});this.isHTML5&&(e.download="");const{download:t}=this.config.urls;!U(t)&&this.isEmbed&&X(e,{icon:`logo-${this.provider}`,label:this.provider}),c.appendChild(i.call(this,"download",e))}"fullscreen"===l&&c.appendChild(i.call(this,"fullscreen",h))})),this.isHTML5&&l.call(this,Pe.getQualityOptions.call(this)),o.call(this),c},inject(){if(this.config.loadSprite){const e=Re.getIconUrl.call(this);e.cors&&De(e.url,"sprite-plyr")}this.id=Math.floor(1e4*Math.random());let e=null;this.elements.controls=null;const t={id:this.id,seektime:this.config.seekTime,title:this.config.title};let i=!0;q(this.config.controls)&&(this.config.controls=this.config.controls.call(this,t)),this.config.controls||(this.config.controls=[]),H(this.config.controls)||_(this.config.controls)?e=this.config.controls:(e=Re.create.call(this,{id:this.id,seektime:this.config.seekTime,speed:this.speed,quality:this.quality,captions:Ue.getLabel.call(this)}),i=!1);let s;i&&_(this.config.controls)&&(e=(e=>{let i=e;return Object.entries(t).forEach((([e,t])=>{i=Me(i,`{${e}}`,t)})),i})(e)),_(this.config.selectors.controls.container)&&(s=document.querySelector(this.config.selectors.controls.container)),H(s)||(s=this.elements.container);if(s[H(e)?"insertAdjacentElement":"insertAdjacentHTML"]("afterbegin",e),H(this.elements.controls)||Re.findElements.call(this),!W(this.elements.buttons)){const e=e=>{const t=this.config.classNames.controlPressed;Object.defineProperty(e,"pressed",{enumerable:!0,get:()=>oe(e,t),set(i=!1){le(e,t,i)}})};Object.values(this.elements.buttons).filter(Boolean).forEach((t=>{j(t)||D(t)?Array.from(t).filter(Boolean).forEach(e):e(t)}))}if(Y.isEdge&&K(s),this.config.tooltips.controls){const{classNames:e,selectors:t}=this.config,i=`${t.controls.wrapper} ${t.labels} .${e.hidden}`,s=ce.call(this,i);Array.from(s).forEach((e=>{le(e,this.config.classNames.hidden,!1),le(e,this.config.classNames.tooltip,!0)}))}}};function Ve(e,t=!0){let i=e;if(t){const e=document.createElement("a");e.href=i,i=e.href}try{return new URL(i)}catch(e){return null}}function Be(e){const t=new URLSearchParams;return L(e)&&Object.entries(e).forEach((([e,i])=>{t.set(e,i)})),t}const Ue={setup(){if(!this.supported.ui)return;if(!this.isVideo||this.isYouTube||this.isHTML5&&!me.textTracks)return void(j(this.config.controls)&&this.config.controls.includes("settings")&&this.config.settings.includes("captions")&&Re.setCaptionsMenu.call(this));var e,t;if(H(this.elements.captions)||(this.elements.captions=Z("div",ne(this.config.selectors.captions)),e=this.elements.captions,t=this.elements.wrapper,H(e)&&H(t)&&t.parentNode.insertBefore(e,t.nextSibling)),Y.isIE&&window.URL){const e=this.media.querySelectorAll("track");Array.from(e).forEach((e=>{const t=e.getAttribute("src"),i=Ve(t);null!==i&&i.hostname!==window.location.href.hostname&&["http:","https:"].includes(i.protocol)&&je(t,"blob").then((t=>{e.setAttribute("src",window.URL.createObjectURL(t))})).catch((()=>{te(e)}))}))}const i=Ne((navigator.languages||[navigator.language||navigator.userLanguage||"en"]).map((e=>e.split("-")[0])));let s=(this.storage.get("language")||this.config.captions.language||"auto").toLowerCase();"auto"===s&&([s]=i);let n=this.storage.get("captions");if(O(n)||({active:n}=this.config.captions),Object.assign(this.captions,{toggled:!1,active:n,language:s,languages:i}),this.isHTML5){const e=this.config.captions.update?"addtrack removetrack":"removetrack";fe.call(this,this.media.textTracks,e,Ue.update.bind(this))}setTimeout(Ue.update.bind(this),0)},update(){const e=Ue.getTracks.call(this,!0),{active:t,language:i,meta:s,currentTrackNode:n}=this.captions,a=Boolean(e.find((e=>e.language===i)));this.isHTML5&&this.isVideo&&e.filter((e=>!s.get(e))).forEach((e=>{this.debug.log("Track added",e),s.set(e,{default:"showing"===e.mode}),"showing"===e.mode&&(e.mode="hidden"),fe.call(this,e,"cuechange",(()=>Ue.updateCues.call(this)))})),(a&&this.language!==i||!e.includes(n))&&(Ue.setLanguage.call(this,i),Ue.toggle.call(this,t&&a)),le(this.elements.container,this.config.classNames.captions.enabled,!W(e)),j(this.config.controls)&&this.config.controls.includes("settings")&&this.config.settings.includes("captions")&&Re.setCaptionsMenu.call(this)},toggle(e,t=!0){if(!this.supported.ui)return;const{toggled:i}=this.captions,s=this.config.classNames.captions.active,n=I(e)?!i:e;if(n!==i){if(t||(this.captions.active=n,this.storage.set({captions:n})),!this.language&&n&&!t){const e=Ue.getTracks.call(this),t=Ue.findTrack.call(this,[this.captions.language,...this.captions.languages],!0);return this.captions.language=t.language,void Ue.set.call(this,e.indexOf(t))}this.elements.buttons.captions&&(this.elements.buttons.captions.pressed=n),le(this.elements.container,s,n),this.captions.toggled=n,Re.updateSetting.call(this,"captions"),ve.call(this,this.media,n?"captionsenabled":"captionsdisabled")}setTimeout((()=>{n&&this.captions.toggled&&(this.captions.currentTrackNode.mode="hidden")}))},set(e,t=!0){const i=Ue.getTracks.call(this);if(-1!==e)if($(e))if(e in i){if(this.captions.currentTrack!==e){this.captions.currentTrack=e;const s=i[e],{language:n}=s||{};this.captions.currentTrackNode=s,Re.updateSetting.call(this,"captions"),t||(this.captions.language=n,this.storage.set({language:n})),this.isVimeo&&this.embed.enableTextTrack(n),ve.call(this,this.media,"languagechange")}Ue.toggle.call(this,!0,t),this.isHTML5&&this.isVideo&&Ue.updateCues.call(this)}else this.debug.warn("Track not found",e);else this.debug.warn("Invalid caption argument",e);else Ue.toggle.call(this,!1,t)},setLanguage(e,t=!0){if(!_(e))return void this.debug.warn("Invalid language argument",e);const i=e.toLowerCase();this.captions.language=i;const s=Ue.getTracks.call(this),n=Ue.findTrack.call(this,[i]);Ue.set.call(this,s.indexOf(n),t)},getTracks(e=!1){return Array.from((this.media||{}).textTracks||[]).filter((t=>!this.isHTML5||e||this.captions.meta.has(t))).filter((e=>["captions","subtitles"].includes(e.kind)))},findTrack(e,t=!1){const i=Ue.getTracks.call(this),s=e=>Number((this.captions.meta.get(e)||{}).default),n=Array.from(i).sort(((e,t)=>s(t)-s(e)));let a;return e.every((e=>(a=n.find((t=>t.language===e)),!a))),a||(t?n[0]:void 0)},getCurrentTrack(){return Ue.getTracks.call(this)[this.currentTrack]},getLabel(e){let t=e;return!V(t)&&me.textTracks&&this.captions.toggled&&(t=Ue.getCurrentTrack.call(this)),V(t)?W(t.label)?W(t.language)?Oe.get("enabled",this.config):e.language.toUpperCase():t.label:Oe.get("disabled",this.config)},updateCues(e){if(!this.supported.ui)return;if(!H(this.elements.captions))return void this.debug.warn("No captions element to render to");if(!I(e)&&!Array.isArray(e))return void this.debug.warn("updateCues: Invalid input",e);let t=e;if(!t){const e=Ue.getCurrentTrack.call(this);t=Array.from((e||{}).activeCues||[]).map((e=>e.getCueAsHTML())).map($e)}const i=t.map((e=>e.trim())).join("\n");if(i!==this.elements.captions.innerHTML){ie(this.elements.captions);const e=Z("span",ne(this.config.selectors.caption));e.innerHTML=i,this.elements.captions.appendChild(e),ve.call(this,this.media,"cuechange")}}},We={enabled:!0,title:"",debug:!1,autoplay:!1,autopause:!0,playsinline:!0,seekTime:10,volume:1,muted:!1,duration:null,displayDuration:!0,invertTime:!0,toggleInvert:!0,ratio:null,clickToPlay:!0,hideControls:!0,resetOnEnd:!1,disableContextMenu:!0,loadSprite:!0,iconPrefix:"plyr",iconUrl:"https://cdn.plyr.io/3.6.4/plyr.svg",blankVideo:"https://cdn.plyr.io/static/blank.mp4",quality:{default:576,options:[4320,2880,2160,1440,1080,720,576,480,360,240],forced:!1,onChange:null},loop:{active:!1},speed:{selected:1,options:[.5,.75,1,1.25,1.5,1.75,2,4]},keyboard:{focused:!0,global:!1},tooltips:{controls:!1,seek:!0},captions:{active:!1,language:"auto",update:!1},fullscreen:{enabled:!0,fallback:!0,iosNative:!1},storage:{enabled:!0,key:"plyr"},controls:["play-large","play","progress","current-time","mute","volume","captions","settings","pip","airplay","fullscreen"],settings:["captions","quality","speed"],i18n:{restart:"Restart",rewind:"Rewind {seektime}s",play:"Play",pause:"Pause",fastForward:"Forward {seektime}s",seek:"Seek",seekLabel:"{currentTime} of {duration}",played:"Played",buffered:"Buffered",currentTime:"Current time",duration:"Duration",volume:"Volume",mute:"Mute",unmute:"Unmute",enableCaptions:"Enable captions",disableCaptions:"Disable captions",download:"Download",enterFullscreen:"Enter fullscreen",exitFullscreen:"Exit fullscreen",frameTitle:"Player for {title}",captions:"Captions",settings:"Settings",pip:"PIP",menuBack:"Go back to previous menu",speed:"Speed",normal:"Normal",quality:"Quality",loop:"Loop",start:"Start",end:"End",all:"All",reset:"Reset",disabled:"Disabled",enabled:"Enabled",advertisement:"Ad",qualityBadge:{2160:"4K",1440:"HD",1080:"HD",720:"HD",576:"SD",480:"SD"}},urls:{download:null,vimeo:{sdk:"https://player.vimeo.com/api/player.js",iframe:"https://player.vimeo.com/video/{0}?{1}",api:"https://vimeo.com/api/oembed.json?url={0}"},youtube:{sdk:"https://www.youtube.com/iframe_api",api:"https://noembed.com/embed?url=https://www.youtube.com/watch?v={0}"},googleIMA:{sdk:"https://imasdk.googleapis.com/js/sdkloader/ima3.js"}},listeners:{seek:null,play:null,pause:null,restart:null,rewind:null,fastForward:null,mute:null,volume:null,captions:null,download:null,fullscreen:null,pip:null,airplay:null,speed:null,quality:null,loop:null,language:null},events:["ended","progress","stalled","playing","waiting","canplay","canplaythrough","loadstart","loadeddata","loadedmetadata","timeupdate","volumechange","play","pause","error","seeking","seeked","emptied","ratechange","cuechange","download","enterfullscreen","exitfullscreen","captionsenabled","captionsdisabled","languagechange","controlshidden","controlsshown","ready","statechange","qualitychange","adsloaded","adscontentpause","adscontentresume","adstarted","adsmidpoint","adscomplete","adsallcomplete","adsimpression","adsclick"],selectors:{editable:"input, textarea, select, [contenteditable]",container:".plyr",controls:{container:null,wrapper:".plyr__controls"},labels:"[data-plyr]",buttons:{play:'[data-plyr="play"]',pause:'[data-plyr="pause"]',restart:'[data-plyr="restart"]',rewind:'[data-plyr="rewind"]',fastForward:'[data-plyr="fast-forward"]',mute:'[data-plyr="mute"]',captions:'[data-plyr="captions"]',download:'[data-plyr="download"]',fullscreen:'[data-plyr="fullscreen"]',pip:'[data-plyr="pip"]',airplay:'[data-plyr="airplay"]',settings:'[data-plyr="settings"]',loop:'[data-plyr="loop"]'},inputs:{seek:'[data-plyr="seek"]',volume:'[data-plyr="volume"]',speed:'[data-plyr="speed"]',language:'[data-plyr="language"]',quality:'[data-plyr="quality"]'},display:{currentTime:".plyr__time--current",duration:".plyr__time--duration",buffer:".plyr__progress__buffer",loop:".plyr__progress__loop",volume:".plyr__volume--display"},progress:".plyr__progress",captions:".plyr__captions",caption:".plyr__caption"},classNames:{type:"plyr--{0}",provider:"plyr--{0}",video:"plyr__video-wrapper",embed:"plyr__video-embed",videoFixedRatio:"plyr__video-wrapper--fixed-ratio",embedContainer:"plyr__video-embed__container",poster:"plyr__poster",posterEnabled:"plyr__poster-enabled",ads:"plyr__ads",control:"plyr__control",controlPressed:"plyr__control--pressed",playing:"plyr--playing",paused:"plyr--paused",stopped:"plyr--stopped",loading:"plyr--loading",hover:"plyr--hover",tooltip:"plyr__tooltip",cues:"plyr__cues",hidden:"plyr__sr-only",hideControls:"plyr--hide-controls",isIos:"plyr--is-ios",isTouch:"plyr--is-touch",uiSupported:"plyr--full-ui",noTransition:"plyr--no-transition",display:{time:"plyr__time"},menu:{value:"plyr__menu__value",badge:"plyr__badge",open:"plyr--menu-open"},captions:{enabled:"plyr--captions-enabled",active:"plyr--captions-active"},fullscreen:{enabled:"plyr--fullscreen-enabled",fallback:"plyr--fullscreen-fallback"},pip:{supported:"plyr--pip-supported",active:"plyr--pip-active"},airplay:{supported:"plyr--airplay-supported",active:"plyr--airplay-active"},tabFocus:"plyr__tab-focus",previewThumbnails:{thumbContainer:"plyr__preview-thumb",thumbContainerShown:"plyr__preview-thumb--is-shown",imageContainer:"plyr__preview-thumb__image-container",timeContainer:"plyr__preview-thumb__time-container",scrubbingContainer:"plyr__preview-scrubbing",scrubbingContainerShown:"plyr__preview-scrubbing--is-shown"}},attributes:{embed:{provider:"data-plyr-provider",id:"data-plyr-embed-id"}},ads:{enabled:!1,publisherId:"",tagUrl:""},previewThumbnails:{enabled:!1,src:""},vimeo:{byline:!1,portrait:!1,title:!1,speed:!0,transparent:!1,customControls:!0,referrerPolicy:null,premium:!1},youtube:{rel:0,showinfo:0,iv_load_policy:3,modestbranding:1,customControls:!0,noCookie:!1}},ze="picture-in-picture",Ke="inline",Ye={html5:"html5",youtube:"youtube",vimeo:"vimeo"},Qe="audio",Xe="video";const Je=()=>{};class Ge{constructor(e=!1){this.enabled=window.console&&e,this.enabled&&this.log("Debugging enabled")}get log(){return this.enabled?Function.prototype.bind.call(console.log,console):Je}get warn(){return this.enabled?Function.prototype.bind.call(console.warn,console):Je}get error(){return this.enabled?Function.prototype.bind.call(console.error,console):Je}}class Ze{constructor(t){e(this,"onChange",(()=>{if(!this.enabled)return;const e=this.player.elements.buttons.fullscreen;H(e)&&(e.pressed=this.active);const t=this.target===this.player.media?this.target:this.player.elements.container;ve.call(this.player,t,this.active?"enterfullscreen":"exitfullscreen",!0)})),e(this,"toggleFallback",((e=!1)=>{if(e?this.scrollPosition={x:window.scrollX||0,y:window.scrollY||0}:window.scrollTo(this.scrollPosition.x,this.scrollPosition.y),document.body.style.overflow=e?"hidden":"",le(this.target,this.player.config.classNames.fullscreen.fallback,e),Y.isIos){let t=document.head.querySelector('meta[name="viewport"]');const i="viewport-fit=cover";t||(t=document.createElement("meta"),t.setAttribute("name","viewport"));const s=_(t.content)&&t.content.includes(i);e?(this.cleanupViewport=!s,s||(t.content+=`,${i}`)):this.cleanupViewport&&(t.content=t.content.split(",").filter((e=>e.trim()!==i)).join(","))}this.onChange()})),e(this,"trapFocus",(e=>{if(Y.isIos||!this.active||"Tab"!==e.key||9!==e.keyCode)return;const t=document.activeElement,i=ce.call(this.player,"a[href], button:not(:disabled), input:not(:disabled), [tabindex]"),[s]=i,n=i[i.length-1];t!==n||e.shiftKey?t===s&&e.shiftKey&&(n.focus(),e.preventDefault()):(s.focus(),e.preventDefault())})),e(this,"update",(()=>{if(this.enabled){let e;e=this.forceFallback?"Fallback (forced)":Ze.native?"Native":"Fallback",this.player.debug.log(`${e} fullscreen enabled`)}else this.player.debug.log("Fullscreen not supported and fallback disabled");le(this.player.elements.container,this.player.config.classNames.fullscreen.enabled,this.enabled)})),e(this,"enter",(()=>{this.enabled&&(Y.isIos&&this.player.config.fullscreen.iosNative?this.player.isVimeo?this.player.embed.requestFullscreen():this.target.webkitEnterFullscreen():!Ze.native||this.forceFallback?this.toggleFallback(!0):this.prefix?W(this.prefix)||this.target[`${this.prefix}Request${this.property}`]():this.target.requestFullscreen({navigationUI:"hide"}))})),e(this,"exit",(()=>{if(this.enabled)if(Y.isIos&&this.player.config.fullscreen.iosNative)this.target.webkitExitFullscreen(),ke(this.player.play());else if(!Ze.native||this.forceFallback)this.toggleFallback(!1);else if(this.prefix){if(!W(this.prefix)){const e="moz"===this.prefix?"Cancel":"Exit";document[`${this.prefix}${e}${this.property}`]()}}else(document.cancelFullScreen||document.exitFullscreen).call(document)})),e(this,"toggle",(()=>{this.active?this.exit():this.enter()})),this.player=t,this.prefix=Ze.prefix,this.property=Ze.property,this.scrollPosition={x:0,y:0},this.forceFallback="force"===t.config.fullscreen.fallback,this.player.elements.fullscreen=t.config.fullscreen.container&&function(e,t){const{prototype:i}=Element;return(i.closest||function(){let e=this;do{if(re.matches(e,t))return e;e=e.parentElement||e.parentNode}while(null!==e&&1===e.nodeType);return null}).call(e,t)}(this.player.elements.container,t.config.fullscreen.container),fe.call(this.player,document,"ms"===this.prefix?"MSFullscreenChange":`${this.prefix}fullscreenchange`,(()=>{this.onChange()})),fe.call(this.player,this.player.elements.container,"dblclick",(e=>{H(this.player.elements.controls)&&this.player.elements.controls.contains(e.target)||this.player.listeners.proxy(e,this.toggle,"fullscreen")})),fe.call(this,this.player.elements.container,"keydown",(e=>this.trapFocus(e))),this.update()}static get native(){return!!(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled)}get usingNative(){return Ze.native&&!this.forceFallback}static get prefix(){if(q(document.exitFullscreen))return"";let e="";return["webkit","moz","ms"].some((t=>!(!q(document[`${t}ExitFullscreen`])&&!q(document[`${t}CancelFullScreen`]))&&(e=t,!0))),e}static get property(){return"moz"===this.prefix?"FullScreen":"Fullscreen"}get enabled(){return(Ze.native||this.player.config.fullscreen.fallback)&&this.player.config.fullscreen.enabled&&this.player.supported.ui&&this.player.isVideo}get active(){if(!this.enabled)return!1;if(!Ze.native||this.forceFallback)return oe(this.target,this.player.config.classNames.fullscreen.fallback);const e=this.prefix?document[`${this.prefix}${this.property}Element`]:document.fullscreenElement;return e&&e.shadowRoot?e===this.target.getRootNode().host:e===this.target}get target(){return Y.isIos&&this.player.config.fullscreen.iosNative?this.player.media:this.player.elements.fullscreen||this.player.elements.container}}function et(e,t=1){return new Promise(((i,s)=>{const n=new Image,a=()=>{delete n.onload,delete n.onerror,(n.naturalWidth>=t?i:s)(n)};Object.assign(n,{onload:a,onerror:a,src:e})}))}const tt={addStyleHook(){le(this.elements.container,this.config.selectors.container.replace(".",""),!0),le(this.elements.container,this.config.classNames.uiSupported,this.supported.ui)},toggleNativeControls(e=!1){e&&this.isHTML5?this.media.setAttribute("controls",""):this.media.removeAttribute("controls")},build(){if(this.listeners.media(),!this.supported.ui)return this.debug.warn(`Basic support only for ${this.provider} ${this.type}`),void tt.toggleNativeControls.call(this,!0);H(this.elements.controls)||(Re.inject.call(this),this.listeners.controls()),tt.toggleNativeControls.call(this),this.isHTML5&&Ue.setup.call(this),this.volume=null,this.muted=null,this.loop=null,this.quality=null,this.speed=null,Re.updateVolume.call(this),Re.timeUpdate.call(this),tt.checkPlaying.call(this),le(this.elements.container,this.config.classNames.pip.supported,me.pip&&this.isHTML5&&this.isVideo),le(this.elements.container,this.config.classNames.airplay.supported,me.airplay&&this.isHTML5),le(this.elements.container,this.config.classNames.isIos,Y.isIos),le(this.elements.container,this.config.classNames.isTouch,this.touch),this.ready=!0,setTimeout((()=>{ve.call(this,this.media,"ready")}),0),tt.setTitle.call(this),this.poster&&tt.setPoster.call(this,this.poster,!1).catch((()=>{})),this.config.duration&&Re.durationUpdate.call(this)},setTitle(){let e=Oe.get("play",this.config);if(_(this.config.title)&&!W(this.config.title)&&(e+=`, ${this.config.title}`),Array.from(this.elements.buttons.play||[]).forEach((t=>{t.setAttribute("aria-label",e)})),this.isEmbed){const e=he.call(this,"iframe");if(!H(e))return;const t=W(this.config.title)?"video":this.config.title,i=Oe.get("frameTitle",this.config);e.setAttribute("title",i.replace("{title}",t))}},togglePoster(e){le(this.elements.container,this.config.classNames.posterEnabled,e)},setPoster(e,t=!0){return t&&this.poster?Promise.reject(new Error("Poster already set")):(this.media.setAttribute("data-poster",e),this.elements.poster.removeAttribute("hidden"),Te.call(this).then((()=>et(e))).catch((t=>{throw e===this.poster&&tt.togglePoster.call(this,!1),t})).then((()=>{if(e!==this.poster)throw new Error("setPoster cancelled by later call to setPoster")})).then((()=>(Object.assign(this.elements.poster.style,{backgroundImage:`url('${e}')`,backgroundSize:""}),tt.togglePoster.call(this,!0),e))))},checkPlaying(e){le(this.elements.container,this.config.classNames.playing,this.playing),le(this.elements.container,this.config.classNames.paused,this.paused),le(this.elements.container,this.config.classNames.stopped,this.stopped),Array.from(this.elements.buttons.play||[]).forEach((e=>{Object.assign(e,{pressed:this.playing}),e.setAttribute("aria-label",Oe.get(this.playing?"pause":"play",this.config))})),F(e)&&"timeupdate"===e.type||tt.toggleControls.call(this)},checkLoading(e){this.loading=["stalled","waiting"].includes(e.type),clearTimeout(this.timers.loading),this.timers.loading=setTimeout((()=>{le(this.elements.container,this.config.classNames.loading,this.loading),tt.toggleControls.call(this)}),this.loading?250:0)},toggleControls(e){const{controls:t}=this.elements;if(t&&this.config.hideControls){const i=this.touch&&this.lastSeekTime+2e3>Date.now();this.toggleControls(Boolean(e||this.loading||this.paused||t.pressed||t.hover||i))}},migrateStyles(){Object.values({...this.media.style}).filter((e=>!W(e)&&_(e)&&e.startsWith("--plyr"))).forEach((e=>{this.elements.container.style.setProperty(e,this.media.style.getPropertyValue(e)),this.media.style.removeProperty(e)})),W(this.media.style)&&this.media.removeAttribute("style")}};class it{constructor(t){e(this,"firstTouch",(()=>{const{player:e}=this,{elements:t}=e;e.touch=!0,le(t.container,e.config.classNames.isTouch,!0)})),e(this,"setTabFocus",(e=>{const{player:t}=this,{elements:i}=t;if(clearTimeout(this.focusTimer),"keydown"===e.type&&9!==e.which)return;"keydown"===e.type&&(this.lastKeyDown=e.timeStamp);const s=e.timeStamp-this.lastKeyDown<=20;("focus"!==e.type||s)&&((()=>{const e=t.config.classNames.tabFocus;le(ce.call(t,`.${e}`),e,!1)})(),"focusout"!==e.type&&(this.focusTimer=setTimeout((()=>{const e=document.activeElement;i.container.contains(e)&&le(document.activeElement,t.config.classNames.tabFocus,!0)}),10)))})),e(this,"global",((e=!0)=>{const{player:t}=this;t.config.keyboard.global&&ge.call(t,window,"keydown keyup",this.handleKey,e,!1),ge.call(t,document.body,"click",this.toggleMenu,e),ye.call(t,document.body,"touchstart",this.firstTouch),ge.call(t,document.body,"keydown focus blur focusout",this.setTabFocus,e,!1,!0)})),e(this,"container",(()=>{const{player:e}=this,{config:t,elements:i,timers:s}=e;!t.keyboard.global&&t.keyboard.focused&&fe.call(e,i.container,"keydown keyup",this.handleKey,!1),fe.call(e,i.container,"mousemove mouseleave touchstart touchmove enterfullscreen exitfullscreen",(t=>{const{controls:n}=i;n&&"enterfullscreen"===t.type&&(n.pressed=!1,n.hover=!1);let a=0;["touchstart","touchmove","mousemove"].includes(t.type)&&(tt.toggleControls.call(e,!0),a=e.touch?3e3:2e3),clearTimeout(s.controls),s.controls=setTimeout((()=>tt.toggleControls.call(e,!1)),a)}));const n=t=>{if(!t)return Ee.call(e);const s=i.container.getBoundingClientRect(),{width:n,height:a}=s;return Ee.call(e,`${n}:${a}`)},a=()=>{clearTimeout(s.resized),s.resized=setTimeout(n,50)};fe.call(e,i.container,"enterfullscreen exitfullscreen",(t=>{const{target:s,usingNative:l}=e.fullscreen;if(s!==i.container)return;if(!e.isEmbed&&W(e.config.ratio))return;const o="enterfullscreen"===t.type,{padding:r,ratio:c}=n(o);((t,i,s)=>{if(!e.isVimeo||e.config.vimeo.premium)return;const n=e.elements.wrapper.firstChild,[,a]=t,[l,o]=Se.call(e);n.style.maxWidth=s?a/o*l+"px":null,n.style.margin=s?"0 auto":null})(c,0,o),o&&setTimeout((()=>K(i.container)),100),l||(o?fe.call(e,window,"resize",a):be.call(e,window,"resize",a))}))})),e(this,"media",(()=>{const{player:e}=this,{elements:t}=e;if(fe.call(e,e.media,"timeupdate seeking seeked",(t=>Re.timeUpdate.call(e,t))),fe.call(e,e.media,"durationchange loadeddata loadedmetadata",(t=>Re.durationUpdate.call(e,t))),fe.call(e,e.media,"ended",(()=>{e.isHTML5&&e.isVideo&&e.config.resetOnEnd&&(e.restart(),e.pause())})),fe.call(e,e.media,"progress playing seeking seeked",(t=>Re.updateProgress.call(e,t))),fe.call(e,e.media,"volumechange",(t=>Re.updateVolume.call(e,t))),fe.call(e,e.media,"playing play pause ended emptied timeupdate",(t=>tt.checkPlaying.call(e,t))),fe.call(e,e.media,"waiting canplay seeked playing",(t=>tt.checkLoading.call(e,t))),e.supported.ui&&e.config.clickToPlay&&!e.isAudio){const i=he.call(e,`.${e.config.classNames.video}`);if(!H(i))return;fe.call(e,t.container,"click",(s=>{([t.container,i].includes(s.target)||i.contains(s.target))&&(e.touch&&e.config.hideControls||(e.ended?(this.proxy(s,e.restart,"restart"),this.proxy(s,(()=>{ke(e.play())}),"play")):this.proxy(s,(()=>{ke(e.togglePlay())}),"play")))}))}e.supported.ui&&e.config.disableContextMenu&&fe.call(e,t.wrapper,"contextmenu",(e=>{e.preventDefault()}),!1),fe.call(e,e.media,"volumechange",(()=>{e.storage.set({volume:e.volume,muted:e.muted})})),fe.call(e,e.media,"ratechange",(()=>{Re.updateSetting.call(e,"speed"),e.storage.set({speed:e.speed})})),fe.call(e,e.media,"qualitychange",(t=>{Re.updateSetting.call(e,"quality",null,t.detail.quality)})),fe.call(e,e.media,"ready qualitychange",(()=>{Re.setDownloadUrl.call(e)}));const i=e.config.events.concat(["keyup","keydown"]).join(" ");fe.call(e,e.media,i,(i=>{let{detail:s={}}=i;"error"===i.type&&(s=e.media.error),ve.call(e,t.container,i.type,!0,s)}))})),e(this,"proxy",((e,t,i)=>{const{player:s}=this,n=s.config.listeners[i];let a=!0;q(n)&&(a=n.call(s,e)),!1!==a&&q(t)&&t.call(s,e)})),e(this,"bind",((e,t,i,s,n=!0)=>{const{player:a}=this,l=a.config.listeners[s],o=q(l);fe.call(a,e,t,(e=>this.proxy(e,i,s)),n&&!o)})),e(this,"controls",(()=>{const{player:e}=this,{elements:t}=e,i=Y.isIE?"change":"input";if(t.buttons.play&&Array.from(t.buttons.play).forEach((t=>{this.bind(t,"click",(()=>{ke(e.togglePlay())}),"play")})),this.bind(t.buttons.restart,"click",e.restart,"restart"),this.bind(t.buttons.rewind,"click",(()=>{e.lastSeekTime=Date.now(),e.rewind()}),"rewind"),this.bind(t.buttons.fastForward,"click",(()=>{e.lastSeekTime=Date.now(),e.forward()}),"fastForward"),this.bind(t.buttons.mute,"click",(()=>{e.muted=!e.muted}),"mute"),this.bind(t.buttons.captions,"click",(()=>e.toggleCaptions())),this.bind(t.buttons.download,"click",(()=>{ve.call(e,e.media,"download")}),"download"),this.bind(t.buttons.fullscreen,"click",(()=>{e.fullscreen.toggle()}),"fullscreen"),this.bind(t.buttons.pip,"click",(()=>{e.pip="toggle"}),"pip"),this.bind(t.buttons.airplay,"click",e.airplay,"airplay"),this.bind(t.buttons.settings,"click",(t=>{t.stopPropagation(),t.preventDefault(),Re.toggleMenu.call(e,t)}),null,!1),this.bind(t.buttons.settings,"keyup",(t=>{const i=t.which;[13,32].includes(i)&&(13!==i?(t.preventDefault(),t.stopPropagation(),Re.toggleMenu.call(e,t)):Re.focusFirstMenuItem.call(e,null,!0))}),null,!1),this.bind(t.settings.menu,"keydown",(t=>{27===t.which&&Re.toggleMenu.call(e,t)})),this.bind(t.inputs.seek,"mousedown mousemove",(e=>{const i=t.progress.getBoundingClientRect(),s=100/i.width*(e.pageX-i.left);e.currentTarget.setAttribute("seek-value",s)})),this.bind(t.inputs.seek,"mousedown mouseup keydown keyup touchstart touchend",(t=>{const i=t.currentTarget,s=t.keyCode?t.keyCode:t.which,n="play-on-seeked";if(R(t)&&39!==s&&37!==s)return;e.lastSeekTime=Date.now();const a=i.hasAttribute(n),l=["mouseup","touchend","keyup"].includes(t.type);a&&l?(i.removeAttribute(n),ke(e.play())):!l&&e.playing&&(i.setAttribute(n,""),e.pause())})),Y.isIos){const t=ce.call(e,'input[type="range"]');Array.from(t).forEach((e=>this.bind(e,i,(e=>K(e.target)))))}this.bind(t.inputs.seek,i,(t=>{const i=t.currentTarget;let s=i.getAttribute("seek-value");W(s)&&(s=i.value),i.removeAttribute("seek-value"),e.currentTime=s/i.max*e.duration}),"seek"),this.bind(t.progress,"mouseenter mouseleave mousemove",(t=>Re.updateSeekTooltip.call(e,t))),this.bind(t.progress,"mousemove touchmove",(t=>{const{previewThumbnails:i}=e;i&&i.loaded&&i.startMove(t)})),this.bind(t.progress,"mouseleave touchend click",(()=>{const{previewThumbnails:t}=e;t&&t.loaded&&t.endMove(!1,!0)})),this.bind(t.progress,"mousedown touchstart",(t=>{const{previewThumbnails:i}=e;i&&i.loaded&&i.startScrubbing(t)})),this.bind(t.progress,"mouseup touchend",(t=>{const{previewThumbnails:i}=e;i&&i.loaded&&i.endScrubbing(t)})),Y.isWebkit&&Array.from(ce.call(e,'input[type="range"]')).forEach((t=>{this.bind(t,"input",(t=>Re.updateRangeFill.call(e,t.target)))})),e.config.toggleInvert&&!H(t.display.duration)&&this.bind(t.display.currentTime,"click",(()=>{0!==e.currentTime&&(e.config.invertTime=!e.config.invertTime,Re.timeUpdate.call(e))})),this.bind(t.inputs.volume,i,(t=>{e.volume=t.target.value}),"volume"),this.bind(t.controls,"mouseenter mouseleave",(i=>{t.controls.hover=!e.touch&&"mouseenter"===i.type})),t.fullscreen&&Array.from(t.fullscreen.children).filter((e=>!e.contains(t.container))).forEach((i=>{this.bind(i,"mouseenter mouseleave",(i=>{t.controls.hover=!e.touch&&"mouseenter"===i.type}))})),this.bind(t.controls,"mousedown mouseup touchstart touchend touchcancel",(e=>{t.controls.pressed=["mousedown","touchstart"].includes(e.type)})),this.bind(t.controls,"focusin",(()=>{const{config:i,timers:s}=e;le(t.controls,i.classNames.noTransition,!0),tt.toggleControls.call(e,!0),setTimeout((()=>{le(t.controls,i.classNames.noTransition,!1)}),0);const n=this.touch?3e3:4e3;clearTimeout(s.controls),s.controls=setTimeout((()=>tt.toggleControls.call(e,!1)),n)})),this.bind(t.inputs.volume,"wheel",(t=>{const i=t.webkitDirectionInvertedFromDevice,[s,n]=[t.deltaX,-t.deltaY].map((e=>i?-e:e)),a=Math.sign(Math.abs(s)>Math.abs(n)?s:n);e.increaseVolume(a/50);const{volume:l}=e.media;(1===a&&l<1||-1===a&&l>0)&&t.preventDefault()}),"volume",!1)})),this.player=t,this.lastKey=null,this.focusTimer=null,this.lastKeyDown=null,this.handleKey=this.handleKey.bind(this),this.toggleMenu=this.toggleMenu.bind(this),this.setTabFocus=this.setTabFocus.bind(this),this.firstTouch=this.firstTouch.bind(this)}handleKey(e){const{player:t}=this,{elements:i}=t,s=e.keyCode?e.keyCode:e.which,n="keydown"===e.type,a=n&&s===this.lastKey;if(e.altKey||e.ctrlKey||e.metaKey||e.shiftKey)return;if(!$(s))return;if(n){const n=document.activeElement;if(H(n)){const{editable:s}=t.config.selectors,{seek:a}=i.inputs;if(n!==a&&re(n,s))return;if(32===e.which&&re(n,'button, [role^="menuitem"]'))return}switch([32,37,38,39,40,48,49,50,51,52,53,54,56,57,67,70,73,75,76,77,79].includes(s)&&(e.preventDefault(),e.stopPropagation()),s){case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:a||(t.currentTime=t.duration/10*(s-48));break;case 32:case 75:a||ke(t.togglePlay());break;case 38:t.increaseVolume(.1);break;case 40:t.decreaseVolume(.1);break;case 77:a||(t.muted=!t.muted);break;case 39:t.forward();break;case 37:t.rewind();break;case 70:t.fullscreen.toggle();break;case 67:a||t.toggleCaptions();break;case 76:t.loop=!t.loop}27===s&&!t.fullscreen.usingNative&&t.fullscreen.active&&t.fullscreen.toggle(),this.lastKey=s}else this.lastKey=null}toggleMenu(e){Re.toggleMenu.call(this.player,e)}}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var st=function(e,t){return e(t={exports:{}},t.exports),t.exports}((function(e,t){e.exports=function(){var e=function(){},t={},i={},s={};function n(e,t){e=e.push?e:[e];var n,a,l,o=[],r=e.length,c=r;for(n=function(e,i){i.length&&o.push(e),--c||t(o)};r--;)a=e[r],(l=i[a])?n(a,l):(s[a]=s[a]||[]).push(n)}function a(e,t){if(e){var n=s[e];if(i[e]=t,n)for(;n.length;)n[0](e,t),n.splice(0,1)}}function l(t,i){t.call&&(t={success:t}),i.length?(t.error||e)(i):(t.success||e)(t)}function o(t,i,s,n){var a,l,r=document,c=s.async,h=(s.numRetries||0)+1,u=s.before||e,d=t.replace(/[\?|#].*$/,""),m=t.replace(/^(css|img)!/,"");n=n||0,/(^css!|\.css$)/.test(d)?((l=r.createElement("link")).rel="stylesheet",l.href=m,(a="hideFocus"in l)&&l.relList&&(a=0,l.rel="preload",l.as="style")):/(^img!|\.(png|gif|jpg|svg|webp)$)/.test(d)?(l=r.createElement("img")).src=m:((l=r.createElement("script")).src=t,l.async=void 0===c||c),l.onload=l.onerror=l.onbeforeload=function(e){var r=e.type[0];if(a)try{l.sheet.cssText.length||(r="e")}catch(e){18!=e.code&&(r="e")}if("e"==r){if((n+=1)<h)return o(t,i,s,n)}else if("preload"==l.rel&&"style"==l.as)return l.rel="stylesheet";i(t,r,e.defaultPrevented)},!1!==u(t,l)&&r.head.appendChild(l)}function r(e,t,i){var s,n,a=(e=e.push?e:[e]).length,l=a,r=[];for(s=function(e,i,s){if("e"==i&&r.push(e),"b"==i){if(!s)return;r.push(e)}--a||t(r)},n=0;n<l;n++)o(e[n],s,i)}function c(e,i,s){var n,o;if(i&&i.trim&&(n=i),o=(n?s:i)||{},n){if(n in t)throw"LoadJS";t[n]=!0}function c(t,i){r(e,(function(e){l(o,e),t&&l({success:t,error:i},e),a(n,e)}),o)}if(o.returnPromise)return new Promise(c);c()}return c.ready=function(e,t){return n(e,(function(e){l(t,e)})),c},c.done=function(e){a(e,[])},c.reset=function(){t={},i={},s={}},c.isDefined=function(e){return e in t},c}()}));function nt(e){return new Promise(((t,i)=>{st(e,{success:t,error:i})}))}function at(e){e&&!this.embed.hasPlayed&&(this.embed.hasPlayed=!0),this.media.paused===e&&(this.media.paused=!e,ve.call(this,this.media,e?"play":"pause"))}const lt={setup(){const e=this;le(e.elements.wrapper,e.config.classNames.embed,!0),e.options.speed=e.config.speed.options,Ee.call(e),L(window.Vimeo)?lt.ready.call(e):nt(e.config.urls.vimeo.sdk).then((()=>{lt.ready.call(e)})).catch((t=>{e.debug.warn("Vimeo SDK (player.js) failed to load",t)}))},ready(){const e=this,t=e.config.vimeo,{premium:i,referrerPolicy:s,...n}=t;i&&Object.assign(n,{controls:!1,sidedock:!1});const a=Be({loop:e.config.loop.active,autoplay:e.autoplay,muted:e.muted,gesture:"media",playsinline:!this.config.fullscreen.iosNative,...n});let l=e.media.getAttribute("src");W(l)&&(l=e.media.getAttribute(e.config.attributes.embed.id));const o=W(r=l)?null:$(Number(r))?r:r.match(/^.*(vimeo.com\/|video\/)(\d+).*/)?RegExp.$2:r;var r;const c=Z("iframe"),h=xe(e.config.urls.vimeo.iframe,o,a);if(c.setAttribute("src",h),c.setAttribute("allowfullscreen",""),c.setAttribute("allow",["autoplay","fullscreen","picture-in-picture"].join("; ")),W(s)||c.setAttribute("referrerPolicy",s),i||!t.customControls)c.setAttribute("data-poster",e.poster),e.media=se(c,e.media);else{const t=Z("div",{class:e.config.classNames.embedContainer,"data-poster":e.poster});t.appendChild(c),e.media=se(t,e.media)}t.customControls||je(xe(e.config.urls.vimeo.api,h)).then((t=>{!W(t)&&t.thumbnail_url&&tt.setPoster.call(e,t.thumbnail_url).catch((()=>{}))})),e.embed=new window.Vimeo.Player(c,{autopause:e.config.autopause,muted:e.muted}),e.media.paused=!0,e.media.currentTime=0,e.supported.ui&&e.embed.disableTextTrack(),e.media.play=()=>(at.call(e,!0),e.embed.play()),e.media.pause=()=>(at.call(e,!1),e.embed.pause()),e.media.stop=()=>{e.pause(),e.currentTime=0};let{currentTime:u}=e.media;Object.defineProperty(e.media,"currentTime",{get:()=>u,set(t){const{embed:i,media:s,paused:n,volume:a}=e,l=n&&!i.hasPlayed;s.seeking=!0,ve.call(e,s,"seeking"),Promise.resolve(l&&i.setVolume(0)).then((()=>i.setCurrentTime(t))).then((()=>l&&i.pause())).then((()=>l&&i.setVolume(a))).catch((()=>{}))}});let d=e.config.speed.selected;Object.defineProperty(e.media,"playbackRate",{get:()=>d,set(t){e.embed.setPlaybackRate(t).then((()=>{d=t,ve.call(e,e.media,"ratechange")})).catch((()=>{e.options.speed=[1]}))}});let{volume:m}=e.config;Object.defineProperty(e.media,"volume",{get:()=>m,set(t){e.embed.setVolume(t).then((()=>{m=t,ve.call(e,e.media,"volumechange")}))}});let{muted:p}=e.config;Object.defineProperty(e.media,"muted",{get:()=>p,set(t){const i=!!O(t)&&t;e.embed.setVolume(i?0:e.config.volume).then((()=>{p=i,ve.call(e,e.media,"volumechange")}))}});let g,{loop:f}=e.config;Object.defineProperty(e.media,"loop",{get:()=>f,set(t){const i=O(t)?t:e.config.loop.active;e.embed.setLoop(i).then((()=>{f=i}))}}),e.embed.getVideoUrl().then((t=>{g=t,Re.setDownloadUrl.call(e)})).catch((e=>{this.debug.warn(e)})),Object.defineProperty(e.media,"currentSrc",{get:()=>g}),Object.defineProperty(e.media,"ended",{get:()=>e.currentTime===e.duration}),Promise.all([e.embed.getVideoWidth(),e.embed.getVideoHeight()]).then((t=>{const[i,s]=t;e.embed.ratio=[i,s],Ee.call(this)})),e.embed.setAutopause(e.config.autopause).then((t=>{e.config.autopause=t})),e.embed.getVideoTitle().then((t=>{e.config.title=t,tt.setTitle.call(this)})),e.embed.getCurrentTime().then((t=>{u=t,ve.call(e,e.media,"timeupdate")})),e.embed.getDuration().then((t=>{e.media.duration=t,ve.call(e,e.media,"durationchange")})),e.embed.getTextTracks().then((t=>{e.media.textTracks=t,Ue.setup.call(e)})),e.embed.on("cuechange",(({cues:t=[]})=>{const i=t.map((e=>function(e){const t=document.createDocumentFragment(),i=document.createElement("div");return t.appendChild(i),i.innerHTML=e,t.firstChild.innerText}(e.text)));Ue.updateCues.call(e,i)})),e.embed.on("loaded",(()=>{if(e.embed.getPaused().then((t=>{at.call(e,!t),t||ve.call(e,e.media,"playing")})),H(e.embed.element)&&e.supported.ui){e.embed.element.setAttribute("tabindex",-1)}})),e.embed.on("bufferstart",(()=>{ve.call(e,e.media,"waiting")})),e.embed.on("bufferend",(()=>{ve.call(e,e.media,"playing")})),e.embed.on("play",(()=>{at.call(e,!0),ve.call(e,e.media,"playing")})),e.embed.on("pause",(()=>{at.call(e,!1)})),e.embed.on("timeupdate",(t=>{e.media.seeking=!1,u=t.seconds,ve.call(e,e.media,"timeupdate")})),e.embed.on("progress",(t=>{e.media.buffered=t.percent,ve.call(e,e.media,"progress"),1===parseInt(t.percent,10)&&ve.call(e,e.media,"canplaythrough"),e.embed.getDuration().then((t=>{t!==e.media.duration&&(e.media.duration=t,ve.call(e,e.media,"durationchange"))}))})),e.embed.on("seeked",(()=>{e.media.seeking=!1,ve.call(e,e.media,"seeked")})),e.embed.on("ended",(()=>{e.media.paused=!0,ve.call(e,e.media,"ended")})),e.embed.on("error",(t=>{e.media.error=t,ve.call(e,e.media,"error")})),t.customControls&&setTimeout((()=>tt.build.call(e)),0)}};function ot(e){e&&!this.embed.hasPlayed&&(this.embed.hasPlayed=!0),this.media.paused===e&&(this.media.paused=!e,ve.call(this,this.media,e?"play":"pause"))}function rt(e){return e.noCookie?"https://www.youtube-nocookie.com":"http:"===window.location.protocol?"http://www.youtube.com":void 0}const ct={setup(){if(le(this.elements.wrapper,this.config.classNames.embed,!0),L(window.YT)&&q(window.YT.Player))ct.ready.call(this);else{const e=window.onYouTubeIframeAPIReady;window.onYouTubeIframeAPIReady=()=>{q(e)&&e(),ct.ready.call(this)},nt(this.config.urls.youtube.sdk).catch((e=>{this.debug.warn("YouTube API failed to load",e)}))}},getTitle(e){je(xe(this.config.urls.youtube.api,e)).then((e=>{if(L(e)){const{title:t,height:i,width:s}=e;this.config.title=t,tt.setTitle.call(this),this.embed.ratio=[s,i]}Ee.call(this)})).catch((()=>{Ee.call(this)}))},ready(){const e=this,t=e.config.youtube,i=e.media&&e.media.getAttribute("id");if(!W(i)&&i.startsWith("youtube-"))return;let s=e.media.getAttribute("src");W(s)&&(s=e.media.getAttribute(this.config.attributes.embed.id));const n=W(a=s)?null:a.match(/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=)([^#&?]*).*/)?RegExp.$2:a;var a;const l=Z("div",{id:`${e.provider}-${Math.floor(1e4*Math.random())}`,"data-poster":t.customControls?e.poster:void 0});if(e.media=se(l,e.media),t.customControls){const t=e=>`https://i.ytimg.com/vi/${n}/${e}default.jpg`;et(t("maxres"),121).catch((()=>et(t("sd"),121))).catch((()=>et(t("hq")))).then((t=>tt.setPoster.call(e,t.src))).then((t=>{t.includes("maxres")||(e.elements.poster.style.backgroundSize="cover")})).catch((()=>{}))}e.embed=new window.YT.Player(e.media,{videoId:n,host:rt(t),playerVars:X({},{autoplay:e.config.autoplay?1:0,hl:e.config.hl,controls:e.supported.ui&&t.customControls?0:1,disablekb:1,playsinline:e.config.fullscreen.iosNative?0:1,cc_load_policy:e.captions.active?1:0,cc_lang_pref:e.config.captions.language,widget_referrer:window?window.location.href:null},t),events:{onError(t){if(!e.media.error){const i=t.data,s={2:"The request contains an invalid parameter value. For example, this error occurs if you specify a video ID that does not have 11 characters, or if the video ID contains invalid characters, such as exclamation points or asterisks.",5:"The requested content cannot be played in an HTML5 player or another error related to the HTML5 player has occurred.",100:"The video requested was not found. This error occurs when a video has been removed (for any reason) or has been marked as private.",101:"The owner of the requested video does not allow it to be played in embedded players.",150:"The owner of the requested video does not allow it to be played in embedded players."}[i]||"An unknown error occured";e.media.error={code:i,message:s},ve.call(e,e.media,"error")}},onPlaybackRateChange(t){const i=t.target;e.media.playbackRate=i.getPlaybackRate(),ve.call(e,e.media,"ratechange")},onReady(i){if(q(e.media.play))return;const s=i.target;ct.getTitle.call(e,n),e.media.play=()=>{ot.call(e,!0),s.playVideo()},e.media.pause=()=>{ot.call(e,!1),s.pauseVideo()},e.media.stop=()=>{s.stopVideo()},e.media.duration=s.getDuration(),e.media.paused=!0,e.media.currentTime=0,Object.defineProperty(e.media,"currentTime",{get:()=>Number(s.getCurrentTime()),set(t){e.paused&&!e.embed.hasPlayed&&e.embed.mute(),e.media.seeking=!0,ve.call(e,e.media,"seeking"),s.seekTo(t)}}),Object.defineProperty(e.media,"playbackRate",{get:()=>s.getPlaybackRate(),set(e){s.setPlaybackRate(e)}});let{volume:a}=e.config;Object.defineProperty(e.media,"volume",{get:()=>a,set(t){a=t,s.setVolume(100*a),ve.call(e,e.media,"volumechange")}});let{muted:l}=e.config;Object.defineProperty(e.media,"muted",{get:()=>l,set(t){const i=O(t)?t:l;l=i,s[i?"mute":"unMute"](),s.setVolume(100*a),ve.call(e,e.media,"volumechange")}}),Object.defineProperty(e.media,"currentSrc",{get:()=>s.getVideoUrl()}),Object.defineProperty(e.media,"ended",{get:()=>e.currentTime===e.duration});const o=s.getAvailablePlaybackRates();e.options.speed=o.filter((t=>e.config.speed.options.includes(t))),e.supported.ui&&t.customControls&&e.media.setAttribute("tabindex",-1),ve.call(e,e.media,"timeupdate"),ve.call(e,e.media,"durationchange"),clearInterval(e.timers.buffering),e.timers.buffering=setInterval((()=>{e.media.buffered=s.getVideoLoadedFraction(),(null===e.media.lastBuffered||e.media.lastBuffered<e.media.buffered)&&ve.call(e,e.media,"progress"),e.media.lastBuffered=e.media.buffered,1===e.media.buffered&&(clearInterval(e.timers.buffering),ve.call(e,e.media,"canplaythrough"))}),200),t.customControls&&setTimeout((()=>tt.build.call(e)),50)},onStateChange(i){const s=i.target;clearInterval(e.timers.playing);switch(e.media.seeking&&[1,2].includes(i.data)&&(e.media.seeking=!1,ve.call(e,e.media,"seeked")),i.data){case-1:ve.call(e,e.media,"timeupdate"),e.media.buffered=s.getVideoLoadedFraction(),ve.call(e,e.media,"progress");break;case 0:ot.call(e,!1),e.media.loop?(s.stopVideo(),s.playVideo()):ve.call(e,e.media,"ended");break;case 1:t.customControls&&!e.config.autoplay&&e.media.paused&&!e.embed.hasPlayed?e.media.pause():(ot.call(e,!0),ve.call(e,e.media,"playing"),e.timers.playing=setInterval((()=>{ve.call(e,e.media,"timeupdate")}),50),e.media.duration!==s.getDuration()&&(e.media.duration=s.getDuration(),ve.call(e,e.media,"durationchange")));break;case 2:e.muted||e.embed.unMute(),ot.call(e,!1);break;case 3:ve.call(e,e.media,"waiting")}ve.call(e,e.elements.container,"statechange",!1,{code:i.data})}}})}},ht={setup(){this.media?(le(this.elements.container,this.config.classNames.type.replace("{0}",this.type),!0),le(this.elements.container,this.config.classNames.provider.replace("{0}",this.provider),!0),this.isEmbed&&le(this.elements.container,this.config.classNames.type.replace("{0}","video"),!0),this.isVideo&&(this.elements.wrapper=Z("div",{class:this.config.classNames.video}),J(this.media,this.elements.wrapper),this.elements.poster=Z("div",{class:this.config.classNames.poster,hidden:""}),this.elements.wrapper.appendChild(this.elements.poster)),this.isHTML5?Pe.setup.call(this):this.isYouTube?ct.setup.call(this):this.isVimeo&&lt.setup.call(this)):this.debug.warn("No media element found!")}};class ut{constructor(t){e(this,"load",(()=>{this.enabled&&(L(window.google)&&L(window.google.ima)?this.ready():nt(this.player.config.urls.googleIMA.sdk).then((()=>{this.ready()})).catch((()=>{this.trigger("error",new Error("Google IMA SDK failed to load"))})))})),e(this,"ready",(()=>{var e;this.enabled||((e=this).manager&&e.manager.destroy(),e.elements.displayContainer&&e.elements.displayContainer.destroy(),e.elements.container.remove()),this.startSafetyTimer(12e3,"ready()"),this.managerPromise.then((()=>{this.clearSafetyTimer("onAdsManagerLoaded()")})),this.listeners(),this.setupIMA()})),e(this,"setupIMA",(()=>{this.elements.container=Z("div",{class:this.player.config.classNames.ads}),this.player.elements.container.appendChild(this.elements.container),google.ima.settings.setVpaidMode(google.ima.ImaSdkSettings.VpaidMode.ENABLED),google.ima.settings.setLocale(this.player.config.ads.language),google.ima.settings.setDisableCustomPlaybackForIOS10Plus(this.player.config.playsinline),this.elements.displayContainer=new google.ima.AdDisplayContainer(this.elements.container,this.player.media),this.loader=new google.ima.AdsLoader(this.elements.displayContainer),this.loader.addEventListener(google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,(e=>this.onAdsManagerLoaded(e)),!1),this.loader.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,(e=>this.onAdError(e)),!1),this.requestAds()})),e(this,"requestAds",(()=>{const{container:e}=this.player.elements;try{const t=new google.ima.AdsRequest;t.adTagUrl=this.tagUrl,t.linearAdSlotWidth=e.offsetWidth,t.linearAdSlotHeight=e.offsetHeight,t.nonLinearAdSlotWidth=e.offsetWidth,t.nonLinearAdSlotHeight=e.offsetHeight,t.forceNonLinearFullSlot=!1,t.setAdWillPlayMuted(!this.player.muted),this.loader.requestAds(t)}catch(e){this.onAdError(e)}})),e(this,"pollCountdown",((e=!1)=>{if(!e)return clearInterval(this.countdownTimer),void this.elements.container.removeAttribute("data-badge-text");this.countdownTimer=setInterval((()=>{const e=Fe(Math.max(this.manager.getRemainingTime(),0)),t=`${Oe.get("advertisement",this.player.config)} - ${e}`;this.elements.container.setAttribute("data-badge-text",t)}),100)})),e(this,"onAdsManagerLoaded",(e=>{if(!this.enabled)return;const t=new google.ima.AdsRenderingSettings;t.restoreCustomPlaybackStateOnAdBreakComplete=!0,t.enablePreloading=!0,this.manager=e.getAdsManager(this.player,t),this.cuePoints=this.manager.getCuePoints(),this.manager.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,(e=>this.onAdError(e))),Object.keys(google.ima.AdEvent.Type).forEach((e=>{this.manager.addEventListener(google.ima.AdEvent.Type[e],(e=>this.onAdEvent(e)))})),this.trigger("loaded")})),e(this,"addCuePoints",(()=>{W(this.cuePoints)||this.cuePoints.forEach((e=>{if(0!==e&&-1!==e&&e<this.player.duration){const t=this.player.elements.progress;if(H(t)){const i=100/this.player.duration*e,s=Z("span",{class:this.player.config.classNames.cues});s.style.left=`${i.toString()}%`,t.appendChild(s)}}}))})),e(this,"onAdEvent",(e=>{const{container:t}=this.player.elements,i=e.getAd(),s=e.getAdData();switch((e=>{ve.call(this.player,this.player.media,`ads${e.replace(/_/g,"").toLowerCase()}`)})(e.type),e.type){case google.ima.AdEvent.Type.LOADED:this.trigger("loaded"),this.pollCountdown(!0),i.isLinear()||(i.width=t.offsetWidth,i.height=t.offsetHeight);break;case google.ima.AdEvent.Type.STARTED:this.manager.setVolume(this.player.volume);break;case google.ima.AdEvent.Type.ALL_ADS_COMPLETED:this.player.ended?this.loadAds():this.loader.contentComplete();break;case google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED:this.pauseContent();break;case google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED:this.pollCountdown(),this.resumeContent();break;case google.ima.AdEvent.Type.LOG:s.adError&&this.player.debug.warn(`Non-fatal ad error: ${s.adError.getMessage()}`)}})),e(this,"onAdError",(e=>{this.cancel(),this.player.debug.warn("Ads error",e)})),e(this,"listeners",(()=>{const{container:e}=this.player.elements;let t;this.player.on("canplay",(()=>{this.addCuePoints()})),this.player.on("ended",(()=>{this.loader.contentComplete()})),this.player.on("timeupdate",(()=>{t=this.player.currentTime})),this.player.on("seeked",(()=>{const e=this.player.currentTime;W(this.cuePoints)||this.cuePoints.forEach(((i,s)=>{t<i&&i<e&&(this.manager.discardAdBreak(),this.cuePoints.splice(s,1))}))})),window.addEventListener("resize",(()=>{this.manager&&this.manager.resize(e.offsetWidth,e.offsetHeight,google.ima.ViewMode.NORMAL)}))})),e(this,"play",(()=>{const{container:e}=this.player.elements;this.managerPromise||this.resumeContent(),this.managerPromise.then((()=>{this.manager.setVolume(this.player.volume),this.elements.displayContainer.initialize();try{this.initialized||(this.manager.init(e.offsetWidth,e.offsetHeight,google.ima.ViewMode.NORMAL),this.manager.start()),this.initialized=!0}catch(e){this.onAdError(e)}})).catch((()=>{}))})),e(this,"resumeContent",(()=>{this.elements.container.style.zIndex="",this.playing=!1,ke(this.player.media.play())})),e(this,"pauseContent",(()=>{this.elements.container.style.zIndex=3,this.playing=!0,this.player.media.pause()})),e(this,"cancel",(()=>{this.initialized&&this.resumeContent(),this.trigger("error"),this.loadAds()})),e(this,"loadAds",(()=>{this.managerPromise.then((()=>{this.manager&&this.manager.destroy(),this.managerPromise=new Promise((e=>{this.on("loaded",e),this.player.debug.log(this.manager)})),this.initialized=!1,this.requestAds()})).catch((()=>{}))})),e(this,"trigger",((e,...t)=>{const i=this.events[e];j(i)&&i.forEach((e=>{q(e)&&e.apply(this,t)}))})),e(this,"on",((e,t)=>(j(this.events[e])||(this.events[e]=[]),this.events[e].push(t),this))),e(this,"startSafetyTimer",((e,t)=>{this.player.debug.log(`Safety timer invoked from: ${t}`),this.safetyTimer=setTimeout((()=>{this.cancel(),this.clearSafetyTimer("startSafetyTimer()")}),e)})),e(this,"clearSafetyTimer",(e=>{I(this.safetyTimer)||(this.player.debug.log(`Safety timer cleared from: ${e}`),clearTimeout(this.safetyTimer),this.safetyTimer=null)})),this.player=t,this.config=t.config.ads,this.playing=!1,this.initialized=!1,this.elements={container:null,displayContainer:null},this.manager=null,this.loader=null,this.cuePoints=null,this.events={},this.safetyTimer=null,this.countdownTimer=null,this.managerPromise=new Promise(((e,t)=>{this.on("loaded",e),this.on("error",t)})),this.load()}get enabled(){const{config:e}=this;return this.player.isHTML5&&this.player.isVideo&&e.enabled&&(!W(e.publisherId)||U(e.tagUrl))}get tagUrl(){const{config:e}=this;if(U(e.tagUrl))return e.tagUrl;return`https://go.aniview.com/api/adserver6/vast/?${Be({AV_PUBLISHERID:"58c25bb0073ef448b1087ad6",AV_CHANNELID:"5a0458dc28a06145e4519d21",AV_URL:window.location.hostname,cb:Date.now(),AV_WIDTH:640,AV_HEIGHT:480,AV_CDIM2:e.publisherId})}`}}const dt=e=>{const t=[];return e.split(/\r\n\r\n|\n\n|\r\r/).forEach((e=>{const i={};e.split(/\r\n|\n|\r/).forEach((e=>{if($(i.startTime)){if(!W(e.trim())&&W(i.text)){const t=e.trim().split("#xywh=");[i.text]=t,t[1]&&([i.x,i.y,i.w,i.h]=t[1].split(","))}}else{const t=e.match(/([0-9]{2})?:?([0-9]{2}):([0-9]{2}).([0-9]{2,3})( ?--> ?)([0-9]{2})?:?([0-9]{2}):([0-9]{2}).([0-9]{2,3})/);t&&(i.startTime=60*Number(t[1]||0)*60+60*Number(t[2])+Number(t[3])+Number(`0.${t[4]}`),i.endTime=60*Number(t[6]||0)*60+60*Number(t[7])+Number(t[8])+Number(`0.${t[9]}`))}})),i.text&&t.push(i)})),t},mt=(e,t)=>{const i={};return e>t.width/t.height?(i.width=t.width,i.height=1/e*t.width):(i.height=t.height,i.width=e*t.height),i};class pt{constructor(t){e(this,"load",(()=>{this.player.elements.display.seekTooltip&&(this.player.elements.display.seekTooltip.hidden=this.enabled),this.enabled&&this.getThumbnails().then((()=>{this.enabled&&(this.render(),this.determineContainerAutoSizing(),this.loaded=!0)}))})),e(this,"getThumbnails",(()=>new Promise((e=>{const{src:t}=this.player.config.previewThumbnails;if(W(t))throw new Error("Missing previewThumbnails.src config attribute");const i=()=>{this.thumbnails.sort(((e,t)=>e.height-t.height)),this.player.debug.log("Preview thumbnails",this.thumbnails),e()};if(q(t))t((e=>{this.thumbnails=e,i()}));else{const e=(_(t)?[t]:t).map((e=>this.getThumbnail(e)));Promise.all(e).then(i)}})))),e(this,"getThumbnail",(e=>new Promise((t=>{je(e).then((i=>{const s={frames:dt(i),height:null,urlPrefix:""};s.frames[0].text.startsWith("/")||s.frames[0].text.startsWith("http://")||s.frames[0].text.startsWith("https://")||(s.urlPrefix=e.substring(0,e.lastIndexOf("/")+1));const n=new Image;n.onload=()=>{s.height=n.naturalHeight,s.width=n.naturalWidth,this.thumbnails.push(s),t()},n.src=s.urlPrefix+s.frames[0].text}))})))),e(this,"startMove",(e=>{if(this.loaded&&F(e)&&["touchmove","mousemove"].includes(e.type)&&this.player.media.duration){if("touchmove"===e.type)this.seekTime=this.player.media.duration*(this.player.elements.inputs.seek.value/100);else{const t=this.player.elements.progress.getBoundingClientRect(),i=100/t.width*(e.pageX-t.left);this.seekTime=this.player.media.duration*(i/100),this.seekTime<0&&(this.seekTime=0),this.seekTime>this.player.media.duration-1&&(this.seekTime=this.player.media.duration-1),this.mousePosX=e.pageX,this.elements.thumb.time.innerText=Fe(this.seekTime)}this.showImageAtCurrentTime()}})),e(this,"endMove",(()=>{this.toggleThumbContainer(!1,!0)})),e(this,"startScrubbing",(e=>{(I(e.button)||!1===e.button||0===e.button)&&(this.mouseDown=!0,this.player.media.duration&&(this.toggleScrubbingContainer(!0),this.toggleThumbContainer(!1,!0),this.showImageAtCurrentTime()))})),e(this,"endScrubbing",(()=>{this.mouseDown=!1,Math.ceil(this.lastTime)===Math.ceil(this.player.media.currentTime)?this.toggleScrubbingContainer(!1):ye.call(this.player,this.player.media,"timeupdate",(()=>{this.mouseDown||this.toggleScrubbingContainer(!1)}))})),e(this,"listeners",(()=>{this.player.on("play",(()=>{this.toggleThumbContainer(!1,!0)})),this.player.on("seeked",(()=>{this.toggleThumbContainer(!1)})),this.player.on("timeupdate",(()=>{this.lastTime=this.player.media.currentTime}))})),e(this,"render",(()=>{this.elements.thumb.container=Z("div",{class:this.player.config.classNames.previewThumbnails.thumbContainer}),this.elements.thumb.imageContainer=Z("div",{class:this.player.config.classNames.previewThumbnails.imageContainer}),this.elements.thumb.container.appendChild(this.elements.thumb.imageContainer);const e=Z("div",{class:this.player.config.classNames.previewThumbnails.timeContainer});this.elements.thumb.time=Z("span",{},"00:00"),e.appendChild(this.elements.thumb.time),this.elements.thumb.container.appendChild(e),H(this.player.elements.progress)&&this.player.elements.progress.appendChild(this.elements.thumb.container),this.elements.scrubbing.container=Z("div",{class:this.player.config.classNames.previewThumbnails.scrubbingContainer}),this.player.elements.wrapper.appendChild(this.elements.scrubbing.container)})),e(this,"destroy",(()=>{this.elements.thumb.container&&this.elements.thumb.container.remove(),this.elements.scrubbing.container&&this.elements.scrubbing.container.remove()})),e(this,"showImageAtCurrentTime",(()=>{this.mouseDown?this.setScrubbingContainerSize():this.setThumbContainerSizeAndPos();const e=this.thumbnails[0].frames.findIndex((e=>this.seekTime>=e.startTime&&this.seekTime<=e.endTime)),t=e>=0;let i=0;this.mouseDown||this.toggleThumbContainer(t),t&&(this.thumbnails.forEach(((t,s)=>{this.loadedImages.includes(t.frames[e].text)&&(i=s)})),e!==this.showingThumb&&(this.showingThumb=e,this.loadImage(i)))})),e(this,"loadImage",((e=0)=>{const t=this.showingThumb,i=this.thumbnails[e],{urlPrefix:s}=i,n=i.frames[t],a=i.frames[t].text,l=s+a;if(this.currentImageElement&&this.currentImageElement.dataset.filename===a)this.showImage(this.currentImageElement,n,e,t,a,!1),this.currentImageElement.dataset.index=t,this.removeOldImages(this.currentImageElement);else{this.loadingImage&&this.usingSprites&&(this.loadingImage.onload=null);const i=new Image;i.src=l,i.dataset.index=t,i.dataset.filename=a,this.showingThumbFilename=a,this.player.debug.log(`Loading image: ${l}`),i.onload=()=>this.showImage(i,n,e,t,a,!0),this.loadingImage=i,this.removeOldImages(i)}})),e(this,"showImage",((e,t,i,s,n,a=!0)=>{this.player.debug.log(`Showing thumb: ${n}. num: ${s}. qual: ${i}. newimg: ${a}`),this.setImageSizeAndOffset(e,t),a&&(this.currentImageContainer.appendChild(e),this.currentImageElement=e,this.loadedImages.includes(n)||this.loadedImages.push(n)),this.preloadNearby(s,!0).then(this.preloadNearby(s,!1)).then(this.getHigherQuality(i,e,t,n))})),e(this,"removeOldImages",(e=>{Array.from(this.currentImageContainer.children).forEach((t=>{if("img"!==t.tagName.toLowerCase())return;const i=this.usingSprites?500:1e3;if(t.dataset.index!==e.dataset.index&&!t.dataset.deleting){t.dataset.deleting=!0;const{currentImageContainer:e}=this;setTimeout((()=>{e.removeChild(t),this.player.debug.log(`Removing thumb: ${t.dataset.filename}`)}),i)}}))})),e(this,"preloadNearby",((e,t=!0)=>new Promise((i=>{setTimeout((()=>{const s=this.thumbnails[0].frames[e].text;if(this.showingThumbFilename===s){let n;n=t?this.thumbnails[0].frames.slice(e):this.thumbnails[0].frames.slice(0,e).reverse();let a=!1;n.forEach((e=>{const t=e.text;if(t!==s&&!this.loadedImages.includes(t)){a=!0,this.player.debug.log(`Preloading thumb filename: ${t}`);const{urlPrefix:e}=this.thumbnails[0],s=e+t,n=new Image;n.src=s,n.onload=()=>{this.player.debug.log(`Preloaded thumb filename: ${t}`),this.loadedImages.includes(t)||this.loadedImages.push(t),i()}}})),a||i()}}),300)})))),e(this,"getHigherQuality",((e,t,i,s)=>{if(e<this.thumbnails.length-1){let n=t.naturalHeight;this.usingSprites&&(n=i.h),n<this.thumbContainerHeight&&setTimeout((()=>{this.showingThumbFilename===s&&(this.player.debug.log(`Showing higher quality thumb for: ${s}`),this.loadImage(e+1))}),300)}})),e(this,"toggleThumbContainer",((e=!1,t=!1)=>{const i=this.player.config.classNames.previewThumbnails.thumbContainerShown;this.elements.thumb.container.classList.toggle(i,e),!e&&t&&(this.showingThumb=null,this.showingThumbFilename=null)})),e(this,"toggleScrubbingContainer",((e=!1)=>{const t=this.player.config.classNames.previewThumbnails.scrubbingContainerShown;this.elements.scrubbing.container.classList.toggle(t,e),e||(this.showingThumb=null,this.showingThumbFilename=null)})),e(this,"determineContainerAutoSizing",(()=>{(this.elements.thumb.imageContainer.clientHeight>20||this.elements.thumb.imageContainer.clientWidth>20)&&(this.sizeSpecifiedInCSS=!0)})),e(this,"setThumbContainerSizeAndPos",(()=>{if(this.sizeSpecifiedInCSS){if(this.elements.thumb.imageContainer.clientHeight>20&&this.elements.thumb.imageContainer.clientWidth<20){const e=Math.floor(this.elements.thumb.imageContainer.clientHeight*this.thumbAspectRatio);this.elements.thumb.imageContainer.style.width=`${e}px`}else if(this.elements.thumb.imageContainer.clientHeight<20&&this.elements.thumb.imageContainer.clientWidth>20){const e=Math.floor(this.elements.thumb.imageContainer.clientWidth/this.thumbAspectRatio);this.elements.thumb.imageContainer.style.height=`${e}px`}}else{const e=Math.floor(this.thumbContainerHeight*this.thumbAspectRatio);this.elements.thumb.imageContainer.style.height=`${this.thumbContainerHeight}px`,this.elements.thumb.imageContainer.style.width=`${e}px`}this.setThumbContainerPos()})),e(this,"setThumbContainerPos",(()=>{const e=this.player.elements.progress.getBoundingClientRect(),t=this.player.elements.container.getBoundingClientRect(),{container:i}=this.elements.thumb,s=t.left-e.left+10,n=t.right-e.left-i.clientWidth-10;let a=this.mousePosX-e.left-i.clientWidth/2;a<s&&(a=s),a>n&&(a=n),i.style.left=`${a}px`})),e(this,"setScrubbingContainerSize",(()=>{const{width:e,height:t}=mt(this.thumbAspectRatio,{width:this.player.media.clientWidth,height:this.player.media.clientHeight});this.elements.scrubbing.container.style.width=`${e}px`,this.elements.scrubbing.container.style.height=`${t}px`})),e(this,"setImageSizeAndOffset",((e,t)=>{if(!this.usingSprites)return;const i=this.thumbContainerHeight/t.h;e.style.height=e.naturalHeight*i+"px",e.style.width=e.naturalWidth*i+"px",e.style.left=`-${t.x*i}px`,e.style.top=`-${t.y*i}px`})),this.player=t,this.thumbnails=[],this.loaded=!1,this.lastMouseMoveTime=Date.now(),this.mouseDown=!1,this.loadedImages=[],this.elements={thumb:{},scrubbing:{}},this.load()}get enabled(){return this.player.isHTML5&&this.player.isVideo&&this.player.config.previewThumbnails.enabled}get currentImageContainer(){return this.mouseDown?this.elements.scrubbing.container:this.elements.thumb.imageContainer}get usingSprites(){return Object.keys(this.thumbnails[0].frames[0]).includes("w")}get thumbAspectRatio(){return this.usingSprites?this.thumbnails[0].frames[0].w/this.thumbnails[0].frames[0].h:this.thumbnails[0].width/this.thumbnails[0].height}get thumbContainerHeight(){if(this.mouseDown){const{height:e}=mt(this.thumbAspectRatio,{width:this.player.media.clientWidth,height:this.player.media.clientHeight});return e}return this.sizeSpecifiedInCSS?this.elements.thumb.imageContainer.clientHeight:Math.floor(this.player.media.clientWidth/this.thumbAspectRatio/4)}get currentImageElement(){return this.mouseDown?this.currentScrubbingImageElement:this.currentThumbnailImageElement}set currentImageElement(e){this.mouseDown?this.currentScrubbingImageElement=e:this.currentThumbnailImageElement=e}}const gt={insertElements(e,t){_(t)?ee(e,this.media,{src:t}):j(t)&&t.forEach((t=>{ee(e,this.media,t)}))},change(e){Q(e,"sources.length")?(Pe.cancelRequests.call(this),this.destroy.call(this,(()=>{this.options.quality=[],te(this.media),this.media=null,H(this.elements.container)&&this.elements.container.removeAttribute("class");const{sources:t,type:i}=e,[{provider:s=Ye.html5,src:n}]=t,a="html5"===s?i:"div",l="html5"===s?{}:{src:n};Object.assign(this,{provider:s,type:i,supported:me.check(i,s,this.config.playsinline),media:Z(a,l)}),this.elements.container.appendChild(this.media),O(e.autoplay)&&(this.config.autoplay=e.autoplay),this.isHTML5&&(this.config.crossorigin&&this.media.setAttribute("crossorigin",""),this.config.autoplay&&this.media.setAttribute("autoplay",""),W(e.poster)||(this.poster=e.poster),this.config.loop.active&&this.media.setAttribute("loop",""),this.config.muted&&this.media.setAttribute("muted",""),this.config.playsinline&&this.media.setAttribute("playsinline","")),tt.addStyleHook.call(this),this.isHTML5&&gt.insertElements.call(this,"source",t),this.config.title=e.title,ht.setup.call(this),this.isHTML5&&Object.keys(e).includes("tracks")&&gt.insertElements.call(this,"track",e.tracks),(this.isHTML5||this.isEmbed&&!this.supported.ui)&&tt.build.call(this),this.isHTML5&&this.media.load(),W(e.previewThumbnails)||(Object.assign(this.config.previewThumbnails,e.previewThumbnails),this.previewThumbnails&&this.previewThumbnails.loaded&&(this.previewThumbnails.destroy(),this.previewThumbnails=null),this.config.previewThumbnails.enabled&&(this.previewThumbnails=new pt(this))),this.fullscreen.update()}),!0)):this.debug.warn("Invalid source format")}};class ft{constructor(t,i){if(e(this,"play",(()=>q(this.media.play)?(this.ads&&this.ads.enabled&&this.ads.managerPromise.then((()=>this.ads.play())).catch((()=>ke(this.media.play()))),this.media.play()):null)),e(this,"pause",(()=>this.playing&&q(this.media.pause)?this.media.pause():null)),e(this,"togglePlay",(e=>(O(e)?e:!this.playing)?this.play():this.pause())),e(this,"stop",(()=>{this.isHTML5?(this.pause(),this.restart()):q(this.media.stop)&&this.media.stop()})),e(this,"restart",(()=>{this.currentTime=0})),e(this,"rewind",(e=>{this.currentTime-=$(e)?e:this.config.seekTime})),e(this,"forward",(e=>{this.currentTime+=$(e)?e:this.config.seekTime})),e(this,"increaseVolume",(e=>{const t=this.media.muted?0:this.volume;this.volume=t+($(e)?e:0)})),e(this,"decreaseVolume",(e=>{this.increaseVolume(-e)})),e(this,"airplay",(()=>{me.airplay&&this.media.webkitShowPlaybackTargetPicker()})),e(this,"toggleControls",(e=>{if(this.supported.ui&&!this.isAudio){const t=oe(this.elements.container,this.config.classNames.hideControls),i=void 0===e?void 0:!e,s=le(this.elements.container,this.config.classNames.hideControls,i);if(s&&j(this.config.controls)&&this.config.controls.includes("settings")&&!W(this.config.settings)&&Re.toggleMenu.call(this,!1),s!==t){const e=s?"controlshidden":"controlsshown";ve.call(this,this.media,e)}return!s}return!1})),e(this,"on",((e,t)=>{fe.call(this,this.elements.container,e,t)})),e(this,"once",((e,t)=>{ye.call(this,this.elements.container,e,t)})),e(this,"off",((e,t)=>{be(this.elements.container,e,t)})),e(this,"destroy",((e,t=!1)=>{if(!this.ready)return;const i=()=>{document.body.style.overflow="",this.embed=null,t?(Object.keys(this.elements).length&&(te(this.elements.buttons.play),te(this.elements.captions),te(this.elements.controls),te(this.elements.wrapper),this.elements.buttons.play=null,this.elements.captions=null,this.elements.controls=null,this.elements.wrapper=null),q(e)&&e()):(we.call(this),Pe.cancelRequests.call(this),se(this.elements.original,this.elements.container),ve.call(this,this.elements.original,"destroyed",!0),q(e)&&e.call(this.elements.original),this.ready=!1,setTimeout((()=>{this.elements=null,this.media=null}),200))};this.stop(),clearTimeout(this.timers.loading),clearTimeout(this.timers.controls),clearTimeout(this.timers.resized),this.isHTML5?(tt.toggleNativeControls.call(this,!0),i()):this.isYouTube?(clearInterval(this.timers.buffering),clearInterval(this.timers.playing),null!==this.embed&&q(this.embed.destroy)&&this.embed.destroy(),i()):this.isVimeo&&(null!==this.embed&&this.embed.unload().then(i),setTimeout(i,200))})),e(this,"supports",(e=>me.mime.call(this,e))),this.timers={},this.ready=!1,this.loading=!1,this.failed=!1,this.touch=me.touch,this.media=t,_(this.media)&&(this.media=document.querySelectorAll(this.media)),(window.jQuery&&this.media instanceof jQuery||D(this.media)||j(this.media))&&(this.media=this.media[0]),this.config=X({},We,ft.defaults,i||{},(()=>{try{return JSON.parse(this.media.getAttribute("data-plyr-config"))}catch(e){return{}}})()),this.elements={container:null,fullscreen:null,captions:null,buttons:{},display:{},progress:{},inputs:{},settings:{popup:null,menu:null,panels:{},buttons:{}}},this.captions={active:null,currentTrack:-1,meta:new WeakMap},this.fullscreen={active:!1},this.options={speed:[],quality:[]},this.debug=new Ge(this.config.debug),this.debug.log("Config",this.config),this.debug.log("Support",me),I(this.media)||!H(this.media))return void this.debug.error("Setup failed: no suitable element passed");if(this.media.plyr)return void this.debug.warn("Target already setup");if(!this.config.enabled)return void this.debug.error("Setup failed: disabled by config");if(!me.check().api)return void this.debug.error("Setup failed: no support");const s=this.media.cloneNode(!0);s.autoplay=!1,this.elements.original=s;const n=this.media.tagName.toLowerCase();let a=null,l=null;switch(n){case"div":if(a=this.media.querySelector("iframe"),H(a)){if(l=Ve(a.getAttribute("src")),this.provider=function(e){return/^(https?:\/\/)?(www\.)?(youtube\.com|youtube-nocookie\.com|youtu\.?be)\/.+$/.test(e)?Ye.youtube:/^https?:\/\/player.vimeo.com\/video\/\d{0,9}(?=\b|\/)/.test(e)?Ye.vimeo:null}(l.toString()),this.elements.container=this.media,this.media=a,this.elements.container.className="",l.search.length){const e=["1","true"];e.includes(l.searchParams.get("autoplay"))&&(this.config.autoplay=!0),e.includes(l.searchParams.get("loop"))&&(this.config.loop.active=!0),this.isYouTube?(this.config.playsinline=e.includes(l.searchParams.get("playsinline")),this.config.youtube.hl=l.searchParams.get("hl")):this.config.playsinline=!0}}else this.provider=this.media.getAttribute(this.config.attributes.embed.provider),this.media.removeAttribute(this.config.attributes.embed.provider);if(W(this.provider)||!Object.values(Ye).includes(this.provider))return void this.debug.error("Setup failed: Invalid provider");this.type=Xe;break;case"video":case"audio":this.type=n,this.provider=Ye.html5,this.media.hasAttribute("crossorigin")&&(this.config.crossorigin=!0),this.media.hasAttribute("autoplay")&&(this.config.autoplay=!0),(this.media.hasAttribute("playsinline")||this.media.hasAttribute("webkit-playsinline"))&&(this.config.playsinline=!0),this.media.hasAttribute("muted")&&(this.config.muted=!0),this.media.hasAttribute("loop")&&(this.config.loop.active=!0);break;default:return void this.debug.error("Setup failed: unsupported type")}this.supported=me.check(this.type,this.provider,this.config.playsinline),this.supported.api?(this.eventListeners=[],this.listeners=new it(this),this.storage=new qe(this),this.media.plyr=this,H(this.elements.container)||(this.elements.container=Z("div",{tabindex:0}),J(this.media,this.elements.container)),tt.migrateStyles.call(this),tt.addStyleHook.call(this),ht.setup.call(this),this.config.debug&&fe.call(this,this.elements.container,this.config.events.join(" "),(e=>{this.debug.log(`event: ${e.type}`)})),this.fullscreen=new Ze(this),(this.isHTML5||this.isEmbed&&!this.supported.ui)&&tt.build.call(this),this.listeners.container(),this.listeners.global(),this.config.ads.enabled&&(this.ads=new ut(this)),this.isHTML5&&this.config.autoplay&&this.once("canplay",(()=>ke(this.play()))),this.lastSeekTime=0,this.config.previewThumbnails.enabled&&(this.previewThumbnails=new pt(this))):this.debug.error("Setup failed: no support")}get isHTML5(){return this.provider===Ye.html5}get isEmbed(){return this.isYouTube||this.isVimeo}get isYouTube(){return this.provider===Ye.youtube}get isVimeo(){return this.provider===Ye.vimeo}get isVideo(){return this.type===Xe}get isAudio(){return this.type===Qe}get playing(){return Boolean(this.ready&&!this.paused&&!this.ended)}get paused(){return Boolean(this.media.paused)}get stopped(){return Boolean(this.paused&&0===this.currentTime)}get ended(){return Boolean(this.media.ended)}set currentTime(e){if(!this.duration)return;const t=$(e)&&e>0;this.media.currentTime=t?Math.min(e,this.duration):0,this.debug.log(`Seeking to ${this.currentTime} seconds`)}get currentTime(){return Number(this.media.currentTime)}get buffered(){const{buffered:e}=this.media;return $(e)?e:e&&e.length&&this.duration>0?e.end(0)/this.duration:0}get seeking(){return Boolean(this.media.seeking)}get duration(){const e=parseFloat(this.config.duration),t=(this.media||{}).duration,i=$(t)&&t!==1/0?t:0;return e||i}set volume(e){let t=e;_(t)&&(t=Number(t)),$(t)||(t=this.storage.get("volume")),$(t)||({volume:t}=this.config),t>1&&(t=1),t<0&&(t=0),this.config.volume=t,this.media.volume=t,!W(e)&&this.muted&&t>0&&(this.muted=!1)}get volume(){return Number(this.media.volume)}set muted(e){let t=e;O(t)||(t=this.storage.get("muted")),O(t)||(t=this.config.muted),this.config.muted=t,this.media.muted=t}get muted(){return Boolean(this.media.muted)}get hasAudio(){return!this.isHTML5||(!!this.isAudio||(Boolean(this.media.mozHasAudio)||Boolean(this.media.webkitAudioDecodedByteCount)||Boolean(this.media.audioTracks&&this.media.audioTracks.length)))}set speed(e){let t=null;$(e)&&(t=e),$(t)||(t=this.storage.get("speed")),$(t)||(t=this.config.speed.selected);const{minimumSpeed:i,maximumSpeed:s}=this;t=function(e=0,t=0,i=255){return Math.min(Math.max(e,t),i)}(t,i,s),this.config.speed.selected=t,setTimeout((()=>{this.media.playbackRate=t}),0)}get speed(){return Number(this.media.playbackRate)}get minimumSpeed(){return this.isYouTube?Math.min(...this.options.speed):this.isVimeo?.5:.0625}get maximumSpeed(){return this.isYouTube?Math.max(...this.options.speed):this.isVimeo?2:16}set quality(e){const t=this.config.quality,i=this.options.quality;if(!i.length)return;let s=[!W(e)&&Number(e),this.storage.get("quality"),t.selected,t.default].find($),n=!0;if(!i.includes(s)){const e=function(e,t){return j(e)&&e.length?e.reduce(((e,i)=>Math.abs(i-t)<Math.abs(e-t)?i:e)):null}(i,s);this.debug.warn(`Unsupported quality option: ${s}, using ${e} instead`),s=e,n=!1}t.selected=s,this.media.quality=s,n&&this.storage.set({quality:s})}get quality(){return this.media.quality}set loop(e){const t=O(e)?e:this.config.loop.active;this.config.loop.active=t,this.media.loop=t}get loop(){return Boolean(this.media.loop)}set source(e){gt.change.call(this,e)}get source(){return this.media.currentSrc}get download(){const{download:e}=this.config.urls;return U(e)?e:this.source}set download(e){U(e)&&(this.config.urls.download=e,Re.setDownloadUrl.call(this))}set poster(e){this.isVideo?tt.setPoster.call(this,e,!1).catch((()=>{})):this.debug.warn("Poster can only be set for video")}get poster(){return this.isVideo?this.media.getAttribute("poster")||this.media.getAttribute("data-poster"):null}get ratio(){if(!this.isVideo)return null;const e=Ae(Se.call(this));return j(e)?e.join(":"):e}set ratio(e){this.isVideo?_(e)&&Ce(e)?(this.config.ratio=e,Ee.call(this)):this.debug.error(`Invalid aspect ratio specified (${e})`):this.debug.warn("Aspect ratio can only be set for video")}set autoplay(e){const t=O(e)?e:this.config.autoplay;this.config.autoplay=t}get autoplay(){return Boolean(this.config.autoplay)}toggleCaptions(e){Ue.toggle.call(this,e,!1)}set currentTrack(e){Ue.set.call(this,e,!1)}get currentTrack(){const{toggled:e,currentTrack:t}=this.captions;return e?t:-1}set language(e){Ue.setLanguage.call(this,e,!1)}get language(){return(Ue.getCurrentTrack.call(this)||{}).language}set pip(e){if(!me.pip)return;const t=O(e)?e:!this.pip;q(this.media.webkitSetPresentationMode)&&this.media.webkitSetPresentationMode(t?ze:Ke),q(this.media.requestPictureInPicture)&&(!this.pip&&t?this.media.requestPictureInPicture():this.pip&&!t&&document.exitPictureInPicture())}get pip(){return me.pip?W(this.media.webkitPresentationMode)?this.media===document.pictureInPictureElement:this.media.webkitPresentationMode===ze:null}static supported(e,t,i){return me.check(e,t,i)}static loadSprite(e,t){return De(e,t)}static setup(e,t={}){let i=null;return _(e)?i=Array.from(document.querySelectorAll(e)):D(e)?i=Array.from(e):j(e)&&(i=e.filter(H)),W(i)?null:i.map((e=>new ft(e,t)))}}var bt;return ft.defaults=(bt=We,JSON.parse(JSON.stringify(bt))),ft}));
 
assets/packages/plyr/plyr.polyfilled.min.js CHANGED
@@ -1,3 +1,3 @@
1
- "object"==typeof navigator&&function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define("Plyr",t):(e=e||self).Plyr=t()}(this,(function(){"use strict";!function(){if("undefined"!=typeof window)try{var e=new window.CustomEvent("test",{cancelable:!0});if(e.preventDefault(),!0!==e.defaultPrevented)throw new Error("Could not prevent default")}catch(e){var t=function(e,t){var n,i;return(t=t||{}).bubbles=!!t.bubbles,t.cancelable=!!t.cancelable,(n=document.createEvent("CustomEvent")).initCustomEvent(e,t.bubbles,t.cancelable,t.detail),i=n.preventDefault,n.preventDefault=function(){i.call(this);try{Object.defineProperty(this,"defaultPrevented",{get:function(){return!0}})}catch(e){this.defaultPrevented=!0}},n};t.prototype=window.Event.prototype,window.CustomEvent=t}}();var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function t(e,t){return e(t={exports:{}},t.exports),t.exports}var n=function(e){return e&&e.Math==Math&&e},i=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof e&&e)||Function("return this")(),r=function(e){try{return!!e()}catch(e){return!0}},a=!r((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),o={}.propertyIsEnumerable,s=Object.getOwnPropertyDescriptor,l={f:s&&!o.call({1:2},1)?function(e){var t=s(this,e);return!!t&&t.enumerable}:o},c=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},u={}.toString,h=function(e){return u.call(e).slice(8,-1)},f="".split,d=r((function(){return!Object("z").propertyIsEnumerable(0)}))?function(e){return"String"==h(e)?f.call(e,""):Object(e)}:Object,p=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e},m=function(e){return d(p(e))},g=function(e){return"object"==typeof e?null!==e:"function"==typeof e},v=function(e,t){if(!g(e))return e;var n,i;if(t&&"function"==typeof(n=e.toString)&&!g(i=n.call(e)))return i;if("function"==typeof(n=e.valueOf)&&!g(i=n.call(e)))return i;if(!t&&"function"==typeof(n=e.toString)&&!g(i=n.call(e)))return i;throw TypeError("Can't convert object to primitive value")},y={}.hasOwnProperty,b=function(e,t){return y.call(e,t)},w=i.document,k=g(w)&&g(w.createElement),T=function(e){return k?w.createElement(e):{}},S=!a&&!r((function(){return 7!=Object.defineProperty(T("div"),"a",{get:function(){return 7}}).a})),E=Object.getOwnPropertyDescriptor,A={f:a?E:function(e,t){if(e=m(e),t=v(t,!0),S)try{return E(e,t)}catch(e){}if(b(e,t))return c(!l.f.call(e,t),e[t])}},P=function(e){if(!g(e))throw TypeError(String(e)+" is not an object");return e},x=Object.defineProperty,C={f:a?x:function(e,t,n){if(P(e),t=v(t,!0),P(n),S)try{return x(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(e[t]=n.value),e}},O=a?function(e,t,n){return C.f(e,t,c(1,n))}:function(e,t,n){return e[t]=n,e},I=function(e,t){try{O(i,e,t)}catch(n){i[e]=t}return t},L=i["__core-js_shared__"]||I("__core-js_shared__",{}),j=Function.toString;"function"!=typeof L.inspectSource&&(L.inspectSource=function(e){return j.call(e)});var N,R,M,_=L.inspectSource,U=i.WeakMap,D="function"==typeof U&&/native code/.test(_(U)),F=t((function(e){(e.exports=function(e,t){return L[e]||(L[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.6.5",mode:"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})})),q=0,H=Math.random(),B=function(e){return"Symbol("+String(void 0===e?"":e)+")_"+(++q+H).toString(36)},V=F("keys"),z=function(e){return V[e]||(V[e]=B(e))},W={},K=i.WeakMap;if(D){var $=new K,Y=$.get,G=$.has,X=$.set;N=function(e,t){return X.call($,e,t),t},R=function(e){return Y.call($,e)||{}},M=function(e){return G.call($,e)}}else{var Q=z("state");W[Q]=!0,N=function(e,t){return O(e,Q,t),t},R=function(e){return b(e,Q)?e[Q]:{}},M=function(e){return b(e,Q)}}var J,Z={set:N,get:R,has:M,enforce:function(e){return M(e)?R(e):N(e,{})},getterFor:function(e){return function(t){var n;if(!g(t)||(n=R(t)).type!==e)throw TypeError("Incompatible receiver, "+e+" required");return n}}},ee=t((function(e){var t=Z.get,n=Z.enforce,r=String(String).split("String");(e.exports=function(e,t,a,o){var s=!!o&&!!o.unsafe,l=!!o&&!!o.enumerable,c=!!o&&!!o.noTargetGet;"function"==typeof a&&("string"!=typeof t||b(a,"name")||O(a,"name",t),n(a).source=r.join("string"==typeof t?t:"")),e!==i?(s?!c&&e[t]&&(l=!0):delete e[t],l?e[t]=a:O(e,t,a)):l?e[t]=a:I(t,a)})(Function.prototype,"toString",(function(){return"function"==typeof this&&t(this).source||_(this)}))})),te=i,ne=function(e){return"function"==typeof e?e:void 0},ie=function(e,t){return arguments.length<2?ne(te[e])||ne(i[e]):te[e]&&te[e][t]||i[e]&&i[e][t]},re=Math.ceil,ae=Math.floor,oe=function(e){return isNaN(e=+e)?0:(e>0?ae:re)(e)},se=Math.min,le=function(e){return e>0?se(oe(e),9007199254740991):0},ce=Math.max,ue=Math.min,he=function(e,t){var n=oe(e);return n<0?ce(n+t,0):ue(n,t)},fe=function(e){return function(t,n,i){var r,a=m(t),o=le(a.length),s=he(i,o);if(e&&n!=n){for(;o>s;)if((r=a[s++])!=r)return!0}else for(;o>s;s++)if((e||s in a)&&a[s]===n)return e||s||0;return!e&&-1}},de={includes:fe(!0),indexOf:fe(!1)},pe=de.indexOf,me=function(e,t){var n,i=m(e),r=0,a=[];for(n in i)!b(W,n)&&b(i,n)&&a.push(n);for(;t.length>r;)b(i,n=t[r++])&&(~pe(a,n)||a.push(n));return a},ge=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],ve=ge.concat("length","prototype"),ye={f:Object.getOwnPropertyNames||function(e){return me(e,ve)}},be={f:Object.getOwnPropertySymbols},we=ie("Reflect","ownKeys")||function(e){var t=ye.f(P(e)),n=be.f;return n?t.concat(n(e)):t},ke=function(e,t){for(var n=we(t),i=C.f,r=A.f,a=0;a<n.length;a++){var o=n[a];b(e,o)||i(e,o,r(t,o))}},Te=/#|\.prototype\./,Se=function(e,t){var n=Ae[Ee(e)];return n==xe||n!=Pe&&("function"==typeof t?r(t):!!t)},Ee=Se.normalize=function(e){return String(e).replace(Te,".").toLowerCase()},Ae=Se.data={},Pe=Se.NATIVE="N",xe=Se.POLYFILL="P",Ce=Se,Oe=A.f,Ie=function(e,t){var n,r,a,o,s,l=e.target,c=e.global,u=e.stat;if(n=c?i:u?i[l]||I(l,{}):(i[l]||{}).prototype)for(r in t){if(o=t[r],a=e.noTargetGet?(s=Oe(n,r))&&s.value:n[r],!Ce(c?r:l+(u?".":"#")+r,e.forced)&&void 0!==a){if(typeof o==typeof a)continue;ke(o,a)}(e.sham||a&&a.sham)&&O(o,"sham",!0),ee(n,r,o,e)}},Le=!!Object.getOwnPropertySymbols&&!r((function(){return!String(Symbol())})),je=Le&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,Ne=Array.isArray||function(e){return"Array"==h(e)},Re=function(e){return Object(p(e))},Me=Object.keys||function(e){return me(e,ge)},_e=a?Object.defineProperties:function(e,t){P(e);for(var n,i=Me(t),r=i.length,a=0;r>a;)C.f(e,n=i[a++],t[n]);return e},Ue=ie("document","documentElement"),De=z("IE_PROTO"),Fe=function(){},qe=function(e){return"<script>"+e+"<\/script>"},He=function(){try{J=document.domain&&new ActiveXObject("htmlfile")}catch(e){}var e,t;He=J?function(e){e.write(qe("")),e.close();var t=e.parentWindow.Object;return e=null,t}(J):((t=T("iframe")).style.display="none",Ue.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(qe("document.F=Object")),e.close(),e.F);for(var n=ge.length;n--;)delete He.prototype[ge[n]];return He()};W[De]=!0;var Be=Object.create||function(e,t){var n;return null!==e?(Fe.prototype=P(e),n=new Fe,Fe.prototype=null,n[De]=e):n=He(),void 0===t?n:_e(n,t)},Ve=ye.f,ze={}.toString,We="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],Ke={f:function(e){return We&&"[object Window]"==ze.call(e)?function(e){try{return Ve(e)}catch(e){return We.slice()}}(e):Ve(m(e))}},$e=F("wks"),Ye=i.Symbol,Ge=je?Ye:Ye&&Ye.withoutSetter||B,Xe=function(e){return b($e,e)||(Le&&b(Ye,e)?$e[e]=Ye[e]:$e[e]=Ge("Symbol."+e)),$e[e]},Qe={f:Xe},Je=C.f,Ze=function(e){var t=te.Symbol||(te.Symbol={});b(t,e)||Je(t,e,{value:Qe.f(e)})},et=C.f,tt=Xe("toStringTag"),nt=function(e,t,n){e&&!b(e=n?e:e.prototype,tt)&&et(e,tt,{configurable:!0,value:t})},it=function(e){if("function"!=typeof e)throw TypeError(String(e)+" is not a function");return e},rt=function(e,t,n){if(it(e),void 0===t)return e;switch(n){case 0:return function(){return e.call(t)};case 1:return function(n){return e.call(t,n)};case 2:return function(n,i){return e.call(t,n,i)};case 3:return function(n,i,r){return e.call(t,n,i,r)}}return function(){return e.apply(t,arguments)}},at=Xe("species"),ot=function(e,t){var n;return Ne(e)&&("function"!=typeof(n=e.constructor)||n!==Array&&!Ne(n.prototype)?g(n)&&null===(n=n[at])&&(n=void 0):n=void 0),new(void 0===n?Array:n)(0===t?0:t)},st=[].push,lt=function(e){var t=1==e,n=2==e,i=3==e,r=4==e,a=6==e,o=5==e||a;return function(s,l,c,u){for(var h,f,p=Re(s),m=d(p),g=rt(l,c,3),v=le(m.length),y=0,b=u||ot,w=t?b(s,v):n?b(s,0):void 0;v>y;y++)if((o||y in m)&&(f=g(h=m[y],y,p),e))if(t)w[y]=f;else if(f)switch(e){case 3:return!0;case 5:return h;case 6:return y;case 2:st.call(w,h)}else if(r)return!1;return a?-1:i||r?r:w}},ct={forEach:lt(0),map:lt(1),filter:lt(2),some:lt(3),every:lt(4),find:lt(5),findIndex:lt(6)},ut=ct.forEach,ht=z("hidden"),ft=Xe("toPrimitive"),dt=Z.set,pt=Z.getterFor("Symbol"),mt=Object.prototype,gt=i.Symbol,vt=ie("JSON","stringify"),yt=A.f,bt=C.f,wt=Ke.f,kt=l.f,Tt=F("symbols"),St=F("op-symbols"),Et=F("string-to-symbol-registry"),At=F("symbol-to-string-registry"),Pt=F("wks"),xt=i.QObject,Ct=!xt||!xt.prototype||!xt.prototype.findChild,Ot=a&&r((function(){return 7!=Be(bt({},"a",{get:function(){return bt(this,"a",{value:7}).a}})).a}))?function(e,t,n){var i=yt(mt,t);i&&delete mt[t],bt(e,t,n),i&&e!==mt&&bt(mt,t,i)}:bt,It=function(e,t){var n=Tt[e]=Be(gt.prototype);return dt(n,{type:"Symbol",tag:e,description:t}),a||(n.description=t),n},Lt=je?function(e){return"symbol"==typeof e}:function(e){return Object(e)instanceof gt},jt=function(e,t,n){e===mt&&jt(St,t,n),P(e);var i=v(t,!0);return P(n),b(Tt,i)?(n.enumerable?(b(e,ht)&&e[ht][i]&&(e[ht][i]=!1),n=Be(n,{enumerable:c(0,!1)})):(b(e,ht)||bt(e,ht,c(1,{})),e[ht][i]=!0),Ot(e,i,n)):bt(e,i,n)},Nt=function(e,t){P(e);var n=m(t),i=Me(n).concat(Ut(n));return ut(i,(function(t){a&&!Rt.call(n,t)||jt(e,t,n[t])})),e},Rt=function(e){var t=v(e,!0),n=kt.call(this,t);return!(this===mt&&b(Tt,t)&&!b(St,t))&&(!(n||!b(this,t)||!b(Tt,t)||b(this,ht)&&this[ht][t])||n)},Mt=function(e,t){var n=m(e),i=v(t,!0);if(n!==mt||!b(Tt,i)||b(St,i)){var r=yt(n,i);return!r||!b(Tt,i)||b(n,ht)&&n[ht][i]||(r.enumerable=!0),r}},_t=function(e){var t=wt(m(e)),n=[];return ut(t,(function(e){b(Tt,e)||b(W,e)||n.push(e)})),n},Ut=function(e){var t=e===mt,n=wt(t?St:m(e)),i=[];return ut(n,(function(e){!b(Tt,e)||t&&!b(mt,e)||i.push(Tt[e])})),i};if(Le||(ee((gt=function(){if(this instanceof gt)throw TypeError("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?String(arguments[0]):void 0,t=B(e),n=function(e){this===mt&&n.call(St,e),b(this,ht)&&b(this[ht],t)&&(this[ht][t]=!1),Ot(this,t,c(1,e))};return a&&Ct&&Ot(mt,t,{configurable:!0,set:n}),It(t,e)}).prototype,"toString",(function(){return pt(this).tag})),ee(gt,"withoutSetter",(function(e){return It(B(e),e)})),l.f=Rt,C.f=jt,A.f=Mt,ye.f=Ke.f=_t,be.f=Ut,Qe.f=function(e){return It(Xe(e),e)},a&&(bt(gt.prototype,"description",{configurable:!0,get:function(){return pt(this).description}}),ee(mt,"propertyIsEnumerable",Rt,{unsafe:!0}))),Ie({global:!0,wrap:!0,forced:!Le,sham:!Le},{Symbol:gt}),ut(Me(Pt),(function(e){Ze(e)})),Ie({target:"Symbol",stat:!0,forced:!Le},{for:function(e){var t=String(e);if(b(Et,t))return Et[t];var n=gt(t);return Et[t]=n,At[n]=t,n},keyFor:function(e){if(!Lt(e))throw TypeError(e+" is not a symbol");if(b(At,e))return At[e]},useSetter:function(){Ct=!0},useSimple:function(){Ct=!1}}),Ie({target:"Object",stat:!0,forced:!Le,sham:!a},{create:function(e,t){return void 0===t?Be(e):Nt(Be(e),t)},defineProperty:jt,defineProperties:Nt,getOwnPropertyDescriptor:Mt}),Ie({target:"Object",stat:!0,forced:!Le},{getOwnPropertyNames:_t,getOwnPropertySymbols:Ut}),Ie({target:"Object",stat:!0,forced:r((function(){be.f(1)}))},{getOwnPropertySymbols:function(e){return be.f(Re(e))}}),vt){var Dt=!Le||r((function(){var e=gt();return"[null]"!=vt([e])||"{}"!=vt({a:e})||"{}"!=vt(Object(e))}));Ie({target:"JSON",stat:!0,forced:Dt},{stringify:function(e,t,n){for(var i,r=[e],a=1;arguments.length>a;)r.push(arguments[a++]);if(i=t,(g(t)||void 0!==e)&&!Lt(e))return Ne(t)||(t=function(e,t){if("function"==typeof i&&(t=i.call(this,e,t)),!Lt(t))return t}),r[1]=t,vt.apply(null,r)}})}gt.prototype[ft]||O(gt.prototype,ft,gt.prototype.valueOf),nt(gt,"Symbol"),W[ht]=!0;var Ft=C.f,qt=i.Symbol;if(a&&"function"==typeof qt&&(!("description"in qt.prototype)||void 0!==qt().description)){var Ht={},Bt=function(){var e=arguments.length<1||void 0===arguments[0]?void 0:String(arguments[0]),t=this instanceof Bt?new qt(e):void 0===e?qt():qt(e);return""===e&&(Ht[t]=!0),t};ke(Bt,qt);var Vt=Bt.prototype=qt.prototype;Vt.constructor=Bt;var zt=Vt.toString,Wt="Symbol(test)"==String(qt("test")),Kt=/^Symbol\((.*)\)[^)]+$/;Ft(Vt,"description",{configurable:!0,get:function(){var e=g(this)?this.valueOf():this,t=zt.call(e);if(b(Ht,e))return"";var n=Wt?t.slice(7,-1):t.replace(Kt,"$1");return""===n?void 0:n}}),Ie({global:!0,forced:!0},{Symbol:Bt})}Ze("iterator");var $t=function(e,t){var n=[][e];return!!n&&r((function(){n.call(null,t||function(){throw 1},1)}))},Yt=Object.defineProperty,Gt={},Xt=function(e){throw e},Qt=function(e,t){if(b(Gt,e))return Gt[e];t||(t={});var n=[][e],i=!!b(t,"ACCESSORS")&&t.ACCESSORS,o=b(t,0)?t[0]:Xt,s=b(t,1)?t[1]:void 0;return Gt[e]=!!n&&!r((function(){if(i&&!a)return!0;var e={length:-1};i?Yt(e,1,{enumerable:!0,get:Xt}):e[1]=1,n.call(e,o,s)}))},Jt=ct.forEach,Zt=$t("forEach"),en=Qt("forEach"),tn=Zt&&en?[].forEach:function(e){return Jt(this,e,arguments.length>1?arguments[1]:void 0)};Ie({target:"Array",proto:!0,forced:[].forEach!=tn},{forEach:tn});var nn=de.indexOf,rn=[].indexOf,an=!!rn&&1/[1].indexOf(1,-0)<0,on=$t("indexOf"),sn=Qt("indexOf",{ACCESSORS:!0,1:0});Ie({target:"Array",proto:!0,forced:an||!on||!sn},{indexOf:function(e){return an?rn.apply(this,arguments)||0:nn(this,e,arguments.length>1?arguments[1]:void 0)}});var ln=Xe("unscopables"),cn=Array.prototype;null==cn[ln]&&C.f(cn,ln,{configurable:!0,value:Be(null)});var un,hn,fn,dn=function(e){cn[ln][e]=!0},pn={},mn=!r((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),gn=z("IE_PROTO"),vn=Object.prototype,yn=mn?Object.getPrototypeOf:function(e){return e=Re(e),b(e,gn)?e[gn]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?vn:null},bn=Xe("iterator"),wn=!1;[].keys&&("next"in(fn=[].keys())?(hn=yn(yn(fn)))!==Object.prototype&&(un=hn):wn=!0),null==un&&(un={}),b(un,bn)||O(un,bn,(function(){return this}));var kn={IteratorPrototype:un,BUGGY_SAFARI_ITERATORS:wn},Tn=kn.IteratorPrototype,Sn=function(){return this},En=function(e,t,n){var i=t+" Iterator";return e.prototype=Be(Tn,{next:c(1,n)}),nt(e,i,!1),pn[i]=Sn,e},An=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{(e=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(n,[]),t=n instanceof Array}catch(e){}return function(n,i){return P(n),function(e){if(!g(e)&&null!==e)throw TypeError("Can't set "+String(e)+" as a prototype")}(i),t?e.call(n,i):n.__proto__=i,n}}():void 0),Pn=kn.IteratorPrototype,xn=kn.BUGGY_SAFARI_ITERATORS,Cn=Xe("iterator"),On=function(){return this},In=function(e,t,n,i,r,a,o){En(n,t,i);var s,l,c,u=function(e){if(e===r&&m)return m;if(!xn&&e in d)return d[e];switch(e){case"keys":case"values":case"entries":return function(){return new n(this,e)}}return function(){return new n(this)}},h=t+" Iterator",f=!1,d=e.prototype,p=d[Cn]||d["@@iterator"]||r&&d[r],m=!xn&&p||u(r),g="Array"==t&&d.entries||p;if(g&&(s=yn(g.call(new e)),Pn!==Object.prototype&&s.next&&(yn(s)!==Pn&&(An?An(s,Pn):"function"!=typeof s[Cn]&&O(s,Cn,On)),nt(s,h,!0))),"values"==r&&p&&"values"!==p.name&&(f=!0,m=function(){return p.call(this)}),d[Cn]!==m&&O(d,Cn,m),pn[t]=m,r)if(l={values:u("values"),keys:a?m:u("keys"),entries:u("entries")},o)for(c in l)(xn||f||!(c in d))&&ee(d,c,l[c]);else Ie({target:t,proto:!0,forced:xn||f},l);return l},Ln=Z.set,jn=Z.getterFor("Array Iterator"),Nn=In(Array,"Array",(function(e,t){Ln(this,{type:"Array Iterator",target:m(e),index:0,kind:t})}),(function(){var e=jn(this),t=e.target,n=e.kind,i=e.index++;return!t||i>=t.length?(e.target=void 0,{value:void 0,done:!0}):"keys"==n?{value:i,done:!1}:"values"==n?{value:t[i],done:!1}:{value:[i,t[i]],done:!1}}),"values");pn.Arguments=pn.Array,dn("keys"),dn("values"),dn("entries");var Rn=[].join,Mn=d!=Object,_n=$t("join",",");Ie({target:"Array",proto:!0,forced:Mn||!_n},{join:function(e){return Rn.call(m(this),void 0===e?",":e)}});var Un,Dn,Fn=function(e,t,n){var i=v(t);i in e?C.f(e,i,c(0,n)):e[i]=n},qn=ie("navigator","userAgent")||"",Hn=i.process,Bn=Hn&&Hn.versions,Vn=Bn&&Bn.v8;Vn?Dn=(Un=Vn.split("."))[0]+Un[1]:qn&&(!(Un=qn.match(/Edge\/(\d+)/))||Un[1]>=74)&&(Un=qn.match(/Chrome\/(\d+)/))&&(Dn=Un[1]);var zn=Dn&&+Dn,Wn=Xe("species"),Kn=function(e){return zn>=51||!r((function(){var t=[];return(t.constructor={})[Wn]=function(){return{foo:1}},1!==t[e](Boolean).foo}))},$n=Kn("slice"),Yn=Qt("slice",{ACCESSORS:!0,0:0,1:2}),Gn=Xe("species"),Xn=[].slice,Qn=Math.max;Ie({target:"Array",proto:!0,forced:!$n||!Yn},{slice:function(e,t){var n,i,r,a=m(this),o=le(a.length),s=he(e,o),l=he(void 0===t?o:t,o);if(Ne(a)&&("function"!=typeof(n=a.constructor)||n!==Array&&!Ne(n.prototype)?g(n)&&null===(n=n[Gn])&&(n=void 0):n=void 0,n===Array||void 0===n))return Xn.call(a,s,l);for(i=new(void 0===n?Array:n)(Qn(l-s,0)),r=0;s<l;s++,r++)s in a&&Fn(i,r,a[s]);return i.length=r,i}});var Jn={};Jn[Xe("toStringTag")]="z";var Zn="[object z]"===String(Jn),ei=Xe("toStringTag"),ti="Arguments"==h(function(){return arguments}()),ni=Zn?h:function(e){var t,n,i;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),ei))?n:ti?h(t):"Object"==(i=h(t))&&"function"==typeof t.callee?"Arguments":i},ii=Zn?{}.toString:function(){return"[object "+ni(this)+"]"};Zn||ee(Object.prototype,"toString",ii,{unsafe:!0});var ri=function(){var e=P(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t};function ai(e,t){return RegExp(e,t)}var oi={UNSUPPORTED_Y:r((function(){var e=ai("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),BROKEN_CARET:r((function(){var e=ai("^r","gy");return e.lastIndex=2,null!=e.exec("str")}))},si=RegExp.prototype.exec,li=String.prototype.replace,ci=si,ui=function(){var e=/a/,t=/b*/g;return si.call(e,"a"),si.call(t,"a"),0!==e.lastIndex||0!==t.lastIndex}(),hi=oi.UNSUPPORTED_Y||oi.BROKEN_CARET,fi=void 0!==/()??/.exec("")[1];(ui||fi||hi)&&(ci=function(e){var t,n,i,r,a=this,o=hi&&a.sticky,s=ri.call(a),l=a.source,c=0,u=e;return o&&(-1===(s=s.replace("y","")).indexOf("g")&&(s+="g"),u=String(e).slice(a.lastIndex),a.lastIndex>0&&(!a.multiline||a.multiline&&"\n"!==e[a.lastIndex-1])&&(l="(?: "+l+")",u=" "+u,c++),n=new RegExp("^(?:"+l+")",s)),fi&&(n=new RegExp("^"+l+"$(?!\\s)",s)),ui&&(t=a.lastIndex),i=si.call(o?n:a,u),o?i?(i.input=i.input.slice(c),i[0]=i[0].slice(c),i.index=a.lastIndex,a.lastIndex+=i[0].length):a.lastIndex=0:ui&&i&&(a.lastIndex=a.global?i.index+i[0].length:t),fi&&i&&i.length>1&&li.call(i[0],n,(function(){for(r=1;r<arguments.length-2;r++)void 0===arguments[r]&&(i[r]=void 0)})),i});var di=ci;Ie({target:"RegExp",proto:!0,forced:/./.exec!==di},{exec:di});var pi=RegExp.prototype,mi=pi.toString,gi=r((function(){return"/a/b"!=mi.call({source:"a",flags:"b"})})),vi="toString"!=mi.name;(gi||vi)&&ee(RegExp.prototype,"toString",(function(){var e=P(this),t=String(e.source),n=e.flags;return"/"+t+"/"+String(void 0===n&&e instanceof RegExp&&!("flags"in pi)?ri.call(e):n)}),{unsafe:!0});var yi=function(e){return function(t,n){var i,r,a=String(p(t)),o=oe(n),s=a.length;return o<0||o>=s?e?"":void 0:(i=a.charCodeAt(o))<55296||i>56319||o+1===s||(r=a.charCodeAt(o+1))<56320||r>57343?e?a.charAt(o):i:e?a.slice(o,o+2):r-56320+(i-55296<<10)+65536}},bi={codeAt:yi(!1),charAt:yi(!0)},wi=bi.charAt,ki=Z.set,Ti=Z.getterFor("String Iterator");In(String,"String",(function(e){ki(this,{type:"String Iterator",string:String(e),index:0})}),(function(){var e,t=Ti(this),n=t.string,i=t.index;return i>=n.length?{value:void 0,done:!0}:(e=wi(n,i),t.index+=e.length,{value:e,done:!1})}));var Si=Xe("species"),Ei=!r((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")})),Ai="$0"==="a".replace(/./,"$0"),Pi=Xe("replace"),xi=!!/./[Pi]&&""===/./[Pi]("a","$0"),Ci=!r((function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var n="ab".split(e);return 2!==n.length||"a"!==n[0]||"b"!==n[1]})),Oi=function(e,t,n,i){var a=Xe(e),o=!r((function(){var t={};return t[a]=function(){return 7},7!=""[e](t)})),s=o&&!r((function(){var t=!1,n=/a/;return"split"===e&&((n={}).constructor={},n.constructor[Si]=function(){return n},n.flags="",n[a]=/./[a]),n.exec=function(){return t=!0,null},n[a](""),!t}));if(!o||!s||"replace"===e&&(!Ei||!Ai||xi)||"split"===e&&!Ci){var l=/./[a],c=n(a,""[e],(function(e,t,n,i,r){return t.exec===di?o&&!r?{done:!0,value:l.call(t,n,i)}:{done:!0,value:e.call(n,t,i)}:{done:!1}}),{REPLACE_KEEPS_$0:Ai,REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE:xi}),u=c[0],h=c[1];ee(String.prototype,e,u),ee(RegExp.prototype,a,2==t?function(e,t){return h.call(e,this,t)}:function(e){return h.call(e,this)})}i&&O(RegExp.prototype[a],"sham",!0)},Ii=bi.charAt,Li=function(e,t,n){return t+(n?Ii(e,t).length:1)},ji=function(e,t){var n=e.exec;if("function"==typeof n){var i=n.call(e,t);if("object"!=typeof i)throw TypeError("RegExp exec method returned something other than an Object or null");return i}if("RegExp"!==h(e))throw TypeError("RegExp#exec called on incompatible receiver");return di.call(e,t)},Ni=Math.max,Ri=Math.min,Mi=Math.floor,_i=/\$([$&'`]|\d\d?|<[^>]*>)/g,Ui=/\$([$&'`]|\d\d?)/g;Oi("replace",2,(function(e,t,n,i){var r=i.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE,a=i.REPLACE_KEEPS_$0,o=r?"$":"$0";return[function(n,i){var r=p(this),a=null==n?void 0:n[e];return void 0!==a?a.call(n,r,i):t.call(String(r),n,i)},function(e,i){if(!r&&a||"string"==typeof i&&-1===i.indexOf(o)){var l=n(t,e,this,i);if(l.done)return l.value}var c=P(e),u=String(this),h="function"==typeof i;h||(i=String(i));var f=c.global;if(f){var d=c.unicode;c.lastIndex=0}for(var p=[];;){var m=ji(c,u);if(null===m)break;if(p.push(m),!f)break;""===String(m[0])&&(c.lastIndex=Li(u,le(c.lastIndex),d))}for(var g,v="",y=0,b=0;b<p.length;b++){m=p[b];for(var w=String(m[0]),k=Ni(Ri(oe(m.index),u.length),0),T=[],S=1;S<m.length;S++)T.push(void 0===(g=m[S])?g:String(g));var E=m.groups;if(h){var A=[w].concat(T,k,u);void 0!==E&&A.push(E);var x=String(i.apply(void 0,A))}else x=s(w,u,k,T,E,i);k>=y&&(v+=u.slice(y,k)+x,y=k+w.length)}return v+u.slice(y)}];function s(e,n,i,r,a,o){var s=i+e.length,l=r.length,c=Ui;return void 0!==a&&(a=Re(a),c=_i),t.call(o,c,(function(t,o){var c;switch(o.charAt(0)){case"$":return"$";case"&":return e;case"`":return n.slice(0,i);case"'":return n.slice(s);case"<":c=a[o.slice(1,-1)];break;default:var u=+o;if(0===u)return t;if(u>l){var h=Mi(u/10);return 0===h?t:h<=l?void 0===r[h-1]?o.charAt(1):r[h-1]+o.charAt(1):t}c=r[u-1]}return void 0===c?"":c}))}}));var Di=Object.is||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t};Oi("search",1,(function(e,t,n){return[function(t){var n=p(this),i=null==t?void 0:t[e];return void 0!==i?i.call(t,n):new RegExp(t)[e](String(n))},function(e){var i=n(t,e,this);if(i.done)return i.value;var r=P(e),a=String(this),o=r.lastIndex;Di(o,0)||(r.lastIndex=0);var s=ji(r,a);return Di(r.lastIndex,o)||(r.lastIndex=o),null===s?-1:s.index}]}));var Fi=Xe("match"),qi=function(e){var t;return g(e)&&(void 0!==(t=e[Fi])?!!t:"RegExp"==h(e))},Hi=Xe("species"),Bi=function(e,t){var n,i=P(e).constructor;return void 0===i||null==(n=P(i)[Hi])?t:it(n)},Vi=[].push,zi=Math.min,Wi=!r((function(){return!RegExp(4294967295,"y")}));Oi("split",2,(function(e,t,n){var i;return i="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(e,n){var i=String(p(this)),r=void 0===n?4294967295:n>>>0;if(0===r)return[];if(void 0===e)return[i];if(!qi(e))return t.call(i,e,r);for(var a,o,s,l=[],c=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),u=0,h=new RegExp(e.source,c+"g");(a=di.call(h,i))&&!((o=h.lastIndex)>u&&(l.push(i.slice(u,a.index)),a.length>1&&a.index<i.length&&Vi.apply(l,a.slice(1)),s=a[0].length,u=o,l.length>=r));)h.lastIndex===a.index&&h.lastIndex++;return u===i.length?!s&&h.test("")||l.push(""):l.push(i.slice(u)),l.length>r?l.slice(0,r):l}:"0".split(void 0,0).length?function(e,n){return void 0===e&&0===n?[]:t.call(this,e,n)}:t,[function(t,n){var r=p(this),a=null==t?void 0:t[e];return void 0!==a?a.call(t,r,n):i.call(String(r),t,n)},function(e,r){var a=n(i,e,this,r,i!==t);if(a.done)return a.value;var o=P(e),s=String(this),l=Bi(o,RegExp),c=o.unicode,u=(o.ignoreCase?"i":"")+(o.multiline?"m":"")+(o.unicode?"u":"")+(Wi?"y":"g"),h=new l(Wi?o:"^(?:"+o.source+")",u),f=void 0===r?4294967295:r>>>0;if(0===f)return[];if(0===s.length)return null===ji(h,s)?[s]:[];for(var d=0,p=0,m=[];p<s.length;){h.lastIndex=Wi?p:0;var g,v=ji(h,Wi?s:s.slice(p));if(null===v||(g=zi(le(h.lastIndex+(Wi?0:p)),s.length))===d)p=Li(s,p,c);else{if(m.push(s.slice(d,p)),m.length===f)return m;for(var y=1;y<=v.length-1;y++)if(m.push(v[y]),m.length===f)return m;p=d=g}}return m.push(s.slice(d)),m}]}),!Wi);var Ki={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0};for(var $i in Ki){var Yi=i[$i],Gi=Yi&&Yi.prototype;if(Gi&&Gi.forEach!==tn)try{O(Gi,"forEach",tn)}catch(e){Gi.forEach=tn}}var Xi=Xe("iterator"),Qi=Xe("toStringTag"),Ji=Nn.values;for(var Zi in Ki){var er=i[Zi],tr=er&&er.prototype;if(tr){if(tr[Xi]!==Ji)try{O(tr,Xi,Ji)}catch(e){tr[Xi]=Ji}if(tr[Qi]||O(tr,Qi,Zi),Ki[Zi])for(var nr in Nn)if(tr[nr]!==Nn[nr])try{O(tr,nr,Nn[nr])}catch(e){tr[nr]=Nn[nr]}}}var ir=Xe("iterator"),rr=!r((function(){var e=new URL("b?a=1&b=2&c=3","http://a"),t=e.searchParams,n="";return e.pathname="c%20d",t.forEach((function(e,i){t.delete("b"),n+=i+e})),!t.sort||"http://a/c%20d?a=1&c=3"!==e.href||"3"!==t.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!t[ir]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("http://тест").host||"#%D0%B1"!==new URL("http://a#б").hash||"a1c3"!==n||"x"!==new URL("http://x",void 0).host})),ar=function(e,t,n){if(!(e instanceof t))throw TypeError("Incorrect "+(n?n+" ":"")+"invocation");return e},or=Object.assign,sr=Object.defineProperty,lr=!or||r((function(){if(a&&1!==or({b:1},or(sr({},"a",{enumerable:!0,get:function(){sr(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},n=Symbol();return e[n]=7,"abcdefghijklmnopqrst".split("").forEach((function(e){t[e]=e})),7!=or({},e)[n]||"abcdefghijklmnopqrst"!=Me(or({},t)).join("")}))?function(e,t){for(var n=Re(e),i=arguments.length,r=1,o=be.f,s=l.f;i>r;)for(var c,u=d(arguments[r++]),h=o?Me(u).concat(o(u)):Me(u),f=h.length,p=0;f>p;)c=h[p++],a&&!s.call(u,c)||(n[c]=u[c]);return n}:or,cr=function(e,t,n,i){try{return i?t(P(n)[0],n[1]):t(n)}catch(t){var r=e.return;throw void 0!==r&&P(r.call(e)),t}},ur=Xe("iterator"),hr=Array.prototype,fr=function(e){return void 0!==e&&(pn.Array===e||hr[ur]===e)},dr=Xe("iterator"),pr=function(e){if(null!=e)return e[dr]||e["@@iterator"]||pn[ni(e)]},mr=function(e){var t,n,i,r,a,o,s=Re(e),l="function"==typeof this?this:Array,c=arguments.length,u=c>1?arguments[1]:void 0,h=void 0!==u,f=pr(s),d=0;if(h&&(u=rt(u,c>2?arguments[2]:void 0,2)),null==f||l==Array&&fr(f))for(n=new l(t=le(s.length));t>d;d++)o=h?u(s[d],d):s[d],Fn(n,d,o);else for(a=(r=f.call(s)).next,n=new l;!(i=a.call(r)).done;d++)o=h?cr(r,u,[i.value,d],!0):i.value,Fn(n,d,o);return n.length=d,n},gr=/[^\0-\u007E]/,vr=/[.\u3002\uFF0E\uFF61]/g,yr="Overflow: input needs wider integers to process",br=Math.floor,wr=String.fromCharCode,kr=function(e){return e+22+75*(e<26)},Tr=function(e,t,n){var i=0;for(e=n?br(e/700):e>>1,e+=br(e/t);e>455;i+=36)e=br(e/35);return br(i+36*e/(e+38))},Sr=function(e){var t,n,i=[],r=(e=function(e){for(var t=[],n=0,i=e.length;n<i;){var r=e.charCodeAt(n++);if(r>=55296&&r<=56319&&n<i){var a=e.charCodeAt(n++);56320==(64512&a)?t.push(((1023&r)<<10)+(1023&a)+65536):(t.push(r),n--)}else t.push(r)}return t}(e)).length,a=128,o=0,s=72;for(t=0;t<e.length;t++)(n=e[t])<128&&i.push(wr(n));var l=i.length,c=l;for(l&&i.push("-");c<r;){var u=2147483647;for(t=0;t<e.length;t++)(n=e[t])>=a&&n<u&&(u=n);var h=c+1;if(u-a>br((2147483647-o)/h))throw RangeError(yr);for(o+=(u-a)*h,a=u,t=0;t<e.length;t++){if((n=e[t])<a&&++o>2147483647)throw RangeError(yr);if(n==a){for(var f=o,d=36;;d+=36){var p=d<=s?1:d>=s+26?26:d-s;if(f<p)break;var m=f-p,g=36-p;i.push(wr(kr(p+m%g))),f=br(m/g)}i.push(wr(kr(f))),s=Tr(o,h,c==l),o=0,++c}}++o,++a}return i.join("")},Er=function(e,t,n){for(var i in t)ee(e,i,t[i],n);return e},Ar=function(e){var t=pr(e);if("function"!=typeof t)throw TypeError(String(e)+" is not iterable");return P(t.call(e))},Pr=ie("fetch"),xr=ie("Headers"),Cr=Xe("iterator"),Or=Z.set,Ir=Z.getterFor("URLSearchParams"),Lr=Z.getterFor("URLSearchParamsIterator"),jr=/\+/g,Nr=Array(4),Rr=function(e){return Nr[e-1]||(Nr[e-1]=RegExp("((?:%[\\da-f]{2}){"+e+"})","gi"))},Mr=function(e){try{return decodeURIComponent(e)}catch(t){return e}},_r=function(e){var t=e.replace(jr," "),n=4;try{return decodeURIComponent(t)}catch(e){for(;n;)t=t.replace(Rr(n--),Mr);return t}},Ur=/[!'()~]|%20/g,Dr={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},Fr=function(e){return Dr[e]},qr=function(e){return encodeURIComponent(e).replace(Ur,Fr)},Hr=function(e,t){if(t)for(var n,i,r=t.split("&"),a=0;a<r.length;)(n=r[a++]).length&&(i=n.split("="),e.push({key:_r(i.shift()),value:_r(i.join("="))}))},Br=function(e){this.entries.length=0,Hr(this.entries,e)},Vr=function(e,t){if(e<t)throw TypeError("Not enough arguments")},zr=En((function(e,t){Or(this,{type:"URLSearchParamsIterator",iterator:Ar(Ir(e).entries),kind:t})}),"Iterator",(function(){var e=Lr(this),t=e.kind,n=e.iterator.next(),i=n.value;return n.done||(n.value="keys"===t?i.key:"values"===t?i.value:[i.key,i.value]),n})),Wr=function(){ar(this,Wr,"URLSearchParams");var e,t,n,i,r,a,o,s,l,c=arguments.length>0?arguments[0]:void 0,u=this,h=[];if(Or(u,{type:"URLSearchParams",entries:h,updateURL:function(){},updateSearchParams:Br}),void 0!==c)if(g(c))if("function"==typeof(e=pr(c)))for(n=(t=e.call(c)).next;!(i=n.call(t)).done;){if((o=(a=(r=Ar(P(i.value))).next).call(r)).done||(s=a.call(r)).done||!a.call(r).done)throw TypeError("Expected sequence with length 2");h.push({key:o.value+"",value:s.value+""})}else for(l in c)b(c,l)&&h.push({key:l,value:c[l]+""});else Hr(h,"string"==typeof c?"?"===c.charAt(0)?c.slice(1):c:c+"")},Kr=Wr.prototype;Er(Kr,{append:function(e,t){Vr(arguments.length,2);var n=Ir(this);n.entries.push({key:e+"",value:t+""}),n.updateURL()},delete:function(e){Vr(arguments.length,1);for(var t=Ir(this),n=t.entries,i=e+"",r=0;r<n.length;)n[r].key===i?n.splice(r,1):r++;t.updateURL()},get:function(e){Vr(arguments.length,1);for(var t=Ir(this).entries,n=e+"",i=0;i<t.length;i++)if(t[i].key===n)return t[i].value;return null},getAll:function(e){Vr(arguments.length,1);for(var t=Ir(this).entries,n=e+"",i=[],r=0;r<t.length;r++)t[r].key===n&&i.push(t[r].value);return i},has:function(e){Vr(arguments.length,1);for(var t=Ir(this).entries,n=e+"",i=0;i<t.length;)if(t[i++].key===n)return!0;return!1},set:function(e,t){Vr(arguments.length,1);for(var n,i=Ir(this),r=i.entries,a=!1,o=e+"",s=t+"",l=0;l<r.length;l++)(n=r[l]).key===o&&(a?r.splice(l--,1):(a=!0,n.value=s));a||r.push({key:o,value:s}),i.updateURL()},sort:function(){var e,t,n,i=Ir(this),r=i.entries,a=r.slice();for(r.length=0,n=0;n<a.length;n++){for(e=a[n],t=0;t<n;t++)if(r[t].key>e.key){r.splice(t,0,e);break}t===n&&r.push(e)}i.updateURL()},forEach:function(e){for(var t,n=Ir(this).entries,i=rt(e,arguments.length>1?arguments[1]:void 0,3),r=0;r<n.length;)i((t=n[r++]).value,t.key,this)},keys:function(){return new zr(this,"keys")},values:function(){return new zr(this,"values")},entries:function(){return new zr(this,"entries")}},{enumerable:!0}),ee(Kr,Cr,Kr.entries),ee(Kr,"toString",(function(){for(var e,t=Ir(this).entries,n=[],i=0;i<t.length;)e=t[i++],n.push(qr(e.key)+"="+qr(e.value));return n.join("&")}),{enumerable:!0}),nt(Wr,"URLSearchParams"),Ie({global:!0,forced:!rr},{URLSearchParams:Wr}),rr||"function"!=typeof Pr||"function"!=typeof xr||Ie({global:!0,enumerable:!0,forced:!0},{fetch:function(e){var t,n,i,r=[e];return arguments.length>1&&(t=arguments[1],g(t)&&(n=t.body,"URLSearchParams"===ni(n)&&((i=t.headers?new xr(t.headers):new xr).has("content-type")||i.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"),t=Be(t,{body:c(0,String(n)),headers:c(0,i)}))),r.push(t)),Pr.apply(this,r)}});var $r,Yr={URLSearchParams:Wr,getState:Ir},Gr=bi.codeAt,Xr=i.URL,Qr=Yr.URLSearchParams,Jr=Yr.getState,Zr=Z.set,ea=Z.getterFor("URL"),ta=Math.floor,na=Math.pow,ia=/[A-Za-z]/,ra=/[\d+-.A-Za-z]/,aa=/\d/,oa=/^(0x|0X)/,sa=/^[0-7]+$/,la=/^\d+$/,ca=/^[\dA-Fa-f]+$/,ua=/[\u0000\u0009\u000A\u000D #%/:?@[\\]]/,ha=/[\u0000\u0009\u000A\u000D #/:?@[\\]]/,fa=/^[\u0000-\u001F ]+|[\u0000-\u001F ]+$/g,da=/[\u0009\u000A\u000D]/g,pa=function(e,t){var n,i,r;if("["==t.charAt(0)){if("]"!=t.charAt(t.length-1))return"Invalid host";if(!(n=ga(t.slice(1,-1))))return"Invalid host";e.host=n}else if(Ea(e)){if(t=function(e){var t,n,i=[],r=e.toLowerCase().replace(vr,".").split(".");for(t=0;t<r.length;t++)n=r[t],i.push(gr.test(n)?"xn--"+Sr(n):n);return i.join(".")}(t),ua.test(t))return"Invalid host";if(null===(n=ma(t)))return"Invalid host";e.host=n}else{if(ha.test(t))return"Invalid host";for(n="",i=mr(t),r=0;r<i.length;r++)n+=Ta(i[r],ya);e.host=n}},ma=function(e){var t,n,i,r,a,o,s,l=e.split(".");if(l.length&&""==l[l.length-1]&&l.pop(),(t=l.length)>4)return e;for(n=[],i=0;i<t;i++){if(""==(r=l[i]))return e;if(a=10,r.length>1&&"0"==r.charAt(0)&&(a=oa.test(r)?16:8,r=r.slice(8==a?1:2)),""===r)o=0;else{if(!(10==a?la:8==a?sa:ca).test(r))return e;o=parseInt(r,a)}n.push(o)}for(i=0;i<t;i++)if(o=n[i],i==t-1){if(o>=na(256,5-t))return null}else if(o>255)return null;for(s=n.pop(),i=0;i<n.length;i++)s+=n[i]*na(256,3-i);return s},ga=function(e){var t,n,i,r,a,o,s,l=[0,0,0,0,0,0,0,0],c=0,u=null,h=0,f=function(){return e.charAt(h)};if(":"==f()){if(":"!=e.charAt(1))return;h+=2,u=++c}for(;f();){if(8==c)return;if(":"!=f()){for(t=n=0;n<4&&ca.test(f());)t=16*t+parseInt(f(),16),h++,n++;if("."==f()){if(0==n)return;if(h-=n,c>6)return;for(i=0;f();){if(r=null,i>0){if(!("."==f()&&i<4))return;h++}if(!aa.test(f()))return;for(;aa.test(f());){if(a=parseInt(f(),10),null===r)r=a;else{if(0==r)return;r=10*r+a}if(r>255)return;h++}l[c]=256*l[c]+r,2!=++i&&4!=i||c++}if(4!=i)return;break}if(":"==f()){if(h++,!f())return}else if(f())return;l[c++]=t}else{if(null!==u)return;h++,u=++c}}if(null!==u)for(o=c-u,c=7;0!=c&&o>0;)s=l[c],l[c--]=l[u+o-1],l[u+--o]=s;else if(8!=c)return;return l},va=function(e){var t,n,i,r;if("number"==typeof e){for(t=[],n=0;n<4;n++)t.unshift(e%256),e=ta(e/256);return t.join(".")}if("object"==typeof e){for(t="",i=function(e){for(var t=null,n=1,i=null,r=0,a=0;a<8;a++)0!==e[a]?(r>n&&(t=i,n=r),i=null,r=0):(null===i&&(i=a),++r);return r>n&&(t=i,n=r),t}(e),n=0;n<8;n++)r&&0===e[n]||(r&&(r=!1),i===n?(t+=n?":":"::",r=!0):(t+=e[n].toString(16),n<7&&(t+=":")));return"["+t+"]"}return e},ya={},ba=lr({},ya,{" ":1,'"':1,"<":1,">":1,"`":1}),wa=lr({},ba,{"#":1,"?":1,"{":1,"}":1}),ka=lr({},wa,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),Ta=function(e,t){var n=Gr(e,0);return n>32&&n<127&&!b(t,e)?e:encodeURIComponent(e)},Sa={ftp:21,file:null,http:80,https:443,ws:80,wss:443},Ea=function(e){return b(Sa,e.scheme)},Aa=function(e){return""!=e.username||""!=e.password},Pa=function(e){return!e.host||e.cannotBeABaseURL||"file"==e.scheme},xa=function(e,t){var n;return 2==e.length&&ia.test(e.charAt(0))&&(":"==(n=e.charAt(1))||!t&&"|"==n)},Ca=function(e){var t;return e.length>1&&xa(e.slice(0,2))&&(2==e.length||"/"===(t=e.charAt(2))||"\\"===t||"?"===t||"#"===t)},Oa=function(e){var t=e.path,n=t.length;!n||"file"==e.scheme&&1==n&&xa(t[0],!0)||t.pop()},Ia=function(e){return"."===e||"%2e"===e.toLowerCase()},La={},ja={},Na={},Ra={},Ma={},_a={},Ua={},Da={},Fa={},qa={},Ha={},Ba={},Va={},za={},Wa={},Ka={},$a={},Ya={},Ga={},Xa={},Qa={},Ja=function(e,t,n,i){var r,a,o,s,l,c=n||La,u=0,h="",f=!1,d=!1,p=!1;for(n||(e.scheme="",e.username="",e.password="",e.host=null,e.port=null,e.path=[],e.query=null,e.fragment=null,e.cannotBeABaseURL=!1,t=t.replace(fa,"")),t=t.replace(da,""),r=mr(t);u<=r.length;){switch(a=r[u],c){case La:if(!a||!ia.test(a)){if(n)return"Invalid scheme";c=Na;continue}h+=a.toLowerCase(),c=ja;break;case ja:if(a&&(ra.test(a)||"+"==a||"-"==a||"."==a))h+=a.toLowerCase();else{if(":"!=a){if(n)return"Invalid scheme";h="",c=Na,u=0;continue}if(n&&(Ea(e)!=b(Sa,h)||"file"==h&&(Aa(e)||null!==e.port)||"file"==e.scheme&&!e.host))return;if(e.scheme=h,n)return void(Ea(e)&&Sa[e.scheme]==e.port&&(e.port=null));h="","file"==e.scheme?c=za:Ea(e)&&i&&i.scheme==e.scheme?c=Ra:Ea(e)?c=Da:"/"==r[u+1]?(c=Ma,u++):(e.cannotBeABaseURL=!0,e.path.push(""),c=Ga)}break;case Na:if(!i||i.cannotBeABaseURL&&"#"!=a)return"Invalid scheme";if(i.cannotBeABaseURL&&"#"==a){e.scheme=i.scheme,e.path=i.path.slice(),e.query=i.query,e.fragment="",e.cannotBeABaseURL=!0,c=Qa;break}c="file"==i.scheme?za:_a;continue;case Ra:if("/"!=a||"/"!=r[u+1]){c=_a;continue}c=Fa,u++;break;case Ma:if("/"==a){c=qa;break}c=Ya;continue;case _a:if(e.scheme=i.scheme,a==$r)e.username=i.username,e.password=i.password,e.host=i.host,e.port=i.port,e.path=i.path.slice(),e.query=i.query;else if("/"==a||"\\"==a&&Ea(e))c=Ua;else if("?"==a)e.username=i.username,e.password=i.password,e.host=i.host,e.port=i.port,e.path=i.path.slice(),e.query="",c=Xa;else{if("#"!=a){e.username=i.username,e.password=i.password,e.host=i.host,e.port=i.port,e.path=i.path.slice(),e.path.pop(),c=Ya;continue}e.username=i.username,e.password=i.password,e.host=i.host,e.port=i.port,e.path=i.path.slice(),e.query=i.query,e.fragment="",c=Qa}break;case Ua:if(!Ea(e)||"/"!=a&&"\\"!=a){if("/"!=a){e.username=i.username,e.password=i.password,e.host=i.host,e.port=i.port,c=Ya;continue}c=qa}else c=Fa;break;case Da:if(c=Fa,"/"!=a||"/"!=h.charAt(u+1))continue;u++;break;case Fa:if("/"!=a&&"\\"!=a){c=qa;continue}break;case qa:if("@"==a){f&&(h="%40"+h),f=!0,o=mr(h);for(var m=0;m<o.length;m++){var g=o[m];if(":"!=g||p){var v=Ta(g,ka);p?e.password+=v:e.username+=v}else p=!0}h=""}else if(a==$r||"/"==a||"?"==a||"#"==a||"\\"==a&&Ea(e)){if(f&&""==h)return"Invalid authority";u-=mr(h).length+1,h="",c=Ha}else h+=a;break;case Ha:case Ba:if(n&&"file"==e.scheme){c=Ka;continue}if(":"!=a||d){if(a==$r||"/"==a||"?"==a||"#"==a||"\\"==a&&Ea(e)){if(Ea(e)&&""==h)return"Invalid host";if(n&&""==h&&(Aa(e)||null!==e.port))return;if(s=pa(e,h))return s;if(h="",c=$a,n)return;continue}"["==a?d=!0:"]"==a&&(d=!1),h+=a}else{if(""==h)return"Invalid host";if(s=pa(e,h))return s;if(h="",c=Va,n==Ba)return}break;case Va:if(!aa.test(a)){if(a==$r||"/"==a||"?"==a||"#"==a||"\\"==a&&Ea(e)||n){if(""!=h){var y=parseInt(h,10);if(y>65535)return"Invalid port";e.port=Ea(e)&&y===Sa[e.scheme]?null:y,h=""}if(n)return;c=$a;continue}return"Invalid port"}h+=a;break;case za:if(e.scheme="file","/"==a||"\\"==a)c=Wa;else{if(!i||"file"!=i.scheme){c=Ya;continue}if(a==$r)e.host=i.host,e.path=i.path.slice(),e.query=i.query;else if("?"==a)e.host=i.host,e.path=i.path.slice(),e.query="",c=Xa;else{if("#"!=a){Ca(r.slice(u).join(""))||(e.host=i.host,e.path=i.path.slice(),Oa(e)),c=Ya;continue}e.host=i.host,e.path=i.path.slice(),e.query=i.query,e.fragment="",c=Qa}}break;case Wa:if("/"==a||"\\"==a){c=Ka;break}i&&"file"==i.scheme&&!Ca(r.slice(u).join(""))&&(xa(i.path[0],!0)?e.path.push(i.path[0]):e.host=i.host),c=Ya;continue;case Ka:if(a==$r||"/"==a||"\\"==a||"?"==a||"#"==a){if(!n&&xa(h))c=Ya;else if(""==h){if(e.host="",n)return;c=$a}else{if(s=pa(e,h))return s;if("localhost"==e.host&&(e.host=""),n)return;h="",c=$a}continue}h+=a;break;case $a:if(Ea(e)){if(c=Ya,"/"!=a&&"\\"!=a)continue}else if(n||"?"!=a)if(n||"#"!=a){if(a!=$r&&(c=Ya,"/"!=a))continue}else e.fragment="",c=Qa;else e.query="",c=Xa;break;case Ya:if(a==$r||"/"==a||"\\"==a&&Ea(e)||!n&&("?"==a||"#"==a)){if(".."===(l=(l=h).toLowerCase())||"%2e."===l||".%2e"===l||"%2e%2e"===l?(Oa(e),"/"==a||"\\"==a&&Ea(e)||e.path.push("")):Ia(h)?"/"==a||"\\"==a&&Ea(e)||e.path.push(""):("file"==e.scheme&&!e.path.length&&xa(h)&&(e.host&&(e.host=""),h=h.charAt(0)+":"),e.path.push(h)),h="","file"==e.scheme&&(a==$r||"?"==a||"#"==a))for(;e.path.length>1&&""===e.path[0];)e.path.shift();"?"==a?(e.query="",c=Xa):"#"==a&&(e.fragment="",c=Qa)}else h+=Ta(a,wa);break;case Ga:"?"==a?(e.query="",c=Xa):"#"==a?(e.fragment="",c=Qa):a!=$r&&(e.path[0]+=Ta(a,ya));break;case Xa:n||"#"!=a?a!=$r&&("'"==a&&Ea(e)?e.query+="%27":e.query+="#"==a?"%23":Ta(a,ya)):(e.fragment="",c=Qa);break;case Qa:a!=$r&&(e.fragment+=Ta(a,ba))}u++}},Za=function(e){var t,n,i=ar(this,Za,"URL"),r=arguments.length>1?arguments[1]:void 0,o=String(e),s=Zr(i,{type:"URL"});if(void 0!==r)if(r instanceof Za)t=ea(r);else if(n=Ja(t={},String(r)))throw TypeError(n);if(n=Ja(s,o,null,t))throw TypeError(n);var l=s.searchParams=new Qr,c=Jr(l);c.updateSearchParams(s.query),c.updateURL=function(){s.query=String(l)||null},a||(i.href=to.call(i),i.origin=no.call(i),i.protocol=io.call(i),i.username=ro.call(i),i.password=ao.call(i),i.host=oo.call(i),i.hostname=so.call(i),i.port=lo.call(i),i.pathname=co.call(i),i.search=uo.call(i),i.searchParams=ho.call(i),i.hash=fo.call(i))},eo=Za.prototype,to=function(){var e=ea(this),t=e.scheme,n=e.username,i=e.password,r=e.host,a=e.port,o=e.path,s=e.query,l=e.fragment,c=t+":";return null!==r?(c+="//",Aa(e)&&(c+=n+(i?":"+i:"")+"@"),c+=va(r),null!==a&&(c+=":"+a)):"file"==t&&(c+="//"),c+=e.cannotBeABaseURL?o[0]:o.length?"/"+o.join("/"):"",null!==s&&(c+="?"+s),null!==l&&(c+="#"+l),c},no=function(){var e=ea(this),t=e.scheme,n=e.port;if("blob"==t)try{return new URL(t.path[0]).origin}catch(e){return"null"}return"file"!=t&&Ea(e)?t+"://"+va(e.host)+(null!==n?":"+n:""):"null"},io=function(){return ea(this).scheme+":"},ro=function(){return ea(this).username},ao=function(){return ea(this).password},oo=function(){var e=ea(this),t=e.host,n=e.port;return null===t?"":null===n?va(t):va(t)+":"+n},so=function(){var e=ea(this).host;return null===e?"":va(e)},lo=function(){var e=ea(this).port;return null===e?"":String(e)},co=function(){var e=ea(this),t=e.path;return e.cannotBeABaseURL?t[0]:t.length?"/"+t.join("/"):""},uo=function(){var e=ea(this).query;return e?"?"+e:""},ho=function(){return ea(this).searchParams},fo=function(){var e=ea(this).fragment;return e?"#"+e:""},po=function(e,t){return{get:e,set:t,configurable:!0,enumerable:!0}};if(a&&_e(eo,{href:po(to,(function(e){var t=ea(this),n=String(e),i=Ja(t,n);if(i)throw TypeError(i);Jr(t.searchParams).updateSearchParams(t.query)})),origin:po(no),protocol:po(io,(function(e){var t=ea(this);Ja(t,String(e)+":",La)})),username:po(ro,(function(e){var t=ea(this),n=mr(String(e));if(!Pa(t)){t.username="";for(var i=0;i<n.length;i++)t.username+=Ta(n[i],ka)}})),password:po(ao,(function(e){var t=ea(this),n=mr(String(e));if(!Pa(t)){t.password="";for(var i=0;i<n.length;i++)t.password+=Ta(n[i],ka)}})),host:po(oo,(function(e){var t=ea(this);t.cannotBeABaseURL||Ja(t,String(e),Ha)})),hostname:po(so,(function(e){var t=ea(this);t.cannotBeABaseURL||Ja(t,String(e),Ba)})),port:po(lo,(function(e){var t=ea(this);Pa(t)||(""==(e=String(e))?t.port=null:Ja(t,e,Va))})),pathname:po(co,(function(e){var t=ea(this);t.cannotBeABaseURL||(t.path=[],Ja(t,e+"",$a))})),search:po(uo,(function(e){var t=ea(this);""==(e=String(e))?t.query=null:("?"==e.charAt(0)&&(e=e.slice(1)),t.query="",Ja(t,e,Xa)),Jr(t.searchParams).updateSearchParams(t.query)})),searchParams:po(ho),hash:po(fo,(function(e){var t=ea(this);""!=(e=String(e))?("#"==e.charAt(0)&&(e=e.slice(1)),t.fragment="",Ja(t,e,Qa)):t.fragment=null}))}),ee(eo,"toJSON",(function(){return to.call(this)}),{enumerable:!0}),ee(eo,"toString",(function(){return to.call(this)}),{enumerable:!0}),Xr){var mo=Xr.createObjectURL,go=Xr.revokeObjectURL;mo&&ee(Za,"createObjectURL",(function(e){return mo.apply(Xr,arguments)})),go&&ee(Za,"revokeObjectURL",(function(e){return go.apply(Xr,arguments)}))}function vo(e){return(vo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function yo(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function bo(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function wo(e,t,n){return t&&bo(e.prototype,t),n&&bo(e,n),e}function ko(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function To(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function So(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?To(Object(n),!0).forEach((function(t){ko(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):To(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Eo(e,t){if(null==e)return{};var n,i,r=function(e,t){if(null==e)return{};var n,i,r={},a=Object.keys(e);for(i=0;i<a.length;i++)n=a[i],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)n=a[i],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Ao(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],i=!0,r=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(i=(o=s.next()).done)&&(n.push(o.value),!t||n.length!==t);i=!0);}catch(e){r=!0,a=e}finally{try{i||null==s.return||s.return()}finally{if(r)throw a}}return n}(e,t)||xo(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Po(e){return function(e){if(Array.isArray(e))return Co(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||xo(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function xo(e,t){if(e){if("string"==typeof e)return Co(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Co(e,t):void 0}}function Co(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}nt(Za,"URL"),Ie({global:!0,forced:!rr,sham:!a},{URL:Za}),function(e){var t=function(){try{return!!Symbol.iterator}catch(e){return!1}}(),n=function(e){var n={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return t&&(n[Symbol.iterator]=function(){return n}),n},i=function(e){return encodeURIComponent(e).replace(/%20/g,"+")},r=function(e){return decodeURIComponent(String(e).replace(/\+/g," "))};(function(){try{var t=e.URLSearchParams;return"a=1"===new t("?a=1").toString()&&"function"==typeof t.prototype.set}catch(e){return!1}})()||function(){var r=function e(t){Object.defineProperty(this,"_entries",{writable:!0,value:{}});var n=vo(t);if("undefined"===n);else if("string"===n)""!==t&&this._fromString(t);else if(t instanceof e){var i=this;t.forEach((function(e,t){i.append(t,e)}))}else{if(null===t||"object"!==n)throw new TypeError("Unsupported input's type for URLSearchParams");if("[object Array]"===Object.prototype.toString.call(t))for(var r=0;r<t.length;r++){var a=t[r];if("[object Array]"!==Object.prototype.toString.call(a)&&2===a.length)throw new TypeError("Expected [string, any] as entry at index "+r+" of URLSearchParams's input");this.append(a[0],a[1])}else for(var o in t)t.hasOwnProperty(o)&&this.append(o,t[o])}},a=r.prototype;a.append=function(e,t){e in this._entries?this._entries[e].push(String(t)):this._entries[e]=[String(t)]},a.delete=function(e){delete this._entries[e]},a.get=function(e){return e in this._entries?this._entries[e][0]:null},a.getAll=function(e){return e in this._entries?this._entries[e].slice(0):[]},a.has=function(e){return e in this._entries},a.set=function(e,t){this._entries[e]=[String(t)]},a.forEach=function(e,t){var n;for(var i in this._entries)if(this._entries.hasOwnProperty(i)){n=this._entries[i];for(var r=0;r<n.length;r++)e.call(t,n[r],i,this)}},a.keys=function(){var e=[];return this.forEach((function(t,n){e.push(n)})),n(e)},a.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),n(e)},a.entries=function(){var e=[];return this.forEach((function(t,n){e.push([n,t])})),n(e)},t&&(a[Symbol.iterator]=a.entries),a.toString=function(){var e=[];return this.forEach((function(t,n){e.push(i(n)+"="+i(t))})),e.join("&")},e.URLSearchParams=r}();var a=e.URLSearchParams.prototype;"function"!=typeof a.sort&&(a.sort=function(){var e=this,t=[];this.forEach((function(n,i){t.push([i,n]),e._entries||e.delete(i)})),t.sort((function(e,t){return e[0]<t[0]?-1:e[0]>t[0]?1:0})),e._entries&&(e._entries={});for(var n=0;n<t.length;n++)this.append(t[n][0],t[n][1])}),"function"!=typeof a._fromString&&Object.defineProperty(a,"_fromString",{enumerable:!1,configurable:!1,writable:!1,value:function(e){if(this._entries)this._entries={};else{var t=[];this.forEach((function(e,n){t.push(n)}));for(var n=0;n<t.length;n++)this.delete(t[n])}var i,a=(e=e.replace(/^\?/,"")).split("&");for(n=0;n<a.length;n++)i=a[n].split("="),this.append(r(i[0]),i.length>1?r(i[1]):"")}})}(void 0!==e?e:"undefined"!=typeof window?window:"undefined"!=typeof self?self:e),function(e){if(function(){try{var t=new e.URL("b","http://a");return t.pathname="c d","http://a/c%20d"===t.href&&t.searchParams}catch(e){return!1}}()||function(){var t=e.URL,n=function(t,n){"string"!=typeof t&&(t=String(t));var i,r=document;if(n&&(void 0===e.location||n!==e.location.href)){(i=(r=document.implementation.createHTMLDocument("")).createElement("base")).href=n,r.head.appendChild(i);try{if(0!==i.href.indexOf(n))throw new Error(i.href)}catch(e){throw new Error("URL unable to set base "+n+" due to "+e)}}var a=r.createElement("a");if(a.href=t,i&&(r.body.appendChild(a),a.href=a.href),":"===a.protocol||!/:/.test(a.href))throw new TypeError("Invalid URL");Object.defineProperty(this,"_anchorElement",{value:a});var o=new e.URLSearchParams(this.search),s=!0,l=!0,c=this;["append","delete","set"].forEach((function(e){var t=o[e];o[e]=function(){t.apply(o,arguments),s&&(l=!1,c.search=o.toString(),l=!0)}})),Object.defineProperty(this,"searchParams",{value:o,enumerable:!0});var u=void 0;Object.defineProperty(this,"_updateSearchParams",{enumerable:!1,configurable:!1,writable:!1,value:function(){this.search!==u&&(u=this.search,l&&(s=!1,this.searchParams._fromString(this.search),s=!0))}})},i=n.prototype;["hash","host","hostname","port","protocol"].forEach((function(e){!function(e){Object.defineProperty(i,e,{get:function(){return this._anchorElement[e]},set:function(t){this._anchorElement[e]=t},enumerable:!0})}(e)})),Object.defineProperty(i,"search",{get:function(){return this._anchorElement.search},set:function(e){this._anchorElement.search=e,this._updateSearchParams()},enumerable:!0}),Object.defineProperties(i,{toString:{get:function(){var e=this;return function(){return e.href}}},href:{get:function(){return this._anchorElement.href.replace(/\?$/,"")},set:function(e){this._anchorElement.href=e,this._updateSearchParams()},enumerable:!0},pathname:{get:function(){return this._anchorElement.pathname.replace(/(^\/?)/,"/")},set:function(e){this._anchorElement.pathname=e},enumerable:!0},origin:{get:function(){var e={"http:":80,"https:":443,"ftp:":21}[this._anchorElement.protocol],t=this._anchorElement.port!=e&&""!==this._anchorElement.port;return this._anchorElement.protocol+"//"+this._anchorElement.hostname+(t?":"+this._anchorElement.port:"")},enumerable:!0},password:{get:function(){return""},set:function(e){},enumerable:!0},username:{get:function(){return""},set:function(e){},enumerable:!0}}),n.createObjectURL=function(e){return t.createObjectURL.apply(t,arguments)},n.revokeObjectURL=function(e){return t.revokeObjectURL.apply(t,arguments)},e.URL=n}(),void 0!==e.location&&!("origin"in e.location)){var t=function(){return e.location.protocol+"//"+e.location.hostname+(e.location.port?":"+e.location.port:"")};try{Object.defineProperty(e.location,"origin",{get:t,enumerable:!0})}catch(n){setInterval((function(){e.location.origin=t()}),100)}}}(void 0!==e?e:"undefined"!=typeof window?window:"undefined"!=typeof self?self:e);var Oo=Xe("isConcatSpreadable"),Io=zn>=51||!r((function(){var e=[];return e[Oo]=!1,e.concat()[0]!==e})),Lo=Kn("concat"),jo=function(e){if(!g(e))return!1;var t=e[Oo];return void 0!==t?!!t:Ne(e)};Ie({target:"Array",proto:!0,forced:!Io||!Lo},{concat:function(e){var t,n,i,r,a,o=Re(this),s=ot(o,0),l=0;for(t=-1,i=arguments.length;t<i;t++)if(a=-1===t?o:arguments[t],jo(a)){if(l+(r=le(a.length))>9007199254740991)throw TypeError("Maximum allowed index exceeded");for(n=0;n<r;n++,l++)n in a&&Fn(s,l,a[n])}else{if(l>=9007199254740991)throw TypeError("Maximum allowed index exceeded");Fn(s,l++,a)}return s.length=l,s}});var No=ct.filter,Ro=Kn("filter"),Mo=Qt("filter");Ie({target:"Array",proto:!0,forced:!Ro||!Mo},{filter:function(e){return No(this,e,arguments.length>1?arguments[1]:void 0)}});var _o=ct.find,Uo=!0,Do=Qt("find");"find"in[]&&Array(1).find((function(){Uo=!1})),Ie({target:"Array",proto:!0,forced:Uo||!Do},{find:function(e){return _o(this,e,arguments.length>1?arguments[1]:void 0)}}),dn("find");var Fo=Xe("iterator"),qo=!1;try{var Ho=0,Bo={next:function(){return{done:!!Ho++}},return:function(){qo=!0}};Bo[Fo]=function(){return this},Array.from(Bo,(function(){throw 2}))}catch(e){}var Vo=function(e,t){if(!t&&!qo)return!1;var n=!1;try{var i={};i[Fo]=function(){return{next:function(){return{done:n=!0}}}},e(i)}catch(e){}return n},zo=!Vo((function(e){Array.from(e)}));Ie({target:"Array",stat:!0,forced:zo},{from:mr});var Wo=de.includes,Ko=Qt("indexOf",{ACCESSORS:!0,1:0});Ie({target:"Array",proto:!0,forced:!Ko},{includes:function(e){return Wo(this,e,arguments.length>1?arguments[1]:void 0)}}),dn("includes");var $o=ct.map,Yo=Kn("map"),Go=Qt("map");Ie({target:"Array",proto:!0,forced:!Yo||!Go},{map:function(e){return $o(this,e,arguments.length>1?arguments[1]:void 0)}});var Xo=function(e,t,n){var i,r;return An&&"function"==typeof(i=t.constructor)&&i!==n&&g(r=i.prototype)&&r!==n.prototype&&An(e,r),e},Qo="\t\n\v\f\r                 \u2028\u2029\ufeff",Jo="["+Qo+"]",Zo=RegExp("^"+Jo+Jo+"*"),es=RegExp(Jo+Jo+"*$"),ts=function(e){return function(t){var n=String(p(t));return 1&e&&(n=n.replace(Zo,"")),2&e&&(n=n.replace(es,"")),n}},ns={start:ts(1),end:ts(2),trim:ts(3)},is=ye.f,rs=A.f,as=C.f,os=ns.trim,ss=i.Number,ls=ss.prototype,cs="Number"==h(Be(ls)),us=function(e){var t,n,i,r,a,o,s,l,c=v(e,!1);if("string"==typeof c&&c.length>2)if(43===(t=(c=os(c)).charCodeAt(0))||45===t){if(88===(n=c.charCodeAt(2))||120===n)return NaN}else if(48===t){switch(c.charCodeAt(1)){case 66:case 98:i=2,r=49;break;case 79:case 111:i=8,r=55;break;default:return+c}for(o=(a=c.slice(2)).length,s=0;s<o;s++)if((l=a.charCodeAt(s))<48||l>r)return NaN;return parseInt(a,i)}return+c};if(Ce("Number",!ss(" 0o1")||!ss("0b1")||ss("+0x1"))){for(var hs,fs=function(e){var t=arguments.length<1?0:e,n=this;return n instanceof fs&&(cs?r((function(){ls.valueOf.call(n)})):"Number"!=h(n))?Xo(new ss(us(t)),n,fs):us(t)},ds=a?is(ss):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split(","),ps=0;ds.length>ps;ps++)b(ss,hs=ds[ps])&&!b(fs,hs)&&as(fs,hs,rs(ss,hs));fs.prototype=ls,ls.constructor=fs,ee(i,"Number",fs)}var ms=r((function(){Me(1)}));Ie({target:"Object",stat:!0,forced:ms},{keys:function(e){return Me(Re(e))}});var gs=function(e){if(qi(e))throw TypeError("The method doesn't accept regular expressions");return e},vs=Xe("match"),ys=function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[vs]=!1,"/./"[e](t)}catch(e){}}return!1};Ie({target:"String",proto:!0,forced:!ys("includes")},{includes:function(e){return!!~String(p(this)).indexOf(gs(e),arguments.length>1?arguments[1]:void 0)}});var bs=!r((function(){return Object.isExtensible(Object.preventExtensions({}))})),ws=t((function(e){var t=C.f,n=B("meta"),i=0,r=Object.isExtensible||function(){return!0},a=function(e){t(e,n,{value:{objectID:"O"+ ++i,weakData:{}}})},o=e.exports={REQUIRED:!1,fastKey:function(e,t){if(!g(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!b(e,n)){if(!r(e))return"F";if(!t)return"E";a(e)}return e[n].objectID},getWeakData:function(e,t){if(!b(e,n)){if(!r(e))return!0;if(!t)return!1;a(e)}return e[n].weakData},onFreeze:function(e){return bs&&o.REQUIRED&&r(e)&&!b(e,n)&&a(e),e}};W[n]=!0})),ks=(ws.REQUIRED,ws.fastKey,ws.getWeakData,ws.onFreeze,t((function(e){var t=function(e,t){this.stopped=e,this.result=t};(e.exports=function(e,n,i,r,a){var o,s,l,c,u,h,f,d=rt(n,i,r?2:1);if(a)o=e;else{if("function"!=typeof(s=pr(e)))throw TypeError("Target is not iterable");if(fr(s)){for(l=0,c=le(e.length);c>l;l++)if((u=r?d(P(f=e[l])[0],f[1]):d(e[l]))&&u instanceof t)return u;return new t(!1)}o=s.call(e)}for(h=o.next;!(f=h.call(o)).done;)if("object"==typeof(u=cr(o,d,f.value,r))&&u&&u instanceof t)return u;return new t(!1)}).stop=function(e){return new t(!0,e)}}))),Ts=ws.getWeakData,Ss=Z.set,Es=Z.getterFor,As=ct.find,Ps=ct.findIndex,xs=0,Cs=function(e){return e.frozen||(e.frozen=new Os)},Os=function(){this.entries=[]},Is=function(e,t){return As(e.entries,(function(e){return e[0]===t}))};Os.prototype={get:function(e){var t=Is(this,e);if(t)return t[1]},has:function(e){return!!Is(this,e)},set:function(e,t){var n=Is(this,e);n?n[1]=t:this.entries.push([e,t])},delete:function(e){var t=Ps(this.entries,(function(t){return t[0]===e}));return~t&&this.entries.splice(t,1),!!~t}};var Ls={getConstructor:function(e,t,n,i){var r=e((function(e,a){ar(e,r,t),Ss(e,{type:t,id:xs++,frozen:void 0}),null!=a&&ks(a,e[i],e,n)})),a=Es(t),o=function(e,t,n){var i=a(e),r=Ts(P(t),!0);return!0===r?Cs(i).set(t,n):r[i.id]=n,e};return Er(r.prototype,{delete:function(e){var t=a(this);if(!g(e))return!1;var n=Ts(e);return!0===n?Cs(t).delete(e):n&&b(n,t.id)&&delete n[t.id]},has:function(e){var t=a(this);if(!g(e))return!1;var n=Ts(e);return!0===n?Cs(t).has(e):n&&b(n,t.id)}}),Er(r.prototype,n?{get:function(e){var t=a(this);if(g(e)){var n=Ts(e);return!0===n?Cs(t).get(e):n?n[t.id]:void 0}},set:function(e,t){return o(this,e,t)}}:{add:function(e){return o(this,e,!0)}}),r}},js=(t((function(e){var t,n=Z.enforce,a=!i.ActiveXObject&&"ActiveXObject"in i,o=Object.isExtensible,s=function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}},l=e.exports=function(e,t,n){var a=-1!==e.indexOf("Map"),o=-1!==e.indexOf("Weak"),s=a?"set":"add",l=i[e],c=l&&l.prototype,u=l,h={},f=function(e){var t=c[e];ee(c,e,"add"==e?function(e){return t.call(this,0===e?0:e),this}:"delete"==e?function(e){return!(o&&!g(e))&&t.call(this,0===e?0:e)}:"get"==e?function(e){return o&&!g(e)?void 0:t.call(this,0===e?0:e)}:"has"==e?function(e){return!(o&&!g(e))&&t.call(this,0===e?0:e)}:function(e,n){return t.call(this,0===e?0:e,n),this})};if(Ce(e,"function"!=typeof l||!(o||c.forEach&&!r((function(){(new l).entries().next()})))))u=n.getConstructor(t,e,a,s),ws.REQUIRED=!0;else if(Ce(e,!0)){var d=new u,p=d[s](o?{}:-0,1)!=d,m=r((function(){d.has(1)})),v=Vo((function(e){new l(e)})),y=!o&&r((function(){for(var e=new l,t=5;t--;)e[s](t,t);return!e.has(-0)}));v||((u=t((function(t,n){ar(t,u,e);var i=Xo(new l,t,u);return null!=n&&ks(n,i[s],i,a),i}))).prototype=c,c.constructor=u),(m||y)&&(f("delete"),f("has"),a&&f("get")),(y||p)&&f(s),o&&c.clear&&delete c.clear}return h[e]=u,Ie({global:!0,forced:u!=l},h),nt(u,e),o||n.setStrong(u,e,a),u}("WeakMap",s,Ls);if(D&&a){t=Ls.getConstructor(s,"WeakMap",!0),ws.REQUIRED=!0;var c=l.prototype,u=c.delete,h=c.has,f=c.get,d=c.set;Er(c,{delete:function(e){if(g(e)&&!o(e)){var i=n(this);return i.frozen||(i.frozen=new t),u.call(this,e)||i.frozen.delete(e)}return u.call(this,e)},has:function(e){if(g(e)&&!o(e)){var i=n(this);return i.frozen||(i.frozen=new t),h.call(this,e)||i.frozen.has(e)}return h.call(this,e)},get:function(e){if(g(e)&&!o(e)){var i=n(this);return i.frozen||(i.frozen=new t),h.call(this,e)?f.call(this,e):i.frozen.get(e)}return f.call(this,e)},set:function(e,i){if(g(e)&&!o(e)){var r=n(this);r.frozen||(r.frozen=new t),h.call(this,e)?d.call(this,e,i):r.frozen.set(e,i)}else d.call(this,e,i);return this}})}})),ct.every),Ns=$t("every"),Rs=Qt("every");Ie({target:"Array",proto:!0,forced:!Ns||!Rs},{every:function(e){return js(this,e,arguments.length>1?arguments[1]:void 0)}}),Ie({target:"Object",stat:!0,forced:Object.assign!==lr},{assign:lr});var Ms=ns.trim;Ie({target:"String",proto:!0,forced:function(e){return r((function(){return!!Qo[e]()||"​…᠎"!="​…᠎"[e]()||Qo[e].name!==e}))}("trim")},{trim:function(){return Ms(this)}});var _s=ct.some,Us=$t("some"),Ds=Qt("some");Ie({target:"Array",proto:!0,forced:!Us||!Ds},{some:function(e){return _s(this,e,arguments.length>1?arguments[1]:void 0)}});var Fs="".repeat||function(e){var t=String(p(this)),n="",i=oe(e);if(i<0||i==1/0)throw RangeError("Wrong number of repetitions");for(;i>0;(i>>>=1)&&(t+=t))1&i&&(n+=t);return n},qs=1..toFixed,Hs=Math.floor,Bs=function(e,t,n){return 0===t?n:t%2==1?Bs(e,t-1,n*e):Bs(e*e,t/2,n)},Vs=qs&&("0.000"!==8e-5.toFixed(3)||"1"!==.9.toFixed(0)||"1.25"!==1.255.toFixed(2)||"1000000000000000128"!==(0xde0b6b3a7640080).toFixed(0))||!r((function(){qs.call({})}));Ie({target:"Number",proto:!0,forced:Vs},{toFixed:function(e){var t,n,i,r,a=function(e){if("number"!=typeof e&&"Number"!=h(e))throw TypeError("Incorrect invocation");return+e}(this),o=oe(e),s=[0,0,0,0,0,0],l="",c="0",u=function(e,t){for(var n=-1,i=t;++n<6;)i+=e*s[n],s[n]=i%1e7,i=Hs(i/1e7)},f=function(e){for(var t=6,n=0;--t>=0;)n+=s[t],s[t]=Hs(n/e),n=n%e*1e7},d=function(){for(var e=6,t="";--e>=0;)if(""!==t||0===e||0!==s[e]){var n=String(s[e]);t=""===t?n:t+Fs.call("0",7-n.length)+n}return t};if(o<0||o>20)throw RangeError("Incorrect fraction digits");if(a!=a)return"NaN";if(a<=-1e21||a>=1e21)return String(a);if(a<0&&(l="-",a=-a),a>1e-21)if(n=(t=function(e){for(var t=0,n=e;n>=4096;)t+=12,n/=4096;for(;n>=2;)t+=1,n/=2;return t}(a*Bs(2,69,1))-69)<0?a*Bs(2,-t,1):a/Bs(2,t,1),n*=4503599627370496,(t=52-t)>0){for(u(0,n),i=o;i>=7;)u(1e7,0),i-=7;for(u(Bs(10,i,1),0),i=t-1;i>=23;)f(1<<23),i-=23;f(1<<i),u(1,1),f(2),c=d()}else u(0,n),u(1<<-t,0),c=d()+Fs.call("0",o);return c=o>0?l+((r=c.length)<=o?"0."+Fs.call("0",o-r)+c:c.slice(0,r-o)+"."+c.slice(r-o)):l+c}});var zs=l.f,Ws=function(e){return function(t){for(var n,i=m(t),r=Me(i),o=r.length,s=0,l=[];o>s;)n=r[s++],a&&!zs.call(i,n)||l.push(e?[n,i[n]]:i[n]);return l}},Ks={entries:Ws(!0),values:Ws(!1)},$s=Ks.entries;Ie({target:"Object",stat:!0},{entries:function(e){return $s(e)}});var Ys=Ks.values;Ie({target:"Object",stat:!0},{values:function(e){return Ys(e)}}),Ie({target:"Number",stat:!0},{isNaN:function(e){return e!=e}});var Gs=A.f,Xs=r((function(){Gs(1)}));function Qs(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function Js(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Zs(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function el(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Zs(Object(n),!0).forEach((function(t){Js(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Zs(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}Ie({target:"Object",stat:!0,forced:!a||Xs,sham:!a},{getOwnPropertyDescriptor:function(e,t){return Gs(m(e),t)}}),Ie({target:"Object",stat:!0,sham:!a},{getOwnPropertyDescriptors:function(e){for(var t,n,i=m(e),r=A.f,a=we(i),o={},s=0;a.length>s;)void 0!==(n=r(i,t=a[s++]))&&Fn(o,t,n);return o}}),Oi("match",1,(function(e,t,n){return[function(t){var n=p(this),i=null==t?void 0:t[e];return void 0!==i?i.call(t,n):new RegExp(t)[e](String(n))},function(e){var i=n(t,e,this);if(i.done)return i.value;var r=P(e),a=String(this);if(!r.global)return ji(r,a);var o=r.unicode;r.lastIndex=0;for(var s,l=[],c=0;null!==(s=ji(r,a));){var u=String(s[0]);l[c]=u,""===u&&(r.lastIndex=Li(a,le(r.lastIndex),o)),c++}return 0===c?null:l}]}));var tl={addCSS:!0,thumbWidth:15,watch:!0};function nl(e,t){return function(){return Array.from(document.querySelectorAll(t)).includes(this)}.call(e,t)}var il=function(e){return null!=e?e.constructor:null},rl=function(e,t){return!!(e&&t&&e instanceof t)},al=function(e){return null==e},ol=function(e){return il(e)===Object},sl=function(e){return il(e)===String},ll=function(e){return Array.isArray(e)},cl=function(e){return rl(e,NodeList)},ul=sl,hl=ll,fl=cl,dl=function(e){return rl(e,Element)},pl=function(e){return rl(e,Event)},ml=function(e){return al(e)||(sl(e)||ll(e)||cl(e))&&!e.length||ol(e)&&!Object.keys(e).length};function gl(e,t){if(1>t){var n=function(e){var t="".concat(e).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return t?Math.max(0,(t[1]?t[1].length:0)-(t[2]?+t[2]:0)):0}(t);return parseFloat(e.toFixed(n))}return Math.round(e/t)*t}var vl,yl,bl,wl=function(){function e(t,n){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),dl(t)?this.element=t:ul(t)&&(this.element=document.querySelector(t)),dl(this.element)&&ml(this.element.rangeTouch)&&(this.config=el({},tl,{},n),this.init())}return function(e,t,n){t&&Qs(e.prototype,t),n&&Qs(e,n)}(e,[{key:"init",value:function(){e.enabled&&(this.config.addCSS&&(this.element.style.userSelect="none",this.element.style.webKitUserSelect="none",this.element.style.touchAction="manipulation"),this.listeners(!0),this.element.rangeTouch=this)}},{key:"destroy",value:function(){e.enabled&&(this.config.addCSS&&(this.element.style.userSelect="",this.element.style.webKitUserSelect="",this.element.style.touchAction=""),this.listeners(!1),this.element.rangeTouch=null)}},{key:"listeners",value:function(e){var t=this,n=e?"addEventListener":"removeEventListener";["touchstart","touchmove","touchend"].forEach((function(e){t.element[n](e,(function(e){return t.set(e)}),!1)}))}},{key:"get",value:function(t){if(!e.enabled||!pl(t))return null;var n,i=t.target,r=t.changedTouches[0],a=parseFloat(i.getAttribute("min"))||0,o=parseFloat(i.getAttribute("max"))||100,s=parseFloat(i.getAttribute("step"))||1,l=i.getBoundingClientRect(),c=100/l.width*(this.config.thumbWidth/2)/100;return 0>(n=100/l.width*(r.clientX-l.left))?n=0:100<n&&(n=100),50>n?n-=(100-2*n)*c:50<n&&(n+=2*(n-50)*c),a+gl(n/100*(o-a),s)}},{key:"set",value:function(t){e.enabled&&pl(t)&&!t.target.disabled&&(t.preventDefault(),t.target.value=this.get(t),function(e,t){if(e&&t){var n=new Event(t,{bubbles:!0});e.dispatchEvent(n)}}(t.target,"touchend"===t.type?"change":"input"))}}],[{key:"setup",value:function(t){var n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},i=null;if(ml(t)||ul(t)?i=Array.from(document.querySelectorAll(ul(t)?t:'input[type="range"]')):dl(t)?i=[t]:fl(t)?i=Array.from(t):hl(t)&&(i=t.filter(dl)),ml(i))return null;var r=el({},tl,{},n);if(ul(t)&&r.watch){var a=new MutationObserver((function(n){Array.from(n).forEach((function(n){Array.from(n.addedNodes).forEach((function(n){dl(n)&&nl(n,t)&&new e(n,r)}))}))}));a.observe(document.body,{childList:!0,subtree:!0})}return i.map((function(t){return new e(t,n)}))}},{key:"enabled",get:function(){return"ontouchstart"in document.documentElement}}]),e}(),kl=i.Promise,Tl=Xe("species"),Sl=function(e){var t=ie(e),n=C.f;a&&t&&!t[Tl]&&n(t,Tl,{configurable:!0,get:function(){return this}})},El=/(iphone|ipod|ipad).*applewebkit/i.test(qn),Al=i.location,Pl=i.setImmediate,xl=i.clearImmediate,Cl=i.process,Ol=i.MessageChannel,Il=i.Dispatch,Ll=0,jl={},Nl=function(e){if(jl.hasOwnProperty(e)){var t=jl[e];delete jl[e],t()}},Rl=function(e){return function(){Nl(e)}},Ml=function(e){Nl(e.data)},_l=function(e){i.postMessage(e+"",Al.protocol+"//"+Al.host)};Pl&&xl||(Pl=function(e){for(var t=[],n=1;arguments.length>n;)t.push(arguments[n++]);return jl[++Ll]=function(){("function"==typeof e?e:Function(e)).apply(void 0,t)},vl(Ll),Ll},xl=function(e){delete jl[e]},"process"==h(Cl)?vl=function(e){Cl.nextTick(Rl(e))}:Il&&Il.now?vl=function(e){Il.now(Rl(e))}:Ol&&!El?(bl=(yl=new Ol).port2,yl.port1.onmessage=Ml,vl=rt(bl.postMessage,bl,1)):!i.addEventListener||"function"!=typeof postMessage||i.importScripts||r(_l)||"file:"===Al.protocol?vl="onreadystatechange"in T("script")?function(e){Ue.appendChild(T("script")).onreadystatechange=function(){Ue.removeChild(this),Nl(e)}}:function(e){setTimeout(Rl(e),0)}:(vl=_l,i.addEventListener("message",Ml,!1)));var Ul,Dl,Fl,ql,Hl,Bl,Vl,zl,Wl={set:Pl,clear:xl},Kl=A.f,$l=Wl.set,Yl=i.MutationObserver||i.WebKitMutationObserver,Gl=i.process,Xl=i.Promise,Ql="process"==h(Gl),Jl=Kl(i,"queueMicrotask"),Zl=Jl&&Jl.value;Zl||(Ul=function(){var e,t;for(Ql&&(e=Gl.domain)&&e.exit();Dl;){t=Dl.fn,Dl=Dl.next;try{t()}catch(e){throw Dl?ql():Fl=void 0,e}}Fl=void 0,e&&e.enter()},Ql?ql=function(){Gl.nextTick(Ul)}:Yl&&!El?(Hl=!0,Bl=document.createTextNode(""),new Yl(Ul).observe(Bl,{characterData:!0}),ql=function(){Bl.data=Hl=!Hl}):Xl&&Xl.resolve?(Vl=Xl.resolve(void 0),zl=Vl.then,ql=function(){zl.call(Vl,Ul)}):ql=function(){$l.call(i,Ul)});var ec,tc,nc,ic,rc=Zl||function(e){var t={fn:e,next:void 0};Fl&&(Fl.next=t),Dl||(Dl=t,ql()),Fl=t},ac=function(e){var t,n;this.promise=new e((function(e,i){if(void 0!==t||void 0!==n)throw TypeError("Bad Promise constructor");t=e,n=i})),this.resolve=it(t),this.reject=it(n)},oc={f:function(e){return new ac(e)}},sc=function(e,t){if(P(e),g(t)&&t.constructor===e)return t;var n=oc.f(e);return(0,n.resolve)(t),n.promise},lc=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}},cc=Wl.set,uc=Xe("species"),hc="Promise",fc=Z.get,dc=Z.set,pc=Z.getterFor(hc),mc=kl,gc=i.TypeError,vc=i.document,yc=i.process,bc=ie("fetch"),wc=oc.f,kc=wc,Tc="process"==h(yc),Sc=!!(vc&&vc.createEvent&&i.dispatchEvent),Ec=Ce(hc,(function(){if(!(_(mc)!==String(mc))){if(66===zn)return!0;if(!Tc&&"function"!=typeof PromiseRejectionEvent)return!0}if(zn>=51&&/native code/.test(mc))return!1;var e=mc.resolve(1),t=function(e){e((function(){}),(function(){}))};return(e.constructor={})[uc]=t,!(e.then((function(){}))instanceof t)})),Ac=Ec||!Vo((function(e){mc.all(e).catch((function(){}))})),Pc=function(e){var t;return!(!g(e)||"function"!=typeof(t=e.then))&&t},xc=function(e,t,n){if(!t.notified){t.notified=!0;var i=t.reactions;rc((function(){for(var r=t.value,a=1==t.state,o=0;i.length>o;){var s,l,c,u=i[o++],h=a?u.ok:u.fail,f=u.resolve,d=u.reject,p=u.domain;try{h?(a||(2===t.rejection&&Lc(e,t),t.rejection=1),!0===h?s=r:(p&&p.enter(),s=h(r),p&&(p.exit(),c=!0)),s===u.promise?d(gc("Promise-chain cycle")):(l=Pc(s))?l.call(s,f,d):f(s)):d(r)}catch(e){p&&!c&&p.exit(),d(e)}}t.reactions=[],t.notified=!1,n&&!t.rejection&&Oc(e,t)}))}},Cc=function(e,t,n){var r,a;Sc?((r=vc.createEvent("Event")).promise=t,r.reason=n,r.initEvent(e,!1,!0),i.dispatchEvent(r)):r={promise:t,reason:n},(a=i["on"+e])?a(r):"unhandledrejection"===e&&function(e,t){var n=i.console;n&&n.error&&(1===arguments.length?n.error(e):n.error(e,t))}("Unhandled promise rejection",n)},Oc=function(e,t){cc.call(i,(function(){var n,i=t.value;if(Ic(t)&&(n=lc((function(){Tc?yc.emit("unhandledRejection",i,e):Cc("unhandledrejection",e,i)})),t.rejection=Tc||Ic(t)?2:1,n.error))throw n.value}))},Ic=function(e){return 1!==e.rejection&&!e.parent},Lc=function(e,t){cc.call(i,(function(){Tc?yc.emit("rejectionHandled",e):Cc("rejectionhandled",e,t.value)}))},jc=function(e,t,n,i){return function(r){e(t,n,r,i)}},Nc=function(e,t,n,i){t.done||(t.done=!0,i&&(t=i),t.value=n,t.state=2,xc(e,t,!0))},Rc=function(e,t,n,i){if(!t.done){t.done=!0,i&&(t=i);try{if(e===n)throw gc("Promise can't be resolved itself");var r=Pc(n);r?rc((function(){var i={done:!1};try{r.call(n,jc(Rc,e,i,t),jc(Nc,e,i,t))}catch(n){Nc(e,i,n,t)}})):(t.value=n,t.state=1,xc(e,t,!1))}catch(n){Nc(e,{done:!1},n,t)}}};Ec&&(mc=function(e){ar(this,mc,hc),it(e),ec.call(this);var t=fc(this);try{e(jc(Rc,this,t),jc(Nc,this,t))}catch(e){Nc(this,t,e)}},(ec=function(e){dc(this,{type:hc,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=Er(mc.prototype,{then:function(e,t){var n=pc(this),i=wc(Bi(this,mc));return i.ok="function"!=typeof e||e,i.fail="function"==typeof t&&t,i.domain=Tc?yc.domain:void 0,n.parent=!0,n.reactions.push(i),0!=n.state&&xc(this,n,!1),i.promise},catch:function(e){return this.then(void 0,e)}}),tc=function(){var e=new ec,t=fc(e);this.promise=e,this.resolve=jc(Rc,e,t),this.reject=jc(Nc,e,t)},oc.f=wc=function(e){return e===mc||e===nc?new tc(e):kc(e)},"function"==typeof kl&&(ic=kl.prototype.then,ee(kl.prototype,"then",(function(e,t){var n=this;return new mc((function(e,t){ic.call(n,e,t)})).then(e,t)}),{unsafe:!0}),"function"==typeof bc&&Ie({global:!0,enumerable:!0,forced:!0},{fetch:function(e){return sc(mc,bc.apply(i,arguments))}}))),Ie({global:!0,wrap:!0,forced:Ec},{Promise:mc}),nt(mc,hc,!1),Sl(hc),nc=ie(hc),Ie({target:hc,stat:!0,forced:Ec},{reject:function(e){var t=wc(this);return t.reject.call(void 0,e),t.promise}}),Ie({target:hc,stat:!0,forced:Ec},{resolve:function(e){return sc(this,e)}}),Ie({target:hc,stat:!0,forced:Ac},{all:function(e){var t=this,n=wc(t),i=n.resolve,r=n.reject,a=lc((function(){var n=it(t.resolve),a=[],o=0,s=1;ks(e,(function(e){var l=o++,c=!1;a.push(void 0),s++,n.call(t,e).then((function(e){c||(c=!0,a[l]=e,--s||i(a))}),r)})),--s||i(a)}));return a.error&&r(a.value),n.promise},race:function(e){var t=this,n=wc(t),i=n.reject,r=lc((function(){var r=it(t.resolve);ks(e,(function(e){r.call(t,e).then(n.resolve,i)}))}));return r.error&&i(r.value),n.promise}});var Mc,_c=A.f,Uc="".startsWith,Dc=Math.min,Fc=ys("startsWith"),qc=!(Fc||(Mc=_c(String.prototype,"startsWith"),!Mc||Mc.writable));Ie({target:"String",proto:!0,forced:!qc&&!Fc},{startsWith:function(e){var t=String(p(this));gs(e);var n=le(Dc(arguments.length>1?arguments[1]:void 0,t.length)),i=String(e);return Uc?Uc.call(t,i,n):t.slice(n,n+i.length)===i}});var Hc,Bc,Vc,zc=function(e){return null!=e?e.constructor:null},Wc=function(e,t){return Boolean(e&&t&&e instanceof t)},Kc=function(e){return null==e},$c=function(e){return zc(e)===Object},Yc=function(e){return zc(e)===String},Gc=function(e){return zc(e)===Function},Xc=function(e){return Array.isArray(e)},Qc=function(e){return Wc(e,NodeList)},Jc=function(e){return Kc(e)||(Yc(e)||Xc(e)||Qc(e))&&!e.length||$c(e)&&!Object.keys(e).length},Zc=Kc,eu=$c,tu=function(e){return zc(e)===Number&&!Number.isNaN(e)},nu=Yc,iu=function(e){return zc(e)===Boolean},ru=Gc,au=Xc,ou=Qc,su=function(e){return Wc(e,Element)},lu=function(e){return Wc(e,Event)},cu=function(e){return Wc(e,KeyboardEvent)},uu=function(e){return Wc(e,TextTrack)||!Kc(e)&&Yc(e.kind)},hu=function(e){return Wc(e,Promise)&&Gc(e.then)},fu=function(e){if(Wc(e,window.URL))return!0;if(!Yc(e))return!1;var t=e;e.startsWith("http://")&&e.startsWith("https://")||(t="http://".concat(e));try{return!Jc(new URL(t).hostname)}catch(e){return!1}},du=Jc,pu=(Hc=document.createElement("span"),Bc={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"},Vc=Object.keys(Bc).find((function(e){return void 0!==Hc.style[e]})),!!nu(Vc)&&Bc[Vc]);function mu(e,t){setTimeout((function(){try{e.hidden=!0,e.offsetHeight,e.hidden=!1}catch(e){}}),t)}var gu={isIE:
2
  /* @cc_on!@ */
3
- !!document.documentMode,isEdge:window.navigator.userAgent.includes("Edge"),isWebkit:"WebkitAppearance"in document.documentElement.style&&!/Edge/.test(navigator.userAgent),isIPhone:/(iPhone|iPod)/gi.test(navigator.platform),isIos:/(iPad|iPhone|iPod)/gi.test(navigator.platform)},vu=function(e){return function(t,n,i,r){it(n);var a=Re(t),o=d(a),s=le(a.length),l=e?s-1:0,c=e?-1:1;if(i<2)for(;;){if(l in o){r=o[l],l+=c;break}if(l+=c,e?l<0:s<=l)throw TypeError("Reduce of empty array with no initial value")}for(;e?l>=0:s>l;l+=c)l in o&&(r=n(r,o[l],l,a));return r}},yu={left:vu(!1),right:vu(!0)}.left,bu=$t("reduce"),wu=Qt("reduce",{1:0});function ku(e,t){return t.split(".").reduce((function(e,t){return e&&e[t]}),e)}function Tu(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];if(!n.length)return e;var r=n.shift();return eu(r)?(Object.keys(r).forEach((function(t){eu(r[t])?(Object.keys(e).includes(t)||Object.assign(e,ko({},t,{})),Tu(e[t],r[t])):Object.assign(e,ko({},t,r[t]))})),Tu.apply(void 0,[e].concat(n))):e}function Su(e,t){var n=e.length?e:[e];Array.from(n).reverse().forEach((function(e,n){var i=n>0?t.cloneNode(!0):t,r=e.parentNode,a=e.nextSibling;i.appendChild(e),a?r.insertBefore(i,a):r.appendChild(i)}))}function Eu(e,t){su(e)&&!du(t)&&Object.entries(t).filter((function(e){var t=Ao(e,2)[1];return!Zc(t)})).forEach((function(t){var n=Ao(t,2),i=n[0],r=n[1];return e.setAttribute(i,r)}))}function Au(e,t,n){var i=document.createElement(e);return eu(t)&&Eu(i,t),nu(n)&&(i.innerText=n),i}function Pu(e,t,n,i){su(t)&&t.appendChild(Au(e,n,i))}function xu(e){ou(e)||au(e)?Array.from(e).forEach(xu):su(e)&&su(e.parentNode)&&e.parentNode.removeChild(e)}function Cu(e){if(su(e))for(var t=e.childNodes.length;t>0;)e.removeChild(e.lastChild),t-=1}function Ou(e,t){return su(t)&&su(t.parentNode)&&su(e)?(t.parentNode.replaceChild(e,t),e):null}function Iu(e,t){if(!nu(e)||du(e))return{};var n={},i=Tu({},t);return e.split(",").forEach((function(e){var t=e.trim(),r=t.replace(".",""),a=t.replace(/[[\]]/g,"").split("="),o=Ao(a,1)[0],s=a.length>1?a[1].replace(/["']/g,""):"";switch(t.charAt(0)){case".":nu(i.class)?n.class="".concat(i.class," ").concat(r):n.class=r;break;case"#":n.id=t.replace("#","");break;case"[":n[o]=s}})),Tu(i,n)}function Lu(e,t){if(su(e)){var n=t;iu(n)||(n=!e.hidden),e.hidden=n}}function ju(e,t,n){if(ou(e))return Array.from(e).map((function(e){return ju(e,t,n)}));if(su(e)){var i="toggle";return void 0!==n&&(i=n?"add":"remove"),e.classList[i](t),e.classList.contains(t)}return!1}function Nu(e,t){return su(e)&&e.classList.contains(t)}function Ru(e,t){var n=Element.prototype;return(n.matches||n.webkitMatchesSelector||n.mozMatchesSelector||n.msMatchesSelector||function(){return Array.from(document.querySelectorAll(t)).includes(this)}).call(e,t)}function Mu(e){return this.elements.container.querySelectorAll(e)}function _u(e){return this.elements.container.querySelector(e)}function Uu(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];su(e)&&(e.focus({preventScroll:!0}),t&&ju(e,this.config.classNames.tabFocus))}Ie({target:"Array",proto:!0,forced:!bu||!wu},{reduce:function(e){return yu(this,e,arguments.length,arguments.length>1?arguments[1]:void 0)}});var Du,Fu={"audio/ogg":"vorbis","audio/wav":"1","video/webm":"vp8, vorbis","video/mp4":"avc1.42E01E, mp4a.40.2","video/ogg":"theora"},qu={audio:"canPlayType"in document.createElement("audio"),video:"canPlayType"in document.createElement("video"),check:function(e,t,n){var i=gu.isIPhone&&n&&qu.playsinline,r=qu[e]||"html5"!==t;return{api:r,ui:r&&qu.rangeInput&&("video"!==e||!gu.isIPhone||i)}},pip:!(gu.isIPhone||!ru(Au("video").webkitSetPresentationMode)&&(!document.pictureInPictureEnabled||Au("video").disablePictureInPicture)),airplay:ru(window.WebKitPlaybackTargetAvailabilityEvent),playsinline:"playsInline"in document.createElement("video"),mime:function(e){if(du(e))return!1;var t=Ao(e.split("/"),1)[0],n=e;if(!this.isHTML5||t!==this.type)return!1;Object.keys(Fu).includes(n)&&(n+='; codecs="'.concat(Fu[e],'"'));try{return Boolean(n&&this.media.canPlayType(n).replace(/no/,""))}catch(e){return!1}},textTracks:"textTracks"in document.createElement("video"),rangeInput:(Du=document.createElement("input"),Du.type="range","range"===Du.type),touch:"ontouchstart"in document.documentElement,transitions:!1!==pu,reducedMotion:"matchMedia"in window&&window.matchMedia("(prefers-reduced-motion)").matches},Hu=function(){var e=!1;try{var t=Object.defineProperty({},"passive",{get:function(){return e=!0,null}});window.addEventListener("test",null,t),window.removeEventListener("test",null,t)}catch(e){}return e}();function Bu(e,t,n){var i=this,r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],o=arguments.length>5&&void 0!==arguments[5]&&arguments[5];if(e&&"addEventListener"in e&&!du(t)&&ru(n)){var s=t.split(" "),l=o;Hu&&(l={passive:a,capture:o}),s.forEach((function(t){i&&i.eventListeners&&r&&i.eventListeners.push({element:e,type:t,callback:n,options:l}),e[r?"addEventListener":"removeEventListener"](t,n,l)}))}}function Vu(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2?arguments[2]:void 0,i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],r=arguments.length>4&&void 0!==arguments[4]&&arguments[4];Bu.call(this,e,t,n,!0,i,r)}function zu(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2?arguments[2]:void 0,i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],r=arguments.length>4&&void 0!==arguments[4]&&arguments[4];Bu.call(this,e,t,n,!1,i,r)}function Wu(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2?arguments[2]:void 0,r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],a=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o=function o(){zu(e,n,o,r,a);for(var s=arguments.length,l=new Array(s),c=0;c<s;c++)l[c]=arguments[c];i.apply(t,l)};Bu.call(this,e,n,o,!0,r,a)}function Ku(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(su(e)&&!du(t)){var r=new CustomEvent(t,{bubbles:n,detail:So(So({},i),{},{plyr:this})});e.dispatchEvent(r)}}function $u(){this&&this.eventListeners&&(this.eventListeners.forEach((function(e){var t=e.element,n=e.type,i=e.callback,r=e.options;t.removeEventListener(n,i,r)})),this.eventListeners=[])}function Yu(){var e=this;return new Promise((function(t){return e.ready?setTimeout(t,0):Vu.call(e,e.elements.container,"ready",t)})).then((function(){}))}function Gu(e){hu(e)&&e.then(null,(function(){}))}function Xu(e){return!!(au(e)||nu(e)&&e.includes(":"))&&(au(e)?e:e.split(":")).map(Number).every(tu)}function Qu(e){if(!au(e)||!e.every(tu))return null;var t=Ao(e,2),n=t[0],i=t[1],r=function e(t,n){return 0===n?t:e(n,t%n)}(n,i);return[n/r,i/r]}function Ju(e){var t=function(e){return Xu(e)?e.split(":").map(Number):null},n=t(e);if(null===n&&(n=t(this.config.ratio)),null===n&&!du(this.embed)&&au(this.embed.ratio)&&(n=this.embed.ratio),null===n&&this.isHTML5){var i=this.media;n=Qu([i.videoWidth,i.videoHeight])}return n}function Zu(e){if(!this.isVideo)return{};var t=this.elements.wrapper,n=Ju.call(this,e),i=Ao(au(n)?n:[0,0],2),r=100/i[0]*i[1];if(t.style.paddingBottom="".concat(r,"%"),this.isVimeo&&!this.config.vimeo.premium&&this.supported.ui){var a=100/this.media.offsetWidth*parseInt(window.getComputedStyle(this.media).paddingBottom,10),o=(a-r)/(a/50);this.media.style.transform="translateY(-".concat(o,"%)")}else this.isHTML5&&t.classList.toggle(this.config.classNames.videoFixedRatio,null!==n);return{padding:r,ratio:n}}var eh={getSources:function(){var e=this;return this.isHTML5?Array.from(this.media.querySelectorAll("source")).filter((function(t){var n=t.getAttribute("type");return!!du(n)||qu.mime.call(e,n)})):[]},getQualityOptions:function(){return this.config.quality.forced?this.config.quality.options:eh.getSources.call(this).map((function(e){return Number(e.getAttribute("size"))})).filter(Boolean)},setup:function(){if(this.isHTML5){var e=this;e.options.speed=e.config.speed.options,du(this.config.ratio)||Zu.call(e),Object.defineProperty(e.media,"quality",{get:function(){var t=eh.getSources.call(e).find((function(t){return t.getAttribute("src")===e.source}));return t&&Number(t.getAttribute("size"))},set:function(t){if(e.quality!==t){if(e.config.quality.forced&&ru(e.config.quality.onChange))e.config.quality.onChange(t);else{var n=eh.getSources.call(e).find((function(e){return Number(e.getAttribute("size"))===t}));if(!n)return;var i=e.media,r=i.currentTime,a=i.paused,o=i.preload,s=i.readyState,l=i.playbackRate;e.media.src=n.getAttribute("src"),("none"!==o||s)&&(e.once("loadedmetadata",(function(){e.speed=l,e.currentTime=r,a||Gu(e.play())})),e.media.load())}Ku.call(e,e.media,"qualitychange",!1,{quality:t})}}})}},cancelRequests:function(){this.isHTML5&&(xu(eh.getSources.call(this)),this.media.setAttribute("src",this.config.blankVideo),this.media.load(),this.debug.log("Cancelled network requests"))}};function th(e){return au(e)?e.filter((function(t,n){return e.indexOf(t)===n})):e}var nh=C.f,ih=ye.f,rh=Z.set,ah=Xe("match"),oh=i.RegExp,sh=oh.prototype,lh=/a/g,ch=/a/g,uh=new oh(lh)!==lh,hh=oi.UNSUPPORTED_Y;if(a&&Ce("RegExp",!uh||hh||r((function(){return ch[ah]=!1,oh(lh)!=lh||oh(ch)==ch||"/a/i"!=oh(lh,"i")})))){for(var fh=function(e,t){var n,i=this instanceof fh,r=qi(e),a=void 0===t;if(!i&&r&&e.constructor===fh&&a)return e;uh?r&&!a&&(e=e.source):e instanceof fh&&(a&&(t=ri.call(e)),e=e.source),hh&&(n=!!t&&t.indexOf("y")>-1)&&(t=t.replace(/y/g,""));var o=Xo(uh?new oh(e,t):oh(e,t),i?this:sh,fh);return hh&&n&&rh(o,{sticky:n}),o},dh=function(e){e in fh||nh(fh,e,{configurable:!0,get:function(){return oh[e]},set:function(t){oh[e]=t}})},ph=ih(oh),mh=0;ph.length>mh;)dh(ph[mh++]);sh.constructor=fh,fh.prototype=sh,ee(i,"RegExp",fh)}function gh(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return du(e)?e:e.toString().replace(/{(\d+)}/g,(function(e,t){return n[t].toString()}))}Sl("RegExp");var vh=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return e.replace(new RegExp(t.toString().replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1"),"g"),n.toString())},yh=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e.toString().replace(/\w\S*/g,(function(e){return e.charAt(0).toUpperCase()+e.substr(1).toLowerCase()}))};function bh(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=e.toString();return t=vh(t,"-"," "),t=vh(t,"_"," "),t=yh(t),vh(t," ","")}function wh(e){var t=document.createElement("div");return t.appendChild(e),t.innerHTML}var kh={pip:"PIP",airplay:"AirPlay",html5:"HTML5",vimeo:"Vimeo",youtube:"YouTube"},Th=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(du(e)||du(t))return"";var n=ku(t.i18n,e);if(du(n))return Object.keys(kh).includes(e)?kh[e]:"";var i={"{seektime}":t.seekTime,"{title}":t.title};return Object.entries(i).forEach((function(e){var t=Ao(e,2),i=t[0],r=t[1];n=vh(n,i,r)})),n},Sh=function(){function e(t){yo(this,e),this.enabled=t.config.storage.enabled,this.key=t.config.storage.key}return wo(e,[{key:"get",value:function(t){if(!e.supported||!this.enabled)return null;var n=window.localStorage.getItem(this.key);if(du(n))return null;var i=JSON.parse(n);return nu(t)&&t.length?i[t]:i}},{key:"set",value:function(t){if(e.supported&&this.enabled&&eu(t)){var n=this.get();du(n)&&(n={}),Tu(n,t),window.localStorage.setItem(this.key,JSON.stringify(n))}}}],[{key:"supported",get:function(){try{if(!("localStorage"in window))return!1;return window.localStorage.setItem("___test","___test"),window.localStorage.removeItem("___test"),!0}catch(e){return!1}}}]),e}();function Eh(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"text";return new Promise((function(n,i){try{var r=new XMLHttpRequest;if(!("withCredentials"in r))return;r.addEventListener("load",(function(){if("text"===t)try{n(JSON.parse(r.responseText))}catch(e){n(r.responseText)}else n(r.response)})),r.addEventListener("error",(function(){throw new Error(r.status)})),r.open("GET",e,!0),r.responseType=t,r.send()}catch(e){i(e)}}))}function Ah(e,t){if(nu(e)){var n=nu(t),i=function(){return null!==document.getElementById(t)},r=function(e,t){e.innerHTML=t,n&&i()||document.body.insertAdjacentElement("afterbegin",e)};if(!n||!i()){var a=Sh.supported,o=document.createElement("div");if(o.setAttribute("hidden",""),n&&o.setAttribute("id",t),a){var s=window.localStorage.getItem("".concat("cache","-").concat(t));if(null!==s){var l=JSON.parse(s);r(o,l.content)}}Eh(e).then((function(e){du(e)||(a&&window.localStorage.setItem("".concat("cache","-").concat(t),JSON.stringify({content:e})),r(o,e))})).catch((function(){}))}}}var Ph=Math.ceil,xh=Math.floor;Ie({target:"Math",stat:!0},{trunc:function(e){return(e>0?xh:Ph)(e)}});var Ch=function(e){return Math.trunc(e/60/60%60,10)},Oh=function(e){return Math.trunc(e/60%60,10)},Ih=function(e){return Math.trunc(e%60,10)};function Lh(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!tu(e))return Lh(void 0,t,n);var i=function(e){return"0".concat(e).slice(-2)},r=Ch(e),a=Oh(e),o=Ih(e);return r=t||r>0?"".concat(r,":"):"","".concat(n&&e>0?"-":"").concat(r).concat(i(a),":").concat(i(o))}var jh={getIconUrl:function(){var e=new URL(this.config.iconUrl,window.location).host!==window.location.host||gu.isIE&&!window.svg4everybody;return{url:this.config.iconUrl,cors:e}},findElements:function(){try{return this.elements.controls=_u.call(this,this.config.selectors.controls.wrapper),this.elements.buttons={play:Mu.call(this,this.config.selectors.buttons.play),pause:_u.call(this,this.config.selectors.buttons.pause),restart:_u.call(this,this.config.selectors.buttons.restart),rewind:_u.call(this,this.config.selectors.buttons.rewind),fastForward:_u.call(this,this.config.selectors.buttons.fastForward),mute:_u.call(this,this.config.selectors.buttons.mute),pip:_u.call(this,this.config.selectors.buttons.pip),airplay:_u.call(this,this.config.selectors.buttons.airplay),settings:_u.call(this,this.config.selectors.buttons.settings),captions:_u.call(this,this.config.selectors.buttons.captions),fullscreen:_u.call(this,this.config.selectors.buttons.fullscreen)},this.elements.progress=_u.call(this,this.config.selectors.progress),this.elements.inputs={seek:_u.call(this,this.config.selectors.inputs.seek),volume:_u.call(this,this.config.selectors.inputs.volume)},this.elements.display={buffer:_u.call(this,this.config.selectors.display.buffer),currentTime:_u.call(this,this.config.selectors.display.currentTime),duration:_u.call(this,this.config.selectors.display.duration)},su(this.elements.progress)&&(this.elements.display.seekTooltip=this.elements.progress.querySelector(".".concat(this.config.classNames.tooltip))),!0}catch(e){return this.debug.warn("It looks like there is a problem with your custom controls HTML",e),this.toggleNativeControls(!0),!1}},createIcon:function(e,t){var n=jh.getIconUrl.call(this),i="".concat(n.cors?"":n.url,"#").concat(this.config.iconPrefix),r=document.createElementNS("http://www.w3.org/2000/svg","svg");Eu(r,Tu(t,{"aria-hidden":"true",focusable:"false"}));var a=document.createElementNS("http://www.w3.org/2000/svg","use"),o="".concat(i,"-").concat(e);return"href"in a&&a.setAttributeNS("http://www.w3.org/1999/xlink","href",o),a.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",o),r.appendChild(a),r},createLabel:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=Th(e,this.config),i=So(So({},t),{},{class:[t.class,this.config.classNames.hidden].filter(Boolean).join(" ")});return Au("span",i,n)},createBadge:function(e){if(du(e))return null;var t=Au("span",{class:this.config.classNames.menu.value});return t.appendChild(Au("span",{class:this.config.classNames.menu.badge},e)),t},createButton:function(e,t){var n=this,i=Tu({},t),r=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=e.toString();return(t=bh(t)).charAt(0).toLowerCase()+t.slice(1)}(e),a={element:"button",toggle:!1,label:null,icon:null,labelPressed:null,iconPressed:null};switch(["element","icon","label"].forEach((function(e){Object.keys(i).includes(e)&&(a[e]=i[e],delete i[e])})),"button"!==a.element||Object.keys(i).includes("type")||(i.type="button"),Object.keys(i).includes("class")?i.class.split(" ").some((function(e){return e===n.config.classNames.control}))||Tu(i,{class:"".concat(i.class," ").concat(this.config.classNames.control)}):i.class=this.config.classNames.control,e){case"play":a.toggle=!0,a.label="play",a.labelPressed="pause",a.icon="play",a.iconPressed="pause";break;case"mute":a.toggle=!0,a.label="mute",a.labelPressed="unmute",a.icon="volume",a.iconPressed="muted";break;case"captions":a.toggle=!0,a.label="enableCaptions",a.labelPressed="disableCaptions",a.icon="captions-off",a.iconPressed="captions-on";break;case"fullscreen":a.toggle=!0,a.label="enterFullscreen",a.labelPressed="exitFullscreen",a.icon="enter-fullscreen",a.iconPressed="exit-fullscreen";break;case"play-large":i.class+=" ".concat(this.config.classNames.control,"--overlaid"),r="play",a.label="play",a.icon="play";break;default:du(a.label)&&(a.label=r),du(a.icon)&&(a.icon=e)}var o=Au(a.element);return a.toggle?(o.appendChild(jh.createIcon.call(this,a.iconPressed,{class:"icon--pressed"})),o.appendChild(jh.createIcon.call(this,a.icon,{class:"icon--not-pressed"})),o.appendChild(jh.createLabel.call(this,a.labelPressed,{class:"label--pressed"})),o.appendChild(jh.createLabel.call(this,a.label,{class:"label--not-pressed"}))):(o.appendChild(jh.createIcon.call(this,a.icon)),o.appendChild(jh.createLabel.call(this,a.label))),Tu(i,Iu(this.config.selectors.buttons[r],i)),Eu(o,i),"play"===r?(au(this.elements.buttons[r])||(this.elements.buttons[r]=[]),this.elements.buttons[r].push(o)):this.elements.buttons[r]=o,o},createRange:function(e,t){var n=Au("input",Tu(Iu(this.config.selectors.inputs[e]),{type:"range",min:0,max:100,step:.01,value:0,autocomplete:"off",role:"slider","aria-label":Th(e,this.config),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":0},t));return this.elements.inputs[e]=n,jh.updateRangeFill.call(this,n),wl.setup(n),n},createProgress:function(e,t){var n=Au("progress",Tu(Iu(this.config.selectors.display[e]),{min:0,max:100,value:0,role:"progressbar","aria-hidden":!0},t));if("volume"!==e){n.appendChild(Au("span",null,"0"));var i={played:"played",buffer:"buffered"}[e],r=i?Th(i,this.config):"";n.innerText="% ".concat(r.toLowerCase())}return this.elements.display[e]=n,n},createTime:function(e,t){var n=Iu(this.config.selectors.display[e],t),i=Au("div",Tu(n,{class:"".concat(n.class?n.class:""," ").concat(this.config.classNames.display.time," ").trim(),"aria-label":Th(e,this.config)}),"00:00");return this.elements.display[e]=i,i},bindMenuItemShortcuts:function(e,t){var n=this;Vu.call(this,e,"keydown keyup",(function(i){if([32,38,39,40].includes(i.which)&&(i.preventDefault(),i.stopPropagation(),"keydown"!==i.type)){var r,a=Ru(e,'[role="menuitemradio"]');if(!a&&[32,39].includes(i.which))jh.showMenuPanel.call(n,t,!0);else 32!==i.which&&(40===i.which||a&&39===i.which?(r=e.nextElementSibling,su(r)||(r=e.parentNode.firstElementChild)):(r=e.previousElementSibling,su(r)||(r=e.parentNode.lastElementChild)),Uu.call(n,r,!0))}}),!1),Vu.call(this,e,"keyup",(function(e){13===e.which&&jh.focusFirstMenuItem.call(n,null,!0)}))},createMenuItem:function(e){var t=this,n=e.value,i=e.list,r=e.type,a=e.title,o=e.badge,s=void 0===o?null:o,l=e.checked,c=void 0!==l&&l,u=Iu(this.config.selectors.inputs[r]),h=Au("button",Tu(u,{type:"button",role:"menuitemradio",class:"".concat(this.config.classNames.control," ").concat(u.class?u.class:"").trim(),"aria-checked":c,value:n})),f=Au("span");f.innerHTML=a,su(s)&&f.appendChild(s),h.appendChild(f),Object.defineProperty(h,"checked",{enumerable:!0,get:function(){return"true"===h.getAttribute("aria-checked")},set:function(e){e&&Array.from(h.parentNode.children).filter((function(e){return Ru(e,'[role="menuitemradio"]')})).forEach((function(e){return e.setAttribute("aria-checked","false")})),h.setAttribute("aria-checked",e?"true":"false")}}),this.listeners.bind(h,"click keyup",(function(e){if(!cu(e)||32===e.which){switch(e.preventDefault(),e.stopPropagation(),h.checked=!0,r){case"language":t.currentTrack=Number(n);break;case"quality":t.quality=n;break;case"speed":t.speed=parseFloat(n)}jh.showMenuPanel.call(t,"home",cu(e))}}),r,!1),jh.bindMenuItemShortcuts.call(this,h,r),i.appendChild(h)},formatTime:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!tu(e))return e;var n=Ch(this.duration)>0;return Lh(e,n,t)},updateTimeDisplay:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];su(e)&&tu(t)&&(e.innerText=jh.formatTime(t,n))},updateVolume:function(){this.supported.ui&&(su(this.elements.inputs.volume)&&jh.setRange.call(this,this.elements.inputs.volume,this.muted?0:this.volume),su(this.elements.buttons.mute)&&(this.elements.buttons.mute.pressed=this.muted||0===this.volume))},setRange:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;su(e)&&(e.value=t,jh.updateRangeFill.call(this,e))},updateProgress:function(e){var t=this;if(this.supported.ui&&lu(e)){var n=0;if(e)switch(e.type){case"timeupdate":case"seeking":case"seeked":n=function(e,t){return 0===e||0===t||Number.isNaN(e)||Number.isNaN(t)?0:(e/t*100).toFixed(2)}(this.currentTime,this.duration),"timeupdate"===e.type&&jh.setRange.call(this,this.elements.inputs.seek,n);break;case"playing":case"progress":!function(e,n){var i=tu(n)?n:0,r=su(e)?e:t.elements.display.buffer;if(su(r)){r.value=i;var a=r.getElementsByTagName("span")[0];su(a)&&(a.childNodes[0].nodeValue=i)}}(this.elements.display.buffer,100*this.buffered)}}},updateRangeFill:function(e){var t=lu(e)?e.target:e;if(su(t)&&"range"===t.getAttribute("type")){if(Ru(t,this.config.selectors.inputs.seek)){t.setAttribute("aria-valuenow",this.currentTime);var n=jh.formatTime(this.currentTime),i=jh.formatTime(this.duration),r=Th("seekLabel",this.config);t.setAttribute("aria-valuetext",r.replace("{currentTime}",n).replace("{duration}",i))}else if(Ru(t,this.config.selectors.inputs.volume)){var a=100*t.value;t.setAttribute("aria-valuenow",a),t.setAttribute("aria-valuetext","".concat(a.toFixed(1),"%"))}else t.setAttribute("aria-valuenow",t.value);gu.isWebkit&&t.style.setProperty("--value","".concat(t.value/t.max*100,"%"))}},updateSeekTooltip:function(e){var t=this;if(this.config.tooltips.seek&&su(this.elements.inputs.seek)&&su(this.elements.display.seekTooltip)&&0!==this.duration){var n="".concat(this.config.classNames.tooltip,"--visible"),i=function(e){return ju(t.elements.display.seekTooltip,n,e)};if(this.touch)i(!1);else{var r=0,a=this.elements.progress.getBoundingClientRect();if(lu(e))r=100/a.width*(e.pageX-a.left);else{if(!Nu(this.elements.display.seekTooltip,n))return;r=parseFloat(this.elements.display.seekTooltip.style.left,10)}r<0?r=0:r>100&&(r=100),jh.updateTimeDisplay.call(this,this.elements.display.seekTooltip,this.duration/100*r),this.elements.display.seekTooltip.style.left="".concat(r,"%"),lu(e)&&["mouseenter","mouseleave"].includes(e.type)&&i("mouseenter"===e.type)}}},timeUpdate:function(e){var t=!su(this.elements.display.duration)&&this.config.invertTime;jh.updateTimeDisplay.call(this,this.elements.display.currentTime,t?this.duration-this.currentTime:this.currentTime,t),e&&"timeupdate"===e.type&&this.media.seeking||jh.updateProgress.call(this,e)},durationUpdate:function(){if(this.supported.ui&&(this.config.invertTime||!this.currentTime)){if(this.duration>=Math.pow(2,32))return Lu(this.elements.display.currentTime,!0),void Lu(this.elements.progress,!0);su(this.elements.inputs.seek)&&this.elements.inputs.seek.setAttribute("aria-valuemax",this.duration);var e=su(this.elements.display.duration);!e&&this.config.displayDuration&&this.paused&&jh.updateTimeDisplay.call(this,this.elements.display.currentTime,this.duration),e&&jh.updateTimeDisplay.call(this,this.elements.display.duration,this.duration),jh.updateSeekTooltip.call(this)}},toggleMenuButton:function(e,t){Lu(this.elements.settings.buttons[e],!t)},updateSetting:function(e,t,n){var i=this.elements.settings.panels[e],r=null,a=t;if("captions"===e)r=this.currentTrack;else{if(r=du(n)?this[e]:n,du(r)&&(r=this.config[e].default),!du(this.options[e])&&!this.options[e].includes(r))return void this.debug.warn("Unsupported value of '".concat(r,"' for ").concat(e));if(!this.config[e].options.includes(r))return void this.debug.warn("Disabled value of '".concat(r,"' for ").concat(e))}if(su(a)||(a=i&&i.querySelector('[role="menu"]')),su(a)){this.elements.settings.buttons[e].querySelector(".".concat(this.config.classNames.menu.value)).innerHTML=jh.getLabel.call(this,e,r);var o=a&&a.querySelector('[value="'.concat(r,'"]'));su(o)&&(o.checked=!0)}},getLabel:function(e,t){switch(e){case"speed":return 1===t?Th("normal",this.config):"".concat(t,"&times;");case"quality":if(tu(t)){var n=Th("qualityLabel.".concat(t),this.config);return n.length?n:"".concat(t,"p")}return yh(t);case"captions":return Mh.getLabel.call(this);default:return null}},setQualityMenu:function(e){var t=this;if(su(this.elements.settings.panels.quality)){var n=this.elements.settings.panels.quality.querySelector('[role="menu"]');au(e)&&(this.options.quality=th(e).filter((function(e){return t.config.quality.options.includes(e)})));var i=!du(this.options.quality)&&this.options.quality.length>1;if(jh.toggleMenuButton.call(this,"quality",i),Cu(n),jh.checkMenu.call(this),i){var r=function(e){var n=Th("qualityBadge.".concat(e),t.config);return n.length?jh.createBadge.call(t,n):null};this.options.quality.sort((function(e,n){var i=t.config.quality.options;return i.indexOf(e)>i.indexOf(n)?1:-1})).forEach((function(e){jh.createMenuItem.call(t,{value:e,list:n,type:"quality",title:jh.getLabel.call(t,"quality",e),badge:r(e)})})),jh.updateSetting.call(this,"quality",n)}}},setCaptionsMenu:function(){var e=this;if(su(this.elements.settings.panels.captions)){var t=this.elements.settings.panels.captions.querySelector('[role="menu"]'),n=Mh.getTracks.call(this),i=Boolean(n.length);if(jh.toggleMenuButton.call(this,"captions",i),Cu(t),jh.checkMenu.call(this),i){var r=n.map((function(n,i){return{value:i,checked:e.captions.toggled&&e.currentTrack===i,title:Mh.getLabel.call(e,n),badge:n.language&&jh.createBadge.call(e,n.language.toUpperCase()),list:t,type:"language"}}));r.unshift({value:-1,checked:!this.captions.toggled,title:Th("disabled",this.config),list:t,type:"language"}),r.forEach(jh.createMenuItem.bind(this)),jh.updateSetting.call(this,"captions",t)}}},setSpeedMenu:function(){var e=this;if(su(this.elements.settings.panels.speed)){var t=this.elements.settings.panels.speed.querySelector('[role="menu"]');this.options.speed=this.options.speed.filter((function(t){return t>=e.minimumSpeed&&t<=e.maximumSpeed}));var n=!du(this.options.speed)&&this.options.speed.length>1;jh.toggleMenuButton.call(this,"speed",n),Cu(t),jh.checkMenu.call(this),n&&(this.options.speed.forEach((function(n){jh.createMenuItem.call(e,{value:n,list:t,type:"speed",title:jh.getLabel.call(e,"speed",n)})})),jh.updateSetting.call(this,"speed",t))}},checkMenu:function(){var e=this.elements.settings.buttons,t=!du(e)&&Object.values(e).some((function(e){return!e.hidden}));Lu(this.elements.settings.menu,!t)},focusFirstMenuItem:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!this.elements.settings.popup.hidden){var n=e;su(n)||(n=Object.values(this.elements.settings.panels).find((function(e){return!e.hidden})));var i=n.querySelector('[role^="menuitem"]');Uu.call(this,i,t)}},toggleMenu:function(e){var t=this.elements.settings.popup,n=this.elements.buttons.settings;if(su(t)&&su(n)){var i=t.hidden,r=i;if(iu(e))r=e;else if(cu(e)&&27===e.which)r=!1;else if(lu(e)){var a=ru(e.composedPath)?e.composedPath()[0]:e.target,o=t.contains(a);if(o||!o&&e.target!==n&&r)return}n.setAttribute("aria-expanded",r),Lu(t,!r),ju(this.elements.container,this.config.classNames.menu.open,r),r&&cu(e)?jh.focusFirstMenuItem.call(this,null,!0):r||i||Uu.call(this,n,cu(e))}},getMenuSize:function(e){var t=e.cloneNode(!0);t.style.position="absolute",t.style.opacity=0,t.removeAttribute("hidden"),e.parentNode.appendChild(t);var n=t.scrollWidth,i=t.scrollHeight;return xu(t),{width:n,height:i}},showMenuPanel:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=this.elements.container.querySelector("#plyr-settings-".concat(this.id,"-").concat(t));if(su(i)){var r=i.parentNode,a=Array.from(r.children).find((function(e){return!e.hidden}));if(qu.transitions&&!qu.reducedMotion){r.style.width="".concat(a.scrollWidth,"px"),r.style.height="".concat(a.scrollHeight,"px");var o=jh.getMenuSize.call(this,i),s=function t(n){n.target===r&&["width","height"].includes(n.propertyName)&&(r.style.width="",r.style.height="",zu.call(e,r,pu,t))};Vu.call(this,r,pu,s),r.style.width="".concat(o.width,"px"),r.style.height="".concat(o.height,"px")}Lu(a,!0),Lu(i,!1),jh.focusFirstMenuItem.call(this,i,n)}},setDownloadUrl:function(){var e=this.elements.buttons.download;su(e)&&e.setAttribute("href",this.download)},create:function(e){var t=this,n=jh.bindMenuItemShortcuts,i=jh.createButton,r=jh.createProgress,a=jh.createRange,o=jh.createTime,s=jh.setQualityMenu,l=jh.setSpeedMenu,c=jh.showMenuPanel;this.elements.controls=null,au(this.config.controls)&&this.config.controls.includes("play-large")&&this.elements.container.appendChild(i.call(this,"play-large"));var u=Au("div",Iu(this.config.selectors.controls.wrapper));this.elements.controls=u;var h={class:"plyr__controls__item"};return th(au(this.config.controls)?this.config.controls:[]).forEach((function(s){if("restart"===s&&u.appendChild(i.call(t,"restart",h)),"rewind"===s&&u.appendChild(i.call(t,"rewind",h)),"play"===s&&u.appendChild(i.call(t,"play",h)),"fast-forward"===s&&u.appendChild(i.call(t,"fast-forward",h)),"progress"===s){var l=Au("div",{class:"".concat(h.class," plyr__progress__container")}),f=Au("div",Iu(t.config.selectors.progress));if(f.appendChild(a.call(t,"seek",{id:"plyr-seek-".concat(e.id)})),f.appendChild(r.call(t,"buffer")),t.config.tooltips.seek){var d=Au("span",{class:t.config.classNames.tooltip},"00:00");f.appendChild(d),t.elements.display.seekTooltip=d}t.elements.progress=f,l.appendChild(t.elements.progress),u.appendChild(l)}if("current-time"===s&&u.appendChild(o.call(t,"currentTime",h)),"duration"===s&&u.appendChild(o.call(t,"duration",h)),"mute"===s||"volume"===s){var p=t.elements.volume;if(su(p)&&u.contains(p)||(p=Au("div",Tu({},h,{class:"".concat(h.class," plyr__volume").trim()})),t.elements.volume=p,u.appendChild(p)),"mute"===s&&p.appendChild(i.call(t,"mute")),"volume"===s&&!gu.isIos){var m={max:1,step:.05,value:t.config.volume};p.appendChild(a.call(t,"volume",Tu(m,{id:"plyr-volume-".concat(e.id)})))}}if("captions"===s&&u.appendChild(i.call(t,"captions",h)),"settings"===s&&!du(t.config.settings)){var g=Au("div",Tu({},h,{class:"".concat(h.class," plyr__menu").trim(),hidden:""}));g.appendChild(i.call(t,"settings",{"aria-haspopup":!0,"aria-controls":"plyr-settings-".concat(e.id),"aria-expanded":!1}));var v=Au("div",{class:"plyr__menu__container",id:"plyr-settings-".concat(e.id),hidden:""}),y=Au("div"),b=Au("div",{id:"plyr-settings-".concat(e.id,"-home")}),w=Au("div",{role:"menu"});b.appendChild(w),y.appendChild(b),t.elements.settings.panels.home=b,t.config.settings.forEach((function(i){var r=Au("button",Tu(Iu(t.config.selectors.buttons.settings),{type:"button",class:"".concat(t.config.classNames.control," ").concat(t.config.classNames.control,"--forward"),role:"menuitem","aria-haspopup":!0,hidden:""}));n.call(t,r,i),Vu.call(t,r,"click",(function(){c.call(t,i,!1)}));var a=Au("span",null,Th(i,t.config)),o=Au("span",{class:t.config.classNames.menu.value});o.innerHTML=e[i],a.appendChild(o),r.appendChild(a),w.appendChild(r);var s=Au("div",{id:"plyr-settings-".concat(e.id,"-").concat(i),hidden:""}),l=Au("button",{type:"button",class:"".concat(t.config.classNames.control," ").concat(t.config.classNames.control,"--back")});l.appendChild(Au("span",{"aria-hidden":!0},Th(i,t.config))),l.appendChild(Au("span",{class:t.config.classNames.hidden},Th("menuBack",t.config))),Vu.call(t,s,"keydown",(function(e){37===e.which&&(e.preventDefault(),e.stopPropagation(),c.call(t,"home",!0))}),!1),Vu.call(t,l,"click",(function(){c.call(t,"home",!1)})),s.appendChild(l),s.appendChild(Au("div",{role:"menu"})),y.appendChild(s),t.elements.settings.buttons[i]=r,t.elements.settings.panels[i]=s})),v.appendChild(y),g.appendChild(v),u.appendChild(g),t.elements.settings.popup=v,t.elements.settings.menu=g}if("pip"===s&&qu.pip&&u.appendChild(i.call(t,"pip",h)),"airplay"===s&&qu.airplay&&u.appendChild(i.call(t,"airplay",h)),"download"===s){var k=Tu({},h,{element:"a",href:t.download,target:"_blank"});t.isHTML5&&(k.download="");var T=t.config.urls.download;!fu(T)&&t.isEmbed&&Tu(k,{icon:"logo-".concat(t.provider),label:t.provider}),u.appendChild(i.call(t,"download",k))}"fullscreen"===s&&u.appendChild(i.call(t,"fullscreen",h))})),this.isHTML5&&s.call(this,eh.getQualityOptions.call(this)),l.call(this),u},inject:function(){var e=this;if(this.config.loadSprite){var t=jh.getIconUrl.call(this);t.cors&&Ah(t.url,"sprite-plyr")}this.id=Math.floor(1e4*Math.random());var n=null;this.elements.controls=null;var i={id:this.id,seektime:this.config.seekTime,title:this.config.title},r=!0;ru(this.config.controls)&&(this.config.controls=this.config.controls.call(this,i)),this.config.controls||(this.config.controls=[]),su(this.config.controls)||nu(this.config.controls)?n=this.config.controls:(n=jh.create.call(this,{id:this.id,seektime:this.config.seekTime,speed:this.speed,quality:this.quality,captions:Mh.getLabel.call(this)}),r=!1);var a,o;if(r&&nu(this.config.controls)&&(a=n,Object.entries(i).forEach((function(e){var t=Ao(e,2),n=t[0],i=t[1];a=vh(a,"{".concat(n,"}"),i)})),n=a),nu(this.config.selectors.controls.container)&&(o=document.querySelector(this.config.selectors.controls.container)),su(o)||(o=this.elements.container),o[su(n)?"insertAdjacentElement":"insertAdjacentHTML"]("afterbegin",n),su(this.elements.controls)||jh.findElements.call(this),!du(this.elements.buttons)){var s=function(t){var n=e.config.classNames.controlPressed;Object.defineProperty(t,"pressed",{enumerable:!0,get:function(){return Nu(t,n)},set:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];ju(t,n,e)}})};Object.values(this.elements.buttons).filter(Boolean).forEach((function(e){au(e)||ou(e)?Array.from(e).filter(Boolean).forEach(s):s(e)}))}if(gu.isEdge&&mu(o),this.config.tooltips.controls){var l=this.config,c=l.classNames,u=l.selectors,h="".concat(u.controls.wrapper," ").concat(u.labels," .").concat(c.hidden),f=Mu.call(this,h);Array.from(f).forEach((function(t){ju(t,e.config.classNames.hidden,!1),ju(t,e.config.classNames.tooltip,!0)}))}}};function Nh(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=e;if(t){var i=document.createElement("a");i.href=n,n=i.href}try{return new URL(n)}catch(e){return null}}function Rh(e){var t=new URLSearchParams;return eu(e)&&Object.entries(e).forEach((function(e){var n=Ao(e,2),i=n[0],r=n[1];t.set(i,r)})),t}var Mh={setup:function(){if(this.supported.ui)if(!this.isVideo||this.isYouTube||this.isHTML5&&!qu.textTracks)au(this.config.controls)&&this.config.controls.includes("settings")&&this.config.settings.includes("captions")&&jh.setCaptionsMenu.call(this);else{if(su(this.elements.captions)||(this.elements.captions=Au("div",Iu(this.config.selectors.captions)),function(e,t){su(e)&&su(t)&&t.parentNode.insertBefore(e,t.nextSibling)}(this.elements.captions,this.elements.wrapper)),gu.isIE&&window.URL){var e=this.media.querySelectorAll("track");Array.from(e).forEach((function(e){var t=e.getAttribute("src"),n=Nh(t);null!==n&&n.hostname!==window.location.href.hostname&&["http:","https:"].includes(n.protocol)&&Eh(t,"blob").then((function(t){e.setAttribute("src",window.URL.createObjectURL(t))})).catch((function(){xu(e)}))}))}var t=th((navigator.languages||[navigator.language||navigator.userLanguage||"en"]).map((function(e){return e.split("-")[0]}))),n=(this.storage.get("language")||this.config.captions.language||"auto").toLowerCase();if("auto"===n)n=Ao(t,1)[0];var i=this.storage.get("captions");if(iu(i)||(i=this.config.captions.active),Object.assign(this.captions,{toggled:!1,active:i,language:n,languages:t}),this.isHTML5){var r=this.config.captions.update?"addtrack removetrack":"removetrack";Vu.call(this,this.media.textTracks,r,Mh.update.bind(this))}setTimeout(Mh.update.bind(this),0)}},update:function(){var e=this,t=Mh.getTracks.call(this,!0),n=this.captions,i=n.active,r=n.language,a=n.meta,o=n.currentTrackNode,s=Boolean(t.find((function(e){return e.language===r})));this.isHTML5&&this.isVideo&&t.filter((function(e){return!a.get(e)})).forEach((function(t){e.debug.log("Track added",t),a.set(t,{default:"showing"===t.mode}),"showing"===t.mode&&(t.mode="hidden"),Vu.call(e,t,"cuechange",(function(){return Mh.updateCues.call(e)}))})),(s&&this.language!==r||!t.includes(o))&&(Mh.setLanguage.call(this,r),Mh.toggle.call(this,i&&s)),ju(this.elements.container,this.config.classNames.captions.enabled,!du(t)),au(this.config.controls)&&this.config.controls.includes("settings")&&this.config.settings.includes("captions")&&jh.setCaptionsMenu.call(this)},toggle:function(e){var t=this,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.supported.ui){var i=this.captions.toggled,r=this.config.classNames.captions.active,a=Zc(e)?!i:e;if(a!==i){if(n||(this.captions.active=a,this.storage.set({captions:a})),!this.language&&a&&!n){var o=Mh.getTracks.call(this),s=Mh.findTrack.call(this,[this.captions.language].concat(Po(this.captions.languages)),!0);return this.captions.language=s.language,void Mh.set.call(this,o.indexOf(s))}this.elements.buttons.captions&&(this.elements.buttons.captions.pressed=a),ju(this.elements.container,r,a),this.captions.toggled=a,jh.updateSetting.call(this,"captions"),Ku.call(this,this.media,a?"captionsenabled":"captionsdisabled")}setTimeout((function(){a&&t.captions.toggled&&(t.captions.currentTrackNode.mode="hidden")}))}},set:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=Mh.getTracks.call(this);if(-1!==e)if(tu(e))if(e in n){if(this.captions.currentTrack!==e){this.captions.currentTrack=e;var i=n[e],r=i||{},a=r.language;this.captions.currentTrackNode=i,jh.updateSetting.call(this,"captions"),t||(this.captions.language=a,this.storage.set({language:a})),this.isVimeo&&this.embed.enableTextTrack(a),Ku.call(this,this.media,"languagechange")}Mh.toggle.call(this,!0,t),this.isHTML5&&this.isVideo&&Mh.updateCues.call(this)}else this.debug.warn("Track not found",e);else this.debug.warn("Invalid caption argument",e);else Mh.toggle.call(this,!1,t)},setLanguage:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(nu(e)){var n=e.toLowerCase();this.captions.language=n;var i=Mh.getTracks.call(this),r=Mh.findTrack.call(this,[n]);Mh.set.call(this,i.indexOf(r),t)}else this.debug.warn("Invalid language argument",e)},getTracks:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=Array.from((this.media||{}).textTracks||[]);return n.filter((function(n){return!e.isHTML5||t||e.captions.meta.has(n)})).filter((function(e){return["captions","subtitles"].includes(e.kind)}))},findTrack:function(e){var t,n=this,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=Mh.getTracks.call(this),a=function(e){return Number((n.captions.meta.get(e)||{}).default)},o=Array.from(r).sort((function(e,t){return a(t)-a(e)}));return e.every((function(e){return!(t=o.find((function(t){return t.language===e})))})),t||(i?o[0]:void 0)},getCurrentTrack:function(){return Mh.getTracks.call(this)[this.currentTrack]},getLabel:function(e){var t=e;return!uu(t)&&qu.textTracks&&this.captions.toggled&&(t=Mh.getCurrentTrack.call(this)),uu(t)?du(t.label)?du(t.language)?Th("enabled",this.config):e.language.toUpperCase():t.label:Th("disabled",this.config)},updateCues:function(e){if(this.supported.ui)if(su(this.elements.captions))if(Zc(e)||Array.isArray(e)){var t=e;if(!t){var n=Mh.getCurrentTrack.call(this);t=Array.from((n||{}).activeCues||[]).map((function(e){return e.getCueAsHTML()})).map(wh)}var i=t.map((function(e){return e.trim()})).join("\n");if(i!==this.elements.captions.innerHTML){Cu(this.elements.captions);var r=Au("span",Iu(this.config.selectors.caption));r.innerHTML=i,this.elements.captions.appendChild(r),Ku.call(this,this.media,"cuechange")}}else this.debug.warn("updateCues: Invalid input",e);else this.debug.warn("No captions element to render to")}},_h={enabled:!0,title:"",debug:!1,autoplay:!1,autopause:!0,playsinline:!0,seekTime:10,volume:1,muted:!1,duration:null,displayDuration:!0,invertTime:!0,toggleInvert:!0,ratio:null,clickToPlay:!0,hideControls:!0,resetOnEnd:!1,disableContextMenu:!0,loadSprite:!0,iconPrefix:"plyr",iconUrl:"https://cdn.plyr.io/3.6.2/plyr.svg",blankVideo:"https://cdn.plyr.io/static/blank.mp4",quality:{default:576,options:[4320,2880,2160,1440,1080,720,576,480,360,240],forced:!1,onChange:null},loop:{active:!1},speed:{selected:1,options:[.5,.75,1,1.25,1.5,1.75,2,4]},keyboard:{focused:!0,global:!1},tooltips:{controls:!1,seek:!0},captions:{active:!1,language:"auto",update:!1},fullscreen:{enabled:!0,fallback:!0,iosNative:!1},storage:{enabled:!0,key:"plyr"},controls:["play-large","play","progress","current-time","mute","volume","captions","settings","pip","airplay","fullscreen"],settings:["captions","quality","speed"],i18n:{restart:"Restart",rewind:"Rewind {seektime}s",play:"Play",pause:"Pause",fastForward:"Forward {seektime}s",seek:"Seek",seekLabel:"{currentTime} of {duration}",played:"Played",buffered:"Buffered",currentTime:"Current time",duration:"Duration",volume:"Volume",mute:"Mute",unmute:"Unmute",enableCaptions:"Enable captions",disableCaptions:"Disable captions",download:"Download",enterFullscreen:"Enter fullscreen",exitFullscreen:"Exit fullscreen",frameTitle:"Player for {title}",captions:"Captions",settings:"Settings",pip:"PIP",menuBack:"Go back to previous menu",speed:"Speed",normal:"Normal",quality:"Quality",loop:"Loop",start:"Start",end:"End",all:"All",reset:"Reset",disabled:"Disabled",enabled:"Enabled",advertisement:"Ad",qualityBadge:{2160:"4K",1440:"HD",1080:"HD",720:"HD",576:"SD",480:"SD"}},urls:{download:null,vimeo:{sdk:"https://player.vimeo.com/api/player.js",iframe:"https://player.vimeo.com/video/{0}?{1}",api:"https://vimeo.com/api/v2/video/{0}.json"},youtube:{sdk:"https://www.youtube.com/iframe_api",api:"https://noembed.com/embed?url=https://www.youtube.com/watch?v={0}"},googleIMA:{sdk:"https://imasdk.googleapis.com/js/sdkloader/ima3.js"}},listeners:{seek:null,play:null,pause:null,restart:null,rewind:null,fastForward:null,mute:null,volume:null,captions:null,download:null,fullscreen:null,pip:null,airplay:null,speed:null,quality:null,loop:null,language:null},events:["ended","progress","stalled","playing","waiting","canplay","canplaythrough","loadstart","loadeddata","loadedmetadata","timeupdate","volumechange","play","pause","error","seeking","seeked","emptied","ratechange","cuechange","download","enterfullscreen","exitfullscreen","captionsenabled","captionsdisabled","languagechange","controlshidden","controlsshown","ready","statechange","qualitychange","adsloaded","adscontentpause","adscontentresume","adstarted","adsmidpoint","adscomplete","adsallcomplete","adsimpression","adsclick"],selectors:{editable:"input, textarea, select, [contenteditable]",container:".plyr",controls:{container:null,wrapper:".plyr__controls"},labels:"[data-plyr]",buttons:{play:'[data-plyr="play"]',pause:'[data-plyr="pause"]',restart:'[data-plyr="restart"]',rewind:'[data-plyr="rewind"]',fastForward:'[data-plyr="fast-forward"]',mute:'[data-plyr="mute"]',captions:'[data-plyr="captions"]',download:'[data-plyr="download"]',fullscreen:'[data-plyr="fullscreen"]',pip:'[data-plyr="pip"]',airplay:'[data-plyr="airplay"]',settings:'[data-plyr="settings"]',loop:'[data-plyr="loop"]'},inputs:{seek:'[data-plyr="seek"]',volume:'[data-plyr="volume"]',speed:'[data-plyr="speed"]',language:'[data-plyr="language"]',quality:'[data-plyr="quality"]'},display:{currentTime:".plyr__time--current",duration:".plyr__time--duration",buffer:".plyr__progress__buffer",loop:".plyr__progress__loop",volume:".plyr__volume--display"},progress:".plyr__progress",captions:".plyr__captions",caption:".plyr__caption"},classNames:{type:"plyr--{0}",provider:"plyr--{0}",video:"plyr__video-wrapper",embed:"plyr__video-embed",videoFixedRatio:"plyr__video-wrapper--fixed-ratio",embedContainer:"plyr__video-embed__container",poster:"plyr__poster",posterEnabled:"plyr__poster-enabled",ads:"plyr__ads",control:"plyr__control",controlPressed:"plyr__control--pressed",playing:"plyr--playing",paused:"plyr--paused",stopped:"plyr--stopped",loading:"plyr--loading",hover:"plyr--hover",tooltip:"plyr__tooltip",cues:"plyr__cues",hidden:"plyr__sr-only",hideControls:"plyr--hide-controls",isIos:"plyr--is-ios",isTouch:"plyr--is-touch",uiSupported:"plyr--full-ui",noTransition:"plyr--no-transition",display:{time:"plyr__time"},menu:{value:"plyr__menu__value",badge:"plyr__badge",open:"plyr--menu-open"},captions:{enabled:"plyr--captions-enabled",active:"plyr--captions-active"},fullscreen:{enabled:"plyr--fullscreen-enabled",fallback:"plyr--fullscreen-fallback"},pip:{supported:"plyr--pip-supported",active:"plyr--pip-active"},airplay:{supported:"plyr--airplay-supported",active:"plyr--airplay-active"},tabFocus:"plyr__tab-focus",previewThumbnails:{thumbContainer:"plyr__preview-thumb",thumbContainerShown:"plyr__preview-thumb--is-shown",imageContainer:"plyr__preview-thumb__image-container",timeContainer:"plyr__preview-thumb__time-container",scrubbingContainer:"plyr__preview-scrubbing",scrubbingContainerShown:"plyr__preview-scrubbing--is-shown"}},attributes:{embed:{provider:"data-plyr-provider",id:"data-plyr-embed-id"}},ads:{enabled:!1,publisherId:"",tagUrl:""},previewThumbnails:{enabled:!1,src:""},vimeo:{byline:!1,portrait:!1,title:!1,speed:!0,transparent:!1,premium:!1,referrerPolicy:null},youtube:{noCookie:!0,rel:0,showinfo:0,iv_load_policy:3,modestbranding:1}},Uh="picture-in-picture",Dh="inline",Fh={html5:"html5",youtube:"youtube",vimeo:"vimeo"},qh="audio",Hh="video";var Bh=function(){},Vh=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];yo(this,e),this.enabled=window.console&&t,this.enabled&&this.log("Debugging enabled")}return wo(e,[{key:"log",get:function(){return this.enabled?Function.prototype.bind.call(console.log,console):Bh}},{key:"warn",get:function(){return this.enabled?Function.prototype.bind.call(console.warn,console):Bh}},{key:"error",get:function(){return this.enabled?Function.prototype.bind.call(console.error,console):Bh}}]),e}(),zh=function(){function e(t){var n=this;yo(this,e),this.player=t,this.prefix=e.prefix,this.property=e.property,this.scrollPosition={x:0,y:0},this.forceFallback="force"===t.config.fullscreen.fallback,this.player.elements.fullscreen=t.config.fullscreen.container&&function(e,t){return(Element.prototype.closest||function(){var e=this;do{if(Ru.matches(e,t))return e;e=e.parentElement||e.parentNode}while(null!==e&&1===e.nodeType);return null}).call(e,t)}(this.player.elements.container,t.config.fullscreen.container),Vu.call(this.player,document,"ms"===this.prefix?"MSFullscreenChange":"".concat(this.prefix,"fullscreenchange"),(function(){n.onChange()})),Vu.call(this.player,this.player.elements.container,"dblclick",(function(e){su(n.player.elements.controls)&&n.player.elements.controls.contains(e.target)||n.toggle()})),Vu.call(this,this.player.elements.container,"keydown",(function(e){return n.trapFocus(e)})),this.update()}return wo(e,[{key:"onChange",value:function(){if(this.enabled){var e=this.player.elements.buttons.fullscreen;su(e)&&(e.pressed=this.active),Ku.call(this.player,this.target,this.active?"enterfullscreen":"exitfullscreen",!0)}}},{key:"toggleFallback",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(e?this.scrollPosition={x:window.scrollX||0,y:window.scrollY||0}:window.scrollTo(this.scrollPosition.x,this.scrollPosition.y),document.body.style.overflow=e?"hidden":"",ju(this.target,this.player.config.classNames.fullscreen.fallback,e),gu.isIos){var t=document.head.querySelector('meta[name="viewport"]'),n="viewport-fit=cover";t||(t=document.createElement("meta")).setAttribute("name","viewport");var i=nu(t.content)&&t.content.includes(n);e?(this.cleanupViewport=!i,i||(t.content+=",".concat(n))):this.cleanupViewport&&(t.content=t.content.split(",").filter((function(e){return e.trim()!==n})).join(","))}this.onChange()}},{key:"trapFocus",value:function(e){if(!gu.isIos&&this.active&&"Tab"===e.key&&9===e.keyCode){var t=document.activeElement,n=Mu.call(this.player,"a[href], button:not(:disabled), input:not(:disabled), [tabindex]"),i=Ao(n,1)[0],r=n[n.length-1];t!==r||e.shiftKey?t===i&&e.shiftKey&&(r.focus(),e.preventDefault()):(i.focus(),e.preventDefault())}}},{key:"update",value:function(){var t;this.enabled?(t=this.forceFallback?"Fallback (forced)":e.native?"Native":"Fallback",this.player.debug.log("".concat(t," fullscreen enabled"))):this.player.debug.log("Fullscreen not supported and fallback disabled");ju(this.player.elements.container,this.player.config.classNames.fullscreen.enabled,this.enabled)}},{key:"enter",value:function(){this.enabled&&(gu.isIos&&this.player.config.fullscreen.iosNative?this.target.webkitEnterFullscreen():!e.native||this.forceFallback?this.toggleFallback(!0):this.prefix?du(this.prefix)||this.target["".concat(this.prefix,"Request").concat(this.property)]():this.target.requestFullscreen({navigationUI:"hide"}))}},{key:"exit",value:function(){if(this.enabled)if(gu.isIos&&this.player.config.fullscreen.iosNative)this.target.webkitExitFullscreen(),Gu(this.player.play());else if(!e.native||this.forceFallback)this.toggleFallback(!1);else if(this.prefix){if(!du(this.prefix)){var t="moz"===this.prefix?"Cancel":"Exit";document["".concat(this.prefix).concat(t).concat(this.property)]()}}else(document.cancelFullScreen||document.exitFullscreen).call(document)}},{key:"toggle",value:function(){this.active?this.exit():this.enter()}},{key:"usingNative",get:function(){return e.native&&!this.forceFallback}},{key:"enabled",get:function(){return(e.native||this.player.config.fullscreen.fallback)&&this.player.config.fullscreen.enabled&&this.player.supported.ui&&this.player.isVideo}},{key:"active",get:function(){if(!this.enabled)return!1;if(!e.native||this.forceFallback)return Nu(this.target,this.player.config.classNames.fullscreen.fallback);var t=this.prefix?document["".concat(this.prefix).concat(this.property,"Element")]:document.fullscreenElement;return t&&t.shadowRoot?t===this.target.getRootNode().host:t===this.target}},{key:"target",get:function(){return gu.isIos&&this.player.config.fullscreen.iosNative?this.player.media:this.player.elements.fullscreen||this.player.elements.container}}],[{key:"native",get:function(){return!!(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled)}},{key:"prefix",get:function(){if(ru(document.exitFullscreen))return"";var e="";return["webkit","moz","ms"].some((function(t){return!(!ru(document["".concat(t,"ExitFullscreen")])&&!ru(document["".concat(t,"CancelFullScreen")]))&&(e=t,!0)})),e}},{key:"property",get:function(){return"moz"===this.prefix?"FullScreen":"Fullscreen"}}]),e}(),Wh=Math.sign||function(e){return 0==(e=+e)||e!=e?e:e<0?-1:1};function Kh(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return new Promise((function(n,i){var r=new Image,a=function(){delete r.onload,delete r.onerror,(r.naturalWidth>=t?n:i)(r)};Object.assign(r,{onload:a,onerror:a,src:e})}))}Ie({target:"Math",stat:!0},{sign:Wh});var $h={addStyleHook:function(){ju(this.elements.container,this.config.selectors.container.replace(".",""),!0),ju(this.elements.container,this.config.classNames.uiSupported,this.supported.ui)},toggleNativeControls:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];e&&this.isHTML5?this.media.setAttribute("controls",""):this.media.removeAttribute("controls")},build:function(){var e=this;if(this.listeners.media(),!this.supported.ui)return this.debug.warn("Basic support only for ".concat(this.provider," ").concat(this.type)),void $h.toggleNativeControls.call(this,!0);su(this.elements.controls)||(jh.inject.call(this),this.listeners.controls()),$h.toggleNativeControls.call(this),this.isHTML5&&Mh.setup.call(this),this.volume=null,this.muted=null,this.loop=null,this.quality=null,this.speed=null,jh.updateVolume.call(this),jh.timeUpdate.call(this),$h.checkPlaying.call(this),ju(this.elements.container,this.config.classNames.pip.supported,qu.pip&&this.isHTML5&&this.isVideo),ju(this.elements.container,this.config.classNames.airplay.supported,qu.airplay&&this.isHTML5),ju(this.elements.container,this.config.classNames.isIos,gu.isIos),ju(this.elements.container,this.config.classNames.isTouch,this.touch),this.ready=!0,setTimeout((function(){Ku.call(e,e.media,"ready")}),0),$h.setTitle.call(this),this.poster&&$h.setPoster.call(this,this.poster,!1).catch((function(){})),this.config.duration&&jh.durationUpdate.call(this)},setTitle:function(){var e=Th("play",this.config);if(nu(this.config.title)&&!du(this.config.title)&&(e+=", ".concat(this.config.title)),Array.from(this.elements.buttons.play||[]).forEach((function(t){t.setAttribute("aria-label",e)})),this.isEmbed){var t=_u.call(this,"iframe");if(!su(t))return;var n=du(this.config.title)?"video":this.config.title,i=Th("frameTitle",this.config);t.setAttribute("title",i.replace("{title}",n))}},togglePoster:function(e){ju(this.elements.container,this.config.classNames.posterEnabled,e)},setPoster:function(e){var t=this,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return n&&this.poster?Promise.reject(new Error("Poster already set")):(this.media.setAttribute("data-poster",e),Yu.call(this).then((function(){return Kh(e)})).catch((function(n){throw e===t.poster&&$h.togglePoster.call(t,!1),n})).then((function(){if(e!==t.poster)throw new Error("setPoster cancelled by later call to setPoster")})).then((function(){return Object.assign(t.elements.poster.style,{backgroundImage:"url('".concat(e,"')"),backgroundSize:""}),$h.togglePoster.call(t,!0),e})))},checkPlaying:function(e){var t=this;ju(this.elements.container,this.config.classNames.playing,this.playing),ju(this.elements.container,this.config.classNames.paused,this.paused),ju(this.elements.container,this.config.classNames.stopped,this.stopped),Array.from(this.elements.buttons.play||[]).forEach((function(e){Object.assign(e,{pressed:t.playing}),e.setAttribute("aria-label",Th(t.playing?"pause":"play",t.config))})),lu(e)&&"timeupdate"===e.type||$h.toggleControls.call(this)},checkLoading:function(e){var t=this;this.loading=["stalled","waiting"].includes(e.type),clearTimeout(this.timers.loading),this.timers.loading=setTimeout((function(){ju(t.elements.container,t.config.classNames.loading,t.loading),$h.toggleControls.call(t)}),this.loading?250:0)},toggleControls:function(e){var t=this.elements.controls;if(t&&this.config.hideControls){var n=this.touch&&this.lastSeekTime+2e3>Date.now();this.toggleControls(Boolean(e||this.loading||this.paused||t.pressed||t.hover||n))}},migrateStyles:function(){var e=this;Object.values(So({},this.media.style)).filter((function(e){return!du(e)&&e.startsWith("--plyr")})).forEach((function(t){e.elements.container.style.setProperty(t,e.media.style.getPropertyValue(t)),e.media.style.removeProperty(t)})),du(this.media.style)&&this.media.removeAttribute("style")}},Yh=function(){function e(t){yo(this,e),this.player=t,this.lastKey=null,this.focusTimer=null,this.lastKeyDown=null,this.handleKey=this.handleKey.bind(this),this.toggleMenu=this.toggleMenu.bind(this),this.setTabFocus=this.setTabFocus.bind(this),this.firstTouch=this.firstTouch.bind(this)}return wo(e,[{key:"handleKey",value:function(e){var t=this.player,n=t.elements,i=e.keyCode?e.keyCode:e.which,r="keydown"===e.type,a=r&&i===this.lastKey;if(!(e.altKey||e.ctrlKey||e.metaKey||e.shiftKey)&&tu(i)){if(r){var o=document.activeElement;if(su(o)){var s=t.config.selectors.editable;if(o!==n.inputs.seek&&Ru(o,s))return;if(32===e.which&&Ru(o,'button, [role^="menuitem"]'))return}switch([32,37,38,39,40,48,49,50,51,52,53,54,56,57,67,70,73,75,76,77,79].includes(i)&&(e.preventDefault(),e.stopPropagation()),i){case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:a||(t.currentTime=t.duration/10*(i-48));break;case 32:case 75:a||Gu(t.togglePlay());break;case 38:t.increaseVolume(.1);break;case 40:t.decreaseVolume(.1);break;case 77:a||(t.muted=!t.muted);break;case 39:t.forward();break;case 37:t.rewind();break;case 70:t.fullscreen.toggle();break;case 67:a||t.toggleCaptions();break;case 76:t.loop=!t.loop}27===i&&!t.fullscreen.usingNative&&t.fullscreen.active&&t.fullscreen.toggle(),this.lastKey=i}else this.lastKey=null}}},{key:"toggleMenu",value:function(e){jh.toggleMenu.call(this.player,e)}},{key:"firstTouch",value:function(){var e=this.player,t=e.elements;e.touch=!0,ju(t.container,e.config.classNames.isTouch,!0)}},{key:"setTabFocus",value:function(e){var t=this.player,n=t.elements;if(clearTimeout(this.focusTimer),"keydown"!==e.type||9===e.which){"keydown"===e.type&&(this.lastKeyDown=e.timeStamp);var i,r=e.timeStamp-this.lastKeyDown<=20;if("focus"!==e.type||r)i=t.config.classNames.tabFocus,ju(Mu.call(t,".".concat(i)),i,!1),"focusout"!==e.type&&(this.focusTimer=setTimeout((function(){var e=document.activeElement;n.container.contains(e)&&ju(document.activeElement,t.config.classNames.tabFocus,!0)}),10))}}},{key:"global",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=this.player;t.config.keyboard.global&&Bu.call(t,window,"keydown keyup",this.handleKey,e,!1),Bu.call(t,document.body,"click",this.toggleMenu,e),Wu.call(t,document.body,"touchstart",this.firstTouch),Bu.call(t,document.body,"keydown focus blur focusout",this.setTabFocus,e,!1,!0)}},{key:"container",value:function(){var e=this.player,t=e.config,n=e.elements,i=e.timers;!t.keyboard.global&&t.keyboard.focused&&Vu.call(e,n.container,"keydown keyup",this.handleKey,!1),Vu.call(e,n.container,"mousemove mouseleave touchstart touchmove enterfullscreen exitfullscreen",(function(t){var r=n.controls;r&&"enterfullscreen"===t.type&&(r.pressed=!1,r.hover=!1);var a=0;["touchstart","touchmove","mousemove"].includes(t.type)&&($h.toggleControls.call(e,!0),a=e.touch?3e3:2e3),clearTimeout(i.controls),i.controls=setTimeout((function(){return $h.toggleControls.call(e,!1)}),a)}));var r=function(t){if(!t)return Zu.call(e);var i=n.container.getBoundingClientRect(),r=i.width,a=i.height;return Zu.call(e,"".concat(r,":").concat(a))},a=function(){clearTimeout(i.resized),i.resized=setTimeout(r,50)};Vu.call(e,n.container,"enterfullscreen exitfullscreen",(function(t){var i=e.fullscreen,o=i.target,s=i.usingNative;if(o===n.container&&(e.isEmbed||!du(e.config.ratio))){var l="enterfullscreen"===t.type,c=r(l);c.padding;!function(t,n,i){if(e.isVimeo&&!e.config.vimeo.premium){var r=e.elements.wrapper.firstChild,a=Ao(t,2)[1],o=Ao(Ju.call(e),2),s=o[0],l=o[1];r.style.maxWidth=i?"".concat(a/l*s,"px"):null,r.style.margin=i?"0 auto":null}}(c.ratio,0,l),s||(l?Vu.call(e,window,"resize",a):zu.call(e,window,"resize",a))}}))}},{key:"media",value:function(){var e=this,t=this.player,n=t.elements;if(Vu.call(t,t.media,"timeupdate seeking seeked",(function(e){return jh.timeUpdate.call(t,e)})),Vu.call(t,t.media,"durationchange loadeddata loadedmetadata",(function(e){return jh.durationUpdate.call(t,e)})),Vu.call(t,t.media,"ended",(function(){t.isHTML5&&t.isVideo&&t.config.resetOnEnd&&(t.restart(),t.pause())})),Vu.call(t,t.media,"progress playing seeking seeked",(function(e){return jh.updateProgress.call(t,e)})),Vu.call(t,t.media,"volumechange",(function(e){return jh.updateVolume.call(t,e)})),Vu.call(t,t.media,"playing play pause ended emptied timeupdate",(function(e){return $h.checkPlaying.call(t,e)})),Vu.call(t,t.media,"waiting canplay seeked playing",(function(e){return $h.checkLoading.call(t,e)})),t.supported.ui&&t.config.clickToPlay&&!t.isAudio){var i=_u.call(t,".".concat(t.config.classNames.video));if(!su(i))return;Vu.call(t,n.container,"click",(function(r){([n.container,i].includes(r.target)||i.contains(r.target))&&(t.touch&&t.config.hideControls||(t.ended?(e.proxy(r,t.restart,"restart"),e.proxy(r,(function(){Gu(t.play())}),"play")):e.proxy(r,(function(){Gu(t.togglePlay())}),"play")))}))}t.supported.ui&&t.config.disableContextMenu&&Vu.call(t,n.wrapper,"contextmenu",(function(e){e.preventDefault()}),!1),Vu.call(t,t.media,"volumechange",(function(){t.storage.set({volume:t.volume,muted:t.muted})})),Vu.call(t,t.media,"ratechange",(function(){jh.updateSetting.call(t,"speed"),t.storage.set({speed:t.speed})})),Vu.call(t,t.media,"qualitychange",(function(e){jh.updateSetting.call(t,"quality",null,e.detail.quality)})),Vu.call(t,t.media,"ready qualitychange",(function(){jh.setDownloadUrl.call(t)}));var r=t.config.events.concat(["keyup","keydown"]).join(" ");Vu.call(t,t.media,r,(function(e){var i=e.detail,r=void 0===i?{}:i;"error"===e.type&&(r=t.media.error),Ku.call(t,n.container,e.type,!0,r)}))}},{key:"proxy",value:function(e,t,n){var i=this.player,r=i.config.listeners[n],a=!0;ru(r)&&(a=r.call(i,e)),!1!==a&&ru(t)&&t.call(i,e)}},{key:"bind",value:function(e,t,n,i){var r=this,a=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],o=this.player,s=o.config.listeners[i],l=ru(s);Vu.call(o,e,t,(function(e){return r.proxy(e,n,i)}),a&&!l)}},{key:"controls",value:function(){var e=this,t=this.player,n=t.elements,i=gu.isIE?"change":"input";if(n.buttons.play&&Array.from(n.buttons.play).forEach((function(n){e.bind(n,"click",(function(){Gu(t.togglePlay())}),"play")})),this.bind(n.buttons.restart,"click",t.restart,"restart"),this.bind(n.buttons.rewind,"click",t.rewind,"rewind"),this.bind(n.buttons.fastForward,"click",t.forward,"fastForward"),this.bind(n.buttons.mute,"click",(function(){t.muted=!t.muted}),"mute"),this.bind(n.buttons.captions,"click",(function(){return t.toggleCaptions()})),this.bind(n.buttons.download,"click",(function(){Ku.call(t,t.media,"download")}),"download"),this.bind(n.buttons.fullscreen,"click",(function(){t.fullscreen.toggle()}),"fullscreen"),this.bind(n.buttons.pip,"click",(function(){t.pip="toggle"}),"pip"),this.bind(n.buttons.airplay,"click",t.airplay,"airplay"),this.bind(n.buttons.settings,"click",(function(e){e.stopPropagation(),e.preventDefault(),jh.toggleMenu.call(t,e)}),null,!1),this.bind(n.buttons.settings,"keyup",(function(e){var n=e.which;[13,32].includes(n)&&(13!==n?(e.preventDefault(),e.stopPropagation(),jh.toggleMenu.call(t,e)):jh.focusFirstMenuItem.call(t,null,!0))}),null,!1),this.bind(n.settings.menu,"keydown",(function(e){27===e.which&&jh.toggleMenu.call(t,e)})),this.bind(n.inputs.seek,"mousedown mousemove",(function(e){var t=n.progress.getBoundingClientRect(),i=100/t.width*(e.pageX-t.left);e.currentTarget.setAttribute("seek-value",i)})),this.bind(n.inputs.seek,"mousedown mouseup keydown keyup touchstart touchend",(function(e){var n=e.currentTarget,i=e.keyCode?e.keyCode:e.which;if(!cu(e)||39===i||37===i){t.lastSeekTime=Date.now();var r=n.hasAttribute("play-on-seeked"),a=["mouseup","touchend","keyup"].includes(e.type);r&&a?(n.removeAttribute("play-on-seeked"),Gu(t.play())):!a&&t.playing&&(n.setAttribute("play-on-seeked",""),t.pause())}})),gu.isIos){var r=Mu.call(t,'input[type="range"]');Array.from(r).forEach((function(t){return e.bind(t,i,(function(e){return mu(e.target)}))}))}this.bind(n.inputs.seek,i,(function(e){var n=e.currentTarget,i=n.getAttribute("seek-value");du(i)&&(i=n.value),n.removeAttribute("seek-value"),t.currentTime=i/n.max*t.duration}),"seek"),this.bind(n.progress,"mouseenter mouseleave mousemove",(function(e){return jh.updateSeekTooltip.call(t,e)})),this.bind(n.progress,"mousemove touchmove",(function(e){var n=t.previewThumbnails;n&&n.loaded&&n.startMove(e)})),this.bind(n.progress,"mouseleave touchend click",(function(){var e=t.previewThumbnails;e&&e.loaded&&e.endMove(!1,!0)})),this.bind(n.progress,"mousedown touchstart",(function(e){var n=t.previewThumbnails;n&&n.loaded&&n.startScrubbing(e)})),this.bind(n.progress,"mouseup touchend",(function(e){var n=t.previewThumbnails;n&&n.loaded&&n.endScrubbing(e)})),gu.isWebkit&&Array.from(Mu.call(t,'input[type="range"]')).forEach((function(n){e.bind(n,"input",(function(e){return jh.updateRangeFill.call(t,e.target)}))})),t.config.toggleInvert&&!su(n.display.duration)&&this.bind(n.display.currentTime,"click",(function(){0!==t.currentTime&&(t.config.invertTime=!t.config.invertTime,jh.timeUpdate.call(t))})),this.bind(n.inputs.volume,i,(function(e){t.volume=e.target.value}),"volume"),this.bind(n.controls,"mouseenter mouseleave",(function(e){n.controls.hover=!t.touch&&"mouseenter"===e.type})),n.fullscreen&&Array.from(n.fullscreen.children).filter((function(e){return!e.contains(n.container)})).forEach((function(i){e.bind(i,"mouseenter mouseleave",(function(e){n.controls.hover=!t.touch&&"mouseenter"===e.type}))})),this.bind(n.controls,"mousedown mouseup touchstart touchend touchcancel",(function(e){n.controls.pressed=["mousedown","touchstart"].includes(e.type)})),this.bind(n.controls,"focusin",(function(){var i=t.config,r=t.timers;ju(n.controls,i.classNames.noTransition,!0),$h.toggleControls.call(t,!0),setTimeout((function(){ju(n.controls,i.classNames.noTransition,!1)}),0);var a=e.touch?3e3:4e3;clearTimeout(r.controls),r.controls=setTimeout((function(){return $h.toggleControls.call(t,!1)}),a)})),this.bind(n.inputs.volume,"wheel",(function(e){var n=e.webkitDirectionInvertedFromDevice,i=Ao([e.deltaX,-e.deltaY].map((function(e){return n?-e:e})),2),r=i[0],a=i[1],o=Math.sign(Math.abs(r)>Math.abs(a)?r:a);t.increaseVolume(o/50);var s=t.media.volume;(1===o&&s<1||-1===o&&s>0)&&e.preventDefault()}),"volume",!1)}}]),e}(),Gh=Kn("splice"),Xh=Qt("splice",{ACCESSORS:!0,0:0,1:2}),Qh=Math.max,Jh=Math.min;Ie({target:"Array",proto:!0,forced:!Gh||!Xh},{splice:function(e,t){var n,i,r,a,o,s,l=Re(this),c=le(l.length),u=he(e,c),h=arguments.length;if(0===h?n=i=0:1===h?(n=0,i=c-u):(n=h-2,i=Jh(Qh(oe(t),0),c-u)),c+n-i>9007199254740991)throw TypeError("Maximum allowed length exceeded");for(r=ot(l,i),a=0;a<i;a++)(o=u+a)in l&&Fn(r,a,l[o]);if(r.length=i,n<i){for(a=u;a<c-i;a++)s=a+n,(o=a+i)in l?l[s]=l[o]:delete l[s];for(a=c;a>c-i+n;a--)delete l[a-1]}else if(n>i)for(a=c-i;a>u;a--)s=a+n-1,(o=a+i-1)in l?l[s]=l[o]:delete l[s];for(a=0;a<n;a++)l[a+u]=arguments[a+2];return l.length=c-i+n,r}});var Zh=t((function(e,t){e.exports=function(){var e=function(){},t={},n={},i={};function r(e,t){if(e){var r=i[e];if(n[e]=t,r)for(;r.length;)r[0](e,t),r.splice(0,1)}}function a(t,n){t.call&&(t={success:t}),n.length?(t.error||e)(n):(t.success||e)(t)}function o(t,n,i,r){var a,s,l=document,c=i.async,u=(i.numRetries||0)+1,h=i.before||e,f=t.replace(/[\?|#].*$/,""),d=t.replace(/^(css|img)!/,"");r=r||0,/(^css!|\.css$)/.test(f)?((s=l.createElement("link")).rel="stylesheet",s.href=d,(a="hideFocus"in s)&&s.relList&&(a=0,s.rel="preload",s.as="style")):/(^img!|\.(png|gif|jpg|svg|webp)$)/.test(f)?(s=l.createElement("img")).src=d:((s=l.createElement("script")).src=t,s.async=void 0===c||c),s.onload=s.onerror=s.onbeforeload=function(e){var l=e.type[0];if(a)try{s.sheet.cssText.length||(l="e")}catch(e){18!=e.code&&(l="e")}if("e"==l){if((r+=1)<u)return o(t,n,i,r)}else if("preload"==s.rel&&"style"==s.as)return s.rel="stylesheet";n(t,l,e.defaultPrevented)},!1!==h(t,s)&&l.head.appendChild(s)}function s(e,n,i){var s,l;if(n&&n.trim&&(s=n),l=(s?i:n)||{},s){if(s in t)throw"LoadJS";t[s]=!0}function c(t,n){!function(e,t,n){var i,r,a=(e=e.push?e:[e]).length,s=a,l=[];for(i=function(e,n,i){if("e"==n&&l.push(e),"b"==n){if(!i)return;l.push(e)}--a||t(l)},r=0;r<s;r++)o(e[r],i,n)}(e,(function(e){a(l,e),t&&a({success:t,error:n},e),r(s,e)}),l)}if(l.returnPromise)return new Promise(c);c()}return s.ready=function(e,t){return function(e,t){e=e.push?e:[e];var r,a,o,s=[],l=e.length,c=l;for(r=function(e,n){n.length&&s.push(e),--c||t(s)};l--;)a=e[l],(o=n[a])?r(a,o):(i[a]=i[a]||[]).push(r)}(e,(function(e){a(t,e)})),s},s.done=function(e){r(e,[])},s.reset=function(){t={},n={},i={}},s.isDefined=function(e){return e in t},s}()}));function ef(e){return new Promise((function(t,n){Zh(e,{success:t,error:n})}))}function tf(e){e&&!this.embed.hasPlayed&&(this.embed.hasPlayed=!0),this.media.paused===e&&(this.media.paused=!e,Ku.call(this,this.media,e?"play":"pause"))}var nf={setup:function(){var e=this;ju(e.elements.wrapper,e.config.classNames.embed,!0),e.options.speed=e.config.speed.options,Zu.call(e),eu(window.Vimeo)?nf.ready.call(e):ef(e.config.urls.vimeo.sdk).then((function(){nf.ready.call(e)})).catch((function(t){e.debug.warn("Vimeo SDK (player.js) failed to load",t)}))},ready:function(){var e=this,t=this,n=t.config.vimeo,i=n.premium,r=n.referrerPolicy,a=Eo(n,["premium","referrerPolicy"]);i&&Object.assign(a,{controls:!1,sidedock:!1});var o=Rh(So({loop:t.config.loop.active,autoplay:t.autoplay,muted:t.muted,gesture:"media",playsinline:!this.config.fullscreen.iosNative},a)),s=t.media.getAttribute("src");du(s)&&(s=t.media.getAttribute(t.config.attributes.embed.id));var l,c=du(l=s)?null:tu(Number(l))?l:l.match(/^.*(vimeo.com\/|video\/)(\d+).*/)?RegExp.$2:l,u=Au("iframe"),h=gh(t.config.urls.vimeo.iframe,c,o);u.setAttribute("src",h),u.setAttribute("allowfullscreen",""),u.setAttribute("allow","autoplay,fullscreen,picture-in-picture"),du(r)||u.setAttribute("referrerPolicy",r);var f=t.poster;if(i)u.setAttribute("data-poster",f),t.media=Ou(u,t.media);else{var d=Au("div",{class:t.config.classNames.embedContainer,"data-poster":f});d.appendChild(u),t.media=Ou(d,t.media)}Eh(gh(t.config.urls.vimeo.api,c),"json").then((function(e){if(!du(e)){var n=new URL(e[0].thumbnail_large);n.pathname="".concat(n.pathname.split("_")[0],".jpg"),$h.setPoster.call(t,n.href).catch((function(){}))}})),t.embed=new window.Vimeo.Player(u,{autopause:t.config.autopause,muted:t.muted}),t.media.paused=!0,t.media.currentTime=0,t.supported.ui&&t.embed.disableTextTrack(),t.media.play=function(){return tf.call(t,!0),t.embed.play()},t.media.pause=function(){return tf.call(t,!1),t.embed.pause()},t.media.stop=function(){t.pause(),t.currentTime=0};var p=t.media.currentTime;Object.defineProperty(t.media,"currentTime",{get:function(){return p},set:function(e){var n=t.embed,i=t.media,r=t.paused,a=t.volume,o=r&&!n.hasPlayed;i.seeking=!0,Ku.call(t,i,"seeking"),Promise.resolve(o&&n.setVolume(0)).then((function(){return n.setCurrentTime(e)})).then((function(){return o&&n.pause()})).then((function(){return o&&n.setVolume(a)})).catch((function(){}))}});var m=t.config.speed.selected;Object.defineProperty(t.media,"playbackRate",{get:function(){return m},set:function(e){t.embed.setPlaybackRate(e).then((function(){m=e,Ku.call(t,t.media,"ratechange")})).catch((function(){t.options.speed=[1]}))}});var g=t.config.volume;Object.defineProperty(t.media,"volume",{get:function(){return g},set:function(e){t.embed.setVolume(e).then((function(){g=e,Ku.call(t,t.media,"volumechange")}))}});var v=t.config.muted;Object.defineProperty(t.media,"muted",{get:function(){return v},set:function(e){var n=!!iu(e)&&e;t.embed.setVolume(n?0:t.config.volume).then((function(){v=n,Ku.call(t,t.media,"volumechange")}))}});var y,b=t.config.loop;Object.defineProperty(t.media,"loop",{get:function(){return b},set:function(e){var n=iu(e)?e:t.config.loop.active;t.embed.setLoop(n).then((function(){b=n}))}}),t.embed.getVideoUrl().then((function(e){y=e,jh.setDownloadUrl.call(t)})).catch((function(t){e.debug.warn(t)})),Object.defineProperty(t.media,"currentSrc",{get:function(){return y}}),Object.defineProperty(t.media,"ended",{get:function(){return t.currentTime===t.duration}}),Promise.all([t.embed.getVideoWidth(),t.embed.getVideoHeight()]).then((function(n){var i=Ao(n,2),r=i[0],a=i[1];t.embed.ratio=[r,a],Zu.call(e)})),t.embed.setAutopause(t.config.autopause).then((function(e){t.config.autopause=e})),t.embed.getVideoTitle().then((function(n){t.config.title=n,$h.setTitle.call(e)})),t.embed.getCurrentTime().then((function(e){p=e,Ku.call(t,t.media,"timeupdate")})),t.embed.getDuration().then((function(e){t.media.duration=e,Ku.call(t,t.media,"durationchange")})),t.embed.getTextTracks().then((function(e){t.media.textTracks=e,Mh.setup.call(t)})),t.embed.on("cuechange",(function(e){var n=e.cues,i=(void 0===n?[]:n).map((function(e){return function(e){var t=document.createDocumentFragment(),n=document.createElement("div");return t.appendChild(n),n.innerHTML=e,t.firstChild.innerText}(e.text)}));Mh.updateCues.call(t,i)})),t.embed.on("loaded",(function(){(t.embed.getPaused().then((function(e){tf.call(t,!e),e||Ku.call(t,t.media,"playing")})),su(t.embed.element)&&t.supported.ui)&&t.embed.element.setAttribute("tabindex",-1)})),t.embed.on("bufferstart",(function(){Ku.call(t,t.media,"waiting")})),t.embed.on("bufferend",(function(){Ku.call(t,t.media,"playing")})),t.embed.on("play",(function(){tf.call(t,!0),Ku.call(t,t.media,"playing")})),t.embed.on("pause",(function(){tf.call(t,!1)})),t.embed.on("timeupdate",(function(e){t.media.seeking=!1,p=e.seconds,Ku.call(t,t.media,"timeupdate")})),t.embed.on("progress",(function(e){t.media.buffered=e.percent,Ku.call(t,t.media,"progress"),1===parseInt(e.percent,10)&&Ku.call(t,t.media,"canplaythrough"),t.embed.getDuration().then((function(e){e!==t.media.duration&&(t.media.duration=e,Ku.call(t,t.media,"durationchange"))}))})),t.embed.on("seeked",(function(){t.media.seeking=!1,Ku.call(t,t.media,"seeked")})),t.embed.on("ended",(function(){t.media.paused=!0,Ku.call(t,t.media,"ended")})),t.embed.on("error",(function(e){t.media.error=e,Ku.call(t,t.media,"error")})),setTimeout((function(){return $h.build.call(t)}),0)}};function rf(e){e&&!this.embed.hasPlayed&&(this.embed.hasPlayed=!0),this.media.paused===e&&(this.media.paused=!e,Ku.call(this,this.media,e?"play":"pause"))}function af(e){return e.noCookie?"https://www.youtube-nocookie.com":"http:"===window.location.protocol?"http://www.youtube.com":void 0}var of={setup:function(){var e=this;if(ju(this.elements.wrapper,this.config.classNames.embed,!0),eu(window.YT)&&ru(window.YT.Player))of.ready.call(this);else{var t=window.onYouTubeIframeAPIReady;window.onYouTubeIframeAPIReady=function(){ru(t)&&t(),of.ready.call(e)},ef(this.config.urls.youtube.sdk).catch((function(t){e.debug.warn("YouTube API failed to load",t)}))}},getTitle:function(e){var t=this;Eh(gh(this.config.urls.youtube.api,e)).then((function(e){if(eu(e)){var n=e.title,i=e.height,r=e.width;t.config.title=n,$h.setTitle.call(t),t.embed.ratio=[r,i]}Zu.call(t)})).catch((function(){Zu.call(t)}))},ready:function(){var e=this,t=e.media&&e.media.getAttribute("id");if(du(t)||!t.startsWith("youtube-")){var n=e.media.getAttribute("src");du(n)&&(n=e.media.getAttribute(this.config.attributes.embed.id));var i,r,a=du(i=n)?null:i.match(/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=)([^#&?]*).*/)?RegExp.$2:i,o=(r=e.provider,"".concat(r,"-").concat(Math.floor(1e4*Math.random()))),s=Au("div",{id:o,"data-poster":e.poster});e.media=Ou(s,e.media);var l=function(e){return"https://i.ytimg.com/vi/".concat(a,"/").concat(e,"default.jpg")};Kh(l("maxres"),121).catch((function(){return Kh(l("sd"),121)})).catch((function(){return Kh(l("hq"))})).then((function(t){return $h.setPoster.call(e,t.src)})).then((function(t){t.includes("maxres")||(e.elements.poster.style.backgroundSize="cover")})).catch((function(){}));var c=e.config.youtube;e.embed=new window.YT.Player(o,{videoId:a,host:af(c),playerVars:Tu({},{autoplay:e.config.autoplay?1:0,hl:e.config.hl,controls:e.supported.ui?0:1,disablekb:1,playsinline:e.config.fullscreen.iosNative?0:1,cc_load_policy:e.captions.active?1:0,cc_lang_pref:e.config.captions.language,widget_referrer:window?window.location.href:null},c),events:{onError:function(t){if(!e.media.error){var n=t.data,i={2:"The request contains an invalid parameter value. For example, this error occurs if you specify a video ID that does not have 11 characters, or if the video ID contains invalid characters, such as exclamation points or asterisks.",5:"The requested content cannot be played in an HTML5 player or another error related to the HTML5 player has occurred.",100:"The video requested was not found. This error occurs when a video has been removed (for any reason) or has been marked as private.",101:"The owner of the requested video does not allow it to be played in embedded players.",150:"The owner of the requested video does not allow it to be played in embedded players."}[n]||"An unknown error occured";e.media.error={code:n,message:i},Ku.call(e,e.media,"error")}},onPlaybackRateChange:function(t){var n=t.target;e.media.playbackRate=n.getPlaybackRate(),Ku.call(e,e.media,"ratechange")},onReady:function(t){if(!ru(e.media.play)){var n=t.target;of.getTitle.call(e,a),e.media.play=function(){rf.call(e,!0),n.playVideo()},e.media.pause=function(){rf.call(e,!1),n.pauseVideo()},e.media.stop=function(){n.stopVideo()},e.media.duration=n.getDuration(),e.media.paused=!0,e.media.currentTime=0,Object.defineProperty(e.media,"currentTime",{get:function(){return Number(n.getCurrentTime())},set:function(t){e.paused&&!e.embed.hasPlayed&&e.embed.mute(),e.media.seeking=!0,Ku.call(e,e.media,"seeking"),n.seekTo(t)}}),Object.defineProperty(e.media,"playbackRate",{get:function(){return n.getPlaybackRate()},set:function(e){n.setPlaybackRate(e)}});var i=e.config.volume;Object.defineProperty(e.media,"volume",{get:function(){return i},set:function(t){i=t,n.setVolume(100*i),Ku.call(e,e.media,"volumechange")}});var r=e.config.muted;Object.defineProperty(e.media,"muted",{get:function(){return r},set:function(t){var i=iu(t)?t:r;r=i,n[i?"mute":"unMute"](),Ku.call(e,e.media,"volumechange")}}),Object.defineProperty(e.media,"currentSrc",{get:function(){return n.getVideoUrl()}}),Object.defineProperty(e.media,"ended",{get:function(){return e.currentTime===e.duration}});var o=n.getAvailablePlaybackRates();e.options.speed=o.filter((function(t){return e.config.speed.options.includes(t)})),e.supported.ui&&e.media.setAttribute("tabindex",-1),Ku.call(e,e.media,"timeupdate"),Ku.call(e,e.media,"durationchange"),clearInterval(e.timers.buffering),e.timers.buffering=setInterval((function(){e.media.buffered=n.getVideoLoadedFraction(),(null===e.media.lastBuffered||e.media.lastBuffered<e.media.buffered)&&Ku.call(e,e.media,"progress"),e.media.lastBuffered=e.media.buffered,1===e.media.buffered&&(clearInterval(e.timers.buffering),Ku.call(e,e.media,"canplaythrough"))}),200),setTimeout((function(){return $h.build.call(e)}),50)}},onStateChange:function(t){var n=t.target;switch(clearInterval(e.timers.playing),e.media.seeking&&[1,2].includes(t.data)&&(e.media.seeking=!1,Ku.call(e,e.media,"seeked")),t.data){case-1:Ku.call(e,e.media,"timeupdate"),e.media.buffered=n.getVideoLoadedFraction(),Ku.call(e,e.media,"progress");break;case 0:rf.call(e,!1),e.media.loop?(n.stopVideo(),n.playVideo()):Ku.call(e,e.media,"ended");break;case 1:e.config.autoplay||!e.media.paused||e.embed.hasPlayed?(rf.call(e,!0),Ku.call(e,e.media,"playing"),e.timers.playing=setInterval((function(){Ku.call(e,e.media,"timeupdate")}),50),e.media.duration!==n.getDuration()&&(e.media.duration=n.getDuration(),Ku.call(e,e.media,"durationchange"))):e.media.pause();break;case 2:e.muted||e.embed.unMute(),rf.call(e,!1);break;case 3:Ku.call(e,e.media,"waiting")}Ku.call(e,e.elements.container,"statechange",!1,{code:t.data})}}})}}},sf={setup:function(){this.media?(ju(this.elements.container,this.config.classNames.type.replace("{0}",this.type),!0),ju(this.elements.container,this.config.classNames.provider.replace("{0}",this.provider),!0),this.isEmbed&&ju(this.elements.container,this.config.classNames.type.replace("{0}","video"),!0),this.isVideo&&(this.elements.wrapper=Au("div",{class:this.config.classNames.video}),Su(this.media,this.elements.wrapper),this.elements.poster=Au("div",{class:this.config.classNames.poster}),this.elements.wrapper.appendChild(this.elements.poster)),this.isHTML5?eh.setup.call(this):this.isYouTube?of.setup.call(this):this.isVimeo&&nf.setup.call(this)):this.debug.warn("No media element found!")}},lf=function(){function e(t){var n=this;yo(this,e),this.player=t,this.config=t.config.ads,this.playing=!1,this.initialized=!1,this.elements={container:null,displayContainer:null},this.manager=null,this.loader=null,this.cuePoints=null,this.events={},this.safetyTimer=null,this.countdownTimer=null,this.managerPromise=new Promise((function(e,t){n.on("loaded",e),n.on("error",t)})),this.load()}return wo(e,[{key:"load",value:function(){var e=this;this.enabled&&(eu(window.google)&&eu(window.google.ima)?this.ready():ef(this.player.config.urls.googleIMA.sdk).then((function(){e.ready()})).catch((function(){e.trigger("error",new Error("Google IMA SDK failed to load"))})))}},{key:"ready",value:function(){var e,t=this;this.enabled||((e=this).manager&&e.manager.destroy(),e.elements.displayContainer&&e.elements.displayContainer.destroy(),e.elements.container.remove()),this.startSafetyTimer(12e3,"ready()"),this.managerPromise.then((function(){t.clearSafetyTimer("onAdsManagerLoaded()")})),this.listeners(),this.setupIMA()}},{key:"setupIMA",value:function(){var e=this;this.elements.container=Au("div",{class:this.player.config.classNames.ads}),this.player.elements.container.appendChild(this.elements.container),google.ima.settings.setVpaidMode(google.ima.ImaSdkSettings.VpaidMode.ENABLED),google.ima.settings.setLocale(this.player.config.ads.language),google.ima.settings.setDisableCustomPlaybackForIOS10Plus(this.player.config.playsinline),this.elements.displayContainer=new google.ima.AdDisplayContainer(this.elements.container,this.player.media),this.loader=new google.ima.AdsLoader(this.elements.displayContainer),this.loader.addEventListener(google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,(function(t){return e.onAdsManagerLoaded(t)}),!1),this.loader.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,(function(t){return e.onAdError(t)}),!1),this.requestAds()}},{key:"requestAds",value:function(){var e=this.player.elements.container;try{var t=new google.ima.AdsRequest;t.adTagUrl=this.tagUrl,t.linearAdSlotWidth=e.offsetWidth,t.linearAdSlotHeight=e.offsetHeight,t.nonLinearAdSlotWidth=e.offsetWidth,t.nonLinearAdSlotHeight=e.offsetHeight,t.forceNonLinearFullSlot=!1,t.setAdWillPlayMuted(!this.player.muted),this.loader.requestAds(t)}catch(e){this.onAdError(e)}}},{key:"pollCountdown",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!t)return clearInterval(this.countdownTimer),void this.elements.container.removeAttribute("data-badge-text");var n=function(){var t=Lh(Math.max(e.manager.getRemainingTime(),0)),n="".concat(Th("advertisement",e.player.config)," - ").concat(t);e.elements.container.setAttribute("data-badge-text",n)};this.countdownTimer=setInterval(n,100)}},{key:"onAdsManagerLoaded",value:function(e){var t=this;if(this.enabled){var n=new google.ima.AdsRenderingSettings;n.restoreCustomPlaybackStateOnAdBreakComplete=!0,n.enablePreloading=!0,this.manager=e.getAdsManager(this.player,n),this.cuePoints=this.manager.getCuePoints(),this.manager.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,(function(e){return t.onAdError(e)})),Object.keys(google.ima.AdEvent.Type).forEach((function(e){t.manager.addEventListener(google.ima.AdEvent.Type[e],(function(e){return t.onAdEvent(e)}))})),this.trigger("loaded")}}},{key:"addCuePoints",value:function(){var e=this;du(this.cuePoints)||this.cuePoints.forEach((function(t){if(0!==t&&-1!==t&&t<e.player.duration){var n=e.player.elements.progress;if(su(n)){var i=100/e.player.duration*t,r=Au("span",{class:e.player.config.classNames.cues});r.style.left="".concat(i.toString(),"%"),n.appendChild(r)}}}))}},{key:"onAdEvent",value:function(e){var t=this,n=this.player.elements.container,i=e.getAd(),r=e.getAdData();switch(function(e){Ku.call(t.player,t.player.media,"ads".concat(e.replace(/_/g,"").toLowerCase()))}(e.type),e.type){case google.ima.AdEvent.Type.LOADED:this.trigger("loaded"),this.pollCountdown(!0),i.isLinear()||(i.width=n.offsetWidth,i.height=n.offsetHeight);break;case google.ima.AdEvent.Type.STARTED:this.manager.setVolume(this.player.volume);break;case google.ima.AdEvent.Type.ALL_ADS_COMPLETED:this.player.ended?this.loadAds():this.loader.contentComplete();break;case google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED:this.pauseContent();break;case google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED:this.pollCountdown(),this.resumeContent();break;case google.ima.AdEvent.Type.LOG:r.adError&&this.player.debug.warn("Non-fatal ad error: ".concat(r.adError.getMessage()))}}},{key:"onAdError",value:function(e){this.cancel(),this.player.debug.warn("Ads error",e)}},{key:"listeners",value:function(){var e,t=this,n=this.player.elements.container;this.player.on("canplay",(function(){t.addCuePoints()})),this.player.on("ended",(function(){t.loader.contentComplete()})),this.player.on("timeupdate",(function(){e=t.player.currentTime})),this.player.on("seeked",(function(){var n=t.player.currentTime;du(t.cuePoints)||t.cuePoints.forEach((function(i,r){e<i&&i<n&&(t.manager.discardAdBreak(),t.cuePoints.splice(r,1))}))})),window.addEventListener("resize",(function(){t.manager&&t.manager.resize(n.offsetWidth,n.offsetHeight,google.ima.ViewMode.NORMAL)}))}},{key:"play",value:function(){var e=this,t=this.player.elements.container;this.managerPromise||this.resumeContent(),this.managerPromise.then((function(){e.manager.setVolume(e.player.volume),e.elements.displayContainer.initialize();try{e.initialized||(e.manager.init(t.offsetWidth,t.offsetHeight,google.ima.ViewMode.NORMAL),e.manager.start()),e.initialized=!0}catch(t){e.onAdError(t)}})).catch((function(){}))}},{key:"resumeContent",value:function(){this.elements.container.style.zIndex="",this.playing=!1,Gu(this.player.media.play())}},{key:"pauseContent",value:function(){this.elements.container.style.zIndex=3,this.playing=!0,this.player.media.pause()}},{key:"cancel",value:function(){this.initialized&&this.resumeContent(),this.trigger("error"),this.loadAds()}},{key:"loadAds",value:function(){var e=this;this.managerPromise.then((function(){e.manager&&e.manager.destroy(),e.managerPromise=new Promise((function(t){e.on("loaded",t),e.player.debug.log(e.manager)})),e.initialized=!1,e.requestAds()})).catch((function(){}))}},{key:"trigger",value:function(e){for(var t=this,n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];var a=this.events[e];au(a)&&a.forEach((function(e){ru(e)&&e.apply(t,i)}))}},{key:"on",value:function(e,t){return au(this.events[e])||(this.events[e]=[]),this.events[e].push(t),this}},{key:"startSafetyTimer",value:function(e,t){var n=this;this.player.debug.log("Safety timer invoked from: ".concat(t)),this.safetyTimer=setTimeout((function(){n.cancel(),n.clearSafetyTimer("startSafetyTimer()")}),e)}},{key:"clearSafetyTimer",value:function(e){Zc(this.safetyTimer)||(this.player.debug.log("Safety timer cleared from: ".concat(e)),clearTimeout(this.safetyTimer),this.safetyTimer=null)}},{key:"enabled",get:function(){var e=this.config;return this.player.isHTML5&&this.player.isVideo&&e.enabled&&(!du(e.publisherId)||fu(e.tagUrl))}},{key:"tagUrl",get:function(){var e=this.config;if(fu(e.tagUrl))return e.tagUrl;var t={AV_PUBLISHERID:"58c25bb0073ef448b1087ad6",AV_CHANNELID:"5a0458dc28a06145e4519d21",AV_URL:window.location.hostname,cb:Date.now(),AV_WIDTH:640,AV_HEIGHT:480,AV_CDIM2:e.publisherId};return"".concat("https://go.aniview.com/api/adserver6/vast/","?").concat(Rh(t))}}]),e}(),cf=ct.findIndex,uf=!0,hf=Qt("findIndex");"findIndex"in[]&&Array(1).findIndex((function(){uf=!1})),Ie({target:"Array",proto:!0,forced:uf||!hf},{findIndex:function(e){return cf(this,e,arguments.length>1?arguments[1]:void 0)}}),dn("findIndex");var ff=Math.min,df=[].lastIndexOf,pf=!!df&&1/[1].lastIndexOf(1,-0)<0,mf=$t("lastIndexOf"),gf=Qt("indexOf",{ACCESSORS:!0,1:0}),vf=pf||!mf||!gf?function(e){if(pf)return df.apply(this,arguments)||0;var t=m(this),n=le(t.length),i=n-1;for(arguments.length>1&&(i=ff(i,oe(arguments[1]))),i<0&&(i=n+i);i>=0;i--)if(i in t&&t[i]===e)return i||0;return-1}:df;Ie({target:"Array",proto:!0,forced:vf!==[].lastIndexOf},{lastIndexOf:vf});var yf=function(e,t){var n={};return e>t.width/t.height?(n.width=t.width,n.height=1/e*t.width):(n.height=t.height,n.width=e*t.height),n},bf=function(){function e(t){yo(this,e),this.player=t,this.thumbnails=[],this.loaded=!1,this.lastMouseMoveTime=Date.now(),this.mouseDown=!1,this.loadedImages=[],this.elements={thumb:{},scrubbing:{}},this.load()}return wo(e,[{key:"load",value:function(){var e=this;this.player.elements.display.seekTooltip&&(this.player.elements.display.seekTooltip.hidden=this.enabled),this.enabled&&this.getThumbnails().then((function(){e.enabled&&(e.render(),e.determineContainerAutoSizing(),e.loaded=!0)}))}},{key:"getThumbnails",value:function(){var e=this;return new Promise((function(t){var n=e.player.config.previewThumbnails.src;if(du(n))throw new Error("Missing previewThumbnails.src config attribute");var i=function(){e.thumbnails.sort((function(e,t){return e.height-t.height})),e.player.debug.log("Preview thumbnails",e.thumbnails),t()};if(ru(n))n((function(t){e.thumbnails=t,i()}));else{var r=(nu(n)?[n]:n).map((function(t){return e.getThumbnail(t)}));Promise.all(r).then(i)}}))}},{key:"getThumbnail",value:function(e){var t=this;return new Promise((function(n){Eh(e).then((function(i){var r,a,o={frames:(r=i,a=[],r.split(/\r\n\r\n|\n\n|\r\r/).forEach((function(e){var t={};e.split(/\r\n|\n|\r/).forEach((function(e){if(tu(t.startTime)){if(!du(e.trim())&&du(t.text)){var n=e.trim().split("#xywh="),i=Ao(n,1);if(t.text=i[0],n[1]){var r=Ao(n[1].split(","),4);t.x=r[0],t.y=r[1],t.w=r[2],t.h=r[3]}}}else{var a=e.match(/([0-9]{2})?:?([0-9]{2}):([0-9]{2}).([0-9]{2,3})( ?--> ?)([0-9]{2})?:?([0-9]{2}):([0-9]{2}).([0-9]{2,3})/);a&&(t.startTime=60*Number(a[1]||0)*60+60*Number(a[2])+Number(a[3])+Number("0.".concat(a[4])),t.endTime=60*Number(a[6]||0)*60+60*Number(a[7])+Number(a[8])+Number("0.".concat(a[9])))}})),t.text&&a.push(t)})),a),height:null,urlPrefix:""};o.frames[0].text.startsWith("/")||o.frames[0].text.startsWith("http://")||o.frames[0].text.startsWith("https://")||(o.urlPrefix=e.substring(0,e.lastIndexOf("/")+1));var s=new Image;s.onload=function(){o.height=s.naturalHeight,o.width=s.naturalWidth,t.thumbnails.push(o),n()},s.src=o.urlPrefix+o.frames[0].text}))}))}},{key:"startMove",value:function(e){if(this.loaded&&lu(e)&&["touchmove","mousemove"].includes(e.type)&&this.player.media.duration){if("touchmove"===e.type)this.seekTime=this.player.media.duration*(this.player.elements.inputs.seek.value/100);else{var t=this.player.elements.progress.getBoundingClientRect(),n=100/t.width*(e.pageX-t.left);this.seekTime=this.player.media.duration*(n/100),this.seekTime<0&&(this.seekTime=0),this.seekTime>this.player.media.duration-1&&(this.seekTime=this.player.media.duration-1),this.mousePosX=e.pageX,this.elements.thumb.time.innerText=Lh(this.seekTime)}this.showImageAtCurrentTime()}}},{key:"endMove",value:function(){this.toggleThumbContainer(!1,!0)}},{key:"startScrubbing",value:function(e){(Zc(e.button)||!1===e.button||0===e.button)&&(this.mouseDown=!0,this.player.media.duration&&(this.toggleScrubbingContainer(!0),this.toggleThumbContainer(!1,!0),this.showImageAtCurrentTime()))}},{key:"endScrubbing",value:function(){var e=this;this.mouseDown=!1,Math.ceil(this.lastTime)===Math.ceil(this.player.media.currentTime)?this.toggleScrubbingContainer(!1):Wu.call(this.player,this.player.media,"timeupdate",(function(){e.mouseDown||e.toggleScrubbingContainer(!1)}))}},{key:"listeners",value:function(){var e=this;this.player.on("play",(function(){e.toggleThumbContainer(!1,!0)})),this.player.on("seeked",(function(){e.toggleThumbContainer(!1)})),this.player.on("timeupdate",(function(){e.lastTime=e.player.media.currentTime}))}},{key:"render",value:function(){this.elements.thumb.container=Au("div",{class:this.player.config.classNames.previewThumbnails.thumbContainer}),this.elements.thumb.imageContainer=Au("div",{class:this.player.config.classNames.previewThumbnails.imageContainer}),this.elements.thumb.container.appendChild(this.elements.thumb.imageContainer);var e=Au("div",{class:this.player.config.classNames.previewThumbnails.timeContainer});this.elements.thumb.time=Au("span",{},"00:00"),e.appendChild(this.elements.thumb.time),this.elements.thumb.container.appendChild(e),su(this.player.elements.progress)&&this.player.elements.progress.appendChild(this.elements.thumb.container),this.elements.scrubbing.container=Au("div",{class:this.player.config.classNames.previewThumbnails.scrubbingContainer}),this.player.elements.wrapper.appendChild(this.elements.scrubbing.container)}},{key:"destroy",value:function(){this.elements.thumb.container&&this.elements.thumb.container.remove(),this.elements.scrubbing.container&&this.elements.scrubbing.container.remove()}},{key:"showImageAtCurrentTime",value:function(){var e=this;this.mouseDown?this.setScrubbingContainerSize():this.setThumbContainerSizeAndPos();var t=this.thumbnails[0].frames.findIndex((function(t){return e.seekTime>=t.startTime&&e.seekTime<=t.endTime})),n=t>=0,i=0;this.mouseDown||this.toggleThumbContainer(n),n&&(this.thumbnails.forEach((function(n,r){e.loadedImages.includes(n.frames[t].text)&&(i=r)})),t!==this.showingThumb&&(this.showingThumb=t,this.loadImage(i)))}},{key:"loadImage",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=this.showingThumb,i=this.thumbnails[t],r=i.urlPrefix,a=i.frames[n],o=i.frames[n].text,s=r+o;if(this.currentImageElement&&this.currentImageElement.dataset.filename===o)this.showImage(this.currentImageElement,a,t,n,o,!1),this.currentImageElement.dataset.index=n,this.removeOldImages(this.currentImageElement);else{this.loadingImage&&this.usingSprites&&(this.loadingImage.onload=null);var l=new Image;l.src=s,l.dataset.index=n,l.dataset.filename=o,this.showingThumbFilename=o,this.player.debug.log("Loading image: ".concat(s)),l.onload=function(){return e.showImage(l,a,t,n,o,!0)},this.loadingImage=l,this.removeOldImages(l)}}},{key:"showImage",value:function(e,t,n,i,r){var a=!(arguments.length>5&&void 0!==arguments[5])||arguments[5];this.player.debug.log("Showing thumb: ".concat(r,". num: ").concat(i,". qual: ").concat(n,". newimg: ").concat(a)),this.setImageSizeAndOffset(e,t),a&&(this.currentImageContainer.appendChild(e),this.currentImageElement=e,this.loadedImages.includes(r)||this.loadedImages.push(r)),this.preloadNearby(i,!0).then(this.preloadNearby(i,!1)).then(this.getHigherQuality(n,e,t,r))}},{key:"removeOldImages",value:function(e){var t=this;Array.from(this.currentImageContainer.children).forEach((function(n){if("img"===n.tagName.toLowerCase()){var i=t.usingSprites?500:1e3;if(n.dataset.index!==e.dataset.index&&!n.dataset.deleting){n.dataset.deleting=!0;var r=t.currentImageContainer;setTimeout((function(){r.removeChild(n),t.player.debug.log("Removing thumb: ".concat(n.dataset.filename))}),i)}}}))}},{key:"preloadNearby",value:function(e){var t=this,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return new Promise((function(i){setTimeout((function(){var r=t.thumbnails[0].frames[e].text;if(t.showingThumbFilename===r){var a;a=n?t.thumbnails[0].frames.slice(e):t.thumbnails[0].frames.slice(0,e).reverse();var o=!1;a.forEach((function(e){var n=e.text;if(n!==r&&!t.loadedImages.includes(n)){o=!0,t.player.debug.log("Preloading thumb filename: ".concat(n));var a=t.thumbnails[0].urlPrefix+n,s=new Image;s.src=a,s.onload=function(){t.player.debug.log("Preloaded thumb filename: ".concat(n)),t.loadedImages.includes(n)||t.loadedImages.push(n),i()}}})),o||i()}}),300)}))}},{key:"getHigherQuality",value:function(e,t,n,i){var r=this;if(e<this.thumbnails.length-1){var a=t.naturalHeight;this.usingSprites&&(a=n.h),a<this.thumbContainerHeight&&setTimeout((function(){r.showingThumbFilename===i&&(r.player.debug.log("Showing higher quality thumb for: ".concat(i)),r.loadImage(e+1))}),300)}}},{key:"toggleThumbContainer",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.player.config.classNames.previewThumbnails.thumbContainerShown;this.elements.thumb.container.classList.toggle(n,e),!e&&t&&(this.showingThumb=null,this.showingThumbFilename=null)}},{key:"toggleScrubbingContainer",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.player.config.classNames.previewThumbnails.scrubbingContainerShown;this.elements.scrubbing.container.classList.toggle(t,e),e||(this.showingThumb=null,this.showingThumbFilename=null)}},{key:"determineContainerAutoSizing",value:function(){(this.elements.thumb.imageContainer.clientHeight>20||this.elements.thumb.imageContainer.clientWidth>20)&&(this.sizeSpecifiedInCSS=!0)}},{key:"setThumbContainerSizeAndPos",value:function(){if(this.sizeSpecifiedInCSS){if(this.elements.thumb.imageContainer.clientHeight>20&&this.elements.thumb.imageContainer.clientWidth<20){var e=Math.floor(this.elements.thumb.imageContainer.clientHeight*this.thumbAspectRatio);this.elements.thumb.imageContainer.style.width="".concat(e,"px")}else if(this.elements.thumb.imageContainer.clientHeight<20&&this.elements.thumb.imageContainer.clientWidth>20){var t=Math.floor(this.elements.thumb.imageContainer.clientWidth/this.thumbAspectRatio);this.elements.thumb.imageContainer.style.height="".concat(t,"px")}}else{var n=Math.floor(this.thumbContainerHeight*this.thumbAspectRatio);this.elements.thumb.imageContainer.style.height="".concat(this.thumbContainerHeight,"px"),this.elements.thumb.imageContainer.style.width="".concat(n,"px")}this.setThumbContainerPos()}},{key:"setThumbContainerPos",value:function(){var e=this.player.elements.progress.getBoundingClientRect(),t=this.player.elements.container.getBoundingClientRect(),n=this.elements.thumb.container,i=t.left-e.left+10,r=t.right-e.left-n.clientWidth-10,a=this.mousePosX-e.left-n.clientWidth/2;a<i&&(a=i),a>r&&(a=r),n.style.left="".concat(a,"px")}},{key:"setScrubbingContainerSize",value:function(){var e=yf(this.thumbAspectRatio,{width:this.player.media.clientWidth,height:this.player.media.clientHeight}),t=e.width,n=e.height;this.elements.scrubbing.container.style.width="".concat(t,"px"),this.elements.scrubbing.container.style.height="".concat(n,"px")}},{key:"setImageSizeAndOffset",value:function(e,t){if(this.usingSprites){var n=this.thumbContainerHeight/t.h;e.style.height="".concat(e.naturalHeight*n,"px"),e.style.width="".concat(e.naturalWidth*n,"px"),e.style.left="-".concat(t.x*n,"px"),e.style.top="-".concat(t.y*n,"px")}}},{key:"enabled",get:function(){return this.player.isHTML5&&this.player.isVideo&&this.player.config.previewThumbnails.enabled}},{key:"currentImageContainer",get:function(){return this.mouseDown?this.elements.scrubbing.container:this.elements.thumb.imageContainer}},{key:"usingSprites",get:function(){return Object.keys(this.thumbnails[0].frames[0]).includes("w")}},{key:"thumbAspectRatio",get:function(){return this.usingSprites?this.thumbnails[0].frames[0].w/this.thumbnails[0].frames[0].h:this.thumbnails[0].width/this.thumbnails[0].height}},{key:"thumbContainerHeight",get:function(){return this.mouseDown?yf(this.thumbAspectRatio,{width:this.player.media.clientWidth,height:this.player.media.clientHeight}).height:this.sizeSpecifiedInCSS?this.elements.thumb.imageContainer.clientHeight:Math.floor(this.player.media.clientWidth/this.thumbAspectRatio/4)}},{key:"currentImageElement",get:function(){return this.mouseDown?this.currentScrubbingImageElement:this.currentThumbnailImageElement},set:function(e){this.mouseDown?this.currentScrubbingImageElement=e:this.currentThumbnailImageElement=e}}]),e}(),wf={insertElements:function(e,t){var n=this;nu(t)?Pu(e,this.media,{src:t}):au(t)&&t.forEach((function(t){Pu(e,n.media,t)}))},change:function(e){var t=this;ku(e,"sources.length")?(eh.cancelRequests.call(this),this.destroy.call(this,(function(){t.options.quality=[],xu(t.media),t.media=null,su(t.elements.container)&&t.elements.container.removeAttribute("class");var n=e.sources,i=e.type,r=Ao(n,1)[0],a=r.provider,o=void 0===a?Fh.html5:a,s=r.src,l="html5"===o?i:"div",c="html5"===o?{}:{src:s};Object.assign(t,{provider:o,type:i,supported:qu.check(i,o,t.config.playsinline),media:Au(l,c)}),t.elements.container.appendChild(t.media),iu(e.autoplay)&&(t.config.autoplay=e.autoplay),t.isHTML5&&(t.config.crossorigin&&t.media.setAttribute("crossorigin",""),t.config.autoplay&&t.media.setAttribute("autoplay",""),du(e.poster)||(t.poster=e.poster),t.config.loop.active&&t.media.setAttribute("loop",""),t.config.muted&&t.media.setAttribute("muted",""),t.config.playsinline&&t.media.setAttribute("playsinline","")),$h.addStyleHook.call(t),t.isHTML5&&wf.insertElements.call(t,"source",n),t.config.title=e.title,sf.setup.call(t),t.isHTML5&&Object.keys(e).includes("tracks")&&wf.insertElements.call(t,"track",e.tracks),(t.isHTML5||t.isEmbed&&!t.supported.ui)&&$h.build.call(t),t.isHTML5&&t.media.load(),du(e.previewThumbnails)||(Object.assign(t.config.previewThumbnails,e.previewThumbnails),t.previewThumbnails&&t.previewThumbnails.loaded&&(t.previewThumbnails.destroy(),t.previewThumbnails=null),t.config.previewThumbnails.enabled&&(t.previewThumbnails=new bf(t))),t.fullscreen.update()}),!0)):this.debug.warn("Invalid source format")}};var kf,Tf=function(){function e(t,n){var i=this;if(yo(this,e),this.timers={},this.ready=!1,this.loading=!1,this.failed=!1,this.touch=qu.touch,this.media=t,nu(this.media)&&(this.media=document.querySelectorAll(this.media)),(window.jQuery&&this.media instanceof jQuery||ou(this.media)||au(this.media))&&(this.media=this.media[0]),this.config=Tu({},_h,e.defaults,n||{},function(){try{return JSON.parse(i.media.getAttribute("data-plyr-config"))}catch(e){return{}}}()),this.elements={container:null,fullscreen:null,captions:null,buttons:{},display:{},progress:{},inputs:{},settings:{popup:null,menu:null,panels:{},buttons:{}}},this.captions={active:null,currentTrack:-1,meta:new WeakMap},this.fullscreen={active:!1},this.options={speed:[],quality:[]},this.debug=new Vh(this.config.debug),this.debug.log("Config",this.config),this.debug.log("Support",qu),!Zc(this.media)&&su(this.media))if(this.media.plyr)this.debug.warn("Target already setup");else if(this.config.enabled)if(qu.check().api){var r=this.media.cloneNode(!0);r.autoplay=!1,this.elements.original=r;var a=this.media.tagName.toLowerCase(),o=null,s=null;switch(a){case"div":if(o=this.media.querySelector("iframe"),su(o)){if(s=Nh(o.getAttribute("src")),this.provider=function(e){return/^(https?:\/\/)?(www\.)?(youtube\.com|youtube-nocookie\.com|youtu\.?be)\/.+$/.test(e)?Fh.youtube:/^https?:\/\/player.vimeo.com\/video\/\d{0,9}(?=\b|\/)/.test(e)?Fh.vimeo:null}(s.toString()),this.elements.container=this.media,this.media=o,this.elements.container.className="",s.search.length){var l=["1","true"];l.includes(s.searchParams.get("autoplay"))&&(this.config.autoplay=!0),l.includes(s.searchParams.get("loop"))&&(this.config.loop.active=!0),this.isYouTube?(this.config.playsinline=l.includes(s.searchParams.get("playsinline")),this.config.youtube.hl=s.searchParams.get("hl")):this.config.playsinline=!0}}else this.provider=this.media.getAttribute(this.config.attributes.embed.provider),this.media.removeAttribute(this.config.attributes.embed.provider);if(du(this.provider)||!Object.keys(Fh).includes(this.provider))return void this.debug.error("Setup failed: Invalid provider");this.type=Hh;break;case"video":case"audio":this.type=a,this.provider=Fh.html5,this.media.hasAttribute("crossorigin")&&(this.config.crossorigin=!0),this.media.hasAttribute("autoplay")&&(this.config.autoplay=!0),(this.media.hasAttribute("playsinline")||this.media.hasAttribute("webkit-playsinline"))&&(this.config.playsinline=!0),this.media.hasAttribute("muted")&&(this.config.muted=!0),this.media.hasAttribute("loop")&&(this.config.loop.active=!0);break;default:return void this.debug.error("Setup failed: unsupported type")}this.supported=qu.check(this.type,this.provider,this.config.playsinline),this.supported.api?(this.eventListeners=[],this.listeners=new Yh(this),this.storage=new Sh(this),this.media.plyr=this,su(this.elements.container)||(this.elements.container=Au("div",{tabindex:0}),Su(this.media,this.elements.container)),$h.migrateStyles.call(this),$h.addStyleHook.call(this),sf.setup.call(this),this.config.debug&&Vu.call(this,this.elements.container,this.config.events.join(" "),(function(e){i.debug.log("event: ".concat(e.type))})),this.fullscreen=new zh(this),(this.isHTML5||this.isEmbed&&!this.supported.ui)&&$h.build.call(this),this.listeners.container(),this.listeners.global(),this.config.ads.enabled&&(this.ads=new lf(this)),this.isHTML5&&this.config.autoplay&&setTimeout((function(){return Gu(i.play())}),10),this.lastSeekTime=0,this.config.previewThumbnails.enabled&&(this.previewThumbnails=new bf(this))):this.debug.error("Setup failed: no support")}else this.debug.error("Setup failed: no support");else this.debug.error("Setup failed: disabled by config");else this.debug.error("Setup failed: no suitable element passed")}return wo(e,[{key:"play",value:function(){var e=this;return ru(this.media.play)?(this.ads&&this.ads.enabled&&this.ads.managerPromise.then((function(){return e.ads.play()})).catch((function(){return Gu(e.media.play())})),this.media.play()):null}},{key:"pause",value:function(){return this.playing&&ru(this.media.pause)?this.media.pause():null}},{key:"togglePlay",value:function(e){return(iu(e)?e:!this.playing)?this.play():this.pause()}},{key:"stop",value:function(){this.isHTML5?(this.pause(),this.restart()):ru(this.media.stop)&&this.media.stop()}},{key:"restart",value:function(){this.currentTime=0}},{key:"rewind",value:function(e){this.currentTime-=tu(e)?e:this.config.seekTime}},{key:"forward",value:function(e){this.currentTime+=tu(e)?e:this.config.seekTime}},{key:"increaseVolume",value:function(e){var t=this.media.muted?0:this.volume;this.volume=t+(tu(e)?e:0)}},{key:"decreaseVolume",value:function(e){this.increaseVolume(-e)}},{key:"toggleCaptions",value:function(e){Mh.toggle.call(this,e,!1)}},{key:"airplay",value:function(){qu.airplay&&this.media.webkitShowPlaybackTargetPicker()}},{key:"toggleControls",value:function(e){if(this.supported.ui&&!this.isAudio){var t=Nu(this.elements.container,this.config.classNames.hideControls),n=void 0===e?void 0:!e,i=ju(this.elements.container,this.config.classNames.hideControls,n);if(i&&au(this.config.controls)&&this.config.controls.includes("settings")&&!du(this.config.settings)&&jh.toggleMenu.call(this,!1),i!==t){var r=i?"controlshidden":"controlsshown";Ku.call(this,this.media,r)}return!i}return!1}},{key:"on",value:function(e,t){Vu.call(this,this.elements.container,e,t)}},{key:"once",value:function(e,t){Wu.call(this,this.elements.container,e,t)}},{key:"off",value:function(e,t){zu(this.elements.container,e,t)}},{key:"destroy",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this.ready){var i=function(){document.body.style.overflow="",t.embed=null,n?(Object.keys(t.elements).length&&(xu(t.elements.buttons.play),xu(t.elements.captions),xu(t.elements.controls),xu(t.elements.wrapper),t.elements.buttons.play=null,t.elements.captions=null,t.elements.controls=null,t.elements.wrapper=null),ru(e)&&e()):($u.call(t),Ou(t.elements.original,t.elements.container),Ku.call(t,t.elements.original,"destroyed",!0),ru(e)&&e.call(t.elements.original),t.ready=!1,setTimeout((function(){t.elements=null,t.media=null}),200))};this.stop(),clearTimeout(this.timers.loading),clearTimeout(this.timers.controls),clearTimeout(this.timers.resized),this.isHTML5?($h.toggleNativeControls.call(this,!0),i()):this.isYouTube?(clearInterval(this.timers.buffering),clearInterval(this.timers.playing),null!==this.embed&&ru(this.embed.destroy)&&this.embed.destroy(),i()):this.isVimeo&&(null!==this.embed&&this.embed.unload().then(i),setTimeout(i,200))}}},{key:"supports",value:function(e){return qu.mime.call(this,e)}},{key:"isHTML5",get:function(){return this.provider===Fh.html5}},{key:"isEmbed",get:function(){return this.isYouTube||this.isVimeo}},{key:"isYouTube",get:function(){return this.provider===Fh.youtube}},{key:"isVimeo",get:function(){return this.provider===Fh.vimeo}},{key:"isVideo",get:function(){return this.type===Hh}},{key:"isAudio",get:function(){return this.type===qh}},{key:"playing",get:function(){return Boolean(this.ready&&!this.paused&&!this.ended)}},{key:"paused",get:function(){return Boolean(this.media.paused)}},{key:"stopped",get:function(){return Boolean(this.paused&&0===this.currentTime)}},{key:"ended",get:function(){return Boolean(this.media.ended)}},{key:"currentTime",set:function(e){if(this.duration){var t=tu(e)&&e>0;this.media.currentTime=t?Math.min(e,this.duration):0,this.debug.log("Seeking to ".concat(this.currentTime," seconds"))}},get:function(){return Number(this.media.currentTime)}},{key:"buffered",get:function(){var e=this.media.buffered;return tu(e)?e:e&&e.length&&this.duration>0?e.end(0)/this.duration:0}},{key:"seeking",get:function(){return Boolean(this.media.seeking)}},{key:"duration",get:function(){var e=parseFloat(this.config.duration),t=(this.media||{}).duration,n=tu(t)&&t!==1/0?t:0;return e||n}},{key:"volume",set:function(e){var t=e;nu(t)&&(t=Number(t)),tu(t)||(t=this.storage.get("volume")),tu(t)||(t=this.config.volume),t>1&&(t=1),t<0&&(t=0),this.config.volume=t,this.media.volume=t,!du(e)&&this.muted&&t>0&&(this.muted=!1)},get:function(){return Number(this.media.volume)}},{key:"muted",set:function(e){var t=e;iu(t)||(t=this.storage.get("muted")),iu(t)||(t=this.config.muted),this.config.muted=t,this.media.muted=t},get:function(){return Boolean(this.media.muted)}},{key:"hasAudio",get:function(){return!this.isHTML5||(!!this.isAudio||(Boolean(this.media.mozHasAudio)||Boolean(this.media.webkitAudioDecodedByteCount)||Boolean(this.media.audioTracks&&this.media.audioTracks.length)))}},{key:"speed",set:function(e){var t=this,n=null;tu(e)&&(n=e),tu(n)||(n=this.storage.get("speed")),tu(n)||(n=this.config.speed.selected);var i=this.minimumSpeed,r=this.maximumSpeed;n=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:255;return Math.min(Math.max(e,t),n)}(n,i,r),this.config.speed.selected=n,setTimeout((function(){t.media.playbackRate=n}),0)},get:function(){return Number(this.media.playbackRate)}},{key:"minimumSpeed",get:function(){return this.isYouTube?Math.min.apply(Math,Po(this.options.speed)):this.isVimeo?.5:.0625}},{key:"maximumSpeed",get:function(){return this.isYouTube?Math.max.apply(Math,Po(this.options.speed)):this.isVimeo?2:16}},{key:"quality",set:function(e){var t=this.config.quality,n=this.options.quality;if(n.length){var i=[!du(e)&&Number(e),this.storage.get("quality"),t.selected,t.default].find(tu),r=!0;if(!n.includes(i)){var a=function(e,t){return au(e)&&e.length?e.reduce((function(e,n){return Math.abs(n-t)<Math.abs(e-t)?n:e})):null}(n,i);this.debug.warn("Unsupported quality option: ".concat(i,", using ").concat(a," instead")),i=a,r=!1}t.selected=i,this.media.quality=i,r&&this.storage.set({quality:i})}},get:function(){return this.media.quality}},{key:"loop",set:function(e){var t=iu(e)?e:this.config.loop.active;this.config.loop.active=t,this.media.loop=t},get:function(){return Boolean(this.media.loop)}},{key:"source",set:function(e){wf.change.call(this,e)},get:function(){return this.media.currentSrc}},{key:"download",get:function(){var e=this.config.urls.download;return fu(e)?e:this.source},set:function(e){fu(e)&&(this.config.urls.download=e,jh.setDownloadUrl.call(this))}},{key:"poster",set:function(e){this.isVideo?$h.setPoster.call(this,e,!1).catch((function(){})):this.debug.warn("Poster can only be set for video")},get:function(){return this.isVideo?this.media.getAttribute("poster")||this.media.getAttribute("data-poster"):null}},{key:"ratio",get:function(){if(!this.isVideo)return null;var e=Qu(Ju.call(this));return au(e)?e.join(":"):e},set:function(e){this.isVideo?nu(e)&&Xu(e)?(this.config.ratio=e,Zu.call(this)):this.debug.error("Invalid aspect ratio specified (".concat(e,")")):this.debug.warn("Aspect ratio can only be set for video")}},{key:"autoplay",set:function(e){var t=iu(e)?e:this.config.autoplay;this.config.autoplay=t},get:function(){return Boolean(this.config.autoplay)}},{key:"currentTrack",set:function(e){Mh.set.call(this,e,!1)},get:function(){var e=this.captions,t=e.toggled,n=e.currentTrack;return t?n:-1}},{key:"language",set:function(e){Mh.setLanguage.call(this,e,!1)},get:function(){return(Mh.getCurrentTrack.call(this)||{}).language}},{key:"pip",set:function(e){if(qu.pip){var t=iu(e)?e:!this.pip;ru(this.media.webkitSetPresentationMode)&&this.media.webkitSetPresentationMode(t?Uh:Dh),ru(this.media.requestPictureInPicture)&&(!this.pip&&t?this.media.requestPictureInPicture():this.pip&&!t&&document.exitPictureInPicture())}},get:function(){return qu.pip?du(this.media.webkitPresentationMode)?this.media===document.pictureInPictureElement:this.media.webkitPresentationMode===Uh:null}}],[{key:"supported",value:function(e,t,n){return qu.check(e,t,n)}},{key:"loadSprite",value:function(e,t){return Ah(e,t)}},{key:"setup",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=null;return nu(t)?i=Array.from(document.querySelectorAll(t)):ou(t)?i=Array.from(t):au(t)&&(i=t.filter(su)),du(i)?null:i.map((function(t){return new e(t,n)}))}}]),e}();return Tf.defaults=(kf=_h,JSON.parse(JSON.stringify(kf))),Tf}));
1
+ "object"==typeof navigator&&function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define("Plyr",t):(e="undefined"!=typeof globalThis?globalThis:e||self).Plyr=t()}(this,(function(){"use strict";!function(){if("undefined"!=typeof window)try{var e=new window.CustomEvent("test",{cancelable:!0});if(e.preventDefault(),!0!==e.defaultPrevented)throw new Error("Could not prevent default")}catch(e){var t=function(e,t){var i,n;return(t=t||{}).bubbles=!!t.bubbles,t.cancelable=!!t.cancelable,(i=document.createEvent("CustomEvent")).initCustomEvent(e,t.bubbles,t.cancelable,t.detail),n=i.preventDefault,i.preventDefault=function(){n.call(this);try{Object.defineProperty(this,"defaultPrevented",{get:function(){return!0}})}catch(e){this.defaultPrevented=!0}},i};t.prototype=window.Event.prototype,window.CustomEvent=t}}();var e=Math.ceil,t=Math.floor,i=function(i){return isNaN(i=+i)?0:(i>0?t:e)(i)},n=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e},s=function(e){return function(t,s){var r,a,o=String(n(t)),l=i(s),c=o.length;return l<0||l>=c?e?"":void 0:(r=o.charCodeAt(l))<55296||r>56319||l+1===c||(a=o.charCodeAt(l+1))<56320||a>57343?e?o.charAt(l):r:e?o.slice(l,l+2):a-56320+(r-55296<<10)+65536}},r={codeAt:s(!1),charAt:s(!0)},a="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function o(e,t){return e(t={exports:{}},t.exports),t.exports}var l=function(e){return e&&e.Math==Math&&e},c=l("object"==typeof globalThis&&globalThis)||l("object"==typeof window&&window)||l("object"==typeof self&&self)||l("object"==typeof a&&a)||function(){return this}()||Function("return this")(),u=function(e){try{return!!e()}catch(e){return!0}},h=!u((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),d=function(e){return"object"==typeof e?null!==e:"function"==typeof e},p=c.document,m=d(p)&&d(p.createElement),f=function(e){return m?p.createElement(e):{}},g=!h&&!u((function(){return 7!=Object.defineProperty(f("div"),"a",{get:function(){return 7}}).a})),y=function(e){if(!d(e))throw TypeError(String(e)+" is not an object");return e},b=function(e,t){if(!d(e))return e;var i,n;if(t&&"function"==typeof(i=e.toString)&&!d(n=i.call(e)))return n;if("function"==typeof(i=e.valueOf)&&!d(n=i.call(e)))return n;if(!t&&"function"==typeof(i=e.toString)&&!d(n=i.call(e)))return n;throw TypeError("Can't convert object to primitive value")},v=Object.defineProperty,w={f:h?v:function(e,t,i){if(y(e),t=b(t,!0),y(i),g)try{return v(e,t,i)}catch(e){}if("get"in i||"set"in i)throw TypeError("Accessors not supported");return"value"in i&&(e[t]=i.value),e}},k=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},T=h?function(e,t,i){return w.f(e,t,k(1,i))}:function(e,t,i){return e[t]=i,e},S=function(e,t){try{T(c,e,t)}catch(i){c[e]=t}return t},C="__core-js_shared__",A=c[C]||S(C,{}),E=Function.toString;"function"!=typeof A.inspectSource&&(A.inspectSource=function(e){return E.call(e)});var P,L,x,I=A.inspectSource,O=c.WeakMap,_="function"==typeof O&&/native code/.test(I(O)),M={}.hasOwnProperty,N=function(e,t){return M.call(e,t)},j=o((function(e){(e.exports=function(e,t){return A[e]||(A[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.9.1",mode:"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"})})),R=0,$=Math.random(),q=function(e){return"Symbol("+String(void 0===e?"":e)+")_"+(++R+$).toString(36)},U=j("keys"),F=function(e){return U[e]||(U[e]=q(e))},D={},H=c.WeakMap;if(_){var B=A.state||(A.state=new H),V=B.get,z=B.has,W=B.set;P=function(e,t){return t.facade=e,W.call(B,e,t),t},L=function(e){return V.call(B,e)||{}},x=function(e){return z.call(B,e)}}else{var K=F("state");D[K]=!0,P=function(e,t){return t.facade=e,T(e,K,t),t},L=function(e){return N(e,K)?e[K]:{}},x=function(e){return N(e,K)}}var Y,G,X={set:P,get:L,has:x,enforce:function(e){return x(e)?L(e):P(e,{})},getterFor:function(e){return function(t){var i;if(!d(t)||(i=L(t)).type!==e)throw TypeError("Incompatible receiver, "+e+" required");return i}}},Q={}.propertyIsEnumerable,J=Object.getOwnPropertyDescriptor,Z={f:J&&!Q.call({1:2},1)?function(e){var t=J(this,e);return!!t&&t.enumerable}:Q},ee={}.toString,te=function(e){return ee.call(e).slice(8,-1)},ie="".split,ne=u((function(){return!Object("z").propertyIsEnumerable(0)}))?function(e){return"String"==te(e)?ie.call(e,""):Object(e)}:Object,se=function(e){return ne(n(e))},re=Object.getOwnPropertyDescriptor,ae={f:h?re:function(e,t){if(e=se(e),t=b(t,!0),g)try{return re(e,t)}catch(e){}if(N(e,t))return k(!Z.f.call(e,t),e[t])}},oe=o((function(e){var t=X.get,i=X.enforce,n=String(String).split("String");(e.exports=function(e,t,s,r){var a,o=!!r&&!!r.unsafe,l=!!r&&!!r.enumerable,u=!!r&&!!r.noTargetGet;"function"==typeof s&&("string"!=typeof t||N(s,"name")||T(s,"name",t),(a=i(s)).source||(a.source=n.join("string"==typeof t?t:""))),e!==c?(o?!u&&e[t]&&(l=!0):delete e[t],l?e[t]=s:T(e,t,s)):l?e[t]=s:S(t,s)})(Function.prototype,"toString",(function(){return"function"==typeof this&&t(this).source||I(this)}))})),le=c,ce=function(e){return"function"==typeof e?e:void 0},ue=function(e,t){return arguments.length<2?ce(le[e])||ce(c[e]):le[e]&&le[e][t]||c[e]&&c[e][t]},he=Math.min,de=function(e){return e>0?he(i(e),9007199254740991):0},pe=Math.max,me=Math.min,fe=function(e){return function(t,n,s){var r,a=se(t),o=de(a.length),l=function(e,t){var n=i(e);return n<0?pe(n+t,0):me(n,t)}(s,o);if(e&&n!=n){for(;o>l;)if((r=a[l++])!=r)return!0}else for(;o>l;l++)if((e||l in a)&&a[l]===n)return e||l||0;return!e&&-1}},ge={includes:fe(!0),indexOf:fe(!1)}.indexOf,ye=function(e,t){var i,n=se(e),s=0,r=[];for(i in n)!N(D,i)&&N(n,i)&&r.push(i);for(;t.length>s;)N(n,i=t[s++])&&(~ge(r,i)||r.push(i));return r},be=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],ve=be.concat("length","prototype"),we={f:Object.getOwnPropertyNames||function(e){return ye(e,ve)}},ke={f:Object.getOwnPropertySymbols},Te=ue("Reflect","ownKeys")||function(e){var t=we.f(y(e)),i=ke.f;return i?t.concat(i(e)):t},Se=function(e,t){for(var i=Te(t),n=w.f,s=ae.f,r=0;r<i.length;r++){var a=i[r];N(e,a)||n(e,a,s(t,a))}},Ce=/#|\.prototype\./,Ae=function(e,t){var i=Pe[Ee(e)];return i==xe||i!=Le&&("function"==typeof t?u(t):!!t)},Ee=Ae.normalize=function(e){return String(e).replace(Ce,".").toLowerCase()},Pe=Ae.data={},Le=Ae.NATIVE="N",xe=Ae.POLYFILL="P",Ie=Ae,Oe=ae.f,_e=function(e,t){var i,n,s,r,a,o=e.target,l=e.global,u=e.stat;if(i=l?c:u?c[o]||S(o,{}):(c[o]||{}).prototype)for(n in t){if(r=t[n],s=e.noTargetGet?(a=Oe(i,n))&&a.value:i[n],!Ie(l?n:o+(u?".":"#")+n,e.forced)&&void 0!==s){if(typeof r==typeof s)continue;Se(r,s)}(e.sham||s&&s.sham)&&T(r,"sham",!0),oe(i,n,r,e)}},Me=function(e){return Object(n(e))},Ne=!u((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),je=F("IE_PROTO"),Re=Object.prototype,$e=Ne?Object.getPrototypeOf:function(e){return e=Me(e),N(e,je)?e[je]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?Re:null},qe="process"==te(c.process),Ue=ue("navigator","userAgent")||"",Fe=c.process,De=Fe&&Fe.versions,He=De&&De.v8;He?G=(Y=He.split("."))[0]+Y[1]:Ue&&(!(Y=Ue.match(/Edge\/(\d+)/))||Y[1]>=74)&&(Y=Ue.match(/Chrome\/(\d+)/))&&(G=Y[1]);var Be,Ve,ze,We=G&&+G,Ke=!!Object.getOwnPropertySymbols&&!u((function(){return!Symbol.sham&&(qe?38===We:We>37&&We<41)})),Ye=Ke&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,Ge=j("wks"),Xe=c.Symbol,Qe=Ye?Xe:Xe&&Xe.withoutSetter||q,Je=function(e){return N(Ge,e)&&(Ke||"string"==typeof Ge[e])||(Ke&&N(Xe,e)?Ge[e]=Xe[e]:Ge[e]=Qe("Symbol."+e)),Ge[e]},Ze=Je("iterator"),et=!1;[].keys&&("next"in(ze=[].keys())?(Ve=$e($e(ze)))!==Object.prototype&&(Be=Ve):et=!0),(null==Be||u((function(){var e={};return Be[Ze].call(e)!==e})))&&(Be={}),N(Be,Ze)||T(Be,Ze,(function(){return this}));var tt,it={IteratorPrototype:Be,BUGGY_SAFARI_ITERATORS:et},nt=Object.keys||function(e){return ye(e,be)},st=h?Object.defineProperties:function(e,t){y(e);for(var i,n=nt(t),s=n.length,r=0;s>r;)w.f(e,i=n[r++],t[i]);return e},rt=ue("document","documentElement"),at=F("IE_PROTO"),ot=function(){},lt=function(e){return"<script>"+e+"</"+"script>"},ct=function(){try{tt=document.domain&&new ActiveXObject("htmlfile")}catch(e){}var e,t;ct=tt?function(e){e.write(lt("")),e.close();var t=e.parentWindow.Object;return e=null,t}(tt):((t=f("iframe")).style.display="none",rt.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(lt("document.F=Object")),e.close(),e.F);for(var i=be.length;i--;)delete ct.prototype[be[i]];return ct()};D[at]=!0;var ut=Object.create||function(e,t){var i;return null!==e?(ot.prototype=y(e),i=new ot,ot.prototype=null,i[at]=e):i=ct(),void 0===t?i:st(i,t)},ht=w.f,dt=Je("toStringTag"),pt=function(e,t,i){e&&!N(e=i?e:e.prototype,dt)&&ht(e,dt,{configurable:!0,value:t})},mt={},ft=it.IteratorPrototype,gt=function(){return this},yt=function(e,t,i){var n=t+" Iterator";return e.prototype=ut(ft,{next:k(1,i)}),pt(e,n,!1),mt[n]=gt,e},bt=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,i={};try{(e=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(i,[]),t=i instanceof Array}catch(e){}return function(i,n){return y(i),function(e){if(!d(e)&&null!==e)throw TypeError("Can't set "+String(e)+" as a prototype")}(n),t?e.call(i,n):i.__proto__=n,i}}():void 0),vt=it.IteratorPrototype,wt=it.BUGGY_SAFARI_ITERATORS,kt=Je("iterator"),Tt="keys",St="values",Ct="entries",At=function(){return this},Et=function(e,t,i,n,s,r,a){yt(i,t,n);var o,l,c,u=function(e){if(e===s&&f)return f;if(!wt&&e in p)return p[e];switch(e){case Tt:case St:case Ct:return function(){return new i(this,e)}}return function(){return new i(this)}},h=t+" Iterator",d=!1,p=e.prototype,m=p[kt]||p["@@iterator"]||s&&p[s],f=!wt&&m||u(s),g="Array"==t&&p.entries||m;if(g&&(o=$e(g.call(new e)),vt!==Object.prototype&&o.next&&($e(o)!==vt&&(bt?bt(o,vt):"function"!=typeof o[kt]&&T(o,kt,At)),pt(o,h,!0))),s==St&&m&&m.name!==St&&(d=!0,f=function(){return m.call(this)}),p[kt]!==f&&T(p,kt,f),mt[t]=f,s)if(l={values:u(St),keys:r?f:u(Tt),entries:u(Ct)},a)for(c in l)(wt||d||!(c in p))&&oe(p,c,l[c]);else _e({target:t,proto:!0,forced:wt||d},l);return l},Pt=r.charAt,Lt="String Iterator",xt=X.set,It=X.getterFor(Lt);Et(String,"String",(function(e){xt(this,{type:Lt,string:String(e),index:0})}),(function(){var e,t=It(this),i=t.string,n=t.index;return n>=i.length?{value:void 0,done:!0}:(e=Pt(i,n),t.index+=e.length,{value:e,done:!1})}));var Ot=Je("iterator"),_t=!u((function(){var e=new URL("b?a=1&b=2&c=3","http://a"),t=e.searchParams,i="";return e.pathname="c%20d",t.forEach((function(e,n){t.delete("b"),i+=n+e})),!t.sort||"http://a/c%20d?a=1&c=3"!==e.href||"3"!==t.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!t[Ot]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("http://тест").host||"#%D0%B1"!==new URL("http://a#б").hash||"a1c3"!==i||"x"!==new URL("http://x",void 0).host})),Mt=function(e,t,i){if(!(e instanceof t))throw TypeError("Incorrect "+(i?i+" ":"")+"invocation");return e},Nt=Object.assign,jt=Object.defineProperty,Rt=!Nt||u((function(){if(h&&1!==Nt({b:1},Nt(jt({},"a",{enumerable:!0,get:function(){jt(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},i=Symbol(),n="abcdefghijklmnopqrst";return e[i]=7,n.split("").forEach((function(e){t[e]=e})),7!=Nt({},e)[i]||nt(Nt({},t)).join("")!=n}))?function(e,t){for(var i=Me(e),n=arguments.length,s=1,r=ke.f,a=Z.f;n>s;)for(var o,l=ne(arguments[s++]),c=r?nt(l).concat(r(l)):nt(l),u=c.length,d=0;u>d;)o=c[d++],h&&!a.call(l,o)||(i[o]=l[o]);return i}:Nt,$t=function(e,t,i){if(function(e){if("function"!=typeof e)throw TypeError(String(e)+" is not a function")}(e),void 0===t)return e;switch(i){case 0:return function(){return e.call(t)};case 1:return function(i){return e.call(t,i)};case 2:return function(i,n){return e.call(t,i,n)};case 3:return function(i,n,s){return e.call(t,i,n,s)}}return function(){return e.apply(t,arguments)}},qt=function(e,t,i,n){try{return n?t(y(i)[0],i[1]):t(i)}catch(t){throw function(e){var t=e.return;if(void 0!==t)y(t.call(e)).value}(e),t}},Ut=Je("iterator"),Ft=Array.prototype,Dt=function(e){return void 0!==e&&(mt.Array===e||Ft[Ut]===e)},Ht=function(e,t,i){var n=b(t);n in e?w.f(e,n,k(0,i)):e[n]=i},Bt={};Bt[Je("toStringTag")]="z";var Vt="[object z]"===String(Bt),zt=Je("toStringTag"),Wt="Arguments"==te(function(){return arguments}()),Kt=Vt?te:function(e){var t,i,n;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(i=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),zt))?i:Wt?te(t):"Object"==(n=te(t))&&"function"==typeof t.callee?"Arguments":n},Yt=Je("iterator"),Gt=function(e){if(null!=e)return e[Yt]||e["@@iterator"]||mt[Kt(e)]},Xt=function(e){var t,i,n,s,r,a,o=Me(e),l="function"==typeof this?this:Array,c=arguments.length,u=c>1?arguments[1]:void 0,h=void 0!==u,d=Gt(o),p=0;if(h&&(u=$t(u,c>2?arguments[2]:void 0,2)),null==d||l==Array&&Dt(d))for(i=new l(t=de(o.length));t>p;p++)a=h?u(o[p],p):o[p],Ht(i,p,a);else for(r=(s=d.call(o)).next,i=new l;!(n=r.call(s)).done;p++)a=h?qt(s,u,[n.value,p],!0):n.value,Ht(i,p,a);return i.length=p,i},Qt=2147483647,Jt=/[^\0-\u007E]/,Zt=/[.\u3002\uFF0E\uFF61]/g,ei="Overflow: input needs wider integers to process",ti=Math.floor,ii=String.fromCharCode,ni=function(e){return e+22+75*(e<26)},si=function(e,t,i){var n=0;for(e=i?ti(e/700):e>>1,e+=ti(e/t);e>455;n+=36)e=ti(e/35);return ti(n+36*e/(e+38))},ri=function(e){var t,i,n=[],s=(e=function(e){for(var t=[],i=0,n=e.length;i<n;){var s=e.charCodeAt(i++);if(s>=55296&&s<=56319&&i<n){var r=e.charCodeAt(i++);56320==(64512&r)?t.push(((1023&s)<<10)+(1023&r)+65536):(t.push(s),i--)}else t.push(s)}return t}(e)).length,r=128,a=0,o=72;for(t=0;t<e.length;t++)(i=e[t])<128&&n.push(ii(i));var l=n.length,c=l;for(l&&n.push("-");c<s;){var u=Qt;for(t=0;t<e.length;t++)(i=e[t])>=r&&i<u&&(u=i);var h=c+1;if(u-r>ti((Qt-a)/h))throw RangeError(ei);for(a+=(u-r)*h,r=u,t=0;t<e.length;t++){if((i=e[t])<r&&++a>Qt)throw RangeError(ei);if(i==r){for(var d=a,p=36;;p+=36){var m=p<=o?1:p>=o+26?26:p-o;if(d<m)break;var f=d-m,g=36-m;n.push(ii(ni(m+f%g))),d=ti(f/g)}n.push(ii(ni(d))),o=si(a,h,c==l),a=0,++c}}++a,++r}return n.join("")},ai=Je("unscopables"),oi=Array.prototype;null==oi[ai]&&w.f(oi,ai,{configurable:!0,value:ut(null)});var li=function(e){oi[ai][e]=!0},ci="Array Iterator",ui=X.set,hi=X.getterFor(ci);Et(Array,"Array",(function(e,t){ui(this,{type:ci,target:se(e),index:0,kind:t})}),(function(){var e=hi(this),t=e.target,i=e.kind,n=e.index++;return!t||n>=t.length?(e.target=void 0,{value:void 0,done:!0}):"keys"==i?{value:n,done:!1}:"values"==i?{value:t[n],done:!1}:{value:[n,t[n]],done:!1}}),"values"),mt.Arguments=mt.Array,li("keys"),li("values"),li("entries");var di=function(e){var t=Gt(e);if("function"!=typeof t)throw TypeError(String(e)+" is not iterable");return y(t.call(e))},pi=ue("fetch"),mi=ue("Headers"),fi=Je("iterator"),gi="URLSearchParams",yi="URLSearchParamsIterator",bi=X.set,vi=X.getterFor(gi),wi=X.getterFor(yi),ki=/\+/g,Ti=Array(4),Si=function(e){return Ti[e-1]||(Ti[e-1]=RegExp("((?:%[\\da-f]{2}){"+e+"})","gi"))},Ci=function(e){try{return decodeURIComponent(e)}catch(t){return e}},Ai=function(e){var t=e.replace(ki," "),i=4;try{return decodeURIComponent(t)}catch(e){for(;i;)t=t.replace(Si(i--),Ci);return t}},Ei=/[!'()~]|%20/g,Pi={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},Li=function(e){return Pi[e]},xi=function(e){return encodeURIComponent(e).replace(Ei,Li)},Ii=function(e,t){if(t)for(var i,n,s=t.split("&"),r=0;r<s.length;)(i=s[r++]).length&&(n=i.split("="),e.push({key:Ai(n.shift()),value:Ai(n.join("="))}))},Oi=function(e){this.entries.length=0,Ii(this.entries,e)},_i=function(e,t){if(e<t)throw TypeError("Not enough arguments")},Mi=yt((function(e,t){bi(this,{type:yi,iterator:di(vi(e).entries),kind:t})}),"Iterator",(function(){var e=wi(this),t=e.kind,i=e.iterator.next(),n=i.value;return i.done||(i.value="keys"===t?n.key:"values"===t?n.value:[n.key,n.value]),i})),Ni=function(){Mt(this,Ni,gi);var e,t,i,n,s,r,a,o,l,c=arguments.length>0?arguments[0]:void 0,u=this,h=[];if(bi(u,{type:gi,entries:h,updateURL:function(){},updateSearchParams:Oi}),void 0!==c)if(d(c))if("function"==typeof(e=Gt(c)))for(i=(t=e.call(c)).next;!(n=i.call(t)).done;){if((a=(r=(s=di(y(n.value))).next).call(s)).done||(o=r.call(s)).done||!r.call(s).done)throw TypeError("Expected sequence with length 2");h.push({key:a.value+"",value:o.value+""})}else for(l in c)N(c,l)&&h.push({key:l,value:c[l]+""});else Ii(h,"string"==typeof c?"?"===c.charAt(0)?c.slice(1):c:c+"")},ji=Ni.prototype;!function(e,t,i){for(var n in t)oe(e,n,t[n],i)}(ji,{append:function(e,t){_i(arguments.length,2);var i=vi(this);i.entries.push({key:e+"",value:t+""}),i.updateURL()},delete:function(e){_i(arguments.length,1);for(var t=vi(this),i=t.entries,n=e+"",s=0;s<i.length;)i[s].key===n?i.splice(s,1):s++;t.updateURL()},get:function(e){_i(arguments.length,1);for(var t=vi(this).entries,i=e+"",n=0;n<t.length;n++)if(t[n].key===i)return t[n].value;return null},getAll:function(e){_i(arguments.length,1);for(var t=vi(this).entries,i=e+"",n=[],s=0;s<t.length;s++)t[s].key===i&&n.push(t[s].value);return n},has:function(e){_i(arguments.length,1);for(var t=vi(this).entries,i=e+"",n=0;n<t.length;)if(t[n++].key===i)return!0;return!1},set:function(e,t){_i(arguments.length,1);for(var i,n=vi(this),s=n.entries,r=!1,a=e+"",o=t+"",l=0;l<s.length;l++)(i=s[l]).key===a&&(r?s.splice(l--,1):(r=!0,i.value=o));r||s.push({key:a,value:o}),n.updateURL()},sort:function(){var e,t,i,n=vi(this),s=n.entries,r=s.slice();for(s.length=0,i=0;i<r.length;i++){for(e=r[i],t=0;t<i;t++)if(s[t].key>e.key){s.splice(t,0,e);break}t===i&&s.push(e)}n.updateURL()},forEach:function(e){for(var t,i=vi(this).entries,n=$t(e,arguments.length>1?arguments[1]:void 0,3),s=0;s<i.length;)n((t=i[s++]).value,t.key,this)},keys:function(){return new Mi(this,"keys")},values:function(){return new Mi(this,"values")},entries:function(){return new Mi(this,"entries")}},{enumerable:!0}),oe(ji,fi,ji.entries),oe(ji,"toString",(function(){for(var e,t=vi(this).entries,i=[],n=0;n<t.length;)e=t[n++],i.push(xi(e.key)+"="+xi(e.value));return i.join("&")}),{enumerable:!0}),pt(Ni,gi),_e({global:!0,forced:!_t},{URLSearchParams:Ni}),_t||"function"!=typeof pi||"function"!=typeof mi||_e({global:!0,enumerable:!0,forced:!0},{fetch:function(e){var t,i,n,s=[e];return arguments.length>1&&(d(t=arguments[1])&&(i=t.body,Kt(i)===gi&&((n=t.headers?new mi(t.headers):new mi).has("content-type")||n.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"),t=ut(t,{body:k(0,String(i)),headers:k(0,n)}))),s.push(t)),pi.apply(this,s)}});var Ri,$i={URLSearchParams:Ni,getState:vi},qi=r.codeAt,Ui=c.URL,Fi=$i.URLSearchParams,Di=$i.getState,Hi=X.set,Bi=X.getterFor("URL"),Vi=Math.floor,zi=Math.pow,Wi="Invalid scheme",Ki="Invalid host",Yi="Invalid port",Gi=/[A-Za-z]/,Xi=/[\d+-.A-Za-z]/,Qi=/\d/,Ji=/^(0x|0X)/,Zi=/^[0-7]+$/,en=/^\d+$/,tn=/^[\dA-Fa-f]+$/,nn=/[\u0000\t\u000A\u000D #%/:?@[\\]]/,sn=/[\u0000\t\u000A\u000D #/:?@[\\]]/,rn=/^[\u0000-\u001F ]+|[\u0000-\u001F ]+$/g,an=/[\t\u000A\u000D]/g,on=function(e,t){var i,n,s;if("["==t.charAt(0)){if("]"!=t.charAt(t.length-1))return Ki;if(!(i=cn(t.slice(1,-1))))return Ki;e.host=i}else if(yn(e)){if(t=function(e){var t,i,n=[],s=e.toLowerCase().replace(Zt,".").split(".");for(t=0;t<s.length;t++)i=s[t],n.push(Jt.test(i)?"xn--"+ri(i):i);return n.join(".")}(t),nn.test(t))return Ki;if(null===(i=ln(t)))return Ki;e.host=i}else{if(sn.test(t))return Ki;for(i="",n=Xt(t),s=0;s<n.length;s++)i+=fn(n[s],hn);e.host=i}},ln=function(e){var t,i,n,s,r,a,o,l=e.split(".");if(l.length&&""==l[l.length-1]&&l.pop(),(t=l.length)>4)return e;for(i=[],n=0;n<t;n++){if(""==(s=l[n]))return e;if(r=10,s.length>1&&"0"==s.charAt(0)&&(r=Ji.test(s)?16:8,s=s.slice(8==r?1:2)),""===s)a=0;else{if(!(10==r?en:8==r?Zi:tn).test(s))return e;a=parseInt(s,r)}i.push(a)}for(n=0;n<t;n++)if(a=i[n],n==t-1){if(a>=zi(256,5-t))return null}else if(a>255)return null;for(o=i.pop(),n=0;n<i.length;n++)o+=i[n]*zi(256,3-n);return o},cn=function(e){var t,i,n,s,r,a,o,l=[0,0,0,0,0,0,0,0],c=0,u=null,h=0,d=function(){return e.charAt(h)};if(":"==d()){if(":"!=e.charAt(1))return;h+=2,u=++c}for(;d();){if(8==c)return;if(":"!=d()){for(t=i=0;i<4&&tn.test(d());)t=16*t+parseInt(d(),16),h++,i++;if("."==d()){if(0==i)return;if(h-=i,c>6)return;for(n=0;d();){if(s=null,n>0){if(!("."==d()&&n<4))return;h++}if(!Qi.test(d()))return;for(;Qi.test(d());){if(r=parseInt(d(),10),null===s)s=r;else{if(0==s)return;s=10*s+r}if(s>255)return;h++}l[c]=256*l[c]+s,2!=++n&&4!=n||c++}if(4!=n)return;break}if(":"==d()){if(h++,!d())return}else if(d())return;l[c++]=t}else{if(null!==u)return;h++,u=++c}}if(null!==u)for(a=c-u,c=7;0!=c&&a>0;)o=l[c],l[c--]=l[u+a-1],l[u+--a]=o;else if(8!=c)return;return l},un=function(e){var t,i,n,s;if("number"==typeof e){for(t=[],i=0;i<4;i++)t.unshift(e%256),e=Vi(e/256);return t.join(".")}if("object"==typeof e){for(t="",n=function(e){for(var t=null,i=1,n=null,s=0,r=0;r<8;r++)0!==e[r]?(s>i&&(t=n,i=s),n=null,s=0):(null===n&&(n=r),++s);return s>i&&(t=n,i=s),t}(e),i=0;i<8;i++)s&&0===e[i]||(s&&(s=!1),n===i?(t+=i?":":"::",s=!0):(t+=e[i].toString(16),i<7&&(t+=":")));return"["+t+"]"}return e},hn={},dn=Rt({},hn,{" ":1,'"':1,"<":1,">":1,"`":1}),pn=Rt({},dn,{"#":1,"?":1,"{":1,"}":1}),mn=Rt({},pn,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),fn=function(e,t){var i=qi(e,0);return i>32&&i<127&&!N(t,e)?e:encodeURIComponent(e)},gn={ftp:21,file:null,http:80,https:443,ws:80,wss:443},yn=function(e){return N(gn,e.scheme)},bn=function(e){return""!=e.username||""!=e.password},vn=function(e){return!e.host||e.cannotBeABaseURL||"file"==e.scheme},wn=function(e,t){var i;return 2==e.length&&Gi.test(e.charAt(0))&&(":"==(i=e.charAt(1))||!t&&"|"==i)},kn=function(e){var t;return e.length>1&&wn(e.slice(0,2))&&(2==e.length||"/"===(t=e.charAt(2))||"\\"===t||"?"===t||"#"===t)},Tn=function(e){var t=e.path,i=t.length;!i||"file"==e.scheme&&1==i&&wn(t[0],!0)||t.pop()},Sn=function(e){return"."===e||"%2e"===e.toLowerCase()},Cn={},An={},En={},Pn={},Ln={},xn={},In={},On={},_n={},Mn={},Nn={},jn={},Rn={},$n={},qn={},Un={},Fn={},Dn={},Hn={},Bn={},Vn={},zn=function(e,t,i,n){var s,r,a,o,l,c=i||Cn,u=0,h="",d=!1,p=!1,m=!1;for(i||(e.scheme="",e.username="",e.password="",e.host=null,e.port=null,e.path=[],e.query=null,e.fragment=null,e.cannotBeABaseURL=!1,t=t.replace(rn,"")),t=t.replace(an,""),s=Xt(t);u<=s.length;){switch(r=s[u],c){case Cn:if(!r||!Gi.test(r)){if(i)return Wi;c=En;continue}h+=r.toLowerCase(),c=An;break;case An:if(r&&(Xi.test(r)||"+"==r||"-"==r||"."==r))h+=r.toLowerCase();else{if(":"!=r){if(i)return Wi;h="",c=En,u=0;continue}if(i&&(yn(e)!=N(gn,h)||"file"==h&&(bn(e)||null!==e.port)||"file"==e.scheme&&!e.host))return;if(e.scheme=h,i)return void(yn(e)&&gn[e.scheme]==e.port&&(e.port=null));h="","file"==e.scheme?c=$n:yn(e)&&n&&n.scheme==e.scheme?c=Pn:yn(e)?c=On:"/"==s[u+1]?(c=Ln,u++):(e.cannotBeABaseURL=!0,e.path.push(""),c=Hn)}break;case En:if(!n||n.cannotBeABaseURL&&"#"!=r)return Wi;if(n.cannotBeABaseURL&&"#"==r){e.scheme=n.scheme,e.path=n.path.slice(),e.query=n.query,e.fragment="",e.cannotBeABaseURL=!0,c=Vn;break}c="file"==n.scheme?$n:xn;continue;case Pn:if("/"!=r||"/"!=s[u+1]){c=xn;continue}c=_n,u++;break;case Ln:if("/"==r){c=Mn;break}c=Dn;continue;case xn:if(e.scheme=n.scheme,r==Ri)e.username=n.username,e.password=n.password,e.host=n.host,e.port=n.port,e.path=n.path.slice(),e.query=n.query;else if("/"==r||"\\"==r&&yn(e))c=In;else if("?"==r)e.username=n.username,e.password=n.password,e.host=n.host,e.port=n.port,e.path=n.path.slice(),e.query="",c=Bn;else{if("#"!=r){e.username=n.username,e.password=n.password,e.host=n.host,e.port=n.port,e.path=n.path.slice(),e.path.pop(),c=Dn;continue}e.username=n.username,e.password=n.password,e.host=n.host,e.port=n.port,e.path=n.path.slice(),e.query=n.query,e.fragment="",c=Vn}break;case In:if(!yn(e)||"/"!=r&&"\\"!=r){if("/"!=r){e.username=n.username,e.password=n.password,e.host=n.host,e.port=n.port,c=Dn;continue}c=Mn}else c=_n;break;case On:if(c=_n,"/"!=r||"/"!=h.charAt(u+1))continue;u++;break;case _n:if("/"!=r&&"\\"!=r){c=Mn;continue}break;case Mn:if("@"==r){d&&(h="%40"+h),d=!0,a=Xt(h);for(var f=0;f<a.length;f++){var g=a[f];if(":"!=g||m){var y=fn(g,mn);m?e.password+=y:e.username+=y}else m=!0}h=""}else if(r==Ri||"/"==r||"?"==r||"#"==r||"\\"==r&&yn(e)){if(d&&""==h)return"Invalid authority";u-=Xt(h).length+1,h="",c=Nn}else h+=r;break;case Nn:case jn:if(i&&"file"==e.scheme){c=Un;continue}if(":"!=r||p){if(r==Ri||"/"==r||"?"==r||"#"==r||"\\"==r&&yn(e)){if(yn(e)&&""==h)return Ki;if(i&&""==h&&(bn(e)||null!==e.port))return;if(o=on(e,h))return o;if(h="",c=Fn,i)return;continue}"["==r?p=!0:"]"==r&&(p=!1),h+=r}else{if(""==h)return Ki;if(o=on(e,h))return o;if(h="",c=Rn,i==jn)return}break;case Rn:if(!Qi.test(r)){if(r==Ri||"/"==r||"?"==r||"#"==r||"\\"==r&&yn(e)||i){if(""!=h){var b=parseInt(h,10);if(b>65535)return Yi;e.port=yn(e)&&b===gn[e.scheme]?null:b,h=""}if(i)return;c=Fn;continue}return Yi}h+=r;break;case $n:if(e.scheme="file","/"==r||"\\"==r)c=qn;else{if(!n||"file"!=n.scheme){c=Dn;continue}if(r==Ri)e.host=n.host,e.path=n.path.slice(),e.query=n.query;else if("?"==r)e.host=n.host,e.path=n.path.slice(),e.query="",c=Bn;else{if("#"!=r){kn(s.slice(u).join(""))||(e.host=n.host,e.path=n.path.slice(),Tn(e)),c=Dn;continue}e.host=n.host,e.path=n.path.slice(),e.query=n.query,e.fragment="",c=Vn}}break;case qn:if("/"==r||"\\"==r){c=Un;break}n&&"file"==n.scheme&&!kn(s.slice(u).join(""))&&(wn(n.path[0],!0)?e.path.push(n.path[0]):e.host=n.host),c=Dn;continue;case Un:if(r==Ri||"/"==r||"\\"==r||"?"==r||"#"==r){if(!i&&wn(h))c=Dn;else if(""==h){if(e.host="",i)return;c=Fn}else{if(o=on(e,h))return o;if("localhost"==e.host&&(e.host=""),i)return;h="",c=Fn}continue}h+=r;break;case Fn:if(yn(e)){if(c=Dn,"/"!=r&&"\\"!=r)continue}else if(i||"?"!=r)if(i||"#"!=r){if(r!=Ri&&(c=Dn,"/"!=r))continue}else e.fragment="",c=Vn;else e.query="",c=Bn;break;case Dn:if(r==Ri||"/"==r||"\\"==r&&yn(e)||!i&&("?"==r||"#"==r)){if(".."===(l=(l=h).toLowerCase())||"%2e."===l||".%2e"===l||"%2e%2e"===l?(Tn(e),"/"==r||"\\"==r&&yn(e)||e.path.push("")):Sn(h)?"/"==r||"\\"==r&&yn(e)||e.path.push(""):("file"==e.scheme&&!e.path.length&&wn(h)&&(e.host&&(e.host=""),h=h.charAt(0)+":"),e.path.push(h)),h="","file"==e.scheme&&(r==Ri||"?"==r||"#"==r))for(;e.path.length>1&&""===e.path[0];)e.path.shift();"?"==r?(e.query="",c=Bn):"#"==r&&(e.fragment="",c=Vn)}else h+=fn(r,pn);break;case Hn:"?"==r?(e.query="",c=Bn):"#"==r?(e.fragment="",c=Vn):r!=Ri&&(e.path[0]+=fn(r,hn));break;case Bn:i||"#"!=r?r!=Ri&&("'"==r&&yn(e)?e.query+="%27":e.query+="#"==r?"%23":fn(r,hn)):(e.fragment="",c=Vn);break;case Vn:r!=Ri&&(e.fragment+=fn(r,dn))}u++}},Wn=function(e){var t,i,n=Mt(this,Wn,"URL"),s=arguments.length>1?arguments[1]:void 0,r=String(e),a=Hi(n,{type:"URL"});if(void 0!==s)if(s instanceof Wn)t=Bi(s);else if(i=zn(t={},String(s)))throw TypeError(i);if(i=zn(a,r,null,t))throw TypeError(i);var o=a.searchParams=new Fi,l=Di(o);l.updateSearchParams(a.query),l.updateURL=function(){a.query=String(o)||null},h||(n.href=Yn.call(n),n.origin=Gn.call(n),n.protocol=Xn.call(n),n.username=Qn.call(n),n.password=Jn.call(n),n.host=Zn.call(n),n.hostname=es.call(n),n.port=ts.call(n),n.pathname=is.call(n),n.search=ns.call(n),n.searchParams=ss.call(n),n.hash=rs.call(n))},Kn=Wn.prototype,Yn=function(){var e=Bi(this),t=e.scheme,i=e.username,n=e.password,s=e.host,r=e.port,a=e.path,o=e.query,l=e.fragment,c=t+":";return null!==s?(c+="//",bn(e)&&(c+=i+(n?":"+n:"")+"@"),c+=un(s),null!==r&&(c+=":"+r)):"file"==t&&(c+="//"),c+=e.cannotBeABaseURL?a[0]:a.length?"/"+a.join("/"):"",null!==o&&(c+="?"+o),null!==l&&(c+="#"+l),c},Gn=function(){var e=Bi(this),t=e.scheme,i=e.port;if("blob"==t)try{return new URL(t.path[0]).origin}catch(e){return"null"}return"file"!=t&&yn(e)?t+"://"+un(e.host)+(null!==i?":"+i:""):"null"},Xn=function(){return Bi(this).scheme+":"},Qn=function(){return Bi(this).username},Jn=function(){return Bi(this).password},Zn=function(){var e=Bi(this),t=e.host,i=e.port;return null===t?"":null===i?un(t):un(t)+":"+i},es=function(){var e=Bi(this).host;return null===e?"":un(e)},ts=function(){var e=Bi(this).port;return null===e?"":String(e)},is=function(){var e=Bi(this),t=e.path;return e.cannotBeABaseURL?t[0]:t.length?"/"+t.join("/"):""},ns=function(){var e=Bi(this).query;return e?"?"+e:""},ss=function(){return Bi(this).searchParams},rs=function(){var e=Bi(this).fragment;return e?"#"+e:""},as=function(e,t){return{get:e,set:t,configurable:!0,enumerable:!0}};if(h&&st(Kn,{href:as(Yn,(function(e){var t=Bi(this),i=String(e),n=zn(t,i);if(n)throw TypeError(n);Di(t.searchParams).updateSearchParams(t.query)})),origin:as(Gn),protocol:as(Xn,(function(e){var t=Bi(this);zn(t,String(e)+":",Cn)})),username:as(Qn,(function(e){var t=Bi(this),i=Xt(String(e));if(!vn(t)){t.username="";for(var n=0;n<i.length;n++)t.username+=fn(i[n],mn)}})),password:as(Jn,(function(e){var t=Bi(this),i=Xt(String(e));if(!vn(t)){t.password="";for(var n=0;n<i.length;n++)t.password+=fn(i[n],mn)}})),host:as(Zn,(function(e){var t=Bi(this);t.cannotBeABaseURL||zn(t,String(e),Nn)})),hostname:as(es,(function(e){var t=Bi(this);t.cannotBeABaseURL||zn(t,String(e),jn)})),port:as(ts,(function(e){var t=Bi(this);vn(t)||(""==(e=String(e))?t.port=null:zn(t,e,Rn))})),pathname:as(is,(function(e){var t=Bi(this);t.cannotBeABaseURL||(t.path=[],zn(t,e+"",Fn))})),search:as(ns,(function(e){var t=Bi(this);""==(e=String(e))?t.query=null:("?"==e.charAt(0)&&(e=e.slice(1)),t.query="",zn(t,e,Bn)),Di(t.searchParams).updateSearchParams(t.query)})),searchParams:as(ss),hash:as(rs,(function(e){var t=Bi(this);""!=(e=String(e))?("#"==e.charAt(0)&&(e=e.slice(1)),t.fragment="",zn(t,e,Vn)):t.fragment=null}))}),oe(Kn,"toJSON",(function(){return Yn.call(this)}),{enumerable:!0}),oe(Kn,"toString",(function(){return Yn.call(this)}),{enumerable:!0}),Ui){var os=Ui.createObjectURL,ls=Ui.revokeObjectURL;os&&oe(Wn,"createObjectURL",(function(e){return os.apply(Ui,arguments)})),ls&&oe(Wn,"revokeObjectURL",(function(e){return ls.apply(Ui,arguments)}))}function cs(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function us(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function hs(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function ds(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function ps(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?ds(Object(i),!0).forEach((function(t){hs(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):ds(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}pt(Wn,"URL"),_e({global:!0,forced:!_t,sham:!h},{URL:Wn}),function(e){var t=function(){try{return!!Symbol.iterator}catch(e){return!1}}(),i=function(e){var i={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return t&&(i[Symbol.iterator]=function(){return i}),i},n=function(e){return encodeURIComponent(e).replace(/%20/g,"+")},s=function(e){return decodeURIComponent(String(e).replace(/\+/g," "))};(function(){try{var t=e.URLSearchParams;return"a=1"===new t("?a=1").toString()&&"function"==typeof t.prototype.set&&"function"==typeof t.prototype.entries}catch(e){return!1}})()||function(){var s=function(e){Object.defineProperty(this,"_entries",{writable:!0,value:{}});var t=typeof e;if("undefined"===t);else if("string"===t)""!==e&&this._fromString(e);else if(e instanceof s){var i=this;e.forEach((function(e,t){i.append(t,e)}))}else{if(null===e||"object"!==t)throw new TypeError("Unsupported input's type for URLSearchParams");if("[object Array]"===Object.prototype.toString.call(e))for(var n=0;n<e.length;n++){var r=e[n];if("[object Array]"!==Object.prototype.toString.call(r)&&2===r.length)throw new TypeError("Expected [string, any] as entry at index "+n+" of URLSearchParams's input");this.append(r[0],r[1])}else for(var a in e)e.hasOwnProperty(a)&&this.append(a,e[a])}},r=s.prototype;r.append=function(e,t){e in this._entries?this._entries[e].push(String(t)):this._entries[e]=[String(t)]},r.delete=function(e){delete this._entries[e]},r.get=function(e){return e in this._entries?this._entries[e][0]:null},r.getAll=function(e){return e in this._entries?this._entries[e].slice(0):[]},r.has=function(e){return e in this._entries},r.set=function(e,t){this._entries[e]=[String(t)]},r.forEach=function(e,t){var i;for(var n in this._entries)if(this._entries.hasOwnProperty(n)){i=this._entries[n];for(var s=0;s<i.length;s++)e.call(t,i[s],n,this)}},r.keys=function(){var e=[];return this.forEach((function(t,i){e.push(i)})),i(e)},r.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),i(e)},r.entries=function(){var e=[];return this.forEach((function(t,i){e.push([i,t])})),i(e)},t&&(r[Symbol.iterator]=r.entries),r.toString=function(){var e=[];return this.forEach((function(t,i){e.push(n(i)+"="+n(t))})),e.join("&")},e.URLSearchParams=s}();var r=e.URLSearchParams.prototype;"function"!=typeof r.sort&&(r.sort=function(){var e=this,t=[];this.forEach((function(i,n){t.push([n,i]),e._entries||e.delete(n)})),t.sort((function(e,t){return e[0]<t[0]?-1:e[0]>t[0]?1:0})),e._entries&&(e._entries={});for(var i=0;i<t.length;i++)this.append(t[i][0],t[i][1])}),"function"!=typeof r._fromString&&Object.defineProperty(r,"_fromString",{enumerable:!1,configurable:!1,writable:!1,value:function(e){if(this._entries)this._entries={};else{var t=[];this.forEach((function(e,i){t.push(i)}));for(var i=0;i<t.length;i++)this.delete(t[i])}var n,r=(e=e.replace(/^\?/,"")).split("&");for(i=0;i<r.length;i++)n=r[i].split("="),this.append(s(n[0]),n.length>1?s(n[1]):"")}})}(void 0!==a?a:"undefined"!=typeof window?window:"undefined"!=typeof self?self:a),function(e){if(function(){try{var t=new e.URL("b","http://a");return t.pathname="c d","http://a/c%20d"===t.href&&t.searchParams}catch(e){return!1}}()||function(){var t=e.URL,i=function(t,i){"string"!=typeof t&&(t=String(t)),i&&"string"!=typeof i&&(i=String(i));var n,s=document;if(i&&(void 0===e.location||i!==e.location.href)){i=i.toLowerCase(),(n=(s=document.implementation.createHTMLDocument("")).createElement("base")).href=i,s.head.appendChild(n);try{if(0!==n.href.indexOf(i))throw new Error(n.href)}catch(e){throw new Error("URL unable to set base "+i+" due to "+e)}}var r=s.createElement("a");r.href=t,n&&(s.body.appendChild(r),r.href=r.href);var a=s.createElement("input");if(a.type="url",a.value=t,":"===r.protocol||!/:/.test(r.href)||!a.checkValidity()&&!i)throw new TypeError("Invalid URL");Object.defineProperty(this,"_anchorElement",{value:r});var o=new e.URLSearchParams(this.search),l=!0,c=!0,u=this;["append","delete","set"].forEach((function(e){var t=o[e];o[e]=function(){t.apply(o,arguments),l&&(c=!1,u.search=o.toString(),c=!0)}})),Object.defineProperty(this,"searchParams",{value:o,enumerable:!0});var h=void 0;Object.defineProperty(this,"_updateSearchParams",{enumerable:!1,configurable:!1,writable:!1,value:function(){this.search!==h&&(h=this.search,c&&(l=!1,this.searchParams._fromString(this.search),l=!0))}})},n=i.prototype;["hash","host","hostname","port","protocol"].forEach((function(e){!function(e){Object.defineProperty(n,e,{get:function(){return this._anchorElement[e]},set:function(t){this._anchorElement[e]=t},enumerable:!0})}(e)})),Object.defineProperty(n,"search",{get:function(){return this._anchorElement.search},set:function(e){this._anchorElement.search=e,this._updateSearchParams()},enumerable:!0}),Object.defineProperties(n,{toString:{get:function(){var e=this;return function(){return e.href}}},href:{get:function(){return this._anchorElement.href.replace(/\?$/,"")},set:function(e){this._anchorElement.href=e,this._updateSearchParams()},enumerable:!0},pathname:{get:function(){return this._anchorElement.pathname.replace(/(^\/?)/,"/")},set:function(e){this._anchorElement.pathname=e},enumerable:!0},origin:{get:function(){var e={"http:":80,"https:":443,"ftp:":21}[this._anchorElement.protocol],t=this._anchorElement.port!=e&&""!==this._anchorElement.port;return this._anchorElement.protocol+"//"+this._anchorElement.hostname+(t?":"+this._anchorElement.port:"")},enumerable:!0},password:{get:function(){return""},set:function(e){},enumerable:!0},username:{get:function(){return""},set:function(e){},enumerable:!0}}),i.createObjectURL=function(e){return t.createObjectURL.apply(t,arguments)},i.revokeObjectURL=function(e){return t.revokeObjectURL.apply(t,arguments)},e.URL=i}(),void 0!==e.location&&!("origin"in e.location)){var t=function(){return e.location.protocol+"//"+e.location.hostname+(e.location.port?":"+e.location.port:"")};try{Object.defineProperty(e.location,"origin",{get:t,enumerable:!0})}catch(i){setInterval((function(){e.location.origin=t()}),100)}}}(void 0!==a?a:"undefined"!=typeof window?window:"undefined"!=typeof self?self:a);var ms={addCSS:!0,thumbWidth:15,watch:!0};function fs(e,t){return function(){return Array.from(document.querySelectorAll(t)).includes(this)}.call(e,t)}var gs=function(e){return null!=e?e.constructor:null},ys=function(e,t){return!!(e&&t&&e instanceof t)},bs=function(e){return null==e},vs=function(e){return gs(e)===Object},ws=function(e){return gs(e)===String},ks=function(e){return Array.isArray(e)},Ts=function(e){return ys(e,NodeList)},Ss=ws,Cs=ks,As=Ts,Es=function(e){return ys(e,Element)},Ps=function(e){return ys(e,Event)},Ls=function(e){return bs(e)||(ws(e)||ks(e)||Ts(e))&&!e.length||vs(e)&&!Object.keys(e).length};function xs(e,t){if(1>t){var i=function(e){var t="".concat(e).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return t?Math.max(0,(t[1]?t[1].length:0)-(t[2]?+t[2]:0)):0}(t);return parseFloat(e.toFixed(i))}return Math.round(e/t)*t}var Is=function(){function e(t,i){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),Es(t)?this.element=t:Ss(t)&&(this.element=document.querySelector(t)),Es(this.element)&&Ls(this.element.rangeTouch)&&(this.config=ps({},ms,{},i),this.init())}return function(e,t,i){t&&us(e.prototype,t),i&&us(e,i)}(e,[{key:"init",value:function(){e.enabled&&(this.config.addCSS&&(this.element.style.userSelect="none",this.element.style.webKitUserSelect="none",this.element.style.touchAction="manipulation"),this.listeners(!0),this.element.rangeTouch=this)}},{key:"destroy",value:function(){e.enabled&&(this.config.addCSS&&(this.element.style.userSelect="",this.element.style.webKitUserSelect="",this.element.style.touchAction=""),this.listeners(!1),this.element.rangeTouch=null)}},{key:"listeners",value:function(e){var t=this,i=e?"addEventListener":"removeEventListener";["touchstart","touchmove","touchend"].forEach((function(e){t.element[i](e,(function(e){return t.set(e)}),!1)}))}},{key:"get",value:function(t){if(!e.enabled||!Ps(t))return null;var i,n=t.target,s=t.changedTouches[0],r=parseFloat(n.getAttribute("min"))||0,a=parseFloat(n.getAttribute("max"))||100,o=parseFloat(n.getAttribute("step"))||1,l=n.getBoundingClientRect(),c=100/l.width*(this.config.thumbWidth/2)/100;return 0>(i=100/l.width*(s.clientX-l.left))?i=0:100<i&&(i=100),50>i?i-=(100-2*i)*c:50<i&&(i+=2*(i-50)*c),r+xs(i/100*(a-r),o)}},{key:"set",value:function(t){e.enabled&&Ps(t)&&!t.target.disabled&&(t.preventDefault(),t.target.value=this.get(t),function(e,t){if(e&&t){var i=new Event(t,{bubbles:!0});e.dispatchEvent(i)}}(t.target,"touchend"===t.type?"change":"input"))}}],[{key:"setup",value:function(t){var i=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},n=null;if(Ls(t)||Ss(t)?n=Array.from(document.querySelectorAll(Ss(t)?t:'input[type="range"]')):Es(t)?n=[t]:As(t)?n=Array.from(t):Cs(t)&&(n=t.filter(Es)),Ls(n))return null;var s=ps({},ms,{},i);if(Ss(t)&&s.watch){var r=new MutationObserver((function(i){Array.from(i).forEach((function(i){Array.from(i.addedNodes).forEach((function(i){Es(i)&&fs(i,t)&&new e(i,s)}))}))}));r.observe(document.body,{childList:!0,subtree:!0})}return n.map((function(t){return new e(t,i)}))}},{key:"enabled",get:function(){return"ontouchstart"in document.documentElement}}]),e}();const Os=e=>null!=e?e.constructor:null,_s=(e,t)=>Boolean(e&&t&&e instanceof t),Ms=e=>null==e,Ns=e=>Os(e)===Object,js=e=>Os(e)===String,Rs=e=>Os(e)===Function,$s=e=>Array.isArray(e),qs=e=>_s(e,NodeList),Us=e=>Ms(e)||(js(e)||$s(e)||qs(e))&&!e.length||Ns(e)&&!Object.keys(e).length;var Fs=Ms,Ds=Ns,Hs=e=>Os(e)===Number&&!Number.isNaN(e),Bs=js,Vs=e=>Os(e)===Boolean,zs=Rs,Ws=$s,Ks=qs,Ys=e=>null!==e&&"object"==typeof e&&1===e.nodeType&&"object"==typeof e.style&&"object"==typeof e.ownerDocument,Gs=e=>_s(e,Event),Xs=e=>_s(e,KeyboardEvent),Qs=e=>_s(e,TextTrack)||!Ms(e)&&js(e.kind),Js=e=>_s(e,Promise)&&Rs(e.then),Zs=e=>{if(_s(e,window.URL))return!0;if(!js(e))return!1;let t=e;e.startsWith("http://")&&e.startsWith("https://")||(t=`http://${e}`);try{return!Us(new URL(t).hostname)}catch(e){return!1}},er=Us;const tr=(()=>{const e=document.createElement("span"),t={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"},i=Object.keys(t).find((t=>void 0!==e.style[t]));return!!Bs(i)&&t[i]})();function ir(e,t){setTimeout((()=>{try{e.hidden=!0,e.offsetHeight,e.hidden=!1}catch(e){}}),t)}const nr={isIE:
2
  /* @cc_on!@ */
3
+ !!document.documentMode,isEdge:window.navigator.userAgent.includes("Edge"),isWebkit:"WebkitAppearance"in document.documentElement.style&&!/Edge/.test(navigator.userAgent),isIPhone:/(iPhone|iPod)/gi.test(navigator.platform),isIos:/(iPad|iPhone|iPod)/gi.test(navigator.platform)};function sr(e,t){return t.split(".").reduce(((e,t)=>e&&e[t]),e)}function rr(e={},...t){if(!t.length)return e;const i=t.shift();return Ds(i)?(Object.keys(i).forEach((t=>{Ds(i[t])?(Object.keys(e).includes(t)||Object.assign(e,{[t]:{}}),rr(e[t],i[t])):Object.assign(e,{[t]:i[t]})})),rr(e,...t)):e}function ar(e,t){const i=e.length?e:[e];Array.from(i).reverse().forEach(((e,i)=>{const n=i>0?t.cloneNode(!0):t,s=e.parentNode,r=e.nextSibling;n.appendChild(e),r?s.insertBefore(n,r):s.appendChild(n)}))}function or(e,t){Ys(e)&&!er(t)&&Object.entries(t).filter((([,e])=>!Fs(e))).forEach((([t,i])=>e.setAttribute(t,i)))}function lr(e,t,i){const n=document.createElement(e);return Ds(t)&&or(n,t),Bs(i)&&(n.innerText=i),n}function cr(e,t,i,n){Ys(t)&&t.appendChild(lr(e,i,n))}function ur(e){Ks(e)||Ws(e)?Array.from(e).forEach(ur):Ys(e)&&Ys(e.parentNode)&&e.parentNode.removeChild(e)}function hr(e){if(!Ys(e))return;let{length:t}=e.childNodes;for(;t>0;)e.removeChild(e.lastChild),t-=1}function dr(e,t){return Ys(t)&&Ys(t.parentNode)&&Ys(e)?(t.parentNode.replaceChild(e,t),e):null}function pr(e,t){if(!Bs(e)||er(e))return{};const i={},n=rr({},t);return e.split(",").forEach((e=>{const t=e.trim(),s=t.replace(".",""),r=t.replace(/[[\]]/g,"").split("="),[a]=r,o=r.length>1?r[1].replace(/["']/g,""):"";switch(t.charAt(0)){case".":Bs(n.class)?i.class=`${n.class} ${s}`:i.class=s;break;case"#":i.id=t.replace("#","");break;case"[":i[a]=o}})),rr(n,i)}function mr(e,t){if(!Ys(e))return;let i=t;Vs(i)||(i=!e.hidden),e.hidden=i}function fr(e,t,i){if(Ks(e))return Array.from(e).map((e=>fr(e,t,i)));if(Ys(e)){let n="toggle";return void 0!==i&&(n=i?"add":"remove"),e.classList[n](t),e.classList.contains(t)}return!1}function gr(e,t){return Ys(e)&&e.classList.contains(t)}function yr(e,t){const{prototype:i}=Element;return(i.matches||i.webkitMatchesSelector||i.mozMatchesSelector||i.msMatchesSelector||function(){return Array.from(document.querySelectorAll(t)).includes(this)}).call(e,t)}function br(e){return this.elements.container.querySelectorAll(e)}function vr(e){return this.elements.container.querySelector(e)}function wr(e=null,t=!1){Ys(e)&&(e.focus({preventScroll:!0}),t&&fr(e,this.config.classNames.tabFocus))}const kr={"audio/ogg":"vorbis","audio/wav":"1","video/webm":"vp8, vorbis","video/mp4":"avc1.42E01E, mp4a.40.2","video/ogg":"theora"},Tr={audio:"canPlayType"in document.createElement("audio"),video:"canPlayType"in document.createElement("video"),check(e,t,i){const n=nr.isIPhone&&i&&Tr.playsinline,s=Tr[e]||"html5"!==t;return{api:s,ui:s&&Tr.rangeInput&&("video"!==e||!nr.isIPhone||n)}},pip:!(nr.isIPhone||!zs(lr("video").webkitSetPresentationMode)&&(!document.pictureInPictureEnabled||lr("video").disablePictureInPicture)),airplay:zs(window.WebKitPlaybackTargetAvailabilityEvent),playsinline:"playsInline"in document.createElement("video"),mime(e){if(er(e))return!1;const[t]=e.split("/");let i=e;if(!this.isHTML5||t!==this.type)return!1;Object.keys(kr).includes(i)&&(i+=`; codecs="${kr[e]}"`);try{return Boolean(i&&this.media.canPlayType(i).replace(/no/,""))}catch(e){return!1}},textTracks:"textTracks"in document.createElement("video"),rangeInput:(()=>{const e=document.createElement("input");return e.type="range","range"===e.type})(),touch:"ontouchstart"in document.documentElement,transitions:!1!==tr,reducedMotion:"matchMedia"in window&&window.matchMedia("(prefers-reduced-motion)").matches},Sr=(()=>{let e=!1;try{const t=Object.defineProperty({},"passive",{get:()=>(e=!0,null)});window.addEventListener("test",null,t),window.removeEventListener("test",null,t)}catch(e){}return e})();function Cr(e,t,i,n=!1,s=!0,r=!1){if(!e||!("addEventListener"in e)||er(t)||!zs(i))return;const a=t.split(" ");let o=r;Sr&&(o={passive:s,capture:r}),a.forEach((t=>{this&&this.eventListeners&&n&&this.eventListeners.push({element:e,type:t,callback:i,options:o}),e[n?"addEventListener":"removeEventListener"](t,i,o)}))}function Ar(e,t="",i,n=!0,s=!1){Cr.call(this,e,t,i,!0,n,s)}function Er(e,t="",i,n=!0,s=!1){Cr.call(this,e,t,i,!1,n,s)}function Pr(e,t="",i,n=!0,s=!1){const r=(...a)=>{Er(e,t,r,n,s),i.apply(this,a)};Cr.call(this,e,t,r,!0,n,s)}function Lr(e,t="",i=!1,n={}){if(!Ys(e)||er(t))return;const s=new CustomEvent(t,{bubbles:i,detail:{...n,plyr:this}});e.dispatchEvent(s)}function xr(){this&&this.eventListeners&&(this.eventListeners.forEach((e=>{const{element:t,type:i,callback:n,options:s}=e;t.removeEventListener(i,n,s)})),this.eventListeners=[])}function Ir(){return new Promise((e=>this.ready?setTimeout(e,0):Ar.call(this,this.elements.container,"ready",e))).then((()=>{}))}function Or(e){Js(e)&&e.then(null,(()=>{}))}function _r(e){if(!(Ws(e)||Bs(e)&&e.includes(":")))return!1;return(Ws(e)?e:e.split(":")).map(Number).every(Hs)}function Mr(e){if(!Ws(e)||!e.every(Hs))return null;const[t,i]=e,n=(e,t)=>0===t?e:n(t,e%t),s=n(t,i);return[t/s,i/s]}function Nr(e){const t=e=>_r(e)?e.split(":").map(Number):null;let i=t(e);if(null===i&&(i=t(this.config.ratio)),null===i&&!er(this.embed)&&Ws(this.embed.ratio)&&({ratio:i}=this.embed),null===i&&this.isHTML5){const{videoWidth:e,videoHeight:t}=this.media;i=Mr([e,t])}return i}function jr(e){if(!this.isVideo)return{};const{wrapper:t}=this.elements,i=Nr.call(this,e),[n,s]=Ws(i)?i:[0,0],r=100/n*s;if(t.style.paddingBottom=`${r}%`,this.isVimeo&&!this.config.vimeo.premium&&this.supported.ui){const e=100/this.media.offsetWidth*parseInt(window.getComputedStyle(this.media).paddingBottom,10),i=(e-r)/(e/50);this.fullscreen.active?t.style.paddingBottom=null:this.media.style.transform=`translateY(-${i}%)`}else this.isHTML5&&t.classList.toggle(this.config.classNames.videoFixedRatio,null!==i);return{padding:r,ratio:i}}const Rr={getSources(){if(!this.isHTML5)return[];return Array.from(this.media.querySelectorAll("source")).filter((e=>{const t=e.getAttribute("type");return!!er(t)||Tr.mime.call(this,t)}))},getQualityOptions(){return this.config.quality.forced?this.config.quality.options:Rr.getSources.call(this).map((e=>Number(e.getAttribute("size")))).filter(Boolean)},setup(){if(!this.isHTML5)return;const e=this;e.options.speed=e.config.speed.options,er(this.config.ratio)||jr.call(e),Object.defineProperty(e.media,"quality",{get(){const t=Rr.getSources.call(e).find((t=>t.getAttribute("src")===e.source));return t&&Number(t.getAttribute("size"))},set(t){if(e.quality!==t){if(e.config.quality.forced&&zs(e.config.quality.onChange))e.config.quality.onChange(t);else{const i=Rr.getSources.call(e).find((e=>Number(e.getAttribute("size"))===t));if(!i)return;const{currentTime:n,paused:s,preload:r,readyState:a,playbackRate:o}=e.media;e.media.src=i.getAttribute("src"),("none"!==r||a)&&(e.once("loadedmetadata",(()=>{e.speed=o,e.currentTime=n,s||Or(e.play())})),e.media.load())}Lr.call(e,e.media,"qualitychange",!1,{quality:t})}}})},cancelRequests(){this.isHTML5&&(ur(Rr.getSources.call(this)),this.media.setAttribute("src",this.config.blankVideo),this.media.load(),this.debug.log("Cancelled network requests"))}};function $r(e){return Ws(e)?e.filter(((t,i)=>e.indexOf(t)===i)):e}function qr(e,...t){return er(e)?e:e.toString().replace(/{(\d+)}/g,((e,i)=>t[i].toString()))}const Ur=(e="",t="",i="")=>e.replace(new RegExp(t.toString().replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1"),"g"),i.toString()),Fr=(e="")=>e.toString().replace(/\w\S*/g,(e=>e.charAt(0).toUpperCase()+e.substr(1).toLowerCase()));function Dr(e=""){let t=e.toString();return t=function(e=""){let t=e.toString();return t=Ur(t,"-"," "),t=Ur(t,"_"," "),t=Fr(t),Ur(t," ","")}(t),t.charAt(0).toLowerCase()+t.slice(1)}function Hr(e){const t=document.createElement("div");return t.appendChild(e),t.innerHTML}const Br={pip:"PIP",airplay:"AirPlay",html5:"HTML5",vimeo:"Vimeo",youtube:"YouTube"},Vr={get(e="",t={}){if(er(e)||er(t))return"";let i=sr(t.i18n,e);if(er(i))return Object.keys(Br).includes(e)?Br[e]:"";const n={"{seektime}":t.seekTime,"{title}":t.title};return Object.entries(n).forEach((([e,t])=>{i=Ur(i,e,t)})),i}};class zr{constructor(e){cs(this,"get",(e=>{if(!zr.supported||!this.enabled)return null;const t=window.localStorage.getItem(this.key);if(er(t))return null;const i=JSON.parse(t);return Bs(e)&&e.length?i[e]:i})),cs(this,"set",(e=>{if(!zr.supported||!this.enabled)return;if(!Ds(e))return;let t=this.get();er(t)&&(t={}),rr(t,e),window.localStorage.setItem(this.key,JSON.stringify(t))})),this.enabled=e.config.storage.enabled,this.key=e.config.storage.key}static get supported(){try{if(!("localStorage"in window))return!1;const e="___test";return window.localStorage.setItem(e,e),window.localStorage.removeItem(e),!0}catch(e){return!1}}}function Wr(e,t="text"){return new Promise(((i,n)=>{try{const n=new XMLHttpRequest;if(!("withCredentials"in n))return;n.addEventListener("load",(()=>{if("text"===t)try{i(JSON.parse(n.responseText))}catch(e){i(n.responseText)}else i(n.response)})),n.addEventListener("error",(()=>{throw new Error(n.status)})),n.open("GET",e,!0),n.responseType=t,n.send()}catch(e){n(e)}}))}function Kr(e,t){if(!Bs(e))return;const i=Bs(t);let n=!1;const s=()=>null!==document.getElementById(t),r=(e,t)=>{e.innerHTML=t,i&&s()||document.body.insertAdjacentElement("afterbegin",e)};if(!i||!s()){const s=zr.supported,a=document.createElement("div");if(a.setAttribute("hidden",""),i&&a.setAttribute("id",t),s){const e=window.localStorage.getItem(`cache-${t}`);if(n=null!==e,n){const t=JSON.parse(e);r(a,t.content)}}Wr(e).then((e=>{er(e)||(s&&window.localStorage.setItem(`cache-${t}`,JSON.stringify({content:e})),r(a,e))})).catch((()=>{}))}}const Yr=e=>Math.trunc(e/60/60%60,10);function Gr(e=0,t=!1,i=!1){if(!Hs(e))return Gr(void 0,t,i);const n=e=>`0${e}`.slice(-2);let s=Yr(e);const r=(a=e,Math.trunc(a/60%60,10));var a;const o=(e=>Math.trunc(e%60,10))(e);return s=t||s>0?`${s}:`:"",`${i&&e>0?"-":""}${s}${n(r)}:${n(o)}`}const Xr={getIconUrl(){const e=new URL(this.config.iconUrl,window.location).host!==window.location.host||nr.isIE&&!window.svg4everybody;return{url:this.config.iconUrl,cors:e}},findElements(){try{return this.elements.controls=vr.call(this,this.config.selectors.controls.wrapper),this.elements.buttons={play:br.call(this,this.config.selectors.buttons.play),pause:vr.call(this,this.config.selectors.buttons.pause),restart:vr.call(this,this.config.selectors.buttons.restart),rewind:vr.call(this,this.config.selectors.buttons.rewind),fastForward:vr.call(this,this.config.selectors.buttons.fastForward),mute:vr.call(this,this.config.selectors.buttons.mute),pip:vr.call(this,this.config.selectors.buttons.pip),airplay:vr.call(this,this.config.selectors.buttons.airplay),settings:vr.call(this,this.config.selectors.buttons.settings),captions:vr.call(this,this.config.selectors.buttons.captions),fullscreen:vr.call(this,this.config.selectors.buttons.fullscreen)},this.elements.progress=vr.call(this,this.config.selectors.progress),this.elements.inputs={seek:vr.call(this,this.config.selectors.inputs.seek),volume:vr.call(this,this.config.selectors.inputs.volume)},this.elements.display={buffer:vr.call(this,this.config.selectors.display.buffer),currentTime:vr.call(this,this.config.selectors.display.currentTime),duration:vr.call(this,this.config.selectors.display.duration)},Ys(this.elements.progress)&&(this.elements.display.seekTooltip=this.elements.progress.querySelector(`.${this.config.classNames.tooltip}`)),!0}catch(e){return this.debug.warn("It looks like there is a problem with your custom controls HTML",e),this.toggleNativeControls(!0),!1}},createIcon(e,t){const i="http://www.w3.org/2000/svg",n=Xr.getIconUrl.call(this),s=`${n.cors?"":n.url}#${this.config.iconPrefix}`,r=document.createElementNS(i,"svg");or(r,rr(t,{"aria-hidden":"true",focusable:"false"}));const a=document.createElementNS(i,"use"),o=`${s}-${e}`;return"href"in a&&a.setAttributeNS("http://www.w3.org/1999/xlink","href",o),a.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",o),r.appendChild(a),r},createLabel(e,t={}){const i=Vr.get(e,this.config);return lr("span",{...t,class:[t.class,this.config.classNames.hidden].filter(Boolean).join(" ")},i)},createBadge(e){if(er(e))return null;const t=lr("span",{class:this.config.classNames.menu.value});return t.appendChild(lr("span",{class:this.config.classNames.menu.badge},e)),t},createButton(e,t){const i=rr({},t);let n=Dr(e);const s={element:"button",toggle:!1,label:null,icon:null,labelPressed:null,iconPressed:null};switch(["element","icon","label"].forEach((e=>{Object.keys(i).includes(e)&&(s[e]=i[e],delete i[e])})),"button"!==s.element||Object.keys(i).includes("type")||(i.type="button"),Object.keys(i).includes("class")?i.class.split(" ").some((e=>e===this.config.classNames.control))||rr(i,{class:`${i.class} ${this.config.classNames.control}`}):i.class=this.config.classNames.control,e){case"play":s.toggle=!0,s.label="play",s.labelPressed="pause",s.icon="play",s.iconPressed="pause";break;case"mute":s.toggle=!0,s.label="mute",s.labelPressed="unmute",s.icon="volume",s.iconPressed="muted";break;case"captions":s.toggle=!0,s.label="enableCaptions",s.labelPressed="disableCaptions",s.icon="captions-off",s.iconPressed="captions-on";break;case"fullscreen":s.toggle=!0,s.label="enterFullscreen",s.labelPressed="exitFullscreen",s.icon="enter-fullscreen",s.iconPressed="exit-fullscreen";break;case"play-large":i.class+=` ${this.config.classNames.control}--overlaid`,n="play",s.label="play",s.icon="play";break;default:er(s.label)&&(s.label=n),er(s.icon)&&(s.icon=e)}const r=lr(s.element);return s.toggle?(r.appendChild(Xr.createIcon.call(this,s.iconPressed,{class:"icon--pressed"})),r.appendChild(Xr.createIcon.call(this,s.icon,{class:"icon--not-pressed"})),r.appendChild(Xr.createLabel.call(this,s.labelPressed,{class:"label--pressed"})),r.appendChild(Xr.createLabel.call(this,s.label,{class:"label--not-pressed"}))):(r.appendChild(Xr.createIcon.call(this,s.icon)),r.appendChild(Xr.createLabel.call(this,s.label))),rr(i,pr(this.config.selectors.buttons[n],i)),or(r,i),"play"===n?(Ws(this.elements.buttons[n])||(this.elements.buttons[n]=[]),this.elements.buttons[n].push(r)):this.elements.buttons[n]=r,r},createRange(e,t){const i=lr("input",rr(pr(this.config.selectors.inputs[e]),{type:"range",min:0,max:100,step:.01,value:0,autocomplete:"off",role:"slider","aria-label":Vr.get(e,this.config),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":0},t));return this.elements.inputs[e]=i,Xr.updateRangeFill.call(this,i),Is.setup(i),i},createProgress(e,t){const i=lr("progress",rr(pr(this.config.selectors.display[e]),{min:0,max:100,value:0,role:"progressbar","aria-hidden":!0},t));if("volume"!==e){i.appendChild(lr("span",null,"0"));const t={played:"played",buffer:"buffered"}[e],n=t?Vr.get(t,this.config):"";i.innerText=`% ${n.toLowerCase()}`}return this.elements.display[e]=i,i},createTime(e,t){const i=pr(this.config.selectors.display[e],t),n=lr("div",rr(i,{class:`${i.class?i.class:""} ${this.config.classNames.display.time} `.trim(),"aria-label":Vr.get(e,this.config)}),"00:00");return this.elements.display[e]=n,n},bindMenuItemShortcuts(e,t){Ar.call(this,e,"keydown keyup",(i=>{if(![32,38,39,40].includes(i.which))return;if(i.preventDefault(),i.stopPropagation(),"keydown"===i.type)return;const n=yr(e,'[role="menuitemradio"]');if(!n&&[32,39].includes(i.which))Xr.showMenuPanel.call(this,t,!0);else{let t;32!==i.which&&(40===i.which||n&&39===i.which?(t=e.nextElementSibling,Ys(t)||(t=e.parentNode.firstElementChild)):(t=e.previousElementSibling,Ys(t)||(t=e.parentNode.lastElementChild)),wr.call(this,t,!0))}}),!1),Ar.call(this,e,"keyup",(e=>{13===e.which&&Xr.focusFirstMenuItem.call(this,null,!0)}))},createMenuItem({value:e,list:t,type:i,title:n,badge:s=null,checked:r=!1}){const a=pr(this.config.selectors.inputs[i]),o=lr("button",rr(a,{type:"button",role:"menuitemradio",class:`${this.config.classNames.control} ${a.class?a.class:""}`.trim(),"aria-checked":r,value:e})),l=lr("span");l.innerHTML=n,Ys(s)&&l.appendChild(s),o.appendChild(l),Object.defineProperty(o,"checked",{enumerable:!0,get:()=>"true"===o.getAttribute("aria-checked"),set(e){e&&Array.from(o.parentNode.children).filter((e=>yr(e,'[role="menuitemradio"]'))).forEach((e=>e.setAttribute("aria-checked","false"))),o.setAttribute("aria-checked",e?"true":"false")}}),this.listeners.bind(o,"click keyup",(t=>{if(!Xs(t)||32===t.which){switch(t.preventDefault(),t.stopPropagation(),o.checked=!0,i){case"language":this.currentTrack=Number(e);break;case"quality":this.quality=e;break;case"speed":this.speed=parseFloat(e)}Xr.showMenuPanel.call(this,"home",Xs(t))}}),i,!1),Xr.bindMenuItemShortcuts.call(this,o,i),t.appendChild(o)},formatTime(e=0,t=!1){if(!Hs(e))return e;return Gr(e,Yr(this.duration)>0,t)},updateTimeDisplay(e=null,t=0,i=!1){Ys(e)&&Hs(t)&&(e.innerText=Xr.formatTime(t,i))},updateVolume(){this.supported.ui&&(Ys(this.elements.inputs.volume)&&Xr.setRange.call(this,this.elements.inputs.volume,this.muted?0:this.volume),Ys(this.elements.buttons.mute)&&(this.elements.buttons.mute.pressed=this.muted||0===this.volume))},setRange(e,t=0){Ys(e)&&(e.value=t,Xr.updateRangeFill.call(this,e))},updateProgress(e){if(!this.supported.ui||!Gs(e))return;let t=0;const i=(e,t)=>{const i=Hs(t)?t:0,n=Ys(e)?e:this.elements.display.buffer;if(Ys(n)){n.value=i;const e=n.getElementsByTagName("span")[0];Ys(e)&&(e.childNodes[0].nodeValue=i)}};if(e)switch(e.type){case"timeupdate":case"seeking":case"seeked":t=function(e,t){return 0===e||0===t||Number.isNaN(e)||Number.isNaN(t)?0:(e/t*100).toFixed(2)}(this.currentTime,this.duration),"timeupdate"===e.type&&Xr.setRange.call(this,this.elements.inputs.seek,t);break;case"playing":case"progress":i(this.elements.display.buffer,100*this.buffered)}},updateRangeFill(e){const t=Gs(e)?e.target:e;if(Ys(t)&&"range"===t.getAttribute("type")){if(yr(t,this.config.selectors.inputs.seek)){t.setAttribute("aria-valuenow",this.currentTime);const e=Xr.formatTime(this.currentTime),i=Xr.formatTime(this.duration),n=Vr.get("seekLabel",this.config);t.setAttribute("aria-valuetext",n.replace("{currentTime}",e).replace("{duration}",i))}else if(yr(t,this.config.selectors.inputs.volume)){const e=100*t.value;t.setAttribute("aria-valuenow",e),t.setAttribute("aria-valuetext",`${e.toFixed(1)}%`)}else t.setAttribute("aria-valuenow",t.value);nr.isWebkit&&t.style.setProperty("--value",t.value/t.max*100+"%")}},updateSeekTooltip(e){if(!this.config.tooltips.seek||!Ys(this.elements.inputs.seek)||!Ys(this.elements.display.seekTooltip)||0===this.duration)return;const t=`${this.config.classNames.tooltip}--visible`,i=e=>fr(this.elements.display.seekTooltip,t,e);if(this.touch)return void i(!1);let n=0;const s=this.elements.progress.getBoundingClientRect();if(Gs(e))n=100/s.width*(e.pageX-s.left);else{if(!gr(this.elements.display.seekTooltip,t))return;n=parseFloat(this.elements.display.seekTooltip.style.left,10)}n<0?n=0:n>100&&(n=100),Xr.updateTimeDisplay.call(this,this.elements.display.seekTooltip,this.duration/100*n),this.elements.display.seekTooltip.style.left=`${n}%`,Gs(e)&&["mouseenter","mouseleave"].includes(e.type)&&i("mouseenter"===e.type)},timeUpdate(e){const t=!Ys(this.elements.display.duration)&&this.config.invertTime;Xr.updateTimeDisplay.call(this,this.elements.display.currentTime,t?this.duration-this.currentTime:this.currentTime,t),e&&"timeupdate"===e.type&&this.media.seeking||Xr.updateProgress.call(this,e)},durationUpdate(){if(!this.supported.ui||!this.config.invertTime&&this.currentTime)return;if(this.duration>=2**32)return mr(this.elements.display.currentTime,!0),void mr(this.elements.progress,!0);Ys(this.elements.inputs.seek)&&this.elements.inputs.seek.setAttribute("aria-valuemax",this.duration);const e=Ys(this.elements.display.duration);!e&&this.config.displayDuration&&this.paused&&Xr.updateTimeDisplay.call(this,this.elements.display.currentTime,this.duration),e&&Xr.updateTimeDisplay.call(this,this.elements.display.duration,this.duration),Xr.updateSeekTooltip.call(this)},toggleMenuButton(e,t){mr(this.elements.settings.buttons[e],!t)},updateSetting(e,t,i){const n=this.elements.settings.panels[e];let s=null,r=t;if("captions"===e)s=this.currentTrack;else{if(s=er(i)?this[e]:i,er(s)&&(s=this.config[e].default),!er(this.options[e])&&!this.options[e].includes(s))return void this.debug.warn(`Unsupported value of '${s}' for ${e}`);if(!this.config[e].options.includes(s))return void this.debug.warn(`Disabled value of '${s}' for ${e}`)}if(Ys(r)||(r=n&&n.querySelector('[role="menu"]')),!Ys(r))return;this.elements.settings.buttons[e].querySelector(`.${this.config.classNames.menu.value}`).innerHTML=Xr.getLabel.call(this,e,s);const a=r&&r.querySelector(`[value="${s}"]`);Ys(a)&&(a.checked=!0)},getLabel(e,t){switch(e){case"speed":return 1===t?Vr.get("normal",this.config):`${t}&times;`;case"quality":if(Hs(t)){const e=Vr.get(`qualityLabel.${t}`,this.config);return e.length?e:`${t}p`}return Fr(t);case"captions":return Zr.getLabel.call(this);default:return null}},setQualityMenu(e){if(!Ys(this.elements.settings.panels.quality))return;const t="quality",i=this.elements.settings.panels.quality.querySelector('[role="menu"]');Ws(e)&&(this.options.quality=$r(e).filter((e=>this.config.quality.options.includes(e))));const n=!er(this.options.quality)&&this.options.quality.length>1;if(Xr.toggleMenuButton.call(this,t,n),hr(i),Xr.checkMenu.call(this),!n)return;const s=e=>{const t=Vr.get(`qualityBadge.${e}`,this.config);return t.length?Xr.createBadge.call(this,t):null};this.options.quality.sort(((e,t)=>{const i=this.config.quality.options;return i.indexOf(e)>i.indexOf(t)?1:-1})).forEach((e=>{Xr.createMenuItem.call(this,{value:e,list:i,type:t,title:Xr.getLabel.call(this,"quality",e),badge:s(e)})})),Xr.updateSetting.call(this,t,i)},setCaptionsMenu(){if(!Ys(this.elements.settings.panels.captions))return;const e="captions",t=this.elements.settings.panels.captions.querySelector('[role="menu"]'),i=Zr.getTracks.call(this),n=Boolean(i.length);if(Xr.toggleMenuButton.call(this,e,n),hr(t),Xr.checkMenu.call(this),!n)return;const s=i.map(((e,i)=>({value:i,checked:this.captions.toggled&&this.currentTrack===i,title:Zr.getLabel.call(this,e),badge:e.language&&Xr.createBadge.call(this,e.language.toUpperCase()),list:t,type:"language"})));s.unshift({value:-1,checked:!this.captions.toggled,title:Vr.get("disabled",this.config),list:t,type:"language"}),s.forEach(Xr.createMenuItem.bind(this)),Xr.updateSetting.call(this,e,t)},setSpeedMenu(){if(!Ys(this.elements.settings.panels.speed))return;const e="speed",t=this.elements.settings.panels.speed.querySelector('[role="menu"]');this.options.speed=this.options.speed.filter((e=>e>=this.minimumSpeed&&e<=this.maximumSpeed));const i=!er(this.options.speed)&&this.options.speed.length>1;Xr.toggleMenuButton.call(this,e,i),hr(t),Xr.checkMenu.call(this),i&&(this.options.speed.forEach((i=>{Xr.createMenuItem.call(this,{value:i,list:t,type:e,title:Xr.getLabel.call(this,"speed",i)})})),Xr.updateSetting.call(this,e,t))},checkMenu(){const{buttons:e}=this.elements.settings,t=!er(e)&&Object.values(e).some((e=>!e.hidden));mr(this.elements.settings.menu,!t)},focusFirstMenuItem(e,t=!1){if(this.elements.settings.popup.hidden)return;let i=e;Ys(i)||(i=Object.values(this.elements.settings.panels).find((e=>!e.hidden)));const n=i.querySelector('[role^="menuitem"]');wr.call(this,n,t)},toggleMenu(e){const{popup:t}=this.elements.settings,i=this.elements.buttons.settings;if(!Ys(t)||!Ys(i))return;const{hidden:n}=t;let s=n;if(Vs(e))s=e;else if(Xs(e)&&27===e.which)s=!1;else if(Gs(e)){const n=zs(e.composedPath)?e.composedPath()[0]:e.target,r=t.contains(n);if(r||!r&&e.target!==i&&s)return}i.setAttribute("aria-expanded",s),mr(t,!s),fr(this.elements.container,this.config.classNames.menu.open,s),s&&Xs(e)?Xr.focusFirstMenuItem.call(this,null,!0):s||n||wr.call(this,i,Xs(e))},getMenuSize(e){const t=e.cloneNode(!0);t.style.position="absolute",t.style.opacity=0,t.removeAttribute("hidden"),e.parentNode.appendChild(t);const i=t.scrollWidth,n=t.scrollHeight;return ur(t),{width:i,height:n}},showMenuPanel(e="",t=!1){const i=this.elements.container.querySelector(`#plyr-settings-${this.id}-${e}`);if(!Ys(i))return;const n=i.parentNode,s=Array.from(n.children).find((e=>!e.hidden));if(Tr.transitions&&!Tr.reducedMotion){n.style.width=`${s.scrollWidth}px`,n.style.height=`${s.scrollHeight}px`;const e=Xr.getMenuSize.call(this,i),t=e=>{e.target===n&&["width","height"].includes(e.propertyName)&&(n.style.width="",n.style.height="",Er.call(this,n,tr,t))};Ar.call(this,n,tr,t),n.style.width=`${e.width}px`,n.style.height=`${e.height}px`}mr(s,!0),mr(i,!1),Xr.focusFirstMenuItem.call(this,i,t)},setDownloadUrl(){const e=this.elements.buttons.download;Ys(e)&&e.setAttribute("href",this.download)},create(e){const{bindMenuItemShortcuts:t,createButton:i,createProgress:n,createRange:s,createTime:r,setQualityMenu:a,setSpeedMenu:o,showMenuPanel:l}=Xr;this.elements.controls=null,Ws(this.config.controls)&&this.config.controls.includes("play-large")&&this.elements.container.appendChild(i.call(this,"play-large"));const c=lr("div",pr(this.config.selectors.controls.wrapper));this.elements.controls=c;const u={class:"plyr__controls__item"};return $r(Ws(this.config.controls)?this.config.controls:[]).forEach((a=>{if("restart"===a&&c.appendChild(i.call(this,"restart",u)),"rewind"===a&&c.appendChild(i.call(this,"rewind",u)),"play"===a&&c.appendChild(i.call(this,"play",u)),"fast-forward"===a&&c.appendChild(i.call(this,"fast-forward",u)),"progress"===a){const t=lr("div",{class:`${u.class} plyr__progress__container`}),i=lr("div",pr(this.config.selectors.progress));if(i.appendChild(s.call(this,"seek",{id:`plyr-seek-${e.id}`})),i.appendChild(n.call(this,"buffer")),this.config.tooltips.seek){const e=lr("span",{class:this.config.classNames.tooltip},"00:00");i.appendChild(e),this.elements.display.seekTooltip=e}this.elements.progress=i,t.appendChild(this.elements.progress),c.appendChild(t)}if("current-time"===a&&c.appendChild(r.call(this,"currentTime",u)),"duration"===a&&c.appendChild(r.call(this,"duration",u)),"mute"===a||"volume"===a){let{volume:t}=this.elements;if(Ys(t)&&c.contains(t)||(t=lr("div",rr({},u,{class:`${u.class} plyr__volume`.trim()})),this.elements.volume=t,c.appendChild(t)),"mute"===a&&t.appendChild(i.call(this,"mute")),"volume"===a&&!nr.isIos){const i={max:1,step:.05,value:this.config.volume};t.appendChild(s.call(this,"volume",rr(i,{id:`plyr-volume-${e.id}`})))}}if("captions"===a&&c.appendChild(i.call(this,"captions",u)),"settings"===a&&!er(this.config.settings)){const n=lr("div",rr({},u,{class:`${u.class} plyr__menu`.trim(),hidden:""}));n.appendChild(i.call(this,"settings",{"aria-haspopup":!0,"aria-controls":`plyr-settings-${e.id}`,"aria-expanded":!1}));const s=lr("div",{class:"plyr__menu__container",id:`plyr-settings-${e.id}`,hidden:""}),r=lr("div"),a=lr("div",{id:`plyr-settings-${e.id}-home`}),o=lr("div",{role:"menu"});a.appendChild(o),r.appendChild(a),this.elements.settings.panels.home=a,this.config.settings.forEach((i=>{const n=lr("button",rr(pr(this.config.selectors.buttons.settings),{type:"button",class:`${this.config.classNames.control} ${this.config.classNames.control}--forward`,role:"menuitem","aria-haspopup":!0,hidden:""}));t.call(this,n,i),Ar.call(this,n,"click",(()=>{l.call(this,i,!1)}));const s=lr("span",null,Vr.get(i,this.config)),a=lr("span",{class:this.config.classNames.menu.value});a.innerHTML=e[i],s.appendChild(a),n.appendChild(s),o.appendChild(n);const c=lr("div",{id:`plyr-settings-${e.id}-${i}`,hidden:""}),u=lr("button",{type:"button",class:`${this.config.classNames.control} ${this.config.classNames.control}--back`});u.appendChild(lr("span",{"aria-hidden":!0},Vr.get(i,this.config))),u.appendChild(lr("span",{class:this.config.classNames.hidden},Vr.get("menuBack",this.config))),Ar.call(this,c,"keydown",(e=>{37===e.which&&(e.preventDefault(),e.stopPropagation(),l.call(this,"home",!0))}),!1),Ar.call(this,u,"click",(()=>{l.call(this,"home",!1)})),c.appendChild(u),c.appendChild(lr("div",{role:"menu"})),r.appendChild(c),this.elements.settings.buttons[i]=n,this.elements.settings.panels[i]=c})),s.appendChild(r),n.appendChild(s),c.appendChild(n),this.elements.settings.popup=s,this.elements.settings.menu=n}if("pip"===a&&Tr.pip&&c.appendChild(i.call(this,"pip",u)),"airplay"===a&&Tr.airplay&&c.appendChild(i.call(this,"airplay",u)),"download"===a){const e=rr({},u,{element:"a",href:this.download,target:"_blank"});this.isHTML5&&(e.download="");const{download:t}=this.config.urls;!Zs(t)&&this.isEmbed&&rr(e,{icon:`logo-${this.provider}`,label:this.provider}),c.appendChild(i.call(this,"download",e))}"fullscreen"===a&&c.appendChild(i.call(this,"fullscreen",u))})),this.isHTML5&&a.call(this,Rr.getQualityOptions.call(this)),o.call(this),c},inject(){if(this.config.loadSprite){const e=Xr.getIconUrl.call(this);e.cors&&Kr(e.url,"sprite-plyr")}this.id=Math.floor(1e4*Math.random());let e=null;this.elements.controls=null;const t={id:this.id,seektime:this.config.seekTime,title:this.config.title};let i=!0;zs(this.config.controls)&&(this.config.controls=this.config.controls.call(this,t)),this.config.controls||(this.config.controls=[]),Ys(this.config.controls)||Bs(this.config.controls)?e=this.config.controls:(e=Xr.create.call(this,{id:this.id,seektime:this.config.seekTime,speed:this.speed,quality:this.quality,captions:Zr.getLabel.call(this)}),i=!1);let n;i&&Bs(this.config.controls)&&(e=(e=>{let i=e;return Object.entries(t).forEach((([e,t])=>{i=Ur(i,`{${e}}`,t)})),i})(e)),Bs(this.config.selectors.controls.container)&&(n=document.querySelector(this.config.selectors.controls.container)),Ys(n)||(n=this.elements.container);if(n[Ys(e)?"insertAdjacentElement":"insertAdjacentHTML"]("afterbegin",e),Ys(this.elements.controls)||Xr.findElements.call(this),!er(this.elements.buttons)){const e=e=>{const t=this.config.classNames.controlPressed;Object.defineProperty(e,"pressed",{enumerable:!0,get:()=>gr(e,t),set(i=!1){fr(e,t,i)}})};Object.values(this.elements.buttons).filter(Boolean).forEach((t=>{Ws(t)||Ks(t)?Array.from(t).filter(Boolean).forEach(e):e(t)}))}if(nr.isEdge&&ir(n),this.config.tooltips.controls){const{classNames:e,selectors:t}=this.config,i=`${t.controls.wrapper} ${t.labels} .${e.hidden}`,n=br.call(this,i);Array.from(n).forEach((e=>{fr(e,this.config.classNames.hidden,!1),fr(e,this.config.classNames.tooltip,!0)}))}}};function Qr(e,t=!0){let i=e;if(t){const e=document.createElement("a");e.href=i,i=e.href}try{return new URL(i)}catch(e){return null}}function Jr(e){const t=new URLSearchParams;return Ds(e)&&Object.entries(e).forEach((([e,i])=>{t.set(e,i)})),t}const Zr={setup(){if(!this.supported.ui)return;if(!this.isVideo||this.isYouTube||this.isHTML5&&!Tr.textTracks)return void(Ws(this.config.controls)&&this.config.controls.includes("settings")&&this.config.settings.includes("captions")&&Xr.setCaptionsMenu.call(this));var e,t;if(Ys(this.elements.captions)||(this.elements.captions=lr("div",pr(this.config.selectors.captions)),e=this.elements.captions,t=this.elements.wrapper,Ys(e)&&Ys(t)&&t.parentNode.insertBefore(e,t.nextSibling)),nr.isIE&&window.URL){const e=this.media.querySelectorAll("track");Array.from(e).forEach((e=>{const t=e.getAttribute("src"),i=Qr(t);null!==i&&i.hostname!==window.location.href.hostname&&["http:","https:"].includes(i.protocol)&&Wr(t,"blob").then((t=>{e.setAttribute("src",window.URL.createObjectURL(t))})).catch((()=>{ur(e)}))}))}const i=$r((navigator.languages||[navigator.language||navigator.userLanguage||"en"]).map((e=>e.split("-")[0])));let n=(this.storage.get("language")||this.config.captions.language||"auto").toLowerCase();"auto"===n&&([n]=i);let s=this.storage.get("captions");if(Vs(s)||({active:s}=this.config.captions),Object.assign(this.captions,{toggled:!1,active:s,language:n,languages:i}),this.isHTML5){const e=this.config.captions.update?"addtrack removetrack":"removetrack";Ar.call(this,this.media.textTracks,e,Zr.update.bind(this))}setTimeout(Zr.update.bind(this),0)},update(){const e=Zr.getTracks.call(this,!0),{active:t,language:i,meta:n,currentTrackNode:s}=this.captions,r=Boolean(e.find((e=>e.language===i)));this.isHTML5&&this.isVideo&&e.filter((e=>!n.get(e))).forEach((e=>{this.debug.log("Track added",e),n.set(e,{default:"showing"===e.mode}),"showing"===e.mode&&(e.mode="hidden"),Ar.call(this,e,"cuechange",(()=>Zr.updateCues.call(this)))})),(r&&this.language!==i||!e.includes(s))&&(Zr.setLanguage.call(this,i),Zr.toggle.call(this,t&&r)),fr(this.elements.container,this.config.classNames.captions.enabled,!er(e)),Ws(this.config.controls)&&this.config.controls.includes("settings")&&this.config.settings.includes("captions")&&Xr.setCaptionsMenu.call(this)},toggle(e,t=!0){if(!this.supported.ui)return;const{toggled:i}=this.captions,n=this.config.classNames.captions.active,s=Fs(e)?!i:e;if(s!==i){if(t||(this.captions.active=s,this.storage.set({captions:s})),!this.language&&s&&!t){const e=Zr.getTracks.call(this),t=Zr.findTrack.call(this,[this.captions.language,...this.captions.languages],!0);return this.captions.language=t.language,void Zr.set.call(this,e.indexOf(t))}this.elements.buttons.captions&&(this.elements.buttons.captions.pressed=s),fr(this.elements.container,n,s),this.captions.toggled=s,Xr.updateSetting.call(this,"captions"),Lr.call(this,this.media,s?"captionsenabled":"captionsdisabled")}setTimeout((()=>{s&&this.captions.toggled&&(this.captions.currentTrackNode.mode="hidden")}))},set(e,t=!0){const i=Zr.getTracks.call(this);if(-1!==e)if(Hs(e))if(e in i){if(this.captions.currentTrack!==e){this.captions.currentTrack=e;const n=i[e],{language:s}=n||{};this.captions.currentTrackNode=n,Xr.updateSetting.call(this,"captions"),t||(this.captions.language=s,this.storage.set({language:s})),this.isVimeo&&this.embed.enableTextTrack(s),Lr.call(this,this.media,"languagechange")}Zr.toggle.call(this,!0,t),this.isHTML5&&this.isVideo&&Zr.updateCues.call(this)}else this.debug.warn("Track not found",e);else this.debug.warn("Invalid caption argument",e);else Zr.toggle.call(this,!1,t)},setLanguage(e,t=!0){if(!Bs(e))return void this.debug.warn("Invalid language argument",e);const i=e.toLowerCase();this.captions.language=i;const n=Zr.getTracks.call(this),s=Zr.findTrack.call(this,[i]);Zr.set.call(this,n.indexOf(s),t)},getTracks(e=!1){return Array.from((this.media||{}).textTracks||[]).filter((t=>!this.isHTML5||e||this.captions.meta.has(t))).filter((e=>["captions","subtitles"].includes(e.kind)))},findTrack(e,t=!1){const i=Zr.getTracks.call(this),n=e=>Number((this.captions.meta.get(e)||{}).default),s=Array.from(i).sort(((e,t)=>n(t)-n(e)));let r;return e.every((e=>(r=s.find((t=>t.language===e)),!r))),r||(t?s[0]:void 0)},getCurrentTrack(){return Zr.getTracks.call(this)[this.currentTrack]},getLabel(e){let t=e;return!Qs(t)&&Tr.textTracks&&this.captions.toggled&&(t=Zr.getCurrentTrack.call(this)),Qs(t)?er(t.label)?er(t.language)?Vr.get("enabled",this.config):e.language.toUpperCase():t.label:Vr.get("disabled",this.config)},updateCues(e){if(!this.supported.ui)return;if(!Ys(this.elements.captions))return void this.debug.warn("No captions element to render to");if(!Fs(e)&&!Array.isArray(e))return void this.debug.warn("updateCues: Invalid input",e);let t=e;if(!t){const e=Zr.getCurrentTrack.call(this);t=Array.from((e||{}).activeCues||[]).map((e=>e.getCueAsHTML())).map(Hr)}const i=t.map((e=>e.trim())).join("\n");if(i!==this.elements.captions.innerHTML){hr(this.elements.captions);const e=lr("span",pr(this.config.selectors.caption));e.innerHTML=i,this.elements.captions.appendChild(e),Lr.call(this,this.media,"cuechange")}}},ea={enabled:!0,title:"",debug:!1,autoplay:!1,autopause:!0,playsinline:!0,seekTime:10,volume:1,muted:!1,duration:null,displayDuration:!0,invertTime:!0,toggleInvert:!0,ratio:null,clickToPlay:!0,hideControls:!0,resetOnEnd:!1,disableContextMenu:!0,loadSprite:!0,iconPrefix:"plyr",iconUrl:"https://cdn.plyr.io/3.6.4/plyr.svg",blankVideo:"https://cdn.plyr.io/static/blank.mp4",quality:{default:576,options:[4320,2880,2160,1440,1080,720,576,480,360,240],forced:!1,onChange:null},loop:{active:!1},speed:{selected:1,options:[.5,.75,1,1.25,1.5,1.75,2,4]},keyboard:{focused:!0,global:!1},tooltips:{controls:!1,seek:!0},captions:{active:!1,language:"auto",update:!1},fullscreen:{enabled:!0,fallback:!0,iosNative:!1},storage:{enabled:!0,key:"plyr"},controls:["play-large","play","progress","current-time","mute","volume","captions","settings","pip","airplay","fullscreen"],settings:["captions","quality","speed"],i18n:{restart:"Restart",rewind:"Rewind {seektime}s",play:"Play",pause:"Pause",fastForward:"Forward {seektime}s",seek:"Seek",seekLabel:"{currentTime} of {duration}",played:"Played",buffered:"Buffered",currentTime:"Current time",duration:"Duration",volume:"Volume",mute:"Mute",unmute:"Unmute",enableCaptions:"Enable captions",disableCaptions:"Disable captions",download:"Download",enterFullscreen:"Enter fullscreen",exitFullscreen:"Exit fullscreen",frameTitle:"Player for {title}",captions:"Captions",settings:"Settings",pip:"PIP",menuBack:"Go back to previous menu",speed:"Speed",normal:"Normal",quality:"Quality",loop:"Loop",start:"Start",end:"End",all:"All",reset:"Reset",disabled:"Disabled",enabled:"Enabled",advertisement:"Ad",qualityBadge:{2160:"4K",1440:"HD",1080:"HD",720:"HD",576:"SD",480:"SD"}},urls:{download:null,vimeo:{sdk:"https://player.vimeo.com/api/player.js",iframe:"https://player.vimeo.com/video/{0}?{1}",api:"https://vimeo.com/api/oembed.json?url={0}"},youtube:{sdk:"https://www.youtube.com/iframe_api",api:"https://noembed.com/embed?url=https://www.youtube.com/watch?v={0}"},googleIMA:{sdk:"https://imasdk.googleapis.com/js/sdkloader/ima3.js"}},listeners:{seek:null,play:null,pause:null,restart:null,rewind:null,fastForward:null,mute:null,volume:null,captions:null,download:null,fullscreen:null,pip:null,airplay:null,speed:null,quality:null,loop:null,language:null},events:["ended","progress","stalled","playing","waiting","canplay","canplaythrough","loadstart","loadeddata","loadedmetadata","timeupdate","volumechange","play","pause","error","seeking","seeked","emptied","ratechange","cuechange","download","enterfullscreen","exitfullscreen","captionsenabled","captionsdisabled","languagechange","controlshidden","controlsshown","ready","statechange","qualitychange","adsloaded","adscontentpause","adscontentresume","adstarted","adsmidpoint","adscomplete","adsallcomplete","adsimpression","adsclick"],selectors:{editable:"input, textarea, select, [contenteditable]",container:".plyr",controls:{container:null,wrapper:".plyr__controls"},labels:"[data-plyr]",buttons:{play:'[data-plyr="play"]',pause:'[data-plyr="pause"]',restart:'[data-plyr="restart"]',rewind:'[data-plyr="rewind"]',fastForward:'[data-plyr="fast-forward"]',mute:'[data-plyr="mute"]',captions:'[data-plyr="captions"]',download:'[data-plyr="download"]',fullscreen:'[data-plyr="fullscreen"]',pip:'[data-plyr="pip"]',airplay:'[data-plyr="airplay"]',settings:'[data-plyr="settings"]',loop:'[data-plyr="loop"]'},inputs:{seek:'[data-plyr="seek"]',volume:'[data-plyr="volume"]',speed:'[data-plyr="speed"]',language:'[data-plyr="language"]',quality:'[data-plyr="quality"]'},display:{currentTime:".plyr__time--current",duration:".plyr__time--duration",buffer:".plyr__progress__buffer",loop:".plyr__progress__loop",volume:".plyr__volume--display"},progress:".plyr__progress",captions:".plyr__captions",caption:".plyr__caption"},classNames:{type:"plyr--{0}",provider:"plyr--{0}",video:"plyr__video-wrapper",embed:"plyr__video-embed",videoFixedRatio:"plyr__video-wrapper--fixed-ratio",embedContainer:"plyr__video-embed__container",poster:"plyr__poster",posterEnabled:"plyr__poster-enabled",ads:"plyr__ads",control:"plyr__control",controlPressed:"plyr__control--pressed",playing:"plyr--playing",paused:"plyr--paused",stopped:"plyr--stopped",loading:"plyr--loading",hover:"plyr--hover",tooltip:"plyr__tooltip",cues:"plyr__cues",hidden:"plyr__sr-only",hideControls:"plyr--hide-controls",isIos:"plyr--is-ios",isTouch:"plyr--is-touch",uiSupported:"plyr--full-ui",noTransition:"plyr--no-transition",display:{time:"plyr__time"},menu:{value:"plyr__menu__value",badge:"plyr__badge",open:"plyr--menu-open"},captions:{enabled:"plyr--captions-enabled",active:"plyr--captions-active"},fullscreen:{enabled:"plyr--fullscreen-enabled",fallback:"plyr--fullscreen-fallback"},pip:{supported:"plyr--pip-supported",active:"plyr--pip-active"},airplay:{supported:"plyr--airplay-supported",active:"plyr--airplay-active"},tabFocus:"plyr__tab-focus",previewThumbnails:{thumbContainer:"plyr__preview-thumb",thumbContainerShown:"plyr__preview-thumb--is-shown",imageContainer:"plyr__preview-thumb__image-container",timeContainer:"plyr__preview-thumb__time-container",scrubbingContainer:"plyr__preview-scrubbing",scrubbingContainerShown:"plyr__preview-scrubbing--is-shown"}},attributes:{embed:{provider:"data-plyr-provider",id:"data-plyr-embed-id"}},ads:{enabled:!1,publisherId:"",tagUrl:""},previewThumbnails:{enabled:!1,src:""},vimeo:{byline:!1,portrait:!1,title:!1,speed:!0,transparent:!1,customControls:!0,referrerPolicy:null,premium:!1},youtube:{rel:0,showinfo:0,iv_load_policy:3,modestbranding:1,customControls:!0,noCookie:!1}},ta="picture-in-picture",ia="inline",na={html5:"html5",youtube:"youtube",vimeo:"vimeo"},sa="audio",ra="video";const aa=()=>{};class oa{constructor(e=!1){this.enabled=window.console&&e,this.enabled&&this.log("Debugging enabled")}get log(){return this.enabled?Function.prototype.bind.call(console.log,console):aa}get warn(){return this.enabled?Function.prototype.bind.call(console.warn,console):aa}get error(){return this.enabled?Function.prototype.bind.call(console.error,console):aa}}class la{constructor(e){cs(this,"onChange",(()=>{if(!this.enabled)return;const e=this.player.elements.buttons.fullscreen;Ys(e)&&(e.pressed=this.active);const t=this.target===this.player.media?this.target:this.player.elements.container;Lr.call(this.player,t,this.active?"enterfullscreen":"exitfullscreen",!0)})),cs(this,"toggleFallback",((e=!1)=>{if(e?this.scrollPosition={x:window.scrollX||0,y:window.scrollY||0}:window.scrollTo(this.scrollPosition.x,this.scrollPosition.y),document.body.style.overflow=e?"hidden":"",fr(this.target,this.player.config.classNames.fullscreen.fallback,e),nr.isIos){let t=document.head.querySelector('meta[name="viewport"]');const i="viewport-fit=cover";t||(t=document.createElement("meta"),t.setAttribute("name","viewport"));const n=Bs(t.content)&&t.content.includes(i);e?(this.cleanupViewport=!n,n||(t.content+=`,${i}`)):this.cleanupViewport&&(t.content=t.content.split(",").filter((e=>e.trim()!==i)).join(","))}this.onChange()})),cs(this,"trapFocus",(e=>{if(nr.isIos||!this.active||"Tab"!==e.key||9!==e.keyCode)return;const t=document.activeElement,i=br.call(this.player,"a[href], button:not(:disabled), input:not(:disabled), [tabindex]"),[n]=i,s=i[i.length-1];t!==s||e.shiftKey?t===n&&e.shiftKey&&(s.focus(),e.preventDefault()):(n.focus(),e.preventDefault())})),cs(this,"update",(()=>{if(this.enabled){let e;e=this.forceFallback?"Fallback (forced)":la.native?"Native":"Fallback",this.player.debug.log(`${e} fullscreen enabled`)}else this.player.debug.log("Fullscreen not supported and fallback disabled");fr(this.player.elements.container,this.player.config.classNames.fullscreen.enabled,this.enabled)})),cs(this,"enter",(()=>{this.enabled&&(nr.isIos&&this.player.config.fullscreen.iosNative?this.player.isVimeo?this.player.embed.requestFullscreen():this.target.webkitEnterFullscreen():!la.native||this.forceFallback?this.toggleFallback(!0):this.prefix?er(this.prefix)||this.target[`${this.prefix}Request${this.property}`]():this.target.requestFullscreen({navigationUI:"hide"}))})),cs(this,"exit",(()=>{if(this.enabled)if(nr.isIos&&this.player.config.fullscreen.iosNative)this.target.webkitExitFullscreen(),Or(this.player.play());else if(!la.native||this.forceFallback)this.toggleFallback(!1);else if(this.prefix){if(!er(this.prefix)){const e="moz"===this.prefix?"Cancel":"Exit";document[`${this.prefix}${e}${this.property}`]()}}else(document.cancelFullScreen||document.exitFullscreen).call(document)})),cs(this,"toggle",(()=>{this.active?this.exit():this.enter()})),this.player=e,this.prefix=la.prefix,this.property=la.property,this.scrollPosition={x:0,y:0},this.forceFallback="force"===e.config.fullscreen.fallback,this.player.elements.fullscreen=e.config.fullscreen.container&&function(e,t){const{prototype:i}=Element;return(i.closest||function(){let e=this;do{if(yr.matches(e,t))return e;e=e.parentElement||e.parentNode}while(null!==e&&1===e.nodeType);return null}).call(e,t)}(this.player.elements.container,e.config.fullscreen.container),Ar.call(this.player,document,"ms"===this.prefix?"MSFullscreenChange":`${this.prefix}fullscreenchange`,(()=>{this.onChange()})),Ar.call(this.player,this.player.elements.container,"dblclick",(e=>{Ys(this.player.elements.controls)&&this.player.elements.controls.contains(e.target)||this.player.listeners.proxy(e,this.toggle,"fullscreen")})),Ar.call(this,this.player.elements.container,"keydown",(e=>this.trapFocus(e))),this.update()}static get native(){return!!(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled)}get usingNative(){return la.native&&!this.forceFallback}static get prefix(){if(zs(document.exitFullscreen))return"";let e="";return["webkit","moz","ms"].some((t=>!(!zs(document[`${t}ExitFullscreen`])&&!zs(document[`${t}CancelFullScreen`]))&&(e=t,!0))),e}static get property(){return"moz"===this.prefix?"FullScreen":"Fullscreen"}get enabled(){return(la.native||this.player.config.fullscreen.fallback)&&this.player.config.fullscreen.enabled&&this.player.supported.ui&&this.player.isVideo}get active(){if(!this.enabled)return!1;if(!la.native||this.forceFallback)return gr(this.target,this.player.config.classNames.fullscreen.fallback);const e=this.prefix?document[`${this.prefix}${this.property}Element`]:document.fullscreenElement;return e&&e.shadowRoot?e===this.target.getRootNode().host:e===this.target}get target(){return nr.isIos&&this.player.config.fullscreen.iosNative?this.player.media:this.player.elements.fullscreen||this.player.elements.container}}function ca(e,t=1){return new Promise(((i,n)=>{const s=new Image,r=()=>{delete s.onload,delete s.onerror,(s.naturalWidth>=t?i:n)(s)};Object.assign(s,{onload:r,onerror:r,src:e})}))}const ua={addStyleHook(){fr(this.elements.container,this.config.selectors.container.replace(".",""),!0),fr(this.elements.container,this.config.classNames.uiSupported,this.supported.ui)},toggleNativeControls(e=!1){e&&this.isHTML5?this.media.setAttribute("controls",""):this.media.removeAttribute("controls")},build(){if(this.listeners.media(),!this.supported.ui)return this.debug.warn(`Basic support only for ${this.provider} ${this.type}`),void ua.toggleNativeControls.call(this,!0);Ys(this.elements.controls)||(Xr.inject.call(this),this.listeners.controls()),ua.toggleNativeControls.call(this),this.isHTML5&&Zr.setup.call(this),this.volume=null,this.muted=null,this.loop=null,this.quality=null,this.speed=null,Xr.updateVolume.call(this),Xr.timeUpdate.call(this),ua.checkPlaying.call(this),fr(this.elements.container,this.config.classNames.pip.supported,Tr.pip&&this.isHTML5&&this.isVideo),fr(this.elements.container,this.config.classNames.airplay.supported,Tr.airplay&&this.isHTML5),fr(this.elements.container,this.config.classNames.isIos,nr.isIos),fr(this.elements.container,this.config.classNames.isTouch,this.touch),this.ready=!0,setTimeout((()=>{Lr.call(this,this.media,"ready")}),0),ua.setTitle.call(this),this.poster&&ua.setPoster.call(this,this.poster,!1).catch((()=>{})),this.config.duration&&Xr.durationUpdate.call(this)},setTitle(){let e=Vr.get("play",this.config);if(Bs(this.config.title)&&!er(this.config.title)&&(e+=`, ${this.config.title}`),Array.from(this.elements.buttons.play||[]).forEach((t=>{t.setAttribute("aria-label",e)})),this.isEmbed){const e=vr.call(this,"iframe");if(!Ys(e))return;const t=er(this.config.title)?"video":this.config.title,i=Vr.get("frameTitle",this.config);e.setAttribute("title",i.replace("{title}",t))}},togglePoster(e){fr(this.elements.container,this.config.classNames.posterEnabled,e)},setPoster(e,t=!0){return t&&this.poster?Promise.reject(new Error("Poster already set")):(this.media.setAttribute("data-poster",e),this.elements.poster.removeAttribute("hidden"),Ir.call(this).then((()=>ca(e))).catch((t=>{throw e===this.poster&&ua.togglePoster.call(this,!1),t})).then((()=>{if(e!==this.poster)throw new Error("setPoster cancelled by later call to setPoster")})).then((()=>(Object.assign(this.elements.poster.style,{backgroundImage:`url('${e}')`,backgroundSize:""}),ua.togglePoster.call(this,!0),e))))},checkPlaying(e){fr(this.elements.container,this.config.classNames.playing,this.playing),fr(this.elements.container,this.config.classNames.paused,this.paused),fr(this.elements.container,this.config.classNames.stopped,this.stopped),Array.from(this.elements.buttons.play||[]).forEach((e=>{Object.assign(e,{pressed:this.playing}),e.setAttribute("aria-label",Vr.get(this.playing?"pause":"play",this.config))})),Gs(e)&&"timeupdate"===e.type||ua.toggleControls.call(this)},checkLoading(e){this.loading=["stalled","waiting"].includes(e.type),clearTimeout(this.timers.loading),this.timers.loading=setTimeout((()=>{fr(this.elements.container,this.config.classNames.loading,this.loading),ua.toggleControls.call(this)}),this.loading?250:0)},toggleControls(e){const{controls:t}=this.elements;if(t&&this.config.hideControls){const i=this.touch&&this.lastSeekTime+2e3>Date.now();this.toggleControls(Boolean(e||this.loading||this.paused||t.pressed||t.hover||i))}},migrateStyles(){Object.values({...this.media.style}).filter((e=>!er(e)&&Bs(e)&&e.startsWith("--plyr"))).forEach((e=>{this.elements.container.style.setProperty(e,this.media.style.getPropertyValue(e)),this.media.style.removeProperty(e)})),er(this.media.style)&&this.media.removeAttribute("style")}};class ha{constructor(e){cs(this,"firstTouch",(()=>{const{player:e}=this,{elements:t}=e;e.touch=!0,fr(t.container,e.config.classNames.isTouch,!0)})),cs(this,"setTabFocus",(e=>{const{player:t}=this,{elements:i}=t;if(clearTimeout(this.focusTimer),"keydown"===e.type&&9!==e.which)return;"keydown"===e.type&&(this.lastKeyDown=e.timeStamp);const n=e.timeStamp-this.lastKeyDown<=20;("focus"!==e.type||n)&&((()=>{const e=t.config.classNames.tabFocus;fr(br.call(t,`.${e}`),e,!1)})(),"focusout"!==e.type&&(this.focusTimer=setTimeout((()=>{const e=document.activeElement;i.container.contains(e)&&fr(document.activeElement,t.config.classNames.tabFocus,!0)}),10)))})),cs(this,"global",((e=!0)=>{const{player:t}=this;t.config.keyboard.global&&Cr.call(t,window,"keydown keyup",this.handleKey,e,!1),Cr.call(t,document.body,"click",this.toggleMenu,e),Pr.call(t,document.body,"touchstart",this.firstTouch),Cr.call(t,document.body,"keydown focus blur focusout",this.setTabFocus,e,!1,!0)})),cs(this,"container",(()=>{const{player:e}=this,{config:t,elements:i,timers:n}=e;!t.keyboard.global&&t.keyboard.focused&&Ar.call(e,i.container,"keydown keyup",this.handleKey,!1),Ar.call(e,i.container,"mousemove mouseleave touchstart touchmove enterfullscreen exitfullscreen",(t=>{const{controls:s}=i;s&&"enterfullscreen"===t.type&&(s.pressed=!1,s.hover=!1);let r=0;["touchstart","touchmove","mousemove"].includes(t.type)&&(ua.toggleControls.call(e,!0),r=e.touch?3e3:2e3),clearTimeout(n.controls),n.controls=setTimeout((()=>ua.toggleControls.call(e,!1)),r)}));const s=t=>{if(!t)return jr.call(e);const n=i.container.getBoundingClientRect(),{width:s,height:r}=n;return jr.call(e,`${s}:${r}`)},r=()=>{clearTimeout(n.resized),n.resized=setTimeout(s,50)};Ar.call(e,i.container,"enterfullscreen exitfullscreen",(t=>{const{target:n,usingNative:a}=e.fullscreen;if(n!==i.container)return;if(!e.isEmbed&&er(e.config.ratio))return;const o="enterfullscreen"===t.type,{padding:l,ratio:c}=s(o);((t,i,n)=>{if(!e.isVimeo||e.config.vimeo.premium)return;const s=e.elements.wrapper.firstChild,[,r]=t,[a,o]=Nr.call(e);s.style.maxWidth=n?r/o*a+"px":null,s.style.margin=n?"0 auto":null})(c,0,o),o&&setTimeout((()=>ir(i.container)),100),a||(o?Ar.call(e,window,"resize",r):Er.call(e,window,"resize",r))}))})),cs(this,"media",(()=>{const{player:e}=this,{elements:t}=e;if(Ar.call(e,e.media,"timeupdate seeking seeked",(t=>Xr.timeUpdate.call(e,t))),Ar.call(e,e.media,"durationchange loadeddata loadedmetadata",(t=>Xr.durationUpdate.call(e,t))),Ar.call(e,e.media,"ended",(()=>{e.isHTML5&&e.isVideo&&e.config.resetOnEnd&&(e.restart(),e.pause())})),Ar.call(e,e.media,"progress playing seeking seeked",(t=>Xr.updateProgress.call(e,t))),Ar.call(e,e.media,"volumechange",(t=>Xr.updateVolume.call(e,t))),Ar.call(e,e.media,"playing play pause ended emptied timeupdate",(t=>ua.checkPlaying.call(e,t))),Ar.call(e,e.media,"waiting canplay seeked playing",(t=>ua.checkLoading.call(e,t))),e.supported.ui&&e.config.clickToPlay&&!e.isAudio){const i=vr.call(e,`.${e.config.classNames.video}`);if(!Ys(i))return;Ar.call(e,t.container,"click",(n=>{([t.container,i].includes(n.target)||i.contains(n.target))&&(e.touch&&e.config.hideControls||(e.ended?(this.proxy(n,e.restart,"restart"),this.proxy(n,(()=>{Or(e.play())}),"play")):this.proxy(n,(()=>{Or(e.togglePlay())}),"play")))}))}e.supported.ui&&e.config.disableContextMenu&&Ar.call(e,t.wrapper,"contextmenu",(e=>{e.preventDefault()}),!1),Ar.call(e,e.media,"volumechange",(()=>{e.storage.set({volume:e.volume,muted:e.muted})})),Ar.call(e,e.media,"ratechange",(()=>{Xr.updateSetting.call(e,"speed"),e.storage.set({speed:e.speed})})),Ar.call(e,e.media,"qualitychange",(t=>{Xr.updateSetting.call(e,"quality",null,t.detail.quality)})),Ar.call(e,e.media,"ready qualitychange",(()=>{Xr.setDownloadUrl.call(e)}));const i=e.config.events.concat(["keyup","keydown"]).join(" ");Ar.call(e,e.media,i,(i=>{let{detail:n={}}=i;"error"===i.type&&(n=e.media.error),Lr.call(e,t.container,i.type,!0,n)}))})),cs(this,"proxy",((e,t,i)=>{const{player:n}=this,s=n.config.listeners[i];let r=!0;zs(s)&&(r=s.call(n,e)),!1!==r&&zs(t)&&t.call(n,e)})),cs(this,"bind",((e,t,i,n,s=!0)=>{const{player:r}=this,a=r.config.listeners[n],o=zs(a);Ar.call(r,e,t,(e=>this.proxy(e,i,n)),s&&!o)})),cs(this,"controls",(()=>{const{player:e}=this,{elements:t}=e,i=nr.isIE?"change":"input";if(t.buttons.play&&Array.from(t.buttons.play).forEach((t=>{this.bind(t,"click",(()=>{Or(e.togglePlay())}),"play")})),this.bind(t.buttons.restart,"click",e.restart,"restart"),this.bind(t.buttons.rewind,"click",(()=>{e.lastSeekTime=Date.now(),e.rewind()}),"rewind"),this.bind(t.buttons.fastForward,"click",(()=>{e.lastSeekTime=Date.now(),e.forward()}),"fastForward"),this.bind(t.buttons.mute,"click",(()=>{e.muted=!e.muted}),"mute"),this.bind(t.buttons.captions,"click",(()=>e.toggleCaptions())),this.bind(t.buttons.download,"click",(()=>{Lr.call(e,e.media,"download")}),"download"),this.bind(t.buttons.fullscreen,"click",(()=>{e.fullscreen.toggle()}),"fullscreen"),this.bind(t.buttons.pip,"click",(()=>{e.pip="toggle"}),"pip"),this.bind(t.buttons.airplay,"click",e.airplay,"airplay"),this.bind(t.buttons.settings,"click",(t=>{t.stopPropagation(),t.preventDefault(),Xr.toggleMenu.call(e,t)}),null,!1),this.bind(t.buttons.settings,"keyup",(t=>{const i=t.which;[13,32].includes(i)&&(13!==i?(t.preventDefault(),t.stopPropagation(),Xr.toggleMenu.call(e,t)):Xr.focusFirstMenuItem.call(e,null,!0))}),null,!1),this.bind(t.settings.menu,"keydown",(t=>{27===t.which&&Xr.toggleMenu.call(e,t)})),this.bind(t.inputs.seek,"mousedown mousemove",(e=>{const i=t.progress.getBoundingClientRect(),n=100/i.width*(e.pageX-i.left);e.currentTarget.setAttribute("seek-value",n)})),this.bind(t.inputs.seek,"mousedown mouseup keydown keyup touchstart touchend",(t=>{const i=t.currentTarget,n=t.keyCode?t.keyCode:t.which,s="play-on-seeked";if(Xs(t)&&39!==n&&37!==n)return;e.lastSeekTime=Date.now();const r=i.hasAttribute(s),a=["mouseup","touchend","keyup"].includes(t.type);r&&a?(i.removeAttribute(s),Or(e.play())):!a&&e.playing&&(i.setAttribute(s,""),e.pause())})),nr.isIos){const t=br.call(e,'input[type="range"]');Array.from(t).forEach((e=>this.bind(e,i,(e=>ir(e.target)))))}this.bind(t.inputs.seek,i,(t=>{const i=t.currentTarget;let n=i.getAttribute("seek-value");er(n)&&(n=i.value),i.removeAttribute("seek-value"),e.currentTime=n/i.max*e.duration}),"seek"),this.bind(t.progress,"mouseenter mouseleave mousemove",(t=>Xr.updateSeekTooltip.call(e,t))),this.bind(t.progress,"mousemove touchmove",(t=>{const{previewThumbnails:i}=e;i&&i.loaded&&i.startMove(t)})),this.bind(t.progress,"mouseleave touchend click",(()=>{const{previewThumbnails:t}=e;t&&t.loaded&&t.endMove(!1,!0)})),this.bind(t.progress,"mousedown touchstart",(t=>{const{previewThumbnails:i}=e;i&&i.loaded&&i.startScrubbing(t)})),this.bind(t.progress,"mouseup touchend",(t=>{const{previewThumbnails:i}=e;i&&i.loaded&&i.endScrubbing(t)})),nr.isWebkit&&Array.from(br.call(e,'input[type="range"]')).forEach((t=>{this.bind(t,"input",(t=>Xr.updateRangeFill.call(e,t.target)))})),e.config.toggleInvert&&!Ys(t.display.duration)&&this.bind(t.display.currentTime,"click",(()=>{0!==e.currentTime&&(e.config.invertTime=!e.config.invertTime,Xr.timeUpdate.call(e))})),this.bind(t.inputs.volume,i,(t=>{e.volume=t.target.value}),"volume"),this.bind(t.controls,"mouseenter mouseleave",(i=>{t.controls.hover=!e.touch&&"mouseenter"===i.type})),t.fullscreen&&Array.from(t.fullscreen.children).filter((e=>!e.contains(t.container))).forEach((i=>{this.bind(i,"mouseenter mouseleave",(i=>{t.controls.hover=!e.touch&&"mouseenter"===i.type}))})),this.bind(t.controls,"mousedown mouseup touchstart touchend touchcancel",(e=>{t.controls.pressed=["mousedown","touchstart"].includes(e.type)})),this.bind(t.controls,"focusin",(()=>{const{config:i,timers:n}=e;fr(t.controls,i.classNames.noTransition,!0),ua.toggleControls.call(e,!0),setTimeout((()=>{fr(t.controls,i.classNames.noTransition,!1)}),0);const s=this.touch?3e3:4e3;clearTimeout(n.controls),n.controls=setTimeout((()=>ua.toggleControls.call(e,!1)),s)})),this.bind(t.inputs.volume,"wheel",(t=>{const i=t.webkitDirectionInvertedFromDevice,[n,s]=[t.deltaX,-t.deltaY].map((e=>i?-e:e)),r=Math.sign(Math.abs(n)>Math.abs(s)?n:s);e.increaseVolume(r/50);const{volume:a}=e.media;(1===r&&a<1||-1===r&&a>0)&&t.preventDefault()}),"volume",!1)})),this.player=e,this.lastKey=null,this.focusTimer=null,this.lastKeyDown=null,this.handleKey=this.handleKey.bind(this),this.toggleMenu=this.toggleMenu.bind(this),this.setTabFocus=this.setTabFocus.bind(this),this.firstTouch=this.firstTouch.bind(this)}handleKey(e){const{player:t}=this,{elements:i}=t,n=e.keyCode?e.keyCode:e.which,s="keydown"===e.type,r=s&&n===this.lastKey;if(e.altKey||e.ctrlKey||e.metaKey||e.shiftKey)return;if(!Hs(n))return;if(s){const s=document.activeElement;if(Ys(s)){const{editable:n}=t.config.selectors,{seek:r}=i.inputs;if(s!==r&&yr(s,n))return;if(32===e.which&&yr(s,'button, [role^="menuitem"]'))return}switch([32,37,38,39,40,48,49,50,51,52,53,54,56,57,67,70,73,75,76,77,79].includes(n)&&(e.preventDefault(),e.stopPropagation()),n){case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:r||(t.currentTime=t.duration/10*(n-48));break;case 32:case 75:r||Or(t.togglePlay());break;case 38:t.increaseVolume(.1);break;case 40:t.decreaseVolume(.1);break;case 77:r||(t.muted=!t.muted);break;case 39:t.forward();break;case 37:t.rewind();break;case 70:t.fullscreen.toggle();break;case 67:r||t.toggleCaptions();break;case 76:t.loop=!t.loop}27===n&&!t.fullscreen.usingNative&&t.fullscreen.active&&t.fullscreen.toggle(),this.lastKey=n}else this.lastKey=null}toggleMenu(e){Xr.toggleMenu.call(this.player,e)}}var da=o((function(e,t){e.exports=function(){var e=function(){},t={},i={},n={};function s(e,t){e=e.push?e:[e];var s,r,a,o=[],l=e.length,c=l;for(s=function(e,i){i.length&&o.push(e),--c||t(o)};l--;)r=e[l],(a=i[r])?s(r,a):(n[r]=n[r]||[]).push(s)}function r(e,t){if(e){var s=n[e];if(i[e]=t,s)for(;s.length;)s[0](e,t),s.splice(0,1)}}function a(t,i){t.call&&(t={success:t}),i.length?(t.error||e)(i):(t.success||e)(t)}function o(t,i,n,s){var r,a,l=document,c=n.async,u=(n.numRetries||0)+1,h=n.before||e,d=t.replace(/[\?|#].*$/,""),p=t.replace(/^(css|img)!/,"");s=s||0,/(^css!|\.css$)/.test(d)?((a=l.createElement("link")).rel="stylesheet",a.href=p,(r="hideFocus"in a)&&a.relList&&(r=0,a.rel="preload",a.as="style")):/(^img!|\.(png|gif|jpg|svg|webp)$)/.test(d)?(a=l.createElement("img")).src=p:((a=l.createElement("script")).src=t,a.async=void 0===c||c),a.onload=a.onerror=a.onbeforeload=function(e){var l=e.type[0];if(r)try{a.sheet.cssText.length||(l="e")}catch(e){18!=e.code&&(l="e")}if("e"==l){if((s+=1)<u)return o(t,i,n,s)}else if("preload"==a.rel&&"style"==a.as)return a.rel="stylesheet";i(t,l,e.defaultPrevented)},!1!==h(t,a)&&l.head.appendChild(a)}function l(e,t,i){var n,s,r=(e=e.push?e:[e]).length,a=r,l=[];for(n=function(e,i,n){if("e"==i&&l.push(e),"b"==i){if(!n)return;l.push(e)}--r||t(l)},s=0;s<a;s++)o(e[s],n,i)}function c(e,i,n){var s,o;if(i&&i.trim&&(s=i),o=(s?n:i)||{},s){if(s in t)throw"LoadJS";t[s]=!0}function c(t,i){l(e,(function(e){a(o,e),t&&a({success:t,error:i},e),r(s,e)}),o)}if(o.returnPromise)return new Promise(c);c()}return c.ready=function(e,t){return s(e,(function(e){a(t,e)})),c},c.done=function(e){r(e,[])},c.reset=function(){t={},i={},n={}},c.isDefined=function(e){return e in t},c}()}));function pa(e){return new Promise(((t,i)=>{da(e,{success:t,error:i})}))}function ma(e){e&&!this.embed.hasPlayed&&(this.embed.hasPlayed=!0),this.media.paused===e&&(this.media.paused=!e,Lr.call(this,this.media,e?"play":"pause"))}const fa={setup(){const e=this;fr(e.elements.wrapper,e.config.classNames.embed,!0),e.options.speed=e.config.speed.options,jr.call(e),Ds(window.Vimeo)?fa.ready.call(e):pa(e.config.urls.vimeo.sdk).then((()=>{fa.ready.call(e)})).catch((t=>{e.debug.warn("Vimeo SDK (player.js) failed to load",t)}))},ready(){const e=this,t=e.config.vimeo,{premium:i,referrerPolicy:n,...s}=t;i&&Object.assign(s,{controls:!1,sidedock:!1});const r=Jr({loop:e.config.loop.active,autoplay:e.autoplay,muted:e.muted,gesture:"media",playsinline:!this.config.fullscreen.iosNative,...s});let a=e.media.getAttribute("src");er(a)&&(a=e.media.getAttribute(e.config.attributes.embed.id));const o=er(l=a)?null:Hs(Number(l))?l:l.match(/^.*(vimeo.com\/|video\/)(\d+).*/)?RegExp.$2:l;var l;const c=lr("iframe"),u=qr(e.config.urls.vimeo.iframe,o,r);if(c.setAttribute("src",u),c.setAttribute("allowfullscreen",""),c.setAttribute("allow",["autoplay","fullscreen","picture-in-picture"].join("; ")),er(n)||c.setAttribute("referrerPolicy",n),i||!t.customControls)c.setAttribute("data-poster",e.poster),e.media=dr(c,e.media);else{const t=lr("div",{class:e.config.classNames.embedContainer,"data-poster":e.poster});t.appendChild(c),e.media=dr(t,e.media)}t.customControls||Wr(qr(e.config.urls.vimeo.api,u)).then((t=>{!er(t)&&t.thumbnail_url&&ua.setPoster.call(e,t.thumbnail_url).catch((()=>{}))})),e.embed=new window.Vimeo.Player(c,{autopause:e.config.autopause,muted:e.muted}),e.media.paused=!0,e.media.currentTime=0,e.supported.ui&&e.embed.disableTextTrack(),e.media.play=()=>(ma.call(e,!0),e.embed.play()),e.media.pause=()=>(ma.call(e,!1),e.embed.pause()),e.media.stop=()=>{e.pause(),e.currentTime=0};let{currentTime:h}=e.media;Object.defineProperty(e.media,"currentTime",{get:()=>h,set(t){const{embed:i,media:n,paused:s,volume:r}=e,a=s&&!i.hasPlayed;n.seeking=!0,Lr.call(e,n,"seeking"),Promise.resolve(a&&i.setVolume(0)).then((()=>i.setCurrentTime(t))).then((()=>a&&i.pause())).then((()=>a&&i.setVolume(r))).catch((()=>{}))}});let d=e.config.speed.selected;Object.defineProperty(e.media,"playbackRate",{get:()=>d,set(t){e.embed.setPlaybackRate(t).then((()=>{d=t,Lr.call(e,e.media,"ratechange")})).catch((()=>{e.options.speed=[1]}))}});let{volume:p}=e.config;Object.defineProperty(e.media,"volume",{get:()=>p,set(t){e.embed.setVolume(t).then((()=>{p=t,Lr.call(e,e.media,"volumechange")}))}});let{muted:m}=e.config;Object.defineProperty(e.media,"muted",{get:()=>m,set(t){const i=!!Vs(t)&&t;e.embed.setVolume(i?0:e.config.volume).then((()=>{m=i,Lr.call(e,e.media,"volumechange")}))}});let f,{loop:g}=e.config;Object.defineProperty(e.media,"loop",{get:()=>g,set(t){const i=Vs(t)?t:e.config.loop.active;e.embed.setLoop(i).then((()=>{g=i}))}}),e.embed.getVideoUrl().then((t=>{f=t,Xr.setDownloadUrl.call(e)})).catch((e=>{this.debug.warn(e)})),Object.defineProperty(e.media,"currentSrc",{get:()=>f}),Object.defineProperty(e.media,"ended",{get:()=>e.currentTime===e.duration}),Promise.all([e.embed.getVideoWidth(),e.embed.getVideoHeight()]).then((t=>{const[i,n]=t;e.embed.ratio=[i,n],jr.call(this)})),e.embed.setAutopause(e.config.autopause).then((t=>{e.config.autopause=t})),e.embed.getVideoTitle().then((t=>{e.config.title=t,ua.setTitle.call(this)})),e.embed.getCurrentTime().then((t=>{h=t,Lr.call(e,e.media,"timeupdate")})),e.embed.getDuration().then((t=>{e.media.duration=t,Lr.call(e,e.media,"durationchange")})),e.embed.getTextTracks().then((t=>{e.media.textTracks=t,Zr.setup.call(e)})),e.embed.on("cuechange",(({cues:t=[]})=>{const i=t.map((e=>function(e){const t=document.createDocumentFragment(),i=document.createElement("div");return t.appendChild(i),i.innerHTML=e,t.firstChild.innerText}(e.text)));Zr.updateCues.call(e,i)})),e.embed.on("loaded",(()=>{if(e.embed.getPaused().then((t=>{ma.call(e,!t),t||Lr.call(e,e.media,"playing")})),Ys(e.embed.element)&&e.supported.ui){e.embed.element.setAttribute("tabindex",-1)}})),e.embed.on("bufferstart",(()=>{Lr.call(e,e.media,"waiting")})),e.embed.on("bufferend",(()=>{Lr.call(e,e.media,"playing")})),e.embed.on("play",(()=>{ma.call(e,!0),Lr.call(e,e.media,"playing")})),e.embed.on("pause",(()=>{ma.call(e,!1)})),e.embed.on("timeupdate",(t=>{e.media.seeking=!1,h=t.seconds,Lr.call(e,e.media,"timeupdate")})),e.embed.on("progress",(t=>{e.media.buffered=t.percent,Lr.call(e,e.media,"progress"),1===parseInt(t.percent,10)&&Lr.call(e,e.media,"canplaythrough"),e.embed.getDuration().then((t=>{t!==e.media.duration&&(e.media.duration=t,Lr.call(e,e.media,"durationchange"))}))})),e.embed.on("seeked",(()=>{e.media.seeking=!1,Lr.call(e,e.media,"seeked")})),e.embed.on("ended",(()=>{e.media.paused=!0,Lr.call(e,e.media,"ended")})),e.embed.on("error",(t=>{e.media.error=t,Lr.call(e,e.media,"error")})),t.customControls&&setTimeout((()=>ua.build.call(e)),0)}};function ga(e){e&&!this.embed.hasPlayed&&(this.embed.hasPlayed=!0),this.media.paused===e&&(this.media.paused=!e,Lr.call(this,this.media,e?"play":"pause"))}function ya(e){return e.noCookie?"https://www.youtube-nocookie.com":"http:"===window.location.protocol?"http://www.youtube.com":void 0}const ba={setup(){if(fr(this.elements.wrapper,this.config.classNames.embed,!0),Ds(window.YT)&&zs(window.YT.Player))ba.ready.call(this);else{const e=window.onYouTubeIframeAPIReady;window.onYouTubeIframeAPIReady=()=>{zs(e)&&e(),ba.ready.call(this)},pa(this.config.urls.youtube.sdk).catch((e=>{this.debug.warn("YouTube API failed to load",e)}))}},getTitle(e){Wr(qr(this.config.urls.youtube.api,e)).then((e=>{if(Ds(e)){const{title:t,height:i,width:n}=e;this.config.title=t,ua.setTitle.call(this),this.embed.ratio=[n,i]}jr.call(this)})).catch((()=>{jr.call(this)}))},ready(){const e=this,t=e.config.youtube,i=e.media&&e.media.getAttribute("id");if(!er(i)&&i.startsWith("youtube-"))return;let n=e.media.getAttribute("src");er(n)&&(n=e.media.getAttribute(this.config.attributes.embed.id));const s=er(r=n)?null:r.match(/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=)([^#&?]*).*/)?RegExp.$2:r;var r;const a=lr("div",{id:`${e.provider}-${Math.floor(1e4*Math.random())}`,"data-poster":t.customControls?e.poster:void 0});if(e.media=dr(a,e.media),t.customControls){const t=e=>`https://i.ytimg.com/vi/${s}/${e}default.jpg`;ca(t("maxres"),121).catch((()=>ca(t("sd"),121))).catch((()=>ca(t("hq")))).then((t=>ua.setPoster.call(e,t.src))).then((t=>{t.includes("maxres")||(e.elements.poster.style.backgroundSize="cover")})).catch((()=>{}))}e.embed=new window.YT.Player(e.media,{videoId:s,host:ya(t),playerVars:rr({},{autoplay:e.config.autoplay?1:0,hl:e.config.hl,controls:e.supported.ui&&t.customControls?0:1,disablekb:1,playsinline:e.config.fullscreen.iosNative?0:1,cc_load_policy:e.captions.active?1:0,cc_lang_pref:e.config.captions.language,widget_referrer:window?window.location.href:null},t),events:{onError(t){if(!e.media.error){const i=t.data,n={2:"The request contains an invalid parameter value. For example, this error occurs if you specify a video ID that does not have 11 characters, or if the video ID contains invalid characters, such as exclamation points or asterisks.",5:"The requested content cannot be played in an HTML5 player or another error related to the HTML5 player has occurred.",100:"The video requested was not found. This error occurs when a video has been removed (for any reason) or has been marked as private.",101:"The owner of the requested video does not allow it to be played in embedded players.",150:"The owner of the requested video does not allow it to be played in embedded players."}[i]||"An unknown error occured";e.media.error={code:i,message:n},Lr.call(e,e.media,"error")}},onPlaybackRateChange(t){const i=t.target;e.media.playbackRate=i.getPlaybackRate(),Lr.call(e,e.media,"ratechange")},onReady(i){if(zs(e.media.play))return;const n=i.target;ba.getTitle.call(e,s),e.media.play=()=>{ga.call(e,!0),n.playVideo()},e.media.pause=()=>{ga.call(e,!1),n.pauseVideo()},e.media.stop=()=>{n.stopVideo()},e.media.duration=n.getDuration(),e.media.paused=!0,e.media.currentTime=0,Object.defineProperty(e.media,"currentTime",{get:()=>Number(n.getCurrentTime()),set(t){e.paused&&!e.embed.hasPlayed&&e.embed.mute(),e.media.seeking=!0,Lr.call(e,e.media,"seeking"),n.seekTo(t)}}),Object.defineProperty(e.media,"playbackRate",{get:()=>n.getPlaybackRate(),set(e){n.setPlaybackRate(e)}});let{volume:r}=e.config;Object.defineProperty(e.media,"volume",{get:()=>r,set(t){r=t,n.setVolume(100*r),Lr.call(e,e.media,"volumechange")}});let{muted:a}=e.config;Object.defineProperty(e.media,"muted",{get:()=>a,set(t){const i=Vs(t)?t:a;a=i,n[i?"mute":"unMute"](),n.setVolume(100*r),Lr.call(e,e.media,"volumechange")}}),Object.defineProperty(e.media,"currentSrc",{get:()=>n.getVideoUrl()}),Object.defineProperty(e.media,"ended",{get:()=>e.currentTime===e.duration});const o=n.getAvailablePlaybackRates();e.options.speed=o.filter((t=>e.config.speed.options.includes(t))),e.supported.ui&&t.customControls&&e.media.setAttribute("tabindex",-1),Lr.call(e,e.media,"timeupdate"),Lr.call(e,e.media,"durationchange"),clearInterval(e.timers.buffering),e.timers.buffering=setInterval((()=>{e.media.buffered=n.getVideoLoadedFraction(),(null===e.media.lastBuffered||e.media.lastBuffered<e.media.buffered)&&Lr.call(e,e.media,"progress"),e.media.lastBuffered=e.media.buffered,1===e.media.buffered&&(clearInterval(e.timers.buffering),Lr.call(e,e.media,"canplaythrough"))}),200),t.customControls&&setTimeout((()=>ua.build.call(e)),50)},onStateChange(i){const n=i.target;clearInterval(e.timers.playing);switch(e.media.seeking&&[1,2].includes(i.data)&&(e.media.seeking=!1,Lr.call(e,e.media,"seeked")),i.data){case-1:Lr.call(e,e.media,"timeupdate"),e.media.buffered=n.getVideoLoadedFraction(),Lr.call(e,e.media,"progress");break;case 0:ga.call(e,!1),e.media.loop?(n.stopVideo(),n.playVideo()):Lr.call(e,e.media,"ended");break;case 1:t.customControls&&!e.config.autoplay&&e.media.paused&&!e.embed.hasPlayed?e.media.pause():(ga.call(e,!0),Lr.call(e,e.media,"playing"),e.timers.playing=setInterval((()=>{Lr.call(e,e.media,"timeupdate")}),50),e.media.duration!==n.getDuration()&&(e.media.duration=n.getDuration(),Lr.call(e,e.media,"durationchange")));break;case 2:e.muted||e.embed.unMute(),ga.call(e,!1);break;case 3:Lr.call(e,e.media,"waiting")}Lr.call(e,e.elements.container,"statechange",!1,{code:i.data})}}})}},va={setup(){this.media?(fr(this.elements.container,this.config.classNames.type.replace("{0}",this.type),!0),fr(this.elements.container,this.config.classNames.provider.replace("{0}",this.provider),!0),this.isEmbed&&fr(this.elements.container,this.config.classNames.type.replace("{0}","video"),!0),this.isVideo&&(this.elements.wrapper=lr("div",{class:this.config.classNames.video}),ar(this.media,this.elements.wrapper),this.elements.poster=lr("div",{class:this.config.classNames.poster,hidden:""}),this.elements.wrapper.appendChild(this.elements.poster)),this.isHTML5?Rr.setup.call(this):this.isYouTube?ba.setup.call(this):this.isVimeo&&fa.setup.call(this)):this.debug.warn("No media element found!")}};class wa{constructor(e){cs(this,"load",(()=>{this.enabled&&(Ds(window.google)&&Ds(window.google.ima)?this.ready():pa(this.player.config.urls.googleIMA.sdk).then((()=>{this.ready()})).catch((()=>{this.trigger("error",new Error("Google IMA SDK failed to load"))})))})),cs(this,"ready",(()=>{var e;this.enabled||((e=this).manager&&e.manager.destroy(),e.elements.displayContainer&&e.elements.displayContainer.destroy(),e.elements.container.remove()),this.startSafetyTimer(12e3,"ready()"),this.managerPromise.then((()=>{this.clearSafetyTimer("onAdsManagerLoaded()")})),this.listeners(),this.setupIMA()})),cs(this,"setupIMA",(()=>{this.elements.container=lr("div",{class:this.player.config.classNames.ads}),this.player.elements.container.appendChild(this.elements.container),google.ima.settings.setVpaidMode(google.ima.ImaSdkSettings.VpaidMode.ENABLED),google.ima.settings.setLocale(this.player.config.ads.language),google.ima.settings.setDisableCustomPlaybackForIOS10Plus(this.player.config.playsinline),this.elements.displayContainer=new google.ima.AdDisplayContainer(this.elements.container,this.player.media),this.loader=new google.ima.AdsLoader(this.elements.displayContainer),this.loader.addEventListener(google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,(e=>this.onAdsManagerLoaded(e)),!1),this.loader.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,(e=>this.onAdError(e)),!1),this.requestAds()})),cs(this,"requestAds",(()=>{const{container:e}=this.player.elements;try{const t=new google.ima.AdsRequest;t.adTagUrl=this.tagUrl,t.linearAdSlotWidth=e.offsetWidth,t.linearAdSlotHeight=e.offsetHeight,t.nonLinearAdSlotWidth=e.offsetWidth,t.nonLinearAdSlotHeight=e.offsetHeight,t.forceNonLinearFullSlot=!1,t.setAdWillPlayMuted(!this.player.muted),this.loader.requestAds(t)}catch(e){this.onAdError(e)}})),cs(this,"pollCountdown",((e=!1)=>{if(!e)return clearInterval(this.countdownTimer),void this.elements.container.removeAttribute("data-badge-text");this.countdownTimer=setInterval((()=>{const e=Gr(Math.max(this.manager.getRemainingTime(),0)),t=`${Vr.get("advertisement",this.player.config)} - ${e}`;this.elements.container.setAttribute("data-badge-text",t)}),100)})),cs(this,"onAdsManagerLoaded",(e=>{if(!this.enabled)return;const t=new google.ima.AdsRenderingSettings;t.restoreCustomPlaybackStateOnAdBreakComplete=!0,t.enablePreloading=!0,this.manager=e.getAdsManager(this.player,t),this.cuePoints=this.manager.getCuePoints(),this.manager.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,(e=>this.onAdError(e))),Object.keys(google.ima.AdEvent.Type).forEach((e=>{this.manager.addEventListener(google.ima.AdEvent.Type[e],(e=>this.onAdEvent(e)))})),this.trigger("loaded")})),cs(this,"addCuePoints",(()=>{er(this.cuePoints)||this.cuePoints.forEach((e=>{if(0!==e&&-1!==e&&e<this.player.duration){const t=this.player.elements.progress;if(Ys(t)){const i=100/this.player.duration*e,n=lr("span",{class:this.player.config.classNames.cues});n.style.left=`${i.toString()}%`,t.appendChild(n)}}}))})),cs(this,"onAdEvent",(e=>{const{container:t}=this.player.elements,i=e.getAd(),n=e.getAdData();switch((e=>{Lr.call(this.player,this.player.media,`ads${e.replace(/_/g,"").toLowerCase()}`)})(e.type),e.type){case google.ima.AdEvent.Type.LOADED:this.trigger("loaded"),this.pollCountdown(!0),i.isLinear()||(i.width=t.offsetWidth,i.height=t.offsetHeight);break;case google.ima.AdEvent.Type.STARTED:this.manager.setVolume(this.player.volume);break;case google.ima.AdEvent.Type.ALL_ADS_COMPLETED:this.player.ended?this.loadAds():this.loader.contentComplete();break;case google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED:this.pauseContent();break;case google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED:this.pollCountdown(),this.resumeContent();break;case google.ima.AdEvent.Type.LOG:n.adError&&this.player.debug.warn(`Non-fatal ad error: ${n.adError.getMessage()}`)}})),cs(this,"onAdError",(e=>{this.cancel(),this.player.debug.warn("Ads error",e)})),cs(this,"listeners",(()=>{const{container:e}=this.player.elements;let t;this.player.on("canplay",(()=>{this.addCuePoints()})),this.player.on("ended",(()=>{this.loader.contentComplete()})),this.player.on("timeupdate",(()=>{t=this.player.currentTime})),this.player.on("seeked",(()=>{const e=this.player.currentTime;er(this.cuePoints)||this.cuePoints.forEach(((i,n)=>{t<i&&i<e&&(this.manager.discardAdBreak(),this.cuePoints.splice(n,1))}))})),window.addEventListener("resize",(()=>{this.manager&&this.manager.resize(e.offsetWidth,e.offsetHeight,google.ima.ViewMode.NORMAL)}))})),cs(this,"play",(()=>{const{container:e}=this.player.elements;this.managerPromise||this.resumeContent(),this.managerPromise.then((()=>{this.manager.setVolume(this.player.volume),this.elements.displayContainer.initialize();try{this.initialized||(this.manager.init(e.offsetWidth,e.offsetHeight,google.ima.ViewMode.NORMAL),this.manager.start()),this.initialized=!0}catch(e){this.onAdError(e)}})).catch((()=>{}))})),cs(this,"resumeContent",(()=>{this.elements.container.style.zIndex="",this.playing=!1,Or(this.player.media.play())})),cs(this,"pauseContent",(()=>{this.elements.container.style.zIndex=3,this.playing=!0,this.player.media.pause()})),cs(this,"cancel",(()=>{this.initialized&&this.resumeContent(),this.trigger("error"),this.loadAds()})),cs(this,"loadAds",(()=>{this.managerPromise.then((()=>{this.manager&&this.manager.destroy(),this.managerPromise=new Promise((e=>{this.on("loaded",e),this.player.debug.log(this.manager)})),this.initialized=!1,this.requestAds()})).catch((()=>{}))})),cs(this,"trigger",((e,...t)=>{const i=this.events[e];Ws(i)&&i.forEach((e=>{zs(e)&&e.apply(this,t)}))})),cs(this,"on",((e,t)=>(Ws(this.events[e])||(this.events[e]=[]),this.events[e].push(t),this))),cs(this,"startSafetyTimer",((e,t)=>{this.player.debug.log(`Safety timer invoked from: ${t}`),this.safetyTimer=setTimeout((()=>{this.cancel(),this.clearSafetyTimer("startSafetyTimer()")}),e)})),cs(this,"clearSafetyTimer",(e=>{Fs(this.safetyTimer)||(this.player.debug.log(`Safety timer cleared from: ${e}`),clearTimeout(this.safetyTimer),this.safetyTimer=null)})),this.player=e,this.config=e.config.ads,this.playing=!1,this.initialized=!1,this.elements={container:null,displayContainer:null},this.manager=null,this.loader=null,this.cuePoints=null,this.events={},this.safetyTimer=null,this.countdownTimer=null,this.managerPromise=new Promise(((e,t)=>{this.on("loaded",e),this.on("error",t)})),this.load()}get enabled(){const{config:e}=this;return this.player.isHTML5&&this.player.isVideo&&e.enabled&&(!er(e.publisherId)||Zs(e.tagUrl))}get tagUrl(){const{config:e}=this;if(Zs(e.tagUrl))return e.tagUrl;return`https://go.aniview.com/api/adserver6/vast/?${Jr({AV_PUBLISHERID:"58c25bb0073ef448b1087ad6",AV_CHANNELID:"5a0458dc28a06145e4519d21",AV_URL:window.location.hostname,cb:Date.now(),AV_WIDTH:640,AV_HEIGHT:480,AV_CDIM2:e.publisherId})}`}}const ka=e=>{const t=[];return e.split(/\r\n\r\n|\n\n|\r\r/).forEach((e=>{const i={};e.split(/\r\n|\n|\r/).forEach((e=>{if(Hs(i.startTime)){if(!er(e.trim())&&er(i.text)){const t=e.trim().split("#xywh=");[i.text]=t,t[1]&&([i.x,i.y,i.w,i.h]=t[1].split(","))}}else{const t=e.match(/([0-9]{2})?:?([0-9]{2}):([0-9]{2}).([0-9]{2,3})( ?--> ?)([0-9]{2})?:?([0-9]{2}):([0-9]{2}).([0-9]{2,3})/);t&&(i.startTime=60*Number(t[1]||0)*60+60*Number(t[2])+Number(t[3])+Number(`0.${t[4]}`),i.endTime=60*Number(t[6]||0)*60+60*Number(t[7])+Number(t[8])+Number(`0.${t[9]}`))}})),i.text&&t.push(i)})),t},Ta=(e,t)=>{const i={};return e>t.width/t.height?(i.width=t.width,i.height=1/e*t.width):(i.height=t.height,i.width=e*t.height),i};class Sa{constructor(e){cs(this,"load",(()=>{this.player.elements.display.seekTooltip&&(this.player.elements.display.seekTooltip.hidden=this.enabled),this.enabled&&this.getThumbnails().then((()=>{this.enabled&&(this.render(),this.determineContainerAutoSizing(),this.loaded=!0)}))})),cs(this,"getThumbnails",(()=>new Promise((e=>{const{src:t}=this.player.config.previewThumbnails;if(er(t))throw new Error("Missing previewThumbnails.src config attribute");const i=()=>{this.thumbnails.sort(((e,t)=>e.height-t.height)),this.player.debug.log("Preview thumbnails",this.thumbnails),e()};if(zs(t))t((e=>{this.thumbnails=e,i()}));else{const e=(Bs(t)?[t]:t).map((e=>this.getThumbnail(e)));Promise.all(e).then(i)}})))),cs(this,"getThumbnail",(e=>new Promise((t=>{Wr(e).then((i=>{const n={frames:ka(i),height:null,urlPrefix:""};n.frames[0].text.startsWith("/")||n.frames[0].text.startsWith("http://")||n.frames[0].text.startsWith("https://")||(n.urlPrefix=e.substring(0,e.lastIndexOf("/")+1));const s=new Image;s.onload=()=>{n.height=s.naturalHeight,n.width=s.naturalWidth,this.thumbnails.push(n),t()},s.src=n.urlPrefix+n.frames[0].text}))})))),cs(this,"startMove",(e=>{if(this.loaded&&Gs(e)&&["touchmove","mousemove"].includes(e.type)&&this.player.media.duration){if("touchmove"===e.type)this.seekTime=this.player.media.duration*(this.player.elements.inputs.seek.value/100);else{const t=this.player.elements.progress.getBoundingClientRect(),i=100/t.width*(e.pageX-t.left);this.seekTime=this.player.media.duration*(i/100),this.seekTime<0&&(this.seekTime=0),this.seekTime>this.player.media.duration-1&&(this.seekTime=this.player.media.duration-1),this.mousePosX=e.pageX,this.elements.thumb.time.innerText=Gr(this.seekTime)}this.showImageAtCurrentTime()}})),cs(this,"endMove",(()=>{this.toggleThumbContainer(!1,!0)})),cs(this,"startScrubbing",(e=>{(Fs(e.button)||!1===e.button||0===e.button)&&(this.mouseDown=!0,this.player.media.duration&&(this.toggleScrubbingContainer(!0),this.toggleThumbContainer(!1,!0),this.showImageAtCurrentTime()))})),cs(this,"endScrubbing",(()=>{this.mouseDown=!1,Math.ceil(this.lastTime)===Math.ceil(this.player.media.currentTime)?this.toggleScrubbingContainer(!1):Pr.call(this.player,this.player.media,"timeupdate",(()=>{this.mouseDown||this.toggleScrubbingContainer(!1)}))})),cs(this,"listeners",(()=>{this.player.on("play",(()=>{this.toggleThumbContainer(!1,!0)})),this.player.on("seeked",(()=>{this.toggleThumbContainer(!1)})),this.player.on("timeupdate",(()=>{this.lastTime=this.player.media.currentTime}))})),cs(this,"render",(()=>{this.elements.thumb.container=lr("div",{class:this.player.config.classNames.previewThumbnails.thumbContainer}),this.elements.thumb.imageContainer=lr("div",{class:this.player.config.classNames.previewThumbnails.imageContainer}),this.elements.thumb.container.appendChild(this.elements.thumb.imageContainer);const e=lr("div",{class:this.player.config.classNames.previewThumbnails.timeContainer});this.elements.thumb.time=lr("span",{},"00:00"),e.appendChild(this.elements.thumb.time),this.elements.thumb.container.appendChild(e),Ys(this.player.elements.progress)&&this.player.elements.progress.appendChild(this.elements.thumb.container),this.elements.scrubbing.container=lr("div",{class:this.player.config.classNames.previewThumbnails.scrubbingContainer}),this.player.elements.wrapper.appendChild(this.elements.scrubbing.container)})),cs(this,"destroy",(()=>{this.elements.thumb.container&&this.elements.thumb.container.remove(),this.elements.scrubbing.container&&this.elements.scrubbing.container.remove()})),cs(this,"showImageAtCurrentTime",(()=>{this.mouseDown?this.setScrubbingContainerSize():this.setThumbContainerSizeAndPos();const e=this.thumbnails[0].frames.findIndex((e=>this.seekTime>=e.startTime&&this.seekTime<=e.endTime)),t=e>=0;let i=0;this.mouseDown||this.toggleThumbContainer(t),t&&(this.thumbnails.forEach(((t,n)=>{this.loadedImages.includes(t.frames[e].text)&&(i=n)})),e!==this.showingThumb&&(this.showingThumb=e,this.loadImage(i)))})),cs(this,"loadImage",((e=0)=>{const t=this.showingThumb,i=this.thumbnails[e],{urlPrefix:n}=i,s=i.frames[t],r=i.frames[t].text,a=n+r;if(this.currentImageElement&&this.currentImageElement.dataset.filename===r)this.showImage(this.currentImageElement,s,e,t,r,!1),this.currentImageElement.dataset.index=t,this.removeOldImages(this.currentImageElement);else{this.loadingImage&&this.usingSprites&&(this.loadingImage.onload=null);const i=new Image;i.src=a,i.dataset.index=t,i.dataset.filename=r,this.showingThumbFilename=r,this.player.debug.log(`Loading image: ${a}`),i.onload=()=>this.showImage(i,s,e,t,r,!0),this.loadingImage=i,this.removeOldImages(i)}})),cs(this,"showImage",((e,t,i,n,s,r=!0)=>{this.player.debug.log(`Showing thumb: ${s}. num: ${n}. qual: ${i}. newimg: ${r}`),this.setImageSizeAndOffset(e,t),r&&(this.currentImageContainer.appendChild(e),this.currentImageElement=e,this.loadedImages.includes(s)||this.loadedImages.push(s)),this.preloadNearby(n,!0).then(this.preloadNearby(n,!1)).then(this.getHigherQuality(i,e,t,s))})),cs(this,"removeOldImages",(e=>{Array.from(this.currentImageContainer.children).forEach((t=>{if("img"!==t.tagName.toLowerCase())return;const i=this.usingSprites?500:1e3;if(t.dataset.index!==e.dataset.index&&!t.dataset.deleting){t.dataset.deleting=!0;const{currentImageContainer:e}=this;setTimeout((()=>{e.removeChild(t),this.player.debug.log(`Removing thumb: ${t.dataset.filename}`)}),i)}}))})),cs(this,"preloadNearby",((e,t=!0)=>new Promise((i=>{setTimeout((()=>{const n=this.thumbnails[0].frames[e].text;if(this.showingThumbFilename===n){let s;s=t?this.thumbnails[0].frames.slice(e):this.thumbnails[0].frames.slice(0,e).reverse();let r=!1;s.forEach((e=>{const t=e.text;if(t!==n&&!this.loadedImages.includes(t)){r=!0,this.player.debug.log(`Preloading thumb filename: ${t}`);const{urlPrefix:e}=this.thumbnails[0],n=e+t,s=new Image;s.src=n,s.onload=()=>{this.player.debug.log(`Preloaded thumb filename: ${t}`),this.loadedImages.includes(t)||this.loadedImages.push(t),i()}}})),r||i()}}),300)})))),cs(this,"getHigherQuality",((e,t,i,n)=>{if(e<this.thumbnails.length-1){let s=t.naturalHeight;this.usingSprites&&(s=i.h),s<this.thumbContainerHeight&&setTimeout((()=>{this.showingThumbFilename===n&&(this.player.debug.log(`Showing higher quality thumb for: ${n}`),this.loadImage(e+1))}),300)}})),cs(this,"toggleThumbContainer",((e=!1,t=!1)=>{const i=this.player.config.classNames.previewThumbnails.thumbContainerShown;this.elements.thumb.container.classList.toggle(i,e),!e&&t&&(this.showingThumb=null,this.showingThumbFilename=null)})),cs(this,"toggleScrubbingContainer",((e=!1)=>{const t=this.player.config.classNames.previewThumbnails.scrubbingContainerShown;this.elements.scrubbing.container.classList.toggle(t,e),e||(this.showingThumb=null,this.showingThumbFilename=null)})),cs(this,"determineContainerAutoSizing",(()=>{(this.elements.thumb.imageContainer.clientHeight>20||this.elements.thumb.imageContainer.clientWidth>20)&&(this.sizeSpecifiedInCSS=!0)})),cs(this,"setThumbContainerSizeAndPos",(()=>{if(this.sizeSpecifiedInCSS){if(this.elements.thumb.imageContainer.clientHeight>20&&this.elements.thumb.imageContainer.clientWidth<20){const e=Math.floor(this.elements.thumb.imageContainer.clientHeight*this.thumbAspectRatio);this.elements.thumb.imageContainer.style.width=`${e}px`}else if(this.elements.thumb.imageContainer.clientHeight<20&&this.elements.thumb.imageContainer.clientWidth>20){const e=Math.floor(this.elements.thumb.imageContainer.clientWidth/this.thumbAspectRatio);this.elements.thumb.imageContainer.style.height=`${e}px`}}else{const e=Math.floor(this.thumbContainerHeight*this.thumbAspectRatio);this.elements.thumb.imageContainer.style.height=`${this.thumbContainerHeight}px`,this.elements.thumb.imageContainer.style.width=`${e}px`}this.setThumbContainerPos()})),cs(this,"setThumbContainerPos",(()=>{const e=this.player.elements.progress.getBoundingClientRect(),t=this.player.elements.container.getBoundingClientRect(),{container:i}=this.elements.thumb,n=t.left-e.left+10,s=t.right-e.left-i.clientWidth-10;let r=this.mousePosX-e.left-i.clientWidth/2;r<n&&(r=n),r>s&&(r=s),i.style.left=`${r}px`})),cs(this,"setScrubbingContainerSize",(()=>{const{width:e,height:t}=Ta(this.thumbAspectRatio,{width:this.player.media.clientWidth,height:this.player.media.clientHeight});this.elements.scrubbing.container.style.width=`${e}px`,this.elements.scrubbing.container.style.height=`${t}px`})),cs(this,"setImageSizeAndOffset",((e,t)=>{if(!this.usingSprites)return;const i=this.thumbContainerHeight/t.h;e.style.height=e.naturalHeight*i+"px",e.style.width=e.naturalWidth*i+"px",e.style.left=`-${t.x*i}px`,e.style.top=`-${t.y*i}px`})),this.player=e,this.thumbnails=[],this.loaded=!1,this.lastMouseMoveTime=Date.now(),this.mouseDown=!1,this.loadedImages=[],this.elements={thumb:{},scrubbing:{}},this.load()}get enabled(){return this.player.isHTML5&&this.player.isVideo&&this.player.config.previewThumbnails.enabled}get currentImageContainer(){return this.mouseDown?this.elements.scrubbing.container:this.elements.thumb.imageContainer}get usingSprites(){return Object.keys(this.thumbnails[0].frames[0]).includes("w")}get thumbAspectRatio(){return this.usingSprites?this.thumbnails[0].frames[0].w/this.thumbnails[0].frames[0].h:this.thumbnails[0].width/this.thumbnails[0].height}get thumbContainerHeight(){if(this.mouseDown){const{height:e}=Ta(this.thumbAspectRatio,{width:this.player.media.clientWidth,height:this.player.media.clientHeight});return e}return this.sizeSpecifiedInCSS?this.elements.thumb.imageContainer.clientHeight:Math.floor(this.player.media.clientWidth/this.thumbAspectRatio/4)}get currentImageElement(){return this.mouseDown?this.currentScrubbingImageElement:this.currentThumbnailImageElement}set currentImageElement(e){this.mouseDown?this.currentScrubbingImageElement=e:this.currentThumbnailImageElement=e}}const Ca={insertElements(e,t){Bs(t)?cr(e,this.media,{src:t}):Ws(t)&&t.forEach((t=>{cr(e,this.media,t)}))},change(e){sr(e,"sources.length")?(Rr.cancelRequests.call(this),this.destroy.call(this,(()=>{this.options.quality=[],ur(this.media),this.media=null,Ys(this.elements.container)&&this.elements.container.removeAttribute("class");const{sources:t,type:i}=e,[{provider:n=na.html5,src:s}]=t,r="html5"===n?i:"div",a="html5"===n?{}:{src:s};Object.assign(this,{provider:n,type:i,supported:Tr.check(i,n,this.config.playsinline),media:lr(r,a)}),this.elements.container.appendChild(this.media),Vs(e.autoplay)&&(this.config.autoplay=e.autoplay),this.isHTML5&&(this.config.crossorigin&&this.media.setAttribute("crossorigin",""),this.config.autoplay&&this.media.setAttribute("autoplay",""),er(e.poster)||(this.poster=e.poster),this.config.loop.active&&this.media.setAttribute("loop",""),this.config.muted&&this.media.setAttribute("muted",""),this.config.playsinline&&this.media.setAttribute("playsinline","")),ua.addStyleHook.call(this),this.isHTML5&&Ca.insertElements.call(this,"source",t),this.config.title=e.title,va.setup.call(this),this.isHTML5&&Object.keys(e).includes("tracks")&&Ca.insertElements.call(this,"track",e.tracks),(this.isHTML5||this.isEmbed&&!this.supported.ui)&&ua.build.call(this),this.isHTML5&&this.media.load(),er(e.previewThumbnails)||(Object.assign(this.config.previewThumbnails,e.previewThumbnails),this.previewThumbnails&&this.previewThumbnails.loaded&&(this.previewThumbnails.destroy(),this.previewThumbnails=null),this.config.previewThumbnails.enabled&&(this.previewThumbnails=new Sa(this))),this.fullscreen.update()}),!0)):this.debug.warn("Invalid source format")}};class Aa{constructor(e,t){if(cs(this,"play",(()=>zs(this.media.play)?(this.ads&&this.ads.enabled&&this.ads.managerPromise.then((()=>this.ads.play())).catch((()=>Or(this.media.play()))),this.media.play()):null)),cs(this,"pause",(()=>this.playing&&zs(this.media.pause)?this.media.pause():null)),cs(this,"togglePlay",(e=>(Vs(e)?e:!this.playing)?this.play():this.pause())),cs(this,"stop",(()=>{this.isHTML5?(this.pause(),this.restart()):zs(this.media.stop)&&this.media.stop()})),cs(this,"restart",(()=>{this.currentTime=0})),cs(this,"rewind",(e=>{this.currentTime-=Hs(e)?e:this.config.seekTime})),cs(this,"forward",(e=>{this.currentTime+=Hs(e)?e:this.config.seekTime})),cs(this,"increaseVolume",(e=>{const t=this.media.muted?0:this.volume;this.volume=t+(Hs(e)?e:0)})),cs(this,"decreaseVolume",(e=>{this.increaseVolume(-e)})),cs(this,"airplay",(()=>{Tr.airplay&&this.media.webkitShowPlaybackTargetPicker()})),cs(this,"toggleControls",(e=>{if(this.supported.ui&&!this.isAudio){const t=gr(this.elements.container,this.config.classNames.hideControls),i=void 0===e?void 0:!e,n=fr(this.elements.container,this.config.classNames.hideControls,i);if(n&&Ws(this.config.controls)&&this.config.controls.includes("settings")&&!er(this.config.settings)&&Xr.toggleMenu.call(this,!1),n!==t){const e=n?"controlshidden":"controlsshown";Lr.call(this,this.media,e)}return!n}return!1})),cs(this,"on",((e,t)=>{Ar.call(this,this.elements.container,e,t)})),cs(this,"once",((e,t)=>{Pr.call(this,this.elements.container,e,t)})),cs(this,"off",((e,t)=>{Er(this.elements.container,e,t)})),cs(this,"destroy",((e,t=!1)=>{if(!this.ready)return;const i=()=>{document.body.style.overflow="",this.embed=null,t?(Object.keys(this.elements).length&&(ur(this.elements.buttons.play),ur(this.elements.captions),ur(this.elements.controls),ur(this.elements.wrapper),this.elements.buttons.play=null,this.elements.captions=null,this.elements.controls=null,this.elements.wrapper=null),zs(e)&&e()):(xr.call(this),Rr.cancelRequests.call(this),dr(this.elements.original,this.elements.container),Lr.call(this,this.elements.original,"destroyed",!0),zs(e)&&e.call(this.elements.original),this.ready=!1,setTimeout((()=>{this.elements=null,this.media=null}),200))};this.stop(),clearTimeout(this.timers.loading),clearTimeout(this.timers.controls),clearTimeout(this.timers.resized),this.isHTML5?(ua.toggleNativeControls.call(this,!0),i()):this.isYouTube?(clearInterval(this.timers.buffering),clearInterval(this.timers.playing),null!==this.embed&&zs(this.embed.destroy)&&this.embed.destroy(),i()):this.isVimeo&&(null!==this.embed&&this.embed.unload().then(i),setTimeout(i,200))})),cs(this,"supports",(e=>Tr.mime.call(this,e))),this.timers={},this.ready=!1,this.loading=!1,this.failed=!1,this.touch=Tr.touch,this.media=e,Bs(this.media)&&(this.media=document.querySelectorAll(this.media)),(window.jQuery&&this.media instanceof jQuery||Ks(this.media)||Ws(this.media))&&(this.media=this.media[0]),this.config=rr({},ea,Aa.defaults,t||{},(()=>{try{return JSON.parse(this.media.getAttribute("data-plyr-config"))}catch(e){return{}}})()),this.elements={container:null,fullscreen:null,captions:null,buttons:{},display:{},progress:{},inputs:{},settings:{popup:null,menu:null,panels:{},buttons:{}}},this.captions={active:null,currentTrack:-1,meta:new WeakMap},this.fullscreen={active:!1},this.options={speed:[],quality:[]},this.debug=new oa(this.config.debug),this.debug.log("Config",this.config),this.debug.log("Support",Tr),Fs(this.media)||!Ys(this.media))return void this.debug.error("Setup failed: no suitable element passed");if(this.media.plyr)return void this.debug.warn("Target already setup");if(!this.config.enabled)return void this.debug.error("Setup failed: disabled by config");if(!Tr.check().api)return void this.debug.error("Setup failed: no support");const i=this.media.cloneNode(!0);i.autoplay=!1,this.elements.original=i;const n=this.media.tagName.toLowerCase();let s=null,r=null;switch(n){case"div":if(s=this.media.querySelector("iframe"),Ys(s)){if(r=Qr(s.getAttribute("src")),this.provider=function(e){return/^(https?:\/\/)?(www\.)?(youtube\.com|youtube-nocookie\.com|youtu\.?be)\/.+$/.test(e)?na.youtube:/^https?:\/\/player.vimeo.com\/video\/\d{0,9}(?=\b|\/)/.test(e)?na.vimeo:null}(r.toString()),this.elements.container=this.media,this.media=s,this.elements.container.className="",r.search.length){const e=["1","true"];e.includes(r.searchParams.get("autoplay"))&&(this.config.autoplay=!0),e.includes(r.searchParams.get("loop"))&&(this.config.loop.active=!0),this.isYouTube?(this.config.playsinline=e.includes(r.searchParams.get("playsinline")),this.config.youtube.hl=r.searchParams.get("hl")):this.config.playsinline=!0}}else this.provider=this.media.getAttribute(this.config.attributes.embed.provider),this.media.removeAttribute(this.config.attributes.embed.provider);if(er(this.provider)||!Object.values(na).includes(this.provider))return void this.debug.error("Setup failed: Invalid provider");this.type=ra;break;case"video":case"audio":this.type=n,this.provider=na.html5,this.media.hasAttribute("crossorigin")&&(this.config.crossorigin=!0),this.media.hasAttribute("autoplay")&&(this.config.autoplay=!0),(this.media.hasAttribute("playsinline")||this.media.hasAttribute("webkit-playsinline"))&&(this.config.playsinline=!0),this.media.hasAttribute("muted")&&(this.config.muted=!0),this.media.hasAttribute("loop")&&(this.config.loop.active=!0);break;default:return void this.debug.error("Setup failed: unsupported type")}this.supported=Tr.check(this.type,this.provider,this.config.playsinline),this.supported.api?(this.eventListeners=[],this.listeners=new ha(this),this.storage=new zr(this),this.media.plyr=this,Ys(this.elements.container)||(this.elements.container=lr("div",{tabindex:0}),ar(this.media,this.elements.container)),ua.migrateStyles.call(this),ua.addStyleHook.call(this),va.setup.call(this),this.config.debug&&Ar.call(this,this.elements.container,this.config.events.join(" "),(e=>{this.debug.log(`event: ${e.type}`)})),this.fullscreen=new la(this),(this.isHTML5||this.isEmbed&&!this.supported.ui)&&ua.build.call(this),this.listeners.container(),this.listeners.global(),this.config.ads.enabled&&(this.ads=new wa(this)),this.isHTML5&&this.config.autoplay&&this.once("canplay",(()=>Or(this.play()))),this.lastSeekTime=0,this.config.previewThumbnails.enabled&&(this.previewThumbnails=new Sa(this))):this.debug.error("Setup failed: no support")}get isHTML5(){return this.provider===na.html5}get isEmbed(){return this.isYouTube||this.isVimeo}get isYouTube(){return this.provider===na.youtube}get isVimeo(){return this.provider===na.vimeo}get isVideo(){return this.type===ra}get isAudio(){return this.type===sa}get playing(){return Boolean(this.ready&&!this.paused&&!this.ended)}get paused(){return Boolean(this.media.paused)}get stopped(){return Boolean(this.paused&&0===this.currentTime)}get ended(){return Boolean(this.media.ended)}set currentTime(e){if(!this.duration)return;const t=Hs(e)&&e>0;this.media.currentTime=t?Math.min(e,this.duration):0,this.debug.log(`Seeking to ${this.currentTime} seconds`)}get currentTime(){return Number(this.media.currentTime)}get buffered(){const{buffered:e}=this.media;return Hs(e)?e:e&&e.length&&this.duration>0?e.end(0)/this.duration:0}get seeking(){return Boolean(this.media.seeking)}get duration(){const e=parseFloat(this.config.duration),t=(this.media||{}).duration,i=Hs(t)&&t!==1/0?t:0;return e||i}set volume(e){let t=e;Bs(t)&&(t=Number(t)),Hs(t)||(t=this.storage.get("volume")),Hs(t)||({volume:t}=this.config),t>1&&(t=1),t<0&&(t=0),this.config.volume=t,this.media.volume=t,!er(e)&&this.muted&&t>0&&(this.muted=!1)}get volume(){return Number(this.media.volume)}set muted(e){let t=e;Vs(t)||(t=this.storage.get("muted")),Vs(t)||(t=this.config.muted),this.config.muted=t,this.media.muted=t}get muted(){return Boolean(this.media.muted)}get hasAudio(){return!this.isHTML5||(!!this.isAudio||(Boolean(this.media.mozHasAudio)||Boolean(this.media.webkitAudioDecodedByteCount)||Boolean(this.media.audioTracks&&this.media.audioTracks.length)))}set speed(e){let t=null;Hs(e)&&(t=e),Hs(t)||(t=this.storage.get("speed")),Hs(t)||(t=this.config.speed.selected);const{minimumSpeed:i,maximumSpeed:n}=this;t=function(e=0,t=0,i=255){return Math.min(Math.max(e,t),i)}(t,i,n),this.config.speed.selected=t,setTimeout((()=>{this.media.playbackRate=t}),0)}get speed(){return Number(this.media.playbackRate)}get minimumSpeed(){return this.isYouTube?Math.min(...this.options.speed):this.isVimeo?.5:.0625}get maximumSpeed(){return this.isYouTube?Math.max(...this.options.speed):this.isVimeo?2:16}set quality(e){const t=this.config.quality,i=this.options.quality;if(!i.length)return;let n=[!er(e)&&Number(e),this.storage.get("quality"),t.selected,t.default].find(Hs),s=!0;if(!i.includes(n)){const e=function(e,t){return Ws(e)&&e.length?e.reduce(((e,i)=>Math.abs(i-t)<Math.abs(e-t)?i:e)):null}(i,n);this.debug.warn(`Unsupported quality option: ${n}, using ${e} instead`),n=e,s=!1}t.selected=n,this.media.quality=n,s&&this.storage.set({quality:n})}get quality(){return this.media.quality}set loop(e){const t=Vs(e)?e:this.config.loop.active;this.config.loop.active=t,this.media.loop=t}get loop(){return Boolean(this.media.loop)}set source(e){Ca.change.call(this,e)}get source(){return this.media.currentSrc}get download(){const{download:e}=this.config.urls;return Zs(e)?e:this.source}set download(e){Zs(e)&&(this.config.urls.download=e,Xr.setDownloadUrl.call(this))}set poster(e){this.isVideo?ua.setPoster.call(this,e,!1).catch((()=>{})):this.debug.warn("Poster can only be set for video")}get poster(){return this.isVideo?this.media.getAttribute("poster")||this.media.getAttribute("data-poster"):null}get ratio(){if(!this.isVideo)return null;const e=Mr(Nr.call(this));return Ws(e)?e.join(":"):e}set ratio(e){this.isVideo?Bs(e)&&_r(e)?(this.config.ratio=e,jr.call(this)):this.debug.error(`Invalid aspect ratio specified (${e})`):this.debug.warn("Aspect ratio can only be set for video")}set autoplay(e){const t=Vs(e)?e:this.config.autoplay;this.config.autoplay=t}get autoplay(){return Boolean(this.config.autoplay)}toggleCaptions(e){Zr.toggle.call(this,e,!1)}set currentTrack(e){Zr.set.call(this,e,!1)}get currentTrack(){const{toggled:e,currentTrack:t}=this.captions;return e?t:-1}set language(e){Zr.setLanguage.call(this,e,!1)}get language(){return(Zr.getCurrentTrack.call(this)||{}).language}set pip(e){if(!Tr.pip)return;const t=Vs(e)?e:!this.pip;zs(this.media.webkitSetPresentationMode)&&this.media.webkitSetPresentationMode(t?ta:ia),zs(this.media.requestPictureInPicture)&&(!this.pip&&t?this.media.requestPictureInPicture():this.pip&&!t&&document.exitPictureInPicture())}get pip(){return Tr.pip?er(this.media.webkitPresentationMode)?this.media===document.pictureInPictureElement:this.media.webkitPresentationMode===ta:null}static supported(e,t,i){return Tr.check(e,t,i)}static loadSprite(e,t){return Kr(e,t)}static setup(e,t={}){let i=null;return Bs(e)?i=Array.from(document.querySelectorAll(e)):Ks(e)?i=Array.from(e):Ws(e)&&(i=e.filter(Ys)),er(i)?null:i.map((e=>new Aa(e,t)))}}var Ea;return Aa.defaults=(Ea=ea,JSON.parse(JSON.stringify(Ea))),Aa}));
classes/Admin.php CHANGED
@@ -52,7 +52,7 @@ class Admin{
52
  $enable_course_marketplace = (bool) tutils()->get_option('enable_course_marketplace');
53
 
54
  add_menu_page(__('Tutor LMS', 'tutor').$pro_text, __('Tutor LMS', 'tutor').$pro_text, 'manage_tutor_instructor', 'tutor', null,
55
- 'dashicons-welcome-learn-more', 2);
56
  add_submenu_page('tutor', __('Categories', 'tutor'), __('Categories', 'tutor'), 'manage_tutor', 'edit-tags.php?taxonomy=course-category&post_type='.$course_post_type, null );
57
 
58
  add_submenu_page('tutor', __('Tags', 'tutor'), __('Tags', 'tutor'), 'manage_tutor', 'edit-tags.php?taxonomy=course-tag&post_type='.$course_post_type, null );
52
  $enable_course_marketplace = (bool) tutils()->get_option('enable_course_marketplace');
53
 
54
  add_menu_page(__('Tutor LMS', 'tutor').$pro_text, __('Tutor LMS', 'tutor').$pro_text, 'manage_tutor_instructor', 'tutor', null,
55
+ 'data:image/svg+xml;base64,' . base64_encode('<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1139"><defs/><path fill-rule="evenodd" clip-rule="evenodd" d="M341.652 622.4c-23.412 0-43.222-19.8-43.222-43.2v-99c0-23.4 19.81-43.2 43.222-43.2 23.412 0 43.222 19.8 43.222 43.2v99c0 23.4-18.009 43.2-43.222 43.2 1.801 0 1.801 0 0 0zM655.01 622.4c-23.412 0-43.222-18-43.222-43.2v-99c0-23.4 19.81-43.2 43.222-43.2 23.412 0 43.222 19.8 43.222 43.2v99c0 25.2-19.81 43.2-43.222 43.2z" fill="#9DA2A8"/><path fill-rule="evenodd" clip-rule="evenodd" d="M255.204 406.4c18.009-37.8 54.028-63 95.449-63 61.231 1.8 108.055 52.2 106.254 113.4v203.4c3.602 21.6 23.412 37.8 45.023 34.2 18.009-1.8 32.416-16.2 34.217-34.2V455c-1.801-61.2 46.824-111.6 106.254-113.4 39.621 0 75.639 21.6 93.648 59.4 68.435 133.2 14.407 295.2-117.06 363.6C487.523 833 325.44 779 258.806 647.6c-39.62-75.6-39.62-165.6-3.602-241.2zM426.291 140h151.277v59.4c-25.212-5.4-52.226-9-77.439-9-25.213 0-50.426 3.6-75.639 7.2l1.801-57.6zm414.211 388.8c0-122.4-66.634-235.8-172.888-295.2V140h64.833c25.213 0 45.023-19.8 45.023-45s-21.611-45-45.023-45H271.413C246.2 51.8 226.39 71.6 226.39 96.8c0 25.2 19.81 45 45.023 45h66.633v91.8c-163.883 90-230.517 298.8-135.068 459 3.602 5.4-3.602-5.4 0 0C338.046 930.2 687.424 948.2 802.683 950c10.805 0 19.81-3.6 27.014-10.8 7.203-7.2 10.805-18 10.805-27V528.8z" fill="#9DA2A8"/></svg>'), 2);
56
  add_submenu_page('tutor', __('Categories', 'tutor'), __('Categories', 'tutor'), 'manage_tutor', 'edit-tags.php?taxonomy=course-category&post_type='.$course_post_type, null );
57
 
58
  add_submenu_page('tutor', __('Tags', 'tutor'), __('Tags', 'tutor'), 'manage_tutor', 'edit-tags.php?taxonomy=course-tag&post_type='.$course_post_type, null );
classes/Ajax.php CHANGED
@@ -104,6 +104,9 @@ class Ajax{
104
  $course_id = sanitize_text_field(tutor_utils()->avalue_dot('course_id', $_POST));
105
  $review = wp_kses_post(tutor_utils()->avalue_dot('review', $_POST));
106
 
 
 
 
107
  $user_id = get_current_user_id();
108
  $user = get_userdata($user_id);
109
  $date = date("Y-m-d H:i:s", tutor_time());
@@ -148,7 +151,7 @@ class Ajax{
148
  $comment_id = (int) $wpdb->insert_id;
149
  $review_ID = $comment_id;
150
 
151
- if ($comment_id && $rating){
152
  $result = $wpdb->insert( $wpdb->commentmeta, array(
153
  'comment_id' => $comment_id,
154
  'meta_key' => 'tutor_rating',
@@ -230,7 +233,7 @@ class Ajax{
230
  $user = get_userdata($user_id);
231
  $date = date("Y-m-d H:i:s", tutor_time());
232
 
233
- if(!tutils()->has_enrolled_content_access('question', $question_id)) {
234
  wp_send_json_error(array('message'=>__('Access Denied', 'tutor')));
235
  exit;
236
  }
104
  $course_id = sanitize_text_field(tutor_utils()->avalue_dot('course_id', $_POST));
105
  $review = wp_kses_post(tutor_utils()->avalue_dot('review', $_POST));
106
 
107
+ !$rating ? $rating = 0 : 0;
108
+ $rating>5 ? $rating = 5 : 0;
109
+
110
  $user_id = get_current_user_id();
111
  $user = get_userdata($user_id);
112
  $date = date("Y-m-d H:i:s", tutor_time());
151
  $comment_id = (int) $wpdb->insert_id;
152
  $review_ID = $comment_id;
153
 
154
+ if ($comment_id){
155
  $result = $wpdb->insert( $wpdb->commentmeta, array(
156
  'comment_id' => $comment_id,
157
  'meta_key' => 'tutor_rating',
233
  $user = get_userdata($user_id);
234
  $date = date("Y-m-d H:i:s", tutor_time());
235
 
236
+ if(!tutils()->has_enrolled_content_access('qa_question', $question_id)) {
237
  wp_send_json_error(array('message'=>__('Access Denied', 'tutor')));
238
  exit;
239
  }
classes/Utils.php CHANGED
@@ -6665,6 +6665,7 @@ class Utils {
6665
  ) );
6666
  break;
6667
  case 'review' :
 
6668
  $course_id = $wpdb->get_var( $wpdb->prepare(
6669
  "SELECT comment_post_ID
6670
  FROM {$wpdb->comments}
6665
  ) );
6666
  break;
6667
  case 'review' :
6668
+ case 'qa_question' :
6669
  $course_id = $wpdb->get_var( $wpdb->prepare(
6670
  "SELECT comment_post_ID
6671
  FROM {$wpdb->comments}
languages/tutor.pot CHANGED
@@ -189,79 +189,79 @@ msgstr ""
189
  msgid "If you like %1$s please leave us a %2$s rating. A huge thanks in advance!"
190
  msgstr ""
191
 
192
- #: classes/Ajax.php:62, classes/Ajax.php:112, classes/Ajax.php:176, classes/Ajax.php:234, classes/Ajax.php:287, classes/Ajax.php:329, classes/Ajax.php:350, classes/Ajax.php:448, classes/Ajax.php:524, classes/Course.php:369, classes/Course.php:404, classes/Course.php:610, classes/Course.php:661, classes/Course.php:698, classes/Course.php:711, classes/Instructor.php:244, classes/Lesson.php:110, classes/Lesson.php:149, classes/Lesson.php:211, classes/Quiz.php:140, classes/Quiz.php:470, classes/Quiz.php:507, classes/Quiz.php:597, classes/Quiz.php:643, classes/Quiz.php:687, classes/Quiz.php:726, classes/Quiz.php:749, classes/Quiz.php:845, classes/Quiz.php:868, classes/Quiz.php:889, classes/Quiz.php:1000, classes/Quiz.php:1045, classes/Quiz.php:1123, classes/Quiz.php:1183, classes/Quiz.php:1205, classes/Q_and_A.php:71, templates/dashboard/registration.php:11
193
  msgid "Access Denied"
194
  msgstr ""
195
 
196
- #: classes/Ajax.php:162
197
  msgid "Rating placed success"
198
  msgstr ""
199
 
200
- #: classes/Ajax.php:181
201
  msgid "Empty question title or body"
202
  msgstr ""
203
 
204
- #: classes/Ajax.php:213
205
  msgid "Question has been added successfully"
206
  msgstr ""
207
 
208
- #: classes/Ajax.php:223
209
  msgid "Please write answer"
210
  msgstr ""
211
 
212
- #: classes/Ajax.php:256
213
  msgid "Answer has been added successfully"
214
  msgstr ""
215
 
216
- #: classes/Ajax.php:277
217
  msgid "Course added to wish list"
218
  msgstr ""
219
 
220
- #: classes/Ajax.php:274
221
  msgid "Course removed from wish list"
222
  msgstr ""
223
 
224
- #: classes/Ajax.php:393, classes/Ajax.php:397
225
  msgid "ERROR:"
226
  msgstr ""
227
 
228
- #: classes/Ajax.php:397
229
  msgid "Username is required."
230
  msgstr ""
231
 
232
- #: classes/Ajax.php:434
233
  msgid "Announcement created successfully"
234
  msgstr ""
235
 
236
- #: classes/Ajax.php:435
237
  msgid "Announcement updated successfully"
238
  msgstr ""
239
 
240
- #: classes/Ajax.php:436
241
  msgid "Announcement creation failed"
242
  msgstr ""
243
 
244
- #: classes/Ajax.php:437
245
  msgid "Announcement update failed"
246
  msgstr ""
247
 
248
- #: classes/Ajax.php:466
249
  msgid "Course name required"
250
  msgstr ""
251
 
252
- #: classes/Ajax.php:471
253
  msgid "Announcement title required"
254
  msgstr ""
255
 
256
- #: classes/Ajax.php:475
257
  msgid "Announcement summary required"
258
  msgstr ""
259
 
260
- #: classes/Ajax.php:537
261
  msgid "Announcement delete failed"
262
  msgstr ""
263
 
264
- #: classes/Ajax.php:531
265
  msgid "Announcement deleted successfully"
266
  msgstr ""
267
 
189
  msgid "If you like %1$s please leave us a %2$s rating. A huge thanks in advance!"
190
  msgstr ""
191
 
192
+ #: classes/Ajax.php:62, classes/Ajax.php:115, classes/Ajax.php:179, classes/Ajax.php:237, classes/Ajax.php:290, classes/Ajax.php:332, classes/Ajax.php:353, classes/Ajax.php:451, classes/Ajax.php:527, classes/Course.php:369, classes/Course.php:404, classes/Course.php:610, classes/Course.php:661, classes/Course.php:698, classes/Course.php:711, classes/Instructor.php:244, classes/Lesson.php:110, classes/Lesson.php:149, classes/Lesson.php:211, classes/Quiz.php:140, classes/Quiz.php:470, classes/Quiz.php:507, classes/Quiz.php:597, classes/Quiz.php:643, classes/Quiz.php:687, classes/Quiz.php:726, classes/Quiz.php:749, classes/Quiz.php:845, classes/Quiz.php:868, classes/Quiz.php:889, classes/Quiz.php:1000, classes/Quiz.php:1045, classes/Quiz.php:1123, classes/Quiz.php:1183, classes/Quiz.php:1205, classes/Q_and_A.php:71, templates/dashboard/registration.php:11
193
  msgid "Access Denied"
194
  msgstr ""
195
 
196
+ #: classes/Ajax.php:165
197
  msgid "Rating placed success"
198
  msgstr ""
199
 
200
+ #: classes/Ajax.php:184
201
  msgid "Empty question title or body"
202
  msgstr ""
203
 
204
+ #: classes/Ajax.php:216
205
  msgid "Question has been added successfully"
206
  msgstr ""
207
 
208
+ #: classes/Ajax.php:226
209
  msgid "Please write answer"
210
  msgstr ""
211
 
212
+ #: classes/Ajax.php:259
213
  msgid "Answer has been added successfully"
214
  msgstr ""
215
 
216
+ #: classes/Ajax.php:280
217
  msgid "Course added to wish list"
218
  msgstr ""
219
 
220
+ #: classes/Ajax.php:277
221
  msgid "Course removed from wish list"
222
  msgstr ""
223
 
224
+ #: classes/Ajax.php:396, classes/Ajax.php:400
225
  msgid "ERROR:"
226
  msgstr ""
227
 
228
+ #: classes/Ajax.php:400
229
  msgid "Username is required."
230
  msgstr ""
231
 
232
+ #: classes/Ajax.php:437
233
  msgid "Announcement created successfully"
234
  msgstr ""
235
 
236
+ #: classes/Ajax.php:438
237
  msgid "Announcement updated successfully"
238
  msgstr ""
239
 
240
+ #: classes/Ajax.php:439
241
  msgid "Announcement creation failed"
242
  msgstr ""
243
 
244
+ #: classes/Ajax.php:440
245
  msgid "Announcement update failed"
246
  msgstr ""
247
 
248
+ #: classes/Ajax.php:469
249
  msgid "Course name required"
250
  msgstr ""
251
 
252
+ #: classes/Ajax.php:474
253
  msgid "Announcement title required"
254
  msgstr ""
255
 
256
+ #: classes/Ajax.php:478
257
  msgid "Announcement summary required"
258
  msgstr ""
259
 
260
+ #: classes/Ajax.php:540
261
  msgid "Announcement delete failed"
262
  msgstr ""
263
 
264
+ #: classes/Ajax.php:534
265
  msgid "Announcement deleted successfully"
266
  msgstr ""
267
 
readme.txt CHANGED
@@ -5,7 +5,7 @@ Tags: lms, course, elearning, education, learning management system
5
  Requires at least: 5.3
6
  Tested up to: 5.7
7
  Requires PHP: 7.0
8
- Stable tag: 1.8.6
9
  License: GPLv3
10
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
11
 
@@ -241,14 +241,24 @@ Tutor enables you to use any third party plugins without facing any compatibilit
241
 
242
  == Changelog ==
243
 
 
 
 
 
 
 
 
 
 
 
244
  = 1.8.6 - March 22, 2021 =
245
 
246
  New: Search assignments by Student Name
247
  New: Toast message added after evaluating assignments
248
- Fix: Disabling Content Drip email not working
249
- Fix: Announcement email sending limit issue fixed using queue
250
- Fix: Import quizzes not working for Windows users due to file type error
251
  Fix: Instructors profile photos were not saving in the WordPress admin panel
 
 
252
 
253
  = 1.8.5 - March 12, 2021 =
254
 
5
  Requires at least: 5.3
6
  Tested up to: 5.7
7
  Requires PHP: 7.0
8
+ Stable tag: 1.8.7
9
  License: GPLv3
10
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
11
 
241
 
242
  == Changelog ==
243
 
244
+ = 1.8.7 - April 01, 2021 =
245
+
246
+ Update: Improved Queuing system for Tutor LMS announcement and content drip email
247
+ Fix: Users were not able to answer to a Q&A
248
+ Fix: Custom player didn’t work for Vimeo
249
+ Fix: The user-submitted reviews for the first time didn’t show up
250
+ Fix: Line break in Quiz description not working
251
+ Fix: An instructor couldn’t see his/her own courses if the preview was disabled
252
+ Fix: Page not found for imported quizzes
253
+
254
  = 1.8.6 - March 22, 2021 =
255
 
256
  New: Search assignments by Student Name
257
  New: Toast message added after evaluating assignments
258
+ New: Updated process for sending Announcement and Content Drip emails
 
 
259
  Fix: Instructors profile photos were not saving in the WordPress admin panel
260
+ Fix: Import quizzes not working for Windows users due to file type error
261
+ Fix: Disabling Content Drip email not working
262
 
263
  = 1.8.5 - March 12, 2021 =
264
 
templates/single/quiz/body.php CHANGED
@@ -123,7 +123,7 @@ $attempt_remaining = $attempts_allowed - $attempted_count;
123
  echo '<p class="question-marks"> '.__('Marks : ', 'tutor').$question->question_mark.' </p>';
124
  }
125
 
126
- $question_description = stripslashes($question->question_description);
127
  if ($question_description){
128
  echo "<p class='question-description'>{$question_description}</p>";
129
  }
123
  echo '<p class="question-marks"> '.__('Marks : ', 'tutor').$question->question_mark.' </p>';
124
  }
125
 
126
+ $question_description = nl2br( stripslashes($question->question_description) );
127
  if ($question_description){
128
  echo "<p class='question-description'>{$question_description}</p>";
129
  }
tutor.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: Tutor LMS
4
  Plugin URI: https://www.themeum.com/product/tutor-lms/
5
  Description: Tutor is a complete solution for creating a Learning Management System in WordPress way. It can help you to create small to large scale online education site very conveniently. Power features like report, certificate, course preview, private file sharing make Tutor a robust plugin for any educational institutes.
6
  Author: Themeum
7
- Version: 1.8.6
8
  Author URI: https://themeum.com
9
  Requires at least: 4.5
10
  Tested up to: 5.7
@@ -17,7 +17,7 @@ if ( ! defined( 'ABSPATH' ) )
17
  /**
18
  * Defined the tutor main file
19
  */
20
- define( 'TUTOR_VERSION', '1.8.6' );
21
  define( 'TUTOR_FILE', __FILE__ );
22
 
23
  /**
4
  Plugin URI: https://www.themeum.com/product/tutor-lms/
5
  Description: Tutor is a complete solution for creating a Learning Management System in WordPress way. It can help you to create small to large scale online education site very conveniently. Power features like report, certificate, course preview, private file sharing make Tutor a robust plugin for any educational institutes.
6
  Author: Themeum
7
+ Version: 1.8.7
8
  Author URI: https://themeum.com
9
  Requires at least: 4.5
10
  Tested up to: 5.7
17
  /**
18
  * Defined the tutor main file
19
  */
20
+ define( 'TUTOR_VERSION', '1.8.7' );
21
  define( 'TUTOR_FILE', __FILE__ );
22
 
23
  /**