douxiaoyun.js/profiles/douyin-profile/Default/Cache/Cache_Data/f_000378
2026-07-17 22:23:39 +08:00

2 lines
114 KiB
Plaintext

/*! For license information please see player-9.69ef1934.js.LICENSE.txt */
"use strict";!function(e,t){"object"==typeof module&&"object"==typeof module.exports?t():"function"==typeof define&&define.amd?define([],t):(e="undefined"!=typeof globalThis?globalThis:e||self)&&t()}(this,function(){"use strict";"object"==typeof window&&(window.openRedirect={version:"1.2.20",webpackPluginVersion:"3.4.22",reportOnly:!1})}),!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).xss={})}(this,function(e){"use strict";var t=function(){return(t=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};function i(e,t,i){if(i||2==arguments.length)for(var n,r=0,a=t.length;r<a;r++)!n&&r in t||(n||(n=Array.prototype.slice.call(t,0,r)),n[r]=t[r]);return e.concat(n||Array.prototype.slice.call(t))}var n=/[^a-zA-Z0-9\\_:.-]/gim,r=/</g,a=/>/g,o=/&#([a-zA-Z0-9]*);?/gim,s=/&quot;/g,u=/&colon;?/gim,l=/&newline;?/gim,c=/((j\s*a\s*v\s*a|v\s*b|l\s*i\s*v\s*e)\s*s\s*c\s*r\s*i\s*p\s*t\s*|m\s*o\s*c\s*h\s*a):/gi,d=/u\s*r\s*l\s*\(.*/gi,h=/e\s*x\s*p\s*r\s*e\s*s\s*s\s*i\s*o\s*n\s*\(.*/gi,f=/"/g,p=function(e){return e.replace(r,"&lt;").replace(a,"&gt;")},v={indexOf:function(e,t){var i,n;for(i=0,n=e.length;i<n;i++)if(e[i]===t)return i;return -1},forEach:function(e,t,i){var n,r;for(n=0,r=e.length;n<r;n++)t.call(i,e[n],n,e)},some:function(e,t,i){var n,r;for(n=0,r=e.length;n<r;n++)if(t.call(i,e[n],n,e))return!0;return!1},trim:function(e){return e.replace(/(^\s*)|(\s*$)/g,"")},includes:function(e,t){if("string"==typeof e)return -1!==e.indexOf(t);for(var i=0;i<e.length;i++)if(e[i]===t)return!0;return!1},spaceIndex:function(e){var t=/\s|\n|\t/.exec(e);return t?t.index:-1},uniq:function(e){for(var t={},i=[],n=0;n<e.length;n++)t[e[n]]||(i.push(e[n]),t[e[n]]=!0);return i},from:function(e){for(var t=[],i=0;i<e.length;i++)t.push(e[i]);return t},keys:function(e){var t=[];for(var i in e)t.push(i);return t}};function g(e){return null==e}function m(e){var t;return'"'===(t=e)[0]&&'"'===t[t.length-1]||"'"===t[0]&&"'"===t[t.length-1]?e.substr(1,e.length-2):e}function _(e){var t,i,n,r,a,o,s,u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",l="",c=0;for(e=function(e){e=e.replace(/rn/g,"n");for(var t="",i=0;i<e.length;i++){var n=e.charCodeAt(i);n<128?t+=String.fromCharCode(n):n>127&&n<2048?t+=String.fromCharCode(n>>6|192)+String.fromCharCode(63&n|128):t+=String.fromCharCode(n>>12|224)+String.fromCharCode(n>>6&63|128)+String.fromCharCode(63&n|128)}return t}(e);c<e.length;)r=(t=e.charCodeAt(c++))>>2,a=(3&t)<<4|(i=e.charCodeAt(c++))>>4,o=(15&i)<<2|(n=e.charCodeAt(c++))>>6,s=63&n,isNaN(i)?o=s=64:isNaN(n)&&(s=64),l=l+u.charAt(r)+u.charAt(a)+u.charAt(o)+u.charAt(s);return l}function y(e){var t,i,n,r,a,o,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",u="",l=0;for(e=e.replace(/[^A-Za-z0-9+/=]/g,"");l<e.length;)t=s.indexOf(e.charAt(l++))<<2|(r=s.indexOf(e.charAt(l++)))>>4,i=(15&r)<<4|(a=s.indexOf(e.charAt(l++)))>>2,n=(3&a)<<6|(o=s.indexOf(e.charAt(l++))),u+=String.fromCharCode(t),64!==a&&(u+=String.fromCharCode(i)),64!==o&&(u+=String.fromCharCode(n));return function(e){for(var t="",i=0,n=0,r=0,a=0;i<e.length;)(n=e.charCodeAt(i))<128?(t+=String.fromCharCode(n),i++):n>191&&n<224?(t+=String.fromCharCode((31&n)<<6|63&(a=e.charCodeAt(i+1))),i+=2):(a=e.charCodeAt(i+1),t+=String.fromCharCode((15&n)<<12|(63&a)<<6|63&(r=e.charCodeAt(i+2))),i+=3);return t}(u)}function b(e,t,i){var n="",r=0,a=!1,o=!1,s=0,u=e.length,l="",c="";e:for(s=0;s<u;s++){var d=e.charAt(s);if(!1===a){if("<"===d){a=s;continue}}else if(!1===o){if("<"===d){n+=i(e.slice(r,s)),a=s,r=s;continue}if(">"===d||s===u-1){n+=i(e.slice(r,a)),l=function(e){var t,i=v.spaceIndex(e);return t=-1===i?e.slice(1,-1):e.slice(1,i+1),"/"===(t=v.trim(t).toLowerCase()).slice(0,1)&&(t=t.slice(1)),"/"===t.slice(-1)&&(t=t.slice(0,-1)),t}(c=e.slice(a,s+1)),n+=t(a,n.length,l,c,"</"===c.slice(0,2)),r=s+1,a=!1;continue}if('"'===d||"'"===d)for(var h=1,f=e.charAt(s-h);""===f.trim()||"="===f;){if("="===f){o=d;continue e}f=e.charAt(s-++h)}}else if(d===o){o=!1;continue}}return r<u&&(n+=i(e.substr(r))),n}function k(e,t){var i=0,r=0,a=[],o=!1,s=e.length;function u(e,i){if(!((e=(e=v.trim(e)).replace(n,"").toLowerCase()).length<1)){var r=t(e,i||"");r&&a.push(r)}}for(var l=0;l<s;l++){var c=e.charAt(l),d=void 0;if(!1!==o||"="!==c){if(!1===o||l!==r){if(/\s|\n|\t/.test(c)){if(e=e.replace(/\s|\n|\t/g," "),!1===o){if(-1===(d=function(e,t){for(;t<e.length;t++){var i=e[t];if(" "!==i)return"="===i?t:-1}return -1}(e,l))){u(v.trim(e.slice(i,l))),o=!1,i=l+1;continue}l=d-1;continue}if(-1===(d=function(e,t){for(;t>0;t--){var i=e[t];if(" "!==i)return"="===i?t:-1}return -1}(e,l-1))){u(o,m(v.trim(e.slice(i,l)))),o=!1,i=l+1;continue}}}else{if(-1===(d=e.indexOf(c,l+1)))break;u(o,v.trim(e.slice(r+1,d))),o=!1,i=(l=d)+1}}else o=e.slice(i,l),i=l+1,r='"'===e.charAt(i)||"'"===e.charAt(i)?i:function(e,t){for(;t<e.length;t++){var i=e[t];if(" "!==i)return"'"===i||'"'===i?t:-1}return -1}(e,l+1)}return i<e.length&&(!1===o?u(e.slice(i)):u(o,m(v.trim(e.slice(i))))),v.trim(a.join(" "))}function w(e,t,i){if(i=function(e){return e=function(e){for(var t="",i=0,n=e.length;i<n;i++)t+=32>e.charCodeAt(i)?" ":e.charAt(i);return v.trim(t)}(e=(e=(e=e.replace(s,'"')).replace(o,function(e,t){return"x"===t[0]||"X"===t[0]?String.fromCharCode(parseInt(t.substr(1),16)):String.fromCharCode(parseInt(t,10))})).replace(u,":").replace(l," "))}(i),"href"===t||"src"===t){if("#"===(i=v.trim(i)))return"#";if("http://"!==i.substr(0,7)&&"https://"!==i.substr(0,8)&&"mailto:"!==i.substr(0,7)&&"tel:"!==i.substr(0,4)&&"data:image/"!==i.substr(0,11)&&"ftp://"!==i.substr(0,6)&&"./"!==i.substr(0,2)&&"../"!==i.substr(0,3)&&"#"!==i[0]&&"/"!==i[0])return""}else if("background"===t){if(c.lastIndex=0,c.test(i))return""}else if("style"===t&&(h.lastIndex=0,h.test(i)||(d.lastIndex=0,d.test(i)&&(c.lastIndex=0,c.test(i)))))return"";return i=function(e){return e=p(e=e.replace(f,"&quot;"))}(i)}var S=function(e){return"string"==typeof e?e.replace(/'/g,'"').replace('=""',"").replace(/\s+/g,"").toLowerCase():""},T=function(){function e(e){var t=function(e){var t={};for(var i in e)t[i]=e[i];return t}(e||{});t.stripIgnoreTag&&(t.onIgnoreTag,t.onIgnoreTag=function(){return""}),t.whiteList={},t.onTag=function(){},t.onTagAttr=function(){},t.onIgnoreTag=function(){},t.onIgnoreTagAttr=function(){},t.safeAttrValue=w,t.escapeHtml=p,this.options=Object.assign(t,e)}return e.prototype.process=function(e){if(!(e=(e=e||"").toString()))return"";var t,i,n,r,a,o,s=this.options,u=s.whiteList,l=s.onTag,c=s.onIgnoreTag,d=s.onTagAttr,h=s.onIgnoreTagAttr,f=s.safeAttrValue,p=s.escapeHtml;s.stripBlankChar&&(e=(t=(t=e.split("")).filter(function(e){var t=e.charCodeAt(0);return!(127===t||t<=31&&10!==t&&13!==t)})).join("")),s.allowCommentTag||(e=function(e){for(var t="",i=0;i<e.length;){var n=e.indexOf("\x3c!--",i);if(-1===n){t+=e.slice(i);break}t+=e.slice(i,n);var r=e.indexOf("--\x3e",n);if(-1===r)break;i=r+3}return t}(e));var g=!1;s.stripIgnoreTagBody&&(i=s.stripIgnoreTagBody,"function"!=typeof(n=c)&&(n=function(){}),r=!Array.isArray(i),a=[],o=!1,c=(g={onIgnoreTag:function(e,t,s){var u;if(u=e,r||-1!==v.indexOf(i,u)){if(s.isClosing){var l="[/removed]",c=s.position+l.length;return a.push([!1!==o?o:s.position,c]),o=!1,l}return o||(o=s.position),"[removed]"}return n(e,t,s)},remove:function(e){var t="",i=0;return v.forEach(a,function(n){t+=e.slice(i,n[0]),i=n[1]}),t+=e.slice(i)}}).onIgnoreTag);var m=b(e,function(e,t,i,n,r){var a={sourcePosition:e,position:t,isClosing:r,isWhite:Object.prototype.hasOwnProperty.call(u,i)},o=l(i,n,a);if(null!=o)return o;if(a.isWhite){if(a.isClosing)return"</".concat(i,">");var s=function(e){var t=v.spaceIndex(e);if(-1===t)return{html:"",closing:"/"===e[e.length-2]};var i="/"===(e=v.trim(e.slice(t+1,-1)))[e.length-1];return i&&(e=v.trim(e.slice(0,-1))),{html:e,closing:i}}(n),g=u[i],m=k(s.html,function(e,t){var n=-1!==v.indexOf(g,e),r=d(i,e,t,n);return null==r?n?(t=f(i,e,t,null))?"".concat(e,'="').concat(t,'"'):e:null==(r=h(i,e,t,n))?void 0:r:r});return n="<".concat(i),m&&(n+=" ".concat(m)),s.closing&&(n+=" /"),n+=">"}return null==(o=c(i,n,a))?p(n):o},p);return g&&(m=g.remove(m)),m},e}(),x=Function("\nvar _checkXSS = function (it) {\n return it && it.Math == Math && it;\n};\nreturn _checkXSS(typeof globalThis === 'object' && globalThis) ||\n_checkXSS(typeof window === 'object' && window) ||\n_checkXSS(typeof self === 'object' && self) ||\n_checkXSS(typeof global === 'object' && global) ||\nFunction('return this')();\n")(),C=new(function(){function e(){var e=this;this.batchData=[],this.uniqKeys=new Set,this.timeout=2e3,this.lock=!1,this.getSlardarBid=function(){var t,i,n="douyin_web";if(!v.includes(n,"bid"))return n;if(e.config&&e.config.bid)return e.config.bid;if(x&&x._xssBid)return x._xssBid;if(x&&x.slardar&&"function"==typeof x.slardar.config){var r=(x.slardar.config()||{}).bid;if(r)return r}if(x&&x.Slardar&&"function"==typeof x.Slardar.config){var a=(x.Slardar.config()||{}).bid;if(a)return a}return(null===(i=null===(t=null==x?void 0:x.Slardar)||void 0===t?void 0:t._baseParams)||void 0===i?void 0:i.bid)||"argus"},this.getConfigRegion=function(){var t;return v.includes("cn","region")?e.config&&e.config.region?e.config.region:((null===(t=null==x?void 0:x.gfdatav1)||void 0===t?void 0:t.region)||"cn").toLowerCase():"cn"},this.gerReportUrl=function(){var t={cn:y("aHR0cHM6Ly9tb24uemlqaWVhcGkuY29tL21vbml0b3JfYnJvd3Nlci9jb2xsZWN0L2JhdGNoL3NlY3VyaXR5Lz9iaWQ9"),boe:y("aHR0cHM6Ly9tb24uemlqaWVhcGkuY29tL21vbml0b3JfYnJvd3Nlci9jb2xsZWN0L2JhdGNoL3NlY3VyaXR5Lz9iaWQ9"),ttp:y("aHR0cHM6Ly9tb24udXMudGlrdG9rdi5jb20vbW9uaXRvcl9icm93c2VyL2NvbGxlY3QvYmF0Y2gvc2VjdXJpdHkvP2JpZD0="),va:y("aHR0cHM6Ly9tb24tdmEuYnl0ZW92ZXJzZWEuY29tL21vbml0b3JfYnJvd3Nlci9jb2xsZWN0L2JhdGNoL3NlY3VyaXR5Lz9iaWQ9"),maliva:y("aHR0cHM6Ly9tb24tdmEuYnl0ZW92ZXJzZWEuY29tL21vbml0b3JfYnJvd3Nlci9jb2xsZWN0L2JhdGNoL3NlY3VyaXR5Lz9iaWQ9"),sg:y("aHR0cHM6Ly9tb24tdmEuYnl0ZW92ZXJzZWEuY29tL21vbml0b3JfYnJvd3Nlci9jb2xsZWN0L2JhdGNoL3NlY3VyaXR5Lz9iaWQ9"),boei18n:y("aHR0cHM6Ly9tb24tdmEuYnl0ZW92ZXJzZWEuY29tL21vbml0b3JfYnJvd3Nlci9jb2xsZWN0L2JhdGNoL3NlY3VyaXR5Lz9iaWQ9")}[e.getConfigRegion()];if(t)return t+e.getSlardarBid()}}return e.prototype.setConfig=function(e){this.config=e},e.prototype.upload=function(){var e=this,t=this.gerReportUrl();!this.lock&&t&&0!==this.batchData.length&&(this.lock=!0,setTimeout(function(){var i=e.batchData.slice(0,100);e.batchData=e.batchData.slice(100),x.fetch(t,{method:"post",body:JSON.stringify(i),headers:{"Content-Type":"application/json"}}).catch(function(e){}),e.lock=!1,e.upload()},this.timeout))},e.prototype.generateKey=function(e){return e.collectKey?[e.collectMode,e.collectKey].join("___"):""},e.prototype.push=function(e){this.batchData.push(e),this.upload()},e.prototype.report=function(e){var t=this.generateKey(e);if(x.fetch&&e.collectKey){var i="object"==typeof window?window.location.href:"SSR";e.documentUrl=i;var n={age:Math.floor(Date.now()),type:"xss",url:i,body:e,"user-agent":""};"enforce"===e.disposition&&"SSR"!==i||(n.url=t),"SSR"===i&&(n.url="SSR___".concat(n.url),n.body.ssr=!0),this.push(n)}},e}()),P=function(e){for(var t=0,i=function(i){Array.isArray(e[i])?0===e[i].length?delete e[i]:(e[i]=v.from(v.uniq(e[i])),t+=e[i].length):0===v.keys(e[i]).length?delete e[i]:v.keys(e[i]).forEach(function(n){e[i][n]=v.from(v.uniq(e[i][n])),t+=e[i][n].length})},n=0,r=v.keys(e);n<r.length;n++)i(r[n]);return{count:t,ret:e}};function D(e,t){return C.setConfig(t),new T(t).process(e)}function E(e){var t,i=(t=/\s|\n|\t/.exec(e))?t.index:-1;if(-1===i)return{html:"",closing:"/"===e[e.length-2]};var n="/"===(e=e.slice(i+1,-1).trim())[e.length-1];return n&&(e=e.slice(0,-1).trim()),{html:e,closing:n}}var I=function(e){return -1===(e=(e=(e=(e=e.replace(/&colon;/gi,":")).replace(/&tab;/gi,"")).replace(/&newline;/gi,"")).replace(/(\t|\n|\r)/g,"")).indexOf("&#")?e.trim().toLowerCase():e.trim().replace(/&#(?:(x)([0-9a-f]+)|([0-9]+));?/gi,function(e,t,i,n){return String.fromCharCode(t?parseInt(i,16):parseInt(n))}).replace(/(\t|\n|\r)/g,"").toLowerCase()};function L(e,t){if(void 0===e&&(e=""),"string"!=typeof e)return!0;if(e=I(e),v.includes(e,"base64")&&!function(e){if(""===e||""===e.trim())return!0;try{return!v.includes(e,"data:text/html;base64")}catch(e){return!0}}(e))return t&&t("data:text/html;base64"),!1;var i=["expression(","behavior:","view-source:"];if(v.some(i,function(t){return -1!==e.indexOf(t)}))return v.forEach(i,function(i){-1!==e.indexOf(i)&&t&&t(i)}),!1;var n=["data:application","data:javascript","data:text/html","data:texthtml"];if(v.some(n,function(t){return -1!==e.indexOf(t)}))return v.forEach(n,function(i){-1!==e.indexOf(i)&&t&&t(i)}),!1;if(e.indexOf("javascript:")>0)return t&&t("javascript:"),!1;if(/^javascript:/i.test(e)){var r=e.slice(11).replace(/\s/g,"").trim();return!!v.some(["void","void(0)","void0","false","undefined",";"],function(e){return e===r})||(t&&t("javascript:"),!1)}return!0}var A=function(e,t){var i,n,r="<%= isSaveValidUrl =>";if("string"!=typeof e||(n=Number("<%= urlLimit =>"),void 0!==i&&(n=i),"NaN"!==e.toString()&&-1!==n&&e.length>=n)||L(e,t))return e;try{if(!0===(r=JSON.parse(r))||"true"===r){var a=new URL(e);return a.origin+a.pathname}}catch(e){}return"#"};function O(e,t,n){if(void 0===e&&(e=""),void 0===t&&(t=[]),"string"!=typeof e)return!0;if(!L(e=I(e)))return!1;var r,a={url:(r=e.match(/^(?:([A-Za-z]+):)?(\/{0,3})([0-9.\-A-Za-z]+)(?::(\d+))?(?:\/([^?#]*))?(?:\?([^#]*))?(?:#(.*))?$/)||[])[0],scheme:r[1],slash:r[2],host:r[3],port:r[4],path:r[5],query:r[6],hash:r[7]},o=a.scheme,s=a.host;return n?!!n(e):!(!o||!s)&&(!v.includes(["http","https","file"],o)||("object"==typeof window&&window&&(t=i(i([],t,!0),[location.host],!1)),v.some(t,function(e){return!!(e instanceof RegExp&&e.test(s))||e===s})))}var R={a:["target","title","spellcheck","rel"],canvas:[],abbr:["title"],address:[],area:["shape","coords","alt"],article:[],aside:[],audio:["autoplay","controls","loop","preload"],b:[],bdi:["dir"],bdo:["dir"],big:[],blockquote:["cite"],br:[],caption:[],center:[],cite:[],code:[],col:["align","valign","span","width"],colgroup:["align","valign","span","width"],dd:[],del:["datetime"],details:["open"],div:["dir"],dl:[],dt:[],em:[],font:["color","size","face"],footer:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],header:[],hr:[],i:[],img:["alt","title","width","height","decoding"],ins:["datetime"],li:[],mark:[],nav:[],ol:["start"],p:[],pre:[],s:[],section:[],small:[],span:[],sub:[],sup:[],delete:[],form:[],strong:[],mask:["maskunits","x","y","width","height","fill"],table:["width","border","align","valign"],tbody:["align","valign"],td:["width","rowspan","colspan","align","valign"],tfoot:["align","valign"],th:["width","rowspan","colspan","align","valign"],thead:["align","valign"],tr:["rowspan","align","valign"],tt:[],u:[],ul:[],wbr:[],video:["autoplay","controls","loop","preload","height","width"],svg:["viewBox","version","xmlns","fill","width","height","stroke","stroke-width","style"],path:["d","fill","opacity","stroke","p-id","fill-rule","clip-rule","stroke-width","stroke-linecap","stroke-linejoin","fill-opacity","mask"],rect:["x","y","width","height","fill","stroke","rx"],g:[]},N={collect:null,initCollect:function(){this.collect={whiteList:{},filterProtocol:[]}},removeCollect:function(){var e=P(this.collect),t=e.count,i=e.ret;return this.collect=null,{collectKey:0===t?null:JSON.stringify(i),collectMode:"white"}},onIgnoreTagAttr:function(e,t,n){return e&&v.indexOf(["href","src"],t)>-1?N.domainWhiteList&&Array.isArray(N.domainWhiteList)&&N.domainWhiteList.length>0&&!O(n,i([],N.domainWhiteList,!0))?"":"".concat(t,'="').concat(A(n,function(e){var t;null===(t=N.collect)||void 0===t||t.filterProtocol.push(e)}),'"'):e&&(v.indexOf(["style","class","id"],t)>-1||t.indexOf("data-")>-1)?"".concat(t,'="').concat(n,'"'):(N.collect.whiteList[e]=N.collect.whiteList[e]||[],void N.collect.whiteList[e].push(t))},onIgnoreTag:function(e,t){if("style"===e)return t;b(t,function(e,t,i,n){k(E(n).html.replace("/",""),function(e){N.collect.whiteList[i]=N.collect.whiteList[i]||[],N.collect.whiteList[i].push(e)})},p)},whiteList:R,mergeWhiteList:function(e){for(var t,i={},n=0,r=v.keys(R);n<r.length;n++)i[t=r[n]]=v.from(R[t]);for(var a=0,o=v.keys(e);a<o.length;a++)i[t=o[a]]=t in R?R[t].concat(e[t]):v.from(e[t]);return i},setWhiteList:function(e){for(var t=0,i=v.keys(e);t<i.length;t++){var n=i[t];this.whiteList[n]=n in R?R[n].concat(e[n]):v.from(e[n])}}};try{var M={},j="merge";v.includes(j,"override")&&(N.whiteList=M.whiteList),v.includes(j,"merge")&&N.setWhiteList(M.whiteList)}catch(e){}var B=function(e,t){for(var i={},n=0,r=v.keys(e);n<r.length;n++){var a=r[n];Array.isArray(e[a])?i[a]=v.from(e[a]):i[a]=B({},e[a])}for(var o=0,s=v.keys(t);o<s.length;o++)(a=s[o])in e?Array.isArray(e[a])?i[a]=e[a].concat(t[a]):i[a]=B(e[a],t[a]):Array.isArray(t[a])?i[a]=v.from(t[a]):i[a]=B({},t[a]);return i},U={blackList:{a:["folder"],meta:["content"],iframe:["srcdoc"],input:["pattern"],vmlframe:["xmlns"]},blackTags:["script","xml","embed","isindex","object","base","set","handler","animate","payload","import"],blackAttrs:["charset","ns","namespace","formaction","xlink:href","xmlns:xlink","handler","repeat","repeat-start","repeat-end"],blackAttrRegExps:[/^on/],filterList:{param:["value"],video:["poster"],form:["action"]},filterAttrs:["href","src","background","style","dynsrc","lowsrc","content"]};try{var F={};F.blackAttrRegExps&&(F.blackAttrRegExps=F.blackAttrRegExps.map(function(e){return new RegExp(e.toString().slice(1,e.toString().length-1))}));var Z="merge";v.includes(Z,"override")&&(U=F),v.includes(Z,"merge")&&(U=B(U,F))}catch(e){}var q={mode:"black",whiteList:{},blackConfig:U,collect:null,initCollect:function(){q.collect={blackList:{},blackTags:[],blackAttrs:[],blackAttrRegExps:[],filterAttrs:[],filterList:{},filterProtocol:[]}},removeCollect:function(){var e=P(q.collect),t=e.count,i=e.ret;return q.collect=null,{collectKey:0===t?null:JSON.stringify(i),collectMode:"black"}},onIgnoreTag:function(e,t){var i;if(!v.includes(U.blackTags,e))return b(t,function(e,t,i,n,r){if(-1!==i.indexOf("/"))return p(n);if(r)return"</".concat(i,">");var a=E(n),o=k(a.html,function(e,t){var n,r=0;if(U.blackList[i]&&v.includes(U.blackList[i],e)&&(q.collect.blackList[i]=q.collect.blackList[i]||[],q.collect.blackList[i].push(e),r++),U.blackAttrRegExps.length&&U.blackAttrRegExps.some(function(t){return t.test(e)})&&v.forEach(U.blackAttrRegExps,function(t){t.test(e)&&(q.collect.blackAttrRegExps.push("".concat(t.toString(),"->").concat(e)),r++)}),U.blackAttrs.length&&v.includes(U.blackAttrs,e)&&(U.blackAttrs.push(e),r++),!r){if(U.filterList&&U.filterList[i]&&v.includes(U.filterList[i],e)){var a=A(t,function(e){var t;null===(t=q.collect)||void 0===t||t.filterProtocol.push(e)});return a!==t&&(q.collect.filterList[i]=q.collect.filterList[i]||[],q.collect.filterList[i].push(e)),t?"".concat(e,"='").concat(a,"'"):e}return U.filterAttrs&&v.includes(U.filterAttrs,e)?((a=A(t,function(e){var t;null===(t=q.collect)||void 0===t||t.filterProtocol.push(e)}))!==t&&(null===(n=q.collect)||void 0===n||n.filterAttrs.push(e)),t?"".concat(e,"='").concat(a,"'"):e):t?"".concat(e,"='").concat(t,"'"):e}});return n="<".concat(i),o&&(n+=" ".concat(o)),a.closing&&(n+=" /"),n+=">"},p);null===(i=q.collect)||void 0===i||i.blackTags.push(e)}},V=function(e){var t=e.reportOnly,i=void 0===t||t,n=e.block;return i&&"all"===i?"report":("string"==typeof i&&("true"===i&&(i=!0),"false"===i&&(i=!1)),n?"enforce":i?"report":"enforce")},H=function(e){return function(i,n,r){if(!i||"string"!=typeof i)return i;var a=n;e===D&&(a=N).initCollect();var o=e(i,a);if(S(o)===S(i))return i;if(!r)return o;var s=r.logType,u=V(r),l=a.removeCollect();return C.report(t(t({type:s,disposition:u},l),{sourceText:_(i),filterText:_(o)})),"enforce"===u?o:i}},W=H(function(e,t){return void 0===t&&(t={}),t&&t.whiteList||(t.whiteList={a:["target","href","title"],abbr:["title"],address:[],area:["shape","coords","href","alt"],article:[],aside:[],audio:["autoplay","controls","crossorigin","loop","muted","preload","src"],b:[],bdi:["dir"],bdo:["dir"],big:[],blockquote:["cite"],br:[],caption:[],center:[],cite:[],code:[],col:["align","valign","span","width"],colgroup:["align","valign","span","width"],dd:[],del:["datetime"],details:["open"],div:[],dl:[],dt:[],em:[],figcaption:[],figure:[],font:["color","size","face"],footer:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],header:[],hr:[],i:[],img:["src","alt","title","width","height"],ins:["datetime"],li:[],mark:[],nav:[],ol:[],p:[],pre:[],s:[],section:[],small:[],span:[],sub:[],summary:[],sup:[],strong:[],strike:[],table:["width","border","align","valign"],tbody:["align","valign"],td:["width","rowspan","colspan","align","valign"],tfoot:["align","valign"],th:["width","rowspan","colspan","align","valign"],thead:["align","valign"],tr:["rowspan","align","valign"],tt:[],u:[],ul:[],video:["autoplay","controls","crossorigin","loop","muted","playsinline","poster","preload","src","height","width"]}),new T(t).process(e)}),z=H(D),J=function(e,t,i){var n=[],r=A(e,function(e){n.push(e)});if(r===e)return e;n=v.from(v.uniq(n));var a=t||i||{};if(!a)return r;var o=a.logType,s=V(i);return C.report({type:o,disposition:s,collectKey:n.join("___"),collectData:JSON.stringify(n),collectMode:"black",sourceText:_(e),filterText:_(r)}),"enforce"===s?r:e},X=x._xssProject||{},K=x.xssNamespace||{},Y="3.0.26",G={FilterXSS:T,version:Y,webpackPluginVersion:"<%= webpackPluginVersion =>",reportOnly:"<%= reportOnly =>",filterXSS:W,_filterXSS:z,filterUrl:J,Config:N,BlackConfig:q,project:X,setProjectName:function(e){X[e]=this,x._xssProjectName=e}};K.douyin_web=G,x.xssNamespace=K,x.Math&&!x.Math.xssNamespace&&(x.Math.xssNamespace=K),X[Y]=G,x.globalThis=x,x.getFilterXss=function(){return void 0!==this._xssProjectName?this._xssProject[this._xssProjectName]:G},x.xss=G,x.isSafeUrl=O,x.isSafeDomain=O,x.isSafeProtocol=L,x._xssProject=X,x._xssProjectName&&(X[x._xssProjectName]=G);var Q=G.setProjectName.bind(G);e.BlackConfig=q,e.Config=N,e.FilterXSS=T,e._filterXSS=z,e.filterUrl=J,e.filterXSS=W,e.isSafeDomain=O,e.isSafeProtocol=L,e.isSafeUrl=O,e.project=X,e.setProjectName=Q,e.setXssNamespace=function(e){var t=e.appId,i=e.bid,n=e.region;K[t]=G;N.bid=i,N.region=n,N.enabled=!0},e.xssNamespace=K,Object.defineProperty(e,"__esModule",{value:!0})}),(self.webpackChunkdouyin_web=self.webpackChunkdouyin_web||[]).push([["60945"],{61072:function(e,t,i){function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=Array(t);i<t;i++)n[i]=e[i];return n}i.d(t,{$w:function(){return o},Ac:function(){return w},PA:function(){return s},Vx:function(){return y},XW:function(){return f},Zj:function(){return g},_x:function(){return c},l5:function(){return m},qH:function(){return l},u:function(){return b},x:function(){return a}});function r(e,t,i,n,r,a,o){try{var s=e[a](o),u=s.value}catch(e){return void i(e)}s.done?t(u):Promise.resolve(u).then(n,r)}function a(e){return function(){var t=this,i=arguments;return new Promise(function(n,a){var o=e.apply(t,i);function s(e){r(o,n,a,s,u,"next",e)}function u(e){r(o,n,a,s,u,"throw",e)}s(void 0)})}}function o(e,t,i){return t=h(t),function(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,p()?Reflect.construct(t,i||[],h(e).constructor):t.apply(e,i))}function s(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function u(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,k(n.key),n)}}function l(e,t,i){return t&&u(e.prototype,t),i&&u(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e}function c(e,t,i){return(t=k(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function d(){return(d="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,i){var n=function(e,t){for(;!({}).hasOwnProperty.call(e,t)&&null!==(e=h(e)););return e}(e,t);if(n){var r=Object.getOwnPropertyDescriptor(n,t);return r.get?r.get.call(arguments.length<3?e:i):r.value}}).apply(null,arguments)}function h(e){return(h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function f(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_(e,t)}function p(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(p=function(){return!!e})()}function v(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),i.push.apply(i,n)}return i}function g(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?v(Object(i),!0).forEach(function(t){c(e,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):v(Object(i)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))})}return e}function m(){m=function(){return t};var e,t={},i=Object.prototype,n=i.hasOwnProperty,r=Object.defineProperty||function(e,t,i){e[t]=i.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function l(e,t,i){return Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,i){return e[t]=i}}function c(t,i,n,a){var o=Object.create((i&&i.prototype instanceof g?i:g).prototype);return r(o,"_invoke",{value:function(t,i,n){var r=h;return function(a,o){if(r===f)throw Error("Generator is already running");if(r===p){if("throw"===a)throw o;return{value:e,done:!0}}for(n.method=a,n.arg=o;;){var s=n.delegate;if(s){var u=function t(i,n){var r=n.method,a=i.iterator[r];if(a===e)return n.delegate=null,"throw"===r&&i.iterator.return&&(n.method="return",n.arg=e,t(i,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=TypeError("The iterator does not provide a '"+r+"' method")),v;var o=d(a,i.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,v;var s=o.arg;return s?s.done?(n[i.resultName]=s.value,n.next=i.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,v):s:(n.method="throw",n.arg=TypeError("iterator result is not an object"),n.delegate=null,v)}(s,n);if(u){if(u===v)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===h)throw r=p,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=f;var l=d(t,i,n);if("normal"===l.type){if(r=n.done?p:"suspendedYield",l.arg===v)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r=p,n.method="throw",n.arg=l.arg)}}}(t,n,new D(a||[]))}),o}function d(e,t,i){try{return{type:"normal",arg:e.call(t,i)}}catch(e){return{type:"throw",arg:e}}}t.wrap=c;var h="suspendedStart",f="executing",p="completed",v={};function g(){}function _(){}function y(){}var b={};l(b,o,function(){return this});var k=Object.getPrototypeOf,w=k&&k(k(E([])));w&&w!==i&&n.call(w,o)&&(b=w);var S=y.prototype=g.prototype=Object.create(b);function T(e){["next","throw","return"].forEach(function(t){l(e,t,function(e){return this._invoke(t,e)})})}function x(e,t){var i;r(this,"_invoke",{value:function(r,a){function o(){return new t(function(i,o){!function i(r,a,o,s){var u=d(e[r],e,a);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==typeof c&&n.call(c,"__await")?t.resolve(c.__await).then(function(e){i("next",e,o,s)},function(e){i("throw",e,o,s)}):t.resolve(c).then(function(e){l.value=e,o(l)},function(e){return i("throw",e,o,s)})}s(u.arg)}(r,a,i,o)})}return i=i?i.then(o,o):o()}})}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function P(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function D(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function E(t){if(t||""===t){var i=t[o];if(i)return i.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,a=function i(){for(;++r<t.length;)if(n.call(t,r))return i.value=t[r],i.done=!1,i;return i.value=e,i.done=!0,i};return a.next=a}}throw TypeError(typeof t+" is not iterable")}return _.prototype=y,r(S,"constructor",{value:y,configurable:!0}),r(y,"constructor",{value:_,configurable:!0}),_.displayName=l(y,u,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===_||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,y):(e.__proto__=y,l(e,u,"GeneratorFunction")),e.prototype=Object.create(S),e},t.awrap=function(e){return{__await:e}},T(x.prototype),l(x.prototype,s,function(){return this}),t.AsyncIterator=x,t.async=function(e,i,n,r,a){void 0===a&&(a=Promise);var o=new x(c(e,i,n,r),a);return t.isGeneratorFunction(i)?o:o.next().then(function(e){return e.done?e.value:o.next()})},T(S),l(S,u,"Generator"),l(S,o,function(){return this}),l(S,"toString",function(){return"[object Generator]"}),t.keys=function(e){var t=Object(e),i=[];for(var n in t)i.push(n);return i.reverse(),function e(){for(;i.length;){var n=i.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=E,D.prototype={constructor:D,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(P),!t)for(var i in this)"t"===i.charAt(0)&&n.call(this,i)&&!isNaN(+i.slice(1))&&(this[i]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var i=this;function r(n,r){return s.type="throw",s.arg=t,i.next=n,r&&(i.method="next",i.arg=e),!!r}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var u=n.call(o,"catchLoc"),l=n.call(o,"finallyLoc");if(u&&l){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(u){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(e,t){for(var i=this.tryEntries.length-1;i>=0;--i){var r=this.tryEntries[i];if(r.tryLoc<=this.prev&&n.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var a=r;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=e,o.arg=t,a?(this.method="next",this.next=a.finallyLoc,v):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),v},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var i=this.tryEntries[t];if(i.finallyLoc===e)return this.complete(i.completion,i.afterLoc),P(i),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var i=this.tryEntries[t];if(i.tryLoc===e){var n=i.completion;if("throw"===n.type){var r=n.arg;P(i)}return r}}throw Error("illegal catch attempt")},delegateYield:function(t,i,n){return this.delegate={iterator:E(t),resultName:i,nextLoc:n},"next"===this.method&&(this.arg=e),v}},t}function _(e,t){return(_=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function y(e,t,i,n){var r=d(h(1&n?e.prototype:e),t,i);return 2&n&&"function"==typeof r?function(e){return r.apply(i,e)}:r}function b(e){return function(e){if(Array.isArray(e))return n(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return n(e,t);var i=({}).toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?n(e,t):void 0}}(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function k(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t||"default");if("object"!=typeof n)return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}function w(e){return(w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}},107093:function(e,t,i){i.d(t,{Z:function(){return a}});var n=i(61072);i(346984),i(705574),i(124300),i(802824),i(162093),i(173757),i(232070),i(2885),i(248385),i(374285),i(759943),i(414931),i(240148),i(683656),i(832674),i(905442),i(446336),i(808483),i(840938),i(118438),i(325598),i(92999),i(611067),i(273723),i(724016),i(803903),i(214604),i(901250),i(755006),i(437048),i(488336),i(825666),i(177162),i(286633),i(943281),i(810658),i(82726),i(224727),i(663030);var r=i(861504);let a={findBox:function e(t,i){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];if(t.type!==i){if(t&&t.subBox){var a=t.subBox.filter(function(e){return e.type===i});a.length?a.forEach(function(e){return r.push(e)}):t.subBox.forEach(function(t){return e(t,i,r)})}}else r.push(t);return(r=(0,n.u)(r)).length>1?r:r[0]},padStart:o,toHex:function(){for(var e=[],t=arguments.length,i=Array(t),n=0;n<t;n++)i[n]=arguments[n];return i.forEach(function(t){var i=Number(t).toString(16);e.push(o(i,2,0))}),e},fromHex:function(e){for(var t=new Uint8Array(e.length/2),i=0;i<e.length;i+=2)t[i/2]=window.parseInt(e.substr(i,2),16);return t},sum:function(){for(var e=0,t=arguments.length,i=Array(t),n=0;n<t;n++)i[n]=arguments[n];return i.forEach(function(t){e+=t}),e},StringToArrayBuffer:function(e){for(var t=new ArrayBuffer(e.length),i=new Uint8Array(t),n=0;n<e.length;n++)i[n]=e.charCodeAt(n);return t},ArrayBufferToString:function(e){for(var t="",i=new Uint8Array(e),n=0;n<i.length;n++)t+=String.fromCharCode(i[n]);return t},fromCharCode:s,Base64ToHex:function(e){for(var t=window.atob(e.replace(/-/g,"+").replace(/_/g,"/")),i="",n=0;n<t.length;n++)i+="0".concat(t.charCodeAt(n).toString(16)).substr(-2);return i},toBase64:function(e,t){var i=s(e);t=void 0===t||t;var n=window.btoa(i).replace(/\+/g,"-").replace(/\//g,"_");return t?n:n.replace(/=*$/,"")},toUTF8:function(e){for(var t=unescape(encodeURIComponent(e)),i=new Uint8Array(t.length),n=0;n<t.length;++n)i[n]=t.charCodeAt(n);return i.buffer},strToBuf:function(e){for(var t=[],i=0;i<e.length;i+=2)t.push(parseInt(e[i]+e[i+1],16));return new Uint8Array(t)},str2hex:function(e){if(""===e)return"";for(var t=[],i=0;i<e.length;i++)t.push(e.charCodeAt(i));return t},formatIV:function(e){if(e.length>=16)return e;for(var t=new Uint8Array(16),i=0;i<t.length;i++)t[i]=i<e.length?e[i]:0;return t},parse:function(e){if(!Array.isArray(e)){for(var t=[],i="",n=0;n<e.length;n++)n%2&&(i=e[n-1]+e[n],t.push(parseInt(i,16)),i="");return t}return e.map(function(e){return parseInt(e,16)})},generateUniqueKey:function(e){var t=e.vid,i=e.mediaType,n=e.definition;return(i=i||"video",n=n||-1,t)?"".concat(t,"#").concat(i,"#").concat(n,"#mp4"):null},validateFragment:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(!(e instanceof ArrayBuffer))return!1;try{var i=!0;if(2===t.length){var n=t[1]-t[0]+1;if(!(i=e.byteLength===n))return}}catch(e){return!1}return!0},typeOf:u,nowTime:function(){try{return parseInt("".concat(performance.now()),10)}catch(e){return new Date().getTime()}},extUrl:i(980275).v,deepMerge:function e(t,i){return Object.keys(i).forEach(function(r){var a,o=u(i[r]),s=u(t[r]);"Array"===o?("Array"!==s&&(t[r]=[]),(a=t[r]).push.apply(a,(0,n.u)(i[r]))):"Object"===o?("Object"!==s&&(t[r]={}),e(t[r],i[r])):t[r]=i[r]}),t},getFileSize:function(e,t){try{if(!e||!t)return 0;return parseInt("".concat(t*e/8),10)}catch(e){return 0}},hashVal:function(e){var t,i=0;if(0===e.length)return i;for(t=0;t<e.length;t++)i=(i<<5)-i+e.charCodeAt(t)|0;return i},ArrayCopy:function(e){var t=[];if(!e||!e.length||0===e.length)return t;for(var i=0;i<e.length;i++){var n=e[i],r={};for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(r[a]=n[a]);t.push(r)}return t},concatData:function(e,t){var i=[],n=0;e&&i.push(e),t&&i.push(t),i.every(function(e){return e&&(n+=e.byteLength),!0});var r=new Uint8Array(n),a=0;return i.every(function(e){return e&&(r.set(e,a),a+=e.byteLength),!0}),r},getFragRange:function(e,t,i){var n,r,a,o,s=null,u=null;return s=e<t.length-1?t[e]:t[t.length-1],u=e<i.length-1?i[e]:i[i.length-1],[Math.min((null===(n=s)||void 0===n?void 0:n.range[0])||1/0,(null===(r=u)||void 0===r?void 0:r.range[0])||1/0),Math.max(null===(a=s)||void 0===a?void 0:a.range[1],null===(o=u)||void 0===o?void 0:o.range[1])]},getHostFromUrl:function(e){if("String"!==u(e)||!e)return"";var t=e.split("/"),i="";return t.length>3&&t[2]&&(i=t[2]),i},newUint8Array:function(e){for(var t,i=0;i<r.XZ;)try{if(t=new Uint8Array(e),t.byteLength>0)break;i++}catch(e){i<r.XZ&&i++}return t},checkUrlIsExpired:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(!e||"String"!==u(e))return 0;var i=0;try{var n=RegExp("(\\?|&)x-tos-expires=([^&]*)(&|$)"),r=e.match(n);if(null!==r)i=parseInt(r[2],10);else{var a=e.split("/");a.length>5&&8===a[4].length&&(i=parseInt(a[4],16))}if(i>0){var o=parseInt("".concat(t&&"number"==typeof t?new Date().getTime()/1e3+t:new Date().getTime()/1e3),10);return i<o?1:2}return 0}catch(e){return 0}},getBufferSplits:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:5e5;if(t-e-i<i/2||!t)return[[e,t]];for(var n=[];e<t;){var r=e+i;(r>t||t-r<i/2)&&(r=t),n.push([e,r]),e=r+1}return n},getFirstFrameStartRange:function(e,t){var i,n,r=Number.MAX_VALUE,a=Number.MAX_VALUE;return e&&(r=(null===(i=e[0])||void 0===i||null===(i=i.range)||void 0===i?void 0:i[0])||Number.MAX_VALUE),t&&(a=(null===(n=t[0])||void 0===n||null===(n=n.range)||void 0===n?void 0:n[0])||Number.MAX_VALUE),Math.min(r,a)},getEndFramePos:function(e,t){var i,n,r=0,a=0;return e&&(r=(null===(i=e[e.length-1])||void 0===i||null===(i=i.range)||void 0===i?void 0:i[1])||0),t&&(a=(null===(n=t[t.length-1])||void 0===n||null===(n=n.range)||void 0===n?void 0:n[1])||0),Math.max(r,a)}};function o(e,t,i){for(var n=String(i),r=t>>0,a=Math.ceil(r/n.length),o=[],s=String(e);a--;)o.push(n);return o.join("").substring(0,r-s.length)+s}function s(e){for(var t="",i=0;i<e.length;i+=16e3){var n=e.subarray(i,i+16e3);t+=String.fromCharCode.apply(null,n)}return t}function u(e){return Object.prototype.toString.call(e).match(/([^\s.*]+)(?=]$)/g)[0]}},802325:function(e,t,i){i.d(t,{Z:function(){return k}});var n,r,a=i(648955);i(346984),i(705574),i(303846),i(162093),i(9498),i(117232),i(285069),i(932651),i(2885),i(248385),i(414931),i(663030);var o=i(734123),s=i(899129),u=i(525231),l=i(309324),c=i(521323),d=i(418804),h=i(731751),f=i(965883),p=i(405762),v=i(965410),g=i(874768),m=i(639803),_=i(204961),y=i(373974),b=h.iS;var k=(0,a.qH)(function e(t){var i,n=this;(0,a.PA)(this,e),(0,a._x)(this,"start",(i=(0,a.x)((0,a.l5)().mark(function e(t){var i,r,o,u,l,v,g;return(0,a.l5)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n._beforeLoadStartCostTime=0,n._tm=p.Z.nowTime(),n._sTime=p.Z.nowTime(),!n._checkHasDestroy("start")){e.next=5;break}return e.abrupt("return");case 5:if(n._hasStart&&(n.__dash__&&(n.__dash__.destroy(),n.__dash__=null),n._initProfile(),n._initialize(),n._hasStart=!1),n.setNodeTime("newplayer_start"),i=Date.now(),r=n.__dash__,u=(o=n._pluginInst).player,l=o.config,u.dashState=h.kI,u.emit("dashStateChange",h.kI),!t&&(t=u.config.url="anytext"),v=new s.Z(t,n._pluginInst,r),r){e.next=17;break}return n._info({msg:"__dash__ is null, dashOpts",startMs:i,name:"start __dash__"}),e.abrupt("return");case 17:return r.initDash(v),r.dashVideoEncrypted||r.dashAudioEncrypted||n._pluginInst.softVideo?(c.ZP.log("加密视频"),g=!1===l.useEME,l.useEME=(0,f.isEMESupported)(),(g||n._pluginInst.softVideo)&&(l.useEME=!1),l.intertrustServerURL&&(l.useEME=!0),!l.useEME&&(r.crypto=new d.Z),v.useEME=l.useEME,n._info({msg:"encrypt video ready useEME ".concat(v.useEME)})):(c.ZP.log("非加密视频"),n._info({msg:" no encrypt video ready"})),u.dashState=h.h4,u.emit("dashStateChange",h.h4),e.next=23,n._onWasmReady({url:t});case 23:n._info({msg:"info player start execute",startMs:i,name:"start",profile:!0}),n._hasStart=!0;case 25:case"end":return e.stop()}},e)})),function(e){return i.apply(this,arguments)})),(0,a._x)(this,"_onLoadStart",function(){var e=n._pluginInst.config,t=p.Z.nowTime()-n._tm;n._beforeLoadStartCostTime=t>100?100:t,n.changeState("loadstart","beforeLoadStartCostTime ".concat(n._beforeLoadStartCostTime)),e.mseOpenTimeout>0&&(c.ZP.log("mOPenTime",e.mseOpenTimeout,performance.now()),n._mseOpenTimeoutId=setTimeout(function(){c.ZP.log("Timeout",performance.now()),n._errorHandler(new g.Z(u.wb.MEDIA,g.Z.MSE_OPEN_TIMEOUT,{message:"mse open timeout"})),n._clearMseOpenTimeout();var e,t,i=parseInt((0,m.uS)(h.Hy)||"0")+1;(0,m.iR)(h.Hy,i),null===(e=n.__dash__)||void 0===e||e.destroy(),null===(t=n.__dash__)||void 0===t||null===(t=t.dash)||void 0===t||t.destroy()},e.mseOpenTimeout))}),(0,a._x)(this,"_onLoadData",(0,a.x)((0,a.l5)().mark(function e(){var t,i,r;return(0,a.l5)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n.changeState("loaddata"),null==(r=n.__dash__)||null===(t=r.dash)||void 0===t||t.checkPCDN(),null==r||null===(i=r.dash)||void 0===i||i.cachePreloadData(),c.ZP.log("未起播计时 clearCheckCanplayTimer"),r.clearCheckCanplayTimer(),!(null!=r&&r.abrInstance)){e.next=10;break}return e.next=9,r.abrInstance.init(r.dash.mpd.mediaList);case 9:r.abrInstance.execute();case 10:case"end":return e.stop()}},e)}))),(0,a._x)(this,"_errorHandler",function(e){if(n._checkHasDestroy("errorHandler"))return;var t,i,r,s=n._pluginInst,l=s.player,d=s.config;if(d.codecType===_.$V[_.d0.HEVC].logCodeType&&(null===(t=l.video.error)||void 0===t||null===(t=t.message)||void 0===t?void 0:t.indexOf("video decoder initialization failed"))>=0&&(c.ZP.log("ErrorHandler DECODER_FAILED"),l.emit("DECODER_FAILED",{codecType:d.codecType,vid:d.vid,message:e.message})),e instanceof g.Z)e=new o.Errors(l,e);else if(l.video.error)e=new o.Errors(l,{errorType:u.wb.MEDIA,errorCode:5100+l.video.error.code});else{var f=e;if("string"!=typeof e)try{f=JSON.stringify(e)}catch(e){f="other"}e=new o.Errors(l,{errorType:u.wb.OTHER,errorCode:0,errorMessage:f})}if(null===(i=n._pluginInst)||void 0===i||i.setStartTimelines(y.l1.PLAYER_ERROR,{message:"mse-".concat(e.message,"-").concat(e.errorCode)}),n._errors.push({time:new Date().getTime(),err:e}),l.emit("xglog_cache"),!!e&&l.dashState!==h.Ck&&l.dashState!==h.mD&&"mp4"!==d.defaultFormat){c.ZP.log(d.vid,e),l.dashState=h.Ck,e.vid=d.vid,e.url=l.src;var p=n.__dash__,v=p&&p.isCurrentAutoDefi;if(e.errd&&"object"===(0,a.Ac)(e.errd)&&p&&p.dash&&(e.errd.url=p.dash.url,e.url=p.dash.url),e.url&&e.url.indexOf("blob:")>-1&&d.dashOpts&&d.dashOpts.dynamic_video&&(e.url=d.dashOpts.dynamic_video.main_url),e&&(e.errorCode===n._getCode(u.wb.MEDIA,u.wb.SUB_TYPES.MSE_HIJACK)||e.errorCode===n._getCode(u.wb.MEDIA,u.wb.SUB_TYPES.EME_HIJACK))){l.emit("error",e);return}if(l.emit("DATA_REPORT",e),e&&e.errorCode===n._getCode(u.wb.DRM,u.wb.SUB_TYPES.LICENSE)){n._pluginInst.destroyKernal(),l.emit("error",e);return}if(e&&(e.errorCode===n._getCode(u.wb.MEDIA,u.wb.SUB_TYPES.MSE_ADD_SB)||e.errorCode===n._getCode(u.wb.DEMUX,u.wb.SUB_TYPES.SIDX))){n._handleDegradeToMp4(e);return}if(e.segmentExpired||e.msg===h.uD){p&&p.abrInstance&&"function"==typeof p.abrInstance._stop&&(p.abrInstance._stop(),c.ZP.abr("error stop","expired",e.segmentExpired,e.ex)),n._pluginInst.emitExpireEvent(e);return}if(!e.curReqVideoSegInfo&&p&&(e.curReqVideoSegInfo=JSON.parse(JSON.stringify(p.curReqVideoSegInfo||{}))),!e.headers&&(e.headers=e.curReqVideoSegInfo.headers||{}),d.useBackUrl&&!n._pluginInst._hasUsedBackUrl&&d.dashOpts&&d.dashOpts.dynamic_video&&p){c.ZP.log("backup replay");var m=p.changeMainBackUrl(b.ERR,n._pluginInst._hasUsedBackUrl);p.updateDashType(),v?m.autoBitrateOpts&&(m.autoBitrateOpts.isPlayAutoDefi=!0):(n.currentDefitionFromPlayer&&(m.defaultDefinition=n.currentDefitionFromPlayer.definition),m.autoBitrateOpts&&(m.autoBitrateOpts.isPlayAutoDefi=!1)),n._pluginInst._hasUsedBackUrl=!0,n._pluginInst.next(l.currentTime,"REPLAY",m,!0,"dash"),l.emit("playCatch","dash",e),c.ZP.log("playCatch dash",JSON.stringify(e)),n._emitDegradeEvent(e,"dash");return}p&&p.updateDashType(!0),e&&(null===(r=e)||void 0===r?void 0:r.errorCode)===g.Z.BACK_URL_FAIL&&(l.fallBackFail=!0),n._handleDegradeToMp4(e)}}),this._pluginInst=t,this._errors=[],this._initProfile(),this._proxyPlayer(),this._initialize(),this._bindEvents()},[{key:"changeState",value:function(e){var t,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!this._pTime&&(this._pTime=p.Z.nowTime());var n=p.Z.nowTime()-this._pTime,r=p.Z.nowTime()-this._sTime;c.ZP.log(null===(t=this._pluginInst)||void 0===t||null===(t=t.config)||void 0===t?void 0:t.vid,">>>changeState[".concat(e,"]"),n,r,JSON.stringify(i));var a={state:e,t1:n,t2:r,data:i};!this.states[e]&&(this.states[e]=a),this.allPhases.push(a),this._pTime=p.Z.nowTime()}},{key:"_initProfile",value:function(){this.states={},this.preloadMap={},this.allPhases=[]}},{key:"setNodeTime",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.changeState(e,t),i&&this.setPreloadData(e,t),"initmse_sbopendone"===e&&(c.ZP.log("clear Timeout sbopendone",performance.now()),this._clearMseOpenTimeout())}},{key:"setPreloadData",value:function(e,t){this.preloadMap[e]=t}},{key:"_proxyPlayer",value:function(){var e=this._pluginInst.player;this._originSwitchURL=e.switchURL,this._originErrorHandler=e.errorHandler,e.switchURL=this._switchURL.bind(this),e._startInit=this.start,e.dash=!0,e.errorHandler=this._errorHandler}},{key:"_info",value:function(e){this._pluginInst&&this._pluginInst.info(e)}},{key:"_onWasmReady",value:(n=(0,a.x)((0,a.l5)().mark(function e(t){var i,n,r,s,u,l,d,f,v,g,m,_,y=this;return(0,a.l5)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._checkHasDestroy("_onWasmReady")){e.next=2;break}return e.abrupt("return");case 2:return i=t.url,r=(n=this._pluginInst).player,s=n.config,l=(u=this.__dash__).dash,r.dashState=h.WX,r.emit("dashStateChange",h.WX),c.ZP.log("监听到wasm_ready"),this._info({msg:"wasm_ready"}),p.Z.on(l,"error",this._errorHandler,"destroy"),u.bindComEvent(),e.prev=12,e.next=15,l.init(i);case 15:if(d=e.sent){e.next=19;break}return this._info({msg:"isDestroy ".concat(!r,", isMseNull ").concat(!d)}),e.abrupt("return");case 19:c.ZP.time("initReady cost",new Date().getTime()-u.startTimestamp),r.dashState=h._6,r.emit("dashStateChange",h._6),c.ZP.log("dash init完成"),l.mpd.mediaList.video.length>0&&(!s.defaultDefinition&&(s.defaultDefinition=s.dashOpts.dynamic_video.dynamic_video_list[0].definition,u.lastDefiIdx=0),!u.isOpenAutoDefi&&(u.isCurrentAutoDefi=!1,u.abrInstance.isCurrentInAbr=!1),f=s.defaultDefinition.toString(),this._initDefinitionList(f),(!(v=u.definitions.some(function(e){return e.selected}))||void 0===u.lastDefiIdx)&&(!v&&(u.definitions[0].selected=!0,g=u.definitions[0].definition,this._pluginInst.setCurrentDefitionInfos(g,u.definition2item[g])),r.emit("initialUrl",l.mpd.mediaList.video[0].baseURL),u.curBitrate=s.dashOpts.dynamic_video.dynamic_video_list[0].bitrate,u.lastDefiIdx=0),this._afterInitDefinitionList()),this._pluginInst.originStartInit.call(r,d.url),c.ZP.time("start call cost",new Date().getTime()-u.startTimestamp),r.dashState=h.vL,r.emit("dashStateChange",h.vL),u.startCheckCanplayTimer(),u.isDashCanUse=!0,u.mse=d,u.emitMenuResolutionChange(),"safari"===o.Sniffer.browser&&(o.Util.addClass(r.root,"canplay"),m=function(){o.Util.removeClass(r.root,"xgplayer-is-enter")},p.Z.once(r,"waiting",m)),_=function(){if(!y._checkHasDestroy("onStartPlay"))r.emit("dash_start_play"),y._info({msg:"dash_start_play"}),r.dashState=h.i4,y._info({msg:"START_PLAY ready"}),r.emit("dashStateChange",h.i4),r.emit("playInterfaceInfo",s.dashOpts||{}),!u.isCurrentAutoDefi&&c.ZP.time("onStartPlay cost not abr",new Date().getTime()-u.startTimestamp),u.startProgressTimer(),c.ZP.time("onStartPlay cost",new Date().getTime()-u.startTimestamp),u.setCurrentDefinition()},p.Z.once(l,"start_play",_),this._info({msg:"START_PLAY dashready"}),r.emit("dashready"),e.next=42;break;case 39:e.prev=39,e.t0=e.catch(12),r.errorHandler(e.t0);case 42:case"end":return e.stop()}},e,this,[[12,39]])})),function(e){return n.apply(this,arguments)})},{key:"_initDefinitionList",value:function(e){var t=this;e=e.toString();var i=this._pluginInst,n=i.player,r=i.config,o=this.__dash__,s=o.dash,u=r.dashOpts.dynamic_video.dynamic_video_list;o.definitions=[];for(var l=0;l<u.length;l++){var d=u[l];o.bandwidth2item[d.bitrate]=d,o.definition2item[d.definition]=d}s.mpd.mediaList.video.sort(function(e,t){return t.height-e.height}),s.mpd.mediaList.video.forEach(function(i,u){var l=o.bandwidth2item[i.bandwidth];if(!!l){var d=l.definition.toString(),h=!!(d===e&&(!o.isOpenAutoDefi||!o.isPlayAutoDefi));o.definitions.push((0,a.Zj)((0,a.Zj)({name:r.definitionText&&r.definitionText[d]||d,selected:h,fps:l.fps},l),{},{url:Array.isArray(i.url)?i.url:i.id,definition:String(l.definition)})),i.frameRate=i.frameRate||l.fps||25;var f=l.bitrate;o.updateAbrCacheData(u,o.isPlayAutoDefi,l),d===e&&(c.ZP.log("dashDefinition",d),n.emit("initialUrl",s.mpd.mediaList.video[u].baseURL),o.curBitrate=f,o.lastDefiIdx=u),h&&t._pluginInst.setCurrentDefitionInfos(l.definition,l)}})}},{key:"_afterInitDefinitionList",value:function(){var e=this._pluginInst,t=e.player,i=e.config,n=this.__dash__;t.emit("resourceReady",n.definitions,i.dashOpts.dynamic_video.dynamic_video_list),n.abrInstance.updateBitrate(n.curBitrate);var r=n.definitions.filter(function(e){return e.selected})[0];n.setPlayerCurDefinition(r);var a=n.definitions.filter(function(e){return e.bitrate===n.curBitrate&&"__auto__"!==e.url})[0];this.abrInstance&&a&&(this.abrInstance.isCurrentHDR=!!a.isHDR)}},{key:"_filterBy",value:function(e,t,i){var n=[],r=[];t.forEach(function(t){n.push(t),t[e]&&r.push(t[e])}),Array.isArray(i)&&i.forEach(function(t){t[e]&&!r.includes(t[e])&&n.push(t)});var a=[],o=n.filter(function(e){return"video"===e.mediaType});o.sort(function(e,t){return e.bitrate<t.bitrate?-1:1});var s=n.filter(function(e){return"audio"===e.mediaType});return s.sort(function(e,t){return e.bitrate<t.bitrate?-1:1}),a=(a=a.concat(o)).concat(s)}},{key:"_processFeedData",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this._pluginInst,i=t.player,n=t.config,r=i.config;if(n.playInfoType===m.zB.FEED&&r.definition){var a,o=n.dashOpts.Data,s=r.definition.list,u=r.definition.extraList||[];u.length>0&&u.forEach(function(e){e.isExtra=!0});var l=e?s:(null==o?void 0:o.vid)===n.vid&&(null==o?void 0:o.playInfoList)||s;l=l.filter(function(e){return!e.isExtra}),n.defaultDefinition=r.defaultDefinition||r.definition.defaultDefinition,r.definition.list=l.filter(function(e){return e.vtype.toUpperCase()===y.l0.DASH&&"video"===e.mediaType});var c=l.concat(u)||[];null!==(a=l[0])&&void 0!==a&&a.file_id&&(c=this._filterBy("file_id",l,u)),n.dashOpts.Data={vid:r.vid,duration:r.duration,playInfoList:JSON.parse(JSON.stringify(c))};var d=c.filter(function(e){return e.vtype.toUpperCase()===y.l0.MP4});if(d.length>0||r.downgradeUrl){var h=d.length>0?d:[{url:r.downgradeUrl,definition:"1",vtype:"MP4",size:0,codecType:"h264"}];n.mp4Opts={mp4List:h}}else n.mp4Opts=null}}},{key:"_processData",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this._pluginInst,i=t.player,n=t.config,r=i.config;this._processFeedData(e),n.dashOpts.Data&&(n.playInfoType===m.zB.TOP||n.playInfoType===m.zB.FEED)&&this._playInfoInit(),n.dashOpts.dynamic_video&&(n.dashOpts.dynamic_video.dynamic_video_list=n.dashOpts.dynamic_video.dynamic_video_list||[],n.dashOpts.dynamic_video.dynamic_audio_list=n.dashOpts.dynamic_video.dynamic_audio_list||[],[n.dashOpts.dynamic_video.dynamic_video_list,n.dashOpts.dynamic_video.dynamic_audio_list].forEach(function(e){e.forEach(function(e){if(e.bitrate=parseInt(e.real_bitrate||e.bitrate),r&&"function"==typeof r.preProcessUrl){var t=r.preProcessUrlOptions||{};e.main_url=r.preProcessUrl(e.main_url,t).url,e.backup_url_1=r.preProcessUrl(e.backup_url_1,t).url;var i=Object.assign({},t,{isFallback:!0});e.fallback_url=r.preProcessUrl(e.fallback_url,i).url}})}))}},{key:"_initialize",value:function(){var e=this._pluginInst,t=e.player,i=e.config;if(c.ZP.log(null==i?void 0:i.vid,"执行dashKernal"),this._processData(),!i.dashOpts){this._info({msg:"dashOpts is null",startMs:Date.now(),name:"_initialize",add:!0});return}var n=h.iS,r=new v.Z({pluginInst:this._pluginInst});this.__dash__=r;var a=l.d1.isSupported('video/mp4; codecs="avc1.64001E, mp4a.40.5"');a?r.changeMainBackUrl(n.INIT,this._hasUsedBackUrl):(this._info({msg:"isCodecSupported ".concat(a),add:!0}),null==t||t.errorHandler(new g.Z(u.wb.MEDIA,u.wb.SUB_TYPES.MEDIA_ERR_CODEC_NOT_SUPPORTED,{message:"init"})))}},{key:"_bindEvents",value:function(){var e=this._pluginInst.player;e.on(o.Events.LOAD_START,this._onLoadStart),e.on(o.Events.LOADED_DATA,this._onLoadData)}},{key:"_clearMseOpenTimeout",value:function(){this._mseOpenTimeoutId&&(clearTimeout(this._mseOpenTimeoutId),this._mseOpenTimeoutId=null)}},{key:"beforeLoadStartCostTime",get:function(){return this._beforeLoadStartCostTime}},{key:"_switchURL",value:(r=(0,a.x)((0,a.l5)().mark(function e(t){var i,n,r=arguments;return(0,a.l5)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return i=!(r.length>1)||void 0===r[1]||r[1],n=this.__dash__,e.next=4,n.switchURL(t,i);case 4:case"end":return e.stop()}},e,this)})),function(e){return r.apply(this,arguments)})},{key:"onPreChangeDefinition",value:function(e){if(!Array.isArray(e)||!this.__dash__||!this.__dash__.dash||this.__dash__.dash._hasDestroyed)return[];var t=this._pluginInst,i=t.player,n=t.config,r=i.config,o=null===(s=this.__dash__)||void 0===s||null===(s=s.dash)||void 0===s?void 0:s.mpd;if(o){var s,u,l,c,d,h=(c=null===(d=this.__dash__)||void 0===d||null===(d=d.dash)||void 0===d||null===(d=d.mpd)||void 0===d?void 0:d.getCurrDefition()).videoFileId,f=n.dashOpts.dynamic_video;if(0===e.filter(function(e){return e.file_id===h}).length){var p=f.dynamic_video_list.filter(function(e){return e.file_id===h});p.length>0&&e.push.apply(e,(0,a.u)(p))}var v=c.audioFileId;if(0===e.filter(function(e){return e.file_id===v}).length){var g=f.dynamic_audio_list.filter(function(e){return e.file_id===v});g&&e.push.apply(e,(0,a.u)(g))}}if(r.definition.list=e,this._processData(!0),null===(u=this.__dash__)||void 0===u||null===(u=u.dash)||void 0===u||null===(u=u.mpd)||void 0===u||u.init(!1,c),o){var m=o.mediaList.video,_=m.selectedIdx;this.__dash__.curVideoInitSegmentIdx=_,this.__dash__.curVideoFileId=m[_].fileId}var y=n.defaultDefinition.toString();return this._initDefinitionList((null===(l=i.curDefinition)||void 0===l?void 0:l.definition)||y),this._afterInitDefinitionList(),this.__dash__.definitions}},{key:"_playInfoInit",value:function(){var e=this._pluginInst,t=e.config,i=e.playerConfig,n=t.dashOpts.Data;t.vid=n.VideoID||n.Vid||n.vid,i.vid=t.vid,t.playInfoType===m.zB.TOP?(0,m.NK)(t):t.playInfoType===m.zB.FEED&&(0,m.LY)(t)}},{key:"_getCode",value:function(e,t){return u.WE[e][t]}},{key:"_emitDegradeEvent",value:function(e,t){if(this._pluginInst){var i=this._pluginInst.player,n=e.errorCode,r=e.errorMessage,o=(0,a.Zj)((0,a.Zj)({},e),{},{vtype:t,errc:n,err_msg:r||(null==e?void 0:e.message)});i.pause(),i.emit("degrade",o),c.ZP.log("degrade event emit",JSON.stringify(o))}}},{key:"_handleDegradeToMp4",value:function(e){var t=this;if(!this._checkHasDestroy("_handleDegradeToMp4")){var i=this._pluginInst,n=i.player,r=i.config;if(r.mp4Opts&&!this._hasDegradeMp4){c.ZP.log(r.vid,"_handleDegradeToMp4"),this._hasDegradeMp4=!0,n.dashState=h.mD;var o=r.startTime||n.currentTime||0;setTimeout(function(){var i;if(!t._checkHasDestroy("degrademp4"))t._pluginInst._setStartTime("destroy",o,!0,!1),n.emit("playertypechange"),n.dashState=h.x3,n.emit("playCatch","dash_mp4_2",(0,a.Zj)((0,a.Zj)({},e),{},{url:(null==n||null===(i=n.config)||void 0===i?void 0:i.downgradeUrl)||""})),c.ZP.log(r.vid,"playCatch dash_mp4_2",JSON.stringify(e)),t._emitDegradeEvent(e,"dash_mp4_2"),r.defaultFormat="mp4",t._pluginInst.changeKernal(!0,!1,"dash_mp4_2"),n.once("canplay",function(){if(n.config.autoplay){var e=n.video.play();e&&e.catch(function(){})}})},0)}else!r.mp4Opts&&(n.dashState=h.wL,n.emit("dashDestroy"),n.emit("error",e),c.ZP.log("_handleDegradeToMp4 throw error"))}}},{key:"abrInstance",get:function(){return this.__dash__.abrInstance}},{key:"destroy",value:function(){var e=this._pluginInst.player;this.__dash__&&(this.__dash__.destroy(),this.__dash__=null),e.off(o.Events.LOAD_START,this._onLoadStart),e.off(o.Events.LOADED_DATA,this._onLoadData),e.errorHandler=this._originErrorHandler,e._startInit=this._pluginInst._originStartInit,e.switchURL=this._originSwitchURL,this._pluginInst=null,this._hasStart=!1,c.ZP.log("dashKernal destroy"),this._clearMseOpenTimeout()}},{key:"_checkHasDestroy",value:function(e){return!this._pluginInst&&(this._info({msg:"dashKernal destroy ".concat(e),add:!0}),c.ZP.log("checkHasDestroy",e),!0)}},{key:"executeReady",value:function(){if(!this._checkHasDestroy("executeReady")){var e=this._pluginInst.player;p.Z.once(e,"dash_start_play",function(){e.dashState=h.Y9,e.emit("nextEnded")})}}},{key:"getStat",value:function(){if(!this._checkHasDestroy("getStat")){var e={};e.dvps=!!this._pluginInst.pvStartup,e.daps=!!this._pluginInst.paStartup,e.preLoadData=this.getPreloadStat();var t={},i={};if(this.__dash__&&this.__dash__.dash&&this.__dash__.dash.mse){var n=this.__dash__.dash.mse;if(n._sourceBuffer){for(var r=Object.keys(n._sourceBuffer),a=0;a<r.length;a++){var o=r[a],s=(n._queue[o]||[]).map(function(e){return{opName:e.opName,context:e.context}});i[o]={updating:n._sourceBuffer[o].updating,queue:s.slice(0,Math.max(5,s.length)),queueEmpty:!n._queue[o]}}}}e.mseStat=i,this.__dash__&&this.__dash__.dash&&this.__dash__.dash.mpd&&(t.video=this.__dash__.dash.mpd._getBuffered("video"),t.audio=this.__dash__.dash.mpd._getBuffered("audio")),e.bfs=t;var u=this._pluginInst.player;e.currentTime=u.currentTime;var l=u.video.error;return e.dVideoError=l?{code:l.code,message:l.message}:null,e.errors=this._errors,e.performance=this.states,e.stage=this._getKeyCost(),e}}},{key:"_getKeyCost",value:function(){var e=this,t=function(t,i){var n=e.states[i],r=e.states[t],a=(null==n?void 0:n.t2)-(null==r?void 0:r.t2);return Number.isFinite(a)?a:-1};return{mseopen_to_msedone:t("initmse_sbopen","initmse_sbopendone"),videometastart_to_metadone:t("initvideo_metastart","initvideo_metadone"),audiometastart_to_metadone:t("initaudio_metastart","initaudio_metadone"),videosegstart_to_segdone:t("initvideo_segstart","initvideo_segdone"),audiosegstart_to_segdone:t("initaudio_segstart","initaudio_segdone"),mseopen_to_loadeddata:t("initmse_sbopen","loaddata"),videoappend_to_loadeddata:t("initvideoSegmentAppend","loaddata"),audioappend_to_loadeddata:t("initaudioSegmentAppend","loaddata")}}},{key:"getPreloadStat",value:function(){for(var e={length:0,byteLength:0,load:[],duration:0,audioDuration:0},t=Object.keys(this.preloadMap),i=0;i<t.length;i++){var n=this.preloadMap[t[i]]||{};if(n&&n.fromCache&&n.byteLength){if(e.length+=n.byteLength,e.byteLength+=n.byteLength,e.load.push(n),!n.isInitSegment&&!n.duration)try{var r,a=this.__dash__.dash.mpd.mediaList[n.mediaType],o=null===(r=a[a.selectedIdx].mediaSegments)||void 0===r?void 0:r[0].endRaw;n.duration=o}catch(e){n.duration=5}var s=n.duration;"video"===n.mediaType?e.duration+=s||0:e.audioDuration+=s||0}}return e.loadLength=e.load.length,e}},{key:"pcdnReq",get:function(){var e,t=null===(e=this.__dash__)||void 0===e?void 0:e.dash;return null==t?void 0:t.pcdnReqCnt()}},{key:"pcdnVVStat",value:function(){var e,t=null===(e=this.__dash__)||void 0===e?void 0:e.dash;return null==t?void 0:t.pcdnVVStat()}},{key:"encryptedType",get:function(){return this.__dash__.encryptedType}},{key:"replay",value:function(){var e=this.__dash__;e&&e.abrInstance&&e.abrInstance.isCurrentInAbr&&e.abrInstance.start()}},{key:"bandwidth",get:function(){var e,t=this.__dash__;return t&&t.dash&&t.dash.loadInfo?null===(e=t.dash)||void 0===e?void 0:e.loadInfo:{cdn:{size:0},pcdn:{size:0}}}},{key:"setAudioDefinition",value:function(){var e;null===(e=this.__dash__)||void 0===e||e.setAudioDefinition()}},{key:"isSuspendLoading",get:function(){var e;return(null===(e=this.__dash__)||void 0===e?void 0:e.isSuspendLoading)||!1}},{key:"suspendLoading",value:function(){var e;null===(e=this.__dash__)||void 0===e||e.suspendLoading()}},{key:"resumeLoading",value:function(){var e;null===(e=this.__dash__)||void 0===e||e.resumeLoading()}}])},364285:function(e,t,i){i.d(t,{Z:function(){return u}});var n=i(648955);i(932651),i(759943);var r=i(521323),a=i(731751),o=(0,n.qH)(function e(t){(0,n.PA)(this,e),this.onTick_=t,this.cancelPending_=null},[{key:"tickAfter",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this.stop();var n=!0,r=null;return this.cancelPending_=function(){window.clearTimeout(r),n=!1},r=window.setTimeout(function(){n&&(t.onTick_(),i&&i())},1e3*e),this}},{key:"tickEvery",value:function(e){var t=this;this.tickAfter(e,function(){t.tickEvery(e)})}},{key:"stop",value:function(){this.cancelPending_&&(this.cancelPending_(),this.cancelPending_=null)}}]),s={stallSkip:.1,stallCount:3,stallTimer:1,failCount:2},u=function(){function e(t,i){var r=this,u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;(0,n.PA)(this,e),(0,n._x)(this,"_onTaskRequestError",function(e){r.requests=e}),this.player=t,this.mediaElem=t.video,this.config=Object.assign({},i,s),this.timer=new o(function(){r.onGapJump()}),this.inBufferTimer=new o(function(){r._onBufferStallCheck()}),this.prevReadyState=this.mediaElem.readyState,this.didFireLargeGap=!1,this.seekingEventReceived=!1,this.segmentAppended=!1,this.onWaitFunc=this._onWaiting.bind(this),this.onPlayFunc=this._onPlay.bind(this),this.onPlayingFunc=this._onPlaying.bind(this),this.onPausedFunc=this._onPaused.bind(this),this.isSafari=/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),this.hasPlayed=!1,this.lastVideoTime=-1,this.hasPaused=!1,this.resumeFromPaused=!1,this.stallSkip=this.config.stallSkip,this.stallCount=this.config.stallCount,this.stallTimer=this.config.stallTimer,this.reset(),this.requests=u,this.player.on(a.X4,this._onTaskRequestError),!1!==this.config.useGapJump&&this._start()}return(0,n.qH)(e,[{key:"reset",value:function(){this.stallPoints={}}},{key:"_onWaiting",value:function(){this.onGapJump();var e=this.player.currentTime;this.onRequestFail(e)}},{key:"onRequestFail",value:function(e){if(!!this.requests){var t=this.requests.video,i=this.requests.audio,n=this._checkIfNextRequestFailed(e,t),r=this._checkIfNextRequestFailed(e,i);if(n.result||r.result){var a=n.result?n.end:r.end;a=a<this.player.duration-.5?a+.5:this.player.duration,this.player.currentTime=a,this.player&&this.player.emit("log",{type:"oneevent",end_type:"gap_req",vid:this.config.vid,ext:{video_postion:Math.floor(1e3*a)}})}}}},{key:"_checkIfNextRequestFailed",value:function(e,t){for(var i=0;i<t.length;i++){var n=t[i],r=n.start-e<1.5,a=n.start<=e&&e<=n.end,o=(null==n?void 0:n.response.status)!==403;if(r&&a&&n.count>=this.config.failCount&&o)return{end:n.end,result:!0}}return{result:!1}}},{key:"_onPlay",value:function(){this.hasPlayed=!0}},{key:"_onPaused",value:function(){this.hasPaused=!0}},{key:"_onPlaying",value:function(){this.hasPaused&&(this.hasPaused=!1,this.resumeFromPaused=!0)}},{key:"_start",value:function(){this.mediaElem.addEventListener("waiting",this.onWaitFunc),this.mediaElem.addEventListener("play",this.onPlayFunc),this.mediaElem.addEventListener("playing",this.onPlayingFunc),this.mediaElem.addEventListener("pause",this.onPausedFunc),this.timer.tickEvery(.25),this.inBufferTimer.tickEvery(this.stallTimer)}},{key:"onSegmentAppend",value:function(){this.segmentAppended=!0,this.onGapJump()}},{key:"onSeeking",value:function(){this.seekingEventReceived=!0,this.segmentAppended=!1,this.didFireLargeGap=!1}},{key:"onGapJump",value:function(){if(this.mediaElem.readyState===HTMLMediaElement.HAVE_NOTHING)return;if(this.mediaElem.seeking){if(!this.seekingEventReceived)return}else this.seekingEventReceived=!1;if(this.mediaElem.paused&&0!==this.mediaElem.currentTime&&this.hasPlayed)return;this.mediaElem.readyState!==this.prevReadyState&&(this.didFireLargeGap=!1,this.prevReadyState=this.mediaElem.readyState);var t=this.mediaElem.buffered,i=this.config.smallGapLimit||1,n=this.config.gapDetectionThreshold||.5,a=this.mediaElem.currentTime,o=this._getIndex(t,a,n);if(null===o||0===o&&!this.segmentAppended)return;var s=t.start(o);if(s>this.mediaElem.duration)return;var u=s-a,l=u<=i;if(!(u<e.BROWSER_GAP_TOLERANCE))l&&(this.mediaElem.currentTime=this.isSafari?s+.2:s,r.ZP.gap("gapJump gapIndex",o,"isGapSamll",l,"jumpLargeGap",!1,"currentTime",this.mediaElem.currentTime),.08!==s&&this.player&&this.player.emit("log",{type:"oneevent",end_type:"gap",vid:this.config.vid,ext:{video_postion:Math.floor(1e3*s)}}))}},{key:"_onBufferStallCheck",value:function(){if(!!this.mediaElem&&!this.mediaElem.paused&&!this.mediaElem.ended&&0!==this.mediaElem.playbackRate&&0!==this.mediaElem.buffered.length){for(var e=this.mediaElem.currentTime,t=this.mediaElem.buffered,i=!1,n=[],r=0;r<t.length;r++){var a=t.start(r),o=t.end(r);if(n.push({start:a,end:o}),!(e<a-.1)&&!(e>o-.5))i=!0}var s=this.mediaElem.buffered,u=s.length;u>0&&this.mediaElem.duration===s.end(u-1)&&(i=!0);var l=this.mediaElem.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA;if(i&&l&&this.lastVideoTime===e&&!this.resumeFromPaused&&this.mediaElem.currentTime<this.mediaElem.duration)try{void 0===this.stallPoints[e]&&(this.stallPoints[e]=0),this.stallPoints[e]++,this.stallPoints[e]>this.stallCount&&(this.mediaElem.currentTime<this.mediaElem.duration-this.stallSkip?this.mediaElem.currentTime+=this.stallSkip:this.mediaElem.currentTime=this.mediaElem.duration)}catch(e){}this.lastVideoTime=e,this.resumeFromPaused=!1}}},{key:"_getIndex",value:function(e,t,i){if(!e||!e.length||1===e.length&&e.end(0)-e.start(0)<1e-6)return null;for(var n=this._getBuffered(e),r=null,a=0;a<n.length;a++)if(n[a].start>t&&(0===a||n[a-1].end-t<=i)){r=a;break}return r}},{key:"_getBuffered",value:function(e){if(!e)return[];for(var t=[],i=0;i<e.length;i++)t.push({start:e.start(i),end:e.end(i)});return t}},{key:"destroy",value:function(){var e,t;this.mediaElem.removeEventListener("waiting",this.onWaitFunc),this.mediaElem.removeEventListener("play",this.onPlayFunc),this.mediaElem.removeEventListener("playing",this.onPlayingFunc),this.mediaElem.removeEventListener("pause",this.onPausedFunc),this.timer.stop(),this.timer=null,this.inBufferTimer.stop(),this.inBufferTimer=null,null!==(e=this.player)&&void 0!==e&&null!==(e=e.config)&&void 0!==e&&e.fixOOM&&(null===(t=this.player)||void 0===t||t.off(a.X4,this._onTaskRequestError))}}])}();u.BROWSER_GAP_TOLERANCE=.001},857626:function(e,t,i){i.d(t,{Z:function(){return s}});var n,r,a=i(648955);i(303846),i(2885),i(248385),i(663030);var o=i(391834);var s=(0,a.qH)(function e(t,i){(0,a.PA)(this,e),this._mediaTypeToServiceType={audio:null,video:null},this._useSeparationMode=!1;var n=t.config,r=t.isOpenPCDN,o=t.videoDuration,s=t.uri,u=n.pcdnConfig,l=n.useSeparationMode;this._useSeparationMode=l,l?(this._mediaTypeToServiceType.video=this._createPCDNService(u,r,o,s,i,"video_PCDN"),this._mediaTypeToServiceType.audio=this._createPCDNService(u,r,o,s,i,"audio_PCDN")):this._pcdn=this._createPCDNService(u,r,o,s,i,"all_PCDN")},[{key:"openPCDNForce",value:(n=(0,a.x)((0,a.l5)().mark(function e(t,i){var n;return(0,a.l5)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=this._getPCDNService(i.mediaType),e.next=3,n.openPCDNForce(t,i);case 3:case"end":return e.stop()}},e,this)})),function(e,t){return n.apply(this,arguments)})},{key:"_getPCDNService",value:function(e){return this._useSeparationMode?this._mediaTypeToServiceType[e]:this._pcdn}},{key:"checkPCDN",value:function(e){var t=this._getPCDNService(e.mediaType);null==t||t.checkPCDN(e)}},{key:"_createPCDNService",value:function(e,t,i,n,r,a){return new o.ZP(e,t,i,n,r,a)}},{key:"selectedPCDN",value:function(e,t,i){var n=this._getPCDNService(e);return null==n?void 0:n.selectedPCDN(t,i)}},{key:"isOpenPCDN",value:function(e,t,i,n,r){var a=this._getPCDNService(e);null==a||a.isOpenPCDN(t,i,n,r)}},{key:"setSetRetryInfo",value:function(e,t){var i=this._getPCDNService(e);null==i||i.setSetRetryInfo(t)}},{key:"removePCDNNode",value:(r=(0,a.x)((0,a.l5)().mark(function e(t,i,n){var r;return(0,a.l5)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=this._getPCDNService(t),e.next=3,null==r?void 0:r.removePCDNNode(i,n);case 3:case"end":return e.stop()}},e,this)})),function(e,t,i){return r.apply(this,arguments)})},{key:"getPCDNInOUtBuffer",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"video",t=this._getPCDNService(e);return null==t?void 0:t.getPCDNInOUtBuffer()}},{key:"pcdnVVStat",get:function(){var e,t,i=this;if(!this._useSeparationMode)return this._pcdn.pcdnReqCnt;var n={};if(!this._mediaTypeToServiceType.video||!this._mediaTypeToServiceType.audio)return(null===(e=this._mediaTypeToServiceType.video)||void 0===e?void 0:e.pcdnReqCnt)||(null===(t=this._mediaTypeToServiceType.audio)||void 0===t?void 0:t.pcdnReqCnt)||{};var r=this._mediaTypeToServiceType.video.pcdnReqCnt,a=this._mediaTypeToServiceType.audio.pcdnReqCnt;return Object.keys(r).forEach(function(e){n[e]=i._getValue(e,r)+i._getValue(e,a)}),n}},{key:"pcdnReqCnt",get:function(){var e,t,i,n,r=this;if(!this._useSeparationMode)return this._pcdn.pcdnVVStat;if(!this._mediaTypeToServiceType.video||!this._mediaTypeToServiceType.audio)return(null===(e=this._mediaTypeToServiceType.video)||void 0===e?void 0:e.pcdnVVStat)||(null===(t=this._mediaTypeToServiceType.audio)||void 0===t?void 0:t.pcdnVVStat)||{};var a={},o=["is_try_open","trace_id"],s=null===(i=this._mediaTypeToServiceType.video)||void 0===i?void 0:i.pcdnVVStat,u=null===(n=this._mediaTypeToServiceType.audio)||void 0===n?void 0:n.pcdnVVStat;return Object.keys(s).forEach(function(e){o.includes(e)?a[e]=s[e]||u[e]:a[e]=r._getValue(e,s)+r._getValue(e,u)}),a}},{key:"_getValue",value:function(e,t){return t[e]||0}},{key:"updateConfig",value:function(e,t){this._getPCDNService(e).updateConfig(t)}}])},97447:function(e,t,i){i.d(t,{Z:function(){return g}});var n=i(648955);i(346984),i(68113),i(705574),i(124300),i(162093),i(9498),i(503e3),i(173757),i(932651),i(2885),i(248385),i(496423),i(679308),i(591111),i(663030),i(490629);var r=i(651108),a=i(857287),o=i(373974),s=i(298757),u=i(265614),l=i(608215),c=i(737178),d=i(405762),h=i(965883),f=i(521323),p=i(639803),v=i(857626),g=function(e){var t,i,a,h,g,m,_;function y(e,t){var i;return(0,n.PA)(this,y),(i=(0,n.$w)(this,y,[e,t])).options=t,i._pendingTask=null,i._newLoader(),i}return(0,n.XW)(y,e),(0,n.qH)(y,[{key:"_setItem",value:(t=(0,n.x)((0,n.l5)().mark(function e(t,i){var r,a;return(0,n.l5)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t.vtype=o.l0.DASH,e.next=3,this.preloadManager.getItem(t,!0);case 3:(r=e.sent)?(a=Object.assign({},r,i),a=d.Z.combinePreloadData(a),this.preloadManager.setItem(t,a,!0)):this.preloadManager.setItem(t,i,!0);case 5:case"end":return e.stop()}},e,this)})),function(e,i){return t.apply(this,arguments)})},{key:"_processItemUrl",value:function(e){this.preloadManager.preProcessUrl&&(e.main_url=this.preloadManager.preProcessUrl(e.main_url).url,e.backup_url_1=this.preloadManager.preProcessUrl(e.backup_url_1).url,e.fallback_url=this.preloadManager.preProcessUrl(e.fallback_url).url)}},{key:"_getDashContext",value:function(e){var t=this,i=e.payload;if("TOP"===e.playInfoType){var n={dashOpts:e.payload};(0,p.NK)(n),i=n.dashOpts.dynamic_video}if(Array.isArray(i)){var r={dashOpts:{Data:e,dynamic_video:e}};(0,p.LY)(r),i=r.dashOpts.dynamic_video}return i.dynamic_video_list&&i.dynamic_video_list.forEach(function(e){e.bitrate=e.real_bitrate||e.bitrate,t._processItemUrl(e)}),i.dynamic_audio_list&&i.dynamic_audio_list.forEach(function(e){e.bitrate=e.real_bitrate||e.bitrate,t._processItemUrl(e)}),{dynamic_video:i}}},{key:"_newLoader",value:function(){var e=this,t=this.options,i=t.dynamicTimeoutIns,n=t.dynamicTimeoutAudioIns,r=t.changeUrlRetry,a=t.retry,s=t.retryDelay,l=this.options.timeout||3e3;this._loader=new c.Z({loaderCount:1,loaderType:u.t.XHR,dynamicTimeoutIns:i,dynamicTimeoutAudioIns:n,retry:a,retryDelay:s,changeUrlRetry:r,timeout:l},this.preloadManager,"preloader",this.options.needPreloadCache),this._loader.on("networkError",function(t){var i;null===(i=e.preloadManager)||void 0===i||null===(i=i.player)||void 0===i||i.emit("networkError",t)}),this._loader.on(o.kW,function(t){if((null==t?void 0:t.len)>0){var i,n,r,a=(null==t||null===(i=t.priOptions)||void 0===i?void 0:i.type)||o._R.CDN,s=(null==t||null===(n=t.priOptions)||void 0===n?void 0:n.rtt)||0,u=Math.round(8e3*t.len/t.time/1024),l=null==t?void 0:t.priOptions.extData,c=l.cacheKey,d=null===(r=e._pendingItem)||void 0===r?void 0:r.duration,h={vid:l.vid,loadType:a,size:t.len,speed:u,cacheKey:c,vtype:o.l0.DASH,duration:d,bitrate:l.bitrate,range:t.range,mediaType:l.mediaType,format:o.l0.DASH,segmentDuration:null==l?void 0:l.segmentDuration,rtt:s};e.preloadManager.bwEventEmit(h)}})}},{key:"_getStartContext",value:function(){return{mediaInfos:{dynamic_video_list:[],dynamic_audio_list:[]},vtype:"",video:{segments:[]},audio:{segments:[]}}}},{key:"_cacheInitSegments",value:(i=(0,n.x)((0,n.l5)().mark(function e(t,i,r,a){var o,s,u,l,c,d,h;return(0,n.l5)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return o=t.mediaList.video||[],s=t.mediaList.audio||[],u=[],s&&s.length>0&&(l=this.makeInitBaseSegemntRequest(t,i.duration,"audio",s.selectedIdx,void 0,i.vid),u.push(l)),o&&o.length>0&&(c=this._calVideoItemIdx(o,a.bandwidth)||0,d=o[c].definition,h=this.makeInitBaseSegemntRequest(t,i.duration,"video",c,d,i.vid),u.push(h)),e.next=7,Promise.all(u);case 7:e.sent.forEach(function(e){"video"===e.data.mediaType&&(e.data.orgDefinition=a.orgDefinition),r[e.key]=e.data});case 9:case"end":return e.stop()}},e,this)})),function(e,t,n,r){return i.apply(this,arguments)})},{key:"start",value:(a=(0,n.x)((0,n.l5)().mark(function e(t,i){var r,a,o,u,c,d,h,g,m,_,y,b,k,w,S,T,x,C,P,D,E,I,L,A,O,R,N,M,j,B,U,F,Z,q,V,H,W,z,J,X,K,Y,G,Q,$,ee,et,ei,en,er,ea=this;return(0,n.l5)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return a=(r=Promise.withResolvers()).resolve,o=r.promise,u={},this._pendingTask={resolve:a,data:t,map:u},c=new s.XK,d=this._getDashContext(t),h=new l.Z("anytext",d,this),g=this._getStartContext(),m=function(){g.mediaInfos.dynamic_video_list=h.mediaList.video||[],g.mediaInfos.dynamic_audio_list=h.mediaList.audio||[],c.resolve(g)},h.once("ready",m),h.init(),e.next=12,c;case 12:if(this._pendingTask){e.next=16;break}return _=this.isStepWise(),a({remove:!_}),e.abrupt("return",o);case 16:if(y=new s.XK,b=g.mediaInfos,k=this._getIdx(b.dynamic_video_list,i||t.defaultDefinition),w=b.dynamic_video_list[k]||b.dynamic_video_list[0],b.dynamic_video_list[k]&&h.mediaList.audio&&b.dynamic_audio_list.length>0&&(h.mediaList.video.selectedIdx=k,-1===(S=(0,p.Ft)(h.mediaList.video,h.mediaList.audio))&&(S=0),f.ZP.log("audio definition preload",S),h.mediaList.audio.selectedIdx=S),t.dashType=h.dashType,!(null!==(en=this.options)&&void 0!==en&&null!==(en=en.pcdnConfig)&&void 0!==en&&en.openPreloadPCDN&&null!==(er=this.options)&&void 0!==er&&null!==(er=er.pcdnConfig)&&void 0!==er&&er.openDASHPreloadPCDN&&"segment_template"!==h.dashType)){e.next=38;break}if(T=this.options.pcdnConfig,!((x=d.dynamic_video.dynamic_video_list.filter(function(e){return e.definition===w.definition}))&&x.length>0)){e.next=38;break}if(P=(C=x[0]).duration,D=C.uri,this._pcdn?this._pcdn.updateConfig("video",{vid:D,duration:P}):(E={pcdnConfig:T},this._pcdn=new v.Z({config:E,isOpenPCDN:!0,videoDuration:P,uri:D},null)),!b.dynamic_video_list[k]){e.next=32;break}return!w.bitrate&&(w.bitrate=w.bandwidth),e.next=32,this._pcdn.openPCDNForce(w.bitrate||w.bandwidth,(0,n.Zj)({mediaType:"video"},w));case 32:if(!(h.mediaList.audio&&b.dynamic_audio_list.length>0)){e.next=38;break}return!(L=(I=h.mediaList.audio)[I.selectedIdx]).bitrate&&(L.bitrate=L.bandwidth),e.next=38,this._pcdn.openPCDNForce(L.bitrate||L.bandwidth,(0,n.Zj)({mediaType:"audio"},L));case 38:if(this._pendingItem=w,!this._pendingItem.duration&&(this._pendingItem.duration=t.duration),A={bandwidth:w.bitrate||w.bandwidth,time:t.startTime||0,orgDefinition:w.orgDefinition,hasSegmentRange:!1},O=[],R=this.isStepWise(),e.prev=43,B=void 0===t.video||(null===(N=t.video.segments)||void 0===N?void 0:N.length)===0,void 0===t.stepIdx&&(t.stepIdx=0),void 0===t.steps&&(t.steps=[0]),!R&&(t.steps=[0]),!(0===t.stepIdx||B)){e.next=71;break}if("segment_template"!==h.dashType){e.next=54;break}this._calRequests(h,A,y,t,!0),y.resolve(),e.next=69;break;case 54:if(0!==t.stepIdx){e.next=68;break}if(q=!1,(null==(V=h.mediaList)||null===(U=V.video)||void 0===U?void 0:U.length)>0&&(null==V||null===(F=V.audio)||void 0===F?void 0:F.length)>0&&(q=V.video[V.video.selectedIdx].firstMoofMdatRange&&V.audio[V.audio.selectedIdx].firstMoofMdatRange),!(!R&&q&&null!==(Z=this.options)&&void 0!==Z&&Z.useSegmentRange)){e.next=63;break}t.hasSegmentRange=!0,this._requestAcc(h,A,y,t),e.next=66;break;case 63:return e.next=65,this._cacheInitSegments(h,t,u,A);case 65:this._calRequests(h,A,y,t);case 66:e.next=69;break;case 68:y.resolve([]);case 69:e.next=72;break;case 71:y.resolve([]);case 72:return e.next=74,y;case 74:if(O=e.sent,0===(H=R?t.stepIdx:0)&&this._setItem(t,u),this._pendingTask){e.next=80;break}return a({remove:!R}),e.abrupt("return",o);case 80:R&&(J=t.steps.length,J<(X=Math.max(null===(W=t.video)||void 0===W?void 0:W.segments.length,null===(z=t.audio)||void 0===z?void 0:z.segments.length))&&(Y=Array(X-J).fill(1),(K=t.steps).push.apply(K,(0,n.u)(Y)))),G=[null===(M=t.video)||void 0===M?void 0:M.segments[H],null===(j=t.audio)||void 0===j?void 0:j.segments[H]],Q=(O||[]).concat(G).filter(function(e){return!!e}),$=[],ee=(0,n.sf)(Q),e.prev=85,ei=(0,n.l5)().mark(function e(){var i,r,a,o,s;return(0,n.l5)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:r=(i=et.value).url,a=i.range,o=i.extData,s=ea._getData(r,a,o).then(function(e){"video"===e.mediaType&&(e.orgDefinition=A.orgDefinition),!e.fromCache&&(u[o.cacheKey]=e,f.ZP.log("prelaoder setItem",t,u),ea._setItem(t,u))}),$.push(s);case 4:case"end":return e.stop()}},e)}),ee.s();case 88:if((et=ee.n()).done){e.next=92;break}return e.delegateYield(ei(),"t0",90);case 90:e.next=88;break;case 92:e.next=97;break;case 94:e.prev=94,e.t1=e.catch(85),ee.e(e.t1);case 97:return e.prev=97,ee.f(),e.finish(97);case 100:return e.next=102,Promise.all($);case 102:e.next=107;break;case 104:e.prev=104,e.t2=e.catch(43);case 107:return e.prev=107,a({remove:!R}),e.finish(107);case 110:return this._pendingTask=null,e.abrupt("return",o);case 112:case"end":return e.stop()}},e,this,[[43,104,107,110],[85,94,97,100]])})),function(e,t){return a.apply(this,arguments)})},{key:"isStepWise",value:function(){var e=this.options.openStepwiseType;return this.stepwise&&(void 0===e||e.toUpperCase()===o.l0.DASH)}},{key:"_getIdx",value:function(e,t){var i=0;return e.forEach(function(e,n){e.definition===t&&(i=n)}),i}},{key:"_calRequests",value:function(e,t,i,n){var r=arguments.length>4&&void 0!==arguments[4]&&arguments[4],a=[],o=t.bandwidth,s=e.mediaList.video||[],u=e.mediaList.audio||[],l=n.vid,c=e.getCodecType();if(u&&u.length>0){var d=u.selectedIdx;u[d].codec_type=c;var h=this._calUrls(u[d],"audio",l,null,r,n);a=a.concat(h)}if(s&&s.length>0){var f=this._calVideoItemIdx(s,o)||0,p=s[f];p.codec_type=c;var v=this._calUrls(p,"video",l,p.definition,r,n);a=a.concat(v)}a.length,i.resolve(a)}},{key:"_getSplitGopRange",value:function(e,t,i){var r=e.segment,a=r.range;if(!e.isStep){var o=r.range[1],s=r.range[0];return{allRangeItems:[{item:r,range:a,segmentDuration:r.endRaw-r.startRaw,rangeEnd:o,rangeStart:s}],newSteps:t}}var u=[],l=[],c,d=(0,n.sf)(t);try{for(d.s();!(c=d.n()).done;){var h=c.value;if(h>=r.endRaw){l.push(r.endRaw);break}l.push(h)}}catch(e){d.e(e)}finally{d.f()}var p=void 0===this.options.needfixSizeSegment||this.options.needfixSizeSegment;p&&l.length>0&&l[l.length-1]<r.endRaw&&(l.push(r.endRaw),f.ZP.log("repload change steps"));for(var v=a[0],g=0,m=l.length,_=r.range[1],y=0;y<l.length;y++){var b,k=l[y],w=v,S=p?g===l.length-1:k>=r.endRaw,T=Math.floor(k*i/8)+a[0]+1,x=S?null===(b=r.range)||void 0===b?void 0:b[1]:T-1;v=x+1;var C=x>=_;if(a=[w,C?_:x],w>=x)break;u.push({item:r,range:a,segmentDuration:C?r.endRaw:k,rangeEnd:r.range[1],rangeStart:r.range[0]}),g++}return g<m&&l.splice(g,m-g),{allRangeItems:u,newSteps:l}}},{key:"_recalcSteps",value:function(e,t){var i=0,r=!1,a=[],o,s=(0,n.sf)(t);try{for(s.s();!(o=s.n()).done;){var u=o.value,l=e[i],c=e[e.length-1],d=u.endRaw;if(u.startRaw<=l&&c<d&&!r)for(;i<e.length;)a.push({stepTime:e[i],segment:u,isStep:!0}),i++;else for(;i<e.length;){var h=e[i],f=e[i+1];if(h<u.endRaw&&f<u.endRaw)i++;else{i++,a.push({stepTime:u.endRaw,isStep:!1,segment:u}),r=!0;break}}if(i>=e.length)break}}catch(e){s.e(e)}finally{s.f()}return a}},{key:"_getRange",value:function(e,t){var i=e.mediaSegments,r=t.steps.map(function(e){return e+0}),a=this._recalcSteps(r,i),o=[],s="segment_template"===t.dashType;if((null===(l=t.steps)||void 0===l?void 0:l.length)>0&&(null===(c=t.steps)||void 0===c?void 0:c[0])>0&&!s){if(a[0].isStep){var u=this._getSplitGopRange(a[0],t.steps,e.bandwidth).allRangeItems;o.push.apply(o,(0,n.u)(u))}else{var l,c,d,h=(0,n.sf)(a);try{for(h.s();!(d=h.n()).done;){var f=d.value,p=this._getSplitGopRange(f,t.steps,e.bandwidth).allRangeItems;o.push.apply(o,(0,n.u)(p))}}catch(e){h.e(e)}finally{h.f()}}}else{var v=a[0].segment,g=v.range,m=v.range[0],_=v.range[1];o.push({item:v,range:g,segmentDuration:v.endRaw-v.startRaw,rangeEnd:_,rangeStart:m})}return o}},{key:"_calUrls",value:function(e,t,i,r,a,o){var s=[];if(e){var u=e.avg_bitrate||e.bandwidth||e.bitrate,l=y.vtype;!o[t]&&(o[t]={initSegment:null,segments:[]});var c=o[t];if(a){var h,f,p=[null===(h=e.initSegmentRange)||void 0===h?void 0:h[0],null===(f=e.sidxRange)||void 0===f?void 0:f[1]],v={url:e.initSegment,range:p,extData:{cacheKey:d.Z.generateRequestUniqueKey({vid:i,mediaType:t,codecType:e.codec_type,vtype:l,bitrate:u,fileId:e.fileId,range:p,definition:r}),vid:i,vtype:l,isInitSegment:!0,mediaType:t,useUrlRange:d.Z.validateUrlRange(this.options.url_range_domains,e.initSegment),codecType:e.codec_type,range:p,bitrate:u,segmentDuration:0,checkPreload:!0,urlList:e.backupUrlList}};s.push(v),c.initSegment=v}var g=[];if(o.hasSegmentRange){var m=e.firstMoofMdatRange[0],_=e.firstMoofMdatRange[1];g=[{item:{start:0,end:7,url:e.initSegment},range:[m,_],segmentDuration:7,rangeEnd:_,rangeStart:m}]}else g=this._getRange(e,o);var b,k=(0,n.sf)(g);try{for(k.s();!(b=k.n()).done;){var w=b.value,S=w.item,T=w.range,x=w.segmentDuration,C=w.rangeEnd,P=w.rangeStart,D=d.Z.generateRequestUniqueKey({vid:i,mediaType:t,codecType:e.codec_type,vtype:l,start:S.start,end:S.end,definition:r,bitrate:u,fileId:e.fileId,range:T});c.segments.push({url:S.url,range:T,extData:{cacheKey:D,vid:i,vtype:l,isInitSegment:!1,mediaType:t,useUrlRange:d.Z.validateUrlRange(this.options.url_range_domains,S.url),codecType:e.codec_type,range:T,bitrate:u,segmentDuration:x,checkPreload:!0,rangeEnd:C,rangeStart:P,fileId:e.fileId,urlList:e.backupUrlList}})}}catch(e){k.e(e)}finally{k.f()}}return s}},{key:"_requestAcc",value:function(e,t,i,n){this._calRequests(e,t,i,n,!0)}},{key:"_calStartEnd",value:function(e,t){for(var i=-1,n=0;n<e.length;n++){var r=e[n],a=t||0;if(r.start>=a&&a<r.end){i=n;break}}return -1===i&&(i=0),i}},{key:"_calVideoItemIdx",value:function(e,t){for(var i=0;i<e.length;i++){var n=e[i];if(n&&n.bandwidth===t)return i}return null}},{key:"_getData",value:(h=(0,n.x)((0,n.l5)().mark(function e(t,i,r){var a,o,s,u,l,c,d,h,p,v,g;return(0,n.l5)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,o=t,this._pcdn&&(s=r.mediaType,u=r.bitrate,(l=this._pcdn.selectedPCDN(s,!1,u))&&(t=l,r.isPCDN=!0,f.ZP.log("preload _pcdn",l,r.mediaType,r.bitrate))),r.reqOptions=this.getRequestOption(null===(a=this._pendingTask)||void 0===a?void 0:a.data.reqOptions),e.next=6,this._loader.load(r.mediaType,t,i,r,!0);case 6:if(c=e.sent,!(r.isPCDN&&"error"===c.res)){e.next=13;break}return r.isPCDN=!1,e.next=11,this._loader.load(r.mediaType,o,i,r,!0);case 11:c=e.sent;case 13:return h=(d=c).res,p=d.headers,v=d.status,g=d.fromCache,e.abrupt("return",{res:h,headers:p,status:v,fromCache:g,memory:h.byteLength,vtype:y.vtype,mediaType:r.mediaType,duration:r.segmentDuration,orgDefinition:void 0,range:i,rangeEnd:r.rangeEnd,rangeStart:r.rangeStart,fileId:r.fileId});case 17:return e.prev=17,e.t0=e.catch(0),e.abrupt("return",{res:null});case 21:case"end":return e.stop()}},e,this,[[0,17]])})),function(e,t,i){return h.apply(this,arguments)})},{key:"makeInitBaseSegemntRequest",value:function(e,t,i,n,r,a){var o=this,u=new s.XK,l=e.mediaList[i][n],c=[l.initSegmentRange[0],l.sidxRange[1]],h=l.initSegment,f=e.getCodecType(),p=l.avg_bitrate||l.bandwidth||l.bitrate,v=y.vtype,g={checkPreload:!0,mediaType:i,vid:a,definition:r,useUrlRange:!1,timeout:-1,isInitSegment:!0,bitrate:p,codecType:f,fileId:l.fileId,cacheKey:d.Z.generateRequestUniqueKey({vid:a,codecType:f,mediaType:i,definition:r,vtype:v,bitrate:p,fileId:l.fileId,range:c})};return this._getData(h,c,g).then(function(r){var s=r.res;s&&"error"!==s?o.handleInitData(s,c,l.sidxRange).then(function(o){if(o.sidxSegmentRes&&e.getSidx(o.sidxSegmentRes,i,n,t),d.Z.validateFragment(o.initSegmentRes,c)){var s=Object.assign({},r,{vid:a,mediaType:i,isInitSegment:!0,vtype:v});u.resolve({key:g.cacheKey,data:s})}else u.reject({mediaType:i,index:n,initSegmentRange:c,url:h,rejected:!0})}).catch(function(){u.reject({mediaType:i,index:n,initSegmentRange:c,url:h,rejected:!0})}):u.reject({mediaType:i,index:n,initSegmentRange:c,url:h,rejected:!0})}).catch(function(){u.reject({mediaType:i,index:n,initSegmentRange:c,url:h,rejected:!0})}),u}},{key:"handleInitData",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=new s.XK;if(e instanceof ArrayBuffer){var r=0===t.length?e:e.slice(t[0],t[1]+1),a=null===i?null:e.slice(i[0],i[1]+1);n.resolve({initSegmentRes:r,sidxSegmentRes:a})}return n}},{key:"cancel",value:(g=(0,n.x)((0,n.l5)().mark(function e(){var t,i,r,a;return(0,n.l5)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._loader){e.next=3;break}return e.next=3,this._loader.cancel();case 3:this._pendingTask&&(i=(t=this._pendingTask).data,r=t.map,a=this.isStepWise(),this._pendingTask.resolve({remove:!a}),Object.values(r).length>0&&this._setItem(i,r),this._pendingTask=null);case 4:case"end":return e.stop()}},e,this)})),function(){return g.apply(this,arguments)})},{key:"getPreLoadDataSync",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=d.Z.generateRequestUniqueKey(e),r=this.preloadManager.getItemSync(e,t),a=this.preloadManager.getLoadInfoAndDelete(i);return(0,n.Zj)((0,n.Zj)({cacheKey:i},r),{},{loadInfo:a})}},{key:"getPreLoadData",value:(m=(0,n.x)((0,n.l5)().mark(function e(t){var i,r,a,o,s=arguments;return(0,n.l5)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return i=s.length>1&&void 0!==s[1]&&s[1],r=d.Z.generateRequestUniqueKey(t),e.next=4,this.preloadManager.getItem(t,i);case 4:return a=e.sent,o=this.preloadManager.getLoadInfoAndDelete(r),e.abrupt("return",(0,n.Zj)((0,n.Zj)({cacheKey:r},a),{},{loadInfo:o}));case 7:case"end":return e.stop()}},e,this)})),function(e){return m.apply(this,arguments)})},{key:"destroy",value:(_=(0,n.x)((0,n.l5)().mark(function e(){var t;return(0,n.l5)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:null===(t=this._loader)||void 0===t||t.destroy(),this._loader=null,this._pcdn&&(this._pcdn=null);case 3:case"end":return e.stop()}},e,this)})),function(){return _.apply(this,arguments)})},{key:"parseKey",value:function(e){var t,i,a=(0,n.sf)(e);try{for(a.s();!(i=a.n()).done;){var o=i.value,s=r.s.parseKey(o);"audio"===s.mediaType?s.hasAudio=!0:(s.hasVideo=!0,t=Object.assign({},t,s))}}catch(e){a.e(e)}finally{a.f()}return t}},{key:"taskInProgress",get:function(){return!!this._pendingTask.resolve&&!!this._pendingTask.data}}],[{key:"vtype",get:function(){return o.l0.DASH}},{key:"isUniqueCache",value:function(e){return!!e&&(4===Object.keys(e).length||!1)}},{key:"generateUniqueKey",value:function(e){return d.Z.generateRequestUniqueKey(e)}}])}(a.d);g.encryptUtils=h},829503:function(e,t,i){i.d(t,{Z:function(){return o}});var n=i(236699),r=i(983711),a=i(588987),o=function(){function e(t,i,o){var s=this;(0,n.PA)(this,e),(0,n._x)(this,"_missFrames",0),(0,n._x)(this,"_lastTotalFrames",0),(0,n._x)(this,"_lastTime",0),(0,n._x)(this,"_threshold",0),(0,n._x)(this,"_isVFC",!1),(0,n._x)(this,"_longFrames",0),(0,n._x)(this,"_isResize",!1),(0,n._x)(this,"_totalFrames",0),(0,n._x)(this,"_visibilityFrames",0),(0,n._x)(this,"_visibilityTotalFrames",0),(0,n._x)(this,"_mediaElement",null),(0,n._x)(this,"_onPause",function(){s._isPaused=!0}),(0,n._x)(this,"_onPlay",function(){s._isPaused&&(s._resumePlay=!0,s._isPaused=!1)}),(0,n._x)(this,"_onResize",function(){s._isResize=!1,s._resizeNextRender=!0}),(0,n._x)(this,"_onVisibilityChange",function(){if(s._mediaElement&&s._mediaElement.getVideoPlaybackQuality){var e=s._mediaElement.getVideoPlaybackQuality().totalVideoFrames;if(document.hidden)s._visibilityFrames=e;else{if(s._visibilityFrames>0){var t=e-s._visibilityFrames;s._missFrames+=t,s._visibilityTotalFrames+=t}s._isActiveHidden&&s._activeHiddenCallback(e),s._resumeVisibilityChange=!0}}});var u=t.threshold,l=t.minRenderCount,c=t.longTaskScale,d=t.isVFC;this._threshold=u,this._minRenderCount=l,this._longTaskScale=c,this._mediaElement=i,this._isVFC=d,this._activeHiddenCallback=o,this._isActiveHidden=!1,this._ewma=new a.Z(5),this._onResizeHandler=(0,r.P2)(this._onResize,200,function(){!document.hidden&&(s._isResize=!0,s._resizeNextRender=!1)}),window.addEventListener("resize",this._onResizeHandler),document.addEventListener("visibilitychange",this._onVisibilityChange),this._isVFC&&(i.addEventListener("pause",this._onPause),i.addEventListener("play",this._onPlay)),document.hidden&&(this._isActiveHidden=!0)}return(0,n.qH)(e,[{key:"record",value:function(e,t){this._totalFrames=t;var i=e-this._lastTime,n=t-this._lastTotalFrames-1;n<0&&(n=0),this._lastTotalFrames>0&&!this._resumeVisibilityChange&&((this._isResize||this._resizeNextRender)&&n>=this._threshold?(this._missFrames+=n,this._resizeNextRender=!1):((this._isPaused||this._resumePlay)&&(this._resumePlay=!1,i=this._ewma.getEstimate()||20),this._ewma.sample(1,i),1e3/this._ewma.getEstimate()>=this._minRenderCount?i>1e3/this._minRenderCount*2&&(this._missFrames+=n):this._longFrames+=n)),this._lastTime=e,this._lastTotalFrames=t,this._resumeVisibilityChange&&(this._resumeVisibilityChange=!1)}},{key:"missFrames",get:function(){return this._missFrames}},{key:"getStat",value:function(){return{missFrames:this._missFrames,longFrames:this._longFrames,renderDelta:this._ewma.getEstimate()||0,totalFrames:this._totalFrames,visibilityFrames:this._visibilityTotalFrames}}},{key:"destroy",value:function(){this._missFrames=0,this._lastTotalFrames=0,this._lastTime=0,this._longFrames=0,window.removeEventListener("resize",this._onResizeHandler),document.removeEventListener("visibilitychange",this._onVisibilityChange),this._isVFC&&(this._mediaElement.removeEventListener("pause",this._onPause),this._mediaElement.removeEventListener("play",this._onPlay))}}]),e}()},696001:function(e,t,i){i.d(t,{Z:function(){return o},h:function(){return r}});var n=i(236699);function r(){return"undefined"!=typeof localStorage&&localStorage&&!!localStorage.getItem("playerlog")}function a(){return new Date().toLocaleString()}var o=function(){function e(t){var i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];(0,n.PA)(this,e),this._enable=i||r(),this._logs=[],this._prefix=t}return(0,n.qH)(e,[{key:"log",value:function(){for(var e,t=arguments.length,i=Array(t),n=0;n<t;n++)i[n]=arguments[n];this._enable&&console.log&&(e=console).log.apply(e,[this._prefix,a()].concat(i)),this._logs.push(i.join(","))}},{key:"logMessage",value:function(){if(this._enable){for(var e,t=arguments.length,i=Array(t),n=0;n<t;n++)i[n]=arguments[n];console.log&&(e=console).log.apply(e,[this._prefix,a()].concat(i))}}},{key:"getLogs",value:function(){return this._logs.join("\n")}}]),e}()},427510:function(e,t,i){i.d(t,{C:function(){return s},Z:function(){return l}});var n=i(989559);i(346984),i(124300),i(9498),i(171655),i(232070),i(932651),i(248385),i(414931),i(591111),i(437545),i(630361),i(497736),i(954018),i(506442),i(795434),i(664089),i(863063),i(478782),i(866124),i(378508),i(70698),i(669689),i(663030),i(490629);var r=i(298757),a=["module"],o="danger_d_speed";function s(e){var t=e.toString(16);if(t.length<=8)return{high:0,low:e};var i=parseInt(t.substr(0,t.length-8),16);return{high:i,low:parseInt(t.substr(t.length-8),16)}}var u={stall_penalty:11,switch_penalty:4,interval:1e3,startInterval:1e3,decodeUnderflowBuffer:1,decodeUnderflowMode:1,decodeUnderflowCount:1},l=(0,n.qH)(function e(t,i,a,o){var s=this,l=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{logger:function(){},openLog:!1};(0,n.PA)(this,e),this._wasmPromise=new r.XK,this._hasDeviceInfoChanged=!0,this.uuid=new Date().getTime().toString(36).slice(4),this._defaultMaxBitrate=0,this._underflowBitrate=0,this._minBitrate=1/0,this._isCurrentHDR=!1,this.config=t,this.segment_duration=o||5e3,this.logger=function(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];l.logger.apply(l,["abr(".concat(s.uuid,")::")].concat(t))},this.openLog=l.openLog,this.autoBitrateOpts=Object.assign({},u,t.autoBitrateOpts),this.stall_penalty=this.autoBitrateOpts.stall_penalty,this.switch_penalty=this.autoBitrateOpts.switch_penalty,this.interval=this.autoBitrateOpts.interval;var c=t.progressTimer||1e3,d=this.autoBitrateOpts.startInterval||c;this.initInterval=.8*d,this._preloadMethod=t.preloadmethod||0,this._videoWidth=0,this._videoHeight=0,this._maxDefinition=this.autoBitrateOpts.maxDefinition||null,this._underflowDefinition=this.autoBitrateOpts.underflowDefinition||null,this.updateBitrate(i),this.updateMediaInfos(a,!1)},[{key:"_onLoadWasm",value:function(){var e=this,t=this.autoBitrateOpts.module,i=this.autoBitrateOpts;i.module;var r=(0,n.Kd)(i,a),o=this.autoBitrateOpts.isClassic||!1;return t&&(o?this.module=new t((0,n.Zj)({promise:this._wasmPromise},r)):t(this.module={onRuntimeInitialized:function(){e._wasmPromise.resolve()}})),this._wasmPromise}},{key:"updateMediaInfos",value:function(e){var t=this,i=!(arguments.length>1)||void 0===arguments[1]||arguments[1];if(this._heightToDefinitionConfig=new Map,this._bitrateToDefinitionConfig=new Map,this._definitionToDefitionConfig=new Map,!e){return}e.dynamic_video_list.forEach(function(e){null===(i=t._heightToDefinitionConfig)||void 0===i||i.set(e.height||e.vheight,e);var i,n,r,a=e.bandwidth||e.bitrate;a<t._minBitrate&&(t._minBitrate=a),null===(n=t._bitrateToDefinitionConfig)||void 0===n||n.set(a,e),e.definition&&(null===(r=t._definitionToDefitionConfig)||void 0===r||r.set(e.definition,e))}),this._maxDefinition&&(this._defaultMaxBitrate=this._getBitrate(this._maxDefinition)),this._underflowDefinition&&(this._underflowBitrate=this._getBitrate(this._underflowDefinition)),this.mediaInfos=e}},{key:"_getBitrate",value:function(e){var t;return(null===(t=this._definitionToDefitionConfig)||void 0===t||null===(t=t.get(e))||void 0===t?void 0:t.bandwidth)||-1}},{key:"transformMediaInfo",value:function(){if(this.setDebugModel(this.openLog),!!this.mediaInfos){this.logger("mediaInfos",this.mediaInfos);try{for(var e,t=[],i=this.mediaInfos.dynamic_video_list,n=0;n<i.length;n++){var r=i[n];if(!!r.isHDR===this._isCurrentHDR)t.push({stream_id:"s".concat(n),bandwidth:r.bitrate||r.bandwidth,width:r.vwidth||r.width,height:r.vheight||r.height,codec:r.codecs||r.codec_type||"h264",frame_rate:Number(r.fps)||-1,segment_duration:this.segment_duration,definition:r.qualityType,gearName:r.gearName})}var a=JSON.stringify({v_adaptation:t});null===(e=this.module)||void 0===e||e.ccall("parseMPD","null",["string"],[a])}catch(e){}}}},{key:"_getDefaultSpeed",value:function(e){var t=0,i=navigator.connection;if(i&&i.downlink)t=1024*i.downlink/8,this.logger("initSpeed connect",t);else try{t=parseFloat(r.Xb.getItem(o)||"")||0,this.logger("initSpeed connect",t)}catch(e){}return 0===t&&(t=e&&e.historyAvspeed||0,this.logger("initSpeed history",t)),t}},{key:"setDebugModel",value:function(e){var t,i;null===(t=this.module)||void 0===t||null===(i=t._setDebugModel)||void 0===i||i.call(t,e)}},{key:"updateBitrate",value:function(e){var t,i,n=this;this.bitrate=e,e>0&&(this.module?null===(t=(i=this.module).updateBitrate)||void 0===t||t.call(i,e):this.readyPromise().then(function(){var t,i;null===(t=n.module)||void 0===t||null===(i=t.updateBitrate)||void 0===i||i.call(t,e)}))}},{key:"getPreloadBitrate",value:function(){return null}},{key:"_updateDeviceInfo",value:function(e){try{if(this._hasDeviceInfoChanged){var t,i=window.devicePixelRatio||1;null===(t=this.module)||void 0===t||t._updateDeviceInfo(this._videoWidth||Number(this.config.width),this._videoHeight||Number(this.config.height),i,e||-1)}this._hasDeviceInfoChanged=!1}catch(e){}}},{key:"readyPromise",value:function(){return this._wasmPromise}}]);l.SPPED_CACHE=o},196999:function(e,t,i){i.d(t,{d:function(){return s}});var n=i(330124);i(248385),i(679308),i(88856);var r=i(942155),a=i.n(r),o=i(31201),s=function(e){var t,i,r,a;function s(e,t){var i;return(0,n.PA)(this,s),(i=(0,n.$w)(this,s))._data=null,i.preloadManager=e,i._config=t,i.promisePolyfill(),i}return(0,n.XW)(s,e),(0,n.qH)(s,[{key:"taskInProgress",get:function(){return!1}},{key:"stepwise",get:function(){return this.preloadManager.stepwise}},{key:"getRequestOption",value:function(e){var t=this._config,i=t.getRequestOptionsCallback,n=t.reqOptions,r={};return e?r=e.reqOptions?e.reqOptions:"function"==typeof i?i(e):n||{}:r}},{key:"getUserSelectDefinition",value:function(){return this.preloadManager.getUserSelectDefinition()}},{key:"selectBitrate",value:function(e,t,i){return this.preloadManager.selectBitrate(e,t,i)}},{key:"promisePolyfill",value:function(){!Promise.prototype.finally&&(Promise.prototype.finally=({finally:function(e){var t=function(t){return Promise.resolve(e()).then(t)};return this.then(function(e){return t(function(){return e})},function(e){return t(function(){return Promise.reject(e)})})}}).finally)}},{key:"getData",value:function(){return this._data}},{key:"setData",value:function(e){this._data=e}},{key:"start",value:(t=(0,n.x)((0,n.l5)().mark(function e(t,i){return(0,n.l5)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:throw Error("start need implement, return Promise");case 1:case"end":return e.stop()}},e)})),function(e,i){return t.apply(this,arguments)})},{key:"cancel",value:(i=(0,n.x)((0,n.l5)().mark(function e(){return(0,n.l5)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:throw Error("cancel need implement, cancel current preload request");case 1:case"end":return e.stop()}},e)})),function(){return i.apply(this,arguments)})},{key:"getPreLoadData",value:(r=(0,n.x)((0,n.l5)().mark(function e(t){return(0,n.l5)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:throw Error("getPreLoadData not implement");case 1:case"end":return e.stop()}},e)})),function(e){return r.apply(this,arguments)})},{key:"getPreLoadDataSync",value:function(e){return null}},{key:"hasItemSameVid",value:function(e){return!0}},{key:"destroy",value:(a=(0,n.x)((0,n.l5)().mark(function e(){return(0,n.l5)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Promise.resolve());case 1:case"end":return e.stop()}},e)})),function(){return a.apply(this,arguments)})},{key:"parseKey",value:function(e){return o.s.parseKey(e[0])}}],[{key:"generateUniqueKey",value:function(e){throw Error("generateUniqueCacheKey need implement, return string")}},{key:"vtype",get:function(){throw Error("need vtype")}},{key:"isUniqueCache",value:function(e){return!0}}])}(a())},50590:function(e,t,i){i.d(t,{F:function(){return a}});var n=i(730210);i(941533),i(451236),i(9498),i(248385),i(663030);var r=i(423013),a=function(e){function t(){var e;return(0,n.PA)(this,t),e=(0,n.$w)(this,t,arguments),e._oldContext=null,e._curContext=null,e}return(0,n.XW)(t,e),(0,n.qH)(t,[{key:"start",value:function(){var e=this,t=this.instManager;this.stop(),t.on(r.L.VIDEO_LIST_CONTEXT_CHANGED,function(){var i=t.getVideoListContext();if(!!i)e._curContext&&(e._oldContext=e._curContext),e._curContext=i,e._execTask()})}},{key:"stop",value:function(){this.instManager.off(r.L.VIDEO_LIST_CONTEXT_CHANGED)}},{key:"_execTask",value:function(){this._cancelPrevVideoTask(),this._tryResumeDownloadTask()}},{key:"_getDistanceToNearestLiveVideo",value:function(e){if(!e)return -1;var t=this.instManager.getVideoListContext();if(!t||!t.allVideos||0===t.allVideos.length)return -1;var i=t.allVideos.findIndex(function(t){return t.vid===e});if(-1===i)return -1;for(var n=-1,r=i+1,a=r;a<t.allVideos.length;a++)if(t.allVideos[a].isLive){n=a-i;break}return n}},{key:"_getSelectBitrateFactor",value:function(e){if(!e)return 1;var t=this._getDistanceToNearestLiveVideo(e);if(t<=0)return 1;var i=this.config,n=i.degradeBitrateType,r=i.degradeBitrateFactors;if("factor"===n){if(Array.isArray(r))return Math.max(0,Math.min(1,r[t-1]||1))}else if("force"===n)return Array.isArray(r)&&r[t-1]||0;return 1}},{key:"getSelectBitrateFactor",value:function(e){var t=this.config,i=t.degradeBitrateType,n=t.degradeBitrateFactorType;return{value:this._getSelectBitrateFactor(e),factorType:n,degradeBitrateType:i}}},{key:"_cancelPrevVideoTask",value:function(){if(!this._oldContext||!this._curContext)return;var e=this._curContext,t=e.current,i=e.allVideos,n=i.findIndex(function(e){return e.vid===t.vid});if(-1!==n){var r=this.config,a=r.cancelType,o=r.cancelNum,s=i.find(function(e,t){return t===n-1});switch(a){case"all":this._suspendDownload(s);break;case"pre":var u=i.slice(n).findIndex(function(e){return e.isLive});u>-1&&"number"==typeof o&&o>0&&u+1<=o&&this._suspendDownload(s)}}}},{key:"_satisfyToCancel",value:function(e){return!!e&&(!!(e.getBufferedRange()[1]>=(this.config.cancelMinBuffer||0))||!1)}},{key:"_getWorkingPlugin",value:function(e){if(!!e)return e.plugins.mp4encryptplayer||e.plugins.dashplugin}},{key:"_suspendDownload",value:function(e){var t=this;if(!!e&&!!e.vid&&!e.isLive)this.instManager.findAll(function(t){var i;return(null===(i=t.config)||void 0===i?void 0:i.vid)===e.vid}).forEach(function(e){if(!!t._satisfyToCancel(e)){var i,n=t._getWorkingPlugin(e);n&&(null===(i=n.suspendLoading)||void 0===i||i.call(n))}})}},{key:"_tryResumeDownloadTask",value:function(){var e=this;if(!!this._curContext){var t=this._curContext.current,i=this.instManager.findAll(function(e){var i;return(null===(i=e.config)||void 0===i?void 0:i.vid)===t.vid||e.isUserActive});i.length>0&&i.forEach(function(t){var i,n=e._getWorkingPlugin(t);null!=n&&n.isSuspendLoading&&(null===(i=n.resumeLoading)||void 0===i||i.call(n))})}}}])}(i(613753).N);a.STRATEGY_NAME="vod-live-joint-optimize"},924718:function(e,t,i){i.d(t,{e:function(){return l}});var n=i(730210);i(346984),i(705574),i(124300),i(162093),i(171655),i(932651),i(2885),i(248385),i(591111),i(437545),i(630361),i(497736),i(954018),i(506442),i(795434),i(664089),i(863063),i(478782),i(866124),i(378508),i(70698),i(669689),i(490629);var r=i(524992),a=i(264583),o=i(65661),s=i(449782),u=new Map,l=function(){var e,t;function i(e,t,a,o){var u,l=this;(0,n.PA)(this,i),this.options=i.getDefaultConfig(),Object.keys(e).map(function(t){void 0!==e[t]&&null!==e[t]&&(l.options[t]=e[t])}),!this.options.productConfig||this.options.productConfig.app_id,this.loader=new r.mf(this.options),this.resetTrackeArgs(),this._lastFileInfo=null,this.lastfetchNodeTime=-1,this._lastRetFileKey=null,this._minUpdateNodeStep=this.options.ErrorTimeStep,null!==(u=this.options)&&void 0!==u&&null!==(u=u.adaptPCDNConfig)&&void 0!==u&&u.PCDNBufferControl&&(this.pcdnAdapt=new s.Z(t,a,o,this.options.adaptPCDNConfig))}return(0,n.qH)(i,[{key:"isOpenAdaptPCDN",get:function(){return!!this.pcdnAdapt}},{key:"curPCDNInBuffer",get:function(){return this.pcdnAdapt.curPCDNInBuffer}},{key:"getPCDNInBuffer",value:function(){var e;return null===(e=this.pcdnAdapt)||void 0===e?void 0:e.getPCDNInBuffer()}},{key:"curPCDNOutBuffer",get:function(){return this.pcdnAdapt.curPCDNOutBuffer}},{key:"getPCDNOutBuffer",value:function(){var e;return null===(e=this.pcdnAdapt)||void 0===e?void 0:e.getPCDNOutBuffer()}},{key:"curPCDNChangeCnt",get:function(){return this.pcdnAdapt.PCDNChangeCnt}},{key:"getPCDNChangeCnt",value:function(){var e;return null===(e=this.pcdnAdapt)||void 0===e?void 0:e.getPCDNChangeCnt()}},{key:"updatePCDNBitrate",value:function(e){var t;return null===(t=this.pcdnAdapt)||void 0===t?void 0:t.updateBitrate(e)}},{key:"resetTrackeArgs",value:function(e){this.trackeArgs={fid:null,trace_id:null,req_times:(null==e?void 0:e.req_times)||0,resp_times:(null==e?void 0:e.resp_times)||0,token:null,node_num:this.options.node_num,client_info:this.options.client_info}}},{key:"getPCDNNode",value:function(e,t,i){var n,r=d(t),o=u.get(c(e,r)),s=new a.Qo;return!(null!=o&&o.nodes)||(null==o||null===(n=o.nodes)||void 0===n?void 0:n.length)<1?this.fetchPCDNNode(null,null,i).then(function(e){s.resolve(e)}).catch(function(e){s.reject(e)}):(o.fromCache=!0,s.resolve(o)),s}},{key:"removePCDNNode",value:function(e,t,i){var n=d(t),r=u.get(c(e,n)),a=null==r?void 0:r.nodes;a&&(i?r.nodes=a.filter(function(e){return e&&0>i.indexOf(e.url)}):a.shift(),u.set(c(e,n),r)),(!a||!a.length)&&this.fetchPCDNNode().then().catch(function(){})}},{key:"fetchPCDNNode",value:(e=(0,n.x)((0,n.l5)().mark(function e(t,o,s){var l,h,f,p,v,g,m,_,y,b,k,w,S,T,x,C;return(0,n.l5)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(l=new a.Qo,o){e.next=5;break}o=this._lastFileInfo,e.next=15;break;case 5:if(o.byterate=d(o.bitrate),this.options.trackerOptions&&Object.assign(o,this.options.trackerOptions),this._lastFileInfo=Object.assign({},o,{byterate:o.byterate}),!((null==(f=u.get(c(o.vid,o.byterate)))||null===(h=f.nodes)||void 0===h?void 0:h.length)>0)){e.next=13;break}return f.fromCache=!0,l.resolve(f),e.abrupt("return",l);case 13:delete o.bitrate,this._lastFileInfo=o;case 15:if(o){e.next=18;break}return l.resolve(null),e.abrupt("return",l);case 18:if(p=!1,v=c(o.vid,o.byterate),this._lastRetFileKey!==v&&(this.resetTrackeArgs(),p=!0),!(Date.now()-this.lastfetchNodeTime<this._minUpdateNodeStep&&!p)){e.next=24;break}return l.resolve(null),e.abrupt("return",l);case 24:if(this.lastfetchNodeTime=Date.now(),this._lastRetFileKey=v,o.sfid?o.version=1:o.vid&&(o.version=2),this.options.withReferer&&(o.with_referer=this.options.withReferer),g=JSON.stringify(Object.assign(this.options.productConfig,{file_info:o},this.trackeArgs,{req_id:s})),!(this.trackeArgs.req_times>=this.options.maxCnt)){e.next=33;break}return l.resolve(null),e.abrupt("return",l);case 33:return!this.loader&&(this.loader=new r.mf(this.options)),this.trackeArgs.req_times+=1,e.prev=35,i.pcdn_tracker_request_cnt++,e.next=39,this.loader.load(t||this.options.trackerUrl,{body:g});case 39:m=e.sent,_=null,m&&(this.trackeArgs.resp_times+=1,b=8*o.byterate,m.done&&null!==(y=m.data)&&void 0!==y&&y.Result?((_=(k=m.data.Result).nodes)&&_.length>0?i.pcdn_tracker_success_cnt++:this._minUpdateNodeStep=this.options.NULLNodeTimeStep,_.map(function(e){e.vid=o.vid,e.bitrate=b}),w=k.fid,S=k.trace_id,T=k.req_id,x={nodes:_,fid:w,vid:o.vid,trace_id:S,req_id:T,bitrate:b},C=c(o.vid,o.byterate),u.set(C,x),this.trackeArgs.fid=k.fid,this.trackeArgs.trace_id=k.trace_id,this.trackeArgs.token=k.token,l.resolve(x)):(this._minUpdateNodeStep=this.options.ErrorTimeStep,l.reject(m))),e.next=49;break;case 44:e.prev=44,e.t0=e.catch(35),this._minUpdateNodeStep=this.options.ErrorTimeStep,l.reject(e.t0);case 49:return e.abrupt("return",l);case 50:case"end":return e.stop()}},e,this,[[35,44]])})),function(t,i,n){return e.apply(this,arguments)})}],[{key:"pluginName",get:function(){return"PCDN"}},{key:"pcdnReqCnt",get:function(){var e=i.pcdn_tracker_request_cnt,t=i.pcdn_tracker_success_cnt;return i.pcdn_tracker_request_cnt=0,i.pcdn_tracker_success_cnt=0,{pcdn_tracker_request_cnt:e,pcdn_tracker_failed_cnt:e-t}}},{key:"getDefaultConfig",value:function(){return{trackerUrl:"",loaderType:o.t.FETCH,responseType:o.U.JSON,mode:"cors",method:"POST",retry:0,retryDelay:3e3,timeout:5e3,node_num:5,client_info:null,maxCnt:30,withReferer:0,NULLNodeTimeStep:6e4,ErrorTimeStep:15e3}}},{key:"gainPCDNNode",value:(t=(0,n.x)((0,n.l5)().mark(function e(t,o,s,u){var l,c,h,f,p,v;return(0,n.l5)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return l=i.getDefaultConfig(),Object.keys(o).map(function(e){void 0!==o[e]&&null!==o[e]&&(l[e]=o[e])}),!u||u.app_id,c=new a.Qo,s?(s.byterate=d(s.bitrate),this.options.trackerOptions&&Object.assign(s,this.options.trackerOptions),delete s.bitrate):c.reject("video fileInfo need set"),h=JSON.stringify(Object.assign(u,{file_info:s},{node_num:(null==o?void 0:o.node_num)||3})),f=new r.mf(l),e.prev=8,i.pcdn_tracker_request_cnt++,e.next=12,f.load(t,{body:h});case 12:(v=e.sent).done&&(null===(p=v.data)||void 0===p||null===(p=p.Result)||void 0===p||null===(p=p.nodes)||void 0===p?void 0:p.length)>0&&i.pcdn_tracker_success_cnt++,c.resolve(v),e.next=20;break;case 17:e.prev=17,e.t0=e.catch(8),c.reject((null===e.t0||void 0===e.t0?void 0:e.t0.message)||"get pcdnNode error");case 20:return e.abrupt("return",c);case 21:case"end":return e.stop()}},e,this,[[8,17]])})),function(e,i,n,r){return t.apply(this,arguments)})}])}();function c(e,t){return"".concat(e,"-").concat(t)}function d(e){return Math.floor(e/8)}(0,n._x)(l,"pcdn_tracker_request_cnt",0),(0,n._x)(l,"pcdn_tracker_success_cnt",0)},713804:function(e,t,i){i.d(t,{XB:function(){return n},cF:function(){return r},eq:function(){return s},uZ:function(){return a}}),i(487689),i(2885);var n={beta:.49,eta:5200,gamma:1100};function r(e,t,i,n){for(var r=1-(1-a(t,0,1))*(1-o(n,e.beta,e.eta,e.gamma)),s=n,u=i;u-s>1;){var l=(s+u)/2;o(l,e.beta,e.eta,e.gamma)<r?s=l:u=l}return s}function a(e,t,i){return Math.min(Math.max(e,t),i)}function o(e,t,i,n){return e<=n?0:-Math.expm1(-Math.pow((e-n)/i,t))}function s(e,t){var i;try{var n=JSON.parse(e);!((i=Array.isArray(n)?{gamma:n[0],beta:n[1],eta:n[2]}:t).beta>0&&i.eta>0&&i.gamma>0)&&(i=t)}catch(e){i=t}return i}},929415:function(e,t,i){i.d(t,{j:function(){return n}});var n="undefined"!=typeof window},403177:function(e,t,i){i.d(t,{wN:function(){return o}});var n=i(570783),r=["algorithm","type"];function a(e,t,i){return"number"!=typeof e||Number.isNaN(e)?t:Math.min(i,Math.max(t,e))}function o(e){if(!!e){if(e&&"object"===(0,n.Ac)(e)){e.algorithm;var t=e.type,i=(0,n.Kd)(e,r);return 1===t?new s(i):new u(i)}}}var s=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,n.PA)(this,e);var i=t.alpha,r=t.minTimeout,a=t.maxTimeout,o=t.initialTimeout;this._alpha=void 0===i?.8:i,this._min=void 0===r?0:r,this._max=void 0===a?1/0:a,this._initial=o,this._ewma=void 0}return(0,n.qH)(e,[{key:"getTimeout",value:function(){var e,t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return a(Math.round(null!==(e=null!==(t=this._ewma)&&void 0!==t?t:this._initial)&&void 0!==e?e:i),this._min,this._max)}},{key:"update",value:function(e){if("number"!=typeof e||Number.isNaN(e)||e<0)return this.getTimeout();var t=this._ewma||3e3;return this._ewma=this._alpha*e+(1-this._alpha)*t,this.getTimeout()}},{key:"reset",value:function(){this._ewma=void 0}}]),e}(),u=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,n.PA)(this,e);var i=t.alpha,r=t.beta,a=t.k,o=t.minTimeout,s=t.maxTimeout,u=t.initialTimeout;this._alpha=void 0===i?.125:i,this._beta=void 0===r?.25:r,this._k=void 0===a?4:a,this._min=void 0===o?0:o,this._max=void 0===s?1/0:s,this._initial=u||1e3,this._srtt=void 0,this._rttvar=void 0}return(0,n.qH)(e,[{key:"getTimeout",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return a(Math.round(void 0!==this._srtt&&void 0!==this._rttvar?this._srtt+this._k*this._rttvar:null!=e?e:this._initial),this._min,this._max)}},{key:"update",value:function(e){if("number"!=typeof e||Number.isNaN(e)||e<0)return this.getTimeout();if(void 0===this._srtt||void 0===this._rttvar)return this._srtt=e,this._rttvar=e/2,this.getTimeout();var t=this._srtt;return this._srtt=t+this._alpha*(e-t),this._rttvar=this._rttvar+this._beta*(Math.abs(e-t)-this._rttvar),this.getTimeout()}},{key:"reset",value:function(){this._srtt=void 0,this._rttvar=void 0}}]),e}()},264583:function(e,t,i){function n(){var e,t,i=new Promise(function(i,n){e=i,t=n});return i.used=!1,i.resolve=function(){return i.used=!0,e.apply(void 0,arguments)},i.reject=function(){return i.used=!0,t.apply(void 0,arguments)},i}function r(){try{return parseInt(performance.now(),10)}catch(e){return new Date().getTime()}}i.d(t,{Kp:function(){return a},Qo:function(){return n},je:function(){return r}});var a={stringify:function(e){try{return JSON.stringify(e)}catch(e){return""}},parse:function(e){try{return JSON.parse(e)}catch(e){return}}}},897311:function(e,t,i){i.d(t,{N:function(){return s}});var n=i(697946),r=i(834279),a=i(578548),o=i(107180),s=function(){function e(t,i,r){(0,n.PA)(this,e),this.videoTrack=t,this.audioTrack=i;var a=/Chrome\/([^.]+)/.exec(navigator.userAgent);this.forceFirstIDR=a&&50>Number(a[1]),this.log=new o.Y("FMP4Remuxer",!r||!r.openLog||!r.openLog)}return(0,n.qH)(e,[{key:"remux",value:function(){var e,t,i,n,a,o=arguments.length>0&&void 0!==arguments[0]&&arguments[0],s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},u=this.videoTrack,l=this.audioTrack,c=u.exist(),d=l.exist(),h=[];return o&&(s&&s.initMerge?(c&&h.push(this.videoTrack),d&&h.push(this.audioTrack),i=r.b.initSegment(h)):(c&&(e=r.b.initSegment([this.videoTrack])),d&&(t=r.b.initSegment([this.audioTrack])))),c&&u.hasSample()&&(n=this._remuxVideo()),d&&l.hasSample()&&(a=this._remuxAudio()),u.samples=[],l.samples=[],{initSegment:i,videoInitSegment:e,audioInitSegment:t,videoSegment:n,audioSegment:a}}},{key:"_remuxVideo",value:function(){var e=this.videoTrack;this.forceFirstIDR&&(e.samples[0].flag={dependsOn:2,isNonSyncSample:0});var t=e.samples,i=/av01/.test(e.codec),n=0;i?t.forEach(function(e){n+=e.data.byteLength}):t.forEach(function(e){n+=e.units.reduce(function(e,t){return e+t.byteLength},0)+4*e.units.length});var o=new Uint8Array(n);if(i)for(var s,u=0,l=t.length,c=0;u<l;u++)s=t[u],o.set(s.data,c),s.size=s.data.byteLength,c+=s.size;else{for(var d,h=new DataView(o.buffer),f=function(e,i){i=t[p];var n=0;i.units.forEach(function(t){h.setUint32(e,t.byteLength),e+=4,o.set(t,e),e+=t.byteLength,n+=4+t.byteLength}),i.size=n,g=e,d=i},p=0,v=t.length,g=0;p<v;p++)f(g,d)}var m=r.b.mdat(o),_=r.b.moof([e]);return(0,a.gJ)(_,m)}},{key:"_remuxAudio",value:function(){var e=this.audioTrack,t=new Uint8Array(e.samples.reduce(function(e,t){return e+t.size},0));e.samples.reduce(function(e,i){return t.set(i.data,e),e+i.size},0);var i=r.b.mdat(t),n=r.b.moof([e]);return(0,a.gJ)(n,i)}},{key:"reset",value:function(){this.videoTrack.reset(),this.audioTrack.reset()}}]),e}()},849280:function(e,t,i){i.r(t)}}]);