1import{q as Wn}from"./index-06f6d0af.js";import{g as Pn,r as xe}from"./react-f4fa6042.js";import"./vendor-2e8812bb.js";import"./utils-790bf987.js";var En={exports:{}};(function(n){var t=Object.prototype.hasOwnProperty,i="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(i=!1));function e(u,l,h){this.fn=u,this.context=l,this.once=h||!1}function o(u,l,h,f,d){if(typeof h!="function")throw new TypeError("The listener must be a function");var v=new e(h,f||u,d),y=i?i+l:l;return u._events[y]?u._events[y].fn?u._events[y]=[u._events[y],v]:u._events[y].push(v):(u._events[y]=v,u._eventsCount++),u}function a(u,l){--u._eventsCount===0?u._events=new r:delete u._events[l]}function s(){this._events=new r,this._eventsCount=0}s.prototype.eventNames=function(){var l=[],h,f;if(this._eventsCount===0)return l;for(f in h=this._events)t.call(h,f)&&l.push(i?f.slice(1):f);return Object.getOwnPropertySymbols?l.concat(Object.getOwnPropertySymbols(h)):l},s.prototype.listeners=function(l){var h=i?i+l:l,f=this._events[h];if(!f)return[];if(f.fn)return[f.fn];for(var d=0,v=f.length,y=new Array(v);d<v;d++)y[d]=f[d].fn;return y},s.prototype.listenerCount=function(l){var h=i?i+l:l,f=this._events[h];return f?f.fn?1:f.length:0},s.prototype.emit=function(l,h,f,d,v,y){var b=i?i+l:l;if(!this._events[b])return!1;var p=this._events[b],_=arguments.length,E,m;if(p.fn){switch(p.once&&this.removeListener(l,p.fn,void 0,!0),_){case 1:return p.fn.call(p.context),!0;case 2:return p.fn.call(p.context,h),!0;case 3:return p.fn.call(p.context,h,f),!0;case 4:return p.fn.call(p.context,h,f,d),!0;case 5:return p.fn.call(p.context,h,f,d,v),!0;case 6:return p.fn.call(p.context,h,f,d,v,y),!0}for(m=1,E=new Array(_-1);m<_;m++)E[m-1]=arguments[m];p.fn.apply(p.context,E)}else{var C=p.length,T;for(m=0;m<C;m++)switch(p[m].once&&this.removeListener(l,p[m].fn,void 0,!0),_){case 1:p[m].fn.call(p[m].context);break;case 2:p[m].fn.call(p[m].context,h);break;case 3:p[m].fn.call(p[m].context,h,f);break;case 4:p[m].fn.call(p[m].context,h,f,d);break;default:if(!E)for(T=1,E=new Array(_-1);T<_;T++)E[T-1]=arguments[T];p[m].fn.apply(p[m].context,E)}}return!0},s.prototype.on=function(l,h,f){return o(this,l,h,f,!1)},s.prototype.once=function(l,h,f){return o(this,l,h,f,!0)},s.prototype.removeListener=function(l,h,f,d){var v=i?i+l:l;if(!this._events[v])return this;if(!h)return a(this,v),this;var y=this._events[v];if(y.fn)y.fn===h&&(!d||y.once)&&(!f||y.context===f)&&a(this,v);else{for(var b=0,p=[],_=y.length;b<_;b++)(y[b].fn!==h||d&&!y[b].once||f&&y[b].context!==f)&&p.push(y[b]);p.length?this._events[v]=p.length===1?p[0]:p:a(this,v)}return this},s.prototype.removeAllListeners=function(l){var h;return l?(h=i?i+l:l,this._events[h]&&a(this,h)):(this._events=new r,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=i,s.EventEmitter=s,n.exports=s})(En);var On=En.exports;const Xn=Pn(On);var qn=JSON.parse('"3.0.0-alpha.146"');const ft=qn;var Jn=typeof window<"u"&&window.location&&window.location.href.indexOf("xgplayerdebugger=1")>-1,qe={info:"color: #525252; background-color: #90ee90;",error:"color: #525252; background-color: red;",warn:"color: #525252; background-color: yellow; "},Je="%c[xgplayer]",O={config:{debug:Jn?3:1},logInfo:function(t){for(var i,r=arguments.length,e=new Array(r>1?r-1:0),o=1;o<r;o++)e[o-1]=arguments[o];this.config.debug>=3&&(i=console).log.apply(i,[Je,qe.info,t].concat(e))},logWarn:function(t){for(var i,r=arguments.length,e=new Array(r>1?r-1:0),o=1;o<r;o++)e[o-1]=arguments[o];this.config.debug>=1&&(i=console).warn.apply(i,[Je,qe.warn,t].concat(e))},logError:function(t){var i;if(!(this.config.debug<1)){for(var r=this.config.debug>=2?"trace":"error",e=arguments.length,o=new Array(e>1?e-1:0),a=1;a<e;a++)o[a-1]=arguments[a];(i=console)[r].apply(i,[Je,qe.error,t].concat(o))}}};function Qn(n){n.logInfo=O.logInfo.bind(n),n.logWarn=O.logWarn.bind(n),n.logError=O.logError.bind(n)}function Ee(n){"@babel/helpers - typeof";return Ee=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ee(n)}function Zn(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function")}function xt(n,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(n,tr(r.key),r)}}function er(n,t,i){return t&&xt(n.prototype,t),i&&xt(n,i),Object.defineProperty(n,"prototype",{writable:!1}),n}function tr(n){var t=nr(n,"string");return Ee(t)==="symbol"?t:String(t)}function nr(n,t){if(Ee(n)!=="object"||n===null)return n;var i=n[Symbol.toPrimitive];if(i!==void 0){var r=i.call(n,t||"default");if(Ee(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(n)}var rr=function(){function n(t){Zn(this,n),this.bufferedList=t}return er(n,[{key:"start",value:function(i){return this.bufferedList[i].start}},{key:"end",value:function(i){return this.bufferedList[i].end}},{key:"length",get:function(){return this.bufferedList.length}}]),n}();function ir(n){return ur(n)||sr(n)||ar(n)||or()}function or(){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 ar(n,t){if(n){if(typeof n=="string")return ht(n,t);var i=Object.prototype.toString.call(n).slice(8,-1);if(i==="Object"&&n.constructor&&(i=n.constructor.name),i==="Map"||i==="Set")return Array.from(n);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return ht(n,t)}}function sr(n){if(typeof Symbol<"u"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function ur(n){if(Array.isArray(n))return ht(n)}function ht(n,t){(t==null||t>n.length)&&(t=n.length);for(var i=0,r=new Array(t);i<t;i++)r[i]=n[i];return r}function Z(n){"@babel/helpers - typeof";return Z=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Z(n)}var c={};c.createDom=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"div",t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"",e=document.createElement(n);
1return e.className=r,e.innerHTML=t,Object.keys(i).forEach(function(o){var a=o,s=i[o];n==="video"||n==="audio"||n==="live-video"?s&&e.setAttribute(a,s):e.setAttribute(a,s)}),e};c.createDomFromHtml=function(n){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"";try{var r=document.createElement("div");r.innerHTML=n;var e=r.children;return r=null,e.length>0?(e=e[0],i&&c.addClass(e,i),t&&Object.keys(t).forEach(function(o){e.setAttribute(o,t[o])}),e):null}catch(o){return O.logError("util.createDomFromHtml",o),null}};c.hasClass=function(n,t){if(!n||!t)return!1;try{return Array.prototype.some.call(n.classList,function(r){return r===t})}catch(r){var i=n.className&&Z(n.className)==="object"?n.getAttribute("class"):n.className;return i&&!!i.match(new RegExp("(\\s|^)"+t+"(\\s|$)"))}};c.addClass=function(n,t){if(!(!n||!t))try{t.replace(/(^\s+|\s+$)/g,"").split(/\s+/g).forEach(function(i){i&&n.classList.add(i)})}catch(i){c.hasClass(n,t)||(n.className&&Z(n.className)==="object"?n.setAttribute("class",n.getAttribute("class")+" "+t):n.className+=" "+t)}};c.removeClass=function(n,t){if(!(!n||!t))try{t.replace(/(^\s+|\s+$)/g,"").split(/\s+/g).forEach(function(i){i&&n.classList.remove(i)})}catch(i){c.hasClass(n,t)&&t.split(/\s+/g).forEach(function(r){var e=new RegExp("(\\s|^)"+r+"(\\s|$)");n.className&&Z(n.className)==="object"?n.setAttribute("class",n.getAttribute("class").replace(e," ")):n.className=n.className.replace(e," ")})}};c.toggleClass=function(n,t){n&&t.split(/\s+/g).forEach(function(i){c.hasClass(n,i)?c.removeClass(n,i):c.addClass(n,i)})};c.classNames=function(){for(var n=arguments,t=[],i=function(o){c.typeOf(n[o])==="String"?t.push(n[o]):c.typeOf(n[o])==="Object"&&Object.keys(n[o]).map(function(a){n[o][a]&&t.push(a)})},r=0;r<arguments.length;r++)i(r);return t.join(" ")};c.findDom=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:document,t=arguments.length>1?arguments[1]:void 0,i;try{i=n.querySelector(t)}catch(r){O.logError("util.findDom",r),t.indexOf("#")===0&&(i=n.getElementById(t.slice(1)))}return i};c.getCss=function(n,t){return n.currentStyle?n.currentStyle[t]:document.defaultView.getComputedStyle(n,!1)[t]};c.padStart=function(n,t,i){for(var r=String(i),e=t>>0,o=Math.ceil(e/r.length),a=[],s=String(n);o--;)a.push(r);return a.join("").substring(0,e-s.length)+s};c.format=function(n){if(window.isNaN(n))return"";n=Math.round(n);var t=c.padStart(Math.floor(n/3600),2,0),i=c.padStart(Math.floor((n-t*3600)/60),2,0),r=c.padStart(Math.floor(n-t*3600-i*60),2,0);return(t==="00"?[i,r]:[t,i,r]).join(":")};c.event=function(n){if(n.touches){var t=n.touches[0]||n.changedTouches[0];n.clientX=t.clientX||0,n.clientY=t.clientY||0,n.offsetX=t.pageX-t.target.offsetLeft,n.offsetY=t.pageY-t.target.offsetTop}n._target=n.target||n.srcElement};c.typeOf=function(n){return Object.prototype.toString.call(n).match(/([^\s.*]+)(?=]$)/g)[0]};c.deepCopy=function(n,t){if(c.typeOf(t)==="Object"&&c.typeOf(n)==="Object")return Object.keys(t).forEach(function(i){c.typeOf(t[i])==="Object"&&!(t[i]instanceof Node)?n[i]===void 0||n[i]===void 0?n[i]=t[i]:c.deepCopy(n[i],t[i]):c.typeOf(t[i])==="Array"?n[i]=c.typeOf(n[i])==="Array"?n[i].concat(t[i]):t[i]:n[i]=t[i]}),n};c.deepMerge=function(n,t){return Object.keys(t).map(function(i){if(c.typeOf(t[i])==="Array"&&c.typeOf(n[i])==="Array"){if(c.typeOf(n[i])==="Array"){var r;(r=n[i]).push.apply(r,ir(t[i]))}}else c.typeOf(n[i])===c.typeOf(t[i])&&n[i]!==null&&c.typeOf(n[i])==="Object"&&!(t[i]instanceof window.Node)?c.deepMerge(n[i],t[i]):t[i]!==null&&(n[i]=t[i])}),n};c.getBgImage=function(n){var t=(n.currentStyle||window.getComputedStyle(n,null)).backgroundImage;if(!t||t==="none")return"";var i=document.createElement("a");return i.href=t.replace(/url\("|"\)/g,""),i.href};c.copyDom=function(n){if(n&&n.nodeType===1){var t=document.createElement(n.tagName);return Array.prototype.forEach.call(n.attributes,function(i){t.setAttribute(i.name,i.value)}),n.innerHTML&&(t.innerHTML=n.innerHTML),t}else return""};c.setInterval=function(n,t,i,r){n._interval[t]||(n._interval[t]=window.setInterval(i.bind(n),r))};c.clearInterval=function(n,t){clearInterval(n._interval[t]),n._interval[t]=null};c.setTimeout=function(n,t,i){n._timers||(n._timers=[]);var r=setTimeout(function(){t(),c.clearTimeout(n,r)},i);return n._timers.push(r),r};c.clearTimeout=function(n,t){var i=n._timers;if(c.typeOf(i)==="Array"){for(var r=0;r<i.length;r++)if(i[r]===t){i.splice(r,1),clearTimeout(t);break}}else clearTimeout(t)};c.clearAllTimers=function(n){var t=n._timers;c.typeOf(t)==="Array"&&(t.map(function(i){clearTimeout(i)}),n._timerIds=[])};c.createImgBtn=function(n,t,i,r){var e=c.createDom("xg-".concat(n),"",{},"xgplayer-".concat(n,"-img"));if(e.style.backgroundImage='url("'.concat(t,'")'),i&&r){var o,a,s;["px","rem","em","pt","dp","vw","vh","vm","%"].every(function(u){return i.indexOf(u)>-1&&r.indexOf(u)>-1?(o=parseFloat(i.slice(0,i.indexOf(u)).trim()),a=parseFloat(r.slice(0,r.indexOf(u)).trim()),s=u,!1):!0}),e.style.width="".concat(o).concat(s),e.style.height="".concat(a).concat(s),e.style.backgroundSize="".concat(o).concat(s," ").concat(a).concat(s),n==="start"?e.style.margin="-".concat(a/2).concat(s," auto auto -").concat(o/2).concat(s):e.style.margin="auto 5px auto 5px"}return e};c.Hex2RGBA=function(n,t){var i=[];if(/^\#[0-9A-F]{3}$/i.test(n)){var r="#";n.replace(/[0-9A-F]/ig,function(e){r+=e+e}),n=r}return/^#[0-9A-F]{6}$/i.test(n)?(n.replace(/[0-9A-F]{2}/ig,function(e){i.push(parseInt(e,16))}),"rgba(".concat(i.join(","),", ").concat(t,")")):"rgba(255, 255, 255, 0.1)"};c.getFullScreenEl=function(){return document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement};c.checkIsFunction=function(n){return n&&typeof n=="function"};c.checkIsObject=function(n){return n!==null&&Z(n)==="object"};c.hide=function(n){n.style.display="none"};c.show=function(n,t){n.style.display=t||"block"};c.isUndefined=function(n){if(typeof n>"u"||n===null)return!0};c.setStyleFromCsstext=function(n,t){if(t)if(c.typeOf(t)==="String"){var i=t.replace(/\s+/g,"").split(";");i.map(function(r){if(r){var e=r.split(":");e.length>1&&(n.style[e[0]]=e[1])}})}else Object.keys(t).map(function(r){n.style[r]=t[r]})};function lr(n,t){for(var i=0,r=t.length;i<r;i++)if(n.indexOf(t[i])>-1)return!0;return!1}c.filterStyleFromText=function(n){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:["width","height","top","left","bottom","right","position","z-index","padding","margin","transform"],i=n.style.cssText;if(!i)return{};var r=i.replace(/\s+/g,"").split(";"),e={},o={};
1return r.map(function(a){if(a){var s=a.split(":");s.length>1&&(lr(s[0],t)?e[s[0]]=s[1]:o[s[0]]=s[1])}}),n.setAttribute("style",""),Object.keys(o).map(function(a){n.style[a]=o[a]}),e};c.getStyleFromCsstext=function(n){var t=n.style.cssText;if(!t)return{};var i=t.replace(/\s+/g,"").split(";"),r={};return i.map(function(e){if(e){var o=e.split(":");o.length>1&&(r[o[0]]=o[1])}}),r};c.preloadImg=function(n){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:function(){},i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(){};if(n){var r=new window.Image;r.onload=function(e){r=null,t&&t(e)},r.onerror=function(e){r=null,i&&i(e)},r.src=n}};c.stopPropagation=function(n){n&&(n.stopPropagation(),n.cancelable&&n.preventDefault())};c.scrollTop=function(){return window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0};c.scrollLeft=function(){return window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0};c.checkTouchSupport=function(){return"ontouchstart"in window};c.getBuffered2=function(n){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:.5,i=[],r=0;r<n.length;r++)i.push({start:n.start(r)<.5?0:n.start(r),end:n.end(r)});i.sort(function(u,l){var h=u.start-l.start;return h||l.end-u.end});var e=[];if(t)for(var o=0;o<i.length;o++){var a=e.length;if(a){var s=e[a-1].end;i[o].start-s<t?i[o].end>s&&(e[a-1].end=i[o].end):e.push(i[o])}else e.push(i[o])}else e=i;return new rr(e)};c.getBufferByCurrentTime=function(n,t){var i={start:0,end:0,include:0,diff:0,cur:t};if(!n||n.length<1)return i;for(var r=-1,e=-1,o=parseInt(t*1e3,10),a=n.length-1;a>-1;a--){var s=parseInt(n.start(a)*1e3,10),u=parseInt(n.end(a)*1e3,10);if(o>=s&&o<=u){i.include=1,i.start=s/1e3,i.end=u/1e3,i.diff=(u-o)/1e3;break}else o<s&&(r<0||s-o<r)?(r=(s-o)/1e3,e=a):o>u&&(r<0||o-u<r)&&(r=(o-u)/1e3,e=a)}return i.include!==1&&(e<0&&(e=n.length-1),i.start=parseInt(n.start(e)*1e3,10)/1e3,i.end=parseInt(n.end(e)*1e3,10)/1e3,i.diff=(parseInt(i.end*1e3,10)-o)/1e3),i};c.getEventPos=function(n){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;return n.touches&&n.touches.length>0&&(n=n.touches[0]),{x:n.x/t,y:n.y/t,clientX:n.clientX/t,clientY:n.clientY/t,offsetX:n.offsetX/t,offsetY:n.offsetY/t,pageX:n.pageX/t,pageY:n.pageY/t}};c.requestAnimationFrame=function(n){var t=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame;if(t)return t(n)};c.getHostFromUrl=function(n){if(c.typeOf(n)!=="String")return"";var t=n.split("/"),i="";return t.length>3&&t[2]&&(i=t[2]),i};c.cancelAnimationFrame=function(n){var t=window.cancelAnimationFrame||window.mozCancelAnimationFrame||window.cancelRequestAnimationFrame;t&&t(n)};c.isMSE=function(n){return n.media&&(n=n.media),!n||!(n instanceof HTMLMediaElement)?!1:/^blob/.test(n.currentSrc)||/^blob/.test(n.src)};c.isBlob=function(n){return typeof n=="string"&&/^blob/.test(n)};c.generateSessionId=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=new Date().getTime();try{n=parseInt(n)}catch(r){n=0}t+=n,window.performance&&typeof window.performance.now=="function"&&(t+=parseInt(window.performance.now()));var i="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(r){var e=(t+Math.random()*16)%16|0;return t=Math.floor(t/16),(r==="x"?e:e&3|8).toString(16)});return i};c.adjustTimeByDuration=function(n,t,i){return!t||!n?n:n>t||i&&n<t?t:n};c.getTransformStyle=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{x:0,y:0,scale:1,rotate:0},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",i={scale:"".concat(n.scale||1),translate:"".concat(n.x||0,"%, ").concat(n.y||0,"%"),rotate:"".concat(n.rotate||0,"deg")},r=Object.keys(i);return r.forEach(function(e){var o=new RegExp("".concat(e,"\\([^\\(]+\\)"),"g"),a="".concat(e,"(").concat(i[e],")");o.test(t)?(o.lastIndex=-1,t=t.replace(o,a)):t+="".concat(a," ")}),t};c.convertDeg=function(n){return Math.abs(n)<=1?n*360:n%360};function Sn(n){var t=Z(n);return n!==null&&(t==="object"||t==="function")}function cr(n,t,i){var r,e,o,a,s,u,l=0,h=!1,f=!1,d=!0,v=!t&&t!==0&&typeof window.requestAnimationFrame=="function";if(typeof n!="function")throw new TypeError("Expected a function");t=+t||0,Sn(i)&&(h=!!i.leading,f="maxWait"in i,o=f?Math.max(+i.maxWait||0,t):o,d="trailing"in i?!!i.trailing:d);function y(P){var D=r,U=e;return r=e=void 0,l=P,a=n.apply(U,D),a}function b(P,D){return v?(window.cancelAnimationFrame(s),window.requestAnimationFrame(P)):setTimeout(P,D)}function p(P){if(v)return window.cancelAnimationFrame(P);clearTimeout(P)}function _(P){return l=P,s=b(C,t),h?y(P):a}function E(P){var D=P-u,U=P-l,ve=t-D;return f?Math.min(ve,o-U):ve}function m(P){var D=P-u,U=P-l;return u===void 0||D>=t||D<0||f&&U>=o}function C(){var P=Date.now();if(m(P))return T(P);s=b(C,E(P))}function T(P){return s=void 0,d&&r?y(P):(r=e=void 0,a)}function K(){s!==void 0&&p(s),l=0,r=u=e=s=void 0}function Re(){return s===void 0?a:T(Date.now())}function pe(){return s!==void 0}function Y(){for(var P=Date.now(),D=m(P),U=arguments.length,ve=new Array(U),Ie=0;Ie<U;Ie++)ve[Ie]=arguments[Ie];if(r=ve,e=this,u=P,D){if(s===void 0)return _(u);if(f)return s=b(C,t),y(u)}return s===void 0&&(s=b(C,t)),a}return Y.cancel=K,Y.flush=Re,Y.pending=pe,Y}
1function fr(n,t,i){var r=!0,e=!0;if(typeof n!="function")throw new TypeError("Expected a function");return Sn(i)&&(r="leading"in i?!!i.leading:r,e="trailing"in i?!!i.trailing:e),cr(n,t,{leading:r,trailing:e,maxWait:t})}function hr(){var n=(document.documentElement.getAttribute("lang")||navigator.language||"zh-cn").toLocaleLowerCase();return n==="zh-cn"&&(n="zh"),n}function dr(n,t,i){if(n){var r=n.getAttribute(i);return!!(r&&r===t&&(n.tagName==="VIDEO"||n.tagName==="AUDIO"))}}function Oe(n){"@babel/helpers - typeof";return Oe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Oe(n)}function Lt(n,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(n,pr(r.key),r)}}function gr(n,t,i){return t&&Lt(n.prototype,t),i&&Lt(n,i),Object.defineProperty(n,"prototype",{writable:!1}),n}function pr(n){var t=vr(n,"string");return Oe(t)==="symbol"?t:String(t)}function vr(n,t){if(Oe(n)!=="object"||n===null)return n;var i=n[Symbol.toPrimitive];if(i!==void 0){var r=i.call(n,t||"default");if(Oe(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(n)}function yr(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function")}var Nt={1:"network",2:"network",3:"decoder",4:"format"},dt=gr(function n(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{errorType:"",errorCode:0,errorMessage:"",originError:"",ext:{},mediaError:null,src:null};yr(this,n);var r=t&&t.i18n?t.i18n.ERROR_TYPES:null;if(t!=null&&t.video){var e=i.mediaError?i.mediaError:t.video.error||{},o=t.duration,a=t.currentTime,s=t.ended,u=t.src,l=t.currentSrc,h=t.video,f=h.readyState,d=h.networkState,v={playerVersion:ft,domain:document.domain,currentTime:a,duration:o,ended:s,readyState:f,networkState:d,src:i.src||u||l,errorType:i.errorType,errorCode:i.errorCode||e.code,message:i.errorMessage||e.message,mediaError:e,originError:i.originError?i.originError.stack:"",host:c.getHostFromUrl(u||l)};return i.ext&&Object.keys(i.ext).map(function(_){v[_]=i.ext[_]}),v}else if(arguments.length>1){for(var y={playerVersion:ft,domain:document.domain},b=["errorType","currentTime","duration","networkState","readyState","src","currentSrc","ended","errd","errorCode","mediaError"],p=0;p<arguments.length;p++)y[b[p]]=arguments[p];return y.ex=r?(r[arguments[0]]||{}).msg:"",y}}),wn="play",Tn="ended",mr="pause",br="error",Qe="seeked",Ze="timeupdate",_r="waiting",Fe="canplay",Pr="durationchange",Er="emptied",Or="focus",Sr="blur",wr="ready",Tr="urlNull",et="autoplay_started",kr="autoplay_was_prevented",Cr="complete",Ar="replay",Rr="destroy",kn="urlchange",$e="buffer_control",q="fullscreen_change",Dt="cssFullscreen_change",Ir="mini_state_change",xr="definition_change",Ft="after_definition_change",Lr="video_resize",Nr="playnext",$t="user_action",Dr="reset",Fr="source_error",$r="source_success",jr=["play","playing","ended","pause","error","seeking","seeked","timeupdate","waiting","canplay","canplaythrough","durationchange","volumechange","loadeddata","loadedmetadata","ratechange","progress","loadstart","emptied","stalled","suspend","abort","lowdecode"],jt={android:/(Android)\s([\d.]+)/,ios:/(Version)\/([\d.]+)/},Mr=["avc1.42E01E, mp4a.40.2","avc1.58A01E, mp4a.40.2","avc1.4D401E, mp4a.40.2","avc1.64001E, mp4a.40.2","avc1.42E01E","mp4v.20.8","avc1.42E01E, mp4a.40.2","avc1.58A01E, mp4a.40.2","avc1.4D401E, mp4a.40.2","avc1.64001E, mp4a.40.2","mp4v.20.8, mp4a.40.2","mp4v.20.240, mp4a.40.2"],Cn={get device(){var n=Cn.os;return n.isPc?"pc":"mobile"},get browser(){if(typeof navigator>"u")return"";var n=navigator.userAgent.toLowerCase(),t={ie:/rv:([\d.]+)\) like gecko/,firefox:/firefox\/([\d.]+)/,chrome:/chrome\/([\d.]+)/,opera:/opera.([\d.]+)/,safari:/version\/([\d.]+).*safari/};return[].concat(Object.keys(t).filter(function(i){return t[i].test(n)}))[0]},get os(){if(typeof navigator>"u")return{};var n=navigator.userAgent,t=/(?:Windows Phone)/.test(n),i=/(?:SymbianOS)/.test(n)||t,r=/(?:Android)/.test(n),e=/(?:Firefox)/.test(n),o=/(?:iPad|PlayBook)/.test(n)||r&&!/(?:Mobile)/.test(n)||e&&/(?:Tablet)/.test(n),a=/(?:iPhone)/.test(n)&&!o,s=!a&&!r&&!i&&!o,u=/(?:iPad|PlayBook)/.test(n);return{isTablet:o,isPhone:a,isIpad:u,isIos:a||u,isAndroid:r,isPc:s,isSymbian:i,isWindowsPhone:t,isFireFox:e}},get osVersion(){if(typeof navigator>"u")return 0;var n=navigator.userAgent,t="";
1/(?:iPhone)|(?:iPad|PlayBook)/.test(n)?t=jt.ios:t=jt.android;var i=t?t.exec(n):[];if(i&&i.length>=3){var r=i[2].split(".");return r.length>0?parseInt(r[0]):0}return 0},get isWeixin(){if(typeof navigator>"u")return!1;var n=/(micromessenger)\/([\d.]+)/,t=n.exec(navigator.userAgent.toLocaleLowerCase());return!!t},isSupportMP4:function(){var t={isSupport:!1,mime:""};if(typeof document>"u")return t;if(this.supportResult)return this.supportResult;var i=document.createElement("video");return typeof i.canPlayType=="function"&&Mr.map(function(r){i.canPlayType('video/mp4; codecs="'.concat(r,'"'))==="probably"&&(t.isSupport=!0,t.mime+="||".concat(r))}),this.supportResult=t,i=null,t},isHevcSupported:function(){return typeof MediaSource>"u"||!MediaSource.isTypeSupported?!1:MediaSource.isTypeSupported('video/mp4;codecs="hev1.1.6.L120.90"')||MediaSource.isTypeSupported('video/mp4;codecs="hev1.2.4.L120.90"')||MediaSource.isTypeSupported('video/mp4;codecs="hev1.3.E.L120.90"')||MediaSource.isTypeSupported('video/mp4;codecs="hev1.4.10.L120.90"')},probeConfigSupported:function(t){var i={supported:!1,smooth:!1,powerEfficient:!1};if(!t||typeof navigator>"u")return Promise.resolve(i);if(navigator.mediaCapabilities&&navigator.mediaCapabilities.decodingInfo)return navigator.mediaCapabilities.decodingInfo(t);var r=t.video||{},e=t.audio||{};try{var o=MediaSource.isTypeSupported(r.contentType),a=MediaSource.isTypeSupported(e.contentType);return Promise.resolve({supported:o&&a,smooth:!1,powerEfficient:!1})}catch(s){return Promise.resolve(i)}},isHdrSupported:function(){if(typeof matchMedia=="function"){var t=matchMedia("(dynamic-range: high)"),i=matchMedia("not supported query");return t.media!==i.media&&t.matches===!0}return!1}};const S=Cn;function re(n){"@babel/helpers - typeof";return re=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},re(n)}function Br(n,t,i){return t=An(t),t in n?Object.defineProperty(n,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[t]=i,n}function Ur(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function")}function Mt(n,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(n,An(r.key),r)}}function Hr(n,t,i){return t&&Mt(n.prototype,t),i&&Mt(n,i),Object.defineProperty(n,"prototype",{writable:!1}),n}function An(n){var t=Gr(n,"string");return re(t)==="symbol"?t:String(t)}function Gr(n,t){if(re(n)!=="object"||n===null)return n;var i=n[Symbol.toPrimitive];if(i!==void 0){var r=i.call(n,t||"default");if(re(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(n)}function V(){return typeof Reflect<"u"&&Reflect.get?V=Reflect.get.bind():V=function(t,i,r){var e=Vr(t,i);if(e){var o=Object.getOwnPropertyDescriptor(e,i);return o.get?o.get.call(arguments.length<3?t:r):o.value}},V.apply(this,arguments)}function Vr(n,t){for(;!Object.prototype.hasOwnProperty.call(n,t)&&(n=$(n),n!==null););return n}function zr(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(t&&t.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),t&>(n,t)}function gt(n,t){return gt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,e){return r.__proto__=e,r},gt(n,t)}function Kr(n){var t=Xr();return function(){var r=$(n),e;if(t){var o=$(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return Yr(this,e)}}function Yr(n,t){if(t&&(re(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Wr(n)}function Wr(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function Xr(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(n){return!1}}function $(n){return $=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(i){return i.__proto__||Object.getPrototypeOf(i)},$(n)}function tt(n,t){!this||!this.emit||(n==="error"?this.errorHandler(n,t.error):this.emit
1(n,t))}function qr(n,t){var i="on".concat(n.charAt(0).toUpperCase()).concat(n.slice(1));return t[i]&&typeof t[i]=="function"&&t.on(n,t[i]),function(r,e){var o=n,a={player:t,eventName:o,originalEvent:r,detail:r.detail||{},timeStamp:r.timeStamp,currentTime:t.currentTime,duration:t.duration,paused:t.paused,ended:t.ended,isInternalOp:!!t._internalOp[r.type],muted:t.muted,volume:t.volume,host:c.getHostFromUrl(t.currentSrc),vtype:t.vtype};if(t.removeInnerOP(r.type),o==="timeupdate"&&(t._currentTime=t.video&&t.video.currentTime),o==="ratechange"){var s=t.video?t.video.playbackRate:0;if(s&&t._rate===s)return;t._rate=t.video&&t.video.playbackRate}if(o==="durationchange"&&(t._duration=t.video.duration),o==="volumechange"&&(a.isMutedChange=t._lastMuted!==t.muted,t._lastMuted=t.muted),o==="error"&&(a.error=e||t.video.error),t.videoEventMiddleware[n]){var u=tt.bind(t,n,a);try{t.videoEventMiddleware[n].call(t,a,u)}catch(l){throw tt.call(t,o,a),l}}else tt.call(t,o,a)}}var Jr=function(n){zr(i,n);var t=Kr(i);function i(r){var e;Ur(this,i),e=t.call(this,r),e._hasStart=!1,e._currentTime=0,e._duration=0,e._internalOp={},e._lastMuted=!1,e.vtype=r.vtype||"MP4",e.bizType=typeof r.bizType=="number"&&r.bizType>=0?r.bizType:0,e._rate=-1,e.videoConfig=Object.assign({},{controls:!1,autoplay:r.autoplay,playsinline:r.playsinline,"x5-playsinline":r.playsinline,"webkit-playsinline":r.playsinline,"x5-video-player-fullscreen":r["x5-video-player-fullscreen"]||r.x5VideoPlayerFullscreen,"x5-video-orientation":r["x5-video-orientation"]||r.x5VideoOrientation,airplay:r.airplay,"webkit-airplay":r.airplay,tabindex:r.tabindex|0,mediaType:r.mediaType||"video","data-index":-1},r.videoConfig,r.videoAttributes);var o=r["x5-video-player-type"]||r.x5VideoPlayerType;return S.isWeixin&&S.os.isAndroid&&o&&(e.videoConfig["x5-video-player-type"]=o,delete e.videoConfig.playsinline,delete e.videoConfig["webkit-playsinline"],delete e.videoConfig["x5-playsinline"]),r.loop&&(e.videoConfig.loop="loop"),e.video=c.createDom(e.videoConfig.mediaType,"",e.videoConfig,""),r.defaultPlaybackRate&&(e.video.defaultPlaybackRate=e.video.playbackRate=r.defaultPlaybackRate),c.typeOf(r.volume)==="Number"&&(e.volume=r.volume),r.autoplayMuted&&(e.video.muted=!0,e._lastMuted=!0),r.autoplay&&(e.video.autoplay=!0),e._interval={},e.videoEventMiddleware={},e.attachVideoEvents(),e}return Hr(i,[{key:"setEventsMiddleware",value:function(e){var o=this;Object.keys(e).map(function(a){o.videoEventMiddleware[a]=e[a]})}},{key:"removeEventsMiddleware",value:function(e){var o=this;Object.keys(e).map(function(a){delete o.videoEventMiddleware[a]})}},{key:"attachVideoEvents",value:function(e){var o=this;this.evHandlers||(this._evHandlers=jr.map(function(a){return Br({},a,qr(a,o))})),e||(e=this.video),this._evHandlers.forEach(function(a){var s=Object.keys(a)[0];e.addEventListener(s,a[s],!1)})}},{key:"detachVideoEvents",value:function(e){e||(e=this.video),this._evHandlers.map(function(o){var a=Object.keys(o)[0];e.removeEventListener(Object.keys(o)[0],o[a],!1)})}},{key:"_attachSourceEvents",value:function(e,o){var a=this;e.removeAttribute("src"),e.load(),e.removeEventListener("loadeddata",this._vLoadeddata),o.forEach(function(f){a.video.appendChild(c.createDom("source","",{src:"".concat(f.src),type:"".concat(f.type||"")}))});var s=e.children;if(s){this._videoSourceCount=s.length,this._vLoadeddata=function(f){a.emit($r,{src:f.target.currentSrc,host:c.getHostFromUrl(f.target.currentSrc)})};for(var u=null,l=0;l<this._evHandlers.length;l++)if(Object.keys(this._evHandlers[l])[0]==="error"){u=this._evHandlers[l];break}!this._sourceError&&(this._sourceError=function(f){if(a._videoSourceCount--,a._videoSourceCount===0){var d={code:4,message:"sources_load_error"};u?u.error(f,d):a.errorHandler("error",d)}var v=Nt[4];a.emit(Fr,new dt(a,{errorType:v,errorCode:4,errorMessage:"sources_load_error",mediaError:{code:4,message:"sources_load_error"},src:f.target.src}))});for(var h=0;h<s.length;h++)s[h].addEventListener("error",this._sourceError);e.addEventListener("loadeddata",this._vLoadeddata)}}},{key:"_detachSourceEvents",value:function(e){var o=e.children;if(!(!o||o.length===0||!this._sourceError)){for(var a=0;a<o.length;a++)o[a].removeEventListener("error",this._sourceError);for(;o.length>0;)e.removeChild(o[0]);this._vLoadeddata&&e.removeEventListener("loadeddata",this._vLoadeddata)}}},{key:"errorHandler",value:function(e){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(this.video&&(this.video.error||o)){var a=this.video.error||o,s=a.code?Nt[a.code]:"other",u=a.message||"";this.video.currentSrc||(u="empty_src_".concat(a.message),a={code:6,message:u}
1),this.emit(e,new dt(this,{errorType:s,errorCode:a.code,errorMessage:a.message||"",mediaError:a}))}}},{key:"hasStart",get:function(){return this._hasStart},set:function(e){typeof e=="boolean"&&(this._hasStart=e,this.emit("hasstart"))}},{key:"destroy",value:function(){var e=this;this.video&&(this.video.pause&&(this.video.pause(),this.video.muted=!0),this.video.removeAttribute("src"),this.video.load()),this._currentTime=0,this._duration=0,this._hasStart=!1,this.videoConfig=null;for(var o in this._interval)Object.prototype.hasOwnProperty.call(this._interval,o)&&(clearInterval(this._interval[o]),this._interval[o]=null);this.detachVideoEvents(),this._evHandlers.map(function(a){var s=Object.keys(a)[0],u="on".concat(s.charAt(0).toUpperCase()).concat(s.slice(1));typeof e[u]=="function"&&e.off(s,e[u])}),this._evHandlers=null,this.video=null,this.videoEventMiddleware={},this.removeAllListeners()}},{key:"play",value:function(){var e=this.video?this.video.play():null;return e}},{key:"pause",value:function(){this.video&&this.video.pause()}},{key:"load",value:function(){this.video&&this.video.load()}},{key:"canPlayType",value:function(e){return this.video?this.video.canPlayType(e):!1}},{key:"getBufferedRange",value:function(e){var o=[0,0];if(!this.video)return o;e||(e=this.video.buffered);var a=this.video.currentTime;if(e)for(var s=0,u=e.length;s<u&&(o[0]=e.start(s),o[1]=e.end(s),!(o[0]<=a&&a<=o[1]));s++);return o[0]-a<=0&&a-o[1]<=0?o:[0,0]}},{key:"autoplay",get:function(){return this.video?this.video.autoplay:!1},set:function(e){this.video&&(this.video.autoplay=e)}},{key:"buffered",get:function(){return this.video?this.video.buffered:null}},{key:"buffered2",get:function(){return this.video?c.getBuffered2(this.video.buffered):null}},{key:"bufferedPoint",get:function(){var e={start:0,end:0};if(!this.video)return e;var o=this.video.buffered;if(!o||o.length===0)return e;for(var a=0;a<o.length;a++)if((o.start(a)<=this.currentTime||o.start(a)<.1)&&o.end(a)>=this.currentTime)return{start:o.start(a),end:o.end(a)};return e}},{key:"crossOrigin",get:function(){return this.video?this.video.crossOrigin:""},set:function(e){this.video&&(this.video.crossOrigin=e)}},{key:"currentSrc",get:function(){return this.video?this.video.currentSrc:""},set:function(e){this.video&&(this.video.currentSrc=e)}},{key:"currentTime",get:function(){return this.video?this.video.currentTime!==void 0?this.video.currentTime:this._currentTime:0},set:function(e){this.video&&(this.video.currentTime=e)}},{key:"defaultMuted",get:function(){return this.video?this.video.defaultMuted:!1},set:function(e){this.video&&(this.video.defaultMuted=e)}},{key:"duration",get:function(){return this._duration}},{key:"ended",get:function(){return this.video?this.video.ended:!1}},{key:"error",get:function(){if(!this.video||!this.video.error)return null;var e=["MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED"];return e[this.video.error.code-1]}},{key:"loop",get:function(){return this.video?this.video.loop:!1},set:function(e){this.video&&(this.video.loop=e)}},{key:"muted",get:function(){return this.video?this.video.muted:!1},set:function(e){!this.video||this.video.muted===e||(this._lastMuted=this.video.muted,this.video.muted=e)}},{key:"networkState",get:function(){return this.video?this.video.networkState:0}},{key:"paused",get:function(){return this.video?this.video.paused:!0}},{key:"playbackRate",get:function(){return this.video?this.video.playbackRate:0},set:function(e){!this.video||e===1/0||(this.video.defaultPlaybackRate=e,this.video.playbackRate=e)}},{key:"played",get:function(){return this.video?this.video.played:null}},{key:"preload",get:function(){return this.video?this.video.preload:!1},set:function(e){this.video&&(this.video.preload=e)}},{key:"readyState",get:function(){return this.video?this.video.readyState:0}},{key:"seekable",get:function(){return this.video?this.video.seekable:!1}},{key:"seeking",get:function(){return this.video?this.video.seeking:!1}},{key:"src",get:function(){return this.video?this.video.src:""},set:function(e){this.video.src=e}},{key:"volume",get:function(){return this.video?this.video.volume:0}
1,set:function(e){e===1/0||!this.video||(this.video.volume=e)}},{key:"addInnerOP",value:function(e){this._internalOp[e]=!0}},{key:"removeInnerOP",value:function(e){delete this._internalOp[e]}},{key:"emit",value:function(e,o){for(var a,s=arguments.length,u=new Array(s>2?s-2:0),l=2;l<s;l++)u[l-2]=arguments[l];(a=V($(i.prototype),"emit",this)).call.apply(a,[this,e,o].concat(u))}},{key:"on",value:function(e,o){for(var a,s=arguments.length,u=new Array(s>2?s-2:0),l=2;l<s;l++)u[l-2]=arguments[l];(a=V($(i.prototype),"on",this)).call.apply(a,[this,e,o].concat(u))}},{key:"once",value:function(e,o){for(var a,s=arguments.length,u=new Array(s>2?s-2:0),l=2;l<s;l++)u[l-2]=arguments[l];(a=V($(i.prototype),"once",this)).call.apply(a,[this,e,o].concat(u))}},{key:"off",value:function(e,o){for(var a,s=arguments.length,u=new Array(s>2?s-2:0),l=2;l<s;l++)u[l-2]=arguments[l];(a=V($(i.prototype),"off",this)).call.apply(a,[this,e,o].concat(u))}},{key:"offAll",value:function(){V($(i.prototype),"removeAllListeners",this).call(this)}}]),i}(Xn);const Qr=Jr;function Se(n){"@babel/helpers - typeof";return Se=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Se(n)}function Zr(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function")}function Bt(n,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(n,ti(r.key),r)}}function ei(n,t,i){return t&&Bt(n.prototype,t),i&&Bt(n,i),Object.defineProperty(n,"prototype",{writable:!1}),n}function ti(n){var t=ni(n,"string");return Se(t)==="symbol"?t:String(t)}function ni(n,t){if(Se(n)!=="object"||n===null)return n;var i=n[Symbol.toPrimitive];if(i!==void 0){var r=i.call(n,t||"default");if(Se(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(n)}var ri=function(){function n(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{name:"xgplayer",version:1,db:null,ojstore:{name:"xg-m4a",keypath:"vid"}};Zr(this,n),this.indexedDB=window.indexedDB||window.webkitindexedDB,this.IDBKeyRange=window.IDBKeyRange||window.webkitIDBKeyRange,this.myDB=t}return ei(n,[{key:"openDB",value:function(i){var r=this,e=this,o=this.myDB.version||1,a=e.indexedDB.open(e.myDB.name,o);a.onerror=function(s){},a.onsuccess=function(s){r.myDB.db=s.target.result,i.call(e)},a.onupgradeneeded=function(s){var u=s.target.result;s.target.transaction,u.objectStoreNames.contains(e.myDB.ojstore.name)||u.createObjectStore(e.myDB.ojstore.name,{keyPath:e.myDB.ojstore.keypath})}}},{key:"deletedb",value:function(){var i=this;i.indexedDB.deleteDatabase(this.myDB.name)}},{key:"closeDB",value:function(){this.myDB.db.close()}},{key:"addData",value:function(i,r){for(var e=this.myDB.db.transaction(i,"readwrite").objectStore(i),o,a=0;a<r.length;a++)o=e.add(r[a]),o.onerror=function(){},o.onsuccess=function(){}}},{key:"putData",value:function(i,r){for(var e=this.myDB.db.transaction(i,"readwrite").objectStore(i),o,a=0;a<r.length;a++)o=e.put(r[a]),o.onerror=function(){},o.onsuccess=function(){}}},{key:"getDataByKey",value:function(i,r,e){var o=this,a=this.myDB.db.transaction(i,"readwrite").objectStore(i),s=a.get(r);s.onerror=function(){e.call(o,null)},s.onsuccess=function(u){var l=u.target.result;e.call(o,l)}}},{key:"deleteData",value:function(i,r){var e=this.myDB.db.transaction(i,"readwrite").objectStore(i);e.delete(r)}},{key:"clearData",value:function(i){var r=this.myDB.db.transaction(i,"readwrite").objectStore(i);r.clear()}}]),n}();const ii=ri;var Ut=["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],Ht=["requestFullscreen","webkitRequestFullscreen","mozRequestFullScreen","msRequestFullscreen"],Gt=["exitFullscreen","webkitExitFullscreen","mozCancelFullScreen","msExitFullscreen"],X="data-xgplayerid",oi={BUFFER_CONTROLS:"buffer_control"},Vt={PLAYING:"playing",WAITING:"waiting"};function ai(n){return ci(n)||li(n)||ui(n)||si()}function si(){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 ui(n,t){if(n){if(typeof n=="string")return pt(n,t);var i=Object.prototype.toString.call(n).slice(8,-1);if(i==="Object"&&n.constructor&&(i=n.constructor.name),i==="Map"||i==="Set")return Array.from(n);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return pt(n,t)}}function li(n){if(typeof Symbol<"u"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function ci(n){if(Array.isArray(n))return pt(n)}function pt(n,t){(t==null||t>n.length)&&(t=n.length);for(var i=0,r=new Array(t);i<t;i++)r[i]=n[i];return r}
1function Le(n,t,i){for(var r=arguments.length,e=new Array(r>3?r-3:0),o=3;o<r;o++)e[o-3]=arguments[o];var a=t.call.apply(t,[n].concat(e));!i||typeof i!="function"||(a&&a.then?a.then(function(){for(var s=arguments.length,u=new Array(s),l=0;l<s;l++)u[l]=arguments[l];i.call.apply(i,[n].concat(u))}):i.call.apply(i,[n].concat(e)))}function Me(n,t){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{pre:null,next:null};return this.__hooks||(this.__hooks={}),!this.__hooks[n]&&(this.__hooks[n]=null),(function(){var r=arguments,e=this;if(i.pre)try{var o;(o=i.pre).call.apply(o,[this].concat(Array.prototype.slice.call(arguments)))}catch(u){throw u.message="[pluginName: ".concat(this.pluginName,":").concat(n,":pre error] >> ").concat(u.message),u}if(this.__hooks&&this.__hooks[n])try{var a,s=(a=this.__hooks[n]).call.apply(a,[this,this].concat(Array.prototype.slice.call(arguments)));s?s.then?s.then(function(u){u!==!1&&Le.apply(void 0,[e,t,i.next].concat(ai(r)))}).catch(function(u){throw u}):Le.apply(void 0,[this,t,i.next].concat(Array.prototype.slice.call(arguments))):s===void 0&&Le.apply(void 0,[this,t,i.next].concat(Array.prototype.slice.call(arguments)))}catch(u){throw u.message="[pluginName: ".concat(this.pluginName,":").concat(n,"] >> ").concat(u.message),u}else Le.apply(void 0,[this,t,i.next].concat(Array.prototype.slice.call(arguments)))}).bind(this)}function Be(n,t){var i=this.__hooks;if(i)return i.hasOwnProperty(n)?(i&&(i[n]=t),!0):!1}function Ue(n,t){var i=this.__hooks;i&&delete i[n]}function zt(n){if(!(!this.plugins||!this.plugins[n.toLowerCase()])){for(var t=this.plugins[n.toLowerCase()],i=arguments.length,r=new Array(i>1?i-1:0),e=1;e<i;e++)r[e-1]=arguments[e];return t.useHooks&&t.useHooks.apply(t,r)}}function Kt(n){if(!(!this.plugins||!this.plugins[n.toLowerCase()])){var t=this.plugins[n.toLowerCase()];if(t){for(var i=arguments.length,r=new Array(i>1?i-1:0),e=1;e<i;e++)r[e-1]=arguments[e];return t.removeHooks&&t.removeHooks.apply(t,r)}}}function Rn(n){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];n.__hooks={},t&&t.map(function(i){n.__hooks[i]=null}),Object.defineProperty(n,"hooks",{get:function(){return n.__hooks&&Object.keys(n.__hooks).map(function(r){if(n.__hooks[r])return r})}})}function In(n){n.__hooks=null}function M(n,t,i){for(var r=arguments.length,e=new Array(r>3?r-3:0),o=3;o<r;o++)e[o-3]=arguments[o];if(n.__hooks&&n.__hooks[t]){var a,s=(a=n.__hooks[t]).call.apply(a,[n,n].concat(e));if(s&&s.then)s.then(function(u){return u===!1?null:i.call.apply(i,[n,n].concat(e))}).catch(function(u){});else if(s!==!1)return i.call.apply(i,[n,n].concat(e))}else return i.call.apply(i,[n,n].concat(e))}function we(n){"@babel/helpers - typeof";return we=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},we(n)}function Yt(n,t){var i=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);t&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})),i.push.apply(i,r)}return i}function Wt(n){for(var t=1;t<arguments.length;t++){var i=arguments[t]!=null?arguments[t]:{};t%2?Yt(Object(i),!0).forEach(function(r){fi(n,r,i[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):Yt(Object(i)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(i,r))})}return n}function fi(n,t,i){return t=xn(t),t in n?Object.defineProperty(n,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[t]=i,n}function hi(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function")}function Xt(n,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(n,xn(r.key),r)}}function di(n,t,i){return t&&Xt(n.prototype,t),i&&Xt(n,i),Object.defineProperty(n,"prototype",{writable:!1}),n}function xn(n){var t=gi(n,"string");return we(t)==="symbol"?t:String(t)}function gi(n,t){if(we(n)!=="object"||n===null)return n;var i=n[Symbol.toPrimitive];if(i!==void 0){var r=i.call(n,t||"default");if(we(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(n)}function nt(n,t){O.logError("[".concat(n,"] event or callback cant be undefined or null when call ").
1concat(t))}var He=function(){function n(t){hi(this,n),c.checkIsFunction(this.beforeCreate)&&this.beforeCreate(t),Rn(this),this.__args=t,this.__events={},this.__onceEvents={},this.config=t.config||{},this.player=null,this.playerConfig={},this.pluginName="",this.__init(t)}return di(n,[{key:"beforeCreate",value:function(i){}},{key:"afterCreate",value:function(){}},{key:"beforePlayerInit",value:function(){}},{key:"onPluginsReady",value:function(){}},{key:"afterPlayerInit",value:function(){}},{key:"destroy",value:function(){}},{key:"__init",value:function(i){this.player=i.player,this.playerConfig=i.player&&i.player.config,this.pluginName=i.pluginName?i.pluginName.toLowerCase():this.constructor.pluginName.toLowerCase(),this.logger=i.player&&i.player.logger}},{key:"updateLang",value:function(i){i||(i=this.lang)}},{key:"lang",get:function(){return this.player.lang}},{key:"i18n",get:function(){return this.player.i18n}},{key:"i18nKeys",get:function(){return this.player.i18nKeys}},{key:"domEventType",get:function(){var i,r=c.checkTouchSupport()?"touch":"mouse";return["compatible","touch","mouse"].indexOf((i=this.playerConfig)===null||i===void 0?void 0:i.domEventType)>-1&&(r=this.playerConfig.domEventType),r}},{key:"on",value:function(i,r){var e=this;if(!i||!r||!this.player){nt(this.pluginName,"plugin.on(event, callback)");return}typeof i=="string"?(this.__events[i]=r,this.player.on(i,r)):Array.isArray(i)&&i.forEach(function(o){e.__events[o]=r,e.player.on(o,r)})}},{key:"once",value:function(i,r){var e=this;if(!i||!r||!this.player){nt(this.pluginName,"plugin.once(event, callback)");return}typeof i=="string"?(this.__onceEvents[i]=r,this.player.once(i,r)):Array.isArray(i)&&i.forEach(function(o){e.__onceEvents[o]=r,e.player.once(i,r)})}},{key:"off",value:function(i,r){var e=this;if(!i||!r||!this.player){nt(this.pluginName,"plugin.off(event, callback)");return}typeof i=="string"?(delete this.__events[i],this.player.off(i,r)):Array.isArray(i)&&i.forEach(function(o){delete e.__events[i],e.player.off(o,r)})}},{key:"offAll",value:function(){var i=this;["__events","__onceEvents"].forEach(function(r){Object.keys(i[r]).forEach(function(e){i[r][e]&&i.off(e,i[r][e]),e&&delete i[r][e]})}),this.__events={},this.__onceEvents={}}},{key:"emit",value:function(i){var r;if(this.player){for(var e=arguments.length,o=new Array(e>1?e-1:0),a=1;a<e;a++)o[a-1]=arguments[a];
1(r=this.player).emit.apply(r,[i].concat(o))}}},{key:"emitUserAction",value:function(i,r){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(this.player){var o=Wt(Wt({},e),{},{pluginName:this.pluginName});this.player.emitUserAction(i,r,o)}}},{key:"hook",value:function(i,r){return Me.call.apply(Me,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"useHooks",value:function(i,r){for(var e=arguments.length,o=new Array(e>2?e-2:0),a=2;a<e;a++)o[a-2]=arguments[a];return Be.call.apply(Be,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"removeHooks",value:function(i,r){for(var e=arguments.length,o=new Array(e>2?e-2:0),a=2;a<e;a++)o[a-2]=arguments[a];return Ue.call.apply(Ue,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"registerPlugin",value:function(i){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"";if(this.player)return e&&(r.pluginName=e),this.player.registerPlugin({plugin:i,options:r})}},{key:"getPlugin",value:function(i){return this.player?this.player.getPlugin(i):null}},{key:"__destroy",value:function(){var i=this,r=this.player,e=this.pluginName;this.offAll(),c.clearAllTimers(this),c.checkIsFunction(this.destroy)&&this.destroy(),["player","playerConfig","pluginName","logger","__args","__hooks"].map(function(o){i[o]=null}),r.unRegisterPlugin(e),In(this)}}],[{key:"defineGetterOrSetter",value:function(i,r){for(var e in r)Object.prototype.hasOwnProperty.call(r,e)&&Object.defineProperty(i,e,r[e])}},{key:"defaultConfig",get:function(){return{}}},{key:"pluginName",get:function(){return"pluginName"}}]),n}(),pi=9;if(typeof Element<"u"&&!Element.prototype.matches){var te=Element.prototype;
1te.matches=te.matchesSelector||te.mozMatchesSelector||te.msMatchesSelector||te.oMatchesSelector||te.webkitMatchesSelector}function vi(n,t){for(;n&&n.nodeType!==pi;){if(typeof n.matches=="function"&&n.matches(t))return n;n=n.parentNode}}var yi=vi,mi=yi;function rt(n,t,i,r,e){var o=_i.apply(this,arguments);return n.addEventListener(i,o,e),{destroy:function(){n.removeEventListener(i,o,e)}}}function bi(n,t,i,r,e){return typeof n.addEventListener=="function"?rt.apply(null,arguments):typeof i=="function"?rt.bind(null,document).apply(null,arguments):(typeof n=="string"&&(n=document.querySelectorAll(n)),Array.prototype.map.call(n,function(o){return rt(o,t,i,r,e)}))}function _i(n,t,i,r){return function(e){e.delegateTarget=mi(e.target,t),e.delegateTarget&&r.call(n,e)}}var Pi=bi;const qt=Pn(Pi);function Ei(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function")}function Jt(n,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(n,Si(r.key),r)}}function Oi(n,t,i){return t&&Jt(n.prototype,t),i&&Jt(n,i),Object.defineProperty(n,"prototype",{writable:!1}),n}function Si(n){var t=wi(n,"string");return N(t)==="symbol"?t:String(t)}function wi(n,t){if(N(n)!=="object"||n===null)return n;var i=n[Symbol.toPrimitive];if(i!==void 0){var r=i.call(n,t||"default");if(N(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(n)}function ne(){return typeof Reflect<"u"&&Reflect.get?ne=Reflect.get.bind():ne=function(t,i,r){var e=Ti(t,i);if(e){var o=Object.getOwnPropertyDescriptor(e,i);return o.get?o.get.call(arguments.length<3?t:r):o.value}},ne.apply(this,arguments)}function Ti(n,t){for(;!Object.prototype.hasOwnProperty.call(n,t)&&(n=z(n),n!==null););return n}function ki(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(t&&t.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),t&&vt(n,t)}function vt(n,t){return vt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,e){return r.__proto__=e,r},vt(n,t)}function Ci(n){var t=Ii();return function(){var r=z(n),e;if(t){var o=z(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return Ai(this,e)}}function Ai(n,t){if(t&&(N(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ri(n)}function Ri(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function Ii(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(n){return!1}}function z(n){return z=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(i){return i.__proto__||Object.getPrototypeOf(i)},z(n)}function N(n){"@babel/helpers - typeof";return N=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},N(n)}var xi={CONTROLS:"controls",ROOT:"root"},L={ROOT:"root",ROOT_LEFT:"rootLeft",ROOT_RIGHT:"rootRight",ROOT_TOP:"rootTop",CONTROLS_LEFT:"controlsLeft",CONTROLS_RIGTH:"controlsRight",CONTROLS_RIGHT:"controlsRight",CONTROLS_CENTER:"controlsCenter",CONTROLS:"controls"},Qt={ICON_DISABLE:"xg-icon-disable",ICON_HIDE:"xg-icon-hide"};function it(n){return n?n.indexOf&&/^(?:http|data:|\/)/.test(n):!1}function Li(n,t){return N(n)==="object"&&n.class&&typeof n.class=="string"?"".concat(t," ").concat(n.class):t}function Ni(n,t){return N(n)==="object"&&n.attr&&N(n.attr)==="object"&&Object.keys(n.attr).map(function(i){t[i]=n.attr[i]}),t}function Zt(n,t){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"",r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},e=arguments.length>4&&arguments[4]!==void 0?arguments[4]:"",o=null;if(n instanceof window.Element)return c.addClass(n,i),Object.keys(r).map(function(a){n.setAttribute(a,r[a])}),n;if(it(n)||it(n.url))return r.src=it(n)?n:n.url||"",o=c.createDom(n.tag||"img","",r,"xg-img ".concat(i)),o;if(typeof n=="function")try{return o=n(),o instanceof window.Element?(c.addClass(o,i),Object.keys(r).map(function(a){o.setAttribute(a,r[a])}),o):(O.logWarn("warn>>icons.".concat(t," in config of plugin named [").concat(e,"] is a function mast return an Element Object")),null)}catch(a){return O.logError("Plugin named [".concat(e,"]:createIcon"),a),null}return typeof n=="string"?c.createDomFromHtml(n,r,i):(O.logWarn("warn>>icons.".concat(t," in config of plugin named [").concat(e,"] is invali
1d")),null)}function Di(n,t){var i=t.config.icons||t.playerConfig.icons;Object.keys(n).map(function(r){var e=n[r],o=e&&e.class?e.class:"",a=e&&e.attr?e.attr:{},s=null;i&&i[r]&&(o=Li(i[r],o),a=Ni(i[r],a),s=Zt(i[r],r,o,a,t.pluginName)),!s&&e&&(s=Zt(e.icon?e.icon:e,a,o,{},t.pluginName)),t.icons[r]=s})}function Fi(n,t){Object.keys(n).map(function(i){Object.defineProperty(t.langText,i,{get:function(){var e=t.lang,o=t.i18n;return o[i]?o[i]:n[i]&&n[i][e]||""}})})}var Ae=function(n){ki(i,n);var t=Ci(i);function i(){var r,e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return Ei(this,i),r=t.call(this,e),r.__delegates=[],r}return Oi(i,[{key:"__init",value:function(e){if(ne(z(i.prototype),"__init",this).call(this,e),!!e.root){var o=e.root,a=null;this.icons={},this.root=null,this.parent=null;var s=this.registerIcons()||{};Di(s,this),this.langText={};var u=this.registerLanguageTexts()||{};Fi(u,this);var l="";try{l=this.render()}catch(d){throw O.logError("Plugin:".concat(this.pluginName,":render"),d),new Error("Plugin:".concat(this.pluginName,":render:").concat(d.message))}if(l)a=i.insert(l,o,e.index),a.setAttribute("data-index",e.index);else if(e.tag)a=c.createDom(e.tag,"",e.attr,e.name),a.setAttribute("data-index",e.index),o.appendChild(a);else return;this.root=a,this.parent=o;var h=this.config.attr||{},f=this.config.style||{};this.setAttr(h),this.setStyle(f),this.config.index&&this.root.setAttribute("data-index",this.config.index),this.__registerChildren()}}},{key:"__registerChildren",value:function(){var e=this;if(this.root){this._children=[];var o=this.children();o&&N(o)==="object"&&Object.keys(o).length>0&&Object.keys(o).map(function(a){var s=a,u=o[s],l={root:e.root},h,f;typeof u=="function"?(h=e.config[s]||{},f=u):N(u)==="object"&&typeof u.plugin=="function"&&(h=u.options?c.deepCopy(e.config[s]||{},u.options):e.config[s]||{},f=u.plugin),l.config=h,h.index!==void 0&&(l.index=h.index),h.root&&(l.root=h.root),e.registerPlugin(f,l,s)})}}},{key:"updateLang",value:function(e){e||(e=this.lang);function o(l,h){for(var f=0;f<l.children.length;f++)l.children[f].children.length>0?o(l.children[f],h):h(l.children[f])}var a=this.root,s=this.i18n,u=this.langText;a&&o(a,function(l){var h=l.getAttribute&&l.getAttribute("lang-key");if(h){var f=s[h.toUpperCase()]||u[h];f&&(l.innerHTML=typeof f=="function"?f(e):f)}})}},{key:"lang",get:function(){return this.player.lang}},{key:"changeLangTextKey",value:function(e){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",a=this.i18n||{},s=this.langText;e.setAttribute&&e.setAttribute("lang-key",o);var u=a[o]||s[o]||"";u&&(e.innerHTML=u)}},{key:"plugins",value:function(){return this._children}},{key:"disable",value:function(){this.config.disable=!0,c.addClass(this.find(".xgplayer-icon"),Qt.ICON_DISABLE)}},{key:"enable",value:function(){this.config.disable=!1,c.removeClass(this.find(".xgplayer-icon"),Qt.ICON_DISABLE)}},{key:"children",value:function(){return{}}},{key:"registerPlugin",value:function(e){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"";o.root=o.root||this.root;var s=ne(z(i.prototype),"registerPlugin",this).call(this,e,o,a);return this._children.push(s),s}},{key:"registerIcons",value:function(){return{}}},{key:"registerLanguageTexts",value:function(){return{}}},{key:"find",value:function(e){if(this.root)return this.root.querySelector(e)}},{key:"bind",value:function(e,o,a){var s=this;if(arguments.length<3&&typeof o=="function")Array.isArray(e)?e.forEach(function(l){s.bindEL(l,o)}):this.bindEL(e,o);else{var u=i.delegate.call(this,this.root,e,o,a);this.__delegates=this.__delegates.concat(u)}}},{key:"unbind",value:function(e,o){var a=this;if(arguments.length<3&&typeof o=="function")Array.isArray(e)?e.forEach(function(l){a.unbindEL(l,o)}):this.unbindEL(e,o);else for(var s="".concat(e,"_").concat(o),u=0;u<this.__delegates.length;u++)if(this.__delegates[u].key===s){this.__delegates[u].destroy(),this.__delegates.splice(u,1);break}}},{key:"setStyle",value:function(e,o){var a=this;if(this.root){if(c.typeOf(e)==="String")return this.root.style[e]=o;c.typeOf(e)==="Object"&&Object.keys(e).map(function(s){a.root.style[s]=e[s]})}}},{key:"setAttr",value:function(e,o){var a=this;if(this.root){if(c.typeOf(e)==="String")return this.root.setAttribute(e,o);c.typeOf(e)==="Object"&&Object.keys(e).map(function(s){a.root.setAttribute(s,e[s])})}}},{key:"setHtml",value:function(e,o){this.root&&(this.root.innerHTML=e,typeof o=="function"&&o())}},{key:"bindEL",value:function(e,o){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;this.root&&"on".concat(e)in this.root&&typeof o=="function"&&this.root.addEventListener(e,o,a)}},{key:"unbindEL",value:function(e,o){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;this.root&&"on".concat(e)in this.root&&typeof o=="function"&&this.root.removeEventListener(e,o,a)}},{key:"show",value:function(e){if(this.root){this.root.style.display=e!==void 0?e:"block";var o=window.getComputedStyle(this.root,null),a=o.getPropertyValue("display");if(a==="none")return this.root.style.display="block"}}},{key:"hide",value:function(){this.root&&(this.root.style.display="none")}},{key:"appendChild",value:function(e,o){if(!this.root)return null;if(arguments.length<2&&arguments[0]instanceof window.Element)return this.root.appendChild(arguments[0]);if(!o||!(o instanceof window.Element))return null;try{return typeof e=="string"?this.find(e).appendChild(o):e.appendChild(o)}catch(a){return O.logError("Plugin:appendChild",a),null}}},{key:"render",value:function(){return""}},{key:"destroy",value:function(){}},{key:"__destroy",value:function(){var e=this,o=this.player;this.__delegates.map(function(a){a.destroy()}),this.__delegates=[],this._children instanceof Array&&(this._children.map(function(a){o.unRegisterPlugin(a.pluginName)}),this._children=null),this.root&&(this.root.hasOwnProperty("remove")?this.root.remove():this.root.parentNode&&this.root.parentNode.removeChild(this.root)),ne(z(i.prototype),"__destroy",this).call(this),this.icons={},["root","parent"].map(function(a){e[a]=null})}}],[{key:"insert",value:function(e,o){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,s=o.children.length,u=Number(a),l=e instanceof window.Node;if(s){for(var h=0,f=null,d="";h<s;h++){f=o.children[h];var v=Number(f.getAttribute("data-index"));if(v>=u){d="beforebegin";break}else v<u&&(d="afterend")}return l?d==="afterend"?o.appendChild(e):o.insertBefore(e,f):f.insertAdjacentHTML(d,e),d==="afterend"?o.children[o.children.length-1]:o.children[h]}else return l?o.appendChild(e):o.insertAdjacentHTML("beforeend",e),o.children[o.children.length-1]}},{key:"defaultConfig",get:function(){return{}}},{key:"delegate",value:function(e,o,a,s){var u=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1,l=[];
1if(e instanceof window.Node&&typeof s=="function")if(Array.isArray(a))a.forEach(function(f){var d=qt(e,o,f,s,u);d.key="".concat(o,"_").concat(f),l.push(d)});else{var h=qt(e,o,a,s,u);h.key="".concat(o,"_").concat(a),l.push(h)}return l}},{key:"ROOT_TYPES",get:function(){return xi}},{key:"POSITIONS",get:function(){return L}}]),i}(He);function Te(n){"@babel/helpers - typeof";return Te=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Te(n)}function $i(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function")}function en(n,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(n,Ln(r.key),r)}}function ji(n,t,i){return t&&en(n.prototype,t),i&&en(n,i),Object.defineProperty(n,"prototype",{writable:!1}),n}function Mi(n,t,i){return t=Ln(t),t in n?Object.defineProperty(n,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[t]=i,n}function Ln(n){var t=Bi(n,"string");return Te(t)==="symbol"?t:String(t)}function Bi(n,t){if(Te(n)!=="object"||n===null)return n;var i=n[Symbol.toPrimitive];if(i!==void 0){var r=i.call(n,t||"default");if(Te(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(n)}var Ui=function(){function n(){var t=this;if($i(this,n),Mi(this,"__trigger",function(i){var r=new Date().getTime();t.timeStamp=r;for(var e=0;e<i.length;e++)t.__runHandler(i[e].target)}),this.__handlers=[],this.timeStamp=0,this.observer=null,!!window.ResizeObserver)try{this.observer=new window.ResizeObserver(fr(this.__trigger,100,{trailing:!0})),this.timeStamp=new Date().getTime()}catch(i){}}return ji(n,[{key:"addObserver",value:function(i,r){if(this.observer){this.observer&&this.observer.observe(i);for(var e=i.getAttribute(X),o=this.__handlers,a=-1,s=0;s<o.length;s++)o[s]&&i===o[s].target&&(a=s);a>-1?this.__handlers[a].handler=r:this.__handlers.push({target:i,handler:r,playerId:e})}}},{key:"unObserver",value:function(i){var r=-1;this.__handlers.map(function(e,o){i===e.target&&(r=o)});try{this.observer&&this.observer.unobserve(i)}catch(e){}this.observer&&this.observer.unobserve(i),r>-1&&this.__handlers.splice(r,1)}},{key:"destroyObserver",value:function(){this.observer&&this.observer.disconnect(),this.observer=null,this.__handlers=null}},{key:"__runHandler",value:function(i){for(var r=this.__handlers,e=0;e<r.length;e++)if(r[e]&&i===r[e].target){try{r[e].handler(i)}catch(o){}return!0}return!1}}]),n}(),be=null;function Hi(n,t){return be||(be=new Ui),be.addObserver(n,t),be}function Gi(n,t){be.unObserver(n,t)}var Vi={pluginGroup:{},init:function(t){var i=t._pluginInfoId;i||(i=new Date().getTime(),t._pluginInfoId=i),!t.config.closeResizeObserver&&Hi(t.root,function(){t.getVideoSize()}),this.pluginGroup[i]={_originalOptions:t.config||{},_plugins:{}}},formatPluginInfo:function(t,i){var r=null,e=null;return t.plugin&&typeof t.plugin=="function"?(r=t.plugin,e=t.options):(r=t,e={}),i&&(e.config=i||{}),{PLUFGIN:r,options:e}},checkPluginIfExits:function(t,i){for(var r=0;r<i.length;r++)if(t.toLowerCase()===i[r].pluginName.toLowerCase())return!0;return!1},getRootByConfig:function(t,i){for(var r=Object.keys(i),e=null,o=0;o<r.length;o++)if(t.toLowerCase()===r[o].toLowerCase()){e=i[r[o]];break}return c.typeOf(e)==="Object"?{root:e.root,position:e.position}:{}},lazyRegister:function(t,i){var r=this,e=i.timeout||1500;return Promise.race([i.loader().then(function(o){var a;o&&o.__esModule?a=o.default:a=o,r.register(t,a,o.options)}),new Promise(function(o,a){setTimeout(function(){a(new Error("timeout"))},e)})])},register:function(t,i){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(!(!t||!i||typeof i!="function"||i.prototype===void 0)){var e=t._pluginInfoId;if(!(!e||!this.pluginGroup[e])){this.pluginGroup[e]._plugins||(this.pluginGroup[e]._plugins={});var o=this.pluginGroup[e]._plugins,a=this.pluginGroup[e]._originalOptions;r.player=t;var s=r.pluginName||i.pluginName;if(!s)throw new Error("The property pluginName is necessary");if(!(i.isSupported&&!i.isSupported())){r.config||(r.config={});for(var u=Object.keys(a),l=0;l<u.length;l++)if(s.toLowerCase()===u[l].toLowerCase()){var h=a[u[l]];c.typeOf(h)==="Object"&&(r.config=Object.assign({},r.config,a[u[l]]));break}i.defaultConfig&&Object.keys(i.defaultConfig).forEach(function(d){typeof r.config[d
1]>"u"&&(r.config[d]=i.defaultConfig[d])}),r.root?typeof r.root=="string"&&(r.root=t[r.root]):r.root=t.root,r.index=r.config.index||0;try{o[s.toLowerCase()]&&this.unRegister(e,s.toLowerCase());var f=new i(r);return o[s.toLowerCase()]=f,o[s.toLowerCase()].func=i,f&&typeof f.afterCreate=="function"&&f.afterCreate(),f}catch(d){throw d}}}}},unRegister:function(t,i){t._pluginInfoId&&(t=t._pluginInfoId),i=i.toLowerCase();try{var r=this.pluginGroup[t]._plugins[i];r&&(r.pluginName&&r.__destroy(),delete this.pluginGroup[t]._plugins[i])}catch(e){}},deletePlugin:function(t,i){var r=t._pluginInfoId;r&&this.pluginGroup[r]&&this.pluginGroup[r]._plugins&&delete this.pluginGroup[r]._plugins[i]},getPlugins:function(t){var i=t._pluginInfoId;return i&&this.pluginGroup[i]?this.pluginGroup[i]._plugins:{}},findPlugin:function(t,i){var r=t._pluginInfoId;if(!r||!this.pluginGroup[r])return null;var e=i.toLowerCase();return this.pluginGroup[r]._plugins[e]},beforeInit:function(t){var i=this;function r(e){return!e||!e.then?new Promise(function(o){o()}):e}return new Promise(function(e){if(i.pluginGroup){var o;return t._loadingPlugins&&t._loadingPlugins.length?o=Promise.all(t._loadingPlugins):o=Promise.resolve(),o.then(function(){var a=t._pluginInfoId;if(!i.pluginGroup[a]){e();return}var s=i.pluginGroup[a]._plugins,u=[];Object.keys(s).forEach(function(l){if(s[l]&&s[l].beforePlayerInit)try{var h=s[l].beforePlayerInit();u.push(r(h))}catch(f){throw u.push(r(null)),f}}),Promise.all([].concat(u)).then(function(){e()}).catch(function(l){e()})})}})},afterInit:function(t){var i=t._pluginInfoId;if(!(!i||!this.pluginGroup[i])){var r=this.pluginGroup[i]._plugins;Object.keys(r).forEach(function(e){r[e]&&r[e].afterPlayerInit&&r[e].afterPlayerInit()})}},setLang:function(t,i){var r=i._pluginInfoId;if(!(!r||!this.pluginGroup[r])){var e=this.pluginGroup[r]._plugins;Object.keys(e).forEach(function(o){if(e[o].updateLang)e[o].updateLang(t);else try{e[o].lang=t}catch(a){}})}},reRender:function(t){var i=this,r=t._pluginInfoId;if(!(!r||!this.pluginGroup[r])){var e=[],o=this.pluginGroup[r]._plugins;Object.keys(o).forEach(function(a){a!=="controls"&&o[a]&&(e.push({plugin:o[a].func,options:o[a].__args}),i.unRegister(r,a))}),e.forEach(function(a){i.register(t,a.plugin,a.options)})}},onPluginsReady:function(t){var i=t._pluginInfoId;if(!(!i||!this.pluginGroup[i])){var r=this.pluginGroup[i]._plugins||{};Object.keys(r).forEach(function(e){r[e].onPluginsReady&&typeof r[e].onPluginsReady=="function"&&r[e].onPluginsReady()})}},destroy:function(t){var i=t._pluginInfoId;if(this.pluginGroup[i]){Gi(t.root);for(var r=this.pluginGroup[i]._plugins,e=0,o=Object.keys(r);e<o.length;e++){var a=o[e];this.unRegister(i,a)}delete this.pluginGroup[i],delete t._pluginInfoId}}};const w=Vi,g={DEFAULT:"xgplayer",DEFAULT_SKIN:"xgplayer-skin-default",ENTER:"xgplayer-is-enter",PAUSED:"xgplayer-pause",PLAYING:"xgplayer-playing",ENDED:"xgplayer-ended",CANPLAY:"xgplayer-canplay",LOADING:"xgplayer-isloading",ERROR:"xgplayer-is-error",REPLAY:"xgplayer-replay",NO_START:"xgplayer-nostart",ACTIVE:"xgplayer-inactive",FULLSCREEN:"xgplayer-is-fullscreen",CSS_FULLSCREEN:"xgplayer-is-cssfullscreen",PARENT_FULLSCREEN:"xgplayer-fullscreen-parent",ROTATE_FULLSCREEN:"xgplayer-rotate-fullscreen",PARENT_ROTATE_FULLSCREEN:"xgplayer-rotate-parent",INNER_FULLSCREEN:"xgplayer-inner-fullscreen",NO_CONTROLS:"no-controls",FLEX_CONTROLS:"flex-controls",CONTROLS_FOLLOW:"controls-follow",AUTOHIDE:"xgplayer_autohide",NOT_ALLOW_AUTOPLAY:"not-allow-autoplay",SEEKING:"seeking",PC:"xgplayer-pc",MOBILE:"xgplayer-mobile",MINI:"xgplayer-mini"};function tn(){return{id:"",el:null,url:"",domEventType:"default",nullUrlStart:!1,width:600,height:337.5,fluid:!1,fitVideoSize:"fixed",videoFillMode:"auto",volume:.6,autoplay:!1,autoplayMuted:!1,loop:!1,isLive:!1,zoom:1,videoInit:!0,poster:"",isMobileSimulateMode:!1,defaultPlaybackRate:1,execBeforePluginsCall:null,allowSeekAfterEnded:!0,enableContextmenu:!0,closeVideoClick:!1,closeVideoDblclick:!1,closePlayerBlur:!1,closeDelayBlur:!1,leavePlayerTime:3e3,closePlayVideoFocus:!1,closePauseVideoFocus:!1,closeFocusVideoFocus:!0,closeControlsBlur:!0,topBarAutoHide:!0,videoAttributes:{},startTime:0,seekedStatus:"play",miniprogress:!1,disableSwipeHandler:function(){},enableSwipeHandler:function(){},preProcessUrl:null,ignores:[],whitelist:[],inactive:3e3,lang:hr(),controls:!0,marginControls:!1,fullscreenTarget:null,screenShot:!1,rotate:!1,pip:!1,download:!1,mini:!1,cssFullscreen:!0,keyShortcut:!0,presets:[],plugins:[],playbackRate:1,definition:{list:[]},playsinline:!0,customDuration:0,timeOffset:0,icons:{},i18n:[],tabindex:0,thumbnail:null,videoConfig:{},isHideTips:!1,minWaitDelay:200,commonStyle:{progressColor:"",playedColor:"",cachedColor:"",sliderBtnStyle:{},volumeColor:""}}}function ot(n){return Wi(n)||Yi(n)||Ki(n)||zi()}function zi(){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 Ki(n,t){if(n){if(typeof n=="string")return yt(n,t);var i=Object.prototype.toString.call(n).slice(8,-1);if(i==="Object"&&n.constructor&&(i=n.constructor.name),i==="Map"||i==="Set")return Array.from(n);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return yt(n,t)}}function Yi(n){if(typeof Symbol<"u"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}
1function Wi(n){if(Array.isArray(n))return yt(n)}function yt(n,t){(t==null||t>n.length)&&(t=n.length);for(var i=0,r=new Array(t);i<t;i++)r[i]=n[i];return r}var Xi=function(t,i){var r,e,o;i.preset&&i.options?o=new i.preset(i.options,t.config):o=new i({},t.config);var a=o,s=a.plugins,u=s===void 0?[]:s,l=a.ignores,h=l===void 0?[]:l,f=a.icons,d=f===void 0?{}:f,v=a.i18n,y=v===void 0?[]:v;t.config.plugins||(t.config.plugins=[]),t.config.ignores||(t.config.ignores=[]),(r=t.config.plugins).push.apply(r,ot(u)),(e=t.config.ignores).push.apply(e,ot(h)),Object.keys(d).map(function(p){t.config.icons[p]||(t.config.icons[p]=d[p])});var b=t.config.i18n||[];y.push.apply(y,ot(b)),t.config.i18n=y};function ie(n){"@babel/helpers - typeof";return ie=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ie(n)}function qi(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function")}function nn(n,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(n,Nn(r.key),r)}}function Ji(n,t,i){return t&&nn(n.prototype,t),i&&nn(n,i),Object.defineProperty(n,"prototype",{writable:!1}),n}function je(){return typeof Reflect<"u"&&Reflect.get?je=Reflect.get.bind():je=function(t,i,r){var e=Qi(t,i);if(e){var o=Object.getOwnPropertyDescriptor(e,i);return o.get?o.get.call(arguments.length<3?t:r):o.value}},je.apply(this,arguments)}function Qi(n,t){for(;!Object.prototype.hasOwnProperty.call(n,t)&&(n=oe(n),n!==null););return n}function Zi(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(t&&t.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),t&&mt(n,t)}function mt(n,t){return mt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,e){return r.__proto__=e,r},mt(n,t)}function eo(n){var t=no();return function(){var r=oe(n),e;if(t){var o=oe(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return to(this,e)}}function to(n,t){if(t&&(ie(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _e(n)}function _e(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function no(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(n){return!1}}function oe(n){return oe=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(i){return i.__proto__||Object.getPrototypeOf(i)},oe(n)}function rn(n,t,i){return t=Nn(t),t in n?Object.defineProperty(n,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[t]=i,n}function Nn(n){var t=ro(n,"string");return ie(t)==="symbol"?t:String(t)}function ro(n,t){if(ie(n)!=="object"||n===null)return n;var i=n[Symbol.toPrimitive];if(i!==void 0){var r=i.call(n,t||"default");if(ie(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(n)}var io=function(n){Zi(i,n);var t=eo(i);function i(){var r;qi(this,i);for(var e=arguments.length,o=new Array(e),a=0;a<e;a++)o[a]=arguments[a];return r=t.call.apply(t,[this].concat(o)),rn(_e(r),"onMouseEnter",function(s){var u=_e(r),l=u.player,h=u.playerConfig;h.closeControlsBlur&&l.focus({autoHide:!1})}),rn(_e(r),"onMouseLeave",function(){var s=_e(r),u=s.player;u.focus()}),r}return Ji(i,[{key:"beforeCreate",value:function(e){typeof e.player.config.controls=="boolean"&&(e.config.disable=!e.player.config.controls),!e.config.mode&&S.device==="mobile"&&(e.config.mode="flex"),e.player.config.marginControls&&(e.config.autoHide=!1)}},{key:"afterCreate",value:function(){var e=this,o=this.config,a=o.disable,s=o.height,u=o.mode,l=o.autoHide;if(!a){u==="flex"&&this.player.addClass(g.FLEX_CONTROLS),l&&this.player.addClass(g.AUTOHIDE);var h={height:"".concat(s,"px")};Object.keys(h).map(function(d){e.root.style[d]=h[d]}),this.left=this.find("xg-left-grid"),this.center=this.find("xg-center-grid"),this.right=this.find("xg-right-grid"),this.innerRoot=this.find("xg-inner-control
1s"),this.on(Ir,function(d){d?c.addClass(e.root,"mini-controls"):c.removeClass(e.root,"mini-controls")});var f=this.playerConfig.isMobileSimulateMode;S.device!=="mobile"&&f!=="mobile"&&(this.bind("mouseenter",this.onMouseEnter),this.bind("mouseleave",this.onMouseLeave))}}},{key:"focus",value:function(){this.player.focus({autoHide:!1})}},{key:"unFocus",value:function(){this.player.focus({autoHide:!0})}},{key:"blur",value:function(){this.player.blur({ignorePaused:!0})}},{key:"recoverAutoHide",value:function(){this.config.autoHide&&c.addClass(this.root,"control_autohide")}},{key:"pauseAutoHide",value:function(){c.removeClass(this.root,"control_autohide")}},{key:"show",value:function(){this.root.style.display="",this.player.focus()}},{key:"hide",value:function(){this.root.style.display="none"}},{key:"mode",get:function(){return this.config.mode}},{key:"registerPlugin",value:function(e){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=arguments.length>2?arguments[2]:void 0;if(this.root){var s=e.defaultConfig||{};if(!o.root){var u=o.position?o.position:o.config&&o.config.position?o.config.position:s.position;switch(u){case L.CONTROLS_LEFT:o.root=this.left;break;case L.CONTROLS_RIGHT:o.root=this.right;break;case L.CONTROLS_CENTER:o.root=this.center;break;case L.CONTROLS:o.root=this.root;break;default:o.root=this.left}return je(oe(i.prototype),"registerPlugin",this).call(this,e,o,a)}}}},{key:"destroy",value:function(){S.device!=="mobile"&&(this.unbind("mouseenter",this.onMouseEnter),this.unbind("mouseleave",this.onMouseLeave))}},{key:"render",value:function(){var e=this.config,o=e.mode,a=e.autoHide,s=e.initShow,u=e.disable;if(!u){var l=c.classNames({"xgplayer-controls":!0},{"flex-controls":o==="flex"},{"bottom-controls":o==="bottom"},{control_autohide:a},{controls_permanent:!a},{"xgplayer-controls-initshow":s||!a});return'<xg-controls class="'.concat(l,'" unselectable="on">\n <xg-inner-controls class="xg-inner-controls xg-pos">\n <xg-left-grid class="xg-left-grid">\n </xg-left-grid>\n <xg-center-grid class="xg-center-grid"></xg-center-grid>\n <xg-right-grid class="xg-right-grid">\n </xg-right-grid>\n </xg-inner-controls>\n </xg-controls>')}}}],[{key:"pluginName",get:function(){return"controls"}},{key:"defaultConfig",get:function(){return{disable:!1,autoHide:!0,mode:"",initShow:!1}}}]),i}(Ae);const Dn=io,oo={LANG:"en",TEXT:{ERROR_TYPES:{network:{code:1,msg:"video download error"},mse:{code:2,msg:"stream append error"},parse:{code:3,msg:"parsing error"},format:{code:4,msg:"wrong format"},decoder:{code:5,msg:"decoding error"},runtime:{code:6,msg:"grammatical errors"},timeout:{code:7,msg:"play timeout"},other:{code:8,msg:"other errors"}},HAVE_NOTHING:"There is no information on whether audio/video is ready",HAVE_METADATA:"Audio/video metadata is ready ",HAVE_CURRENT_DATA:"Data about the current play location is available, but there is not enough data to play the next frame/millisecond",HAVE_FUTURE_DATA:"Current and at least one frame of data is available",HAVE_ENOUGH_DATA:"The available data is sufficient to start playing",NETWORK_EMPTY:"Audio/video has not been initialized",NETWORK_IDLE:"Audio/video is active and has been selected for resources, but no network is used",NETWORK_LOADING:"The browser is downloading the data",NETWORK_NO_SOURCE:"No audio/video source was found",MEDIA_ERR_ABORTED:"The fetch process is aborted by the user",MEDIA_ERR_NETWORK:"An error occurred while downloading",MEDIA_ERR_DECODE:"An error occurred while decoding",MEDIA_ERR_SRC_NOT_SUPPORTED:"Audio/video is not supported",REPLAY:"Replay",ERROR:"Network is offline",PLAY_TIPS:"Play",PAUSE_TIPS:"Pause",PLAYNEXT_TIPS:"Play next",DOWNLOAD_TIPS:"Download",ROTATE_TIPS:"Rotate",RELOAD_TIPS:"Reload",FULLSCREEN_TIPS:"Fullscreen",EXITFULLSCREEN_TIPS:"Exit fullscreen",CSSFULLSCREEN_TIPS:"Cssfullscreen",EXITCSSFULLSCREEN_TIPS:"Exit cssfullscreen",TEXTTRACK:"Caption",PIP:"PIP",SCREENSHOT:"Screenshot",LIVE:"LIVE",OFF:"Off",OPEN:"Open",MINI_DRAG:"Click and hold to drag",MINISCREEN:"Miniscreen",REFRESH_TIPS:"Please Try",REFRESH:"Refresh",FORWARD:"forward",LIVE_TIP:"Live"}};function Fn(n){return lo(n)||uo(n)||so(n)||ao()}function ao(){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 so(n,t){if(n){if(typeof n=="string")return bt(n,t);var i=Object.prototype.toString.call(n).slice(8,-1);if(i==="Object"&&n.constructor&&(i=n.constructor.name),i==="Map"||i==="Set")return Array.from(n);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return bt(n,t)}}function uo(n){if(typeof Symbol<"u"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function lo(n){if(Array.isArray(n))return bt(n)}function bt(n,t){(t==null||t>n.length)&&(t=n.length);for(var i=0,r=new Array(t);i<t;i++)r[i]=n[i];return r}var A={lang:{},langKeys:[],textKeys:[]};function ke(n,t){return Object.keys(t).forEach(function(i){var r=c.typeOf(t[i]),e=c.typeOf(n[i]);if(r==="Array"){var o;e!=="Array"&&(n[i]=[]),(o=n[i]).push.apply(o,Fn(t[i]))}else r==="Object"?(e!=="Object"&&(n[i]={}),ke(n[i],t[i])):n[i]=t[i]}),n}function $n(){Object.keys(A.lang.en).map(function(n){A.textKeys[n]=n})}function co(n,t){var i=[];if(t||(t=A),!!t.lang){c.typeOf(n)!=="Array"?i=Object.keys(n).map(function(o){var a=o==="zh"?"zh-cn":o;return{LANG:a,TEXT:n[o]}}):i=n;var r=t,e=r.lang;i.map(function(o){o.LANG==="zh"&&(o.LANG="zh-cn"),e[o.LANG]?ke(e[o.LANG]||{},o.TEXT||{}):It(o,t)}
1),$n()}}function It(n,t){var i=n.LANG;if(t||(t=A),!!t.lang){var r=n.TEXT||{};i==="zh"&&(i="zh-cn"),t.lang[i]?ke(t.lang[i],r):(t.langKeys.push(i),t.lang[i]=r),$n()}}function fo(n){var t,i={lang:{},langKeys:[],textKeys:{},pId:n};return ke(i.lang,A.lang),(t=i.langKeys).push.apply(t,Fn(A.langKeys)),ke(i.textKeys,A.textKeys),i}It(oo);var ho={get textKeys(){return A.textKeys},get langKeys(){return A.langKeys},get lang(){var n={};return A.langKeys.map(function(t){n[t]=A.lang[t]}),A.lang["zh-cn"]&&(n.zh=A.lang["zh-cn"]||{}),n},extend:co,use:It,init:fo};const at=ho;function ae(n){"@babel/helpers - typeof";return ae=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ae(n)}function go(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function")}function on(n,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(n,vo(r.key),r)}}function po(n,t,i){return t&&on(n.prototype,t),i&&on(n,i),Object.defineProperty(n,"prototype",{writable:!1}),n}function vo(n){var t=yo(n,"string");return ae(t)==="symbol"?t:String(t)}function yo(n,t){if(ae(n)!=="object"||n===null)return n;var i=n[Symbol.toPrimitive];if(i!==void 0){var r=i.call(n,t||"default");if(ae(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(n)}function mo(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(t&&t.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),t&&_t(n,t)}function _t(n,t){return _t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,e){return r.__proto__=e,r},_t(n,t)}function bo(n){var t=Eo();return function(){var r=Ge(n),e;if(t){var o=Ge(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return _o(this,e)}}function _o(n,t){if(t&&(ae(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Po(n)}function Po(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function Eo(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(n){return!1}}function Ge(n){return Ge=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(i){return i.__proto__||Object.getPrototypeOf(i)},Ge(n)}var k={},st=null,Oo=function(n){mo(i,n);var t=bo(i);function i(){return go(this,i),t.apply(this,arguments)}return po(i,[{key:"add",value:function(e){e&&(k[e.playerId]=e,Object.keys(k).length===1&&this.setActive(e.playerId,!0))}},{key:"remove",value:function(e){e&&(e.isUserActive,delete k[e.playerId])}},{key:"_iterate",value:function(e){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;for(var a in k)if(Object.prototype.hasOwnProperty.call(k,a)){var s=k[a];if(o){if(e(s))break}else e(s)}}},{key:"forEach",value:function(e){this._iterate(e)}},{key:"find",value:function(e){var o=null;return this._iterate(function(a){var s=e(a);return s&&(o=a),s},!0),o}},{key:"findAll",value:function(e){var o=[];return this._iterate(function(a){e(a)&&o.push(a)}),o}},{key:"setActive",value:function(e){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(k[e])return o?this.forEach(function(a){e===a.playerId?(a.isUserActive=!0,a.isInstNext=!1):a.isUserActive=!1}):k[e].isUserActive=o,e}},{key:"getActiveId",value:function(){for(var e=Object.keys(k),o=0;o<e.length;o++){var a=k[e[o]];if(a&&a.isUserActive)return e[o]}return null}},{key:"setNext",value:function(e){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(k[e])return o?this.forEach(function(a){e===a.playerId?(a.isUserActive=!1,a.isInstNext=!0):a.isInstNext=!1}):k[e].isInstNext=o,e}}],[{key:"getInstance",value:function(){return st||(st=new i),st}}]),i}(On.EventEmitter);function So(n){for(var t=Object.keys(k),i=0;i<t.length;i++){var r=k[t[i]];if(r.root===n)return r}return null}function se(n){"@babel/helpers - typeof";return se=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},se(n)}function an(n,t){var i=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);t&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})),i.push.apply(i,r)}return i}function ut(n){for(var t=1;t<arguments.length;t++){var i=arguments[t]!=null?arguments[t]:{};
1t%2?an(Object(i),!0).forEach(function(r){J(n,r,i[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):an(Object(i)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(i,r))})}return n}function wo(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function")}function sn(n,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(n,Mn(r.key),r)}}function To(n,t,i){return t&&sn(n.prototype,t),i&&sn(n,i),Object.defineProperty(n,"prototype",{writable:!1}),n}function F(){return typeof Reflect<"u"&&Reflect.get?F=Reflect.get.bind():F=function(t,i,r){var e=ko(t,i);if(e){var o=Object.getOwnPropertyDescriptor(e,i);return o.get?o.get.call(arguments.length<3?t:r):o.value}},F.apply(this,arguments)}function ko(n,t){for(;!Object.prototype.hasOwnProperty.call(n,t)&&(n=x(n),n!==null););return n}function Co(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(t&&t.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),t&&Pt(n,t)}function Pt(n,t){return Pt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,e){return r.__proto__=e,r},Pt(n,t)}function Ao(n){var t=Ro();return function(){var r=x(n),e;if(t){var o=x(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return jn(this,e)}}function jn(n,t){if(t&&(se(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return R(n)}function R(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function Ro(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(n){return!1}}function x(n){return x=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(i){return i.__proto__||Object.getPrototypeOf(i)},x(n)}function J(n,t,i){return t=Mn(t),t in n?Object.defineProperty(n,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[t]=i,n}function Mn(n){var t=Io(n,"string");return se(t)==="symbol"?t:String(t)}function Io(n,t){if(se(n)!=="object"||n===null)return n;var i=n[Symbol.toPrimitive];if(i!==void 0){var r=i.call(n,t||"default");if(se(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(n)}var xo=["play","pause","replay","retry","playnext"],un=0,ln=0,H=null,Xe=function(n){Co(i,n);var t=Ao(i);function i(r){var e;wo(this,i);var o=c.deepMerge(tn(),r);e=t.call(this,o),J(R(e),"canPlayFunc",function(){if(e.config){var l=e.config,h=l.autoplay,f=l.startTime,d=l.defaultPlaybackRate;O.logInfo("player","canPlayFunc, startTime",f),f&&(e.currentTime=f>e.duration?e.duration:f,e.config.startTime=0),e.playbackRate=d,h&&e.videoPlay(),e.off(Fe,e.canPlayFunc),e.removeClass(g.ENTER)}}),J(R(e),"onFullscreenChange",function(l,h){var f=function(){c.setTimeout(R(e),function(){e.getVideoSize()},100)},d=c.getFullScreenEl();e._fullActionFrom?e._fullActionFrom="":e.emit($t,{eventType:"system",action:"switch_fullscreen",pluginName:"player",currentTime:e.currentTime,duration:e.duration,props:[{prop:"fullscreen",from:!0,to:!1}]});var v=dr(d,e.playerId,X);if(h||d&&(d===e._fullscreenEl||v))f(),!e.config.closeFocusVideoFocus&&e.video.focus(),e.fullscreen=!0,e.emit(q,!0,e._fullScreenOffset),e.cssfullscreen&&e.exitCssFullscreen();else if(e.fullscreen){f();var y=R(e),b=y._fullScreenOffset,p=y.config;p.needFullscreenScroll?(window.scrollTo(b.left,b.top),c.setTimeout(R(e),function(){e.fullscreen=!1,e._fullScreenOffset=null},100)):(!e.config.closeFocusVideoFocus&&e.video.focus(),e.fullscreen=!1,e._fullScreenOffset=null),e.cssfullscreen?e.removeClass(g.FULLSCREEN):e.recoverFullStyle(e.root,e._fullscreenEl,g.FULLSCREEN),e._fullscreenEl=null,e.emit(q,!1)}}),J(R(e),"_onWebkitbeginfullscreen",function(l){e._fullscreenEl=e.video,e.onFullscreenChange(l,!0)}),J(R(e),"_onWebkitendfullscreen",function(l){e.onFullscreenChange(l,!1)}),Rn(R(e),xo),e.config=o,e._pluginInfoId=c.generateSessionId(),Qn(R(e));var a=e.constructor.defaultPreset;if(e.config.presets.length){var s=e.config.presets.indexOf("default");s>=0&&a&&(e.config.presets[s]=a)}else a&&e.config.presets.push(a);e.userTimer=null,e.waitTimer=null,e.isReady=!1,e.isPlaying=!1,e.isError=!1,e.isSeeking=!1,e.isCanplay=!1,e._runPending=!1,e.rotateDeg=0,e.isActive=!1,e.isBufferControlPaused=!1,e.isCssfullScreen=!1,e.fullscreen=!1,e._fullscreenEl=null,e._cssfullscreenEl=null,e.curDefinition=null,e._orgCss="",e._fullScreenOffset=null,e._videoHeight=0,e._videoWidth=0,e.videoPos={pi:1,scale:0,rotate:-1,x:0,y:0,h:-1,w:-1,vy:0,vx:0},e.sizeInfo={width:0,height:0,left:0,top:0},e._accPlayed={t:0,acc:0,loopAcc:0},e.innerContainer=null,e.controls=null,e.topBar=null,e.topBar=null,e.root=null,e.__i18n=at.init(),S.os.isAndroid&&S.osVersion>
10&&S.osVersion<6&&(e.config.autoplay=!1),e.database=new ii,e.isUserActive=!1,e._onceSeekCanplay=null,e._isPauseBeforeSeek=0,e.innerStates={isActiveLocked:!1},e.instManager=H;var u=e._initDOM();return u?(e._bindEvents(),e._registerPresets(),e._registerPlugins(),w.onPluginsReady(R(e)),c.setTimeout(R(e),function(){e.emit(wr),e.onReady&&e.onReady(),e.isReady=!0},0),e.getInitDefinition(),(e.config.videoInit||e.config.autoplay)&&(e.hasStart||e.start()),e):jn(e)}return To(i,[{key:"_initDOM",value:function(){var e,o=this;if(this.root=this.config.id?document.getElementById(this.config.id):null,!this.root){var a=this.config.el;if(a&&a.nodeType===1)this.root=a;else return this.emit(br,new dt("use",this.config.vid,{line:32,handle:"Constructor",msg:"container id can't be empty"})),!1}var s=So(this.root);s&&(O.logWarn("The is an Player instance already exists in this.root, destroy it and reinitialize"),s.destroy()),this.root.setAttribute(X,this.playerId),(e=H)===null||e===void 0||e.add(this),w.init(this),this._initBaseDoms();var u=this.constructor.XgVideoProxy;if(u&&this.videoConfig.mediaType===u.mediaType){var l=this.innerContainer||this.root;this.detachVideoEvents(this.video);var h=new u(l,this.config,this.videoConfig);this.attachVideoEvents(h),this.video=h}if(this.video.setAttribute(X,this.playerId),this.config.controls){var f=w.register(this,Dn);this.controls=f}var d=this.config.isMobileSimulateMode==="mobile"?"mobile":S.device;if(this.addClass("".concat(g.DEFAULT," ").concat(g.ACTIVE," xgplayer-").concat(d," ").concat(this.config.controls?"":g.NO_CONTROLS)),this.config.autoplay?this.addClass(g.ENTER):this.addClass(g.NO_START),this.config.fluid){var v={"max-width":"100%",width:"100%",height:"0","padding-top":"".concat(this.config.height*100/this.config.width,"%"),position:"position",top:"0",left:"0"};Object.keys(v).map(function(m){o.root.style[m]=v[m]})}else["width","height"].map(function(m){o.config[m]&&(typeof o.config[m]!="number"?o.root.style[m]=o.config[m]:o.root.style[m]="".concat(o.config[m],"px"))});var y=this.root.getBoundingClientRect(),b=y.width,p=y.height,_=y.left,E=y.top;return this.sizeInfo.width=b,this.sizeInfo.height=p,this.sizeInfo.left=_,this.sizeInfo.top=E,!0}},{key:"_initBaseDoms",value:function(){this.topBar=c.createDom("xg-bar","",{"data-index":-1},"xg-top-bar"),this.leftBar=c.createDom("xg-bar","",{"data-index":-1},"xg-left-bar"),this.rightBar=c.createDom("xg-bar","",{"data-index":-1},"xg-right-bar"),this.config.marginControls&&(this.innerContainer=c.createDom("xg-video-container","",{"data-index":-1},"xg-video-container"),this.root.appendChild(this.innerContainer)),this.root.appendChild(this.topBar),this.root.appendChild(this.leftBar),this.root.appendChild(this.rightBar)}},{key:"_bindEvents",value:function(){var e=this;["focus","blur"].forEach(function(o){e.on(o,e["on"+o.charAt(0).toUpperCase()+o.slice(1)])}),Ut.forEach(function(o){document&&document.addEventListener(o,e.onFullscreenChange)}),S.os.isIos&&(this.video.addEventListener("webkitbeginfullscreen",this._onWebkitbeginfullscreen),this.video.addEventListener("webkitendfullscreen",this._onWebkitendfullscreen)),this.once("loadeddata",this.getVideoSize),this.playFunc=function(){e.config.closeFocusVideoFocus||e.video.focus()},this.once("play",this.playFunc),this.on($e,this.onBufferControl)}},{key:"_unbindEvents",value:function(){var e=this;this.root.removeEventListener("mousemove",this.mousemoveFunc),Ut.forEach(function(o){document.removeEventListener(o,e.onFullscreenChange)}),this.playFunc&&this.off("play",this.playFunc),this.off("canplay",this.canPlayFunc),this.video.removeEventListener("webkitbeginfullscreen",this._onWebkitbeginfullscreen),this.video.removeEventListener("webkitendfullscreen",this._onWebkitendfullscreen)}},{key:"_startInit",value:function(e){var o=this;if(this.video&&!((!e||e===""||c.typeOf(e)==="Array"&&e.length===0)&&(e="",this.emit(Tr),O.logWarn("config.url is null, please get url and run player._startInit(url)"),this.config.nullUrlStart))){this._detachSourceEvents(this.video),c.typeOf(e)==="Array"&&e.length>0?this._attachSourceEvents(this.video,e):!this.video.src||this.video.src!==e?this.video.src=e:e||this.video.removeAttribute("src"),c.typeOf(this.config.volume)==="Number"&&(this.volume=this.config.volume);var a=this.innerContainer?this.innerContainer:this.root;this.video instanceof window.Element&&!a.contains(this.video)&&a.insertBefore(this.video,a.firstChild);var s=this.video.readyState;
1O.logInfo("_startInit readyState",s),this.config.autoplay&&(!c.isMSE(this.video)&&this.load(),(S.os.isIpad||S.os.isPhone)&&this.videoPlay()),s>=2?this.canPlayFunc():this.once(Fe,this.canPlayFunc),c.setTimeout(this,function(){o.emit(Cr)},1),this.hasStart||w.afterInit(this),this.hasStart=!0}}},{key:"_registerPlugins",value:function(){var e=this,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this._loadingPlugins=[];var a=this.config.ignores||[],s=this.config.plugins||[],u=this.config.i18n||[];o&&at.extend(u,this.__i18n);var l=a.join("||").toLowerCase().split("||"),h=this.plugins;s.forEach(function(f){try{var d=f.plugin?f.plugin.pluginName:f.pluginName;if(!d)return;var v=d.toLowerCase(),y=e.config[v]||e.config[d];if(c.typeOf(y)==="Boolean"&&!y||l.indexOf(v)>-1||!o&&h[v])return;if(f.lazy&&f.loader){var b=w.lazyRegister(e,f);f.forceBeforeInit&&(b.then(function(){e._loadingPlugins.splice(e._loadingPlugins.indexOf(b),1)}).catch(function(p){O.logError("_registerPlugins:loadingPlugin",p),e._loadingPlugins.splice(e._loadingPlugins.indexOf(b),1)}),e._loadingPlugins.push(b));return}return e.registerPlugin(f)}catch(p){O.logError("_registerPlugins:",p)}})}},{key:"_registerPresets",value:function(){var e=this;this.config.presets.forEach(function(o){Xi(e,o)})}},{key:"_getRootByPosition",value:function(e){var o=null;switch(e){case L.ROOT_RIGHT:o=this.rightBar;break;case L.ROOT_LEFT:o=this.leftBar;break;case L.ROOT_TOP:o=this.topBar;break;default:o=this.innerContainer||this.root;break}return o}},{key:"registerPlugin",value:function(e,o){var a=w.formatPluginInfo(e,o),s=a.PLUFGIN,u=a.options,l=this.config.plugins,h=w.checkPluginIfExits(s.pluginName,l);!h&&l.push(s);var f=w.getRootByConfig(s.pluginName,this.config);f.root&&(u.root=f.root),f.position&&(u.position=f.position);var d=u.position?u.position:u.config&&u.config.position||s.defaultConfig&&s.defaultConfig.position;return!u.root&&typeof d=="string"&&d.indexOf("controls")>-1?this.controls&&this.controls.registerPlugin(s,u,s.pluginName):(u.root||(u.root=this._getRootByPosition(d)),w.register(this,s,u))}},{key:"deregister",value:function(e){typeof e=="string"?w.unRegister(this,e):e instanceof He&&w.unRegister(this,e.pluginName)}},{key:"unRegisterPlugin",value:function(e){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;this.deregister(e),o&&this.removePluginFromConfig(e)}},{key:"removePluginFromConfig",value:function(e){var o;if(typeof e=="string"?o=e:e instanceof He&&(o=e.pluginName),!!o)for(var a=this.config.plugins.length-1;a>-1;a--){var s=this.config.plugins[a];if(s.pluginName.toLowerCase()===o.toLowerCase()){this.config.plugins.splice(a,1);break}}}},{key:"plugins",get:function(){return w.getPlugins(this)}},{key:"getPlugin",value:function(e){var o=w.findPlugin(this,e);return o&&o.pluginName?o:null}},{key:"addClass",value:function(e){this.root&&(c.hasClass(this.root,e)||c.addClass(this.root,e))}},{key:"removeClass",value:function(e){this.root&&c.removeClass(this.root,e)}},{key:"hasClass",value:function(e){if(this.root)return c.hasClass(this.root,e)}},{key:"setAttribute",value:function(e,o){this.root&&this.root.setAttribute(e,o)}},{key:"removeAttribute",value:function(e,o){this.root&&this.root.removeAttribute(e,o)}},{key:"start",value:function(e){var o=this;if(!this.hasStart)return!e&&!this.config.url&&this.getInitDefinition(),this.hasStart=!0,this._registerPlugins(!1),w.beforeInit(this).then(function(){if(o.config){e||(e=o.url||o.config.url);var a=o.preProcessUrl(e),s=o._startInit(a.url);return s}}).catch(function(a){throw a.fileName="player",a.lineNumber="236",O.logError("start:beforeInit:",a),a})}},{key:"switchURL",value:function(e){var o=this,a=e;c.typeOf(e)==="Object"&&(a=e.url);var s=this.currentTime,u=this.paused&&!this.isError;return this.src=a,new Promise(function(l){var h=function(){o.currentTime=s,u&&o.once("canplay",function(){o.pause()}),l()};S.os.isAndroid?o.once("timeupdate",function(){h()}):o.once("canplay",function(){h()}),o.play()})}},{key:"videoPlay",value:function(){var e=this;if(!this.hasStart){this.removeClass(g.NO_START),this.addClass(g.
1ENTER);var o=this.start();o&&o.then(function(s){!e.config.autoplay&&e.videoPlay()});return}this.isPlaying||(this.removeClass(g.NO_START),!this.isCanplay&&this.addClass(g.ENTER));var a=F(x(i.prototype),"play",this).call(this);return a!==void 0&&a&&a.then?a.then(function(){e.removeClass(g.NOT_ALLOW_AUTOPLAY),e.addClass(g.PLAYING),e.isPlaying||(O.logInfo(">>>>playPromise.then"),e.isPlaying=!0,e.emit(et))}).catch(function(s){if(O.logWarn(">>>>playPromise.catch",s.name),e.video&&e.video.error){e.onError(),e.removeClass(g.ENTER);return}s.name==="NotAllowedError"&&(e._errorTimer=c.setTimeout(e,function(){e._errorTimer=null,e.emit(kr),e.addClass(g.NOT_ALLOW_AUTOPLAY),e.removeClass(g.ENTER),e.pause()},0))}):(O.logWarn("video.play not return promise"),this.isPlaying||(this.isPlaying=!0,this.removeClass(g.NOT_ALLOW_AUTOPLAY),this.removeClass(g.NO_START),this.removeClass(g.ENTER),this.addClass(g.PLAYING),this.emit(et))),a}},{key:"videoPause",value:function(){F(x(i.prototype),"pause",this).call(this)}},{key:"play",value:function(){var e=this;this.removeClass(g.PAUSED),M(this,"play",function(){e.videoPlay()})}},{key:"pause",value:function(e){var o=this;M(this,"pause",function(){e===oi.BUFFER_CONTROLS?o.isBufferControlPaused||(o.isBufferControlPaused=!0,o.emit($e,{type:Vt.WAITING})):o.isBufferControlPaused&&(o.isBufferControlPaused=!1,o.emit($e,{type:Vt.PLAYING})),F(x(i.prototype),"pause",o).call(o)},e)}},{key:"seek",value:function(e,o){var a=this;if(!(!this.video||Number.isNaN(Number(e))||!this.hasStart)){var s=this.config,u=s.isSeekedPlay,l=s.seekedStatus,h=o||(u?"play":l);e=e<0?0:e>this.duration?parseInt(this.duration,10):e,!this._isPauseBeforeSeek&&(this._isPauseBeforeSeek=this.paused?2:1),this._onceSeekCanplay&&this.off(Qe,this._onceSeekCanplay),this._onceSeekCanplay=function(){switch(a.removeClass(g.ENTER),a.isSeeking=!1,h){case"play":a.play();break;case"pause":a.pause();break;default:a._isPauseBeforeSeek>1||a.paused?a.pause():a.play()}a._isPauseBeforeSeek=0,a._onceSeekCanplay=null},this.once(Qe,this._onceSeekCanplay),this.isPlaying?this.currentTime=e:(this.removeClass(g.NO_START),this.currentTime=e,this.play())}}},{key:"getInitDefinition",value:function(){var e=this,o=this.config,a=o.definition,s=o.url;!s&&a&&a.list&&a.list.length>0&&a.defaultDefinition&&a.list.map(function(u){u.definition===a.defaultDefinition&&(e.config.url=u.url,e.curDefinition=u.definition)})}},{key:"changeDefinition",value:function(e,o){var a=this,s=this.config.definition;if(Array.isArray(s==null?void 0:s.list)&&s.list.forEach(function(l){(e==null?void 0:e.definition)===l.definition&&(a.curDefinition=l)}),e!=null&&e.bitrate&&typeof e.bitrate!="number"&&(e.bitrate=parseInt(e.bitrate,10)||0),this.emit(xr,{from:o,to:e}),!this.hasStart){this.config.url=e.url;return}var u=this.switchURL(e.url);u&&u.then?u.then(function(){a.emit(Ft,{from:o,to:e})}):this.emit(Ft,{from:o,to:e})}},{key:"reload",value:function(){this.load(),this.reloadFunc=function(){this.play()},this.once("loadeddata",this.reloadFunc)}},{key:"resetState",value:function(){var e=this,o=g.NOT_ALLOW_AUTOPLAY,a=g.PLAYING,s=g.NO_START,u=g.PAUSED,l=g.REPLAY,h=g.ENTER,f=g.ENDED,d=g.ERROR,v=g.LOADING,y=[o,a,s,u,l,h,f,d,v];this.hasStart=!1,this.isError=!1,this.isPlaying=!1,this.videoPause(),this._accPlayed.acc=0,this._accPlayed.t=0,this._accPlayed.loopAcc=0,y.forEac
1h(function(b){e.removeClass(b)}),this.addClass(g.ENTER),this.emit(Dr)}},{key:"reset",value:function(){var e=this,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],a=arguments.length>1?arguments[1]:void 0;this.resetState();var s=this.plugins;if(s&&(o.map(function(l){e.deregister(l)}),a)){var u=tn();Object.keys(this.config).keys(function(l){e.config[l]!=="undefined"&&(l==="plugins"||l==="presets"||l==="el"||l==="id")&&(e.config[l]=u[l])})}}},{key:"destroy",value:function(){var e,o=this,a=this.innerContainer,s=this.root,u=this.video;if(!(!s||!u)){if(s.removeAttribute(X),this.updateAcc("destroy"),this._unbindEvents(),this._detachSourceEvents(this.video),c.clearAllTimers(this),this.emit(Rr),(e=H)===null||e===void 0||e.remove(this),w.destroy(this),In(this),F(x(i.prototype),"destroy",this).call(this),this.fullscreen&&this._fullscreenEl===this.root)try{this.exitFullscreen()}catch(d){}if(a)for(var l=a.children,h=0;h<l.length;h++)a.removeChild(l[h]);!a&&u instanceof window.Node&&s.contains(u)&&s.removeChild(u),["topBar","leftBar","rightBar","innerContainer"].map(function(d){o[d]&&s.removeChild(o[d]),o[d]=null});var f=s.className.split(" ");f.length>0?s.className=f.filter(function(d){return d.indexOf("xgplayer")<0}).join(" "):s.className="",this.removeAttribute("data-xgfill"),["isReady","isPlaying","isSeeking","isCanplay","isActive","isCssfullScreen","fullscreen"].map(function(d){o[d]=!1})}}},{key:"replay",value:function(){var e=this;this.removeClass(g.ENDED),this.currentTime=0,this.isSeeking=!1,M(this,"replay",function(){e.once(Qe,function(){var o=e.videoPlay();o&&o.catch&&o.catch(function(a){})}),e.play(),e.emit(Ar),e.onPlay()})}},{key:"retry",value:function(){var e=this;this.removeClass(g.ERROR),this.addClass(g.LOADING),M(this,"retry",function(){var o=e.currentTime;e.src=e.config.url,!e.config.isLive&&(e.currentTime=o),e.once(Fe,function(){e.videoPlay()})})}},{key:"changeFullStyle",value:function(e,o,a,s){e&&(s||(s=g.PARENT_FULLSCREEN),this._orgCss||(this._orgCss=c.filterStyleFromText(e)),c.addClass(e,a),o&&o!==e&&!this._orgPCss&&(this._orgPCss=c.filterStyleFromText(o),c.addClass(o,s),o.setAttribute(X,this.playerId)))}},{key:"recoverFullStyle",value:function(e,o,a,s){s||(s=g.PARENT_FULLSCREEN),this._orgCss&&(c.setStyleFromCsstext(e,this._orgCss),this._orgCss=""),c.removeClass(e,a),o&&o!==e&&this._orgPCss&&(c.setStyleFromCsstext(o,this._orgPCss),this._orgPCss="",c.removeClass(o,s),o.removeAttribute(X))}},{key:"getFullscreen",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.config.fullscreenTarget,o=this.root,a=this.video;e||(e=o),this._fullScreenOffset={top:c.scrollTop(),left:c.scrollLeft()},this._fullscreenEl=e,this._fullActionFrom="get";var s=c.getFullScreenEl();if(s===this._fullscreenEl)return this.onFullscreenChange(),Promise.resolve();try{this.changeFullStyle(this.root,e,g.FULLSCREEN);for(var u=0;u<Ht.length;u++){var l=Ht[u];if(e[l]){var h=l==="webkitRequestFullscreen"?e.webkitRequestFullscreen(window.Element.ALLOW_KEYBOARD_INPUT):e[l]();return h&&h.then?h:Promise.resolve()}}return a.fullscreenEnabled||a.webkitSupportsFullscreen?(a.webkitEnterFullscreen(),Promise.resolve()):(this.recoverFullStyle(this.root,this._fullscreenEl,g.FULLSCREEN),Promise.reject(new Error("call getFullscreen fail")))}catch(f){return this.recoverFullStyle(this.root,this._fullscreenEl,g.FULLSCREEN),Promise.reject(f)}}},{key:"exitFullscreen",value:function(e){if(!(!this._fullscreenEl&&!c.getFullScreenEl())){this.root;var o=this.video;this._fullActionFrom="exit";for(var a=0;a<Gt.length;a++){var s=Gt[a];if(document[s]){var u=document[s]();return u&&u.then?u:Promise.resolve()}}return o&&o.webkitSupportsFullscreen?(o.webkitExitFullScreen(),Promise.resolve()):Promise.reject(new Error("call exitFullscreen fail"))}}},{key:"getCssFullscreen",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.config.fullscreenTarget;this.fullscreen&&this.exitFullscreen(),this._cssfullscreenEl=e,this.changeFullStyle(this.root,e,e?g.INNER_FULLSCREEN:g.CSS_FULLSCREEN),this.isCssfullScreen=!0,this.emit(Dt,!0)}},{key:"exitCssFullscreen",value:function(){var e=this._cssfullscreenEl?g.INNER_FULLSCREEN:g.CSS_FULLSCREEN;this.fullscreen?this.removeClass(e):this.recoverFullStyle(this.root,this._cssfullscreenEl,e),this._cssfullscreenEl=null,this.isCssfullScreen=!1,this.emit
1(Dt,!1)}},{key:"focus",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{autoHide:!this.config.closeDelayBlur,delay:this.config.inactive};if(this.isActive){this.onFocus(e);return}this.emit(Or,ut({paused:this.paused,ended:this.ended},e))}},{key:"blur",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{ignorePaused:!1};if(!this.isActive){this.onBlur(e);return}this.emit(Sr,ut({paused:this.paused,ended:this.ended},e))}},{key:"onFocus",value:function(){var e=this,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{autoHide:!0,delay:3e3},a=this.innerStates;if(this.isActive=!0,this.removeClass(g.ACTIVE),this.userTimer&&(c.clearTimeout(this,this.userTimer),this.userTimer=null),o.isLock!==void 0&&(a.isActiveLocked=o.isLock),o.autoHide===!1||o.isLock===!0||a.isActiveLocked){this.userTimer&&(c.clearTimeout(this,this.userTimer),this.userTimer=null);return}var s=o&&o.delay?o.delay:this.config.inactive;this.userTimer=c.setTimeout(this,function(){e.userTimer=null,e.blur()},s)}},{key:"onBlur",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{ignorePaused:!1};if(!(!this.isActive||this.innerStates.isActiveLocked)){var o=this.config.closePauseVideoFocus;this.isActive=!1,(e.ignorePaused||o||!this.paused&&!this.ended)&&this.addClass(g.ACTIVE)}}},{key:"onEmptied",value:function(){this.updateAcc("emptied")}},{key:"onCanplay",value:function(){this.hasStart&&this.removeClass(g.ENTER),!this.isBufferControlPaused&&this.removeClass(g.LOADING),this.isCanplay=!0,this.waitTimer&&c.clearTimeout(this,this.waitTimer)}},{key:"onLoadeddata",value:function(){this.isError=!1}},{key:"onPlay",value:function(){this.removeClass(g.PAUSED),this.ended&&this.removeClass(g.ENDED),!this.config.closePlayVideoFocus&&this.focus()}},{key:"onPause",value:function(){!this.isBufferControlPaused&&this.addClass(g.PAUSED),this.updateAcc("pause"),this.config.closePauseVideoFocus||(this.userTimer&&(c.clearTimeout(this,this.userTimer),this.userTimer=null),this.focus())}},{key:"onEnded",value:function(){this.isBufferControlPaused=!1,this.updateAcc("ended"),this.addClass(g.ENDED)}},{key:"onError",value:function(){this.isBufferControlPaused=!1,this.isError=!0,this.updateAcc("error"),this.removeClass(g.NOT_ALLOW_AUTOPLAY),this.removeClass(g.NO_START),this.removeClass(g.ENTER),this.removeClass(g.LOADING),this.addClass(g.ERROR)}},{key:"onSeeking",value:function(){this.isSeeking||this.updateAcc("seeking"),this.isSeeking=!0,this.addClass(g.SEEKING)}},{key:"onSeeked",value:function(){this.isSeeking=!1,this.waitTimer&&c.clearTimeout(this,this.waitTimer),this.removeClass(g.LOADING),this.removeClass(g.SEEKING)}},{key:"onWaiting",value:function(){var e=this;this.waitTimer&&c.clearTimeout(this,this.waitTimer),this.updateAcc("waiting"),this.waitTimer=c.setTimeout(this,function(){e.addClass(g.LOADING),c.clearTimeout(e,e.waitTimer),e.waitTimer=null},200)}},{key:"onPlaying",value:function(){var e=this;this.isError=!1;var o=g.NO_START,a=g.PAUSED,s=g.ENDED,u=g.ERROR,l=g.REPLAY,h=g.LOADING,f=[o,a,s,u,l,h];f.forEach(function(d){e.removeClass(d)})}},{key:"onTimeupdate",value:function(){!this._videoHeight&&this.getVideoSize(),(this.waitTimer||this.hasClass(g.LOADING))&&this.video.readyState>2&&(!this.isBufferControlPaused&&this.removeClass(g.LOADING),c.clearTimeout(this,this.waitTimer),this.waitTimer=null),!this.paused&&!this.isPlaying&&this.duration&&(this.isPlaying=!0,this.emit(et)),!this._accPlayed.t&&!this.paused&&!this.ended&&(this._accPlayed.t=new Date().getTime())}},{key:"onVolumechange",value:function(){c.typeOf(this.config.volume)==="Number"&&(this.config.volume=this.volume)}},{key:"onRatechange",value:function(){this.config.defaultPlaybackRate=this.playbackRate}},{key:"onBufferControl",value:function(e){this.isPlaying&&(e.type==="waiting"?(this.isBufferControlPaused=!0,this.addClass(g.LOADING),this.removeClass(g.PAUSED)):e.type==="playing"&&(this.isBufferControlPaused=!1,this.removeClass(g.LOADING),this.paused&&this.addClass(g.PAUSED)))}},{key:"emitUserAction",value:function(e,o){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(!(!this.video||!o||!e)){var s=c.typeOf(e)==="String"?e:e.type||"";o==="switch_play_pause"&&(c.typeOf(a.paused)==="Undefined"&&(a.paused=this.paused),a.isFirstStart=!this.playing),this.emit
1($t,ut({eventType:s,action:o,currentTime:this.currentTime,duration:this.duration,ended:this.ended,event:e},a))}}},{key:"updateAcc",value:function(e){if(this._accPlayed.t){var o=new Date().getTime()-this._accPlayed.t;this._accPlayed.acc+=o,this._accPlayed.t=0,(e==="ended"||this.ended)&&(this._accPlayed.loopAcc=this._accPlayed.acc)}}},{key:"checkBuffer",value:function(e){var o=this.video.buffered;if(!o||o.length===0||!this.duration)return!0;for(var a=parseInt((e||this.video.currentTime||0)*1e3,10),s=o.length,u=0;u<s;u++)if(parseInt(o.start(u)*1e3,10)+200<=a&&parseInt(o.end(u)*1e3,10)-200>a)return!0;return!1}},{key:"resizePosition",value:function(){var e=this.videoPos,o=e.rotate,a=e.vy,s=e.vx,u=e.h,l=e.w;if(!(o<0&&u<0&&l<0)){var h=this.videoPos._pi;if(!h&&this.video.videoHeight&&(h=this.video.videoWidth/this.video.videoHeight*100),!!h){this.videoPos.pi=h;var f={},d=0,v=0,y=1,b=o<0?0:Math.abs(o/90),p=this.root,_=this.innerContainer,E=p.offsetWidth,m=_?_.offsetHeight:p.offsetHeight,C=m,T=E,K={width:E,height:m};if(b%2===0)y=u>0?100/u:l>0?100/l:1,f.scale=y,d=a>0?(100-u)/2-a:0,f.y=b===2?0-d:d,v=s>0?(100-l)/2-s:0,f.x=b===2?0-v:v,K.width=T,K.height=C;else if(b%2===1){T=m,C=E;var Re=m-E;v=-Re/2/T*100,f.x=b===3?v+a/2:v-a/2,d=Re/2/C*100,f.y=b===3?d+s/2:d-s/2,f.scale=y,K.width=T,K.height=C}var pe=this.video;o>=0&&["width","height"].forEach(function(P){pe.style[P]="".concat(K[P],"px")}),f.rotate=o<0?0:o;var Y=c.getTransformStyle(f,this.video.style.transform||this.video.style.webkitTransform);pe.style.transform=Y,pe.style.webkitTransform=Y}}}},{key:"position",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{h:0,y:0,x:0,w:0};if(!(!this.video||!e||!e.h)){var o=this.videoPos;o.h=e.h*100||0,o.w=e.w*100||0,o.vx=e.x*100||0,o.vy=e.y*100||0,this.resizePosition()}}},{key:"setConfig",value:function(e){var o=this;e&&Object.keys(e).map(function(a){if(a!=="plugins"){o.config[a]=e[a];var s=o.plugins[a.toLowerCase()];s&&c.typeOf(s.setConfig)==="Function"&&s.setConfig(e[a])}})}},{key:"playNext",value:function(e){var o=this;this.resetState(),this._currentTime=0,this._duration=0,this.isPlaying=!1,this.setConfig(e),this.vtype="MP4",M(this,"playnext",function(){o.start(),o.emit(Nr,e)})}},{key:"getVideoSize",value:function(){var e=this;if(this.video){var o=this.root.getBoundingClientRect();this.sizeInfo.width=o.width,this.sizeInfo.height=o.height,this.sizeInfo.left=o.left,this.sizeInfo.top=o.top;var a=this.video,s=a.videoWidth,u=a.videoHeight,l=this.config,h=l.fitVideoSize,f=l.videoFillMode;if((f==="fill"||f==="cover"||f==="contain")&&this.setAttribute("data-xgfill",f),!(!u||!s)){this._videoHeight=u,this._videoWidth=s;var d=this.controls&&this.innerContainer?this.controls.root.getBoundingClientRect().height:0,v=o.width,y=o.height-d,b=parseInt(s/u*1e3,10),p=parseInt(v/y*1e3,10),_=v,E=y,m={};h==="auto"&&p>b||h==="fixWidth"?(E=v/b*1e3,this.config.fluid?m.paddingTop="".concat(E*100/_,"%"):m.height="".concat(E+d,"px")):(h==="auto"&&p<b||h==="fixHeight")&&(_=b*y/1e3,m.width="".concat(_,"px")),!this.fullscreen&&!this.cssfullscreen&&Object.keys(m).forEach(function(T){e.root.style[T]=m[T]}),(f==="fillHeight"&&p<b||f==="fillWidth"&&p>b)&&this.setAttribute("data-xgfill","cover");var C={videoScale:b,vWidth:_,vHeight:E,cWidth:_,cHeight:E+d};this.resizePosition(),this.emit(Lr,C)}}}},{key:"updateObjectPosition",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;if(this.video.updateObjectPosition){this.video.updateObjectPosition(e,o);return}this.video.style.objectPosition="".concat(e*100,"% ").concat(o*100,"%")}},{key:"preProcessUrl",value:function(e,o){var a=this.config,s=a.preProcessUrl,u=a.preProcessUrlOptions,l=Object.assign({},u,o);return!c.isBlob(e)&&typeof s=="function"?s(e,l):{url:e}}},{key:"src",get:function(){return this.video?this.video.src:""},set:function(e){if(this.video){if(this.emit(kn,e),this.emit(_r),this._currentTime=0,this._duration=0,c.isMSE(this.video)){this.onWaiting();return}e=this.preProcessUrl(e).url,this._detachSourceEvents(this.video),c.typeOf(e)==="Array"?this._attachSourceEvents(this.video,e):e?this.video.src=e:this.video.removeAttribute("src"),this.load()}}},{key:"definitionList",get:function(){return!this.config||!this.config.definition?[]:this.config.definition.list||[]},set:function(e){var o=this,a=this.config.definition;
1a.list=e,this.emit("resourceReady",e);var s=null,u=null;e.map(function(l){o.curDefinition===l.definition&&(s=l),a.defaultDefinition===l.definition&&(u=l)}),!u&&e.length>0&&(u=e[0]),s?this.changeDefinition(s):u&&this.changeDefinition(u)}},{key:"videoFrameInfo",get:function(){var e={total:0,dropped:0,corrupted:0,droppedRate:0,droppedDuration:0};if(!this.video||!this.video.getVideoPlaybackQuality)return e;var o=this.video.getVideoPlaybackQuality();return e.dropped=o.droppedVideoFrames||0,e.total=o.totalVideoFrames||0,e.corrupted=o.corruptedVideoFrames||0,e.total>0&&(e.droppedRate=e.dropped/e.total*100,e.droppedDuration=parseInt(this.cumulateTime/e.total*e.dropped,0)),e}},{key:"lang",get:function(){return this.config.lang},set:function(e){var o=at.langKeys.filter(function(a){return a===e});o.length===0&&e!=="zh"||(this.config.lang=e,w.setLang(e,this))}},{key:"i18n",get:function(){var e=this.config.lang;return e==="zh"&&(e="zh-cn"),this.__i18n.lang[e]||this.__i18n.lang.en}},{key:"i18nKeys",get:function(){return this.__i18n.textKeys||{}}},{key:"version",get:function(){return ft}},{key:"playerId",get:function(){return this._pluginInfoId}},{key:"url",get:function(){return this.__url||this.config.url},set:function(e){this.__url=e}},{key:"poster",get:function(){return this.plugins.poster?this.plugins.poster.config.poster:this.config.poster},set:function(e){this.plugins.poster&&this.plugins.poster.update(e)}},{key:"readyState",get:function(){var e=F(x(i.prototype),"readyState",this);return this.i18n[e]||e}},{key:"error",get:function(){var e=F(x(i.prototype),"error",this);return this.i18n[e]||e}},{key:"networkState",get:function(){var e=F(x(i.prototype),"networkState",this);return this.i18n[e]||e}},{key:"fullscreenChanging",get:function(){return this._fullScreenOffset!==null}},{key:"cumulateTime",get:function(){var e=this._accPlayed;return this.updateAcc("get"),e.acc}},{key:"zoom",get:function(){return this.config.zoom},set:function(e){this.config.zoom=e}},{key:"videoRotateDeg",get:function(){return this.videoPos.rotate},set:function(e){e=c.convertDeg(e),!(e%90!==0||e===this.videoPos.rotate)&&(this.videoPos.rotate=e,this.resizePosition())}},{key:"avgSpeed",get:function(){return ln},set:function(e){ln=e}},{key:"realTimeSpeed",get:function(){return un},set:function(e){un=e}},{key:"hook",value:function(e,o){return Me.call.apply(Me,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"useHooks",value:function(e,o){return Be.call.apply(Be,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"removeHooks",value:function(e,o){return Ue.call.apply(Ue,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"usePluginHooks",value:function(e,o,a){for(var s=arguments.length,u=new Array(s>3?s-3:0),l=3;l<s;l++)u[l-3]=arguments[l];return zt.call.apply(zt,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"removePluginHooks",value:function(e,o,a){for(var s=arguments.length,u=new Array(s>3?s-3:0),l=3;l<s;l++)u[l-3]=arguments[l];return Kt.call.apply(Kt,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"setUserActive",value:function(e,o){var a;typeof o=="boolean"&&o!==this.muted&&(this.addInnerOP("volumechange"),this.muted=o),(a=H)===null||a===void 0||a.setActive(this.playerId,e)}}],[{key:"debugger",get:function(){return O.config.debug},set:function(e){O.config.debug=e}},{key:"instManager",get:function(){return H},set:function(e){H=e}},{key:"pluginsManager",get:function(){return w}},{key:"getCurrentUserActivePlayerId",value:function(){var e;return(e=H)===null||e===void 0?void 0:e.getActiveId()}},{key:"setCurrentUserActive",value:function(e,o){var a;(a=H)===null||a===void 0||a.setActive(e,o)}},{key:"isHevcSupported",value:function(){return S.isHevcSupported()}},{key:"probeConfigSupported",value:function(e){return S.probeConfigSupported(e)}},{key:"install",value:function(e,o){i.plugins||(i.plugins={}),i.plugins[e]||(i.plugins[e]=o)}},{key:"use",value:function(e,o){i.plugins||(i.plugins={}),i.plugins[e]=o}}]),i}(Qr);J(Xe,"defaultPreset",null);J(Xe,"XgVideoProxy",null);Xe.instManager=Oo.getInstance();function ue(n){"@babel/helpers - typeof";return ue=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ue(n)}function Lo(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function")}function cn(n,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(n,Do(r.key),r)}}function No(n,t,i){return t&&cn(n.prototype,t),i&&cn(n,i),Object.defineProperty(n,"prototype",{writable:!1}),n}function Do(n){var t=Fo(n,"string");return ue(t)==="symbol"?t:String(t)}function Fo(n,t){if(ue(n)!=="object"||n===null)return n;var i=n[Symbol.toPrimitive];if(i!==void 0){var r=i.call(n,t||"default");if(ue(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(n)}function $o(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(t&&t.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),t&&Et(n,t)}function Et(n,t){return Et=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,e){return r.__proto__=e,r},Et(n,t)}function jo(n){var t=Uo();return function(){var r=Ve(n),e;if(t){var o=Ve(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return Mo(this,e)}}function Mo(n,t){if(t&&(ue(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Bo(n)}function Bo(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function Uo(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(n){return!1}}function Ve(n){return Ve=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(i){return i.__proto__||Object.getPrototypeOf(i)},Ve(n)}var Ho=function(n){$o(i,n);var t=jo(i);function i(){return Lo(this,i),t.apply(this,arguments)}return No(i,[{key:"isEndedShow",get:function(){return this.config.isEndedShow},set:function(e){this.config.isEndedShow=e}},{key:"hide",value:function(){c.addClass(this.root,"hide")}},{key:"show",value:function(){c.removeClass(this.root,"hide")}},{key:"beforeCreate",value:function(e){typeof e.player.config.poster=="string"&&(e.config.poster=e.player.config.poster)}},{key:"afterCreate",value:function(){var e=this;this.on(Tn,function(){e.isEndedShow&&c.removeClass(e.root,"hide")}),this.config.hideCanplay?(this.once(Ze,function(){e.onTimeUpdate()}),this.on(kn,function(){c.removeClass(e.root,"hide"),c.addClass(e.root,"xg-showplay"),e.once(Ze,function(){e.onTimeUpdate()})})):this.on(wn,function(){c.addClass(e.root,"hide")})}},{key:"onTimeUpdate",value:function(){var e=this;this.player.currentTime?c.removeClass(this.root,"xg-showplay"):this.once(Ze,function(){e.onTimeUpdate()})}},{key:"update",value:function(e){e&&(this.config.poster=e,this.root.style.backgroundImage="url(".concat(e,")"))}},{key:"render",value:function(){var e=this.config,o=e.poster,a=e.hideCanplay,s=o?"background-image:url(".concat(o,");"):"";return'<xg-poster class="xgplayer-poster '.concat(a?"xg-showplay":"",'" style="').concat(s,'">\n </xg-poster>')}}],[{key:"pluginName",get:function(){return"poster"}},{key:"defaultConfig",get:function(){return{isEndedShow:!0,hideCanplay:!1,poster:""}}}]),i}(Ae);const Go=Ho;function le(n){"@babel/helpers - typeof";return le=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},le(n)}function Vo(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function")}function fn(n,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(n,Bn(r.key),r)}}function zo(n,t,i){return t&&fn(n.prototype,t),i&&fn(n,i),Object.defineProperty(n,"prototype",{writable:!1}),n}function Ko(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(t&&t.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),t&&Ot(n,t)}function Ot(n,t){return Ot=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,e){return r.__proto__=e,r},Ot(n,t)}function Yo(n){var t=Xo();return function(){var r=ze(n),e;if(t){var o=ze(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return Wo(this,e)}}function Wo(n,t){if(t&&(le(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return I(n)}function I(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function Xo(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(n){return!1}}function ze(n){return ze=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(i){return i.__proto__||Object.getPrototypeOf(i)},ze(n)}
1function ye(n,t,i){return t=Bn(t),t in n?Object.defineProperty(n,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[t]=i,n}function Bn(n){var t=qo(n,"string");return le(t)==="symbol"?t:String(t)}function qo(n,t){if(le(n)!=="object"||n===null)return n;var i=n[Symbol.toPrimitive];if(i!==void 0){var r=i.call(n,t||"default");if(le(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(n)}var Ne={mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",mousemove:"onMouseMove"},lt=["videoClick","videoDbClick"],Jo=function(n){Ko(i,n);var t=Yo(i);function i(){var r;Vo(this,i);for(var e=arguments.length,o=new Array(e),a=0;a<e;a++)o[a]=arguments[a];return r=t.call.apply(t,[this].concat(o)),ye(I(r),"onMouseMove",function(s){var u=I(r),l=u.player,h=u.playerConfig;l.isActive||(l.focus({autoHide:!h.closeDelayBlur}),!h.closeFocusVideoFocus&&l.video.focus())}),ye(I(r),"onMouseEnter",function(s){var u=I(r),l=u.playerConfig,h=u.player;!l.closeFocusVideoFocus&&h.video.focus(),l.closeDelayBlur?h.focus({autoHide:!1}):h.focus()}),ye(I(r),"onMouseLeave",function(s){var u=r.playerConfig,l=u.closePlayerBlur,h=u.leavePlayerTime,f=u.closeDelayBlur;!l&&!f&&(h?r.player.focus({autoHide:!0,delay:h}):r.player.blur())}),ye(I(r),"onVideoClick",function(s){var u=I(r),l=u.player,h=u.playerConfig;s.target&&h.closeVideoClick||(s.target===l.video||s.target===l.innerContainer||s.target===l.video.__canvas)&&(s.preventDefault(),h.closeVideoStopPropagation||s.stopPropagation(),r._clickCount++,r.clickTimer&&(clearTimeout(r.clickTimer),r.clickTimer=null),r.clickTimer=setTimeout(function(){r._clickCount&&(r._clickCount--,M(I(r),lt[0],function(f,d){r.switchPlayPause(d.e)},{e:s,paused:l.paused}),clearTimeout(r.clickTimer),r.clickTimer=null)},300))}),ye(I(r),"onVideoDblClick",function(s){var u=I(r),l=u.player,h=u.playerConfig;if(!(h.closeVideoDblclick||!s.target||s.target!==l.video&&s.target!==l.video.__canvas)){if(r._clickCount<2){r._clickCount=0;return}r._clickCount=0,r.clickTimer&&(clearTimeout(r.clickTimer),r.clickTimer=null),s.preventDefault(),s.stopPropagation(),M(I(r),lt[1],function(f,d){r.emitUserAction(d.e,"switch_fullscreen",{fullscreen:l.fullscreen}),l.fullscreen?l.exitFullscreen():l.getFullscreen()},{e:s,fullscreen:l.fullscreen})}}),r}return zo(i,[{key:"afterCreate",value:function(){var e=this;this._clickCount=0,lt.map(function(a){e.__hooks[a]=null});var o=this.playerConfig.isMobileSimulateMode;o==="mobile"||S.device==="mobile"&&!S.os.isIpad||this.initEvents()}},{key:"initEvents",value:function(){var e=this,o=this.player,a=o.video,s=o.root,u=this.playerConfig.enableContextmenu;a&&a.addEventListener("click",this.onVideoClick,!1),a&&a.addEventListener("dblclick",this.onVideoDblClick,!1),Object.keys(Ne).map(function(l){s.addEventListener(l,e[Ne[l]],!1)}),u&&a&&a.addEventListener("contextmenu",this.onContextmenu,!1)}},{key:"switchPlayPause",value:function(e){var o=this.player;this.emitUserAction(e,"switch_play_pause"),o.ended?o.duration!==1/0&&o.duration>0&&o.replay():o.paused?o.play():o.pause()}},{key:"onContextmenu",value:function(e){e=e||window.event,e.preventDefault&&e.preventDefault(),e.stopPropagation?e.stopPropagation():(e.returnValue=!1,e.cancelBubble=!0)}},{key:"destroy",value:function(){var e=this,o=this.player,a=o.video,s=o.root;this.clickTimer&&clearTimeout(this.clickTimer),a.removeEventListener("click",this.onVideoClick,!1),a.removeEventListener("dblclick",this.onVideoDblClick,!1),a.removeEventListener("contextmenu",this.onContextmenu,!1),Object.keys(Ne).map(function(u){s.removeEventListener(u,e[Ne[u]],!1)})}}],[{key:"pluginName",get:function(){return"pc"}},{key:"defaultConfig",get:function(){return{}}}]),i}(He);function Ce(n){"@babel/helpers - typeof";return Ce=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ce(n)}function Qo(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function")}function hn(n,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(n,Un(r.key),r)}}function Zo(n,t,i){return t&&hn(n.prototype,t),i&&hn(n,i),Object.defineProperty(n,"prototype",{writable:!1}),n}function De(n,t,i){return t=Un(t),t in n?Object.defineProperty(n,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[t]=i,n}function Un(n){var t=ea(n,"string");return Ce(t)==="symbol"?t:String(t)}function ea(n,t){if(Ce(n)!=="object"||n===null)return n;var i=n[Symbol.toPrimitive];if(i!==void 0){var r=i.call(n,t||"default");if(Ce(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(n)}var G={PRESS:"press",PRESS_END:"pressend",DOUBlE_CLICK:"doubleclick",CLICK:"click",TOUCH_MOVE:"touchmove",TOUC
1H_START:"touchstart",TOUCH_END:"touchend"},ta={start:"touchstart",end:"touchend",move:"touchmove",cancel:"touchcancel"},na={start:"mousedown",end:"mouseup",move:"mousemove",cancel:"mouseleave"};function dn(n){return n&&n.length>0?n[n.length-1]:null}function gn(n){var t=navigator.userAgent;/(?:iPhone|iPad)/.test(t)&&n.cancelable&&n.preventDefault()}function ra(){return{pressDelay:600,dbClickDelay:200,disablePress:!1,disableDbClick:!1,miniStep:2,needPreventDefault:!0}}var ia=function(){function n(t){var i=this,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{eventType:"touch"};Qo(this,n),De(this,"onTouchStart",function(e){var o=i._pos,a=i.root,s=i.config;s.needPreventDefault&&gn(e);var u=dn(e.touches);o.x=u?parseInt(u.pageX,10):e.pageX,o.y=u?parseInt(u.pageX,10):e.pageX,o.start=!0,i.__setPress(e),a.addEventListener(i.events.end,i.onTouchEnd),a.addEventListener(i.events.cancel,i.onTouchCancel),a.addEventListener(i.events.move,i.onTouchMove),i.trigger(G.TOUCH_START,e)}),De(this,"onTouchCancel",function(e){i.onTouchEnd(e)}),De(this,"onTouchEnd",function(e){var o=i._pos,a=i.root,s=i.config;s.needPreventDefault&&gn(e),i.__clearPress(),a.removeEventListener(i.events.cancel,i.onTouchCancel),a.removeEventListener(i.events.end,i.onTouchEnd),a.removeEventListener(i.events.move,i.onTouchMove),e.moving=o.moving,e.press=o.press,o.press&&i.trigger(G.PRESS_END,e),i.trigger(G.TOUCH_END,e),!o.press&&!o.moving&&i.__setDb(e),o.press=!1,o.start=!1,o.moving=!1}),De(this,"onTouchMove",function(e){var o=i._pos,a=i.config,s=dn(e.touches),u=s?parseInt(s.pageX,10):e.pageX,l=s?parseInt(s.pageY,10):e.pageX,h=u-o.x,f=l-o.y;Math.abs(f)<a.miniStep&&Math.abs(h)<a.miniStep||(i.__clearPress(),o.press&&i.trigger(G.PRESS_END,e),o.press=!1,o.moving=!0,i.trigger(G.TOUCH_MOVE,e))}),this._pos={moving:!1,start:!1,x:0,y:0},this.config=ra(),Object.keys(r).map(function(e){i.config[e]=r[e]}),this.root=t,this.events=r.eventType==="mouse"?na:ta,this.pressIntrvalId=null,this.dbIntrvalId=null,this.__handlers={},this._initEvent()}return Zo(n,[{key:"_initEvent",value:function(){this.root.addEventListener(this.events.start,this.onTouchStart)}},{key:"__setPress",value:function(i){var r=this,e=this.config;this.pressIntrvalId&&this.__clearPress(),this.pressIntrvalId=setTimeout(function(){r.trigger(G.PRESS,i),r._pos.press=!0,r.__clearPress()},e.pressDelay)}},{key:"__clearPress",value:function(){window.clearTimeout(this.pressIntrvalId),this.pressIntrvalId=null}},{key:"__setDb",value:function(i){var r=this,e=this.config;if(this.dbIntrvalId){this.__clearDb(),this.trigger(G.DOUBlE_CLICK,i);return}this.dbIntrvalId=setTimeout(function(){r.__clearDb(),!r._pos.start&&!r._pos.press&&!r._pos.moving&&r.trigger(G.CLICK,i)},e.dbClickDelay)}},{key:"__clearDb",value:function(){clearTimeout(this.dbIntrvalId),this.dbIntrvalId=null}},{key:"on",value:function(i,r){this.__handlers[i]||(this.__handlers[i]=[]),this.__handlers[i].push(r)}},{key:"off",value:function(i,r){if(this.__handlers[i]){for(var e=this.__handlers[i],o=-1,a=0;a<e.length;a++)if(e[a]===r){o=a;break}o>=0&&this.__handlers[i].splice(o,1)}}},{key:"trigger",value:function(i,r){this.__handlers[i]&&this.__handlers[i].map(function(e){try{e(r)}catch(o){}})}},{key:"destroy",value:function(){var i=this,r={touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart"};Object.keys(r).forEach(function(e){i.root.removeEventListener(e,i[r[e]])})}}]),n}();const oa=ia;function ce(n){"@babel/helpers - typeof";return ce=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ce(n)}function aa(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function")}function pn(n,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(n,Hn(r.key),r)}}function sa(n,t,i){return t&&pn(n.prototype,t),i&&pn(n,i),Object.defineProperty(n,"prototype",{writable:!1}),n}function ua(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(t&&t.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),t&&St(n,t)}function St(n,t){return St=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,e){return r.__proto__=e,r},St(n,t)}function la(n){var t=fa();return function(){var r=Ke(n),e;if(t){var o=Ke(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return ca(this,e)}}function ca(n,t){if(t&&(ce(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return j(n)}
1function j(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function fa(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(n){return!1}}function Ke(n){return Ke=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(i){return i.__proto__||Object.getPrototypeOf(i)},Ke(n)}function me(n,t,i){return t=Hn(t),t in n?Object.defineProperty(n,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[t]=i,n}function Hn(n){var t=ha(n,"string");return ce(t)==="symbol"?t:String(t)}function ha(n,t){if(ce(n)!=="object"||n===null)return n;var i=n[Symbol.toPrimitive];if(i!==void 0){var r=i.call(n,t||"default");if(ce(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(n)}var da='<svg width="20" height="9" viewBox="0 0 8 9" fill="none" xmlns="http://www.w3.org/2000/svg"><path opacity=".54" d="M7.5 3.634a1 1 0 010 1.732l-6 3.464A1 1 0 010 7.964V1.036A1 1 0 011.5.17l6 3.464z" fill="#fff"/><path d="M12.5 3.634a1 1 0 010 1.732l-6 3.464A1 1 0 015 7.964V1.036A1 1 0 016.5.17l6 3.464z" fill="#fff"/></svg>',W={AUTO:"auto",SEEKING:"seeking",PLAYBACK:"playbackrate",LIGHT:""},ct=["videoClick","videoDbClick"],ga=function(n){ua(i,n);var t=la(i);function i(r){var e;return aa(this,i),e=t.call(this,r),me(j(e),"onTouchStart",function(o){var a=j(e),s=a.player,u=a.config,l=a.pos,h=a.playerConfig,f=e.getTouche(o);if(f&&!u.disableGesture&&e.duration>0&&!s.ended){l.isStart=!0,c.checkIsFunction(h.disableSwipeHandler)&&h.disableSwipeHandler(),e.find(".xg-dur").innerHTML=c.format(e.duration);var d=e.root.getBoundingClientRect();s.rotateDeg===90?(l.top=d.left,l.left=d.top,l.width=d.height,l.height=d.width):(l.top=d.top,l.left=d.left,l.width=d.width,l.height=d.height);var v=parseInt(f.pageX-l.left,10),y=parseInt(f.pageY-l.top,10);l.x=s.rotateDeg===90?y:v,l.y=s.rotateDeg===90?v:y,l.scopeL=u.scopeL*l.width,l.scopeR=(1-u.scopeR)*l.width,l.scopeM1=l.width*(1-u.scopeM)/2,l.scopeM2=l.width-l.scopeM1}}),me(j(e),"onTouchMove",function(o){var a=e.getTouche(o),s=j(e),u=s.pos,l=s.config,h=s.player;if(!(!a||l.disableGesture||!e.duration||!u.isStart)){var f=l.miniMoveStep,d=l.hideControlsActive,v=parseInt(a.pageX-u.left,10),y=parseInt(a.pageY-u.top,10),b=h.rotateDeg===90?y:v,p=h.rotateDeg===90?v:y;if(Math.abs(b-u.x)>f||Math.abs(p-u.y)>f){var _=b-u.x,E=p-u.y,m=u.scope;if(m===-1&&(m=e.checkScope(b,p,_,E,u),m===0&&(d?h.blur():h.focus({autoHide:!1}),!u.time&&(u.time=parseInt(h.currentTime*1e3,10)+e.timeOffset*1e3)),u.scope=m),m===-1||m>0&&!l.gestureY||m===0&&!l.gestureX)return;o.cancelable&&o.preventDefault(),e.executeMove(_,E,m,u.width,u.height),u.x=b,u.y=p}}}),me(j(e),"onTouchEnd",function(o){var a=j(e),s=a.player,u=a.pos,l=a.playerConfig;u.isStart&&(u.scope>-1&&o.cancelable&&o.preventDefault(),e.endLastMove(u.scope),setTimeout(function(){s.getPlugin("progress")&&s.getPlugin("progress").resetSeekState()},10),u.scope=-1,e.resetPos(),c.checkIsFunction(l.enableSwipeHandler)&&l.enableSwipeHandler(),e.changeAction(W.AUTO))}),me(j(e),"onRootTouchMove",function(o){e.config.disableGesture||!e.config.gestureX||e.checkIsRootTarget(o)&&(o.stopPropagation(),e.pos.isStart?e.onTouchMove(o):e.onTouchStart(o))}),me(j(e),"onRootTouchEnd",function(o){if(e.pos.isStart&&e.checkIsRootTarget(o)){o.stopPropagation(),e.onTouchEnd(o);var a=e.player.controls;a&&a.recoverAutoHide()}}),e.pos={isStart:!1,x:0,y:0,time:0,volume:0,rate:1,light:0,width:0,height:0,scopeL:0,scopeR:0,scopeM1:0,scopeM2:0,scope:-1},e.timer=null,e}return sa(i,[{key:"duration",get:function(){return this.playerConfig.customDuration||this.player.duration}},{key:"timeOffset",get:function(){return this.playerConfig.timeOffset||0}},{key:"registerIcons",value:function(){return{seekTipIcon:{icon:da,class:"xg-seek-pre"}}}},{key:"afterCreate",value:function(){var e=this;ct.map(function(f){e.__hooks[f]=null});var o=this.playerConfig,a=this.config,s=this.player;o.closeVideoDblclick===!0&&(a.closedbClick=!0),this.resetPos(),c.isUndefined(o.disableGesture)||(a.disableGesture=!!o.disableGesture),this.appendChild(".xg-seek-icon",this.icons.seekTipIcon),this.xgMask=c.createDom("xg-mask","",{},"xgmask"),s.root.appendChild(this.xgMask),this.initCustomStyle(),this.registerThumbnail();var u=this.domEventType==="mouse"?"mouse":"touch";this.touch=new oa(this.root,{eventType:u,needPreventDefault:!this.config.disableGesture}),this.root.addEventListener("contextmenu",function(f){f.preventDefault()}),s.root.addEventListener("touchmove",this.onRootTouchMove,!0),s.root.addEventListener("touchend",this.onRootTouchEnd,!0),this.on(Pr,function(){var f=e.player,d=e.config;f.duration*1e3<d.moveDuration&&(d.moveDuration=f.duration*1e3)}),this.on([Fe,Tn],function(){var f=e.pos,d=f.time,v=f.isStart;!v&&d>0&&(e.pos.time=0)});var l={touchstart:"onTouchStart",touchmove:"onTouchMove",touchend:"onTouchEnd",press:"onPress",pressend:"onPressEnd",click:"onClick",doubleclick:"onDbClick"};if(Object.keys(l).forEach(function(f){e.touch.on(f,function(d){e[l[f]](d)})}),!a.disableActive){var h=s.plugins.progress;h&&(h.addCallBack("dragmove",function(f){e.activeSeekNote(f.currentTime,f.forward)}),h.addCallBack("dragend",function(){e.changeAction(W.AUTO)}),h.addCallBack("click",function(){e.changeAction(W.AUTO)}))}}},{key:"registerThumbnail",value:function(){var e=this.player,o=e.plugins.thumbnail;if(o&&o.usable){this.thumbnail=o.createThumbnail(null,"mobile-thumbnail");var a=this.find(".time-preview");a.insertBefore(this.thumbnail,a.children[0])}}},{key:"initCustomStyle",value:function(){var e=this.playerConfig||{},o=e.commonStyle,a=o.playedColor,s=o.progressColor;a&&(this.find(".xg-curbar").style.backgroundColor=a,this.find(".xg-cur").style.color=a),s&&(this.find(".xg-bar").style.backgroundColor=s,this.find(".time-preview").style.color=s),this.config.disableTimeProgress&&
1c.addClass(this.find(".xg-timebar"),"hide")}},{key:"resetPos",value:function(){var e=this;this.pos?(this.pos.isStart=!1,this.pos.scope=-1,["x","y","width","height","scopeL","scopeR","scopeM1","scopeM2"].map(function(o){e.pos[o]=0})):this.pos={isStart:!1,x:0,y:0,volume:0,rate:1,light:0,width:0,height:0,scopeL:0,scopeR:0,scopeM1:0,scopeM2:0,scope:-1,time:0}}},{key:"changeAction",value:function(e){var o=this.player,a=this.root;a.setAttribute("data-xg-action",e);var s=o.plugins.start;s&&s.recover()}},{key:"getTouche",value:function(e){var o=this.player.rotateDeg,a=e.touches&&e.touches.length>0?e.touches[e.touches.length-1]:e;return o===0?{pageX:a.pageX,pageY:a.pageY}:{pageX:a.pageX,pageY:a.pageY}}},{key:"checkScope",value:function(e,o,a,s,u){var l=u.width,h=-1;if(e<0||e>l)return h;var f=Math.abs(s===0?a:a/s);return Math.abs(a)>0&&f>=1.73&&e>u.scopeM1&&e<u.scopeM2?h=0:(Math.abs(a)===0||f<=.57)&&(h=e<u.scopeL?1:e>u.scopeR?2:3),h}},{key:"executeMove",value:function(e,o,a,s,u){switch(a){case 0:this.updateTime(e/s*this.config.scopeM);break;case 1:this.updateBrightness(o/u);break;case 2:S.os.isIos||this.updateVolume(o/u);break}}},{key:"endLastMove",value:function(e){var o=this,a=this.pos,s=this.player,u=this.config,l=(a.time-this.timeOffset)/1e3;switch(e){case 0:s.seek(Number(l).toFixed(1)),u.hideControlsEnd?s.blur():s.focus(),this.timer=setTimeout(function(){o.pos.time=0},500);break}this.changeAction(W.AUTO)}},{key:"checkIsRootTarget",value:function(e){var o=this.player.plugins||{};return o.progress&&o.progress.root.contains(e.target)?!1:o.start&&o.start.root.contains(e.target)||o.controls&&o.controls.root.contains(e.target)}},{key:"clickHandler",value:function(e){var o=this.player,a=this.config,s=this.playerConfig;if(!o.isPlaying){s.closeVideoClick||(this.emitUserAction("click","
1switch_play_pause"),o.play());return}!a.closedbClick||s.closeVideoClick?o.isActive?o.blur():o.focus():s.closeVideoClick||((o.isActive||a.focusVideoClick)&&(this.emitUserAction("click","switch_play_pause"),this.switchPlayPause()),o.focus())}},{key:"dbClickHandler",value:function(e){var o=this.config,a=this.player;!o.closedbClick&&a.isPlaying&&(this.emitUserAction("dblclick","switch_play_pause"),this.switchPlayPause())}},{key:"onClick",value:function(e){var o=this,a=this.player;M(this,ct[0],function(s,u){o.clickHandler(u.e)},{e,paused:a.paused})}},{key:"onDbClick",value:function(e){var o=this,a=this.player;M(this,ct[1],function(s,u){o.dbClickHandler(u.e)},{e,paused:a.paused})}},{key:"onPress",value:function(e){var o=this.pos,a=this.config,s=this.player;a.disablePress||(o.rate=this.player.playbackRate,this.emitUserAction("press","change_rate",{from:s.playbackRate,to:a.pressRate}),s.playbackRate=a.pressRate,this.changeAction(W.PLAYBACK))}},{key:"onPressEnd",value:function(e){var o=this.pos,a=this.config,s=this.player;a.disablePress||(this.emitUserAction("pressend","change_rate",{from:s.playbackRate,to:o.rate}),s.playbackRate=o.rate,o.rate=1,this.changeAction(W.AUTO))}},{key:"updateTime",value:function(e){var o=this.player,a=this.config,s=this.player.duration;e=Number(e.toFixed(4));var u=parseInt(e*a.moveDuration,10)+this.timeOffset;u+=this.pos.time,u=u<0?0:u>s*1e3?s*1e3-200:u,o.getPlugin("time")&&o.getPlugin("time").updateTime(u/1e3),o.getPlugin("progress")&&o.getPlugin("progress").updatePercent(u/1e3/this.duration,!0),this.activeSeekNote(u/1e3,e>0),a.isTouchingSeek&&o.seek(Number((u-this.timeOffset)/1e3).toFixed(1)),this.pos.time=u}},{key:"updateVolume",value:function(e){this.player.rotateDeg&&(e=-e);var o=this.player,a=this.pos;if(e=parseInt(e*100,10),a.volume+=e,!(Math.abs(a.volume)<10)){var s=parseInt(o.volume*10,10)-parseInt(a.volume/10,10);s=s>10?10:s<1?0:s,o.volume=s/10,a.volume=0}}},{key:"updateBrightness",value:function(e){this.player.rotateDeg&&(e=-e);var o=this.pos,a=this.config,s=this.xgMask,u=o.light+.8*e;u=u>a.maxDarkness?a.maxDarkness:u<0?0:u,s&&(s.style.backgroundColor="rgba(0,0,0,".concat(u,")")),o.light=u}},{key:"activeSeekNote",value:function(e){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,a=this.player,s=this.config,u=!(this.duration!==1/0&&this.duration>0);if(!(!e||typeof e!="number"||u||s.disableActive)){e<0?e=0:e>a.duration&&(e=a.duration-.2),this.changeAction(W.SEEKING);var l=a.plugins.start;l&&l.focusHide(),this.find(".xg-dur").innerHTML=c.format(this.duration),this.find(".xg-cur").innerHTML=c.format(e),this.find(".xg-curbar").style.width="".concat(e/this.duration*100,"%"),o?c.removeClass(this.find(".xg-seek-show"),"xg-back"):c.addClass(this.find(".xg-seek-show"),"xg-back"),this.updateThumbnails(e)}}},{key:"updateThumbnails",value:function(e){var o=this.player,a=o.plugins.thumbnail;a&&a.usable&&this.thumbnail&&a.update(this.thumbnail,e,160,90)}},{key:"switchPlayPause",value:function(){var e=this.player;if(e.hasStart)e.ended||(e.paused?e.play():e.pause());else return!1}},{key:"disableGesture",value:function(){this.config.disableGesture=!1}},{key:"enableGesture",value:function(){this.config.disableGesture=!0}},{key:"destroy",value:function(){var e=this.player;this.timer&&clearTimeout(this.timer),this.thumbnail=null,e.root.removeChild(this.xgMask),this.xgMask=null,this.touch&&this.touch.destroy(),this.touch=null,e.root.removeEventListener("touchmove",this.onRootTouchMove,!0),e.root.removeEventListener("touchend",this.onRootTouchEnd,!0)}},{key:"render",value:function(){var e=this.config.gradient!=="normal"?"gradient ".concat(this.config.gradient):"gradient";return'\n <xg-trigger class="trigger">\n <div class="'.concat(e,'"></div>\n <div class="time-preview">\n <div class="xg-seek-show ').concat(this.config.disableSeekIcon?" hide-seek-icon":"",'">\n <i class="xg-seek-icon"></i>\n <span class="xg-cur">00:00</span>\n <span>/</span>\n <span class="xg-dur">00:00</span>\n </div>\n <div class="xg-bar xg-timebar">\n <div class="xg-curbar"></div>\n </div>\n </div>\n <div class="xg-playbackrate xg-top-note">
1\n <span><i>').concat(this.config.pressRate,"X</i>").concat(this.i18n.FORWARD,"</span>\n </div>\n </xg-trigger>\n ")}}],[{key:"pluginName",get:function(){return"mobile"}},{key:"defaultConfig",get:function(){return{stopPropagation:!0,index:0,disableGesture:!1,gestureX:!0,gestureY:!0,updateGesture:function(){},onTouchStart:function(){},onTouchEnd:function(){},gradient:"normal",isTouchingSeek:!1,miniMoveStep:5,miniYPer:5,scopeL:.25,scopeR:.25,scopeM:.9,pressRate:2,darkness:!0,maxDarkness:.8,disableActive:!1,disableTimeProgress:!1,hideControlsActive:!1,hideControlsEnd:!1,moveDuration:60*6*1e3,closedbClick:!1,disablePress:!0,disableSeekIcon:!1,focusVideoClick:!1}}}]),i}(Ae);const pa=ga;function fe(n){"@babel/helpers - typeof";return fe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},fe(n)}function va(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function")}function vn(n,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(n,Gn(r.key),r)}}function ya(n,t,i){return t&&vn(n.prototype,t),i&&vn(n,i),Object.defineProperty(n,"prototype",{writable:!1}),n}function ma(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(t&&t.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),t&&wt(n,t)}function wt(n,t){return wt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,e){return r.__proto__=e,r},wt(n,t)}function ba(n){var t=Pa();return function(){var r=Ye(n),e;if(t){var o=Ye(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return _a(this,e)}}function _a(n,t){if(t&&(fe(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Tt(n)}function Tt(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function Pa(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(n){return!1}}function Ye(n){return Ye=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(i){return i.__proto__||Object.getPrototypeOf(i)},Ye(n)}function yn(n,t,i){return t=Gn(t),t in n?Object.defineProperty(n,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[t]=i,n}function Gn(n){var t=Ea(n,"string");return fe(t)==="symbol"?t:String(t)}function Ea(n,t){if(fe(n)!=="object"||n===null)return n;var i=n[Symbol.toPrimitive];if(i!==void 0){var r=i.call(n,t||"default");if(fe(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(n)}var Vn=function(n){ma(i,n);var t=ba(i);function i(){var r;va(this,i);for(var e=arguments.length,o=new Array(e),a=0;a<e;a++)o[a]=arguments[a];return r=t.call.apply(t,[this].concat(o)),yn(Tt(r),"_onMouseenter",function(s){r.emit("icon_mouseenter",{pluginName:r.pluginName})}),yn(Tt(r),"_onMouseLeave",function(s){r.emit("icon_mouseleave",{pluginName:r.pluginName})}),r}return ya(i,[{key:"afterCreate",value:function(){this.bind("mouseenter",this._onMouseenter),this.bind("mouseleave",this._onMouseLeave),this.config.disable&&this.disable()}},{key:"destroy",value:function(){this.unbind("mouseenter",this._onMouseenter),this.unbind("mouseleave",this._onMouseLeave)}}]),i}(Ae);function he(n){"@babel/helpers - typeof";return he=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},he(n)}function Oa(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function")}function mn(n,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(n,zn(r.key),r)}}function Sa(n,t,i){return t&&mn(n.prototype,t),i&&mn(n,i),Object.defineProperty(n,"prototype",{writable:!1}),n}function Pe(){return typeof Reflect<"u"&&Reflect.get?Pe=Reflect.get.bind():Pe=function(t,i,r){var e=wa(t,i);if(e){var o=Object.getOwnPropertyDescriptor(e,i);return o.get?o.get.call(arguments.length<3?t:r):o.value}},Pe.apply(this,arguments)}function wa(n,t){for(;!Object.prototype.hasOwnProperty.call(n,t)&&(n=ee(n),n!==null););return n}function Ta(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(t&&t.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),t&&kt(n,t)}function kt(n,t){return kt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,e){return r.__proto__=e,r},kt(n,t)}function ka(n){var t=Aa();return function(){var r=ee(n),e;if(t){var o=ee(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return Ca(this,e)}}function Ca(n,t){if(t&&(he(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ct(n)}function Ct(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function Aa(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(n){return!1}}function ee(n){return ee=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(i){return i.__proto__||Object.getPrototypeOf(i)},ee(n)}function Ra(n,t,i){return t=zn(t),t in n?Object.defineProperty(n,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[t]=i,n}function zn(n){var t=Ia(n,"string");return he(t)==="symbol"?t:String(t)}function Ia(n,t){if(he(n)!=="object"||n===null)return n;var i=n[Symbol.toPrimitive];if(i!==void 0){var r=i.call(n,t||"default");if(he(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(n)}var xa='<svg class="play" xmlns="http://www.w3.org/2000/svg" width="28" height="40" viewBox="3 -4 28 40"><path fill="#fff" d="M18.468 11.639l7.503 4.777-7.503 4.777zM10.965 6.86l7.503 4.778v9.554l-7.503 4.778z"/></svg>',La='<svg class="pause" xmlns="http://www.w3.org/2000/svg" width="28" height="40" viewBox="3 -4 28 40"><path fill="#fff" d="M19.173 6.861h5.451v19.11h-5.45V6.86zM8.208 25.971V6.86h5.45v19.11h-5.45z"/></svg>',Na=function(n){Ta(i,n);var t=ka(i);function i(){var r;Oa(this,i);for(var e=arguments.length,o=new Array(e),a=0;a<e;a++)o[a]=arguments[a];return r=t.call.apply(t,[this].concat(o)),Ra(Ct(r),"btnClick",function(s){var u=Ct(r),l=u.player,h=u.config;if(!h.disable)return s.preventDefault(),s.stopPropagation(),r.emitUserAction(s,"switch_play_pause"),l.ended?l.replay():l.paused&&!l.isBufferControlPaused?(l.play(),r.animate(!1)):(l.pause(),r.animate(!0)),!1}),r}return Sa(i,[{key:"afterCreate",value:function(){var e=this;Pe(ee(i.prototype),"afterCreate",this).call(this);var o=this.player;this.initIcons(),this.bind(["touchend","click"],this.btnClick),this.on([mr,Er,wn],function(){e.animate(o.paused)}),this.on($e,function(){e.animate(o.paused)}),this.animate(this.player.paused)}},{key:"registerIcons",value:function(){return{play:{icon:xa,class:"xg-icon-play"},pause:{icon:La,class:"xg-icon-pause"}}}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(".xgplayer-icon",e.play),this.appendChild(".xgplayer-icon",e.pause)}},{key:"animate",value:function(e){var o=this.i18nKeys,a=this.player;e&&a.isBufferControlPaused||(e?(this.setAttr("data-state","pause"),this.changeLangTextKey(this.find(".xg-tips"),o.PLAY_TIPS)):(this.setAttr("data-state","play"),this.changeLangTextKey(this.find(".xg-tips"),o.PAUSE_TIPS)))}},{key:"destroy",value:function(){Pe(ee(i.prototype),"destroy",this).call(this),this.unbind(["touchend","click"],this.btnClick)}},{key:"render",value:function(){return'<xg-icon class="xgplayer-play">\n <div class="xgplayer-icon">\n </div>\n <div class="xg-tips" lang-key="'.concat(this.i18nKeys.PLAY_TIPS,'">').concat(this.i18n.PLAY_TIPS,"</div>\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"play"}},{key:"defaultConfig",get:function(){return{position:L.CONTROLS_LEFT,index:0,disable:!1}}}]),i}(Vn);const Da=Na;function de(n){"@babel/helpers - typeof";return de=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},de(n)}function Fa(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function")}function bn(n,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(n,ja(r.key),r)}}function $a(n,t,i){return t&&bn(n.prototype,t),i&&bn(n,i),Object.defineProperty(n,"prototype",{writable:!1}),n}function ja(n){var t=Ma(n,"string");return de(t)==="symbol"?t:String(t)}function Ma(n,t){if(de(n)!=="object"||n===null)return n;var i=n[Symbol.toPrimitive];if(i!==void 0){var r=i.call(n,t||"default");if(de(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(n)}function Ba(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(t&&t.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),t&&At(n,t)}function At(n,t){return At=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,e){return r.__proto__=e,r},At(n,t)}function Ua(n){var t=Va();return function(){var r=We(n),e;if(t){var o=We(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return Ha(this,e)}}function Ha(n,t){if(t&&(de(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ga(n)}function Ga(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function Va(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(n){return!1}}function We(n){return We=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(i){return i.__proto__||Object.getPrototypeOf(i)},We(n)}var za='<svg width="32" height="40" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg"><path d="M11.237 14l6.382-6.381A.875.875 0 1016.38 6.38l-7 7a.875.875 0 000 1.238l7 7a.875.875 0 101.238-1.238L11.237 14z" fill="#FFF" fill-rule="evenodd"/></svg>',Ka=function(n){Ba(i,n);var t=Ua(i);function i(){return Fa(this,i),t.apply(this,arguments)}return $a(i,[{key:"afterCreate",value:function(){var e=this;this.initIcons(),this.onClick=function(o){o.preventDefault(),o.stopPropagation(),e.config.onClick(o)},this.bind(["click","touchend"],this.onClick)}},{key:"registerIcons",value:function(){return{screenBack:{icon:za,class:"xg-fullscreen-back"}}}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(this.root,e.screenBack)}},{key:"show",value:function(){c.addClass(this.root,"show")}},{key:"hide",value:function(){c.removeClass(this.root,"show")}},{key:"render",value:function(){return'<xg-icon class="xgplayer-back">\n </xg-icon>'}}],[{key:"pluginName",get:function(){return"topbackicon"}},{key:"defaultConfig",get:function(){return{position:L.ROOT_TOP,index:0}}}]),i}(Ae);function ge(n){"@babel/helpers - typeof";return ge=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ge(n)}function Ya(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function")}function _n(n,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(n,Yn(r.key),r)}}function Wa(n,t,i){return t&&_n(n.prototype,t),i&&_n(n,i),Object.defineProperty(n,"prototype",{writable:!1}),n}function Q(){return typeof Reflect<"u"&&Reflect.get?Q=Reflect.get.bind():Q=function(t,i,r){var e=Xa(t,i);if(e){var o=Object.getOwnPropertyDescriptor(e,i);return o.get?o.get.call(arguments.length<3?t:r):o.value}},Q.apply(this,arguments)}function Xa(n,t){for(;!Object.prototype.hasOwnProperty.call(n,t)&&(n=B(n),n!==null););return n}function qa(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(t&&t.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),t&&Rt(n,t)}function Rt(n,t){return Rt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,e){return r.__proto__=e,r},Rt(n,t)}function Ja(n){var t=Za();return function(){var r=B(n),e;if(t){var o=B(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return Qa(this,e)}}function Qa(n,t){if(t&&(ge(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Kn(n)}function Kn(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function Za(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(n){return!1}}
1function B(n){return B=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(i){return i.__proto__||Object.getPrototypeOf(i)},B(n)}function es(n,t,i){return t=Yn(t),t in n?Object.defineProperty(n,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[t]=i,n}function Yn(n){var t=ts(n,"string");return ge(t)==="symbol"?t:String(t)}function ts(n,t){if(ge(n)!=="object"||n===null)return n;var i=n[Symbol.toPrimitive];if(i!==void 0){var r=i.call(n,t||"default");if(ge(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(n)}var ns='<svg xmlns="http://www.w3.org/2000/svg" width="28" height="40" viewBox="2 -4 28 40"><path fill="#fff" d="M19.173 6.861h6.798v6.798h-2.694V9.555h-4.104V6.86zm4.104 16.416v-4.104h2.694v6.798h-6.798v-2.694h4.104zM6.861 13.66V6.86h6.798v2.694H9.555v4.104H6.86zm2.694 5.514v4.104h4.104v2.694H6.86v-6.798h2.694z"/></svg>',rs='<svg xmlns="http://www.w3.org/2000/svg" width="28" height="40" viewBox="2 -4 28 40"><path fill="#fff" d="M21.867 10.965h4.104v2.694h-6.798V6.86h2.694v4.104zm-2.694 15.006v-6.798h6.798v2.694h-4.104v4.104h-2.694zm-8.208-15.006V6.861h2.694v6.798H6.86v-2.694h4.104zM6.861 21.867v-2.694h6.798v6.798h-2.694v-4.104H6.861z"/></svg>',is=function(n){qa(i,n);var t=Ja(i);function i(){var r;Ya(this,i);for(var e=arguments.length,o=new Array(e),a=0;a<e;a++)o[a]=arguments[a];return r=t.call.apply(t,[this].concat(o)),es(Kn(r),"_onOrientationChange",function(s){r.player.fullscreen&&r.config.rotateFullscreen&&(window.orientation===90||window.orientation===-90?r.setRotateDeg(0):r.setRotateDeg(90))}),r}return Wa(i,[{key:"afterCreate",value:function(){var e=this;Q(B(i.prototype),"afterCreate",this).call(this);var o=this.config,a=this.playerConfig;o.target&&(this.playerConfig.fullscreenTarget=this.config.target);var s=c.getFullScreenEl();a.fullscreenTarget===s&&this.player.getFullscreen().catch(function(){}),this.initIcons(),this.handleFullscreen=this.hook("fullscreen_change",this.changeFullScreen,{pre:function(l){e.config.disable||e.emitUserAction(l,"switch_fullscreen",{fullscreen:e.player.fullscreen})}}),this.bind(".xgplayer-fullscreen",["touchend","click"],this.handleFullscreen),this.on(q,function(u){e.changeLangTextKey(e.find(".xg-tips"),u?e.i18nKeys.EXITFULLSCREEN_TIPS:e.i18nKeys.FULLSCREEN_TIPS),e.animate(u),e.config.needBackIcon&&e.show()}),this.config.needBackIcon&&(this.topBackIcon=this.player.registerPlugin({plugin:Ka,options:{config:{onClick:function(l){e.handleFullscreen(l)}}}})),S.device==="mobile"&&window.addEventListener("orientationchange",this._onOrientationChange)}},{key:"registerIcons",value:function(){return{fullscreen:{icon:ns,class:"xg-get-fullscreen"},exitFullscreen:{icon:rs,class:"xg-exit-fullscreen"}}}},{key:"destroy",value:function(){Q(B(i.prototype),"destroy",this).call(this),this.unbind(".xgplayer-icon",S.device==="mobile"?"touchend":"click",this.handleFullscreen),S.device==="mobile"&&window.removeEventListener("orientationchange",this._onOrientationChange)}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(".xgplayer-icon",e.fullscreen),this.appendChild(".xgplayer-icon",e.exitFullscreen)}},{key:"setRotateDeg",value:function(e){var o=this.player;window.orientation===90||window.orientation===-90?o.rotateDeg=0:o.rotateDeg=e}},{key:"getRotateFullscreen",value:function(e){var o=this.player;o.isCssfullScreen&&o.exitCssFullscreen(e);var a=e?g.INNER_FULLSCREEN:g.ROTATE_FULLSCREEN;o._fullscreenEl=e||o.root,o.changeFullStyle(o.root,e,a,g.PARENT_ROTATE_FULLSCREEN),o.fullscreen=!0,this.setRotateDeg(90),this.emit(q,!0)}},{key:"exitRotateFullscreen",value:function(e){var o=this.player;o.fullscreen=!1;var a=o._fullscreenEl!==o.root?g.INNER_FULLSCREEN:g.ROTATE_FULLSCREEN;o.recoverFullStyle(o.root,o._fullscreenEl,a,g.PARENT_ROTATE_FULLSCREEN),this.setRotateDeg(0),this.emit(q,!1)}},{key:"changeFullScreen",value:function(e){var o=this.player,a=this.config;if(!a.disable){e&&(e.preventDefault(),e.stopPropagation());var s=!1;if((a.useCssFullscreen===!0||typeof a.useCssFullscreen=="function"&&a.useCssFullscreen())&&(s=!0),s)o.fullscreen?(o.fullscreen=!1,o.exitCssFullscreen(),this.emit
1(q,!1)):(o.fullscreen=!0,o.getCssFullscreen(),this.emit(q,!0)),this.animate(o.fullscreen);else if(a.rotateFullscreen)o.fullscreen?this.exitRotateFullscreen():this.getRotateFullscreen(),this.animate(o.fullscreen);else{if(a.switchCallback&&typeof a.switchCallback=="function"){a.switchCallback(o.fullscreen);return}o.fullscreen?o.exitFullscreen():o.getFullscreen().catch(function(){})}}}},{key:"animate",value:function(e){e?this.setAttr("data-state","full"):this.setAttr("data-state","normal"),this.topBackIcon&&(e?(this.topBackIcon.show(),this.hide()):(this.topBackIcon.hide(),this.show()))}},{key:"show",value:function(){Q(B(i.prototype),"show",this).call(this)}},{key:"hide",value:function(){Q(B(i.prototype),"hide",this).call(this)}},{key:"render",value:function(){var e="FULLSCREEN_TIPS";return'<xg-icon class="xgplayer-fullscreen">\n <div class="xgplayer-icon">\n </div>\n <div class="xg-tips" lang-key="'.concat(this.i18nKeys[e],'">').concat(this.i18n[e],"</div>\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"fullscreen"}},{key:"defaultConfig",get:function(){return{position:L.CONTROLS_RIGHT,index:0,useCssFullscreen:!1,rotateFullscreen:!1,switchCallback:null,target:null,disable:!1,needBackIcon:!1}}}]),i}(Vn);const ls=n=>{var f;const{src:t,cover:i}=n,r=(f=n.advance)!=null?f:{},e=!!r.autoplay,o=!!r.mute,a=!!r.loop,s=!r.hideControls,u=!r.hideControlFullscreen,l=xe.useRef(null),h=xe.useRef();return xe.useEffect(()=>{if(!l.current)return;const d=[pa,Jo,Da];i&&d.push(Go),s&&d.push(Dn),u&&d.push(is),h.current=new Xe({el:l.current,height:"100%",width:"100%",url:t,poster:i,autoplay:e,autoplayMuted:o,loop:a,controls:s,playsinline:!0,videoAttributes:{autoplay:e,controls:s,muted:o},closeVideoClick:!s,closeVideoDblclick:!s,"x5-video-player-type":"h5",plugins:d})},[e,o,s,i,u,a,t]),xe.useEffect(()=>{setTimeout(()=>{const d=window.WeixinJSBridge;e&&o&&d&&h.current&&h.current.play()},2e3)},[e,o]),Wn.jsx("div",{className:"mt-video-custom-wrapper",ref:l})};export{ls as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.