(function(lb,mb){typeof exports==="object"&&typeof module!=="undefined"?module.exports=mb():typeof define==="function"&&define.amd?define(mb):(lb=typeof globalThis!=="undefined"?globalThis:lb||self,lb.ZWPlayer=mb())})(this,function(){function lb(){var a,t,z,y=navigator.userAgent.toLowerCase(),x;(x=y.match(/rv:([\d.]+)\) like gecko/))?a=x[1]:(x=y.match(/msie ([\d.]+)/))?a=x[1]:(x=y.match(/edge\/([\d.]+)/))?t=x[1]:y.match(/firefox\/([\d.]+)/)||y.match(/chrome\/([\d.]+)/)||((x=y.match(/opera.([\d.]+)/))?
z=x[1]:y.match(/version\/([\d.]+).*safari/)||0);return t?{broswer:"Edge",version:t,edge:!0,ver:parseInt(t)}:a?{broswer:"IE",version:a,ie:!0,ver:parseInt(a)}:z?{broswer:"Opera",version:z,opera:!0,ver:parseInt(z)}:{broswer:"",version:"0",ver:0}}function mb(a,t){if(!a)return!1;if(a==t)return!0;var z=a.indexOf(t);if(z<0)return!1;if(z>0){if(a.charAt(z-1)==" "&&(a.length-z==t.length||a.charAt(z+t.length)==" "))return!0}else if(a.charAt(t.length)==" ")return!0;return!1}function hb(a){if(a==null)return"";
a=String(a);for(var t="",z=0;z<a.length;)if(a.charAt(z)!=="<"){var y=a.indexOf("<",z);y===-1&&(y=a.length);t+=Nb(a.substring(z,y));z=y}else{y=a.indexOf(">",z);if(y===-1){t+=Nb(a.substring(z));break}z=a.substring(z,y+1);var x=ld(z);t=x!==null?t+x:t+Nb(z);z=y+1}return t}function Nb(a){return a.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function ld(a){var t=a.match(/^<\s*(\/?)\s*([a-zA-Z0-9]+)([^>]*)>$/);if(!t)return null;a=t[1];var z=t[2].toLowerCase();t=t[3];return z==="br"?a?
null:"<br/>":z==="b"||z==="i"||z==="u"?t.trim()!==""?null:"<"+a+z+">":z==="font"?a?t.trim()!==""?null:"</font>":(a=t.match(/^\s+color\s*=\s*"([^"]*)"$/i))?(a=a[1],/^#[0-9a-fA-F]{3,8}$/.test(a)||/^[a-zA-Z]+$/.test(a)?'<font color="'+a+'">':null):(a=t.match(/^\s+face\s*=\s*"([^"]*)"$/i))?'<font face="'+a[1]+'">':null:z==="c"?a?t.trim()!==""?null:"</c>":(a=t.match(/^(\.[\w-]+)?$/))?"<c"+(a[1]||"")+">":null:z==="v"?a?t.trim()!==""?null:"</v>":(a=t.match(/^\s+(\S[^<>]*)$/))&&/^[^=<>"']*$/.test(a[1])?"<v "+
a[1]+">":"<v>":null}function sc(a){var t={font_size:.4,font_color:"#FFFFFF",background_alpha:.5,background_color:"#9C27B0",Stroke:"none",body:[]},z=function(n){n=String(n).trim().split(/\s+/)[0];n=n.split(":");if(n.length!==3)return 0;var m=parseInt(n[0],10)*3600,u=parseInt(n[1],10)*60,f=parseInt(n[2],10),c=n[2].indexOf(","),h=0;c>0&&(h=parseInt(n[2].substr(c+1))/1E3);return m+u+f+h};a=a.replace(/\r/g,"");a=a.split(/\n\s*\n/);for(var y=0;y<a.length;y++){var x=a[y].trim();if(x&&(x=x.split("\n"),!(x.length<
2))){var e=0,d=x[0].trim();d.indexOf("--\x3e")===-1&&/^\d+$/.test(d)&&(e=1);if(!(e>=x.length)){var r=x[e].split(" --\x3e ");r.length===2&&(d={},d.id=y+1,d.from=z(r[0].trim()),d.to=z(r[1].trim()),d.location=2,x=x.slice(e+1),d.content=hb(x.join("\n").trim()),d.content&&t.body.push(d))}}}return t}function Ab(a){var t={font_size:.4,font_color:"#FFFFFF",background_alpha:.5,background_color:"#9C27B0",Stroke:"none",body:[]},z=function(d){d=String(d).trim().split(/\s+/)[0];d=d.split(":");var r=0,n=0;if(d.length===
3){r=parseInt(d[0],10)*3600;n=parseInt(d[1],10)*60;var m=parseInt(d[2],10)}else if(d.length===2)n=parseInt(d[0],10)*60,m=parseInt(d[1],10);else if(d.length===1)m=parseInt(d[0],10);else return 0;var u=d.length-1,f=d[u].indexOf("."),c=0;f>0&&(c=parseInt(d[u].substr(f+1))/1E3);return r+n+m+c};a=a.replace(/\r/g,"");a=a.split("\n");if(a.length<2||a[0].substr(0,6)!=="WEBVTT"||a[1].trim().length!==0)return null;for(var y=2;y<=a.length-2;){var x={};if(!a[y].startsWith("NOTE")&&a[y].trim()!==""){var e=a[y].split(" --\x3e ");
if(e.length!==2&&(e=a[y].trim(),x.id=parseInt(e),y++,e=a[y].split(" --\x3e "),e.length!==2)){y++;continue}x.from=z(e[0].trim());x.to=z(e[1].trim());x.location=2;y++;x.content=a[y].trim();for(y++;y<a.length;){e=a[y].trim();if(!e)break;x.content+="<br/>"+e;y++}x.content=hb(x.content);t.body.push(x)}y++}return t}function Ob(a){if(!a)return[];a=a.replace(/\r/g,"").trim();var t=a.indexOf("\n\n");a=t>0?a.substring(t+2):a.substring(a.indexOf("\n")+1);return(a=Ab("WEBVTT\n\n"+a.trim()))&&a.body&&a.body.length!==
0?a.body:[]}function Pb(a,t){if(a==null)return null;var z=String(a).trim();if(a=z.match(/^(\d+):(\d+):(\d+(?:\.\d+)?)(?::(\d+))?(?:\.\d+)?$/))return z=parseInt(a[1],10)*3600+parseInt(a[2],10)*60+parseFloat(a[3]),a[4]!=null&&(z+=parseInt(a[4],10)/(t.frameRate||30)),z;if(a=z.match(/^(-?\d+(?:\.\d+)?)(ms|s|m|h|f|t)?$/))switch(z=parseFloat(a[1]),a[2]||"s"){case "ms":return z/1E3;case "s":return z;case "m":return z*60;case "h":return z*3600;case "f":return z/(t.frameRate||30);case "t":return z/(t.tickRate||
1)}return null}function md(a,t){if(t==null){t=!1;for(var z=a;z&&z.nodeType===1;z=z.parentNode)if(z.getAttribute&&z.getAttribute("xml:space")==="preserve"){t=!0;break}}var y=[];(function d(e){for(e=e.firstChild;e;e=e.nextSibling)e.nodeType===3?y.push(t?e.nodeValue:e.nodeValue.replace(/[ \t\r\n\f]+/g," ")):e.nodeType===1&&(e.localName==="br"?y.push("\n"):e.localName!=="script"&&e.localName!=="style"&&d(e))})(a);a=y.join("").split("\n");if(!t)for(z=0;z<a.length;z++)a[z]=a[z].trim();for(;a.length&&a[0]===
"";)a.shift();for(;a.length&&a[a.length-1]==="";)a.pop();return a.join("<br/>")}function tc(a){var t={font_size:.4,font_color:"#FFFFFF",background_alpha:.5,background_color:"#9C27B0",Stroke:"none",body:[]};if(!a)return t;try{var z=(new DOMParser).parseFromString(String(a),"text/xml")}catch(n){return t}if(!z||z.getElementsByTagName("parsererror").length>0)return t;a=z.documentElement;a={frameRate:parseFloat(a&&a.getAttribute&&a.getAttribute("ttp:frameRate"))||0,tickRate:parseFloat(a&&a.getAttribute&&
a.getAttribute("ttp:tickRate"))||0};var y=[];(function u(m){for(m=m.firstChild;m;m=m.nextSibling)m.nodeType===1&&(m.localName==="p"&&y.push(m),u(m))})(z);for(z=0;z<y.length;z++){var x=y[z],e=Pb(x.getAttribute("begin"),a);if(e!=null){var d=Pb(x.getAttribute("end"),a);if(d==null){var r=Pb(x.getAttribute("dur"),a);r!=null&&(d=e+r)}d!=null&&(x=hb(md(x)))&&t.body.push({from:e,to:d,content:x,location:2})}}return t}function uc(a){function t(e){var d=Math.floor(e/36E5),r=Math.floor(e%36E5/6E4),n=Math.floor(e%
6E4/1E3);e%=1E3;return(d<10?"0":"")+d+":"+(r<10?"0":"")+r+":"+(n<10?"0":"")+n+","+(e<100?e<10?"00":"0":"")+e}for(var z=[],y=0;y<a.length;y++){var x=a[y];z.push(y+1+"\n"+t(Math.round(x.from*1E3))+" --\x3e "+t(Math.round(x.to*1E3))+"\n"+(x.content||"")+"\n")}return z.join("\n")}function Qb(){vc||(vc=!0,za._langExplicit||(typeof window!=="undefined"&&window.navigator&&(navigator.languages&&navigator.languages.length&&navigator.languages[0].toLowerCase().startsWith("zh")||navigator.language&&navigator.language.toLowerCase().startsWith("zh")||
navigator.browserLanguage&&navigator.browserLanguage.toLowerCase().startsWith("zh")||navigator.systemLanguage&&navigator.systemLanguage.toLowerCase().startsWith("zh")||navigator.userLanguage&&navigator.userLanguage.toLowerCase().startsWith("zh"))?(za.defaultLang="zh",Bb&&console.log("\u4e2d\u6587\u6d4f\u89c8\u5668\uff0c\u8bbe\u7f6e\u64ad\u653e\u5668\u4e3a\u4e2d\u6587\u3002")):(za.defaultLang="en",Bb&&console.log("\u975e\u4e2d\u6587\u6d4f\u89c8\u5668\uff0c\u8bbe\u7f6e\u64ad\u653e\u5668\u4e3a\u82f1\u6587\u3002"))))}
function nd(a,t){if(a&&za.languages[a]||a&&(a=String(a).split("-")[0])&&za.languages[a])return a;t&&za.languages[t]||(Qb(),t=za.defaultLang);return t&&za.languages[t]?t:"en"}function Rb(a){var t;Sb===null&&(Sb=(t=typeof window!=="undefined"&&window.matchMedia?window.matchMedia("(pointer: coarse)"):null)&&t.matches||"ontouchstart"in window);t=Sb;return t?K("selectLocalVideoHint","Click to open a local video file",a):K("selectOrDropVideo","Click or drag file here to play",a)}function Tb(){if(!wc){wc=
!0;var a=typeof document!=="undefined"&&document.documentElement?document.documentElement:null;Cb=!!(a&&"classList"in a)}}function Ea(a){if(a===null||a===void 0)return"";if(typeof document==="undefined")return String(a).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");var t=document.createElement("div");t.textContent=String(a);return t.innerHTML}function rb(a){return typeof a==="string"&&a?a.indexOf("http://")===0||a.indexOf("https://")===0:!1}function Db(a){if(typeof a==="number")return a;
a=a.split(":");return a.length===2?parseInt(a[0])*60+parseFloat(a[1]):a.length===3?parseInt(a[0])*3600+parseInt(a[1])*60+parseFloat(a[2]):a.length===1?parseFloat(a[0]):a.length>3?9.999999999999999E8:0}function sb(a,t){var z=t&&t.precision||null;t=t&&t.showHours!==void 0?t.showHours:"auto";var y=typeof a==="number"?a:parseFloat(a);isNaN(y)&&(y=0);y=Math.max(0,y);var x=Math.floor(y),e=Math.floor(x/3600),d=Math.floor(x%3600/60),r=Math.floor(x%60);a="";if(t===!0||t==="auto"&&e>0)a+=e+":";a=d>=10?a+(d+
":"):a+("0"+d+":");a=r>=10?a+r:a+("0"+r);if(z==="ms"){for(z=Math.round((y-x)*1E3).toString();z.length<3;)z="0"+z;a=a+"."+z}else if(z==="cs"){for(z=Math.round((y-x)*100).toString();z.length<2;)z="0"+z;a=a+"."+z}return a}function xc(a,t){if(!a)return"";a:{var z=a.lastIndexOf("/");var y=a.indexOf("?"),x=a.indexOf("#"),e=a.indexOf(".",z+1);z="";if(a.substr(0,5)==="blob:"&&x>0){x=a.substring(x);var d=x.lastIndexOf(".");if(d>0){z=x.substring(d).toLowerCase();break a}}e>0&&(z=y>0?e>y?"":a.substring(e,y).toLowerCase():
a.substring(e).toLowerCase(),y=z.lastIndexOf("."),y>0&&(z=z.substring(y)))}!z&&t&&t.detectedFileExt&&(z=t.detectedFileExt);z||(y=a.indexOf("mime_type="),y>0&&(y+=10,z=a.indexOf("&",y),z<0&&(z=a.length),z={video_mp4:".mp4",video_flv:".flv",video_hls:".m3u8",video_rtc:".rtc",video_dash:".mpd"}[a.substring(y,z)]||""),!z&&(a.indexOf("/whip-play/")>0||a.indexOf("/whep/")>0||a.indexOf("/whep?")>0)&&(z=".rtc"));!z&&t&&typeof t.streamtype==="string"&&(z={httpflv:".flv",hls:".m3u8",dash:".mpd",mpegts:".ts",
webrtc:".rtc"}[t.streamtype]||"");return z}function ab(a){if(a===null||a===void 0)return"";var t=document.createElement("div");t.textContent=String(a);return t.innerHTML.replace(/"/g,"&quot;")}function yc(a){var t=document.documentElement;t.exitFullscreen?t.exitFullscreen():t.mozCancelFullScreen?t.mozCancelFullScreen():t.webkitCancelFullScreen?t.webkitCancelFullScreen():document.exitFullscreen?document.exitFullscreen():document.webkitCancelFullScreen?document.webkitCancelFullScreen():document.msExitFullscreen?
document.msExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.oRequestFullscreen?document.oCancelFullScreen():document.webkitExitFullscreen?document.webkitExitFullscreen():(t=document.body,document.documentElement.style.cssText="",t.style.cssText="",a.style.cssText="",document.IsFullScreen=!1)}function nb(){return document.fullscreenElement||document.msFullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement||!1}function od(a,t){var z=t.getTimeString,
y=t.copyToClipboard;a.doSnapshot=function(){if(this.videoEl&&this.videoEl.videoWidth){if(!this.snapCanvas&&(this.snapCanvas=document.createElement("canvas"),!this.snapCanvas))return;var x=this.videoEl,e=this.snapCanvas;e.width=this.videoEl.videoWidth;e.height=this.videoEl.videoHeight;var d=e.getContext("2d");d.fillStyle="#000000";d.beginPath();d.fillRect(0,0,x.videoWidth,x.videoHeight);d.closePath();d.drawImage(x,0,0,x.videoWidth,x.videoHeight);if(typeof e.toBlob=="function"){var r="SNAP-"+z();try{e.toBlob(function(n){var m=
document.createElement("a");m.download=`${r}.jpg`;var u=URL.createObjectURL(n);m.href=u;m.click();y(n);setTimeout(function(){URL.revokeObjectURL(u)},2E3)},"image/jpeg",.99)}catch(n){}}}}.bind(a)}function pd(a,t){var z=t.zwp_pipWrapper_html;a.togglePictureInPicture=function(){var y=this;if(y.videoEl)if(y._mode==="music"&&y._musicPiP)y._musicPiP.isPipping()?(y._musicPiP.stop(),document.pictureInPictureElement&&document.exitPictureInPicture().catch(function(){})):y._musicPiP.start().catch(function(e){typeof console!==
"undefined"&&console.warn("[Music PiP] start failed:",e)});else if(document.pictureInPictureElement)document.exitPictureInPicture();else{var x=y.videoEl;y.smallWindowMode||(typeof x.requestPictureInPicture!=="function"?typeof x.webkitSetPresentationMode==="function"?x.webkitSetPresentationMode(x.webkitPresentationMode==="picture-in-picture"?"inline":"picture-in-picture"):typeof y.toast==="function"&&(x=typeof t.ll==="function"?t.ll("pipUnsupported","Picture-in-Picture is not supported by this browser"):
"Picture-in-Picture is not supported by this browser",y.toast(x,3E3)):(x.bindPicInPicEvent||(x.addEventListener("enterpictureinpicture",function(e){ka(y.playerElm,"zwp-picInPic");y.overlay_layers.insertAdjacentHTML("beforeEnd",z());(e=y.overlay_layers.querySelector(".zwp-pipExitButton"))&&e.addEventListener("click",function(d){d.stopPropagation();document.pictureInPictureElement&&document.exitPictureInPicture()});y.isInPicInPic=!0}),x.addEventListener("leavepictureinpicture",function(){ja(y.playerElm,
"zwp-picInPic");var e=y.overlay_layers.querySelector(".zwp-pipPlaceHolder");e&&y.overlay_layers.removeChild(e);setTimeout(function(){},500);delete y.isInPicInPic}),x.bindPicInPicEvent=!0),x.requestPictureInPicture()))}}.bind(a)}function qd(a,t){function z(){var J=!(!a.isVrActive||!a.isVrActive());J!==G&&(G=J,B=!0);if(J){if(E&&E.isConnected&&E.width>0)return{element:E,isVR:!0};if((J=a.playerElm?a.playerElm.querySelector(".zwp-vr-canvas"):null)&&J.width>0&&J.height>0)return E=J,{element:J,isVR:!0}}E=
null;return{element:a.videoEl,isVR:!1}}function y(){if(!B&&D)return D;var J=z();if(!J.element)return null;if(J.isVR){J=J.element.getBoundingClientRect();if(!J.width||!J.height)return null;J={left:J.left,top:J.top,right:J.right,bottom:J.bottom,width:J.width,height:J.height}}else{if(!a.videoEl)return null;var T=a.videoEl.videoWidth,b=a.videoEl.videoHeight;if(!T||!b)return null;var S=a._config&&(a._config.video_rotated===90||a._config.video_rotated===270);J=S?b:T;b=S?T:b;T=a.videoEl.getBoundingClientRect();
S=Math.min(T.width/J,T.height/b);J*=S;b*=S;J={left:T.left+(T.width-J)/2,top:T.top+(T.height-b)/2,right:T.left+(T.width+J)/2,bottom:T.top+(T.height+b)/2,width:J,height:b}}D=J;B=!1;return J}function x(){if(f&&c){var J=Math.round(260*(window.devicePixelRatio||1));if(f.width!==J||f.height!==J)f.width=J,f.height=J,f.style.width="260px",f.style.height="260px",c.imageSmoothingEnabled=!0,c.imageSmoothingQuality="high"}}function e(J){var T=z(),b=T.element;if(b&&c&&u){x();var S=y();if(S)if(J.clientX<S.left||
J.clientX>S.right||J.clientY<S.top||J.clientY>S.bottom)u.style.display="none";else{u.style.transform="translate3d("+(J.clientX-130)+"px,"+(J.clientY-130)+"px,0)";u.style.display="block";var H=T.isVR?b.width:a.videoEl.videoWidth;T=T.isVR?b.height:a.videoEl.videoHeight;if(H&&T){var V=260/h/(S.width/H),P=(J.clientX-S.left)/S.width*H-V/2;J=(J.clientY-S.top)/S.height*T-V/2;P<0&&(P=0);J<0&&(J=0);P+V>H&&(P=H-V);J+V>T&&(J=T-V);c.fillStyle="#000";c.fillRect(0,0,f.width,f.height);try{c.drawImage(b,P,J,V,V,
0,0,f.width,f.height)}catch(U){}}}}}function d(){function J(){m&&p?(p&&c&&u&&e(p),k=requestAnimationFrame(J)):l=!1}l||(l=!0,k=requestAnimationFrame(J))}function r(){M||(M=function(T){w=T.clientX;v=T.clientY},document.addEventListener("mousemove",M));u?(u.style.width="260px",u.style.height="260px"):(u=document.createElement("div"),u.className="zwp-zoom-lens",u.style.display="none",u.style.width="260px",u.style.height="260px",(document.fullscreenElement||document.body).appendChild(u),f=document.createElement("canvas"),
c=f.getContext("2d"),u.appendChild(f));x();p=null;C=function(T){m&&(p=T,l||d())};g=function(T){m&&u&&(u.style.display="block",p=T,d())};q=function(){u&&(u.style.display="none");p=null;k&&(cancelAnimationFrame(k),k=null);l=!1};A=function(T){if(m){var b=y();if(b&&!(T.clientX<b.left||T.clientX>b.right||T.clientY<b.top||T.clientY>b.bottom)){T.preventDefault();T.stopPropagation();b=[1.5,2,2.5,3,3.5,4];var S=h,H=b.indexOf(S);H===-1&&(H=b.reduce(function(V,P,U,W){return Math.abs(P-S)<Math.abs(W[V]-S)?U:
V},0));T.deltaY<0?H<b.length-1&&(h=b[H+1]):H>0&&(h=b[H-1]);a.toast(K("zoomLevel","Zoom Level")+": "+h+"x",2E3)}}};var J=a.playerElm;J.addEventListener("mousemove",C);J.addEventListener("mouseenter",g);J.addEventListener("mouseleave",q);J.addEventListener("wheel",A,{passive:!1,capture:!0});N=function(){B=!0};window.addEventListener("resize",N);window.addEventListener("scroll",N,!0);a.videoEl&&a.videoEl.addEventListener("loadedmetadata",N);I=function(){if(u&&m){var T=document.fullscreenElement||document.body;
u.parentNode!==T&&T.appendChild(u);B=!0}};document.addEventListener("fullscreenchange",I);w!=null&&v!=null&&(p=J={clientX:w,clientY:v,target:J,currentTarget:J},e(J),d())}function n(){k&&(cancelAnimationFrame(k),k=null);l=!1;var J=a.playerElm;C&&(J.removeEventListener("mousemove",C),C=null);g&&(J.removeEventListener("mouseenter",g),g=null);q&&(J.removeEventListener("mouseleave",q),q=null);A&&(J.removeEventListener("wheel",A,{capture:!0}),A=null);N&&(window.removeEventListener("resize",N),window.removeEventListener("scroll",
N,!0),a.videoEl&&a.videoEl.removeEventListener("loadedmetadata",N),N=null);I&&(document.removeEventListener("fullscreenchange",I),I=null);u&&(u.style.display="none")}var m=!1,u=null,f=null,c=null,h=2,k=null,l=!1,p=null,w=null,v=null,E=null,D=null,B=!0,G=!1,N=null,I=null,C=null,g=null,q=null,A=null,M=null;a._destroyZoom=function(){try{M&&(document.removeEventListener("mousemove",M),M=null),m&&(m=!1,n()),u&&u.parentNode&&u.parentNode.removeChild(u),c=f=u=null}catch(J){}};a.registerFeature({name:"zoom",
destroy:a._destroyZoom},2);a.isZoomActive=function(){return m};a.closeZoom=function(){if(m){m=!1;n();var J=a.playerElm.querySelector(".zwp-zoomBtn");J&&(ja(J,"zwp-active"),J.setAttribute("title",K("zoom","Zoom")))}};a.toggleZoom=function(){if(a.videoEl){(m=!m)?r():n();var J=a.playerElm.querySelector(".zwp-zoomBtn");J&&(m?(ka(J,"zwp-active"),J.setAttribute("title",K("disableZoom","Disable Zoom"))):(ja(J,"zwp-active"),J.setAttribute("title",K("zoom","Zoom"))))}}}function rd(a,t){var z=t.httpGet,y=t.resolveThumbnailUrl;
a._loadThumbnails=function(){var x=this,e=x._config.thumbnails;e&&(typeof e==="object"?y(x):typeof e!=="string"||e.indexOf("http")!==0&&e.indexOf("/")!==0||z(e,function(d){try{var r=JSON.parse(d);(d=r)&&!Array.isArray(r)&&(r.zwp_protocol&&typeof r.zwp_protocol==="string"&&r.zwp_protocol.indexOf("ZWMAP/")===0&&r.zwp_type==="thumbnail"&&r.thumbnail?d=r.thumbnail:r.thumbnail&&typeof r.thumbnail==="object"&&(d=r.thumbnail));if(d&&d.url){x._config.thumbnails=d;x._config.thumbnails._jsonUrl=e;y(x);var n=
x._config.thumbnails;if(x.progressBar&&x.progressBar.rail){var m=x.progressBar.rail.querySelector(".zwp__time-float");if(m){var u=m.querySelector(".zwp__time-thumbnail");u||(m.insertAdjacentHTML("afterbegin",'<div class="zwp__time-thumbnail"></div>'),u=m.querySelector(".zwp__time-thumbnail"),x.progressBar.thumbnails=u);n.rowsize=typeof n.row==="number"?n.row:Math.ceil(Math.sqrt(n.total));u.style.maxWidth="none";u.style.maxHeight="none";u.style.width=n.width+"px";u.style.height=n.height+"px";u.style.backgroundImage=
"url("+n.url+")";m.style.width=4+n.width+"px";m.style.height=4+n.height+"px";ka(m,"zwp__thumbnail")}}}}catch(f){}},function(){}))}.bind(a)}function sd(a,t){a.castState="disconnected";a._watchdogTimer=null;a._castPreviousPlayState=!1;a._castTimeupdateRef=null;a.getCastState=function(){return this.castState};a._castDebounce=function(z,y){var x;return function(){var e=this,d=arguments;clearTimeout(x);x=setTimeout(function(){z.apply(e,d)},y)}};a._syncRemoteStatus=function(z){var y=this,x=y._castDebounce(function(){if(y.castState===
"connected"&&y.videoEl){var e=y.videoEl.currentTime;y.videoEl.duration;y.updateProgress&&y.updateProgress(e);y.timeSpan&&!isNaN(e)&&y._renderTimeSpan(e)}},300);y._castTimeupdateRef=x;z.addEventListener("timeupdate",x)};a._removeCastOverlay=function(){var z=this.playerContainer?this.playerContainer.querySelector(".zwp-casting-overlay"):null;z&&(z.classList.remove("zwp-cast-visible"),setTimeout(function(){z.parentNode&&z.parentNode.removeChild(z)},300))};a._createCastOverlay=function(){var z=this.playerContainer?
this.playerContainer.querySelector(".zwp-casting-overlay"):null;z&&z.parentNode&&z.parentNode.removeChild(z);z=K("castExternal","External Media Device");z=this.castState==="connecting"?K("casting","Cast - Finding devices..."):K("castTo","Cast - Disconnect")+" : "+z;var y=document.createElement("div");y.className="zwp-casting-overlay";y.innerHTML='<div class="zwp-cast-pulse"><i class="xicon xicon-cast" style="font-size: 56px; color: #4285f4;"></i></div><div class="zwp-cast-title">'+z+'</div><button class="zwpbtn zwp-cast-disconnect-btn">'+
K("castDisconnect","Disconnect")+"</button>";this.playerContainer.appendChild(y);var x=this;requestAnimationFrame(function(){y.classList.add("zwp-cast-visible")});y.querySelector(".zwp-cast-disconnect-btn").addEventListener("click",function(e){e.stopPropagation();x.stopCast()})};a._onCastConnect=function(){clearTimeout(this._watchdogTimer);this.castState="connected";Da(this.playerContainer).find(".zwp-castButton").addClass("casting").removeClass("connecting");this._createCastOverlay();if(typeof this._config.onCastStart===
"function")this._config.onCastStart("remote")};a._onCastDisconnect=function(z){clearTimeout(this._watchdogTimer);var y=this.castState;this.castState="disconnected";Da(this.playerContainer).find(".zwp-castButton").removeClass("casting").removeClass("connecting");this._removeCastOverlay();z?this.toast(K("castError","Cast failed or no devices found"),3E3):y==="connected"&&this.toast(K("castDisconnect","Cast disconnected"),3E3);this._castPreviousPlayState&&y==="connected"&&(this.videoEl&&(this.videoEl.src||
this.videoEl.srcObject)?((z=this.videoEl.play())&&typeof z.catch==="function"&&z.catch(function(){}),this.setplaystate(!0)):this.murl&&this.play(this.murl,this._config.isLive));this._castPreviousPlayState=!1;if(typeof this._config.onCastEnd==="function")this._config.onCastEnd()};a.startCast=function(){var z=this.videoEl;if(z){var y=this;y._castPreviousPlayState=!(!z||z.paused||z.ended);window.__FORCE_CAST_STATE__?(y.castState="connecting",Da(y.playerContainer).find(".zwp-castButton").addClass("connecting"),
y._createCastOverlay(),setTimeout(function(){y._onCastConnect()},2E3)):z.remote&&z.remote.prompt?(z._castBound||(z._castBound=!0,y._onCastConnectRef=function(){y._onCastConnect()},y._onCastDisconnectRef=function(){y._onCastDisconnect()},z.remote.addEventListener("connect",y._onCastConnectRef),z.remote.addEventListener("disconnect",y._onCastDisconnectRef),y._syncRemoteStatus(z)),z.remote.prompt().then(function(){y.castState="connecting";Da(y.playerContainer).find(".zwp-castButton").addClass("connecting");
y._createCastOverlay();y._watchdogTimer=setTimeout(function(){y.castState==="connecting"&&(y.stopCast(),y.toast(K("castError","Cast failed or no devices found"),3E3))},1E4)}).catch(function(x){y._onCastDisconnect(!0)})):z.webkitShowPlaybackTargetPicker?(z._airplayBound||(z._airplayBound=!0,y._onAirPlayChanged=function(x){z.webkitCurrentPlaybackTargetIsWireless?y._onCastConnect():y.castState!=="disconnected"&&y._onCastDisconnect()},z.addEventListener("webkitcurrentplaybacktargetiswirelesschanged",
y._onAirPlayChanged)),z.webkitShowPlaybackTargetPicker(),y.castState="connecting",Da(y.playerContainer).find(".zwp-castButton").addClass("connecting"),y._createCastOverlay(),y._watchdogTimer=setTimeout(function(){y.castState==="connecting"&&(y.stopCast(),y.toast(K("castError","Cast failed or no devices found"),3E3))},1E4)):this.toast(K("castError","Cast failed or no devices found"),3E3)}};a.stopCast=function(){var z=this.videoEl;if(!window.__FORCE_CAST_STATE__&&z&&z.remote&&z.remote.cancel)try{z.remote.cancel()}catch(y){}this._onCastDisconnect()};
a.toggleCast=function(){this.videoEl&&(this.castState==="disconnected"?this.startCast():this.stopCast())}}function td(a,t){function z(c,h){var k=a.controlbar?a.controlbar.querySelector("#segmentLayer"):null;if(k&&(k=k.querySelector("#segmentTooltip"))){var l=k.querySelector(".seg-tip-row.start"),p=k.querySelector(".seg-tip-row.end");l&&p||(k.innerHTML='<div class="seg-tip-row start"><span class="seg-tip-label"></span><span class="seg-tip-time"></span></div><div class="seg-tip-row end"><span class="seg-tip-label"></span><span class="seg-tip-time"></span></div>',
l=k.querySelector(".seg-tip-row.start"),p=k.querySelector(".seg-tip-row.end"),l.querySelector(".seg-tip-label").textContent=m("segmentStart","\u8d77\u70b9")+" ",p.querySelector(".seg-tip-label").textContent=m("segmentEnd","\u7ec8\u70b9")+" ");l.querySelector(".seg-tip-time").textContent=n(a.segment.startTime);p.querySelector(".seg-tip-time").textContent=n(a.segment.endTime);l.classList.toggle("active",c==="start");p.classList.toggle("active",c==="end");k.classList.remove("start-handle","end-handle");
k.classList.add(c==="start"?"start-handle":"end-handle");k.style.left=typeof h==="number"?h+"px":(c==="start"?a.segment.startTime:a.segment.endTime)/(a.videoEl.duration||1)*100+"%";k.style.transform="translateX(-50%) translateY(-100%)";k.style.display="block"}}function y(){if(a.subtitleLoopCtrl&&!a.subtitleLoopCtrl.isEmpty()&&typeof a.subtitleLoopCtrl.getCues==="function"){var c=a.subtitleLoopCtrl.getCues();c.length&&(a.segment.loopOriginFrom===void 0&&(a.segment.loopOriginFrom=c[0].from),c[0].from=
a.segment.startTime,c[c.length-1].to=a.segment.endTime,a.subtitleLoopQueue={cues:a.subtitleLoopCtrl.getCues(),position:a.subtitleLoopCtrl.getPosition()})}}function x(){a.startHideControlbar&&a.startHideControlbar(a)}function e(c){if(typeof c.refreshSubtitleSearch==="function")if(c.subtitleSearchPanel)c.refreshSubtitleSearch();else{var h=c.overlay_layers?c.overlay_layers.querySelector(":scope > .zwp-subtitleSearchPanel"):null;h&&h.style.display!=="none"&&c.refreshSubtitleSearch()}}function d(c){if(c==
null)return"";c=String(c);c=c.replace(/<br\s*\/?>/gi," ");c=c.replace(/[\r\n]+/g," ");c=c.replace(/<[^>]*>/g,"");c=c.replace(/&nbsp;/gi," ");return c=c.replace(/\s+/g," ").trim()}function r(c,h){for(var k=d(h.content),l=0;l<c.length;l++)if(c[l].from===h.from&&d(c[l].content)===k)return l;for(l=0;l<c.length;l++)if(d(c[l].content)===k)return l;return-1}var n=t.formatPreciseTime,m=t.ll||function(c,h){return h},u=null,f=!1;a.toggleSegment=function(){if(this.videoEl&&this.videoEl.duration){this.segment.isActive=
!this.segment.isActive;var c=this.controlbar?this.controlbar.querySelector("#segmentLayer"):null,h=this.controlbar?this.controlbar.querySelector(".zwp-segmentBtn"):null;if(this.segment.isActive){if(c&&(c.classList.add("active"),(c=c.closest(".zwp__time-rail"))&&c.classList.add("segment-active")),h&&h.closest(".zwp-segmentButton").classList.add("active"),h=this.videoEl.duration||100,c=this.videoEl.currentTime||0,this.segment.startTime=c,this.segment.endTime=Math.min(c+h*.1,h),this.updateSegmentUI(),
this.setupSegmentHandlers(),this.videoEl.currentTime<this.segment.startTime||this.videoEl.currentTime>this.segment.endTime)this.videoEl.currentTime=this.segment.startTime}else{c&&(c.classList.remove("active"),(c=c.closest(".zwp__time-rail"))&&c.classList.remove("segment-active"));h&&h.closest(".zwp-segmentButton").classList.remove("active");this.removeSegmentHandlers();if(a.subtitleLoopCtrl&&!a.subtitleLoopCtrl.isEmpty()&&(a.subtitleLoopCtrl.clear(),a.subtitleLoopQueue={cues:[],position:null},a.currentChapterLoop=
null,h=document.querySelector(".zwp-subtitleSearchPanel"))){c=h.querySelectorAll(".zwp-sub-loop-btn.active");for(var k=0;k<c.length;k++)c[k].classList.remove("active");c=h.querySelectorAll(".zwp-sub-in-range");for(k=0;k<c.length;k++)c[k].classList.remove("zwp-sub-in-range");h=h.querySelectorAll(".zwp-sub-range-tag");for(c=0;c<h.length;c++)h[c].remove()}this.segment.subtitleSourceSnapshot=null;this.segment.loopOriginFrom=void 0}}};a.updateSegmentUI=function(){if(this.videoEl&&this.videoEl.duration){var c=
this.controlbar?this.controlbar.querySelector("#segmentLayer"):null;if(c){var h=c.querySelector("#segmentHandleStart"),k=c.querySelector("#segmentHandleEnd");c=c.querySelector("#segmentSelection");if(h&&k&&c){var l=this.segment.startTime/this.videoEl.duration*100,p=this.segment.endTime/this.videoEl.duration*100;h.style.left=l+"%";k.style.left=p+"%";c.style.left=l+"%";c.style.width=p-l+"%"}}}};a.setupSegmentHandlers=function(){var c=this;if(!c.segmentHandlersSetup){var h=c.controlbar?c.controlbar.querySelector("#segmentLayer"):
null;if(h){var k=h.querySelector("#segmentHandleStart"),l=h.querySelector("#segmentHandleEnd"),p=c.controlbar?c.controlbar.querySelector(".zwp__time-rail"):null;if(k&&l&&p){var w=function(B){return function(G){G.preventDefault();c.segment.isDragging=!0;c.segment.dragTarget=B;x();z(B);document.addEventListener("mousemove",v);document.addEventListener("mouseup",E);document.addEventListener("touchmove",v,{passive:!1});document.addEventListener("touchend",E)}},v=function(B){if(c.segment.isDragging&&c.videoEl&&
c.videoEl.duration){x();var G=p.getBoundingClientRect();B=(B.clientX||(B.touches?B.touches[0].clientX:0))-G.left;B<0&&(B=0);B>G.width&&(B=G.width);G=B/G.width*c.videoEl.duration;c.segment.dragTarget==="start"?(G>c.segment.endTime-1&&(G=c.segment.endTime-1),c.segment.startTime=G,c.videoEl.currentTime=G,z("start",B)):(G<c.segment.startTime+1&&(G=c.segment.startTime+1),c.segment.endTime=G,c.videoEl.currentTime=G,z("end",B));c.updateSegmentUI()}},E=function(){c.segment.isDragging=!1;c.segment.dragTarget=
null;y();var B=h.querySelector("#segmentTooltip");B&&(B.style.display="none",B.classList.remove("start-handle","end-handle"));f=!1;c.videoEl.currentTime=c.segment.startTime;document.removeEventListener("mousemove",v);document.removeEventListener("mouseup",E);document.removeEventListener("touchmove",v);document.removeEventListener("touchend",E)};k.addEventListener("mousedown",w("start"));k.addEventListener("touchstart",w("start"),{passive:!1});l.addEventListener("mousedown",w("end"));l.addEventListener("touchstart",
w("end"),{passive:!1});k.addEventListener("focus",function(){c.segment.focusedHandle="start";k.classList.add("focused");l.classList.remove("focused")});k.addEventListener("blur",function(){c.segment.focusedHandle==="start"&&(c.segment.focusedHandle=null);k.classList.remove("focused")});l.addEventListener("focus",function(){c.segment.focusedHandle="end";l.classList.add("focused");k.classList.remove("focused")});l.addEventListener("blur",function(){c.segment.focusedHandle==="end"&&(c.segment.focusedHandle=
null);l.classList.remove("focused")});var D=function(B){c.segment.isDragging||u||(z(B),x(),f=!0)};w=function(){if(!c.segment.isDragging&&f){f=!1;var B=h.querySelector("#segmentTooltip");B&&(B.style.display="none",B.classList.remove("start-handle","end-handle"))}};k.addEventListener("mouseenter",function(){D("start")});k.addEventListener("mouseleave",w);l.addEventListener("mouseenter",function(){D("end")});l.addEventListener("mouseleave",w);c.segmentHandlersSetup=!0}}}};a.removeSegmentHandlers=function(){this.segmentHandlersSetup=
!1;u&&(clearTimeout(u),u=null)};a.showSegmentNudgeTooltip=function(c,h){f=!1;z(c);x();var k=(c=a.controlbar?a.controlbar.querySelector("#segmentLayer"):null)?c.querySelector("#segmentTooltip"):null;k&&(u&&clearTimeout(u),u=setTimeout(function(){k.style.display="none";k.classList.remove("start-handle","end-handle");u=null},1200))};a.nudgeSegmentBoundary=function(c,h){if(!(a.segment&&a.segment.isActive&&a.videoEl&&a.videoEl.duration)||c!=="start"&&c!=="end")return!1;var k=a.videoEl.duration,l=c==="start"?
a.segment.startTime:a.segment.endTime;h=l+1/30*h;if(c==="start")k=Math.max(0,a.segment.endTime-1),h<0&&(h=0),h>k&&(h=k);else{var p=Math.min(k,a.segment.startTime+1);h<p&&(h=p);h>k&&(h=k)}if(h===l)return!1;c==="start"?a.segment.startTime=h:a.segment.endTime=h;try{a.videoEl.currentTime=h}catch(w){}a.updateSegmentUI();y();a.showSegmentNudgeTooltip(c,h);return!0};a.focusSegmentHandle=function(c){if(a.segment&&a.segment.isActive){var h=a.controlbar?a.controlbar.querySelector("#segmentLayer"):null;h&&(c=
h.querySelector(c==="start"?"#segmentHandleStart":"#segmentHandleEnd"))&&c.focus()}};a.isSegmentInteracting=function(){return a.segment&&a.segment.isActive?a.segment.isDragging||u?!0:!1:!1};a.commitSegmentToSubtitle=function(){if(!a.segment||!a.segment.isActive)return a.toast&&a.toast(m("commitSubtitleNoSource","No subtitle loop to update (set a subtitle loop first)"),2E3),!1;var c=a.subtitleLoopCtrl&&typeof a.subtitleLoopCtrl.getCues==="function"&&!a.subtitleLoopCtrl.isEmpty()?a.subtitleLoopCtrl.getCues():
null,h=a.segment.subtitleSourceSnapshot,k=null;c&&c.length?k={position:a.subtitleLoopCtrl.getPosition(),startCue:{from:c[0].from,to:c[0].to,content:c[0].content},endCue:c.length>1?{from:c[c.length-1].from,to:c[c.length-1].to,content:c[c.length-1].content}:null}:h&&(k=h);if(!k)return a.toast&&a.toast(m("commitSubtitleNoSource","No subtitle loop to update (set a subtitle loop first)"),2E3),!1;c=k.position;h=a.subtitles&&a.subtitles[c];if(!h||!h.body||!h.body.length)return a.toast&&a.toast(m("commitSubtitleNotFound",
"Original subtitle not found (track may have changed)"),2E3),a.segment.subtitleSourceSnapshot=null,!1;var l=h.body,p=a.segment.startTime,w=a.segment.endTime,v=r(l,k.startCue);k=k.endCue?r(l,k.endCue):v;if(v===-1||k===-1)return a.toast&&a.toast(m("commitSubtitleNotFound","Original subtitle not found (track may have changed)"),2E3),a.segment.subtitleSourceSnapshot=null,!1;if(v>k){var E=v;v=k;k=E}for(E=v-1;E>=0;E--)if(l[E].to>p)l[E].to=p,l[E].from>p&&(l[E].from=p);else break;for(E=k+1;E<l.length;E++)if(l[E].from<
w)l[E].from=w,l[E].to<w&&(l[E].to=w);else break;l[v].from=p;l[k].to=w;l.sort(function(D,B){return(D.from||0)-(B.from||0)});h.current=null;h.nextSubtitleIdx=0;a.segment.subtitleSourceSnapshot=null;typeof a.syncSubtitleCache==="function"&&a.syncSubtitleCache(c);e(a);a.toast&&a.toast(m("commitSubtitleSuccess","Subtitle timing updated (download to save)"),2E3);return!0};a.shiftAllSubtitles=function(){if(!a.segment||!a.segment.isActive||a.segment.loopOriginFrom===void 0)return a.toast&&a.toast(m("shiftSubtitleNoLoop",
"Set a subtitle loop and nudge start first"),2E3),!1;var c=a.subtitleLoopCtrl&&typeof a.subtitleLoopCtrl.getPosition==="function"?a.subtitleLoopCtrl.getPosition():"1",h=a.subtitles&&a.subtitles[c];if(!h||!h.body||!h.body.length)return a.toast&&a.toast(m("commitSubtitleNotFound","Original subtitle not found (track may have changed)"),2E3),!1;var k=a.segment.startTime-a.segment.loopOriginFrom;if(Math.abs(k)<.001)return a.toast&&a.toast(m("shiftSubtitleZero","No offset (nudge start to set offset)"),
2E3),!1;for(var l=h.body,p=0;p<l.length;p++)l[p].from+=k,l[p].to+=k,l[p].from<0&&(l[p].from=0),l[p].to<0&&(l[p].to=0);l.sort(function(w,v){return(w.from||0)-(v.from||0)});h.current=null;h.nextSubtitleIdx=0;a.segment.endTime+=k;a.segment.startTime<0&&(a.segment.startTime=0);a.segment.endTime>a.videoEl.duration&&(a.segment.endTime=a.videoEl.duration);a.updateSegmentUI&&a.updateSegmentUI();a.segment.loopOriginFrom=a.segment.startTime;y();typeof a.syncSubtitleCache==="function"&&a.syncSubtitleCache(c);
e(a);c=(k>=0?"+":"")+k.toFixed(3)+"s";a.toast&&a.toast(m("shiftSubtitleSuccess","All subtitles shifted").replace("{0}",c),2E3);return!0}}function ud(a,t){function z(l){l=l.recording;if(l.capturedStream){try{l.capturedStream.getTracks().forEach(function(p){p.stop()})}catch(p){}l.capturedStream=null}if(l.fallbackAudioContext){try{l.fallbackAudioContext.state!=="closed"&&l.fallbackAudioContext.close()}catch(p){}l.fallbackAudioContext=null}if(l.hiddenAudio){try{l.hiddenAudio.pause(),l.hiddenAudio.removeAttribute("src"),
l.hiddenAudio.parentNode&&l.hiddenAudio.parentNode.removeChild(l.hiddenAudio)}catch(p){}l.hiddenAudio=null}}function y(l,p,w){var v=l.recording,E=l._config&&l._config.isLive;v.isLive=E;if(!v.isRecording){v.isRecording=!0;v.startTime=Date.now();v.recordedChunks=[];v.duration=0;v.recordType=w;v.finalized=!1;if(p){var D=p.closest?p.closest(".zwp-recordButton"):null;D&&(ja(D,"is-active"),ka(D,"is-recording"))}if(!v.indicator){D=document.createElement("div");D.className="zwp-live-recording-indicator";
D.title=k("recordingInProgress","Recording in progress");if(p){var B=p.closest(".zwp-recordButton");B?(B.style.position=B.style.position||"relative",B.appendChild(D)):(p.style.position=p.style.position||"relative",p.appendChild(D))}v.indicator=D}v.indicator&&(v.indicator.className="zwp-live-recording-indicator recording "+(w==="audio"?"audio-recording":""));p&&(p.title=w==="audio"?k("stopRecordAudio","Stop Audio Recording"):k("stopRecordVideo","Stop Video Recording"));E?(v=0,D=Infinity):(l.videoEl.src,
l.segment&&l.segment.isActive?(l.videoEl.currentTime=l.segment.startTime,l._startPlayback&&l._startPlayback(!0),v=l.segment.startTime,D=l.segment.endTime):(v=l.videoEl.currentTime,D=l.videoEl.duration||Infinity));x(l,p,w,v,D,E)}}function x(l,p,w,v,E,D){var B=l.recording;B.isLive=D;try{var G=f(l);if(w==="audio"){var N=G.getAudioTracks();if(N.length===0)throw Error("\u6ca1\u6709\u627e\u5230\u97f3\u9891\u8f68\u9053\uff0c\u65e0\u6cd5\u8fdb\u884c\u97f3\u9891\u5f55\u5236");N.forEach(function(g){g.enabled=
!0});G=new MediaStream(N)}B.format=n(w);var I={mimeType:B.format.mimeType};w==="video"?(I.videoBitsPerSecond=25E5,G.getAudioTracks().length>0&&(I.audioBitsPerSecond=192E3)):I.audioBitsPerSecond=128E3;B.mediaRecorder=new MediaRecorder(G,I);B.capturedStream=G;B.mediaRecorder.ondataavailable=function(g){g.data.size>0&&B.recordedChunks.push(g.data)};B.mediaRecorder.onstop=function(){e(l,D);z(l)};B.mediaRecorder.onstart=function(){};B.mediaRecorder.onerror=function(g){B.isRecording=!1;B.indicator&&(B.indicator.className=
"zwp-live-recording-indicator");p&&(p.title=k("record","Record"))};B.mediaRecorder.start(w==="audio"?100:200);h(l,p);if((D||E===Infinity)&&!D&&E===Infinity){var C=function(){B.isRecording&&d(l,p);l.videoEl.removeEventListener("ended",C)};l.videoEl.addEventListener("ended",C)}}catch(g){B.isRecording=!1,B.indicator&&(B.indicator.className="zwp-live-recording-indicator"),p&&(p.title=k("record","Record"))}}function e(l,p){l=l.recording;l.isLive?"\u76f4\u64ad":"\u70b9\u64ad";p!==l.isLive&&(l.isLive=p);
if(l.recordedChunks.length!==0){var w=new Blob(l.recordedChunks,{type:l.format.mimeType});l.format.isMP4?"MP4":"WebM";p=p?"live_recording":"vod_recording";var v=new Date;v=v.getFullYear()+String(v.getMonth()+1).padStart(2,"0")+String(v.getDate()).padStart(2,"0")+"_"+String(v.getHours()).padStart(2,"0")+String(v.getMinutes()).padStart(2,"0")+String(v.getSeconds()).padStart(2,"0");p=p+"_"+v+l.format.fileExtension;var E=URL.createObjectURL(w);w=document.createElement("a");w.href=E;w.download=p;w.style.display=
"none";document.body.appendChild(w);w.click();document.body.removeChild(w);setTimeout(function(){URL.revokeObjectURL(E)},2E3);l.recordedChunks=[];l.isRecording=!1;l.finalized=!0;l.duration=0;l.startTime=0;l.recordType=null}}function d(l,p){var w=l.recording;if(w.isRecording||w.mediaRecorder){w.timer&&(clearInterval(w.timer),w.timer=null);w.streamCheckInterval&&(clearInterval(w.streamCheckInterval),w.streamCheckInterval=null);var v=l._config&&l._config.isLive;!v&&w.isRecording&&l.segment&&l.segment.isActive&&
l._pausePlayback&&l._pausePlayback();if(w.mediaRecorder&&w.mediaRecorder.state!=="inactive")try{w.mediaRecorder.stop()}catch(E){}w.indicator&&(w.indicator.className="zwp-live-recording-indicator");p&&(p.title=k("record","Record"),(l=p.closest?p.closest(".zwp-recordButton"):null)&&ja(l,"is-recording"));w.isRecording=!1}}function r(l,p){try{if(l.videoEl)if(l.streamContentCache)p({hasVideo:l.streamContentCache.hasVideo,hasAudio:l.streamContentCache.hasAudio});else{var w=l.videoEl,v={hasVideo:!1,hasAudio:!1};
if(w.captureStream||w.mozCaptureStream)try{var E=(w.captureStream||w.mozCaptureStream).call(w),D=E.getVideoTracks();v.hasVideo=D.length>0;var B=E.getAudioTracks();v.hasAudio=B.length>0;l.streamContentCache={hasVideo:v.hasVideo,hasAudio:v.hasAudio};p(v);return}catch(G){}w.videoWidth>0&&w.videoHeight>0&&(v.hasVideo=!0);if(w.webkitAudioDecodedByteCount>0||w.getAudioTracks&&w.getAudioTracks().length>0)v.hasAudio=!0;v.hasVideo||v.hasAudio||(v.hasVideo=!0,v.hasAudio=!0);l.streamContentCache={hasVideo:v.hasVideo,
hasAudio:v.hasAudio};p(v)}else p({hasVideo:!1,hasAudio:!1})}catch(G){w={hasVideo:!0,hasAudio:!0},l.streamContentCache=w,p(w)}}function n(l){if((l||"video")==="audio"){l="audio/mp4;codecs=mp4a.40.2 audio/mp4 audio/webm;codecs=opus audio/webm;codecs=vorbis audio/webm audio/ogg;codecs=opus audio/ogg;codecs=vorbis".split(" ");for(var p=0;p<l.length;p++)if(MediaRecorder.isTypeSupported(l[p])){var w=l[p].includes("mp4");return{mimeType:l[p],isMP4:w,fileExtension:w?".m4a":".webm"}}return{mimeType:"audio/webm",
isMP4:!1,fileExtension:".webm"}}l="video/mp4;codecs=avc1.42E01E,mp4a.40.2 video/mp4;codecs=avc1.42E01E video/mp4;codecs=h264 video/webm;codecs=vp8,opus video/webm;codecs=vp8,vorbis video/webm;codecs=vp9 video/webm;codecs=vp8 video/webm".split(" ");for(p=0;p<l.length;p++)if(MediaRecorder.isTypeSupported(l[p]))return{mimeType:l[p],isMP4:l[p].includes("mp4"),fileExtension:l[p].includes("mp4")?".mp4":".webm"};return{mimeType:"video/webm",isMP4:!1,fileExtension:".webm"}}function m(l){var p=l.videoEl;if(p.captureStream||
p.mozCaptureStream)try{var w=(p.captureStream||p.mozCaptureStream).call(p).getAudioTracks();if(w.length>0)return new MediaStream(w)}catch(v){}return u(l)}function u(l){var p=l.videoEl;if(p.captureStream)try{var w=p.captureStream(),v=w.getAudioTracks();if(v.length>0){var E=new MediaStream(v);return E}}catch(I){}if(p.mozCaptureStream)try{if(w=p.mozCaptureStream(),v=w.getAudioTracks(),v.length>0)return E=new MediaStream(v)}catch(I){}try{var D=new (window.AudioContext||window.webkitAudioContext),B=document.createElement("audio");
B.src=p.src;p.crossOrigin&&(B.crossOrigin=p.crossOrigin);B.muted=!1;B.volume=1;var G=D.createMediaStreamDestination(),N=D.createMediaElementSource(B);N.connect(G);N.connect(D.destination);w=G.stream;B.muted=!0;B.play().catch(function(I){});l.recording.fallbackAudioContext=D;l.recording.hiddenAudio=B;return w}catch(I){if(l.recording.fallbackAudioContext){try{l.recording.fallbackAudioContext.close()}catch(C){}l.recording.fallbackAudioContext=null}if(l.recording.hiddenAudio){try{l.recording.hiddenAudio.pause(),
l.recording.hiddenAudio.removeAttribute("src")}catch(C){}l.recording.hiddenAudio=null}}return new MediaStream}function f(l){var p=l.videoEl;if(p.captureStream||p.mozCaptureStream)try{var w=(p.captureStream||p.mozCaptureStream).call(p),v=w.getVideoTracks(),E=w.getAudioTracks();if(v.length>0){if(E.length>0)return w;var D=m(l).getAudioTracks();D.length>0&&D.forEach(function(B){w.addTrack(B)});return w}}catch(B){}return c(l)}function c(l){function p(){if(l.recording&&l.recording.isRecording){try{if(w&&
w.videoWidth>0&&w.videoHeight>0){var C=w.currentTime;Math.abs(C-N)>.016&&(E.drawImage(w,0,0,v.width,v.height),N=C,I++)}else E.fillStyle="black",E.fillRect(0,0,v.width,v.height)}catch(g){}requestAnimationFrame(p)}}var w=l.videoEl,v=document.createElement("canvas"),E=v.getContext("2d");v.width=w?w.videoWidth||1280:1280;v.height=w?w.videoHeight||720:720;var D=v.captureStream(60),B=u(l),G=new MediaStream;D.getVideoTracks().forEach(function(C){G.addTrack(C)});B.getAudioTracks().forEach(function(C){G.addTrack(C)});
var N=0,I=0;p();return G}function h(l,p){var w=l.recording;w.isLive;w.timer=setInterval(function(){w.duration=Math.floor((Date.now()-w.startTime)/1E3);if(w.duration>=w.maxDuration)d(l,p);else{var v=w.duration;var E=Math.floor(v/3600);var D=Math.floor(v%3600/60);v%=60;E=E>0?E+":"+String(D).padStart(2,"0")+":"+String(v).padStart(2,"0"):D+":"+String(v).padStart(2,"0");p&&(p.title=k("stopRecordingWithDuration","Stop recording ({duration})").replace("{duration}",E))}},1E3)}var k=t.ll||function(l,p){return p};
a.recordingSettings={mode:"ask"};a.recording={isRecording:!1,startTime:null,mediaRecorder:null,recordedChunks:[],timer:null,duration:0,maxDuration:14400,format:null,indicator:null,isLive:!1,capturedStream:null,fallbackAudioContext:null,hiddenAudio:null};a.streamContentCache=null;a.recordVideo=function(l){var p=this;if(p.videoEl&&(p.videoEl.src||p.videoEl.srcObject)){p._config&&p._config.isLive;var w=p.recording,v=null;v=p.container?p.container.querySelector(".zwp-recordBtn"):p.element?p.element.querySelector(".zwp-recordBtn"):
p.playerElm?p.playerElm.querySelector(".zwp-recordBtn"):document.querySelector(".zwp-recordBtn");w.isRecording?d(p,v):l==="video"?y(p,v,"video"):l==="audio"?y(p,v,"audio"):p.makeRecordingDecision(v,function(E,D){switch(E){case "show_options":if(E=v?v.closest(".zwp-recordButton"):null)p.closeAllMenus&&p.closeAllMenus(),ka(E,"is-active");break;case "record_video":y(p,v,"video");break;case "record_audio":y(p,v,"audio")}})}}.bind(a);a.updateRecordingMenuVisibility=function(){var l=this.recordingSettings?
this.recordingSettings.mode:"ask",p=this.controlbar?this.controlbar.querySelector(".zwp-recordOptionsMenu"):null;p&&(p.style.display=l==="ask"?"":"none")};a.makeRecordingDecision=function(l,p){var w=this.recordingSettings?this.recordingSettings.mode:"ask";r(this,function(v){w==="ask"?v.hasVideo&&v.hasAudio?p("show_options",v):v.hasAudio?p("record_audio",v):p("record_video",v):w==="audio"&&v.hasAudio?p("record_audio",v):w==="video"&&v.hasAudio&&!v.hasVideo?p("record_audio",v):p("record_video",v)})};
a.stopRecording=function(){var l=null;a.container?l=a.container.querySelector(".zwp-recordBtn"):a.element?l=a.element.querySelector(".zwp-recordBtn"):a.playerElm&&(l=a.playerElm.querySelector(".zwp-recordBtn"));d(a,l)};a._destroyRecording=function(){try{a.recording&&(a.recording.isRecording||a.recording.mediaRecorder)&&d(a,null)}catch(l){}z(a);a.recording&&(a.recording.timer&&(clearInterval(a.recording.timer),a.recording.timer=null),a.recording.streamCheckInterval&&(clearInterval(a.recording.streamCheckInterval),
a.recording.streamCheckInterval=null))};a.registerFeature({name:"recording",destroy:a._destroyRecording},1)}function Ub(a,t){t=t&&t.debug_log;if(a.audioContext&&a.audioSource&&a.audioGainNode)return{ctx:a.audioContext,source:a.audioSource,volumeNode:a.audioVolumeNode||null,gainNode:a.audioGainNode,analyser:zc(a)};if(typeof a.isMobile==="function"&&a.isMobile())return null;try{var z=window.AudioContext||window.webkitAudioContext;if(!z||!a.videoEl)return null;var y=new z,x=y.createMediaElementSource(a.videoEl),
e=y.createGain(),d=y.createGain();e.gain.value=a.lastVolume!==void 0?a.lastVolume:a.videoEl.volume!=null?a.videoEl.volume:1;d.gain.value=1;x.connect(e);e.connect(d);d.connect(y.destination);a.audioContext=y;a.audioSource=x;a.audioVolumeNode=e;a.audioGainNode=d;t&&console.log("[AudioGraph] Web Audio \u56fe\u8c31\u5df2\u5efa\u7acb\uff08source\u2192volume\u2192gain\u2192destination\uff09");return{ctx:y,source:x,volumeNode:e,gainNode:d,analyser:zc(a)}}catch(r){return t&&console.warn("[AudioGraph] \u5efa\u56fe\u5931\u8d25:",
r),null}}function zc(a){if(a._audioAnalyserTap)return a._audioAnalyserTap;var t=a.audioGainNode;if(!t||typeof t.context.createAnalyser!=="function")return null;try{var z=t.context.createAnalyser();z.fftSize=256;z.smoothingTimeConstant=.75;t.connect(z);return a._audioAnalyserTap=z}catch(y){return null}}function vd(a,t){var z=t.debug_log,y=t.fadeOut,x=t.triggerEvent,e=t.detectMobile,d=t.getControlId,r=function(m){var u=m.parentNode;if(u&&(u=u.querySelector(".zwp-slider-value"))){var f=m.getAttribute("data-action");
m=m.value;f==="volumeBoost"?(m=parseFloat(m),m=(m>=0?"+":"")+m.toFixed(1)+"dB",u.innerHTML=m):u.innerHTML=m}},n=function(m,u,f,c,h,k){m=d("zwp_slider-");f=f!==void 0?f:-100;c=c!==void 0?c:100;var l=f<0&&c>0?0:f,p="";k&&(p+='<span class="zwp-slider-min-label">'+f+"dB</span>");p+='<input type="range" id="'+m+'" name="slider'+m+'" data-action="'+u+'" class="zwp-slider" value="'+l+'" min="'+f+'" max="'+c+'" step="'+(h!==void 0?h:1)+'"/><span class="zwp-slider-value">'+(u==="volumeBoost"?"+0.0dB":l)+"</span>";
k&&(p+='<span class="zwp-slider-max-label">'+c+"dB</span>");return p};a.isMobile=function(){return typeof this._isMobile!=="undefined"?this._isMobile:this._isMobile=e()}.bind(a);a.removeVolumeBoostButton=function(){if(this.controlbar){var m=this.controlbar.querySelector('button[data-action="showVolumeBoostConfig"]');m&&(m=m.closest(".zwp-option-item"))&&m.remove()}}.bind(a);a.initAudioContext=function(){this.videoEl&&!this.audioContext&&Ub(this,{debug_log:z})};a.on_volumeBoostSliderChange=function(m){var u=
m.currentTarget;m=u.getAttribute("data-action");this.volumeBoostConfig||(this.volumeBoostConfig={volumeBoost:0});r(u);typeof this.volumeBoostConfig[m]!=="undefined"&&(u=parseFloat(u.value),this.volumeBoostConfig[m]=u,this.audioContext||this.initAudioContext(),this.audioGainNode&&this.audioGainNode.gain.setTargetAtTime(Math.pow(10,u/20),this.audioContext.currentTime,.03))}.bind(a);a.on_colorSliderChange=function(m){var u=m.currentTarget;m=u.getAttribute("data-action");this.colors||(this.colors={brightness:0,
contrast:0,saturation:0,hue:0});r(u);if(typeof this.colors[m]!=="undefined"&&(u=parseInt(u.value),m==="hue"?this.colors.hue=parseInt(u*180/100):this.colors[m]=u,this.videoEl)){m=null;u=this.colors;u.brightness&&(m="brightness("+(100+u.brightness)+"%)");if(u.contrast){var f=100+u.contrast;m=(m?m+" ":"")+("contrast("+f+"%)")}u.saturation&&(f=100+u.saturation,m=(m?m+" ":"")+("saturate("+f+"%)"));u.hue&&(u=u.hue,m=(m?m+" ":"")+("hue-rotate("+u+"deg)"));this.videoEl.style.filter=m}}.bind(a);a.createVolumeBoostPanel=
function(){var m=this,u='<div class="zwp-volumeBoostPanel zwp-popupwindow"><button class="closeBtn"><i class="xicon xicon-close"></i></button><div class="form-row form-title">'+K("audioEffectAdjustment","Audio Effects")+'</div><div class="form-row"><label class="row-label">'+K("volumeBoost","Volume Boost")+'</label><div class="row-content">'+n("","volumeBoost",-12,12,.1,!0)+'</div></div><div class="form-row form-bottombar"><button class="zwp-form-button action-item" data-action="resetVolumeBoost">'+
K("reset","Reset")+"</button></div></div>";m.overlay_layers.insertAdjacentHTML("beforeend",u);u=m.overlay_layers.querySelector(":scope > .zwp-volumeBoostPanel");var f=u.querySelector(".closeBtn");f&&f.addEventListener("click",function(c){c.stopPropagation();var h=c.currentTarget.closest(".zwp-volumeBoostPanel");y(h,500,function(){h.remove()});delete m.volumeBoostPanel;m._lastClosedParentMenu&&(m._lastClosedParentMenu.style.display="",delete m._lastClosedParentMenu)});f=u.querySelectorAll('input[type="range"]');
f.length>0&&f.forEach(function(c){c.addEventListener("input",a.on_volumeBoostSliderChange);if(m.volumeBoostConfig){var h=c.getAttribute("data-action");typeof m.volumeBoostConfig[h]!=="undefined"&&(c.value=m.volumeBoostConfig[h],r(c))}});u.addEventListener("mousedown",function(c){c.stopPropagation()});u.addEventListener("dblclick",function(c){c.stopPropagation()});u.addEventListener("click",function(c){c.stopPropagation()});(f=u.querySelector(".zwp-form-button"))&&f.addEventListener("click",function(c){c.preventDefault();
c.stopPropagation();c=c.currentTarget.closest(".zwp-volumeBoostPanel").querySelectorAll('input[type="range"]');c.length>0&&c.forEach(function(h){parseFloat(h.value)!==0&&(h.value=0,x(h,"input"))});m.audioGainNode&&(m.audioGainNode.gain.value=1)});return m.volumeBoostPanel=u}.bind(a);a.createColorSettingPanel=function(){var m=this,u='<div class="zwp-colorSettingPanel zwp-popupwindow"><button class="closeBtn"><i class="xicon xicon-close"></i></button><div class="form-row form-title">'+K("videoColorAdjustment",
"Video Color Adjustment")+'</div><div class="form-row"><label class="row-label">'+K("brightness","Brightness")+'</label><div class="row-content">'+n("","brightness")+'</div></div><div class="form-row"><label class="row-label">'+K("contrast","Contrast")+'</label><div class="row-content">'+n("","contrast")+'</div></div><div class="form-row"><label class="row-label">'+K("saturation","Saturation")+'</label><div class="row-content">'+n("","saturation")+'</div></div><div class="form-row"><label class="row-label">'+
K("hue","Hue")+'</label><div class="row-content">'+n("","hue")+'</div></div><div class="form-row form-bottombar"><button class="zwp-form-button action-item" data-action="resetcolors">'+K("reset","Reset")+"</button></div></div>";m.overlay_layers.insertAdjacentHTML("beforeend",u);u=m.overlay_layers.querySelector(":scope > .zwp-colorSettingPanel");var f=u.querySelector(".closeBtn");f&&f.addEventListener("click",function(c){c.stopPropagation();var h=c.currentTarget.closest(".zwp-colorSettingPanel");y(h,
500,function(){h.remove()});delete m.colorSettingPanel;m._lastClosedParentMenu&&(m._lastClosedParentMenu.style.display="",delete m._lastClosedParentMenu)});f=u.querySelectorAll('input[type="range"]');f.length>0&&f.forEach(function(c){c.addEventListener("input",a.on_colorSliderChange);if(m.colors){var h=c.getAttribute("data-action");typeof m.colors[h]!=="undefined"&&(c.value=m.colors[h],r(c))}});u.addEventListener("mousedown",function(c){c.stopPropagation()});u.addEventListener("dblclick",function(c){c.stopPropagation()});
u.addEventListener("click",function(c){c.stopPropagation()});(f=u.querySelector(".zwp-form-button"))&&f.addEventListener("click",function(c){c.preventDefault();c.stopPropagation();c=c.currentTarget.closest(".zwp-colorSettingPanel").querySelectorAll('input[type="range"]');c.length>0&&c.forEach(function(h){parseInt(h.value)!==0&&(h.value=0,x(h,"input"))})});return m.colorSettingPanel=u}.bind(a)}function Ac(a){return a?String(a).replace(/<[^>]+>/g,"").trim():""}function ib(a,t){return a&&t?a.from===
t.from||a.content&&t.content&&(a=Ac(a.content),t=Ac(t.content),a&&a===t)?!0:!1:!1}function wd(){function a(y,x){return y.from-x.from}var t=[],z=null;return{initSingle:function(y){t=[y];z=y.position},isEmpty:function(){return t.length===0},isSingle:function(){return t.length===1},getCues:function(){return t.slice()},getPosition:function(){return z},getAggregateRange:function(){if(t.length===0)return null;var y=t.slice().sort(a);return{startTime:y[0].from,endTime:y[y.length-1].to}},expand:function(y){t.some(function(x){return ib(x,
y)})||(t.push(y),t.sort(a))},contains:function(y){return t.some(function(x){return ib(x,y)})},cancelToEnd:function(){if(t.length>=2){var y=t[t.length-1];t=[y];z=y.position}},cancelToStart:function(){if(t.length>=2){var y=t[0];t=[y];z=y.position}},shrinkTo:function(y){if(!(t.length<2)){for(var x=-1,e=0;e<t.length;e++)if(ib(t[e],y)){x=e;break}if(x!==0)if(x>0)t=t.slice(0,x+1);else{x=t.length;for(e=0;e<t.length;e++)if(t[e].from>y.from){x=e;break}x<1||(t=t.slice(0,x),t.push(y),t.sort(function(d,r){return d.from-
r.from}))}}},isEndpoint:function(y){return t.length<2?!1:ib(t[0],y)||ib(t[t.length-1],y)},clear:function(){t=[];z=null}}}function xd(a,t,z){z=z&&z.singleOnly;if(a.isEmpty())return"init";if(z)return a.contains(t)&&a.isSingle()?"cancel":"init";if(!a.contains(t)){if(a.getPosition()&&t.position&&a.getPosition()!==t.position)return"switchTrack";a=a.getCues();return a.length>=2&&t.from>=a[0].from&&t.from<=a[a.length-1].from?"shrink":"expand"}if(a.isSingle())return"cancel";a=a.getCues();return ib(a[0],t)?
"cancelToEnd":ib(a[a.length-1],t)?"cancelToStart":"shrink"}function yd(a){var t=a.viewMode==="filtered";return a.searchFilter==="all"&&!!a.hasDualTracks||t}function Na(a){if(a==null)return"";a=String(a);a=a.replace(/<br\s*\/?>/gi," ");a=a.replace(/[\r\n]+/g," ");a=a.replace(/<[^>]*>/g,"");a=a.replace(/&nbsp;/gi," ");return a=a.replace(/\s+/g," ").trim()}function tb(a){a=String(a);for(var t=5381,z=0;z<a.length;z++)t=(t<<5)+t+a.charCodeAt(z)|0;return(t>>>0).toString(36)}function Bc(a){function t(c){c.type===
"touchstart"?(r=c.touches[0].clientX-m,n=c.touches[0].clientY-u):(r=c.clientX-m,n=c.clientY-u);if(c.target===f||f.contains(c.target))x=!0,ka(a,"dragging")}function z(c){r=e;n=d;x=!1;ja(a,"dragging")}function y(c){if(x){c.preventDefault();c.type==="touchmove"?(e=c.touches[0].clientX-r,d=c.touches[0].clientY-n):(e=c.clientX-r,d=c.clientY-n);m=e;u=d;c=a.style;var h="translate(calc(-50% + "+e+"px), calc(";var k=a.classList.contains("zwp-subtitleTranslatePanel")?"-50%":(k=a.closest(".zwp-wrap"))&&(k.classList.contains("zwp-fullscreen")||
k.classList.contains("zwp-fullscreen-win")||k.classList.contains("zwp-mobile"))||window.innerWidth<768?"0px":"-50%";c.transform=h+k+" + "+d+"px))"}}var x=!1,e,d,r,n,m=0,u=0,f=a.querySelector(".form-row.form-title");f&&(f.addEventListener("mousedown",t),f.addEventListener("touchstart",t,{passive:!1}));document.addEventListener("mouseup",z);document.addEventListener("mousemove",y);document.addEventListener("touchend",z);document.addEventListener("touchmove",y,{passive:!1});return function(){document.removeEventListener("mouseup",
z);document.removeEventListener("mousemove",y);document.removeEventListener("touchend",z);document.removeEventListener("touchmove",y)}}function Vb(a,t){var z=t.playerElm.offsetHeight;a.style.maxWidth=t.playerElm.offsetWidth-80+"px";window.innerWidth<768||t.isMobile&&t.isMobile()||t.playerElm.classList.contains("zwp-fullscreen")||t.playerElm.classList.contains("zwp-fullscreen-win")?t.playerElm.classList.contains("zwp-fullscreen")||t.playerElm.classList.contains("zwp-fullscreen-win")||(t=t.playerElm.clientHeight,
z=parseFloat(getComputedStyle(a).top)||12,a.style.maxHeight=Math.max(120,t-z-48-12)+"px"):(t=Math.min(.8*z-40,1.2*z-104),t=Math.min(t,500),t=Math.max(t,140),a.style.maxHeight=t+"px")}function zd(a,t){var z=t.fadeOut,y=t.zwpQuery,x=t.secondsToTimeCode,e=t.vttParse,d=t.srtParse,r=t.zwp_subtitleSearch_html,n=t.zwp_subtitleTranslate_html,m=t.zwp_tts_html,u=t.zwp_version;a.createSubtitleSearchPanel=function(){function f(){if(P){P.scrollTop=0;var Z=P.querySelector(".zwp-list-inner");if(Z){var da=parseFloat(getComputedStyle(P).maxHeight)||
400,ia=Z.getBoundingClientRect(),pa=P.getBoundingClientRect();pa.height!==0&&ia.height!==0&&(ia=ia.top-pa.top,pa=parseFloat(getComputedStyle(P).paddingBottom)||6,ia>0&&(Z.style.maxHeight=Math.max(60,Math.floor(da-ia-pa))+"px"))}}}function c(Z,da){function ia(){wa||(wa=!0,O===Y&&(clearInterval(Y),O=null),H.videoEl&&(H.videoEl.removeEventListener("loadedmetadata",ia),H.videoEl.removeEventListener("canplay",ia)),H._crossSearchJumping=!1,da())}if(Z){var pa=function(){var ea=H.playlistState&&H.playlistState.currentItem;
return ea?ea===Z||ea.id===Z.id||ea.url===Z.url:!1},sa=function(){var ea=H.videoEl;return ea?ea.readyState>=1:!0};if(pa()&&sa())da();else{H._crossSearchJumping=!0;pa()||typeof H.playPlaylistItem!=="function"||H.playPlaylistItem(Z);O&&(clearInterval(O),O=null);var wa=!1;H.videoEl&&(H.videoEl.addEventListener("loadedmetadata",ia,{once:!0}),H.videoEl.addEventListener("canplay",ia,{once:!0}));var Y=setInterval(function(){pa()&&sa()&&ia()},100);O=Y;setTimeout(function(){ia()},4E3)}}else da()}function h(){Ga&&
cancelAnimationFrame(Ga);Ga=requestAnimationFrame(function(){Ga=null;f()})}function k(){var Z=P.querySelector('input[name="zwpSubtitleSearchScope"]:checked');return Z?Z.value:"current"}function l(){if(Ba){var Z=Ba.itemsWithSubs.length,da=0;Ba.itemsWithSubs.forEach(function(ia){Ca[ia.item.id]&&da++});R&&(R.textContent=K("searchTargetSummary","Target: {0}/{1} videos selected").replace("{0}",da).replace("{1}",Z))}}function p(){Ba&&X&&(X.innerHTML="",l(),Ba.itemsWithSubs.forEach(function(Z){var da=Z.item;
Z=document.createElement("label");Z.className="zwp-target-item";var ia=document.createElement("input");ia.type="checkbox";ia.value=da.id;ia.checked=!!Ca[da.id];ia.addEventListener("change",function(){Ca[da.id]=ia.checked;l();k()==="group"&&w()});var pa=document.createElement("span");pa.className="zwp-target-item-title";pa.textContent=da.name||da.title||"Item "+da.id;Z.appendChild(ia);Z.appendChild(pa);X.appendChild(Z)}))}function w(Z,da){var ia=k(),pa=arguments.length===0?la.value.trim():String(Z==
null?"":Z).trim();if(ia==="group"&&Ba)v(pa);else{ia=H.searchSubtitles(pa);var sa=da!=null?String(da).trim():pa;C(ia,pa,sa)}}function v(Z){function da(){if(pa===Ha&&!(ra>=wa.length)){var ua=wa[ra++],Aa=ua.item,Ia=ua.subSource,Ka=ua.trackIndex,Ja=Aa.id+"|"+((typeof Ia==="object"&&Ia.url?Ia.url:typeof Ia==="string"?Ia:"")||Ia.name||Ka);H.subtitleParseCache[Ja]?(ua=H.subtitleParseCache[Ja],delete H.subtitleParseCache[Ja],H.subtitleParseCache[Ja]=ua,ua=Promise.resolve(ua)):ua=H.fetchAndParseSubtitle(Ia).then(function(Oa){if(Oa){var Ra=
H.subtitleParseCache,db=Object.keys(Ra);db.length>=50&&delete Ra[db[0]];Ra[Ja]=Oa}return Oa});ua.then(function(Oa){if(pa===Ha){ea++;if(fa){var Ra=Math.min(sa.length,Math.ceil(ea/Y*sa.length));fa.textContent=K("searchingProgress","Searching {0}/{1} files...").replace("{0}",Ra).replace("{1}",sa.length)}if(Oa&&Oa.body&&Array.isArray(Oa.body)){var db=typeof Ia==="object"&&Ia.title?Ia.title:Ka===1?K("mainSubtitle","Main subtitle"):K("secondSubtitle","Second subtitle"),ub=Z.toLowerCase();Oa.body.forEach(function(Wa){var La=
Na(Wa.content||Wa.text||"");La.toLowerCase().indexOf(ub)!==-1&&(qa[Aa.id]||(qa[Aa.id]={item:Aa,hits:[]}),qa[Aa.id].hits.push({from:Wa.from,to:Wa.to,content:La,trackName:db,trackIndex:Ka}),ma++)})}ia();ea===Y?(fa&&(fa.textContent=K("searchResultCount","{0} results found").replace("{0}",ma)),h()):da()}})}}function ia(){if(pa===Ha){ba.innerHTML="";var ua=Object.keys(qa);if(ua.length===0)ea===Y&&(ba.innerHTML='<div class="zwp-no-results">'+K("noSearchResults","No matching subtitles found")+"</div>");
else{var Aa=0,Ia=!1;ua.forEach(function(Ka){if(!Ia){Ka=qa[Ka];var Ja=Ka.item;Ka=Ka.hits;var Oa=document.createElement("div");Oa.className="zwp-search-group";var Ra=document.createElement("div");Ra.className="zwp-search-group-header";var db=document.createElement("span");db.className="zwp-search-group-title";db.textContent=Ja.name||Ja.title||"Item "+Ja.id;var ub=document.createElement("span");ub.className="zwp-search-group-count";ub.textContent=Ka.length+" "+K("searchResultCount","{0} results found").replace("{0}",
"").trim();Ra.appendChild(db);Ra.appendChild(ub);Ra.addEventListener("click",function(La){La.target.closest(".zwp-search-result-item")||(Wa.style.display=Wa.style.display==="none"?"":"none",Ra.classList.toggle("zwp-search-group-collapsed"))});Oa.appendChild(Ra);var Wa=document.createElement("div");Wa.className="zwp-search-group-items";Ka.forEach(function(La){if(Aa>=500)Ia=!0;else{Aa++;var Xa=document.createElement("div");Xa.className="zwp-search-result-item";var Cc=Na(La.content||"");Xa.setAttribute("data-cue-key",
La.from+"-"+La.to+"-"+tb(Cc));Xa.setAttribute("data-from",La.from);Xa.setAttribute("data-to",La.to);var bb=document.createElement("span");bb.className="result-time";bb.innerHTML=x(La.from)+'<span class="result-time-end"> \u2192 '+x(La.to)+"</span>";var eb=document.createElement("span");eb.className="result-text";eb.innerHTML=E(La.content,Z);Xa.appendChild(bb);Xa.appendChild(eb);bb=document.createElement("button");bb.className="zwp-sub-locate-btn";bb.title=K("locateInFullList","Locate in full list");
bb.innerHTML='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M20 10c0 6-8 12-8 12s-8-6-8-12a8 8 0 0 1 16 0Z"/><circle cx="12" cy="10" r="3"/></svg>';Xa.appendChild(bb);eb=document.createElement("button");eb.className="zwp-sub-loop-btn";eb.innerHTML='<i class="xicon xicon-loop"></i>';Xa.appendChild(eb);(function(Dc,Wb,Ad,Bd,Cd){Xa.addEventListener("click",function(jb){jb.target.closest(".zwp-sub-loop-btn")||jb.target.closest(".zwp-sub-locate-btn")||
(jb.stopPropagation(),c(Wb,function(){g(Dc.from)}))});Cd.addEventListener("click",function(jb){jb.stopPropagation();N(Dc,Wb)});Bd.addEventListener("click",function(jb){jb.stopPropagation();c(Wb,function(){J(Ad)})})})(La,Ja,{from:La.from,to:La.to,content:Cc,position:String(La.trackIndex||1)},eb,bb);Wa.appendChild(Xa)}});Oa.appendChild(Wa);ba.appendChild(Oa)}});Ia&&(ua=document.createElement("div"),ua.className="zwp-no-results",ua.style.fontSize="12px",ua.textContent=K("crossSearchTooManyHits","Too many results, showing first 500. Refine your keywords."),
ba.appendChild(ua));h()}}}var pa=++Ha;if(Z){D("filtered");ba.innerHTML="";var sa=Ba.itemsWithSubs.filter(function(ua){return!!Ca[ua.item.id]});if(sa.length===0)ba.innerHTML='<div class="zwp-no-results">'+K("noSearchResults","No matching subtitles found")+"</div>",fa&&(fa.textContent="");else{var wa=[];sa.forEach(function(ua){ua.subtitles.forEach(function(Aa,Ia){wa.push({item:ua.item,subSource:Aa,trackIndex:Ia+1})})});var Y=wa.length,ea=0,ma=0,qa={};fa&&(fa.textContent=K("searchingProgress","Searching {0}/{1} files...").replace("{0}",
0).replace("{1}",sa.length));H.subtitleParseCache=H.subtitleParseCache||{};for(var ra=0,xa=0;xa<Math.min(3,wa.length);xa++)da()}}else ba.innerHTML="",D("full"),ha&&(ha.innerHTML=""),fa&&(fa.textContent="")}function E(Z,da){if(!da)return Ea(Z);da=da.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");da=new RegExp("("+da+")","gi");return Ea(Z).replace(da,'<span class="search-highlight">$1</span>')}function D(Z){H._subtitleViewMode=Z;P.setAttribute("data-viewmode",Z);B(Z)}function B(Z){if(ha&&fa&&(ha.innerHTML="",
fa.textContent="",Z!=="filtered"&&Z==="suspended")){Z=document.createElement("button");Z.className="zwp-resume-search-btn";var da=(la.value||"").trim();Z.textContent=K("resumeSearchFormat",'Resume search for "{0}"').replace("{0}",da);Z.addEventListener("click",function(ia){ia.stopPropagation();if(H._crossSuspendedKeyword!=null){ia=H._crossSuspendedKeyword;H._crossSuspendedKeyword=null;var pa=P.querySelector('input[name="zwpSubtitleSearchScope"][value="group"]');pa&&!pa.checked&&(pa.checked=!0);ia?
(la.value=ia,D("filtered"),v(ia)):D("full")}else(ia=la.value.trim())?(D("filtered"),w(ia)):(D("full"),w(null))});ha.appendChild(Z);fa.textContent=K("fullListHint","Full list")}}function G(Z){D("suspended");w(null,la.value);requestAnimationFrame(function(){var da=Z.from+"-"+Z.to+"-"+tb(Na(Z.content)),ia=ba.querySelector('[data-cue-key="'+da+'"]');ia||=ba.querySelector('[data-from="'+Z.from+'"][data-to="'+Z.to+'"]');if(ia&&(da=P.querySelector(".zwp-list-inner"))){ia=ia.getBoundingClientRect();var pa=
da.getBoundingClientRect();da.scrollTop=Math.max(0,da.scrollTop+(ia.top-pa.top-da.clientHeight/3))}})}function N(Z,da){function ia(){D("suspended");ba.innerHTML="";if(Y&&Y.body&&Array.isArray(Y.body)){var ea=document.createDocumentFragment();Y.body.forEach(function(ma,qa){qa=Na(ma.content||ma.text||"");var ra=document.createElement("div");ra.className="zwp-search-result-item";var xa=ma.from+"-"+ma.to+"-"+tb(qa);ra.setAttribute("data-cue-key",xa);ra.setAttribute("data-from",ma.from);ra.setAttribute("data-to",
ma.to);xa=document.createElement("span");xa.className="result-time";xa.innerHTML=x(ma.from)+'<span class="result-time-end"> \u2192 '+x(ma.to)+"</span>";var ua=document.createElement("span");ua.className="result-text";ua.innerHTML=I(ma.content||ma.text||"",pa);ra.appendChild(xa);ra.appendChild(ua);xa=document.createElement("button");xa.className="zwp-sub-locate-btn";xa.innerHTML='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M20 10c0 6-8 12-8 12s-8-6-8-12a8 8 0 0 1 16 0Z"/><circle cx="12" cy="10" r="3"/></svg>';
ra.appendChild(xa);xa=document.createElement("button");xa.className="zwp-sub-loop-btn";xa.innerHTML='<i class="xicon xicon-loop"></i>';ra.appendChild(xa);(function(Aa,Ia){ra.addEventListener("click",function(Ka){Ka.target.closest(".zwp-sub-loop-btn")||Ka.target.closest(".zwp-sub-locate-btn")||(Ka.stopPropagation(),g(Aa.from))});Ia.addEventListener("click",function(Ka){Ka.stopPropagation();J(Aa)})})({from:ma.from,to:ma.to,content:qa,position:String(sa)},xa);ea.appendChild(ra)});ba.appendChild(ea);
requestAnimationFrame(function(){var ma=Z.from+"-"+Z.to+"-"+tb(Na(Z.content)),qa=ba.querySelector('[data-cue-key="'+ma+'"]');qa||=ba.querySelector('[data-from="'+Z.from+'"][data-to="'+Z.to+'"]');if(qa){if(ma=P.querySelector(".zwp-list-inner")){qa=qa.getBoundingClientRect();var ra=ma.getBoundingClientRect();ma.scrollTop=Math.max(0,ma.scrollTop+(qa.top-ra.top-ma.clientHeight/3))}f()}})}else H._crossSuspendedKeyword=null,v(pa)}H._lastCrossLocateHit=Z;H._lastCrossLocateItem=da;var pa=(la.value||"").trim();
H._crossSuspendedKeyword=pa;var sa=Z.trackIndex||1,wa=da.subtitle&&da.subtitle[sa-1]||"";wa=da.id+"|"+((typeof wa==="object"&&wa.url?wa.url:typeof wa==="string"?wa:"")||wa.name||sa);var Y=H.subtitleParseCache&&H.subtitleParseCache[wa];c(da,function(){ia()})}function I(Z,da){Z=Na(Z);if(!da)return Ea(Z);da=da.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");da=new RegExp("("+da+")","gi");return Ea(Z).replace(da,'<span class="search-highlight">$1</span>')}function C(Z,da,ia){function pa(ma){var qa=document.createElement("div");
qa.className="zwp-search-result-item";qa.setAttribute("data-from",ma.from);qa.setAttribute("data-to",ma.to);qa.setAttribute("data-cue-key",ma.from+"-"+ma.to+"-"+tb(Na(ma.content)));var ra=document.createElement("span");ra.className="result-time";ra.innerHTML=x(ma.from)+'<span class="result-time-end"> \u2192 '+x(ma.to)+"</span>";var xa=document.createElement("span");xa.className="result-text";xa.innerHTML=I(ma.content,ia);if(H._searchFilter==="all"&&(ma.position==="1"||ma.position==="2")){var ua=document.createElement("span");
ua.className="result-tag tag-"+ma.position;ua.textContent=ma.position==="1"?K("primaryTrack","Pri"):K("secondaryTrack","Sec");qa.appendChild(ua)}qa.appendChild(ra);qa.appendChild(xa);ra=document.createElement("button");ra.className="zwp-sub-locate-btn";ra.title=K("locateInFullList","Locate in full list");ra.innerHTML='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M20 10c0 6-8 12-8 12s-8-6-8-12a8 8 0 0 1 16 0Z"/><circle cx="12" cy="10" r="3"/></svg>';
qa.appendChild(ra);xa=document.createElement("button");xa.className="zwp-sub-loop-btn";xa.innerHTML='<i class="xicon xicon-loop"></i>';qa.appendChild(xa);(function(Aa,Ia,Ka){qa.addEventListener("click",function(Ja){Ja.target.closest(".zwp-sub-loop-btn")||Ja.target.closest(".zwp-sub-locate-btn")||(Ja.stopPropagation(),H.subtitleLoopCtrl&&!H.subtitleLoopCtrl.isEmpty()&&(Ja=H.subtitleLoopCtrl.getAggregateRange())&&Aa.from>=Ja.endTime&&(H._userSeekOutbound=!0),g(Aa.from))});Ka.addEventListener("click",
function(Ja){Ja.stopPropagation();G(Aa)});Ia.addEventListener("click",function(Ja){Ja.stopPropagation();J(Aa)})})(ma,xa,ra);return qa}function sa(){for(var ma=document.createDocumentFragment(),qa=Math.min(ea+100,Z.length),ra=ea;ra<qa;ra++)ma.appendChild(pa(Z[ra]));ea=qa;ba.appendChild(ma);ea<Z.length?requestAnimationFrame(sa):wa()}function wa(){fa&&H._subtitleViewMode!=="suspended"&&(fa.textContent=da&&Z.length>0?K("searchResultCount","Found {0} results").replace("{0}",Z.length):"");f()}ia==null&&
(ia=da);ba.innerHTML="";if(Z.length===0){var Y=document.createElement("div");Y.className="zwp-no-results";Y.textContent=da?K("noSearchResults","No matching subtitles found"):K("noSubtitlesLoaded","No subtitles loaded");ba.appendChild(Y);wa()}else{var ea=0;sa()}}function g(Z){typeof H.seekTimeProgressByTime==="function"?H.seekTimeProgressByTime(Z):H.videoEl&&(H.videoEl.currentTime=Z,H.updateProgress&&H.updateProgress(Z),H.timeSpan&&H._renderTimeSpan(Z))}function q(){var Z=H.subtitleLoopCtrl.getAggregateRange();
Z?(H.segment.isActive=!0,H.segment.startTime=Z.startTime,H.segment.endTime=Z.endTime):(H.segment.isActive=!1,H.segment.loopOriginFrom=void 0,H.segment.subtitleSourceSnapshot=null,typeof H.removeSegmentHandlers==="function"&&H.removeSegmentHandlers());var da=H.controlbar?H.controlbar.querySelector("#segmentLayer"):null;Z=H.controlbar?H.controlbar.querySelector(".zwp-segmentBtn"):null;da&&(H.segment.isActive?(da.classList.add("active"),(da=da.closest(".zwp__time-rail"))&&da.classList.add("segment-active")):
(da.classList.remove("active"),(da=da.closest(".zwp__time-rail"))&&da.classList.remove("segment-active")));Z&&(H.segment.isActive?Z.closest(".zwp-segmentButton").classList.add("active"):Z.closest(".zwp-segmentButton").classList.remove("active"));typeof H.updateSegmentUI==="function"&&H.updateSegmentUI()}function A(){var Z=P.querySelectorAll(".zwp-search-result-item"),da=H.subtitleLoopCtrl.getCues(),ia=H.subtitleLoopCtrl.isEmpty(),pa={},sa=da.length?da[0].from:null,wa=da.length?da[da.length-1].from:
null,Y=da.length>=2;ia||da.forEach(function(ua){pa[Na(ua.content||"").trim()]=!0});for(da=0;da<Z.length;da++){var ea=Z[da],ma=ea.querySelector(".zwp-sub-loop-btn");if(ma){ma.classList.remove("active");ea.classList.remove("zwp-sub-in-range");var qa=ea.querySelector(".zwp-sub-range-tag");qa&&qa.remove();if(!ia){qa=parseFloat(ea.getAttribute("data-from"));var ra="",xa=ea.querySelector(".result-text");xa&&(ra=Na(xa.textContent||"").trim());if(Y?qa>=sa&&qa<=wa||pa[ra]:qa===sa||pa[ra])ma.classList.add("active"),
ea.classList.add("zwp-sub-in-range")}}}}function M(){var Z=H.controlbar?H.controlbar.querySelector(".zwp-recordBtn"):null;if(Z)if(H.subtitleLoopCtrl&&!H.subtitleLoopCtrl.isEmpty()){var da=H.subtitleLoopCtrl.getCues(),ia=H.subtitleLoopCtrl.getAggregateRange();ia=(ia.endTime-ia.startTime).toFixed(1);da=K("recordLoopRangeHint","Record this range ({n} cues, {sec}s)").replace("{n}",String(da.length)).replace("{sec}",ia);Z.setAttribute("title",da)}else Z.removeAttribute("title")}function J(Z,da){da=yd({searchFilter:H._searchFilter,
hasDualTracks:H.subtitles&&H.subtitles["1"]&&H.subtitles["2"]&&H.subtitles["1"]!==H.subtitles["2"],viewMode:H._subtitleViewMode});switch(xd(H.subtitleLoopCtrl,Z,{singleOnly:da})){case "init":case "switchTrack":H.subtitleLoopCtrl.initSingle(Z);break;case "cancel":H.subtitleLoopCtrl.clear();break;case "expand":H.subtitleLoopCtrl.expand(Z);break;case "cancelToEnd":H.subtitleLoopCtrl.cancelToEnd();break;case "cancelToStart":H.subtitleLoopCtrl.cancelToStart();break;case "shrink":H.subtitleLoopCtrl.shrinkTo(Z);
break;default:return}H.subtitleLoopQueue={cues:H.subtitleLoopCtrl.getCues(),position:H.subtitleLoopCtrl.getPosition()};A();q();M();H.subtitleLoopCtrl.isEmpty()?H.currentChapterLoop&&(H.currentChapterLoop=null):(H.currentChapterLoop=null,typeof H.setupSegmentHandlers==="function"&&H.setupSegmentHandlers(),Z=H.subtitleLoopCtrl.getAggregateRange(),H._internalSeek=!0,g(Z.startTime),H.videoEl&&H.videoEl.paused&&H.videoEl.play(),setTimeout(function(){H._internalSeek=!1},500))}function T(){var Z=la.value;
var da=(Z||"").trim()?"filtered":"full";D(da);w(Z)}function b(){var Z=la.value.length>0;va&&(va.style.display=Z?"none":"block");na&&(na.style.display=Z?"block":"none")}var S,H=this,V=r();H.overlay_layers.insertAdjacentHTML("beforeend",V);var P=H.overlay_layers.querySelector(":scope > .zwp-subtitleSearchPanel");Vb(P,H);var U=null,W=function(){U&&(clearTimeout(U),U=null);U=setTimeout(function(){P&&P.parentNode&&(Vb(P,H),f())},120)};window.addEventListener("resize",W);var ca=null;P.querySelector(".closeBtn").addEventListener("click",
function(Z){Z.stopPropagation();if(!H._crossSearchJumping){ca&&(ca(),ca=null);window.removeEventListener("resize",W);U&&(clearTimeout(U),U=null);Ha++;O&&(clearInterval(O),O=null);var da=Z.currentTarget.closest(".zwp-subtitleSearchPanel");z(da,500,function(){da.remove()});delete H.subtitleSearchPanel;delete H.refreshSubtitleSearch;H._lastClosedParentMenu&&(H._lastClosedParentMenu.style.display="",delete H._lastClosedParentMenu)}});var la=P.querySelector(".zwp-search-input"),na=P.querySelector(".zwp-search-clear-btn"),
ba=P.querySelector(".zwp-search-results-list");P.querySelector(".zwp-search-status-row");var ha=P.querySelector(".zwp-status-left"),fa=P.querySelector(".zwp-status-right"),Ga=null,Ba=function(){if(!H.playlistState||!H.playlistState.currentGroup)return null;var Z=H.playlistState.currentGroup;if(!Z.items||Z.items.length<=1)return null;var da=[],ia=0;Z.items.forEach(function(pa){var sa=pa.subtitle;sa&&(Array.isArray(sa)||(sa=[sa]),sa.length>0&&(da.push({item:pa,subtitles:sa}),ia+=sa.length))});return ia<=
1?null:{group:Z,itemsWithSubs:da,allItems:Z.items}}(),Ca={},Ha=0,O=null,Q=P.querySelector(".zwp-search-scope-row"),F=P.querySelector(".zwp-search-targets-row"),R=P.querySelector(".zwp-search-targets-summary"),X=P.querySelector(".zwp-search-targets-list"),aa=P.querySelector(".zwp-targets-toggle-btn");V=P.querySelector(".zwp-targets-select-all");var oa=P.querySelector(".zwp-targets-clear-all");Ba?(Q&&(Q.style.display=""),F&&(F.style.display="none"),Ba.itemsWithSubs.forEach(function(Z){Ca[Z.item.id]=
!0})):(Q&&(Q.style.display="none"),F&&(F.style.display="none"));Q=P.querySelectorAll('input[name="zwpSubtitleSearchScope"]');for(F=0;F<Q.length;F++)Q[F].addEventListener("change",function(){k()==="group"?ta&&(ta.style.display="none"):ta&&(ta.style.display="");h();w()});aa&&aa.addEventListener("click",function(Z){Z.stopPropagation();Z=X.style.display!=="none";X.style.display=Z?"none":"block";aa.classList.toggle("expanded",!Z);h()});V&&V.addEventListener("click",function(Z){Z.stopPropagation();Ba&&
(Ba.itemsWithSubs.forEach(function(da){Ca[da.item.id]=!0}),p(),h(),k()==="group"&&w())});oa&&oa.addEventListener("click",function(Z){Z.stopPropagation();Ba&&(Ba.itemsWithSubs.forEach(function(da){Ca[da.item.id]=!1}),p(),h(),k()==="group"&&w())});var ta=null;H.subtitles&&H.subtitles["2"]&&H.subtitles["2"]!==H.subtitles["1"]&&(ta=document.createElement("div"),ta.className="zwp-search-seg",["all","primary","secondary"].forEach(function(Z){var da=document.createElement("span");da.className="zwp-search-seg-item"+
(Z==="all"?" active":"");da.setAttribute("data-filter",Z);da.textContent=Z==="all"?K("searchFilterAll","All"):Z==="primary"?K("primarySubtitle","Primary"):K("secondarySubtitle","Secondary");ta.appendChild(da)}),(V=(S=P.querySelector(".zwp-search-input-wrapper"))==null?void 0:S.closest(".form-row"))&&V.parentNode.insertBefore(ta,V.nextSibling));H._searchFilter="all";ta&&ta.addEventListener("click",function(Z){if(Z=Z.target.closest(".zwp-search-seg-item")){Z=Z.getAttribute("data-filter");H._searchFilter=
Z;for(var da=ta.querySelectorAll(".zwp-search-seg-item"),ia=0;ia<da.length;ia++)da[ia].classList.toggle("active",da[ia].getAttribute("data-filter")===Z);H._subtitleViewMode==="suspended"?w(null,la.value):w()}});H._subtitleViewMode=H._subtitleViewMode||"full";S=function(Z,da){var ia;return function(){var pa=this,sa=arguments;clearTimeout(ia);ia=setTimeout(function(){Z.apply(pa,sa)},da)}}(T,100);la.addEventListener("input",S);la.addEventListener("keypress",function(Z){Z.key==="Enter"&&T()});var va=
P.querySelector(".zwp-search-icon");la.addEventListener("input",b);b();na&&na.addEventListener("click",function(Z){Z.stopPropagation();la.value="";la.focus();b();T()});D("full");w();P.addEventListener("mousedown",function(Z){Z.stopPropagation()});P.addEventListener("dblclick",function(Z){Z.stopPropagation()});P.addEventListener("click",function(Z){Z.stopPropagation()});P.addEventListener("scroll",function(){P.scrollTop!==0&&(P.scrollTop=0)});ca=Bc(P);if(S=P.querySelector(".zwp-list-inner"))S.style.maxHeight=
"";V=y(S);typeof V.focus==="function"&&V.focus();S.addEventListener("mouseenter",function(Z){Z.stopPropagation();this.focus()});H.subtitleSearchPanel=P;H.syncSubtitleCache=function(Z){if(H.subtitleParseCache){var da=H.subtitles&&H.subtitles[Z];if(da&&da.body){var ia=H.playlistState&&H.playlistState.currentItem;if(ia&&ia.id){var pa=Object.keys(H.subtitleParseCache),sa=ia.id+"|";ia=null;for(var wa=0;wa<pa.length;wa++){var Y=pa[wa];if(Y.indexOf(sa)===0){var ea=Y.substring(sa.length);if(da.url&&ea===
da.url){ia=Y;break}}}if(!ia)if(pa=pa.filter(function(ma){return ma.indexOf(sa)===0}),pa.length===1)ia=pa[0];else if(pa.length>1)for(wa=0;wa<pa.length;wa++)if(pa[wa].endsWith("|"+Z)){ia=pa[wa];break}ia&&H.subtitleParseCache[ia]&&(H.subtitleParseCache[ia].body=JSON.parse(JSON.stringify(da.body)))}}}};H.refreshSubtitleSearch=function(){k()==="group"&&Ba?H._subtitleViewMode==="suspended"&&H._lastCrossLocateHit&&H._lastCrossLocateItem?N(H._lastCrossLocateHit,H._lastCrossLocateItem):v(la.value):H._subtitleViewMode===
"suspended"?w(null,la.value):w();A()};h();return P}.bind(a);a.createSubtitleTranslatePanel=function(f){function c(){E&&(E.abort(),E=null);D&&(clearInterval(D),D=null);z(v,500,function(){v.remove()});delete w.subtitleTranslatePanel;w._lastClosedParentMenu&&(w._lastClosedParentMenu.style.display="",delete w._lastClosedParentMenu)}function h(V){return(V=V.indexOf("WEBVTT")!==-1?e(V):d(V))&&V.body&&V.body.length?V.body:null}function k(V,P){H=V;P=P||{};q.disabled=!1;q.classList.remove("zwp-translate-loading");
M.style.display="none";T.style.display="none";G&&(G.disabled=!1);B.disabled=!1;J.className="zwp-translate-status";J.textContent="";V==="idle"?(A.textContent=K("translateStart","Translate"),P.errorMsg?(J.textContent=P.errorMsg,J.className="zwp-translate-status zwp-translate-error"):P.okMsg&&(J.textContent=P.okMsg,J.className="zwp-translate-status zwp-translate-ok")):V==="translating"?(q.disabled=!0,q.classList.add("zwp-translate-loading"),M.style.display="inline-block",A.textContent=K("translating",
"Translating..."),T.style.display="block",b.style.width="0%",G&&(G.disabled=!0),B.disabled=!0):V==="success"&&(A.textContent=K("translateApply","Apply Translation"),V=P.count||0,J.textContent="\u2713 "+K("translateSuccess","Translation complete")+" ("+K("translateSuccessCount","{n} subtitles").replace("{n}",V)+")",J.className="zwp-translate-status zwp-translate-ok")}function l(){H==="success"&&(S=null,k("idle"))}function p(){var V=null;if(G){var P=parseInt(G.value);w.subtitleList&&w.subtitleList[P]&&
(V=w.subtitleList[P])}V||=w.subtitles&&w.subtitles[1];if(V&&V.body&&V.body.length!==0)if(P=w._config&&w._config.translateApi||"")if(/^https?:\/\//i.test(P)){P=P.replace(/\/+$/,"");var U=B.value;U||=(window.navigator.language||"en").toLowerCase().indexOf("zh")!==-1?"zh":"en";V=uc(V.body);V=new Blob([V],{type:"text/plain"});var W=new FormData;W.append("file",V,"subtitle.srt");W.append("targetLang",U);W.append("outputFormat","srt");S=null;k("translating");var ca=0;D=setInterval(function(){ca+=Math.random()*
8;ca>90&&(ca=90);b.style.width=ca+"%"},300);var la=new XMLHttpRequest;E=la;la.open("POST",P+"/translate",!0);la.setRequestHeader("X-ZWPlayer",u);la.timeout=w._config&&w._config.translateTimeout||3E4;la.onload=function(){clearInterval(D);E=D=null;b.style.width="100%";try{var na=JSON.parse(la.responseText);if(na.success&&na.data&&na.data.content)(S=h(na.data.content))&&S.length>0?k("success",{count:S.length}):k("idle",{errorMsg:K("translateFailed","Translation failed")});else{var ba=K("translateFailed",
"Translation failed")+(na.error?": "+na.error:"");k("idle",{errorMsg:ba})}}catch(ha){k("idle",{errorMsg:K("translateFailed","Translation failed")})}setTimeout(function(){T.style.display="none"},1E3)};la.onerror=function(){clearInterval(D);E=D=null;k("idle",{errorMsg:K("translateFailed","Translation failed")})};la.ontimeout=function(){clearInterval(D);E=D=null;k("idle",{errorMsg:K("translateTimeout","Translation request timed out")})};la.send(W)}else k("idle",{errorMsg:K("translateInvalidUrl","Invalid translation service URL")});
else k("idle",{errorMsg:K("translateNoApi","Translation service not configured")});else k("idle",{errorMsg:K("translateNoSubtitle","No subtitle loaded")})}var w=this;f=n(f);w.overlay_layers.insertAdjacentHTML("beforeend",f);var v=w.overlay_layers.querySelector(":scope > .zwp-subtitleTranslatePanel");f=w.playerElm.offsetHeight;v.style.maxWidth=w.playerElm.offsetWidth-80+"px";f=Math.min(.8*f-60,1.2*f-104);f=Math.min(f,500);f=Math.max(f,140);v.style.maxHeight=f+"px";var E=null,D=null;v.querySelector(".closeBtn").addEventListener("click",
function(V){V.stopPropagation();c()});var B=v.querySelector("#zwp-translate-target"),G=null;if(w.subtitleList&&w.subtitleList.length>1){f=document.createElement("div");f.className="zwp-translate-row";var N=document.createElement("span");N.className="zwp-translate-label";N.textContent=K("translateSourceSubtitle","Source");f.appendChild(N);G=document.createElement("select");G.className="zwp-translate-select";G.id="zwp-translate-source";for(N=0;N<w.subtitleList.length;N++){var I=w.subtitleList[N];if(!I.hidden){var C=
I.name||"Subtitle "+(N+1);I.format&&(C+=" ("+I.format.toUpperCase()+")");var g=document.createElement("option");g.value=N;g.textContent=C;w.subtitles&&w.subtitles["1"]===I&&(g.selected=!0);G.appendChild(g)}}f.appendChild(G);(N=v.querySelector(".zwp-translate-controls"))&&N.insertBefore(f,N.firstChild)}var q=v.querySelector(".zwp-translate-main-btn"),A=q.querySelector(".zwp-translate-btn-text"),M=v.querySelector(".zwp-translate-spinner"),J=v.querySelector(".zwp-translate-status"),T=v.querySelector(".zwp-translate-progress-row"),
b=v.querySelector(".zwp-translate-progress-fill"),S=null,H="idle";G&&G.addEventListener("change",l);B.addEventListener("change",l);q.addEventListener("click",function(V){V.stopPropagation();if(H==="success"){if(S){V=w.subtitles&&w.subtitles["1"];var P=!(!w.subtitles||!w.subtitles["2"])&&w.subtitles["2"]!==V,U={body:S};V&&(V.font_size!=null&&(U.font_size=V.font_size),V.font_color!=null&&(U.font_color=V.font_color),V.background_alpha!=null&&(U.background_alpha=V.background_alpha),V.background_color!=
null&&(U.background_color=V.background_color),V.format&&(U.format=V.format));w.processLoadedSubtitle(U,"1",B.selectedIndex>=0?B.options[B.selectedIndex].text||B.value:B.value,"translate",!1);P&&V&&V.id!=null&&(w.setSubtitleTrack("2",V.id),w.updateSubtitleMenu(),w.showSubtitle(!0));S=null;c()}}else H==="idle"&&p()});v.addEventListener("mousedown",function(V){V.stopPropagation()});v.addEventListener("dblclick",function(V){V.stopPropagation()});v.addEventListener("click",function(V){V.stopPropagation()});
return w.subtitleTranslatePanel=v}.bind(a);a.createTtsPanel=function(){function f(){B&&(B.abort(),B=null);G&&(clearInterval(G),G=null);I&&(I.abort(),I=null);z(D,500,function(){D.remove()});delete v.ttsPanel;v._lastClosedParentMenu&&(v._lastClosedParentMenu.style.display="",delete v._lastClosedParentMenu)}function c(ba,ha){W=ba;ha=ha||{};b.disabled=!1;b.classList.remove("zwp-tts-loading");H.style.display="none";P.style.display="none";q&&(q.disabled=!1);C.disabled=!1;g.disabled=!1;V.className="zwp-tts-status";
V.textContent="";ba==="idle"?(S.textContent=K("ttsStart","Synthesize"),ha.errorMsg?(V.textContent=ha.errorMsg,V.className="zwp-tts-status zwp-tts-error"):ha.okMsg&&(V.textContent=ha.okMsg,V.className="zwp-tts-status zwp-tts-ok")):ba==="submitting"||ba==="polling"?(b.classList.add("zwp-tts-loading"),H.style.display="inline-block",P.style.display="block",U.style.width=ba==="submitting"?"5%":"30%",q&&(q.disabled=!0),C.disabled=!0,g.disabled=!0,ba==="polling"?S.textContent=K("ttsCancel","Cancel"):(b.disabled=
!0,S.textContent=K("ttsSubmitting","Submitting\u2026")),ha.stageMsg&&(V.textContent=ha.stageMsg,V.className="zwp-tts-status zwp-tts-info")):ba==="completed"&&(S.textContent=K("ttsApply","Apply Dubbing"),V.textContent=ha.okMsg||K("ttsCompleted","\u2713 Synthesis complete"),V.className="zwp-tts-status zwp-tts-ok")}function h(){W!=="completed"&&W!=="failed"||c("idle")}function k(){var ba=null;if(q){var ha=parseInt(q.value);v.subtitleList&&v.subtitleList[ha]&&(ba=v.subtitleList[ha])}ba||=v.subtitles&&
v.subtitles["1"];if(ba&&ba.body&&ba.body.length!==0){var fa=v._config&&v._config.translateApi||"";if(fa)if(/^https?:\/\//i.test(fa))if(fa=fa.replace(/\/+$/,""),(ha=g.files&&g.files[0]?g.files[0]:null)&&ha.size>10485760)c("idle",{errorMsg:K("ttsAudioTooLarge","Reference audio too large (max 10MB)")});else{var Ga=C.value||"zh";ba=uc(ba.body);ba=new Blob([ba],{type:"text/plain"});var Ba=new FormData;Ba.append("subtitle",ba,"subtitle.srt");Ba.append("language",Ga);ha&&Ba.append("audio",ha,ha.name);la=
Ga;na=K("lang_"+Ga,Ga)+" "+K("audioTrack","Audio Track");ca=null;c("submitting");var Ca=new XMLHttpRequest;B=Ca;Ca.open("POST",fa+"/tts/conversions",!0);Ca.setRequestHeader("X-ZWPlayer",u);Ca.timeout=v._config&&v._config.ttsTimeout||6E4;Ca.onload=function(){B=null;try{var Ha=JSON.parse(Ca.responseText);if(Ha.job_id)ca=N=Ha.job_id,l(fa);else{var O=K("ttsFailed","Synthesis failed")+(Ha.error?": "+Ha.error:"");c("idle",{errorMsg:O})}}catch(Q){c("idle",{errorMsg:K("ttsFailed","Synthesis failed")})}};
Ca.onerror=function(){B=null;c("idle",{errorMsg:K("ttsFailed","Synthesis failed")})};Ca.ontimeout=function(){B=null;c("idle",{errorMsg:K("ttsTimeout","Request timed out")})};Ca.send(Ba)}else c("idle",{errorMsg:K("ttsInvalidUrl","Invalid service URL")});else c("idle",{errorMsg:K("ttsNoApi","Subtitle service not configured")})}else c("idle",{errorMsg:K("ttsNoSubtitle","No subtitle loaded")})}function l(ba){c("polling",{stageMsg:K("ttsStageQueued","Queued")});var ha=30;U.style.width=ha+"%";G=setInterval(function(){ha+=
Math.random()*5;ha>92&&(ha=92);U.style.width=ha+"%";p(ba)},1500);p(ba)}function p(ba){var ha=new XMLHttpRequest;B=ha;ha.open("GET",ba+"/tts/conversions/"+encodeURIComponent(N),!0);ha.setRequestHeader("X-ZWPlayer",u);ha.timeout=1E4;ha.onload=function(){if(W==="polling")try{var fa=JSON.parse(ha.responseText);if(fa.status==="completed")clearInterval(G),G=null,U.style.width="100%",c("completed");else if(fa.status==="failed"){clearInterval(G);G=null;var Ga=K("ttsFailed","Synthesis failed")+(fa.error?": "+
fa.error:"");c("idle",{errorMsg:Ga})}else if(fa.status==="canceled")clearInterval(G),G=null,c("idle",{okMsg:K("ttsCanceled","Canceled")});else{var Ba=fa.status,Ca={queued:"ttsStageQueued",parsing:"ttsStageParsing",cloning_voice:"ttsStageCloning",synthesizing:"ttsStageSynth",aligning:"ttsStageAlign",mixing:"ttsStageMix"}[Ba];var Ha=Ca?K(Ca,Ba):K("ttsPolling","Synthesizing\u2026");V.textContent=Ha}}catch(O){}};ha.onerror=function(){};ha.send()}function w(){if(ca){var ba=(v._config&&v._config.translateApi||
"").replace(/\/+$/,"");b.disabled=!0;S.textContent=K("ttsPolling","Loading\u2026");V.textContent=K("ttsStageMix","Downloading");V.className="zwp-tts-status zwp-tts-info";var ha=new AbortController;I=ha;fetch(ba+"/tts/conversions/"+encodeURIComponent(ca)+"/audio",{headers:{"X-ZWPlayer":u},signal:ha.signal}).then(function(fa){if(!fa.ok)throw Error("HTTP "+fa.status);return fa.blob()}).then(function(fa){I===ha&&(I=null);fa=URL.createObjectURL(fa);v._ttsBlobUrls||(v._ttsBlobUrls=[]);v._ttsBlobUrls.push(fa);
fa=v.addAudioTrack(fa,la,na,!0);fa!=null&&typeof v.setAudioTrack==="function"&&v.setAudioTrack(fa);c("idle",{okMsg:K("ttsApplied","\u2713 Dubbing generated and switched")});setTimeout(f,1500)}).catch(function(fa){I===ha&&(I=null);fa&&fa.name==="AbortError"||c("idle",{errorMsg:K("ttsDownloadFailed","Dubbing audio download failed")+": "+fa.message})})}}var v=this,E=m();v.overlay_layers.insertAdjacentHTML("beforeend",E);var D=v.overlay_layers.querySelector(":scope > .zwp-ttsPanel");E=v.playerElm.offsetHeight;
D.style.maxWidth=v.playerElm.offsetWidth-80+"px";E=Math.min(Math.min(.8*E-60,1.2*E-104),500);E=Math.max(E,140);D.style.maxHeight=E+"px";var B=null,G=null,N=null,I=null;D.querySelector(".closeBtn").addEventListener("click",function(ba){ba.stopPropagation();f()});var C=D.querySelector("#zwp-tts-lang"),g=D.querySelector(".zwp-tts-audio-input"),q=null;if(v.subtitleList&&v.subtitleList.length>1){E=document.createElement("div");E.className="zwp-tts-row";var A=document.createElement("span");A.className=
"zwp-tts-label";A.textContent=K("ttsSourceSubtitle","Source");E.appendChild(A);q=document.createElement("select");q.className="zwp-tts-select";q.id="zwp-tts-source";for(A=0;A<v.subtitleList.length;A++){var M=v.subtitleList[A];if(!M.hidden){var J=M.name||"Subtitle "+(A+1),T=document.createElement("option");T.value=A;T.textContent=J;v.subtitles&&v.subtitles["1"]===M&&(T.selected=!0);q.appendChild(T)}}E.appendChild(q);(A=D.querySelector(".zwp-tts-controls"))&&A.insertBefore(E,A.firstChild)}var b=D.querySelector(".zwp-tts-main-btn"),
S=b.querySelector(".zwp-tts-btn-text"),H=b.querySelector(".zwp-tts-spinner"),V=D.querySelector(".zwp-tts-status"),P=D.querySelector(".zwp-tts-progress-row"),U=D.querySelector(".zwp-tts-progress-fill"),W="idle";q&&q.addEventListener("change",h);C.addEventListener("change",h);b.addEventListener("click",function(ba){ba.stopPropagation();if(W==="polling"){if(N){ba=(v._config&&v._config.translateApi||"").replace(/\/+$/,"");G&&(clearInterval(G),G=null);try{var ha=new XMLHttpRequest;ha.open("DELETE",ba+
"/tts/conversions/"+encodeURIComponent(N),!0);ha.setRequestHeader("X-ZWPlayer",u);ha.send()}catch(fa){}N=null;c("idle",{okMsg:K("ttsCanceled","Canceled")})}}else W==="completed"?w():W==="idle"&&k()});var ca=null,la="",na="";D.addEventListener("click",function(ba){ba.stopPropagation()});return v.ttsPanel=D}.bind(a);a.searchSubtitles=function(f){var c=[],h=this._searchFilter||"all",k=h!=="secondary";h=h!=="primary";var l=f?Na(f).toLowerCase():"";if(this.subtitleList&&this.subtitleList.length>0)for(f=
0;f<this.subtitleList.length;f++){var p=this.subtitleList[f];if(p.body){var w="";this.subtitles&&this.subtitles["1"]===p?w="1":this.subtitles&&this.subtitles["2"]===p&&(w="2");if((w!=="1"||k)&&(w!=="2"||h)&&w)for(var v=0;v<p.body.length;v++){var E=p.body[v],D=E.content?Na(E.content).toLowerCase():"";l&&D.indexOf(l)===-1||c.push({content:E.content,from:E.from,to:E.to,position:w,subtitleName:p.name})}}}else this.subtitles&&(k&&this.subtitles["1"]&&this.subtitles["1"].body&&this.subtitles["1"].body.forEach(function(B){var G=
B.content?Na(B.content).toLowerCase():"";l&&G.indexOf(l)===-1||c.push({content:B.content,from:B.from,to:B.to,position:"1"})}),h&&this.subtitles["2"]&&this.subtitles["2"].body&&this.subtitles["2"].body.forEach(function(B){var G=B.content?Na(B.content).toLowerCase():"";l&&G.indexOf(l)===-1||c.push({content:B.content,from:B.from,to:B.to,position:"2"})}));c.sort(function(B,G){return B.from-G.from});return c}.bind(a)}function Dd(a,t){var z=t.httpGet,y=t.parse_media_time,x=t.secondsToTimeCode,e=t.zwpQuery,
d=t.fadeOut,r=t.zwp__controlbar_chapters_html,n=t.zwp__make_chapters_list,m=t.zwp_chapterSearch_html;t=t.resolveThumbnailUrl;a.searchChapters=function(u){var f=[];if(!this.chapters||!Array.isArray(this.chapters)||this.chapters.length===0)return f;this.chapters.forEach(function(c){var h=c.title||c.text||"",k=c.desc||"",l=u?u.toLowerCase():"";(!u||h&&h.toLowerCase().indexOf(l)!==-1||k&&k.toLowerCase().indexOf(l)!==-1)&&f.push({title:h,desc:k,time:c.time,start_time:c.start_time,end_time:c.end_time,duration:c.duration,
image:c.image})});f.sort(function(c,h){c=c.start_time!==void 0?c.start_time:c.time;h=h.start_time!==void 0?h.start_time:h.time;c=typeof c==="string"?y(c):c;h=typeof h==="string"?y(h):h;return c-h});return f}.bind(a);a.createChapterSearchPanel=function(){function u(){var I=E.value.trim(),C=l.searchChapters(I);c(C,I)}function f(I,C){if(!C)return Ea(I);C=C.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");C=new RegExp("("+C+")","gi");return Ea(I).replace(C,'<span class="search-highlight">$1</span>')}function c(I,
C){var g=document.createDocumentFragment();I.length===0?(I=document.createElement("div"),I.className="zwp-no-results",I.textContent=C?K("noChapterSearchResults","No matching chapters found"):K("noChaptersLoaded","No chapters loaded"),g.appendChild(I)):I.forEach(function(q){var A=document.createElement("div");A.className="zwp-search-result-item";var M=document.createElement("div");M.className="result-time";var J=q.start_time!==void 0?q.start_time:q.time;J=typeof J==="string"?y(J):J;var T=x(J,!0),b=
void 0;q.end_time!==void 0?b=typeof q.end_time==="string"?y(q.end_time):q.end_time:q.duration!==void 0&&(b=typeof q.duration==="string"?y(q.duration):q.duration,b=J+b);b!==void 0&&(T+=" - "+x(b,!0));M.textContent=T;T=document.createElement("div");T.className="result-text";T.innerHTML=f(q.title,C);J=document.createElement("div");J.className="result-info";J.style.flex="1";J.style.minWidth="0";J.appendChild(T);q.desc&&(T=document.createElement("div"),T.className="result-desc",T.innerHTML=f(q.desc,C),
J.appendChild(T));T=document.createElement("div");T.style.display="flex";T.style.alignItems="center";T.style.paddingTop="4px";if(q.image){b=document.createElement("div");b.className="result-thumb";b.style.marginRight="12px";var S=document.createElement("img");S.style.height="40px";S.style.borderRadius="4px";S.style.maxWidth="71px";S.style.objectFit="contain";rb(q.image)||String(q.image).indexOf("//")===0?S.src=q.image:S.alt="";b.appendChild(S);T.appendChild(b)}T.appendChild(J);A.appendChild(M);A.appendChild(T);
M=document.createElement("button");M.className="zwp-chapter-loop-btn";M.innerHTML='<i class="xicon xicon-loop"></i>';M.title=K("loopChapter","Loop Chapter");A.appendChild(M);(function(H,V,P){V.addEventListener("click",function(U){U.stopPropagation();U=V.classList.contains("active");for(var W=w.querySelectorAll(".zwp-chapter-loop-btn"),ca=0;ca<W.length;ca++)W[ca].classList.remove("active");if(U)l.currentChapterLoop=null,l.segment&&l.segment.isActive&&(l.segment.isActive=!1,na=l.controlbar?l.controlbar.querySelector("#segmentLayer"):
null,ba=l.controlbar?l.controlbar.querySelector(".zwp-segmentBtn"):null,na&&(na.classList.remove("active"),(na=na.closest(".zwp__time-rail"))&&na.classList.remove("segment-active")),ba&&ba.closest(".zwp-segmentButton").classList.remove("active"),l.updateSegmentUI());else{V.classList.add("active");U=H.start_time!==void 0?H.start_time:H.time;W=typeof U==="string"?y(U):U;ca=l.videoEl.duration||999999;if(H.end_time!==void 0)ca=typeof H.end_time==="string"?y(H.end_time):H.end_time;else if(H.duration)ca=
W+y(H.duration);else for(ba=[],l.chapters&&Array.isArray(l.chapters)&&(ba=l.chapters.slice().sort(function(ha,fa){ha=ha.start_time!==void 0?ha.start_time:ha.time;fa=fa.start_time!==void 0?fa.start_time:fa.time;ha=typeof ha==="string"?y(ha):ha;fa=typeof fa==="string"?y(fa):fa;return ha-fa})),na=0;na<ba.length;na++){var la=ba[na].start_time!==void 0?ba[na].start_time:ba[na].time;la=typeof la==="string"?y(la):la;if(la>W+.1){ca=la;break}}var na=l.controlbar?l.controlbar.querySelector("#segmentLayer"):
null,ba=l.controlbar?l.controlbar.querySelector(".zwp-segmentBtn"):null;l.segment.isActive=!0;l.segment.startTime=W;l.segment.endTime=ca;na&&(na.classList.add("active"),(na=na.closest(".zwp__time-rail"))&&na.classList.add("segment-active"));ba&&ba.closest(".zwp-segmentButton").classList.add("active");l.updateSegmentUI();l.setupSegmentHandlers();if(l.subtitleLoopCtrl&&!l.subtitleLoopCtrl.isEmpty()&&(l.subtitleLoopCtrl.clear(),l.subtitleLoopQueue={cues:[],position:null},ba=document.querySelector(".zwp-subtitleSearchPanel"))){na=
ba.querySelectorAll(".zwp-sub-loop-btn.active");for(la=0;la<na.length;la++)na[la].classList.remove("active");ba=ba.querySelectorAll(".zwp-sub-in-range");for(na=0;na<ba.length;na++)ba[na].classList.remove("zwp-sub-in-range")}l.currentChapterLoop={start:W,end:ca,triggerElement:V};l._internalSeek=!0;h(U);l.videoEl.paused&&l.videoEl.play();setTimeout(function(){l._internalSeek=!1},500)}});P.addEventListener("click",function(U){U.stopPropagation();if(l.currentChapterLoop&&(l.currentChapterLoop.triggerElement&&
l.currentChapterLoop.triggerElement.classList.remove("active"),l.currentChapterLoop=null,l.segment&&l.segment.isActive)){l.segment.isActive=!1;var W=l.controlbar?l.controlbar.querySelector("#segmentLayer"):null;U=l.controlbar?l.controlbar.querySelector(".zwp-segmentBtn"):null;W&&(W.classList.remove("active"),(W=W.closest(".zwp__time-rail"))&&W.classList.remove("segment-active"));U&&U.closest(".zwp-segmentButton").classList.remove("active");typeof l.updateSegmentUI==="function"&&l.updateSegmentUI()}h(H.start_time!==
void 0?H.start_time:H.time)})})(q,M,A);g.appendChild(A)});B.innerHTML="";B.appendChild(g);I=w.querySelector(".zwp-list-inner");(I=e(I).getNiceScroll())&&I.length>0&&I[0].resize()}function h(I){I=typeof I==="string"?y(I):I;typeof l.seekTimeProgressByTime==="function"?l.seekTimeProgressByTime(I):l.videoEl&&(l.videoEl.currentTime=I,l.updateProgress&&l.updateProgress(I),l.timeSpan&&l._renderTimeSpan(I))}function k(){var I=E.value.length>0;G&&(G.style.display=I?"none":"block");D.style.display=I?"block":
"none"}var l=this,p=m();l.overlay_layers.insertAdjacentHTML("beforeend",p);var w=l.overlay_layers.querySelector(":scope > .zwp-chapterSearchPanel");Vb(w,l);var v=null;w.querySelector(".closeBtn").addEventListener("click",function(I){I.stopPropagation();v&&(v(),v=null);var C=I.currentTarget.closest(".zwp-chapterSearchPanel");d(C,500,function(){C.remove()});delete l.chapterSearchPanel});var E=w.querySelector(".zwp-search-input"),D=w.querySelector(".zwp-search-clear-btn"),B=w.querySelector(".zwp-search-results-list");
l._chapterLoopHandlerAttached||(l._internalSeek=!1,l.videoEl.addEventListener("timeupdate",function(){!l._internalSeek&&l.currentChapterLoop&&l.videoEl.currentTime+.1>=l.currentChapterLoop.end&&!l.videoEl.seeking&&(l._internalSeek=!0,l.videoEl.currentTime=l.currentChapterLoop.start,l.videoEl.paused&&l.videoEl.play(),setTimeout(function(){l._internalSeek=!1},500))}),l.videoEl.addEventListener("seeking",function(){!l._internalSeek&&l.currentChapterLoop&&(l.currentChapterLoop.triggerElement&&l.currentChapterLoop.triggerElement.classList.remove("active"),
l.currentChapterLoop=null)}),l._chapterLoopHandlerAttached=!0);p=function(I,C){var g;return function(){var q=this,A=arguments;clearTimeout(g);g=setTimeout(function(){I.apply(q,A)},C)}}(u,100);E.addEventListener("input",p);E.addEventListener("keypress",function(I){I.key==="Enter"&&u()});var G=w.querySelector(".zwp-search-icon");E.addEventListener("input",k);k();D.addEventListener("click",function(I){I.stopPropagation();E.value="";E.focus();k();u()});u();w.addEventListener("mousedown",function(I){I.stopPropagation()});
w.addEventListener("dblclick",function(I){I.stopPropagation()});w.addEventListener("click",function(I){I.stopPropagation()});v=Bc(w);p=w.querySelector(".zwp-list-inner");var N=parseFloat(getComputedStyle(w).maxHeight)||400;p.style.maxHeight=Math.max(N-84,60)+"px";N=e(p);N.niceScroll({cursorborder:"",cursorcolor:"rgb(179 178 178 / 67%)",boxzoom:!1,rightdock:4});N.focus();p.addEventListener("mouseenter",function(I){I.stopPropagation();this.focus()});return l.chapterSearchPanel=w}.bind(a);a.setMediainfo=
function(u,f){u={engine:u,hasVideo:f.hasVideo,hasAudio:f.hasAudio};if(f.hasVideo){var c=f.videoCodec;c=c.indexOf("avc1")>=0?"H264/AVC":c.indexOf("hvc")>=0?"H265/HEVC":"Unknown";u.vCodec=c;u.width=f.width;u.height=f.height;u.fps=f.fps;typeof u.fps==="number"&&(u.fps=u.fps.toFixed(2));u.profile=f.profile;u.level=f.level}f.hasAudio&&(c=f.audioCodec,c=c.indexOf("mp4a.40.2")>=0?"AAC-LC":c.indexOf("mp4a.40.5")>=0?"HE-AAC":c.indexOf("mp3")>=0?"MP3":"Unknown",u.aCodec=c,u.sampleRate=f.audioSampleRate,u.channels=
f.audioChannelCount);this.mediaInfo=u}.bind(a);a.processChapterContent=function(u,f){f=f||{};var c=null,h=a.detectContentFormat(u);if(h==="vtt"){if(u=Ab(u)){c=[];for(var k=0;k<u.body.length;k++){var l=u.body[k];c.push({title:l.content,time:x(l.from),desc:"no desc",image:null})}}}else if(h==="json")try{c=(k=JSON.parse(u))&&!Array.isArray(k)&&k.zwp_protocol&&typeof k.zwp_protocol==="string"&&k.zwp_protocol.indexOf("ZWMAP/")===0&&k.zwp_type==="chapter"&&Array.isArray(k.chapters)&&k.chapters.length>0?
k.chapters:Array.isArray(k)?k:null}catch(p){c=null}if(!c||!Array.isArray(c))return typeof this._config.onChapterError==="function"&&this._config.onChapterError.call(this,{title:f.title||"Unknown",url:f.url||"",error:"Invalid chapter file format",errorCode:"INVALID_FORMAT",source:f.source||"unknown",timestamp:(new Date).toISOString()}),f.source==="local"&&this.toast(K("invalidChapterFormat","Invalid chapter file format"),3E3,!0),!1;typeof this._config.onChapterLoaded==="function"&&this._config.onChapterLoaded.call(this,
{url:f.url||"",title:f.title||"",format:h});this.chapters=c;this.loadChapters();return!0};rd(a,{httpGet:z,resolveThumbnailUrl:t});a.loadChapters=function(){var u=this;if(u.chapters)if(typeof u.chapters==="object"&&u.chapters instanceof File)u.detectMimeType(u.chapters).then(function(k){return u.isValidChapterFile(u.chapters,k).then(function(l){return l?!0:(u.toast(K("unsupportedChapterFormat","Unsupported chapter format")+": "+k,3E3,!0),!1)})}).then(function(k){k&&(k=new FileReader,k.onload=function(l){l=
l.target.result;var p=URL.createObjectURL(u.chapters);u._playlistBlobUrls=u._playlistBlobUrls||[];u._playlistBlobUrls.push(p);u.processChapterContent(l,{url:p,title:u.chapters.name,source:"local"})},k.onerror=function(){var l={fileName:u.chapters.name,error:"Failed to read chapter file",errorCode:"READ_ERROR",source:"local",timestamp:(new Date).toISOString()};typeof u._config.onChapterError==="function"&&u._config.onChapterError.call(u,l);u.toast(K("failedToReadChapter","Failed to read chapter file"),
3E3,!0)},k.readAsText(u.chapters))}).catch(function(k){k={fileName:u.chapters.name,error:"Chapter file validation failed",errorCode:"VALIDATION_FAILED",details:k.message||k,source:"local",timestamp:(new Date).toISOString()};typeof u._config.onChapterError==="function"&&u._config.onChapterError.call(u,k);u.toast(K("chapterValidationFailed","Chapter file validation failed"),3E3,!0)});else if(typeof u.chapters==="string")u.chapters.substr(0,4)==="http"||u.chapters.substr(0,5)==="blob:"?z(u.chapters,
function(k){u.processChapterContent(k,{url:u.chapters,title:u.chapters,source:u.chapters.substr(0,4)==="http"?"http":"blob"})},function(k){typeof u._config.onChapterError==="function"&&u._config.onChapterError.call(u,{title:u.chapters,url:u.chapters,error:"Failed to fetch chapter file",errorCode:"FETCH_ERROR",source:u.chapters.substr(0,4)==="http"?"http":"blob",timestamp:(new Date).toISOString(),xhr:k})}):u.detectContentFormat(u.chapters)!=="unknown"?u.processChapterContent(u.chapters,{url:"",title:"Direct Chapter Content",
source:"direct"}):delete u.chapters;else{if(typeof u.chapters==="object"&&!Array.isArray(u.chapters)&&u.chapters.zwp_type==="chapter"&&Array.isArray(u.chapters.chapters))u.chapters=u.chapters.chapters;else if(!Array.isArray(u.chapters))return;if(u.videoEl){var f=u.videoEl.duration;if(!isNaN(f)&&f!==Infinity){if(f=r(f,u.chapters)){var c=u.controlbar.querySelector(".zwp__time-chapter");c&&(c.innerHTML=f,f=c.querySelectorAll(".zwp__chapter_dot"),f.length>0&&f.forEach(function(k){k.addEventListener("mousedown",
function(l){l.stopPropagation();l=y(this.getAttribute("data-time"));u.seekTimeProgressByTime(l)})}))}if(u._config.chapterButton&&(f=u.controlbar.querySelector(".zwp__time-info"))&&((c=f.querySelector(".zwp-chapterButton"))&&c.remove(),c=n(u.chapters))){var h=f.querySelector(".zwp_danmuBarDock");h?h.insertAdjacentHTML("beforebegin",c.html):f.insertAdjacentHTML("beforeend",c.html);c=f.querySelector(".zwp-chapterButton");c.querySelector(".zwp-chapterBtn").addEventListener("click",function(k){k.stopPropagation();
var l=u.overlay_layers.querySelector(":scope > .zwp-chapterSearchPanel");if(l)d(l,500,function(){l.remove()}),delete u.chapterSearchPanel;else if(u.closeAllActivePanels(),l=u.createChapterSearchPanel())l.style.display="block",(k=l.querySelector(".zwp-search-input"))&&!u.isMobile()&&k.focus()})}}}}}.bind(a);a.removeChapters=function(){if(this.chapters){if(this.controlbar){var u=this.controlbar.querySelector(".zwp__time-chapter");u&&(u.innerHTML="")}(u=this.controlbar.querySelector(".zwp__time-info"))&&
(u=u.querySelector(".zwp-chapterButton"))&&u.remove();this._closePanel("chapterSearchPanel");delete this.chapters}}.bind(a)}function Ed(a,t){function z(f){return Ea(f)}function y(f,c){if(f=f._hotspot)f._panelTimers||(f._panelTimers=[]),f._panelTimers.push(c)}function x(f){if(!f||typeof f!=="object")return null;Array.isArray(f)&&(f={zwp_protocol:"ZWMAP/1.0",zwp_type:"annotation",zwp_version:"1.0",nodes:f});if(!f.zwp_protocol||typeof f.zwp_protocol!=="string"||!f.zwp_protocol.startsWith("ZWMAP/")||
f.zwp_type!=="annotation")return null;var c=f.zwp_protocol.substring(6);if(parseInt(c.split(".")[0],10)>2)return null;c={nodes:[]};if(Array.isArray(f.nodes))for(var h=0;h<f.nodes.length;h++){var k=f.nodes[h];if(k&&typeof k==="object"&&typeof k.id==="string"&&/^[A-Za-z0-9_\-]+$/.test(k.id)&&k.id&&k.type&&k.time_range&&Array.isArray(k.time_range)&&!(k.time_range.length<2)&&(typeof k.time_range[0]!=="number"&&(k.time_range[0]=parseFloat(k.time_range[0])||0),typeof k.time_range[1]!=="number"&&(k.time_range[1]=
parseFloat(k.time_range[1])||0),!(k.time_range[0]>=k.time_range[1]))){k.action&&(k.event||(k.event={trigger:"click",actions:[]}),Array.isArray(k.event.actions)||(k.event.actions=[]),k.action.type&&k.event.actions.length===0&&k.event.actions.push(k.action),delete k.action);k.event&&k.event.action&&!k.event.actions&&(k.event.actions=k.event.action.type?[k.event.action]:[],delete k.event.action);k.event&&!k.event.actions&&(k.event.actions=[]);if(k.position){var l=k.position;l.x=Math.max(0,Math.min(100,
l.x||0));l.y=Math.max(0,Math.min(100,l.y||0));l.w=Math.max(0,Math.min(100,l.w||0));l.h=Math.max(0,Math.min(100,l.h||0))}c.nodes.push(k)}}return c}function e(f,c){f.controlbar&&(f.controlbar.querySelectorAll("li.zwp-speed-item").forEach(function(h){h.classList.toggle("active",parseFloat(h.innerText)===c)}),f=f.controlbar.querySelector(".zwp-speedBtn"))&&(f.innerHTML=Math.abs(c-1)<.01?"1x":c.toFixed(2).replace(/\.?0+$/,"")+"x")}function d(f,c,h,k){return{event_id:c,type:h,time:f.videoEl?f.videoEl.currentTime:
0,data:k}}function r(f,c){if(document.getElementById(f)&&window.L){var h=c.lat||39.908,k=c.lng||116.397,l=c.zoom||12,p=L.map(f,{zoomControl:!0,attributionControl:!1}).setView([h,k],l);L.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{maxZoom:19}).addTo(p);f=c.marker_label||c.title||"";L.marker([h,k]).addTo(p).bindPopup(f||h.toFixed(4)+", "+k.toFixed(4)).openPopup();setTimeout(function(){p.invalidateSize()},350)}}var n=t.httpGet,m=t.secondsToTimeCode;a._hotspot={data:null,url:null,
activeIds:{},triggeredEvents:{},completed:{},manualShown:{},interactionLayer:null,eventLayer:null,navigationStack:[],isInterrupted:!1,resizeObserver:null,eventQueue:[],variables:{},_speedControllerStack:[],userEnabled:!0};a._hotspot.variables=Object.create(null);var u=function(f,c,h){try{var k=x(c);k&&k.nodes.length!==0&&(f._hotspot.data=k,f._hotspot.url=h||"",f._hotspotEnsureLayers(),f._hotspotRenderProgressMarkers(),f._showAnnotationButton(),typeof f._config.onHotspotLoaded==="function"&&f._config.onHotspotLoaded.call(f,
{nodes:k.nodes.length,url:h||""}))}catch(l){typeof f._config.onHotspotError==="function"&&f._config.onHotspotError.call(f,{error:"JSON_PARSE_ERROR",url:h||"",message:l.message})}};a.loadAnnotations=function(f){var c=this;if(f){c.unloadAnnotations();c._hotspotLoadGen=(c._hotspotLoadGen||0)+1;var h=c._hotspotLoadGen;if(typeof f==="object"&&f instanceof File){c._hotspot.url=f.name;var k=new FileReader;k.onload=function(l){if(h===c._hotspotLoadGen)try{var p=JSON.parse(l.target.result);u(c,p,f.name)}catch(w){}};
k.readAsText(f)}else typeof f==="object"?u(c,f,""):typeof f==="string"&&(c._hotspot.url=f,n(f,function(l){h===c._hotspotLoadGen&&(l=JSON.parse(l),u(c,l,f))},function(l){h===c._hotspotLoadGen&&typeof c._config.onHotspotError==="function"&&c._config.onHotspotError.call(c,{error:"FETCH_ERROR",url:f,status:l?l.status:0})}))}};a.unloadAnnotations=function(){var f=this._hotspot;this._hotspotLoadGen=(this._hotspotLoadGen||0)+1;f.interactionLayer&&(f.interactionLayer.innerHTML="");f.eventLayer&&(f.eventLayer.innerHTML=
"",f.eventLayer.classList.remove("active"));f.data=null;f.url=null;f.activeIds={};f.triggeredEvents={};f.manualShown={};f.navigationStack=[];f.isInterrupted=!1;f.eventQueue=[];f.variables=Object.create(null);f.completed={};f.lastTime=void 0;if(f._speedControllerStack&&f._speedControllerStack.length>0){var c=f._speedControllerStack[0];c.restoreRate!==0&&(this.videoEl&&(this.videoEl.playbackRate=c.previousRate||1),e(this,c.previousRate||1))}f._speedControllerStack=[];this._hotspotBackBtn&&(this._hotspotBackBtn.remove(),
this._hotspotBackBtn=null);this._hotspotClearProgressMarkers();if(f._countdownCleanups){c=Object.keys(f._countdownCleanups);for(var h=0;h<c.length;h++){try{f._countdownCleanups[c[h]]()}catch(k){}delete f._countdownCleanups[c[h]]}}if(f._panelTimers){for(c=0;c<f._panelTimers.length;c++)clearTimeout(f._panelTimers[c]);f._panelTimers=[]}this._hotspotBackBtnTimer&&(clearTimeout(this._hotspotBackBtnTimer),this._hotspotBackBtnTimer=null);this._hideAnnotationButton()};a._destroyHotspot=function(){var f=this._hotspot;
if(f){if(f.resizeObserver){try{f.resizeObserver.disconnect()}catch(c){}f.resizeObserver=null}this.unloadAnnotations&&this.unloadAnnotations()}};a.registerFeature({name:"hotspot",destroy:a._destroyHotspot},1);a._hotspotEnsureLayers=function(){var f=this,c=f.playerContainer;if(c){if(!f._hotspot.interactionLayer){var h=document.createElement("div");h.className="zwp-interaction-layer";c.appendChild(h);f._hotspot.interactionLayer=h}f._hotspot.eventLayer||(h=document.createElement("div"),h.className="zwp-event-layer",
c.appendChild(h),f._hotspot.eventLayer=h);f._hotspot.resizeObserver||typeof ResizeObserver==="undefined"||(f._hotspot.resizeObserver=new ResizeObserver(function(){f._hotspotUpdatePositions()}),f._hotspot.resizeObserver.observe(c))}};a._hotspotGetVideoRect=function(){var f=this.videoWrapper||this.playerContainer;if(!f)return null;var c=f.clientWidth;f=f.clientHeight;var h=this.videoEl;if(!h||!h.videoWidth||!h.videoHeight)return{x:0,y:0,w:c,h:f};var k=h.videoWidth,l=h.videoHeight;h=window.getComputedStyle?
window.getComputedStyle(h).objectFit:"";if(h==="fill"||h==="cover")return{x:0,y:0,w:c,h:f};h=Math.min(c/k,f/l);k*=h;l*=h;return{x:(c-k)/2,y:(f-l)/2,w:k,h:l}};a._hotspotMapToPixels=function(f){var c=this._hotspotGetVideoRect();if(!c)return null;f=f||{x:0,y:0,w:0,h:0};return{x:c.x+f.x/100*c.w,y:c.y+f.y/100*c.h,w:f.w/100*c.w,h:f.h/100*c.h}};a._hotspotUpdatePositions=function(){var f=this._hotspot.interactionLayer;if(f){f=f.querySelectorAll(".zwp-hotspot, .zwp-hotspot-text, .zwp-choice-inline");for(var c=
0;c<f.length;c++){var h=f[c]._hotspotPosition;h&&(h=this._hotspotMapToPixels(h))&&(f[c].style.left=h.x+"px",f[c].style.top=h.y+"px",f[c].style.width=h.w+"px",f[c].style.height=h.h+"px")}}};a._hotspotGetAnimConfig=function(f){return(f=f.animation)&&typeof f==="object"?{enter:f.enter||"none",emphasis:f.emphasis||"none",exit:f.exit||"none",duration:typeof f.duration==="number"&&f.duration>0?f.duration:500}:null};a._hotspotStartEmphasis=function(f,c){c=c.emphasis;f.className=f.className.replace(/\bzwp-anim-emphasis-\S+/g,
"");c&&c!=="none"?f.classList.add("idle","zwp-anim-emphasis-"+c):f.classList.add("idle")};a._hotspotPlayEnter=function(f,c,h){var k=this,l=c.enter;f._zwpExitHandler&&(f.removeEventListener("animationend",f._zwpExitHandler),f._zwpExitHandler=null);f.classList.remove("zwp-animating");f.style.animation="";f.classList.remove("idle");if(l&&l!=="none"){f.style.transition="none";f.style.opacity="0";f.style.pointerEvents="auto";f.style.animation="zwp-"+l+" "+c.duration+"ms "+(l==="bouncein"?"cubic-bezier(0.34,1.56,0.64,1)":
"cubic-bezier(0.4,0,0.2,1)")+" forwards";f.classList.add("zwp-animating");var p=function(w){w.target===f&&(f.removeEventListener("animationend",p),f._zwpEnterHandler=null,f.classList.remove("zwp-animating"),f.style.animation="",f.style.transition="",f.style.opacity=h,k._hotspotStartEmphasis(f,c))};f._zwpEnterHandler=p;f.addEventListener("animationend",p)}else f.style.transition="",f.style.opacity=h,f.style.pointerEvents="auto",k._hotspotStartEmphasis(f,c)};a._hotspotPlayExit=function(f,c){var h=c.exit;
f._zwpEnterHandler&&(f.removeEventListener("animationend",f._zwpEnterHandler),f._zwpEnterHandler=null);f.classList.remove("zwp-animating");f.style.animation="";f.classList.remove("idle");f.className=f.className.replace(/\bzwp-anim-emphasis-\S+/g,"");if(h&&h!=="none"){f.style.transition="none";f.style.animation="zwp-"+h+" "+c.duration+"ms cubic-bezier(0.4,0,1,1) forwards";f.classList.add("zwp-animating");var k=function(l){l.target===f&&(f.removeEventListener("animationend",k),f._zwpExitHandler=null,
f.classList.remove("zwp-animating"),f.style.animation="",f.style.transition="",f.style.opacity="0",f.style.pointerEvents="none")};f._zwpExitHandler=k;f.addEventListener("animationend",k)}else f.style.transition="opacity 200ms cubic-bezier(0.4,0,1,1)",f.style.opacity="0",f.style.pointerEvents="none"};a._hotspotCreateElement=function(f){var c=this,h=c.isMobile&&c.isMobile(),k=!!f.content,l=f.type||f.type;if(l==="choice")return c._hotspotCreateChoiceInline(f);var p=l==="text";l=document.createElement("div");
l.className=p?"zwp-hotspot-text idle":"zwp-hotspot idle";k&&!p&&l.classList.add("has-content");l.setAttribute("data-hotspot-id",f.id);l.setAttribute("role","button");l.setAttribute("tabindex","0");l._hotspotPosition=f.position;l._hotspotData=f;var w=c._hotspotMapToPixels(f.position);w&&(l.style.left=w.x+"px",l.style.top=w.y+"px",l.style.width=w.w+"px",l.style.height=w.h+"px");w=f.style||{};var v=w.border_color||w.borderColor,E=w.border_style||w.borderStyle,D=w.border_width||w.borderWidth,B=w.background_color||
w.backgroundColor;p?(l.style.border="none",l.style.background=B||"transparent"):k?(v&&(l.style.borderColor=v),E&&(l.style.borderStyle=E),D&&(l.style.borderWidth=D+"px")):(l.style.borderColor=v||"rgba(255,255,255,0.4)",l.style.borderStyle=E||"dashed",l.style.borderWidth=(D||1)+"px");B&&(l.style.backgroundColor=B);typeof w.opacity==="number"&&(l.style.opacity=w.opacity);(v=c._hotspotGetAnimConfig(f))?l._animConfig=v:(p=w.animation||(k||p?"none":"pulse"),p!=="none"&&l.classList.add("anim-"+p));h&&!k&&
(l.style.margin="-8px",l.style.padding="8px");k&&(h=document.createElement("div"),h.className="zwp-hotspot-content",c._hotspotRenderContent(h,f.content,f),l.appendChild(h));f.hint&&(h=document.createElement("span"),h.className="zwp-hotspot-hint",h.setAttribute("role","tooltip"),h.textContent=f.hint,l.appendChild(h),l.setAttribute("aria-label",f.hint));if(f.event&&f.event.actions&&f.event.actions.length){var G=function(N){N.preventDefault();N.stopPropagation();c._hotspotExecuteAction(f)};l.addEventListener("click",
G);l.addEventListener("keydown",function(N){if(N.key==="Enter"||N.key===" ")N.preventDefault(),G(N)})}else l.style.cursor="default",typeof w.opacity==="number"&&(l.style.opacity=w.opacity),l.removeAttribute("role"),l.removeAttribute("tabindex");typeof f.z_index==="number"&&(l.style.zIndex=f.z_index);l.style.opacity="0";l.style.pointerEvents="none";return l};a._hotspotRenderContent=function(f,c,h){if(c&&c.type)switch(c.type){case "text":h=document.createElement("div");h.className="zwp-hotspot-text";
h.textContent=c.text||"";c.style&&(c=c.style,c.color&&(h.style.color=c.color),c.fontSize&&(h.style.fontSize=c.fontSize+"px"),c.fontWeight&&(h.style.fontWeight=c.fontWeight),c.background&&(h.style.background=c.background),c.textAlign&&(h.style.textAlign=c.textAlign),c.fontFamily&&(h.style.fontFamily=c.fontFamily),c.lineHeight&&(h.style.lineHeight=c.lineHeight),c.letterSpacing&&(h.style.letterSpacing=c.letterSpacing),c.textShadow&&(h.style.textShadow=c.textShadow),c.padding&&(h.style.padding=c.padding));
f.appendChild(h);break;case "image":var k=c.url||c.src;if(k){var l=document.createElement("img");l.className="zwp-hotspot-image";l.src=k;l.alt=c.alt||"";l.style.objectFit=c.keep_ratio===!1?"fill":c.fit||"cover";if(c=h&&h.style&&h.style.border_radius)l.style.borderRadius=c+"px";l.draggable=!1;l.addEventListener("error",function(){this.style.display="none";var w=document.createElement("div");w.className="zwp-hotspot-image-placeholder";w.innerHTML="&#128247;";this.parentNode.insertBefore(w,this.nextSibling)});
f.appendChild(l)}else c=document.createElement("div"),c.className="zwp-hotspot-image-placeholder",c.innerHTML="&#128247;",c.style.cssText="display:flex;align-items:center;justify-content:center;width:100%;height:100%;font-size:32px;color:#484f58;background:rgba(255,255,255,0.05);",f.appendChild(c);break;case "button":h=(h&&h.style||{}).bg_color||"#007AFF";l=c.text_color||"#ffffff";k=c.shape||"rounded";var p=c.variant||"solid";f.style.cssText="display:flex;align-items:center;justify-content:center;width:100%;height:100%;border-radius:"+
(k==="pill"?"9999px":k==="square"?"0":(c.border_radius||6)+"px")+";font-size:"+(c.font_size||14)+"px;font-weight:bold;cursor:pointer;";p==="outline"?(f.style.border="2px solid "+h,f.style.color=l,f.style.background="transparent"):p==="glass"?(f.style.border="1px solid rgba(255,255,255,0.3)",f.style.color=l,f.style.background="rgba(255,255,255,0.15)",f.style.backdropFilter="blur(8px)"):(f.style.border="none",f.style.color=l,f.style.background=h,f.style.boxShadow="0 4px 6px rgba(0,0,0,0.15),inset 0 1px 0 rgba(255,255,255,0.2)");
f.textContent=c.text||"Button";break;case "composite":if(f.classList.add(c.layout==="horizontal"?"layout-horizontal":"layout-vertical"),Array.isArray(c.items))for(l=0;l<c.items.length;l++)this._hotspotRenderContent(f,c.items[l],h)}};a._hotspotCreateChoiceInline=function(f){var c=this,h=f.content||{},k=f.style||{},l=h.options||[],p=document.createElement("div");p.className="zwp-choice-inline";p.setAttribute("data-hotspot-id",f.id);p._hotspotPosition=f.position;p._hotspotData=f;var w=c._hotspotMapToPixels(f.position);
w&&(p.style.left=w.x+"px",p.style.top=w.y+"px",p.style.width=w.w+"px",p.style.height=w.h+"px");p.style.overflow="visible";p.style.background="transparent";p.style.border="none";p.style.boxShadow="none";p.style.cursor="default";var v=document.createElement("div"),E=h.direction||"horizontal";v.style.cssText="display:flex;align-items:stretch;box-sizing:border-box;gap:"+(h.gap!=null?h.gap:1)+"em;width:100%;height:100%;padding:0.5em 0.8em;flex-direction:"+(E==="vertical"?"column":"row")+";";var D=k.bg_color||
"#007AFF",B=h.text_color||"#ffffff",G=h.variant||"solid";w=h.shape||"rounded";var N=h.font_size||14,I=w==="pill"?"9999px":w==="square"?"0":(k.border_radius||6)+"px";l.forEach(function(C){var g=document.createElement("div"),q="flex:1;display:inline-flex;align-items:center;justify-content:center;gap:0.4em;padding:0.4em 0.8em;cursor:pointer;border-radius:"+I+";font-size:"+N+"px;transition:transform 0.1s,box-shadow 0.1s;";E==="vertical"&&(q+="width:100%;");g.style.cssText=q;g.setAttribute("role","button");
g.setAttribute("tabindex","0");g.addEventListener("keydown",function(A){if(A.key==="Enter"||A.key===" ")A.preventDefault(),g.click()});G==="outline"?(g.style.border="2px solid "+D,g.style.color=B,g.style.background="transparent",g.style.boxShadow="0 2px 4px rgba(0,0,0,0.1)"):G==="glass"?(g.style.border="1px solid rgba(255,255,255,0.3)",g.style.color=B,g.style.background="rgba(255,255,255,0.15)",g.style.backdropFilter="blur(8px)",g.style.boxShadow="0 2px 4px rgba(0,0,0,0.1)"):(g.style.border="1px solid "+
D,g.style.color=B,g.style.background="linear-gradient(to bottom, "+D+" 0%, "+D+" 100%)",g.style.boxShadow="0 4px 6px rgba(0,0,0,0.15), inset 0 1px 0 rgba(255,255,255,0.2), 0 1px 3px rgba(0,0,0,0.1)");g.addEventListener("mousedown",function(){g.style.transform="translateY(2px)";g.style.boxShadow="0 1px 2px rgba(0,0,0,0.2)"});g.addEventListener("mouseup",function(){g.style.transform="";g.style.boxShadow=G==="solid"?"0 4px 6px rgba(0,0,0,0.15), inset 0 1px 0 rgba(255,255,255,0.2), 0 1px 3px rgba(0,0,0,0.1)":
"0 2px 4px rgba(0,0,0,0.1)"});g.addEventListener("mouseleave",function(){g.style.transform="";g.style.boxShadow=G==="solid"?"0 4px 6px rgba(0,0,0,0.15), inset 0 1px 0 rgba(255,255,255,0.2), 0 1px 3px rgba(0,0,0,0.1)":"0 2px 4px rgba(0,0,0,0.1)"});q=document.createElement("span");q.style.cssText="width:1em;height:1em;border-radius:50%;border:0.15em solid currentColor;flex-shrink:0;opacity:0.6;";g.appendChild(q);q=document.createElement("span");q.textContent=C.text||"";q.style.cssText="overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:500;";
g.appendChild(q);(function(A){g.addEventListener("click",function(M){M.preventDefault();M.stopPropagation();c._hotspotResolveChoice(f);A&&A.type&&c._hotspotExecuteSingleAction(A,f,0)})})(C.action);v.appendChild(g)});p.appendChild(v);typeof f.z_index==="number"&&(p.style.zIndex=f.z_index);p.style.opacity="0";p.style.pointerEvents="none";return p};a._hotspotResolveChoice=function(f){var c=this._hotspot;c&&f&&(c.completed=c.completed||{},c.completed[f.id]=!0,delete c.activeIds[f.id],(c=c.interactionLayer)&&
(f=c.querySelector('[data-hotspot-id="'+f.id+'"]'))&&f.parentNode&&f.parentNode.removeChild(f),this._hotspotActionPlayMedia())};a._hotspotExecuteAction=function(f,c){var h=this,k=c||0;c=f.event&&f.event.actions?f.event.actions:f.action?[f.action]:[];c.length&&c.forEach(function(l){l&&l.type&&h._hotspotExecuteSingleAction(l,f,k)})};a._hotspotExecuteSingleAction=function(f,c,h){var k=f.payload||{};this.isMobile&&this.isMobile()&&navigator.vibrate&&navigator.vibrate(15);typeof this._config.onHotspotClick===
"function"&&this._config.onHotspotClick.call(this,{id:c.id||"",action:f,currentTime:this.videoEl?this.videoEl.currentTime:0});switch(f.type){case "OPEN_LINK":this._hotspotActionOpenLink(k);break;case "SEEK_TIME":this._hotspotActionSeekTime(k);break;case "LOAD_ITEM":this._hotspotActionLoadItem(k);break;case "PAUSE_MEDIA":this._hotspotActionPauseMedia();break;case "PLAY_MEDIA":this._hotspotActionPlayMedia();break;case "CONTROL_NODE":this._hotspotActionControlNode(k,h);break;case "SET_VISIBILITY":this._hotspotActionSetVisibility(k);
break;case "EMIT_MESSAGE":this._hotspotActionEmitMessage(k);break;case "SUBMIT_DATA":this._hotspotActionSubmitData(k);break;case "SET_VARIABLE":this._hotspotActionSetVariable(k);break;case "ACTIVATE_EVENT":this._hotspotActionActivateEvent(k)}};a._hotspotActionOpenLink=function(f){var c=f.url;c&&rb(c)&&(f.pause!==!1&&this.videoEl&&this.videoEl.pause(),window.open(c,"_blank","noopener,noreferrer"))};a._hotspotActionSeekTime=function(f){if(this.videoEl&&typeof f.target==="number"){var c=this.videoEl.duration;
c=Math.max(0,Math.min(f.target,isFinite(c)?c:f.target));f.show_back_btn&&(this._hotspot.navigationStack.push(this.videoEl.currentTime),this._hotspotShowBackBtn());this.videoEl.currentTime=c;typeof this._config.onNavigationComplete==="function"&&this._config.onNavigationComplete.call(this,{type:"SEEK_TIME",target:c})}};a._hotspotActionLoadItem=function(f){if(f.target&&this.playlistState&&this.playlistState.data){for(var c=null,h=this.playlistState.data.groups,k=0;k<h.length;k++){for(var l=h[k].items,
p=0;p<l.length;p++)if(l[p].id===f.target){c=l[p];break}if(c)break}c?(this.playPlaylistItem&&this.playPlaylistItem(c),typeof this._config.onNavigationComplete==="function"&&this._config.onNavigationComplete.call(this,{type:"LOAD_ITEM",target:f.target})):typeof this._config.onHotspotError==="function"&&this._config.onHotspotError.call(this,{error:"ENTRY_NOT_FOUND",target:f.target})}};a._hotspotActionPlayMedia=function(){this._hotspot.isInterrupted=!1;this._hotspot.eventLayer&&(this._hotspot.eventLayer.innerHTML=
"",this._hotspot.eventLayer.classList.remove("active"),this._hotspot.eventLayer.style.background="");this._hotspot.eventQueue&&this._hotspot.eventQueue.length>0?this._hotspotProcessEventQueue():this.videoEl&&this.videoEl.paused&&this.videoEl.play()};a._hotspotActionControlNode=function(f,c){function h(){D.manualShown[w]=!0;D.activeIds[w]=!0;I||(I=p._hotspotCreateElement(G),B.appendChild(I));var C=p._hotspotMapToPixels(G.position);C&&(I.style.left=C.x+"px",I.style.top=C.y+"px",I.style.width=C.w+"px",
I.style.height=C.h+"px");(C=I._animConfig||null)?p._hotspotPlayEnter(I,C,N):(I.style.transition="opacity 300ms cubic-bezier(0.4, 0, 0.2, 1)",I.style.opacity=N,I.style.pointerEvents="auto")}function k(){delete D.manualShown[w];delete D.activeIds[w];if(I){I._autoHideTimer&&(clearTimeout(I._autoHideTimer),I._autoHideTimer=null);var C=I._animConfig||null;C?p._hotspotPlayExit(I,C):(I.style.transition="opacity 200ms cubic-bezier(0.4, 0, 1, 1)",I.style.opacity="0",I.style.pointerEvents="none")}}function l(){E>
0&&I&&(I._autoHideTimer&&clearTimeout(I._autoHideTimer),I._autoHideTimer=setTimeout(function(){I._autoHideTimer=null;k()},E*1E3))}var p=this,w=f.target_id,v=f.operation||"activate",E=f.auto_hide||0;f=c||0;if(w&&p._hotspot.data){var D=p._hotspot,B=D.interactionLayer;if(B){var G=null;for(c=0;c<D.data.nodes.length;c++)if(D.data.nodes[c].id===w){G=D.data.nodes[c];break}if(G){var N=G.style&&typeof G.style.opacity==="number"?G.style.opacity:"1",I=B.querySelector('[data-hotspot-id="'+w+'"]');c=!!D.manualShown[w];
switch(v){case "show":h();l();break;case "hide":k();break;case "toggle":c?k():(h(),l());break;case "activate":h(),l(),f>=8||G.event&&G.event.actions&&G.event.actions.length&&p._hotspotExecuteAction(G,f+1)}}}}};a._hotspotActionSetVisibility=function(f){var c=this,h=f.target_id;if(h&&c._hotspot.data){var k=c._hotspot,l=k.interactionLayer;if(l){for(var p=null,w=0;w<k.data.nodes.length;w++)if(k.data.nodes[w].id===h){p=k.data.nodes[w];break}if(p)if(w=!!k.manualShown[h],f.visible===!1&&w){if(delete k.manualShown[h],
delete k.activeIds[h],f=l.querySelector('[data-hotspot-id="'+h+'"]'))f.style.transition="opacity 200ms cubic-bezier(0.4, 0, 1, 1)",f.style.opacity="0",f.style.pointerEvents="none"}else{k.manualShown[h]=!0;k.activeIds[h]=!0;w=l.querySelector('[data-hotspot-id="'+h+'"]');w||(w=c._hotspotCreateElement(p),l.appendChild(w));var v=c._hotspotMapToPixels(p.position);v&&(w.style.left=v.x+"px",w.style.top=v.y+"px",w.style.width=v.w+"px",w.style.height=v.h+"px");v=w._animConfig||null;p=p.style&&typeof p.style.opacity===
"number"?p.style.opacity:"1";v?c._hotspotPlayEnter(w,v,p):(w.style.transition="opacity 300ms cubic-bezier(0.4, 0, 0.2, 1)",w.style.opacity=p,w.style.pointerEvents="auto");f.auto_hide&&f.auto_hide>0&&setTimeout(function(){delete k.manualShown[h];delete k.activeIds[h];var E=l.querySelector('[data-hotspot-id="'+h+'"]');if(E){var D=E._animConfig||null;D?c._hotspotPlayExit(E,D):(E.style.transition="opacity 300ms cubic-bezier(0.4, 0, 1, 1)",E.style.opacity="0",E.style.pointerEvents="none")}},f.auto_hide*
1E3)}}}};a._hotspotActionPauseMedia=function(){this.videoEl&&!this.videoEl.paused&&this.videoEl.pause()};a._hotspotActionEmitMessage=function(f){typeof this._config.onMessageEmitted==="function"&&this._config.onMessageEmitted.call(this,f);if(window.parent&&window.parent!==window){var c=this._config.trustedOrigins||[];window.parent.postMessage({type:"zwplayer:hotspot_message",payload:f},f.target_origin||(c.length>0?c[0]:null)||location.origin)}};a._hotspotActionSubmitData=function(f){var c=f.api_url,
h=f.params||{};c&&(f={method:f.method||"POST",credentials:"same-origin"},f.method!=="GET"&&(f.headers={"Content-Type":"application/json"},f.body=JSON.stringify(h)),fetch(c,f).then(function(){}).catch(function(k){}))};a._hotspotActionSetVariable=function(f){!f.key||typeof f.key!=="string"||"__proto__ constructor prototype toString valueOf hasOwnProperty".split(" ").indexOf(f.key)>=0||!/^[a-zA-Z_]\w{0,63}$/.test(f.key)||(this._hotspot.variables||(this._hotspot.variables=Object.create(null)),this._hotspot.variables[f.key]=
f.value)};a._hotspotActionActivateEvent=function(f,c){if(!((c||0)+1>8)&&(f=f.target_event_id)&&this._hotspot&&this._hotspot.data&&this._hotspot.data.nodes){c=this._hotspot.data.nodes;for(var h=null,k=0;k<c.length;k++)if(c[k].id===f){h=c[k];break}h&&(this._hotspot.isInterrupted&&h.pause_on_show?this._hotspot.eventQueue.push(h):this._hotspotTriggerEvent(h))}};a._hotspotShowBackBtn=function(){var f=this,c=f.videoWrapper||f.playerContainer;if(c){f._hotspotBackBtn&&f._hotspotBackBtn.remove();var h=f._hotspot.navigationStack[f._hotspot.navigationStack.length-
1],k=document.createElement("div");k.className="zwp-hotspot-back-btn";k.innerHTML="\u2190 "+z(K("hotspotBackTo","\u8fd4\u56de\u539f\u5904"))+" ("+m(h)+")";k.setAttribute("role","button");k.setAttribute("tabindex","0");k.addEventListener("click",function(l){l.stopPropagation();l=f._hotspot.navigationStack.pop();typeof l==="number"&&f.videoEl&&(f.videoEl.currentTime=l);f._hotspot.navigationStack.length===0?(k.remove(),f._hotspotBackBtn=null):(l=f._hotspot.navigationStack[f._hotspot.navigationStack.length-
1],k.innerHTML="\u2190 "+z(K("hotspotBackTo","\u8fd4\u56de\u539f\u5904"))+" ("+m(l)+")")});c.appendChild(k);f._hotspotBackBtn=k;clearTimeout(f._hotspotBackBtnTimer);f._hotspotBackBtnTimer=setTimeout(function(){k&&k.classList.add("faded")},5E3);k.addEventListener("mouseenter",function(){k.classList.remove("faded");clearTimeout(f._hotspotBackBtnTimer)});k.addEventListener("mouseleave",function(){f._hotspotBackBtnTimer=setTimeout(function(){k&&k.classList.add("faded")},3E3)})}};a._hotspotOnTimeUpdate=
function(f){var c=this._hotspot;if(c.data&&c.data.nodes){if(c.isInterrupted&&c.lastTime!==void 0&&f<c.lastTime)for(var h=c.data.nodes,k=0;k<h.length;k++){var l=h[k];if(l.type==="countdown"&&l.time_range[0]>=f&&!c.completed[l.id]&&c._countdownCleanups&&c._countdownCleanups[l.id]){try{c._countdownCleanups[l.id]()}catch(G){}delete c._countdownCleanups[l.id];c.triggeredEvents[l.id]=!1;l.pause_on_show&&(c.isInterrupted=!1)}}if(!c.isInterrupted&&c.userEnabled&&(h=c.interactionLayer)){k=c.data.nodes;typeof c.lastTime===
"undefined"&&(c.lastTime=0);c.completed||(c.completed={});l=f-c.lastTime>1;var p=f<c.lastTime;if(p)for(var w=0;w<k.length;w++){var v=k[w];(v.type==="quiz"||v.type==="form"||v.type==="vote"||v.type==="card"||v.type==="webview"||v.type==="map"||v.type==="countdown")&&v.time_range[0]>=f&&!c.completed[v.id]&&(c.triggeredEvents[v.id]=!1,v.type==="countdown"&&c._countdownCleanups&&c._countdownCleanups[v.id]&&(c._countdownCleanups[v.id](),delete c._countdownCleanups[v.id]));if(v.type==="speed_controller"&&
v.time_range[0]>=f)for(var E=c._speedControllerStack.length-1;E>=0;E--)if(c._speedControllerStack[E].id===v.id){v=c._speedControllerStack.splice(E,1)[0];v=c._speedControllerStack.length>0?c._speedControllerStack[c._speedControllerStack.length-1].playbackRate:v.restoreRate===-1?v.previousRate:v.restoreRate===0?this.videoEl?this.videoEl.playbackRate:1:v.restoreRate;this.videoEl&&(this.videoEl.playbackRate=v);e(this,v);break}}if(l){w=null;for(v=0;v<k.length;v++)if(E=k[v],E.mandatory&&!E.hidden&&!c.completed[E.id]){var D=
E.time_range[0];D>c.lastTime&&D<=f&&(!w||D<w.time_range[0])&&(w=E)}if(w){this.videoEl&&(this.videoEl.currentTime=w.time_range[0]);c.lastTime=w.time_range[0];if(["hotspot","text","image","button","choice"].indexOf(w.type)>=0){c.activeIds[w.id]=!0;if(h=c.interactionLayer)f=h.querySelector("[data-hotspot-id='"+w.id+"']"),f||(f=this._hotspotCreateElement(w),h.appendChild(f)),f.style.opacity=w.style&&typeof w.style.opacity==="number"?w.style.opacity:"1",f.style.pointerEvents="auto";w.type==="choice"&&
w.pause_on_show&&(this._hotspot.isInterrupted=!0,this.videoEl&&this.videoEl.pause())}else c.triggeredEvents[w.id]=!0,this._hotspotTriggerEvent(w);return}}for(w=0;w<k.length;w++)if(v=k[w],E=f>=v.time_range[0]&&f<=v.time_range[1],D=!!c.activeIds[v.id],v.hidden&&!c.manualShown[v.id])D&&(delete c.activeIds[v.id],v=h.querySelector('[data-hotspot-id="'+v.id+'"]'))&&((E=v._animConfig||null)?this._hotspotPlayExit(v,E):(v.style.transition="opacity 200ms cubic-bezier(0.4, 0, 1, 1)",v.style.opacity="0",v.style.pointerEvents=
"none"));else if(E&&!D)if(c.activeIds[v.id]=!0,v.type==="speed_controller")E=v.content||{},D=Math.max(.1,Math.min(16,E.playback_rate||2)),c._speedControllerStack.push({id:v.id,previousRate:this.videoEl?this.videoEl.playbackRate:1,playbackRate:D,restoreRate:E.restore_rate!==void 0?E.restore_rate:-1}),this.videoEl&&(this.videoEl.playbackRate=D),e(this,D);else if(v.type==="hotspot"||v.type==="text"||v.type==="image"||v.type==="button"||v.type==="choice"){E=h.querySelector('[data-hotspot-id="'+v.id+'"]');
E||(E=this._hotspotCreateElement(v),h.appendChild(E));D=E._animConfig||null;var B=v.style&&typeof v.style.opacity==="number"?v.style.opacity:"1";l&&D?(E.style.transition="none",E.style.opacity=B,E.style.pointerEvents="auto",E.className=E.className.replace(/\bzwp-anim-enter-\S+|\bzwp-anim-exit-\S+|\bzwp-animating\b/g,""),this._hotspotStartEmphasis(E,D)):D?this._hotspotPlayEnter(E,D,B):(E.style.transition="opacity 300ms cubic-bezier(0.4, 0, 0.2, 1)",E.style.opacity=B,E.style.pointerEvents="auto");v.type===
"choice"&&v.pause_on_show&&(this._hotspot.isInterrupted=!0,this.videoEl&&this.videoEl.pause())}else v.type!=="quiz"&&v.type!=="form"&&v.type!=="vote"&&v.type!=="card"&&v.type!=="webview"&&v.type!=="map"&&v.type!=="countdown"||c.triggeredEvents[v.id]||(c.triggeredEvents[v.id]=!0,v.pause_on_show&&c.isInterrupted?c.eventQueue.push(v):this._hotspotTriggerEvent(v));else if(!E&&D)if(delete c.activeIds[v.id],delete c.manualShown[v.id],v.type==="speed_controller")for(E=c._speedControllerStack.length-1;E>=
0;E--){if(c._speedControllerStack[E].id===v.id){v=c._speedControllerStack.splice(E,1)[0];v=v.restoreRate===-1?c._speedControllerStack.length>0?c._speedControllerStack[c._speedControllerStack.length-1].playbackRate:v.previousRate:v.restoreRate===0?this.videoEl?this.videoEl.playbackRate:1:v.restoreRate;this.videoEl&&(this.videoEl.playbackRate=v);e(this,v);break}}else if(v.type==="hotspot"||v.type==="text"||v.type==="image"||v.type==="button"||v.type==="choice")if(v=h.querySelector('[data-hotspot-id="'+
v.id+'"]'))E=v._animConfig||null,p&&E?(v.classList.remove("idle"),v.className=v.className.replace(/\bzwp-anim-emphasis-\S+|\bzwp-animating\b/g,""),v.style.transition="none",v.style.animation="",v.style.opacity="0",v.style.pointerEvents="none"):E?this._hotspotPlayExit(v,E):(v.style.transition="opacity 200ms cubic-bezier(0.4, 0, 1, 1)",v.style.opacity="0",v.style.pointerEvents="none");c.lastTime=f}}};a._hotspotTriggerEvent=function(f){typeof this._config.onEventTrigger==="function"&&this._config.onEventTrigger.call(this,
{id:f.id,type:f.type,time:f.time});f.pause_on_show&&(this._hotspot.isInterrupted=!0,this.videoEl&&this.videoEl.pause());switch(f.type){case "quiz":this._hotspotRenderQuiz(f);break;case "vote":this._hotspotRenderVote(f);break;case "card":this._hotspotRenderInfoCard(f);break;case "form":this._hotspotRenderInputForm(f);break;case "webview":this._hotspotRenderWebView(f);break;case "map":this._hotspotRenderMap(f);break;case "countdown":this._hotspotRenderCountdown(f)}};a._hotspotProcessEventQueue=function(){var f=
this._hotspot;f.eventQueue.length!==0&&(f=f.eventQueue.shift(),this._hotspotTriggerEvent(f))};a._hotspotRenderQuiz=function(f){function c(H,V){H=setTimeout(function(){if(V){var P=typeof p.fallback_time==="number"?p.fallback_time:0;l.videoEl&&(l.videoEl.currentTime=P,l.videoEl.play());l._hotspotActionPlayMedia()}else p.on_complete&&p.on_complete.type?l._hotspotExecuteAction({action:p.on_complete}):l._hotspotActionPlayMedia()},H||1500);y(l,H)}function h(H,V){T.style.display="block";if(H){l._hotspot.completed||
(l._hotspot.completed={});l._hotspot.completed[f.id]=!0;T.textContent=p.feedback&&p.feedback.correct||K("annotCorrect");T.className="zwp-choice-board-feedback correct";for(H=0;H<J.length;H++)J[H].disabled=!0;b&&(b.disabled=!0);c(1500,!1)}else if(T.textContent=p.feedback&&p.feedback.wrong||K("annotWrong"),T.className="zwp-choice-board-feedback wrong",l.isMobile&&l.isMobile()&&navigator.vibrate&&navigator.vibrate([30,50,30]),V){for(H=0;H<J.length;H++)J[H].disabled=!0,J[H].classList.remove("wrong","correct");
b&&(b.disabled=!0);T.textContent=K("annotAttemptsExceeded");c(2E3,!0)}else H=setTimeout(function(){for(var P=0;P<J.length;P++)J[P].classList.remove("wrong","correct","selected"),J[P].disabled=!1;B&&(S={});b&&(b.disabled=!0,b.textContent=K("annotConfirmSubmit"));T.style.display="none"},1500),y(l,H)}function k(H){for(var V=0;V<J.length;V++)J[V].disabled=!0;b&&(b.disabled=!0);l._hotspot.completed||(l._hotspot.completed={});l._hotspot.completed[f.id]=!0;p.submit_url&&fetch(p.submit_url,{method:"POST",
credentials:"same-origin",headers:{"Content-Type":"application/json"},body:JSON.stringify(d(l,f.id,"quiz",{answers:H.map(function(P){return p.options[P].value||p.options[P].text})}))});p.show_toast!==!1&&l.toast(K("annotSubmitted"),2E3,!1,!0);c(0,!1)}var l=this,p=f.content||{},w=l._hotspot.eventLayer;if(w&&Array.isArray(p.options)&&p.options.length!==0){w.querySelector(".zwp-quiz-panel")&&(w.innerHTML="",w.classList.remove("active"),w.style.background="");var v=0,E=p.max_attempts||0,D=p.is_evaluative!==
!1,B=p.allow_multiple===!0,G=p.prompt||p.question||"",N=document.createElement("div");N.className="zwp-event-panel zwp-quiz-panel";N.setAttribute("role","dialog");N.setAttribute("aria-modal","true");N.setAttribute("aria-label",p.title||G||"");var I=f.style||{},C=p.max_width||I.max_width,g=p.max_height||I.max_height;C&&(N.style.maxWidth=C+"px");g&&(N.style.maxHeight=g+"px");I.bg_color&&(N.style.background=I.bg_color);I.border_radius!=null&&(N.style.borderRadius=I.border_radius+"px");g&&(N.style.overflowY=
"auto",N.style.overflowX="hidden");C="";g=f.type;var q={quiz:K("annotQuiz"),form:K("annotForm"),vote:K("annotVote"),choice:K("annotChoice")},A={quiz:"&#9998;",form:"&#9997;",vote:"&#9745;",choice:"&#128256;"};if(q[g]){var M=p.dismissible===!0?!0:p.dismissible===!1?!1:!f.mandatory;C=C+'<div class="dialog-preview-header"><span class="dialog-preview-badge"><span class="dialog-preview-badge-icon">'+(A[g]+"</span> "+Ea(p.title||q[g])+"</span>");M&&(C+='<span class="dialog-preview-close">&times;</span>');
C+="</div>"}C+='<div class="zwp-choice-board-prompt">'+Ea(G)+'<span class="dialog-select-mode">'+(B?K("annotMulti"):K("annotSingle"))+"</span></div>";C+='<div class="zwp-choice-board-options '+(B?"is-multiple":"is-single")+'">';for(G=0;G<p.options.length;G++)g=String.fromCharCode(65+G),C+='<button class="zwp-choice-board-option" data-index="'+G+'" data-correct="'+(D&&p.options[G].is_correct?"true":"false")+'">',C+='<span class="zwp-choice-board-letter">'+g+".</span>",C+='<span class="zwp-choice-board-text">'+
Ea(p.options[G].text)+"</span>",C+="</button>";C+="</div>";if(B||D)C=C+'<div class="zwp-choice-board-submit-wrap"><button class="zwp-choice-board-submit" disabled>'+((D?K("annotConfirmSubmit"):K("annotSubmit"))+"</button>"),C+="</div>";N.innerHTML=C+'<div class="zwp-choice-board-feedback" style="display:none;" aria-live="polite"></div>';(G=N.querySelector(".dialog-preview-close"))&&G.addEventListener("click",function(){l._hotspot.completed&&(l._hotspot.completed[f.id]=!0);w.innerHTML="";w.classList.remove("active");
w.style.background="";f.pause_on_show&&l._hotspotActionPlayMedia()});var J=N.querySelectorAll(".zwp-choice-board-option"),T=N.querySelector(".zwp-choice-board-feedback"),b=B||D?N.querySelector(".zwp-choice-board-submit"):null,S={};for(G=0;G<J.length;G++)J[G].addEventListener("click",function(){var H=parseInt(this.getAttribute("data-index"),10);if(D||B)if(B)this.classList.contains("selected")?(this.classList.remove("selected"),delete S[H]):(this.classList.add("selected"),S[H]=!0),b&&(b.disabled=Object.keys(S).length===
0);else if(b){for(var V=0;V<J.length;V++)J[V].classList.remove("selected");this.classList.add("selected");S={};S[H]=!0;b.disabled=!1}else H=this.getAttribute("data-correct")==="true",v++,H?(this.classList.add("correct"),h(!0,!1)):(this.classList.add("wrong"),this.disabled=!0,h(!1,E>0&&v>=E));else this.classList.add("selected"),(V=p.options[H].action)&&V.type&&(l._hotspotExecuteAction({action:V}),p.submit_url||(l._hotspot.isInterrupted=!1,N.parentNode&&N.parentNode.removeChild(N),l._hotspot.eventLayer&&
(l._hotspot.eventLayer.innerHTML="",l._hotspot.eventLayer.classList.remove("active"),l._hotspot.eventLayer.style.background=""),l._hotspot.completed[f.id]=!0,l.videoEl&&l.videoEl.paused&&l.videoEl.play())),p.submit_url&&k([H])});b&&b.addEventListener("click",function(){var H=Object.keys(S).map(Number);if(D){v++;for(var V=0;V<J.length;V++)J[V].disabled=!0;V=b.disabled=!0;for(var P=0;P<J.length;P++){var U=J[P].getAttribute("data-correct")==="true",W=!!S[P];W&&!U?V=!1:!W&&U&&(V=!1)}if(V)for(P=0;P<J.length;P++)U=
J[P],S[P]&&U.classList.add("correct");P=E>0&&v>=E;p.submit_url&&fetch(p.submit_url,{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json"},body:JSON.stringify(d(l,f.id,"quiz",{answers:H.map(function(ca){return p.options[ca].value||p.options[ca].text}),correct:V,attempts:v}))});p.show_toast!==!1&&l.toast(K("annotSubmitted"),2E3,!1,!0);h(V,P)}else k(H)});w.innerHTML="";w.appendChild(N);w.classList.add("active");I.opacity!=null&&(w.style.background="rgba(0,0,0,"+I.opacity+
")");J.length>0&&J[0].focus()}};a._hotspotRenderVote=function(f){function c(C){for(var g=0;g<G.length;g++)G[g].disabled=!0;N.disabled=!0;k.submit_url&&fetch(k.submit_url,{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json"},body:JSON.stringify(d(h,f.id,"vote",{options:C.map(function(q){return k.options[q].text||""})}))});k.show_toast!==!1&&h.toast(K("annotVoteThanks"),2E3,!1,!0);h._hotspot.completed||(h._hotspot.completed={});h._hotspot.completed[f.id]=!0;w.parentNode&&
w.parentNode.removeChild(w);l.innerHTML="";l.classList.remove("active");l.style.background="";h.videoEl&&h.videoEl.paused&&h.videoEl.play()}var h=this,k=f.content||{},l=h._hotspot.eventLayer;if(l&&Array.isArray(k.options)&&k.options.length!==0){l.querySelector(".zwp-vote-panel")&&(l.innerHTML="",l.classList.remove("active"),l.style.background="");var p=k.allow_multiple===!0,w=document.createElement("div");w.className="zwp-event-panel zwp-vote-panel";w.setAttribute("role","dialog");w.setAttribute("aria-modal",
"true");w.setAttribute("aria-label",k.title||K("annotVote"));var v=f.style||{},E=k.max_width||v.max_width,D=k.max_height||v.max_height;E&&(w.style.maxWidth=E+"px");D&&(w.style.maxHeight=D+"px",w.style.overflowY="auto",w.style.overflowX="hidden");v.bg_color&&(w.style.background=v.bg_color);v.border_radius!=null&&(w.style.borderRadius=v.border_radius+"px");D=k.dismissible===!0?!0:k.dismissible===!1?!1:!f.mandatory;E='<div class="dialog-preview-header"><span class="dialog-preview-badge"><span class="dialog-preview-badge-icon">&#9745;</span> '+
(z(k.title||K("annotVote"))+"</span>");D&&(E+='<span class="dialog-preview-close">&times;</span>');E=E+'</div><div class="zwp-choice-board-prompt">'+(Ea(k.desc||"")+'<span class="dialog-select-mode">'+(p?K("annotMulti"):K("annotSingle"))+"</span></div>");E+='<div class="zwp-choice-board-options '+(p?"is-multiple":"is-single")+'">';for(D=0;D<k.options.length;D++){var B=String.fromCharCode(65+D);E+='<button class="zwp-choice-board-option" data-index="'+D+'">';E+='<span class="zwp-choice-board-letter">'+
B+".</span>";E+='<span class="zwp-choice-board-text">'+Ea(k.options[D].text)+"</span>";E+="</button>"}E=E+'</div><div class="zwp-choice-board-submit-wrap"><button class="zwp-choice-board-submit"'+((p?" disabled":"")+'>\u6295\u7968</button></div><div class="zwp-choice-board-feedback" style="display:none;" aria-live="polite"></div>');w.innerHTML=E;var G=w.querySelectorAll(".zwp-choice-board-option");w.querySelector(".zwp-choice-board-feedback");var N=w.querySelector(".zwp-choice-board-submit");E=w.querySelector(".dialog-preview-close");
var I={};E&&E.addEventListener("click",function(){h._hotspot.completed&&(h._hotspot.completed[f.id]=!0);w.parentNode&&w.parentNode.removeChild(w);l.innerHTML="";l.classList.remove("active");l.style.background="";h._hotspot.isInterrupted=!1;h.videoEl&&h.videoEl.paused&&h.videoEl.play()});for(E=0;E<G.length;E++)G[E].addEventListener("click",function(){var C=parseInt(this.getAttribute("data-index"),10);if(p)this.classList.contains("selected")?(this.classList.remove("selected"),delete I[C]):(this.classList.add("selected"),
I[C]=!0),N.disabled=Object.keys(I).length===0;else{for(var g=0;g<G.length;g++)G[g].classList.remove("selected");this.classList.add("selected");I={};I[C]=!0;N.disabled=!1}});N.addEventListener("click",function(){var C=Object.keys(I).map(Number);C.length!==0&&c(C)});l.innerHTML="";l.appendChild(w);l.classList.add("active");v.opacity!=null&&(l.style.background="rgba(0,0,0,"+v.opacity+")");G.length>0&&G[0].focus()}};a._hotspotRenderInfoCard=function(f){var c=this,h=f.content||{},k=c._hotspot.eventLayer;
if(k){var l=document.createElement("div");l.className="zwp-event-panel zwp-info-card-panel";var p=f.style||{},w=h.max_width||p.max_width,v=h.max_height||p.max_height;w&&(l.style.maxWidth=w+"px");v&&(l.style.maxHeight=v+"px",l.style.overflowY="auto");p.bg_color&&(l.style.background=p.bg_color);p.border_radius!=null&&(l.style.borderRadius=p.border_radius+"px");w=h.dismissible===!0?!0:h.dismissible===!1?!1:!f.mandatory;v='<div class="dialog-preview-header"><span class="dialog-preview-badge"><span class="dialog-preview-badge-icon">&#128196;</span> '+
(z(h.title||K("annotCard"))+"</span>");w&&(v+='<span class="dialog-preview-close">&times;</span>');v=v+'</div><div class="dialog-preview-prompt">'+(Ea(h.body)+"</div>");v+='<span class="dialog-preview-btn-card" style="cursor:pointer">'+z(h.button_text||K("annotOK"))+"</span>";l.innerHTML=v;(w=l.querySelector(".dialog-preview-close"))&&w.addEventListener("click",function(){c._hotspot.completed&&(c._hotspot.completed[f.id]=!0);k.innerHTML="";k.classList.remove("active");k.style.background="";f.pause_on_show&&
c._hotspotActionPlayMedia()});var E=l.querySelector(".dialog-preview-btn-card");E&&E.addEventListener("click",function(){E.disabled=!0;c._hotspot.completed&&(c._hotspot.completed[f.id]=!0);h.submit_url&&fetch(h.submit_url,{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json"},body:JSON.stringify(d(c,f.id,"card",{action:"confirmed"}))});h.show_toast!==!1&&c.toast(K("annotCardConfirmed"),2E3,!1,!0);k.innerHTML="";k.classList.remove("active");k.style.background="";f.pause_on_show&&
c._hotspotActionPlayMedia()});k.innerHTML="";k.appendChild(l);k.classList.add("active");p.opacity!=null&&(k.style.background="rgba(0,0,0,"+p.opacity+")");h.auto_dismiss>0&&(p=setTimeout(function(){l.parentNode&&(h.submit_url&&fetch(h.submit_url,{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json"},body:JSON.stringify(d(c,f.id,"card",{action:"auto_dismissed"}))}),k.innerHTML="",k.classList.remove("active"),k.style.background="",f.pause_on_show&&c._hotspotActionPlayMedia())},
h.auto_dismiss*1E3),y(c,p))}};a._hotspotRenderInputForm=function(f){var c=this,h=f.content||{},k=c._hotspot.eventLayer;if(k){var l=document.createElement("div");l.className="zwp-event-panel zwp-input-form-panel";l.setAttribute("role","dialog");l.setAttribute("aria-modal","true");var p=f.style||{},w=h.max_width||p.max_width,v=h.max_height||p.max_height;w&&(l.style.maxWidth=w+"px");v&&(l.style.maxHeight=v+"px",l.style.overflowY="auto");p.bg_color&&(l.style.background=p.bg_color);p.border_radius!=null&&
(l.style.borderRadius=p.border_radius+"px");w=h.dismissible===!0?!0:h.dismissible===!1?!1:!f.mandatory;v='<div class="dialog-preview-header"><span class="dialog-preview-badge"><span class="dialog-preview-badge-icon">&#9997;</span> '+(z(h.title||K("annotForm"))+"</span>");w&&(v+='<span class="dialog-preview-close">&times;</span>');l.innerHTML=v+"</div>";h.desc&&(w=document.createElement("div"),w.className="dialog-preview-prompt",w.style.marginBottom="10px",w.textContent=h.desc,l.appendChild(w));h.image&&
(w=document.createElement("div"),w.className="zwp-popup-image-wrap",v=document.createElement("img"),v.className="zwp-popup-image",v.src=h.image,w.appendChild(v),l.appendChild(w));w=document.createElement("div");w.className="zwp-form-container";v=h.fields||[];for(var E={},D=0;D<v.length;D++){var B=v[D],G=document.createElement("div");G.className="zwp-form-field";B.required&&G.classList.add("is-required");var N=document.createElement("label");N.className="zwp-form-label";B.required&&N.classList.add("required");
N.textContent=B.label||B.name;G.appendChild(N);B.type==="textarea"?(N=document.createElement("textarea"),N.className="zwp-form-textarea"):(N=document.createElement("input"),N.className="zwp-form-input",N.type="text email tel number url password date".split(" ").indexOf(B.type)>=0?B.type:"text");N.setAttribute("data-name",B.name);N.placeholder=B.placeholder||"";E[B.name]={el:N,config:B,wrap:G};N.addEventListener("input",function(){this.classList.remove("error");var g=this.parentElement;g&&g.classList.remove("has-error")});
G.appendChild(N);B=document.createElement("div");B.className="zwp-form-error-msg";B.textContent=K("annotFieldRequired");G.appendChild(B);w.appendChild(G)}l.appendChild(w);w=document.createElement("div");w.style.marginTop="20px";w.style.textAlign="right";var I=document.createElement("button");I.className="zwp-popup-btn";I.textContent=K("annotSubmit");w.appendChild(I);l.appendChild(w);var C=!1;I.addEventListener("click",function(){if(!C){var g=!0,q={},A;for(A in E){var M=E[A],J=M.el.value.trim();M.config.required&&
!J&&(M.el.classList.add("error"),M.wrap.classList.add("has-error"),g=!1);q[A]=J}g&&(C=!0,I.disabled=!0,c._hotspot.completed||(c._hotspot.completed={}),c._hotspot.completed[f.id]=!0,h.submit_url&&fetch(h.submit_url,{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json"},body:JSON.stringify(d(c,f.id,"form",q))}),h.show_toast!==!1&&c.toast(K("annotFormSubmitted"),2E3,!1,!0),k.innerHTML="",k.classList.remove("active"),k.style.background="",c._hotspot.isInterrupted=!1,h.on_complete&&
h.on_complete.type?c._hotspotExecuteAction({action:h.on_complete}):c._hotspotExecuteAction({action:{type:"PLAY_MEDIA"}}))}});k.innerHTML="";k.appendChild(l);k.classList.add("active");p.opacity!=null&&(k.style.background="rgba(0,0,0,"+p.opacity+")");(l=l.querySelector(".dialog-preview-close"))&&l.addEventListener("click",function(g){g.stopPropagation();c._hotspot.completed&&(c._hotspot.completed[f.id]=!0);k.innerHTML="";k.classList.remove("active");k.style.background="";c._hotspot.isInterrupted=!1;
h.on_complete&&h.on_complete.type?c._hotspotExecuteAction({action:h.on_complete}):c._hotspotExecuteAction({action:{type:"PLAY_MEDIA"}})})}};a._hotspotRenderWebView=function(f){var c=this,h=f.content||{},k=c._hotspot.eventLayer;if(k&&h.url){var l=h.url||"";if(rb(l)){c.videoEl&&!c.videoEl.paused&&c.videoEl.pause();var p=document.createElement("div");p.className="zwp-event-panel zwp-webview-panel";var w=f.position||{};w.w&&(p.style.width=w.w+"%",p.style.maxWidth="none");w.h&&(p.style.height=w.h+"%",
p.style.maxHeight="none");w=document.createElement("div");w.className="zwp-webview-toolbar";var v=document.createElement("span");v.className="zwp-webview-title";v.textContent=h.title||h.url;w.appendChild(v);var E=document.createElement("button");E.className="zwp-webview-maximize";E.innerHTML="&#9723;";E.setAttribute("aria-label",K("annotMaximize"));E.addEventListener("click",function(D){D.stopPropagation();p.classList.contains("zwp-webview-maximized")?(p.classList.remove("zwp-webview-maximized"),
E.innerHTML="&#9723;"):(p.classList.add("zwp-webview-maximized"),E.innerHTML="&#9724;")});w.appendChild(E);if(h.dismissible===!0||(h.dismissible===!1?0:!f.mandatory))v=document.createElement("button"),v.className="zwp-webview-close",v.textContent="\u00d7",v.setAttribute("aria-label",K("annotClose")),v.addEventListener("click",function(D){D.stopPropagation();c._hotspot.completed&&(c._hotspot.completed[f.id]=!0);k.innerHTML="";k.classList.remove("active");c._hotspot.isInterrupted=!1;c.videoEl&&c.videoEl.paused&&
c.videoEl.play()}),w.appendChild(v);p.appendChild(w);w=document.createElement("iframe");w.className="zwp-webview-iframe";w.src=l;w.setAttribute("sandbox","allow-scripts allow-forms allow-popups allow-popups-to-escape-sandbox");w.setAttribute("referrerpolicy","no-referrer");w.setAttribute("loading","lazy");w.setAttribute("allow","autoplay; fullscreen");h.width&&(w.style.width=h.width);h.height&&(w.style.height=h.height);p.appendChild(w);k.innerHTML="";k.appendChild(p);k.classList.add("active")}else f.pause_on_show&&
c._hotspot.isInterrupted&&(c._hotspot.isInterrupted=!1,c.videoEl&&c.videoEl.paused&&c.videoEl.play())}};a._hotspotRenderMap=function(f){var c=this,h=f.content||{},k=c._hotspot.eventLayer;if(k&&h.lat!=null&&h.lng!=null){var l=f.data||{},p=h.deep_link||l.deep_link||l.url||h.url||"";f.pause_on_show&&c.videoEl&&!c.videoEl.paused&&c.videoEl.pause();var w=document.createElement("div");w.className="zwp-event-panel zwp-map-panel";l=f.position||{};l.w&&(w.style.width=l.w+"%",w.style.maxWidth="none");l.h&&
(w.style.height=l.h+"%",w.style.maxHeight="none");l=document.createElement("div");l.className="zwp-map-toolbar";var v=document.createElement("span");v.className="zwp-map-title";var E=h.provider==="amap"?K("annotMapAmap"):K("annotMapBaidu");v.textContent=h.title||E;l.appendChild(v);v=document.createElement("span");v.className="zwp-map-actions";E=document.createElement("button");E.className="zwp-map-btn zwp-map-open-app";E.innerHTML="&#128197;";E.title=K("annotOpenInMap");E.addEventListener("click",
function(C){C.stopPropagation();rb(p)&&window.open(p,"_blank","noopener,noreferrer")});v.appendChild(E);var D=document.createElement("button");D.className="zwp-map-btn zwp-map-share";D.innerHTML="&#128279;";D.title=K("annotCopyLink");D.addEventListener("click",function(C){C.stopPropagation();navigator.clipboard&&navigator.clipboard.writeText&&navigator.clipboard.writeText(p).then(function(){D.innerHTML="&#10003;";setTimeout(function(){D.innerHTML="&#128279;"},1500)})});v.appendChild(D);var B=document.createElement("button");
B.className="zwp-map-btn zwp-map-maximize";B.innerHTML="&#9723;";B.setAttribute("aria-label",K("annotMaximize"));B.addEventListener("click",function(C){C.stopPropagation();w.classList.contains("zwp-map-maximized")?(w.classList.remove("zwp-map-maximized"),B.innerHTML="&#9723;"):(w.classList.add("zwp-map-maximized"),B.innerHTML="&#9724;")});v.appendChild(B);if(h.dismissible===!0||(h.dismissible===!1?0:!f.mandatory))E=document.createElement("button"),E.className="zwp-map-btn zwp-map-close",E.textContent=
"\u00d7",E.setAttribute("aria-label",K("annotClose")),E.addEventListener("click",function(C){C.stopPropagation();c._hotspot.completed&&(c._hotspot.completed[f.id]=!0);k.innerHTML="";k.classList.remove("active");c._hotspot.isInterrupted=!1;c.videoEl&&c.videoEl.paused&&c.videoEl.play()}),v.appendChild(E);l.appendChild(v);w.appendChild(l);h.address&&(l=document.createElement("div"),l.className="zwp-map-address",l.textContent=h.address,w.appendChild(l));var G=document.createElement("div");G.className=
"zwp-map-container";G.id="zwp-map-"+(f.id||Date.now());w.appendChild(G);k.innerHTML="";k.appendChild(w);k.classList.add("active");if(window._zwpLeafletLoaded)if(window.L)r(G.id,h);else var N=0,I=setInterval(function(){window.L?(clearInterval(I),r(G.id,h)):++N>=100&&(clearInterval(I),window._zwpLeafletLoaded=!1)},100);else window._zwpLeafletLoaded=!0,l=document.createElement("link"),l.rel="stylesheet",l.href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css",document.head.appendChild(l),l=document.createElement("script"),
l.src="https://unpkg.com/leaflet@1.9.4/dist/leaflet.js",l.onload=function(){r(G.id,h)},l.onerror=function(){window._zwpLeafletLoaded=!1},document.head.appendChild(l)}};a._hotspotRenderCountdown=function(f){function c(W){W=Math.ceil(W*10)/10;if(W!==b){if(W>=60){var ca=W%60;ca=Math.floor(W/60)+":"+(ca<10?"0":"")+ca.toFixed(1)}else ca=W.toFixed(1);J.textContent=ca;b=W}}function h(){if(!S){var W=(performance.now()-U)/1E3;W=B-W;W<=0?(J.textContent="0.0",S=!0,p()):(c(W),T=requestAnimationFrame(h))}}function k(){if(!S)if(v.videoEl)if(v.videoEl.paused)T=
requestAnimationFrame(k);else{var W=B-(v.videoEl.currentTime-V);W<=0?(J.textContent="0.0",S=!0,p()):(c(W),T=requestAnimationFrame(k))}else T=requestAnimationFrame(k)}function l(){H||(H=!0,A?(V=v.videoEl?v.videoEl.currentTime:0,T=requestAnimationFrame(k)):(U=performance.now(),T=requestAnimationFrame(h)))}function p(){M.classList.add("zwp-countdown-fadeout");w();var W=setTimeout(function(){M.parentNode&&M.parentNode.removeChild(M);g&&(v._hotspot.isInterrupted=!1)},300);y(v,W)}function w(){var W=E.on_expire;
if(W&&W.type)switch(W.type){case "PLAY_MEDIA":v._hotspot.isInterrupted=!1;v.videoEl&&v.videoEl.paused&&v.videoEl.play();break;case "PAUSE_MEDIA":v.videoEl&&v.videoEl.pause();break;case "JUMP_TO":v.videoEl&&W.payload&&W.payload.target&&(v.videoEl.currentTime=parseFloat(W.payload.target)||0);break;case "OPEN_URL":W.payload&&W.payload.target&&(W=W.payload.target,rb(W)&&window.open(W,"_blank","noopener,noreferrer"))}}var v=this,E=f.content||{},D=v._hotspot.interactionLayer;if(D){var B=E.countdown||10,
G=E.font_size||48,N=E.text_color||"#ffffff",I=f.style&&f.style.bg_color||"rgba(0,0,0,0.6)",C=E.description||"",g=f.pause_on_show!==!1,q=E.pause_during!==!1,A=!q;q=g&&!q;g&&v.videoEl&&!v.videoEl.paused&&v.videoEl.pause();var M=document.createElement("div");M.className="zwp-countdown-panel";M.style.background=I;f.style&&typeof f.style.opacity==="number"&&(M.style.opacity=f.style.opacity);I=f.position||{};I.x!=null&&(M.style.left=I.x+"%");I.y!=null&&(M.style.top=I.y+"%");I.w&&(M.style.width=I.w+"%");
I.h&&(M.style.height=I.h+"%");C&&(I=document.createElement("div"),I.className="zwp-countdown-desc",I.textContent=C,M.appendChild(I));var J=document.createElement("div");J.className="zwp-countdown-number";J.style.color=N;J.style.fontSize=G+"px";M.appendChild(J);(G=D.querySelector(".zwp-countdown-panel"))&&G.remove();D.appendChild(M);var T=null,b=-1,S=!1,H=!1,V=0,P=null;c(B);var U=0;q?v.videoEl&&(P=function(){l();v.videoEl.removeEventListener("play",P);P=null},v.videoEl.addEventListener("play",P)):
l();v._hotspot._countdownCleanups||(v._hotspot._countdownCleanups={});v._hotspot._countdownCleanups[f.id]=function(){S=!0;T&&cancelAnimationFrame(T);M.parentNode&&M.parentNode.removeChild(M);P&&v.videoEl&&(v.videoEl.removeEventListener("play",P),P=null)}}};a.getActiveHotspots=function(){if(!this._hotspot.data)return[];for(var f=[],c=this._hotspot.data.nodes,h=0;h<c.length;h++)this._hotspot.activeIds[c[h].id]&&f.push(c[h]);return f};a.triggerHotspot=function(f){if(this._hotspot.data)for(var c=0;c<
this._hotspot.data.nodes.length;c++)if(this._hotspot.data.nodes[c].id===f){this._hotspotExecuteAction(this._hotspot.data.nodes[c]);break}};a.getNavigationStack=function(){return this._hotspot.navigationStack.slice()};a.getVariable=function(f){var c=this._hotspot.variables;if(c&&f)return c[f]};a.setVariable=function(f,c){this._hotspotActionSetVariable({key:f,value:c})};a._hotspotRenderProgressMarkers=function(){var f=this,c=f._hotspot.data;if(c){var h=f._hotspotLoadGen||0,k=function(){if((f._hotspotLoadGen||
0)===h&&f._hotspot.data===c){var l=f.progressBar&&f.progressBar.total,p=f.videoEl&&f.videoEl.duration;if(!l||!p||!isFinite(p)||p<=0)f._hotspotProgressRetry||(f._hotspotProgressRetry=0),f._hotspotProgressRetry++,f._hotspotProgressRetry<=20&&setTimeout(k,500);else{f._hotspotProgressRetry=0;f._hotspotClearProgressMarkers();for(var w={hotspot:"rgba(255,255,255,0.4)",quiz:"#007AFF",card:"#FF9500",form:"#FF6B6B",vote:"#34C759",webview:"#AF52DE",map:"#5AC8FA",countdown:"#FF3B30",speed_controller:"#8E8E93"},
v={hotspot:K("annotNtHotspot"),text:K("annotNtText"),image:K("annotNtImage"),button:K("annotNtButton"),quiz:K("annotQuiz"),card:K("annotCard"),form:K("annotForm"),vote:K("annotVote"),webview:K("annotNtWebview"),map:K("annotNtMap"),countdown:K("annotNtCountdown"),speed_controller:K("annotNtSpeed"),choice:K("annotChoice")},E={hotspot:1,text:1,image:1,button:1},D=c.nodes,B=0;B<D.length;B++){var G=D[B];if(G.time_range&&Array.isArray(G.time_range)&&!(G.time_range.length<2)){var N=v[G.type]||G.type||"\u8282\u70b9",
I=G.hint||"";!I&&G.content&&(I=G.content.title||G.content.prompt||G.content.question||"");var C=m(G.time_range[0])+"-"+m(G.time_range[1]);if(E[G.type]){var g=G.style&&G.style.border_color||w[G.type]||"rgba(255,255,255,0.4)",q=document.createElement("span");q.className="zwp-progress-hotspot-mark";q.style.left=G.time_range[0]/p*100+"%";q.style.width=(G.time_range[1]-G.time_range[0])/p*100+"%";q.style.backgroundColor=g;q.setAttribute("title",N+": "+(I||G.id)+" ("+C+")");l.appendChild(q)}else g=w[G.type]||
"#fff",q=document.createElement("span"),q.className="zwp-progress-event-mark",q.style.left=G.time_range[0]/p*100+"%",q.style.backgroundColor=g,q.setAttribute("title",N+": "+(I||G.id)+" ("+C+")"),l.appendChild(q)}}}}};k()}};a._hotspotClearProgressMarkers=function(){var f=this.progressBar&&this.progressBar.total;if(f){f=f.querySelectorAll(".zwp-progress-hotspot-mark, .zwp-progress-event-mark");for(var c=0;c<f.length;c++)f[c].remove()}};a._showAnnotationButton=function(){if(this._config.annotationButton!==
!1&&this.controlbar){var f=this.controlbar.querySelector(".zwp-annotationButton");if(f)ja(f,"zwp-hidden");else{f=document.createElement("div");f.className="zwp-button zwp-annotationButton";f.innerHTML='<button class="zwpbtn zwp-annotationBtn zwp-active" data-action="toggleAnnotation" data-name="annotationbtn" title="'+K("disableAnnotation","Disable Annotation")+'"><svg viewBox="0 0 24 24" width="24" height="24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="4" width="18" height="16" rx="2" ry="2"/><rect x="8" y="9" width="8" height="6" rx="1" fill="rgba(255,255,255,0.15)"/><circle cx="8" cy="9" r="1.5" fill="currentColor" stroke="none"/><circle cx="16" cy="9" r="1.5" fill="currentColor" stroke="none"/><circle cx="8" cy="15" r="1.5" fill="currentColor" stroke="none"/><circle cx="16" cy="15" r="1.5" fill="currentColor" stroke="none"/></svg></button>';
f.querySelector("button").addEventListener("click",this.on_btnclick);var c=this.controlbar.querySelector(".zwp-segmentButton")||this.controlbar.querySelector(".zwp-recordButton");c?c.parentNode.insertBefore(f,c.nextSibling):this.controlbar.appendChild(f)}}};a._hideAnnotationButton=function(){if(this.controlbar){var f=this.controlbar.querySelector(".zwp-annotationButton");f&&ka(f,"zwp-hidden")}};a.toggleAnnotation=function(){this._hotspot.userEnabled=!this._hotspot.userEnabled;var f=this._hotspot.userEnabled;
this._hotspot.interactionLayer&&(this._hotspot.interactionLayer.style.display=f?"":"none");this._hotspot.eventLayer&&!f&&(this._hotspot.eventLayer.innerHTML="",this._hotspot.eventLayer.classList.remove("active"),this._hotspot.eventLayer.style.background="",this._hotspot.isInterrupted=!1);var c=this._hotspot;if(!f){c._countdownCleanups&&Object.keys(c._countdownCleanups).forEach(function(k){try{c._countdownCleanups[k]()}catch(l){}delete c._countdownCleanups[k]});if(c._panelTimers){for(var h=0;h<c._panelTimers.length;h++)clearTimeout(c._panelTimers[h]);
c._panelTimers=[]}c.activeIds={};c.triggeredEvents={};c.isInterrupted=!1}if(h=this.controlbar.querySelector(".zwp-annotationBtn"))f?(ka(h,"zwp-active"),h.setAttribute("title",K("disableAnnotation","Disable Annotation")),h.innerHTML='<svg viewBox="0 0 24 24" width="24" height="24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="4" width="18" height="16" rx="2" ry="2"/><rect x="8" y="9" width="8" height="6" rx="1" fill="rgba(255,255,255,0.15)"/><circle cx="8" cy="9" r="1.5" fill="currentColor" stroke="none"/><circle cx="16" cy="9" r="1.5" fill="currentColor" stroke="none"/><circle cx="8" cy="15" r="1.5" fill="currentColor" stroke="none"/><circle cx="16" cy="15" r="1.5" fill="currentColor" stroke="none"/></svg>'):
(ja(h,"zwp-active"),h.setAttribute("title",K("enableAnnotation","Enable Annotation")),h.innerHTML='<svg viewBox="0 0 24 24" width="24" height="24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><g opacity="0.5"><rect x="3" y="4" width="18" height="16" rx="2" ry="2"/><rect x="8" y="9" width="8" height="6" rx="1"/></g><line x1="4" y1="4" x2="20" y2="20" stroke="currentColor" stroke-width="1.5"/></svg>')}}function Fd(a,t){function z(x){x.keyState.nudgeAccelerating=
!1;x.keyState.nudgeAccelTimer&&(clearTimeout(x.keyState.nudgeAccelTimer),x.keyState.nudgeAccelTimer=null);x.keyState.nudgeRepeatTimer&&(clearInterval(x.keyState.nudgeRepeatTimer),x.keyState.nudgeRepeatTimer=null);x.keyState.nudgeWhich=null;x.keyState.nudgeDir=0;x.keyState.nudgeAction=null}function y(x,e,d){x.keyState.nudgeAccelTimer&&(clearTimeout(x.keyState.nudgeAccelTimer),x.keyState.nudgeAccelTimer=null);x.keyState.nudgeAction=e;x.keyState.nudgeAccelTimer=setTimeout(function(){x.keyState.nudgeAccelerating=
!0;x.keyState.nudgeAccelTimer=null;x.keyState.nudgeRepeatTimer=setInterval(function(){d&&!d()?z(x):x.keyState.nudgeAction&&x.keyState.nudgeAction()},50)},350)}a.keyState={leftPressed:!1,rightPressed:!1,leftTimer:null,rightTimer:null,leftPressTime:0,rightPressTime:0,originalPlaybackRate:1,isFastForward:!1,leftRewindInterval:null,wasPlayingBeforeRewind:!1,frozenFrameTime:0,rewindStartTime:0,isRewinding:!1,rewindCompleted:!1,nudgeAccelerating:!1,nudgeAccelTimer:null,nudgeRepeatTimer:null,nudgeWhich:null,
nudgeDir:0,nudgeAction:null};a.resetKeyState=function(){this.keyState&&(this.keyState.leftTimer&&(clearTimeout(this.keyState.leftTimer),this.keyState.leftTimer=null),this.keyState.rightTimer&&(clearTimeout(this.keyState.rightTimer),this.keyState.rightTimer=null),this.keyState.leftRewindInterval&&(clearInterval(this.keyState.leftRewindInterval),this.keyState.leftRewindInterval=null),this.keyState.nudgeAccelTimer&&(clearInterval(this.keyState.nudgeAccelTimer),this.keyState.nudgeAccelTimer=null),this.keyState.nudgeRepeatTimer&&
(clearTimeout(this.keyState.nudgeRepeatTimer),this.keyState.nudgeRepeatTimer=null))}.bind(a);a.onKeydown=function(x){if(x){var e=this,d=window.__zwpKeyboardPlayer;if(d&&d!==e&&(d=x.target,!(d&&e.playerElm&&e.playerElm.contains&&e.playerElm.contains(d))))return;var r=document.activeElement;if(!r||!r.classList.contains("barrage_inp_text")&&r.tagName!=="INPUT"&&r.tagName!=="TEXTAREA"&&r.contentEditable!=="true"||x.keyCode===27)if(a._vrInput&&(x.keyCode===37||x.keyCode===38||x.keyCode===39||x.keyCode===
40))x.preventDefault(),x.keyCode===37?a._vrInput.nudge(-5,0):x.keyCode===39?a._vrInput.nudge(5,0):x.keyCode===38?a._vrInput.nudge(0,5):x.keyCode===40&&a._vrInput.nudge(0,-5);else if(x.keyCode===27)if(d=!1,e.contextMenu?(e.hideContextMenu(),d=!0):e._closePanel("volumeBoostPanel")?d=!0:e._closePanel("colorSettingPanel")?d=!0:e._closePanel("recordingSettingsPanel")?d=!0:e._closePanel("vrSettingsPanel")?d=!0:e._closePanel("shortcutHelpPanel")?d=!0:e._closePanel("infoViewer")?d=!0:e._closePanel("subtitleSettingsPanel")?
d=!0:e._closePanel("subtitleSearchPanel")?d=!0:e._closePanel("subtitleTranslatePanel")?d=!0:e._closePanel("chapterSearchPanel")?d=!0:e.playlistPanel&&e.playlistPanel.style.display!=="none"&&(e.togglePlaylistPanel(),d=!0),e.isZoomActive()&&e._config.zoomButton&&(e.closeZoom(),d=!0),d)x.stopPropagation(),x.preventDefault();else if(e.isFullscrWin&&e.controlbar){if(d=e.controlbar.querySelector(".zwp-fullscrWinBtn")||e.controlbar.querySelector(".zwp-fullscrBtn"))e.setFullscreenWin(!1,d),x.stopPropagation(),
x.preventDefault()}else nb()&&(x.stopPropagation(),x.preventDefault(),e.playerElm&&yc(e.playerElm));else if(x.keyCode===13)e.danmuToolbar&&(d=e.danmuToolbar.querySelector(".zwp_switch"))&&ya(d,"switch_on")&&(d=e.danmuToolbar.querySelector(".barrage_inp_text"))&&(r=document.activeElement,r===d?(x=d.value.trim())&&e.sendDanmu(x)&&(d.value=""):(x.preventDefault(),d.focus()));else if(x.keyCode===38)x.preventDefault(),e.videoEl&&(x=e.videoEl.volume,x+=.05,x>1&&(x=1),e.setMuted(!1),e.setVolume(x),d=parseInt(x*
100)+"%",d={icon:"speaker",text:d},e.toast(d,1200,!1),e.positionVolumeThumb&&e.positionVolumeThumb(x));else if(x.keyCode===40)x.preventDefault(),e.videoEl&&(x=e.videoEl.volume,x-=.05,x<0&&(x=0),e.setVolume(x),e.setMuted(x===0),d=parseInt(x*100)+"%",x===0&&(d=K("muted","Muted")),d={icon:"speaker",text:d},e.toast(d,1200,!1),e.positionVolumeThumb&&e.positionVolumeThumb(x));else if(x.keyCode===32||x.keyCode===179)x.preventDefault(),e._config.disablePlayBtn||(e._flashOnUserClick=e.videoEl&&!e.videoEl.paused&&
e.isPlaying?"pause":"play",e.playbtn?e.playbtn.click():e.controlbar?(e.playbtn=e.controlbar.querySelector(".zwp-playbtn"),e.playbtn&&e.playbtn.click()):e.videoEl&&(e.videoEl.paused?(e.videoEl.play(),e.setplaystate&&e.setplaystate(!0)):(e.videoEl.pause(),e.setplaystate&&e.setplaystate(!1))));else if(x.keyCode===77||x.keyCode===109)e.videoEl&&(e.videoEl.muted?(e.toast(K("unmuted","Unmuted"),1E3,!1,!0),e.setMuted(!1)):(e.toast(K("muted","Muted"),1E3,!1,!0),e.setMuted(!0)));else if(x.keyCode===68||x.keyCode===
100){if(x.preventDefault(),e.danmuToolbar&&(d=e.danmuToolbar.querySelector(".zwp_switch")))d.click(),ya(d,"switch_on")?e.toast(K("danmuEnabled","Danmu Enabled"),1E3,!1,!0):e.toast(K("danmuDisabled","Danmu Disabled"),1E3,!1,!0)}else if(x.keyCode===81)x.preventDefault(),e.playlistState&&e.playlistState.data&&e.togglePlaylistPanel();else if(x.key==="]"||x.key==="\u3011")x.preventDefault(),e.playlistState&&e.playlistState.currentItem&&e.playNextPlaylistItem&&(e.playNextPlaylistItem(),e.toast(K("nextTrack",
"Next"),1E3,!1,!0));else if(x.key==="["||x.key==="\u3010")x.preventDefault(),e.playlistState&&e.playlistState.currentItem&&e.playPrevPlaylistItem&&(e.playPrevPlaylistItem(),e.toast(K("previousTrack","Previous"),1E3,!1,!0));else if(x.shiftKey&&x.keyCode===49)x.preventDefault(),e.videoEl&&(e.videoEl.playbackRate=1,e._syncSpeedBtnUI(1),e.toast(K("playbackSpeed1x","Playback Speed: 1x"),1E3,!1,!0));else if(x.shiftKey&&x.keyCode===50)x.preventDefault(),e.videoEl&&(e.videoEl.playbackRate=2,e._syncSpeedBtnUI(2),
e.toast(K("playbackSpeed2x","Playback Speed: 2x"),1E3,!1,!0));else if(x.keyCode===76||x.keyCode===108)x.preventDefault(),e.playerElm&&(ya(e.playerElm,"zwp-state-light-off")?e.lightOn():e.lightOff());else if(x.keyCode===48)x.preventDefault(),e._config.isLive||e._config.disablePlayBtn||!e.videoEl||e.videoEl.readyState<2||(e.videoEl.currentTime=e.segment&&e.segment.isActive&&e.segment.startTime!==void 0?e.segment.startTime:0,e.videoEl.play().then(function(){e.setplaystate(!0)}).catch(function(m){m.name===
"NotAllowedError"?e.toast(K("autoplayBlocked","Autoplay blocked by browser"),2E3,!1,!0):e.toast(K("playbackFailed","Playback failed")+": "+m.message,2E3,!1,!0)}));else if(x.keyCode===188||x.keyCode===190)x.preventDefault(),!e.videoEl||e._config.isLive||e.videoEl.readyState<2||(d=x.keyCode===190?1:-1,r=null,e.segment&&e.segment.isActive&&(!x.ctrlKey||x.altKey||x.shiftKey||x.metaKey?!x.altKey||x.ctrlKey||x.shiftKey||x.metaKey||(r="end"):r="start"),r?e.keyState.nudgeAccelerating||(e.nudgeSegmentBoundary(r,
d),e.keyState.nudgeWhich=r,e.keyState.nudgeDir=d,y(e,function(){e.nudgeSegmentBoundary(e.keyState.nudgeWhich,e.keyState.nudgeDir)},function(){return!(!e.segment||!e.segment.isActive)})):e.keyState.nudgeAccelerating||(e.stepFrame(d),e.keyState.nudgeWhich=null,e.keyState.nudgeDir=d,y(e,function(){e.stepFrame(e.keyState.nudgeDir)})));else if(x.keyCode===37)x.preventDefault(),!e.videoEl||e._config.isLive||e.videoEl.readyState<2||e.keyState.leftPressed||(x=0,e.segment&&e.segment.isActive&&e.segment.startTime!==
void 0&&(x=e.segment.startTime),e.videoEl.currentTime<=x||(e.keyState.leftPressed=!0,e.keyState.leftPressTime=Date.now(),e.keyState.wasPlayingBeforeRewind=!0,e.seekVideo(-5),e.keyState.leftTimer=setTimeout(function(){if(e.keyState.leftPressed){e.keyState.isRewinding=!0;e.keyState.frozenFrameTime=e.videoEl.currentTime;e.keyState.rewindStartTime=Date.now();e.videoEl.paused||e.videoEl.pause();e.bigPlayOverlay&&(e.bigPlayOverlay.style.display="none");var m=e.videoEl.duration||1;m=m>=3600?20:m>=1800?25:
m>=600?30:80;e.timeSpan||(e.timeSpan=e.controlbar?e.controlbar.querySelector(".zwp__currenttime"):null);e.keyState.leftRewindInterval=setInterval(function(){if(e.keyState.leftPressed&&e.videoEl){var u=e.videoEl.currentTime-5,f=0;e.segment&&e.segment.isActive&&e.segment.startTime!==void 0&&(f=e.segment.startTime);u<=f?(e.videoEl.currentTime=f,clearInterval(e.keyState.leftRewindInterval),clearTimeout(e.keyState.leftTimer),e.keyState.leftRewindInterval=null,e.keyState.leftTimer=null,e.videoEl.play().then(function(){e.setplaystate(!0)}).catch(function(c){}),
e.keyState.frozenFrameTime=0,e.keyState.isRewinding=!1,e.keyState.rewindCompleted=!0):(e.videoEl.currentTime=u,e.updateProgress&&e.updateProgress(u),e.timeSpan&&e._renderTimeSpan(u))}},m)}},300)));else if(x.keyCode===39)x.preventDefault(),!e.videoEl||e._config.isLive||e.videoEl.readyState<2||e.keyState.rightPressed||(x=e.videoEl.duration,e.segment&&e.segment.isActive&&e.segment.endTime!==void 0&&(x=e.segment.endTime),e.videoEl.currentTime>=x||(e.keyState.rightPressed=!0,e.keyState.rightPressTime=
Date.now(),e.keyState.originalPlaybackRate=e.videoEl.playbackRate||1,e.keyState.maxBoundary=x,e.videoEl.paused&&e._startPlayback(),e.keyState.rightTimer=setTimeout(function(){e.keyState.rightPressed&&(e.videoEl.playbackRate=3,e.keyState.isFastForward=!0)},300)));else if(x.keyCode===70||x.keyCode===102)x.preventDefault(),e.controlbar?(x=e.controlbar.querySelector(".zwp-fullscrBtn"))&&x.click():e.playerElm&&(x=nb(),e.setFullscreen&&e.setFullscreen(!x,null));else if(x.keyCode===82||x.keyCode===114)x.preventDefault(),
e._config.recordButton&&(x=e.controlbar?e.controlbar.querySelector(".zwp-recordBtn"):null)&&x.click();else if(x.keyCode===83){r=(d=e.segment&&e.segment.isActive)&&e.subtitleLoopCtrl&&!e.subtitleLoopCtrl.isEmpty();var n=d&&e.segment.subtitleSourceSnapshot;x.ctrlKey&&x.altKey&&x.shiftKey&&!x.metaKey?d&&(x.preventDefault(),e.shiftAllSubtitles()):x.ctrlKey||x.altKey||x.shiftKey||x.metaKey||!r&&!n||(x.preventDefault(),e.commitSegmentToSubtitle())}else if(x.keyCode===90||x.keyCode===122)x.preventDefault(),
e._config.zoomButton&&(x=e.controlbar?e.controlbar.querySelector(".zwp-zoomBtn"):null)&&x.click()}}.bind(a);a.onKeyup=function(x){if(x){var e=this;if(x.keyCode===37)x.preventDefault(),e.keyState.leftPressed&&(e.keyState.leftPressed=!1,e.keyState.leftTimer&&(clearTimeout(e.keyState.leftTimer),e.keyState.leftTimer=null),e.keyState.leftRewindInterval&&(clearInterval(e.keyState.leftRewindInterval),e.keyState.leftRewindInterval=null),e.videoEl&&e.videoEl.play().then(function(){e.setplaystate(!0)}).catch(function(r){}),
e.keyState.frozenFrameTime=0,e.keyState.isRewinding=!1,e.keyState.rewindCompleted=!1);else if(x.keyCode===39){if(x.preventDefault(),e.keyState.rightPressed){e.keyState.rightPressed=!1;e.keyState.rightTimer&&(clearTimeout(e.keyState.rightTimer),e.keyState.rightTimer=null);if(Date.now()-e.keyState.rightPressTime<300){x=e.videoEl.duration;e.segment&&e.segment.isActive&&e.segment.endTime!==void 0&&(x=e.segment.endTime);var d=e.videoEl.currentTime+5;if(d>x)d=x;else{e.seekVideo(5);return}e.videoEl.currentTime=
d;e.updateProgress&&e.updateProgress(d);e.timeSpan&&e._renderTimeSpan(d)}e.keyState.isFastForward&&e.videoEl&&(e.videoEl.playbackRate=e.keyState.originalPlaybackRate,e.keyState.isFastForward=!1)}}else x.keyCode!==188&&x.keyCode!==190||z(e)}}.bind(a);a.initKeyboardEvents=function(){!this.keyboardEventsInitialized&&this.onKeydown&&this.onKeyup&&(document.addEventListener("keydown",this.onKeydown),document.addEventListener("keyup",this.onKeyup),this.keyboardEventsInitialized=!0)}}function Gd(a,t){var z=
t.secondsToTimeCode,y=t.offset,x=t.getMouseIsDown,e=t.setMouseIsDown;a.buildProgressBar=function(){var d=this,r={};if(d.controlbar){var n=d.controlbar;r.rail=n.querySelector(".zwp__time-rail");r.timeInfo=n.querySelector(".zwp__time-info");if(d._config.isLive)d.progressBar&&d.progressBar.streamtype||(r.timeInfo&&(r.timeInfo.innerHTML='<div class="zwp-streamtype zwp-label">Live</div>',r.streamtype=n.querySelector(".zwp-streamtype")),d.progressBar=r);else if(r.timeInfo&&(r.timeInfo.innerHTML="",r.streamtype=
null),r.rail||(n.insertAdjacentHTML("beforeend",'<div class="zwp__time-rail"></div>'),r.rail=n.querySelector(".zwp__time-rail")),d._config.disableSeek&&ka(r.rail,"zwp_disabled"),d.progressBar&&d.progressBar.total)d.progressBar.rail&&d._config.useProgressTooltip&&(n=d.progressBar.rail.querySelector(".zwp__time-float"))&&(m=n.querySelector(".zwp__time-thumbnail"),m||(n.insertAdjacentHTML("afterbegin",'<div class="zwp__time-thumbnail"></div>'),m=n.querySelector(".zwp__time-thumbnail"),d.progressBar.thumbnails=
m),d._config.thumbnails?(h=d._config.thumbnails,h.zwp_type==="thumbnail"&&h.thumbnail&&(h=h.thumbnail),m&&(h.rowsize=typeof h.row=="number"?h.row:Math.ceil(Math.sqrt(h.total)),m.style.maxWidth="none",m.style.maxHeight="none",m.style.width=h.width+"px",m.style.height=h.height+"px",m.style.backgroundImage="url("+h.url+")"),n.style.width=4+h.width+"px",n.style.height=4+h.height+"px",ka(n,"zwp__thumbnail")):(n.style.width=null,n.style.height=null,m&&(m.style.width="0px",m.style.height="0px",m.style.backgroundImage=
null),ja(n,"zwp__thumbnail")));else{var m='<span class="zwp__time-total zwp__time-slider"><span class="zwp__bar zwp__time-buffering"></span><span class="zwp__bar zwp__time-loaded"></span><span class="zwp__bar zwp__time-current"></span><span class="zwp__time-chapter"></span><span class="zwp__time-hovered no-hover"></span><span class="zwp__time-thumb"><span class="zwp__time-thumb-content"></span></span>';if(d._config.useProgressTooltip){var u="",f="",c="";if(typeof d._config.thumbnails==="object"&&
d._config.thumbnails!=null){var h=d._config.thumbnails;h&&!Array.isArray(h)&&h.thumbnail&&typeof h.thumbnail==="object"&&(!h.zwp_protocol||h.zwp_protocol.indexOf("ZWMAP/")===0&&h.zwp_type==="thumbnail")&&(h=h.thumbnail);if(typeof h.width=="number"&&typeof h.height=="number"&&typeof h.total=="number"){h.rowsize=typeof h.row=="number"?h.row:Math.ceil(Math.sqrt(h.total));c=' style="width: '+(4+h.width)+"px; height: "+(4+h.height)+'px;"';f=" zwp__thumbnail";var k=String(h.url||"");/^(https?:|blob:|data:image\/)/i.test(k)&&
!/["'()<>\\;]/.test(k)&&(u='<div class="zwp__time-thumbnail" style="max-width:none;max-height:none;width: '+h.width+"px;height: "+h.height+"px; background-image: url("+k+');"></div>')}}m+='<div class="zwp__time-float'+f+'"'+c+">"+u+'<span class="zwp__time-float-current">0:00</span><span class="zwp__time-float-corner corner_external"></span><span class="zwp__time-float-corner corner_internal"></span></div>'}m=m+'</span><div class="zwp-segment-layer" id="segmentLayer"><div class="zwp-segment-selection" id="segmentSelection"></div><div class="zwp-segment-handle zwp-segment-handle-start" id="segmentHandleStart" tabindex="0" role="slider" aria-label="'+
(K("segmentHandleStartLabel","Segment start handle")+'"></div><div class="zwp-segment-handle zwp-segment-handle-end" id="segmentHandleEnd" tabindex="0" role="slider" aria-label="'+K("segmentHandleEndLabel","Segment end handle")+'"></div><div class="zwp-segment-tooltip" id="segmentTooltip" style="display: none;"></div></div>');r.rail.innerHTML=m;r.buffering=n.querySelector(".zwp__time-buffering");r.total=n.querySelector(".zwp__time-total");r.loaded=n.querySelector(".zwp__time-loaded");r.current=n.querySelector(".zwp__time-current");
r.thumb=n.querySelector(".zwp__time-thumb");r.timefloat=n.querySelector(".zwp__time-float");r.timefloatcurrent=n.querySelector(".zwp__time-float-current");r.thumbnails=n.querySelector(".zwp__time-thumbnail");r.slider=n.querySelector(".zwp__time-slider");r.hovered=n.querySelector(".zwp__time-hovered");r.chapters=n.querySelector(".zwp__time-chapter");r.newTime=0;r.forcedHandlePause=!1;r.buffering.style.display="none";r.slider.addEventListener("dragstart",function(){return!1});d.progressBar=r;d.showTimefloat=
function(N){var I=this;I._config.useProgressTooltip&&!I._timefloatRaf&&(I._pendingTimefloatEvt=N,I._timefloatRaf=requestAnimationFrame(function(){I._timefloatRaf=null;var C=I._pendingTimefloatEvt;I._pendingTimefloatEvt=null;C&&I._renderTimefloat(C)}))}.bind(d);d._renderTimefloat=function(N){var I=N.originalEvent&&N.originalEvent.changedTouches?N.originalEvent.changedTouches[0].pageX:N.changedTouches?N.changedTouches[0].pageX:N.pageX;if((N=this.progressBar)&&N.timefloat&&N.total){var C=this.videoEl.duration,
g=y(N.total),q=N.total.offsetWidth,A=!(!N.thumbnails||!this._config.thumbnails),M=A?N.timefloat.offsetWidth/2:0;I<g.left?I=g.left:I>q+g.left&&(I=q+g.left);I-=g.left;g=I/q;C=z(C*g);C!==N._lastTimeText&&(N.timefloatcurrent.innerHTML=C,N._lastTimeText=C);A?(A=this._config.thumbnails,A.zwp_type==="thumbnail"&&A.thumbnail&&(A=A.thumbnail),C=Math.floor(g*A.total),C>=A.total&&(C=A.total-1),A.rowsize!=0&&(N.thumbnails.style.backgroundPosition="-"+C%A.rowsize*A.width+"px -"+A.height*Math.floor(C/A.rowsize)+
"px")):(M=7*C.length+10,M<40&&(M=40),N.timefloat.style.width=M+"px",N._halfByLen||(N._halfByLen={}),N._halfByLen[C.length]||(N._halfByLen[C.length]=N.timefloat.offsetWidth/2),M=N._halfByLen[C.length]);N.timefloat.style.left=(I<M?M:I>q-M?q-M:I)+"px";N.timefloat.style.display="block"}}.bind(d);r.slider.addEventListener("mouseenter",function(N){var I=this;if(I.videoEl){var C=I.videoEl.duration;isNaN(C)||C===Infinity||N.target!==r.slider||(r.bindMouseMoveEvent||(r.slider.addEventListener("mousemove",
function(g){var q=g.target;(q===r.slider||q.closest(".zwp__time-slider"))&&I.showTimefloat(g)}),r.bindMouseMoveEvent=!0),r.timefloat&&(r.timefloat.style.display="block"))}}.bind(d));r.slider.addEventListener("mouseleave",function(){if(this.videoEl){var N=this.videoEl.duration;isNaN(N)||N===Infinity||x()||!r.timefloat||(r.timefloat.style.display="none")}}.bind(d));var l=function(N,I){var C=this,g=r.slider.offsetWidth,q=y(r.slider);q=(N.touches&&N.touches.length>0?N.touches[0].pageX:N.pageX)-q.left;
q<0?q=0:q>g&&(q=g);g=(q*100/g).toFixed(4);r.thumb.style.left=g+"%";I?(C.seekTimeProgress(g),C.lastSeekProgress=g):typeof C.lastSeekProgress!="undefined"&&Math.abs(g-C.lastSeekProgress)>1&&(C.lastSeekProgress=g,C.seekTimer||(C.seekTimer=setTimeout(function(){C.seekTimeProgress(C.lastSeekProgress);delete C.seekTimer},1E3)));N.preventDefault();N.stopPropagation()}.bind(d),p=function(N,I){if(I===N)return!0;for(;I.parentNode;){if(I.parentNode===N)return!0;I=I.parentNode}return!1};d.on_progressbar_mousemove=
function(N){var I=N.target;x()&&p(r.slider,I)&&l(N)}.bind(d);d.on_progressbar_mouseup=function(N){if(x()){document.removeEventListener("mousemove",this.on_progressbar_mousemove);document.removeEventListener("mouseup",this.on_progressbar_mouseup);e(!1);delete this.isTrackingProgress;this.seekTimer&&(clearTimeout(this.seekTimer),delete this.seekTimer);if(N.target&&(N.target.parentNode==r.thumb||N.target==r.thumb)){var I=r.slider.offsetWidth,C=y(r.slider);N=(N.touches&&N.touches.length>0?N.touches[0].pageX:
N.pageX)-C.left;N<0?N=0:N>I&&(N=I);I=(N*100/I).toFixed(4);typeof this.lastSeekProgress!="undefined"?Math.abs(I-this.lastSeekProgress)>1&&this.seekTimeProgress(I):this.seekTimeProgress(I)}delete this.lastSeekProgress}}.bind(d);d.on_progressbar_mousedown=function(N){x()||this._config.disableSeek||(a.isTrackingProgress=!0,l(N,!0),document.addEventListener("mousemove",this.on_progressbar_mousemove),document.addEventListener("mouseup",this.on_progressbar_mouseup),e(!0),N.preventDefault(),N.stopPropagation())}.bind(d);
r.slider.addEventListener("mousedown",d.on_progressbar_mousedown);if(d.isMobile()){var w=!1,v=null,E=null,D=!1,B=!!d.showTimefloat,G=function(N,I){var C=I.offsetWidth;I=y(I);N=N.pageX-I.left;N<0?N=0:N>C&&(N=C);return parseFloat((N*100/C).toFixed(4))};d.on_progressbar_touchmove=function(N){var I=N.target;w&&p(r.slider,I)&&(l(N,!1),B&&d.showTimefloat(N),N=G(N.touches[0],r.slider),I=!1,E===null?I=!0:Math.abs(N-E)>1&&(I=!0),I&&(E=N,v&&clearTimeout(v),v=setTimeout(function(){w&&E!==null&&d.seekTimeProgress(E)},
300)))}.bind(d);d.on_progressbar_touchend=function(N){var I=this;if(w){document.removeEventListener("touchmove",I.on_progressbar_touchmove);document.removeEventListener("touchend",I.on_progressbar_touchend);document.removeEventListener("touchcancel",I.on_progressbar_touchcancel);w=!1;delete I.isTrackingProgress;v&&(clearTimeout(v),v=null);var C=E;C===null&&N.changedTouches&&N.changedTouches.length>0&&(C=G(N.changedTouches[0],r.slider));C!==null&&(I.seekTimeProgress(C),D&&I.videoEl&&I.videoEl.paused&&
I.videoEl.play().then(function(){I.setplaystate(!0)}).catch(function(g){}));E=null;D=!1;r.timefloat&&(r.timefloat.style.display="none")}}.bind(d);d.on_progressbar_touchstart=function(N){w||this._config.disableSeek||(a.isTrackingProgress=!0,E=null,v&&(clearTimeout(v),v=null),D=this.videoEl?this.videoEl.paused:!0,l(N,!1),B&&this.showTimefloat(N),document.addEventListener("touchmove",this.on_progressbar_touchmove,{passive:!1}),document.addEventListener("touchend",this.on_progressbar_touchend),document.addEventListener("touchcancel",
this.on_progressbar_touchcancel),w=!0,N.preventDefault(),N.stopPropagation())}.bind(d);d.on_progressbar_touchcancel=function(N){d.on_progressbar_touchend(N)}.bind(d);r.slider.addEventListener("touchstart",d.on_progressbar_touchstart,{passive:!1})}}d._applyControlbarMode()}}.bind(a);a.updateProgressBarType=function(){if(this.controlbar){var d=this.controlbar,r=d.querySelector(".zwp__time-rail");this._config.isLive?this.progressBar&&this.progressBar.streamtype&&(this.progressBar.streamtype.innerHTML=
"Live",this.progressBar.streamtype.style.display="block"):(r&&this._config.disableSeek&&ka(r,"zwp_disabled"),this.progressBar&&this.progressBar.streamtype&&(this.progressBar.streamtype.innerHTML="",this.progressBar.streamtype.style.display="none"));this._applyControlbarMode();this._config.isLive&&(ja(d,"zwp-has-hours"),this._showHoursLocked=!1);this.updateResponsiveControlbar&&this.updateResponsiveControlbar()}}.bind(a)}function Ec(a,t){var z=t.debug_log,y=t.offset,x=t.getMouseIsDown,e=t.setMouseIsDown,
d=t.getMouseIsOver,r=t.setMouseIsOver;if(t=a.controlbar){var n=t.querySelector(".zwp-volume-docker");if(n){a.muteBtn=n.querySelector("button.zwp-muteBtn");a.volslider=n.querySelector(".zwp-volume-slider");a.voltotal=n.querySelector(".zwp-volume-total");a.volcurrent=a.volslider.querySelector(".zwp-volume-current");a.volthumb=a.volslider.querySelector(".zwp-volume-handle");var m=function(c){if(c!==null&&!isNaN(c)&&c!==void 0){var h=K("unmuted","Unmuted"),k=K("muted","Muted");c=Math.max(0,c);c=Math.min(c,
1);c===0?(ja(n,"zwp__mute"),ka(n,"zwp__unmute"),k=a.muteBtn,k.setAttribute("title",h),k.setAttribute("aria-label",h)):(ja(n,"zwp__unmute"),ka(n,"zwp__mute"),h=a.muteBtn,h.setAttribute("title",k),h.setAttribute("aria-label",k));h=a.volthumb;k=a.volcurrent;c=c*100+"%";var l=getComputedStyle(h);k.style.bottom=0;k.style.height=c;h.style.bottom=c;h.style.marginBottom=-parseFloat(l.height)/2+"px"}},u=function(c){var h=y(a.voltotal),k=getComputedStyle(a.voltotal),l=!0;c.type=="touchmove"&&(c.changedTouches&&
(l=c.changedTouches[0],c.pageX=l.pageX,c.pageY=l.pageY),l=!1);k=parseFloat(k.height);k=(k-(c.pageY-h.top))/k;h.top!==0&&h.left!==0&&(k=Math.max(0,k),k=Math.min(k,1),m(k),a.setMuted(k===0),a.setVolume(k),l&&c.preventDefault(),c.stopPropagation())};a.positionVolumeThumb=m;a.on_volthumb_mousemove=function(c){var h=c.target;x()&&(h===a.volslider||h.closest(".zwp-volume-slider"))&&u(c)}.bind(a);a.on_volthumb_mouseup=function(c){x()&&("onpointerout"in document?(document.removeEventListener("pointermove",
a.on_volthumb_mousemove),document.removeEventListener("pointerup",a.on_volthumb_mouseup),document.removeEventListener("touchmove",a.on_volthumb_mousemove),document.removeEventListener("touchend",a.on_volthumb_mouseup)):(document.removeEventListener("mousemove",a.on_volthumb_mousemove),document.removeEventListener("mouseup",a.on_volthumb_mouseup)),e(!1));d()||(a.volslider.style.display="none");z&&console.log("volthumb_mouseup:"+c.type)}.bind(a);a.on_volthumb_mousedown=function(c){u(c);"onpointerout"in
document?(document.addEventListener("pointermove",a.on_volthumb_mousemove),document.addEventListener("pointerup",a.on_volthumb_mouseup),document.addEventListener("touchmove",a.on_volthumb_mousemove),document.addEventListener("touchend",a.on_volthumb_mouseup)):(document.addEventListener("mousemove",a.on_volthumb_mousemove),document.addEventListener("mouseup",a.on_volthumb_mouseup));e(!0);c.preventDefault();c.stopPropagation()}.bind(a);var f=a.volslider;n.addEventListener("mouseenter",function(c){c.target===
n&&(f.style.display="block",r(!0),c.preventDefault(),c.stopPropagation())});n.addEventListener("focusin",function(){f.style.display="block";r(!0)});n.addEventListener("focusout",function(c){if(!c.relatedTarget||c.relatedTarget&&!c.relatedTarget.matches(".zwp-volume-slider"))f.style.display="none"});n.addEventListener("mouseleave",function(){r(!1);x()||(f.style.display="none")});n.addEventListener("focusout",function(){r(!1)});n.addEventListener("keydown",function(c){var h=c.which||c.keyCode||0;c.preventDefault();
c.stopPropagation();h==32&&(a.videoEl.muted?a.setMuted(!1):a.setMuted(!0))});f.addEventListener("dragstart",function(){return!1});f.addEventListener("mouseover",function(){r(!0)});f.addEventListener("focusin",function(){f.style.display="block";r(!0)});f.addEventListener("focusout",function(){r(!1);x()||(f.style.display="none")});f.addEventListener("mousedown",a.on_volthumb_mousedown)}}}function Hd(a,t){var z=t.fadeOut;a._closePanel=function(y,x){var e=this[y];if(!e)return!1;var d=e.querySelector(".closeBtn");
d?d.click():x&&x.fade===!1||typeof z!=="function"?e.remove():z(e,x&&x.duration||500,function(){e.remove()});delete this[y];return!0};a.panels=".zwp-chapterSearchPanel .zwp-shortcutHelpPanel .zwp-recordingSettingsPanel .zwp-volumeBoostPanel .zwp-colorSettingPanel .zwp-subtitleSearchPanel .zwp-playlistPanel .zwp-subtitleTranslatePanel .zwp-ttsPanel .zwp-subtitleSettingsPanel .zwp-vrSettingsPanel .zwp__mediainfo-viewer".split(" ");a.closeAllActivePanels=function(){a.panels.forEach(function(y){var x=
null;x=a.overlay_layers?a.overlay_layers.querySelector(y):null;!x&&a.playerContainer&&(x=a.playerContainer.querySelector(y));y===".zwp__mediainfo-viewer"&&x&&a.infoViewer?(y=x.querySelector(".closeBtn"))?y.click():typeof z==="function"&&(z(x,500,function(){x.remove()}),delete a.infoViewer):x&&x.style.display!=="none"&&x.style.display!==""&&((y=x.querySelector(".closeBtn"))?y.click():typeof z==="function"?z(x,300,function(){x.style.display="none"}):x.style.display="none")});a._lastClosedParentMenu&&
(a._lastClosedParentMenu.style.display="",delete a._lastClosedParentMenu)};a.closeAllMenus=function(){if(a.controlbar){var y=a.controlbar.querySelectorAll(".is-active");y.length>0&&y.forEach(function(x){ja(x,"is-active")})}}}function Id(){var a=navigator.userAgent.toLowerCase();if(a.indexOf("micromessenger")!==-1||typeof wx!=="undefined"&&wx.miniProgram||window.WeixinJSBridge||document.getElementById("wechat-browser"))return!0;a.indexOf("wxwork");return!1}function Jd(a){var t=function(r,n,m){for(var u=
m.length,f=0;f<u;f++)r.setUint8(n+f,m.charCodeAt(f))},z=function(){var r=new ArrayBuffer(364),n=new DataView(r);t(n,0,"RIFF");n.setUint32(4,204,!0);t(n,8,"WAVE");t(n,12,"fmt ");n.setUint32(16,16,!0);n.setUint16(20,1,!0);n.setUint16(22,1,!0);n.setUint32(24,16E3,!0);n.setUint32(28,32E3,!0);n.setUint16(32,4,!0);n.setUint16(34,16,!0);t(n,36,"data");n.setUint32(40,320,!0);var m=44;for(let u=0;u<160;u++)n.setInt16(m,15,!0),m+=2;r=new Uint8Array(r);return"data:audio/x-wav;base64,"+btoa(String.fromCharCode.apply(null,
r))}(),y=new Audio(z),x=!1,e=function(r){x||(x=!0,typeof a==="function"&&a(r))},d=window.setTimeout(function(){d=0;e(!1)},500);y.play().then(function(){d&&window.clearTimeout(d);y.pause();e(!0)}).catch(function(r){d&&window.clearTimeout(d);e(!1)})}function Kd(a,t){t=t.detectMobile;if(!Id()||!t())return!1;t=a._config;t=typeof t.url==="string"&&(t.url.startsWith("webrtc://")||t.url.startsWith("brtc://")||t.url.startsWith("trtc://")||t.url.startsWith("artc://"));t=typeof a._config.url==="string"&&(a._config.url.startsWith("webrtc://")||
a._config.url.startsWith("brtc://")||a._config.url.startsWith("trtc://")||a._config.url.startsWith("artc://"));var z=function(){a.videoEl&&(a.videoEl.setAttribute("playsinline",""),a.videoEl.setAttribute("webkit-playsinline",""),a.videoEl.setAttribute("x5-video-player-type","h5"),a.videoEl.setAttribute("x5-video-player-fullscreen","true"))},y=function(){a.bigPlayBtn&&a.bigPlayBtn.style.setProperty("display","none","important");a.bigPlayOverlay&&a.bigPlayOverlay.style.setProperty("display","none",
"important")},x=function(E,D){var B=function(){if(!D())try{typeof window.WeixinJSBridge!=="undefined"&&window.WeixinJSBridge.invoke?window.WeixinJSBridge.invoke("getNetworkType",{},function(G){E()}):E()}catch(G){E()}};typeof window.WeixinJSBridge!=="undefined"&&window.WeixinJSBridgeReady?B():(document.addEventListener("WeixinJSBridgeReady",B,!1),document.readyState==="loading"?document.addEventListener("DOMContentLoaded",function(){setTimeout(B,200)},!1):setTimeout(B,300),setTimeout(function(){D()||
B()},3E3))},e=function(){a.isPlaying=!0;a.murl||(a.murl=a._config.url);a.isPlayVideo||(a.isPlayVideo=!0);a.closecall||(a.closecall=function(E){E.isPlayVideo&&(E.videoEl&&!E.videoEl.paused&&E.videoEl.pause(),E.videoEl&&(E.videoEl.src=""),delete E.isPlayVideo)});a.videoEventsSetuped||a.setupEventsHandler();a.updateDuration(a);a.startHideControlbar(a)};if(t){z();var d=!1,r=!1,n=null,m=function(){y();a.mutedConfirmBox(!0);a.playerContainer&&!n&&(n=function(E){a.mutedTipBox&&a.mutedTipBox.contains(E.target)||
a.popup_layers&&a.popup_layers.contains(E.target)||!a.videoEl||!a.videoEl.paused||(E=a._config.muted===!0,a.videoEl.muted=E,a.setMuted(E),a.play(a._config.url,a._config.isLive))},a.playerContainer.addEventListener("click",n,!1),a.playerContainer.addEventListener("touchend",n,!1))};x(function(){if(!d){d=!0;a.play(a._config.url,a._config.isLive);var E=function(){r=!0;a.videoEl&&a.videoEl.removeEventListener("playing",E);clearTimeout(D);n&&a.playerContainer&&(a.playerContainer.removeEventListener("click",
n,!1),a.playerContainer.removeEventListener("touchend",n,!1),n=null)};a.videoEl&&a.videoEl.addEventListener("playing",E,!1);var D=setTimeout(function(){a.videoEl&&a.videoEl.removeEventListener("playing",E);r||m()},1500)}},function(){return d})}else{a.videoEl&&!a.videoEl.src&&a._config.url&&(a.videoEl.src=a._config.url);z();var u=!1,f=!1,c=!1,h=null,k=function(){h&&a.playerContainer&&(a.playerContainer.removeEventListener("click",h,!1),a.playerContainer.removeEventListener("touchend",h,!1),h=null)},
l=function(){c||f||(c=!0,a.playerContainer&&(h=function(E){f||a.mutedTipBox&&a.mutedTipBox.contains(E.target)||a.popup_layers&&a.popup_layers.contains(E.target)||!a.videoEl||!a.videoEl.paused||(E=a._config.muted===!0,a.videoEl.muted=E,a.setMuted(E),E=a.videoEl.play(),E!==void 0&&E.then(function(){f=!0;a.setplaystate(!0);e();k()}).catch(function(D){}))},a.playerContainer.addEventListener("click",h,!1),a.playerContainer.addEventListener("touchend",h,!1)))},p=function(E){l();E&&y();!E&&a._config.disableMutedConfirm||
a.mutedConfirmBox(E)},w=!1,v=function(){if(!w&&(w=!0,a.videoEl)){var E=a._config.muted===!0;a.videoEl.muted=E;var D=a.videoEl.play();D!==void 0&&D.then(function(){f=!0;a.setplaystate(!0);a.setMuted(a.videoEl.muted);k();e()}).catch(function(B){E?(y(),a.setplaystate(!1),p(!0)):(a.videoEl.muted=!0,a.setMuted(!0),B=a.videoEl.play(),B!==void 0&&B.then(function(){f=!0;a.setplaystate(!0);e();k();p(!1)}).catch(function(G){y();a.setplaystate(!1);p(!0)}))})}};x(function(){if(!u&&(u=!0,a.videoEl))if(a.videoEl.networkState===
0&&a.videoEl.load(),a.videoEl.readyState>=1)v();else{var E=function(){a.videoEl.removeEventListener("loadedmetadata",E);a.videoEl.removeEventListener("canplay",E);v()};a.videoEl.addEventListener("loadedmetadata",E,!1);a.videoEl.addEventListener("canplay",E,!1);setTimeout(function(){!f&&a.videoEl&&(a.videoEl.removeEventListener("loadedmetadata",E),a.videoEl.removeEventListener("canplay",E),v())},2E3)}},function(){return u})}return!0}function Eb(a,t){return a===t?100:a===t+"_subtitle"?95:a.startsWith(t+
".")?80:Fc(a)===Fc(t)?70:a.includes(t)||t.includes(a)?50:0}function Fc(a){return a.replace(/\[.*?\]|\(.*?\)|\b(1080p|720p|480p|2160p|4k)\b/gi,"").replace(/[.\-_]+/g," ").replace(/\s+/g," ").trim()}function vb(a){var t={zh:"zh",chs:"chs",sc:"sc",cht:"cht",tc:"tc",en:"en",jp:"ja",ja:"ja",ko:"ko",fr:"fr",de:"de",es:"es",sv:"sv",pt:"pt",it:"it",pl:"pl",nl:"nl",tr:"tr",vi:"vi",id:"id",hi:"hi",ru:"ru",uk:"uk",cs:"cs",da:"da",fi:"fi",no:"no",ro:"ro",el:"el",ms:"ms",hu:"hu",ar:"ar",th:"th",fa:"fa",ur:"ur",
bg:"bg",sr:"sr",mk:"mk",kk:"kk",mn:"mn",bn:"bn",ta:"ta",te:"te",ml:"ml",mr:"mr",gu:"gu",pa:"pa",ne:"ne",si:"si",he:"he",ka:"ka",hy:"hy",km:"km",lo:"lo",my:"my",ca:"ca",af:"af",is:"is",sq:"sq",et:"et",lv:"lv",lt:"lt",hr:"hr",sk:"sk",sl:"sl",fil:"fil",tl:"fil",sw:"sw",bilingual:"bi",dual:"bi"};a=a.split(/[._-]/);for(var z=a.length-1;z>=0;z--)if(t[a[z]])return t[a[z]];return null}function Xb(a,t,z,y){a=t(a);t=a.toLowerCase();if(t=vb(t))return K("lang_"+t,t);if(y&&y.length>=3){var x=y.split(/[._-]/);
a=a.split(/[._\-]/).filter(function(e){return x.indexOf(e.toLowerCase())===-1}).join(" ")}a=a.replace(/\[.*?\]|\(.*?\)|\b(1080p|720p|480p|2160p|4k|web-dl|bluray|x264|hevc)\b/gi," ");a=a.replace(/\b(subtitle|sub|subs|caption|captions|srt|ass|vtt)\b/gi," ");return(a=a.replace(/[.\-_]+/g," ").replace(/\s+/g," ").trim())?a=a.split(" ").map(function(e){return e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}).join(" "):K("trackN","Track {0}").replace("{0}",z||"1")}function Ld(a,t,z,y){return new Promise(function(x,
e){if(!a||typeof document==="undefined"||!document.createElement)return e(Error("Environment or source not supported"));var d=typeof a==="string"?a:URL.createObjectURL(a),r=typeof a!=="string",n=document.createElement("video");n.preload="metadata";n.muted=!0;n.playsInline=!0;var m=!1,u=function(){if(!m){m=!0;try{n.removeAttribute("src"),typeof n.load==="function"&&n.load()}catch(h){}if(r)try{URL.revokeObjectURL(d)}catch(h){}}},f=setTimeout(function(){u();e(Error("Poster extraction timeout"))},4E3),
c=function(){clearTimeout(f);try{if(!n.videoWidth||!n.videoHeight)return u(),e(Error("Invalid video dimensions"));var h=z||Infinity,k=n.videoWidth,l=n.videoHeight;if(k>h||l>h)k>=l?(l=Math.round(l*h/k),k=h):(k=Math.round(k*h/l),l=h);var p=document.createElement("canvas");p.width=k;p.height=l;var w=p.getContext("2d");if(!w)return u(),e(Error("Canvas context not available"));w.imageSmoothingEnabled=!0;w.imageSmoothingQuality="high";w.drawImage(n,0,0,k,l);var v=p.toDataURL("image/jpeg",typeof y==="number"?
y:.95);u();x(v)}catch(E){u(),e(E)}};n.addEventListener("loadedmetadata",function(){var h=1;n.duration&&n.duration>0&&(h=Math.min(h,Math.max(.1,n.duration*.1)));try{n.currentTime=h}catch(k){c()}},{once:!0});n.addEventListener("seeked",c,{once:!0});n.addEventListener("error",function(h){clearTimeout(f);u();e(Error("Video loading failed"))},{once:!0});try{n.src=d}catch(h){clearTimeout(f),u(),e(h)}})}function Md(a,t){function z(c){n||=setTimeout(function(){n=null;c.playlistState&&c.playlistState.isLocal&&
c.playlistState.data&&typeof c.renderPlaylistItems==="function"&&c.renderPlaylistItems()},250)}function y(c,h,k,l){d.push(function(){Ld(h.video,void 0,l.maxDim).then(function(p){if(c.playlistState&&c.playlistState.isLocal&&c.playlistState.data){var w=c.playlistState.data.groups&&c.playlistState.data.groups[0]?c.playlistState.data.groups[0].items:null;w&&w.indexOf(k)!==-1&&(k.poster=p,l.isFirst&&!c._config.poster&&(c._config.poster=p,c.videoEl&&c.videoEl.setAttribute("poster",p)),z(c))}}).catch(function(p){}).then(function(){r--;
x()})});x()}function x(){for(;r<2&&d.length;)r++,d.shift()()}var e=t.resolveThumbnailUrl;a._playlistBlobUrls=a._playlistBlobUrls||[];a.localFileUrls=a.localFileUrls||[];a.getFileExtension=function(c){var h=c.lastIndexOf(".");return h!==-1?c.substring(h).toLowerCase():""};a.isPlaylistUrl=function(c){if(!c||typeof c!=="string")return!1;c=c.split("?")[0].split("#")[0];c=a.getFileExtension(c);return c===".json"||c===".xml"};a.detectAndLoadPlaylist=function(c,h){var k=this;return new Promise(function(l,
p){var w=new XMLHttpRequest;w.open("GET",c,!0);w.timeout=15E3;w.ontimeout=function(){p(Error("Request timeout"))};w.onreadystatechange=function(){if(w.readyState===4)if(w.status>=200&&w.status<400){var v=w.responseText,E=null,D=c.split("?")[0].split("#")[0];D=k.getFileExtension(D);if(D===".json")try{E=JSON.parse(v)}catch(B){p(Error("JSON parse error"));return}else if(D===".xml")try{E=k.parsePlaylistXML(v)}catch(B){p(Error("XML parse error"));return}else try{E=JSON.parse(v)}catch(B){try{E=k.parsePlaylistXML(v)}catch(G){p(Error("Parse error"));
return}}k.isValidPlaylistData(E)?(k._applyPlaylistData(E,c,h!==!1),l(E)):p(Error("Not a playlist format"))}else p(Error("HTTP error: "+w.status))};w.onerror=function(){p(Error("Network error"))};w.send()})};a.initializeDragDrop=function(){if(a._config.localPlayback){var c=a.playerContainer||a.playerElm;c&&(a._bodyDragEvents=["dragenter","dragover","dragleave","drop"],a._bodyDragEvents.forEach(function(h){c.addEventListener(h,a.preventDefaults,!1);document.body.addEventListener(h,a.preventDefaults,
!1)}),["dragenter","dragover"].forEach(function(h){c.addEventListener(h,a.highlight,!1)}),["dragleave","drop"].forEach(function(h){c.addEventListener(h,a.unhighlight,!1)}),c.addEventListener("drop",a.handleDrop,!1))}};a.preventDefaults=function(c){c.preventDefault();c.stopPropagation()};a.highlight=function(c){a._config.localPlayback&&(c=a.playerContainer||a.playerElm,ka(c,"zwp-drag-over"),a.localPlaybackHint&&a.localPlaybackHint.style.display!=="none"&&ka(c,"zwp-drag-over-no-prompt"))};a.unhighlight=
function(c){c=a.playerContainer||a.playerElm;ja(c,"zwp-drag-over");ja(c,"zwp-drag-over-no-prompt")};a._getFileFingerprint=function(c){return c.name+"::"+c.size+"::"+c.lastModified};a.handleDrop=function(c){a._config.localPlayback&&(c=c.dataTransfer.files,c.length>0&&a.handleFiles(c))};a.handleFiles=function(c){c=Array.prototype.slice.call(c);var h=0,k=0,l=0,p=0,w=0,v=0,E=0,D=0,B=0,G=[],N=[],I=[],C=[],g=[],q=[],A=[],M=[],J=[],T=a.murl||a._config.url;c=c.map(function(b){return a.detectFileType(b).then(function(S){S===
"video"?(h++,G.push({file:b,type:S})):S==="subtitle"?(k++,N.push({file:b,type:S})):S==="chapter"?(l++,I.push({file:b,type:S})):S==="playlist"?p<1&&(p++,C.push({file:b,type:S,parsedData:b._parsedPlaylistData||null})):S==="annotation"?(w++,g.push({file:b,type:S,parsedData:b._parsedAnnotationData||null})):S==="thumbnail"?(v++,q.push({file:b,type:S,parsedData:b._parsedThumbnailData||null})):S==="watermark"?(E++,A.push({file:b,type:S,parsedData:b._parsedWatermarkData||null})):S==="audioTrack"?(D++,M.push({file:b,
type:S})):S==="unknown"&&(S=a.getFileExtension(b.name),S===".jpg"||S===".jpeg"||S===".png"||S===".webp")&&(B++,J.push({file:b,type:"image"}))}).catch(function(S){a.toast(K("unsupportedFormat","Unsupported format")+": "+b.name,3E3,!0)})});Promise.all(c).then(function(){var b=G,S=a.playlistState.isLocal===!0;if(b.length>0&&a._localFileFingerprints&&a._localFileFingerprints.size>0){var H=b.length;G=b=b.filter(function(ba){return!a._localFileFingerprints.has(a._getFileFingerprint(ba.file))});H-=b.length;
H>0&&a.toast(K("duplicateFilesSkipped","Skipped {0} duplicate file(s)").replace("{0}",H),3E3,!1)}if(C.length>0)S=C[0],a._playlistBlobUrls&&a._playlistBlobUrls.length>0&&(a._playlistBlobUrls.forEach(function(ba){URL.revokeObjectURL(ba)}),a._playlistBlobUrls=[]),a.playlistState.isLocal=!1,a.loadPlaylistFromFile(S.file,S.parsedData);else if(b.length>=2)H=a._matchFilesByBaseName(b,N,I,g,q,A,M),H.imageFiles=J,S?a._appendToLocalPlaylist(H):a._buildLocalFilePlaylist(H);else if(b.length===1){H={matched:[{video:b[0].file,
subtitle:[],audioTracks:[],chapter:null,annotation:null,thumbnail:null,watermark:null}],unmatched:[]};var V=a.getBaseFilename(b[0].file.name).toLowerCase();b=!(!a._config||!a._config.subtitleStrictMatch);var P=N.map(function(ba){var ha=a.getBaseFilename(ba.file.name).toLowerCase();return{file:ba.file,score:Eb(ha,V)}}).sort(function(ba,ha){return ha.score-ba.score});b=(b?P.filter(function(ba){return ba.score>0}):P).map(function(ba){return ba.file});P=I.filter(function(ba){ba=a.getBaseFilename(ba.file.name).toLowerCase();
return ba===V||ba===V+"_chapter"});var U=g.filter(function(ba){ba=a.getBaseFilename(ba.file.name).toLowerCase();return ba===V||ba===V+"_annotation"}),W=q.filter(function(ba){ba=a.getBaseFilename(ba.file.name).toLowerCase();return ba===V||ba===V+"_thumbnail"}),ca=A.filter(function(ba){ba=a.getBaseFilename(ba.file.name).toLowerCase();return ba===V||ba===V+"_watermark"});P.length===0&&I.length>0&&(P=[I[0]]);U.length===0&&g.length>0&&(U=[g[0]]);W.length===0&&q.length>0&&(W=[q[0]]);ca.length===0&&A.length>
0&&(ca=[A[0]]);b.length>0&&(H.matched[0].subtitle=b.slice(0,10));P.length>0&&(H.matched[0].chapter=P[0].file);U.length>0&&(H.matched[0].annotation=U[0].file);W.length>0&&(H.matched[0].thumbnail=W[0].file,H.matched[0].parsedThumbnailData=W[0].parsedData);ca.length>0&&(H.matched[0].watermark=ca[0].file,H.matched[0].parsedWatermarkData=ca[0].parsedData);M.length>0&&(b=M.map(function(ba){var ha=a.getBaseFilename(ba.file.name).toLowerCase();return{file:ba.file,score:Eb(ha,V)}}).sort(function(ba,ha){return ha.score-
ba.score}).map(function(ba){return ba.file}),H.matched[0].audioTracks=b.slice(0,10));H.imageFiles=J;S?a._appendToLocalPlaylist(H):a._buildLocalFilePlaylist(H)}else if(N.length>0||I.length>0||g.length>0||q.length>0||A.length>0||M.length>0)if(S&&a.playlistState.currentItem){if(S=a._findPlaylistItemById(a.playlistState.currentItem.id)){if(N.length>0){a._closePanel("subtitleSearchPanel");var la=(S.name||"").toLowerCase();H=N.slice(0,10).map(function(ba){return a._localSubFileToObj(ba.file,la)});S.subtitle=
H;H.forEach(function(ba,ha){a.loadSubtitle(ba.url,ha<2?(ha+1).toString():"",ba.title,!ba.langFromName)});a.toast(N.length===1?K("subtitleLoaded","Subtitle loaded"):K("subtitleLoadedN","{0} subtitles loaded").replace("{0}",N.length),2E3,!1)}I.length>0&&a._config.chapterButton!==!1&&(S.chapter=I[0].file,a._closePanel("chapterSearchPanel"),a.chapters=I[0].file,a._config.chapterButton=!0,a.loadChapters(),a.toast(K("chapterLinked","Chapter linked to current item"),2E3,!1));g.length>0&&(H=URL.createObjectURL(g[0].file),
a._playlistBlobUrls.push(H),S.annotation=H,a.loadAnnotations(H),a.toast(K("annotationLinked","Annotation linked to current item"),2E3,!1));q.length>0&&(a.loadLocalThumbnails(q,J),a.toast(K("thumbnailLinked","Thumbnail linked to current item"),2E3,!1));M.length>0&&a.addAudioTrack&&(H=M.slice(0,10).map(function(ba){return a._localAudioFileToObj(ba.file)}),S.audioTracks=H,H.forEach(function(ba){a.addAudioTrack(ba.url,ba.language,ba.label)}),a.toast(M.length===1?K("audioTrackLoaded","Audio track loaded"):
K("audioTrackLoadedN","{0} audio tracks loaded").replace("{0}",M.length),2E3,!1))}}else if(T){if(N.length>0){S=a.murl||a._config.url||"";var na="";S&&(S=S.match(/([^\/\\]+?)(\?|$)/))&&(na=a.getBaseFilename(S[1]).toLowerCase());a._closePanel("subtitleSearchPanel");N.forEach(function(ba,ha){ha=(ha+1).toString();var fa=a.getBaseFilename(ba.file.name).toLowerCase(),Ga=Xb(ba.file.name,a.getBaseFilename.bind(a),ha,na);a.loadSubtitle(ba.file,ha,Ga,!vb(fa))});a.toast(N.length===1?K("subtitleLoaded","Subtitle loaded"):
K("subtitleLoadedN","{0} subtitles loaded").replace("{0}",N.length),2E3,!1)}I.length>0&&(a._closePanel("chapterSearchPanel"),a._config.chapterButton!==!1&&(a.chapters=I[0].file,a._config.chapterButton=!0,a.loadChapters(),a.toast(K("chapterLoaded","Chapter loaded"),2E3,!1)));g.length>0&&(S=URL.createObjectURL(g[0].file),a._playlistBlobUrls.push(S),a.loadAnnotations(S),a.toast(K("annotationLoaded","Annotation loaded"),2E3,!1));q.length>0&&(a.loadLocalThumbnails(q,J),a.toast(K("thumbnailLoaded","Thumbnail loaded"),
2E3,!1));M.length>0&&a.addAudioTrack&&(M.slice(0,10).forEach(function(ba){ba=a._localAudioFileToObj(ba.file);a.addAudioTrack(ba.url,ba.language,ba.label)}),a.toast(M.length===1?K("audioTrackLoaded","Audio track loaded"):K("audioTrackLoadedN","{0} audio tracks loaded").replace("{0}",M.length),2E3,!1))}else a.toast(K("subtitleChapterNoVideo","Selected subtitle/chapter/annotation/watermark/audio files have no video to attach to, ignored"),3E3,!0)}).catch(function(b){a.toast(K("loadFailed","Load failed"),
3E3,!0)})};a.loadPlaylistFromFile=function(c,h){a.murl&&a.stop();h&&a.isValidPlaylistData(h)?(a._applyPlaylistData(h,"local_"+c.name,!!a._config.autoplay),a.toast(K("playlistLoaded","Playlist loaded")+": "+c.name,2E3,!1)):(h=new FileReader,h.onload=function(k){try{var l=k.target.result;k=null;var p=a.getFileExtension(c.name);if(p===".json")try{k=JSON.parse(l)}catch(w){a.toast(K("playlistParseError","Failed to parse playlist"),3E3,!0);return}else if(p===".xml")try{k=a.parsePlaylistXML(l)}catch(w){a.toast(K("playlistParseError",
"Failed to parse playlist"),3E3,!0);return}a.isValidPlaylistData(k)?(a._applyPlaylistData(k,"local_"+c.name,!!a._config.autoplay),a.toast(K("playlistLoaded","Playlist loaded")+": "+c.name,2E3,!1)):a.toast(K("playlistParseError","Failed to parse playlist"),3E3,!0)}catch(w){a.toast(K("playlistParseError","Failed to parse playlist"),3E3,!0)}},h.onerror=function(){a.toast(K("loadFailed","Load failed"),3E3,!0)},h.readAsText(c))};a.uploadFile=async function(c){if(a._config.localPlayback){a.playlistState.data&&
a._clearPlaylistState();var h={file:c,name:c.name,size:c.size,lastModified:c.lastModified,type:c.type,timestamp:(new Date).toISOString()};typeof a._config.onFileSelected==="function"&&a._config.onFileSelected.call(a,h);var k=await a.detectMimeType(c);h.detectedMime=k;await a.isValidVideoFile(c,k)?(k=URL.createObjectURL(c),h.url=k,a.loadingOverlay&&(a.loadingOverlay.style.display="block"),a.playLocalFile(k,c.name,h),typeof a._config.onFileLoaded==="function"&&a._config.onFileLoaded.call(a,h)):(h.error=
K("unsupportedFormat","Unsupported format"),h.errorCode="UNSUPPORTED_FORMAT",typeof a._config.onFileError==="function"&&a._config.onFileError.call(a,h),a.toast(K("unsupportedFormat","Unsupported format")+": "+k,3E3,!0))}else a.toast(K("localFileDisabled","Local file playback is disabled"),3E3,!0)};a._mimeCache=new Map;a.detectMimeType=async function(c){var h=c.name+"_"+c.size+"_"+c.lastModified;if(a._mimeCache.has(h))return a._mimeCache.get(h);var k;try{var l=await a.readFileHeader(c,16),p=a.detectMimeTypeFromHeader(l);
p&&(k=p)}catch(w){}!k&&c.type&&c.type!==""&&(k=c.type);k||(c=a.getFileExtension(c.name),k=a.getMimeFromExtension(c)||"application/octet-stream");a._mimeCache.size>=200&&a._mimeCache.delete(a._mimeCache.keys().next().value);a._mimeCache.set(h,k);return k};a.readFileHeader=function(c,h){return new Promise(function(k,l){var p=new FileReader;p.onload=function(w){k(w.target.result)};p.onerror=l;p.readAsArrayBuffer(c.slice(0,h))})};a.detectMimeTypeFromHeader=function(c){if(!c||c.byteLength===0)return null;
c=new Uint8Array(c);return c.length>=8&&c[4]===102&&c[5]===116&&c[6]===121&&c[7]===112?"video/mp4":c.length>=4&&c[0]===26&&c[1]===69&&c[2]===223&&c[3]===163?"video/webm":c.length>=12&&c[0]===82&&c[1]===73&&c[2]===70&&c[3]===70&&c[8]===65&&c[9]===86&&c[10]===73&&c[11]===32?"video/x-msvideo":c.length>=8&&(c[4]===109&&c[5]===111&&c[6]===118&&c[7]===101||c[4]===102&&c[5]===114&&c[6]===101&&c[7]===101)?"video/quicktime":c.length>=4&&c[0]===70&&c[1]===76&&c[2]===86&&c[3]===1?"video/x-flv":c.length>=4&&
c[0]===26&&c[1]===69&&c[2]===223&&c[3]===163?"video/x-matroska":c.length>=16&&c[0]===48&&c[1]===38&&c[2]===178&&c[3]===117&&c[8]===6&&c[9]===230?"video/x-ms-wmv":c.length>=4&&(c[0]===71&&c[1]===64||c[0]===71&&(c[1]&240)===64)?"video/mp2t":null};a.getBaseFilename=function(c){if(!c)return"";var h=c,k=Math.max(c.lastIndexOf("/"),c.lastIndexOf("\\"));k!==-1&&(h=c.substring(k+1));c=h.lastIndexOf(".");c!==-1&&(h=h.substring(0,c));return h};a._matchFilesByBaseName=function(c,h,k,l,p,w,v){var E=this,D=[],
B={};k.forEach(function(b){var S=E.getBaseFilename(b.file.name).toLowerCase();B[S]||(B[S]=[]);B[S].push(b.file)});var G={};(l||[]).forEach(function(b){var S=E.getBaseFilename(b.file.name).toLowerCase();G[S]||(G[S]=[]);G[S].push(b.file)});var N={};(p||[]).forEach(function(b){var S=E.getBaseFilename(b.file.name).toLowerCase();N[S]||(N[S]=[]);N[S].push(b)});var I={};(w||[]).forEach(function(b){var S=E.getBaseFilename(b.file.name).toLowerCase();I[S]||(I[S]=[]);I[S].push(b)});var C={},g=[];h.forEach(function(b){for(var S=
E.getBaseFilename(b.file.name).toLowerCase(),H=-1,V=0,P=0;P<c.length;P++){var U=E.getBaseFilename(c[P].file.name).toLowerCase();U=Eb(S,U);U>V&&(V=U,H=P)}H>=0&&V>0?(C[H]||(C[H]=[]),C[H].push(b.file)):g.push(b.file)});var q={},A=[];(v||[]).forEach(function(b){for(var S=E.getBaseFilename(b.file.name).toLowerCase(),H=-1,V=0,P=0;P<c.length;P++){var U=E.getBaseFilename(c[P].file.name).toLowerCase();U=Eb(S,U);U>V&&(V=U,H=P)}H>=0&&V>0?(q[H]||(q[H]=[]),q[H].push(b.file)):A.push(b.file)});c.forEach(function(b,
S){var H=E.getBaseFilename(b.file.name).toLowerCase(),V=B[H];V?delete B[H]:(V=B[H+"_chapter"])&&delete B[H+"_chapter"];var P=G[H];P?delete G[H]:(P=G[H+"_annotation"])&&delete G[H+"_annotation"];var U=N[H];U?delete N[H]:(U=N[H+"_thumbnail"])&&delete N[H+"_thumbnail"];var W=I[H];W?delete I[H]:(W=I[H+"_watermark"])&&delete I[H+"_watermark"];H=(C[S]||[]).slice(0,10);S=(q[S]||[]).slice(0,10);D.push({video:b.file,subtitle:H,audioTracks:S,chapter:V?V[0]:null,annotation:P?P[0]:null,thumbnail:U?U[0].file:
null,parsedThumbnailData:U?U[0].parsedData:null,watermark:W?W[0].file:null,parsedWatermarkData:W?W[0].parsedData:null})});h=[];for(var M in B)B.hasOwnProperty(M)&&(h=h.concat(B[M]));M=[];for(var J in G)G.hasOwnProperty(J)&&(M=M.concat(G[J]));J=[];for(var T in N)N.hasOwnProperty(T)&&(J=J.concat(N[T].map(function(b){return b.file})));return{matched:D,unmatchedSubtitles:g,unmatchedChapters:h,unmatchedHotspots:M,unmatchedThumbnails:J,unmatchedAudios:A}};a._processLocalThumbnailObject=function(c,h,k){if(!c||
!h)return null;c=h.thumbnail?h.thumbnail:h;if(c.url&&c.url.indexOf("http://")!==0&&c.url.indexOf("https://")!==0&&c.url.indexOf("//")!==0){h=null;for(var l=0;l<k.length;l++){var p=k[l].file||k[l];if(p.name===c.url){h=p;break}}h&&(k=URL.createObjectURL(h),a._playlistBlobUrls.push(k),c.url=k)}return c};a.loadLocalThumbnails=function(c,h){if(c&&c.length!==0&&(c=c[0],h=a._processLocalThumbnailObject(c.file,c.parsedData||c.parsedThumbnailData,h)))if(h.url){if(a._config.thumbnails=JSON.parse(JSON.stringify(h)),
typeof e==="function"&&e(a),a.progressBar&&a.progressBar.rail&&(h=a.progressBar.rail.querySelector(".zwp__time-float"))){c=h.querySelector(".zwp__time-thumbnail");c||(h.insertAdjacentHTML("afterbegin",'<div class="zwp__time-thumbnail"></div>'),c=h.querySelector(".zwp__time-thumbnail"),a.progressBar.thumbnails=c);var k=a._config.thumbnails;k.rowsize=typeof k.row==="number"?k.row:Math.ceil(Math.sqrt(k.total));c.style.maxWidth="none";c.style.maxHeight="none";c.style.width=k.width+"px";c.style.height=
k.height+"px";c.style.backgroundImage="url("+k.url+")";h.style.width=4+k.width+"px";h.style.height=4+k.height+"px";ka(h,"zwp__thumbnail")}}else a.toast(K("thumbnailImageNotFound","Thumbnail image not found in dropped files"),3E3,!0)};a._localSubFileToObj=function(c,h){if(typeof c==="string"||c&&c.url)return c;var k=URL.createObjectURL(c);this._playlistBlobUrls.push(k);var l=this.getBaseFilename(c.name);c=Xb(c.name,this.getBaseFilename.bind(this),"",h);l=!!vb(l.toLowerCase());return{url:k,title:c,
langFromName:l}};a._localAudioFileToObj=function(c){if(typeof c==="string"||c&&c.url)return c;var h=URL.createObjectURL(c);this._playlistBlobUrls.push(h);c=this.getBaseFilename(c.name).replace(/[._-](dub|audio|audiotrack)$/i,"");var k=vb(c.toLowerCase())||"";return{url:h,language:k,label:c}};var d=[],r=0,n=null;a._buildLocalFilePlaylist=function(c){var h=this;h.murl&&h.stop();!h.playlistState.isLocal&&h.playlistState.data&&h._clearPlaylistState();h._playlistBlobUrls&&h._playlistBlobUrls.forEach(function(v){URL.revokeObjectURL(v)});
h._playlistBlobUrls=[];h._localFileFingerprints=new Set;c.matched.sort(function(v,E){return v.video.name.localeCompare(E.video.name,void 0,{numeric:!0})});var k=c.matched.map(function(v,E){var D=URL.createObjectURL(v.video);h._playlistBlobUrls.push(D);h._localFileFingerprints.add(h._getFileFingerprint(v.video));var B="";v.annotation&&(B=URL.createObjectURL(v.annotation),h._playlistBlobUrls.push(B));var G=h._processLocalThumbnailObject(v.thumbnail,v.parsedThumbnailData,c.imageFiles||[]),N=h._getFileFingerprint(v.video),
I=h.getBaseFilename(v.video.name).toLowerCase(),C=(v.subtitle||[]).map(function(A){return h._localSubFileToObj(A,I)}),g=(v.audioTracks||[]).map(function(A){return h._localAudioFileToObj(A)}),q=typeof h.inferMediaKind==="function"?h.inferMediaKind(v.video.name,v.video.name):"video";v={id:"local_"+E,name:h.getBaseFilename(v.video.name)||v.video.name,url:D,type:"auto",mediaKind:q,subtitle:C,audioTracks:g,chapter:v.chapter||"",annotation:B,_fingerprint:N};G&&(v.thumbnails=G);return v}),l={zwp_protocol:"ZWMAP/1.0",
zwp_type:"playlist",title:K("localFiles","Local Files"),autoPlayNext:!0,groups:[{id:"local_default",name:K("localFiles","Local Files"),items:k}]};h._applyPlaylistData(l,"local_files",!!h._config.autoplay);h.playlistState.isLocal=!0;h.toast(K("playlistCreated","Playlist created")+": "+k.length+" "+K("videos","videos"),2E3,!1);var p=h._mode==="preview"?480:void 0,w=h.playlistState.data&&h.playlistState.data.groups[0]?h.playlistState.data.groups[0].items:[];c.matched.forEach(function(v,E){var D=w[E];
D&&D.mediaKind!=="audio"&&!D.poster&&v.video&&y(h,v,D,{maxDim:p,isFirst:E===0})})};a._appendToLocalPlaylist=function(c){var h=this;if(h.playlistState.data&&h.playlistState.data.groups.length){c.matched.sort(function(v,E){return(v.video?v.video.name:v.name||"").localeCompare(E.video?E.video.name:E.name||"",void 0,{numeric:!0})});var k=h.playlistState.data.groups[0],l=k.items.length;c.matched.forEach(function(v,E){var D=v.video,B=URL.createObjectURL(D);h._playlistBlobUrls.push(B);h._localFileFingerprints.add(h._getFileFingerprint(D));
var G="";v.annotation&&(G=URL.createObjectURL(v.annotation),h._playlistBlobUrls.push(G));var N=h._processLocalThumbnailObject(v.thumbnail,v.parsedThumbnailData,c.imageFiles||[]),I=h._getFileFingerprint(D),C=h.getBaseFilename(D.name).toLowerCase(),g=(v.subtitle||[]).map(function(A){return h._localSubFileToObj(A,C)}),q=(v.audioTracks||[]).map(function(A){return h._localAudioFileToObj(A)});v={id:"local_"+(l+E),name:h.getBaseFilename(D.name)||D.name,url:B,type:"auto",subtitle:g,audioTracks:q,chapter:v.chapter||
"",annotation:G,_fingerprint:I};N&&(v.thumbnails=N);k.items.push(v)});h.renderPlaylistItems();h.toast(K("addedToPlaylist","Added")+": "+c.matched.length+" "+K("videos","videos"),2E3,!1);var p=h._mode==="preview"?480:void 0;c.matched.forEach(function(v,E){(E=k.items[l+E])&&E.mediaKind!=="audio"&&!E.poster&&v.video&&y(h,v,E,{maxDim:p,isFirst:!1})});if(h._config.autoplay&&h.videoEl&&(h.videoEl.paused||h.videoEl.ended||!h.isPlaying)){var w=k.items[l];w&&h.playPlaylistItem(w)}}};a._removeLocalPlaylistItem=
function(c){if(this.playlistState.isLocal&&this.playlistState.data){var h=this.playlistState.data.groups[0];if(h&&h.items){for(var k=-1,l=0;l<h.items.length;l++)if(h.items[l].id===c){k=l;break}if(k!==-1){k=h.items.splice(k,1)[0];if(c=!(!this.playlistState.currentItem||this.playlistState.currentItem.id!==c))this.playlistState.currentItem=null;if(c&&this.videoEl&&this.videoEl.src===k.url){try{this.videoEl.pause()}catch(p){}this.videoEl.removeAttribute("src");try{this.videoEl.load()}catch(p){}}k.url&&
k.url.indexOf("blob:")===0&&(URL.revokeObjectURL(k.url),c=this._playlistBlobUrls.indexOf(k.url),c!==-1&&this._playlistBlobUrls.splice(c,1));this._localFileFingerprints&&k._fingerprint&&this._localFileFingerprints.delete(k._fingerprint);h.items.length===0?this._resetLocalPlaylistItems():this.renderPlaylistItems()}}}};a._resetLocalPlaylistItems=function(){this._playlistBlobUrls&&(this._playlistBlobUrls.forEach(function(c){URL.revokeObjectURL(c)}),this._playlistBlobUrls=[]);this.playlistState.data&&
this.playlistState.data.groups&&this.playlistState.data.groups.length>0&&(this.playlistState.data.groups[0].items=[]);this.playlistState.currentItem=null;this._localFileFingerprints=new Set;this.renderPlaylistItems();this.toast(K("playlistCleared","Playlist cleared"),2E3,!1)};a._clearPlaylistState=function(){this._playlistBlobUrls&&(this._playlistBlobUrls.forEach(function(h){URL.revokeObjectURL(h)}),this._playlistBlobUrls=[]);this.playlistState.data=null;this.playlistState.currentItem=null;this.playlistState.currentGroup=
null;this.playlistState.isLocal=!1;this._localFileFingerprints=new Set;this.playlistPanel&&(this.playlistPanel.style.display="none");var c=this.controlbar&&this.controlbar.querySelector(".zwp-playlistButton");c&&c.remove()};a._findPlaylistItemById=function(c){if(!this.playlistState.data||!this.playlistState.data.groups)return null;for(var h=0;h<this.playlistState.data.groups.length;h++){var k=this.playlistState.data.groups[h].items;if(k)for(var l=0;l<k.length;l++)if(k[l].id===c)return k[l]}return null};
a.getMimeFromExtension=function(c){return{".mp4":"video/mp4",".webm":"video/webm",".ogg":"video/ogg",".ogv":"video/ogg",".mov":"video/quicktime",".avi":"video/x-msvideo",".wmv":"video/x-ms-wmv",".flv":"video/x-flv",".mkv":"video/x-matroska",".3gp":"video/3gpp",".3g2":"video/3gpp2",".m4v":"video/x-m4v",".ts":"video/mp2t",".m4a":"audio/mp4",".mp3":"audio/mpeg",".wav":"audio/wav",".flac":"audio/flac",".opus":"audio/opus",".m3u8":"application/x-mpegURL",".dash":"application/dash+xml",".srt":"text/plain",
".vtt":"text/vtt",".webvtt":"text/vtt",".ass":"text/plain",".ssa":"text/plain",".sub":"text/plain",".sbv":"text/plain",".txt":"text/plain",".bcc":"application/json",".json":"application/json"}[c]||null};a.isValidVideoFile=async function(c,h){var k=".mp4 .webm .ogg .ogv .mov .mkv .m4v .flac .wav .m4a .mp3 .opus".split(" ");c=c.name.toLowerCase();for(var l=".srt .vtt .webvtt .ass .ssa .sub .sbv .txt .bcc".split(" "),p=0;p<l.length;p++)if(c.endsWith(l[p]))return!1;if("video/mp4 video/webm video/ogg video/ogv video/quicktime video/x-matroska video/x-m4v video/H264 video/h264 audio/wav audio/x-wav audio/flac audio/opus audio/mp4 audio/mpeg audio/ogg".split(" ").indexOf(h)!==
-1)return!0;if("video/mp2t video/3gpp video/avi video/x-ms-wmv video/x-flv video/x-msvideo video/MP2T application/vnd.apple.mpegurl application/x-mpegURL application/dash+xml".split(" ").indexOf(h)!==-1||h&&h.startsWith("text/"))return!1;if(h&&(h.startsWith("video/")||h.startsWith("audio/")))return!0;for(p=0;p<k.length;p++)if(c.endsWith(k[p]))return!0;return!1};a.readContentFromSource=async function(c){if(typeof c==="object"&&c instanceof File)return await a.readFileContent(c);if(typeof c==="string")try{return await (await fetch(c)).text()}catch(h){throw h;
}throw Error("Unsupported source type");};a.validateJsonContent=async function(c,h){try{var k=await a.readContentFromSource(c),l=JSON.parse(k);if(h==="subtitle"){if(l.hasOwnProperty("body")&&Array.isArray(l.body))return!0}else if(h==="chapter"){if(Array.isArray(l)&&l.length>0){var p=l[0];if(p.hasOwnProperty("title")&&p.hasOwnProperty("time"))return!0}if(l&&!Array.isArray(l)&&l.zwp_protocol&&typeof l.zwp_protocol==="string"&&l.zwp_protocol.indexOf("ZWMAP/")===0&&l.zwp_type==="chapter"&&Array.isArray(l.chapters)&&
l.chapters.length>0)return!0}return!1}catch(w){return!1}};a.isValidAudioTrackFile=function(c,h,k){return".mp3 .m4a .aac .ogg .wav .flac .opus".split(" ").indexOf(h)!==-1||k&&k.indexOf("audio/")===0?!0:!1};a.isValidSubtitleFile=async function(c,h){for(var k=[".srt",".vtt",".webvtt",".bcc"],l=c.name.toLowerCase(),p=0;p<k.length;p++)if(l.endsWith(k[p]))return!0;return["text/plain","text/srt","text/vtt","text/webvtt"].indexOf(h)!==-1?!0:l.endsWith(".json")||h==="application/json"?await a.validateJsonContent(c,
"subtitle"):!1};a.isValidChapterFile=async function(c,h){for(var k=[".vtt",".webvtt"],l=c.name.toLowerCase(),p=0;p<k.length;p++)if(l.endsWith(k[p]))return!0;return["text/plain","text/vtt","text/webvtt","application/x-chapters"].indexOf(h)!==-1||h&&h.startsWith("text/")?!0:l.endsWith(".json")||h==="application/json"?await a.validateJsonContent(c,"chapter"):!1};a.readFileContent=function(c){return new Promise(function(h,k){var l=new FileReader;l.onload=function(p){h(p.target.result)};l.onerror=function(){k(Error("Failed to read file: "+
c.name))};l.readAsText(c)})};a.truncateFilename=function(c){if(!c)return c;for(var h=0,k=0,l=0;l<c.length;l++)if(h=c.charAt(l).match(/[\u4e00-\u9fff]/)?h+2:h+1,h<=12)k=l+1;else break;return h<=12?c:c.substring(0,k)+"..."};a.isPlaylistFile=async function(c){var h=a.getFileExtension(c.name);return h!==".json"&&h!==".xml"?!1:new Promise(function(k){var l=new FileReader;l.onload=function(p){try{var w=p.target.result;p=null;if(h===".json")try{p=JSON.parse(w)}catch(v){k(!1);return}else if(h===".xml")try{p=
a.parsePlaylistXML(w)}catch(v){k(!1);return}a.isValidPlaylistData(p)?k(p):k(!1)}catch(v){k(!1)}};l.onerror=function(){k(!1)};l.readAsText(c)})};a.isAnnotationFile=async function(c){return a.getFileExtension(c.name)!==".json"?!1:new Promise(function(h){if(c._parsedContent){var k=c._parsedContent;k&&k.zwp_protocol&&typeof k.zwp_protocol==="string"&&k.zwp_protocol.indexOf("ZWMAP/")===0&&k.zwp_type==="annotation"?h(k):h(!1)}else k=new FileReader,k.onload=function(l){try{var p=JSON.parse(l.target.result);
(c._parsedContent=p)&&p.zwp_protocol&&typeof p.zwp_protocol==="string"&&p.zwp_protocol.indexOf("ZWMAP/")===0&&p.zwp_type==="annotation"?h(p):h(!1)}catch(w){h(!1)}},k.onerror=function(){h(!1)},k.readAsText(c)})};a.isThumbnailFile=async function(c){return a.getFileExtension(c.name)!==".json"?!1:new Promise(function(h){if(c._parsedContent){var k=c._parsedContent;k&&k.zwp_protocol&&typeof k.zwp_protocol==="string"&&k.zwp_protocol.indexOf("ZWMAP/")===0&&k.zwp_type==="thumbnail"?h(k):k&&typeof k.url===
"string"&&k.url.length>0&&typeof k.width==="number"&&k.width>0&&typeof k.height==="number"&&k.height>0&&typeof k.total==="number"&&k.total>0&&Number.isInteger(k.width)&&Number.isInteger(k.height)&&Number.isInteger(k.total)?h(k):h(!1)}else k=new FileReader,k.onload=function(l){try{var p=JSON.parse(l.target.result);(c._parsedContent=p)&&p.zwp_protocol&&typeof p.zwp_protocol==="string"&&p.zwp_protocol.indexOf("ZWMAP/")===0&&p.zwp_type==="thumbnail"?h(p):p&&typeof p.url==="string"&&p.url.length>0&&typeof p.width===
"number"&&p.width>0&&typeof p.height==="number"&&p.height>0&&typeof p.total==="number"&&p.total>0&&Number.isInteger(p.width)&&Number.isInteger(p.height)&&Number.isInteger(p.total)?h(p):h(!1)}catch(w){h(!1)}},k.onerror=function(){h(!1)},k.readAsText(c)})};a.isWatermarkFile=async function(c){return a.getFileExtension(c.name)!==".json"?!1:new Promise(function(h){if(c._parsedContent){var k=c._parsedContent;k&&k.zwp_protocol&&typeof k.zwp_protocol==="string"&&k.zwp_protocol.indexOf("ZWMAP/")===0&&k.zwp_type===
"watermark"?h(k):k&&Array.isArray(k.watermarks)?h(k):h(!1)}else k=new FileReader,k.onload=function(l){try{var p=JSON.parse(l.target.result);(c._parsedContent=p)&&p.zwp_protocol&&typeof p.zwp_protocol==="string"&&p.zwp_protocol.indexOf("ZWMAP/")===0&&p.zwp_type==="watermark"?h(p):p&&Array.isArray(p.watermarks)?h(p):h(!1)}catch(w){h(!1)}},k.onerror=function(){h(!1)},k.readAsText(c)})};a.detectFileType=async function(c){var h=c.name.toLowerCase(),k=a.getFileExtension(h),l=a.getBaseFilename(h);h=await a.detectMimeType(c);
if(/[._-]chapters?$/i.test(l)){var p=[".vtt",".webvtt",".json"];if(p.indexOf(k)!==-1&&(p=await a.isValidChapterFile(c,h)))return"chapter"}if(/[._-]annotation$/i.test(l)&&k===".json"&&(p=await a.isAnnotationFile(c)))return c._parsedAnnotationData=p,"annotation";if(/[._-]thumbnail$/i.test(l)&&k===".json"&&(p=await a.isThumbnailFile(c)))return c._parsedThumbnailData=p,"thumbnail";if(/[._-](watermark|wm)$/i.test(l)&&k===".json"&&(p=await a.isWatermarkFile(c)))return c._parsedWatermarkData=p,"watermark";
if(/[._-]subtitle$/i.test(l)&&(p=[".srt",".vtt",".webvtt",".bcc",".json"],p.indexOf(k)!==-1&&await a.isValidSubtitleFile(c,h)))return"subtitle";if(/[._-](dub|audio|audiotrack)$/i.test(l)&&a.isValidAudioTrackFile(c,k,h))return"audioTrack";if(k===".json"||k===".xml")if(l=await a.isPlaylistFile(c))return c._parsedPlaylistData=l,"playlist";if(k===".json"){if(p=await a.isAnnotationFile(c))return c._parsedAnnotationData=p,"annotation";if(p=await a.isThumbnailFile(c))return c._parsedThumbnailData=p,"thumbnail";
if(p=await a.isWatermarkFile(c))return c._parsedWatermarkData=p,"watermark"}p=[".srt",".vtt",".webvtt",".bcc",".json"];if(p.indexOf(k)!==-1&&await a.isValidSubtitleFile(c,h))return"subtitle";p=[".vtt",".webvtt",".json"];return p.indexOf(k)!==-1&&(p=await a.isValidChapterFile(c,h))?"chapter":await a.isValidVideoFile(c,h)?"video":"unknown"};a.playLocalFile=function(c,h,k){(a.murl||a._config.url)&&a.stop();a._config.url=c;a.murl=c;a.currentFileName=h;typeof a.inferMediaKind==="function"&&a.inferMediaKind(c,
h)==="audio"?(a._config.mediaKind="audio",typeof a.switchMode==="function"&&a.switchMode("music")):typeof a.switchMode==="function"&&a._mode==="music"&&(a._config.mediaKind="video",a.switchMode("standard"));a.isPlaying=!0;a.force_stopped=!1;a.loadingOverlay&&(a.loadingOverlay.style.display="flex");var l=a.playVideo();if(l){a.setupEventsHandler();a.startHideControlbar(a);a.toast(K("playingFile","playing")+": "+h,2E3,!1);var p={fileName:h,fileURL:c,timestamp:(new Date).toISOString(),source:"local"};
k&&Object.assign(p,k);typeof a._config.onLocalFilePlaybackStart==="function"&&a._config.onLocalFilePlaybackStart.call(a,p);a.updateLocalPlaybackHint&&a.updateLocalPlaybackHint();a.localFileUrls||(a.localFileUrls=[]);a.localFileUrls.push(c);a.videoEl.addEventListener("loadeddata",function(){a.setplaystate(!0);var w={fileName:h,fileURL:c,duration:a.videoEl.duration,videoWidth:a.videoEl.videoWidth,videoHeight:a.videoEl.videoHeight,currentTime:a.videoEl.currentTime,playbackRate:a.videoEl.playbackRate};
k&&Object.assign(w,k);typeof a._config.onLocalFileMetadataReady==="function"&&a._config.onLocalFileMetadataReady.call(a,w)},{once:!0});a.videoEl.readyState>=2&&(a.setplaystate(!0),p={fileName:h,fileURL:c,duration:a.videoEl.duration,videoWidth:a.videoEl.videoWidth,videoHeight:a.videoEl.videoHeight,currentTime:a.videoEl.currentTime,playbackRate:a.videoEl.playbackRate},k&&Object.assign(p,k),typeof a._config.onLocalFileMetadataReady==="function"&&a._config.onLocalFileMetadataReady.call(a,p))}else p={fileName:h,
fileURL:c,error:K("unsupportedFormat","Unsupported format"),errorCode:"PLAYBACK_FAILED",timestamp:(new Date).toISOString()},k&&Object.assign(p,k),typeof a._config.onLocalFilePlaybackError==="function"&&a._config.onLocalFilePlaybackError.call(a,p),a.toast(K("unsupportedFormat","Unsupported format"),3E3,!0),a.loadingOverlay&&(a.loadingOverlay.style.display="none"),a.isPlaying=!1,a._config.url=null,a.murl=null;return l};a.cleanupLocalFiles=function(){this.localFileUrls&&(this.localFileUrls.forEach(function(c){URL.revokeObjectURL(c)}),
this.localFileUrls=[]);this._playlistBlobUrls&&this._playlistBlobUrls.length>0&&(this._playlistBlobUrls.forEach(function(c){URL.revokeObjectURL(c)}),this._playlistBlobUrls=[]);this._bodyDragEvents&&this.preventDefaults&&(this._bodyDragEvents.forEach(function(c){document.body.removeEventListener(c,this.preventDefaults,!1)},this),this._bodyDragEvents=null)};a.selectLocalFile=function(){if(a._config.localPlayback){var c=document.createElement("input");c.type="file";c.accept="video/*,.mp4,.webm,.ogg,.ogv,.mov,.mkv,.m4v,audio/*,.flac,.wav,.m4a,.mp3,.opus,.vtt,.webvtt,.srt,.json,.bcc";
c.multiple=!0;c.onchange=function(h){h=h.target.files;h.length>0&&a.handleFiles(h)};c.click()}else a.toast(K("localFileDisabled","Local file playback is disabled"),3E3,!0)};if(a.playerContainer)a.initializeDragDrop();else{var m=0,u=function(){a.playerContainer?a.initializeDragDrop():++m<100&&setTimeout(u,100)};setTimeout(u,100)}if(a._config.localPlayback){a.updateLocalPlaybackHint();if(a.localPlaybackHint){t=a.localPlaybackHint.querySelector(".zwp-local-playback-text");var f=a.localPlaybackHint.querySelector(".zwp-local-playback-subtitle");
t&&(t.textContent=Rb());f&&(f.textContent=K("supportedFormats","Supports MP4, WebM, MOV, MKV, M4V, OGG, FLAC, WAV, M4A, MP3, OPUS and other formats"));a.localPlaybackHint.setAttribute("aria-label",K("selectLocalVideo","Select Local Video File"))}a.updateDragDropText=function(){var c=document.getElementById("zwp-dragdrop-text-style");c&&c.remove();c=document.createElement("style");c.id="zwp-dragdrop-text-style";c.textContent='.zwp-drag-over::before { content: "'+K("dragDropToPlay","Drag and drop video/audio files here to play")+
'" !important; }';document.head.appendChild(c)};a.updateDragDropText()}}function Nd(a,t,z){if(!t||!z||!z.length)return a;t="";for(var y=0;y<Math.min(z.length,10)&&!(t+=(z[y].content||"")+" ",t.length>=500);y++);if(t){z=t.substring(0,500);for(var x=y=t=0,e=0,d=0,r=0,n=0,m=0,u=0;u<z.length;u++){var f=z.charCodeAt(u);f>=12352&&f<=12447?y++:f>=12448&&f<=12543?x++:f>=44032&&f<=55215?e++:f>=19968&&f<=40959||f>=13312&&f<=19903?t++:f>=1024&&f<=1279?d++:f>=1536&&f<=1791?r++:f>=3584&&f<=3711?n++:f>=65&&f<=
591&&m++}z=y+x>0&&t>0?"ja":e>0&&e>=t?"ko":t>0&&y+x+e===0?Od.test(z)?"cht":"chs":d>m&&d>0?"ru":r>m&&r>0?"ar":n>0?"th":null}else z=null;return z?K("lang_"+z,z):a}function Pd(a,t){function z(n){var m=parseInt(n.substr(1,2),16),u=parseInt(n.substr(3,2),16),f=parseInt(n.substr(5,2),16);return(.299*m+.587*u+.114*f)/255<.3?"#00BCD4":n}var y=t.httpGet,x=t.fadeOut,e=t.fadeIn,d=t.onZwpSwitch,r=t.makeSubtitleMenuItems;a.subtitleList=[];a._nextSubId=1;a._subtitleSettings={primary:{fontSize:"0.2",fontColor:"#FFFFFF",
outline:"none",position:"bottom",bgOpacity:.6,scale:!0,fade:!1},secondary:{fontSize:"0.14",fontColor:"#FFFFFF",outline:"none",position:"bottom",bgOpacity:.6,scale:!0,fade:!1}};a._subtitleActiveTab="primary";a.showSubtitle=function(n){function m(){v=w=0}var u=this;if(u.overlay_layers){var f=u.overlay_layers.querySelector(".zwp-subtitles-show");if(f){var c=!1;n?u.subtitle1&&u.subtitle2&&f.querySelector(".zwp-subtitles-viever")?f.style.display!=="block"&&(f.style.opacity=0,f.style.display="block",e(f,
500,function(){})):(Ta.removeElement(f),f.remove(),delete u.subtitleShow,delete u.subtitle1,delete u.subtitle2,c=!0):x(f,500,function(){Ta.removeElement(f);f.remove();delete u.subtitleShow;delete u.subtitle1;delete u.subtitle2});if(!c){u.controlbar&&(c=u.controlbar.querySelector(".zwp-subtitleButton"))&&(c.style.display=n?"block":"none");return}}else if(!n)return;f=document.createElement("div");f.setAttribute("class","zwp-subtitles-show");f.innerHTML='<div class="zwp-subtitles-viever"><div class="zwp-subtitle subtitle-1"><span class="subtitle-text"></span></div><div class="zwp-subtitle subtitle-2"><span class="subtitle-text"></span></div></div>';
u.overlay_layers.appendChild(f);f.addEventListener("click",function(B){B.preventDefault();B.stopPropagation()});Ta.addElement(f);f.addEventListener("resize",function(B){this.updateSubtitlePosition()}.bind(u));u.subtitleShow=f;u.subtitle1=f.querySelector(".subtitle-1 > .subtitle-text");u.subtitle2=f.querySelector(".subtitle-2 > .subtitle-text");delete u._1_lastRenderedContent;delete u._2_lastRenderedContent;u.subtitle1.style.display="none";u.subtitle2.style.display="none";u._applyAllSubtitleSettings();
var h=f.querySelector(".zwp-subtitles-viever"),k=!1,l=0,p=0,w=0,v=0,E="onpointerout"in document,D="ontouchstart"in document.documentElement||"ontouchstart"in window;u.on_subtitle_mousemove=function(B){if(k){var G=B.pageY,N=!0;B.type=="touchmove"&&(B.changedTouches&&(G=B.changedTouches[0].pageY),N=!0);N&&B.preventDefault();B.stopPropagation();B=p+(l-G);B<70&&(B=70);G=w;N=v;G&&N||(G=this.subtitleShow.offsetHeight,N=h.offsetHeight,w=G,v=N);G-=N;B>G&&(B=G);h.style.bottom=B+"px"}}.bind(u);u.on_subtitle_mouseup=
function(B){k&&("onpointerout"in document?(document.removeEventListener("pointermove",this.on_subtitle_mousemove),document.removeEventListener("pointerup",this.on_subtitle_mouseup)):D?(document.removeEventListener("touchmove",this.on_subtitle_mousemove),document.removeEventListener("touchend",this.on_subtitle_mouseup)):(document.removeEventListener("mousemove",this.on_subtitle_mousemove),document.removeEventListener("mouseup",this.on_subtitle_mouseup)),k=!1,this._subtitleUserPositioned=!0,ja(h,"dragging"))}.bind(u);
u.on_subtitle_mousedown=function(B){"onpointerout"in document?(document.addEventListener("pointermove",this.on_subtitle_mousemove),document.addEventListener("pointerup",this.on_subtitle_mouseup)):D?(document.addEventListener("touchmove",this.on_subtitle_mousemove,{passive:!1}),document.addEventListener("touchend",this.on_subtitle_mouseup)):(document.addEventListener("mousemove",this.on_subtitle_mousemove),document.addEventListener("mouseup",this.on_subtitle_mouseup));k=!0;ka(h,"dragging");var G=B.pageY;
B.type==="touchstart"&&B.changedTouches&&(G=B.changedTouches[0].pageY);l=G;G=parseInt(h.offsetTop+h.offsetHeight);var N=this.subtitleShow.offsetHeight;p=N-G;w=N;v=h.offsetHeight;h.style.top="auto";B.stopPropagation();B.preventDefault()}.bind(u);u._subDragCacheBound||(u._subDragCacheBound=!0,u._invalidateDragCache=m,document.addEventListener("fullscreenchange",m),document.addEventListener("webkitfullscreenchange",m),window.addEventListener("orientationchange",m),window.addEventListener("resize",m));
u.on_subtitleItemclick=function(B){var G=this;B.stopPropagation();B=B.currentTarget;ya(B,"zwp_switch")&&d(B);var N=B.getAttribute("data-action"),I=ya(B,"switch_on");if(N==="toggleShowSubtitle")I?G.subtitleShow&&(G.subtitleShow.style.display="block"):G.subtitleShow&&(G.subtitleShow.style.display="none"),G.updateSubtitleMenu();else if(N==="selectLanguage"){if(B=B.closest(".zwp-sub-dual-item"))for(B=parseInt(B.getAttribute("data-subtitle-id")),N=0;N<G.subtitleList.length;N++)if(G.subtitleList[N].id===
B){B=G.subtitleList[N];G.subtitles&&G.subtitles["1"]===B&&!G.subtitles["2"]?G.setSubtitleTrack("1",null):(G.setSubtitleTrack("2",null),G.setSubtitleTrack("1",B.id),B.hidden&&delete B.hidden);G.updateSubtitleMenu();G.showSubtitle(!0);break}}else if(N==="toggleDualSubtitle"){if(I){N=G.subtitles&&G.subtitles["1"];I=null;for(B=0;B<G.subtitleList.length;B++)if(G.subtitleList[B]!==N){I=G.subtitleList[B];break}I&&I!==N&&(G.setSubtitleTrack("2",I.id),I.hidden&&delete I.hidden)}else G.setSubtitleTrack("2",
null);G.updateSubtitleMenu()}else if(N==="selectPrimary"){if(B=B.closest(".zwp-sub-dual-item")){var C=parseInt(B.getAttribute("data-subtitle-id"));G.setSubtitleTrack("1",C);(B=G.subtitleList.find(function(b){return b.id===C}))&&B.hidden&&delete B.hidden;G.updateSubtitleMenu();G.showSubtitle(!0)}}else if(N==="selectSecondary"){if(B=B.closest(".zwp-sub-dual-item")){var g=parseInt(B.getAttribute("data-subtitle-id"));G.setSubtitleTrack("2",g);(B=G.subtitleList.find(function(b){return b.id===g}))&&B.hidden&&
delete B.hidden;G.updateSubtitleMenu();G.showSubtitle(!0)}}else if(N==="subtitleRemove")(N=B.closest(".zwp-sub-dual-item"))||(N=B.closest(".zwp-subtitle-entry")),N&&(B=parseInt(N.getAttribute("data-subtitle-id")),G.removeFromSubtitleList(B),G.updateSubtitleMenu());else if(N==="addSubtitleFile")(B=B.closest(".zwp-subtitleMenu"))||(B=document.querySelector(".zwp-subtitleMenu")),B&&(B=B.querySelector(".zwp-add-subtitle-input"))&&B.click();else if(N==="showSubtitleSettings")G._toggleSubtitleSettings();
else if(N!=="noop")if(N==="downloadSubtitle"){if(!G._subDownloading){G._subDownloading=!0;setTimeout(function(){G._subDownloading=!1},800);N=parseInt(B.getAttribute("data-subtitle-id"));I=null;for(B=0;B<G.subtitleList.length;B++)if(G.subtitleList[B].id===N){I=G.subtitleList[B];break}I&&I.body&&I.body.length&&G.downloadSubtitleAsSrt(I)}}else if(N==="subtitleOn")G.subtitleShow&&(G.subtitleShow.style.display=I?"block":"none");else if(N==="subtitleDefault")G.subtitles["1"]&&(I?G.subtitles["1"].hidden&&
(delete G.subtitles["1"].hidden,G.subtitle1.style.display="inline-block"):(G.subtitles["1"].hidden=!0,G.subtitle1.style.display="none"));else if(N==="subtitleSecond")G.subtitles["2"]&&(I?G.subtitles["2"].hidden&&(delete G.subtitles["2"].hidden,G.subtitle2.style.display="inline-block"):(G.subtitles["2"].hidden=!0,G.subtitle2.style.display="none"));else if(N==="showSubtitleSearchPanel"){var q=G.overlay_layers.querySelector(":scope > .zwp-subtitleSearchPanel");if(q)x(q,500,function(){q.remove()}),delete G.subtitleSearchPanel,
delete G.refreshSubtitleSearch;else if(G.closeAllActivePanels(),q=G.createSubtitleSearchPanel()){q.style.display="block";(N=q.querySelector(".zwp-search-input"))&&!G.isMobile()&&N.focus();if(B=B.closest(".zwp-subtitleMenu"))B.style.display="none",G._lastClosedParentMenu=B;(B=G.controlbar.querySelector(".zwp-subtitleButton"))&&ja(B,"is-active")}}else if(N==="showSubtitleTranslatePanel"){var A=G.overlay_layers.querySelector(":scope > .zwp-subtitleTranslatePanel");if(A)x(A,500,function(){A.remove()}),
delete G.subtitleTranslatePanel;else{G.closeAllActivePanels();var M=G.createSubtitleTranslatePanel(null);if(M){M.style.display="block";if(B=B.closest(".zwp-subtitleMenu"))B.style.display="none",G._lastClosedParentMenu=B;(B=G.controlbar.querySelector(".zwp-subtitleButton"))&&ja(B,"is-active")}if((B=G._config&&G._config.translateApi||"")&&/^https?:\/\//i.test(B)){B=B.replace(/\/+$/,"");var J=new XMLHttpRequest;J.open("GET",B+"/languages?lang="+encodeURIComponent(za&&za.defaultLang?za.defaultLang:"zh"),
!0);J.timeout=G._config&&G._config.translateTimeout||5E3;J.onload=function(){if(J.responseText)try{var b=JSON.parse(J.responseText);if(b.success&&b.data&&b.data.length){var S=M.querySelector("#zwp-translate-target");if(S){for(var H=(window.navigator.language||"en").toLowerCase(),V="en",P="zh ja ko fr de es ru pt it ar th vi en".split(" "),U=0;U<P.length;U++)if(H.indexOf(P[U])!==-1){V=P[U];break}H="";for(P=0;P<b.data.length;P++){var W=b.data[P],ca=typeof W==="string"?W:W.code,la=typeof W==="string"?
W:W.name||W.code;U=ca===V?" selected":"";ca=String(ca).replace(/[^a-zA-Z0-9_-]/g,"");H+='<option value="'+Ea(ca)+'"'+U+">"+Ea(la)+"</option>"}S.innerHTML=H}}}catch(na){}};J.onerror=function(){};J.ontimeout=function(){};J.send()}}}else if(N==="showTtsPanel"){var T=G.overlay_layers.querySelector(":scope > .zwp-ttsPanel");if(T)x(T,500,function(){T.remove()}),delete G.ttsPanel;else if(G.closeAllActivePanels(),N=G.createTtsPanel()){N.style.display="block";if(B=B.closest(".zwp-subtitleMenu"))B.style.display=
"none",G._lastClosedParentMenu=B;(B=G.controlbar.querySelector(".zwp-subtitleButton"))&&ja(B,"is-active")}}}.bind(u);n=f.querySelectorAll(".subtitle-text");for(c=0;c<n.length;c++)(function(B){E?B.addEventListener("pointerdown",u.on_subtitle_mousedown):D?B.addEventListener("touchstart",u.on_subtitle_mousedown):B.addEventListener("mousedown",u.on_subtitle_mousedown)})(n[c]);window.MutationObserver&&u.playerElm&&!u._subControlbarObserver&&(u._subControlbarObserver=new MutationObserver(function(){u._subtitleUserPositioned||
u._applyAllSubtitleSettings()}),u._subControlbarObserver.observe(u.playerElm,{attributes:!0,attributeFilter:["class"]}));u._destroySubtitleRender=function(){this._subControlbarObserver&&(this._subControlbarObserver.disconnect(),delete this._subControlbarObserver)}.bind(u);u.registerFeature({name:"subtitleRender",destroy:u._destroySubtitleRender},1);if(u.controlbar){if(c=u.controlbar.querySelector(".zwp-subtitleButton"))c.style.display="block";(n=u.controlbar.querySelector(".zwp-subtitleMenu"))&&!n.bindSwitchEvent&&
(c=n.querySelectorAll(".action-item"),c.length>0&&c.forEach(function(B){B.addEventListener("click",u.on_subtitleItemclick);var G=B.getAttribute("data-action");G!=="subtitleOn"&&G!=="subtitleDefault"||ka(B,"switch_on")}),n.addEventListener("click",function(B){var G=B.target,N=G.closest?G.closest("[data-action]"):null;!(G=N?N.getAttribute("data-action"):null)||G!=="toggleShowSubtitle"&&G!=="selectLanguage"&&G!=="selectPrimary"&&G!=="selectSecondary"&&G!=="toggleDualSubtitle"&&G!=="subtitleRemove"&&
G!=="addSubtitleFile"&&G!=="showSubtitleSettings"&&G!=="subtitleEntryClick"&&G!=="subtitleAssign"&&G!=="subtitleUnassign"&&G!=="noop"&&G!=="downloadSubtitle"||(u.on_subtitleItemclick.call(u,{stopPropagation:function(){},currentTarget:N,target:N,closest:function(I){return N.closest?N.closest(I):null}}),B.stopPropagation())}),(c=n.querySelector(".zwp-add-subtitle-input"))&&c.addEventListener("change",function(B){var G=B.target.files;if(G&&G.length!==0){var N="",I=u.murl||u._config.url||"";I&&(I=I.match(/([^\/\\]+?)(\?|$)/))&&
(N=u.getBaseFilename(I[1]).toLowerCase());for(I=0;I<G.length;I++){var C=G[I],g=u.getBaseFilename(C.name).toLowerCase(),q=Xb(C.name,u.getBaseFilename.bind(u),"",N);u.loadSubtitle(C,"",q,!vb(g))}B.target.value=""}}),n.bindSwitchEvent=!0)}}}.bind(a);a.getSimpleSubtitleRenderer=function(){if(!this.overlay_layers)return null;var n=this.overlay_layers.querySelector(".zwp-subtitles-show");if(n){var m=n.querySelector(".zwp-simple-subtitles-viever");m||(m=document.createElement("div"),m.setAttribute("class",
"zwp-simple-subtitles-viever"),n.appendChild(m));return m}n=document.createElement("div");n.setAttribute("class","zwp-subtitles-show");n.innerHTML='<div class="zwp-simple-subtitles-viever"></div>';this.overlay_layers.appendChild(n);n.addEventListener("click",function(u){u.preventDefault();u.stopPropagation()});Ta.addElement(n);n.addEventListener("resize",function(u){this.updateSubtitlePosition()}.bind(this));this.subtitleShow=n;return n.querySelector(".zwp-simple-subtitles-viever")}.bind(a);a.detectContentFormat=
function(n){return n.substr(0,6)==="WEBVTT"?"vtt":n.charAt(0)==="["||n.charAt(0)==="{"?"json":/^\d+\s*\n/.test(n)||n.includes("--\x3e")?"srt":"unknown"};a.processSubtitleContent=function(n,m){m=m||{};var u=this.parseSubtitleText(n);if(!u)return typeof this._config.onSubtitleError==="function"&&this._config.onSubtitleError.call(this,{title:m.title||"Unknown",url:m.url||"",trackId:m.pos||"1",error:"Invalid subtitle file format",errorCode:"INVALID_FORMAT",source:m.source||"unknown",timestamp:(new Date).toISOString()}),
m.source==="local"&&this.toast(K("invalidSubtitleFormat","Invalid subtitle file format"),3E3,!0),!1;typeof this._config.onSubtitleLoaded==="function"&&this._config.onSubtitleLoaded.call(this,{url:m.url||"",title:m.title||"",format:this.detectContentFormat(n),trackId:m.pos||"1"});this.processLoadedSubtitle(u,m.pos!=null?m.pos:"1",m.title||"",m.source,m.allowContentOverride,m.url||"",m);return!0};a.parseSubtitleText=function(n){if(!n)return null;var m=this.detectContentFormat(n),u=null;if(m==="vtt")u=
Ab(n);else if(m==="srt")u=sc(n);else if(m==="json"||m==="bcc"){try{var f=JSON.parse(n);if(f&&!Array.isArray(f)&&f.zwp_protocol&&typeof f.zwp_protocol==="string"&&f.zwp_protocol.indexOf("ZWMAP/")===0&&f.zwp_type==="subtitle"){n={};m="body font_size font_color background_alpha background_color Stroke title format language".split(" ");for(var c=0;c<m.length;c++)f[m[c]]!==void 0&&(n[m[c]]=f[m[c]]);u=n}else u=f}catch(h){u=null}f=null;Array.isArray(u)?f=u:u&&Array.isArray(u.body)&&(f=u.body);if(f)for(n=
0;n<f.length;n++)(m=f[n])&&typeof m==="object"&&(typeof m.content==="string"&&(m.content=hb(m.content)),typeof m.text==="string"&&(m.text=hb(m.text)))}return u};a.fetchAndParseSubtitle=function(n){var m=this;return new Promise(function(u){if(n)if(typeof n==="object"&&n.body)u(n);else if(typeof n==="string"&&m.detectContentFormat(n)!=="unknown")u(m.parseSubtitleText(n));else{var f=typeof n==="object"&&n.url?n.url:n;typeof f==="string"&&f?y(f,function(c){c=m.parseSubtitleText(c);u(c)},function(){u(null)}):
u(null)}else u(null)})};a.loadSubtitle=function(n,m,u,f){var c=this;f===void 0&&(f=!0);m!=null&&(m=String(m));m!=="1"&&m!=="2"&&(m="");if(typeof n==="object"&&n instanceof File)c.detectMimeType(n).then(function(k){return c.isValidSubtitleFile(n,k).then(function(l){return l?!0:(c.toast(K("unsupportedSubtitleFormat","Unsupported subtitle format")+": "+k,3E3,!0),!1)})}).then(function(k){k&&(k=new FileReader,k.onload=function(l){l=l.target.result;for(var p=n.name+"|"+n.size+"|"+n.lastModified,w=null,
v=0;v<c.subtitleList.length;v++)if(c.subtitleList[v]._fileFingerprint===p){w=c.subtitleList[v];break}w?(m!=="1"&&m!=="2"||c.setSubtitleTrack(m,w.id),c.updateSubtitleMenu()):(w=URL.createObjectURL(n),c._playlistBlobUrls=c._playlistBlobUrls||[],c._playlistBlobUrls.push(w),c.processSubtitleContent(l,{url:w,title:u||n.name,allowContentOverride:f,pos:m,source:"local",fileFingerprint:p}))},k.onerror=function(){var l={fileName:n.name,title:u||n.name,trackId:m,error:"Failed to read subtitle file",errorCode:"READ_ERROR",
source:"local",timestamp:(new Date).toISOString()};typeof c._config.onSubtitleError==="function"&&c._config.onSubtitleError.call(c,l);c.toast(K("failedToReadSubtitle","Failed to read subtitle file"),3E3,!0)},k.readAsText(n))}).catch(function(k){k={fileName:n.name,title:u||n.name,trackId:m,error:"Subtitle file validation failed",errorCode:"VALIDATION_FAILED",details:k.message||k,source:"local",timestamp:(new Date).toISOString()};typeof c._config.onSubtitleError==="function"&&c._config.onSubtitleError.call(c,
k);c.toast(K("subtitleValidationFailed","Subtitle file validation failed"),3E3,!0)});else{if(typeof n==="object"&&n.url&&typeof n.url==="string")return c.loadSubtitle(n.url,m,u||n.title,f);if(typeof n==="object"){var h=typeof n.text==="string"?n.text:JSON.stringify(n);c.processSubtitleContent(h,{url:"",title:u||K("trackN","Track {0}").replace("{0}",m||"1"),allowContentOverride:f,pos:m,source:"direct"})}else typeof n==="string"&&(c.detectContentFormat(n)!=="unknown"?c.processSubtitleContent(n,{url:"",
title:u||"Direct Subtitle Content",allowContentOverride:f,pos:m,source:"direct"}):y(n,function(k){var l=c.getBaseFilename(n);l=c.truncateFilename(l);c.processSubtitleContent(k,{url:n,title:u||l,allowContentOverride:f,pos:m,source:"http"})},function(k){typeof c._config.onSubtitleError==="function"&&c._config.onSubtitleError.call(c,{title:u||n,url:n,trackId:m,error:"Failed to fetch subtitle file",errorCode:"FETCH_ERROR",source:"http",timestamp:(new Date).toISOString(),xhr:k})}))}}.bind(a);a.addToSubtitleList=
function(n,m){m=m||{};var u=m.url||"";if(u)for(var f=0;f<this.subtitleList.length;f++){var c=this.subtitleList[f];if(c.url===u)return c}u={id:this._nextSubId++,name:m.title||n.title||"Subtitle "+this._nextSubId,url:u,language:m.language||"",source:m.source||"unknown",format:m.format||"",body:n.body||[],current:null,nextSubtitleIdx:0,hidden:!!m.hidden};n.title&&(u.title=n.title);n.font_size&&(u.font_size=n.font_size);n.font_color&&(u.font_color=n.font_color);n.background_alpha&&(u.background_alpha=
n.background_alpha);n.background_color&&(u.background_color=n.background_color);m.fileFingerprint&&(u._fileFingerprint=m.fileFingerprint);this.subtitleList.push(u);return u};a.removeFromSubtitleList=function(n){for(var m=-1,u=0;u<this.subtitleList.length;u++)if(this.subtitleList[u].id===n){m=u;break}if(m===-1)return!1;n=this.subtitleList[m];this.subtitles&&(this.subtitles["1"]===n&&(this.subtitles["1"].current=null,delete this.subtitles["1"],this.subtitle1&&(this.subtitle1.innerHTML="",this.subtitle1.style.display=
"none")),this.subtitles["2"]===n&&(this.subtitles["2"].current=null,delete this.subtitles["2"],this.subtitle2&&(this.subtitle2.innerHTML="",this.subtitle2.style.display="none")));this.subtitleList.splice(m,1);delete this._1_lastRenderedContent;delete this._2_lastRenderedContent;return!0};a.setSubtitleTrack=function(n,m){if(n==="1"||n==="2")if(this.subtitles||(this.subtitles={}),m==null){this.subtitles[n]&&(this.subtitles[n].current=null,this.subtitles[n].nextSubtitleIdx=0);delete this.subtitles[n];
var u=this["subtitle"+n];u&&(u.innerHTML="",u.style.display="none",delete this["_"+n+"_lastRenderedContent"])}else{u=null;for(var f=0;f<this.subtitleList.length;f++)if(this.subtitleList[f].id===m){u=this.subtitleList[f];break}u&&(m=n==="1"?"2":"1",this.subtitles[m]===u&&(delete this.subtitles[m],f=this["subtitle"+m])&&(f.innerHTML="",f.style.display="none",delete this["_"+m+"_lastRenderedContent"]),u.current=null,u.nextSubtitleIdx=0,this.subtitles[n]=u)}};a.updateSubtitleMenu=function(){if(this.controlbar){var n=
this.controlbar.querySelector(".zwp-subtitleMenu");if(n){if(window.innerWidth<768||this.isMobile&&this.isMobile()||this.playerElm.classList.contains("zwp-fullscreen")||this.playerElm.classList.contains("zwp-fullscreen-win")){var m=n.querySelector(".zwp-sub-single-list"),u=this.controlbar.querySelector(".zwp-subtitleButton");m&&u&&(u=u.getBoundingClientRect().top-this.playerElm.getBoundingClientRect().top-140,m.style.maxHeight=Math.max(60,u)+"px")}m=this.subtitles&&this.subtitles["1"];u=this.subtitles&&
this.subtitles["2"];var f=!!u&&u!==m,c=n.querySelector(".main .zwp_switch"),h=this.subtitleShow&&this.subtitleShow.style.display!=="none";if(c){h?ka(c,"switch_on"):ja(c,"switch_on");c=n.querySelector(".zwp-sub-controls-area");if(!c){c=document.createElement("div");c.className="zwp-sub-controls-area";var k=n.querySelector(".zwp-option-item.main");if(k&&k.nextSibling)for(k=k.nextSibling;k;){var l=k.nextSibling;c.appendChild(k);k=l}n.appendChild(c)}c&&(c.style.opacity=h?"":"0.4",c.style.pointerEvents=
h?"":"none")}if(h=n.querySelector(".dual-toggle-item"))h.style.display=this.subtitleList.length>=2?"":"none";if(h=n.querySelector(".zwp-sub-dual-section"))if(this.subtitleList.length>=1){h.style.display="block";this.subtitleList.length>=2&&(n=n.querySelector(".dual-toggle-item .zwp_switch"))&&(f?ka(n,"switch_on"):ja(n,"switch_on"));if(n=h.querySelector(".zwp-sub-single-list"))if(f)n.style.display="none";else{n.style.display="block";c="";for(k=0;k<this.subtitleList.length;k++){l=this.subtitleList[k];
var p=m===l,w="zwp-sub-dual-item"+(p?" selected":""),v=l.source==="translate"?' <span class="zwp-sub-lang-ai">AI</span>':"";p=p?'<span class="zwp-sub-check">\u2713</span>':'<span class="zwp-sub-check"></span>';var E=this._config.subtitleDownload&&l.body&&l.body.length?'<button class="zwp-sub-download-btn" data-action="downloadSubtitle" data-subtitle-id="'+l.id+'" title="'+K("downloadSubtitle","\u4e0b\u8f7d\u5b57\u5e55")+'"><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><path d="M7 10l5 5 5-5"/><path d="M12 15V3"/></svg></button>':
"";c+='<div class="'+w+'" data-subtitle-id="'+l.id+'" data-action="selectLanguage">'+p+'<span class="zwp-sub-lang-text">'+Ea(l.name||"Untitled")+v+"</span>"+E+"</div>"}n.innerHTML=c}if(n=h.querySelector(".zwp-sub-dual-columns"))n.style.display=f?"flex":"none";if(f&&(f=h.querySelector(".zwp-sub-dual-col-items.pri"),h=h.querySelector(".zwp-sub-dual-col-items.sec"),f&&h)){c=n="";for(k=0;k<this.subtitleList.length;k++)l=this.subtitleList[k],w=l.source==="translate"?' <span class="zwp-sub-lang-ai">AI</span>':
"",n+='<div class="zwp-sub-dual-item'+(m===l?" selected":"")+'" data-subtitle-id="'+l.id+'" data-action="selectPrimary">'+(m===l?'<span class="zwp-sub-check">\u2713</span>':'<span class="zwp-sub-check"></span>')+'<span class="zwp-sub-lang-text">'+Ea(l.name||"Untitled")+w+"</span></div>",c+='<div class="zwp-sub-dual-item'+(u===l?" selected":"")+'" data-subtitle-id="'+l.id+'" data-action="selectSecondary">'+(u===l?'<span class="zwp-sub-check">\u2713</span>':'<span class="zwp-sub-check"></span>')+'<span class="zwp-sub-lang-text">'+
Ea(l.name||"Untitled")+w+"</span></div>";f.innerHTML=n;h.innerHTML=c}}else h.style.display="none";typeof this._updateSubtitleButtonVisibility==="function"&&this._updateSubtitleButtonVisibility()}}};a.clearAllSubtitles=function(){this.subtitles&&(delete this.subtitles["1"],delete this.subtitles["2"]);this.subtitleList=[];this._nextSubId=1;this.subtitleShow&&(this.subtitleShow.parentNode&&(Ta.removeElement(this.subtitleShow),this.subtitleShow.parentNode.removeChild(this.subtitleShow)),delete this.subtitleShow,
delete this.subtitle1,delete this.subtitle2);this.showSubtitleTimer&&(clearTimeout(this.showSubtitleTimer),delete this.showSubtitleTimer);this._closePanel("subtitleSearchPanel");if(this.controlbar){var n=this.controlbar.querySelector(".zwp-subtitleButton");n&&(n.style.display="none");var m=this.controlbar.querySelector(".zwp-subtitleMenu");if(m){n=m.querySelector(".main");var u=m.querySelector(".sub1");m=m.querySelector(".sub2");u&&(u.style.display="none");m&&(m.style.display="none");n&&(n=n.querySelector(".zwp_switch"))&&
ja(n,"switch_on")}}this.updateSubtitleMenu()};a.processLoadedSubtitle=function(n,m,u,f,c,h,k){k=k||{};this.subtitles||(this.subtitles={});u&&(n.title=u);m==="2"&&this._config.secondSubtitleHidden&&(n.hidden=!0);if(this.controlbar){var l=this.controlbar.querySelector(".zwp-subtitleMenu");if(l){var p=l.querySelector(".main");p||(l.innerHTML=r(this._config),ja(l,"zwp-autosize"));if(m==="1"){if(p=l.querySelector(".sub1")){u||=K("mainSubtitle","Main subtitle");var w=p.querySelector(".zwp-option-item-label");
if(w){var v=this.truncateFilename(u);w.innerHTML=Ea(v);w.setAttribute("title",u)}p.style.display="block"}(p=l.querySelector(".main"))&&(w=p.querySelector(".zwp_switch"))&&ka(w,"switch_on");if(p=l.querySelector(".zwp-search-subtitle1"))if(p.style.display="inline-flex",p=p.querySelector('input[type="checkbox"]'))p.checked=!0}if(m==="2"){if(p=l.querySelector(".sub2")){u||=K("secondSubtitle","Second subtitle");if(w=p.querySelector(".zwp-option-item-label"))v=this.truncateFilename(u),w.innerHTML=Ea(v),
w.setAttribute("title",u);n.hidden||(w=p.querySelector(".zwp_switch"))&&ka(w,"switch_on");p.style.display="block"}if(l=l.querySelector(".zwp-search-subtitle2"))if(l.style.display="inline-flex",l=l.querySelector('input[type="checkbox"]'))l.checked=!0}}}u=Nd(u||n.title||"",c,n.body);n=this.addToSubtitleList(n,{title:u,source:f||"unknown",url:h||"",hidden:n.hidden,fileFingerprint:k.fileFingerprint});if(m==="1"||m==="2")this.subtitles[m]=n;this.updateSubtitleMenu();if(m==="1"||m==="2")this.showSubtitleTimer&&
(clearTimeout(this.showSubtitleTimer),delete this.showSubtitleTimer),this.showSubtitleTimer=setTimeout(function(){this.showSubtitle(!0);this.updateSubtitleMenu();delete this.showSubtitleTimer}.bind(this),100)}.bind(a);a.createSubtitleSettingsPanel=function(){function n(p){var w="";w+='<div class="sub-settings-grid">';w+='<div class="sub-setting-item"><div class="sub-setting-label">'+K("subtitleSize","Size")+"</div>";w+='<div class="sub-setting-control"><select data-setting="fontSize">';[{v:"0.08",
l:"subtitleSizeMin"},{v:"0.14",l:"subtitleSizeSmall"},{v:"0.2",l:"subtitleSizeMedium"},{v:"0.28",l:"subtitleSizeLarge"},{v:"0.36",l:"subtitleSizeMax"}].forEach(function(E){w+='<option value="'+E.v+'"'+((p.fontSize||"0.2")===E.v?" selected":"")+">"+K(E.l,E.l)+"</option>"});w+="</select></div></div>";var v=p.fontColor||"#FFFFFF";w+='<div class="sub-setting-item"><div class="sub-setting-label">'+K("subtitleColor","Color")+"</div>";w+='<div class="sub-setting-control sub-color-dropdown" data-setting="fontColor" data-value="'+
v+'">';w+='<div class="color-trigger"><span class="color-swatch" style="background:'+v+'"></span><span class="color-trigger-arrow">\u25be</span></div>';w+='<div class="color-dropdown-panel">';[{v:"#FFFFFF",l:"subtitleColorWhite"},{v:"#CCCCCC",l:"subtitleColorLightGray"},{v:"#888888",l:"subtitleColorDarkGray"},{v:"#FFD700",l:"subtitleColorYellow"},{v:"#FF9800",l:"subtitleColorOrange"},{v:"#E74C3C",l:"subtitleColorRed"},{v:"#2ECC71",l:"subtitleColorGreen"},{v:"#00E5FF",l:"subtitleColorCyan"},{v:"#3498DB",
l:"subtitleColorBlue"},{v:"#9B59B6",l:"subtitleColorPurple"},{v:"#FF66CC",l:"subtitleColorPink"},{v:"#000000",l:"subtitleColorBlack"}].forEach(function(E){var D=v===E.v?" selected":"",B=D?' style="--ring-color:'+z(E.v)+'"':"";w+='<div class="color-option'+D+'" data-value="'+E.v+'" title="'+K(E.l,E.l)+'"'+B+'><span class="color-swatch" style="background:'+E.v+'"></span></div>'});w+="</div></div></div>";w+='<div class="sub-setting-item"><div class="sub-setting-label">'+K("subtitleOutline","Outline")+
"</div>";w+='<div class="sub-setting-control"><select data-setting="outline">';[{v:"none",l:"subtitleOutlineNone"},{v:"heavy",l:"subtitleOutlineHeavy"},{v:"shadow",l:"subtitleOutlineShadow"},{v:"shadow45",l:"subtitleOutlineShadow45"}].forEach(function(E){w+='<option value="'+E.v+'"'+((p.outline||"none")===E.v?" selected":"")+">"+K(E.l,E.l)+"</option>"});w+="</select></div></div>";return w+="</div>"}var m=this;if(m.subtitleSettingsPanel)return m.subtitleSettingsPanel;var u=m._subtitleActiveTab||"primary";
m._subtitleSettings&&m._subtitleSettings[u]||{};var f=document.createElement("div");f.className="zwp-popupwindow zwp-subtitleSettingsPanel";f.style.cssText="width:300px;bottom:70px;";var c='<button class="closeBtn"><span class="xicon xicon-close"></span></button>';c+='<div class="form-row form-title">'+K("subtitleSettings","Subtitle Settings")+"</div>";c+='<div class="sub-settings-tabs">';c+='<div class="barrage-tab-item'+(u==="primary"?" selected":"")+'" data-tab="primary"><a href="javascript:void(0)" class="barrage-tab-link">'+
K("primarySubtitle","Primary")+'<i class="bottom-line"></i></a></div>';c+='<div class="barrage-tab-item'+(u==="secondary"?" selected":"")+'" data-tab="secondary"><a href="javascript:void(0)" class="barrage-tab-link">'+K("secondarySubtitle","Secondary")+'<i class="bottom-line"></i></a></div>';c+="</div>";var h=m._subtitleSettings&&m._subtitleSettings.primary||{};c+='<div class="sub-panel-upper">';c+='<div class="sub-tab-content" data-tab-content="primary">'+n(h)+"</div>";c+='<div class="sub-tab-content zwp-hidden" data-tab-content="secondary">'+
n(m._subtitleSettings&&m._subtitleSettings.secondary||{})+"</div>";c+="</div>";c+='<div class="sub-panel-divider"></div>';c+='<div class="sub-panel-lower">';u=h.bgOpacity!=null?Math.round(h.bgOpacity*100):0;var k=h.scale!==!1,l=h.fade===!0;c+='<div class="sub-lower-main">';c+='<div class="sub-lower-left">';c+='<div class="sub-setting-label">'+K("subtitlePosition","Position")+"</div>";c+='<div class="sub-position-grid" data-setting="position" data-value="'+(h.position||"bottom")+'">';[{v:"top-left",
l:"subtitlePositionTopLeft"},{v:"top",l:"subtitlePositionTop"},{v:"top-right",l:"subtitlePositionTopRight"},{v:"bottom-left",l:"subtitlePositionBottomLeft"},{v:"bottom",l:"subtitlePositionBottom"},{v:"bottom-right",l:"subtitlePositionBottomRight"}].forEach(function(p){c+='<div class="sub-position-cell'+((h.position||"bottom")===p.v?" selected":"")+'" data-pos="'+p.v+'" title="'+K(p.l,p.l)+'"><span class="sub-position-mark"></span></div>'});c+="</div>";c+="</div>";c+='<div class="sub-lower-right">';
c+='<div class="sub-setting-label">'+K("subtitleOthers","Others")+"</div>";c+='<div class="sub-lower-checks">';c+='<label class="sub-check-item"><input type="checkbox"'+(k?" checked":"")+' data-setting="scale"> '+K("subtitleScale","Scale")+"</label>";c+='<label class="sub-check-item"><input type="checkbox"'+(l?" checked":"")+' data-setting="fade"> '+K("subtitleFade","Fade")+"</label>";c+="</div>";c+="</div>";c+="</div>";c+='<div class="sub-slider-row">';c+='<div class="sub-setting-label">'+K("subtitleBgOpacity",
"Bg Opacity")+"</div>";c+='<div class="sub-setting-control"><input type="range" class="zwp-slider" min="0" max="100" value="'+u+'" data-setting="bgOpacity"></div>';c+="</div>";c+="</div>";c+='<div class="form-row form-bottombar" style="justify-content:center;"><button class="zwp-form-button" data-action="restoreDefaults">'+K("subtitleRestoreDefaults","Restore")+"</button></div>";f.innerHTML=c;(u=f.querySelector(".closeBtn"))&&u.addEventListener("click",function(){x(f,300,function(){f.remove()});delete m.subtitleSettingsPanel;
m._lastClosedParentMenu&&(m._lastClosedParentMenu.style.display="",delete m._lastClosedParentMenu)});f.addEventListener("click",function(p){var w=p.target.closest(".sub-settings-tabs .barrage-tab-item");if(w){if(p=w.getAttribute("data-tab"),p!==m._subtitleActiveTab){m._saveActiveTabSettings(f);m._subtitleActiveTab=p;w=f.querySelectorAll(".sub-settings-tabs .barrage-tab-item");for(var v=0;v<w.length;v++)w[v].classList.toggle("selected",w[v].getAttribute("data-tab")===p);w=f.querySelectorAll(".sub-tab-content");
for(v=0;v<w.length;v++)w[v].classList.toggle("zwp-hidden",w[v].getAttribute("data-tab-content")!==p);m._loadTabSettings(f,p)}}else p.target.getAttribute("data-action")==="restoreDefaults"&&(p=m._subtitleActiveTab||"primary",m._subtitleSettings[p].fontSize="0.2",m._subtitleSettings[p].fontColor="#FFFFFF",m._subtitleSettings[p].outline="none",m._subtitleSettings.primary.position="bottom",m._subtitleSettings.primary.bgOpacity=.6,m._subtitleSettings.primary.scale=!0,m._subtitleSettings.primary.fade=!1,
m._applyAllSubtitleSettings(),m._loadTabSettings(f,p),m._loadGlobalSettings(f))});f.addEventListener("change",function(p){var w=p.target.getAttribute("data-setting");if(w){var v=m._subtitleActiveTab;p.target.closest(".sub-panel-lower")&&(m._subtitleActiveTab="primary");m._applySubtitleSetting(w,p.target);m._subtitleActiveTab=v}});f.addEventListener("mousedown",function(p){p.stopPropagation()});f.addEventListener("dblclick",function(p){p.stopPropagation()});f.addEventListener("click",function(p){p.stopPropagation();
var w=p.target.closest(".sub-position-cell");if(w){var v=w.closest(".sub-position-grid");if(v){p=w.getAttribute("data-pos");v.setAttribute("data-value",p);w=v.querySelectorAll(".sub-position-cell");for(v=0;v<w.length;v++)w[v].classList.toggle("selected",w[v].getAttribute("data-pos")===p);w=m._subtitleActiveTab;m._subtitleActiveTab="primary";m._applySubtitleSetting("position",{type:"text",value:p});m._subtitleActiveTab=w}}else if(w=p.target.closest(".color-trigger"),v=p.target.closest(".color-option"),
p=p.target.closest(".sub-color-dropdown"),w){p=w.closest(".sub-color-dropdown");w=p.classList.contains("open");v=f.querySelectorAll(".sub-color-dropdown.open");for(var E=0;E<v.length;E++)v[E].classList.remove("open");w||p.classList.add("open")}else if(v&&p){w=v.getAttribute("data-value");p.setAttribute("data-value",w);if(v=p.querySelector(".color-trigger .color-swatch"))v.style.background=w;v=p.querySelectorAll(".color-option");for(E=0;E<v.length;E++){var D=v[E].getAttribute("data-value")===w;v[E].classList.toggle("selected",
D);D?v[E].style.setProperty("--ring-color",z(w)):v[E].style.removeProperty("--ring-color")}p.classList.remove("open");m._applySubtitleSetting("fontColor",{type:"text",value:w})}else for(p=f.querySelectorAll(".sub-color-dropdown.open"),w=0;w<p.length;w++)p[w].classList.remove("open")});return m.subtitleSettingsPanel=f};a._saveActiveTabSettings=function(n){var m=this._subtitleActiveTab||"primary";this._subtitleSettings[m]||(this._subtitleSettings[m]={});var u=this._subtitleSettings[m];if(n=n.querySelector('.sub-tab-content[data-tab-content="'+
m+'"]')){if(m=n.querySelector('[data-setting="fontSize"]'))u.fontSize=m.value;if(m=n.querySelector('[data-setting="fontColor"]'))u.fontColor=m.getAttribute("data-value")||m.value;if(m=n.querySelector('[data-setting="outline"]'))u.outline=m.value}};a._loadTabSettings=function(n,m){var u=this._subtitleSettings[m]||{};if(n=n.querySelector('.sub-tab-content[data-tab-content="'+m+'"]')){var f;if(f=n.querySelector('[data-setting="fontSize"]'))f.value=u.fontSize||"0.2";if(f=n.querySelector('[data-setting="fontColor"]')){m=
u.fontColor||"#FFFFFF";f.setAttribute("data-value",m);var c=f.querySelector(".color-trigger .color-swatch");c&&(c.style.background=m);f=f.querySelectorAll(".color-option");for(c=0;c<f.length;c++){var h=f[c].getAttribute("data-value")===m;f[c].classList.toggle("selected",h);h?f[c].style.setProperty("--ring-color",z(m)):f[c].style.removeProperty("--ring-color")}}if(f=n.querySelector('[data-setting="outline"]'))f.value=u.outline||"none"}};a._loadGlobalSettings=function(n){var m=this._subtitleSettings.primary||
{};if(n=n.querySelector(".sub-panel-lower")){var u=n.querySelector('[data-setting="position"]');if(u){var f=m.position||"bottom";u.setAttribute("data-value",f);u=u.querySelectorAll(".sub-position-cell");for(var c=0;c<u.length;c++)u[c].classList.toggle("selected",u[c].getAttribute("data-pos")===f)}if(f=n.querySelector('[data-setting="bgOpacity"]'))f.value=m.bgOpacity!=null?Math.round(m.bgOpacity*100):0;if(f=n.querySelector('[data-setting="scale"]'))f.checked=m.scale!==!1;if(f=n.querySelector('[data-setting="fade"]'))f.checked=
m.fade===!0}};a._applySubtitleSetting=function(n,m){var u=this._subtitleActiveTab||"primary";this._subtitleSettings[u]||(this._subtitleSettings[u]={});m=m.type==="checkbox"?m.checked:m.value;n==="bgOpacity"&&(m=parseInt(m)/100);this._subtitleSettings[u][n]=m;n==="position"&&(this._subtitleUserPositioned=!1);this._applyAllSubtitleSettings()};a._isControlbarHidden=function(){return!!a.isControlbarhidden};a._applyAllSubtitleSettings=function(){function n(h,k){h&&(k.fontColor&&(h.style.color=k.fontColor),
k.outline==="heavy"?(h.style.textShadow="2px 2px 4px #000, -1px -1px 2px #000, 1px -1px 2px #000, -1px 1px 2px #000",h.style.backgroundColor="transparent"):k.outline==="shadow"?(h.style.textShadow="1px 1px 2px #000",h.style.backgroundColor="transparent"):k.outline==="shadow45"?(h.style.textShadow="2px 2px 3px rgba(0,0,0,0.8)",h.style.backgroundColor="transparent"):(h.style.textShadow="none",k=typeof k.bgOpacity==="number"&&k.bgOpacity>0?k.bgOpacity:0,h.style.backgroundColor=k>0?"rgba(0,0,0,"+k+")":
"transparent"))}var m=this._subtitleSettings;if(m){var u=m.primary||{};m=m.secondary||{};if(this.subtitle1){var f=this.subtitle1.parentElement;f&&(f.style.transform=u.scale!==!1?"":"none")}this.subtitle2&&(f=this.subtitle2.parentElement)&&(f.style.transform=m.scale!==!1?"":"none");if(f=this.subtitleShow&&this.subtitleShow.querySelector(".zwp-subtitles-viever"))f.style.transition=u.fade===!0?"opacity 0.3s ease-in-out":"none";n(this.subtitle1,u);n(this.subtitle2,m);if(this.subtitleShow&&!this._subtitleUserPositioned&&
(m=this.subtitleShow.querySelector(".zwp-subtitles-viever"))){var c=u.position||"bottom";u=c.indexOf("top")===0;f=c.indexOf("left")>-1;c=c.indexOf("right")>-1;m.style.top=u?"14px":"auto";m.style.bottom=u?"auto":this._isControlbarHidden()?"14px":"70px";m.style.textAlign=f?"left":c?"right":"center";f?(m.style.left="14px",m.style.right="auto",m.style.width="auto",m.style.maxWidth="80%"):c?(m.style.left="auto",m.style.right="14px",m.style.width="auto",m.style.maxWidth="80%"):(m.style.left="5%",m.style.right=
"auto",m.style.width="90%",m.style.maxWidth="")}typeof this.updateSubtitlePosition==="function"&&this.updateSubtitlePosition()}};a._toggleSubtitleSettings=function(){var n=this.overlay_layers&&this.overlay_layers.querySelector(":scope > .zwp-subtitleSettingsPanel");if(n)x(n,300,function(){n.remove()}),delete this.subtitleSettingsPanel,this._lastClosedParentMenu&&(this._lastClosedParentMenu.style.display="",delete this._lastClosedParentMenu);else{this.closeAllActivePanels();var m=this.controlbar&&
this.controlbar.querySelector(".zwp-subtitleMenu");m&&(m.style.display="none",this._lastClosedParentMenu=m);m=this.createSubtitleSettingsPanel();if(this.overlay_layers){this.overlay_layers.appendChild(m);var u=this.controlbar&&this.controlbar.querySelector(".zwp-subtitleButton"),f=this.overlay_layers.getBoundingClientRect();u&&f.width>0&&(u=u.getBoundingClientRect(),m.style.left=u.left+u.width/2-f.left+"px",m.style.transform="translateX(-50%)",m.style.right="auto");m.style.display="block"}}};a.secsToSrtStamp=
function(n){n=Math.max(0,n||0);var m=Math.round(n*1E3);n=Math.floor(m/36E5);var u=Math.floor(m%36E5/6E4),f=Math.floor(m%6E4/1E3);m%=1E3;return(n<10?"0":"")+n+":"+((u<10?"0":"")+u)+":"+((f<10?"0":"")+f)+","+((m<10?"00":m<100?"0":"")+m)}.bind(a);a.downloadSubtitleAsSrt=function(n){function m(p){if(p==null)return"";p=String(p);p=p.replace(/<br\s*\/?>/gi,"\n");p=p.replace(/<[^>]*>/g,"");p=p.replace(/&nbsp;/gi," ");return p.replace(/^\s+|\s+$/g,"")}function u(p){return String(p||"").replace(/[\\/:*?"<>|]/g,
"").replace(/\s+/g," ").trim()||"subtitle"}if(n&&n.body&&n.body.length){for(var f=n.body.slice().sort(function(p,w){return(p.from||0)-(w.from||0)}),c=[],h=0;h<f.length;h++){var k=f[h];c.push(h+1+"\n"+a.secsToSrtStamp(k.from)+" --\x3e "+a.secsToSrtStamp(k.to)+"\n"+m(k.content)+"\n")}f=c.join("\n");(c=typeof a.murl==="string"&&a.getBaseFilename?u(a.getBaseFilename(a.murl)):"")||(c="video");n=u(n.language||n.name);n=c+"_"+n+".srt";f=new Blob([f],{type:"text/plain;charset=utf-8"});var l=URL.createObjectURL(f);
f=document.createElement("a");f.href=l;f.download=n;document.body.appendChild(f);f.click();f.remove();setTimeout(function(){URL.revokeObjectURL(l)},1E3)}}.bind(a);a.renderSubtitles=function(n){if(this.subtitleShow&&this.subtitles&&this.subtitleShow.style.display!=="none")for(var m=this.subtitleShow.querySelector(".zwp-subtitles-viever"),u=["1","2"],f=0;f<u.length;f++){var c=u[f];if(this.subtitles[c]){var h="subtitle"+c,k=this.subtitles[c],l=!1;if(!k.hidden&&k.body&&Array.isArray(k.body)){if(k.current){if(n<
k.current.from)l=!0;else if(n<k.current.to)continue;if(this[h]){for(var p=null,w=k.nextSubtitleIdx;w<k.body.length;w++)if(k.body[w].from>=k.current.to){p=k.body[w];break}w=p?p.from-k.current.to:Infinity;if(p&&w<=.3&&n>=k.current.to&&n<p.from)continue;this[h].innerHTML="";delete this["_"+c+"_lastRenderedContent"];c==="1"&&m&&(m.style.opacity="0")}k.current=null}w=k.nextSubtitleIdx||0;!k.current&&n<(k.body[w]?k.body[w].from:Infinity)&&(l=!0);p=!0;if(l){var v=w-4;v<0&&(v=0);for(var E=w-2;E>=v;E--)if(l=
k.body[E],n<=l.to){if(n>=l.from){k.current=l;k.nextSubtitleIdx=E+1;p=!1;break}}else{k.nextSubtitleIdx=w;p=!1;break}if(p&&v>0){w=0;for(E=v-1;w<=E;){v=parseInt((w+E)/2);if(!k.body||!Array.isArray(k.body)||v>=k.body.length)break;l=k.body[v];if(n<l.from)E=v-1;else if(n>l.to)w=v+1;else{k.current=l;k.nextSubtitleIdx=v+1;p=!1;break}}p&&(k.nextSubtitleIdx=w)}}else{if(!k.body||!Array.isArray(k.body))break;v=w+2;v>k.body.length&&(v=k.body.length);for(E=w;E<v;E++)if(l=k.body[E],n>=l.from){if(n<=l.to){k.current=
l;k.nextSubtitleIdx=E+1;p=!1;break}}else{k.nextSubtitleIdx=w;p=!1;break}if(p){w=v;E=k.body.length-1;for(v>=k.body.length?n<k.body[k.body.length-1].from&&(w=0):n<k.body[v].from&&(w=0);w<=E;)if(v=parseInt((w+E)/2),l=k.body[v],n<l.from)E=v-1;else if(n>l.to)w=v+1;else{k.current=l;k.nextSubtitleIdx=v+1;p=!1;break}p&&(k.nextSubtitleIdx=w)}}k.current&&this[h]&&(p="_"+c+"_lastRenderedContent",this[p]!==k.current.content&&(this[h].innerHTML=k.current.content,this[p]=k.current.content),this[h].style.display=
"inline-block",c==="1"&&m&&(m.style.opacity="1"))}}}}.bind(a);a.updateSubtitlePosition=function(){if(this.subtitleShow&&this.subtitles){var n=["1","2"],m=this.subtitleShow.offsetWidth,u=this.subtitleShow.offsetHeight;if(m&&u&&(!this._subtitleSettings||!this._subtitleSettings.primary||this._subtitleSettings.primary.scale!==!1))for(m=Math.max(14,Math.min(32,m*.05)),u=0;u<n.length;u++){var f=n[u];if(this.subtitles[f]){var c="subtitle"+f;this[c]&&(f=f==="1"?"primary":"secondary",f=(f=this._subtitleSettings&&
this._subtitleSettings[f])&&f.fontSize?parseFloat(f.fontSize)/.2:1,this[c].style.fontSize=(m*f).toFixed(2)+"px")}}}}.bind(a)}function Qd(a,t){function z(l,p){n();d();u||(u=document.createElement("div"),u.className="zwp-watermarks",l.overlay_layers.appendChild(u));u.innerHTML="";var w=l._config.variables||{},v=!1;c=[];p.forEach(function(E,D){if(!E.hidden)if(E.behavior==="tile"&&E.type==="text"){var B=u,G=E.tile||{angle:-30,rowSpacing:120,colSpacing:300},N=G.angle||-30,I=G.rowSpacing||120;G=G.colSpacing||
300;var C=(E.text||"").replace(/\n/g," ").replace(/\r/g,"").trim();C||="";var g=y(C,w),q=E.font_size||16,A=E.font_color||"rgba(255,255,255,0.7)",M=document.createElement("div");M.className="zwp-wm zwp-wm-tile";M.style.position="absolute";M.style.left="0";M.style.top="0";M.style.width="100%";M.style.height="100%";M.style.zIndex=D+1;M.style.opacity=Math.min((E.opacity!=null?E.opacity:30)/100,1);M.style.pointerEvents="none";B.appendChild(M);var J=B.offsetWidth||800,T=B.offsetHeight||450,b=Math.ceil(Math.sqrt(J*
J+T*T));E=Math.ceil(b/G)+2;D=Math.ceil(b/I)+2;var S=document.createElement("div");S.className="zwp-wm-tile-grid";S.style.position="absolute";S.style.width=b+"px";S.style.height=b+"px";S.style.left=(J-b)/2+"px";S.style.top=(T-b)/2+"px";S.style.transform="rotate("+N+"deg)";S.style.transformOrigin="center";for(N=0;N<D;N++)for(J=0;J<E;J++)T=document.createElement("span"),T.className="zwp-wm-tile-text",T.textContent=g,C.indexOf("{sys_time}")!==-1&&(T.dataset.template=C),T.style.left=J*G+"px",T.style.top=
N*I+"px",T.style.fontSize=q+"px",T.style.color=A,S.appendChild(T);M.appendChild(S);C.indexOf("{sys_time}")===-1||B._hasSysTime||(B._hasSysTime=!0,e(w))}else B=document.createElement("div"),B.className="zwp-wm",B.style.position="absolute",B.style.zIndex=D+1,B.style.opacity=Math.min((E.opacity!=null?E.opacity:70)/100,1),E.behavior==="dynamic"?(B.style.left="0",B.style.top="0"):(I=E.x||"5%",G=E.y||"5%",(E.dock||"right")==="right"?B.style.right=I:B.style.left=I,B.style.top=G),E.type==="image"?(B.classList.add("zwp-wm-image"),
I=E.height||"auto",B.style.width=E.width||"5%",I!=="auto"&&(B.style.height=I),I=document.createElement("img"),I.src=E.icon||"",I.draggable=!1,I.style.width="100%",I.style.height="100%",I.style.objectFit="contain",B.appendChild(I)):(B.classList.add("zwp-wm-text"),(I=(E.text||"").replace(/\n/g," ").replace(/\r/g,"").trim())||(I=""),G=y(I,w),C=document.createElement("span"),C.textContent=G,C.dataset.template=I,C.style.fontSize=(E.font_size||14)+"px",C.style.color=E.font_color||"rgba(255,255,255,0.4)",
C.style.display="block",C.style.whiteSpace="nowrap",B.appendChild(C),I.indexOf("{sys_time}")!==-1&&(v=!0)),u.appendChild(B),E.behavior==="dynamic"&&E.movement&&c.push({el:B,wm:E,variables:w})});v&&e(w);c.length>0&&r(l)}function y(l,p){return l.replace(/\{(\w+)\}/g,function(w,v){return v==="sys_time"?x():p&&p[v]!=null?String(p[v]):w})}function x(){var l=new Date,p=function(w){return w<10?"0"+w:w};return l.getFullYear()+"-"+p(l.getMonth()+1)+"-"+p(l.getDate())+" "+p(l.getHours())+":"+p(l.getMinutes())+
":"+p(l.getSeconds())}function e(l){d();h=setInterval(function(){u&&u.querySelectorAll("[data-template]").forEach(function(p){var w=p.dataset.template;w&&w.indexOf("{sys_time}")!==-1&&(p.textContent=y(w,l))})},1E3)}function d(){h&&(clearInterval(h),h=null)}function r(l){var p=l.overlay_layers;if(p){var w=p.getBoundingClientRect();c.forEach(function(D){var B=D.wm.movement||{direction:"diagonal",speed:2},G=(B.speed||2)*30;var N=B.direction==="horizontal"?0:B.direction==="vertical"?Math.PI/2:B.direction===
"diagonal"?Math.PI/4:Math.random()*Math.PI*2;var I=D.el.offsetWidth||20,C=D.el.offsetHeight||20;D._anim={dx:Math.cos(N)*G,dy:Math.sin(N)*G,px:Math.random()*Math.max(w.width-I,0),py:Math.random()*Math.max(w.height-C,0),lastTime:performance.now(),containerW:w.width,containerH:w.height,elW:I,elH:C,visible:!0,phaseTimer:0,duration:B.duration||0,interval:B.interval||0}});var v=w,E=performance.now();p=function(){v=null};window.addEventListener("resize",p);document.addEventListener("fullscreenchange",p);
document.addEventListener("webkitfullscreenchange",p);k=[["resize",window,p],["fullscreenchange",document,p],["webkitfullscreenchange",document,p]];f=requestAnimationFrame(function G(B){var N=l.overlay_layers;if(N){if(!v||B-E>2E3)v=N.getBoundingClientRect(),E=B;var I=v;c.forEach(function(C){if(C._anim){var g=C._anim,q=(B-g.lastTime)/1E3;q>.5&&(q=.016);g.lastTime=B;var A=g.duration>0;A&&(g.phaseTimer+=q,g.visible&&g.phaseTimer>=g.duration?(g.visible=!1,g.phaseTimer=0,C.el.style.opacity="0",C.el.style.transition=
"opacity 0.3s"):!g.visible&&g.phaseTimer>=g.interval&&(g.visible=!0,g.phaseTimer=0,C.el.style.opacity=String(Math.min((C.wm.opacity||70)/100,1)),C.el.style.transition="opacity 0.3s"));if(g.visible||!A)g.px+=g.dx*q,g.py+=g.dy*q,g.px<0&&(g.px=0,g.dx=Math.abs(g.dx)),g.px>I.width-g.elW&&(g.px=I.width-g.elW,g.dx=-Math.abs(g.dx)),g.py<0&&(g.py=0,g.dy=Math.abs(g.dy)),g.py>I.height-g.elH&&(g.py=I.height-g.elH,g.dy=-Math.abs(g.dy)),C.el.style.transform="translate("+g.px.toFixed(1)+"px,"+g.py.toFixed(1)+"px)"}});
f=requestAnimationFrame(G)}})}}function n(){f&&(cancelAnimationFrame(f),f=null);c=[];k&&(k.forEach(function(l){l[1].removeEventListener(l[0],l[2])}),k=null)}Yb=t.debug_log;var m=t.httpGet,u=null,f=null,c=[],h=null,k=null;a.loadWatermarks=function(){var l=this;if(l._watermarkData){var p=l._watermarkData;typeof p==="string"?p.substr(0,4)!=="http"&&p.substr(0,5)!=="blob:"||m(p,function(w){try{var v=JSON.parse(w);l._watermarkData=v;l.loadWatermarks()}catch(E){Yb&&console.warn("[watermark] Failed to parse JSON from "+
p)}},function(){Yb&&console.warn("[watermark] Failed to fetch "+p)}):(typeof p==="object"&&!Array.isArray(p)&&p.zwp_protocol&&typeof p.zwp_protocol==="string"&&p.zwp_protocol.indexOf("ZWMAP/")===0&&p.zwp_type==="watermark"&&Array.isArray(p.watermarks)&&(p=p.watermarks),Array.isArray(p)&&z(l,p))}};a.removeWatermarks=function(){n();d();u&&(u.innerHTML="")};a.setWatermarks=function(l){l?(a._watermarkData=l,a.loadWatermarks()):(a._watermarkData=null,a.removeWatermarks())};a._watermarkDestroy=function(){n();
d();u&&(u.innerHTML="",u=null)};a.registerFeature({name:"watermark",destroy:a._watermarkDestroy},2)}function Rd(a){if(typeof a==="string")return{type:"image",behavior:"static",icon:a,dock:"right",x:"5%",y:"5%",width:"5%",opacity:50};var t={type:"image",behavior:"static",icon:a.icon||"",dock:a.dock||"right",x:a.x||"5%",y:a.y||"5%",width:a.width||"5%",opacity:a.opacity!=null?a.opacity:50};a.height&&(t.height=a.height);return t}function Gc(a){return typeof a!=="string"||a.length===0?!1:/^(https?:|blob:)/i.test(a)}
function Zb(a,t){if(!a||typeof a!=="object")return null;var z=a.url;if(!Gc(z))return Fa&&console.warn("[bumper] "+t+" url missing or unsafe protocol, skipping:",z),null;var y=null;typeof a.skipOffset==="number"&&a.skipOffset>=0&&(y=a.skipOffset);var x=null;typeof a.clickThrough==="string"&&Gc(a.clickThrough)&&(x=a.clickThrough);typeof z!=="string"?a="video/mp4":(a=z.split("?")[0].toLowerCase(),a=a.endsWith(".webm")?"video/webm":a.endsWith(".ogg")||a.endsWith(".ogv")?"video/ogg":a.endsWith(".mov")?
"video/quicktime":a.endsWith(".m3u8")?"application/vnd.apple.mpegurl":"video/mp4");return{position:t,mediaFiles:[{url:z,mimeType:a}],skipOffset:y,clickThrough:x,trackers:[]}}function $b(a,t){if(!a||typeof a!=="string"&&typeof a!=="object")return[];if(typeof a==="string")return t&&typeof t.setConfigUrl==="function"&&t.setConfigUrl(a),[];if(Array.isArray(a))return Fa&&console.warn("[bumper] config must be object or URL string, got array"),[];t=[];if(typeof a.url==="string"&&!a.preRoll&&!a.postRoll)return(a=
Zb(a,"pre"))&&t.push(a),t;if(a.preRoll){var z=Zb(a.preRoll,"pre");z&&t.push(z)}a.postRoll&&(a=Zb(a.postRoll,"post"))&&t.push(a);return t}function Sd(a,t){function z(){if(w&&typeof p==="function"){var q=w;p(q,function(A){if(w===q){w=null;try{var M=JSON.parse(A);v=$b(M,{setConfigUrl:function(J){w=J;z()}});Fa&&console.log("[bumper] config URL fetched:",v.length,"bumper(s)")}catch(J){Fa&&console.warn("[bumper] config URL JSON parse failed:",q,J.message)}}},function(A){w===q&&(w=null,Fa&&console.warn("[bumper] config URL fetch failed:",
q,A?A.status:""))})}}function y(){if(I)return I;if(a.overlay_layers){var q=document.createElement("div");q.className="zwp-bumper-layer";q.setAttribute("aria-hidden","true");q.style.display="none";var A=document.createElement("video");A.className="zwp-bumper-video";A.muted=!0;A.setAttribute("muted","");A.setAttribute("playsinline","");A.setAttribute("webkit-playsinline","");A.setAttribute("preload","auto");A.style.display="";q.appendChild(A);var M=document.createElement("a");M.className="zwp-bumper-learnmore";
M.setAttribute("role","button");M.setAttribute("tabindex","0");M.target="_blank";M.rel="noopener noreferrer";M.style.display="none";q.appendChild(M);var J=document.createElement("div");J.className="zwp-bumper-skip";J.setAttribute("role","button");J.setAttribute("tabindex","0");J.setAttribute("aria-label",K("bumperSkipAd","\u8df3\u8fc7\u5e7f\u544a"));J.style.display="none";q.appendChild(J);a.overlay_layers.appendChild(q);I={layer:q,video:A,skip:J,learnmore:M}}else Fa&&console.warn("[bumper] overlay_layers unavailable, cannot create layer"),
I=null;I&&Fa&&console.log("[bumper] layer DOM created (lazy)");return I}function x(){D=E=!1}function e(q,A){var M=y();if(M){B=q;N=A;a._bumperActive=!0;var J=M.video;q.clickThrough&&M.learnmore?(M.learnmore.href=q.clickThrough,M.learnmore.style.display="",M.learnmore.textContent=K("bumperLearnMore","\u4e86\u89e3\u66f4\u591a")):M.learnmore&&(M.learnmore.style.display="none",M.learnmore.removeAttribute("href"));m(M,q);J.onended=f;J.onerror=c;J.onplaying=r;J.ontimeupdate=u;G&&clearTimeout(G);G=setTimeout(function(){a._bumperActive&&
J.readyState<3&&(Fa&&console.warn("[bumper] load timeout, skipping"),c({type:"timeout"}))},g);J.src=q.mediaFiles[0].url;M.layer.style.display="block";M.layer.setAttribute("aria-hidden","false");a.playerElm&&a.playerElm.classList.add("zwp-ad-playing");(A=J.play())&&typeof A.then==="function"?A.then(function(){d(J)}).catch(function(){Fa&&console.log("[bumper] autoplay muted (policy), unmute UI unavailable during ad")}):d(J);Fa&&console.log("[bumper] playing",q.position,q.mediaFiles[0].url)}else a._bumperActive=
!1,B=null,A&&A()}function d(q){try{q.muted=!1,q.volume=a.videoEl?a.videoEl.volume:1}catch(A){Fa&&console.warn("[bumper] volume sync failed",A)}}function r(){G&&(clearTimeout(G),G=null)}function n(q,A,M){q.textContent=A;M&&(A=document.createElement("i"),A.className="xicon xicon-play",q.appendChild(A))}function m(q,A){var M=q.skip;M&&(M.onclick=function(J){J.preventDefault();J.stopPropagation();M.classList.contains("readonly")||(Fa&&console.log("[bumper] skip button clicked"),h())},M.onkeydown=function(J){if(J.key===
"Enter"||J.key===" ")J.preventDefault(),M.classList.contains("readonly")||h()},q=A.skipOffset,q===null?(M.classList.add("readonly"),M.style.display="",n(M,K("bumperRemaining","\u5e7f\u544a %s").replace("%s","?"),!1)):q===0?(M.classList.remove("readonly"),M.style.display="",n(M,K("bumperSkipAd","\u8df3\u8fc7\u5e7f\u544a"),!0)):(M.classList.add("readonly"),M.style.display="",n(M,K("bumperSkipIn","%s\u79d2\u540e\u53ef\u8df3\u8fc7\u5e7f\u544a").replace("%s",q),!1)))}function u(){if(a._bumperActive&&B&&
I){var q=I.video,A=I.skip,M=B.skipOffset,J=0,T=0;try{J=q.currentTime||0,T=q.duration||0}catch(b){return}M===null?A&&T>0&&(q=Math.max(0,Math.ceil(T-J)),n(A,K("bumperRemaining","\u5e7f\u544a %s").replace("%s",q),!1)):M>0&&(J>=M?A.classList.contains("skippable")||(A.classList.remove("readonly"),A.classList.add("skippable"),n(A,K("bumperSkipAd","\u8df3\u8fc7\u5e7f\u544a"),!0)):A&&(q=Math.ceil(M-J),n(A,K("bumperSkipIn","%s\u79d2\u540e\u53ef\u8df3\u8fc7\u5e7f\u544a").replace("%s",q),!1)))}}function f(){h()}
function c(q){Fa&&console.warn("[bumper] error:",q&&q.type);h()}function h(){G&&(clearTimeout(G),G=null);var q=I;if(q){q.layer.style.display="none";q.layer.setAttribute("aria-hidden","true");a.playerElm&&a.playerElm.classList.remove("zwp-ad-playing");q.video.onended=null;q.video.onerror=null;q.video.onplaying=null;q.video.ontimeupdate=null;try{q.video.pause()}catch(M){}q.video.removeAttribute("src");q.skip&&(q.skip.style.display="none",q.skip.onclick=null,q.skip.onkeydown=null,q.skip.classList.remove("readonly",
"skippable"))}q=B;var A=N;N=B=null;a._bumperActive=!1;Fa&&q&&console.log("[bumper] ended",q.position);A&&A()}function k(){if(!(E||a._mode&&a._mode!=="standard")){for(var q=null,A=0;A<v.length;A++)if(v[A].position==="pre"){q=v[A];break}if(q){Fa&&console.log("[bumper] pre-roll interception: pausing main content");a._bumperActive=!0;try{a.videoEl.pause()}catch(M){}e(q,function(){E=!0;Fa&&console.log("[bumper] pre-roll done, resuming main content");try{a.videoEl.play()}catch(M){}})}else E=!0}}function l(){if(!(D||
a._bumperActive||a._mode&&a._mode!=="standard"||a._config.loop)){for(var q=null,A=0;A<v.length;A++)if(v[A].position==="post"){q=v[A];break}q?(Fa&&console.log("[bumper] post-roll: playing after main content ended"),e(q,function(){D=!0;Fa&&console.log("[bumper] post-roll done")})):D=!0}}Fa=!1;var p=t.httpGet,w=null,v=[],E=a._bumperActive=!1,D=!1,B=null,G=null,N=null,I=null;a._bumperReady=function(){!C&&a.videoEl&&(a.videoEl.addEventListener("play",k),a.videoEl.addEventListener("ended",l),a.videoEl.addEventListener("loadstart",
x),C=!0,Fa&&console.log("[bumper] listeners attached (play + ended + loadstart)"))};var C=!1;v=$b(t.bumperConfig!==void 0?t.bumperConfig:a._config.bumper,{setConfigUrl:function(q){w=q}});z();Fa&&console.log("[bumper] setup: normalized",v.length,"bumper(s)",w?"(config URL pending fetch: "+w+")":"");var g=a._config.bumperLoadTimeout!==void 0?a._config.bumperLoadTimeout:5E3;a.setBumpers=function(q){w=null;v=$b(q,{setConfigUrl:function(A){w=A}});z();D=E=!1;Fa&&console.log("[bumper] setBumpers: updated to",
v.length,"bumper(s)")};a.getBumperState=function(){var q=0,A=!1;if(a._bumperActive&&I&&I.video&&B){try{q=Math.max(0,(I.video.duration||0)-I.video.currentTime)}catch(J){}var M=B.skipOffset;if(M!==null)try{A=M===0||I.video.currentTime>=M}catch(J){}}return{active:a._bumperActive,position:B?B.position:null,remainingTime:q,skippable:A}};a.skipBumper=function(){a._bumperActive&&(Fa&&console.log("[bumper] skipBumper: skipping current bumper"),h())};a._bumperDestroy=function(){G&&(clearTimeout(G),G=null);
C&&a.videoEl&&(a.videoEl.removeEventListener("play",k),a.videoEl.removeEventListener("ended",l),a.videoEl.removeEventListener("loadstart",x),C=!1);if(I&&I.video){I.video.onended=null;I.video.onerror=null;I.video.onplaying=null;I.video.ontimeupdate=null;I.video.pause();I.video.removeAttribute("src");try{I.video.load()}catch(q){}}I&&I.layer&&I.layer.parentNode&&I.layer.parentNode.removeChild(I.layer);I=null;v=[];w=null;D=E=a._bumperActive=!1;N=B=null;Fa&&console.log("[bumper] destroyed")};a.registerFeature({name:"bumper",
destroy:a._bumperDestroy},1);a._getBumpersInternal=function(){return v};a._getBumperDomInternal=function(){return y()}}function Td(a){if(typeof a!=="string")return"video/mp4";a=a.split("?")[0].toLowerCase();return a.endsWith(".webm")?"video/webm":a.endsWith(".ogg")||a.endsWith(".ogv")?"video/ogg":a.endsWith(".mov")?"video/quicktime":"video/mp4"}function Ud(a){if(typeof a!=="string")return"image/jpeg";a=a.split("?")[0].toLowerCase();return a.endsWith(".png")?"image/png":a.endsWith(".webp")?"image/webp":
a.endsWith(".gif")?"image/gif":"image/jpeg"}function Hc(a){return typeof a!=="string"||a.length===0?!1:/^(https?:|blob:)/i.test(a)}function Ic(a,t){if(!a||typeof a!=="object")return null;var z=a.url;if(!Hc(z))return Ya&&console.warn("[pauseAd] "+t+" url unsafe, skipping"),null;var y=null;typeof a.clickThrough==="string"&&Hc(a.clickThrough)&&(y=a.clickThrough);return{mediaType:t,mediaFiles:[{url:z,mimeType:(t==="image"?Ud:Td)(z)}],muted:t==="video"?a.muted!==!1:!0,loop:t==="video"?a.loop!==!1:!0,clickThrough:y,
trackers:[]}}function ac(a,t){if(!a||typeof a!=="string"&&typeof a!=="object")return null;if(typeof a==="string")return t&&typeof t.setConfigUrl==="function"&&t.setConfigUrl(a),null;if(Array.isArray(a))return null;t=a.image?Ic(a.image,"image"):null;var z=a.video?Ic(a.video,"video"):null;return t||z?{image:t,video:z,prefer:a.prefer==="video"?"video":"image",trackers:[]}:null}function Vd(a,t){function z(){if(n&&typeof m==="function"){var p=n;m(p,function(w){if(n===p){n=null;try{u=ac(JSON.parse(w),{setConfigUrl:function(v){n=
v;z()}}),h=!1,Ya&&console.log("[pauseAd] config URL fetched")}catch(v){Ya&&console.warn("[pauseAd] config URL JSON parse failed:",p,v.message)}}},function(w){n===p&&(n=null,Ya&&console.warn("[pauseAd] config URL fetch failed:",p,w?w.status:""))})}}function y(){if(f)return f;if(a.overlay_layers){var p=document.createElement("div");p.className="zwp-pausead-layer";p.setAttribute("aria-hidden","true");p.style.display="none";var w=document.createElement("img");w.className="zwp-pausead-image";w.style.display=
"none";w.setAttribute("alt","");p.appendChild(w);var v=document.createElement("video");v.className="zwp-pausead-video";v.muted=!0;v.setAttribute("muted","");v.setAttribute("playsinline","");v.setAttribute("webkit-playsinline","");v.loop=!0;v.style.display="none";p.appendChild(v);var E=document.createElement("div");E.className="zwp-pausead-close";E.setAttribute("role","button");E.setAttribute("tabindex","0");E.setAttribute("aria-label",K("pauseAdClose","\u5173\u95ed"));E.textContent="\u00d7";E.style.display=
"none";p.appendChild(E);a.overlay_layers.appendChild(p);f={layer:p,image:w,video:v,close:E}}else f=null;f&&Ya&&console.log("[pauseAd] layer DOM created (lazy)");return f}function x(p){var w=u.prefer,v=w==="video"?u.video:u.image;w=w==="video"?u.image:u.video;v?e(p,v):w?e(p,w):Ya&&console.warn("[pauseAd] no media to load")}function e(p,w){w.mediaType==="image"?(p.image.src=w.mediaFiles[0].url,p.image.style.display="",p.video.style.display="none",w.clickThrough?(p.image.style.cursor="pointer",p.image.onclick=
function(){window.open(w.clickThrough,"_blank","noopener,noreferrer")}):(p.image.style.cursor="",p.image.onclick=null)):(p.video.src=w.mediaFiles[0].url,p.video.muted=w.muted,p.video.loop=w.loop,p.video.style.display="",p.image.style.display="none",w.clickThrough?(p.video.style.cursor="pointer",p.video.onclick=function(){window.open(w.clickThrough,"_blank","noopener,noreferrer")}):(p.video.style.cursor="",p.video.onclick=null));k=w.mediaType}function d(p){if(c){var w=f;if(w&&w.video&&k==="video"){try{w.video.pause()}catch(v){}try{w.video.currentTime=
0}catch(v){}}w&&(w.layer.style.display="none",w.layer.setAttribute("aria-hidden","true"),w.close.style.display="none");c=!1;Ya&&console.log("[pauseAd] hidden, resumeMain="+p)}}function r(){f&&(f.close.onclick=function(p){p.preventDefault();p.stopPropagation();d(!1)},f.close.onkeydown=function(p){if(p.key==="Enter"||p.key===" ")p.preventDefault(),d(!1)})}Ya=!1;var n=null,m=t.httpGet,u=null,f=null,c=!1,h=!1,k=null;u=ac(t.pauseAdConfig!==void 0?t.pauseAdConfig:a._config.pauseAd,{setConfigUrl:function(p){n=
p}});z();a._maybeShowPauseAd=function(){if(!c&&u&&a._userPaused&&!(a.focusPaused||a._frameStepping||a._systemPaused||a._bumperActive||a._mode&&a._mode!=="standard")){var p=y();if(p){c=!0;h||(x(p),h=!0);p.layer.style.display="flex";p.layer.setAttribute("aria-hidden","false");p.close.style.display="";if(k==="video"&&p.video)try{p.video.play().catch(function(){})}catch(w){}Ya&&console.log("[pauseAd] showing",k)}}};var l=y;y=function(){var p=l();p&&!p._closeBound&&(r(),p._closeBound=!0);return p};a.setPauseAd=
function(p){n=null;u=ac(p,{setConfigUrl:function(w){n=w}});z();h=!1;k=null;Ya&&console.log("[pauseAd] setPauseAd: updated")};a.getPauseAdState=function(){return{active:c,mediaType:c?k:null}};a.hidePauseAd=function(){d(!1)};a._pauseAdDestroy=function(){if(f&&f.video){try{f.video.pause()}catch(p){}f.video.removeAttribute("src");try{f.video.load()}catch(p){}}f&&f.layer&&f.layer.parentNode&&f.layer.parentNode.removeChild(f.layer);n=u=f=null;h=c=!1;k=null};a.registerFeature({name:"pauseAd",destroy:a._pauseAdDestroy},
1);a._getPauseAdInternal=function(){return u};a._getPauseAdDomInternal=function(){return y()}}function Wd(a,t){function z(d,r){if(!r)return Ea(d);d=Ea(d);r=r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return d.replace(new RegExp("("+r+")","gi"),'<span class="search-highlight">$1</span>')}var y={_FAVORITES_KEY:"zwplayer_playlist_favorites",_PROGRESS_KEY:"zwplayer_playlist_progress",_cache:{favorites:null,progress:null,history:null},getFavorites:function(){if(this._cache.favorites)return this._cache.favorites;
try{var d=localStorage.getItem(this._FAVORITES_KEY);this._cache.favorites=d?JSON.parse(d):{};return this._cache.favorites}catch(r){return{}}},toggleFavorite:function(d){var r=this.getFavorites();if(r[d])return delete r[d],localStorage.setItem(this._FAVORITES_KEY,JSON.stringify(r)),this._cache.favorites=null,!1;r[d]={timestamp:Date.now()};localStorage.setItem(this._FAVORITES_KEY,JSON.stringify(r));this._cache.favorites=null;return!0},isFavorite:function(d){return!!this.getFavorites()[d]},saveProgress:function(d,
r,n,m){try{var u=this.getAllProgress(),f=n>0?r/n:0,c=u[d]?u[d].isCompleted:!1;u[d]={currentTime:r,duration:n,percent:f,isCompleted:m||f>.95||c,lastPlay:Date.now()};var h=Object.keys(u);if(h.length>500){h.sort(function(l,p){return(u[l].lastPlay||0)-(u[p].lastPlay||0)});var k=h.length-500;for(d=0;d<k;d++)delete u[h[d]]}localStorage.setItem(this._PROGRESS_KEY,JSON.stringify(u));this._cache.progress=null}catch(l){}},getItemProgress:function(d){return this.getAllProgress()[d]||null},getAllProgress:function(){if(this._cache.progress)return this._cache.progress;
try{var d=localStorage.getItem(this._PROGRESS_KEY);this._cache.progress=d?JSON.parse(d):{};return this._cache.progress}catch(r){return{}}},clearProgress:function(d){try{var r=this.getAllProgress();delete r[d];localStorage.setItem(this._PROGRESS_KEY,JSON.stringify(r));this._cache.progress=null}catch(n){}},saveSortOrder:function(d,r){try{localStorage.setItem("zwplayer_playlist_sort_"+d,r)}catch(n){}},getSortOrder:function(d){try{return localStorage.getItem("zwplayer_playlist_sort_"+d)||"asc"}catch(r){return"asc"}},
_HISTORY_KEY:"zwplayer_playlist_history",_HISTORY_MAX:100,addToHistory:function(d,r){try{var n=this.getHistory();n=n.filter(function(m){return m.id!==d});n.unshift({id:d,name:r,timestamp:Date.now()});n.length>this._HISTORY_MAX&&(n=n.slice(0,this._HISTORY_MAX));localStorage.setItem(this._HISTORY_KEY,JSON.stringify(n));this._cache.history=null}catch(m){}},getHistory:function(){try{var d=localStorage.getItem(this._HISTORY_KEY);return d?JSON.parse(d):[]}catch(r){return[]}},isInHistory:function(d){for(var r=
this.getHistory(),n=0;n<r.length;n++)if(r[n].id===d)return!0;return!1},clearHistory:function(){try{localStorage.removeItem(this._HISTORY_KEY),this._cache.history=null}catch(d){}}};a.playlistState={data:null,currentGroup:null,currentItem:null,searchKeyword:"",sortOrder:"asc",isSingleLevel:!1,isLoading:!1,isLocal:!1,showHistoryOnly:!1,sourceUrl:null,autoPlayNext:!0,loopPlaylist:!1,shuffle:!1,shuffleHistory:[]};a.togglePlaylistPanel=function(){var d=this;if(d.playlistPanel)if(ya(d.playlistPanel,"zwp-panel-open")){d.playlistState.searchKeyword=
"";var r=d.playlistPanel.querySelector(".zwp-playlist-search-input");r&&document.activeElement===r&&r.blur();ja(d.playlistPanel,"zwp-panel-open");setTimeout(function(){d.playlistPanel&&!ya(d.playlistPanel,"zwp-panel-open")&&(d.playlistPanel.style.display="none")},350)}else d.closeAllActivePanels&&d.closeAllActivePanels(),d.playlistPanel.style.display="flex",d.playlistPanel.style.opacity="1",d.playlistPanel.offsetHeight,ka(d.playlistPanel,"zwp-panel-open"),d.renderPlaylistGroups(),d.renderPlaylistItems();
else if(d.closeAllActivePanels&&d.closeAllActivePanels(),r=d.createPlaylistPanel()){var n=d.playerContainer;n&&(n.appendChild(r),d.playlistPanel=r,r.style.display="flex",r.style.opacity="1",r.offsetHeight,ka(r,"zwp-panel-open"),d.playlistState.data?(d.renderPlaylistGroups(),d.renderPlaylistItems()):d.loadPlaylistData())}}.bind(a);a._playlistOutsideClose=function(d){var r=this.playlistPanel;if(r&&r.style.display!=="none"&&ya(r,"zwp-panel-open")){var n=d.target;!n||n.nodeType!==1&&n.nodeType!==9||r.contains(n)||
(r=this.controlbar&&this.controlbar.querySelector(".zwp-playlistButton"),r&&r.contains(n)||(d.preventDefault(),d.stopPropagation(),this.togglePlaylistPanel()))}}.bind(a);document.addEventListener("click",a._playlistOutsideClose,!0);document.addEventListener("dblclick",a._playlistOutsideClose,!0);a.registerFeature&&a.registerFeature({name:"playlist-outside-close",destroy:function(){document.removeEventListener("click",a._playlistOutsideClose,!0);document.removeEventListener("dblclick",a._playlistOutsideClose,
!0)}},2);a.createPlaylistPanel=function(){var d=this;if(!d.overlay_layers)return null;var r=document.createElement("div");r.className="zwp-playlistPanel";r.setAttribute("role","dialog");r.setAttribute("aria-label",K("playlist","Playlist"));r.style.display="none";r.addEventListener("click",function(G){G.stopPropagation();var N=r.querySelector(".zwp-playlist-mode-menu");N&&!G.target.closest(".zwp-playlist-mode-btn")&&(N.style.display="none")});r.addEventListener("dblclick",function(G){G.stopPropagation()});
var n=0,m=0,u=0;r.addEventListener("touchstart",function(G){G=G.touches[0];n=G.clientX;m=G.clientY;u=Date.now()},{passive:!0});r.addEventListener("touchend",function(G){var N=G.changedTouches[0];G=N.clientX-n;N=Math.abs(N.clientY-m);var I=Date.now()-u;G<-80&&N<50&&I<500&&d.togglePlaylistPanel()},{passive:!0});var f=document.createElement("div");f.className="zwp-playlist-header";var c=document.createElement("span");c.className="zwp-playlist-title";c.textContent=K("playlist","Playlist");f.appendChild(c);
var h=document.createElement("div");h.className="zwp-playlist-header-actions";c=document.createElement("button");c.className="zwp-playlist-refresh-btn";c.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8"/><path d="M21 3v5h-5"/></svg>';c.title=K("refresh","Refresh");c.addEventListener("click",function(){d.playlistState.isLocal?
d._resetLocalPlaylistItems():(d.playlistState.isLoading=!1,d.playlistState.data=null,d.loadPlaylistData())});var k=document.createElement("button");k.className="zwp-playlist-mode-btn";k.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M5 6 L11.5 12 L5 18 Z" /><path d="M12.5 6 L19 12 L12.5 18 Z" /></svg>';k.title=K("playMode","Continuous");h.appendChild(k);h.appendChild(c);
var l=document.createElement("div");l.className="zwp-playlist-mode-menu";[{key:"continuous",icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M5 6 L11.5 12 L5 18 Z" /><path d="M12.5 6 L19 12 L12.5 18 Z" /></svg>',label:K("playModeContinuous","Continuous"),action:function(){d.playlistState.autoPlayNext=!0;d.playlistState.loopPlaylist=!1;d._config.loop=!1;d.playlistState.shuffle=
!1;d.playlistState.shuffleHistory=[]}},{key:"loop",icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M18.5 15.5 A 7.5 7.5 0 1 1 18.5 8.5" /><path d="M14.5 8.5 h4 v-4" /><path d="M9 10.5 h6" /><path d="M9 13.5 h4" /></svg>',label:K("playModeLoop","Loop All"),action:function(){d.playlistState.autoPlayNext=!0;d.playlistState.loopPlaylist=!0;d._config.loop=!1;d.playlistState.shuffle=
!1;d.playlistState.shuffleHistory=[]}},{key:"repeat",icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M18.5 15.5 A 7.5 7.5 0 1 1 18.5 8.5" /><path d="M14.5 8.5 h4 v-4" /><path d="M10.5 11 l 1.5 -1.5 v6" /><path d="M10 15.5 h4" /></svg>',label:K("playModeRepeat","Repeat One"),action:function(){d._config.loop=!0;d.playlistState.autoPlayNext=!1;d.playlistState.shuffle=!1;d.playlistState.shuffleHistory=
[]}},{key:"once",icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M6 5.5 L17 12 L6 18.5 Z" /><rect x="15" y="15" width="5" height="5" rx="0.5" /></svg>',label:K("playModeOnce","Play Once"),action:function(){d.playlistState.autoPlayNext=!1;d.playlistState.loopPlaylist=!1;d._config.loop=!1;d.playlistState.shuffle=!1;d.playlistState.shuffleHistory=[]}},{key:"shuffle",
icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M16 3h5v5" /><path d="M4 20L21 3" /><path d="M21 16v5h-5" /><path d="M15 15l6 6" /><path d="M4 4l5 5" /></svg>',label:K("playModeShuffle","Shuffle"),action:function(){d.playlistState.autoPlayNext=!0;d.playlistState.loopPlaylist=!1;d._config.loop=!1;d.playlistState.shuffle=!0}}].forEach(function(G){var N=document.createElement("div");
N.className="zwp-playlist-mode-option";N.setAttribute("data-mode",G.key);N.innerHTML='<span class="zwp-mode-icon">'+G.icon+'</span><span class="zwp-mode-label">'+G.label+"</span>";N.addEventListener("click",function(){G.action();d._updatePlayModeUI(k,l)});l.appendChild(N)});k.addEventListener("click",function(G){G.stopPropagation();l.style.display=l.style.display==="block"?"none":"block"});r.appendChild(l);var p=document.createElement("button");p.className="zwp-playlist-fav-btn";p.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"/></svg>';
p.title=K("myFavorites","My Favorites");p.addEventListener("click",function(){d.playlistState.showFavoritesOnly=!d.playlistState.showFavoritesOnly;if(d.playlistState.showFavoritesOnly){ka(p,"zwp-active");p.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"/></svg>';
p.style.color="#ff9800";d.playlistState.showHistoryOnly=!1;var G=h.querySelector(".zwp-playlist-history-btn");G&&(ja(G,"zwp-active"),G.style.color="");if(G=r.querySelector(".zwp-playlist-toolbar-clear-history"))G.style.display="none"}else ja(p,"zwp-active"),p.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"/></svg>',
p.style.color="";d.renderPlaylistGroups();d.renderPlaylistItems()});h.appendChild(p);var w=document.createElement("button");w.className="zwp-playlist-history-btn";w.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"/><path d="M3 3v5h5"/><path d="M12 7v5l3 3"/></svg>';w.title=K("playHistory","Play History");w.addEventListener("click",
function(){d.playlistState.showHistoryOnly=!d.playlistState.showHistoryOnly;if(d.playlistState.showHistoryOnly){ka(w,"zwp-active");w.style.color="#00BCD4";var G=r.querySelector(".zwp-playlist-toolbar-clear-history");G&&(G.style.display="");d.playlistState.showFavoritesOnly=!1;if(G=h.querySelector(".zwp-playlist-fav-btn"))ja(G,"zwp-active"),G.style.color=""}else if(ja(w,"zwp-active"),w.style.color="",G=r.querySelector(".zwp-playlist-toolbar-clear-history"))G.style.display="none";d.renderPlaylistGroups();
d.renderPlaylistItems()});h.appendChild(w);c=document.createElement("button");c.className="closeBtn";c.innerHTML='<i class="xicon xicon-close"></i>';c.title=K("close","Close");c.addEventListener("click",function(){d.togglePlaylistPanel()});h.appendChild(c);f.appendChild(h);r.appendChild(f);f=document.createElement("div");f.className="zwp-playlist-search-row";c=document.createElement("div");c.className="zwp-playlist-search-wrapper";var v=document.createElement("input");v.className="zwp-playlist-search-input";
v.type="text";v.placeholder=K("searchPlaylist","Search...");var E=null;v.addEventListener("keydown",function(G){G.keyCode===27&&(d.togglePlaylistPanel(),G.stopPropagation(),G.preventDefault())});var D=document.createElement("button");D.className="zwp-search-clear-btn";D.innerHTML="\u00d7";D.style.display="none";D.addEventListener("click",function(){v.value="";D.style.display="none";B.style.display="block";d.playlistState.searchKeyword="";d.renderPlaylistGroups();d.renderPlaylistItems();v.focus()});
var B=document.createElement("i");B.className="zwp-search-icon xicon xicon-search";B.style.display="block";v.addEventListener("input",function(){var G=v.value.length>0;D.style.display=G?"block":"none";B.style.display=G?"none":"block";E&&clearTimeout(E);E=setTimeout(function(){d.playlistState.searchKeyword=v.value.trim();d.renderPlaylistGroups();d.renderPlaylistItems()},200)});c.appendChild(v);c.appendChild(B);c.appendChild(D);f.appendChild(c);r.appendChild(f);f=document.createElement("div");f.className=
"zwp-playlist-toolbar";f.style.display="none";c=document.createElement("span");c.className="zwp-playlist-toolbar-title";f.appendChild(c);c=document.createElement("button");c.className="zwp-playlist-sort-btn";c.innerHTML='<i class="xicon xicon-sort"></i>';c.title=K("sort","Sort");c.addEventListener("click",function(){d.playlistState.sortOrder=d.playlistState.sortOrder==="asc"?"desc":"asc";y.saveSortOrder(d.playlistState.sourceUrl,d.playlistState.sortOrder);d.renderPlaylistItems()});f.appendChild(c);
c=document.createElement("button");c.className="zwp-playlist-toolbar-clear-history";c.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M19 6 l-1 14 c0 1 -1 2 -2 2 H8 c-1 0 -2 -1 -2 -2 L5 6" /><path d="M3 6h18"/><path d="M9 6V4a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2"/><path d="M10 11v6" /><path d="M14 11v6" /></svg>';c.title=K("clearHistory","Clear History");c.style.display="none";
c.addEventListener("click",function(){y.clearHistory();d.showToast&&d.showToast(K("clearHistory","Clear History")+" OK");d.renderPlaylistItems()});f.appendChild(c);r.appendChild(f);f=document.createElement("div");f.className="zwp-playlist-container";c=document.createElement("div");c.className="zwp-playlist-groups";f.appendChild(c);c=document.createElement("div");c.className="zwp-playlist-items";f.appendChild(c);r.appendChild(f);return r}.bind(a);a.loadPlaylistData=function(){var d=this;d.playlistState.isLocal&&
d._playlistBlobUrls&&d._playlistBlobUrls.length>0&&(d._playlistBlobUrls.forEach(function(u){URL.revokeObjectURL(u)}),d._playlistBlobUrls=[]);d.playlistState.isLocal=!1;d.murl&&d.stop();var r=d.playlistState.sourceUrl;if(r&&!d.playlistState.isLoading){d.playlistState.isLoading=!0;if(d.playlistPanel){var n=d.playlistPanel.querySelector(".zwp-playlist-items");n&&(n.innerHTML='<div class="zwp-playlist-loading">'+K("loading","Loading...")+"</div>")}var m=new XMLHttpRequest;m.open("GET",r,!0);m.onreadystatechange=
function(){if(m.readyState===4)if(m.status>=200&&m.status<400){var u=m.responseText,f=null;try{f=JSON.parse(u)}catch(c){try{f=d.parsePlaylistXML(u)}catch(h){d.playlistState.isLoading=!1;d.toast(K("playlistParseError","Failed to parse playlist"));if(u=d.playlistPanel&&d.playlistPanel.querySelector(".zwp-playlist-items"))u.innerHTML='<div class="zwp-playlist-error">\u26a0 '+K("playlistParseError","Failed to parse playlist")+"</div>";return}}if(f){d.playlistState.data=d.normalizePlaylistData(f);d.playlistState.sortOrder=
y.getSortOrder(r);d.playlistState.isSingleLevel=d.playlistState.data.groups.length===1;if(d.playlistState.data.groups.length===0){d.playlistState.isLoading=!1;if(u=d.playlistPanel&&d.playlistPanel.querySelector(".zwp-playlist-items"))u.innerHTML='<div class="zwp-playlist-empty">'+K("noPlaylistItems","No items")+"</div>";return}d.playlistState.data.groups.length>0&&(d.playlistState.currentGroup=d.playlistState.data.groups[0]);d.renderPlaylistGroups();d.renderPlaylistItems();d.playlistPanel&&d.playlistState.data.title&&
(u=d.playlistPanel.querySelector(".zwp-playlist-title"))&&(u.textContent=d.playlistState.data.title);d.playlistState.isSingleLevel&&d.playlistPanel&&(ka(d.playlistPanel,"zwp-single-level"),u=d.playlistPanel.querySelector(".zwp-playlist-toolbar"))&&(u.style.display="flex")}d.playlistState.isLoading=!1}else if(d.playlistState.isLoading=!1,d.toast(K("playlistLoadFailed","Failed to load playlist")+(m.status?": HTTP "+m.status:"")),u=d.playlistPanel&&d.playlistPanel.querySelector(".zwp-playlist-items"))u.innerHTML=
'<div class="zwp-playlist-error">\u26a0 '+K("playlistLoadFailed","Failed to load playlist")+"</div>"};m.onerror=function(){d.playlistState.isLoading=!1;d.toast(K("playlistNetworkError","Network error"));var u=d.playlistPanel&&d.playlistPanel.querySelector(".zwp-playlist-items");u&&(u.innerHTML='<div class="zwp-playlist-error">\u26a0 '+K("playlistNetworkError","Network error")+"</div>")};m.send()}}.bind(a);a.isValidPlaylistData=function(d){return d&&d.zwp_protocol&&typeof d.zwp_protocol==="string"&&
d.zwp_protocol.startsWith("ZWMAP/")&&d.zwp_type==="playlist"&&d.groups&&Array.isArray(d.groups)?!0:!1};a._applyPlaylistData=function(d,r,n){this.playlistState.sourceUrl=r;d=this.normalizePlaylistData(d);this.playlistState.data=d;this.playlistState.sortOrder=y.getSortOrder(r);this.playlistState.isSingleLevel=d.groups.length===1;this._userModeOverride=!1;d.groups.length>0&&(this.playlistState.currentGroup=d.groups[0]);this._ensurePlaylistButton();this.playlistPanel||(this.playlistPanel=this.createPlaylistPanel())&&
this.playerContainer&&this.playerContainer.appendChild(this.playlistPanel);this.renderPlaylistGroups();this.renderPlaylistItems();this.playlistPanel&&d.title&&(r=this.playlistPanel.querySelector(".zwp-playlist-title"))&&(r.textContent=d.title);if(n)(n=d.groups[0])&&n.items&&n.items.length>0&&this.playPlaylistItem(n.items[0]);else{n=(n=d.groups[0])&&n.items&&n.items.length>0?n.items[0]:null;d=this._explicitKeys&&this._explicitKeys.has("poster")&&this._config.poster||n&&n.poster||"";this._config.poster=
d;this.videoEl&&(d?this.videoEl.setAttribute("poster",d):this.videoEl.removeAttribute("poster"));r="";if(!d&&n&&!n.isLive&&typeof n.url==="string"&&/^https?:\/\//i.test(n.url)){d=String(n.type||"").toLowerCase();var m=this.getFileExtension?this.getFileExtension(n.url.split("?")[0].split("#")[0]):"";d!==""&&d!=="auto"&&d!=="mp4"&&d!=="video"||[".mp4",".webm",".mov",".m4v",".ogv"].indexOf(m)===-1||(r=n.url.indexOf("#")===-1?n.url+"#t=0.001":n.url)}if(this.videoEl&&!this.isPlaying){if(this._playlistPreviewSrc&&
this.videoEl.getAttribute("src")===this._playlistPreviewSrc){this.videoEl.removeAttribute("src");try{this.videoEl.load()}catch(u){}}r&&(this.videoEl.src=r);this._playlistPreviewSrc=r}typeof this.updateLocalPlaybackHint==="function"&&this.updateLocalPlaybackHint(!0)}};a._ensurePlaylistButton=function(){if(this.controlbar&&!this.controlbar.querySelector(".zwp-playlistButton")){var d=document.createElement("div");d.className="zwp-button zwp-playlistButton";d.innerHTML='<button class="zwpbtn zwp-playlistBtn" data-action="showPlaylist" data-name="playlistbtn" title="'+
K("playlist","Playlist")+'"><i class="xicon xicon-list"></i></button>';d.querySelector("button").addEventListener("click",this.on_btnclick);var r=this.controlbar.querySelector(".zwp__time-info");r&&r.nextSibling?this.controlbar.insertBefore(d,r.nextSibling):(r=this.controlbar.querySelector(".zwp-button"))?this.controlbar.insertBefore(d,r):this.controlbar.appendChild(d)}};var x=".mp3 .flac .m4a .aac .ogg .wav .opus".split(" ");a.inferMediaKind=function(d,r){d=r||a&&a.currentFileName||d;if(!d||typeof d!==
"string")return"video";d=d.split("?")[0].split("#")[0].toLowerCase();for(r=0;r<x.length;r++)if(d.endsWith(x[r]))return"audio";return"video"};a.normalizePlaylistData=function(d){var r={title:"",autoPlayNext:!0,groups:[],music:null,hasAudioItem:!1};if(!d.zwp_protocol||typeof d.zwp_protocol!=="string"||!d.zwp_protocol.startsWith("ZWMAP/")||d.zwp_type!=="playlist")return r;var n=d.zwp_protocol.substring(6);if(parseInt(n.split(".")[0],10)>1)return r;r.title=d.title||"";r.autoPlayNext=d.autoPlayNext!==
!1;d.music&&typeof d.music==="object"&&(r.music=d.music);var m=d.id||d.playlist_id;!m&&r.title&&(m=r.title.toLowerCase().trim().replace(/[-\s]+/g,"_"));m=m||"default_pl";d.groups&&Array.isArray(d.groups)&&(r.groups=d.groups.map(function(u,f){var c=u.id||"group_"+f;return{id:c,name:u.name||"Group "+(f+1),expanded:u.expanded!==!1,items:(u.items||[]).map(function(h,k){var l=h.id||"item_"+k,p=String(h.mediaKind||"").toLowerCase();p=p==="audio"||p.indexOf("audio/")===0?"audio":p==="video"||p.indexOf("video/")===
0?"video":a.inferMediaKind(h.url);p==="audio"&&(r.hasAudioItem=!0);return{id:m+"_"+c+"_"+l,name:h.name||"Item "+(k+1),url:h.url||"",type:h.type||"auto",isLive:h.isLive||!1,poster:h.poster||"",subtitle:h.subtitle||[],audioTracks:h.audioTracks||h.audioTrack||[],chapter:h.chapter||"",annotation:h.annotation||"",epg_now:h.epg_now||"",thumbnails:h.thumbnails||null,lyrics:h.lyrics!==void 0?h.lyrics:"",artist:h.artist||"",mediaKind:p,music:h.music&&typeof h.music==="object"?h.music:null,bumper:h.bumper!==
void 0?h.bumper:void 0,pauseAd:h.pauseAd!==void 0?h.pauseAd:void 0,_fingerprint:h._fingerprint}})}}));return r};a.shouldAutoSwitchMode=function(){var d=this._explicitKeys&&this._explicitKeys.has("mode"),r=this._config.mode;return d&&r!=="auto"?!1:r==="auto"?!0:d?!1:(d=this.playlistState&&this.playlistState.data,!(!d||!d.hasAudioItem))};a.injectItemMusicConfig=function(d){var r=this.playlistState.data&&this.playlistState.data.music||{},n=d.music||{},m=this._explicitKeys&&this._explicitKeys.has("music")?
this._config.music:{},u={};n.theme&&(u.theme=n.theme);this._config.music=Object.assign({},r,m,u,{artist:d.artist||m&&m.artist||r.artist||""})};a.parsePlaylistXML=function(d){d=(new DOMParser).parseFromString(d,"text/xml");if(d.getElementsByTagName("parsererror").length>0)throw Error("XML parse error");var r=d.getElementsByTagName("playlist")[0];if(!r)throw Error("No <playlist> element found");d={zwp_protocol:"ZWMAP/1.0",zwp_type:"playlist",id:r.getAttribute("id")||"",title:"",groups:[]};var n=r.getElementsByTagName("title");
n.length>0&&(d.title=n[0].textContent||"");r=r.getElementsByTagName("group");for(n=0;n<r.length;n++){var m=r[n],u={id:m.getAttribute("id")||"group_"+n,name:m.getAttribute("name")||"",expanded:m.getAttribute("expanded")==="true",items:[]};m=m.getElementsByTagName("channel");for(var f=0;f<m.length;f++){var c=m[f],h=c.getElementsByTagName("name")[0],k=c.getElementsByTagName("url")[0];c.getElementsByTagName("logo")[0];for(var l=c.getElementsByTagName("poster")[0],p=c.getElementsByTagName("epg")[0],w=
c.getElementsByTagName("chapter")[0],v=c.getElementsByTagName("subtitle"),E=[],D=0;D<v.length;D++)E.push(v[D].textContent);v=c.getElementsByTagName("audioTrack");D=[];for(var B=0;B<v.length;B++){var G=v[B],N=G.getAttribute("url")||G.textContent;if(N){var I=G.getAttribute("language")||"",C=G.getAttribute("label")||G.textContent||"";G=G.getAttribute("default")==="true";C===N&&(C="");I||C||G?D.push({url:N,language:I,label:C,"default":G}):D.push(N)}}u.items.push({id:c.getAttribute("id")||"ch_"+n+"_"+
f,name:h?h.textContent:"",url:k?k.textContent:"",type:c.getAttribute("type")||"auto",isLive:c.getAttribute("live")==="true",poster:l?l.textContent:"",subtitle:E,audioTracks:D,chapter:w?w.textContent:"",epg_now:p?p.textContent:""})}d.groups.push(u)}return d};a.renderPlaylistGroups=function(){var d=this;if(d.playlistPanel&&d.playlistState.data){var r=d.playlistPanel.querySelector(".zwp-playlist-groups");if(r)if(d.playlistState.isSingleLevel||d.playlistState.showFavoritesOnly||d.playlistState.showHistoryOnly||
d.playlistState.searchKeyword)ka(d.playlistPanel,"zwp-single-level"),r.style.display="none";else{ja(d.playlistPanel,"zwp-single-level");r.style.display="";var n=document.createDocumentFragment(),m=[];m=m.concat(d.playlistState.data.groups);m.forEach(function(u){var f=document.createElement("div");f.className="zwp-playlist-group";f.setAttribute("data-group-id",u.id);f.setAttribute("role","tab");f.setAttribute("tabindex","0");var c=u.items&&u.items.length||0;f.innerHTML='<span class="zwp-group-name">'+
Ea(u.name)+'</span><span class="zwp-group-count">'+c+"</span>";f.title=u.name+" ("+c+")";d.playlistState.currentGroup&&d.playlistState.currentGroup.id===u.id&&ka(f,"zwp-active");f.addEventListener("click",function(){d.playlistState.currentGroup=u;d.renderPlaylistGroups();d.renderPlaylistItems()});f.addEventListener("keydown",function(h){if(h.keyCode===13||h.keyCode===32)h.preventDefault(),d.playlistState.currentGroup=u,d.renderPlaylistGroups(),d.renderPlaylistItems()});n.appendChild(f)});r.innerHTML=
"";r.appendChild(n);typeof zwpQuery==="function"&&((m=zwpQuery(r).getNiceScroll())&&m.length>0?m[0].resize():zwpQuery(r).niceScroll({cursorcolor:"rgba(255,255,255,0.3)",cursoropacitymin:.1,cursoropacitymax:.5,cursorwidth:"5px",cursorborder:"none",cursorborderradius:"3px",background:"transparent",autohidemode:"scroll"}))}}}.bind(a);a.renderPlaylistItems=function(){var d=this;if(d.playlistPanel&&d.playlistState.data){var r=d.playlistPanel.querySelector(".zwp-playlist-refresh-btn");r&&(d.playlistState.isLocal?
(r.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M19 6 l-1 14 c0 1 -1 2 -2 2 H8 c-1 0 -2 -1 -2 -2 L5 6" /><path d="M3 6h18"/><path d="M9 6V4a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2"/><path d="M10 11v6" /><path d="M14 11v6" /></svg>',r.title=K("clearPlaylist","Clear playlist")):(r.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8"/><path d="M21 3v5h-5"/></svg>',
r.title=K("refresh","Refresh")));var n=d.playlistPanel.querySelector(".zwp-playlist-items");if(n){var m=[],u=(d.playlistState.searchKeyword||"").toLowerCase();r=d.playlistState.currentGroup;if(d.playlistState.showFavoritesOnly||d.playlistState.showHistoryOnly||u){var f={};d.playlistState.data.groups.forEach(function(w){w.items&&w.items.forEach(function(v){f[v.id]||(f[v.id]=!0,m.push(v))})})}else if(r&&r.items)m=r.items.slice();else{n.innerHTML='<div class="zwp-playlist-empty">'+K("noPlaylistItems",
"No items")+"</div>";return}d.playlistState.showFavoritesOnly&&(m=m.filter(function(w){return y.isFavorite(w.id)}));if(d.playlistState.showHistoryOnly){var c={},h={};y.getHistory().forEach(function(w,v){c[w.id]=!0;h[w.id]=v});m=m.filter(function(w){return c[w.id]});m.sort(function(w,v){return(h[w.id]||0)-(h[v.id]||0)})}u&&(m=m.filter(function(w){return w.name.toLowerCase().indexOf(u)!==-1||w.epg_now&&w.epg_now.toLowerCase().indexOf(u)!==-1}));d.playlistState.sortOrder==="desc"&&m.reverse();if(m.length===
0)r=K("noPlaylistItems","No items"),u?r=K("noSearchResult","No results found"):d.playlistState.showHistoryOnly&&(r=K("noHistoryItems","No history")),n.innerHTML='<div class="zwp-playlist-empty">'+r+"</div>";else{n.innerHTML="";var k=d.playlistState.currentItem,l=0;d._playlistRenderRafId&&cancelAnimationFrame(d._playlistRenderRafId);var p=function(){for(var w=document.createDocumentFragment(),v=Math.min(l+100,m.length);l<v;l++){var E=m[l],D=y.getItemProgress(E.id),B=document.createElement("div");B.className=
"zwp-playlist-item";D&&D.isCompleted&&(B.className+=" zwp-item-completed");B.setAttribute("data-item-id",E.id);var G=k&&k.id===E.id;G&&ka(B,"zwp-active");G&&(G=document.createElement("div"),G.className="zwp-playlist-playing-indicator",G.innerHTML="<span></span><span></span><span></span>",B.appendChild(G));G=document.createElement("div");G.className="zwp-playlist-item-info";var N=document.createElement("span");N.className="zwp-playlist-item-name";N.innerHTML=u?z(E.name,d.playlistState.searchKeyword):
Ea(E.name);D&&D.isCompleted&&(N.innerHTML='<svg class="zwp-completed-icon" viewBox="0 0 24 24" width="14" height="14" stroke="currentColor" stroke-width="3" fill="none" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"></polyline></svg> '+N.innerHTML);N.title=E.name;G.appendChild(N);E.isLive===!0&&(N=document.createElement("span"),N.className="zwp-playlist-item-badge zwp-badge-live",N.textContent="live",B.appendChild(N));E.epg_now&&(N=document.createElement("span"),
N.className="zwp-playlist-item-epg",u?N.innerHTML=z(E.epg_now,d.playlistState.searchKeyword):N.textContent=E.epg_now,G.appendChild(N));B.appendChild(G);(function(I,C){var g=y.isFavorite(I.id),q=document.createElement("button");q.className="zwp-playlist-item-fav"+(g?" zwp-fav-active":"");q.innerHTML=g?'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"/></svg>':
'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"/></svg>';q.title=g?K("unfavorite","Remove from favorites"):K("favorite","Add to favorites");q.addEventListener("click",function(A){A.stopPropagation();A=y.toggleFavorite(I.id);q.innerHTML=A?'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"/></svg>':
'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"/></svg>';q.title=A?K("unfavorite","Remove from favorites"):K("favorite","Add to favorites");A?ka(q,"zwp-fav-active"):ja(q,"zwp-fav-active");d.playlistState.showFavoritesOnly&&d.renderPlaylistItems()});C.appendChild(q)})(E,B);d.playlistState.isLocal&&
function(I,C){var g=document.createElement("button");g.className="zwp-playlist-item-remove";g.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M19 6 l-1 14 c0 1 -1 2 -2 2 H8 c-1 0 -2 -1 -2 -2 L5 6" /><path d="M3 6h18"/><path d="M9 6V4a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2"/><path d="M10 11v6" /><path d="M14 11v6" /></svg>';g.title=K("remove","Remove");g.addEventListener("click",
function(q){q.stopPropagation();d._removeLocalPlaylistItem(I.id)});C.appendChild(g)}(E,B);D&&(D.percent>0||D.isCompleted)&&(G=document.createElement("div"),G.className="zwp-playlist-item-progress",N=document.createElement("div"),N.className="zwp-playlist-item-progress-fill",N.style.width=D.isCompleted?"100%":D.percent*100+"%",G.appendChild(N),B.appendChild(G));(function(I){B.addEventListener("click",function(){d.playPlaylistItem(I)})})(E);w.appendChild(B)}n.appendChild(w);if(l<m.length)d._playlistRenderRafId=
requestAnimationFrame(p);else if(d._playlistRenderRafId=null,typeof zwpQuery==="function"&&((w=zwpQuery(n).getNiceScroll())&&w.length>0?w[0].resize():zwpQuery(n).niceScroll({cursorcolor:"rgba(255,255,255,0.3)",cursoropacitymin:.1,cursoropacitymax:.5,cursorwidth:"5px",cursorborder:"none",cursorborderradius:"3px",background:"transparent",autohidemode:"scroll"})),d.playlistState.currentItem&&(w=n.querySelector(".zwp-playlist-item.zwp-active")))w=Math.max(0,w.offsetTop-n.clientHeight/2+w.offsetHeight/
2),typeof zwpQuery==="function"?(v=zwpQuery(n).getNiceScroll())&&v.length>0?v[0].doScrollTop(w,300):n.scrollTop=w:n.scrollTop=w};d._updatePlaylistActiveItem=function(w){if(!this.playlistPanel)return!1;var v=this.playlistPanel.querySelector(".zwp-playlist-items");if(!v)return!1;for(var E=null,D=v.querySelectorAll(".zwp-playlist-item"),B=0;B<D.length;B++)if(D[B].getAttribute("data-item-id")===String(w)){E=D[B];break}if(!E)return!1;(w=v.querySelector(".zwp-playlist-item.zwp-active"))&&w!==E&&(ja(w,"zwp-active"),
(v=w.querySelector(".zwp-playlist-playing-indicator"))&&v.parentNode&&v.parentNode.removeChild(v),(v=y.getItemProgress(w.getAttribute("data-item-id")))&&v.isCompleted&&ka(w,"zwp-item-completed"));E.classList.contains("zwp-active")||(ka(E,"zwp-active"),w=document.createElement("div"),w.className="zwp-playlist-playing-indicator",w.innerHTML="<span></span><span></span><span></span>",E.insertBefore(w,E.firstChild));return!0};p()}}}}.bind(a);a.playPlaylistItem=function(d){var r=this;if(d&&d.url){var n=
y.getItemProgress(d.id),m=0;!(n&&n.currentTime>5)||d.isLive||n.duration&&n.currentTime>=n.duration-5||(m=n.currentTime);r.playlistState.currentItem=d;y.addToHistory(d.id,d.name);var u=d.url;typeof d.url==="object"&&(u=d.url);var f=r.videoEl&&r.videoEl.playbackRate?r.videoEl.playbackRate:1;r.isPlaying?r.stop():(r.clearAllSubtitles&&r.clearAllSubtitles(),r.removeChapters&&r.removeChapters(),r.unloadAnnotations&&r.unloadAnnotations(),r.clearAudioTracks&&r.clearAudioTracks());r._config.url=u;d.type&&
d.type!=="auto"&&(r._config.type=d.type);d.isLive!==void 0&&(r._config.isLive=d.isLive);d.poster?(r._config.poster=d.poster,r.videoEl&&r.videoEl.setAttribute("poster",d.poster)):(r._config.poster="",r.videoEl&&r.videoEl.removeAttribute("poster"));r.setBumpers&&r.setBumpers(d.bumper!==void 0?d.bumper:r._config.bumper);r.setPauseAd&&r.setPauseAd(d.pauseAd!==void 0?d.pauseAd:r._config.pauseAd);n=null;d.thumbnails&&typeof d.thumbnails==="object"&&(n=d.thumbnails,n.zwp_type==="thumbnail"&&n.thumbnail&&
(n=n.thumbnail),r._config.thumbnails=n);(function(){var l=String(d.mediaKind||"").toLowerCase();l=l==="audio"||l.indexOf("audio/")===0?"audio":l==="video"||l.indexOf("video/")===0?"video":r.inferMediaKind?r.inferMediaKind(d.url):"video";var p=!!r._userModeOverride;l==="audio"&&r._mode!=="music"&&!p&&r.shouldAutoSwitchMode()?(r.injectItemMusicConfig(d),r._modeAutoSwitched=!0,typeof r.setMode==="function"&&r.setMode("music",{auto:!0})):l==="video"&&r._mode==="music"&&r._modeAutoSwitched&&!p?(typeof r.setMode===
"function"&&r.setMode("standard",{auto:!0}),r._modeAutoSwitched=!1):l==="audio"&&r._mode==="music"&&(r.injectItemMusicConfig(d),typeof r.setMusicTrack==="function"&&r.setMusicTrack({title:d.name,artist:d.artist,poster:d.poster}))})();r._playingPlaylistItem=!0;r.play(u);r._playingPlaylistItem=!1;d.subtitle&&d.subtitle.length>0&&(u=d.subtitle,Array.isArray(u)||(u=[u]),u.forEach(function(l,p){p=(p+1).toString();typeof l==="object"&&l.url?r.loadSubtitle(l.url,l.pos||p,l.title,!l.langFromName):l instanceof
File?r.loadSubtitle(l,p,l.title||r.getBaseFilename(l.name)):typeof l==="string"&&r.loadSubtitle(l,p,void 0)}));d.audioTracks&&d.audioTracks.length>0&&(u=d.audioTracks,Array.isArray(u)||(u=[u]),u.forEach(function(l){if(l instanceof File){var p=URL.createObjectURL(l);r._playlistBlobUrls&&r._playlistBlobUrls.push(p);r._addAudioTrackInternal(p,void 0,r.getBaseFilename(l.name),!1)}else typeof l==="object"&&l.url?r._addAudioTrackInternal(l.url,l.language,l.label,l.default):typeof l==="string"&&r._addAudioTrackInternal(l)}),
r._defaultAudioId&&r._defaultAudioId!==0&&r.setAudioTrack(r._defaultAudioId),typeof r.updateAudioMenuUI==="function"&&r.updateAudioMenuUI());d.lyrics!==void 0&&typeof r.setLyrics==="function"?r.setLyrics(d.lyrics):typeof r.setLyrics==="function"&&r.setLyrics("");typeof r.setMusicTrack==="function"&&r.setMusicTrack(d);if(f&&f!==1&&r.videoEl){var c=function(){r.videoEl.playbackRate=f;r.videoEl.removeEventListener("canplay",c);if(r.controlbar){for(var l=r.controlbar.querySelectorAll(".zwp-speed-item"),
p=0;p<l.length;p++)ja(l[p],"active"),parseFloat(l[p].innerText)===f&&ka(l[p],"active");if(l=r.controlbar.querySelector(".zwp-speedBtn"))l.innerHTML=f+"x"}};r.videoEl.addEventListener("canplay",c)}if(n&&n.url&&r.progressBar&&r.progressBar.rail&&(u=r.progressBar.rail.querySelector(".zwp__time-float"))){var h=u.querySelector(".zwp__time-thumbnail");h||(u.insertAdjacentHTML("afterbegin",'<div class="zwp__time-thumbnail"></div>'),h=u.querySelector(".zwp__time-thumbnail"),r.progressBar.thumbnails=h);n.rowsize=
typeof n.row==="number"?n.row:Math.ceil(Math.sqrt(n.total));h.style.maxWidth="none";h.style.maxHeight="none";h.style.width=n.width+"px";h.style.height=n.height+"px";h.style.backgroundImage="url("+n.url+")";u.style.width=4+n.width+"px";u.style.height=4+n.height+"px";ka(u,"zwp__thumbnail")}setTimeout(function(){d.chapter&&typeof r.setChapters==="function"&&r.setChapters(d.chapter);d.annotation&&typeof r.loadAnnotations==="function"&&r.loadAnnotations(d.annotation)},1E3);if(m>0){var k=function(){r.playlistState.currentItem!==
d?r.videoEl.removeEventListener("loadedmetadata",k):r.videoEl&&r.videoEl.readyState>=1&&(r.videoEl.currentTime=m,r.videoEl.removeEventListener("loadedmetadata",k))};r.videoEl&&r.videoEl.addEventListener("loadedmetadata",k)}typeof r._updatePlaylistActiveItem==="function"&&r._updatePlaylistActiveItem(d.id)||r.renderPlaylistItems();r._updatePlaylistNavButtons();r._setupPeriodicProgressSave();r._setupErrorAutoskip();r._showUpNext()}}.bind(a);a.savePlaylistProgress=function(){if(this.playlistState.currentItem&&
this.videoEl&&!(this.videoEl.readyState<1)&&!this._config.isLive){var d=this.videoEl.currentTime,r=this.videoEl.duration;!isFinite(r)||r<=0||(d>=r-5||r>0&&d/r>.95?y.saveProgress(this.playlistState.currentItem.id,0,r,!0):y.saveProgress(this.playlistState.currentItem.id,d,r))}}.bind(a);a._setupPeriodicProgressSave=function(){var d=this;if(!d._periodicSaveSetup){d._periodicSaveSetup=!0;var r=0,n=function(){var m=Date.now();m-r<3E4||(r=m,d.savePlaylistProgress())};d.videoEl&&d.videoEl.addEventListener("timeupdate",
n)}}.bind(a);a._setupErrorAutoskip=function(){var d=this;d._errorAutoskipSetup||(d._errorAutoskipSetup=!0,d.videoEl&&(d.videoEl.addEventListener("error",function(){d.playlistPanel&&d.playlistState&&d.playlistState.currentItem&&(d.showToast&&d.showToast(K("playErrorSkip","Playback error. Auto-skipping to next in 3s...")),d._errorSkipTimer&&clearTimeout(d._errorSkipTimer),d._errorSkipTimer=setTimeout(function(){d.playNextPlaylistItem()},3E3))}),d.videoEl.addEventListener("playing",function(){d._errorSkipTimer&&
(clearTimeout(d._errorSkipTimer),d._errorSkipTimer=null)})))}.bind(a);a._getAllFavoriteItems=function(){if(!this.playlistState.data)return[];for(var d=[],r=this.playlistState.data.groups,n=0;n<r.length;n++){var m=r[n].items;if(m)for(var u=0;u<m.length;u++)y.isFavorite(m[u].id)&&d.push(m[u])}return d}.bind(a);a.playNextPlaylistItem=function(){if(this.playlistState.currentItem){if(this.playlistState.showFavoritesOnly){var d=this._getAllFavoriteItems();if(d.length===0)return;for(var r=-1,n=0;n<d.length;n++)if(d[n].id===
this.playlistState.currentItem.id){r=n;break}d=d[(r+1)%d.length]}else{if(!this.playlistState.currentGroup)return;var m=this.playlistState.currentGroup.items;if(!m||m.length===0)return;if(this.playlistState.shuffle){var u=this.playlistState.currentItem.id,f=this.playlistState.shuffleHistory||(this.playlistState.shuffleHistory=[]);f.indexOf(u)===-1&&f.push(u);this.playlistState.shuffleHistory=f.filter(function(c){for(var h=0;h<m.length;h++)if(m[h].id===c)return!0;return!1});f=this.playlistState.shuffleHistory;
d=m.filter(function(c){return c.id!==u&&f.indexOf(c.id)===-1});d.length===0&&(this.playlistState.shuffleHistory=[u],d=m.filter(function(c){return c.id!==u}));d=d.length>0?d[Math.floor(Math.random()*d.length)]:m[0]}else{d=-1;for(r=0;r<m.length;r++)if(m[r].id===this.playlistState.currentItem.id){d=r;break}if(d===-1)return;d+=1;d>=m.length?(d=this._getNextGroupItem(),!d&&this.playlistState.loopPlaylist&&(r=this.playlistState.data.groups[0])&&r.items&&r.items.length>0&&(this.playlistState.currentGroup=
r,d=r.items[0])):d=m[d]}}d&&this.playPlaylistItem(d)}}.bind(a);a._getNextGroupItem=function(){if(!this.playlistState.data||!this.playlistState.currentGroup)return null;for(var d=this.playlistState.data.groups,r=-1,n=0;n<d.length;n++)if(d[n].id===this.playlistState.currentGroup.id){r=n;break}if(r===-1||r>=d.length-1)return null;d=d[r+1];if(!d.items||d.items.length===0)return null;this.playlistState.currentGroup=d;return d.items[0]}.bind(a);a._getPrevGroupItem=function(){if(!this.playlistState.data||
!this.playlistState.currentGroup)return null;for(var d=this.playlistState.data.groups,r=-1,n=0;n<d.length;n++)if(d[n].id===this.playlistState.currentGroup.id){r=n;break}if(r<=0)return null;d=d[r-1];if(!d.items||d.items.length===0)return null;this.playlistState.currentGroup=d;return d.items[d.items.length-1]}.bind(a);a._getUpNextItems=function(d){d=d||3;if(!this.playlistState.currentItem)return[];if(this.playlistState.showFavoritesOnly){var r=this._getAllFavoriteItems();if(r.length<=1)return[];for(var n=
-1,m=0;m<r.length;m++)if(r[m].id===this.playlistState.currentItem.id){n=m;break}if(n===-1)return[];m=[];for(var u=1;u<=d;u++){var f=(n+u)%r.length;f!==n&&m.push(r[f])}return m}if(!this.playlistState.currentGroup)return[];r=this.playlistState.currentGroup.items;if(!r||r.length<=1)return[];n=-1;for(m=0;m<r.length;m++)if(r[m].id===this.playlistState.currentItem.id){n=m;break}if(n===-1)return[];m=[];for(u=1;u<=d;u++)f=n+u,f<r.length&&m.push(r[f]);return m}.bind(a);a._showUpNext=function(){var d=this,
r=d.playerContainer&&d.playerContainer.querySelector(".zwp-upnext-panel");r&&r.parentNode.removeChild(r);r=d._getUpNextItems(3);if(r.length!==0){var n=document.createElement("div");n.className="zwp-upnext-panel";var m=document.createElement("div");m.className="zwp-upnext-title";m.textContent=K("upNext","Up Next");n.appendChild(m);r.forEach(function(u,f){var c=document.createElement("div");c.className="zwp-upnext-item";c.innerHTML='<span class="zwp-upnext-idx">'+(f+1)+'</span><span class="zwp-upnext-name">'+
Ea(u.name)+"</span>";c.addEventListener("click",function(h){h.stopPropagation();d.playPlaylistItem(u)});n.appendChild(c)});d.playerContainer&&(d.playerContainer.appendChild(n),requestAnimationFrame(function(){ka(n,"zwp-upnext-visible")}),setTimeout(function(){ja(n,"zwp-upnext-visible");setTimeout(function(){n.parentNode&&n.parentNode.removeChild(n)},400)},5E3))}}.bind(a);a.playPrevPlaylistItem=function(){if(this.playlistState.currentItem){if(this.playlistState.showFavoritesOnly){var d=this._getAllFavoriteItems();
if(d.length===0)return;var r=-1;for(var n=0;n<d.length;n++)if(d[n].id===this.playlistState.currentItem.id){r=n;break}r=d[(r-1+d.length)%d.length]}else{if(!this.playlistState.currentGroup)return;d=this.playlistState.currentGroup.items;if(!d||d.length===0)return;r=-1;for(n=0;n<d.length;n++)if(d[n].id===this.playlistState.currentItem.id){r=n;break}if(r===-1)return;r===0?(r=this._getPrevGroupItem())||(r=d[d.length-1]):r=d[r-1]}r&&this.playPlaylistItem(r)}}.bind(a);a._ensurePlaylistNavButtons=function(){if(this.controlbar&&
!this.controlbar.querySelector(".zwp-prevButton")){var d=this.controlbar.querySelector(".zwp_playbtn");if(d){var r=document.createElement("div");r.className="zwp-button zwp-prevButton zwp-nav-btn";r.style.display="none";r.innerHTML='<button class="zwpbtn zwp-prevBtn" data-action="playPrevItem" data-name="prevbtn" title="'+K("previousTrack","Previous")+'"><i class="xicon xicon-media-prev"></i></button>';r.querySelector("button").addEventListener("click",this.on_btnclick);var n=document.createElement("div");
n.className="zwp-button zwp-nextButton zwp-nav-btn";n.style.display="none";n.innerHTML='<button class="zwpbtn zwp-nextBtn" data-action="playNextItem" data-name="nextbtn" title="'+K("nextTrack","Next")+'"><i class="xicon xicon-media-next"></i></button>';n.querySelector("button").addEventListener("click",this.on_btnclick);d.parentNode.insertBefore(r,d);d.parentNode.insertBefore(n,d.nextSibling)}}}.bind(a);a._updatePlaylistNavButtons=function(){this._ensurePlaylistNavButtons();var d=this.controlbar&&
this.controlbar.querySelector(".zwp-prevButton"),r=this.controlbar&&this.controlbar.querySelector(".zwp-nextButton");if(d&&r){var n=this.playlistState;if(n&&n.data&&n.data.groups){for(var m=[],u=n.data.groups,f=0;f<u.length;f++){var c=u[f];if(c&&Array.isArray(c.items))for(var h=0;h<c.items.length;h++)m.push(c.items[h])}if(m.length<=1)d.style.display="none",r.style.display="none";else{n=n.currentItem;u=-1;if(n){if(n.id)for(f=0;f<m.length;f++)if(m[f].id===n.id){u=f;break}if(u===-1&&n.url)for(f=0;f<
m.length;f++)if(m[f].url===n.url){u=f;break}}u===-1?(d.style.display="",r.style.display=""):(d.style.display=u>0?"":"none",r.style.display=u<m.length-1?"":"none")}}else d.style.display="none",r.style.display="none"}}.bind(a);a._playlistProgressTimer=0;a._updatePlayModeUI=function(d,r){if(this._config.loop){var n="repeat";var m='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M18.5 15.5 A 7.5 7.5 0 1 1 18.5 8.5" /><path d="M14.5 8.5 h4 v-4" /><path d="M10.5 11 l 1.5 -1.5 v6" /><path d="M10 15.5 h4" /></svg>';
var u=K("playModeRepeat","Repeat One")}else this.playlistState.shuffle?(n="shuffle",m='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M16 3h5v5" /><path d="M4 20L21 3" /><path d="M21 16v5h-5" /><path d="M15 15l6 6" /><path d="M4 4l5 5" /></svg>',u=K("playModeShuffle","Shuffle")):this.playlistState.autoPlayNext&&this.playlistState.loopPlaylist?(n="loop",m='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M18.5 15.5 A 7.5 7.5 0 1 1 18.5 8.5" /><path d="M14.5 8.5 h4 v-4" /><path d="M9 10.5 h6" /><path d="M9 13.5 h4" /></svg>',
u=K("playModeLoop","Loop All")):this.playlistState.autoPlayNext?(n="continuous",m='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M5 6 L11.5 12 L5 18 Z" /><path d="M12.5 6 L19 12 L12.5 18 Z" /></svg>',u=K("playModeContinuous","Continuous")):(n="once",m='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M6 5.5 L17 12 L6 18.5 Z" /><rect x="15" y="15" width="5" height="5" rx="0.5" /></svg>',
u=K("playModeOnce","Play Once"));d&&(d.innerHTML=m,d.title=u);if(r){d=r.querySelectorAll(".zwp-playlist-mode-option");for(m=0;m<d.length;m++)d[m].getAttribute("data-mode")===n?d[m].classList.add("zwp-mode-active"):d[m].classList.remove("zwp-mode-active");r.style.display="none"}};if(a.playlistPanel){t=a.playlistPanel.querySelector(".zwp-playlist-mode-btn");var e=a.playlistPanel.querySelector(".zwp-playlist-mode-menu");t&&e&&a._updatePlayModeUI(t,e)}}function Xd(a,t){if(a.dragableWinInited)typeof a.zwpDragable===
"object"&&("oldX"in a.zwpDragable&&(a.style.left=a.zwpDragable.oldX+"px"),"oldY"in a.zwpDragable&&(a.style.top=a.zwpDragable.oldY+"px"),"oldWidth"in a.zwpDragable&&(a.style.width=a.zwpDragable.oldWidth+"px"),"oldHeight"in a.zwpDragable&&(a.style.height=a.zwpDragable.oldHeight+"px"));else{var z='<div class="zwp-captionbar"><button class="closeBtn" title="'+(K("closeSmallWindow","Close small window")+'"><i class="xicon xicon-close"></i></button></div><div class="zwp-gripper-right"></div><div class="zwp-gripper-bottom"></div><div class="zwp-gripper-bottom-right"></div>');
a.insertAdjacentHTML("beforeend",z);var y=function(m){m.stopPropagation();m.preventDefault();var u=parseInt(a.offsetLeft),f=parseInt(a.offsetTop),c=m.pageX,h=m.pageY,k=window.innerWidth-a.offsetWidth-20,l=window.innerHeight-a.offsetHeight-20,p=function(v){var E=u+v.pageX-c;v=f+v.pageY-h;E<0&&(E=0);v<0&&(v=0);E>k&&(E=k);v>l&&(v=l);a.style.left=E+"px";a.style.top=v+"px";typeof a.zwpDragable==="object"&&(a.zwpDragable.oldX=E,a.zwpDragable.oldY=v)},w=function(v){document.removeEventListener("mousemove",
p);document.removeEventListener("mouseup",w)};document.addEventListener("mousemove",p);document.addEventListener("mouseup",w)};z=function(m){m.stopPropagation();m.preventDefault();var u=a.offsetWidth,f=m.pageX,c=function(k){k=u+k.pageX-f;k<200&&(k=200);a.style.width=k+"px";typeof a.zwpDragable==="object"&&(a.zwpDragable.oldWidth=k)},h=function(k){document.removeEventListener("mousemove",c);document.removeEventListener("mouseup",h)};document.addEventListener("mousemove",c);document.addEventListener("mouseup",
h)};var x=function(m){m.stopPropagation();m.preventDefault();var u=a.offsetHeight,f=m.pageY,c=function(k){k=u+k.pageY-f;k<180&&(k=180);a.style.height=k+"px";typeof a.zwpDragable==="object"&&(a.zwpDragable.oldHeight=k)},h=function(k){document.removeEventListener("mousemove",c);document.removeEventListener("mouseup",h)};document.addEventListener("mousemove",c);document.addEventListener("mouseup",h)},e=function(m){m.stopPropagation();m.preventDefault();var u=a.offsetWidth,f=a.offsetHeight,c=m.pageX,
h=m.pageY,k=function(p){var w=u+p.pageX-c;w<200&&(w=200);p=f+p.pageY-h;p<180&&(p=180);a.style.width=w+"px";a.style.height=p+"px";typeof a.zwpDragable==="object"&&(a.zwpDragable.oldWidth=w,a.zwpDragable.oldHeight=p)},l=function(p){document.removeEventListener("mousemove",k);document.removeEventListener("mouseup",l)};document.addEventListener("mousemove",k);document.addEventListener("mouseup",l)};a.zwpDragable={};var d=a.querySelector(".zwp-captionbar");if(d){var r=d.querySelector(".closeBtn");if(r){var n=
t||function(){};r.addEventListener("click",function(m){m.preventDefault();m.stopPropagation();n(a)})}d.addEventListener("mousedown",y);a.zwpDragable.doc_mousedown=y}t=a.querySelector(".zwp-gripper-right");y=a.querySelector(".zwp-gripper-bottom");d=a.querySelector(".zwp-gripper-bottom-right");t&&(t.addEventListener("mousedown",z),a.zwpDragable.gripperR_mousedown=z);y&&(y.addEventListener("mousedown",x),a.zwpDragable.gripperB_mousedown=x);d&&(d.addEventListener("mousedown",e),a.zwpDragable.gripperBR_mousedown=
e);a.dragableWinInited=!0}}function Yd(a,t){var z=t.detectMobile;a.toast=function(y,x,e,d){var r=this;x=x||2E3;r.toastTimerId&&(clearTimeout(r.toastTimerId),r.toastBox&&(r.overlay_layers.removeChild(r.toastBox),delete r.toastBox));if(y!=="closetoast"){var n,m=!1;typeof y==="object"&&("icon"in y&&(n=String(y.icon).replace(/[^a-zA-Z0-9_-]/g,"")),m=y.raw===!0,y=y.text);m||(y=Ea(y));m=document.createElement("div");var u="",f="zwp-toast zwp-center";n&&(f+=" zwp-toast-icon",u='<i class="xicon xicon-'+n+
'"></i>');e&&(u+='<a href="javascript:void(0)" class="zwp-toast-closebtn"><i class="xicon xicon-close"></i></a>',f+=" zwp-use-close");d&&(f+=" zwp-lite");u+='<span class="zwp-toast-text">'+y+"</span>";m.setAttribute("class",f);m.innerHTML=u;r.overlay_layers.appendChild(m);r.toastBox=m;var c=function(h){if(r.toastBox){var k=r.toastBox.querySelector(".zwp-toast-closebtn");k&&k.removeEventListener("click",c);r.overlay_layers.removeChild(r.toastBox);delete r.toastBox}r.toastTimerId&&(h&&h.type==="click"&&
clearTimeout(r.toastTimerId),delete r.toastTimerId)};r.toastTimerId=window.setTimeout(c,x);e&&(y=m.querySelector(".zwp-toast-closebtn"))&&y.addEventListener("click",c)}}.bind(a);a._updateMutedPlaybackUI=function(){this.playerContainer&&((this.isMobile&&this.isMobile()||this.playerContainer.classList&&this.playerContainer.classList.contains("zwp-mobile")||typeof z==="function"&&z())&&this.videoEl&&!this.videoEl.paused&&this.videoEl.muted?(this._unmuteLayer||this._showUnmuteCapsule(),this.bigPlayOverlay&&
this.bigPlayOverlay.style.display.indexOf("flex")!==-1&&(this.bigPlayOverlay.style.setProperty("display","none","important"),this.bigPlayBtn&&this.bigPlayBtn.style.setProperty("display","none","important"))):this._destroyUnmuteCapsule())}.bind(a);a._destroyUnmuteCapsule=function(){this._unmuteTimer&&(clearTimeout(this._unmuteTimer),delete this._unmuteTimer);this._unmuteLayer&&(this._unmuteLayer.parentNode&&this._unmuteLayer.parentNode.removeChild(this._unmuteLayer),delete this._unmuteLayer)}.bind(a);
a._showUnmuteCapsule=function(){var y=this;if(!y._unmuteLayer){var x=document.createElement("div");x.className="zwp-unmute-layer";x.innerHTML='<div class="zwp-unmute-capsule"><i class="xicon xicon-speaker"></i><span>'+K("tapToUnmute","Tap to unmute")+"</span></div>";y.playerContainer.appendChild(x);y._unmuteLayer=x;var e=x.querySelector(".zwp-unmute-capsule");e&&(requestAnimationFrame(function(){e&&e.classList.add("zwp-show")}),e.addEventListener("click",function(d){d.preventDefault();d.stopPropagation();
e&&e.classList.remove("zwp-show");y.setMuted(!1);window.zwpAllowAutoAudioPlay=!0}))}}.bind(a);a.mutedConfirmBox=function(y){var x=this;if(x.playerContainer&&!x._hlsVideoCodecUnsupported)if(x.isMobile&&x.isMobile()||x.playerContainer&&x.playerContainer.classList.contains("zwp-mobile")||typeof z==="function"&&z())x.mutedTipBox&&(x.mutedTipBox.parentNode&&x.mutedTipBox.parentNode.removeChild(x.mutedTipBox),x.popup_layers&&(x.popup_layers.style.display=null),delete x.mutedTipBox),!y||x.videoEl&&!x.videoEl.paused?
x._updateMutedPlaybackUI():(x._destroyUnmuteCapsule(),x.bigPlayOverlay&&x.bigPlayOverlay.style.setProperty("display","flex","important"),x.bigPlayBtn&&x.bigPlayBtn.style.setProperty("display","flex","important"));else{var e=function(){x.popup_layers||(x.popup_layers=document.createElement("div"),x.popup_layers.setAttribute("class","zwp__popup_layers"),x.playerContainer.appendChild(x.popup_layers));var d=document.createElement("div");var r=y?'<span class="zwp-toast-text">'+K("mutedAutoplayMessagePre",
"Muted due to ")+' <a href="#mutemore" class="mutemore">'+K("browserLimits","Browser Restrictions")+"</a>"+K("autoplayBlockedMessagePost","\uff0c\u7981\u6b62\u81ea\u52a8\u64ad\u653e\uff0c\u8bf7\u70b9\u51fb")+'<a href="#openaudio" class="openaudio">'+K("clickToPlay","\u70b9\u51fb\u64ad\u653e")+'</a><button class="closeBtn" title="'+K("close","Close")+'"><i class="xicon xicon-close"></i></button></span>':'<span class="zwp-toast-text">'+K("mutedAutoplayMessagePre","Muted due to ")+' <a href="#mutemore" class="mutemore">'+
K("browserLimits","Browser Restrictions")+"</a>"+K("mutedAutoplayMessagePost",". Click to ")+'<a href="#openaudio" class="openaudio">'+K("openAudio","Enable")+'</a><button class="closeBtn" title="'+K("close","Close")+'"><i class="xicon xicon-close"></i></button></span>';d.setAttribute("class","zwp-toast zwp-confirm zwp-center");d.innerHTML=r;x.popup_layers.appendChild(d);x.mutedTipBox=d;(r=d.querySelector(".closeBtn"))&&r.addEventListener("click",function(n){n.preventDefault();x.mutedTipBox&&(x.popup_layers.removeChild(x.mutedTipBox),
x.popup_layers.style.display=null,delete x.mutedTipBox);window.zwpAllowAutoAudioPlay=!0});(r=d.querySelector(".openaudio"))&&r.addEventListener("click",function(n){n.preventDefault();n.stopPropagation();x.mutedTipBox&&(x.popup_layers.removeChild(x.mutedTipBox),x.popup_layers.style.display=null,delete x.mutedTipBox);y?(n=x._config.muted===!0,x.setMuted(n),x.videoEl&&(x.videoEl.muted=n),x.videoEl&&x.videoEl.paused&&x.play(x._config.url,x._config.isLive)):x.setMuted(!1);window.zwpAllowAutoAudioPlay=
!0});(r=d.querySelector(".mutemore"))&&r.addEventListener("click",function(n){n.preventDefault();n.stopPropagation();var m=d.querySelector(".moreInfoBox");m||(n='<div class="moreInfoBox"><div class="info-text">'+K("browserRestrictionsInfo","When you visit this site infrequently or often play muted content, browsers may limit audio volume, preventing automatic audio playback.")+'</div><div class="info-control"><button class="info-btn">'+K("iUnderstand","OK")+"</button></div></div>",d.insertAdjacentHTML("beforeend",
n),m=d.querySelector(".moreInfoBox"),m.querySelector(".info-btn").addEventListener("click",function(u){u.preventDefault();u.stopPropagation();m.style.display="none"}));m&&(m.style.display="block");window.zwpAllowAutoAudioPlay=!0});x.popup_layers.style.display="block"};x._mutedConfirmDeferTimer&&clearTimeout(x._mutedConfirmDeferTimer);x._mutedConfirmDeferTimer=window.setTimeout(function(){delete x._mutedConfirmDeferTimer;x._hlsVideoCodecUnsupported||e()},1200)}}.bind(a)}function wb(a){return a.map(function(t,
z){return String.fromCharCode(t^"zwp".charCodeAt(z%3))}).join("")}function bc(a){return"https://www."+(za.defaultLang==="zh"?Zd:$d)+a}function ae(a,t){var z=t.zwp_version,y=t.zwp_build;a.showContextMenu=function(x){var e=this;if(x.offsetX!==void 0&&x.offsetY!==void 0){var d=x.offsetX;x=x.offsetY}else{var r=e.playerContainer.getBoundingClientRect();d=x.clientX-r.left;x=x.clientY-r.top}r=e.playerContainer.getBoundingClientRect();var n=r.width;r=r.height;var m="left",u="top",f=d,c=x;d+180>n&&(m="right",
f=n-d);x+148>r&&(u="bottom",c=r-x);if(e.contextMenu)e.contextMenu.style[m==="left"?"right":"left"]=null,e.contextMenu.style[u==="top"?"bottom":"top"]=null,e.contextMenu.style[m]=f+"px",e.contextMenu.style[u]=c+"px";else{d='<div class="zwp-popupmenu" style="'+(m+": "+f+"px; "+u+":"+c+'px;"><a class="zwp-menuitem" data-action="shortcutHelp" href="javascript:void(0)"><span class="zwp-menucaption">')+(K("keyboardShortcuts","Keyboard Shortcuts")+"</span></a>");d=d+'<span class="zwp-menuseperator" action="shortcutHelp"></span><a class="zwp-menuitem" data-action="document" href="'+
(bc(be)+'" target="zwplayer-doc"><span class="zwp-menucaption">'+K("player-help","Help and document")+"</span></a>");d+='<a class="zwp-menuitem" data-action="version" href="'+bc(ce)+"?v="+z+'" title="Build: '+y+'" target="zwplayer-version"><span class="zwp-menucaption">'+K("version-update","Version update")+' (<span class="zwp-version">'+K("current")+": v"+z+"</span>) </span></a>";d=d+'<span class="zwp-menuseperator" action="version"></span><a class="zwp-menuitem" data-action="about" href="'+(bc(de)+
'"><span class="zwp-menucaption">'+K("about","About")+" zwplayer</span></a>");d+="</div>";x=e.playerContainer;nb()&&(n=document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement)&&(x=n);x.insertAdjacentHTML("beforeEnd",d);e.contextMenu=x.querySelector(".zwp-popupmenu");var h=function(k){k.stopPropagation();k.preventDefault();var l=this.getAttribute("data-action");this.getAttribute("target");var p=this.getAttribute("href");e.hideContextMenu();
setTimeout(function(){l==="about"?window.open(p,"zwplayer-about"):l==="version"?window.open(p,"zwplayer-version"):l==="document"?window.open(p,"zwplayer-doc"):l==="shortcutHelp"&&e.createShortcutHelpPanel()},10)};e.contextMenu.querySelectorAll("a.zwp-menuitem").forEach(function(k){k.addEventListener("click",h,!1)});document.addEventListener("click",e.hideContextMenu)}}.bind(a);a.hideContextMenu=function(){if(this.contextMenu){var x=this.contextMenu.parentNode;x&&x.removeChild(this.contextMenu);delete this.contextMenu;
document.removeEventListener("click",this.hideContextMenu)}}.bind(a)}function cc(a){var t=null,z=[".zwp-infoButton",".zwp-fullscrWinButton",".zwp-zoomButton"],y=[".zwp-snapshotButton",".zwp-segmentButton",".zwp-recordButton",".zwp-castButton"],x=[".zwp-localPlaybackButton",".zwp-optionButton"];a.updateResponsiveControlbar=function(){if(a.playerContainer){var e=a.playerContainer.getBoundingClientRect().width||a.playerContainer.offsetWidth,d=e<790;z.forEach(function(c){(c=a.controlbar.querySelector(c))&&
(d?ka(c,"zwp-hidden"):ja(c,"zwp-hidden"))});var r=e<670;y.forEach(function(c){(c=a.controlbar.querySelector(c))&&(r?ka(c,"zwp-hidden"):ja(c,"zwp-hidden"))});var n=e<550;x.forEach(function(c){(c=a.controlbar.querySelector(c))&&(n?ka(c,"zwp-hidden"):ja(c,"zwp-hidden"))});var m=a.controlbar.querySelector(".zwp-streamtype");m&&a._config.isLive&&(ja(m,"zwp-hidden"),m.style.display="block");m=a.controlbar.querySelector(".zwp__duration-container");var u=a.controlbar.querySelector(".zwp__time-info");if(m&&
u&&!a._config.isLive)if(u=u.clientWidth,a._timeCompactMode&&(u-=m.scrollWidth||0),u<30){if(ka(m,"zwp-hidden"),ka(a.controlbar,"zwp-time-compact"),a._timeCompactMode=!0,m=a.controlbar.querySelector(".zwp__currenttime-container"))m.setAttribute("role","button"),m.setAttribute("tabindex","0"),m.setAttribute("aria-label",K("currentTime","\u5f53\u524d\u65f6\u95f4"))}else a._timeCompactMode&&(ja(m,"zwp-hidden"),ja(a.controlbar,"zwp-time-compact"),a._timeCompactMode=!1,a._showRemaining=!1,a._renderTimeSpan(),
m=a.controlbar.querySelector(".zwp__currenttime-container"))&&(m.removeAttribute("role"),m.removeAttribute("tabindex"),m.removeAttribute("aria-label"));u=a.playerContainer.querySelector(".zwp__overlay-button");m=96;u&&(m=e<670?64:e<790?80:96,u.style.width=m+"px",u.style.height=m+"px",u=u.querySelector("svg"))&&(u.setAttribute("width",m+"px"),u.setAttribute("height",m+"px"));u=a.playerContainer.querySelector(".zwp__overlay-loading");var f=a.playerContainer.querySelector(".zwp__overlay-loading-bg-img");
m=80;u&&(m=e<670?56:e<790?68:80,u.style.width=m+"px",u.style.height=m+"px",f&&(f.style.width=m+"px",f.style.height=m+"px",e=f.querySelector("svg")))&&(e.setAttribute("width",m+"px"),e.setAttribute("height",m+"px"))}};a.responsiveControlbarObserver=new ResizeObserver(function(e){t&&clearTimeout(t);t=setTimeout(function(){a.updateResponsiveControlbar()},150)});a.playerContainer&&a.responsiveControlbarObserver.observe(a.playerContainer);requestAnimationFrame(function(){a.updateResponsiveControlbar&&
a.updateResponsiveControlbar()})}function Pa(a,t,z){this.view=a;this.pos=t||0;this.limit=z==null?a.byteLength:z}function Ma(a,t,z){return z<0||t<0||t+z>a.byteLength?null:new Pa(a,t,t+z)}function Sa(a,t){for(;a.left()>=8;){var z=a.u32(),y=a.fourcc();if(z===1){if(a.left()<8)break;z=a.u64()}else z===0&&(z=a.left()+8);if(z<8||a.pos+(z-8)>a.limit)break;var x=a.pos;z-=8;a.pos+=z;if(t(y,x,z)===!1)break}}function ee(a,t,z){var y=[],x=[],e=[],d=[];Sa(a,function(c,h,k){if(h=Ma(t,h,k))if(c==="stsd")h.fullbox(),
h.u32(),h.left()>=8&&(h.u32(),h=h.fourcc(),z.codec||(z.codec=h));else if(c==="stts")for(h.fullbox(),c=h.u32(),k=0;k<c&&h.left()>=8;k++)for(var l=h.u32(),p=h.u32(),w=0;w<l;w++)y.push(p);else if(c==="stsz")if(h.fullbox(),k=h.u32(),c=h.u32(),k!==0)for(h=0;h<c;h++)x.push(k);else for(k=0;k<c&&h.left()>=4;k++)x.push(h.u32());else if(c==="stsc")for(h.fullbox(),c=h.u32(),k=0;k<c&&h.left()>=12;k++)d.push({firstChunk:h.u32(),perChunk:h.u32()}),h.u32();else if(c==="stco"||c==="co64")for(h.fullbox(),k=h.u32(),
l=0;l<k;l++)e.push(c==="co64"?h.u64():h.u32())});if(x.length&&y.length){d.length||e.length!==1||(d=[{firstChunk:1,perChunk:x.length}]);a=Array(x.length);for(var r=0,n=0;n<e.length;n++){for(var m=0,u=0;u<d.length;u++)d[u].firstChunk<=n+1&&(m=d[u].perChunk);u=e[n];for(var f=0;f<m&&r<x.length;f++)a[r]=u,u+=x[r],r++}r===x.length&&(z.stbl={durations:y,sizes:x,sampleOffsets:a})}}function fe(a,t,z){var y=null;Sa(a,function(e,d,r){e==="mdia"&&(y={start:d,size:r})});if(y){var x="";if(a=Ma(t,y.start,y.size))Sa(a,
function(e,d,r){if(d=Ma(t,d,r))e==="hdlr"?(d.fullbox(),d.u32(),x=d.fourcc()):e==="mdhd"&&(d.fullbox().version===1?(d.u64(),d.u64()):(d.u32(),d.u32()),z.timescale||(z.timescale=d.u32()))}),(x==="subt"||x==="text")&&(a=Ma(t,y.start,y.size))&&Sa(a,function(e,d,r){e==="minf"&&(e=Ma(t,d,r))&&Sa(e,function(n,m,u){n==="stbl"&&(n=Ma(t,m,u))&&ee(n,t,z)})})}}function Jc(a){if(!a||a.byteLength<8)return null;var t=new DataView(a),z={timescale:0,codec:"",fragmented:!1,stbl:null},y=!1;Sa(new Pa(t),function(x,e,
d){if(x==="moov")return y=!0,(x=Ma(t,e,d))&&Sa(x,function(r,n,m){r==="mvex"&&(z.fragmented=!0);r==="trak"&&(r=Ma(t,n,m))&&fe(r,t,z)}),!1});return y&&z.timescale&&z.codec?z:null}function ge(a,t,z,y){var x=[];z=Ma(a,t+8,z-8);if(!z)return x;Sa(z,function(e,d,r){if(e==="traf"&&(e=Ma(a,d,r))){var n=-1,m=0,u=0,f=0,c=[];Sa(e,function(E,D,B){if(D=Ma(a,D,B))if(E==="tfhd")E=D.fullbox(),E.flags&1&&(n=D.u64()),E.flags&2&&D.u32(),E.flags&8&&(m=D.u32()),E.flags&16&&(u=D.u32()),E.flags&32&&D.u32();else if(E==="tfdt")f=
D.fullbox().version===1?D.u64():D.u32();else if(E==="trun"){E=D.fullbox();B=D.u32();var G=0;E.flags&1&&(G=D.i32());E.flags&4&&D.u32();for(var N=[],I=0;I<B;I++){var C=E.flags&256?D.u32():m,g=E.flags&512?D.u32():u;E.flags&1024&&D.u32();E.flags&2048&&D.u32();N.push({dur:C,size:g})}c.push({dataOffset:G,samples:N})}});if(c.length){e=n>=0?n:t;for(r=d=0;r<c.length;r++)d+=c[r].samples.length;d=Array(d);r=0;for(var h=f,k=0;k<c.length;k++)for(var l=c[k],p=e+l.dataOffset,w=0;w<l.samples.length;w++){var v=l.samples[w];
d[r++]={time:h/y,dur:v.dur/y,size:v.size,offset:p};h+=v.dur;p+=v.size}x.push(d)}}});return x}function he(a,t,z){function y(e,d){(e=Ma(a,e,d))&&(x=e.utf8(d))}t=Ma(a,t,z);if(!t)return null;var x=null;Sa(t,function(e,d,r){x===null&&(e==="payl"?y(d,r):e==="vttc"&&(e=Ma(a,d,r))&&Sa(e,function(n,m,u){n==="payl"&&x===null&&y(m,u)}))});return x}function ie(a,t){if(!a||!t||!t.timescale)return null;var z=new DataView(a),y=[],x=[];Sa(new Pa(z),function(u,f,c){if(u==="moof")for(u=ge(z,f-8,c+8,t.timescale),f=
0;f<u.length;f++)y.push(u[f]);else u==="mdat"&&x.push({start:f,end:f+c})});a=null;if(y.length){a=[];for(var e=0;e<y.length;e++)a.push.apply(a,y[e]);e=[];for(var d=0;d<a.length;d++){var r=a[d];if(!(r.size<=0))for(var n=0;n<x.length;n++){var m=x[n];if(r.offset>=m.start&&r.offset<m.end){r.offset+r.size>m.end&&(r.size=m.end-r.offset);e.push(r);break}}}a=e}else if(t.stbl&&t.stbl.sampleOffsets.length)for(e=t.stbl,d=Math.min(e.sizes.length,e.sampleOffsets.length,e.durations.length),a=[],n=r=0;n<d;n++)e.sampleOffsets[n]+
e.sizes[n]>z.byteLength||(a.push({time:r,dur:e.durations[n]/t.timescale,size:e.sizes[n],offset:e.sampleOffsets[n]}),r+=e.durations[n]/t.timescale);if(!a||!a.length)return null;e=t.codec;if(e==="wvtt"){e=[];for(d=0;d<a.length;d++)r=a[d],n=he(z,r.offset,r.size),e.push({time:r.time,dur:r.dur,text:n==null?null:n.replace(/\r/g,"").replace(/\n/g,"<br/>")});a=[];for(n=0;n<e.length;)if(d=e[n],r=d.text==null?null:hb(d.text)){n+=1;for(m=null;n<e.length;){if((e[n].text==null?null:hb(e[n].text))!==r){m=e[n].time;
break}n++}m==null&&(m=e[n-1],m=m.time+m.dur);m<=d.time&&(m=d.time+d.dur);a.push({from:d.time,to:m,content:r,location:2})}else n++;return{codec:"wvtt",cues:a}}if(e==="stpp"||e==="ttml"){e=[];for(d=0;d<a.length;d++)r=a[d],(n=Ma(z,r.offset,r.size))&&(n=n.utf8(r.size))&&n.length&&e.push({time:r.time,dur:r.dur,text:n});return{codec:"stpp",docs:e}}return{codec:e,unsupported:!0}}function Kc(a){return a?(a=String(a).match(/^[-+]?P(?!$)(?:([0-9.]+)Y)?(?:([0-9.]+)M)?(?:([0-9.]+)D)?(?:T(?!$)(?:([0-9.]+)H)?(?:([0-9.]+)M)?(?:([0-9.]+)S)?)?$/))?
parseFloat(a[1]||0)*31536E3+parseFloat(a[2]||0)*2628E3+parseFloat(a[3]||0)*86400+parseFloat(a[4]||0)*3600+parseFloat(a[5]||0)*60+parseFloat(a[6]||0):0:0}function dc(a,t){return a?String(a).replace(/\$\$|\$([^$]+)\$/g,function(z,y){if(z==="$$")return"$";y=y.match(/^([A-Za-z]+)(?:%0(\d+)d)?$/);if(!(y&&y[1]in t))return z;z=String(t[y[1]]);if(y[2]){y=parseInt(y[2],10);var x=z.charAt(0)==="-";for(z=x?z.substring(1):z;z.length<y;)z="0"+z;z=(x?"-":"")+z}return z}):""}function je(a,t,z){z=z||{};var y=z.maxSegments||
500;z=[];if(!a)return z;try{var x=(new DOMParser).parseFromString(String(a),"text/xml")}catch{return z}if(!x||x.getElementsByTagName("parsererror").length>0)return z;x=x.documentElement;if(!x||x.localName!=="MPD"||x.getAttribute("type")==="dynamic")return z;a=Kc(x.getAttribute("mediaPresentationDuration"));t=Fb(x,t);x=fb(x,"Period");for(var e=0;e<x.length;e++)for(var d=x[e],r=Fb(d,t),n=Kc(d.getAttribute("duration"))||a,m=fb(d,"AdaptationSet"),u=0;u<m.length;u++){var f=m[u];if(ke(f)){var c=Fb(f,r),
h=f.getAttribute("lang")||"",k=Lc(f)||h||f.getAttribute("id")||"",l=Mc(f).indexOf("main")>=0,p=Ua(f,"SegmentTemplate"),w=Ua(f,"SegmentList"),v=fb(f,"Representation");v.length||(v=[f]);for(var E=0;E<v.length;E++){var D=v[E],B=Fb(D,c),G=(D.getAttribute("mimeType")||f.getAttribute("mimeType")||"").toLowerCase(),N=D.getAttribute("codecs")||f.getAttribute("codecs")||"";a:{var I=D,C=p,g=w,q=D.getAttribute("id")||"",A=D.getAttribute("bandwidth")||"",M=n,J=f,T=d;C=Ua(I,"SegmentTemplate")||C;g=Ua(I,"SegmentList")||
g;if(C){I=C.getAttribute("media")||"";T=C.getAttribute("initialization")||"";J=parseInt(C.getAttribute("timescale")||"1",10)||1;g=parseInt(C.getAttribute("startNumber")||"1",10)||1;q={RepresentationID:q,Bandwidth:A,Number:"",Time:""};A={initUrl:T?ob(dc(T,q),B):null,urls:[],singleFile:null};if(T=Ua(C,"SegmentTimeline"))for(M=g,J=-1,C=fb(T,"S"),g=0;g<C.length;g++){var b=C[g];J=b.getAttribute("t")!=null?parseInt(b.getAttribute("t"),10):J<0?0:J;T=parseInt(b.getAttribute("d"),10)||0;b=b.getAttribute("r")!=
null?parseInt(b.getAttribute("r"),10):0;b<0&&(b=0);for(var S=0;S<=b;S++){var H=A,V=q,P=B;(V=dc(I,{RepresentationID:V.RepresentationID,Bandwidth:V.Bandwidth,Number:M,Time:J+T*S}))&&H.urls.push(ob(V,P));M++}J+=T*(b+1)}else{C=parseInt(C.getAttribute("duration"),10)||0;if(!C||!M){(!I||I.indexOf("$")<0)&&A.urls.push(ob(I,B));B=A.urls.length?A:null;break a}M=Math.ceil(M*J/C);if(M<=0){B=null;break a}for(C=0;C<M;C++)(J=dc(I,{RepresentationID:q.RepresentationID,Bandwidth:q.Bandwidth,Number:g+C,Time:""}))&&
A.urls.push(ob(J,B))}B=A.urls.length||A.singleFile?A:null}else if(g){I=Ua(g,"Initialization");I={initUrl:I&&I.getAttribute("sourceURL")?ob(I.getAttribute("sourceURL"),B):null,urls:[],singleFile:null};q=fb(g,"SegmentURL");for(A=0;A<q.length;A++)(M=q[A].getAttribute("media"))&&I.urls.push(ob(M,B));B=I.urls.length?I:null}else B=Ua(I,"BaseURL")||Ua(J,"BaseURL")||Ua(T,"BaseURL")?{urls:[],initUrl:null,singleFile:B}:null}B&&(B.urls.length>y&&(B.urls=B.urls.slice(0,y)),I=e+"|"+(B.initUrl||B.urls[0]||B.singleFile||
""),q=D.getAttribute("lang")||h,A=Lc(D)||k,D=l||Mc(D).indexOf("main")>=0,G=le(G,N,B),N=(N||"").toLowerCase(),N=N.indexOf("wvtt")>=0?"wvtt":N.indexOf("stpp")>=0?"stpp":N.indexOf("ttml")>=0?"ttml":"",z.push({key:I,lang:q,label:A,isPrimary:D,kind:G,codec:N,initUrl:B.initUrl||null,urls:B.urls,singleFile:B.singleFile||null,period:e}))}}}y={};for(a=0;a<z.length;a++)t=z[a],t.kind==="mp4"&&(x=t.period+"|"+(t.lang||""),(y[x]=y[x]||[]).push(t));a={};for(var U in y){t=y[U];x=null;for(e=0;e<t.length;e++)if(t[e].codec===
"wvtt"){x=t[e];break}if(x)for(e=0;e<t.length;e++){if(d=t[e].codec==="stpp")d=t[e],d=d.singleFile&&x.singleFile?!0:d.singleFile||x.singleFile?!1:d.urls.length===x.urls.length;d&&(a[t[e].key]=!0)}}if(Object.keys(a).length){U=[];for(y=0;y<z.length;y++)a[z[y].key]||U.push(z[y]);z=U}return z}function fb(a,t){var z=[];for(a=a.firstChild;a;a=a.nextSibling)a.nodeType===1&&a.localName===t&&z.push(a);return z}function Ua(a,t){a=fb(a,t);return a.length?a[0]:null}function Fb(a,t){var z=Ua(a,"BaseURL");z=z?(z.textContent||
"").trim():"";(a=a.getAttribute&&(a.getAttribute("xml:base")||a.getAttributeNS&&a.getAttributeNS("http://www.w3.org/XML/1998/namespace","base")))&&(z=a);if(!z)return t;try{return(new URL(z,t||void 0)).href}catch{return t}}function Lc(a){return(a=Ua(a,"Label"))?(a.textContent||"").trim():""}function Mc(a){a=fb(a,"Role");for(var t=[],z=0;z<a.length;z++){var y=a[z].getAttribute("value");y&&t.push(y)}return t}function Nc(a,t){if(a!=="application/mp4")return!1;t=(t||"").toLowerCase();return t.indexOf("stpp")>=
0||t.indexOf("wvtt")>=0||t.indexOf("ttml")>=0}function ke(a){if((a.getAttribute("contentType")||"").toLowerCase()==="text")return!0;var t=(a.getAttribute("mimeType")||"").toLowerCase();if(t==="text/vtt"||t==="application/ttml+xml"||Nc(t,a.getAttribute("codecs")))return!0;a=fb(a,"Representation");for(t=0;t<a.length;t++){var z=(a[t].getAttribute("mimeType")||"").toLowerCase();if(z==="text/vtt"||z==="application/ttml+xml"||Nc(z,a[t].getAttribute("codecs")))return!0}return!1}function le(a,t,z){if(a===
"text/vtt")return"vtt";if(a==="application/ttml+xml")return"ttml";t=(t||"").toLowerCase();if(a==="application/mp4"||t.indexOf("stpp")>=0||t.indexOf("wvtt")>=0||t.indexOf("ttml")>=0)return"mp4";a=z.singleFile||z.urls[0]||"";return/\.vtt(\?|$)/i.test(a)?"vtt":/\.(ttml|xml|dfxp)(\?|$)/i.test(a)?"ttml":"mp4"}function ob(a,t){try{return(new URL(a,t||void 0)).href}catch{return a}}function me(a,t){function z(m){typeof d.toast==="function"&&d.toast(K("pluginLoadFailed","Media engine failed to load")+": "+
m,5E3,!0);d.setplaystate(!1);typeof d._hideLoading==="function"&&d._hideLoading();d.bigPlayOverlay&&(d.bigPlayOverlay.style.display="flex");d.isPlaying=!1}function y(m,u,f,c){Oc(m,u,f,function(){z(m)})}function x(m,u,f,c,h){function k(){for(;E<u.length&&v[E]!==void 0;){var I=v[E];if(I&&I.length>0){var C=m.body.length>0?m.body[m.body.length-1]:null;if(C){for(var g=0;g<I.length&&I[g].from===C.from&&I[g].content===C.content;)g++;g>0&&(I=I.slice(g))}I.length>0&&Array.prototype.push.apply(m.body,I)}v[E]=
null;E++}w&&!G&&m.body.length>0&&!f()&&(G=!0,a._activatePrimarySubtitleEntry(m));if(E===u.length&&!N&&(N=!0,f()||a.updateSubtitleMenu(),typeof h.onComplete==="function"))h.onComplete(m)}function l(){for(;B<p&&D<u.length&&!f();){var I=D++;B++;(function(C){n(u[C],function(g){B--;f()||(v[C]=c(g),k(),l())},function(){B--;v[C]=[];k();l()},h.responseType)})(I)}}h=h||{};var p=h.concurrency||4,w=!!h.activateAsPrimary,v=Array(u.length),E=0,D=0,B=0,G=!1,N=!1;l()}function e(m,u){if(!u||!u.timescale)return[];
m=ie(m,u);if(!m)return[];if(m.codec==="wvtt")return m.cues;if(m.codec==="stpp"){u=[];for(var f=0;f<m.docs.length;f++){var c=m.docs[f],h=tc(c.text).body;if(h.length){for(var k=0,l=0;l<h.length;l++)k=Math.max(k,h[l].from);if(c.time>0&&k<c.dur*1.5+1)for(k=0;k<h.length;k++)h[k].from+=c.time,h[k].to+=c.time;for(c=0;c<h.length;c++)u.push(h[c])}}return u}return[]}var d=a,r=t.isSupportMSE,n=t.httpGet;a.playRtsp=async function(){var m=d._config.xmc_url||window.xmc_url;if(!m)return d.toast(K("rtspNotSupported",
"The RTSP protocol is not supported without setting XMC")),!1;m+="play";d.wsclient&&(d.wsclient.close(),delete d.wsclient);m=m.replace("http","ws");var u=new WebSocket(m);u.onopen=function(){var f=typeof d._config.rtspOverTcp==="undefined"?1:d._config.rtspOverTcp,c=typeof d._config.rtsp_bypass==="boolean"?d._config.rtsp_bypass:0,h=typeof d._config.use_audio==="undefined"?0:d._config.use_audio,k="MediaSource"in window&&window.MediaSource.isTypeSupported("video/mp4;codecs=hvc1.1.1.L93.B0")?1:0;f=JSON.stringify({msgtype:"playurl",
data:{sourceurl:d.murl,rtsp_over_tcp:f,has_audio:h,has_hevc:k,rtsp_bypass:c}});u.send(f)};u.onmessage=function(f){try{var c=JSON.parse(f.data)}catch(k){return}if(typeof c=="object"&&c.type==="onresult"&&c.event==="playurl"&&typeof c.streaminfo==="object")if(d.closecall2=function(k){k.waitSignTimer&&(window.clearTimeout(k.waitSignTimer),delete k.waitSignTimer);k.wsclient&&(k.wsclient.close(),k.wsclient=null,delete k.wsclient)},c.snapshot&&d.videoEl&&d.videoEl.setAttribute("poster",c.snapshot),d._config.useFlv||
typeof c.streaminfo.rtc_playurl!=="string")typeof c.streaminfo.http_playurl==="string"?(h=c.streaminfo.http_playurl+c.streaminfo.stream+".flv",d.murl=h,d.playMpegts()):d.closecall2(d);else{var h=c.streaminfo.rtc_playurl+c.streaminfo.stream+".rtc";c.first?d.waitSignTimer=setTimeout(function(){d.murl=h;d.playRtc();delete d.waitSignTimer},1E3):(d.murl=h,d.playRtc())}};u.onclose=function(){d.wsclient&&delete d.wsclient};u.onerror=function(){};d.wsclient=u;return!0};a.playFlv=function(){var m=xb+"flv.min.js?v="+
Va.v;a._flvGenId=(a._flvGenId||0)+1;var u=a._flvGenId;y("flv_js",m,function(f){if(u===a._flvGenId){var c=window.flvjs;c.LoggingControl&&c.LoggingControl.applyConfig&&c.LoggingControl.applyConfig({enableVerbose:!1,enableInfo:!1});if(!c.isSupported())return z("flv (MSE not supported)"),!1;f=!1;typeof d._config.isLive==="boolean"&&(f=d._config.isLive);var h={type:"flv",isLive:f,url:d.murl};var k={enableWorker:!1,enableStashBuffer:!1,stashInitialSize:0,lazyLoad:!1,autoCleanupSourceBuffer:!0,lazyLoadMaxDuration:0,
isLive:!0};d.openFlv=function(){var l=c.createPlayer(h,k),p=d;l.on(c.Events.METADATA_ARRIVED,function(v){p.loadingOverlay&&(p.loadingOverlay.style.display="none")});l.on(c.Events.ERROR,function(v){});l.attachMediaElement(d.videoEl);d.videoEl.playbackRate=1;d.onFlvStaticInfo=function(v){this.videoEl.paused||(this.lastDecodedFrames?this.lastDecodedFrames!=v.decodedFrames?this.lastDecodedFrames=v.decodedFrames:(this.lastDecodedFrames=0,this.flvPlayer&&(this.closecall(this),this.openFlv(),this.setplaystate(!0))):
this.lastDecodedFrames=v.decodedFrames)}.bind(d);d.onFlvError=function(v){v!=="NetworkError"||d.reconnectTimer||(d.reconnectTimer=window.setTimeout(function(){d.flvPlayer&&(d.closecall(d),d.openFlv(),d.setplaystate(!0));delete d.reconnectTimer},1E3))}.bind(d);p.onMediainfoCb=function(v){v&&this.setMediainfo("flvjs",v)}.bind(p);l.on(c.Events.ERROR,d.onFlvError);l.on(c.Events.STATISTICS_INFO,d.onFlvStaticInfo);l.on(c.Events.MEDIA_INFO,d.onMediainfoCb);d.delayCheckTimerId=window.setInterval(function(){if(this.flvPlayer&&
!this.videoEl.paused){var v=this.flvPlayer;if(v.buffered.length){let E=v.buffered.end(0)-v.currentTime;E>=6?v.currentTime=v.buffered.end(0)-.2:E>3&&(p.videoEl.playbackRate=1.5,p.fastForwardTimerId=setTimeout(function(){p.videoEl.playbackRate=1;delete p.fastForwardTimerId},E*2E3))}}}.bind(d),2E3);l.load();var w=l.play();w&&w.catch&&w.catch(function(v){});d.flvPlayer=l;d.closecall=function(v){if(v.flvPlayer){var E=v.flvPlayer;E.off(c.Events.ERROR,v.onFlvError);E.off(c.Events.STATISTICS_INFO,v.onFlvStaticInfo);
E.off(c.Events.MEDIA_INFO,v.onMediainfoCb);delete v.onFlvError;delete v.onFlvStaticInfo;delete v.onMediainfoCb;v.delayCheckTimerId&&(window.clearInterval(v.delayCheckTimerId),delete v.delayCheckTimerId);v.fastForwardTimerId&&(window.clearTimeout(v.fastForwardTimerId),delete v.fastForwardTimerId);v.reconnectTimer&&(window.clearTimeout(v.reconnectTimer),delete v.reconnectTimer);E.pause();E.unload();E.detachMediaElement();E.destroy();delete v.flvPlayer}}};d.openFlv();d.setplaystate(!0)}});return!0};
a.playMpegts=function(){var m=xb+"mpeg.min.js?v="+Va.v;a._mpegtsGenId=(a._mpegtsGenId||0)+1;var u=a._mpegtsGenId;y("mpeg_js",m,function(f){if(u===a._mpegtsGenId){mpegts.LoggingControl&&mpegts.LoggingControl.applyConfig&&mpegts.LoggingControl.applyConfig({enableVerbose:!1,enableInfo:!1});f=mpegts.getFeatureList();if(!mpegts.isSupported())return z("mpegts (not supported)"),!1;if(!f.mseLivePlayback)return z("mpegts (MSE live playback not supported)"),!1;d.openMpegts=function(){var c=d,h=d.videoEl,k=
{autoCleanupSourceBuffer:!0,stashInitialSize:128,autoCleanupMaxBackwardDuration:20,autoCleanupMinBackwardDuration:10,enableWorker:!0,enableStashBuffer:!1},l=void 0,p=void 0,w=!1,v=!1,E={type:"mse",url:d.murl};typeof d._config.hasAudio==="boolean"&&(l=d._config.hasAudio);typeof d._config.hasVideo==="boolean"&&(p=d._config.hasVideo);typeof d._config.isLive==="boolean"&&(w=d._config.isLive);E.hasAudio=l;E.hasVideo=p;if(E.isLive=w)d._config.useCustomLiveSync?v=!0:(k.liveSync=typeof d._config.useLiveChasing===
"boolean"?d._config.useLiveChasing:!0,k.liveSync&&(typeof d._config.liveSyncMaxLatency!=="undefined"&&(k.liveSyncMaxLatency=d._config.liveSyncMaxLatency),typeof d._config.liveSyncPlaybackRate!=="undefined"&&(k.liveSyncPlaybackRate=d._config.liveSyncPlaybackRate)));k=mpegts.createPlayer(E,k);c.onErrorCb=function(D){var B=this;D!==mpegts.ErrorTypes.NETWORK_ERROR||B.reconnectTimer||(B.reconnectTimer=window.setTimeout(function(){B.mpegtsPlayer&&(B.closecall(B),B.openMpegts());delete B.reconnectTimer},
1E3))}.bind(c);c.onEventCb=function(D){}.bind(c);c.onMetadataCb=function(D){}.bind(c);c.onMediaInfoCb=function(D){D&&this.setMediainfo("mpegts",D)}.bind(c);c.onStatisCb=function(D){this.videoEl.paused||(this.lastDecodedFrames?this.lastDecodedFrames!=D.decodedFrames?(this.lastDecodedFrames=D.decodedFrames,delete this.waitDecodedFrames):(typeof this.waitDecodedFrames==="undefined"?this.waitDecodedFrames=0:this.waitDecodedFrames++,this._config.reconnectByWaitFrames&&this.waitDecodedFrames>10&&(this.lastDecodedFrames=
0,delete this.waitDecodedFrames,this.mpegtsPlayer&&(this.closecall(this),this.openMpegts()))):this.lastDecodedFrames=D.decodedFrames)}.bind(c);c.closecall=function(D){D.checkDelayTimerId&&(window.clearInterval(D.checkDelayTimerId),delete D.checkDelayTimerId);D.reconnectTimer&&(window.clearTimeout(D.reconnectTimer),delete D.reconnectTimer);D.fastForwardTimerId&&(window.clearTimeout(D.fastForwardTimerId),delete D.fastForwardTimerId);if(D.mpegtsPlayer){var B=D.mpegtsPlayer;B.pause();B.off(mpegts.Events.ERROR,
D.onErrorCb);B.off(mpegts.Events.MEDIA_INFO,D.onMediaInfoCb);B.off(mpegts.Events.METADATA_ARRIVED,D.onMetadataCb);B.off(mpegts.Events.STATISTICS_INFO,D.onStatisCb);B.unload();B.detachMediaElement();B.destroy();delete D.onErrorCb;delete D.onMediaInfoCb;delete D.onMetadataCb;delete D.onStatisCb;delete D.onEventCb;delete D.mpegtsPlayer}};v&&(c.checkDelayTimerId=window.setInterval(function(){var D=this;if(D.mpegtsPlayer&&!D.videoEl.paused&&typeof D.fastForwardTimerId==="undefined"&&D.mpegtsPlayer.buffered.length){var B=
D.mpegtsPlayer.buffered;B=B.end(B.length-1)-D.mpegtsPlayer.currentTime;var G=1.2;if(B>=6)G=1.5;else if(B<2)return;D.videoEl.playbackRate=G;D.fastForwardTimerId=setTimeout(function(){D.videoEl.playbackRate=1;delete D.fastForwardTimerId},B/G*1E3)}}.bind(c),2E3));k.on(mpegts.Events.ERROR,c.onErrorCb);k.on(mpegts.Events.MEDIA_INFO,c.onMediaInfoCb);k.on(mpegts.Events.METADATA_ARRIVED,c.onMetadataCb);k.on(mpegts.Events.STATISTICS_INFO,c.onStatisCb);k.attachMediaElement(h);k.load();(h=k.play())&&h.catch&&
h.catch(function(D){});c.mpegtsPlayer=k};d.openMpegts()}});return!0};a._loadHlsSubtitleTracks=function(m,u){if(m&&m.length&&d._config.hlsSubtitlePreload&&!(d._config.isLive||u&&u.levels&&u.levels[0]&&u.levels[0].details&&u.levels[0].details.live)){u&&(u.subtitleDisplay=!1,u.subtitleTrack!==-1&&(u.subtitleTrack=-1));u=a._hlsSubVersion;for(var f=!1,c=0;c<m.length;c++){var h=m[c];if(!h.forced){var k=h.url;if(k&&!a._hlsSubUrls[k]){a._hlsSubUrls[k]=!0;var l=h.name||h.lang||"Subtitle "+h.id,p=!f&&(!!h.default||
!!h.autoselect);p&&(f=!0);a.fetchAndLoadHlsSubtitle(k,l,u,p,h.lang)}}}}};a.fetchAndLoadHlsSubtitle=function(m,u,f,c,h){function k(){a._hlsSubVersion===f&&typeof a.removeFromSubtitleList==="function"&&(a.removeFromSubtitleList(l.id),a.updateSubtitleMenu())}var l=a.addToSubtitleList({body:[]},{title:u,source:"hls",hidden:!1,language:h||""});a.updateSubtitleMenu();a.controlbar&&(u=a.controlbar.querySelector(".zwp-subtitleButton"))&&(u.style.display="block");n(m,function(p){if(a._hlsSubVersion===f)if(p=
(p||"").trim(),p.indexOf("#EXTM3U")===0){var w=[];p.split(/\r?\n/).forEach(function(v){(v=v.trim())&&v.charAt(0)!=="#"&&w.push((new URL(v,m)).href)});w.length?(p=d._config.hlsSubtitleMaxSegments||500,w.length>p&&(w=w.slice(0,p)),x(l,w,function(){return a._hlsSubVersion!==f},Ob,{concurrency:d._config.hlsSubtitleConcurrency||4,activateAsPrimary:c})):k()}else p=Ob(p),p.length>0&&Array.prototype.push.apply(l.body,p),c&&a._activatePrimarySubtitleEntry(l)},function(){k()})};a._activatePrimarySubtitleEntry=
function(m){m&&m.body.length!==0&&(a.setSubtitleTrack("1",m.id),a.showSubtitle(!0),a.updateSubtitleMenu())};a.playHls=function(){a._hlsSubUrls={};a._hlsSubVersion=(a._hlsSubVersion||0)+1;if(a._hlsVideoCodecBadUrl&&a._hlsVideoCodecBadUrl===a.murl)return a._hlsVideoCodecUnsupported=!0,a._hlsCodecSilentFail=!0,a.setplaystate(!1),a.isPlaying=!1,typeof a._hideLoading==="function"&&a._hideLoading(),!1;delete a._hlsVideoCodecUnsupported;a._hlsGenId=(a._hlsGenId||0)+1;var m=a._hlsGenId;y("hls_js",xb+"hls.min.js?v="+
Va.v,function(u){if(m===a._hlsGenId){var f=window.Hls;if(f.isSupported()){var c=new f;c.on(f.Events.MEDIA_ATTACHED,function(){c.loadSource(d.murl);c.on(f.Events.MANIFEST_PARSED,function(l,p){a.loadingOverlay&&(a.loadingOverlay.style.display="none");a._startPlayback(!0)})});c.on(f.Events.ERROR,function(l,p){if(p&&p.details==="bufferAddCodecError"&&p.sourceBufferName==="video"&&!a._hlsVideoCodecUnsupported)a._hlsVideoCodecUnsupported=!0,a._hlsVideoCodecBadUrl=a.murl,c.destroy(),delete d.hlsPlayer,a.setplaystate(!1),
a.isPlaying=!1,typeof a._hideLoading==="function"&&a._hideLoading(),a.progressBar&&a.progressBar.buffering&&(a.progressBar.buffering.style.display="none"),a.mutedTipBox&&(a.mutedTipBox.parentNode&&a.mutedTipBox.parentNode.removeChild(a.mutedTipBox),delete a.mutedTipBox),a.popup_layers&&(a.popup_layers.style.display=null),a.toast(K("videoCodecUnsupported","Unsupported video codec"),3E3);else if(p.fatal)switch(p.type){case f.ErrorTypes.NETWORK_ERROR:c.startLoad();break;case f.ErrorTypes.MEDIA_ERROR:c.recoverMediaError();
break;default:c.destroy(),delete d.hlsPlayer,a.setplaystate(!1)}});a.onHlsManifestParsed=function(l,p){var w=this;if(p.levels.length>1){l=[];for(var v=0;v<p.levels.length;v++)l.push({mediaType:"video",bitrate:p.levels[v].bitrate,height:p.levels[v].height,width:p.levels[v].width,qualityIndex:v,name:p.levels[v].name||void 0});w.switchQualityLevel=function(E){c.nextLevel=parseInt(E)}.bind(w);w.createQualitiesMenu(l,c.autoLevelEnabled);c.on(f.Events.LEVEL_SWITCHED,function(E,D){w.updateQualityLevel(c.currentLevel,
c.autoLevelEnabled)},w)}else w.resetQualitiesMenu();w._loadHlsSubtitleTracks(p.subtitleTracks||c.subtitleTracks,c)}.bind(a);a.onHlsManifestLoaded=function(l,p){}.bind(a);c.on(f.Events.MANIFEST_PARSED,a.onHlsManifestParsed);c.on(f.Events.SUBTITLE_TRACKS_UPDATED,function(l,p){a._loadHlsSubtitleTracks(p&&p.subtitleTracks||c.subtitleTracks,c)});if(d._config.hlsSubtitlePreload)c.on(f.Events.SUBTITLE_TRACK_SWITCH,function(){c.subtitleTrack!==-1&&(c.subtitleTrack=-1)});c.on(f.Events.MANIFEST_LOADED,a.onHlsManifestLoaded);
a.hlsPlayer=c;c.attachMedia(d.videoEl);a.closecall=function(l){l.hlsPlayer&&(l.hlsPlayer.off(f.Events.MANIFEST_PARSED,l.onHlsManifestParsed),l.hlsPlayer.off(f.Events.MANIFEST_LOADED,l.onHlsManifestLoaded),typeof l.hlsPlayer.stopLoad==="function"&&l.hlsPlayer.stopLoad(),l.hlsPlayer.detachMedia(),l.hlsPlayer.destroy(),delete l.hlsPlayer,delete l.onHlsManifestParsed,delete l.onHlsManifestLoaded);delete l.switchQualityLevel}}else if(d.videoEl.canPlayType("application/vnd.apple.mpegurl")){d.videoEl.zwplayer=
d;var h=function(){typeof this.zwplayer=="object"&&this.zwplayer._startPlayback(!0)},k=function(){};a.videoEl.addEventListener("loadedmetadata",h);a.videoEl.addEventListener("error",k);a.closecall=function(l){typeof l.videoEl==="object"&&(l.videoEl.pause(),l.videoEl.src="",l.videoEl.removeEventListener("loadedmetadata",h),l.videoEl.removeEventListener("error",k),typeof l.videoEl.zwplayer=="object"&&delete l.videoEl.zwplayer)};a.videoEl.src=a.murl}else return d.toast(K("cannotPlayHls","Player cannot play HLS media")),
!1}});return!0};a._preloadDashSubtitles=function(){if(d._config.dashSubtitlePreload&&!d._config.isLive){var m=a._dashSubVersion,u=d.murl;try{u=(new URL(d.murl,document.baseURI)).href}catch(f){}n(u,function(f){if(a._dashSubVersion===m&&(f=je(f,u,{maxSegments:d._config.dashSubtitleMaxSegments||500}),f.length)){for(var c=-1,h=0;h<f.length;h++)if(f[h].isPrimary){c=h;break}for(h=0;h<f.length;h++){var k=f[h];k.key&&!a._dashSubUrls[k.key]&&(a._dashSubUrls[k.key]=!0,a._fetchDashSubtitleTrack(k,m,h===c))}}},
function(){})}};a._fetchDashSubtitleTrack=function(m,u,f){function c(){return a._dashSubVersion!==u}function h(){c()||typeof a.removeFromSubtitleList!=="function"||(a.removeFromSubtitleList(p.id),a.updateSubtitleMenu())}function k(B){B&&B.length&&(Array.prototype.push.apply(p.body,B),f&&a._activatePrimarySubtitleEntry(p))}function l(){x(p,m.urls,c,function(B){return e(B,D)},{concurrency:v,responseType:"arraybuffer",activateAsPrimary:f,onComplete:function(){p.body.length===0&&h()}})}var p=a.addToSubtitleList({body:[]},
{title:m.label,source:"dash",hidden:!1,language:m.lang||""});a.updateSubtitleMenu();if(a.controlbar){var w=a.controlbar.querySelector(".zwp-subtitleButton");w&&(w.style.display="block")}var v=d._config.dashSubtitleConcurrency||4;if(m.kind==="vtt"||m.kind==="ttml"){var E=m.kind==="vtt"?function(B){return Ob(B)}:function(B){return tc(B).body};m.singleFile?n(m.singleFile,function(B){c()||(k(E(B)),a.updateSubtitleMenu())},function(){h()}):x(p,m.urls,c,E,{concurrency:v,activateAsPrimary:f,onComplete:function(){p.body.length===
0&&h()}})}else if(m.singleFile)n(m.singleFile,function(B){if(!c()){var G=Jc(B);G?(k(e(B,G)),a.updateSubtitleMenu()):h()}},function(){h()},"arraybuffer");else if(m.urls.length){var D=null;m.initUrl?n(m.initUrl,function(B){c()||((D=Jc(B))?l():h())},function(){h()},"arraybuffer"):(D=null,l())}else h()};a.playDash=function(){a._dashSubUrls={};a._dashSubVersion=(a._dashSubVersion||0)+1;var m=!!d._config.dashSubtitlePreload&&!d._config.isLive;a._dashSubTakeover=m;var u=xb+"dash.all.min.js?v="+Va.v;a._dashGenId=
(a._dashGenId||0)+1;var f=a._dashGenId;y("dash_js",u,function(c){if(f===a._dashGenId){var h=window.dashjs,k=h.MediaPlayer().create();if(m)try{k.updateSettings({streaming:{text:{defaultEnabled:!1}}})}catch(l){}k.initialize(d.videoEl,d.murl,!0);c=a.getSimpleSubtitleRenderer();k.attachTTMLRenderingDiv(c);a.dashTextTrackList={};m&&a._preloadDashSubtitles();a.onDashMetadata=function(l){this.loadingOverlay&&(this.loadingOverlay.style.display="none");this._startPlayback(!0)}.bind(a);a.onDashError=function(l){if(l&&
l.error&&l.error.code===h.MediaPlayer.errors.MANIFEST_ERROR_ID_PARSE_CODE){try{a.closecall(a)}catch(p){}a.setplaystate(!1);a._hideLoading();a.bigPlayOverlay&&(a.bigPlayOverlay.style.display="flex");a.toast(K("playbackFailed","Playback failed")+": DASH manifest",3E3,!0)}}.bind(a);k.on(h.MediaPlayer.events.ERROR,a.onDashError);a.onDashQualityChanged=function(l){l=k.getQualityFor("video");var p=k.getSettings().streaming.abr.autoSwitchBitrate.video||!1;a.updateQualityLevel(l,p)}.bind(a);a.onDashStreamInitialized=
function(l){k.getBitrateInfoListFor("audio");l=k.getBitrateInfoListFor("video")||[];l.length>1?(this.switchQualityLevel=function(p){p=parseInt(p);var w={streaming:{abr:{autoSwitchBitrate:{}}}};p>=0?(w.streaming.abr.autoSwitchBitrate.video=!1,k.updateSettings(w),k.setQualityFor("video",p,!1)):(w.streaming.abr.autoSwitchBitrate.video=!0,k.updateSettings(w))}.bind(this),this.createQualitiesMenu(l),k.on(h.MediaPlayer.events.QUALITY_CHANGE_RENDERED,this.onDashQualityChanged,this)):this.resetQualitiesMenu()}.bind(a);
a.onDashTracksAdded=function(l){var p=this.dashTextTrackList;p[l.streamId]||(p[l.streamId]=[]);p[l.streamId]=p[l.streamId].concat(l.tracks);if(this._dashSubTakeover&&this.dashPlayer)try{this.dashPlayer.setTextTrack(-1)}catch(w){}};a.onDashStreamDeactivated=function(l){var p=this.dashTextTrackList;l.streamInfo&&p[l.streamInfo.id]&&delete p[l.streamInfo.id]}.bind(a);a.onDashStreamActivated=function(l){if(!this._dashSubTakeover){l=l.streamInfo.id||"none";var p=this.dashTextTrackList;if(p[l]&&(l=p[l],
!(l.length<1))){p=[];for(var w=0;w<l.length;w++){var v=l[w],E=ne(v.labels);E?E+=" : "+v.type:(E=v.label||v.lang,E+=" : "+v.kind);p.push({"default":v.defaultTrack,id:w,lang:v.lang,name:E,url:v.url||""})}this.switchSubtitleTrack=function(D){var B=this.dashPlayer||null;B&&B.setTextTrack(D)}.bind(this);this.createSubtitlesMenu(p)}}}.bind(a);k.on(h.MediaPlayer.events.PLAYBACK_METADATA_LOADED,a.onDashMetadata,a);k.on(h.MediaPlayer.events.STREAM_INITIALIZED,a.onDashStreamInitialized,a);k.on(h.MediaPlayer.events.STREAM_ACTIVATED,
a.onDashStreamActivated,a);k.on(h.MediaPlayer.events.STREAM_DEACTIVATED,a.onDashStreamDeactivated,a);k.on(h.MediaPlayer.events.TEXT_TRACKS_ADDED,a.onDashTracksAdded,a);a.dashPlayer=k;a.closecall=function(l){if(l.dashPlayer){l.dashPlayer.pause();l.dashPlayer.off(h.MediaPlayer.events.PLAYBACK_METADATA_LOADED,l.onDashMetadata,l);l.dashPlayer.off(h.MediaPlayer.events.STREAM_INITIALIZED,l.onDashStreamInitialized,l);l.dashPlayer.off(h.MediaPlayer.events.STREAM_ACTIVATED,l.onDashStreamActivated,l);l.dashPlayer.off(h.MediaPlayer.events.STREAM_DEACTIVATED,
l.onDashStreamDeactivated,l);l.dashPlayer.off(h.MediaPlayer.events.TEXT_TRACKS_ADDED,a.onDashTracksAdded,a);l.dashPlayer.off(h.MediaPlayer.events.ERROR,l.onDashError,l);l.switchQualityLevel&&(l.dashPlayer.off(h.MediaPlayer.events.QUALITY_CHANGE_RENDERED,l.onDashQualityChanged,l),delete l.switchQualityLevel);if(typeof l.dashPlayer.reset==="function")try{l.dashPlayer.reset()}catch(p){}l.dashPlayer.destroy();delete l.dashPlayer;delete l.onDashMetadata;delete l.onDashStreamInitialized;delete l.onDashStreamActivated;
delete l.onDashStreamDeactivated;delete l.onDashTracksAdded;delete l.switchSubtitleTrack;delete l._dashSubTakeover}}}});return!0};a.playWCDN=function(m){var u=d._config.cdn_addr||window.cdn_addr;if(!u)return d.toast(K("webcdnNotSupported","The WCDN protocol is not supported without setting CDN server address")),!1;u.endsWith("/")||(u+="/");u+="cdnplay";d.wcdnClient&&(d.wcdnClient.close(),delete d.wcdnClient);u=u.replace("http","ws");window.location.protocol=="https:"&&(u=u.replace("ws:","wss:"));
var f=m.indexOf("://");if(f<0)return d.toast(K("invalidWcdnUrl","Invalid WCDN URL: ")+m),!1;m=m.substr(f+3);(f=d._config.userInfo||window.userInfo)||(f={userid:"0",username:"Visitor",nickname:"Visitor"});var c={msgtype:"startplay",data:{userid:f.userid||"0",username:f.username||"Visitor",nickname:f.nickname||"Visitor",avatar:f.avatar||"",streamurl:m}},h=function(k){var l=new WebSocket(u);l.onopen=function(p){p=JSON.stringify(c);l.send(p)};l.onmessage=function(p){if(typeof p.data==="string")try{var w=
JSON.parse(p.data),v=w.msgtype||"none",E=w.event||"none";if(v==="onresult")if(E==="startplay"){var D=w.data||null;if(D&&typeof D==="object"){p=void 0;typeof k.closecall2==="function"&&(p=k.closecall2,k.closecall2=null);w={msgtype:"playstatus",data:{status:"playing"}};k.play(D,!0)||(w.data.status="error");var B=JSON.stringify(w);l.send(B);typeof p==="function"&&(k.closecall2=p)}else{var G=w.msg||"Unknown error";G==="StreamNotExist"?(k.toast(K("waitStreamToReady","Waiting for stream")),k.errorHandleTimerId=
window.setTimeout(function(){delete k.errorHandleTimerId;k.toast("closetoast");var N=JSON.stringify(c);l.send(N)},3E3)):(k.toast(K("streamError","Stream error")+": "+E+" - "+G),k.errorHandleTimerId=window.setTimeout(function(){delete k.errorHandleTimerId;k.stop()},2E3))}}else E==="endplay"&&k.stop();else v==="error"?k.toast(K("streamError","Stream error")+": "+E+" - "+(w.msg||K("unknownError","Unknown error"))):v==="command"&&(w.action||"none")==="stopplay"&&(k.toast(K("serverClosed","Server is closed, player is stopped")),
k.errorHandleTimerId=window.setTimeout(function(){delete k.errorHandleTimerId;k.stop()},100),k.wcdnClient&&(k.wcdnClient.ws.close(),k.wcdnClient=null))}catch(N){}};l.onerror=function(p){};l.onclose=function(p){this.wsVersionId===k.wsVersionId&&k.wcdnClient&&!k.cdnReconnectTimerId&&k.wcdnClient===this&&(k.cdnReconnectTimerId=setTimeout(function(){h(k)},1E3),delete k.wcdnClient)};l.wsVersionId=(new Date).getTime();k.wcdnClient=l;k.wsVersionId=l.wsVersionId;typeof k.cdnReconnectTimerId!=="undefined"&&
delete k.cdnReconnectTimerId};d.closecall2=function(k){d.cdnReconnectTimerId&&(clearTimeout(d.cdnReconnectTimerId),delete d.cdnReconnectTimerId);d.errorHandleTimerId&&(clearTimeout(d.errorHandleTimerId),delete d.errorHandleTimerId);d.wcdnClient?(k=d.wcdnClient,delete d.wcdnClient,k.close()):d.toast(K("wcdnConnectionClosed","The WCDN connection has been passively closed"))};h(d);return!0};a.playVideo=function(){var m=d.videoEl;d.closecall=function(u){if(u.isPlayVideo){var f=u.videoEl;f.paused||f.pause();
f.src="";delete u.isPlayVideo}};d.isPlayVideo=!0;m.src=d.murl;d.resetPlaybackState();return!0};a.playAudio=function(){var m=d.videoEl;d.closecall=function(u){if(u.isPlayAudio){var f=u.videoEl;f.paused||f.pause();f.src="";delete u.isPlayAudio}};d.isPlayAudio=!0;m.src=d.murl;d.resetPlaybackState();return!0};a.playObject=function(){var m=d.murl;if((m.type||"")==="dvr"&&m.http)return d.murl=m.http,d.playVideo();if(r()){var u=window.RTCPeerConnection||window.webkitRTCPeerConnection||window.mozRTCPeerConnection||
window.RTCIceGatherer;if(m.rtc&&u)return d.murl=m.rtc,d.playRtc();if(m["httpflv-n"])return d.murl=m["httpflv-n"],d._config.useOldFlv?d.playFlv():d.playMpegts();if(m.httpflv)return d.murl=m.httpflv,d._config.useOldFlv?d.playFlv():d.playMpegts();if(m["wsflv-n"])return d.murl=m["wsflv-n"],d._config.useOldFlv?d.playFlv():d.playMpegts();if(m.wsflv)return d.murl=m.wsflv,d._config.useOldFlv?d.playFlv():d.playMpegts();if(m.hls)return d.murl=m.hls,d.playHls();if(m.dash)return d.murl=m.dash,d.playDash();if(m.ts)return d.murl=
m.ts,d.playMpegts()}else if(d.murl.hls)return d.murl=d.murl.hls,d.playHls();return!1}}async function oe(a,t){return new Promise(function(z,y){ec(a,JSON.stringify(t),function(x){z(x)},function(x){y(x)})})}function pe(a,t){a.playRtc=async function(){if(typeof window.RTCPeerConnection=="undefined")return alert("This browser does not support the stream.\r\nPlease play this stream in chrome!"),!1;a._rtcGenId=(a._rtcGenId||0)+1;var z=a._rtcGenId,y=qe(a.murl);if(!y)return a.toast(K("invalidInput","Invalid input")),
!1;a.peer_conn=new RTCPeerConnection(typeof RTCPeerConnection.prototype.addTransceiver=="function"?{iceServers:[],iceTransportPolicy:"all",bundlePolicy:"max-bundle",rtcpMuxPolicy:"require",sdpSemantics:"unified-plan"}:null);a.mediaStream=new MediaStream;a.peer_conn.ontrack=function(n){z===a._rtcGenId&&(this.hasTracks||(this.setRtcstream(a.mediaStream),fc()),this.hasTracks++,this.mediaStream.addTrack(n.track),a.baseTrack&&n.track.kind!="video"||(a.baseTrack=n.track),a.rtcstatsTimerId||(a.packetsReceived=
0,a.framesDecoded=0,a.emptyCount=0,a.rtcstatsTimerId=window.setInterval(function(){z===a._rtcGenId&&a.baseTrack&&a.peer_conn.getStats(a.baseTrack).then(m=>{z===a._rtcGenId&&m.forEach(u=>{u.type=="inbound-rtp"&&u.kind=="video"&&(u.framesDecoded!=a.framesDecoded?(a.framesDecoded=u.framesDecoded,a.packetsReceived=u.packetsReceived,a.emptyCount=0):a.framesDecoded>0&&(a.emptyCount++,a.emptyCount>3&&(a.closecall(a),a.playRtc())))})})},1E3)))}.bind(a);a.hasTracks=0;if(typeof a.peer_conn.addTransceiver==
"function"){(typeof a._config.hasAudio==="undefined"||a._config.hasAudio)&&await a.peer_conn.addTransceiver("audio",{direction:"recvonly"});await a.peer_conn.addTransceiver("video",{direction:"recvonly"});var x=await a.peer_conn.createOffer()}else x=await a.peer_conn.createOffer({offerToReceiveAudio:typeof a._config.hasAudio==="undefined"||a._config.hasAudio,offerToReceiveVideo:!0});await a.peer_conn.setLocalDescription(x);var e=(n=21)=>crypto.getRandomValues(new Uint8Array(n)).reduce((m,u)=>m+((u&=
63)<36?u.toString(36):u<62?(u-26).toString(36).toUpperCase():u>62?"-":"_"),"");if(y.provider==="trtc"){var d=y.urlObject.server,r="https://".concat("webrtc-signal-scheduler.tlivesource.com","/signal_query");d={domain:d,requestid:e(16),client_type:"Web",client_info:window.navigator.userAgent};if((r=await oe(r,d))&&r.errcode===0)y.apiUrl="https://"+r.data.signal_domain+"/webrtc/v1/pullstream",y.trtc_signal_domain=r.data.signal_domain;else return a.toast(K("failedToQueryTrtc","Failed to query TRTC signal server")),
!1;a.trtc_createBitratesMenu=function(n){var m=n.indexOf("tabr_bitrates=");if(m>0){m+=14;var u=n.indexOf("&",m);if(u===-1)u=n.length;else if(m=n.substring(m,u)){var f=m.split(",",4);if(f.length>1){var c=[];u=void 0;for(m=0;m<f.length;m++)c.push({mediaType:"video",bitrate:void 0,height:0,width:0,qualityIndex:m,name:f[m]}),u===void 0&&(u=m);this.switchQualityLevel=function(h){var k=this,l=parseInt(h);l>c.length||(l=f[l],k.trtc_svrsig&&ec("https://"+k.trtc_signal_domain+"/webrtc/v1/tabrctl",JSON.stringify({svrsig:k.trtc_svrsig,
seq:a.trtc_quality_seq,bitrate_name:l}),function(p){p.errcode===0&&(k.trtc_quality_seq++,k.updateQualityLevel(h,!1))},function(p){}))}.bind(this);this.createQualitiesMenu(c,!1);m=n.indexOf("tabr_start_bitrate=");m>0&&(m+=19,u=n.indexOf("&",m),u===-1&&(u=n.length),n=n.substring(m,u),u=f.indexOf(n));this.updateQualityLevel(u,!1)}}}else this.resetQualitiesMenu()}.bind(a)}r=new Promise(function(n,m){var u=null;if(y.provider==="brtc")var f={streamurl:y.streamUrl,sdp:x.sdp};else y.provider==="trtc"?(f=
y.streamUrl,f.indexOf("tabr_bitrates=")>0&&(f+="&webrtc_tabr_level=client_control"),f={clientinfo:"Windows NT 10.0;Chrome 142.0.0.0",localsdp:{type:"offer",sdp:x.sdp},sessionid:e(),streamurl:f}):y.provider==="artc"?f={version:2,sdk_version:"0.0.1",mode:"live",pull_streams:[{url:y.streamUrl,amsid:["rts audio"],vmsid:["rts video"]}],jsep:{type:"offer",sdp:x.sdp}}:y.provider==="whep"?(f=x.sdp,u="application/sdp"):f={api:y.apiUrl,rtcstream:y.streamUrl,clientip:null,sdp:x.sdp};y.urlObject.schema==="webrtc"&&
(delete f.rtcstream,f.streamurl=y.streamUrl);typeof f!=="string"&&(f=JSON.stringify(f));ec(y.apiUrl,f,function(c,h){if(y.provider==="trtc"){if(c.errcode){m(c);return}h=c.svrsig||"";c=c.remotesdp;c.svrsig=h;c.signal_domain=y.trtc_signal_domain}else if(y.provider==="artc")c.sdp=c.jsep.sdp,c.type="answer";else{if(y.provider==="whep"){c={sdp:c,type:"answer"};if(h=h.getResponseHeader("Location"))y.resourceUrl=(new URL(h,y.apiUrl)).href;n(c);return}if(c.code){m(c);return}}n(c)},function(c){m(c)},u)});a.closecall=
function(n){n._rtcGenId=(n._rtcGenId||0)+1;n.rtcstatsTimerId&&(window.clearInterval(n.rtcstatsTimerId),delete n.rtcstatsTimerId);n.tryStartPlayTimer&&(window.clearTimeout(n.tryStartPlayTimer),delete n.tryStartPlayTimer);typeof n.baseTrack!=="undefined"&&delete n.baseTrack;y.resourceUrl&&(re(y.resourceUrl),delete y.resourceUrl);typeof n.trtc_svrsig!=="undefined"&&(delete n.trtc_svrsig,delete n.trtc_quality_seq,delete n.trtc_signal_domain);typeof n.trtc_createBitratesMenu!=="undefined"&&delete n.trtc_createBitratesMenu;
n.switchQualityLevel&&delete n.switchQualityLevel;n.peer_conn&&(n.videoEl&&(n.videoEl.srcObject=null),n.mediaStream&&delete n.mediaStream,n.peer_conn.close(),n.peer_conn=null)};r.then(n=>{z===a._rtcGenId&&(a.peer_conn.setRemoteDescription(new RTCSessionDescription({type:"answer",sdp:n.sdp})).catch(function(m){typeof a.toast==="function"&&a.toast(K("playbackFailed","Playback failed")+": WebRTC",3E3,!0)}),y.provider==="trtc"&&(n.svrsig&&(a.trtc_svrsig=n.svrsig,a.trtc_quality_seq=1,a.trtc_signal_domain=
n.signal_domain),a.trtc_createBitratesMenu(y.streamUrl)))}).catch(n=>{z===a._rtcGenId&&("REQUEST:error"==n?a.tryStartPlayTimer=window.setTimeout(function(){delete a.tryStartPlayTimer;z===a._rtcGenId&&(a.closecall(a),a.playRtc())},1E3):a.peer_conn&&(a.peer_conn.close(),a.peer_conn=null))});return!0}}function se(a){return Ea(a)}function te(a,t){function z(){return{id:0,language:"original",label:K("originalSound","Original Sound"),isOriginal:!0}}function y(){if(a.externalAudioEl)return a.externalAudioEl;
var h=document.createElement("audio");h.preload="auto";h.setAttribute("crossorigin","anonymous");h.style.cssText="position:absolute;width:0;height:0;opacity:0;pointer-events:none;overflow:hidden;";a.playerContainer?a.playerContainer.appendChild(h):document.body.appendChild(h);return a.externalAudioEl=h}function x(){if(!a._audioSyncBound){var h=a.videoEl;h&&(a._audioSyncOnPlay=function(){var k=a.externalAudioEl;k&&a.currentAudioId!==0&&(k=k.play())&&typeof k.catch==="function"&&k.catch(function(){})},
a._audioSyncOnPause=function(){var k=a.externalAudioEl;k&&k.pause()},a._audioSyncOnSeeking=function(){var k=a.externalAudioEl;k&&k.pause()},a._audioSyncOnSeeked=function(){var k=a.externalAudioEl,l=a.videoEl;k&&l&&a.currentAudioId!==0&&(k.currentTime=l.currentTime,l.paused||(k=k.play())&&typeof k.catch==="function"&&k.catch(function(){}))},a._audioSyncOnRatechange=function(){var k=a.externalAudioEl,l=a.videoEl;k&&l&&(k.playbackRate=l.playbackRate)},a._audioSyncOnWaiting=function(){var k=a.externalAudioEl;
k&&k.pause()},a._audioSyncOnEnded=function(){var k=a.externalAudioEl;k&&(k.pause(),k.currentTime=0)},a._audioSyncOnLoadedmetadata=function(){a._realignAudioTrack()},a._audioSyncOnTimeupdate=function(){var k=a.externalAudioEl,l=a.videoEl;k&&l&&a.currentAudioId!==0&&!(l.seeking||k.paused||k.readyState<2)&&Math.abs(k.currentTime-l.currentTime)>.3&&(k.currentTime=l.currentTime)},h.addEventListener("play",a._audioSyncOnPlay),h.addEventListener("playing",a._audioSyncOnPlay),h.addEventListener("pause",a._audioSyncOnPause),
h.addEventListener("seeking",a._audioSyncOnSeeking),h.addEventListener("seeked",a._audioSyncOnSeeked),h.addEventListener("ratechange",a._audioSyncOnRatechange),h.addEventListener("waiting",a._audioSyncOnWaiting),h.addEventListener("ended",a._audioSyncOnEnded),h.addEventListener("loadedmetadata",a._audioSyncOnLoadedmetadata),h.addEventListener("timeupdate",a._audioSyncOnTimeupdate),a._audioSyncBound=!0)}}function e(){var h=a.videoEl,k=a.externalAudioEl;if(h){var l=a.currentAudioId===0,p=a._globalMuted;
h.muted=p||!l;k&&(k.muted=p||l)}}function d(h){if(!h)return"";h=String(h).split("-")[0].toLowerCase();h==="jp"&&(h="ja");return K("lang_"+h,h)}function r(h){return h.isOriginal?K("originalSound","Original Sound"):h.labelLocalized&&h.language?d(h.language):h.label||h.language||""}function n(h){function k(v,E){var D=URL.createObjectURL(v);v=document.createElement("a");v.href=D;v.download=E;document.body.appendChild(v);v.click();document.body.removeChild(v);setTimeout(function(){URL.revokeObjectURL(D)},
1E3)}for(var l=null,p=0;p<a.audioTrackList.length;p++)if(a.audioTrackList[p].id===h){l=a.audioTrackList[p];break}if(l&&l.url){h=".m4a";(p=l.url.split("?")[0].split("#")[0].toLowerCase().match(/\.(mp3|m4a|aac|ogg|wav|flac|opus)$/))&&(h=p[1]);l.url.indexOf("blob:")===0&&l.isAI&&(h=".m4a");var w=(r(l)||"audio").replace(/[\\/:*?"<>|]/g,"_").trim()+h;l.url.indexOf("blob:")===0?fetch(l.url).then(function(v){return v.blob()}).then(function(v){k(v,w)}).catch(function(){k(new Blob,w)}):fetch(l.url).then(function(v){if(!v.ok)throw Error("HTTP "+
v.status);return v.blob()}).then(function(v){k(v,w)}).catch(function(v){v=document.createElement("a");v.href=l.url;v.download=w;v.target="_blank";document.body.appendChild(v);v.click();document.body.removeChild(v)})}}var m=t.triggerEvent,u=t.httpGet;a.audioTrackList=[z()];a._makeOriginalAudioEntry=z;a.currentAudioId=0;a._nextAudioId=1;a.externalAudioEl=null;a._audioSyncBound=!1;a._globalMuted=!1;a._defaultAudioId=0;var f=a.setVolume,c=a.setMuted;a.setVolume=function(h){f.call(a,h);var k=a.externalAudioEl;
k&&(k.volume=h)};a.setMuted=function(h){a._globalMuted=!!h;c.call(a,h);e()};a._loadAudioTrackManifestFromUrl=function(h,k){typeof u!=="function"?k&&k([]):u(h,function(l){var p=[];try{var w,v=JSON.parse(l);(w=v&&typeof v==="object"?v.zwp_protocol&&typeof v.zwp_protocol==="string"&&v.zwp_protocol.indexOf("ZWMAP/")===0&&v.zwp_type==="audiotrack"&&Array.isArray(v.audioTracks)||Array.isArray(v.audioTracks)?v.audioTracks:null:null)&&(p=w)}catch(E){}k&&k(p)},function(){k&&k([])})};a._addAudioTrackInternal=
function(h,k,l,p,w){if(!h)return null;if(!k)if(h&&typeof h==="string")if(k=h.split("/").pop().split("?")[0].toLowerCase().match(/[._-](zh|chs|cht|en|ja|jp|ko|fr|de|es|ru|pt|it|ar|th|vi)\b/)){if(k=k[1],k==="jp"&&(k="ja"),k==="chs"||k==="cht")k="zh"}else k="";else k="";var v=l||d(k)||h.split("/").pop().split("?")[0];h={id:a._nextAudioId++,url:h,language:k,label:v,labelLocalized:!l&&!!k,isOriginal:!1,isDefault:!!p,isAI:!!w};a.audioTrackList.push(h);p&&(a._defaultAudioId=h.id);return h};a.updateAudioMenuUI=
function(){if(a.controlbar){var h=a.controlbar.querySelector(".zwp-subtitleButton");if(h){var k=h.querySelector(".zwp-subtitleComposite");if(k){var l=a.audioTrackList&&a.audioTrackList.length>1;h=k.querySelector(".zwp-audioMenu");if(l){h||(h=document.createElement("div"),h.className="zwp-audioMenu",(l=k.querySelector(".zwp-subtitleMenu"))?k.insertBefore(h,l):k.appendChild(h),h.addEventListener("click",function(B){var G=B.target&&B.target.closest?B.target.closest("[data-action]"):null;if(G){var N=
G.getAttribute("data-action");N==="selectAudioTrack"?(B.stopPropagation(),B=parseInt(G.getAttribute("data-audio-id"),10),isNaN(B)||a.setAudioTrack(B)):N==="downloadAudioTrack"&&(B.stopPropagation(),B=parseInt(G.getAttribute("data-audio-id"),10),isNaN(B)||n(B))}}));k='<div class="zwp-audio-title">'+K("audioTrack","Audio Track")+"</div>";k+='<div class="zwp-audio-divider"></div><div class="zwp-sub-single-list">';for(l=0;l<a.audioTrackList.length;l++){var p=a.audioTrackList[l],w=a.currentAudioId===p.id,
v="zwp-sub-dual-item"+(w?" selected":"");w='<span class="zwp-sub-check">'+(w?"\u2713":"")+"</span>";var E=p.isAI?' <span class="zwp-sub-lang-ai">AI</span>':"",D=p.isAI&&p.url?'<button class="zwp-sub-download-btn" data-action="downloadAudioTrack" data-audio-id="'+p.id+'" title="'+K("downloadAudioTrack","\u4e0b\u8f7d\u914d\u97f3")+'"><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><path d="M7 10l5 5 5-5"/><path d="M12 15V3"/></svg></button>':
"";k+='<div class="'+v+'" data-audio-id="'+p.id+'" data-action="selectAudioTrack">'+w+'<span class="zwp-sub-lang-text">'+se(r(p))+E+"</span>"+D+"</div>"}h.innerHTML=k+"</div>"}else h&&h.remove(),k.classList.remove("zwp-audio-only");a._updateSubtitleButtonVisibility()}}}};a._updateSubtitleButtonVisibility=function(){if(a.controlbar){var h=a.controlbar.querySelector(".zwp-subtitleButton");if(h){var k=a.subtitleList&&a.subtitleList.length>0,l=a.audioTrackList&&a.audioTrackList.length>1;h.style.display=
k||l?"block":"none";(l=h.querySelector(".zwp-subtitleComposite"))&&l.classList.toggle("has-subtitle",k);if(h=h.querySelector(".zwp-subtitleMenu"))h.style.display=k?"":"none"}}};a.setAudioTrack=function(h){for(var k=null,l=0;l<a.audioTrackList.length;l++)if(a.audioTrackList[l].id===h){k=a.audioTrackList[l];break}if(k&&a.currentAudioId!==h){l=null;for(var p=0;p<a.audioTrackList.length;p++)if(a.audioTrackList[p].id===a.currentAudioId){l=a.audioTrackList[p];break}a.currentAudioId=h;if(h===0){var w=a.externalAudioEl;
w&&(w.pause(),w.removeAttribute("src"),w.load())}else{w=y();x();w.src=k.url;w.load();var v=a.videoEl;if(v){w.playbackRate=v.playbackRate;var E=function(){w.removeEventListener("canplay",E);if(a.currentAudioId===h&&v&&(w.currentTime=v.currentTime,!v.paused)){var D=w.play();D&&typeof D.catch==="function"&&D.catch(function(){})}};w.addEventListener("canplay",E)}}e();typeof a.updateAudioMenuUI==="function"&&a.updateAudioMenuUI();if(a._config&&typeof a._config.onAudioTrackChange==="function")try{a._config.onAudioTrackChange.call(a,
k,l)}catch(D){}typeof m==="function"&&a.playerElm&&m(a.playerElm,"zwplayerAudioTrackChanged")}};a._realignAudioTrack=function(){var h=a.externalAudioEl,k=a.videoEl;h&&k&&a.currentAudioId!==0&&(h.playbackRate=k.playbackRate,h.currentTime=k.currentTime,e())};a._destroyAudioTracks=function(){var h=a.videoEl;h&&a._audioSyncBound&&(h.removeEventListener("play",a._audioSyncOnPlay),h.removeEventListener("playing",a._audioSyncOnPlay),h.removeEventListener("pause",a._audioSyncOnPause),h.removeEventListener("seeking",
a._audioSyncOnSeeking),h.removeEventListener("seeked",a._audioSyncOnSeeked),h.removeEventListener("ratechange",a._audioSyncOnRatechange),h.removeEventListener("waiting",a._audioSyncOnWaiting),h.removeEventListener("ended",a._audioSyncOnEnded),h.removeEventListener("loadedmetadata",a._audioSyncOnLoadedmetadata),h.removeEventListener("timeupdate",a._audioSyncOnTimeupdate),a._audioSyncBound=!1);if(h=a.externalAudioEl)h.pause(),h.removeAttribute("src"),h.load(),h.parentNode&&h.parentNode.removeChild(h),
a.externalAudioEl=null;a.audioTrackList=null;a.currentAudioId=0;a._globalMuted=!1};a.registerFeature({name:"audioTracks",destroy:a._destroyAudioTracks},1)}function ue(a){if(a===!1||a==null)return{enabled:!1};if(a===!0)return Object.assign({},Gb,{enabled:!0,force:!0,mode:"force",button:!0});if(a==="auto")return Object.assign({},Gb,{enabled:!0,force:!1,autoDetect:!0,mode:"auto",button:!0});if(a.enabled===!1)return{enabled:!1};var t=a.yaw!==void 0?a.yaw:a.defaultYaw!==void 0?a.defaultYaw:0,z=a.pitch!==
void 0?a.pitch:a.defaultPitch!==void 0?a.defaultPitch:0,y=a.button!==void 0?a.button:a.showButton!==void 0?a.showButton:!0,x=a.mode;x||=a.autoDetect===!0?"auto":a.autoDetect===!1?"manual":a.force===!1?"auto":"force";a=Object.assign({},Gb,a,{enabled:!0,mode:x,button:y,showButton:y,yaw:t,pitch:z,defaultYaw:t,defaultPitch:z,force:x==="force",autoDetect:x==="auto"});typeof a.fov==="number"&&isFinite(a.fov)||(a.fov=Gb.fov);return a}function Hb(a){return typeof a==="number"&&isFinite(a)?a<30?30:a>100?100:
a:75}function cb(a){return a*Math.PI/180}function ve(a){var t=a&&a.projection||"equirectangular",z=!(!a||!a.stereo);a&&a.videoWidth||0;a&&a.videoHeight||0;t!=="equirectangular"&&(t="equirectangular");a={offsetX:0,scaleX:1,offsetY:0,scaleY:1};var y={offsetX:0,scaleX:1,offsetY:0,scaleY:1};z&&(a.offsetY=.5,a.scaleY=.5,y.offsetY=0,y.scaleY=.5);return{phiStart:0,phiLength:Math.PI*2,thetaStart:0,thetaLength:Math.PI,flipX:!0,widthSegments:64,heightSegments:48,leftEyeUV:a,rightEyeUV:y,projection:t,stereo:z}}
function we(a){function t(){D=p.needsUpdate=!0;e.requestVideoFrameCallback&&(f.videoFrameCbId=e.requestVideoFrameCallback(t))}function z(){if(a.onFrame)a.onFrame();f.rafId=requestAnimationFrame(z);e.paused||e.currentTime!==B?G=0:++G>60&&(e.play().catch(function(){}),G=0);B=e.currentTime;if(E?D:!e.paused||D){D=!1;try{v.render(c,h)}catch(N){f.rafId&&(cancelAnimationFrame(f.rafId),f.rafId=0),x(),m(N)}}}function y(N,I,C){k.rotation.y=-N;h.rotation.x=I;C!==h.fov&&(h.fov=Hb(C),h.updateProjectionMatrix());
D=!0}function x(){cancelAnimationFrame(f.rafId);cancelAnimationFrame(f.resizeRafId);f.videoFrameCbId&&e.cancelVideoFrameCallback&&e.cancelVideoFrameCallback(f.videoFrameCbId);l.dispose();w.dispose();p.dispose();v.dispose();if(typeof v.forceContextLoss==="function")try{v.forceContextLoss()}catch(N){}f.initialized=!1}var e=a.videoEl,d=a.canvas,r=a.config,n=a.THREE,m=a.onFatal||function(){},u=ve({projection:r.projection,stereo:r.stereo,videoWidth:e.videoWidth,videoHeight:e.videoHeight}),f={initialized:!0,
rafId:0,resizeRafId:0,videoFrameCbId:0},c=new n.Scene,h=new n.PerspectiveCamera(r.fov,1,.1,100),k=new n.Object3D;k.add(h);c.add(k);var l=new n.SphereGeometry(1,u.widthSegments,u.heightSegments,u.phiStart,u.phiLength,u.thetaStart,u.thetaLength);l.applyMatrix4((new n.Matrix4).makeScale(-1,1,1));var p=new n.VideoTexture(e);p.minFilter=n.LinearFilter;p.magFilter=n.LinearFilter;p.format=n.RGBAFormat;n.SRGBColorSpace&&(p.colorSpace=n.SRGBColorSpace);u.leftEyeUV&&(p.offset.x=u.leftEyeUV.offsetX||0,p.offset.y=
u.leftEyeUV.offsetY||0,p.repeat.x=u.leftEyeUV.scaleX||1,p.repeat.y=u.leftEyeUV.scaleY||1);var w=new n.MeshBasicMaterial({map:p});u=new n.Mesh(l,w);c.add(u);var v=new n.WebGLRenderer({canvas:d,antialias:!1,alpha:!1,preserveDrawingBuffer:!0});v.setPixelRatio(Math.min(window.devicePixelRatio||1,2));var E=!!e.requestVideoFrameCallback,D=!0;E&&(f.videoFrameCbId=e.requestVideoFrameCallback(t));var B=-1,G=0;return{start:function(){y(cb(r.defaultYaw),cb(r.defaultPitch),r.fov);z()},dispose:x,onResize:function(N,
I){f.resizeRafId||(f.resizeRafId=requestAnimationFrame(function(){f.resizeRafId=0;h.aspect=N/I;h.updateProjectionMatrix();v.setSize(N,I);D=!0}))},setCamera:y,getState:function(){return f}}}function xe(a){function t(){var P=v,U=E,W=l.yawOnly,ca=cb(l.defaultPitch);p(P,W?ca:U,D)}function z(){I=Date.now()}function y(P){z();B=!0;G=P.clientX;N=P.clientY}function x(P){if(B){var U=P.clientX-G,W=P.clientY-N;G=P.clientX;N=P.clientY;v+=U*.005;E+=-W*.005;E=Math.max(-Math.PI/2+.01,Math.min(Math.PI/2-.01,E));t()}}
function e(){B=!1}function d(P){z();P.preventDefault();D=Hb(D+(P.deltaY>0?3:-3));t()}function r(P,U){var W=P.clientX-U.clientX;P=P.clientY-U.clientY;return Math.sqrt(W*W+P*P)}function n(P){z();B=!1;P.touches.length===1?(C=!0,g=P.touches[0].clientX,q=P.touches[0].clientY):P.touches.length===2&&(C=!1,A=r(P.touches[0],P.touches[1]),M=D)}function m(P){P.preventDefault();if(P.touches.length===1&&C){var U=P.touches[0].clientX-g,W=P.touches[0].clientY-q;g=P.touches[0].clientX;q=P.touches[0].clientY;v+=U*
.005;E+=-W*.005;E=Math.max(-Math.PI/2+.01,Math.min(Math.PI/2-.01,E));t()}else P.touches.length===2&&A>0&&(P=r(P.touches[0],P.touches[1]),D=Hb(A/P*M),t())}function u(P){P.touches.length===0?(C=!1,A=0):P.touches.length===1&&(C=!0,g=P.touches[0].clientX,q=P.touches[0].clientY,A=0)}function f(){!T&&w&&(T=new w.Euler,b=new w.Quaternion,S=new w.Quaternion(-Math.sqrt(.5),0,0,Math.sqrt(.5)),H=new w.Quaternion,V=new w.Vector3(0,0,1))}function c(P){if(w&&P&&(P.alpha!==null||P.beta!==null||P.gamma!==null)){f();
var U=(P.alpha||0)*Math.PI/180,W=(P.beta||0)*Math.PI/180;P.webkitCompassHeading!==void 0&&(U=(360-P.webkitCompassHeading)*Math.PI/180);T.set(W,U,0,"YXZ");b.setFromEuler(T);b.multiply(S);P=b;U=H;P.multiply.call(P,U.setFromAxisAngle.call(U,V,-((window.orientation||screen.orientation&&screen.orientation.angle||0)*Math.PI/180)));P=b.w;U=b.x;W=b.y;var ca=b.z;E=Math.asin(Math.max(-1,Math.min(1,2*(P*U-W*ca))));v=Math.atan2(2*(P*W+U*ca),1-2*(W*W+U*U));z();t()}}function h(){}var k=a.canvas,l=a.config,p=a.onChange||
function(){},w=a.THREE,v=cb(l.defaultYaw),E=cb(l.defaultPitch),D=l.fov,B=!1,G=0,N=0,I=0,C=!1,g=0,q=0,A=0,M=0,J=!1,T,b,S,H,V;return{attach:function(){k.addEventListener("mousedown",y);window.addEventListener("mousemove",x);window.addEventListener("mouseup",e);k.addEventListener("wheel",d,{passive:!1});k.addEventListener("touchstart",n,{passive:!1});k.addEventListener("touchmove",m,{passive:!1});k.addEventListener("touchend",u);k.addEventListener("touchcancel",u)},detach:function(){k.removeEventListener("mousedown",
y);window.removeEventListener("mousemove",x);window.removeEventListener("mouseup",e);k.removeEventListener("wheel",d);k.removeEventListener("touchstart",n);k.removeEventListener("touchmove",m);k.removeEventListener("touchend",u);k.removeEventListener("touchcancel",u)},reset:function(){v=cb(l.defaultYaw);E=cb(l.defaultPitch);D=l.fov;t()},setYawPitchFov:function(P,U,W){z();v=P;E=Math.max(-Math.PI/2+.01,Math.min(Math.PI/2-.01,U));D=Hb(W);t()},nudge:function(P,U){v+=cb(P);E+=cb(U);E=Math.max(-Math.PI/
2+.01,Math.min(Math.PI/2-.01,E));z();t()},tickAutoRotate:function(){!l.autoRotate||Date.now()-I<2E3||(v+=.002,t())},enableGyro:function(){!J&&w&&(f(),window.addEventListener("deviceorientation",c,!1),"ondeviceorientationabsolute"in window&&window.addEventListener("deviceorientationabsolute",c,!1),window.addEventListener("orientationchange",h),J=!0,typeof console!=="undefined"&&console.log("[ZWPlayer VR] \u9640\u87ba\u4eea\u5df2\u542f\u7528\uff0c\u76d1\u542c deviceorientation \u4e8b\u4ef6"))},disableGyro:function(){J&&
(window.removeEventListener("deviceorientation",c,!1),window.removeEventListener("deviceorientationabsolute",c,!1),window.removeEventListener("orientationchange",h),J=!1)},isGyroEnabled:function(){return J},getState:function(){return{yaw:v,pitch:E,fov:D}}}}function ye(a,t){function z(l){typeof m.toast==="function"&&m.toast(K("vrUnsupported","\u60a8\u7684\u6d4f\u89c8\u5668\u4e0d\u652f\u6301 VR \u6e32\u67d3"))}function y(){f.canvas&&f.canvas.parentNode&&f.canvas.parentNode.removeChild(f.canvas);m.videoEl&&
m.videoEl.classList.remove("zwp-vr-source");m.videoWrapper&&m.videoWrapper.classList.remove("zwp-vr-active");m.overlay_layers&&m.overlay_layers.classList.remove("zwp-vr-suppressed");m.playerElm&&m.playerElm.classList.remove("zwp-vr-mode")}function x(){if(!f.initialized){var l=window.THREE;if(l&&l.WebGLRenderer){ze(m.videoEl,m.murl||m.videoEl&&m.videoEl.src||"");if(c!==null)u.stereo=c;else if(!u.stereo){var p=m.videoEl.videoWidth,w=m.videoEl.videoHeight;if(!p||!w){var v=m.videoEl,E=function(){v.removeEventListener("loadedmetadata",
E);x()};v.addEventListener("loadedmetadata",E);return}Math.abs(p/w-1)<.1&&(u.stereo=!0)}var D=m.videoWrapper;if(D)if(p=document.createElement("canvas"),p.className="zwp-vr-canvas",D.appendChild(p),f.canvas=p,w=document.createElement("canvas"),w.getContext("webgl")||w.getContext("experimental-webgl")){m.videoEl.classList.add("zwp-vr-source");D.classList.add("zwp-vr-active");m.overlay_layers&&m.overlay_layers.classList.add("zwp-vr-suppressed");m.playerElm&&m.playerElm.classList.add("zwp-vr-mode");try{f.renderer=
we({videoEl:m.videoEl,canvas:p,config:u,THREE:l,onFrame:function(){f.input&&f.input.tickAutoRotate()},onFatal:function(B){console.error("[ZWPlayer VR] \u6e32\u67d3\u5931\u8d25\uff0c\u5df2\u505c\u6b62 VR",B);if(typeof m._destroyVR==="function")try{m._destroyVR()}catch(G){}}}),f.input=xe({canvas:p,config:u,THREE:l,onChange:function(B,G,N){f.renderer.setCamera(B,G,N);typeof m._onVrViewChange==="function"&&m._onVrViewChange()}}),m._vrInput=f.input,f.renderer.onResize(D.clientWidth,D.clientHeight),f.renderer.start(),
f.input.attach(),f.resizeHandler=function(){if(f.renderer)f.renderer.onResize(D.clientWidth,D.clientHeight)},D.addEventListener("resize",f.resizeHandler),f.initialized=!0,r(),typeof m.updateLocalPlaybackHint==="function"&&m.updateLocalPlaybackHint(m.videoEl&&m.videoEl.paused)}catch(B){console.error("[ZWPlayer VR] \u521d\u59cb\u5316\u5931\u8d25",B),y(),z()}}else y(),z();else z()}else z()}}function e(){return"ontouchstart"in window||navigator&&navigator.maxTouchPoints>0}function d(){if(e())if(f.gyroPermission===
"granted")r();else if(typeof DeviceOrientationEvent!=="undefined"&&typeof DeviceOrientationEvent.requestPermission==="function")try{DeviceOrientationEvent.requestPermission().then(function(l){f.gyroPermission=l;l==="granted"&&r()}).catch(function(l){f.gyroPermission="denied"})}catch(l){}else f.gyroPermission="granted",r()}function r(){e()&&f.gyroPermission==="granted"&&f.input&&!f.input.isGyroEnabled()&&f.input.enableGyro()}function n(){if(u.autoDetect!==!1){var l=m.videoEl;l&&(h&&l.removeEventListener("loadedmetadata",
h),h=function(){var p=l.videoWidth,w=l.videoHeight;p&&w&&(p/=w,w=Math.abs(p-1)<.05,Math.abs(p-2)<.05||w)&&(l.removeEventListener("loadedmetadata",h),typeof m.toggleVR!=="function"||m.isVrActive()||m.toggleVR())},l.addEventListener("loadedmetadata",h),l.videoWidth&&l.videoHeight&&h())}}var m=a,u=ue(m._config&&m._config.vr);if(u.enabled){u.force&&(m._config.url||m.murl)&&(m.bigPlayOverlay&&m.bigPlayOverlay.style.setProperty("display","none","important"),m.bigPlayBtn&&m.bigPlayBtn.style.setProperty("display",
"none","important"),m.videoEl&&m.videoEl.classList.add("zwp-vr-source"),m.videoWrapper&&m.videoWrapper.classList.add("zwp-vr-active"),m.overlay_layers&&m.overlay_layers.classList.add("zwp-vr-suppressed"));var f={initialized:!1,renderer:null,input:null,canvas:null,loaded:!1,gyroPermissionRequested:!1,gyroPermission:void 0},c=null;a.isVrActive=function(){return f.initialized};a.isVrMobileDevice=e;a.isVrStereo=function(){return!!u.stereo};a.setVrStereo=function(l){c=!!l;f.initialized&&(m._destroyVR(),
m.toggleVR())};a.toggleVR=function(){f.initialized?m._destroyVR():(d(),f.loaded?(x(),r()):Oc("three_js",xb+"three.custom.min.js",function(l){f.loaded=!0;x();r();f.initialized&&e()&&f.gyroPermission===void 0&&(setTimeout(r,50),setTimeout(r,300))}))};m._destroyVR=function(){f.initialized&&(f.resizeHandler&&m.videoWrapper&&(m.videoWrapper.removeEventListener("resize",f.resizeHandler),f.resizeHandler=null),f.input&&f.input.detach(),f.input&&f.input.isGyroEnabled()&&f.input.disableGyro(),m._gyroEnabled=
!1,m._vrInput=null,f.renderer&&f.renderer.dispose(),y(),f.initialized=!1,typeof m.updateLocalPlaybackHint==="function"&&m.updateLocalPlaybackHint(m.videoEl&&m.videoEl.paused))};m.registerFeature({name:"vr",destroy:m._destroyVR},2);var h=null;n();var k=!1;m.videoEl.addEventListener("loadedmetadata",function(){k=!0},{once:!0});m.videoEl.addEventListener("loadstart",function(){k&&(f.initialized&&m._destroyVR(),c=null,u.stereo=!1,n(),u.force&&typeof m.toggleVR==="function"&&!m.isVrActive()&&m.toggleVR())});
u.force&&typeof m.toggleVR==="function"&&!m.isVrActive()&&m.toggleVR()}}function ze(a,t){if(!t)return"ok";try{if((new URL(t,location.href)).origin!==location.origin&&a&&!a.crossOrigin)return console.error('[ZWPlayer VR] \u8de8\u57df\u89c6\u9891\u6e90\u672a\u8bbe\u7f6e crossOrigin\uff0cVR \u7eb9\u7406\u5c06\u88ab\u6c61\u67d3\u5bfc\u81f4\u9ed1\u5c4f\u3002\u8bf7\u786e\u4fdd\u89c6\u9891\u6e90\u8fd4\u56de\u6b63\u786e\u7684 CORS \u5934\uff0c\u5e76\u5728\u521d\u59cb\u5316\u524d\u8bbe\u7f6e videoEl.crossOrigin="anonymous"\u3002'),
"warn-and-attempt"}catch(z){}return"ok"}function Ae(a){if(!a||typeof a!=="object")return Object.assign({},Pc);var t=Object.assign({},Pc,a);t.startTime=a.startTime==="random"?"random":+a.startTime||0;t.duration=+a.duration||0;t.hoverToPlay=a.hoverToPlay!==!1;t.resetOnLeave=a.resetOnLeave===!0;return t}function Be(a,t){if(a==="random"){if(!t||!isFinite(t))return 0;a=t*.1;return a+Math.random()*(t*.8-a)}t=+a||0;return t<0?0:t}function Ce(a,t){function z(){if(p||!m)return p;var v=r._config.poster||r.videoEl&&
r.videoEl.getAttribute("poster");if(!v)return null;p=m.querySelector(".zwp-preview-poster");p||(p=document.createElement("div"),p.className="zwp-preview-poster",m.appendChild(p));p.style.backgroundImage='url("'+v+'")';return p}function y(){var v=z();v&&v.classList.remove("zwp-preview-poster-hidden")}function x(){var v=z();v&&v.classList.add("zwp-preview-poster-hidden")}function e(){if(r._previewing){clearTimeout(u);u=null;h&&r.videoEl&&(r.videoEl.removeEventListener("loadedmetadata",h),h=null);if(r.videoEl&&
(r.videoEl.pause(),n.resetOnLeave))try{r.videoEl.currentTime=n.startTime==="random"?0:+n.startTime||0,l=!1}catch(v){}r._previewing=!1;y();if(typeof r._config.onPreviewStop==="function")r._config.onPreviewStop()}}function d(){if(w&&r.videoEl){var v=r.videoEl.duration||0;w.textContent=sb(r.videoEl.currentTime||0)+" / "+sb(v)}}t=t||{};var r=a;a=t.debug_log;var n=Ae(r._config.preview);r._config.preview=n;var m=r.playerContainer,u=null,f=null,c=null,h=null,k=!1,l=!1,p=null;r.startPreview=function(v){v=
v||{};if(!r._previewing&&r.videoEl){r.videoEl.muted=!0;r._previewing=!0;x();var E=v.startTime!==void 0,D=E?v.startTime:n.startTime;r.videoEl.duration||0;var B=function(){if(!k&&r._previewing){if(!l||E){var G=Be(D,r.videoEl.duration||0);try{r.videoEl.currentTime=G}catch(N){}}l=!0;r.videoEl.play().catch(function(){});if(typeof r._config.onPreviewStart==="function")r._config.onPreviewStart({startTime:r.videoEl.currentTime});G=v.duration!==void 0?v.duration:n.duration;G>0&&(clearTimeout(u),u=setTimeout(function(){e()},
G*1E3))}};if(r.videoEl.readyState>=1||D!=="random"||l)B();else{h&&r.videoEl&&r.videoEl.removeEventListener("loadedmetadata",h);h=function(){r.videoEl&&r.videoEl.removeEventListener("loadedmetadata",h);h=null;r._previewing&&!k&&B()};r.videoEl.addEventListener("loadedmetadata",h);try{r.videoEl.load()}catch(G){}}}};r.stopPreview=e;r._previewing=!1;y();n.hoverToPlay&&m&&(f=function(){r.startPreview&&r.startPreview()},c=function(){r.stopPreview&&r.stopPreview()},m.addEventListener("mouseenter",f),m.addEventListener("mouseleave",
c),(t=m.parentElement)&&t!==document.body&&t!==document.documentElement&&(t.addEventListener("mouseenter",f),t.addEventListener("mouseleave",c)));a&&console.log("[Preview] \u9884\u89c8\u6a21\u5f0f\u5df2\u88c5\u914d\uff0choverToPlay="+n.hoverToPlay);var w=null;m&&(w=document.createElement("div"),w.className="zwp-preview-time",w.textContent="0:00 / 0:00",m.appendChild(w));r.videoEl&&r.videoEl.addEventListener("timeupdate",d);return{destroy:function(){k=!0;clearTimeout(u);u=null;h&&r.videoEl&&(r.videoEl.removeEventListener("loadedmetadata",
h),h=null);f&&m&&m.removeEventListener("mouseenter",f);c&&m&&m.removeEventListener("mouseleave",c);var v=m?m.parentElement:null;f&&v&&v.removeEventListener("mouseenter",f);c&&v&&v.removeEventListener("mouseleave",c);r.videoEl&&r.videoEl.removeEventListener("timeupdate",d);w&&w.parentNode&&w.parentNode.removeChild(w);p&&p.parentNode&&p.parentNode.removeChild(p);w=p=null;r._previewing=!1}}}function Qc(a){function t(){try{if(a){var y=getComputedStyle(a).getPropertyValue("--zwp-accent");y&&(z=y.trim()||
"#1db954")}}catch(x){}}var z="#1db954";t();return{get:function(){return z},refresh:t,set:function(y){y&&(z=y)}}}function De(a,t,z){function y(){if(t){var A=typeof window!=="undefined"?window.devicePixelRatio||1:1,M;if(f==="circular")var J=M=140;else f==="mountain"?(M=t.clientWidth||600,J=t.clientHeight||120):(M=t.clientWidth||300,J=t.clientHeight||40);if(h.width!==Math.round(M*A)||h.height!==Math.round(J*A))h.width=Math.round(M*A),h.height=Math.round(J*A),h.style.width=M+"px",h.style.height=J+"px";
k&&typeof k.setTransform==="function"&&k.setTransform(A,0,0,A,0,0);I=M;C=J;g.refresh()}}function x(){if(E)return!0;var A=Ub(c,{debug_log:!1});if(!A||!A.analyser)return!1;try{l=A.analyser;if(f==="mountain"&&l.fftSize!==512)try{l.fftSize=512}catch(M){}p=new Uint8Array(l.frequencyBinCount);E=!0;c.audioAnalyser=l;return!0}catch(M){return!1}}function e(){if(!v)if(w=requestAnimationFrame(e),!c.videoEl||c.videoEl.paused)d();else{if(c.audioContext&&c.audioContext.state==="suspended")try{c.audioContext.resume()}catch(la){}if(x()){l.getByteFrequencyData(p);
for(var A=p,M=Math.min(A.length,f==="mountain"?128:64),J=0;J<D;J++){var T=J/D;var b=Math.floor(Math.pow(T,1.5)*M),S=Math.floor(Math.pow((J+1)/D,1.5)*M);S<=b&&(S=b+1);S=Math.min(S,M);for(var H=0,V=0,P=0;b<S;b++){var U=A[b]||0;U>H&&(H=U);V+=U;P++}T=Math.min((H*.75+(P>0?V/P:0)*.25)/255*1.8*(1+T*.7),1);S=B[J];B[J]=T>S?S*.25+T*.75:S*.85+T*.15;B[J]>=G[J]?(G[J]=B[J],N[J]=0):(N[J]+=.02,G[J]-=N[J],G[J]<B[J]&&(G[J]=B[J],N[J]=0))}if(f==="circular"){if(k){A=I;M=C;k.clearRect(0,0,A,M);A/=2;M/=2;J=g.get();H=(B[0]+
B[1]+B[2]+B[3])/4;T=Math.min(A,M)*.32+H*4;S=Math.min(A,M)*.55;k.shadowBlur=10;k.shadowColor=J;k.beginPath();k.arc(A,M,T,0,Math.PI*2);k.strokeStyle=J;k.globalAlpha=.35+H*.4;k.lineWidth=1.5;k.stroke();k.globalAlpha=1;k.lineCap="round";for(H=0;H<D;H++){b=Math.max(B[H]*S,2);P=H/D*Math.PI*2-Math.PI/2;V=Math.cos(P);P=Math.sin(P);U=A+V*T;var W=M+P*T,ca=A+V*(T+b);b=M+P*(T+b);k.beginPath();k.moveTo(U,W);k.lineTo(ca,b);k.strokeStyle=J;k.lineWidth=2.5;k.stroke();b=Math.max(G[H]*S,2)+3;V=A+V*(T+b);P=M+P*(T+b);
k.beginPath();k.arc(V,P,1.2,0,Math.PI*2);k.fillStyle="#ffffff";k.fill()}k.shadowBlur=0}}else if(f==="mirror"){if(k){J=I;A=C;k.clearRect(0,0,J,A);M=g.get();J=Math.max((J-2*(D-1))/D,1);T=A/2;k.shadowBlur=6;k.shadowColor=M;for(S=0;S<D;S++)V=Math.max(B[S]*(T-4),1),H=S*(J+2),P=k.createLinearGradient(0,T-V,0,T+V),P.addColorStop(0,"#ffffff"),P.addColorStop(.5,M),P.addColorStop(1,"#ffffff"),k.fillStyle=P,k.fillRect(H,T-V,J,V*2),V=Math.max(G[S]*(T-4),1)+2,k.fillStyle="#ffffff",k.fillRect(H,Math.max(T-V,0),
J,1.5),k.fillRect(H,Math.min(T+V-1.5,A-1.5),J,1.5);k.shadowBlur=0}}else if(f==="mountain"){if(k){T=I;A=C;k.clearRect(0,0,T,A);M=g.get();J=Math.max((T-1.5*(D-1))/D,1);k.shadowBlur=8;k.shadowColor=M;k.beginPath();k.moveTo(0,A);for(S=0;S<D;S++)k.lineTo(S*(J+1.5)+J/2,A-Math.max(B[S]*(A-8),2));k.lineTo(T,A);k.closePath();T=k.createLinearGradient(0,0,0,A);T.addColorStop(0,r(M,.65));T.addColorStop(.5,r(M,.25));T.addColorStop(1,r(M,.02));k.fillStyle=T;k.fill();for(T=0;T<D;T++)H=Math.max(B[T]*(A-8),2),S=T*
(J+1.5),V=A-H,k.fillStyle=r(M,.85),k.fillRect(S,V,J,H),H=A-Math.max(G[T]*(A-8),2)-3,k.fillStyle="#ffffff",k.fillRect(S,Math.max(H,0),J,1.5);k.shadowBlur=0}}else if(f==="vintage"){if(k)for(M=I,A=C,k.clearRect(0,0,M,A),M=Math.max((M-2*(D-1))/D,1),J=k.createLinearGradient(0,A,0,0),J.addColorStop(0,"#00e676"),J.addColorStop(.65,"#ffea00"),J.addColorStop(1,"#ff1744"),T=0;T<D;T++)H=Math.max(B[T]*(A-4),1),S=T*(M+2),k.fillStyle=J,k.fillRect(S,A-H,M,H),H=A-Math.max(G[T]*(A-4),1)-3,k.fillStyle="#00e5ff",k.fillRect(S,
Math.max(H,0),M,2)}else if(f==="classic"){if(k)for(M=I,A=C,k.clearRect(0,0,M,A),M=Math.max((M-2*(D-1))/D,1),J=(A-2)/12,T=0;T<D;T++){H=Math.round(B[T]*12);S=T*(M+2);for(V=0;V<H;V++)P=A-(V+1)*J,k.fillStyle=V<7?"#38bdf8":V<10?"#f59e0b":"#ef4444",k.fillRect(S,P+1,M,J-1);H=A-(Math.min(Math.round(G[T]*12),11)+1)*J;k.fillStyle="#fbbf24";k.fillRect(S,Math.max(H+1,0),M,J-1)}}else if(k){J=I;A=C;k.clearRect(0,0,J,A);M=g.get();J=Math.max((J-2*(D-1))/D,1);k.shadowBlur=6;k.shadowColor=M;for(T=0;T<D;T++)S=T*(J+
2),H=A-Math.max(B[T]*(A-6),2),V=k.createLinearGradient(0,H,0,A),V.addColorStop(0,"#ffffff"),V.addColorStop(.3,M),V.addColorStop(1,M),k.fillStyle=V,V=Math.min(J/2,2),k.beginPath(),k.moveTo(S+V,H),k.lineTo(S+J-V,H),k.quadraticCurveTo(S+J,H,S+J,H+V),k.lineTo(S+J,A),k.lineTo(S,A),k.lineTo(S,H+V),k.quadraticCurveTo(S,H,S+V,H),k.fill(),H=A-Math.max(G[T]*(A-6),2)-4,k.fillStyle="#ffffff",k.fillRect(S,Math.max(H,0),J,2);k.shadowBlur=0}}else d()}}function d(){if(k){var A=I,M=C;k.clearRect(0,0,A,M);k.fillStyle=
"rgba(255,255,255,0.15)";f==="circular"?(A/=2,M/=2,k.beginPath(),k.arc(A,M,Math.min(A,M)*.35,0,Math.PI*2),k.strokeStyle="rgba(255,255,255,0.15)",k.lineWidth=1.5,k.stroke()):k.fillRect(0,M/2-1,A,2)}}function r(A,M){if(!A)return"rgba(29, 185, 84, "+M+")";A=A.replace("#","");A.length===3&&(A=A[0]+A[0]+A[1]+A[1]+A[2]+A[2]);if(A.length!==6)return"rgba(29, 185, 84, "+M+")";var J=parseInt(A.substring(0,2),16),T=parseInt(A.substring(2,4),16);A=parseInt(A.substring(4,6),16);return"rgba("+J+", "+T+", "+A+", "+
M+")"}function n(){w!=null&&(cancelAnimationFrame(w),w=null);k&&d()}function m(){if(c.audioContext&&c.audioContext.state==="suspended")try{c.audioContext.resume()}catch(A){}w!=null||v||e()}function u(){n()}z=z||{};var f="classic";if(z.shape==="circular")f="circular";else if(z.shape==="mirror")f="mirror";else if(z.shape==="mountain")f="mountain";else if(z.shape==="classic")f="classic";else if(z.shape==="vintage"||z.shape==="ttplayer")f="vintage";var c=a,h=document.createElement("canvas");h.className=
"zwp-music-visualizer-canvas";t.appendChild(h);t.setAttribute("data-shape",f);h.setAttribute("data-shape",f);var k=h.getContext("2d"),l=null,p=null,w=null,v=!1,E=!1,D=f==="mountain"?128:48,B=new Float32Array(D),G=new Float32Array(D),N=new Float32Array(D);var I=300;var C=40;var g=Qc(h),q=null;y();typeof ResizeObserver!=="undefined"&&t&&(q=new ResizeObserver(function(){y()}),q.observe(t));c.videoEl&&(c.videoEl.addEventListener("play",m),c.videoEl.addEventListener("pause",u));c.videoEl&&!c.videoEl.paused?
w!=null||v||e():d();return{updateAccent:function(A){g.set(A)},destroy:function(){v=!0;n();q&&(q.disconnect(),q=null);c.videoEl&&(c.videoEl.removeEventListener("play",m),c.videoEl.removeEventListener("pause",u));if(l){try{l.disconnect()}catch(A){}c.audioAnalyser===l&&(c.audioAnalyser=null);l=null}h.parentNode&&h.parentNode.removeChild(h)}}}function Ee(a){var t=[];if(Array.isArray(a))for(var z=0;z<a.length;z++){var y=a[z];if(y&&y.url){var x={name:y.title||y.url,url:y.url,type:"auto",isLive:!1};y.poster?
x.poster=y.poster:y.cover&&(x.poster=y.cover);y.lyrics&&(x.lyrics=y.lyrics);y.audioTracks&&(x.audioTracks=y.audioTracks);y.artist&&(x.artist=y.artist);t.push(x)}}return{zwp_protocol:"ZWMAP/1.0",zwp_type:"playlist",title:"",autoPlayNext:!0,groups:[{id:"music_queue",name:"",expanded:!0,items:t}]}}function Fe(a,t){function z(){var f=x.playlistState&&x.playlistState.data;return f&&f.groups&&f.groups[0]?f.groups[0].items||[]:[]}function y(f){var c=z();f<0||f>=c.length||typeof x.playPlaylistItem==="function"&&
x.playPlaylistItem(c[f])}t=t||{};var x=a;a=t.debug_log;t=t.cfg||{};var e=!1,d=!1,r=[],n=0;x.playNextTrack=function(){if(!e&&d)if(x.playlistState&&x.playlistState.shuffle){var f=z();if(f.length!==0){if(r.length===0||n>=r.length){var c=f.length;if(!c||c<=0)r=[];else{f=[];for(var h=0;h<c;h++)f.push(h);for(c=f.length-1;c>0;c--){h=Math.floor(Math.random()*(c+1));var k=f[c];f[c]=f[h];f[h]=k}r=f}n=0}y(r[n]);n++}}else typeof x.playNextPlaylistItem==="function"&&x.playNextPlaylistItem()};x.playPrevTrack=function(){!e&&
d&&(x.playlistState&&x.playlistState.shuffle&&n>0?(n--,y(r[n])):typeof x.playPrevPlaylistItem==="function"&&x.playPrevPlaylistItem())};if(Array.isArray(t.tracks)&&t.tracks.length>0&&typeof x._applyPlaylistData==="function")try{var m=Ee(t.tracks);x._applyPlaylistData(m,null,!1);if(x.playlistState&&x.playlistState.data&&x.playlistState.data.groups[0]){var u=x.playlistState.data.groups[0].items[0];u&&(x.playlistState.currentItem=u,x.playlistState.currentGroup=x.playlistState.data.groups[0])}d=!0;a&&
console.log("[Music Queue] \u88c5\u8f7d",t.tracks.length,"\u9996\u66f2\u76ee\uff0ccurrentItem=items[0]")}catch(f){a&&console.warn("[Music Queue] \u88c5\u8f7d\u5931\u8d25:",f)}return{destroy:function(){e=!0;d=!1},isLoaded:function(){return d}}}function Rc(a,t,z,y,x,e){if(a&&y)try{yb&&hc===y.frequencyBinCount||(hc=y.frequencyBinCount,yb=new Uint8Array(hc));y.getByteFrequencyData(yb);var d=Math.min(yb.length,32);t/=d;a.fillStyle=x;for(x=0;x<d;x++){var r=yb[x]/255*e;a.fillRect(x*t,z-r,Math.max(t-2,1),
r)}}catch(n){}}function Ge(a){function t(){if(typeof document!=="undefined"&&typeof document.createElement==="function"&&typeof HTMLCanvasElement!=="undefined"&&typeof HTMLCanvasElement.prototype.captureStream==="function")try{l||(l=document.createElement("canvas"),l.width=400,l.height=260,l.style.display="none",p=l.getContext("2d"),document.body.appendChild(l)),v||(z(),v=l.captureStream(30)),w||(w=document.createElement("video"),w.srcObject=v,w.muted=!0,w.style.display="none",w.setAttribute("playsinline",
""),w.autoplay=!0,document.body.appendChild(w),w.play().catch(function(){}))}catch(D){typeof console!=="undefined"&&console.warn("[Music PiP] Prewarm canvas stream failed:",D)}}function z(){if(p&&l){var D=l.width,B=l.height;p.fillStyle="#141414";p.fillRect(0,0,D,B);var G=u.get();Rc(p,D,B,n.audioAnalyser,G,55);var N=n._musicLyricCurrent?n._musicLyricCurrent:"";p.fillStyle="#ffffff";p.font="bold 22px sans-serif";p.textAlign="center";p.textBaseline="middle";G=p;var I=D/2;B=B/2-15;var C=D-40;if(G&&N){var g=
N.split(""),q="";N=[];for(var A=0;A<g.length;A++){var M=q+g[A];G.measureText(M).width>C&&q?(N.push(q),q=g[A]):q=M}q&&N.push(q);B-=(N.length-1)*28/2;for(C=0;C<N.length;C++)G.fillText(N[C],I,B+C*28)}G=n.videoEl&&n.videoEl.paused;p.font="24px sans-serif";p.textAlign="right";p.textBaseline="alphabetic";p.fillText(G?"\u25b6":"\u23f8",D-16,32)}}function y(){function D(){z();E=requestAnimationFrame(D)}E||D()}function x(){return typeof window!=="undefined"&&window.documentPictureInPicture&&typeof window.documentPictureInPicture.requestWindow===
"function"?window.documentPictureInPicture.requestWindow({width:420,height:260}).then(function(D){f=D;m=!0;var B=D.document,G=B.createElement("style");G.textContent='\n        * { box-sizing: border-box; margin: 0; padding: 0; }\n        body {\n          background: #141414;\n          color: #ffffff;\n          font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;\n          height: 100vh;\n          display: flex;\n          flex-direction: column;\n          justify-content: space-between;\n          padding: 16px;\n          user-select: none;\n          overflow: hidden;\n        }\n        .pip-lyric-container {\n          flex: 1;\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          text-align: center;\n          padding: 8px 12px;\n        }\n        .pip-lyric-text {\n          font-size: 22px;\n          font-weight: 700;\n          line-height: 1.4;\n          color: #ffffff;\n          text-shadow: 0 2px 8px rgba(0,0,0,0.6);\n          word-break: break-word;\n          transition: all 0.2s ease;\n        }\n        .pip-visualizer-canvas {\n          width: 100%;\n          height: 40px;\n          display: block;\n          margin-bottom: 8px;\n        }\n        .pip-controls {\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          gap: 16px;\n        }\n        .pip-btn {\n          background: rgba(255, 255, 255, 0.12);\n          border: none;\n          color: #ffffff;\n          border-radius: 50%;\n          width: 40px;\n          height: 40px;\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          cursor: pointer;\n          font-size: 18px;\n          transition: background 0.2s;\n        }\n        .pip-btn:hover {\n          background: rgba(255, 255, 255, 0.25);\n        }\n        .pip-btn:active {\n          transform: scale(0.95);\n        }\n      ';
B.head.appendChild(G);B.body.innerHTML=`
        <div class="pip-lyric-container">
          <div class="pip-lyric-text" id="pip-lyric"></div>
        </div>
        <canvas class="pip-visualizer-canvas" id="pip-canvas" width="400" height="40"></canvas>
        <div class="pip-controls">
          <button class="pip-btn" id="pip-prev" title="${K("musicPrevTrack","Previous Track")}">\u23ee</button>
          <button class="pip-btn" id="pip-play" title="${K("shortcutPlayPause","Play / Pause")}">\u23f8</button>
          <button class="pip-btn" id="pip-next" title="${K("musicNextTrack","Next Track")}">\u23ed</button>
        </div>
      `;var N=B.getElementById("pip-lyric"),I=B.getElementById("pip-play");G=B.getElementById("pip-prev");var C=B.getElementById("pip-next");(h=B.getElementById("pip-canvas"))&&(k=h.getContext("2d"));I.addEventListener("click",function(){n.videoEl&&(n.videoEl.paused?n.videoEl.play().catch(function(){}):n.videoEl.pause())});G.addEventListener("click",function(){n._queueCtrl&&typeof n._queueCtrl.prev==="function"&&n._queueCtrl.prev()});C.addEventListener("click",function(){n._queueCtrl&&typeof n._queueCtrl.next===
"function"&&n._queueCtrl.next()});c=setInterval(function(){if(f){var g=n._musicLyricCurrent?n._musicLyricCurrent:"";N&&N.textContent!==g&&(N.textContent=g);I&&n.videoEl&&(I.textContent=n.videoEl.paused?"\u25b6":"\u23f8");if(k&&h){g=h.width;var q=h.height;k.clearRect(0,0,g,q);Rc(k,g,q,n.audioAnalyser,u.get(),q)}}},100);D.addEventListener("pagehide",function(){r()})}):Promise.reject(Error("Document PiP not supported"))}function e(){t();if(!w||!w.requestPictureInPicture)return Promise.reject(Error("Canvas PiP unavailable"));
try{var D=w.requestPictureInPicture()}catch(B){return typeof console!=="undefined"&&console.warn("[Music PiP] requestPictureInPicture sync failed:",B),Promise.reject(B)}return D.then(function(){m=!0;y();w.addEventListener("leavepictureinpicture",function G(){w.removeEventListener("leavepictureinpicture",G);r()})})}function d(D){r();typeof console!=="undefined"&&console.warn("[Music PiP] All PiP modes failed:",D);n&&typeof n.toast==="function"&&n.toast(K("musicPipUnsupported","Picture-in-Picture lyrics are not supported by this browser"));
return Promise.reject(D)}function r(){m=!1;c&&(clearInterval(c),c=null);if(f){try{f.close()}catch(D){}f=null}k=h=null;E&&(cancelAnimationFrame(E),E=null);if(typeof document!=="undefined"&&document.pictureInPictureElement)try{document.exitPictureInPicture().catch(function(){})}catch(D){}}var n=a,m=!1,u=Qc(n.playerContainer),f=null,c=null,h=null,k=null,l=null,p=null,w=null,v=null,E=null;t();return{start:function(){return m?Promise.resolve():typeof window!=="undefined"&&window.documentPictureInPicture&&
typeof window.documentPictureInPicture.requestWindow==="function"?x().catch(function(D){typeof console!=="undefined"&&console.warn("[Music PiP] Document PiP failed, fallbacking to Canvas PiP:",D);return e()}).catch(d):e().catch(d)},stop:r,destroy:function(){r();if(v){try{v.getTracks().forEach(function(D){D.stop()})}catch(D){}v=null}if(w){try{w.pause(),w.srcObject=null,w.parentNode&&w.parentNode.removeChild(w)}catch(D){}w=null}if(l){try{l.parentNode&&l.parentNode.removeChild(l)}catch(D){}p=l=null}},
isPipping:function(){return m},updateAccent:function(D){u.set(D)}}}function He(a,t,z){function y(v){(Ib[v]||Ib.normal).gains.forEach(function(E,D){d[D]=E;k[D]&&(k[D].slider.value=E,k[D].valLabel.textContent=(E>0?"+"+E:E)+"dB");e[D]&&r&&e[D].gain.setTargetAtTime(E,r.currentTime,.01)})}function x(v){if(v&&!(e.length>0)){r=v;e=ic.map(function(E,D){var B=r.createBiquadFilter();D===0?B.type="lowshelf":D===ic.length-1?B.type="highshelf":(B.type="peaking",B.Q.value=1.4);B.frequency.value=E;B.gain.value=
d[D];return B});for(v=0;v<e.length-1;v++)e[v].connect(e[v+1]);n=e[0];m=e[e.length-1]}}var e=[],d=[0,0,0,0,0,0,0,0,0,0],r=null,n=null,m=null,u=null,f=null,c=document.createElement("div");c.className="zwp-music-eq-panel";z=document.createElement("div");z.className="zwp-music-eq-header";z.innerHTML='<span class="zwp-music-eq-title">\u4e13\u4e1a\u97f3\u6548 / 10 \u6bb5\u5747\u8861\u5668 (EQ)</span><div class="zwp-music-eq-actions"><select class="zwp-music-eq-preset">'+Object.keys(Ib).map(function(v){return'<option value="'+
v+'">'+Ib[v].name+"</option>"}).join("")+'</select><button class="zwp-music-eq-reset" title="\u91cd\u7f6e EQ">\u91cd\u7f6e</button></div>';var h=document.createElement("div");h.className="zwp-music-eq-body";var k=[];ic.forEach(function(v,E){var D=document.createElement("div");D.className="zwp-music-eq-col";var B=document.createElement("span");B.className="zwp-music-eq-val";B.textContent="0dB";var G=document.createElement("input");G.type="range";G.min="-12";G.max="12";G.step="1";G.value="0";G.className=
"zwp-music-eq-slider";G.setAttribute("orient","vertical");var N=document.createElement("span");N.className="zwp-music-eq-freq";N.textContent=v>=1E3?v/1E3+"k":v+"";G.addEventListener("input",function(){var I=parseInt(G.value,10);B.textContent=(I>0?"+"+I:I)+"dB";d[E]=I;e[E]&&e[E].gain.setTargetAtTime(I,r?r.currentTime:0,.01)});D.appendChild(B);D.appendChild(G);D.appendChild(N);h.appendChild(D);k.push({slider:G,valLabel:B})});c.appendChild(z);c.appendChild(h);t&&t.appendChild(c);var l=z.querySelector(".zwp-music-eq-preset");
l.addEventListener("change",function(){y(l.value)});z.querySelector(".zwp-music-eq-reset").addEventListener("click",function(){l.value="normal";y("normal")});var p=!1,w=null;return{initAudioNodes:x,attachToPlayer:function(v){if((v=v||a)&&v.videoEl)try{var E=Ub(v,{debug_log:!1});if(E){var D=E.ctx;x(D);D.state!=="suspended"||w||(w=function(){D.resume().catch(function(){});w&&(window.removeEventListener("click",w),window.removeEventListener("touchstart",w),window.removeEventListener("keydown",w),w=null)},
window.addEventListener("click",w),window.addEventListener("touchstart",w,{passive:!0}),window.addEventListener("keydown",w));if(!p&&n&&m){var B=v.audioVolumeNode||v.audioSource;E=!0;try{B.disconnect(v.audioGainNode)}catch(G){E=!1}if(E)try{B.connect(n),m.connect(v.audioGainNode),u=v,f=B}catch(G){try{B.connect(v.audioGainNode)}catch(N){}}p=!0}}}catch(G){}},getInputNode:function(){return n},getOutputNode:function(){return m},applyPreset:y,destroy:function(){w&&(window.removeEventListener("click",w),
window.removeEventListener("touchstart",w),window.removeEventListener("keydown",w),w=null);if(n)try{n.disconnect()}catch(v){}if(m)try{m.disconnect()}catch(v){}e.forEach(function(v){try{v.disconnect()}catch(E){}});e=[];if(f&&u&&u.audioGainNode)try{f.connect(u.audioGainNode)}catch(v){}r=m=n=f=null;p=!1;c&&c.parentNode&&c.parentNode.removeChild(c)}}}function Ie(a){if(!a||typeof a!=="object")return Object.assign({},Sc);var t=Object.assign({},Sc,a);t.vinyl=a.vinyl!==!1;t.mediaSession=a.mediaSession!==
!1;t.blurBackground=a.blurBackground!==!1;t.visualizer=a.visualizer===!1?!1:a.visualizer!==!0&&a.visualizer?{circular:1,bars:1,mirror:1,mountain:1,vintage:1,classic:1,ttplayer:1}[a.visualizer]?a.visualizer:"classic":"classic";t.visualizer==="ttplayer"&&(t.visualizer="vintage");t.theme==="ttplayer"&&(t.theme="vintage");t.panel!=="bar"&&(t.panel="full");t.title=typeof a.title==="string"?a.title:"";t.artist=typeof a.artist==="string"?a.artist:"";return t}function Tc(a,t,z){a=parseInt(a,10);t=parseInt(t,
10);var y=0;z&&(y=parseInt(z.length===2?z+"0":z,10)/1E3);return a*60+t+y}function jc(a){if(!a||typeof a!=="string")return[];var t=a.split(/\r?\n/);a=[];for(var z=0;z<t.length;z++){var y=t[z];if(!/^\[(ti|ar|al|by|offset|re|ve):/i.test(y.trim())){kc.lastIndex=0;for(var x=[],e;(e=kc.exec(y))!==null;)x.push(Tc(e[1],e[2],e[3]));if(x.length!==0&&(y=y.replace(kc,"").trim())){e=null;lc.lastIndex=0;if(lc.test(y)){e=[];lc.lastIndex=0;for(var d=/<(\d{1,2}):(\d{1,2})(?:[.:](\d{1,3}))?>([^<]*)/g,r;(r=d.exec(y))!==
null;)e.push({time:Tc(r[1],r[2],r[3]),text:r[4]});y=y.replace(/<[^>]+>/g,"")}for(d=0;d<x.length;d++)a.push({time:x[d],text:y,words:e?e.map(function(n){return{time:n.time,text:n.text}}):null})}}}a.sort(function(n,m){return n.time-m.time});t=[];for(z=0;z<a.length;z++)x=a[z],(y=t.length>0?t[t.length-1]:null)&&Math.abs(y.time-x.time)<.001?y.translation===void 0?y.translation=x.text:y.translation2=y.translation2===void 0?x.text:y.translation2+"\n"+x.text:t.push(x);return t}function Je(a){return new Promise(function(t){if(a&&
typeof Image!=="undefined"){var z=new Image;z.crossOrigin="anonymous";z.onload=function(){try{var y=document.createElement("canvas");y.width=16;y.height=16;var x=y.getContext("2d");x.drawImage(z,0,0,16,16);for(var e=x.getImageData(0,0,16,16).data,d=x=y=0,r=0,n=0;n<e.length;n+=4)e[n+3]<125||(y+=e[n],x+=e[n+1],d+=e[n+2],r++);if(r===0)t(null);else{y=Math.round(y/r);x=Math.round(x/r);d=Math.round(d/r);var m="#"+[y,x,d].map(function(u){return u.toString(16).padStart(2,"0")}).join("");t({hex:m,isDark:(.299*
y+.587*x+.114*d)/255<.5})}}catch(u){t(null)}};z.onerror=function(){t(null)};z.src=a}else t(null)})}function Ke(a,t){function z(){return D._config.poster?D._config.poster:""}function y(U){return typeof U!=="string"||!U||/["'()<>\\]/.test(U)||/^\s*(javascript|vbscript|file)\s*:/i.test(U)?!1:/^(https?:|blob:|data:image\/)/i.test(U)?!0:!/:/.test(U)||U.indexOf("/")===0}function x(U){var W=document.createElement("img");W.className="zwp-music-cover";W.alt="";W.style.display="block";W.src=U;return W}function e(U){return y(U)?
'url("'+U+'")':""}function d(U){if(U){if(J){try{J.destroy()}catch(W){}J=null}J=De(D,U,{shape:typeof B.visualizer==="string"?B.visualizer:"bars"});D._visualizerCtrl=J}}function r(){var U=document.createElement("div");U.className="zwp-music-bar";U.innerHTML='<div class="zwp-music-cover-wrap"></div><div class="zwp-music-info"><div class="zwp-music-title"></div><div class="zwp-music-artist"></div></div>';G.appendChild(U);q=U;var W=U.querySelector(".zwp-music-cover-wrap"),ca=z();if(ca&&y(ca)){W.innerHTML=
"";var la=x(ca);W.appendChild(la);B.vinyl&&la.classList.add("zwp-vinyl-spin");D.videoEl&&!D.videoEl.paused||la.classList.add("zwp-paused")}else W.innerHTML='<div class="zwp-music-cover-vinyl"><div class="zwp-music-vinyl-label"><div class="zwp-music-vinyl-hole"></div></div></div>',W=W.querySelector(".zwp-music-cover-vinyl"),B.vinyl&&W.classList.add("zwp-vinyl-spin"),D.videoEl&&!D.videoEl.paused||W.classList.add("zwp-paused");W=U.querySelector(".zwp-music-title");la=U.querySelector(".zwp-music-artist");
W&&(W.textContent=B.title||"");la&&(la.textContent=B.artist||"");B.visualizer&&(W=document.createElement("div"),W.className="zwp-music-visualizer",U.appendChild(W),d(W));f(ca);return U}function n(){var U=document.createElement("div"),W="";B.theme==="vintage"||B.theme==="ttplayer"?W=" zwp-theme-vintage":B.theme==="classic"&&(W=" zwp-theme-classic");U.className="zwp-music-full"+W;U.innerHTML='<div class="zwp-music-bg"></div><div class="zwp-music-full-body"><div class="zwp-music-vinyl-wrap"><div class="zwp-music-info"><div class="zwp-music-title"></div><div class="zwp-music-artist"></div><div class="zwp-music-toolbar"><button class="zwp-music-btn-eq" title="10\u6bb5\u5747\u8861\u5668 (EQ)">EQ</button><button class="zwp-music-btn-lrc-minus" title="\u6b4c\u8bcd\u5ef6\u540e 0.5s">-0.5s</button><span class="zwp-music-lrc-offset-val" title="\u5f53\u524d\u6b4c\u8bcd\u504f\u79fb">0.0s</span><button class="zwp-music-btn-lrc-plus" title="\u6b4c\u8bcd\u63d0\u524d 0.5s">+0.5s</button></div></div></div><div class="zwp-music-lyrics"></div></div>';
G.appendChild(U);A=U;M=U.querySelector(".zwp-music-lyrics");var ca=D.playerContainer||U;S=He(D,ca);var la=U.querySelector(".zwp-music-btn-eq");W=U.querySelector(".zwp-music-btn-lrc-minus");var na=U.querySelector(".zwp-music-btn-lrc-plus"),ba=U.querySelector(".zwp-music-lrc-offset-val");la&&la.addEventListener("click",function(){S&&S.attachToPlayer(D);var fa=ca.querySelector(".zwp-music-eq-panel");fa&&(fa.classList.toggle("zwp-eq-open"),la.classList.toggle("zwp-active",fa.classList.contains("zwp-eq-open")))});
W&&W.addEventListener("click",function(){H-=.5;ba&&(ba.textContent=(H>=0?"+":"")+H.toFixed(1)+"s")});na&&na.addEventListener("click",function(){H+=.5;ba&&(ba.textContent=(H>=0?"+":"")+H.toFixed(1)+"s")});B.visualizer&&(W=document.createElement("div"),W.className="zwp-music-visualizer",U.appendChild(W),d(W));na=U.querySelector(".zwp-music-vinyl-wrap");if(W=z()){var ha=document.createElement("img");ha.className="zwp-music-cover";ha.src=W;B.vinyl&&ha.classList.add("zwp-vinyl-spin");D.videoEl&&!D.videoEl.paused||
ha.classList.add("zwp-paused");na.insertBefore(ha,na.firstChild)}else ha=document.createElement("div"),ha.className="zwp-music-cover-vinyl",ha.innerHTML='<div class="zwp-music-vinyl-label"><div class="zwp-music-vinyl-hole"></div></div>',B.vinyl&&ha.classList.add("zwp-vinyl-spin"),D.videoEl&&!D.videoEl.paused||ha.classList.add("zwp-paused"),na.insertBefore(ha,na.firstChild);na=U.querySelector(".zwp-music-title");ha=U.querySelector(".zwp-music-artist");na&&(na.textContent=B.title||"");ha&&(ha.textContent=
B.artist||"");na=U.querySelector(".zwp-music-bg");W&&B.blurBackground&&y(W)?(na.style.backgroundImage=e(W),na.classList.remove("zwp-music-bg-default")):(na.style.backgroundImage="",na.classList.add("zwp-music-bg-default"));f(W);return U}function m(){if(!D._config.poster){var U=D.videoEl;if(U&&U.videoWidth&&typeof document!=="undefined")try{var W=document.createElement("canvas"),ca=U.videoWidth,la=U.videoHeight,na=240/Math.min(ca,la);W.width=Math.max(2,Math.round(ca*na));W.height=Math.max(2,Math.round(la*
na));W.getContext("2d").drawImage(U,0,0,W.width,W.height);var ba=W.toDataURL("image/jpeg",.72);!ba||ba.length<64||(D._config.poster=ba,u({poster:ba}))}catch(ha){}}}function u(U){U=U||{};if(U.title||U.name)B.title=U.title||U.name||"";U.artist!==void 0&&(B.artist=U.artist||"");D._config.poster=U.poster||"";U=z();if(A){var W=A.querySelector(".zwp-music-title"),ca=A.querySelector(".zwp-music-artist");W&&(W.textContent=B.title);ca&&(ca.textContent=B.artist);if(W=A.querySelector(".zwp-music-vinyl-wrap"))(ca=
W.querySelector(".zwp-music-cover, .zwp-music-cover-vinyl"))&&ca.parentNode.removeChild(ca),U?(ca=document.createElement("img"),ca.className="zwp-music-cover",ca.src=U,B.vinyl&&ca.classList.add("zwp-vinyl-spin"),D.videoEl&&!D.videoEl.paused||ca.classList.add("zwp-paused"),W.insertBefore(ca,W.firstChild)):(ca=document.createElement("div"),ca.className="zwp-music-cover-vinyl",ca.innerHTML='<div class="zwp-music-vinyl-label"><div class="zwp-music-vinyl-hole"></div></div>',B.vinyl&&ca.classList.add("zwp-vinyl-spin"),
D.videoEl&&!D.videoEl.paused||ca.classList.add("zwp-paused"),W.insertBefore(ca,W.firstChild));if(W=A.querySelector(".zwp-music-bg"))U&&B.blurBackground&&y(U)?(W.style.backgroundImage=e(U),W.classList.remove("zwp-music-bg-default")):(W.style.backgroundImage="",W.classList.add("zwp-music-bg-default"))}q&&(W=q.querySelector(".zwp-music-title"),ca=q.querySelector(".zwp-music-artist"),W&&(W.textContent=B.title),ca&&(ca.textContent=B.artist),W=q.querySelector(".zwp-music-cover-wrap"))&&(U&&y(U)?(W.innerHTML=
"",ca=x(U),W.appendChild(ca),B.vinyl&&ca.classList.add("zwp-vinyl-spin"),D.videoEl&&!D.videoEl.paused||ca.classList.add("zwp-paused")):(W.innerHTML='<div class="zwp-music-cover-vinyl"><div class="zwp-music-vinyl-label"><div class="zwp-music-vinyl-hole"></div></div></div>',W=W.querySelector(".zwp-music-cover-vinyl"),B.vinyl&&W.classList.add("zwp-vinyl-spin"),D.videoEl&&!D.videoEl.paused||W.classList.add("zwp-paused")));f(U)}function f(U){var W=function(ca,la){G.style.setProperty("--zwp-accent",ca);
la&&G.style.setProperty("--zwp-fg",la);J&&typeof J.updateAccent==="function"&&J.updateAccent(ca);b&&typeof b.updateAccent==="function"&&b.updateAccent(ca)};B.theme==="auto"&&U?Je(U).then(function(ca){!V&&ca&&W(ca.hex,ca.isDark?"#ffffff":"#000000")}):typeof B.theme==="string"&&B.theme[0]==="#"?W(B.theme):B.theme==="vintage"?W("#00e676","#ffffff"):B.theme==="classic"&&W("#f59e0b","#ffffff")}function c(){if(M){M.innerHTML="";I=[];for(var U=0;U<N.length;U++){var W=document.createElement("div");W.className=
"zwp-lyric-line";W.dataset.idx=U;if(N[U].words&&N[U].words.length>0)for(var ca=0;ca<N[U].words.length;ca++){var la=document.createElement("span");la.className="zwp-lyric-word";la.dataset.time=N[U].words[ca].time;la.textContent=N[U].words[ca].text;W.appendChild(la)}else W.textContent=N[U].text;N[U].translation&&(ca=document.createElement("div"),ca.className="zwp-lyric-translation",ca.textContent=N[U].translation,W.appendChild(ca));N[U].translation2&&(ca=document.createElement("div"),ca.className="zwp-lyric-translation zwp-lyric-translation2",
ca.textContent=N[U].translation2,W.appendChild(ca));(function(na){W.addEventListener("click",function(){if(D.videoEl){var ba=N[na].time;D.isEnded&&delete D.isEnded;D.videoEl.currentTime=ba;typeof D.seekTimeProgressByTime==="function"&&D.seekTimeProgressByTime(ba);D.videoEl.paused&&D.videoEl.play().catch(function(){})}})})(U);M.appendChild(W);I.push(W)}}}function h(){if(D.videoEl&&I.length!==0){for(var U=(D.videoEl.currentTime||0)+H,W=-1,ca=0;ca<N.length;ca++)if(U>=N[ca].time)W=ca;else break;if(W!==
C){if(C>=0&&I[C]){I[C].classList.remove("zwp-lyric-active");ca=I[C].querySelectorAll(".zwp-lyric-word-sung");for(var la=0;la<ca.length;la++)ca[la].classList.remove("zwp-lyric-word-sung")}C=W;if(W>=0&&I[W]){I[W].classList.add("zwp-lyric-active");try{typeof I[W].scrollIntoView==="function"&&I[W].scrollIntoView({behavior:"smooth",block:"center"})}catch(na){}}}if(W>=0&&I[W]&&N[W].words&&N[W].words.length>0)for(W=I[W].querySelectorAll(".zwp-lyric-word"),ca=0;ca<W.length;ca++)parseFloat(W[ca].dataset.time)<=
U?W[ca].classList.add("zwp-lyric-word-sung"):W[ca].classList.remove("zwp-lyric-word-sung")}if(D.videoEl&&N.length>0){U=D.videoEl.currentTime||0;W="";for(ca=0;ca<N.length;ca++)if(U>=N[ca].time)W=N[ca].text;else break;D._musicLyricCurrent=W}}function k(){if(!V&&P&&D.videoEl&&(D.videoEl.currentTime||0)>=P.b)try{D.videoEl.currentTime=P.a}catch(U){}}function l(U){U?Array.isArray(U)?(N=jc(U.join("\n")),c()):typeof U==="string"&&(/\[\d{1,2}:\d{1,2}/.test(U)?(N=jc(U),c()):fetch(U).then(function(W){return W.text()}).then(function(W){if(!V&&
(N=jc(W),c(),typeof D._config.onLyricsLoaded==="function"))D._config.onLyricsLoaded(N)}).catch(function(W){if(typeof D._config.onLyricsError==="function")D._config.onLyricsError(W)})):(N=[],c())}function p(){v(!1)}function w(){v(!0)}function v(U){for(var W=G.querySelectorAll(".zwp-vinyl-spin"),ca=0;ca<W.length;ca++)U?W[ca].classList.add("zwp-paused"):W[ca].classList.remove("zwp-paused")}function E(){m()}t=t||{};var D=a;a=t.debug_log;var B=Ie(D._config.music);D._config.music=B;var G=D.playerContainer,
N=[],I=[],C=-1,g=!1,q=null,A=null,M=null,J=null,T=null,b=null,S=null,H=0,V=!1,P=null;D.setMusicTrack=u;D.setABLoop=function(U,W){V||typeof U!=="number"||typeof W!=="number"||U>=W||W-U<.5||(P={a:U,b:W})};D.clearABLoop=function(){P=null};D.videoEl&&typeof D.videoEl.addEventListener==="function"&&D.videoEl.addEventListener("timeupdate",k);B.panel==="full"?n():(r(),M=document.createElement("div"),M.className="zwp-music-lyrics zwp-music-lyrics-hidden",G.appendChild(M));l(D._config.lyrics);D.setLyrics=
function(U){l(U)};D.videoEl&&typeof D.videoEl.addEventListener==="function"&&D.videoEl.addEventListener("timeupdate",h);D.videoEl&&typeof D.videoEl.addEventListener==="function"&&(D.videoEl.addEventListener("play",p),D.videoEl.addEventListener("pause",w));D.videoEl&&typeof D.videoEl.addEventListener==="function"&&(D.videoEl.addEventListener("loadeddata",E),D.videoEl.readyState>=2&&m());(function(){B.mediaSession&&typeof navigator!=="undefined"&&"mediaSession"in navigator&&(window.__zwp_music_active||
(window.__zwp_music_active=null),function(){if(window.__zwp_music_active&&window.__zwp_music_active!==D)try{navigator.mediaSession.setActionHandler("play",null)}catch(U){}window.__zwp_music_active=D;g=!0;typeof MediaMetadata!=="undefined"&&(navigator.mediaSession.metadata=new MediaMetadata({title:B.title||"",artist:B.artist||"",album:"",artwork:z()?[{src:z(),sizes:"512x512"}]:[]}));["play","pause","previoustrack","nexttrack"].forEach(function(U){try{navigator.mediaSession.setActionHandler(U,function(){U===
"play"&&D.resume&&D.resume();U==="pause"&&D.pause&&D.pause();U==="previoustrack"&&D.playPrevTrack&&D.playPrevTrack();U==="nexttrack"&&D.playNextTrack&&D.playNextTrack()})}catch(W){}})}())})();T=Fe(D,{cfg:B,debug_log:a});D._queueCtrl=T;b=Ge(D);D._musicPiP=b;a&&console.log("[Music] \u97f3\u4e50\u6a21\u5f0f\u5df2\u88c5\u914d\uff0cpanel="+B.panel);return{destroy:function(){V=!0;D.videoEl&&typeof D.videoEl.removeEventListener==="function"&&(D.videoEl.removeEventListener("timeupdate",h),D.videoEl.removeEventListener("timeupdate",
k),D.videoEl.removeEventListener("play",p),D.videoEl.removeEventListener("pause",w),D.videoEl.removeEventListener("loadeddata",E));P=null;if(g&&typeof navigator!=="undefined"&&"mediaSession"in navigator){window.__zwp_music_active===D&&(window.__zwp_music_active=null);try{["play","pause","previoustrack","nexttrack"].forEach(function(U){navigator.mediaSession.setActionHandler(U,null)})}catch(U){}}q&&q.parentNode&&q.parentNode.removeChild(q);A&&A.parentNode&&A.parentNode.removeChild(A);M=A=q=null;J&&
(J.destroy(),J=null);D._visualizerCtrl=null;if(S){try{S.destroy()}catch(U){}S=null}T&&(T.destroy(),T=null);D._queueCtrl=null;b&&(b.destroy(),b=null);D._musicPiP=null;D._musicLyricCurrent=null;N=[];I=[]}}}function mc(a){return typeof a==="string"&&Le[a]?a:"standard"}function Uc(a,t){t=t||{};t=t.explicitKeys||new Set;var z=mc(a.mode),y=z==="preview"?Vc:z==="music"?Wc:null;if(y)for(var x=Object.keys(y),e=0;e<x.length;e++){var d=x[e];z!=="music"&&t.has(d)||(a[d]=y[d])}}function Me(a,t,z){if(t=t==="preview"?
Vc:t==="music"?Wc:null){t=Object.keys(t);for(var y=0;y<t.length;y++){var x=t[y];z&&Object.prototype.hasOwnProperty.call(z,x)?a[x]=z[x]:delete a[x]}}}function Ne(a,t){t=t||{};var z=t.debug_log;t=t.parOptions||{};a._debug_log=z;t=new Set(Object.keys(t));a._explicitKeys=t;var y=a._config.mode;if(!t.has("mode")){var x=String(a._config.mediaKind||"").toLowerCase();if(a._config.isAudio||x==="audio"||x.indexOf("audio/")===0||x!=="video"&&typeof a.inferMediaKind==="function"&&a.inferMediaKind(a._config.url)===
"audio")y="music"}y=mc(y);a._config.mode=y;Uc(a._config,{explicitKeys:t});a._mode=y;Xc(a,y);a.playerContainer&&a.playerContainer.classList.add("zwp-mode-"+y);z&&console.log("[Mode] \u5f53\u524d\u64ad\u653e\u6a21\u5f0f:",y);if(y==="auto"){let r=function(){!e&&d&&(a._mode!=="auto"?d.removeEventListener("loadedmetadata",r):(e=!0,d.removeEventListener("loadedmetadata",r),(a.playerContainer&&a.playerContainer.dataset.zwpContext)==="card"?Jb(a,"preview",{auto:!0}):d.videoWidth===0&&d.videoHeight===0?Jb(a,
"music",{auto:!0}):Jb(a,"standard",{auto:!0})))};var e=!1,d=a.videoEl;d&&typeof d.addEventListener==="function"&&d.addEventListener("loadedmetadata",r);d&&d.readyState>=1&&r()}}function Jb(a,t,z){t=mc(t);var y=a._mode||"standard";z&&z.auto||(a._userModeOverride=!0);if(typeof a._config.onModeChange==="function"&&a._config.onModeChange(y,t)===!1)return!1;if(t===y)return!0;z=0;var x=!1;try{a.videoEl&&(z=a.videoEl.currentTime||0,x=!!a.isPlaying)}catch(n){}Oe(a,y);var e=a.playerContainer;if(e)for(var d=
e.className.split(/\s+/).filter(function(n){return n.indexOf("zwp-mode-")===0}),r=0;r<d.length;r++)e.classList.remove(d[r]);Me(a._config,y,a._defaults);a._config.mode=t;a._mode=t;Uc(a._config,{explicitKeys:a._explicitKeys||new Set});e&&e.classList.add("zwp-mode-"+t);t==="music"&&a.playerElm&&a._config.fluid&&(typeof a.playerElm.classList.add==="function"&&a.playerElm.classList.add("zwp-fluid"),a.playerElm.style.height="0",y=typeof a.getFluidRatio==="function"?a.getFluidRatio(a._config):56.25,a.playerElm.style.paddingTop=
y+"%");if(typeof a.refreshControlbar==="function")try{a.refreshControlbar()}catch(n){}if(a.playlistState&&a.playlistState.data&&typeof a._ensurePlaylistButton==="function")try{a._ensurePlaylistButton()}catch(n){}Xc(a,t);try{a.videoEl&&z&&(a.videoEl.currentTime=z),x&&typeof a.resume==="function"&&a.resume()}catch(n){}return!0}function Xc(a,t){t==="preview"&&(a._previewController=Ce(a,{debug_log:a._debug_log}));t==="music"&&(a._musicController=Ke(a,{debug_log:a._debug_log}))}function Oe(a,t){t==="preview"&&
a._previewController&&(a._previewController.destroy(),a._previewController=null);t==="music"&&a._musicController&&(a._musicController.destroy(),a._musicController=null)}function Pe(a){if(typeof a!=="number"||a<=0)return"";a/=1E3;return a>=1E3?(a/1E3).toFixed(1).replace(/\.0$/,"")+" M":Math.round(a)+" K"}function Za(a,t,z){if(a){a._zwpFadeTimer&&(clearInterval(a._zwpFadeTimer),a._zwpFadeTimer=null);var y=parseInt(a.style.opacity);isNaN(y)&&(y=1);y*=100;t=parseInt(t/50);if(isNaN(t)||t===0)t=1;var x=
y/t;if(isNaN(x)||x<5)x=5;var e=setInterval(function(){y>0?(y-=x,y<0&&(y=0),a.style.opacity=y/100):(clearInterval(e),a._zwpFadeTimer=null,typeof z=="function"&&z(a))},50);return a._zwpFadeTimer=e}return null}function Yc(a,t,z){if(a){a._zwpFadeTimer&&(clearInterval(a._zwpFadeTimer),a._zwpFadeTimer=null);var y=parseFloat(a.style.opacity);isNaN(y)&&(y=0);y*=100;t=parseInt(t/50);if(isNaN(t)||t===0)t=1;var x=(100-y)/t;if(isNaN(x)||x<5)x=5;var e=null;e=setInterval(function(){y<100?(y+=x,y>100&&(y=100),a.style.opacity=
y/100):(clearInterval(e),a._zwpFadeTimer=null,typeof z=="function"&&z(a))},50);return a._zwpFadeTimer=e}return null}function gb(a,t,z,y){var x=new XMLHttpRequest;x.onreadystatechange=function(){x.readyState===4&&(x.status>=200&&x.status<300||x.status===304?typeof t==="function"&&t(x.response):typeof z==="function"&&z(x))};x.open("GET",a,!0);y&&(x.responseType=y);x.send(null)}function nc(a){if((a=a._config.thumbnails)&&a.url){var t=a.url;if(t.indexOf("http://")!==0&&t.indexOf("https://")!==0&&t.indexOf("//")!==
0){var z=a._jsonUrl||"";if(z){var y=z.lastIndexOf("/");y>=0&&(a.url=z.substring(0,y+1)+t)}}delete a._jsonUrl}}async function Qe(a){navigator.clipboard&&navigator.clipboard.write([new ClipboardItem({[a.type]:a})]).then(()=>{}).catch(t=>{})}function Re(){var a=new Date,t=a.getMonth()+1;t<10&&(t="0"+t);var z=a.getDate();z<10&&(z="0"+z);var y=a.getHours();y<10&&(y="0"+y);var x=a.getMinutes();x<10&&(x="0"+x);var e=a.getSeconds();e<10&&(e="0"+e);var d=a.getMilliseconds();d<10?d="00"+d:d<100&&(d="0"+d);
return""+a.getFullYear()+t+z+y+x+e+d}function Zc(a){return!(!a.width()&&!a.height())&&a.css("display")!=="none"}function Se(a,t){var z="smilesFaces-view",y=Va.path+"widgets/smiles/p",x=Da(a);if(!x.hasClass("disabled")){z=x.attr("data-viewid");if(!x.attr("data-viewinit")&&Da("#"+z).length<=0){var e=x.closest(".zwp-barrage_form");a='<div id="'+z+'" style="position:absolute;display:none;z-index:1138;" class="zwp-smileview"><table border="0" cellspacing="0" cellpadding="0"><tr>';for(var d=1;d<=40;d++){var r=
"[sm-"+d+"]";a+='<td><img src="'+y+d+'.png" onclick="insertSmile(this,\''+r+"');\" /></td>";d%8==0&&(a+="</tr><tr>")}e.append(a+"</tr></table></div>");x.attr("data-viewinit","1");Da(document).click(function(){Da("#"+z).hide()});Da(window).on("resize",function(){var u=Da("#"+z);if(Zc(u)){var f=x.offset();f.top-u.outerHeight(!1);f.left+x.outerWidth(!1)/2-u.outerWidth(!1)+39}})}var n=Da("#"+z);if(Zc(n))n.hide();else{y=x.offset();n[0].style.opacity=0;n[0].style.display="block";y.top-n.outerHeight(!1);
y.left+x.outerWidth(!1)/2-n.outerWidth(!1)+40;y=x.parent().children("DIV.zwp-barrage_inp").children(".barrage_inp_text");n.get(0).inputbox=y.get(0);n.css({bottom:"36px",right:"26px"}).show();var m=function(){var u=parseFloat(n[0].style.opacity);u<=1&&(u+=.1,u>1&&(u=1),n[0].style.opacity=u,setTimeout(m,50))};setTimeout(m,50)}if(t=t||window.event)t.preventDefault?(t.preventDefault(),t.stopPropagation()):(window.event.cancelBubble=!0,window.event.returnValue=!1)}}function Qa(a){if(a===null||a===void 0)return"";
a=String(a);a.indexOf("&")!=-1&&(a=a.replace(/&/g,"&amp;"));a.indexOf("<")!=-1&&(a=a.replace(/</g,"&lt;"));a.indexOf(">")!=-1&&(a=a.replace(/>/g,"&gt;"));a.indexOf('"')!=-1&&(a=a.replace(/"/g,"&quot;"));a.indexOf("'")!=-1&&(a=a.replace(/'/g,"&#039;"));return a}function $c(a){a=a.getBoundingClientRect();return{top:a.top+(window.pageYOffset||document.documentElement.scrollTop),left:a.left+(window.pageXOffset||document.documentElement.scrollLeft)}}function Te(){return window.MediaSource&&window.MediaSource.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"')}
function ad(a,t){if(document.createEvent){let z=document.createEvent("HTMLEvents");z.initEvent(t,!0,!1);a.dispatchEvent(z)}else document.createEventObject&&a.fireEvent(t)}function pb(){var a=navigator.userAgent||navigator.vendor||window.opera||"";return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini|CriOS|FxiOS|EdgiOS|Mobile/i.test(a)||/Macintosh/i.test(a)&&(navigator.maxTouchPoints>0||"ontouchstart"in window)?!0:!1}var oc=typeof document!=="undefined"?document.currentScript:null,Da=
function(a){var t=function(){function z(F){return F==null?String(F):ba[ha.call(F)]||"object"}function y(F){return z(F)=="function"}function x(F){return F!=null&&F==F.window}function e(F){return z(F)=="object"}function d(F){return e(F)&&!x(F)&&Object.getPrototypeOf(F)==Object.prototype}function r(F){var R=!!F&&"length"in F&&F.length,X=Q.type(F);return"function"!=X&&!x(F)&&("array"==X||R===0||typeof R=="number"&&R>0&&R-1 in F)}function n(F){return C.call(F,function(R){return R!=null})}function m(F){return F.replace(/::/g,
"/").replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2").replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/_/g,"-").toLowerCase()}function u(F){return F in M?M[F]:M[F]=new RegExp("(^|\\s)"+F+"(\\s|$)")}function f(F,R){return typeof R!="number"||J[m(F)]?R:R+"px"}function c(F){return"children"in F?g.call(F.children):Q.map(F.childNodes,function(R){if(R.nodeType==1)return R})}function h(F,R){var X,aa=F?F.length:0;for(X=0;X<aa;X++)this[X]=F[X];this.length=aa;this.selector=R||""}function k(F,R,X){for(B in R)X&&(d(R[B])||
Ca(R[B]))?(d(R[B])&&!d(F[B])&&(F[B]={}),Ca(R[B])&&!Ca(F[B])&&(F[B]=[]),k(F[B],R[B],X)):R[B]!==D&&(F[B]=R[B])}function l(F,R){return R==null?Q(F):Q(F).filter(R)}function p(F,R,X,aa){return y(R)?R.call(F,X,aa):R}function w(F,R){var X=F.className||"",aa=X&&X.baseVal!==D;if(R===D)return aa?X.baseVal:X;aa?X.baseVal=R:F.className=R}function v(F){try{return F?F=="true"||(F=="false"?!1:F=="null"?null:+F+""==F?+F:/^[\[\{]/.test(F)?Q.parseJSON(F):F):F}catch(R){return F}}function E(F,R){R(F);for(var X=0,aa=
F.childNodes.length;X<aa;X++)E(F.childNodes[X],R)}var D,B,G,N=[],I=N.concat,C=N.filter,g=N.slice,q=a.document,A={},M={},J={"column-count":1,columns:1,"font-weight":1,"line-height":1,opacity:1,"z-index":1,zoom:1},T=/^\s*<(\w+|!)[^>]*>/,b=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,S=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,H=/^(?:body|html)$/i,V=/([A-Z])/g,P="val css html text data width height offset".split(" "),U=q.createElement("table"),W=q.createElement("tr"),ca={tr:q.createElement("tbody"),
tbody:U,thead:U,tfoot:U,td:W,th:W,"*":q.createElement("div")},la=/complete|loaded|interactive/,na=/^[\w-]*$/,ba={},ha=ba.toString,fa={},Ga=q.createElement("div"),Ba={tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},Ca=Array.isArray||function(F){return F instanceof Array};fa.matches=function(F,
R){if(!R||!F||F.nodeType!==1)return!1;var X=F.matches||F.webkitMatchesSelector||F.mozMatchesSelector||F.oMatchesSelector||F.matchesSelector;if(X)return X.call(F,R);var aa=F.parentNode;(X=!aa)&&(aa=Ga).appendChild(F);R=~fa.qsa(aa,R).indexOf(F);X&&Ga.removeChild(F);return R};var Ha=function(F){return F.replace(/-+(.)?/g,function(R,X){return X?X.toUpperCase():""})};var O=function(F){return C.call(F,function(R,X){return F.indexOf(R)==X})};fa.fragment=function(F,R,X){var aa;b.test(F)&&(aa=Q(q.createElement(RegExp.$1)));
if(!aa){F.replace&&(F=F.replace(S,"<$1></$2>"));R===D&&(R=T.test(F)&&RegExp.$1);R in ca||(R="*");var oa=ca[R];oa.innerHTML=""+F;aa=Q.each(g.call(oa.childNodes),function(){oa.removeChild(this)})}if(d(X)){var ta=Q(aa);Q.each(X,function(va,Z){if(P.indexOf(va)>-1)ta[va](Z);else ta.attr(va,Z)})}return aa};fa.Z=function(F,R){return new h(F,R)};fa.isZ=function(F){return F instanceof fa.Z};fa.init=function(F,R){if(F)if(typeof F=="string")if(F=F.trim(),F[0]=="<"&&T.test(F))R=fa.fragment(F,RegExp.$1,R),F=null;
else{if(R!==D)return Q(R).find(F);R=fa.qsa(q,F)}else{if(y(F))return Q(q).ready(F);if(fa.isZ(F))return F;if(Ca(F))R=n(F);else if(e(F))R=[F],F=null;else if(T.test(F))R=fa.fragment(F.trim(),RegExp.$1,R),F=null;else{if(R!==D)return Q(R).find(F);R=fa.qsa(q,F)}}else return fa.Z();return fa.Z(R,F)};var Q=function(F,R){return fa.init(F,R)};Q.extend=function(F){var R=g.call(arguments,1);if(typeof F=="boolean"){var X=F;F=R.shift()}R.forEach(function(aa){k(F,aa,X)});return F};fa.qsa=function(F,R){var X,aa=R[0]==
"#",oa=!aa&&R[0]==".",ta=aa||oa?R.slice(1):R,va=na.test(ta);return F.getElementById&&va&&aa?(X=F.getElementById(ta))?[X]:[]:F.nodeType!==1&&F.nodeType!==9&&F.nodeType!==11?[]:g.call(va&&!aa&&F.getElementsByClassName?oa?F.getElementsByClassName(ta):F.getElementsByTagName(R):F.querySelectorAll(R))};Q.contains=q.documentElement.contains?function(F,R){return F!==R&&F.contains(R)}:function(F,R){for(;R&&=R.parentNode;)if(R===F)return!0;return!1};Q.type=z;Q.isFunction=y;Q.isWindow=x;Q.isArray=Ca;Q.isPlainObject=
d;Q.isEmptyObject=function(F){for(var R in F)return!1;return!0};Q.isNumeric=function(F){var R=Number(F),X=typeof F;return F!=null&&X!="boolean"&&(X!="string"||F.length)&&!isNaN(R)&&isFinite(R)||!1};Q.inArray=function(F,R,X){return N.indexOf.call(R,F,X)};Q.camelCase=Ha;Q.trim=function(F){return F==null?"":String.prototype.trim.call(F)};Q.uuid=0;Q.support={};Q.expr={};Q.noop=function(){};Q.map=function(F,R){var X=[],aa;if(r(F))for(aa=0;aa<F.length;aa++){var oa=R(F[aa],aa);oa!=null&&X.push(oa)}else for(aa in F)oa=
R(F[aa],aa),oa!=null&&X.push(oa);return X.length>0?Q.fn.concat.apply([],X):X};Q.each=function(F,R){var X;if(r(F))for(X=0;X<F.length&&R.call(F[X],X,F[X])!==!1;X++);else for(X in F)if(R.call(F[X],X,F[X])===!1)break;return F};Q.grep=function(F,R){return C.call(F,R)};a.JSON&&(Q.parseJSON=JSON.parse);Q.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(F,R){ba["[object "+R+"]"]=R.toLowerCase()});Q.data=function(F,R,X){if(X===D)return typeof F[R]!=="undefined"?F[R]:
D;X===null?delete F[R]:F[R]=X};Q.fn={jquery:"1.2.0",constructor:fa.Z,length:0,forEach:N.forEach,reduce:N.reduce,push:N.push,sort:N.sort,splice:N.splice,indexOf:N.indexOf,concat:function(){var F,R=[];for(F=0;F<arguments.length;F++){var X=arguments[F];R[F]=fa.isZ(X)?X.toArray():X}return I.apply(fa.isZ(this)?this.toArray():this,R)},map:function(F){return Q(Q.map(this,function(R,X){return F.call(R,X,R)}))},slice:function(){return Q(g.apply(this,arguments))},ready:function(F){la.test(q.readyState)&&q.body?
F(Q):q.addEventListener("DOMContentLoaded",function(){F(Q)},!1);return this},get:function(F){return F===D?g.call(this):this[F>=0?F:F+this.length]},toArray:function(){return this.get()},size:function(){return this.length},remove:function(){return this.each(function(){this.parentNode!=null&&this.parentNode.removeChild(this)})},each:function(F){N.every.call(this,function(R,X){return F.call(R,X,R)!==!1});return this},filter:function(F){return y(F)?this.not(this.not(F)):Q(C.call(this,function(R){return fa.matches(R,
F)}))},add:function(F,R){return Q(O(this.concat(Q(F,R))))},is:function(F){return F===":visible"?this.length>0?this.css("display")!=="none":!1:e(F)?this[0]===F?!0:!1:this.length>0&&fa.matches(this[0],F)},not:function(F){var R=[];if(y(F)&&F.call!==D)this.each(function(aa){F.call(this,aa)||R.push(this)});else{var X=typeof F=="string"?this.filter(F):r(F)&&y(F.item)?g.call(F):Q(F);this.forEach(function(aa){X.indexOf(aa)<0&&R.push(aa)})}return Q(R)},has:function(F){return this.filter(function(){return e(F)?
Q.contains(this,F):Q(this).find(F).size()})},eq:function(F){return F===-1?this.slice(F):this.slice(F,+F+1)},first:function(){var F=this[0];return F&&!e(F)?F:Q(F)},last:function(){var F=this[this.length-1];return F&&!e(F)?F:Q(F)},find:function(F){var R=this;return F?typeof F=="object"?Q(F).filter(function(){var X=this;return N.some.call(R,function(aa){return Q.contains(aa,X)})}):this.length==1?Q(fa.qsa(this[0],F)):this.map(function(){return fa.qsa(this,F)}):Q()},closest:function(F,R){var X=[],aa=typeof F==
"object"&&Q(F);this.each(function(oa,ta){for(;ta&&!(aa?aa.indexOf(ta)>=0:fa.matches(ta,F));)ta=ta!==R&&!(ta!=null&&ta.nodeType==ta.DOCUMENT_NODE)&&ta.parentNode;ta&&X.indexOf(ta)<0&&X.push(ta)});return Q(X)},parents:function(F){for(var R=[],X=this;X.length>0;)X=Q.map(X,function(aa){if((aa=aa.parentNode)&&(aa==null||aa.nodeType!=aa.DOCUMENT_NODE)&&R.indexOf(aa)<0)return R.push(aa),aa});return l(R,F)},parent:function(F){return l(O(this.pluck("parentNode")),F)},children:function(F){return l(this.map(function(){return c(this)}),
F)},contents:function(){return this.map(function(){return this.contentDocument||g.call(this.childNodes)})},siblings:function(F){return l(this.map(function(R,X){return C.call(c(X.parentNode),function(aa){return aa!==X})}),F)},empty:function(){return this.each(function(){this.innerHTML=""})},pluck:function(F){return Q.map(this,function(R){return R[F]})},show:function(){return this.each(function(){this.style.display=="none"&&(this.style.display="");if(getComputedStyle(this,"").getPropertyValue("display")==
"none"){var F=this.style,R=this.nodeName;if(!A[R]){var X=q.createElement(R);q.body.appendChild(X);var aa=getComputedStyle(X,"").getPropertyValue("display");X.parentNode.removeChild(X);aa=="none"&&(aa="block");A[R]=aa}F.display=A[R]}})},replaceWith:function(F){return this.before(F).remove()},wrap:function(F){var R=y(F);if(this[0]&&!R)var X=Q(F).get(0),aa=X.parentNode||this.length>1;return this.each(function(oa){Q(this).wrapAll(R?F.call(this,oa):aa?X.cloneNode(!0):X)})},wrapAll:function(F){if(this[0]){Q(this[0]).before(F=
Q(F));for(var R;(R=F.children()).length;)F=R.first();Q(F).append(this)}return this},wrapInner:function(F){var R=y(F);return this.each(function(X){var aa=Q(this),oa=aa.contents();X=R?F.call(this,X):F;oa.length?oa.wrapAll(X):aa.append(X)})},unwrap:function(){this.parent().each(function(){Q(this).replaceWith(Q(this).children())});return this},clone:function(){return this.map(function(){return this.cloneNode(!0)})},hide:function(){return this.css("display","none")},toggle:function(F){return this.each(function(){var R=
Q(this);(F===D?R.css("display")=="none":F)?R.show():R.hide()})},prev:function(F){return Q(this.pluck("previousElementSibling")).filter(F||"*")},next:function(F){return Q(this.pluck("nextElementSibling")).filter(F||"*")},html:function(F){return 0 in arguments?this.each(function(R){var X=this.innerHTML;Q(this).empty().append(p(this,F,R,X))}):0 in this?this[0].innerHTML:null},text:function(F){return 0 in arguments?this.each(function(R){R=p(this,F,R,this.textContent);this.textContent=R==null?"":""+R}):
0 in this?this.pluck("textContent").join(""):null},attr:function(F,R){var X;return typeof F!="string"||1 in arguments?this.each(function(aa){if(this.nodeType===1)if(e(F))for(B in F){var oa=B;aa=F[B];aa==null?this.removeAttribute(oa):this.setAttribute(oa,aa)}else oa=F,aa=p(this,R,aa,this.getAttribute(F)),aa==null?this.removeAttribute(oa):this.setAttribute(oa,aa)}):0 in this&&this[0].nodeType==1&&(X=this[0].getAttribute(F))!=null?X:D},removeAttr:function(F){return this.each(function(){this.nodeType===
1&&F.split(" ").forEach(function(R){this.removeAttribute(R)},this)})},prop:function(F,R){F=Ba[F]||F;return 1 in arguments?this.each(function(X){this[F]=p(this,R,X,this[F])}):this[0]&&this[0][F]},removeProp:function(F){F=Ba[F]||F;return this.each(function(){delete this[F]})},data:function(F,R){if(typeof R==="object")this.length&&(this[0][F]=R);else{if(typeof R==="undefined"){if(this.length&&typeof this[0][F]!=="undefined")return this[0][F]}else this.length&&(typeof this[0][F]!=="undefined"&&delete this[0][F],
R&&(this[0][F]=R));var X="data-"+F.replace(V,"-$1").toLowerCase();X=1 in arguments?this.attr(X,R):this.attr(X);return X!==null?v(X):D}},val:function(F){return 0 in arguments?(F==null&&(F=""),this.each(function(R){this.value=p(this,F,R,this.value)})):this[0]&&(this[0].multiple?Q(this[0]).find("option").filter(function(){return this.selected}).pluck("value"):this[0].value)},offset:function(F){if(F)return this.each(function(X){var aa=Q(this);X=p(this,F,X,aa.offset());var oa=aa.offsetParent().offset();
X={top:X.top-oa.top,left:X.left-oa.left};aa.css("position")=="static"&&(X.position="relative");aa.css(X)});if(!this.length)return null;if(q.documentElement!==this[0]&&!Q.contains(q.documentElement,this[0]))return{top:0,left:0};var R=this[0].getBoundingClientRect();return{left:R.left+a.pageXOffset,top:R.top+a.pageYOffset,width:Math.round(R.width),height:Math.round(R.height)}},css:function(F,R){if(arguments.length<2){var X=this[0];if(typeof F=="string")return X?X.style[Ha(F)]||getComputedStyle(X,"").getPropertyValue(F):
void 0;if(Ca(F)){if(!X)return;var aa={},oa=getComputedStyle(X,"");Q.each(F,function(va,Z){aa[Z]=X.style[Ha(Z)]||oa.getPropertyValue(Z)});return aa}}var ta="";if(z(F)=="string")R||R===0?ta=m(F)+":"+f(F,R):this.each(function(){this.style.removeProperty(m(F))});else for(B in F)F[B]||F[B]===0?ta+=m(B)+":"+f(B,F[B])+";":this.each(function(){this.style.removeProperty(m(B))});return this.each(function(){this.style.cssText+=";"+ta})},index:function(F){return F?this.indexOf(Q(F)[0]):this.parent().children().indexOf(this[0])},
hasClass:function(F){return F?N.some.call(this,function(R){return this.test(w(R))},u(F)):!1},addClass:function(F){return F?this.each(function(R){if("className"in this){G=[];var X=w(this);p(this,F,R,X).split(/\s+/g).forEach(function(aa){Q(this).hasClass(aa)||G.push(aa)},this);G.length&&w(this,X+(X?" ":"")+G.join(" "))}}):this},removeClass:function(F){return this.each(function(R){if("className"in this){if(F===D)return w(this,"");G=w(this);p(this,F,R,G).split(/\s+/g).forEach(function(X){G=G.replace(u(X),
" ")});w(this,G.trim())}})},toggleClass:function(F,R){return F?this.each(function(X){var aa=Q(this);p(this,F,X,w(this)).split(/\s+/g).forEach(function(oa){(R===D?!aa.hasClass(oa):R)?aa.addClass(oa):aa.removeClass(oa)})}):this},scrollTop:function(F){if(this.length){var R="scrollTop"in this[0];return F===D?R?this[0].scrollTop:this[0].pageYOffset:this.each(R?function(){this.scrollTop=F}:function(){this.scrollTo(this.scrollX,F)})}},scrollLeft:function(F){if(this.length){var R="scrollLeft"in this[0];return F===
D?R?this[0].scrollLeft:this[0].pageXOffset:this.each(R?function(){this.scrollLeft=F}:function(){this.scrollTo(F,this.scrollY)})}},position:function(){if(this.length){var F=this[0],R=this.offsetParent(),X=this.offset(),aa=H.test(R[0].nodeName)?{top:0,left:0}:R.offset();X.top-=parseFloat(Q(F).css("margin-top"))||0;X.left-=parseFloat(Q(F).css("margin-left"))||0;aa.top+=parseFloat(Q(R[0]).css("border-top-width"))||0;aa.left+=parseFloat(Q(R[0]).css("border-left-width"))||0;return{top:X.top-aa.top,left:X.left-
aa.left}}},offsetParent:function(){return this.map(function(){for(var F=this.offsetParent||q.body;F&&!H.test(F.nodeName)&&Q(F).css("position")=="static";)F=F.offsetParent;return F})}};Q.fn.detach=Q.fn.remove;["width","height"].forEach(function(F){var R=F.replace(/./,function(X){return X[0].toUpperCase()});Q.fn[F]=function(X){var aa,oa=this[0];return X===D?x(oa)?oa["inner"+R]:oa!=null&&oa.nodeType==oa.DOCUMENT_NODE?oa.documentElement["scroll"+R]:(aa=this.offset())&&aa[F]:this.each(function(ta){oa=
Q(this);oa.css(F,p(this,X,ta,oa[F]()))})}});Q.fn.innerWidth=function(){return this.width()};Q.fn.innerHeight=function(){return this.height()};["after","prepend","before","append"].forEach(function(F,R){var X=R%2;Q.fn[F]=function(){var aa,oa=Q.map(arguments,function(Z){var da=[];aa=z(Z);return aa=="array"?(Z.forEach(function(ia){if(ia.nodeType!==D)return da.push(ia);if(Q.zepto.isZ(ia))return da=da.concat(ia.get());da=da.concat(fa.fragment(ia))}),da):aa=="object"||Z==null?Z:fa.fragment(Z)}),ta,va=this.length>
1;return oa.length<1?this:this.each(function(Z,da){ta=X?da:da.parentNode;da=R==0?da.nextSibling:R==1?da.firstChild:R==2?da:null;var ia=Q.contains(q.documentElement,ta);oa.forEach(function(pa){if(va)pa=pa.cloneNode(!0);else if(!ta)return Q(pa).remove();ta.insertBefore(pa,da);ia&&E(pa,function(sa){if(!(sa.nodeName==null||sa.nodeName.toUpperCase()!=="SCRIPT"||sa.type&&sa.type!=="text/javascript"||sa.src)){var wa=sa.ownerDocument?sa.ownerDocument.defaultView:a;wa.eval.call(wa,sa.innerHTML)}})})})};Q.fn[X?
F+"To":"insert"+(R?"Before":"After")]=function(aa){Q(aa)[F](this);return this}});fa.Z.prototype=h.prototype=Q.fn;fa.uniq=O;fa.deserializeValue=v;Q.zepto=fa;return Q}();(function(z){function y(C){return C._zid||(C._zid=f++)}function x(C,g,q,A){g=e(g);if(g.ns)var M=new RegExp("(?:^| )"+g.ns.replace(" "," .* ?")+"(?: |$)");return(p[y(C)]||[]).filter(function(J){return J&&(!g.e||J.e==g.e)&&(!g.ns||M.test(J.ns))&&(!q||y(J.fn)===y(q))&&(!A||J.sel==A)})}function e(C){C=(""+C).split(".");return{e:C[0],ns:C.slice(1).sort().join(" ")}}
function d(C){return D[C]||v&&E[C]||C}function r(C,g,q,A,M,J,T){var b=y(C),S=p[b]||(p[b]=[]);g.split(/\s/).forEach(function(H){if(H=="ready")return z(document).ready(q);var V=e(H);V.fn=q;V.sel=M;V.e in D&&(q=function(U){var W=U.relatedTarget;if(!W||W!==this&&!z.contains(this,W))return V.fn.apply(this,arguments)});var P=(V.del=J)||q;V.proxy=function(U){U=m(U);if(!U.isImmediatePropagationStopped()){U.data=A;var W=P.apply(C,U._args==c?[U]:[U].concat(U._args));W===!1&&(U.preventDefault(),U.stopPropagation());
return W}};V.i=S.length;S.push(V);"addEventListener"in C&&C.addEventListener(d(V.e),V.proxy,V.del&&!v&&V.e in E||!!T)})}function n(C,g,q,A,M){var J=y(C);(g||"").split(/\s/).forEach(function(T){x(C,T,q,A).forEach(function(b){delete p[J][b.i];"removeEventListener"in C&&C.removeEventListener(d(b.e),b.proxy,b.del&&!v&&b.e in E||!!M)})})}function m(C,g){if(g||!C.isDefaultPrevented)if(g||=C,z.each(I,function(q,A){var M=g[q];C[q]=function(){this[A]=B;return M&&M.apply(g,arguments)};C[A]=G}),C.timeStamp||
(C.timeStamp=Date.now()),g.defaultPrevented!==c?g.defaultPrevented:"returnValue"in g?g.returnValue===!1:g.getPreventDefault&&g.getPreventDefault())C.isDefaultPrevented=B;return C}function u(C){var g,q={originalEvent:C};for(g in C)N.test(g)||C[g]===c||(q[g]=C[g]);return m(q,C)}var f=1,c,h=Array.prototype.slice,k=z.isFunction,l=function(C){return typeof C=="string"},p={},w={},v="onfocusin"in a,E={focus:"focusin",blur:"focusout"},D={mouseenter:"mouseover",mouseleave:"mouseout"};w.click=w.mousedown=w.mouseup=
w.mousemove="MouseEvents";z.event={add:r,remove:n};z.proxy=function(C,g){var q=2 in arguments&&h.call(arguments,2);if(k(C)){var A=function(){return C.apply(g,q?q.concat(h.call(arguments)):arguments)};A._zid=y(C);return A}if(l(g))return q?(q.unshift(C[g],C),z.proxy.apply(null,q)):z.proxy(C[g],C);throw new TypeError("expected function");};z.fn.bind=function(C,g,q){return this.on(C,g,q)};z.fn.unbind=function(C,g){return this.off(C,g)};z.fn.one=function(C,g,q,A){return this.on(C,g,q,A,1)};var B=function(){return!0},
G=function(){return!1},N=/^([A-Z]|returnValue$|layer[XY]$|webkitMovement[XY]$)/,I={preventDefault:"isDefaultPrevented",stopImmediatePropagation:"isImmediatePropagationStopped",stopPropagation:"isPropagationStopped"};z.fn.delegate=function(C,g,q){return this.on(g,C,q)};z.fn.undelegate=function(C,g,q){return this.off(g,C,q)};z.fn.live=function(C,g){z(document.body).delegate(this.selector,C,g);return this};z.fn.die=function(C,g){z(document.body).undelegate(this.selector,C,g);return this};z.fn.on=function(C,
g,q,A,M){var J,T,b=this;if(C&&!l(C))return z.each(C,function(S,H){b.on(S,g,q,H,M)}),b;l(g)||k(A)||A===!1||(A=q,q=g,g=c);if(A===c||q===!1)A=q,q=c;A===!1&&(A=G);return b.each(function(S,H){M&&(J=function(V){n(H,V.type,A);return A.apply(this,arguments)});g&&(T=function(V){var P=z(V.target).closest(g,H).get(0);if(P&&P!==H){var U=z.extend(u(V),{currentTarget:P,liveFired:H});return(J||A).apply(P,[U].concat(h.call(arguments,1)))}});r(H,C,A,q,g,T||J)})};z.fn.off=function(C,g,q){var A=this;if(C&&!l(C))return z.each(C,
function(M,J){A.off(M,g,J)}),A;l(g)||k(q)||q===!1||(q=g,g=c);q===!1&&(q=G);return A.each(function(){n(this,C,q,g)})};z.fn.trigger=function(C,g){C=l(C)||z.isPlainObject(C)?z.Event(C):m(C);C._args=g;return this.each(function(){if(C.type in E&&typeof this[C.type]=="function")this[C.type]();else"dispatchEvent"in this?this.dispatchEvent(C):z(this).triggerHandler(C,g)})};z.fn.triggerHandler=function(C,g){var q,A;this.each(function(M,J){q=u(l(C)?z.Event(C):C);q._args=g;q.target=J;z.each(x(J,C.type||C),function(T,
b){A=b.proxy(q);if(q.isImmediatePropagationStopped())return!1})});return A};"focusin focusout focus blur load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select keydown keypress keyup error".split(" ").forEach(function(C){z.fn[C]=function(g){return 0 in arguments?this.bind(C,g):this.trigger(C)}});z.Event=function(C,g){l(C)||(g=C,C=g.type);var q=document.createEvent(w[C]||"Events"),A=!0;if(g)for(var M in g)M=="bubbles"?A=!!g[M]:q[M]=
g[M];q.initEvent(C,A,!0);return m(q)}})(t);(function(z){["width","height"].forEach(function(y){var x=y.replace(/./,function(e){return e[0].toUpperCase()});z.fn["outer"+x]=function(e){var d=this;if(d){var r=d[y]();({width:["left","right"],height:["top","bottom"]})[y].forEach(function(n){e&&(r+=parseInt(d.css("margin-"+n),10))});return r}return null}})})(t);(function(z){function y(C,g,q,A){if(C.global)return C=g||p,q=z.Event(q),z(C).trigger(q,A),!q.isDefaultPrevented()}function x(C){C.global&&z.active++===
0&&y(C,null,"ajaxStart")}function e(C,g){var q=g.context;if(g.beforeSend.call(q,C,g)===!1||y(g,q,"ajaxBeforeSend",[C,g])===!1)return!1;y(g,q,"ajaxSend",[C,g])}function d(C,g,q,A){var M=q.context;q.success.call(M,C,"success",g);A&&A.resolveWith(M,[C,"success",g]);y(q,M,"ajaxSuccess",[g,q,C]);n("success",g,q)}function r(C,g,q,A,M){var J=A.context;A.error.call(J,q,g,C);M&&M.rejectWith(J,[q,g,C]);y(A,J,"ajaxError",[q,A,C||g]);n(g,q,A)}function n(C,g,q){var A=q.context;q.complete.call(A,g,C);y(q,A,"ajaxComplete",
[g,q]);q.global&&!--z.active&&y(q,null,"ajaxStop")}function m(){}function u(C){C&&=C.split(";",2)[0];return C&&(C=="text/html"?"html":C=="application/json"?"json":D.test(C)?"script":B.test(C)&&"xml")||"text"}function f(C,g){return g==""?C:(C+"&"+g).replace(/[&?]{1,2}/,"?")}function c(C){C.processData&&C.data&&z.type(C.data)!="string"&&(C.data=z.param(C.data,C.traditional));!C.data||C.type&&C.type.toUpperCase()!="GET"&&"jsonp"!=C.dataType||(C.url=f(C.url,C.data),C.data=void 0)}function h(C,g,q,A){z.isFunction(g)&&
(A=q,q=g,g=void 0);z.isFunction(q)||(A=q,q=void 0);return{url:C,data:g,success:q,dataType:A}}function k(C,g,q,A){var M,J=z.isArray(g),T=z.isPlainObject(g);z.each(g,function(b,S){M=z.type(S);A&&(b=q?A:A+"["+(T||M=="object"||M=="array"?b:"")+"]");!A&&J?C.add(S.name,S.value):M=="array"||!q&&M=="object"?k(C,S,q,b):C.add(b,S)})}var l=+new Date,p=a.document,w,v,E=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,D=/^(?:text|application)\/javascript/i,B=/^(?:text|application)\/xml/i,G=/^\s*$/,N=p.createElement("a");
N.href=a.location.href;z.active=0;z.ajaxJSONP=function(C,g){if(!("type"in C))return z.ajax(C);var q=C.jsonpCallback,A=(z.isFunction(q)?q():q)||"Zepto"+l++,M=p.createElement("script"),J=a[A],T,b=function(V){z(M).triggerHandler("error",V||"abort")},S={abort:b},H;g&&g.promise(S);z(M).on("load error",function(V,P){clearTimeout(H);z(M).off().remove();V.type!="error"&&T?d(T[0],S,C,g):r(null,P||"error",S,C,g);a[A]=J;T&&z.isFunction(J)&&J(T[0]);J=T=void 0});if(e(S,C)===!1)return b("abort"),S;a[A]=function(){T=
arguments};M.src=C.url.replace(/\?(.+)=\?/,"?$1="+A);p.head.appendChild(M);C.timeout>0&&(H=setTimeout(function(){b("timeout")},C.timeout));return S};z.ajaxSettings={type:"GET",beforeSend:m,success:m,error:m,complete:m,context:null,global:!0,xhr:function(){return new a.XMLHttpRequest},accepts:{script:"text/javascript, application/javascript, application/x-javascript",json:"application/json",xml:"application/xml, text/xml",html:"text/html",text:"text/plain"},crossDomain:!1,timeout:0,processData:!0,
cache:!0,dataFilter:m};z.ajax=function(C){var g=z.extend({},C||{}),q=z.Deferred&&z.Deferred();for(w in z.ajaxSettings)g[w]===void 0&&(g[w]=z.ajaxSettings[w]);x(g);if(!g.crossDomain){var A=p.createElement("a");A.href=g.url;A.href=A.href;g.crossDomain=N.protocol+"//"+N.host!==A.protocol+"//"+A.host}g.url||(g.url=a.location.toString());(A=g.url.indexOf("#"))>-1&&(g.url=g.url.slice(0,A));c(g);var M=g.dataType;(A=/\?.+=\?/.test(g.url))&&(M="jsonp");g.cache!==!1&&(C&&C.cache===!0||"script"!=M&&"jsonp"!=
M)||(g.url=f(g.url,"_="+Date.now()));if("jsonp"==M)return A||(g.url=f(g.url,g.jsonp?g.jsonp+"=?":g.jsonp===!1?"":"callback=?")),z.ajaxJSONP(g,q);C=g.accepts[M];var J={};A=function(V,P){J[V.toLowerCase()]=[V,P]};var T=/^([\w-]+:)\/\//.test(g.url)?RegExp.$1:a.location.protocol,b=g.xhr(),S=b.setRequestHeader,H;q&&q.promise(b);g.crossDomain||A("X-Requested-With","XMLHttpRequest");A("Accept",C||"*/*");if(C=g.mimeType||C)C.indexOf(",")>-1&&(C=C.split(",",2)[0]),b.overrideMimeType&&b.overrideMimeType(C);
(g.contentType||g.contentType!==!1&&g.data&&g.type.toUpperCase()!="GET")&&A("Content-Type",g.contentType||"application/x-www-form-urlencoded");if(g.headers)for(v in g.headers)A(v,g.headers[v]);b.setRequestHeader=A;b.onreadystatechange=function(){if(b.readyState==4){b.onreadystatechange=m;clearTimeout(H);var V=!1;if(b.status>=200&&b.status<300||b.status==304||b.status==0&&T=="file:"){M=M||u(g.mimeType||b.getResponseHeader("content-type"));if(b.responseType=="arraybuffer"||b.responseType=="blob")var P=
b.response;else{P=b.responseText;try{P=g.dataFilter==m?P:g.dataFilter.call(g.context,P,M),M=="script"?(0,eval)(P):M=="xml"?P=b.responseXML:M=="json"&&(P=G.test(P)?null:z.parseJSON(P))}catch(U){V=U}if(V)return r(V,"parsererror",b,g,q)}d(P,b,g,q)}else r(b.statusText||null,b.status?"error":"abort",b,g,q)}};if(e(b,g)===!1)return b.abort(),r(null,"abort",b,g,q),b;b.open(g.type,g.url,"async"in g?g.async:!0,g.username,g.password);if(g.xhrFields)for(v in g.xhrFields)b[v]=g.xhrFields[v];for(v in J)S.apply(b,
J[v]);g.timeout>0&&(H=setTimeout(function(){b.onreadystatechange=m;b.abort();r(null,"timeout",b,g,q)},g.timeout));b.send(g.data?g.data:null);return b};z.get=function(){return z.ajax(h.apply(null,arguments))};z.post=function(){var C=h.apply(null,arguments);C.type="POST";return z.ajax(C)};z.getJSON=function(){var C=h.apply(null,arguments);C.dataType="json";return z.ajax(C)};z.fn.load=function(C,g,q){if(!this.length)return this;var A=this,M=C.split(/\s/);C=h(C,g,q);var J=C.success;if(M.length>1){C.url=
M[0];var T=M[1]}C.success=function(b){A.html(T?z("<div>").html(b.replace(E,"")).find(T):b);J&&J.apply(A,arguments)};z.ajax(C);return this};var I=encodeURIComponent;z.param=function(C,g){var q=[];q.add=function(A,M){z.isFunction(M)&&(M=M());M==null&&(M="");this.push(I(A)+"="+I(M))};k(q,C,g);return q.join("&").replace(/%20/g,"+")}})(t);(function(z){z.fn.serializeArray=function(){var y,x,e=[],d=function(r){if(r.forEach)return r.forEach(d);e.push({name:y,value:r})};this[0]&&z.each(this[0].elements,function(r,
n){x=n.type;(y=n.name)&&n.nodeName.toLowerCase()!="fieldset"&&!n.disabled&&x!="submit"&&x!="reset"&&x!="button"&&x!="file"&&(x!="radio"&&x!="checkbox"||n.checked)&&d(z(n).val())});return e};z.fn.serialize=function(){var y=[];this.serializeArray().forEach(function(x){y.push(encodeURIComponent(x.name)+"="+encodeURIComponent(x.value))});return y.join("&")};z.fn.submit=function(y){if(0 in arguments)this.bind("submit",y);else if(this.length){var x=z.Event("submit");this.eq(0).trigger(x);x.isDefaultPrevented()||
this.get(0).submit()}return this}})(t);(function(z,y){function x(D){return d?d+D:D.toLowerCase()}var e="",d,r={Webkit:"webkit",Moz:"",O:"o"},n=document.createElement("div"),m=/^((translate|rotate|scale)(X|Y|Z|3d)?|matrix(3d)?|perspective|skew(X|Y)?)$/i,u,f,c,h,k,l,p,w,v={};n.style.transform===y&&z.each(r,function(D,B){if(n.style[D+"TransitionProperty"]!==y)return e="-"+D.toLowerCase()+"-",d=B,!1});var E=e+"transform";v[u=e+"transition-property"]=v[f=e+"transition-duration"]=v[h=e+"transition-delay"]=
v[c=e+"transition-timing-function"]=v[k=e+"animation-name"]=v[l=e+"animation-duration"]=v[w=e+"animation-delay"]=v[p=e+"animation-timing-function"]="";z.fx={off:d===y&&n.style.transitionProperty===y,speeds:{_default:400,fast:200,slow:600},cssPrefix:e,transitionEnd:x("TransitionEnd"),animationEnd:x("AnimationEnd")};z.fn.animate=function(D,B,G,N,I){z.isFunction(B)&&(N=B,B=G=y);z.isFunction(G)&&(N=G,G=y);z.isPlainObject(B)&&(G=B.easing,N=B.complete,I=B.delay,B=B.duration);B&&=(typeof B=="number"?B:z.fx.speeds[B]||
z.fx.speeds._default)/1E3;I&&=parseFloat(I)/1E3;return this.anim(D,B,G,N,I)};z.fn.anim=function(D,B,G,N,I){var C,g={},q="",A=this,M=z.fx.transitionEnd,J=!1;B===y&&(B=z.fx.speeds._default/1E3);I===y&&(I=0);z.fx.off&&(B=0);if(typeof D=="string")g[k]=D,g[l]=B+"s",g[w]=I+"s",g[p]=G||"linear",M=z.fx.animationEnd;else{var T=[];for(C in D)m.test(C)?q+=C+"("+D[C]+") ":(g[C]=D[C],T.push(C.replace(/([A-Z])/g,"-$1").toLowerCase()));q&&(g[E]=q,T.push(E));B>0&&typeof D==="object"&&(g[u]=T.join(", "),g[f]=B+"s",
g[h]=I+"s",g[c]=G||"linear")}var b=function(S){if(typeof S!=="undefined"){if(S.target!==S.currentTarget)return;z(S.target).unbind(M,b)}else z(this).unbind(M,b);J=!0;z(this).css(v);N&&N.call(this)};B>0&&(this.bind(M,b),setTimeout(function(){J||b.call(A)},(B+I)*1E3+25));this.size()&&this.get(0).clientLeft;this.css(g);B<=0&&setTimeout(function(){A.each(function(){b.call(this)})},0);return this};z.fn.stop=function(D,B){return this};n=null})(t);(function(){try{getComputedStyle(void 0)}catch(y){var z=getComputedStyle;
a.getComputedStyle=function(x,e){try{return z(x,e)}catch(d){return null}}}})();return t}(window);(function(a){var t=!1,z=!1,y=0,x=2E3,e=0,d=document,r=window,n=a(r),m=[],u=r.requestAnimationFrame||r.webkitRequestAnimationFrame||r.mozRequestAnimationFrame||!1,f=r.cancelAnimationFrame||r.webkitCancelAnimationFrame||r.mozCancelAnimationFrame||!1;if(u)r.cancelAnimationFrame||(f=function(I){});else{var c=0;u=function(I,C){var g=(new Date).getTime(),q=Math.max(0,16-(g-c));C=r.setTimeout(function(){I(g+
q)},q);c=g+q;return C};f=function(I){r.clearTimeout(I)}}var h=r.MutationObserver||r.WebKitMutationObserver||!1,k=Date.now||function(){return(new Date).getTime()},l={zindex:"auto",cursoropacitymin:0,cursoropacitymax:1,cursorcolor:"#424242",cursorwidth:"6px",cursorborder:"1px solid #fff",cursorborderradius:"5px",scrollspeed:40,mousescrollstep:27,touchbehavior:!1,emulatetouch:!1,hwacceleration:!0,usetransition:!0,boxzoom:!1,dblclickzoom:!0,gesturezoom:!0,grabcursorenabled:!0,autohidemode:!0,background:"",
iframeautoresize:!0,cursorminheight:32,preservenativescrolling:!0,railoffset:!1,railhoffset:!1,bouncescroll:!0,spacebarenabled:!0,railpadding:{top:0,right:0,left:0,bottom:0},disableoutline:!0,horizrailenabled:!0,rightdock:0,railalign:"right",railvalign:"bottom",enabletranslate3d:!0,enablemousewheel:!0,enablekeyboard:!0,smoothscroll:!0,sensitiverail:!0,enablemouselockapi:!0,cursorfixedheight:!1,directionlockdeadzone:6,hidecursordelay:400,nativeparentscrolling:!0,enablescrollonselection:!0,overflowx:!0,
overflowy:!0,cursordragspeed:.3,rtlmode:"auto",cursordragontouch:!1,oneaxismousemode:"auto",scriptpath:function(){var I;(I=d.currentScript)||(I=d.getElementsByTagName("script"),I=I.length?I[I.length-1]:!1);I=I?I.src.split("?")[0]:"";return I.split("/").length>0?I.split("/").slice(0,-1).join("/")+"/":""}(),preventmultitouchscrolling:!0,disablemutationobserver:!1,enableobserver:!0,scrollbarid:!1,scrollCLass:!1},p=!1,w=function(){if(p)return p;var I=d.createElement("DIV"),C=I.style,g=navigator.userAgent,
q=navigator.platform,A={};A.haspointerlock="pointerLockElement"in d||"webkitPointerLockElement"in d||"mozPointerLockElement"in d;A.isopera="opera"in r;A.isopera12=A.isopera&&"getUserMedia"in navigator;A.isoperamini=Object.prototype.toString.call(r.operamini)==="[object OperaMini]";A.isie="all"in d&&"attachEvent"in I&&!A.isopera;A.isieold=A.isie&&!("msInterpolationMode"in C);A.isie7=A.isie&&!A.isieold&&(!("documentMode"in d)||d.documentMode===7);A.isie8=A.isie&&"documentMode"in d&&d.documentMode===
8;A.isie9=A.isie&&"performance"in r&&d.documentMode===9;A.isie10=A.isie&&"performance"in r&&d.documentMode===10;A.isie11="msRequestFullscreen"in I&&d.documentMode>=11;A.ismsedge="msCredentials"in r;A.ismozilla="MozAppearance"in C;A.iswebkit=!A.ismsedge&&"WebkitAppearance"in C;A.ischrome=A.iswebkit&&"chrome"in r;A.ischrome38=A.ischrome&&"touchAction"in C;A.ischrome22=!A.ischrome38&&A.ischrome&&A.haspointerlock;A.ischrome26=!A.ischrome38&&A.ischrome&&"transition"in C;A.cantouch="ontouchstart"in d.documentElement||
"ontouchstart"in r;A.hasw3ctouch=(r.PointerEvent||!1)&&(navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0);A.hasmstouch=!A.hasw3ctouch&&(r.MSPointerEvent||!1);A.ismac=/^mac$/i.test(q);A.isios=A.cantouch&&/iphone|ipad|ipod/i.test(q);A.isios4=A.isios&&!("seal"in Object);A.isios7=A.isios&&"webkitHidden"in d;A.isios8=A.isios&&"hidden"in d;A.isios10=A.isios&&r.Proxy;A.isandroid=/android/i.test(g);A.haseventlistener="addEventListener"in I;A.trstyle=!1;A.hastransform=!1;A.hastranslate3d=!1;A.transitionstyle=
!1;A.hastransition=!1;A.transitionend=!1;A.trstyle="transform";A.hastransform="transform"in C||function(){for(var M=["msTransform","webkitTransform","MozTransform","OTransform"],J=0,T=M.length;J<T;J++)if(C[M[J]]!==void 0){A.trstyle=M[J];break}A.hastransform=!!A.trstyle}();A.hastransform&&(C[A.trstyle]="translate3d(1px,2px,3px)",A.hastranslate3d=/translate3d/.test(C[A.trstyle]));A.transitionstyle="transition";A.prefixstyle="";A.transitionend="transitionend";A.hastransition="transition"in C||function(){A.transitionend=
!1;for(var M="webkitTransition msTransition MozTransition OTransition OTransition KhtmlTransition".split(" "),J="-webkit- -ms- -moz- -o- -o -khtml-".split(" "),T="webkitTransitionEnd msTransitionEnd transitionend otransitionend oTransitionEnd KhtmlTransitionEnd".split(" "),b=0,S=M.length;b<S;b++)if(M[b]in C){A.transitionstyle=M[b];A.prefixstyle=J[b];A.transitionend=T[b];break}A.ischrome26&&(A.prefixstyle=J[1]);A.hastransition=A.transitionstyle}();A.cursorgrabvalue=function(){var M=["grab","-webkit-grab",
"-moz-grab"];if(A.ischrome&&!A.ischrome38||A.isie)M=[];for(var J=0,T=M.length;J<T;J++){var b=M[J];C.cursor=b;if(C.cursor==b)return b}return"url("+(l.scriptpath+"css/openhand.cur),n-resize")}();A.hasmousecapture="setCapture"in I;A.hasMutationObserver=h!==!1;I=null;return p=A},v=function(I,C){function g(){var O=b.doc.css(P.trstyle);return O&&O.substr(0,6)=="matrix"?O.replace(/^.*\((.*)\)$/g,"$1").replace(/px/g,"").split(/, +/):!1}function q(){var O=b.win;if("zIndex"in O)return O.zIndex();for(;O.length>
0&&O[0].nodeType!=9;){var Q=O.css("zIndex");if(!isNaN(Q)&&Q!==0)return parseInt(Q);O=O.parent()}return!1}function A(O,Q,F){Q=O.css(Q);O=parseFloat(Q);return isNaN(O)?(O=ca[Q]||0,F=O==3?F?b.win.outerHeight()-b.win.innerHeight():b.win.outerWidth()-b.win.innerWidth():1,b.isie8&&O&&(O+=1),F?O:0):O}function M(O,Q,F,R){b._bind(O,Q,function(X){X=X||r.event;var aa={original:X,target:X.target||X.srcElement,type:"wheel",deltaMode:X.type=="MozMousePixelScroll"?0:1,deltaX:0,deltaZ:0,preventDefault:function(){X.preventDefault?
X.preventDefault():X.returnValue=!1;return!1},stopImmediatePropagation:function(){X.stopImmediatePropagation?X.stopImmediatePropagation():X.cancelBubble=!0}};Q=="mousewheel"?(X.wheelDeltaX&&(aa.deltaX=-.025*X.wheelDeltaX),X.wheelDeltaY&&(aa.deltaY=-.025*X.wheelDeltaY),aa.deltaY||aa.deltaX||(aa.deltaY=-.025*X.wheelDelta)):aa.deltaY=X.detail;return F.call(O,aa)},R)}function J(O,Q,F,R){b.scrollrunning||(b.newscrolly=b.getScrollTop(),b.newscrollx=b.getScrollLeft(),Ga=k());var X=k()-Ga;Ga=k();Ba=X>350?
1:Ba+(2-Ba)/10;O=O*Ba|0;Q=Q*Ba|0;if(O){if(R)if(O<0){if(b.getScrollLeft()>=b.page.maxw)return!0}else if(b.getScrollLeft()<=0)return!0;R=O>0?1:-1;fa!==R&&(b.scrollmom&&b.scrollmom.stop(),b.newscrollx=b.getScrollLeft(),fa=R);b.lastdeltax-=O}if(Q){if(function(){var aa=b.getScrollTop();if(Q<0){if(aa>=b.page.maxh)return!0}else if(aa<=0)return!0}()){if(H.nativeparentscrolling&&F&&!b.ispage&&!b.zoomactive)return!0;F=b.view.h>>1;b.newscrolly<-F?(b.newscrolly=-F,Q=-1):b.newscrolly>b.page.maxh+F?(b.newscrolly=
b.page.maxh+F,Q=1):Q=0}F=Q>0?1:-1;ha!==F&&(b.scrollmom&&b.scrollmom.stop(),b.newscrolly=b.getScrollTop(),ha=F);b.lastdeltay-=Q}(Q||O)&&b.synched("relativexy",function(){var aa=b.lastdeltay+b.newscrolly;b.lastdeltay=0;var oa=b.lastdeltax+b.newscrollx;b.lastdeltax=0;b.rail.drag||b.doScrollPos(oa,aa)})}function T(O,Q,F){if(!F&&Ca)return!0;if(O.deltaMode===0){var R=-(H.mousescrollstep/54*O.deltaX)|0;var X=-(H.mousescrollstep/54*O.deltaY)|0}else O.deltaMode===1&&(R=-(O.deltaX*H.mousescrollstep*50/80)|
0,X=-(O.deltaY*H.mousescrollstep*50/80)|0);Q&&H.oneaxismousemode&&R===0&&X&&(R=X,X=0,F&&(R<0?b.getScrollLeft()>=b.page.maxw:b.getScrollLeft()<=0)&&(X=R,R=0));b.isrtlmode&&(R=-R);if(J(R,X,F,!0))F&&(Ca=!0);else return Ca=!1,O.stopImmediatePropagation(),O.preventDefault()}var b=this;this.version="3.7.6";this.name="nicescroll";this.me=C;var S=a("body"),H=this.opt={doc:S,win:!1};a.extend(H,l);H.snapbackspeed=80;if(I)for(var V in H)I[V]!==void 0&&(H[V]=I[V]);H.disablemutationobserver&&(h=!1);this.iddoc=
(this.doc=H.doc)&&this.doc[0]?this.doc[0].id||"":"";this.ispage=/^BODY|HTML/.test(H.win?H.win[0].nodeName:this.doc[0].nodeName);this.haswrapper=H.win!==!1;this.win=H.win||(this.ispage?n:this.doc);this.docscroll=this.ispage&&!this.haswrapper?n:this.win;this.body=S;this.iframe=this.isfixed=this.viewport=!1;this.isiframe=this.doc[0].nodeName=="IFRAME"&&this.win[0].nodeName=="IFRAME";this.istextarea=this.win[0].nodeName=="TEXTAREA";this.forcescreen=!1;this.canshowonmouseevent=H.autohidemode!="scroll";
this.page=this.view=this.onzoomout=this.onzoomin=this.onscrollcancel=this.onscrollend=this.onscrollstart=this.onclick=this.ongesturezoom=this.onkeypress=this.onmousewheel=this.onmousemove=this.onmouseup=this.onmousedown=!1;this.scroll={x:0,y:0};this.scrollratio={x:0,y:0};this.cursorheight=20;this.scrollvaluemax=0;H.rtlmode=="auto"?(I=this.win[0]==r?this.body:this.win,C=I.css("writing-mode")||I.css("-webkit-writing-mode")||I.css("-ms-writing-mode")||I.css("-moz-writing-mode"),C=="horizontal-tb"||C==
"lr-tb"||C===""?(this.isrtlmode=I.css("direction")=="rtl",this.isvertical=!1):(this.isrtlmode=C=="vertical-rl"||C=="tb"||C=="tb-rl"||C=="rl-tb",this.isvertical=C=="vertical-rl"||C=="tb"||C=="tb-rl")):(this.isrtlmode=H.rtlmode===!0,this.isvertical=!1);this.observerbody=this.observerremover=this.observer=this.scrollmom=this.scrollrunning=!1;if(H.scrollbarid!==!1)this.id=H.scrollbarid;else{do this.id="ascrail"+x++;while(d.getElementById(this.id))}this.hidden=this.locked=this.railslocked=this.hasmousefocus=
this.hasfocus=this.zoomactive=this.zoom=this.selectiondrag=this.cursorfreezed=this.cursor=this.rail=!1;this.cursoractive=!0;this.wheelprevented=!1;this.overflowx=H.overflowx;this.overflowy=H.overflowy;this.nativescrollingarea=!1;this.checkarea=0;this.events=[];this.saved={};this.delaylist={};this.synclist={};this.lastdeltay=this.lastdeltax=0;this.detected=w();var P=a.extend({},this.detected);this.ishwscroll=(this.canhwscroll=P.hastransform&&H.hwacceleration)&&b.haswrapper;this.hasreversehr=this.isrtlmode?
this.isvertical?!(P.iswebkit||P.isie||P.isie11):!(P.iswebkit||P.isie&&!P.isie10&&!P.isie11):!1;this.istouchcapable=!1;P.cantouch||!P.hasw3ctouch&&!P.hasmstouch?!P.cantouch||P.isios||P.isandroid||!P.iswebkit&&!P.ismozilla||(this.istouchcapable=!0):this.istouchcapable=!0;H.enablemouselockapi||(P.hasmousecapture=!1,P.haspointerlock=!1);this.debounced=function(O,Q,F){b&&(b.delaylist[O]||(b.delaylist[O]={h:u(function(){b.delaylist[O].fn.call(b);b.delaylist[O]=!1},F)},Q.call(b)),b.delaylist[O].fn=Q)};this.synched=
function(O,Q){b.synclist[O]?b.synclist[O]=Q:(b.synclist[O]=Q,u(function(){b&&(b.synclist[O]&&b.synclist[O].call(b),b.synclist[O]=null)}))};this.unsynched=function(O){b.synclist[O]&&(b.synclist[O]=!1)};this.css=function(O,Q){for(var F in Q)b.saved.css.push([O,F,O.css(F)]),O.css(F,Q[F])};this.scrollTop=function(O){return O===void 0?b.getScrollTop():b.setScrollTop(O)};this.scrollLeft=function(O){return O===void 0?b.getScrollLeft():b.setScrollLeft(O)};var U=function(O,Q,F,R,X,aa,oa){this.st=O;this.ed=
Q;this.spd=F;this.p1=R||0;this.p2=X||1;this.p3=aa||0;this.p4=oa||1;this.ts=k();this.df=Q-O};U.prototype={B2:function(O){return 3*(1-O)*(1-O)*O},B3:function(O){return 3*(1-O)*O*O},B4:function(O){return O*O*O},getPos:function(){return(k()-this.ts)/this.spd},getNow:function(){var O=(k()-this.ts)/this.spd,Q=this.B2(O)+this.B3(O)+this.B4(O);return O>=1?this.ed:this.st+this.df*Q|0},update:function(O,Q){this.st=this.getNow();this.ed=O;this.spd=Q;this.ts=k();this.df=this.ed-this.st;return this}};if(this.ishwscroll){this.doc.translate=
{x:0,y:0,tx:"0px",ty:"0px"};P.hastranslate3d&&P.isios&&this.doc.css("-webkit-backface-visibility","hidden");this.getScrollTop=function(O){if(!O){if(O=g())return O.length==16?-O[13]:-O[5];if(b.timerscroll&&b.timerscroll.bz)return b.timerscroll.bz.getNow()}return b.doc.translate.y};this.getScrollLeft=function(O){if(!O){if(O=g())return O.length==16?-O[12]:-O[4];if(b.timerscroll&&b.timerscroll.bh)return b.timerscroll.bh.getNow()}return b.doc.translate.x};this.notifyScrollEvent=function(O){var Q=d.createEvent("UIEvents");
Q.initUIEvent("scroll",!1,!1,r,1);Q.niceevent=!0;O.dispatchEvent(Q)};var W=this.isrtlmode?1:-1;P.hastranslate3d&&H.enabletranslate3d?(this.setScrollTop=function(O,Q){b.doc.translate.y=O;b.doc.translate.ty=O*-1+"px";b.doc.css(P.trstyle,"translate3d("+b.doc.translate.tx+","+b.doc.translate.ty+",0)");Q||b.notifyScrollEvent(b.win[0])},this.setScrollLeft=function(O,Q){b.doc.translate.x=O;b.doc.translate.tx=O*W+"px";b.doc.css(P.trstyle,"translate3d("+b.doc.translate.tx+","+b.doc.translate.ty+",0)");Q||
b.notifyScrollEvent(b.win[0])}):(this.setScrollTop=function(O,Q){b.doc.translate.y=O;b.doc.translate.ty=O*-1+"px";b.doc.css(P.trstyle,"translate("+b.doc.translate.tx+","+b.doc.translate.ty+")");Q||b.notifyScrollEvent(b.win[0])},this.setScrollLeft=function(O,Q){b.doc.translate.x=O;b.doc.translate.tx=O*W+"px";b.doc.css(P.trstyle,"translate("+b.doc.translate.tx+","+b.doc.translate.ty+")");Q||b.notifyScrollEvent(b.win[0])})}else this.getScrollTop=function(){return b.docscroll.scrollTop()},this.setScrollTop=
function(O){b.docscroll.scrollTop(O)},this.getScrollLeft=function(){return b.hasreversehr?b.detected.ismozilla?b.page.maxw-Math.abs(b.docscroll.scrollLeft()):b.page.maxw-b.docscroll.scrollLeft():b.docscroll.scrollLeft()},this.setScrollLeft=function(O){return setTimeout(function(){if(b)return b.hasreversehr&&(O=b.detected.ismozilla?-(b.page.maxw-O):b.page.maxw-O),b.docscroll.scrollLeft(O)},1)};this.getTarget=function(O){return O?O.target?O.target:O.srcElement?O.srcElement:!1:!1};this.hasParent=function(O,
Q){if(!O)return!1;for(O=O.target||O.srcElement||O||!1;O&&O.id!=Q;)O=O.parentNode||!1;return O!==!1};var ca={thin:1,medium:3,thick:5};this.getDocumentScrollOffset=function(){return{top:r.pageYOffset||d.documentElement.scrollTop,left:r.pageXOffset||d.documentElement.scrollLeft}};this.getOffset=function(){if(b.isfixed){var O=b.win.offset(),Q=b.getDocumentScrollOffset();O.top-=Q.top;O.left-=Q.left;return O}O=b.win.offset();if(!b.viewport)return O;Q=b.viewport.offset();return{top:O.top-Q.top,left:O.left-
Q.left}};this.updateScrollBar=function(O){var Q;if(b.ishwscroll)b.rail.css({height:b.win.innerHeight()-(H.railpadding.top+H.railpadding.bottom)}),b.railh&&b.railh.css({width:b.win.innerWidth()-(H.railpadding.left+H.railpadding.right)});else{var F=b.getOffset();var R=F.top;var X=F.left-(H.railpadding.left+H.railpadding.right);R+=A(b.win,"border-top-width",!0);X+=b.rail.align?b.win.outerWidth()-A(b.win,"border-right-width")-b.rail.width:A(b.win,"border-left-width");if(Q=H.railoffset)Q.top&&(R+=Q.top),
Q.left&&(X+=Q.left);O=(O?O.h:b.win.innerHeight())-(H.railpadding.top+H.railpadding.bottom);Q="left";var aa=X;typeof H.rightdock==="number"&&(Q="right",aa=H.rightdock);b.railslocked||b.rail.css({top:R,[Q]:aa,height:O});b.zoom&&b.zoom.css({top:R+1,left:b.rail.align==1?X-20:X+b.rail.width+4});if(b.railh&&!b.railslocked){R=F.top;X=F.left;if(Q=H.railhoffset)Q.top&&(R+=Q.top),Q.left&&(X+=Q.left);R=b.railh.align?R+A(b.win,"border-top-width",!0)+b.win.innerHeight()-b.railh.height:R+A(b.win,"border-top-width",
!0);X+=A(b.win,"border-left-width");b.railh.css({top:R-(H.railpadding.top+H.railpadding.bottom),left:X,width:b.railh.width})}}};this.doRailClick=function(O,Q,F){if(!b.railslocked)if(b.cancelEvent(O),"pageY"in O||(O.pageX=O.clientX+d.documentElement.scrollLeft,O.pageY=O.clientY+d.documentElement.scrollTop),Q){Q=F?b.doScrollLeft:b.doScrollTop;var R=F?(O.pageX-b.railh.offset().left-b.cursorwidth/2)*b.scrollratio.x:(O.pageY-b.rail.offset().top-b.cursorheight/2)*b.scrollratio.y;b.unsynched("relativexy");
Q(R|0)}else Q=F?b.doScrollLeftBy:b.doScrollBy,R=F?b.scroll.x:b.scroll.y,O=F?O.pageX-b.railh.offset().left:O.pageY-b.rail.offset().top,F=F?b.view.w:b.view.h,Q(R>=O?F:-F)};b.newscrolly=b.newscrollx=0;b.hasanimationframe="requestAnimationFrame"in r;b.hascancelanimationframe="cancelAnimationFrame"in r;b.hasborderbox=!1;this.init=function(){b.saved.css=[];if(P.isoperamini||P.isandroid&&!("hidden"in d))return!0;H.emulatetouch=H.emulatetouch||H.touchbehavior;b.hasborderbox=r.getComputedStyle&&r.getComputedStyle(d.body)["box-sizing"]===
"border-box";var O={"overflow-y":"hidden"};if(P.isie11||P.isie10)O["-ms-overflow-style"]="none";b.ishwscroll&&(this.doc.css(P.transitionstyle,P.prefixstyle+"transform 0ms ease-out"),P.transitionend&&b.bind(b.doc,P.transitionend,b.onScrollTransitionEnd,!1));b.zindex="auto";b.zindex=b.ispage||H.zindex!="auto"?H.zindex:q()||"auto";!b.ispage&&b.zindex!="auto"&&b.zindex>e&&(e=b.zindex);b.isie&&b.zindex===0&&H.zindex=="auto"&&(b.zindex="auto");if(!b.ispage||!P.isieold){var Q=b.docscroll;b.ispage&&(Q=b.haswrapper?
b.win:b.doc);b.css(Q,O);b.ispage&&(P.isie11||P.isie)&&b.css(a("html"),O);!P.isios||b.ispage||b.haswrapper||b.css(S,{"-webkit-overflow-scrolling":"touch"});var F=a(d.createElement("div"));F.css({position:"relative",top:0,"float":"right",width:H.cursorwidth,height:0,"background-color":H.cursorcolor,border:H.cursorborder,"background-clip":"padding-box","-webkit-border-radius":H.cursorborderradius,"-moz-border-radius":H.cursorborderradius,"border-radius":H.cursorborderradius});F.addClass("nicescroll-cursors");
b.cursor=F;var R=a(d.createElement("div"));R.attr("id",b.id);R.addClass("nicescroll-rails nicescroll-rails-vr");H.scrollCLass&&R.addClass(H.scrollCLass);var X,aa=["left","right","top","bottom"],oa;for(oa in aa){var ta=aa[oa];(X=H.railpadding[ta]||0)&&R.css("padding-"+ta,X+"px")}R.append(F);R.width=Math.max(parseFloat(H.cursorwidth),F.outerWidth());R.css({width:R.width+"px",zIndex:b.zindex,background:H.background,cursor:"default"});R.visibility=!0;R.scrollable=!0;R.align=H.railalign=="left"?0:1;b.rail=
R;F=b.rail.drag=!1;!H.boxzoom||b.ispage||P.isieold||(F=d.createElement("div"),b.bind(F,"click",b.doZoom),b.bind(F,"mouseenter",function(){b.zoom.css("opacity",H.cursoropacitymax)}),b.bind(F,"mouseleave",function(){b.zoom.css("opacity",H.cursoropacitymin)}),b.zoom=a(F),b.zoom.css({cursor:"pointer",zIndex:b.zindex,backgroundImage:"url("+H.scriptpath+"zoomico.png)",height:18,width:18,backgroundPosition:"0 0"}),H.dblclickzoom&&b.bind(b.win,"dblclick",b.doZoom),P.cantouch&&H.gesturezoom&&(b.ongesturezoom=
function(Y){Y.scale>1.5&&b.doZoomIn(Y);Y.scale<.8&&b.doZoomOut(Y);return b.cancelEvent(Y)},b.bind(b.win,"gestureend",b.ongesturezoom)));b.railh=!1;if(H.horizrailenabled){b.css(Q,{overflowX:"hidden"});F=a(d.createElement("div"));F.css({position:"absolute",top:0,height:H.cursorwidth,width:0,backgroundColor:H.cursorcolor,border:H.cursorborder,backgroundClip:"padding-box","-webkit-border-radius":H.cursorborderradius,"-moz-border-radius":H.cursorborderradius,"border-radius":H.cursorborderradius});P.isieold&&
F.css("overflow","hidden");F.addClass("nicescroll-cursors");b.cursorh=F;var va=a(d.createElement("div"));va.attr("id",b.id+"-hr");va.addClass("nicescroll-rails nicescroll-rails-hr");H.scrollCLass&&va.addClass(H.scrollCLass);va.height=Math.max(parseFloat(H.cursorwidth),F.outerHeight());va.css({height:va.height+"px",zIndex:b.zindex,background:H.background});va.append(F);va.visibility=!0;va.scrollable=!0;va.align=H.railvalign=="top"?0:1;b.railh=va;b.railh.drag=!1}b.ispage?(R.css({position:"fixed",top:0,
height:"100%"}),R.css(R.align?{right:0}:{left:0}),b.body.append(R),b.railh&&(va.css({position:"fixed",left:0,width:"100%"}),va.css(va.align?{bottom:0}:{top:0}),b.body.append(va))):(b.ishwscroll?(b.win.css("position")=="static"&&b.css(b.win,{position:"relative"}),Q=b.win[0].nodeName=="HTML"?b.body:b.win,a(Q).scrollTop(0).scrollLeft(0),b.zoom&&(b.zoom.css({position:"absolute",top:1,right:0,"margin-right":R.width+4}),Q.append(b.zoom)),R.css({position:"absolute",top:0}),R.css(R.align?{right:0}:{left:0}),
Q.append(R),va&&(va.css({position:"absolute",left:0,bottom:0}),va.css(va.align?{bottom:0}:{top:0}),Q.append(va))):(b.isfixed=b.win.css("position")=="fixed",Q=b.isfixed?"fixed":"absolute",b.isfixed||(b.viewport=b.getViewport(b.win[0])),b.viewport&&(b.body=b.viewport,/fixed|absolute/.test(b.viewport.css("position"))||b.css(b.viewport,{position:"relative"})),R.css({position:Q}),b.zoom&&b.zoom.css({position:Q}),b.updateScrollBar(),b.body.append(R),b.zoom&&b.body.append(b.zoom),b.railh&&(va.css({position:Q}),
b.body.append(va))),P.isios&&b.css(b.win,{"-webkit-tap-highlight-color":"rgba(0,0,0,0)","-webkit-touch-callout":"none"}),H.disableoutline&&(P.isie&&b.win.attr("hideFocus","true"),P.iswebkit&&b.win.css("outline","none")));H.autohidemode===!1?(b.autohidedom=!1,b.rail.css({opacity:H.cursoropacitymax}),b.railh&&b.railh.css({opacity:H.cursoropacitymax})):H.autohidemode===!0||H.autohidemode==="leave"?(b.autohidedom=a().add(b.rail),P.isie8&&(b.autohidedom=b.autohidedom.add(b.cursor)),b.railh&&(b.autohidedom=
b.autohidedom.add(b.railh)),b.railh&&P.isie8&&(b.autohidedom=b.autohidedom.add(b.cursorh))):H.autohidemode=="scroll"?(b.autohidedom=a().add(b.rail),b.railh&&(b.autohidedom=b.autohidedom.add(b.railh))):H.autohidemode=="cursor"?(b.autohidedom=a().add(b.cursor),b.railh&&(b.autohidedom=b.autohidedom.add(b.cursorh))):H.autohidemode=="hidden"&&(b.autohidedom=!1,b.hide(),b.railslocked=!1);if(P.cantouch||b.istouchcapable||H.emulatetouch||P.hasmstouch){b.scrollmom=new E(b);b.ontouchstart=function(Y){if(b.locked||
Y.pointerType&&(Y.pointerType==="mouse"||Y.pointerType===Y.MSPOINTER_TYPE_MOUSE))return!1;b.hasmoving=!1;b.scrollmom.timer&&(b.triggerScrollEnd(),b.scrollmom.stop());if(!b.railslocked){var ea=b.getTarget(Y);if(ea&&/INPUT/i.test(ea.nodeName)&&/range/i.test(ea.type))return b.stopPropagation(Y);var ma=Y.type==="mousedown";!("clientX"in Y)&&"changedTouches"in Y&&(Y.clientX=Y.changedTouches[0].clientX,Y.clientY=Y.changedTouches[0].clientY);if(b.forcescreen){var qa=Y;Y={original:Y.original?Y.original:Y};
Y.clientX=qa.screenX;Y.clientY=qa.screenY}b.rail.drag={x:Y.clientX,y:Y.clientY,sx:b.scroll.x,sy:b.scroll.y,st:b.getScrollTop(),sl:b.getScrollLeft(),pt:2,dl:!1,tg:ea};if(b.ispage||!H.directionlockdeadzone)b.rail.drag.dl="f";else{qa=n.width();var ra=n.height(),xa=b.getContentSize();ra=xa.h-ra;qa=xa.w-qa;b.rail.drag.ck=b.rail.scrollable&&!b.railh.scrollable?ra>0?"v":!1:!b.rail.scrollable&&b.railh.scrollable?qa>0?"h":!1:!1}H.emulatetouch&&b.isiframe&&P.isie&&(qa=b.win.position(),b.rail.drag.x+=qa.left,
b.rail.drag.y+=qa.top);b.hasmoving=!1;b.lastmouseup=!1;b.scrollmom.reset(Y.clientX,Y.clientY);if(ea&&ma){if(!/INPUT|SELECT|BUTTON|TEXTAREA/i.test(ea.nodeName))return P.hasmousecapture&&ea.setCapture(),H.emulatetouch?(ea.onclick&&!ea._onclick&&(ea._onclick=ea.onclick,ea.onclick=function(ua){if(b.hasmoving)return!1;ea._onclick.call(this,ua)}),b.cancelEvent(Y)):b.stopPropagation(Y);/SUBMIT|CANCEL|BUTTON/i.test(a(ea).attr("type"))&&(b.preventclick={tg:ea,click:!1})}}};b.ontouchend=function(Y){if(!b||
!b.rail.drag)return!0;if(b.rail.drag.pt==2){if(Y.pointerType&&(Y.pointerType==="mouse"||Y.pointerType===Y.MSPOINTER_TYPE_MOUSE))return!1;b.rail.drag=!1;var ea=Y.type==="mouseup";if(b.hasmoving&&(b.scrollmom.doMomentum(),b.lastmouseup=!0,b.hideCursor(),P.hasmousecapture&&d.releaseCapture(),ea))return b.cancelEvent(Y)}else if(b.rail.drag.pt==1)return b.onmouseup(Y)};var Z=H.emulatetouch&&b.isiframe&&!P.hasmousecapture,da=H.directionlockdeadzone*.3|0;b.ontouchmove=function(Y,ea){if(!b||!b.rail.drag||
Y.targetTouches&&H.preventmultitouchscrolling&&Y.targetTouches.length>1||Y.pointerType&&(Y.pointerType==="mouse"||Y.pointerType===Y.MSPOINTER_TYPE_MOUSE))return!0;if(b.rail.drag.pt==2){"changedTouches"in Y&&(Y.clientX=Y.changedTouches[0].clientX,Y.clientY=Y.changedTouches[0].clientY);var ma;var qa=ma=0;Z&&!ea&&(ea=b.win.position(),qa=-ea.left,ma=-ea.top);var ra=Y.clientY+ma;ea=ra-b.rail.drag.y;var xa=Y.clientX+qa;ma=xa-b.rail.drag.x;var ua=b.rail.drag.st-ea;if(b.ishwscroll&&H.bouncescroll)ua<0?ua=
Math.round(ua/2):ua>b.page.maxh&&(ua=b.page.maxh+Math.round((ua-b.page.maxh)/2));else if(ua<0?ra=ua=0:ua>b.page.maxh&&(ua=b.page.maxh,ra=0),ra===0&&!b.hasmoving)return b.ispage||(b.rail.drag=!1),!0;var Aa=b.getScrollLeft();b.railh&&b.railh.scrollable&&(Aa=b.isrtlmode?ma-b.rail.drag.sl:b.rail.drag.sl-ma,b.ishwscroll&&H.bouncescroll?Aa<0?Aa=Math.round(Aa/2):Aa>b.page.maxw&&(Aa=b.page.maxw+Math.round((Aa-b.page.maxw)/2)):(Aa<0&&(xa=Aa=0),Aa>b.page.maxw&&(Aa=b.page.maxw,xa=0)));if(!b.hasmoving){if(b.rail.drag.y===
Y.clientY&&b.rail.drag.x===Y.clientX)return b.cancelEvent(Y);qa=Math.abs(ea);ea=Math.abs(ma);ma=H.directionlockdeadzone;b.rail.drag.ck?b.rail.drag.ck=="v"?ea>ma&&qa<=da?b.rail.drag=!1:qa>ma&&(b.rail.drag.dl="v"):b.rail.drag.ck=="h"&&(qa>ma&&ea<=da?b.rail.drag=!1:ea>ma&&(b.rail.drag.dl="h")):qa>ma&&ea>ma?b.rail.drag.dl="f":qa>ma?b.rail.drag.dl=ea>da?"f":"v":ea>ma&&(b.rail.drag.dl=qa>da?"f":"h");if(!b.rail.drag.dl)return b.cancelEvent(Y);b.triggerScrollStart(Y.clientX,Y.clientY,0,0,0);b.hasmoving=!0}b.preventclick&&
!b.preventclick.click&&(b.preventclick.click=b.preventclick.tg.onclick||!1,b.preventclick.tg.onclick=b.onpreventclick);b.rail.drag.dl&&(b.rail.drag.dl=="v"?Aa=b.rail.drag.sl:b.rail.drag.dl=="h"&&(ua=b.rail.drag.st));b.synched("touchmove",function(){b.rail.drag&&b.rail.drag.pt==2&&(b.prepareTransition&&b.resetTransition(),b.rail.scrollable&&b.setScrollTop(ua),b.scrollmom.update(xa,ra),b.railh&&b.railh.scrollable?(b.setScrollLeft(Aa),b.showCursor(ua,Aa)):b.showCursor(ua),P.isie10&&d.selection.clear())});
return b.cancelEvent(Y)}if(b.rail.drag.pt==1)return b.onmousemove(Y)};b.ontouchstartCursor=function(Y,ea){if(!b.rail.drag||b.rail.drag.pt==3){if(b.locked)return b.cancelEvent(Y);b.cancelScroll();b.rail.drag={x:Y.touches[0].clientX,y:Y.touches[0].clientY,sx:b.scroll.x,sy:b.scroll.y,pt:3,hr:!!ea};ea=b.getTarget(Y);!b.ispage&&P.hasmousecapture&&ea.setCapture();b.isiframe&&!P.hasmousecapture&&(b.saved.csspointerevents=b.doc.css("pointer-events"),b.css(b.doc,{"pointer-events":"none"}));return b.cancelEvent(Y)}};
b.ontouchendCursor=function(Y){if(b.rail.drag&&(P.hasmousecapture&&d.releaseCapture(),b.isiframe&&!P.hasmousecapture&&b.doc.css("pointer-events",b.saved.csspointerevents),b.rail.drag.pt==3))return b.rail.drag=!1,b.cancelEvent(Y)};b.ontouchmoveCursor=function(Y){if(b.rail.drag&&b.rail.drag.pt==3){b.cursorfreezed=!0;if(b.rail.drag.hr){b.scroll.x=b.rail.drag.sx+(Y.touches[0].clientX-b.rail.drag.x);b.scroll.x<0&&(b.scroll.x=0);var ea=b.scrollvaluemaxw;b.scroll.x>ea&&(b.scroll.x=ea)}else b.scroll.y=b.rail.drag.sy+
(Y.touches[0].clientY-b.rail.drag.y),b.scroll.y<0&&(b.scroll.y=0),ea=b.scrollvaluemax,b.scroll.y>ea&&(b.scroll.y=ea);b.synched("touchmove",function(){b.rail.drag&&b.rail.drag.pt==3&&(b.showCursor(),b.rail.drag.hr?b.doScrollLeft(Math.round(b.scroll.x*b.scrollratio.x),H.cursordragspeed):b.doScrollTop(Math.round(b.scroll.y*b.scrollratio.y),H.cursordragspeed))});return b.cancelEvent(Y)}}}b.onmousedown=function(Y,ea){if(!b.rail.drag||b.rail.drag.pt==1){if(b.railslocked)return b.cancelEvent(Y);b.cancelScroll();
b.rail.drag={x:Y.clientX,y:Y.clientY,sx:b.scroll.x,sy:b.scroll.y,pt:1,hr:ea||!1};ea=b.getTarget(Y);P.hasmousecapture&&ea.setCapture();b.isiframe&&!P.hasmousecapture&&(b.saved.csspointerevents=b.doc.css("pointer-events"),b.css(b.doc,{"pointer-events":"none"}));b.hasmoving=!1;return b.cancelEvent(Y)}};b.onmouseup=function(Y){if(b.rail.drag){if(b.rail.drag.pt!=1)return!0;P.hasmousecapture&&d.releaseCapture();b.isiframe&&!P.hasmousecapture&&b.doc.css("pointer-events",b.saved.csspointerevents);b.rail.drag=
!1;b.cursorfreezed=!1;b.hasmoving&&b.triggerScrollEnd();return b.cancelEvent(Y)}};b.onmousemove=function(Y){if(b.rail.drag){if(b.rail.drag.pt===1){if(P.ischrome&&Y.which===0)return b.onmouseup(Y);b.cursorfreezed=!0;b.hasmoving||b.triggerScrollStart(Y.clientX,Y.clientY,0,0,0);b.hasmoving=!0;if(b.rail.drag.hr){b.scroll.x=b.rail.drag.sx+(Y.clientX-b.rail.drag.x);b.scroll.x<0&&(b.scroll.x=0);var ea=b.scrollvaluemaxw;b.scroll.x>ea&&(b.scroll.x=ea)}else b.scroll.y=b.rail.drag.sy+(Y.clientY-b.rail.drag.y),
b.scroll.y<0&&(b.scroll.y=0),ea=b.scrollvaluemax,b.scroll.y>ea&&(b.scroll.y=ea);b.synched("mousemove",function(){b.cursorfreezed&&(b.showCursor(),b.rail.drag.hr?b.scrollLeft(Math.round(b.scroll.x*b.scrollratio.x)):b.scrollTop(Math.round(b.scroll.y*b.scrollratio.y)))});return b.cancelEvent(Y)}}else b.checkarea=0};if(P.cantouch||H.emulatetouch)b.onpreventclick=function(Y){if(b.preventclick)return b.preventclick.tg.onclick=b.preventclick.click,b.preventclick=!1,b.cancelEvent(Y)},b.onclick=P.isios?!1:
function(Y){return b.lastmouseup?(b.lastmouseup=!1,b.cancelEvent(Y)):!0},H.grabcursorenabled&&P.cursorgrabvalue&&(b.css(b.ispage?b.doc:b.win,{cursor:P.cursorgrabvalue}),b.css(b.rail,{cursor:P.cursorgrabvalue}));else{var ia=function(Y){if(b.selectiondrag){if(Y){var ea=b.win.outerHeight();Y=Y.pageY-b.selectiondrag.top;Y>0&&Y<ea&&(Y=0);Y>=ea&&(Y-=ea);b.selectiondrag.df=Y}b.selectiondrag.df!==0&&(b.doScrollBy(-(b.selectiondrag.df*2/6)|0),b.debounced("doselectionscroll",function(){ia()},50))}};b.hasTextSelected=
"getSelection"in d?function(){return d.getSelection().rangeCount>0}:"selection"in d?function(){return d.selection.type!="None"}:function(){return!1};b.onselectionstart=function(Y){b.ispage||(b.selectiondrag=b.win.offset())};b.onselectionend=function(Y){b.selectiondrag=!1};b.onselectiondrag=function(Y){b.selectiondrag&&b.hasTextSelected()&&b.debounced("selectionscroll",function(){ia(Y)},250)}}P.hasw3ctouch?(b.css(b.ispage?a("html"):b.win,{"touch-action":"none"}),b.css(b.rail,{"touch-action":"none"}),
b.css(b.cursor,{"touch-action":"none"}),b.bind(b.win,"pointerdown",b.ontouchstart),b.bind(d,"pointerup",b.ontouchend),b.delegate(d,"pointermove",b.ontouchmove)):P.hasmstouch?(b.css(b.ispage?a("html"):b.win,{"-ms-touch-action":"none"}),b.css(b.rail,{"-ms-touch-action":"none"}),b.css(b.cursor,{"-ms-touch-action":"none"}),b.bind(b.win,"MSPointerDown",b.ontouchstart),b.bind(d,"MSPointerUp",b.ontouchend),b.delegate(d,"MSPointerMove",b.ontouchmove),b.bind(b.cursor,"MSGestureHold",function(Y){Y.preventDefault()}),
b.bind(b.cursor,"contextmenu",function(Y){Y.preventDefault()})):P.cantouch&&(b.bind(b.win,"touchstart",b.ontouchstart,!1,!0),b.bind(d,"touchend",b.ontouchend,!1,!0),b.bind(d,"touchcancel",b.ontouchend,!1,!0),b.delegate(d,"touchmove",b.ontouchmove,!1,!0));H.emulatetouch&&(b.bind(b.win,"mousedown",b.ontouchstart,!1,!0),b.bind(d,"mouseup",b.ontouchend,!1,!0),b.bind(d,"mousemove",b.ontouchmove,!1,!0));if(H.cursordragontouch||!P.cantouch&&!H.emulatetouch)b.rail.css({cursor:"default"}),b.railh&&b.railh.css({cursor:"default"}),
b.jqbind(b.rail,"mouseenter",function(){if(!b.ispage&&!b.win.is(":visible"))return!1;b.canshowonmouseevent&&b.showCursor();b.rail.active=!0}),b.jqbind(b.rail,"mouseleave",function(){b.rail.active=!1;b.rail.drag||b.hideCursor()}),H.sensitiverail&&(b.bind(b.rail,"click",function(Y){b.doRailClick(Y,!1,!1)}),b.bind(b.rail,"dblclick",function(Y){b.doRailClick(Y,!0,!1)}),b.bind(b.cursor,"click",function(Y){b.cancelEvent(Y)}),b.bind(b.cursor,"dblclick",function(Y){b.cancelEvent(Y)})),b.railh&&(b.jqbind(b.railh,
"mouseenter",function(){if(!b.ispage&&!b.win.is(":visible"))return!1;b.canshowonmouseevent&&b.showCursor();b.rail.active=!0}),b.jqbind(b.railh,"mouseleave",function(){b.rail.active=!1;b.rail.drag||b.hideCursor()}),H.sensitiverail&&(b.bind(b.railh,"click",function(Y){b.doRailClick(Y,!1,!0)}),b.bind(b.railh,"dblclick",function(Y){b.doRailClick(Y,!0,!0)}),b.bind(b.cursorh,"click",function(Y){b.cancelEvent(Y)}),b.bind(b.cursorh,"dblclick",function(Y){b.cancelEvent(Y)})));H.cursordragontouch&&(this.istouchcapable||
P.cantouch)&&(b.bind(b.cursor,"touchstart",b.ontouchstartCursor),b.bind(b.cursor,"touchmove",b.ontouchmoveCursor),b.bind(b.cursor,"touchend",b.ontouchendCursor),b.cursorh&&b.bind(b.cursorh,"touchstart",function(Y){b.ontouchstartCursor(Y,!0)}),b.cursorh&&b.bind(b.cursorh,"touchmove",b.ontouchmoveCursor),b.cursorh&&b.bind(b.cursorh,"touchend",b.ontouchendCursor));H.emulatetouch||P.isandroid||P.isios?(b.bind(P.hasmousecapture?b.win:d,"mouseup",b.ontouchend),b.onclick&&b.bind(d,"click",b.onclick),H.cursordragontouch?
(b.bind(b.cursor,"mousedown",b.onmousedown),b.bind(b.cursor,"mouseup",b.onmouseup),b.cursorh&&b.bind(b.cursorh,"mousedown",function(Y){b.onmousedown(Y,!0)}),b.cursorh&&b.bind(b.cursorh,"mouseup",b.onmouseup)):(b.bind(b.rail,"mousedown",function(Y){Y.preventDefault()}),b.railh&&b.bind(b.railh,"mousedown",function(Y){Y.preventDefault()}))):(b.bind(P.hasmousecapture?b.win:d,"mouseup",b.onmouseup),b.bind(d,"mousemove",b.onmousemove),b.onclick&&b.bind(d,"click",b.onclick),b.bind(b.cursor,"mousedown",b.onmousedown),
b.bind(b.cursor,"mouseup",b.onmouseup),b.railh&&(b.bind(b.cursorh,"mousedown",function(Y){b.onmousedown(Y,!0)}),b.bind(b.cursorh,"mouseup",b.onmouseup)),!b.ispage&&H.enablescrollonselection&&(b.bind(b.win[0],"mousedown",b.onselectionstart),b.bind(d,"mouseup",b.onselectionend),b.bind(b.cursor,"mouseup",b.onselectionend),b.cursorh&&b.bind(b.cursorh,"mouseup",b.onselectionend),b.bind(d,"mousemove",b.onselectiondrag)),b.zoom&&(b.jqbind(b.zoom,"mouseenter",function(){b.canshowonmouseevent&&b.showCursor();
b.rail.active=!0}),b.jqbind(b.zoom,"mouseleave",function(){b.rail.active=!1;b.rail.drag||b.hideCursor()})));H.enablemousewheel&&(b.isiframe||b.mousewheel(P.isie&&b.ispage?d:b.win,b.onmousewheel),b.mousewheel(b.rail,b.onmousewheel),b.railh&&b.mousewheel(b.railh,b.onmousewheelhr));b.ispage||P.cantouch||/HTML|^BODY/.test(b.win[0].nodeName)||(b.win.attr("tabindex")||b.win.attr({tabindex:++y}),b.bind(b.win,"focus",function(Y){t=b.getTarget(Y).id||b.getTarget(Y)||!1;b.hasfocus=!0;b.canshowonmouseevent&&
b.noticeCursor()}),b.bind(b.win,"blur",function(Y){t=!1;b.hasfocus=!1}),b.bind(b.win,"mouseenter",function(Y){z=b.getTarget(Y).id||b.getTarget(Y)||!1;b.hasmousefocus=!0;b.canshowonmouseevent&&b.noticeCursor()}),b.bind(b.win,"mouseleave",function(Y){z=!1;b.hasmousefocus=!1;b.rail.drag||b.hideCursor()}));b.onkeypress=function(Y){if(b.railslocked&&b.page.maxh===0)return!0;Y=Y||r.event;var ea=b.getTarget(Y);if(ea&&/INPUT|TEXTAREA|SELECT|OPTION/.test(ea.nodeName)&&(!ea.getAttribute("type")&&!ea.type||
!/submit|button|cancel/i.tp)||a(ea).attr("contenteditable"))return!0;if(b.hasfocus||b.hasmousefocus&&!t||b.ispage&&!t&&!z){ea=Y.keyCode;if(b.railslocked&&ea!=27)return b.cancelEvent(Y);var ma=Y.ctrlKey||!1,qa=Y.shiftKey||!1,ra=!1;switch(ea){case 38:case 63233:b.doScrollBy(72);ra=!0;break;case 40:case 63235:b.doScrollBy(-72);ra=!0;break;case 37:case 63232:b.railh&&(ma?b.doScrollLeft(0):b.doScrollLeftBy(72),ra=!0);break;case 39:case 63234:b.railh&&(ma?b.doScrollLeft(b.page.maxw):b.doScrollLeftBy(-72),
ra=!0);break;case 33:case 63276:b.doScrollBy(b.view.h);ra=!0;break;case 34:case 63277:b.doScrollBy(-b.view.h);ra=!0;break;case 36:case 63273:b.railh&&ma?b.doScrollPos(0,0):b.doScrollTo(0);ra=!0;break;case 35:case 63275:b.railh&&ma?b.doScrollPos(b.page.maxw,b.page.maxh):b.doScrollTo(b.page.maxh);ra=!0;break;case 32:H.spacebarenabled&&(qa?b.doScrollBy(b.view.h):b.doScrollBy(-b.view.h),ra=!0);break;case 27:b.zoomactive&&(b.doZoom(),ra=!0)}if(ra)return b.cancelEvent(Y)}};R=b.body[0];H.enablekeyboard&&
b.bind(R,P.isopera&&!P.isopera12?"keypress":"keydown",b.onkeypress);b.bind(d,"keydown",function(Y){Y.ctrlKey&&(b.wheelprevented=!0)});b.bind(d,"keyup",function(Y){Y.ctrlKey||(b.wheelprevented=!1)});b.bind(r,"blur",function(Y){b.wheelprevented=!1});b.bind(r,"resize",b.onscreenresize);b.bind(r,"orientationchange",b.onscreenresize);b.bind(r,"load",b.lazyResize);if(P.ischrome&&!b.ispage&&!b.haswrapper){var pa=b.win.attr("style");R=parseFloat(b.win.css("width"))+1;b.win.css("width",R);b.synched("chromefix",
function(){b.win.attr("style",pa)})}b.onAttributeChange=function(Y){b.lazyResize(b.isieold?250:30)};if(H.enableobserver&&(b.isie11||h===!1||(b.observerbody=new h(function(Y){Y.forEach(function(ea){if(ea.type=="attributes")return S.hasClass("modal-open")&&S.hasClass("modal-dialog")&&!a.contains(a(".modal-dialog")[0],b.doc[0])?b.hide():b.show()});if(b.me.clientWidth!=b.page.width||b.me.clientHeight!=b.page.height)return b.lazyResize(30)}),b.observerbody.observe(d.body,{childList:!0,subtree:!0,characterData:!1,
attributes:!0,attributeFilter:["class"]})),!b.ispage&&!b.haswrapper)){var sa=b.win[0];h!==!1?(b.observer=new h(function(Y){Y.forEach(b.onAttributeChange)}),b.observer.observe(sa,{childList:!0,characterData:!1,attributes:!0,subtree:!1}),b.observerremover=new h(function(Y){Y.forEach(function(ea){if(ea.removedNodes.length>0)for(var ma in ea.removedNodes)if(b&&ea.removedNodes[ma]===sa)return b.remove()})}),b.observerremover.observe(sa.parentNode,{childList:!0,characterData:!1,attributes:!1,subtree:!1})):
(b.bind(sa,P.isie&&!P.isie9?"propertychange":"DOMAttrModified",b.onAttributeChange),P.isie9&&sa.attachEvent("onpropertychange",b.onAttributeChange),b.bind(sa,"DOMNodeRemoved",function(Y){Y.target===sa&&b.remove()}))}!b.ispage&&H.boxzoom&&b.bind(r,"resize",b.resizeZoom);b.istextarea&&(b.bind(b.win,"keydown",b.lazyResize),b.bind(b.win,"mouseup",b.lazyResize));b.lazyResize(30)}if(this.doc[0].nodeName=="IFRAME"){var wa=function(){b.iframexd=!1;try{var Y="contentDocument"in this?this.contentDocument:this.contentWindow._doc}catch(ma){b.iframexd=
!0,Y=!1}if(b.iframexd)return"console"in r&&debug_log&&console.log("NiceScroll error: policy restriced iframe"),!0;b.forcescreen=!0;b.isiframe&&(b.iframe={doc:a(Y),html:b.doc.contents().find("html")[0],body:b.doc.contents().find("body")[0]},b.getContentSize=function(){return{w:Math.max(b.iframe.html.scrollWidth,b.iframe.body.scrollWidth),h:Math.max(b.iframe.html.scrollHeight,b.iframe.body.scrollHeight)}},b.docscroll=a(b.iframe.body));if(!P.isios&&H.iframeautoresize&&!b.isiframe){b.win.scrollTop(0);
b.doc.height("");var ea=Math.max(Y.getElementsByTagName("html")[0].scrollHeight,Y.body.scrollHeight);b.doc.height(ea)}b.lazyResize(30);b.css(a(b.iframe.body),O);P.isios&&b.haswrapper&&b.css(a(Y.body),{"-webkit-transform":"translate3d(0,0,0)"});"contentWindow"in this?b.bind(this.contentWindow,"scroll",b.onscroll):b.bind(Y,"scroll",b.onscroll);H.enablemousewheel&&b.mousewheel(Y,b.onmousewheel);H.enablekeyboard&&b.bind(Y,P.isopera?"keypress":"keydown",b.onkeypress);P.cantouch?(b.bind(Y,"touchstart",
b.ontouchstart),b.bind(Y,"touchmove",b.ontouchmove)):H.emulatetouch&&(b.bind(Y,"mousedown",b.ontouchstart),b.bind(Y,"mousemove",function(ma){return b.ontouchmove(ma,!0)}),H.grabcursorenabled&&P.cursorgrabvalue&&b.css(a(Y.body),{cursor:P.cursorgrabvalue}));b.bind(Y,"mouseup",b.ontouchend);b.zoom&&(H.dblclickzoom&&b.bind(Y,"dblclick",b.doZoom),b.ongesturezoom&&b.bind(Y,"gestureend",b.ongesturezoom))};this.doc[0].readyState&&this.doc[0].readyState==="complete"&&setTimeout(function(){wa.call(b.doc[0],
!1)},500);b.bind(this.doc,"load",wa)}};this.showCursor=function(O,Q){b.cursortimeout&&(clearTimeout(b.cursortimeout),b.cursortimeout=0);b.rail&&(b.autohidedom&&(b.autohidedom.stop().css({opacity:H.cursoropacitymax}),b.cursoractive=!0),b.rail.drag&&b.rail.drag.pt==1||(O!==void 0&&O!==!1&&(b.scroll.y=O/b.scrollratio.y|0),Q!==void 0&&(b.scroll.x=Q/b.scrollratio.x|0)),b.cursor.css({height:b.cursorheight,top:b.scroll.y}),b.cursorh&&(O=b.hasreversehr?b.scrollvaluemaxw-b.scroll.x:b.scroll.x,b.cursorh.css({width:b.cursorwidth,
left:!b.rail.align&&b.rail.visibility?O+b.rail.width:O}),b.cursoractive=!0),b.zoom&&b.zoom.stop().css({opacity:H.cursoropacitymax}))};this.hideCursor=function(O){b.cursortimeout||!b.rail||!b.autohidedom||b.hasmousefocus&&H.autohidemode==="leave"||(b.cursortimeout=setTimeout(function(){b.rail.active&&b.showonmouseevent||(b.autohidedom.stop().animate({opacity:H.cursoropacitymin}),b.zoom&&b.zoom.stop().animate({opacity:H.cursoropacitymin}),b.cursoractive=!1);b.cursortimeout=0},O||H.hidecursordelay))};
this.noticeCursor=function(O,Q,F){b.showCursor(Q,F);b.rail.active||b.hideCursor(O)};this.getContentSize=b.ispage?function(){return{w:Math.max(d.body.scrollWidth,d.documentElement.scrollWidth),h:Math.max(d.body.scrollHeight,d.documentElement.scrollHeight)}}:b.haswrapper?function(){return{w:b.doc[0].offsetWidth,h:b.doc[0].offsetHeight}}:function(){return{w:b.docscroll[0].scrollWidth,h:b.docscroll[0].scrollHeight}};this.onResize=function(O,Q){if(!b||!b.win)return!1;O=b.page.maxh;var F=b.page.maxw,R=
b.view.h,X=b.view.w;b.view={w:b.ispage?b.win.width():b.win[0].clientWidth,h:b.ispage?b.win.height():b.win[0].clientHeight};b.page=Q?Q:b.getContentSize();b.page.maxh=Math.max(0,b.page.h-b.view.h);b.page.maxw=Math.max(0,b.page.w-b.view.w);if(b.page.maxh==O&&b.page.maxw==F&&b.view.w==X&&b.view.h==R){if(b.ispage)return b;Q=b.win.offset();if(b.lastposition&&(O=b.lastposition,O.top==Q.top&&O.left==Q.left))return b;b.lastposition=Q}b.page.maxh===0?(b.hideRail(),b.scrollvaluemax=0,b.scroll.y=0,b.scrollratio.y=
0,b.cursorheight=0,b.setScrollTop(0),b.rail&&(b.rail.scrollable=!1)):(b.page.maxh-=H.railpadding.top+H.railpadding.bottom,b.rail.scrollable=!0);b.page.maxw===0?(b.hideRailHr(),b.scrollvaluemaxw=0,b.scroll.x=0,b.scrollratio.x=0,b.cursorwidth=0,b.setScrollLeft(0),b.railh&&(b.railh.scrollable=!1)):(b.page.maxw-=H.railpadding.left+H.railpadding.right,b.railh&&(b.railh.scrollable=H.horizrailenabled));b.railslocked=b.locked||b.page.maxh===0&&b.page.maxw===0;if(b.railslocked)return b.ispage||b.updateScrollBar(b.view),
!1;b.hidden||(b.rail.visibility||b.showRail(),b.railh&&!b.railh.visibility&&b.showRailHr());b.istextarea&&b.win.css("resize")&&b.win.css("resize")!="none"&&(b.view.h-=20);b.cursorheight=Math.min(b.view.h,Math.round(b.view.h/b.page.h*b.view.h));b.cursorheight=H.cursorfixedheight?H.cursorfixedheight:Math.max(H.cursorminheight,b.cursorheight);b.cursorwidth=Math.min(b.view.w,Math.round(b.view.w/b.page.w*b.view.w));b.cursorwidth=H.cursorfixedheight?H.cursorfixedheight:Math.max(H.cursorminheight,b.cursorwidth);
b.scrollvaluemax=b.view.h-b.cursorheight-(H.railpadding.top+H.railpadding.bottom);b.hasborderbox||(b.scrollvaluemax-=b.cursor[0].offsetHeight-b.cursor[0].clientHeight);b.railh&&(b.railh.width=b.page.maxh>0?b.view.w-b.rail.width:b.view.w,b.scrollvaluemaxw=b.railh.width-b.cursorwidth-(H.railpadding.left+H.railpadding.right));b.ispage||b.updateScrollBar(b.view);b.scrollratio={x:b.page.maxw/b.scrollvaluemaxw,y:b.page.maxh/b.scrollvaluemax};b.getScrollTop()>b.page.maxh?b.doScrollTop(b.page.maxh):(b.scroll.y=
b.getScrollTop()/b.scrollratio.y|0,b.scroll.x=b.getScrollLeft()/b.scrollratio.x|0,b.cursoractive&&b.noticeCursor());b.scroll.y&&b.getScrollTop()===0&&b.doScrollTo(b.scroll.y*b.scrollratio.y|0);return b};this.resize=b.onResize;var la=0;this.onscreenresize=function(O){clearTimeout(la);var Q=!b.ispage&&!b.haswrapper;Q&&b.hideRails();la=setTimeout(function(){b&&(Q&&b.showRails(),b.resize());la=0},120)};this.lazyResize=function(O){clearTimeout(la);O=isNaN(O)?240:O;la=setTimeout(function(){b&&b.resize();
la=0},O);return b};this.jqbind=function(O,Q,F){b.events.push({e:O,n:Q,f:F,q:!0});a(O).on(Q,F)};this.mousewheel=function(O,Q,F){O="jquery"in O?O[0]:O;if("onwheel"in d.createElement("div"))b._bind(O,"wheel",Q,F||!1);else{var R=d.onmousewheel!==void 0?"mousewheel":"DOMMouseScroll";M(O,R,Q,F||!1);R=="DOMMouseScroll"&&M(O,"MozMousePixelScroll",Q,F||!1)}};var na=!1;if(P.haseventlistener){try{var ba=Object.defineProperty({},"passive",{get:function(){na=!0}});r.addEventListener("test",null,ba)}catch(O){}this.stopPropagation=
function(O){if(!O)return!1;O=O.original?O.original:O;O.stopPropagation();return!1};this.cancelEvent=function(O){O.cancelable&&O.preventDefault();O.stopImmediatePropagation();O.preventManipulation&&O.preventManipulation();return!1}}else Event.prototype.preventDefault=function(){this.returnValue=!1},Event.prototype.stopPropagation=function(){this.cancelBubble=!0},r.constructor.prototype.addEventListener=d.constructor.prototype.addEventListener=Element.prototype.addEventListener=function(O,Q,F){this.attachEvent("on"+
O,Q)},r.constructor.prototype.removeEventListener=d.constructor.prototype.removeEventListener=Element.prototype.removeEventListener=function(O,Q,F){this.detachEvent("on"+O,Q)},this.cancelEvent=function(O){if(O=O||r.event)O.cancelBubble=!0,O.cancel=!0,O.returnValue=!1;return!1},this.stopPropagation=function(O){if(O=O||r.event)O.cancelBubble=!0;return!1};this.delegate=function(O,Q,F,R,X){var aa=m[Q]||!1;aa?b.events.push({e:O,n:Q,f:F,b:R,q:!1}):(aa={a:[],l:[],f:function(oa){for(var ta=aa.l,va=!1,Z=ta.length-
1;Z>=0;Z--)if(va=ta[Z].call(oa.target,oa),va===!1)return!1;return va}},b.bind(O,Q,aa.f,R,X),m[Q]=aa);b.ispage?(aa.a=[b.id].concat(aa.a),aa.l=[F].concat(aa.l)):(aa.a.push(b.id),aa.l.push(F))};this.undelegate=function(O,Q,F,R,X){if((F=m[Q]||!1)&&F.l)for(R=0,X=F.l.length;R<X;R++)F.a[R]===b.id&&(F.a.splice(R),F.l.splice(R),F.a.length===0&&(b._unbind(O,Q,F.l.f),m[Q]=null))};this.bind=function(O,Q,F,R,X){b._bind("jquery"in O?O[0]:O,Q,F,R||!1,X||!1)};this._bind=function(O,Q,F,R,X){b.events.push({e:O,n:Q,
f:F,b:R,q:!1});na&&(X||O==window.document||O==window.document.body||O==window)?O.addEventListener(Q,F,{passive:!1,capture:R}):O.addEventListener(Q,F,R||!1)};this._unbind=function(O,Q,F,R){m[Q]?b.undelegate(O,Q,F,R):O.removeEventListener(Q,F,R)};this.unbindAll=function(){for(var O=0;O<b.events.length;O++){var Q=b.events[O];Q.q?Q.e.unbind(Q.n,Q.f):b._unbind(Q.e,Q.n,Q.f,Q.b)}};this.showRails=function(){return b.showRail().showRailHr()};this.showRail=function(){b.page.maxh===0||!b.ispage&&b.win.css("display")==
"none"||(b.rail.visibility=!0,b.rail.css("display","block"));return b};this.showRailHr=function(){b.railh&&b.page.maxw!==0&&(b.ispage||b.win.css("display")!="none")&&(b.railh.visibility=!0,b.railh.css("display","block"));return b};this.hideRails=function(){return b.hideRail().hideRailHr()};this.hideRail=function(){b.rail.visibility=!1;b.rail.css("display","none");return b};this.hideRailHr=function(){b.railh&&(b.railh.visibility=!1,b.railh.css("display","none"));return b};this.show=function(){b.hidden=
!1;b.railslocked=!1;return b.showRails()};this.hide=function(){b.hidden=!0;b.railslocked=!0;return b.hideRails()};this.toggle=function(){return b.hidden?b.show():b.hide()};this.remove=function(){b.stop();b.cursortimeout&&clearTimeout(b.cursortimeout);for(var O in b.delaylist)b.delaylist[O]&&f(b.delaylist[O].h);b.doZoomOut();P.hasw3ctouch?b.undelegate(d,"pointermove",b.ontouchmove):P.hasmstouch?b.undelegate(d,"MSPointerMove",b.ontouchmove):P.cantouch&&b.undelegate(d,"touchmove",b.ontouchmove,!1,!0);
b.unbindAll();P.isie9&&b.win[0].detachEvent("onpropertychange",b.onAttributeChange);b.observer!==!1&&b.observer.disconnect();b.observerremover!==!1&&b.observerremover.disconnect();b.observerbody!==!1&&b.observerbody.disconnect();b.events=null;b.cursor&&b.cursor.remove();b.cursorh&&b.cursorh.remove();b.rail&&b.rail.remove();b.railh&&b.railh.remove();b.zoom&&b.zoom.remove();for(O=0;O<b.saved.css.length;O++){var Q=b.saved.css[O];Q[0].css(Q[1],Q[2]===void 0?"":Q[2])}b.saved=!1;b.me.data("__nicescroll",
"");var F=a.nicescroll;F.each(function(X){if(this&&this.id===b.id){delete F[X];for(var aa=++X;aa<F.length;aa++,X++)F[X]=F[aa];F.length--;F.length&&delete F[F.length]}});for(var R in b)b[R]=null,delete b[R];b=null};this.scrollstart=function(O){this.onscrollstart=O;return b};this.scrollend=function(O){this.onscrollend=O;return b};this.scrollcancel=function(O){this.onscrollcancel=O;return b};this.zoomin=function(O){this.onzoomin=O;return b};this.zoomout=function(O){this.onzoomout=O;return b};this.isScrollable=
function(O){O=O.target?O.target:O;if(O.nodeName=="OPTION")return!0;for(;O&&O.nodeType==1&&O!==this.me[0]&&!/^BODY|HTML/.test(O.nodeName);){var Q=a(O);Q=Q.css("overflowY")||Q.css("overflowX")||Q.css("overflow")||"";if(/scroll|auto/.test(Q))return O.clientHeight!=O.scrollHeight;O=O.parentNode?O.parentNode:!1}return!1};this.getViewport=function(O){for(O=O&&O.parentNode?O.parentNode:!1;O&&O.nodeType==1&&!/^BODY|HTML/.test(O.nodeName);){var Q=a(O);if(/fixed|absolute/.test(Q.css("position")))return Q;var F=
Q.css("overflowY")||Q.css("overflowX")||Q.css("overflow")||"";if(/scroll|auto/.test(F)&&O.clientHeight!=O.scrollHeight||Q.getNiceScroll().length>0)return Q;O=O.parentNode?O.parentNode:!1}return!1};this.triggerScrollStart=function(O,Q,F,R,X){b.onscrollstart&&b.onscrollstart.call(b,{type:"scrollstart",current:{x:O,y:Q},request:{x:F,y:R},end:{x:b.newscrollx,y:b.newscrolly},speed:X})};this.triggerScrollEnd=function(){if(b.onscrollend){var O=b.getScrollLeft(),Q=b.getScrollTop();b.onscrollend.call(b,{type:"scrollend",
current:{x:O,y:Q},end:{x:O,y:Q}})}};var ha=0,fa=0,Ga=0,Ba=1,Ca=!1;this.onmousewheel=function(O){if(b.wheelprevented||b.locked)return!1;if(b.railslocked)return b.debounced("checkunlock",b.resize,250),!1;if(b.rail.drag)return b.cancelEvent(O);H.oneaxismousemode==="auto"&&O.deltaX!==0&&(H.oneaxismousemode=!1);if(H.oneaxismousemode&&O.deltaX===0&&!b.rail.scrollable)return b.railh&&b.railh.scrollable?b.onmousewheelhr(O):!0;var Q=k(),F=!1;H.preservenativescrolling&&b.checkarea+600<Q&&(b.nativescrollingarea=
b.isScrollable(O),F=!0);b.checkarea=Q;if(b.nativescrollingarea)return!0;if(O=T(O,!1,F))b.checkarea=0;return O};this.onmousewheelhr=function(O){if(!b.wheelprevented){if(b.railslocked||!b.railh.scrollable)return!0;if(b.rail.drag)return b.cancelEvent(O);var Q=k(),F=!1;H.preservenativescrolling&&b.checkarea+600<Q&&(b.nativescrollingarea=b.isScrollable(O),F=!0);b.checkarea=Q;return b.nativescrollingarea?!0:b.railslocked?b.cancelEvent(O):T(O,!0,F)}};this.stop=function(){b.cancelScroll();b.scrollmon&&b.scrollmon.stop();
b.cursorfreezed=!1;b.scroll.y=Math.round(b.getScrollTop()*(1/b.scrollratio.y));b.noticeCursor();return b};this.getTransitionSpeed=function(O){return 80+O/72*H.scrollspeed|0};if(H.smoothscroll)if(b.ishwscroll&&P.hastransition&&H.usetransition&&H.smoothscroll){var Ha="";this.resetTransition=function(){Ha="";b.doc.css(P.prefixstyle+"transition-duration","0ms")};this.prepareTransition=function(O,Q){O=Q?O:b.getTransitionSpeed(O);Q=O+"ms";Ha!==Q&&(Ha=Q,b.doc.css(P.prefixstyle+"transition-duration",Q));
return O};this.doScrollLeft=function(O,Q){var F=b.scrollrunning?b.newscrolly:b.getScrollTop();b.doScrollPos(O,F,Q)};this.doScrollTop=function(O,Q){var F=b.scrollrunning?b.newscrollx:b.getScrollLeft();b.doScrollPos(F,O,Q)};this.cursorupdate={running:!1,start:function(){var O=this;if(!O.running){O.running=!0;var Q=function(){O.running&&u(Q);b.showCursor(b.getScrollTop(),b.getScrollLeft());b.notifyScrollEvent(b.win[0])};u(Q)}},stop:function(){this.running=!1}};this.doScrollPos=function(O,Q,F){F=b.getScrollTop();
var R=b.getScrollLeft();((b.newscrolly-F)*(Q-F)<0||(b.newscrollx-R)*(O-R)<0)&&b.cancelScroll();H.bouncescroll?(Q<0?Q=Q/2|0:Q>b.page.maxh&&(Q=b.page.maxh+(Q-b.page.maxh)/2|0),O<0?O=O/2|0:O>b.page.maxw&&(O=b.page.maxw+(O-b.page.maxw)/2|0)):(Q<0?Q=0:Q>b.page.maxh&&(Q=b.page.maxh),O<0?O=0:O>b.page.maxw&&(O=b.page.maxw));if(b.scrollrunning&&O==b.newscrollx&&Q==b.newscrolly)return!1;b.newscrolly=Q;b.newscrollx=O;F=b.getScrollTop();R=b.getScrollLeft();var X=O-R;var aa=Q-F;X=b.prepareTransition(Math.sqrt(X*
X+aa*aa)|0);b.scrollrunning||(b.scrollrunning=!0,b.triggerScrollStart(R,F,O,Q,X),b.cursorupdate.start());b.scrollendtrapped=!0;P.transitionend||(b.scrollendtrapped&&clearTimeout(b.scrollendtrapped),b.scrollendtrapped=setTimeout(b.onScrollTransitionEnd,X));b.setScrollTop(b.newscrolly);b.setScrollLeft(b.newscrollx)};this.cancelScroll=function(){if(!b.scrollendtrapped)return!0;var O=b.getScrollTop(),Q=b.getScrollLeft();b.scrollrunning=!1;P.transitionend||clearTimeout(P.transitionend);b.scrollendtrapped=
!1;b.resetTransition();b.setScrollTop(O);b.railh&&b.setScrollLeft(Q);b.timerscroll&&b.timerscroll.tm&&clearInterval(b.timerscroll.tm);b.timerscroll=!1;b.cursorfreezed=!1;b.cursorupdate.stop();b.showCursor(O,Q);return b};this.onScrollTransitionEnd=function(){if(b.scrollendtrapped){var O=b.getScrollTop(),Q=b.getScrollLeft();O<0?O=0:O>b.page.maxh&&(O=b.page.maxh);Q<0?Q=0:Q>b.page.maxw&&(Q=b.page.maxw);if(O!=b.newscrolly||Q!=b.newscrollx)return b.doScrollPos(Q,O,H.snapbackspeed);b.scrollrunning&&b.triggerScrollEnd();
b.scrollrunning=!1;b.scrollendtrapped=!1;b.resetTransition();b.timerscroll=!1;b.setScrollTop(O);b.railh&&b.setScrollLeft(Q);b.cursorupdate.stop();b.noticeCursor(!1,O,Q);b.cursorfreezed=!1}}}else this.doScrollLeft=function(O,Q){var F=b.scrollrunning?b.newscrolly:b.getScrollTop();b.doScrollPos(O,F,Q)},this.doScrollTop=function(O,Q){var F=b.scrollrunning?b.newscrollx:b.getScrollLeft();b.doScrollPos(F,O,Q)},this.doScrollPos=function(O,Q,F){F=b.getScrollTop();var R=b.getScrollLeft();((b.newscrolly-F)*
(Q-F)<0||(b.newscrollx-R)*(O-R)<0)&&b.cancelScroll();var X=!1;b.bouncescroll&&b.rail.visibility||(Q<0?(Q=0,X=!0):Q>b.page.maxh&&(Q=b.page.maxh,X=!0));b.bouncescroll&&b.railh.visibility||(O<0?(O=0,X=!0):O>b.page.maxw&&(O=b.page.maxw,X=!0));if(b.scrollrunning&&b.newscrolly===Q&&b.newscrollx===O)return!0;b.newscrolly=Q;b.newscrollx=O;b.dst={};b.dst.x=O-R;b.dst.y=Q-F;b.dst.px=R;b.dst.py=F;var aa=b.getTransitionSpeed(Math.sqrt(b.dst.x*b.dst.x+b.dst.y*b.dst.y)|0);b.bzscroll={};X=X?1:.58;b.bzscroll.x=new U(R,
b.newscrollx,aa,0,0,X,1);b.bzscroll.y=new U(F,b.newscrolly,aa,0,0,X,1);k();var oa=function(){if(b.scrollrunning){var ta=b.bzscroll.y.getPos();b.setScrollLeft(b.bzscroll.x.getNow());b.setScrollTop(b.bzscroll.y.getNow());ta<=1?b.timer=u(oa):(b.scrollrunning=!1,b.timer=0,b.triggerScrollEnd())}};b.scrollrunning||(b.triggerScrollStart(R,F,O,Q,aa),b.scrollrunning=!0,b.timer=u(oa))},this.cancelScroll=function(){b.timer&&f(b.timer);b.timer=0;b.bzscroll=!1;b.scrollrunning=!1;return b};else this.doScrollLeft=
function(O,Q){var F=b.getScrollTop();b.doScrollPos(O,F,Q)},this.doScrollTop=function(O,Q){var F=b.getScrollLeft();b.doScrollPos(F,O,Q)},this.doScrollPos=function(O,Q,F){var R=O>b.page.maxw?b.page.maxw:O;R<0&&(R=0);var X=Q>b.page.maxh?b.page.maxh:Q;X<0&&(X=0);b.synched("scroll",function(){b.setScrollTop(X);b.setScrollLeft(R)})},this.cancelScroll=function(){};this.doScrollBy=function(O,Q){J(0,O)};this.doScrollLeftBy=function(O,Q){J(O,0)};this.doScrollTo=function(O,Q){b.cursorfreezed=!1;b.doScrollTop(O)};
this.checkContentSize=function(){var O=b.getContentSize();O.h==b.page.h&&O.w==b.page.w||b.resize(!1,O)};b.onscroll=function(O){b.rail.drag||b.cursorfreezed||b.synched("scroll",function(){b.scroll.y=Math.round(b.getScrollTop()/b.scrollratio.y);b.railh&&(b.scroll.x=Math.round(b.getScrollLeft()/b.scrollratio.x));b.noticeCursor()})};b.bind(b.docscroll,"scroll",b.onscroll);this.doZoomIn=function(O){if(!b.zoomactive){b.zoomactive=!0;b.zoomrestore={style:{}};var Q="position top left zIndex backgroundColor marginTop marginBottom marginLeft marginRight".split(" "),
F=b.win[0].style,R;for(R in Q){var X=Q[R];b.zoomrestore.style[X]=F[X]!==void 0?F[X]:""}b.zoomrestore.style.width=b.win.css("width");b.zoomrestore.style.height=b.win.css("height");b.zoomrestore.padding={w:b.win.outerWidth()-b.win.width(),h:b.win.outerHeight()-b.win.height()};P.isios4&&(b.zoomrestore.scrollTop=n.scrollTop(),n.scrollTop(0));b.win.css({position:P.isios4?"absolute":"fixed",top:0,left:0,zIndex:e+100,margin:0});Q=b.win.css("backgroundColor");(""===Q||/transparent|rgba\(0, 0, 0, 0\)|rgba\(0,0,0,0\)/.test(Q))&&
b.win.css("backgroundColor","#fff");b.rail.css({zIndex:e+101});b.zoom.css({zIndex:e+102});b.zoom.css("backgroundPosition","0 -18px");b.resizeZoom();b.onzoomin&&b.onzoomin.call(b);return b.cancelEvent(O)}};this.doZoomOut=function(O){if(b.zoomactive)return b.zoomactive=!1,b.win.css("margin",""),b.win.css(b.zoomrestore.style),P.isios4&&n.scrollTop(b.zoomrestore.scrollTop),b.rail.css({"z-index":b.zindex}),b.zoom.css({"z-index":b.zindex}),b.zoomrestore=!1,b.zoom.css("backgroundPosition","0 0"),b.onResize(),
b.onzoomout&&b.onzoomout.call(b),b.cancelEvent(O)};this.doZoom=function(O){return b.zoomactive?b.doZoomOut(O):b.doZoomIn(O)};this.resizeZoom=function(){if(b.zoomactive){var O=b.getScrollTop();b.win.css({width:n.width()-b.zoomrestore.padding.w+"px",height:n.height()-b.zoomrestore.padding.h+"px"});b.onResize();b.setScrollTop(Math.min(b.page.maxh,O))}};this.init();a.nicescroll.push(this)},E=function(I){var C=this;this.nc=I;this.steptime=this.lasttime=this.speedy=this.speedx=this.lasty=this.lastx=0;this.snapy=
this.snapx=!1;this.demuly=this.demulx=0;this.lastscrolly=this.lastscrollx=-1;this.timer=this.chky=this.chkx=0;this.reset=function(g,q){C.stop();C.steptime=0;C.lasttime=k();C.speedx=0;C.speedy=0;C.lastx=g;C.lasty=q;C.lastscrollx=-1;C.lastscrolly=-1};this.update=function(g,q){var A=k();C.steptime=A-C.lasttime;C.lasttime=A;A=q-C.lasty;var M=g-C.lastx,J=C.nc.getScrollTop(),T=C.nc.getScrollLeft();J+=A;T+=M;C.snapx=T<0||T>C.nc.page.maxw;C.snapy=J<0||J>C.nc.page.maxh;C.speedx=M;C.speedy=A;C.lastx=g;C.lasty=
q};this.stop=function(){C.nc.unsynched("domomentum2d");C.timer&&clearTimeout(C.timer);C.timer=0;C.lastscrollx=-1;C.lastscrolly=-1};this.doSnapy=function(g,q){var A=!1;q<0?(q=0,A=!0):q>C.nc.page.maxh&&(q=C.nc.page.maxh,A=!0);g<0?(g=0,A=!0):g>C.nc.page.maxw&&(g=C.nc.page.maxw,A=!0);A?C.nc.doScrollPos(g,q,C.nc.opt.snapbackspeed):C.nc.triggerScrollEnd()};this.doMomentum=function(g){var q=k(),A=g?q+g:C.lasttime;g=C.nc.getScrollLeft();var M=C.nc.getScrollTop(),J=C.nc.page.maxh,T=C.nc.page.maxw;C.speedx=
T>0?Math.min(60,C.speedx):0;C.speedy=J>0?Math.min(60,C.speedy):0;A=A&&q-A<=60;if(M<0||M>J||g<0||g>T)A=!1;g=C.speedx&&A?C.speedx:!1;if(C.speedy&&A&&C.speedy||g){var b=Math.max(16,C.steptime);b>50&&(g=b/50,C.speedx*=g,C.speedy*=g,b=50);C.demulxy=0;C.lastscrollx=C.nc.getScrollLeft();C.chkx=C.lastscrollx;C.lastscrolly=C.nc.getScrollTop();C.chky=C.lastscrolly;var S=C.lastscrollx,H=C.lastscrolly,V=function(){var P=k()-q>600?.04:.02;C.speedx&&(S=Math.floor(C.lastscrollx-C.speedx*(1-C.demulxy)),C.lastscrollx=
S,S<0||S>T)&&(P=.1);C.speedy&&(H=Math.floor(C.lastscrolly-C.speedy*(1-C.demulxy)),C.lastscrolly=H,H<0||H>J)&&(P=.1);C.demulxy=Math.min(1,C.demulxy+P);C.nc.synched("domomentum2d",function(){C.speedx&&(C.nc.getScrollLeft(),C.chkx=S,C.nc.setScrollLeft(S));C.speedy&&(C.nc.getScrollTop(),C.chky=H,C.nc.setScrollTop(H));C.timer||(C.nc.hideCursor(),C.doSnapy(S,H))});C.demulxy<1?C.timer=setTimeout(V,b):(C.stop(),C.nc.hideCursor(),C.doSnapy(S,H))};V()}else C.doSnapy(C.nc.getScrollLeft(),C.nc.getScrollTop())}},
D=a.fn.scrollTop;typeof a.cssHooks==="object"&&(a.cssHooks.pageYOffset={get:function(I,C,g){return(C=a.data(I,"__nicescroll")||!1)&&C.ishwscroll?C.getScrollTop():D.call(I)},set:function(I,C){var g=a.data(I,"__nicescroll")||!1;g&&g.ishwscroll?g.setScrollTop(parseInt(C)):D.call(I,C);return this}});a.fn.scrollTop=function(I){if(I===void 0){var C=this[0]?a.data(this[0],"__nicescroll")||!1:!1;return C&&C.ishwscroll?C.getScrollTop():D.call(this)}return this.each(function(){var g=a.data(this,"__nicescroll")||
!1;g&&g.ishwscroll?g.setScrollTop(parseInt(I)):D.call(a(this),I)})};var B=a.fn.scrollLeft;typeof a.cssHooks==="object"&&(a.cssHooks.pageXOffset={get:function(I,C,g){return(C=a.data(I,"__nicescroll")||!1)&&C.ishwscroll?C.getScrollLeft():B.call(I)},set:function(I,C){var g=a.data(I,"__nicescroll")||!1;g&&g.ishwscroll?g.setScrollLeft(parseInt(C)):B.call(I,C);return this}});a.fn.scrollLeft=function(I){if(I===void 0){var C=this[0]?a.data(this[0],"__nicescroll")||!1:!1;return C&&C.ishwscroll?C.getScrollLeft():
B.call(this)}return this.each(function(){var g=a.data(this,"__nicescroll")||!1;g&&g.ishwscroll?g.setScrollLeft(parseInt(I)):B.call(a(this),I)})};var G=function(I){var C=this;this.length=0;this.name="nicescrollarray";this.each=function(A){a.each(C,A);return C};this.push=function(A){C[C.length]=A;C.length++};this.eq=function(A){return C[A]};if(I)for(var g=0;g<I.length;g++){var q=a.data(I[g],"__nicescroll")||!1;q&&(this[this.length]=q,this.length++)}return this};(function(I,C,g){for(var q=0,A=C.length;q<
A;q++)g(I,C[q])})(G.prototype,"show hide toggle onResize resize remove stop doScrollPos".split(" "),function(I,C){I[C]=function(){var g=arguments;return this.each(function(){this[C].apply(this,g)})}});a.fn.getNiceScroll=function(I){return I===void 0?new G(this):this[I]&&a.data(this[I],"__nicescroll")||!1};if(typeof a.expr==="object"){var N=a.expr.pseudos||a.expr[":"];N&&(N.nicescroll=function(I){return a.data(I,"__nicescroll")!==void 0})}a.fn.niceScroll=function(I,C){C!==void 0||typeof I!="object"||
"jquery"in I||(C=I,I=!1);var g=new G;this.each(function(){var q=a(this),A=a.extend({},C);if(I){var M=a(I);A.doc=M.length>1?a(I,q):M;A.win=q}"doc"in A&&!("win"in A)&&(A.win=q);M=q.data("__nicescroll")||!1;M||(A.doc=A.doc||q,M=new v(A,q),q.data("__nicescroll",M));g.push(M)});return g.length===1?g[0]:g};r.NiceScroll={getjQuery:function(){return a}};a.nicescroll||(a.nicescroll=new G,a.nicescroll.options=l)})(Da);var Va=function(){try{var a=typeof document==="undefined"&&typeof location==="undefined"?
require("url").pathToFileURL(__filename).href:typeof document==="undefined"?location.href:oc&&oc.tagName.toUpperCase()==="SCRIPT"&&oc.src||(new URL("zwplayer.min.js",document.baseURI)).href}catch(x){if(document.currentScript)var t=document.currentScript.src;else{a=document.scripts;for(var z=a.length-1,y=z;y>0;y--)if(a[y].readyState==="interactive"){t=a[y].src;break}t=t||a[z].src}a=t}t=a.indexOf("v=");t=t>0?a.substr(t+2):20260628;z=a.lastIndexOf("zwplayer/");z>=0?a=a.substring(0,z+9):(a=a.substring(0,
a.lastIndexOf("/")+1),a+="js/");return{path:a,v:t}}(),xb=Va.path+"plugins/",Oc=function(a,t,z,y){var x=document.getElementsByTagName("head");if(x.length==0){x=document.createElement("head");var e=document.getElementsByTagName("body");if(e.length>0)e=e[0],document.insertBefore(x,e);else return alert("Invalid html document: no HEAD tag"),!1}else{x=x[0];e=x.childNodes;for(var d=0;d<e.length;d++){var r=e[d];if(r.nodeName.toUpperCase()==="SCRIPT"&&r.id&&r.id==a){if(r.getAttribute("loadstate")!="true"){var n=
function(){r.getAttribute("loadstate")==="error"?typeof y=="function"&&y(a):r.getAttribute("loadstate")!="true"?setTimeout(n,50):typeof z=="function"&&z(a)};setTimeout(n,50);return!1}typeof z=="function"&&z(a);return!0}}}var m=document.createElement("script");m.type="text/javascript";m.onerror=function(){m.setAttribute("loadstate","error");typeof y=="function"&&y(a)};m.readyState?m.onreadystatechange=function(){if(m.readyState=="loaded"||m.readyState=="complete")m.onreadystatechange=null,m.setAttribute("loadstate",
"true"),typeof z=="function"&&z(a)}:m.onload=function(){m.setAttribute("loadstate","true");typeof z=="function"&&z(a)};m.id=a;m.src=t;x.appendChild(m);return!1},Ta={_onResize:function(a){var t=a.target||a.srcElement;if(t=t.__resizeTrigger__?t.__resizeTrigger__:t){var z=t.__z_resizeListeners;if(z)for(var y=z.length,x=0;x<y;x++){var e=z[x],d=e.handler;(e=e.context)||(e=t);if(d)d.apply(e,[a]);else if(a.type==="resize"||Object.prototype.toString.call(a)==="[object ResizeObserverEntry]")d=document.createEvent("Event"),
d.initEvent("resize",!1,!1),t.dispatchEvent(d)}}},addElement:function(a,t,z){var y=a.__z_resizeListeners;if(!y)if(y=[],a.__z_resizeListeners=y,typeof window.ResizeObserver==="function")this.resizeObserver||(this.resizeObserver=new ResizeObserver(function(e){for(var d=0;d<e.length;d++)this._onResize(e[d])}.bind(this))),this.resizeObserver.observe(a);else{getComputedStyle(a,null).position==="static"&&(a.style.position="relative");var x=document.createElement("object");x.resizer=this;x.__resizeElement__=
a;x.setAttribute("style","display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; opacity: 0; pointer-events: none; z-index: -9999;");x.type="text/html";x.data="about:blank";x.onload=function(e){this.contentDocument.defaultView.__resizeTrigger__=this.__resizeElement__;this.contentDocument.defaultView.addEventListener("resize",this.resizer._onResize)};a.appendChild(x);a.__resizeDetector__=x}y.push({handler:t,context:z})},removeElement:function(a,t,z){var y=a.__z_resizeListeners;
if(y){for(var x=y.length,e=0;e<x;e++){var d=y[e];if(d.handler===t&&d.context===z){y.splice(e,1);break}}if(y.length===0){if(t=a.__resizeDetector__)t.contentDocument.defaultView.removeEventListener("resize",this._onResize),a.removeChild(t),delete a.__resizeDetector__;delete a.__z_resizeListeners;this.resizeObserver&&this.resizeObserver.unobserve(a)}}}},Kb=lb();var bd=function(){var a={playerObj:null,opacity:70,onInit:null,onClose:null,onResize:null};return{create:function(t){var z={},y;for(y in a)z[y]=
a[y];for(y in t)z[y]=t[y];typeof z.playerId=="undefined"&&(z.playerId="video-body");return new function(x){x=x.playerId;this.rows=[];this.timerId=this.rowCount=0;this.frameDuration=40;this.Danmulayer=null;this.danmuMargin=50;this.speedX=100;this.hasTransition=!0;this.rowHeight=28;this.topMargin=10;this.layerHeight=this.layerWidth=0;this.fontSize="25px";if(typeof x=="string")this.vPlayer=document.getElementById(x);else if(typeof x=="object")this.vPlayer=x;else return;this.vPlayer||(this.vPlayer=document.getElementById("video-body"));
if(this.vPlayer&&(x=this.vPlayer.childNodes,x.length>0))for(var e=0;e<x.length;e++){var d=x[e];if(d.nodeName=="DIV"&&mb(d.className,"danmuplayer")){this.wrapObj=d;break}}if(this.wrapObj){if(x=this.wrapObj.childNodes,x.length>0)for(e=0;e<x.length;e++)if(d=x[e],d.nodeName=="DIV"&&mb(d.className,"danmu-layer")){this.Danmulayer=d;break}}else this.wrapObj=document.createElement("div"),this.wrapObj.className="danmuplayer",this.vPlayer.appendChild(this.wrapObj),this.Danmulayer=document.createElement("div"),
this.Danmulayer.className="danmu-layer",this.wrapObj.appendChild(this.Danmulayer),Kb.ie&&Kb.ver<9&&(this.wrapObj.style.height=this.vPlayer.offsetHeight-45+"px");if(this.Danmulayer){this.hasTransition=typeof this.Danmulayer.style.transition!="undefined";this.rowCount=Math.floor(Math.floor((this.Danmulayer.offsetHeight-this.topMargin)*2/3)/this.rowHeight);if(this.rowCount>0)for(e=0;e<this.rowCount;e++)this.rows.push({top:this.topMargin+this.rowHeight*e,count:0,last:null,idx:e});this.layerWidth=this.Danmulayer.offsetWidth;
this.layerHeight=this.Danmulayer.offsetHeight;Ta.addElement(this.Danmulayer);this.Danmulayer.addEventListener("resize",function(r){this.reCalcLayout()}.bind(this))}this.start=function(r){this.timerId&&(clearInterval(this.timerId),this.timerId=0);if(!this.hasTransition){var n=this;this.timerId=setInterval(function(){var m=n.Danmulayer,u=m.childNodes;if(u.length>0){for(var f=[],c=0;c<u.length;c++){var h=u[c];if(h.tagName=="DIV"){var k=parseFloat(h.style.left);k+h.offsetWidth<0?f.push(h):h.style.left=
k-4.5+"px"}}if(f.length>0){for(c=0;c<f.length;c++)u=f[c],u.rowIdx&&(n.rows[u.rowIdx].last==this&&(n.rows[u.rowIdx].last=null),n.rows[u.rowIdx].count--),m.removeChild(f[c]);f.splice(0,f.length)}}},this.frameDuration)}};this.stop=function(){this.timerId&&(clearInterval(this.timerId),this.timerId=0);var r=this.Danmulayer.childNodes;if(r.length>0)for(var n=0;n<r.length;n++)r[n].style.display="none";this.Danmulayer.style.display="none"};this.destroy=function(){this.Danmulayer&&(Ta.removeElement(this.Danmulayer),
delete this.Danmulayer);this.timerId&&(clearInterval(this.timerId),this.timerId=0);this.wrapObj&&this.vPlayer&&this.vPlayer.removeChild(this.wrapObj)};this.addDanmu=function(r,n){n||={};var m=document.createElement("div");m.className="danmu";typeof r.color=="undefined"||n.isFilterColorFont||(m.style.color=r.color);typeof r.border!="undefined"&&(m.style.border="1px solid #666");m.style.fontSize=n.forcedFontSizeValue?parseInt(25*n.forcedFontSizeValue/100)+"px":"25px";this.fontSize!=m.style.fontSize&&
(this.rowHeight=parseInt(m.style.fontSize)+3,this.layerHeight=0,this.reCalcLayout(),this.fontSize=m.style.fontSize);r.outlineColor&&(m.style.outlineStyle="solid",m.style.outlineWidth="2px",m.style.outlineColor=r.outlineColor);m.style.opacity=n.opacityValue?n.opacityValue/100:"0.9";if(typeof window.replaceSmileDanmu=="function")m.innerHTML=window.replaceSmileDanmu(r.text,this.rowHeight,n);else{var u=document.createElement("div");u.textContent=r.text==null?"":String(r.text);m.innerHTML=u.innerHTML}u=
r=0;var f=999999;this.rowCount>this.rows.length&&(this.rowCount=this.rows.length);for(;r<this.rowCount;r++)if(this.rows[r].count==0){u=r;f=this.layerWidth;break}else if(this.rows[r].last){var c=this.rows[r].last;c=c.getBoundingClientRect().left+c.offsetWidth+this.danmuMargin;if(c<f&&(u=r,f=c,f<this.layerWidth))break}f<this.layerWidth&&(f=this.layerWidth);m.style.fontFamily='SimHei, "Microsoft JhengHei", Arial, Helvetica, sans-serif';m.style.textShadow="rgb(0, 0, 0) 1px 0px 1px, rgb(0, 0, 0) 0px 1px 1px, rgb(0, 0, 0) 0px -1px 1px, rgb(0, 0, 0) -1px 0px 1px";
m.style.cursor="pointer";m.style.left=f+"px";if(this.rows[u]){m.style.top=this.rows[u].top+"px";m.rowIdx=u;this.rows[u].last=m;this.rows[u].count++;this.Danmulayer.appendChild(m);var h=this;m.onmouseover=function(k){this.pause||(this.offsetLeft,this.pause=!0)};m.onmouseout=function(k){this.pause&&(this.pause=!1)};this.hasTransition&&(m.addEventListener("transitionend",function(){typeof this.rowIdx=="number"&&(h.rows[this.rowIdx].last==this&&(h.rows[this.rowIdx].last=null),h.rows[this.rowIdx].count--);
h.Danmulayer.removeChild(this)}),r=f+m.offsetWidth,n.speedValue?(n=parseInt(this.speedX*parseFloat(n.speedValue)),n==0&&(n=1),n=r/n+4*Math.random()):n=r/this.speedX+4*Math.random(),m.style.transition="transform "+n+"s linear",m.style.transform="translateX(-"+r+"px)")}};this.reCalcLayout=function(){if(this.Danmulayer){Kb.ie&&Kb.ver<9&&(this.wrapObj.style.height=this.vPlayer.offsetHeight-45+"px");var r=this.Danmulayer.offsetHeight;if(r!=this.layerHeight){this.rowCount=Math.floor(Math.floor((r-this.topMargin)*
2/3)/this.rowHeight);if(this.rowCount>0)if(this.rowCount>this.rows.length)for(var n=this.rows.length;n<this.rowCount;n++)this.rows.push({top:this.topMargin+this.rowHeight*n,count:0,last:null,idx:n});else for(n=0;n<this.rowCount;n++)this.rows[n].top=this.topMargin+this.rowHeight*n;this.layerHeight=r}if(this.Danmulayer.offsetWidth!=this.layerWidth){r=this.Danmulayer.childNodes;if(r.length>0)for(n=0;n<r.length;n++);this.layerWidth=this.Danmulayer.offsetWidth}}};this.hasTransition||this.start()}(z)}}}();
var Bb=!1,cd={about:"\u5173\u4e8e",current:"\u5f53\u524d","qs-auto":"\u81ea\u52a8\u5207\u6362",enterFullScreen:"\u8fdb\u5165\u5168\u5c4f",exitFullScreen:"\u9000\u51fa\u5168\u5c4f",subtitleOff:"\u5b57\u5e55\u5173\u95ed",allSubtitle:"\u5b57\u5e55\u603b\u5f00\u5173",closeSmallWindow:"\u5173\u95ed\u5c0f\u7a97\u53e3\u6a21\u5f0f",mainSubtitle:"\u7b2c\u4e00\u5b57\u5e55",secondSubtitle:"\u7b2c\u4e8c\u5b57\u5e55",speed:"\u500d\u901f",currentTime:"\u5f53\u524d\u65f6\u95f4",remainingTime:"\u5269\u4f59\u65f6\u95f4",
muted:"\u9759\u97f3",unmuted:"\u53d6\u6d88\u9759\u97f3",tapToUnmute:"\u70b9\u51fb\u5f00\u542f\u58f0\u97f3",danmuEnabled:"\u5f00\u542f\u5f39\u5e55",danmuDisabled:"\u5173\u95ed\u5f39\u5e55",playbackSpeed1x:"1.0x\u64ad\u653e",playbackSpeed2x:"2.0x\u64ad\u653e",level:"\u7ea7\u522b","media-prop":"\u5a92\u4f53\u6d41\u5c5e\u6027","player-help":"\u4f7f\u7528\u8bf4\u660e","version-update":"\u7248\u672c\u66f4\u65b0",waitStreamToReady:"\u6b63\u5728\u7b49\u5f85\u8282\u76ee...",externalSubtitle:"\u5916\u6302\u5b57\u5e55",
qualitySelection:"\u6e05\u6670\u5ea6\u9009\u62e9",danmuSettings:"\u5f39\u5e55\u8bbe\u7f6e",selectEmotion:"\u9009\u62e9\u8868\u60c5",loginToSendDanmu:"\u767b\u5f55\u540e\u624d\u53ef\u4ee5\u53d1\u9001\u5f39\u5e55\u54e6",send:"\u53d1\u9001",settings:"\u8bbe\u7f6e",mediaInfo:"\u5a92\u4f53\u4fe1\u606f",recordVideo:"\u5b8c\u6574\u5f55\u5236",recordAudio:"\u4ec5\u5f55\u97f3\u9891",shortcutRecord:"\u5f00\u59cb / \u505c\u6b62\u5f55\u5236",webFullscreen:"\u7f51\u9875\u5168\u5c4f",exitWebFullscreen:"\u9000\u51fa\u7f51\u9875\u5168\u5c4f",
rotateForBestExperience:"\u8bf7\u6a2a\u5c4f\u4ee5\u83b7\u5f97\u6700\u4f73\u89c2\u770b\u4f53\u9a8c",snapshot:"\u6293\u53d6\u56fe\u50cf",cast:"\u6295\u5c4f",casting:"\u6295\u5c4f - \u67e5\u627e\u8bbe\u5907\u4e2d...",castTo:"\u6295\u5c4f - \u70b9\u51fb\u65ad\u5f00",castDisconnect:"\u6295\u5c4f\u5df2\u65ad\u5f00",castError:"\u6295\u5c4f\u5931\u8d25\u6216\u672a\u53d1\u73b0\u53ef\u7528\u8bbe\u5907",castExternal:"\u5916\u90e8\u6d41\u5a92\u4f53\u8bbe\u5907",selectLocalVideo:"\u9009\u62e9\u672c\u5730\u89c6\u97f3\u9891\u6587\u4ef6",
pictureInPicture:"\u753b\u4e2d\u753b\u6a21\u5f0f",pipUnsupported:"\u5f53\u524d\u6d4f\u89c8\u5668\u4e0d\u652f\u6301\u753b\u4e2d\u753b",pluginLoadFailed:"\u5a92\u4f53\u5f15\u64ce\u52a0\u8f7d\u5931\u8d25",chapters:"\u7ae0\u8282",chapterList:"\u7ae0\u8282\u5217\u8868",danmu:"\u5f39\u5e55",login:"\u767b\u5f55",loginToParticipate:"\u767b\u5f55\u540e\u53ef\u4ee5\u53c2\u4e0e\u5f39\u5e55",brightness:"\u4eae\u5ea6",contrast:"\u5bf9\u6bd4\u5ea6",saturation:"\u9971\u548c\u5ea6",hue:"\u8272\u8c03",reset:"\u91cd\u7f6e",
colorfulText:"\u5f69\u8272\u6587\u5b57",imageEmoji:"\u56fe\u7247\u8868\u60c5",mirrorHorizontal:"\u5de6\u53f3\u7ffb\u8f6c",mirrorVertical:"\u4e0a\u4e0b\u7ffb\u8f6c",rotate90Clockwise:"\u987a90\u5ea6\u7ffb\u8f6c",rotate90Counterclockwise:"\u900690\u5ea6\u7ffb\u8f6c",loopPlayback:"\u5faa\u73af\u64ad\u653e",subtitleLoopRange:"\u6bb5\u843d\u5faa\u73af",subtitleLoopStart:"\u8d77",subtitleLoopEnd:"\u7ec8",subtitleLoopExpandHint:"\u518d\u70b9\u5176\u4ed6\u5b57\u5e55\u53ef\u6269\u5c55\u4e3a\u6bb5\u843d\u5faa\u73af",
recordLoopRangeHint:"\u5f55\u5236\u6b64\u6bb5\u843d\uff08{n} \u53e5\uff0c{sec} \u79d2\uff09",autoPlay:"\u81ea\u52a8\u64ad\u653e",recordingSettings:"\u5f55\u5236\u8bbe\u7f6e",recordingSettingsTitle:"\u5f55\u5236\u8bbe\u7f6e",recordingOptionAsk:"\u6bcf\u6b21\u8be2\u95ee",recordingOptionVideo:"\u5b8c\u6574\u5f55\u5236",recordingOptionAudio:"\u4ec5\u63d0\u53d6\u97f3\u9891",recordingNote:"\u6ce8\u610f\uff1a\u5982\u679c\u6ca1\u6709\u97f3\u9891\uff0c\u5219\u76f4\u63a5\u5f55\u5236\u89c6\u9891",audioVolumeBoost:"\u97f3\u6548\u8c03\u8282",
videoColorTuning:"\u89c6\u9891\u8272\u5ea6\u8c03\u8282",videoColorAdjustment:"\u89c6\u9891\u8272\u5ea6\u8c03\u8282",audioEffectAdjustment:"\u97f3\u6548\u8c03\u8282",volumeBoost:"\u97f3\u91cf\u589e\u5f3a",selectOrDropVideo:"\u70b9\u51fb\u6216\u62d6\u62fd\u6587\u4ef6\u5230\u6b64\u5904\u64ad\u653e",selectLocalVideoHint:"\u70b9\u51fb\u6253\u5f00\u672c\u5730\u89c6\u9891\u6587\u4ef6",supportedFormats:"\u89c6\u9891 \u00b7 \u5b57\u5e55 \u00b7 \u7ae0\u8282 \u00b7 \u914d\u97f3",dragDropToPlay:"\u62d6\u62fd\u6587\u4ef6\u5230\u6b64\u5904\uff08\u89c6\u9891/\u97f3\u9891/\u5b57\u5e55/\u7ae0\u8282\uff09",
pipModePlaying:"\u6b63\u5728\u300c\u753b\u4e2d\u753b\u300d\u6a21\u5f0f\u4e0b\u64ad\u653e",exitPictureInPicture:"\u9000\u51fa\u753b\u4e2d\u753b",close:"\u5173\u95ed\u63d0\u793a",unsupportedChapterFormat:"\u4e0d\u652f\u6301\u7684\u7ae0\u8282\u683c\u5f0f",invalidChapterFormat:"\u7ae0\u8282\u6587\u4ef6\u683c\u5f0f\u65e0\u6548",failedToReadChapter:"\u8bfb\u53d6\u7ae0\u8282\u6587\u4ef6\u5931\u8d25",chapterValidationFailed:"\u7ae0\u8282\u6587\u4ef6\u9a8c\u8bc1\u5931\u8d25",unsupportedSubtitleFormat:"\u4e0d\u652f\u6301\u7684\u5b57\u5e55\u683c\u5f0f",
invalidSubtitleFormat:"\u5b57\u5e55\u6587\u4ef6\u683c\u5f0f\u65e0\u6548",failedToReadSubtitle:"\u8bfb\u53d6\u5b57\u5e55\u6587\u4ef6\u5931\u8d25",subtitleValidationFailed:"\u5b57\u5e55\u6587\u4ef6\u9a8c\u8bc1\u5931\u8d25",subtitleSearch:"\u5b57\u5e55\u641c\u7d22",lang_zh:"\u4e2d\u6587",lang_chs:"\u7b80\u4e2d",lang_sc:"\u7b80\u4e2d",lang_cht:"\u7e41\u4e2d",lang_tc:"\u7e41\u4e2d",lang_en:"\u82f1\u8bed",lang_ja:"\u65e5\u8bed",lang_ko:"\u97e9\u8bed",lang_fr:"\u6cd5\u8bed",lang_de:"\u5fb7\u8bed",lang_es:"\u897f\u8bed",
lang_bi:"\u53cc\u8bed",lang_ru:"\u4fc4\u8bed",lang_ar:"\u963f\u62c9\u4f2f\u8bed",lang_th:"\u6cf0\u8bed",lang_sv:"\u745e\u5178\u8bed",lang_pt:"\u8461\u8bed",lang_it:"\u610f\u8bed",lang_pl:"\u6ce2\u5170\u8bed",lang_nl:"\u8377\u5170\u8bed",lang_tr:"\u571f\u8033\u5176\u8bed",lang_vi:"\u8d8a\u5357\u8bed",lang_id:"\u5370\u5c3c\u8bed",lang_hi:"\u5370\u5730\u8bed",lang_uk:"\u4e4c\u514b\u5170\u8bed",lang_cs:"\u6377\u514b\u8bed",lang_da:"\u4e39\u9ea6\u8bed",lang_fi:"\u82ac\u5170\u8bed",lang_no:"\u632a\u5a01\u8bed",
lang_ro:"\u7f57\u9a6c\u5c3c\u4e9a\u8bed",lang_el:"\u5e0c\u814a\u8bed",lang_ms:"\u9a6c\u6765\u8bed",lang_hu:"\u5308\u7259\u5229\u8bed",lang_bn:"\u5b5f\u52a0\u62c9\u8bed",lang_ta:"\u6cf0\u7c73\u5c14\u8bed",lang_te:"\u6cf0\u5362\u56fa\u8bed",lang_ml:"\u9a6c\u62c9\u96c5\u62c9\u59c6\u8bed",lang_mr:"\u9a6c\u62c9\u5730\u8bed",lang_gu:"\u53e4\u5409\u62c9\u7279\u8bed",lang_pa:"\u65c1\u906e\u666e\u8bed",lang_ne:"\u5c3c\u6cca\u5c14\u8bed",lang_si:"\u50e7\u4f3d\u7f57\u8bed",lang_he:"\u5e0c\u4f2f\u6765\u8bed",
lang_ka:"\u683c\u9c81\u5409\u4e9a\u8bed",lang_hy:"\u4e9a\u7f8e\u5c3c\u4e9a\u8bed",lang_km:"\u9ad8\u68c9\u8bed",lang_lo:"\u8001\u631d\u8bed",lang_my:"\u7f05\u7538\u8bed",lang_ca:"\u52a0\u6cf0\u7f57\u5c3c\u4e9a\u8bed",lang_af:"\u5357\u975e\u8377\u5170\u8bed",lang_is:"\u51b0\u5c9b\u8bed",lang_sq:"\u963f\u5c14\u5df4\u5c3c\u4e9a\u8bed",lang_et:"\u7231\u6c99\u5c3c\u4e9a\u8bed",lang_lv:"\u62c9\u8131\u7ef4\u4e9a\u8bed",lang_lt:"\u7acb\u9676\u5b9b\u8bed",lang_hr:"\u514b\u7f57\u5730\u4e9a\u8bed",lang_sk:"\u65af\u6d1b\u4f10\u514b\u8bed",
lang_sl:"\u65af\u6d1b\u6587\u5c3c\u4e9a\u8bed",lang_fil:"\u83f2\u5f8b\u5bbe\u8bed",lang_sw:"\u65af\u74e6\u5e0c\u91cc\u8bed",lang_fa:"\u6ce2\u65af\u8bed",lang_ur:"\u4e4c\u5c14\u90fd\u8bed",lang_bg:"\u4fdd\u52a0\u5229\u4e9a\u8bed",lang_sr:"\u585e\u5c14\u7ef4\u4e9a\u8bed",lang_mk:"\u9a6c\u5176\u987f\u8bed",lang_kk:"\u54c8\u8428\u514b\u8bed",lang_mn:"\u8499\u53e4\u8bed",trackN:"\u5b57\u5e55 {0}",subtitleSearchTitle:"\u5b57\u5e55\u641c\u7d22",searchScopeCurrent:"\u5f53\u524d\u89c6\u9891",searchScopeGroup:"\u64ad\u653e\u5217\u8868 (\u5f53\u524d\u7ec4)",
searchFilterLabel:"\u7b5b\u9009",searchTargetSummary:"\u641c\u7d22\u76ee\u6807\uff1a\u5df2\u9009 {0}/{1} \u4e2a\u89c6\u9891",selectAll:"\u5168\u9009",clearAll:"\u6e05\u7a7a",searchingProgress:"\u6b63\u5728\u641c\u7d22 {0}/{1} \u4e2a\u6587\u4ef6...",noSubtitleFile:"\u672a\u627e\u5230\u5b57\u5e55\u6587\u4ef6",loadSubtitleFailed:"\u5b57\u5e55\u52a0\u8f7d\u5931\u8d25",crossSearchTooManyHits:"\u7ed3\u679c\u8fc7\u591a\uff0c\u4ec5\u663e\u793a\u524d 500 \u6761\uff0c\u8bf7\u7ec6\u5316\u5173\u952e\u8bcd",searchMainSubtitle:"\u7b2c\u4e00\u5b57\u5e55",
searchSecondSubtitle:"\u7b2c\u4e8c\u5b57\u5e55",search:"\u641c\u7d22",inputSearchKeyword:"\u8bf7\u8f93\u5165\u641c\u7d22\u5173\u952e\u8bcd",noSearchResults:"\u672a\u627e\u5230\u5339\u914d\u7684\u5b57\u5e55",searchResultCount:"\u627e\u5230 {0} \u6761\u7ed3\u679c",searchFilterAll:"\u5168\u90e8",locateInFullList:"\u5728\u539f\u5217\u8868\u4e2d\u5b9a\u4f4d",resumeSearchFormat:"\u6062\u590d\u5bf9\u300c{0}\u300d\u7684\u641c\u7d22",fullListHint:"\u5168\u91cf\u5217\u8868",noSubtitlesLoaded:"\u672a\u52a0\u8f7d\u5b57\u5e55",
chapterSearch:"\u7ae0\u8282\u641c\u7d22...",chapterSearchTitle:"\u7ae0\u8282\u641c\u7d22",noChaptersLoaded:"\u672a\u52a0\u8f7d\u7ae0\u8282",noChapterSearchResults:"\u672a\u627e\u5230\u5339\u914d\u7684\u7ae0\u8282",localFileDisabled:"\u672c\u5730\u6587\u4ef6\u64ad\u653e\u529f\u80fd\u5df2\u7981\u7528",unsupportedFormat:"\u4e0d\u652f\u6301\u7684\u683c\u5f0f",invalidInput:"\u65e0\u6548\u8f93\u5165",unsupportedOperation:"\u4e0d\u652f\u6301\u7684\u64cd\u4f5c",playingFile:"\u6b63\u5728\u64ad\u653e",switchedToQuality:"\u5df2\u7ecf\u4e3a\u60a8\u5207\u6362\u5230",
quality:"\u753b\u8d28",mutedAutoplayMessagePre:"\u56e0",mutedAutoplayMessagePost:"\uff0c\u5df2\u9759\u97f3\u64ad\u653e\uff0c\u8bf7\u70b9\u51fb",autoplayBlockedMessagePost:"\uff0c\u7981\u6b62\u81ea\u52a8\u64ad\u653e\uff0c\u8bf7",browserLimits:"\u6d4f\u89c8\u5668\u9650\u5236",openAudio:"\u6253\u5f00\u58f0\u97f3",clickToPlay:"\u70b9\u51fb\u64ad\u653e",browserRestrictionsInfo:"\u5f53\u60a8\u8bbf\u95ee\u672c\u7f51\u7ad9\u7684\u6b21\u6570\u8f83\u5c11\uff0c\u6216\u7ecf\u5e38\u9759\u97f3\u64ad\u653e\u65f6\uff0c\u6d4f\u89c8\u5668\u53ef\u80fd\u4f1a\u9650\u5236\u7f51\u7ad9\u97f3\u91cf\uff0c\u5bfc\u81f4\u7f51\u7ad9\u65e0\u6cd5\u8fdb\u884c\u6709\u58f0\u81ea\u52a8\u64ad\u653e\u3002",
iUnderstand:"\u6211\u77e5\u9053\u4e86",danmuItems:"items",danmuDensityDefault:"30 items",danmuSendSettings:"\u53d1\u9001\u8bbe\u7f6e",danmuViewSettings:"\u89c2\u770b\u8bbe\u7f6e",danmuBlockSettings:"\u5c4f\u853d\u8bbe\u7f6e",danmuTextColor:"\u6587\u5b57\u989c\u8272",danmuTextBorder:"\u6587\u5b57\u8fb9\u6846",danmuOpacity:"\u4e0d\u900f\u660e\u5ea6",danmuFontSize:"\u6587\u5b57\u5927\u5c0f",danmuScrollSpeed:"\u6eda\u52a8\u901f\u5ea6",danmuDensity:"\u6392\u5217\u5bc6\u5ea6",danmuBottomArea:"\u5e95\u90e8\u533a\u57df",
keyboardShortcuts:"\u5feb\u6377\u952e\u8bf4\u660e",shortcutPlayPause:"\u64ad\u653e/\u6682\u505c",shortcutSeekRight:"\u5355\u6b21\u5feb\u8fdb5s\uff0c\u957f\u6309\u500d\u901f\u64ad\u653e",shortcutSeekLeft:"\u5feb\u90005s\uff0c\u957f\u6309\u8fde\u7eed\u64cd\u4f5c",shortcutVolume:"\u97f3\u91cf\u589e\u52a0/\u964d\u4f4e 5%",shortcutMute:"\u9759\u97f3 / \u5173\u95ed\u9759\u97f3",shortcutDanmu:"\u5f00\u542f / \u5173\u95ed\u5f39\u5e55",shortcutSendDanmu:"\u53d1\u9001\u5f39\u5e55",shortcutSpeed1x:"\u4e00\u500d\u901f (\u6b63\u5e38\u500d\u6570)",
shortcutSpeed2x:"\u4e8c\u500d\u901f",shortcutFrameStep:"\u9010\u5e27\u540e\u9000 / \u524d\u8fdb",frameStepForward:"\u9010\u5e27\u524d\u8fdb",frameStepBackward:"\u9010\u5e27\u540e\u9000",bumperSkipAd:"\u8df3\u8fc7\u5e7f\u544a",bumperSkipIn:"%s\u79d2\u540e\u53ef\u8df3\u8fc7\u5e7f\u544a",bumperRemaining:"\u5e7f\u544a %s",bumperLearnMore:"\u4e86\u89e3\u66f4\u591a",pauseAdClose:"\u5173\u95ed",shortcutSegmentNudgeStart:"\u5fae\u8c03\u8d77\u70b9\uff08Ctrl+,/. \u540e\u9000/\u524d\u8fdb\uff09",shortcutSegmentNudgeEnd:"\u5fae\u8c03\u7ec8\u70b9\uff08Alt+,/. \u540e\u9000/\u524d\u8fdb\uff09",
segmentHandleStartLabel:"\u7247\u6bb5\u8d77\u70b9\u624b\u67c4",segmentHandleEndLabel:"\u7247\u6bb5\u7ec8\u70b9\u624b\u67c4",segmentStart:"\u8d77\u70b9",segmentEnd:"\u7ec8\u70b9",commitSubtitleSuccess:"\u5df2\u66f4\u65b0\u5b57\u5e55\u65f6\u95f4\uff08\u53ef\u4e0b\u8f7d\u4fdd\u5b58\uff09",commitSubtitleNoSource:"\u6ca1\u6709\u53ef\u66f4\u65b0\u7684\u5b57\u5e55\u5faa\u73af\uff08\u8bf7\u5148\u8bbe\u7f6e\u5b57\u5e55\u5faa\u73af\uff09",commitSubtitleNotFound:"\u672a\u627e\u5230\u539f\u59cb\u5b57\u5e55\uff0c\u53ef\u80fd\u5df2\u5207\u6362\u8f68\u9053",
shortcutCommitSubtitle:"\u5199\u56de\u5fae\u8c03\u5230\u5b57\u5e55\uff08Save\uff09",shortcutShiftSubtitle:"\u6574\u4f53\u504f\u79fb\u5b57\u5e55\uff08Ctrl+Alt+Shift+S\uff09",shiftSubtitleSuccess:"\u5df2\u6574\u4f53\u504f\u79fb\u6240\u6709\u5b57\u5e55 {0}\uff08\u53ef\u4e0b\u8f7d\u4fdd\u5b58\uff09",shiftSubtitleNoLoop:"\u8bf7\u5148\u8bbe\u7f6e\u5b57\u5e55\u5faa\u73af\u5e76\u5fae\u8c03\u8d77\u70b9",shiftSubtitleZero:"\u65e0\u504f\u79fb\u91cf\uff08\u8bf7\u5148\u5fae\u8c03\u8d77\u70b9\uff09",shortcutExit:"\u5173\u95ed\u83dc\u5355 / \u9000\u51fa\u5168\u5c4f",
shortcutFullscreen:"\u5168\u5c4f / \u9000\u51fa\u5168\u5c4f",autoplayBlocked:"\u6d4f\u89c8\u5668\u963b\u6b62\u4e86\u81ea\u52a8\u64ad\u653e",playbackFailed:"\u64ad\u653e\u5931\u8d25",shortcutRestart:"\u91cd\u64ad",lightOn:"\u706f\u5149\u5f00\u542f",lightOff:"\u706f\u5149\u5173\u95ed",shortcutLight:"\u5f00/\u5173\u706f\u5149",segmentSelect:"\u9009\u62e9\u7247\u6bb5",record:"\u5f55\u5236",stopRecordVideo:"\u505c\u6b62\u89c6\u9891\u5f55\u5236",stopRecordAudio:"\u505c\u6b62\u97f3\u9891\u5f55\u5236",recordingInProgress:"\u6b63\u5728\u5f55\u5236",
stopRecordingWithDuration:"\u505c\u6b62\u5f55\u5236 ({duration})",zoom:"\u653e\u5927\u955c",disableZoom:"\u5173\u95ed\u653e\u5927\u955c",zoomLevel:"\u653e\u5927\u500d\u6570",failedToQueryTrtc:"\u67e5\u8be2TRTC\u4fe1\u4ee4\u670d\u52a1\u5668\u5931\u8d25",rtspNotSupported:"\u672a\u8bbe\u7f6eXMC\u65f6\uff0c\u4e0d\u652f\u6301RTSP\u534f\u8bae",cannotPlayHls:"\u64ad\u653e\u5668\u65e0\u6cd5\u64ad\u653eHLS\u5a92\u4f53",videoCodecUnsupported:"\u4e0d\u652f\u6301\u8be5\u89c6\u9891\u7f16\u7801",webcdnNotSupported:"\u672a\u8bbe\u7f6eCDN\u670d\u52a1\u5668\u5730\u5740\u65f6\uff0c\u4e0d\u652f\u6301WCDN\u534f\u8bae",
invalidWcdnUrl:"\u65e0\u6548\u7684WCDN\u7f51\u5740\uff1a",streamError:"\u6d41\u9519\u8bef",unknownError:"\u672a\u77e5\u9519\u8bef",serverClosed:"\u670d\u52a1\u5668\u5df2\u5173\u95ed\uff0c\u64ad\u653e\u5668\u505c\u6b62",wcdnConnectionClosed:"WCDN\u8fde\u63a5\u5df2\u88ab\u88ab\u52a8\u5173\u95ed",loadFailed:"\u52a0\u8f7d\u5931\u8d25",subtitleLoaded:"\u5b57\u5e55\u5df2\u52a0\u8f7d",subtitleLoadedN:"\u5df2\u52a0\u8f7d {0} \u6761\u5b57\u5e55",audioTrackLoaded:"\u97f3\u8f68\u5df2\u52a0\u8f7d",audioTrackLoadedN:"\u5df2\u52a0\u8f7d {0} \u6761\u97f3\u8f68",
chapterLoaded:"\u7ae0\u8282\u5df2\u52a0\u8f7d",loopChapter:"\u7ae0\u8282\u5faa\u73af",thumbnailLoaded:"\u7f29\u7565\u56fe\u5df2\u52a0\u8f7d",thumbnailImageNotFound:"\u672a\u5728\u62d6\u62fd\u6587\u4ef6\u4e2d\u627e\u5230\u7f29\u7565\u56fe\u96ea\u78a7\u56fe",thumbnailLinked:"\u7f29\u7565\u56fe\u5df2\u5173\u8054\u5230\u5f53\u524d\u89c6\u9891",chapterLinked:"\u7ae0\u8282\u5df2\u5173\u8054\u5230\u5f53\u524d\u89c6\u9891",annotationLinked:"\u6807\u6ce8\u5df2\u5173\u8054\u5230\u5f53\u524d\u89c6\u9891",annotationLoaded:"\u6807\u6ce8\u5df2\u52a0\u8f7d",
disableAnnotation:"\u7981\u7528\u6807\u6ce8",enableAnnotation:"\u542f\u7528\u6807\u6ce8",hotspotBackTo:"\u8fd4\u56de\u539f\u5904",annotVote:"\u6295\u7968",annotForm:"\u8868\u5355",annotCard:"\u4fe1\u606f\u5361",annotMulti:"[\u591a\u9009]",annotSingle:"[\u5355\u9009]",annotSubmit:"\u63d0\u4ea4",annotConfirmSubmit:"\u786e\u8ba4\u63d0\u4ea4",annotCorrect:"\u56de\u7b54\u6b63\u786e\uff01",annotWrong:"\u56de\u7b54\u9519\u8bef",annotAttemptsExceeded:"\u9519\u8bef\u6b21\u6570\u5df2\u8fbe\u4e0a\u9650\uff0c\u5c06\u56de\u9000\u91cd\u770b",
annotSubmitted:"\u5df2\u63d0\u4ea4",annotVoteThanks:"\u611f\u8c22\u60a8\u7684\u6295\u7968",annotFormSubmitted:"\u63d0\u4ea4\u6210\u529f",annotFieldRequired:"\u6b64\u9879\u4e0d\u80fd\u4e3a\u7a7a",annotCardConfirmed:"\u5df2\u786e\u8ba4",annotOK:"\u786e\u5b9a",annotOpenInMap:"\u5728\u5730\u56fe\u4e2d\u6253\u5f00",annotCopyLink:"\u590d\u5236\u94fe\u63a5",annotMaximize:"\u6700\u5927\u5316",annotClose:"\u5173\u95ed",annotMapBaidu:"\u767e\u5ea6\u5730\u56fe",annotMapAmap:"\u9ad8\u5fb7\u5730\u56fe",annotQuiz:"\u6d4b\u9a8c",
annotChoice:"\u9009\u9879\u5206\u652f",annotNtHotspot:"\u70ed\u533a",annotNtText:"\u6587\u672c",annotNtImage:"\u56fe\u7247",annotNtButton:"\u6309\u94ae",annotNtWebview:"\u7f51\u9875",annotNtMap:"\u5730\u56fe",annotNtCountdown:"\u5012\u8ba1\u65f6",annotNtSpeed:"\u53d8\u901f\u63a7\u5236",playlist:"\u64ad\u653e\u5217\u8868",refresh:"\u5237\u65b0",myFavorites:"\u6211\u7684\u6536\u85cf",searchPlaylist:"\u641c\u7d22...",sort:"\u6392\u5e8f",loading:"\u52a0\u8f7d\u4e2d...",playlistParseError:"\u64ad\u653e\u5217\u8868\u89e3\u6790\u5931\u8d25",
noPlaylistItems:"\u6682\u65e0\u8282\u76ee",playlistLoadFailed:"\u52a0\u8f7d\u64ad\u653e\u5217\u8868\u5931\u8d25",playlistNetworkError:"\u7f51\u7edc\u9519\u8bef","default":"\u9ed8\u8ba4",noSearchResult:"\u672a\u627e\u5230\u5339\u914d\u9879",unfavorite:"\u53d6\u6d88\u6536\u85cf",favorite:"\u6dfb\u52a0\u6536\u85cf",localFiles:"\u672c\u5730\u6587\u4ef6",playlistCreated:"\u64ad\u653e\u5217\u8868\u5df2\u521b\u5efa",playlistCleared:"\u64ad\u653e\u5217\u8868\u5df2\u6e05\u7a7a",videos:"\u4e2a\u89c6\u9891",
addedToPlaylist:"\u5df2\u6dfb\u52a0",clearPlaylist:"\u6e05\u7a7a\u5217\u8868",playlistLoaded:"\u64ad\u653e\u5217\u8868\u5df2\u52a0\u8f7d",duplicateFilesSkipped:"\u5df2\u8df3\u8fc7 {0} \u4e2a\u91cd\u590d\u6587\u4ef6",subtitleChapterNoVideo:"\u6ca1\u6709\u53ef\u5173\u8054\u7684\u89c6\u9891\uff0c\u5df2\u5ffd\u7565",remove:"\u79fb\u9664",previousTrack:"\u4e0a\u4e00\u4e2a",nextTrack:"\u4e0b\u4e00\u4e2a",musicPrevTrack:"\u4e0a\u4e00\u66f2",musicNextTrack:"\u4e0b\u4e00\u66f2",musicPipUnsupported:"\u5f53\u524d\u6d4f\u89c8\u5668\u4e0d\u652f\u6301\u753b\u4e2d\u753b\u6b4c\u8bcd",
playHistory:"\u64ad\u653e\u5386\u53f2",noHistoryItems:"\u6682\u65e0\u64ad\u653e\u8bb0\u5f55",clearHistory:"\u6e05\u9664\u5386\u53f2",shuffle:"\u968f\u673a\u64ad\u653e",shuffleOn:"\u968f\u673a\u64ad\u653e\uff1a\u5f00",shuffleOff:"\u968f\u673a\u64ad\u653e\uff1a\u5173",playMode:"\u64ad\u653e\u6a21\u5f0f",playModeContinuous:"\u8fde\u64ad",playModeLoop:"\u5217\u8868\u5faa\u73af",playModeRepeat:"\u5355\u66f2\u5faa\u73af",playModeOnce:"\u64ad\u653e\u4e00\u6b21",playModeShuffle:"\u968f\u673a\u64ad\u653e",
upNext:"\u5373\u5c06\u64ad\u653e",playErrorSkip:"\u8d44\u6e90\u64ad\u653e\u5931\u8d25\uff0c3\u79d2\u540e\u81ea\u52a8\u64ad\u653e\u4e0b\u4e00\u9996...",subtitleTranslate:"\u5b57\u5e55\u7ffb\u8bd1",subtitleTranslateTitle:"\u5b57\u5e55\u7ffb\u8bd1",translateSourceSubtitle:"\u539f\u59cb\u5b57\u5e55",translateTargetLang:"\u76ee\u6807\u8bed\u8a00",translateFirstSubtitle:"\u7b2c\u4e00\u5b57\u5e55",translateSecondSubtitle:"\u7b2c\u4e8c\u5b57\u5e55",translateBrowserLang:"\u6d4f\u89c8\u5668\u8bed\u8a00(\u81ea\u52a8)",
translateStart:"\u5f00\u59cb\u7ffb\u8bd1",translateApply:"\u5e94\u7528\u7ffb\u8bd1",translating:"\u6b63\u5728\u7ffb\u8bd1...",translateApplyToSub2:"\u5e94\u7528\u5230\u7b2c\u4e8c\u5b57\u5e55",translateDownloadSRT:"\u4e0b\u8f7d SRT",translateNoApi:"\u672a\u914d\u7f6e\u5b57\u5e55\u670d\u52a1\uff08translateApi\uff09",translateInvalidUrl:"\u5b57\u5e55\u670d\u52a1\u5730\u5740\u65e0\u6548",translateTimeout:"\u8bf7\u6c42\u8d85\u65f6",translateNoSubtitle:"\u65e0\u5b57\u5e55\u6570\u636e\uff0c\u8bf7\u5148\u52a0\u8f7d\u5b57\u5e55",
translateFailed:"\u7ffb\u8bd1\u5931\u8d25",translateSuccess:"\u7ffb\u8bd1\u5b8c\u6210",translateSuccessCount:"\u5171\u7ffb\u8bd1 {n} \u6761",translateApplied:"\u5df2\u5e94\u7528\u7ffb\u8bd1",ttsTitle:"\u5b57\u5e55\u8f6c\u914d\u97f3",ttsSourceSubtitle:"\u539f\u59cb\u5b57\u5e55",ttsTargetLang:"\u914d\u97f3\u8bed\u8a00",ttsCloneHint:"\u53ef\u9009\uff1a\u4e0a\u4f20 10\u201320 \u79d2\u7684\u53c2\u8003\u97f3\u9891\u4ee5\u590d\u523b\u58f0\u97f3\uff08\u4e0d\u4f20\u5219\u7528\u9ed8\u8ba4\u97f3\u8272\uff09",
ttsSelectAudio:"\u9009\u62e9\u53c2\u8003\u97f3\u9891",ttsStart:"\u5f00\u59cb\u5408\u6210",ttsSubmitting:"\u63d0\u4ea4\u4e2d\u2026",ttsPolling:"\u5408\u6210\u4e2d\u2026",ttsApply:"\u5e94\u7528\u914d\u97f3",ttsCancel:"\u53d6\u6d88",ttsCompleted:"\u2713 \u5408\u6210\u5b8c\u6210",ttsApplied:"\u2713 \u914d\u97f3\u5df2\u751f\u6210\u5e76\u5207\u6362",ttsFailed:"\u5408\u6210\u5931\u8d25",ttsCanceled:"\u5df2\u53d6\u6d88",ttsNoSubtitle:"\u65e0\u5b57\u5e55\u6570\u636e\uff0c\u8bf7\u5148\u52a0\u8f7d\u5b57\u5e55",
ttsNoApi:"\u672a\u914d\u7f6e\u5b57\u5e55\u670d\u52a1\uff08translateApi\uff09",ttsInvalidUrl:"\u5b57\u5e55\u670d\u52a1\u5730\u5740\u65e0\u6548",ttsAudioTooLarge:"\u53c2\u8003\u97f3\u9891\u8fc7\u5927\uff08\u4e0a\u9650 10MB\uff09",ttsStageQueued:"\u6392\u961f\u4e2d",ttsStageParsing:"\u89e3\u6790\u5b57\u5e55",ttsStageCloning:"\u590d\u523b\u97f3\u8272",ttsStageSynth:"\u5408\u6210\u8bed\u97f3",ttsStageAlign:"\u65f6\u95f4\u5bf9\u9f50",ttsStageMix:"\u6df7\u97f3\u7f16\u7801",ttsTimeout:"\u8bf7\u6c42\u8d85\u65f6",
ttsDownloadFailed:"\u914d\u97f3\u97f3\u9891\u4e0b\u8f7d\u5931\u8d25",loadedSubtitles:"\u5df2\u52a0\u8f7d\u5b57\u5e55",noTrack:"\u672a\u5206\u914d",primaryTrack:"\u4e3b",secondaryTrack:"\u526f",removeSubtitle:"\u79fb\u9664",addSubtitleFile:"\u6dfb\u52a0\u5b57\u5e55\u6587\u4ef6",showSubtitle:"\u663e\u793a\u5b57\u5e55",dualSubtitle:"\u53cc\u8bed\u5b57\u5e55",primarySubtitle:"\u4e3b\u5b57\u5e55",secondarySubtitle:"\u526f\u5b57\u5e55",subtitleSettings:"\u5b57\u5e55\u8bbe\u7f6e",downloadSubtitle:"\u4e0b\u8f7d\u5b57\u5e55",
downloadAudioTrack:"\u4e0b\u8f7d\u914d\u97f3",audioTrack:"\u97f3\u8f68",originalSound:"\u539f\u58f0",subtitleSize:"\u5b57\u5e55\u5927\u5c0f",subtitleSizeMin:"\u6700\u5c0f",subtitleSizeSmall:"\u8f83\u5c0f",subtitleSizeMedium:"\u9002\u4e2d",subtitleSizeLarge:"\u8f83\u5927",subtitleSizeMax:"\u6700\u5927",subtitleColor:"\u5b57\u5e55\u989c\u8272",subtitleColorWhite:"\u767d\u8272",subtitleColorLightGray:"\u6d45\u7070",subtitleColorDarkGray:"\u6df1\u7070",subtitleColorBlack:"\u7eaf\u9ed1",subtitleColorRed:"\u67d4\u548c\u7ea2",
subtitleColorYellow:"\u660e\u9ec4",subtitleColorOrange:"\u6a59\u8272",subtitleColorGreen:"\u67d4\u548c\u7eff",subtitleColorCyan:"\u9752\u8272",subtitleColorBlue:"\u6d45\u84dd",subtitleColorPurple:"\u67d4\u548c\u7d2b",subtitleColorPink:"\u54c1\u7ea2",subtitleOutline:"\u63cf\u8fb9\u65b9\u5f0f",subtitleOutlineNone:"\u65e0\u63cf\u8fb9",subtitleOutlineHeavy:"\u91cd\u63cf\u8fb9",subtitleOutlineShadow:"\u63cf\u8fb9",subtitleOutlineShadow45:"45\u00b0\u6295\u5f71",subtitlePosition:"\u9ed8\u8ba4\u4f4d\u7f6e",
subtitlePositionBottomLeft:"\u5de6\u4e0b\u89d2",subtitlePositionBottom:"\u5e95\u90e8\u5c45\u4e2d",subtitlePositionBottomRight:"\u53f3\u4e0b\u89d2",subtitlePositionTopLeft:"\u5de6\u4e0a\u89d2",subtitlePositionTop:"\u9876\u90e8\u5c45\u4e2d",subtitlePositionTopRight:"\u53f3\u4e0a\u89d2",subtitleBgOpacity:"\u80cc\u666f\u4e0d\u900f\u660e\u5ea6",subtitleScale:"\u7b49\u6bd4\u7f29\u653e",subtitleFade:"\u6de1\u5165\u6de1\u51fa",subtitleOthers:"\u663e\u793a\u6548\u679c",subtitleRestoreDefaults:"\u6062\u590d\u9ed8\u8ba4\u8bbe\u7f6e",
vr:"VR",activateVr:"\u542f\u7528 VR",gyroscope:"\u9640\u87ba\u4eea",vrSettings:"VR \u8bbe\u7f6e",vrSettingsTitle:"VR \u89c6\u89d2\u8bbe\u7f6e",vrYaw:"\u504f\u822a",vrPitch:"\u4fef\u4ef0",vrFov:"\u89c6\u91ce",vrUnsupported:"\u60a8\u7684\u6d4f\u89c8\u5668\u4e0d\u652f\u6301 VR \u6e32\u67d3",copyVrConfig:"\u590d\u5236\u914d\u7f6e",vrConfigCopied:"\u5df2\u590d\u5236 VR \u914d\u7f6e\u5230\u526a\u8d34\u677f",activateVrFirst:"\u8bf7\u5148\u6fc0\u6d3b VR",vrAutoDetected:"\u68c0\u6d4b\u5230\u5168\u666f\u89c6\u9891\uff0c\u5df2\u5207\u6362 VR \u6a21\u5f0f",
vrStereo:"\u4e0a\u4e0b\u5206\u5c4f",gyroDenied:"\u9640\u87ba\u4eea\u6743\u9650\u88ab\u62d2"},dd={playModeContinuous:"\u9023\u64ad",playModeLoop:"\u5217\u8868\u5faa\u74b0",playModeRepeat:"\u55ae\u66f2\u5faa\u74b0",playModeOnce:"\u64ad\u653e\u4e00\u6b21",playModeShuffle:"\u96a8\u6a5f\u64ad\u653e"},ed={about:"About",current:"Current","qs-auto":"Auto",enterFullScreen:"Enter Fullscreen",exitFullScreen:"Exit Fullscreen",subtitleOff:"Subtitles Off",allSubtitle:"All Subtitles",closeSmallWindow:"Close Small Window",
mainSubtitle:"First Subtitle",secondSubtitle:"Second Subtitle",speed:"Playback Speed",currentTime:"Current Time",remainingTime:"Remaining Time",muted:"Muted",unmuted:"Unmuted",tapToUnmute:"Tap to unmute",danmuEnabled:"Danmu Enabled",danmuDisabled:"Danmu Disabled",playbackSpeed1x:"Speed: 1x",playbackSpeed2x:"Speed: 2x",level:"Level","media-prop":"Media Properties","player-help":"User Guide","version-update":"Version Update",waitStreamToReady:"Waiting for stream to be ready...",externalSubtitle:"External Subtitles",
qualitySelection:"Quality Selection",danmuSettings:"Danmu Settings",selectEmotion:"Select Emotion",loginToSendDanmu:"Login required to send danmu",send:"Send",settings:"settings",mediaInfo:"Media Info",recordVideo:"Full Recording",recordAudio:"Audio Only",shortcutRecord:"Start / Stop Recording",webFullscreen:"Web Fullscreen",exitWebFullscreen:"Exit web fullscreen",rotateForBestExperience:"Rotate your device for the best experience",snapshot:"Snapshot",cast:"Cast",casting:"Cast - Finding devices...",
castTo:"Cast - Disconnect",castDisconnect:"Cast disconnected",castError:"Cast failed or no devices found",castExternal:"External Media Device",selectLocalVideo:"Select Local Video File",pictureInPicture:"Picture-in-Picture",pipUnsupported:"Picture-in-Picture is not supported by this browser",pluginLoadFailed:"Media engine failed to load",chapters:"Chapter",chapterList:"Chapter List",danmu:"Danmu",login:"Login",loginToParticipate:"Login to participate in danmu",videoColorAdjustment:"Video Color Adjustment",
brightness:"Brightness",contrast:"Contrast",saturation:"Saturation",hue:"Hue",reset:"Reset",colorfulText:"Color",imageEmoji:"Emoji",mirrorHorizontal:"H-Mirror",mirrorVertical:"V-Mirror",rotate90Clockwise:"90 CW",rotate90Counterclockwise:"90 CCW",loopPlayback:"Loop",subtitleLoopRange:"Range Loop",subtitleLoopStart:"Start",subtitleLoopEnd:"End",subtitleLoopExpandHint:"Click another subtitle to extend the loop range",recordLoopRangeHint:"Record this range ({n} cues, {sec}s)",autoPlay:"Auto Play",recordingSettings:"Recording Settings",
recordingSettingsTitle:"Recording Settings",recordingOptionAsk:"Ask Every Time",recordingOptionVideo:"Full Recording",recordingOptionAudio:"Audio Only",recordingNote:"Note: If no audio is present, video will be recorded directly",audioVolumeBoost:"Audio Effects",videoColorTuning:"Color Tuning",audioEffectAdjustment:"Audio Effects",volumeBoost:"Gain",selectOrDropVideo:"Click or drag file here to play",selectLocalVideoHint:"Click to open a local video file",supportedFormats:"Video \u00b7 Subtitle \u00b7 Chapter \u00b7 Audio track",
dragDropToPlay:"Drag files here (video/audio/subtitles/chapters)",pipModePlaying:"Playing in Picture-in-Picture mode",exitPictureInPicture:"Exit Picture-in-Picture",close:"Close",unsupportedChapterFormat:"Unsupported chapter format",invalidChapterFormat:"Invalid chapter file format",failedToReadChapter:"Failed to read chapter file",chapterValidationFailed:"Chapter file validation failed",unsupportedSubtitleFormat:"Unsupported subtitle format",invalidSubtitleFormat:"Invalid subtitle file format",failedToReadSubtitle:"Failed to read subtitle file",
subtitleValidationFailed:"Subtitle file validation failed",subtitleSearch:"Subtitle Search",lang_zh:"Chinese",lang_chs:"CHS",lang_sc:"CHS",lang_cht:"CHT",lang_tc:"CHT",lang_en:"English",lang_ja:"Japanese",lang_ko:"Korean",lang_fr:"French",lang_de:"German",lang_es:"Spanish",lang_bi:"Dual",lang_ru:"Russian",lang_ar:"Arabic",lang_th:"Thai",lang_sv:"Swedish",lang_pt:"Portuguese",lang_it:"Italian",lang_pl:"Polish",lang_nl:"Dutch",lang_tr:"Turkish",lang_vi:"Vietnamese",lang_id:"Indonesian",lang_hi:"Hindi",
lang_uk:"Ukrainian",lang_cs:"Czech",lang_da:"Danish",lang_fi:"Finnish",lang_no:"Norwegian",lang_ro:"Romanian",lang_el:"Greek",lang_ms:"Malay",lang_hu:"Hungarian",lang_bn:"Bengali",lang_ta:"Tamil",lang_te:"Telugu",lang_ml:"Malayalam",lang_mr:"Marathi",lang_gu:"Gujarati",lang_pa:"Punjabi",lang_ne:"Nepali",lang_si:"Sinhala",lang_he:"Hebrew",lang_ka:"Georgian",lang_hy:"Armenian",lang_km:"Khmer",lang_lo:"Lao",lang_my:"Burmese",lang_ca:"Catalan",lang_af:"Afrikaans",lang_is:"Icelandic",lang_sq:"Albanian",
lang_et:"Estonian",lang_lv:"Latvian",lang_lt:"Lithuanian",lang_hr:"Croatian",lang_sk:"Slovak",lang_sl:"Slovenian",lang_fil:"Filipino",lang_sw:"Swahili",lang_fa:"Persian",lang_ur:"Urdu",lang_bg:"Bulgarian",lang_sr:"Serbian",lang_mk:"Macedonian",lang_kk:"Kazakh",lang_mn:"Mongolian",trackN:"Track {0}",subtitleSearchTitle:"Subtitle Search",searchScopeCurrent:"Current Video",searchScopeGroup:"Playlist (Group)",searchFilterLabel:"Filter",searchTargetSummary:"Target: {0}/{1} videos selected",selectAll:"Select All",
clearAll:"Clear",searchingProgress:"Searching {0}/{1} files...",noSubtitleFile:"Subtitle file not found",loadSubtitleFailed:"Failed to load subtitle",crossSearchTooManyHits:"Too many results, showing first 500. Please refine your keyword.",searchMainSubtitle:"First",searchSecondSubtitle:"Second",subtitleTranslate:"Subtitle Translate",subtitleTranslateTitle:"Subtitle Translation",translateSourceSubtitle:"Source",translateTargetLang:"Target",translateFirstSubtitle:"First Subtitle",translateSecondSubtitle:"Second Subtitle",
translateBrowserLang:"Browser Language (Auto)",translateStart:"Translate",translateApply:"Apply Translation",translating:"Translating...",translateApplyToSub2:"Apply to 2nd Subtitle",translateDownloadSRT:"Download SRT",translateNoApi:"Translation service not configured",translateInvalidUrl:"Invalid translation service URL",translateTimeout:"Translation request timed out",translateNoSubtitle:"No subtitle loaded",translateFailed:"Translation failed",translateSuccess:"Translation complete",translateSuccessCount:"{n} subtitles translated",
translateApplied:"Translation applied",ttsTitle:"Subtitle to Speech",ttsSourceSubtitle:"Source",ttsTargetLang:"Voice Language",ttsCloneHint:"Optional: upload a 10\u201320s reference audio to clone the voice (default voice used if omitted)",ttsSelectAudio:"Select reference audio",ttsStart:"Synthesize",ttsSubmitting:"Submitting\u2026",ttsPolling:"Synthesizing\u2026",ttsApply:"Apply Dubbing",ttsCancel:"Cancel",ttsCompleted:"\u2713 Synthesis complete",ttsApplied:"\u2713 Dubbing generated and switched",
ttsFailed:"Synthesis failed",ttsCanceled:"Canceled",ttsNoSubtitle:"No subtitle loaded",ttsNoApi:"Subtitle service not configured (translateApi)",ttsInvalidUrl:"Invalid subtitle service URL",ttsAudioTooLarge:"Reference audio too large (max 10MB)",ttsStageQueued:"Queued",ttsStageParsing:"Parsing subtitle",ttsStageCloning:"Cloning voice",ttsStageSynth:"Synthesizing",ttsStageAlign:"Aligning",ttsStageMix:"Mixing & encoding",ttsTimeout:"Request timed out",ttsDownloadFailed:"Dubbing audio download failed",
loadedSubtitles:"Loaded Subtitles",noTrack:"Not assigned",primaryTrack:"Pri",secondaryTrack:"Sec",removeSubtitle:"Remove",addSubtitleFile:"Add Subtitle File",showSubtitle:"Show Subtitles",dualSubtitle:"Dual Subtitles",primarySubtitle:"Primary",secondarySubtitle:"Secondary",subtitleSettings:"Subtitle Settings",downloadSubtitle:"Download Subtitle",downloadAudioTrack:"Download Audio",audioTrack:"Audio Track",originalSound:"Original Sound",subtitleSize:"Size",subtitleSizeMin:"Min",subtitleSizeSmall:"Small",
subtitleSizeMedium:"Medium",subtitleSizeLarge:"Large",subtitleSizeMax:"Max",subtitleColor:"Color",subtitleColorWhite:"White",subtitleColorLightGray:"Light Gray",subtitleColorDarkGray:"Dark Gray",subtitleColorBlack:"Black",subtitleColorRed:"Red",subtitleColorYellow:"Yellow",subtitleColorOrange:"Orange",subtitleColorGreen:"Green",subtitleColorCyan:"Cyan",subtitleColorBlue:"Blue",subtitleColorPurple:"Purple",subtitleColorPink:"Pink",subtitleOutline:"Outline",subtitleOutlineNone:"None",subtitleOutlineHeavy:"Heavy",
subtitleOutlineShadow:"Shadow",subtitleOutlineShadow45:"45\u00b0 Shadow",subtitlePosition:"Position",subtitlePositionBottomLeft:"Bottom Left",subtitlePositionBottom:"Bottom Center",subtitlePositionBottomRight:"Bottom Right",subtitlePositionTopLeft:"Top Left",subtitlePositionTop:"Top Center",subtitlePositionTopRight:"Top Right",subtitleBgOpacity:"Background Opacity",subtitleScale:"Proportional Scale",subtitleFade:"Fade In/Out",subtitleOthers:"Effects",subtitleRestoreDefaults:"Restore Defaults",search:"Search",
inputSearchKeyword:"Enter search keyword",noSearchResults:"No matching subtitles found",searchResultCount:"Found {0} results",searchFilterAll:"All",locateInFullList:"Locate in full list",resumeSearchFormat:'Resume search for "{0}"',fullListHint:"Full list",noSubtitlesLoaded:"No subtitles loaded",chapterSearch:"Chapter Search...",chapterSearchTitle:"Chapter Search",noChaptersLoaded:"No chapters loaded",noChapterSearchResults:"No matching chapters found",localFileDisabled:"Local file playback is disabled",
unsupportedFormat:"Unsupported format",invalidInput:"Invalid input",unsupportedOperation:"Unsupported operation",playingFile:"playing",switchedToQuality:"Switched to",quality:"quality",mutedAutoplayMessagePre:"Muted due to ",mutedAutoplayMessagePost:". Click to ",autoplayBlockedMessagePost:". Autoplay blocked, click ",clickToPlay:"to play",openAudio:"Enable",browserRestrictionsInfo:"Browsers may limit audio volume when you visit this site infrequently or often play muted content, preventing automatic audio playback.",
iUnderstand:"OK",browserLimits:"Browser Restrictions",danmuItems:"items",danmuDensityDefault:"30 items",danmuSendSettings:"Send",danmuViewSettings:"View",danmuBlockSettings:"Block",danmuTextColor:"Text Color",danmuTextBorder:"Border",danmuOpacity:"Opacity",danmuFontSize:"Font Size",danmuScrollSpeed:"Speed",danmuDensity:"Density",danmuBottomArea:"Bottom Area",keyboardShortcuts:"Keyboard Shortcuts",shortcutPlayPause:"Play / Pause",shortcutSeekRight:"Single press: forward 5s, hold: speed playback",shortcutSeekLeft:"Rewind 5s (hold for continuous operation)",
shortcutVolume:"Increase / decrease volume by 5%",shortcutMute:"Mute / Unmute",shortcutDanmu:"Enable / Disable Danmu",shortcutSendDanmu:"Send Danmu",shortcutSpeed1x:"1x Speed (Normal)",shortcutSpeed2x:"2x Speed",shortcutFrameStep:"Frame Step Backward / Forward",frameStepForward:"Frame Step Forward",frameStepBackward:"Frame Step Backward",bumperSkipAd:"Skip Ad",bumperSkipIn:"Skip ad in %s",bumperRemaining:"Ad %s",bumperLearnMore:"Learn More",pauseAdClose:"Close",shortcutSegmentNudgeStart:"Nudge segment start (Ctrl+,/. back/forward)",
shortcutSegmentNudgeEnd:"Nudge segment end (Alt+,/. back/forward)",segmentHandleStartLabel:"Segment start handle",segmentHandleEndLabel:"Segment end handle",segmentStart:"Start",segmentEnd:"End",commitSubtitleSuccess:"Subtitle timing updated (download to save)",commitSubtitleNoSource:"No subtitle loop to update (set a subtitle loop first)",commitSubtitleNotFound:"Original subtitle not found (track may have changed)",shortcutCommitSubtitle:"Commit nudge to subtitle (Save)",shortcutShiftSubtitle:"Shift all subtitles (Ctrl+Alt+Shift+S)",
shiftSubtitleSuccess:"All subtitles shifted {0} (download to save)",shiftSubtitleNoLoop:"Set a subtitle loop and nudge start first",shiftSubtitleZero:"No offset (nudge start to set offset)",shortcutExit:"Close menu / Exit fullscreen",shortcutFullscreen:"Fullscreen / Exit fullscreen",autoplayBlocked:"Autoplay blocked by browser",playbackFailed:"Playback failed",shortcutRestart:"Restart",lightOn:"Light On",lightOff:"Light Off",shortcutLight:"Light Toggle",segmentSelect:"Select Segment",record:"Record",
stopRecordVideo:"Stop Video Recording",stopRecordAudio:"Stop Audio Recording",recordingInProgress:"Recording in progress",stopRecordingWithDuration:"Stop recording ({duration})",zoom:"Zoom",disableZoom:"Disable Zoom",zoomLevel:"Zoom Level",failedToQueryTrtc:"Failed to query TRTC signal server",rtspNotSupported:"The RTSP protocol is not supported without setting XMC",cannotPlayHls:"Player cannot play HLS media",videoCodecUnsupported:"Unsupported video codec",webcdnNotSupported:"The WCDN protocol is not supported without setting CDN server address",
invalidWcdnUrl:"Invalid WCDN URL: ",streamError:"Stream error",unknownError:"Unknown error",serverClosed:"Server is closed, player is stopped",wcdnConnectionClosed:"The WCDN connection has been passively closed",loadFailed:"Load failed",subtitleLoaded:"Subtitle loaded",subtitleLoadedN:"{0} subtitles loaded",audioTrackLoaded:"Audio track loaded",audioTrackLoadedN:"{0} audio tracks loaded",chapterLoaded:"Chapters loaded",loopChapter:"Loop Chapter",thumbnailLoaded:"Thumbnail loaded",thumbnailImageNotFound:"Thumbnail image not found in dropped files",
thumbnailLinked:"Thumbnail linked to current item",chapterLinked:"Chapter linked to current item",annotationLinked:"Annotation linked to current item",annotationLoaded:"Annotation loaded",disableAnnotation:"Disable Annotation",enableAnnotation:"Enable Annotation",hotspotBackTo:"Back to previous position",annotVote:"Vote",annotForm:"Form",annotCard:"Info Card",annotMulti:"[Multi]",annotSingle:"[Single]",annotSubmit:"Submit",annotConfirmSubmit:"Confirm",annotCorrect:"Correct!",annotWrong:"Wrong answer",
annotAttemptsExceeded:"Max attempts reached, rewinding",annotSubmitted:"Submitted",annotVoteThanks:"Thanks for voting",annotFormSubmitted:"Submitted successfully",annotFieldRequired:"This field is required",annotCardConfirmed:"Confirmed",annotOK:"OK",annotOpenInMap:"Open in map app",annotCopyLink:"Copy link",annotMaximize:"Maximize",annotClose:"Close",annotMapBaidu:"Baidu Map",annotMapAmap:"Amap",annotQuiz:"Quiz",annotChoice:"Choice",annotNtHotspot:"Hotspot",annotNtText:"Text",annotNtImage:"Image",
annotNtButton:"Button",annotNtWebview:"Web",annotNtMap:"Map",annotNtCountdown:"Countdown",annotNtSpeed:"Speed",playlist:"Playlist",refresh:"Refresh",myFavorites:"My Favorites",searchPlaylist:"Search...",sort:"Sort",loading:"Loading...",playlistParseError:"Failed to parse playlist",noPlaylistItems:"No items",playlistLoadFailed:"Failed to load playlist",playlistNetworkError:"Network error","default":"Default",noSearchResult:"No results found",unfavorite:"Remove from favorites",favorite:"Add to favorites",
localFiles:"Local Files",playlistCreated:"Playlist created",playlistCleared:"Playlist cleared",videos:"videos",addedToPlaylist:"Added",clearPlaylist:"Clear playlist",playlistLoaded:"Playlist loaded",duplicateFilesSkipped:"Skipped {0} duplicate file(s)",subtitleChapterNoVideo:"no video to attach to, ignored",remove:"Remove",previousTrack:"Previous",nextTrack:"Next",musicPrevTrack:"Previous Track",musicNextTrack:"Next Track",musicPipUnsupported:"Picture-in-Picture lyrics are not supported by this browser",
playHistory:"Play History",noHistoryItems:"No history",clearHistory:"Clear History",vr:"VR",activateVr:"Activate VR",gyroscope:"Gyroscope",vrSettings:"VR Settings",vrSettingsTitle:"VR View Settings",vrYaw:"Yaw",vrPitch:"Pitch",vrFov:"FOV",vrUnsupported:"Your browser does not support VR rendering",copyVrConfig:"Copy Config",vrConfigCopied:"VR config copied to clipboard",activateVrFirst:"Please activate VR first",vrAutoDetected:"Panorama video detected, switched to VR mode",vrStereo:"Top/Bottom",playMode:"Play Mode",
upNext:"Up Next",playErrorSkip:"Playback error. Auto-skipping to next in 3s...",shuffle:"Shuffle",shuffleOn:"Shuffle: On",shuffleOff:"Shuffle: Off",playModeContinuous:"Continuous",playModeLoop:"Loop All",playModeRepeat:"Repeat One",playModeOnce:"Play Once",playModeShuffle:"Shuffle",gyroDenied:"Gyroscope permission denied"},za={defaultLang:"en",languages:{"zh-CN":cd,zh:cd,"zh-HK":dd,"zh-TW":dd,"en-US":ed,en:ed}},vc=!1;za.defaultLang="en";var K=function(a,t,z){Qb();z=z||za.defaultLang;var y=za.languages[z];
!y&&z!=="en"&&za.languages.en&&(y=za.languages.en);if(y){if(y[a])return y[a];if(z!=="en"&&za.languages.en&&za.languages.en[a])return za.languages.en[a];if(z!=="zh-CN"&&za.languages["zh-CN"]&&za.languages["zh-CN"][a])return za.languages["zh-CN"][a]}return t||a},Sb=null,ne=function(a){for(var t=navigator.languages&&navigator.languages.length?navigator.languages:[navigator.language],z=0;z<a.length;z++)for(var y=0;y<t.length;y++)if(a[z].lang&&t[y]&&t[y].indexOf(a[z].lang)>-1)return a[z].text;return a.length===
1?a[0].text:null},wc=!1,ya=function(a,t){Tb();return Cb?a.classList!==void 0&&a.classList.contains(t):(new RegExp("\\b"+t+"\\b")).test(a.className)},ka=function(a,t){Tb();if(Cb)return a.classList.add(t);ya(a,t)||(a.className+=" "+t)},ja=function(a,t){Tb();if(Cb)return a.classList.remove(t);a.className=a.className.replace(new RegExp("\\b"+t+"\\b","g"),"")},Cb=!0;typeof window!=="undefined"&&(window.hasClass=ya,window.addClass=ka,window.removeClass=ja);var Ue=function(a,t){var z=typeof t==="function"?
t:function(y){return y};return'<ul class="zwp-subtitlesMenu">'+function(){var y='<li class="zwp-subtitles-item" data-id="-1">'+K("subtitleOff","Captions off")+"</li>";for(var x=0;x<a.length;x++){var e=ab(z(a[x].name)),d=ab(a[x].name),r=ab(a[x].id);y=x===0?y+('<li class="zwp-subtitles-item active" data-id="'+r+'" title="'+d+'">'+e+"</li>"):y+('<li class="zwp-subtitles-item" data-id="'+r+'" title="'+d+'">'+e+"</li>")}return y}()+"</ul>"},Ve=function(a,t){var z="";if(!t||!Array.isArray(t))return"";for(var y=
0;y<t.length;y++){var x=t[y],e=x.start_time!==void 0?x.start_time:x.time,d=Db(e);if(!(d>=a)){var r=d*100/a+"%",n=x.title||x.text||e+"",m=void 0;x.end_time!==void 0?m=Db(x.end_time)-d:x.duration!==void 0&&(m=Db(x.duration));if(typeof m!=="undefined"){var u="red";x.style&&typeof x.style.background!=="undefined"&&(u=x.style.background,u===null||u===void 0?u="transparent":(u=String(u).trim(),u=/^#[0-9a-fA-F]{3,8}$/.test(u)||/^rgba?\(\s*\d+\s*,\s*\d+\s*,\s*\d+\s*(,\s*[\d.]+\s*)?\)$/.test(u)||/^[a-zA-Z]+$/.test(u)?
u:"transparent"));d+m>a&&(m=a-d);z+='<span class="zwp__chapter_dot zwp_bar" style="left: '+r+"; width: "+(m*100/a+"%; border-radius: 3px; background-color: ")+u+';" title="'+ab(n)+'" data-time="'+ab(e)+'" data-desc="'+ab(x.desc)+'">&nbsp;</span>'}else z+='<span class="zwp__chapter_dot" style="left: '+r+'" title="'+ab(n)+'" data-time="'+ab(e)+'" data-desc="'+ab(x.desc)+'">&nbsp;</span>'}}return z},We=function(){return'<div class="zwp-subtitleSearchPanel zwp-popupwindow"><button class="closeBtn"><i class="xicon xicon-close"></i></button><div class="form-row form-title">'+
K("subtitleSearchTitle","Subtitle Search")+'</div><div class="form-row zwp-search-input-row"><div class="zwp-search-input-wrapper"><input type="text" class="zwp-search-input" placeholder="'+K("inputSearchKeyword","Enter search keyword")+'" /><i class="zwp-search-icon xicon xicon-search"></i><button class="zwp-search-clear-btn">\u00d7</button></div></div><div class="form-row zwp-search-scope-row" style="display:none"><div class="zwp-radio-group"><label class="zwp-radio-item"><input type="radio" name="zwpSubtitleSearchScope" value="current" checked><span class="zwp-radio-label">'+
K("searchScopeCurrent","Current Video")+'</span></label><label class="zwp-radio-item"><input type="radio" name="zwpSubtitleSearchScope" value="group"><span class="zwp-radio-label">'+K("searchScopeGroup","Playlist (Group)")+'</span></label></div></div><div class="form-row zwp-search-targets-row" style="display:none"><div class="zwp-search-targets-header"><span class="zwp-search-targets-summary"></span><span class="zwp-search-targets-actions"><button class="zwp-targets-action-btn zwp-targets-select-all" type="button">'+
K("selectAll","Select All")+'</button><button class="zwp-targets-action-btn zwp-targets-clear-all" type="button">'+K("clearAll","Clear")+'</button><button class="zwp-targets-toggle-btn" type="button">\u25bc</button></span></div><div class="zwp-search-targets-list" style="display:none"></div></div><div class="form-row zwp-search-status-row"><div class="zwp-search-status"><div class="zwp-status-left"></div><div class="zwp-status-right"></div></div></div><div class="form-row zwp-search-results-row"><div class="zwp-list-inner"><div class="zwp-search-results-list"></div></div></div></div>'},
Xe=function(a){a=a&&a.length>0?a:[{code:"zh",name:K("lang_zh","\u4e2d\u6587")},{code:"en",name:K("lang_en","\u82f1\u8bed")},{code:"ja",name:K("lang_ja","\u65e5\u8bed")},{code:"ko",name:K("lang_ko","\u97e9\u8bed")},{code:"fr",name:K("lang_fr","\u6cd5\u8bed")},{code:"de",name:K("lang_de","\u5fb7\u8bed")},{code:"es",name:K("lang_es","\u897f\u8bed")},{code:"ru",name:K("lang_ru","\u4fc4\u8bed")},{code:"pt",name:K("lang_pt","\u8461\u8bed")},{code:"it",name:K("lang_it","\u610f\u8bed")},{code:"ar",name:K("lang_ar",
"\u963f\u62c9\u4f2f\u8bed")},{code:"th",name:K("lang_th","\u6cf0\u8bed")},{code:"vi",name:K("lang_vi","\u8d8a\u5357\u8bed")}];for(var t=(window.navigator.language||"en").toLowerCase(),z="en",y="zh ja ko fr de es ru pt it ar th vi en".split(" "),x=0;x<y.length;x++)if(t.indexOf(y[x])!==-1){z=y[x];break}t="";for(x=0;x<a.length;x++){y=a[x];var e=typeof y==="string"?y:y.code;t+='<option value="'+e+'"'+(e===z?" selected":"")+">"+(typeof y==="string"?y:y.name||y.code)+"</option>"}return'<div class="zwp-subtitleTranslatePanel zwp-popupwindow"><button class="closeBtn"><i class="xicon xicon-close"></i></button><div class="form-row form-title">'+
K("subtitleTranslateTitle","Subtitle Translation")+'</div><div class="form-row zwp-translate-controls"><div class="zwp-translate-row"><span class="zwp-translate-label">'+K("translateTargetLang","Target")+'</span><select class="zwp-translate-select" id="zwp-translate-target">'+t+'</select></div><div class="zwp-translate-row zwp-translate-status-row"><span class="zwp-translate-status"></span></div><div class="zwp-translate-row zwp-translate-action-row"><button class="zwp-translate-btn zwp-translate-main-btn"><span class="zwp-translate-spinner"></span><span class="zwp-translate-btn-text">'+
K("translateStart","Translate")+'</span></button></div></div><div class="form-row zwp-translate-progress-row" style="display:none"><div class="zwp-translate-progress-bar"><div class="zwp-translate-progress-fill"></div></div></div></div>'},Ye=function(){for(var a=[{code:"zh",name:K("lang_zh","\u4e2d\u6587")},{code:"en",name:K("lang_en","\u82f1\u8bed")},{code:"ja",name:K("lang_ja","\u65e5\u8bed")},{code:"ko",name:K("lang_ko","\u97e9\u8bed")},{code:"fr",name:K("lang_fr","\u6cd5\u8bed")},{code:"de",name:K("lang_de",
"\u5fb7\u8bed")},{code:"ru",name:K("lang_ru","\u4fc4\u8bed")},{code:"pt",name:K("lang_pt","\u8461\u8bed")},{code:"th",name:K("lang_th","\u6cf0\u8bed")},{code:"id",name:K("lang_id","\u5370\u5c3c\u8bed")},{code:"vi",name:K("lang_vi","\u8d8a\u5357\u8bed")}],t=(window.navigator.language||"zh").toLowerCase(),z="zh",y="zh en ja ko fr de ru pt th id vi".split(" "),x=0;x<y.length;x++)if(t.indexOf(y[x])!==-1){z=y[x];break}t="";for(y=0;y<a.length;y++)t+='<option value="'+a[y].code+'"'+(a[y].code===z?" selected":
"")+">"+a[y].name+"</option>";return'<div class="zwp-ttsPanel zwp-popupwindow"><button class="closeBtn"><i class="xicon xicon-close"></i></button><div class="form-row form-title">'+K("ttsTitle","Subtitle to Speech")+'</div><div class="form-row zwp-tts-controls"><div class="zwp-tts-row"><span class="zwp-tts-label">'+K("ttsTargetLang","Voice Language")+'</span><select class="zwp-tts-select" id="zwp-tts-lang">'+t+'</select></div><div class="zwp-tts-row zwp-tts-audio-row"><span class="zwp-tts-label">'+
K("ttsSelectAudio","Select reference audio")+'</span><input type="file" class="zwp-tts-audio-input" accept="audio/wav,audio/mpeg,audio/mp4,audio/x-m4a,.wav,.mp3,.m4a" /></div><div class="zwp-tts-row zwp-tts-clone-hint-row"><span class="zwp-tts-clone-hint">'+K("ttsCloneHint","Optional reference audio")+'</span></div><div class="zwp-tts-row zwp-tts-status-row"><span class="zwp-tts-status"></span></div><div class="zwp-tts-row zwp-tts-action-row"><button class="zwp-tts-btn zwp-tts-main-btn"><span class="zwp-tts-spinner"></span><span class="zwp-tts-btn-text">'+
K("ttsStart","Synthesize")+'</span></button></div></div><div class="form-row zwp-tts-progress-row" style="display:none"><div class="zwp-tts-progress-bar"><div class="zwp-tts-progress-fill"></div></div></div></div>'},Ze=function(){return'<div class="zwp-chapterSearchPanel zwp-popupwindow"><button class="closeBtn"><i class="xicon xicon-close"></i></button><div class="form-row form-title">'+K("chapterSearchTitle","Chapter Search")+'</div><div class="form-row"><div class="zwp-search-input-wrapper"><input type="text" class="zwp-search-input" placeholder="'+
K("inputSearchKeyword","Enter search keyword")+'" /><i class="zwp-search-icon xicon xicon-search"></i><button class="zwp-search-clear-btn">\u00d7</button></div></div><div class="form-row"><div class="zwp-list-inner"><div class="zwp-search-results-list"></div></div></div></div>'},$e=function(a){a=a||{};var t="";a.segmentButton&&(t='<div class="shortcut-item"><div class="shortcut-key">Ctrl + , / .</div><div class="shortcut-desc">'+K("shortcutSegmentNudgeStart","Nudge segment start (Ctrl+,/. for back/forward)")+
'</div></div><div class="shortcut-item"><div class="shortcut-key">Alt + , / .</div><div class="shortcut-desc">'+K("shortcutSegmentNudgeEnd","Nudge segment end (Alt+,/. for back/forward)")+'</div></div><div class="shortcut-item"><div class="shortcut-key">S</div><div class="shortcut-desc">'+K("shortcutCommitSubtitle","Commit nudge to subtitle (Save)")+'</div></div><div class="shortcut-item"><div class="shortcut-key">Ctrl+Alt+Shift+S</div><div class="shortcut-desc">'+K("shortcutShiftSubtitle","Shift all subtitles (Ctrl+Alt+Shift+S)")+
"</div></div>");return'<div class="zwp-shortcutHelpPanel zwp-popupwindow"><button class="closeBtn"><i class="xicon xicon-close"></i></button><div class="form-row form-title">'+K("keyboardShortcuts","Keyboard Shortcuts")+'</div><div class="zwp-list-inner"><div class="shortcut-item"><div class="shortcut-key">Space/MediaKey </div><div class="shortcut-desc">'+K("shortcutPlayPause","Play / Pause")+'</div></div><div class="shortcut-item"><div class="shortcut-key">\u2192</div><div class="shortcut-desc">'+
K("shortcutSeekRight","Single press: forward 5s, hold: speed playback")+'</div></div><div class="shortcut-item"><div class="shortcut-key">\u2190</div><div class="shortcut-desc">'+K("shortcutSeekLeft","Rewind 5s (hold for continuous operation)")+'</div></div><div class="shortcut-item"><div class="shortcut-key">\u2191 / \u2193</div><div class="shortcut-desc">'+K("shortcutVolume","Increase / decrease volume by 5%")+'</div></div><div class="shortcut-item"><div class="shortcut-key">Esc</div><div class="shortcut-desc">'+
K("shortcutExit","Close menu / Exit fullscreen")+'</div></div><div class="shortcut-item"><div class="shortcut-key">F</div><div class="shortcut-desc">'+K("shortcutFullscreen","Fullscreen / Exit fullscreen")+'</div></div><div class="shortcut-item"><div class="shortcut-key">Enter</div><div class="shortcut-desc">'+K("shortcutSendDanmu","Send Danmu")+'</div></div><div class="shortcut-item"><div class="shortcut-key">D</div><div class="shortcut-desc">'+K("shortcutDanmu","Enable / Disable Danmu")+'</div></div><div class="shortcut-item"><div class="shortcut-key">M</div><div class="shortcut-desc">'+
K("shortcutMute","Mute / Unmute")+'</div></div><div class="shortcut-item"><div class="shortcut-key">0</div><div class="shortcut-desc">'+K("shortcutRestart","Restart")+'</div></div><div class="shortcut-item"><div class="shortcut-key">R</div><div class="shortcut-desc">'+K("shortcutRecord","Start / Stop Recording")+'</div></div><div class="shortcut-item"><div class="shortcut-key">L</div><div class="shortcut-desc">'+K("shortcutLight","Light Toggle")+'</div></div><div class="shortcut-item"><div class="shortcut-key">Shift + 1</div><div class="shortcut-desc">'+
K("shortcutSpeed1x","1x Speed (Normal)")+'</div></div><div class="shortcut-item"><div class="shortcut-key">Shift + 2</div><div class="shortcut-desc">'+K("shortcutSpeed2x","2x Speed")+'</div></div><div class="shortcut-item"><div class="shortcut-key">, / .</div><div class="shortcut-desc">'+K("shortcutFrameStep","Frame Step Backward / Forward")+"</div></div>"+t+"</div></div>"},af=function(){return'<div class="zwp-pipPlaceHolder'+(/^zh/i.test(za.defaultLang)?"":" zwp-pipPlaceHolder-en")+'">\t<div class="zwp-pipControl">\t\t<div class="zwp-pipTiptext">'+
K("pipModePlaying","Playing in Picture-in-Picture mode")+'</div>\t\t<div class="zwp-pipExitButton">'+K("exitPictureInPicture","Exit Picture-in-Picture")+"</div>\t</div></div>"},fd=/iPhone|iPad|iPod/.test(navigator.userAgent),gd=/iPhone|iPod/.test(navigator.userAgent),Od=/[\u5b78\u7d93\u95dc\u958b\u767c\u9054\u9032\u52d5\u5834\u696d\u89ba\u89c0\u7d71\u91ab\u74b0\u71df\u8655\u8a8d\u8ab2\u8aaa\u8a9e\u8acb\u8ad6\u8b58\u8b93\u8b80\u8b8a\u8cb7\u8ce3\u8cea\u8cbb\u9023\u904e\u4f86\u9084\u61c9\u70ba\u8fa6\u570b\u5716\u5ee3\u6176\u6b0a\u6b61\u6eff\u7121\u78ba\u7576\u76e3\u76e4\u7926\u7a2e\u7a4d\u7bc0\u7c21\u7d42\u7d66\u7db2\u7dad\u7da0\u7dda\u7fd2\u807d\u88e1\u88fd\u8996\u89aa\u8a2d\u8a31\u8a66\u8a71\u8aa0\u8aa4\u8ab0\u8b49\u8b70\u8b77\u8cfc\u8f49\u8f15\u8f03\u8f09\u8f1d\u8f2a\u8f38\u8fb2\u908a\u91ab\u9396\u93c8\u93e1\u9418\u9435\u9451\u9589\u9593\u9591\u95b1\u9663\u9670\u967d\u969b\u96a8\u96aa\u96d9\u96de\u96e2\u96fb\u9748\u975c\u97d3\u9806\u9808\u9813\u9818\u982d\u984c\u984d\u984f\u9858\u986f\u9867\u98c4\u98db\u98f2\u99d5\u9ad4\u9aee\u9b06\u9f4a\u9f52\u9f8d\u9f9c]/,
Yb=!1,Fa=!1,Ya=!1,Zd=wb([0,0,0,22,22,9,31,5,94,25,25]),$d=wb([0,0,0,22,22,9,31,5,94,25,24,29]),be=wb([85,19,31,25,4,95,9,2,0,10,24,2,14,88,31,12,18,2,12,30,21,13,89,24,14,26,28]),ce=wb([85,7,17,29,18,3,85,20,31,23,7,17,20,14,95,25,31,17,20,16,21,22,24,23,84,31,4,23,27]),de=wb([85,7,17,29,18,3,85,20,31,23,7,17,20,14,95,27,21,31,15,3,94,18,3,29,22]);Pa.prototype.eof=function(){return this.pos>=this.limit};Pa.prototype.left=function(){return this.limit-this.pos};Pa.prototype.u8=function(){return this.view.getUint8(this.pos++)};
Pa.prototype.u16=function(){var a=this.view.getUint16(this.pos);this.pos+=2;return a};Pa.prototype.u32=function(){var a=this.view.getUint32(this.pos);this.pos+=4;return a};Pa.prototype.i32=function(){var a=this.view.getInt32(this.pos);this.pos+=4;return a};Pa.prototype.u64=function(){var a=this.view.getUint32(this.pos),t=this.view.getUint32(this.pos+4);this.pos+=8;return a*4294967296+t};Pa.prototype.fourcc=function(){for(var a="",t=0;t<4;t++)a+=String.fromCharCode(this.view.getUint8(this.pos+t));
this.pos+=4;return a};Pa.prototype.utf8=function(a){var t=new Uint8Array(this.view.buffer,this.view.byteOffset+this.pos,a);this.pos+=a;return(new TextDecoder("utf-8")).decode(t)};Pa.prototype.fullbox=function(){var a=this.u8(),t=this.u8(),z=this.u8(),y=this.u8();return{version:a,flags:t<<16|z<<8|y}};var fc=function(){return(new Date).getTime()};typeof performance!="undefined"&&performance.now&&(fc=function(){return performance.now()});fc();var qe=function(a){var t="",z="",y="";if(a.startsWith("webrtc://"))a.indexOf("txSecret=")>
0?(t="/webrtc/v1/pullstream",z="trtc",y=a.replace("trtc://","webrtc://")):t="/rtc/v1/play/";else if(a.startsWith("brtc://"))t="/brtc/v3/pullstream",z="brtc",y=a.replace("brtc://","webrtc://");else if(a.startsWith("trtc://"))t="/webrtc/v1/pullstream",z="trtc",y=a.replace("trtc://","webrtc://");else if(a.startsWith("artc://"))z="artc",y=a;else if(a.indexOf("/whep/")>0||a.indexOf("/whep?")>0||a.indexOf("/whip-play/")>0)return{apiUrl:a,provider:"whep",schema:"whep",urlObject:{schema:"whep"}};var x=a.indexOf("://");
if(x==-1)return!1;var e="";if(a.indexOf("?")>=0){var d=a.indexOf("?");e=a.substr(d+1);a=a.substr(0,d)}var r=a.indexOf("/",x+3);d=a.substr(0,x);x=a.substring(x+3,r);r=a.substring(r);var n=r.lastIndexOf("/"),m="",u=x.indexOf(":");u>0&&(m=x.substring(u+1),x=x.substring(0,u));u=r.substring(1,n);n=r.substring(n+1);var f=n.lastIndexOf(".");f>0&&(n=n.substring(0,f));f="";e.indexOf("vhost=")>0&&(f=e.substr(e.indexOf("vhost=")+6),f.indexOf("&")>0&&(f=f.substr(0,f.indexOf("&"))));x===f&&/^(\d+)\.(\d+)\.(\d+)\.(\d+)$/.test(x)&&
(f="_default_vhost_");a={url:a,schema:d,server:x,port:m,vhost:f,app:u,stream:n};a.user_query={};if(e.length!==0){e.indexOf("?")>=0&&(e=e.split("?")[1]);e=e.split("&");for(m=0;m<e.length;m++)f=e[m].split("="),a[f[0]]=f[1],a.user_query[f[0]]=f[1];a.domain&&(a.vhost=a.domain)}d==="webrtc"||d==="rtc"?(d="",a.port||(a.user_query.schema==="https"?(a.port=443,d=a.user_query.schema||"https"):window.location.href.indexOf("https://")===0?(a.port=443,d=a.user_query.schema||"https"):a.port=1985)):z==="brtc"?
window.location.href.indexOf("https://")===0?(d="https",a.port=a.port||443):(d="http",a.port=a.port||80):z==="artc"&&(d="https",a.port=a.port||443,t=r);y||="rtmp://"+x+"/"+u+"/"+n;d=d?d+":":window.location.protocol;(m=a.port)||(m=d==="https:"?m||443:m||1985);t=t||"/live/webrtc/play/";x=d+"//"+a.server+":"+m+t;for(var c in a.user_query)c!=="api"&&c!=="play"&&(x+="&"+c+"="+a.user_query[c]);x=x.replace(t+"&",t+"?");z={apiUrl:x,streamUrl:y,schema:d,urlObject:a,port:m,provider:z};z.tid=Number(parseInt((new Date).getTime()*
Math.random()*100)).toString(16).slice(0,7);return z},ec=function(a,t,z,y,x){var e=null;e=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");e.addEventListener("error",function(d){y&&y("REQUEST:"+d.type)});e.timeout=2E4;e.addEventListener("timeout",function(){y&&y("REQUEST:timeout")});e.onreadystatechange=function(){if(e.readyState===4)if(e.status===200||e.status===201)if(e.responseText.startsWith("{")){var d=JSON.parse(e.responseText);z&&z(d,e)}else z&&
z(e.responseText,e);else y&&y("STATUS:"+e.status+":"+e.statusText)};e.open("POST",a,!0);x||="application/json";e.setRequestHeader("Content-Type",x);e.send(t);return e},re=function(a){var t=new XMLHttpRequest;t.open("DELETE",a,!0);t.onload=function(){};t.onerror=function(){};t.send()},Gb=Object.freeze({enabled:!0,mode:"force",button:!0,yaw:0,pitch:0,fov:75,yawOnly:!1,autoRotate:!1,gyro:"auto",projection:"equirectangular",stereo:!1,defaultYaw:0,defaultPitch:0,showButton:!0,autoDetect:!0}),Pc=Object.freeze({hoverToPlay:!0,
startTime:0,duration:0,resetOnLeave:!1}),yb=null,hc=0,ic=[60,170,310,600,1E3,3E3,6E3,12E3,14E3,16E3],Ib={normal:{name:"\u6807\u51c6",gains:[0,0,0,0,0,0,0,0,0,0]},pop:{name:"\u6d41\u884c",gains:[2,3,4,2,-1,-1,1,2,3,3]},rock:{name:"\u6447\u6eda",gains:[5,4,2,0,-2,0,2,4,5,5]},jazz:{name:"\u7235\u58eb",gains:[4,3,1,2,-1,-1,0,1,3,3]},classical:{name:"\u53e4\u5178",gains:[4,3,2,1,-1,-1,0,2,3,4]},bass:{name:"\u91cd\u4f4e\u97f3",gains:[7,6,5,3,0,-2,-3,-4,-4,-5]},vocal:{name:"\u4eba\u58f0\u589e\u5f3a",gains:[-2,
-1,1,3,5,4,2,1,0,-2]}},Sc=Object.freeze({title:"",artist:"",waveform:"auto",theme:"auto",vinyl:!0,panel:"full",mediaSession:!0,blurBackground:!0,visualizer:"classic"}),kc=/\[(\d{1,2}):(\d{1,2})(?:[.:](\d{1,3}))?\]/g,lc=/<(\d{1,2}):(\d{1,2})(?:[.:](\d{1,3}))?>/g,Vc=Object.freeze({controlbar:!1,showProgress:!1,autoplay:!1,muted:!0,loop:!0,hideBigPlayButton:!0,bumper:null,pauseAd:null}),Wc=Object.freeze({controlbar:!0,showProgress:!0,fixedControlbar:!0,snapshotButton:!1,zoomButton:!1,vr:!1,infoButton:!1,
annotation:!1,annotationButton:!1,castButton:!1,recordButton:!1,optionButton:!1,bumper:null,pauseAd:null}),Le={standard:!0,preview:!0,music:!0,auto:!0};window.zwpQuery=Da;var bf=Va.path+"css/zwplayer.css?v="+Va.v,pc=document.createElement("style");pc.id="zwplayer-fouc-guard";pc.textContent=".zwp-wrap{opacity:0}";document.head.appendChild(pc);(function(a,t,z,y){y=document.getElementsByTagName("head");if(y.length==0){y=document.createElement("head");var x=document.getElementsByTagName("body");if(x.length>
0)x=x[0],document.insertBefore(y,x);else return alert("Invalid html document: no HEAD tag found"),!1}else{y=y[0];x=y.childNodes;for(var e=0;e<x.length;e++){var d=x[e];if(d.nodeName.toUpperCase()==="LINK"&&d.id&&d.id==a){if(d.getAttribute("loadstate")!=="true"){var r=function(){d.getAttribute("loadstate")!=="error"&&(d.getAttribute("loadstate")!=="true"?setTimeout(r,50):typeof z==="function"&&z(a))};setTimeout(r,50);return!1}typeof z==="function"&&z(a);return!0}}}var n=document.createElement("link");
n.type="text/css";n.setAttribute("rel","stylesheet");n.onerror=function(){n.setAttribute("loadstate","error")};n.readyState?n.onreadystatechange=function(){if(n.readyState=="loaded"||n.readyState=="complete")n.onreadystatechange=null,n.setAttribute("loadstate","true"),typeof z=="function"&&z(a)}:n.onload=function(){n.setAttribute("loadstate","true");typeof z=="function"&&z(a)};n.id=a;n.href=t;y.appendChild(n);return!1})("zwplayer-css",bf,function(a){(a=document.getElementById("zwplayer-fouc-guard"))&&
a.parentNode.removeChild(a)});window.setTimeout(function(){var a=document.getElementById("zwplayer-fouc-guard");a&&a.parentNode.removeChild(a)},1E4);var hd=function(a){return typeof HTMLElement==="object"?a instanceof HTMLElement:!(!a||typeof a!=="object"||a.nodeType!==1&&a.nodeType!==9||typeof a.nodeName!=="string")};Array.isArray||(Array.isArray=function(a){return Object.prototype.toString.call(a)==="[object Array]"});lb();Bb=!1;var cf=function(){for(var a='<div class="zwp-button zwp-speedButton"><button class="zwpbtn zwp-speedBtn" data-action="showSpeedMenu" data-name="speedbtn" title="'+
K("speed","Playback Speed")+'" aria-label="'+K("speed","Playback Speed")+'">1x</button><ul class="zwp-speedMenu">',t="2.0x 1.5x 1.25x 1.0x 0.75x 0.5x 0.25x".split(" "),z="",y=0;y<t.length;y++)z=y===3?z+('<li class="zwp-speed-item active">'+t[y]+"</li>"):z+('<li class="zwp-speed-item">'+t[y]+"</li>");return a+z+"</ul></div>"},id=function(a){var t='<div class="zwp-option-item main"><label class="zwp-option-item-label">'+K("showSubtitle","Show Subtitles")+'</label><div class="zwp-option-item-value">'+
$a("","toggleShowSubtitle").replace("zwp_switch ","zwp_switch switch_on ")+"</div></div>";t+='<div class="zwp-option-item dual-toggle-item" style="display:none;"><label class="zwp-option-item-label">'+K("dualSubtitle","Dual Subtitles")+'</label><div class="zwp-option-item-value">'+$a("","toggleDualSubtitle")+"</div></div>";t=t+'<div class="zwp-sub-divider"></div><div class="zwp-sub-dual-section" style="display:none;"><div class="zwp-sub-single-list"></div><div class="zwp-sub-dual-columns" style="display:none;"><div class="zwp-sub-dual-col"><div class="zwp-sub-dual-col-label pri">'+
(K("primarySubtitle","Primary")+'</div><div class="zwp-sub-dual-col-items pri"></div></div>');t+='<div class="zwp-sub-dual-col"><div class="zwp-sub-dual-col-label sec">'+K("secondarySubtitle","Secondary")+'</div><div class="zwp-sub-dual-col-items sec"></div></div></div>';t=t+'</div><div class="zwp-sub-divider"></div><div class="zwp-option-item zwp-lefticon"><span class="zwp-liteicon"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="vertical-align: middle;"><path d="M5 12h14"/><path d="M12 5v14"/></svg></span> <button class="zwp-option-button action-item" data-action="addSubtitleFile">'+
(K("addSubtitleFile","Add Subtitle File")+"</button></div>");t=t+'<input type="file" class="zwp-add-subtitle-input" accept=".srt,.vtt,.bcc,.json" style="display:none;" multiple><div class="zwp-sub-divider"></div><div class="zwp-option-item zwp-lefticon"><span class="zwp-liteicon"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="vertical-align: middle;"><circle cx="11" cy="11" r="8"/><path d="m21 21-4.3-4.3"/></svg></span> <button class="zwp-option-button action-item" data-action="showSubtitleSearchPanel">'+
(K("subtitleSearch","Subtitle Search")+"</button>");t+="</div>";a&&a.translateApi&&(t+='<div class="zwp-option-item zwp-lefticon"><span class="zwp-liteicon"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="vertical-align: middle;"><path d="M4 21 9 7l5 14"/><path d="M5.5 15h7"/><path d="M17 2l-1.5 3.5L12 7l3.5 1.5L17 12l1.5-3.5L22 7l-3.5-1.5Z"/><path d="M21 12l-1 2-2 1 2 1 1 2 1-2 2-1-2-1Z"/></svg></span> <button class="zwp-option-button action-item" data-action="showSubtitleTranslatePanel">'+
K("subtitleTranslate","Subtitle Translate")+"</button></div>",t+='<div class="zwp-option-item zwp-lefticon"><span class="zwp-liteicon"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="vertical-align: middle;"><path d="M3 10v4"/><path d="M7 6v12"/><path d="M11 3v18"/><path d="M15 8v8"/><path d="M19 5v14"/></svg></span> <button class="zwp-option-button action-item" data-action="showTtsPanel">'+K("ttsTitle",
"Subtitle to Speech")+"</button></div>");return t+='<div class="zwp-option-item zwp-lefticon"><span class="zwp-liteicon"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="vertical-align: middle;"><circle cx="12" cy="12" r="3"/><path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"/></svg></span> <button class="zwp-option-button action-item" data-action="showSubtitleSettings">'+
K("subtitleSettings","Subtitle Settings")+"</button></div>"},Lb=function(){Lb._seed=(Lb._seed||0)+1;var a="zwp"+Lb._seed;var t='<div class="zwp-toolbox-ground-right zwp-dmform zwp_danmu-controlbar"> <div class="zwp_switch_group">   <div class="zwp_switch_text">'+(K("danmu","Danmu")+"</div>");t=t+('   <div class="zwp_switch" id="danmuSwitch-'+a+'"><i class="switch_inner"></i></div> </div> <div class="zwp_dmconfig zwp_dmicon" id="danmu-config-btn-')+(a+'" title="'+K("danmuSettings","Danmu Settings")+
'"><i class="xicon xicon-subtitles"></i></div>');t=t+(' <div class="zwp-barrage_form" id="barrage_form-'+a+'">   <div class="zwp-barrage_inp logined">    <input id="barrage_inp_text-')+(a+'" type="text" class="barrage_inp_text" maxlength="40" disabled="disabled" readonly="readonly">    <div class="barrage_login" href="#login"><span class="barrage_text">')+(K("login","Login")+"</span>"+K("loginToParticipate"," to participate in danmu")+"</div>");t+="   </div>";t+='   <a class="btn_bubble disabled" href="javascript:void(0);" title="'+
K("selectEmotion","Select Emotion")+'" data-viewid="smilesFaces-view-'+a+'"><i class="xicon xicon-smile"></i></a>';t+='   <button type="submit" class="btn_submit vtb_disabled" title="'+K("loginToSendDanmu","Login required to send danmu")+'" disabled="disabled">'+K("send","Send")+"</button>";t+=" </div>";t+=' <div class="zwp-barrage-set zwp-hidden" data-barrage-panel="panel" data-render="0"></div>';return t+="</div>"},df=function(a){return a&&Array.isArray(a)&&a.length!==0?{html:'<div class="zwp-button zwp-chapterButton"><button class="zwpbtn zwp-chapterBtn" data-action="showChapterListview" data-name="chapterbtn" title="'+
K("chapters","Chapters")+'"><i class="xicon xicon-chapter"></i></button></div>',titleWidth:0}:null},qc=function(a,t){function z(d){var r=x;d.find("a.barrage-tab-link").each(function(n){var m=r(this);n===0?m.html(K("danmuSendSettings","Send Settings")+'<i class="bottom-line"></i>'):n===1?m.html(K("danmuViewSettings","View Settings")+'<i class="bottom-line"></i>'):n===2&&m.html(K("danmuBlockSettings","Block Settings")+'<i class="bottom-line"></i>')});d.find(".set-label").each(function(){var n=r(this),
m=n.text();m==="\u6587\u5b57\u989c\u8272"?n.text(K("danmuTextColor","Text Color")):m==="\u6587\u5b57\u8fb9\u6846"?n.text(K("danmuTextBorder","Border")):m==="\u4e0d\u900f\u660e\u5ea6"?n.text(K("danmuOpacity","Opacity")):m==="\u6587\u5b57\u5927\u5c0f"?n.text(K("danmuFontSize","Font Size")):m==="\u6eda\u52a8\u901f\u5ea6"?n.text(K("danmuScrollSpeed","Scroll Speed")):m==="\u6392\u5217\u5bc6\u5ea6"&&n.text(K("danmuDensity","Density"))});d.find(".set-rol-left").each(function(){var n=r(this),m=n.text();m===
"\u4e0d\u900f\u660e\u5ea6"?n.text(K("danmuOpacity","Opacity")):m==="\u6587\u5b57\u5927\u5c0f"?n.text(K("danmuFontSize","Font Size")):m==="\u6eda\u52a8\u901f\u5ea6"?n.text(K("danmuScrollSpeed","Scroll Speed")):m==="\u6392\u5217\u5bc6\u5ea6"&&n.text(K("danmuDensity","Density"))});d.find(".pb-title").each(function(){var n=r(this),m=n.text();m==="\u5e95\u90e8\u533a\u57df"?n.text(K("danmuBottomArea","Bottom Area")):m==="\u5f69\u8272\u6587\u5b57"?n.text(K("colorfulText","Color")):m==="\u56fe\u7247\u8868\u60c5"&&
n.text(K("imageEmoji","Emoji"))});d.find("a.barrage-set-rest").each(function(){var n=r(this);n.text()==="\u91cd\u7f6e"&&n.text(K("reset","Reset"))})}function y(d,r){if(d){var n=r&&r.playerElm;if(n){d.style.left="";r=d.getBoundingClientRect();n=n.getBoundingClientRect();var m=0;r.left<n.left+6?m=n.left+6-r.left:r.right>n.right-6&&(m=n.right-6-r.right);m&&(d.style.left=d.offsetLeft+m+"px")}}}var x=t.zwpQuery,e=t.htmlSpecialChars;window.insertSmile=function(d,r){d=x(d).closest("div.zwp-smileview");if(d.length>
0&&(d=d.get(0).inputbox))if(d.createTextRange&&(d.caretPos=document.selection.createRange().duplicate()),document.all)d.createTextRange&&d.caretPos?(d=d.caretPos,d.text=d.text.charAt(d.text.length-1)==" "?r+" ":r):d.value=r;else if(d.setSelectionRange){var n=d.selectionEnd,m=d.value.substring(0,d.selectionStart);n=d.value.substring(n);d.value=m+r+n}else alert("This version of Mozilla based browser does not support setSelectionRange")};window.replaceSmileDanmu=function(d,r,n){if(typeof d!="string")return"";
d.indexOf("<")>=0&&(d=d.replace(/</g,"&lt;").replace(/>/g,"&gt;"));var m=d.indexOf("[sm-");if(m<0)return d;var u=Va.path+"widgets/smiles/p",f="",c=d.substring(0,m);for(c!=""&&(f+=c);m>=0;){c=d.indexOf("]",m+4);if(c<0){c=d.substring(m);c!=""&&(f+=c);break}m=d.substring(m+4,c);m!=""&&(f=/^[a-zA-Z0-9_-]+$/.test(m)&&!n.isFilterImage?f+('<img style="opacity: 1;" src="'+u+m+'.png" height="'+r+'">'):f+("[sm-"+m+"]"));m=d.indexOf("[sm-",c+1);m<0?(c=d.substring(c+1),c!=""&&(f+=c)):m>c+1&&(f+=d.substring(c+
1,m))}return f};return{onZwpSwitch:function(d){ya(d,"switch_on")?ja(d,"switch_on"):ka(d,"switch_on")},onDanmuConfig:function(d,r){var n=x;d=n(r).closest("div.zwp-dmform").children(".zwp-barrage-set");if(d.length!=0){if(d.attr("data-render")!="1"){var m=r.zwplayer,u=d.get(0);n.get(Va.path+"widgets/danmu_setting.html?v="+Va.v,{},function(c){var h=n(u);h.html(c);z(h);h.find("a.barrage-tab-link").click(function(k){k.preventDefault();k=n(this).parent();k.hasClass("selected")||(k.addClass("selected").siblings().removeClass("selected"),
k=n(k.attr("data-tab")),k.hasClass("zwp-hidden")&&(k.removeClass("zwp-hidden"),k.siblings().addClass("zwp-hidden")))});c=n("#fsBox_tab");c.find("div.color-box").children("a").click(function(k){k.preventDefault();k=n(this);k.hasClass("selected")||(k.siblings().removeClass("selected"),k.addClass("selected"),m&&(m.danmuSetting.color=k.attr("data-color")))});c.find("div.other-box").children("a.checkbox-wrap").click(function(k){k.preventDefault();var l=n(this);l.toggleClass("selected");k=l.attr("data-content");
l=l.hasClass("selected");m&&(m.danmuSetting[k]=l)});n("#bfBox_tab").find("a.zwp-barrage-icons").mousedown(function(k){if(k.button==0){this.isMousePressed=!0;var l=n(this).position().left,p=k.clientX-l,w=this,v=function(D){var B=D.clientX-p;B<0?B=0:B>134&&(B=134);n(w).css({left:B+"px"});D=n(w).siblings("div.bar-t");D.length>0&&D.width(B+3);w.valuePanel||(w.valuePanel=n(w).parent().siblings("div.set-rol-right").get(0));if(typeof w.valuePanel=="object"){D=n(w.valuePanel);var G=D.attr("data-barrage-content");
G=="opacityValue"?(B=parseInt(B*100/138),m&&(m.danmuSetting.opacityValue=B),D.html(B+"%")):G=="forcedFontSizeValue"?(B=50+parseInt(B*150/138),m&&(m.danmuSetting.forcedFontSizeValue=B),D.html(B+"%")):G=="speedValue"?(B=(.5+parseFloat(B/69)).toFixed(1),m&&(m.danmuSetting.speedValue=B),D.html(B+"x")):G=="densityValue"&&(B=parseInt(B*100/46),m&&(m.danmuSetting.densityValue=B),B=B+" "+K("danmuItems","items"),D.html(B))}return!1},E=function(D){n(document).unbind("mousemove",v).unbind("mouseup",E)};n(document).bind("mousemove",
v).bind("mouseup",E)}return!1});n("#pbBox_tab").find("a.pb-link").click(function(k){k.preventDefault();var l=n(this).parent();l.toggleClass("selected");k=n(this).attr("data-content");l=l.hasClass("selected");m&&(m.danmuSetting[k]=l)});n("#barrage-set-bot").children("a").click(function(k){k.preventDefault();if(n(this).attr("data-content")=="reset"){if(m)for(var l in m.danmuSetting)delete m.danmuSetting[l];n("#fsBox_tab").find(".color-box a").removeClass("selected").eq(0).addClass("selected");n("#fsBox_tab").find(".other-box a").removeClass("selected");
var p={opacityTrigger:[128,124,"90%"],forcedFontSizeTrigger:[50,46,"100%"],speedTrigger:[39,35,"1.0x"],densityTrigger:[18,14,K("danmuDensityDefault","30 items")]};n("#bfBox_tab").find("a.zwp-barrage-icons").each(function(w,v){w=n(v).attr("data-barrage-content");if(p[w]){var E=p[w];w=E[1];var D=E[0];E=E[2];v=n(v);v.css({left:w+"px"});v.siblings(".bar-t").width(D+"px");v.parent().siblings(".set-rol-right").text(E)}});n("#pbBox_tab").find("li.selected").removeClass("selected")}})},"html");d.attr("data-render",
"1")}if(d.hasClass("zwp-hidden")){u=d.get(0);var f=function(c){var h=n(u);if(ya(c.target,"xicon-close")||!h.is(c.target)&&h.has(c.target).length===0)h.addClass("zwp-hidden"),n(document).off("click.zwpDanmuSetting",f),delete r.zwplayer};d.removeClass("zwp-hidden");y(d.get(0),r.zwplayer);n(document).on("click.zwpDanmuSetting",f)}else d.addClass("zwp-hidden"),n(document).off("click.zwpDanmuSetting"),delete r.zwplayer}},onSendDanmu:function(d,r){if(!d.inpbox){var n=x(d).parent().children("DIV.zwp-barrage_inp").children(".barrage_inp_text");
if(!n)return;d.inpbox=n}if(r){n=d.inpbox.val();if(n=="")return;n=e(n);if(!r.sendDanmu(n))return}d.inpbox.val("")}}}(null,{zwpQuery:Da,htmlSpecialChars:Qa}),rc=qc.onZwpSwitch,ef=qc.onDanmuConfig,ff=qc.onSendDanmu,jd=function(a){window.zwpCtrlInitId||(window.zwpCtrlInitId=(new Date).getTime());var t=window.zwpCtrlInitId++;return a+t},$a=function(a,t){return'<div class="zwp_switch action-item" id="'+(a||jd("switch-"))+'" data-action="'+(t||"none")+'"><i class="switch_inner"></i></div>'},kd=function(a){var t=
"";a.infoButton&&(t='<div class="zwp-button zwp-infoButton"><button class="zwpbtn zwp-infoBtn" data-action="showMediainfo" data-name="infobtn" title="'+K("mediaInfo","Media Info")+'" aria-label="'+K("mediaInfo","Media Info")+'"><i class="xicon xicon-info"></i></button></div>');var z="",y="",x="",e="",d="",r="",n="",m="",u="",f="",c="",h="",k="",l="";var p=a.defVolume;a.speedButton&&!a.isLive&&(z="");if(a.optionButton){x='<div class="zwp-optionPanel">';a.mirrorButton!==!1&&(x+='<div class="zwp-option-item"><label class="zwp-option-item-label">'+
K("mirrorHorizontal","Mirror Horizontal")+'</label><div class="zwp-option-item-value">'+$a("","mirror")+'</div></div><div class="zwp-option-item"><label class="zwp-option-item-label">'+K("mirrorVertical","Mirror Vertical")+'</label><div class="zwp-option-item-value">'+$a("","flip")+'</div></div><div class="zwp-option-item"><label class="zwp-option-item-label">'+K("rotate90Clockwise","Rotate 90\u00b0 CW")+'</label><div class="zwp-option-item-value">'+$a("","rotated90")+'</div></div><div class="zwp-option-item"><label class="zwp-option-item-label">'+
K("rotate90Counterclockwise","Rotate 90\u00b0 CCW")+'</label><div class="zwp-option-item-value">'+$a("","rotated270")+'</div></div><div class="zwp-option-h-separator"><hr/></div>');if(a.autoplayUserControllable){var w=$a("","autoplay");a.autoplay&&(w=w.replace("zwp_switch ","zwp_switch switch_on "));x+='<div class="zwp-option-item"><label class="zwp-option-item-label">'+K("autoPlay","Auto Play")+'</label><div class="zwp-option-item-value">'+w+"</div></div>"}x+='<div class="zwp-option-item"><label class="zwp-option-item-label">'+
K("loopPlayback","Loop Playback")+'</label><div class="zwp-option-item-value">'+$a("","loop")+"</div></div>";a.recordButton&&(x+='<div class="zwp-option-item zwp-lefticon"><span class="zwp-liteicon"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="vertical-align: middle;"><path d="m22 8-6 4 6 4V8Z"/><rect x="2" y="6" width="14" height="12" rx="2" ry="2"/></svg></span> <button class="zwp-option-button action-item" data-action="showRecordingConfig">'+
K("recordingSettings","Recording Settings")+"</button></div>");x+='<div class="zwp-option-item zwp-lefticon"><span class="zwp-liteicon"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="vertical-align: middle;"><line x1="4" x2="20" y1="21" y2="21"/><line x1="4" x2="20" y1="14" y2="14"/><line x1="4" x2="20" y1="7" y2="7"/><circle cx="9" cy="7" r="2"/><circle cx="15" cy="14" r="2"/><circle cx="9" cy="21" r="2"/></svg></span> <button class="zwp-option-button action-item" data-action="showVolumeBoostConfig">'+
K("audioVolumeBoost","Volume Boost")+"</button></div>";a.colorTuningButton!==!1&&(x+='<div class="zwp-option-item zwp-lefticon"><span class="zwp-liteicon"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="vertical-align: middle;"><circle cx="12" cy="12" r="10"/><path d="M12 2a10 10 0 0 0 0 20z"/></svg></span> <button class="zwp-option-button action-item" data-action="showColorConfig">'+K("videoColorTuning",
"Video Color Tuning")+"</button></div>");x+="</div>";x='<div class="zwp-button zwp-optionButton"><button class="zwpbtn zwp-optionBtn" data-action="showConfigPanel" data-name="optionbtn" title="'+K("settings","Settings")+'"><i class="xicon xicon-config"></i></button>'+x+"</div>"}a.disableVolumeControl||(m='<div class="zwp-button zwp-volume-docker"><button class="zwpbtn zwp-muteBtn" data-action="mute"  data-name="mutebtn"><i class="xicon xicon-speaker"></i></button><div class="zwp-volume-slider"><div class="zwp-volume-total"><div class="zwp-volume-current" style="bottom: 0px; height: '+
p+'%;"></div><div class="zwp-volume-handle" style="bottom: '+p+'%; margin-bottom: -7px;"></div></div></div></div>');a.disableFullscreenWin||a.iosWebFullscreen&&gd||(e='<div class="zwp-button zwp-fullscrWinButton"><button class="zwpbtn zwp-fullscrWinBtn" data-action="enterfullscreenWin" data-name="fullscrWinbtn" title="'+K("webFullscreen","Web Fullscreen")+'"><i class="xicon xicon-fullScreen-win"></i></button></div>');a.snapshotButton&&(d='<div class="zwp-button zwp-snapshotButton"><button class="zwpbtn zwp-snapshotBtn" data-action="snapshot" data-name="snapshotbtn" title="'+
K("snapshot","Snapshot")+'"><i class="xicon xicon-camera"></i></button></div>');!a.castButton||typeof document.createElement("video").remote!=="object"&&typeof document.createElement("video").webkitShowPlaybackTargetPicker!=="function"||(r='<div class="zwp-button zwp-castButton"><button class="zwpbtn zwp-castBtn" data-action="cast" data-name="castbtn" title="'+K("cast","Cast")+'"><i class="xicon xicon-cast"></i></button></div>');a.zoomButton&&(h='<div class="zwp-button zwp-zoomButton"><button class="zwpbtn zwp-zoomBtn" data-action="toggleZoom" data-name="zoombtn" title="'+
K("zoom","Zoom")+'"><i class="xicon xicon-zoom"></i></button></div>');p=typeof a.vr==="object"&&a.vr!==null?a.vr:{};a.vr&&p.showButton!==!1&&p.button!==!1&&(k='<div class="zwp-button zwp-vrButton"><button class="zwpbtn zwp-vrBtn" data-action="showVrMenu" data-name="vrbtn" title="'+K("vr","VR")+'"><i class="xicon xicon-vr"></i></button><div class="zwp-vrMenu"><div class="zwp-option-item"><label class="zwp-option-item-label">'+K("activateVr","Activate VR")+'</label><div class="zwp-option-item-value">'+
$a("","vrActive")+'</div></div><div class="zwp-option-item"><label class="zwp-option-item-label">'+K("vrStereo","\u4e0a\u4e0b\u5206\u5c4f")+'</label><div class="zwp-option-item-value">'+$a("","vrStereo")+'</div></div><div class="zwp-option-item zwp-lefticon"><span class="zwp-liteicon"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="vertical-align: middle;"><circle cx="12" cy="12" r="3"/><path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"/></svg></span> <button class="zwp-option-button action-item" data-action="showVrConfig">'+
K("vrSettings","VR Settings")+"</button></div></div></div>");a.localPlayback&&(u='<div class="zwp-button zwp-localPlaybackButton"><button class="zwpbtn zwp-localPlaybackBtn" data-action="selectLocalFile" data-name="localPlaybackbtn" title="'+K("selectLocalVideo","Select Local Video File")+'"><i class="xicon xicon-open-file"></i></button></div>');a.isLive||a.segmentButton!==!0||(f='<div class="zwp-button zwp-segmentButton"><button class="zwpbtn zwp-segmentBtn" data-action="toggleSegment" data-name="segmentbtn" title="'+
K("segmentSelect","Segment Select")+'"><i class="xicon xicon-zone"></i></button></div>');a.recordButton&&(c='<div class="zwp-button zwp-recordButton"><button class="zwpbtn zwp-recordBtn" data-action="record" data-name="recordbtn" title="'+K("record","Record")+'"><i class="xicon xicon-record"></i></button><div class="zwp-recordOptionsMenu"><div class="zwp-recording-option" data-action="recordVideo"><span class="zwp-recording-dot zwp-recording-dot-red"></span><span class="zwp-option-item-label">'+K("recordVideo",
"Full Recording")+'</span></div><div class="zwp-recording-option" data-action="recordAudio"><span class="zwp-recording-dot zwp-recording-dot-green"></span><span class="zwp-option-item-label">'+K("recordAudio","Audio Only")+"</span></div></div></div>");a.disablePicInPic||document.pictureInPictureEnabled&&(n='<div class="zwp-button zwp-picInPicButton"><button class="zwpbtn zwp-picInPicBtn" data-action="pictureInPicture" data-name="picInPicbtn" title="'+K("pictureInPicture","Picture-in-Picture")+'"><i class="xicon xicon-pic-in-pic"></i></button></div>');
a.isLive||a.showProgress===!1||(y='<div class="zwp__time-rail"></div>');p='<div class="zwp-button zwp-subtitleButton" style="display: none;"><button class="zwpbtn zwp-subtitleBtn" data-action="showSubtitleMenu" data-name="subtitlebtn" title="'+K("externalSubtitle","External Subtitles")+'"><i class="xicon xicon-cc"></i></button><div class="zwp-subtitleComposite"><div class="zwp-subtitleMenu">'+id(a)+"</div></div></div>";w='<div class="zwp-button zwp-qualityButton" style="display: none;"><button class="zwpbtn zwp-qualityBtn" data-action="showQualityMenu" data-name="qualitybtn" title="'+
K("qualitySelection","Quality Selection")+'"><i class="xicon xicon-hd"></i></button><ul class="zwp-qualityMenu">';for(var v=["1920","1280","720","480"],E="",D=0;D<v.length;D++)E=D===3?E+('<li class="zwp-quality-item active">'+v[D]+"</li>"):E+('<li class="zwp-quality-item">'+v[D]+"</li>");w=w+E+"</ul></div>";a.annotation&&a.annotationButton!==!1&&(l='<div class="zwp-button zwp-annotationButton zwp-hidden"><button class="zwpbtn zwp-annotationBtn zwp-active" data-action="toggleAnnotation" data-name="annotationbtn" title="'+
K("disableAnnotation","Disable Annotation")+'"><svg viewBox="0 0 24 24" width="24" height="24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="4" width="18" height="16" rx="2" ry="2"/><rect x="8" y="9" width="8" height="6" rx="1" fill="rgba(255,255,255,0.15)"/><circle cx="8" cy="9" r="1.5" fill="currentColor" stroke="none"/><circle cx="16" cy="9" r="1.5" fill="currentColor" stroke="none"/><circle cx="8" cy="15" r="1.5" fill="currentColor" stroke="none"/><circle cx="16" cy="15" r="1.5" fill="currentColor" stroke="none"/></svg></button></div>');
return'<div class="zwp-button zwp_playbtn"><button class="zwpbtn zwp-playbtn" data-action="play" data-name="playbtn"><i class="xicon xicon-play"></i></button></div><div class="zwp__time zwp__currenttime-container" role="timer" aria-live="polite"><span class="zwp__currenttime"></span></div><div class="zwp__time zwp__duration-container" style="display: none;"><span class="zwp__time_divider">/</span><span class="zwp__duration"></span></div><div class="zwp__time-info "></div>'+t+u+h+k+d+f+c+r+l+p+w+z+
x+m+n+e+'<div class="zwp-button"><button class="zwpbtn zwp-fullscrBtn" data-action="enterfullscreen" data-name="fullscrbtn" title="'+K("enterFullScreen","Enter Fullscreen")+'"><i class="xicon xicon-fullScreen"></i></button></div>'+y},kb=function(a,t,z){t={precision:t||null};z!==void 0&&(t.showHours=z);return sb(a,t)},gf=function(a){return sb(a,{precision:"ms"})},qb=function(a){if(typeof a.ratio==="number")return a.ratio*100;if(typeof a.ratio==="string"){if(a=a.ratio.split(":"),a.length===2){var t=
parseFloat(a[0]);a=parseFloat(a[1]);t===0&&(t=1);return a*100/t}}else if(typeof a.width==="number"&&typeof a.height==="number")return t=a.width,t===0&&(t=1),a.height*100/t;return 56.25},zb=function(a){if(a&&a._config&&a._config.fluid&&a.isMobile&&a.isMobile()){var t=a.playerElm;if(t){ka(t,"zwp-fluid");t.style.maxWidth="100%";t.style.width="100%";var z=window.matchMedia?window.matchMedia("(orientation: landscape)").matches:window.innerWidth>window.innerHeight;z?(t.style.height="100dvh",t.style.paddingTop=
"0",t.style.maxHeight="100dvh"):(t.style.height="0",t.style.maxHeight="",a=qb(a._config),t.style.paddingTop=a+"%")}}},Mb=function(a){function t(g){try{var q=document.createElement("textarea");q.value=g;q.style.position="fixed";q.style.top="-9999px";q.style.opacity="0";document.body.appendChild(q);q.focus();q.select();var A=document.execCommand("copy");document.body.removeChild(q);return A}catch(M){return!1}}function z(g){m=g;e._onVrViewChange=function(){m&&m.style.display!=="none"&&e._vrInput&&(m._vrSliderActive||
e.syncVrSettingsSliders(m))}}var y=!1,x=!1,e=this;e instanceof Mb||(e=Object.create(Mb.prototype));e.getFluidRatio=qb;e._features=[];e.registerFeature=function(g,q){if(g&&typeof g.destroy==="function"){g._phase=q||2;for(q=0;q<e._features.length;q++)if(e._features[q].name===g.name){e._features[q]=g;return}e._features.push(g)}};e._runFeatureDestroys=function(g){for(var q=e._features.length-1;q>=0;q--)if(e._features[q]._phase===g){try{e._features[q].destroy()}catch(A){console.warn("[ZWPlayer] feature destroy failed:",
e._features[q].name,A)}e._features.splice(q,1)}};var d=Object.freeze({showProgress:!0,timeFormat:"s",controlbar:!0,hideControlbarTimeout:1E4,defVolume:61.25,clientip:"",autoplay:!0,hideBigPlayButton:!0,hlsSubtitlePreload:!0,hlsSubtitleConcurrency:4,dashSubtitlePreload:!0,dashSubtitleConcurrency:4,subtitleStrictMatch:!1,iosWebFullscreen:!1,audioTracksButton:!1,vr:!1,mode:"standard",bumper:null,pauseAd:null,lyrics:null,preview:null,music:null});e._config=Object.assign({},d,a||{});e._defaults=Object.assign({},
d,a||{});e._userPaused=!1;e._frameStepping=!1;e._systemPaused=!1;var r=e._config,n=!(!a||!Object.prototype.hasOwnProperty.call(a,"autoplay"));r.autoplayUserControllable=!n;if(!n){n=null;try{n=localStorage.getItem("zwp_autoplay")}catch(g){}r.autoplay=n===null?!0:n==="1"}r.hideControlbarTimeout=+r.hideControlbarTimeout||d.hideControlbarTimeout;r.defVolume=+r.defVolume||d.defVolume;!r.chapters&&r.chapter&&(r.chapters=r.chapter);!r.thumbnails&&r.thumbnail&&(r.thumbnails=r.thumbnail);!r.annotations&&r.annotation&&
(r.annotations=r.annotation);!r.audioTracks&&r.audioTrack&&(r.audioTracks=r.audioTrack);!r.watermarks&&r.watermark&&(r.watermarks=r.watermark);r.logo&&!r.watermarks&&(r.watermarks=[Rd(r.logo)]);e._config.lang?(za.defaultLang=nd(e._config.lang),za._langExplicit=!0):(Qb(),e._config.lang=za.defaultLang);e._config.recordButton&&pb()&&(e._config.recordButton=!1);e.peer_conn=null;e.danmuSetting={};e.segment={isActive:!1,startTime:0,endTime:0,isDragging:!1,dragTarget:null,focusedHandle:null};e.subtitleLoopCtrl=
wd();e.subtitleLoopQueue={cues:[],position:null};e.resetPlaybackState=function(){this.segment.isActive=!1;this.segment.startTime=0;this.segment.endTime=0;this.segment.isDragging=!1;this.segment.dragTarget=null;this.segment.focusedHandle=null;this.segment.subtitleSourceSnapshot=null;this.segment.loopOriginFrom=void 0;this.subtitleLoopCtrl&&this.subtitleLoopCtrl.clear();this.subtitleLoopQueue&&(this.subtitleLoopQueue={cues:[],position:null});this._userSeekOutbound=!1;var g=this.controlbar?this.controlbar.querySelector("#segmentLayer"):
null,q=this.controlbar?this.controlbar.querySelector(".zwp-segmentBtn"):null;g&&(g.classList.remove("active"),(g=g.closest(".zwp__time-rail"))&&g.classList.remove("segment-active"));q&&q.closest(".zwp-segmentButton").classList.remove("active");this.streamContentCache=null};Hd(e,{fadeOut:Za});e._showLoading=function(){this.loadingOverlay&&(this.loadingOverlay.style.display="flex")};e._hideLoading=function(){this.loadingOverlay&&(this.loadingOverlay.style.display="none")};e._startPlayback=function(g){var q=
this;if(q.audioContext&&q.audioContext.state==="suspended")try{q.audioContext.resume()}catch(M){}var A=q.videoEl.play();A!==void 0?A.then(function(){if(q.audioContext&&q.audioContext.state==="suspended")try{q.audioContext.resume()}catch(M){}q.setplaystate(!0)}).catch(function(M){g?q.videoEl.muted?(q.setplaystate(!1),q._config.disableMutedConfirm||q.mutedConfirmBox(!0)):(q.videoEl.muted=!0,q.videoEl.defaultMuted=!0,q.videoEl.setAttribute("muted",""),q.setMuted(!0),M=q.videoEl.play(),M!==void 0?M.then(function(){q.setplaystate(!0);
q._config.disableMutedConfirm||q.mutedConfirmBox()}).catch(function(J){q.setplaystate(!1);q._config.disableMutedConfirm||q.mutedConfirmBox(!0)}):(q.setplaystate(!0),q._config.disableMutedConfirm||q.mutedConfirmBox())):q.setplaystate(!1)}):q.setplaystate(!0)};e._pausePlayback=function(){this.videoEl.pause();this.setplaystate(!1)};e._cleanupStreamAdapters=function(g){this.closecall&&(this.closecall(this),delete this.closecall);this.closecall2&&(this.closecall2(this),delete this.closecall2);g&&this.removeVideoEventHandlers&&
this.removeVideoEventHandlers()};e._cleanupTimers=function(){this.hideControlbarTimer&&(window.clearInterval(this.hideControlbarTimer),delete this.hideControlbarTimer);this.resizeTimer&&(window.clearTimeout(this.resizeTimer),delete this.resizeTimer);this.longPressState&&(this.longPressState.pressTimer&&(clearTimeout(this.longPressState.pressTimer),this.longPressState.pressTimer=null),this.longPressState.isFastPlaying=!1,this.longPressState.isPressed=!1);this.seekTimer&&(clearTimeout(this.seekTimer),
delete this.seekTimer);typeof this.resetKeyState==="function"&&this.resetKeyState();this.toastTimerId&&(clearTimeout(this.toastTimerId),delete this.toastTimerId,this.toastBox&&(this.overlay_layers.removeChild(this.toastBox),delete this.toastBox));this.overlayLayerClickTimer&&(window.clearTimeout(this.overlayLayerClickTimer),delete this.overlayLayerClickTimer);this._timefloatRaf&&(cancelAnimationFrame(this._timefloatRaf),this._timefloatRaf=null);this.keyState&&(this.keyState.nudgeAccelTimer&&(clearInterval(this.keyState.nudgeAccelTimer),
this.keyState.nudgeAccelTimer=null),this.keyState.nudgeRepeatTimer&&(clearTimeout(this.keyState.nudgeRepeatTimer),this.keyState.nudgeRepeatTimer=null));if(this._deferredTimers&&this._deferredTimers.length){for(var g=0;g<this._deferredTimers.length;g++)clearTimeout(this._deferredTimers[g]);this._deferredTimers=[]}};e._resetVideoSource=function(){this.videoEl&&(this.videoEl.removeAttribute("src"),this.videoEl.load())};Ed(e,{debug_log:!1,httpGet:gb,secondsToTimeCode:kb});e.setRtcstream=function(g){this.videoEl&&
(this.videoEl.srcObject=g,this._startPlayback(),this.startHideControlbar(this))};e.onfullscrchange=function(g){var q=this;nb()?(q.isFullscr=!0,q.setupFullscrBtn&&q.setupFullscrBtn.setAttribute("title",K("exitFullScreen","Exit full screen")),(g=document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement)||(g=q.videoEl||q.playerElm||q.playerContainer),g&&(q.fullscreenContextMenuHandler&&g.removeEventListener("contextmenu",q.fullscreenContextMenuHandler),
q.fullscreenContextMenuHandler=function(A){A.preventDefault();A.stopPropagation();fd||q.showContextMenu(A)},g.addEventListener("contextmenu",q.fullscreenContextMenuHandler))):(q.setupFullscrBtn&&(ja(q.playerElm,"zwp-fullscreen"),q.setupFullscrBtn.setAttribute("data-action","enterfullscreen"),q.setupFullscrBtn.setAttribute("title",K("enterFullScreen","Enter full screen"))),q.isFullscr=!1,q.fullscreenContextMenuHandler&&((g=document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||
document.msFullscreenElement)&&q.fullscreenContextMenuHandler&&g.removeEventListener("contextmenu",q.fullscreenContextMenuHandler),delete q.fullscreenContextMenuHandler),q._config.fluid&&(q.isMobile&&q.isMobile()?zb(q):(ka(q.playerElm,"zwp-fluid"),q.playerElm.style.height="0",(g=q.videoEl)&&g.videoHeight&&g.videoWidth||q._mode==="music"?(g=qb(q._config),q.playerElm.style.paddingTop=g+"%"):q.playerElm.style.paddingTop=q._config.keepAudioWindow?"264px":"64px")));q.isFullscrWin||q.reposDanmuToolbar(q.isFullscr)}.bind(e);
e.on_btnclick=function(g){if(g.currentTarget&&this.btnBindZwp){g=g.currentTarget;this._floatingUIPossible=!0;var q=g.getAttribute("data-action");if(q==="play"){if(!this._config.disablePlayBtn)if(this.isPlaying)this.videoEl&&(this.videoEl.paused||this.videoEl.ended)&&(this.isMobile()||this.initAudioContext(),this._startPlayback());else{if(this.playlistState&&this.playlistState.data&&this.playlistState.data.groups.length>0&&!this.playlistState.currentItem&&(g=this.playlistState.data.groups[0])&&g.items&&
g.items.length>0){this.playPlaylistItem(g.items[0]);return}this.videoEl&&this.videoEl.src&&!this.videoEl.error&&this.murl===this._config.url?(this.force_stopped=!1,this.isPlaying=!0,this.isMobile()||this.initAudioContext(),this._startPlayback()):this._config.url&&this.play(this._config.url)}}else q==="pause"?this._config.disablePlayBtn||(this._userPaused=!0,this.videoEl&&(this.videoEl.paused||this.videoEl.ended||this._pausePlayback())):q==="mute"?this.videoEl&&((typeof this._globalMuted==="boolean"?
this._globalMuted:this.videoEl.muted)||this.setMuted(!0)):q==="unmute"?this.videoEl&&(typeof this._globalMuted==="boolean"?this._globalMuted:this.videoEl.muted)&&this.setMuted(!1):q==="enterfullscreen"?this.setFullscreen(!0,g):q==="exitfullscreen"?this.setFullscreen(!1,g):q==="enterfullscreenWin"?this.setFullscreenWin(!0,g):q==="exitfullscreenWin"?this.setFullscreenWin(!1,g):q==="showMediainfo"?this.showMediainfo():q==="snapshot"?this.doSnapshot():q==="cast"?this.toggleCast():q==="pictureInPicture"?
this.togglePictureInPicture():q==="selectLocalFile"?this.selectLocalFile():q==="toggleSegment"?this.toggleSegment():q==="record"?this.recordVideo():q==="recordVideo"?this.recordVideo("video"):q==="recordAudio"?this.recordVideo("audio"):q==="toggleZoom"?this.toggleZoom():q==="toggleVR"?this.toggleVR():q==="toggleAnnotation"?this.toggleAnnotation():q==="showPlaylist"?this.togglePlaylistPanel():q==="playPrevItem"?this.playPrevPlaylistItem&&this.playPrevPlaylistItem():q==="playNextItem"?this.playNextPlaylistItem&&
this.playNextPlaylistItem():q==="showChapterSearchPanel"&&!this._closePanel("chapterSearchPanel")&&(this.closeAllActivePanels(),g=this.createChapterSearchPanel())&&(g.style.display="block",(g=g.querySelector(".zwp-search-input"))&&!this.isMobile()&&g.focus())}}.bind(e);e.setFullscreen=function(g,q){if(this._config.iosWebFullscreen&&gd)return this.setFullscreenWin(g,q);if(g){if(!nb()&&this.playerElm){this._config.fluid&&(ja(this.playerElm,"zwp-fluid"),this.playerElm.style.height=null,this.playerElm.style.paddingTop=
null);g=this.playerElm;var A=this.videoEl;g.requestFullscreen?g.requestFullscreen():g.webkitRequestFullscreen?g.webkitRequestFullScreen():g.mozRequestFullScreen?g.mozRequestFullScreen():g.msRequestFullscreen?g.msRequestFullscreen():g.oRequestFullscreen?g.oRequestFullscreen():A.webkitEnterFullScreen?A.webkitEnterFullScreen():(A=document.documentElement,A.requestFullscreen?A.requestFullscreen():A.mozRequestFullScreen?A.mozRequestFullScreen():A.webkitRequestFullScreen?A.webkitRequestFullScreen():(A=
document.body,document.documentElement.style.cssText="width:100%;height:100%;overflow:hidden;",A.style.cssText="width:100%;height:100%;overflow:hidden;",g.style.cssText="width:100%;height:100%;overflow:hidden;;margin:0px;padding:0px;",document.IsFullScreen=!0));ka(this.playerElm,"zwp-fullscreen");q&&q.setAttribute("data-action","exitfullscreen");if(!this.setupFullscrBtn){g=this.onfullscrchange;A=this.videoEl;var M="fullscreenchange";document.fullscreenEnabled!==void 0||typeof document.exitFullscreen===
"function"||document.documentElement&&typeof document.documentElement.requestFullscreen==="function"||(document.webkitExitFullscreen||document.webkitCancelFullScreen?M="webkitfullscreenchange":document.mozCancelFullScreen?M="mozfullscreenchange":document.msExitFullscreen&&(M="MSFullscreenChange"));document.addEventListener(M,g,!1);A&&fd&&(A.addEventListener("webkitbeginfullscreen",g),A.addEventListener("webkitendfullscreen",g));this.setupFullscrBtn=q}}}else nb()&&this.playerElm&&(this._config.fluid&&
(this.isMobile&&this.isMobile()?zb(this):(ka(this.playerElm,"zwp-fluid"),this.playerElm.style.height="0",(g=this.videoEl)&&g.videoHeight&&g.videoWidth||this._mode==="music"?(g=qb(this._config),this.playerElm.style.paddingTop=g+"%"):this.playerElm.style.paddingTop=this._config.keepAudioWindow?"264px":"64px")),yc(this.playerElm),ja(this.playerElm,"zwp-fullscreen"),q&&(q.setAttribute("data-action","enterfullscreen"),q.setAttribute("title",K("enterFullScreen","Enter full screen"))))}.bind(e);e.setFullscreenWin=
function(g,q){this.playerElm&&(g?this.isFullscrWin||(ka(this.playerElm,"zwp-fullscreen-win"),q&&(q.setAttribute("data-action","exitfullscreenWin"),q.setAttribute("title",K("exitWebFullscreen","Exit web fullscreen"))),this.isFullscrWin=!0,this.reposDanmuToolbar(!0),(g=this.playerElm.parentNode)&&g.tagName!=="BODY"&&(this.oldWrapZIndex=g.style.zIndex,g.style.zIndex=99999999),this._savedBodyOverflow=document.body.style.overflow,document.body.style.overflow="hidden"):this.isFullscrWin&&(typeof this.oldWrapZIndex!==
"undefined"&&(g=this.playerElm.parentNode,g.style.zIndex=this.oldWrapZIndex,delete this.oldWrapZIndex),typeof this._savedBodyOverflow!=="undefined"&&(document.body.style.overflow=this._savedBodyOverflow,delete this._savedBodyOverflow),ja(this.playerElm,"zwp-fullscreen-win"),q&&(q.setAttribute("data-action","enterfullscreenWin"),q.setAttribute("title",K("webFullscreen","Web Fullscreen"))),delete this.isFullscrWin,this.reposDanmuToolbar(!1)))}.bind(e);e.setMuted=function(g){this.videoEl&&(this.videoEl.muted=
g,(this.videoEl.defaultMuted=g)?(this.videoEl.setAttribute("muted",""),this.oldVolume=this.videoEl.volume):this.videoEl.removeAttribute("muted"));g?(ka(this.playerElm,"zwp-muted"),this.muteBtn&&this.muteBtn.setAttribute("data-action","unmute")):(this.oldVolume&&(this.videoEl.volume=this.oldVolume,delete this.oldVolume),ja(this.playerElm,"zwp-muted"),this.muteBtn&&this.muteBtn.setAttribute("data-action","mute"),this.audioContext&&this.audioContext.state==="suspended"&&this.audioContext.resume().then(function(){}).catch(function(q){}));
this.mutedTipBox&&(this.popup_layers.removeChild(this.mutedTipBox),this.popup_layers.style.display=null,delete this.mutedTipBox);typeof this._updateMutedPlaybackUI==="function"&&this._updateMutedPlaybackUI()}.bind(e);e.setVolume=function(g){this.videoEl&&(this.lastVolume=g,this.videoEl.volume=g,this.audioVolumeNode&&(this.audioVolumeNode.gain.value=g))}.bind(e);vd(e,{debug_log:!1,fadeOut:Za,triggerEvent:ad,detectMobile:pb,getControlId:jd});td(e,{formatPreciseTime:gf,ll:K});ud(e,{debug_log:!1,ll:K});
e.hasActiveFloatingUI=function(){if(e._floatingUIPossible){var g=e.panels;if(g&&g.length)for(var q=0;q<g.length;q++){var A=null;e.overlay_layers&&(A=e.overlay_layers.querySelector(g[q]));!A&&e.playerContainer&&(A=e.playerContainer.querySelector(g[q]));if(A&&A.style.display!=="none")return!0}if(e.controlbar&&e.controlbar.querySelector(".is-active"))return!0;e._floatingUIPossible=!1}return typeof e.isSegmentInteracting==="function"&&e.isSegmentInteracting()?!0:!1};e.startHideControlbar=function(g){g.controlbar&&
!g._config.fixedControlbar&&(g.hideControlbarTime=(new Date).getTime()+g._config.hideControlbarTimeout,g.hideControlbarTimer||(g.hideControlbarTimer=window.setInterval(function(){(new Date).getTime()>=g.hideControlbarTime&&(g.hasActiveFloatingUI&&g.hasActiveFloatingUI()?g.hideControlbarTime=(new Date).getTime()+g._config.hideControlbarTimeout:(window.clearInterval(g.hideControlbarTimer),delete g.hideControlbarTimer,Za(g.controlbar,1E3,function(q){q.style.display="none";ka(g.playerElm,"hide-cursor");
g.isControlbarhidden=!0;typeof e._config.onhideControlbar=="function"&&e._config.onhideControlbar.call(e)})))},1E3)))}.bind(e);Gd(e,{secondsToTimeCode:kb,offset:$c,getMouseIsDown:function(){return y},setMouseIsDown:function(g){y=g}});e.updateDuration=function(g){if(g.controlbar){var q=g.controlbar.querySelector(".zwp__duration-container"),A=g.videoEl.duration;if(isNaN(A)||A===Infinity)q.style.display="none",typeof g._config.isLive!=="boolean"&&(g._config.isLive=!0,g._liveAutoDetected=!0);else{q.style.display=
"block";q.querySelector(".zwp__duration").innerHTML=kb(A);g._config.isLive&&g._liveAutoDetected&&(delete g._config.isLive,delete g._liveAutoDetected);q=q.closest(".zwp-controlbar");A=A>=3600;q&&(A?ka(q,"zwp-has-hours"):ja(q,"zwp-has-hours"));g._showHoursLocked=A;g.chapters&&(g._deferredTimers=g._deferredTimers||[],g._deferredTimers.push(setTimeout(function(){this.loadChapters()}.bind(g),1E3)));typeof g._config.thumbnails==="string"&&g._loadThumbnails();var M=g._config.annotation||g._config.annotations;
M&&typeof g.loadAnnotations==="function"&&(g._deferredTimers=g._deferredTimers||[],g._deferredTimers.push(setTimeout(function(){g.loadAnnotations(M)},1200)))}g.updateProgressBarType();g.syncUI()}}.bind(e);e.setProgressRail=function(g){var q=g!==void 0?g.target||g.detail.target:this.videoEl,A=null;q&&q.buffered&&q.buffered.length>0&&q.buffered.end&&this.videoEl.duration?A=q.buffered.end(q.buffered.length-1)/this.videoEl.duration:q&&q.bytesTotal!==void 0&&q.bytesTotal>0&&q.bufferedBytes!==void 0?A=
q.bufferedBytes/q.bytesTotal:g&&g.lengthComputable&&g.total!==0&&(A=g.loaded/g.total);A!==null&&(A=Math.min(1,Math.max(0,A)),this.progressBar&&this.progressBar.loaded&&(this.progressBar.loaded.style.width=A*100+"%"))}.bind(e);e.updateProgress=function(g){if(!this.isTrackingProgress&&this.progressBar&&this.progressBar.thumb){var q=this.videoEl.duration;!isNaN(q)&&q!==Infinity&&q>0&&(g+.3>=q&&(g=q),g=g/q*100,this.progressBar.thumb.style.left=g+"%",this.progressBar.current&&(this.progressBar.current.style.width=
g/100*100+"%"))}}.bind(e);e.seekTimeProgress=function(g){if(this.videoEl){var q=this.videoEl.duration;isNaN(q)||q===Infinity||(this.videoEl.currentTime=q*g/100,this.progressBar.current&&(this.progressBar.current.style.width=g+"%"))}}.bind(e);e.seekTimeProgressByTime=function(g){if(this.videoEl){var q=this.videoEl.duration;isNaN(q)||q===Infinity||(this.videoEl.currentTime=g,this.progressBar.current&&(this.progressBar.current.style.width=g/q*100+"%"))}}.bind(e);e.on_speedItemclick=function(g){g.stopPropagation();
g=g.currentTarget;if(!ya(g,"active")){var q=parseFloat(g.innerText),A=g.parentNode.querySelector(".active");A&&ja(A,"active");ka(g,"active");this.videoEl&&(this.videoEl.playbackRate=q);if(A=this.controlbar.querySelector(".zwp-speedBtn"))A.innerHTML=q==1?"1x":g.innerText}(g=this.controlbar.querySelector(".zwp-speedButton"))&&ja(g,"is-active")}.bind(e);e._syncSpeedBtnUI=function(g){if(this.controlbar){var q=this.controlbar.querySelector(".zwp-speedBtn");q&&(q.innerHTML=g==1?"1x":g.toFixed(2).replace(/\.?0+$/,
"")+"x");(q=this.controlbar.querySelectorAll(".zwp-speedMenu > li.zwp-speed-item"))&&q.length>0&&q.forEach(function(A){parseFloat(A.innerText)===g?ka(A,"active"):ja(A,"active")})}}.bind(e);e._renderTimeSpan=function(g){if(this.timeSpan){var q=this.videoEl,A=g!==void 0?g:q?q.currentTime:0;g=this._timeCompactMode&&this._showRemaining&&!this._config.isLive;q=kb(g?Math.max(0,(q?q.duration:0)-A):A,this._config.timeFormat,this._showHoursLocked);this.timeSpan.innerHTML=g?"-"+q:q}}.bind(e);e.resetSpeedMenu=
function(){if(this.controlbar){var g=this.controlbar.querySelector(".zwp-speed-item.active");if(g&&g.innerText!=="1.0x"){var q=this.controlbar.querySelector(".zwp-speedBtn");q&&(q.innerHTML="1x");ja(g,"active");g=g.parentNode.querySelectorAll("li.zwp-speed-item");if(g.length>0)for(q=0;q<g.length;q++)if(g[q].innerText==="1.0x"){ka(g[q],"active");break}}}}.bind(e);e._applyControlbarMode=function(){var g=this.controlbar;if(g){var q=this._config,A=!(!q.url&&!this.murl);(q=!q.isLive&&q.showProgress!==
!1&&A)?ka(g,"zwp-vodplayer"):ja(g,"zwp-vodplayer");if(g=g.querySelector(".zwp__time-rail"))q?(ja(g,"zwp-hidden"),ka(g,"has-duration")):(ka(g,"zwp-hidden"),ja(g,"has-duration"))}}.bind(e);e.syncUI=function(){var g=this;if(g._config.isLive){var q=g.controlbar.querySelector(".zwp-speedButton");q&&g.controlbar.removeChild(q)}else if(g._config.speedButton&&(q=g.controlbar.querySelector(".zwp-speedButton"),!q)){var A=g.controlbar.querySelector(".zwp-infoButton")||g.controlbar.querySelector(".zwp-optionButton")||
g.controlbar.querySelector(".zwp-volume-docker");if(A){var M=cf();q=document.createElement("div");g.controlbar.insertBefore(q,A);q.outerHTML=M;if(q=g.controlbar.querySelector(".zwp-speedButton"))q.addEventListener("click",function(J){J.stopPropagation();g.updateSpeedMenuMaxHeight&&g.updateSpeedMenuMaxHeight();ya(q,"is-active")?ja(q,"is-active"):(g.closeAllMenus&&g.closeAllMenus(),ka(q,"is-active"))}),g.updateSpeedMenuMaxHeight&&g.updateSpeedMenuMaxHeight();A=g.controlbar.querySelectorAll(".zwp-speedMenu>li.zwp-speed-item");
A.length>0&&A.forEach(function(J){J.addEventListener("click",e.on_speedItemclick)})}}g._applyControlbarMode()}.bind(e);Fd(e);e.createRecordingSettingsPanel=function(){var g=this,q='<div class="zwp-recordingSettingsPanel zwp-popupwindow"><button class="closeBtn"><i class="xicon xicon-close"></i></button><div class="form-row form-title">'+K("recordingSettingsTitle","Recording Settings")+'</div><div class="form-row"><div class="zwp-radio-group"><label class="zwp-radio-item"><input type="radio" name="recordingOption" value="ask" checked><span class="zwp-radio-label">'+
K("recordingOptionAsk","Ask Every Time")+'</span></label><label class="zwp-radio-item"><input type="radio" name="recordingOption" value="video"><span class="zwp-radio-label">'+K("recordingOptionVideo","Record Video Directly")+'</span></label><label class="zwp-radio-item"><input type="radio" name="recordingOption" value="audio"><span class="zwp-radio-label">'+K("recordingOptionAudio","Record Audio Directly")+'</span></label></div></div><div class="form-row zwp-recording-note"><div class="zwp-note-text">'+
K("recordingNote","Note: If no audio is present, video will be recorded directly")+"</div></div></div>";g.overlay_layers.insertAdjacentHTML("beforeend",q);q=g.overlay_layers.querySelector(":scope > .zwp-recordingSettingsPanel");var A=q.querySelector(".closeBtn");A&&A.addEventListener("click",function(M){M.stopPropagation();var J=M.currentTarget.closest(".zwp-recordingSettingsPanel");Za(J,500,function(){J.remove()});delete g.recordingSettingsPanel;g._lastClosedParentMenu&&(g._lastClosedParentMenu.style.display=
"",delete g._lastClosedParentMenu)});if(A=q.querySelector('input[name="recordingOption"][value="'+(g.recordingSettings.mode||"ask")+'"]'))A.checked=!0;A=q.querySelectorAll('input[name="recordingOption"]');A.length>0&&A.forEach(function(M){M.addEventListener("change",function(J){g.recordingSettings.mode=J.target.value;g.updateRecordingMenuVisibility&&g.updateRecordingMenuVisibility()});M.value===g.recordingSettings.mode&&(M.checked=!0)});q.addEventListener("mousedown",function(M){M.stopPropagation()});
q.addEventListener("dblclick",function(M){M.stopPropagation()});q.addEventListener("click",function(M){M.stopPropagation()});return g.recordingSettingsPanel=q}.bind(e);e.createVrSettingsPanel=function(){var g=this,q='<div class="zwp-vrSettingsPanel zwp-popupwindow"><button class="closeBtn"><i class="xicon xicon-close"></i></button><div class="form-row form-title">'+K("vrSettingsTitle","VR Settings")+'</div><div class="form-row"><label class="row-label">'+K("vrYaw","Yaw")+'</label><div class="row-content"><input type="range" class="zwp-slider" data-action="vrYaw" min="-180" max="180" step="1" value="0"><span class="zwp-slider-value">0\u00b0</span></div></div><div class="form-row"><label class="row-label">'+
K("vrPitch","Pitch")+'</label><div class="row-content"><input type="range" class="zwp-slider" data-action="vrPitch" min="-90" max="90" step="1" value="0"><span class="zwp-slider-value">0\u00b0</span></div></div><div class="form-row"><label class="row-label">'+K("vrFov","FOV")+'</label><div class="row-content"><input type="range" class="zwp-slider" data-action="vrFov" min="30" max="100" step="1" value="75"><span class="zwp-slider-value">75\u00b0</span></div></div><div class="form-row zwp-vr-preview-row"><div class="zwp-vr-preview-block"><svg class="zwp-vr-preview" viewBox="0 0 100 100" width="84" height="84"><circle cx="50" cy="50" r="44" fill="none" stroke="rgba(255,255,255,0.25)" stroke-width="1"/><circle cx="50" cy="50" r="2" fill="rgba(255,255,255,0.6)"/><path class="zwp-vr-fov-arc" d="" fill="rgba(0,188,212,0.35)" stroke="rgba(0,188,212,0.9)" stroke-width="1"/><line class="zwp-vr-heading" x1="50" y1="50" x2="50" y2="6" stroke="rgba(255,255,255,0.7)" stroke-width="1.5"/></svg><div class="zwp-vr-preview-label">'+
K("vrYaw","Yaw")+'</div></div><div class="zwp-vr-preview-block"><svg class="zwp-vr-preview zwp-vr-pitch-svg" viewBox="0 0 100 100" width="84" height="84"><circle cx="50" cy="50" r="44" fill="none" stroke="rgba(255,255,255,0.25)" stroke-width="1"/><circle cx="50" cy="50" r="2" fill="rgba(255,255,255,0.6)"/><path class="zwp-vr-pitch-arc" d="" fill="none" stroke="rgba(0,188,212,1)" stroke-width="5" stroke-linecap="round"/><line class="zwp-vr-pitch-heading" x1="50" y1="50" x2="50" y2="6" stroke="rgba(255,255,255,0.7)" stroke-width="1.5"/><line x1="6" y1="50" x2="94" y2="50" stroke="rgba(255,255,255,0.15)" stroke-width="1" stroke-dasharray="2,2"/></svg><div class="zwp-vr-preview-label">'+
K("vrPitch","Pitch")+'</div></div></div><div class="form-row form-bottombar"><button class="zwp-form-button action-item" data-action="resetVrView">'+K("reset","Reset")+'</button><button class="zwp-form-button action-item" data-action="copyVrConfig">'+K("copyVrConfig","Copy Config")+"</button></div></div>";g.overlay_layers.insertAdjacentHTML("beforeend",q);var A=g.overlay_layers.querySelector(":scope > .zwp-vrSettingsPanel");if(!A)return null;(q=A.querySelector(".closeBtn"))&&q.addEventListener("click",
function(M){M.stopPropagation();var J=M.currentTarget.closest(".zwp-vrSettingsPanel");m=e._onVrViewChange=null;Za(J,500,function(){J.remove()});delete g.vrSettingsPanel;g._lastClosedParentMenu&&(g._lastClosedParentMenu.style.display="",delete g._lastClosedParentMenu)});(q=A.querySelectorAll('input[type="range"]'))&&q.forEach&&q.forEach(function(M){M.addEventListener("mousedown",function(){A._vrSliderActive=!0});M.addEventListener("touchstart",function(){A._vrSliderActive=!0},{passive:!0});M.addEventListener("mouseup",
function(){A._vrSliderActive=!1});M.addEventListener("touchend",function(){A._vrSliderActive=!1});M.addEventListener("input",function(J){if(g._vrInput){var T=J.currentTarget.getAttribute("data-action"),b=parseFloat(J.currentTarget.value),S=g._vrInput.getState();T==="vrYaw"?g._vrInput.setYawPitchFov(b*Math.PI/180,S.pitch,S.fov):T==="vrPitch"?g._vrInput.setYawPitchFov(S.yaw,b*Math.PI/180,S.fov):T==="vrFov"&&g._vrInput.setYawPitchFov(S.yaw,S.pitch,b);if(J=J.currentTarget.parentNode.querySelector(".zwp-slider-value"))J.textContent=
Math.round(b)+"\u00b0";S=A.querySelector('input[data-action="vrYaw"]');b=A.querySelector('input[data-action="vrFov"]');T=A.querySelector(".zwp-vr-fov-arc");J=A.querySelector(".zwp-vr-heading");if(S&&b&&T){S=parseFloat(S.value)||0;b=parseFloat(b.value)||75;var H=(S-b/2-90)*Math.PI/180,V=(S+b/2-90)*Math.PI/180,P=50+44*Math.sin(H),U=50+44*Math.cos(V);V=50+44*Math.sin(V);var W=b>180?1:0;T.setAttribute("d","M 50,50 L "+(50+44*Math.cos(H)).toFixed(1)+","+P.toFixed(1)+" A 44,44 0 "+W+",1 "+U.toFixed(1)+
","+V.toFixed(1)+" Z");S=(S-90)*Math.PI/180;T=50+44*Math.cos(S);S=50+44*Math.sin(S);J&&(J.setAttribute("x2",T.toFixed(1)),J.setAttribute("y2",S.toFixed(1)));S=A.querySelector('input[data-action="vrPitch"]');T=A.querySelector(".zwp-vr-pitch-arc");J=A.querySelector(".zwp-vr-pitch-heading");S&&T&&(S=parseFloat(S.value)||0,H=-(S-b/2)*Math.PI/180,V=-(S+b/2)*Math.PI/180,P=50+44*Math.sin(H),U=50+44*Math.cos(V),V=50+44*Math.sin(V),b=b>180?1:0,T.setAttribute("d","M "+(50+44*Math.cos(H)).toFixed(1)+","+P.toFixed(1)+
" A 44,44 0 "+b+",0 "+U.toFixed(1)+","+V.toFixed(1)),J&&(b=-S*Math.PI/180,J.setAttribute("x2",(50+44*Math.cos(b)).toFixed(1)),J.setAttribute("y2",(50+44*Math.sin(b)).toFixed(1))))}}})});(q=A.querySelectorAll(".action-item"))&&q.length>0&&q.forEach(function(M){M.addEventListener("click",g.on_optionItemclick)});A.addEventListener("mousedown",function(M){M.stopPropagation()});A.addEventListener("dblclick",function(M){M.stopPropagation()});A.addEventListener("click",function(M){M.stopPropagation()});
return g.vrSettingsPanel=A}.bind(e);e.syncVrSettingsSliders=function(g){if(g&&e._vrInput){var q=e._vrInput.getState(),A=Math.round(q.yaw*180/Math.PI),M=Math.round(q.pitch*180/Math.PI);q=Math.round(q.fov);var J=function(P,U){if(P=g.querySelector('input[data-action="'+P+'"]'))if(P.value=U,P=P.parentNode.querySelector(".zwp-slider-value"))P.textContent=U+"\u00b0"};J("vrYaw",A);J("vrPitch",M);J("vrFov",q);if(J=g.querySelector(".zwp-vr-fov-arc")){var T=(A-q/2-90)*Math.PI/180,b=(A+q/2-90)*Math.PI/180,S=
50+44*Math.sin(T),H=50+44*Math.cos(b);b=50+44*Math.sin(b);var V=q>180?1:0;J.setAttribute("d","M 50,50 L "+(50+44*Math.cos(T)).toFixed(1)+","+S.toFixed(1)+" A 44,44 0 "+V+",1 "+H.toFixed(1)+","+b.toFixed(1)+" Z");if(J=g.querySelector(".zwp-vr-heading"))A=(A-90)*Math.PI/180,J.setAttribute("x2",(50+44*Math.cos(A)).toFixed(1)),J.setAttribute("y2",(50+44*Math.sin(A)).toFixed(1));J=g.querySelector(".zwp-vr-pitch-arc");A=g.querySelector(".zwp-vr-pitch-heading");J&&(T=-(M-q/2)*Math.PI/180,b=-(M+q/2)*Math.PI/
180,S=50+44*Math.sin(T),H=50+44*Math.cos(b),b=50+44*Math.sin(b),q=q>180?1:0,J.setAttribute("d","M "+(50+44*Math.cos(T)).toFixed(1)+","+S.toFixed(1)+" A 44,44 0 "+q+",0 "+H.toFixed(1)+","+b.toFixed(1)),A&&(M=-M*Math.PI/180,A.setAttribute("x2",(50+44*Math.cos(M)).toFixed(1)),A.setAttribute("y2",(50+44*Math.sin(M)).toFixed(1))))}}}.bind(e);var m=null;e.createShortcutHelpPanel=function(){var g=this;g._floatingUIPossible=!0;var q=$e({segmentButton:!!g._config.segmentButton});g.overlay_layers.insertAdjacentHTML("beforeend",
q);q=g.overlay_layers.querySelector(":scope > .zwp-shortcutHelpPanel");var A=q.querySelector(".closeBtn");A&&A.addEventListener("click",function(J){J.stopPropagation();var T=J.currentTarget.closest(".zwp-shortcutHelpPanel");Za(T,500,function(){T.remove()});delete g.shortcutHelpPanel});q.addEventListener("mousedown",function(J){J.stopPropagation()});q.addEventListener("dblclick",function(J){J.stopPropagation()});q.addEventListener("click",function(J){J.stopPropagation()});A=q.querySelector(".zwp-list-inner");
var M=Da(A);M.niceScroll({cursorborder:"",cursorcolor:"rgb(179 178 178 / 67%)",boxzoom:!1,rightdock:4});e.closeAllActivePanels();q.style.display="block";g.shortcutHelpPanel=q;M.focus();A.addEventListener("mouseenter",function(J){J.stopPropagation();this.focus()});return q}.bind(e);var u=function(g,q){if(g=g.querySelector(".zwp-optionPanel"))g=g.querySelectorAll(".zwp_switch"),g.length>0&&g.forEach(function(A){var M=A.getAttribute("data-action");q.indexOf(M)!==-1&&ya(A,"switch_on")&&ja(A,"switch_on")})};
e.on_optionItemclick=function(g){var q=this;g.stopPropagation();g=g.currentTarget;ya(g,"zwp_switch")&&rc(g);var A=g.getAttribute("data-action");if(A==="mirror")q.videoEl&&(g=ya(g,"switch_on"),q._config.video_mirror=g,q.flipMirrorVideo(),g&&(q._config.video_rotated=0,u(q.controlbar,["rotated270","rotated90"])));else if(A==="flip")q.videoEl&&(g=ya(g,"switch_on"),q._config.video_flip=g,q.flipMirrorVideo(),g&&(q._config.video_rotated=0,u(q.controlbar,["rotated270","rotated90"])));else if(A==="rotated90")q.videoEl&&
(g=ya(g,"switch_on"),q._config.video_rotated=g?90:0,q.rotateVideo(),g&&(q._config.video_mirror=!1,q._config.video_flip=!1,u(q.controlbar,["mirror","flip","rotated270"])));else if(A==="rotated270")q.videoEl&&(g=ya(g,"switch_on"),q._config.video_rotated=g?270:0,q.rotateVideo(),g&&(q._config.video_mirror=!1,q._config.video_flip=!1,u(q.controlbar,["mirror","flip","rotated90"])));else if(A==="loop")g=ya(g,"switch_on"),q._config.loop=g;else if(A==="autoplay"){g=ya(g,"switch_on");q._config.autoplay=g;try{localStorage.setItem("zwp_autoplay",
g?"1":"0")}catch(T){}}else if(A==="vrActive")ya(g,"switch_on")?q.isVrActive&&q.isVrActive()||q.toggleVR():q.isVrActive&&q.isVrActive()&&q.toggleVR();else if(A==="vrGyro")g=ya(g,"switch_on"),q._vrInput&&(g?typeof DeviceOrientationEvent!=="undefined"&&typeof DeviceOrientationEvent.requestPermission==="function"?DeviceOrientationEvent.requestPermission().then(function(T){T==="granted"?q._vrInput.enableGyro():typeof q.toast==="function"&&q.toast(K("gyroDenied","\u9640\u87ba\u4eea\u6743\u9650\u88ab\u62d2"))}).catch(function(){typeof q.toast===
"function"&&q.toast(K("gyroDenied","\u9640\u87ba\u4eea\u6743\u9650\u88ab\u62d2"))}):q._vrInput.enableGyro():q._vrInput.disableGyro());else if(A==="vrStereo")g=ya(g,"switch_on"),typeof q.setVrStereo==="function"&&q.setVrStereo(g);else if(A==="showRecordingConfig"){if(g=g.closest(".zwp-optionPanel"))if(A=g.closest(".zwp-optionButton")){var M=q.overlay_layers.querySelector(":scope > .zwp-recordingSettingsPanel");if(!M&&(M=q.createRecordingSettingsPanel(),!M))return;q.closeAllActivePanels();M.style.display=
"block";g.style.display="none";q._lastClosedParentMenu=g;ja(A,"is-active")}}else if(A==="showVrConfig"){g=g.closest(".zwp-vrButton");A=q.overlay_layers.querySelector(":scope > .zwp-vrSettingsPanel");if(!A&&(A=q.createVrSettingsPanel(),!A))return;q.closeAllActivePanels();q.syncVrSettingsSliders(A);A.style.display="block";z(A);g&&ja(g,"is-active")}else if(A==="resetVrView")q._vrInput&&(q._vrInput.reset(),(g=q.overlay_layers&&q.overlay_layers.querySelector(":scope > .zwp-vrSettingsPanel"))&&q.syncVrSettingsSliders(g));
else if(A==="copyVrConfig")if(q._vrInput){g=q._vrInput.getState();var J="vr: { yaw: "+Math.round(g.yaw*180/Math.PI)+", pitch: "+Math.round(g.pitch*180/Math.PI)+", fov: "+Math.round(g.fov)+" }";g=!1;try{navigator.clipboard&&navigator.clipboard.writeText&&(navigator.clipboard.writeText(J).then(function(){typeof q.toast==="function"&&q.toast(K("vrConfigCopied","VR config copied"),2500)}).catch(function(){t(J)?typeof q.toast==="function"&&q.toast(K("vrConfigCopied","VR config copied"),2500):typeof q.toast===
"function"&&q.toast(J,6E3)}),g=!0)}catch(T){}g||(t(J)?typeof q.toast==="function"&&q.toast(K("vrConfigCopied","VR config copied"),2500):typeof q.toast==="function"&&q.toast(J,6E3))}else typeof q.toast==="function"&&q.toast(K("activateVrFirst","\u8bf7\u5148\u6fc0\u6d3b VR"),3E3);else if(A==="showVolumeBoostConfig"){if(!q.isMobile()&&(g=g.closest(".zwp-optionPanel"))&&(A=g.closest(".zwp-optionButton"))){M=q.overlay_layers.querySelector(":scope > .zwp-volumeBoostPanel");if(!M&&(M=q.createVolumeBoostPanel(),
!M))return;q.closeAllActivePanels();M.style.display="block";g.style.display="none";q._lastClosedParentMenu=g;ja(A,"is-active")}}else if(A==="showColorConfig"&&(g=g.closest(".zwp-optionPanel"))&&(A=g.closest(".zwp-optionButton"))){M=q.overlay_layers.querySelector(":scope > .zwp-colorSettingPanel");if(!M&&(M=q.createColorSettingPanel(),!M))return;q.closeAllActivePanels();M.style.display="block";g.style.display="none";q._lastClosedParentMenu=g;ja(A,"is-active")}}.bind(e);e.flipMirrorVideo=function(){var g=
null;this._config.video_flip&&(g="rotateX(180.00deg)");this._config.video_mirror&&(g=g?g+" rotateY(180.00deg)":" rotateY(180.00deg)");this.videoEl.style.width="100%";this.videoEl.style.height="100%";this.videoEl.style.transform=g}.bind(e);e.rotateVideo=function(){var g=null,q=this.videoEl.parentNode;if(q&&q===this.videoWrapper)if(this._config.video_rotated){var A=q.offsetHeight;q=q.offsetWidth;var M=this.videoEl.videoHeight;this.videoEl.videoWidth&&M&&(this.videoEl.style.width=A+"px",this.videoEl.style.height=
q+"px",this.videoEl.style.transformOrigin="center center",M=(q-A)/2,A=(A-q)/2,this._config.video_rotated===90?g="translate("+M+"px, "+A+"px) rotate(0.25turn)":this._config.video_rotated===270&&(g="translate("+M+"px, "+A+"px) rotate(0.75turn)"),this.videoEl.style.transform=g)}else this.videoEl.style.transform&&(this.videoEl.style.transform=null,this.videoEl.style.width="100%",this.videoEl.style.height="100%")}.bind(e);e.setupEventsHandler=function(){var g=this;if(!g.videoEventsSetuped){g.videoEventsSetuped=
!0;var q=function(b){g._hideLoading();g.isPlaying||g._config.autoplay?g._startPlayback(!0):g.setplaystate(!1);g.updateDuration(g);g.videoEl&&g.timeSpan?g._renderTimeSpan(g.videoEl.currentTime):g.videoEl&&g.controlbar&&(g.timeSpan=g.controlbar.querySelector(".zwp__currenttime"),g.timeSpan&&g._renderTimeSpan(g.videoEl.currentTime));g._config.isLive&&g.controlbar&&(g.controlbar.querySelector(".zwp__duration-container").style.display="none");g._config.fluid&&(g.isMobile&&g.isMobile()?zb(g):(b=g.videoEl,
ka(g.playerElm,"zwp-fluid"),g.playerElm.style.maxWidth="100%",g.playerElm.style.width="100%",g.playerElm.style.height="0",b&&b.videoHeight&&b.videoWidth||g._mode==="music"?(b=qb(g._config),g.playerElm.style.paddingTop=b+"%"):g.playerElm.style.paddingTop=g._config.keepAudioWindow?"264px":"64px"));g.buildProgressBar();g.updateProgress&&g.videoEl&&g.updateProgress(g.videoEl.currentTime)};g.videoEl.addEventListener("loadedmetadata",q);var A=g.videoEl,M=function(b){var S=!0;if(b.type==="ended"){g.savePlaylistProgress&&
g.savePlaylistProgress();var H=g.playlistState&&g.playlistState.currentItem&&!g._config.isLive&&g.playlistState.data&&g.playlistState.data.autoPlayNext!==!1&&g.playlistState.autoPlayNext!==!1;!g._config.isLive&&g._config.loop?(window.setTimeout(function(){g.videoEl.currentTime=0;g.videoEl.play()},1E3),S=!1):H&&g.playNextPlaylistItem?(window.setTimeout(function(){g.playNextPlaylistItem()},500),S=!1):(g.isEnded=!0,g.setplaystate(!1),g._config.isLive&&g._config.reconnect&&g.mpegtsPlayer&&(setTimeout(function(){g.lastDecodedFrames=
0;g.closecall(g);g.openMpegts()},1E3),S=!1))}else b.type==="play"?(delete g.isEnded,g._userPaused=!1,g.hidePauseAd&&g.hidePauseAd(),typeof g.postSeekTime!=="undefined"&&(g.seekTimeProgressByTime(g.postSeekTime),delete g.postSeekTime)):b.type==="pause"?g._bumperActive?g.savePlaylistProgress&&g.savePlaylistProgress():(g.setplaystate(!1),g.savePlaylistProgress&&g.savePlaylistProgress(),g._maybeShowPauseAd&&g._maybeShowPauseAd(),g._frameStepping&&(g._frameStepping=!1)):b.type==="playing"?(g.setplaystate(!0),
typeof g._updateMutedPlaybackUI==="function"&&g._updateMutedPlaybackUI()):b.type==="volumechange"&&typeof g._updateMutedPlaybackUI==="function"&&g._updateMutedPlaybackUI();H=!!g._hlsVideoCodecUnsupported;g.progressBar&&g.progressBar.buffering&&("play playing pause seeked ended error".split(" ").includes(b.type)?g.progressBar.buffering.style.display="none":["seeking","waiting","loadeddata"].includes(b.type)&&!H&&(g.progressBar.buffering.style.display=""));b.type==="waiting"&&(H||g._showLoading());
if(b.type==="error"&&(g._hideLoading(),g._systemPaused=!0,g.hidePauseAd&&g.hidePauseAd(),!g._corsRetryDone&&g.videoEl&&g.videoEl.getAttribute("crossorigin")!==null&&g.videoEl.error&&(g.videoEl.src||g.videoEl.currentSrc))){g._corsRetryDone=!0;g.videoEl.removeAttribute("crossorigin");try{g.videoEl.load()}catch(V){}}S&&typeof g._config.onmediaevent==="function"&&g._config.onmediaevent.call(g,b)},J=function(b){var S=this.currentTime;typeof g.postSeekTime!=="undefined"&&(S=g.postSeekTime);g.segment.isActive&&
!g.segment.isDragging&&S>=g.segment.endTime&&(g.recording&&g.recording.isRecording&&g.stopRecording?(this.currentTime=g.segment.endTime,g.stopRecording()):g._userSeekOutbound?g._userSeekOutbound=!1:g.keyState&&g.keyState.isFastForward?(this.currentTime=g.segment.endTime,g.videoEl.playbackRate=g.keyState.originalPlaybackRate||1,g.keyState.isFastForward=!1,g.keyState.rightPressed=!1):this.currentTime=g.segment.startTime);if(typeof g._config.ontimeupdate==="function")g._config.ontimeupdate(S);if(g.playlistState&&
g.playlistState.currentItem&&g.savePlaylistProgress){var H=Date.now();if(!g._playlistProgressTimer||H-g._playlistProgressTimer>=5E3)g._playlistProgressTimer=H,g.savePlaylistProgress()}!g.timeSpan&&g.controlbar&&(g.timeSpan=g.controlbar.querySelector(".zwp__currenttime"));g.timeSpan&&g._renderTimeSpan(S);g.updateProgress(S);g.setProgressRail(b);g.renderSubtitles(S);g._hotspotOnTimeUpdate&&g._hotspotOnTimeUpdate(S)};A.addEventListener("play",M);A.addEventListener("playing",M);A.addEventListener("pause",
M);A.addEventListener("seeked",M);A.addEventListener("ended",M);A.addEventListener("error",M);A.addEventListener("seeking",M);A.addEventListener("waiting",M);A.addEventListener("volumechange",M);A.addEventListener("timeupdate",J);var T=g._onSeekRender=function(){g.renderSubtitles&&g.renderSubtitles(A.currentTime)};A.addEventListener("seeking",T);A.addEventListener("seeked",T);g.keyboardEventsInitialized?g._config.localPlayback&&(document.removeEventListener("keydown",g.onKeydown),document.removeEventListener("keyup",
g.onKeyup),document.addEventListener("keydown",g.onKeydown),document.addEventListener("keyup",g.onKeyup)):(document.addEventListener("keydown",g.onKeydown),document.addEventListener("keyup",g.onKeyup),g.keyboardEventsInitialized=!0);e.videoEventsSetuped=!0;e.removeVideoEventHandlers=function(){if(this.videoEventsSetuped){var b=this.videoEl;b.removeEventListener("loadedmetadata",q);b.removeEventListener("play",M);b.removeEventListener("playing",M);b.removeEventListener("pause",M);b.removeEventListener("seeked",
M);b.removeEventListener("ended",M);b.removeEventListener("error",M);b.removeEventListener("seeking",M);b.removeEventListener("waiting",M);b.removeEventListener("timeupdate",J);this._onSeekRender&&(b.removeEventListener("seeking",this._onSeekRender),b.removeEventListener("seeked",this._onSeekRender),delete this._onSeekRender);document.removeEventListener("keydown",this.onKeydown);document.removeEventListener("keyup",this.onKeyup);typeof this.resetKeyState==="function"&&this.resetKeyState();delete this.videoEventsSetuped;
this.keyboardEventsInitialized=!1}}}}.bind(e);e.showMediainfo=function(g){var q=this;if(q.overlay_layers){q.closeAllActivePanels();var A=q.overlay_layers.querySelector(".zwp__mediainfo-viewer");if(A){if(!g){g=A.querySelector(".closeBtn");var M=document.createEvent("Event");M.initEvent("click",!0,!0);g.dispatchEvent(M)}}else{g='<button class="closeBtn"><i class="xicon xicon-close"></i></button><div class="form-row form-title">'+(K("media-prop","Media properties")+"</div>");q.mediaInfo?(M=q.mediaInfo,
M.hasVideo&&(g+='<div class="info-item"><span class="info-label">Video</span><span class="info-value">'+Qa(M.vCodec)+"</span></div>",g+='<div class="info-item"><span class="info-label">Width</span><span class="info-value">'+Qa(M.width)+"</span></div>",g+='<div class="info-item"><span class="info-label">Height</span><span class="info-value">'+Qa(M.height)+"</span></div>",g+='<div class="info-item"><span class="info-label">FPS</span><span class="info-value">'+Qa(M.fps)+"</span></div>",g+='<div class="info-item"><span class="info-label">Profile</span><span class="info-value">'+
Qa(M.profile)+"</span></div>",g+='<div class="info-item"><span class="info-label">Level</span><span class="info-value">'+Qa(M.level)+"</span></div>"),M.hasAudio&&(g+='<div class="info-item"><span class="info-label">Audio</span><span class="info-value">'+Qa(M.aCodec)+"</span></div>",g+='<div class="info-item"><span class="info-label">SampRate</span><span class="info-value">'+Qa(M.sampleRate)+"</span></div>",g+='<div class="info-item"><span class="info-label">Channel</span><span class="info-value">'+
Qa(M.channels)+"</span></div>")):q.videoEl?(M=q.videoEl,M.videoWidth&&(g+='<div class="info-item"><span class="info-label">Width</span><span class="info-value">'+M.videoWidth+"</span></div>",g+='<div class="info-item"><span class="info-label">Height</span><span class="info-value">'+M.videoHeight+"</span></div>"),M.duration&&(g+='<div class="info-item"><span class="info-label">Duration</span><span class="info-value">'+kb(M.duration)+"</span></div>")):g+='<div class="info-item"><div class="row-text">No More Media Info</div></div>';
A=document.createElement("div");A.setAttribute("class","zwp__mediainfo-viewer zwp-popupwindow");A.innerHTML=g;q.overlay_layers.appendChild(A);A.addEventListener("click",function(T){T.stopPropagation()});var J=function(T){T.preventDefault();T.stopPropagation();Za(A,500,function(){A.remove()});q.overlay_layers.removeEventListener("click",J);delete q.infoViewer};g=A.querySelector(".closeBtn");g.addEventListener("click",J);q.infoViewer=A}}}.bind(e);zd(e,{zwpQuery:Da,fadeOut:Za,secondsToTimeCode:kb,vttParse:Ab,
srtParse:sc,zwp_subtitleSearch_html:We,zwp_subtitleTranslate_html:Xe,zwp_tts_html:Ye,zwp_version:"3.3.2"});Dd(e,{httpGet:gb,parse_media_time:Db,secondsToTimeCode:kb,zwpQuery:Da,fadeOut:Za,zwp__controlbar_chapters_html:Ve,zwp__make_chapters_list:df,zwp_chapterSearch_html:Ze,resolveThumbnailUrl:nc});Qd(e,{debug_log:!1,httpGet:gb});Sd(e,{httpGet:gb});Vd(e,{httpGet:gb});od(e,{getTimeString:Re,copyToClipboard:Qe});pd(e,{debug_log:!1,zwp_pipWrapper_html:af,ll:K});sd(e);qd(e);Pd(e,{httpGet:gb,fadeOut:Za,
fadeIn:Yc,onZwpSwitch:rc,makeSubtitleMenuItems:id});te(e,{triggerEvent:ad,httpGet:gb});if(e.createSubtitlesMenu){var f=e.createSubtitlesMenu;e.createSubtitlesMenu=function(){var g=f.apply(this,arguments);typeof e._updateSubtitleButtonVisibility==="function"&&e._updateSubtitleButtonVisibility();return g}}if(e.resetSubtitleMenu){var c=e.resetSubtitleMenu;e.resetSubtitleMenu=function(){var g=c.apply(this,arguments);typeof e._updateSubtitleButtonVisibility==="function"&&e._updateSubtitleButtonVisibility();
return g}}e.resetQualitiesMenu=function(){if(this&&!this.multiStreams&&this.controlbar){var g=this.controlbar.querySelector(".zwp-qualityButton");if(g){var q=g.querySelector(".zwp-qualityMenu");q&&(q.innerHTML='<li class="zwp-quality-item zwp-disabled" data-index="-1">No quality</li>');g.style.display="none"}}}.bind(e);e.createQualitiesMenu=function(g,q=!0){var A=this;if(g.length<=1)A.resetQualitiesMenu();else{var M=A.controlbar.querySelector(".zwp-qualityButton");if(M){var J="",T=K("level","Level")+
" ";q&&(J+='<li class="zwp-quality-item active" data-idx="-1">'+K("qs-auto","AUTO SWITCH")+"</li>");for(q=0;q<g.length;q++){var b="";b=typeof g[q].name==="undefined"?g[q].width&&g[q].height?g[q].width+"x"+g[q].height:T+(q+1):g[q].name;typeof g[q].bitrate!=="undefined"&&(b+=" ("+Pe(g[q].bitrate)+")");J+='<li class="zwp-quality-item" data-br="'+g[q].bitrate+'" data-idx="'+g[q].qualityIndex+'" data-vh="'+g[q].height+'">'+Qa(b)+"</li>"}if(g=M.querySelector(".zwp-qualityMenu"))g.innerHTML=J,Da(g).find(".zwp-quality-item").click(function(S){S.preventDefault();
S.stopPropagation();S=Da(this);S.hasClass("active")||(S.siblings().removeClass("active"),S.addClass("active"),S=this.getAttribute("data-idx"),typeof A.switchQualityLevel==="function"&&A.switchQualityLevel(S))});M.style.display="block"}}}.bind(e);e.updateQualityLevel=function(g,q){if(this&&this.controlbar){var A=this.controlbar.querySelector(".zwp-qualityButton");A&&(A=A.querySelector(".zwp-qualityMenu"))&&Da(A).children(".zwp-quality-item").each(function(M,J){M=parseInt(J.getAttribute("data-idx"));
J=Da(J);M===-1?q&&!J.hasClass("active")&&(J.siblings(".active").removeClass("active"),J.addClass("active")):g===M?(q||J.hasClass("active")||(J.siblings(".active").removeClass("active"),J.addClass("active")),J.hasClass("current")||(J.siblings(".current").removeClass("current"),J.addClass("current"))):J.hasClass("current")&&J.removeClass("current")})}}.bind(e);e.buildStreamSelector=function(){var g=this;if(g.multiStreams&&g.controlbar){var q=g.controlbar.querySelector(".zwp-qualityButton");if(q){var A=
"",M=g.multiStreams.murls;if(!Array.isArray(M)||M.length!==1){for(var J in M){var T=M[J];T=typeof T==="object"?T.name:J;A+='<li class="zwp-quality-item" data-stream="'+Qa(T)+'">'+Qa(K(T,T))+"</li>"}if(M=q.querySelector(".zwp-qualityMenu"))M.innerHTML=A,A=Da(M).find(".zwp-quality-item"),A.click(function(b){b.preventDefault();b.stopPropagation();b=this.getAttribute("data-stream");if(g.multiStreams.curStream!==b){var S=g.multiStreams.murls;if(Array.isArray(S))for(var H in S){var V=S[H];if(V.name===b){var P=
V.url;break}}else P=S[b];g.__switchStream(P);g.multiStreams.curStream=b;P=Da(this);P.hasClass("active")||(P.siblings(".active").removeClass("active"),P.addClass("active"));b=K(b,b);g.toast(K("switchedToQuality","Switched to")+" "+b+" "+K("quality","quality"))}}),A.each(function(b,S){b=this.getAttribute("data-stream");if(g.multiStreams.curStream===b&&(b=Da(this),!b.hasClass("active")))return b.siblings(".active").removeClass("active"),b.addClass("active"),!1});q.style.display="block"}}}}.bind(e);e.createSubtitlesMenu=
function(g,q){var A=this;A.controlbar&&(q=A.controlbar.querySelector(".zwp-subtitleMenu"),g=Ue(g,A.truncateFilename),q.innerHTML=g,delete q.bindSwitchEvent,ka(q,"zwp-autosize"),Da(q).find(".zwp-subtitles-item").click(function(M){M.preventDefault();M.stopPropagation();M=Da(this);M.hasClass("active")||(M.siblings().removeClass("active"),M.addClass("active"),M=this.getAttribute("data-id"),typeof A.switchSubtitleTrack==="function"&&A.switchSubtitleTrack(M))}),g=A.controlbar.querySelector(".zwp-subtitleButton"))&&
(g.style.display="block")}.bind(e);e.resetSubtitleMenu=function(){if(this.controlbar){var g=this.controlbar.querySelector(".zwp-subtitleButton");g&&(g.style.display="none")}}.bind(e);e.__getDanmuBarDock=function(){var g=this.progressBar.timeInfo.querySelector(".zwp_danmuBarDock");g||(g=document.createElement("DIV"),g.setAttribute("class","zwp_danmuBarDock"),this.progressBar.timeInfo.appendChild(g),Ta.addElement(g),g.addEventListener("resize",function(q){var A=this;A.resizeTimer||(A.resizeTimer=window.setTimeout(function(){g.clientWidth<
350?ka(g,"zwp-mini"):ja(g,"zwp-mini");delete A.resizeTimer},50))}.bind(this)));return g}.bind(e);e.buildDanmuToolbar=function(g,q){var A=this,M;if(!A.danmuToolbar){g&&(M=document.querySelector("#"+g));if(!M){if(!A.overlay_layers)return;q=null;M=A.progressBar&&A.progressBar.timeInfo?A.__getDanmuBarDock():A.overlay_layers}g=Lb();M.insertAdjacentHTML("beforeend",g);A.danmuToolbar=M.querySelector(".zwp_danmu-controlbar");q&&ka(A.danmuToolbar,q);M.appendChild(A.danmuToolbar);(q=A.danmuToolbar.querySelector(".zwp_switch"))&&
q.addEventListener("click",function(J){J.stopPropagation();J=J.currentTarget;if(ya(J,"zwp_switch")){rc(J);var T=ya(J,"switch_on");J=Da(this.danmuToolbar);if(T){var b=J.find("button.btn_submit");b.removeClass("vtb_disabled").removeAttr("disabled");this.setEnableDanmu(!0);T=J.find(".barrage_inp_text");T.removeAttr("readonly").removeAttr("disabled").removeClass("disabled");T.attr("keydown")!="on"&&(T.keydown(function(S){S.which==13&&b.length>0&&b.trigger("click")}),T.attr("keydown","on"));J.find(".zwp-barrage_form").css("background-color",
"#28303db3").children("a.btn_bubble").toggleClass("disabled")}else J.find("button.btn_submit").addClass("vtb_disabled").attr({disabled:"disabled"}),this.setEnableDanmu(!1),J.find(".barrage_inp_text").attr("readonly","readonly").attr("disabled","disabled").addClass("disabled"),J.find(".zwp-barrage_form").css("background-color","#202020b3").children("a.btn_bubble").toggleClass("disabled")}}.bind(A));(q=A.danmuToolbar.querySelector(".barrage_login"))&&q.addEventListener("click",function(J){J.preventDefault();
J.stopPropagation();alert("login")});(q=A.danmuToolbar.querySelector(".zwp_dmconfig"))&&q.addEventListener("click",function(J){J.preventDefault();J.stopPropagation();this.zwplayer=A;ef(J,this)});(q=A.danmuToolbar.querySelector(".btn_bubble"))&&q.addEventListener("click",function(J){J.preventDefault();J.stopPropagation();Se(this,J)});(q=A.danmuToolbar.querySelector(".btn_submit"))&&q.addEventListener("click",function(J){J.preventDefault();J.stopPropagation();ff(this,A)})}}.bind(e);e.reposDanmuToolbar=
function(g){if(this.danmuToolbar&&this.progressBar&&this.progressBar.timeInfo){var q=this.__getDanmuBarDock(),A=this.danmuToolbar.parentNode;A&&(g?A!==q&&(A.removeChild(this.danmuToolbar),q.appendChild(this.danmuToolbar),this.oldDanmuParentNode=A):this.oldDanmuParentNode&&(q.removeChild(this.danmuToolbar),this.oldDanmuParentNode.appendChild(this.danmuToolbar),delete this.oldDanmuParentNode))}}.bind(e);e.sendDanmu=function(g){if(typeof this._config.sendDanmu==="function")return g=JSON.stringify({type:"danmu",
text:g,border:this.danmuSetting.border?"1":void 0,color:this.danmuSetting.color?"#"+this.danmuSetting.color:void 0}),this._config.sendDanmu(g),!0;alert("No danmu send function is setup");return!1}.bind(e);ae(e,{zwp_version:"3.3.2",zwp_build:"20260821"});Yd(e,{detectMobile:pb});me(e,{debug_log:!1,isSupportMSE:Te,httpGet:gb});pe(e);typeof e._config.playerElm=="string"?(d=e._config.playerElm,d.charAt(0)!="#"&&(d="#"+d),e.playerElm=document.querySelector(d)):hd(e._config.playerElm)&&(e.playerElm=e._config.playerElm);
e.playerElm?ya(e.playerElm,"zwp-wrap")||(e.playerElmOldClass=e.playerElm.getAttribute("class"),ka(e.playerElm,"zwp-wrap"),e.doRemovePlayerClass=!0):(d="",typeof e._config.playerElm=="string"?(d=e._config.playerElm,d.charAt(0)=="#"&&(d=d.substr(1))):d="ZWP-"+(new Date).getTime(),e.playerElm=document.createElement("DIV"),e.playerElm.id=d,e.playerElm.style.position="absolute",e.playerElm.style.left=0,e.playerElm.style.top=0,e.playerElm.style.width="640px",e.playerElm.style.height="360px",document.body.appendChild(e.playerElm),
e.playerElm.setAttribute("class","zwp-wrap"),e.doDeletePlayerElm=!0);e.playerContainer=document.createElement("DIV");e.playerContainer.setAttribute("class","zwp-container");pb()&&(e.playerContainer.className+=" zwp-mobile");e.playerElm.appendChild(e.playerContainer);typeof e._config.videoElm=="string"?(d=e._config.videoElm,d.charAt(0)!="#"&&(d="#"+d),e.videoEl=document.querySelector(d)):hd(e._config.videoElm)&&(e.videoEl=e._config.videoElm);e.videoEl||(r=document.createElement("DIV"),r.setAttribute("class",
"zwp-videoWrapper"),e.playerContainer.appendChild(r),Ta.addElement(r),r.addEventListener("resize",function(g){this._config.video_rotated&&this.rotateVideo()}.bind(e)),e.videoWrapper=r,e.videoEl=document.createElement("VIDEO"),typeof e._config.videostyle=="string"&&e.videoEl.setAttribute("style",e._config.videostyle),typeof e._config.videoclass=="string"&&e.videoEl.setAttribute("class",e._config.videoclass),e._config.videostyle||e._config.videoclass||e.videoEl.setAttribute("style","width:100%;height:100%;"),
typeof e._config.videoElm=="string"&&(d=e._config.videoElm,d.charAt(0)=="#"&&(d=d.substr(1)),e.videoEl.id=d),e.videoEl.setAttribute("playsinline",""),e.videoEl.setAttribute("webkit-playsinline",""),e._config.autoplay&&e.videoEl.setAttribute("autoplay",""),r.appendChild(e.videoEl),e.videoRemoveWhenClose=!0);Wd(e);Ne(e,{parOptions:a,debug_log:!1});a=e._config.defVolume/100;e.lastVolume=a;e.videoEl.volume=a;e._config.poster&&e.videoEl.setAttribute("poster",e._config.poster);e._config.mode==="preview"&&
e.videoEl.setAttribute("preload","auto");if(!e._config.disableOverlayLayer){var h=document.createElement("div");h.setAttribute("class","zwp__layers");h.innerHTML='<div class="zwp__overlay zwp__layer zwp_loadingicon" style="width: 100%; height: 100%; display: none;"><div class="zwp__overlay-loading"><span class="zwp__overlay-loading-bg-img"><svg width="80px" height="80px" viewBox="0 0 38 38" xmlns="http://www.w3.org/2000/svg" stroke="#fff"><g fill="none" fill-rule="evenodd"><g transform="translate(1 1)" stroke-width="2"><circle stroke-opacity=".5" cx="18" cy="18" r="18"/><path d="M36 18c0-9.94-8.06-18-18-18"><animateTransform attributeName="transform" type="rotate" from="0 18 18" to="360 18 18" dur="1s" repeatCount="indefinite"/></path></g></g></svg></span></div></div><div class="zwp__overlay zwp__layer zwp__overlay-play" style="width: 100%; height: 100%; display: none;"><div class="zwp-local-playback-hint" style="display: none;" role="button" tabindex="0" aria-label="'+
(K("selectLocalVideo","Select Local Video File")+'" data-action="selectLocalFile"><div class="zwp-local-playback-text">'+Rb()+'</div><div class="zwp-local-playback-subtitle">'+K("supportedFormats","Supports MP4, WebM, MOV, MKV, M4V, OGG, FLAC, WAV, M4A, MP3, OPUS and other formats")+'</div></div><div class="zwp__overlay-button" role="button" tabindex="0" aria-label="play" aria-pressed="false" data-action="play"><svg class="icon" width="96px" height="96px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path fill="#c2c2c2" d="M512.61025 48.820024a463.790226 463.790226 0 1 0 463.790227 463.790226A463.790226 463.790226 0 0 0 512.61025 48.820024z m0 854.350417a390.560191 390.560191 0 1 1 390.560191-390.560191a390.560191 390.560191 0 0 1-390.560191 390.560191z m166.720382-414.970203l-120.341359-70.300834-127.908463-74.694636a22.945411 22.945411 0 0 0-32.465315 24.410011v288.526341a22.945411 22.945411 0 0 0 32.465315 24.410012l127.908463-74.694636 120.341359-70.056734a28.559714 28.559714 0 0 0 0-47.599524z" /></svg></div></div>');
e.playerContainer.appendChild(h);e.overlay_layers=h;e.bigPlayOverlay=h.querySelector(".zwp__overlay-play");e.bigPlayBtn=e.bigPlayOverlay.querySelector(".zwp__overlay-button");e.localPlaybackHint=e.bigPlayOverlay.querySelector(".zwp-local-playback-hint");e.loadingOverlay=h.querySelector(".zwp_loadingicon");(function(){var g=document.createElement("div");g.className="zwp-flash-icon";g.setAttribute("aria-hidden","true");h.appendChild(g);e.flashIcon=g;e._lastFlashPlaying=!1;e._initialPlayDone=!1;e._flashOnUserClick=
null;e.flashPlayState=function(q){if(!(e._config.vr||e.isVrActive&&e.isVrActive())){var A=e.flashIcon;A&&(A.innerHTML=q?'<svg viewBox="0 0 24 24" width="44" height="44" fill="#fff"><rect x="6" y="4" width="4" height="16" rx="1"/><rect x="14" y="4" width="4" height="16" rx="1"/></svg>':'<svg viewBox="0 0 24 24" width="44" height="44" fill="#fff"><path d="M8 5v14l11-7z"/></svg>',A.classList.remove("zwp-flash-show"),A.getBoundingClientRect(),A.classList.add("zwp-flash-show"))}}})();e.updateLocalPlaybackHint=
function(g){if(e.localPlaybackHint){var q=e.overlay_layers&&e.overlay_layers.classList.contains("zwp-vr-suppressed")||!(!e.isVrActive||!e.isVrActive()),A=e._config.url||e.murl;q=e._config.hideBigPlayButton||q?"none":"flex";g?(e.localPlaybackHint.style.setProperty("display","none","important"),e.bigPlayBtn&&e.bigPlayBtn.style.setProperty("display",q,"important"),e.bigPlayOverlay&&e.bigPlayOverlay.style.setProperty("display",q,"important")):e._config.localPlayback&&!A?(e.localPlaybackHint.style.setProperty("display",
"flex","important"),e.bigPlayBtn&&e.bigPlayBtn.style.setProperty("display","none","important"),e.bigPlayOverlay&&e.bigPlayOverlay.style.setProperty("display","flex","important")):A&&(e.localPlaybackHint.style.setProperty("display","none","important"),e.bigPlayBtn&&e.bigPlayBtn.style.setProperty("display",q,"important"),e.bigPlayOverlay&&e.bigPlayOverlay.style.setProperty("display",q,"important"))}};e._config.disablePlayBtn?ka(e.bigPlayBtn,"zwp_disabled"):(e.bigPlayBtn.addEventListener("click",function(g){g.preventDefault();
g.stopPropagation();this.on_btnclick(g)}.bind(e)),e.btnBindZwp=!0);e.bigPlayOverlay&&(a=e._config.vr?"none":"flex",e.bigPlayOverlay.style.setProperty("display",a,"important"),e.bigPlayBtn&&e.bigPlayBtn.style.setProperty("display",a,"important"));e.localPlaybackHint&&e.localPlaybackHint.addEventListener("click",function(g){g.preventDefault();g.stopPropagation();this.on_btnclick(g)}.bind(e));e.updateLocalPlaybackHint();e._bumperReady&&e._bumperReady();e._config.enableDanmu&&(e.danmuPlayer=bd.create({playerId:h}));
e.playerContainer.addEventListener("contextmenu",function(g){if(!g.target||g.target.tagName!=="INPUT"&&g.target.tagName!=="TEXTAREA")g.preventDefault(),g.stopPropagation(),e.isMobile()||e.showContextMenu(g)});h.addEventListener("click",function(g){var q=this,A=function(M){M=M.querySelector(".closeBtn");var J=document.createEvent("Event");J.initEvent("click",!0,!0);M.dispatchEvent(J)};q.infoViewer?A(q.infoViewer):q.colorSettingPanel?A(q.colorSettingPanel):q.recordingSettingsPanel?A(q.recordingSettingsPanel):
q.volumeBoostPanel?A(q.volumeBoostPanel):q.shortcutHelpPanel?A(q.shortcutHelpPanel):q.contextMenu?q.hideContextMenu():q._config.disableClickPause||q._config.disablePlayBtn||q._config.isLive||(q.overlayLayerClickTimer&&(window.clearTimeout(q.overlayLayerClickTimer),delete q.overlayLayerClickTimer),q.playbtn&&(q.isControlbarhidden&&typeof G==="function"&&G(g),q.overlayLayerClickTimer=window.setTimeout(function(){q._flashOnUserClick=q.videoEl&&!q.videoEl.paused&&q.isPlaying?"pause":"play";q.playbtn.click();
delete q.overlayLayerClickTimer},300)))}.bind(e))}if(e._config.nativecontrols)e.videoEl.setAttribute("controls","controls"),e.overlay_layers&&(e.overlay_layers.style.bottom="70px"),e.videoEl.addEventListener("fullscreenchange",function(g){return!1}.bind(e));else if(e._config.controlbar){a=document.createElement("div");a.setAttribute("class","zwp-controlbar");a.innerHTML=kd(e._config);e.playerContainer.appendChild(a);e.controlbar=a;e._applyControlbarMode();e.controlbar.addEventListener("click",function(g){e._controlbarShownAt&&
Date.now()-e._controlbarShownAt<250&&(g.stopPropagation(),g.preventDefault(),e._controlbarShownAt=0)},!0);e.updateRecordingMenuVisibility&&e.updateRecordingMenuVisibility();e.isMobile()&&e.removeVolumeBoostButton();cc(e);var k=e.controlbar.querySelector(".zwp__currenttime-container");if(k){var l=function(g){g.stopPropagation();e._timeCompactMode&&!e._config.isLive&&(e._showRemaining=!e._showRemaining,k.setAttribute("aria-label",e._showRemaining?K("remainingTime","\u5269\u4f59\u65f6\u95f4"):K("currentTime",
"\u5f53\u524d\u65f6\u95f4")),e._renderTimeSpan())};k.addEventListener("click",l);k.addEventListener("keydown",function(g){if(g.key==="Enter"||g.key===" "||g.key==="Spacebar")g.preventDefault(),l(g)})}e.longPressState={isPressed:!1,isFastPlaying:!1,originalPlaybackRate:1,pressTimer:null,startX:0,startY:0,enabled:e._config.longPress2xSpeed!==!1};e.playbtn=a.querySelector(".zwp-playbtn");if(e.controlbar){let g=function(q){q.querySelectorAll(".zwp_switch").forEach(function(A){var M=A.getAttribute("data-action");
M==="vrActive"?e.isVrActive&&e.isVrActive()?ka(A,"switch_on"):ja(A,"switch_on"):M==="vrGyro"?e._vrInput&&e._vrInput.isGyroEnabled()?ka(A,"switch_on"):ja(A,"switch_on"):M==="vrStereo"&&(e.isVrStereo&&e.isVrStereo()?ka(A,"switch_on"):ja(A,"switch_on"))})};a.addEventListener("dblclick",function(q){q.stopPropagation()});d=a.querySelectorAll("button.zwpbtn");d.length>0&&(e.btnBindZwp=!0,d.forEach(function(q){q.addEventListener("click",e.on_btnclick)}));d=a.querySelectorAll(".zwp-recording-option");d.length>
0&&d.forEach(function(q){q.addEventListener("click",e.on_btnclick)});e._config.disablePlayBtn&&(d=a.querySelector(".zwp_playbtn"),ka(d,"zwp_disabled"),d.setAttribute("disabled","disabled"));e.setupThemeCompatibility=function(){var q=this;q.playerContainer.querySelectorAll("button, .zwp-button, .zwpbtn").forEach(function(J){J.classList.contains("nowave")||J.classList.add("nowave");J.classList.contains("zwp-theme-compat")||J.classList.add("zwp-theme-compat")});var A=function(){q.playerContainer&&q.playerContainer.querySelectorAll("button.zwpbtn").forEach(function(J){J.hasAttribute("disabled")&&
!q._config.disablePlayBtn&&J.removeAttribute("disabled");J.style.pointerEvents==="none"&&(J.style.pointerEvents="auto");J.style.cursor==="not-allowed"&&(J.style.cursor="pointer")})};A();try{var M=new MutationObserver(function(J){A()});M.observe(q.playerContainer,{subtree:!0,attributes:!0,attributeFilter:["disabled","style"]});q._themeCompatObserver=M}catch(J){q._themeCompatInterval=setInterval(A,1E3)}q._cleanupThemeCompatibility=function(){if(q._themeCompatObserver){try{q._themeCompatObserver.disconnect()}catch(J){}delete q._themeCompatObserver}q._themeCompatInterval&&
(clearInterval(q._themeCompatInterval),delete q._themeCompatInterval)}};e._config.themeCompatibility!==!1&&e.setupThemeCompatibility();d=a.querySelectorAll(".zwp-speedMenu>li.zwp-speed-item");d.length>0&&d.forEach(function(q){q.addEventListener("click",e.on_speedItemclick)});e.updateSpeedMenuMaxHeight=function(){var q=e.controlbar?e.controlbar.querySelector(".zwp-speedMenu"):null;q&&e.playerContainer&&(q.style.maxHeight=e.playerContainer.offsetHeight-50+"px")};d=function(q){if(e.controlbar){var A=
e.controlbar.querySelectorAll(".is-active");if(A.length!==0){for(var M=!1,J=0;J<A.length;J++)if(A[J].contains(q.target)){M=!0;break}M||e.closeAllMenus()}}};e._closeMenusHandlerBound||(e._closeMenusHandler=d,document.addEventListener("click",d),e._closeMenusHandlerBound=!0);var p=a.querySelector(".zwp-speedButton");p&&(p.addEventListener("mouseenter",function(){e.updateSpeedMenuMaxHeight()}),p.addEventListener("click",function(q){q.stopPropagation();e.updateSpeedMenuMaxHeight();ya(p,"is-active")?ja(p,
"is-active"):(e.closeAllMenus(),ka(p,"is-active"))}),e.updateSpeedMenuMaxHeight());var w=a.querySelector(".zwp-optionButton");w&&(w.addEventListener("mouseenter",function(q){e.closeAllMenus();e._lastClosedParentMenu&&(e._lastClosedParentMenu.style.display="",delete e._lastClosedParentMenu)}),w.addEventListener("click",function(q){q.stopPropagation();ya(w,"is-active")?ja(w,"is-active"):(e.closeAllMenus(),e._lastClosedParentMenu&&(e._lastClosedParentMenu.style.display="",delete e._lastClosedParentMenu),
ka(w,"is-active"))}));var v=a.querySelector(".zwp-subtitleButton");v&&(v.addEventListener("mouseenter",function(q){e.closeAllMenus();e._lastClosedParentMenu&&(e._lastClosedParentMenu.style.display="",delete e._lastClosedParentMenu)}),v.addEventListener("click",function(q){q.stopPropagation();if(ya(v,"is-active"))ja(v,"is-active"),(q=v.querySelector(".zwp-subtitleComposite"))&&q.style.removeProperty("right");else if(e.closeAllMenus(),e._lastClosedParentMenu&&(e._lastClosedParentMenu.style.display=
"",delete e._lastClosedParentMenu),ka(v,"is-active"),e.isMobile&&e.isMobile()){q=v.querySelector(".zwp-subtitleComposite");var A=e.controlbar;q&&A&&(A=A.clientWidth-(v.offsetLeft+v.offsetWidth),q.style.setProperty("right",(A>0?-A:0)+"px","important"))}}));var E=a.querySelector(".zwp-vrButton");E&&(E.addEventListener("mouseenter",function(q){e.controlbar&&e.controlbar.querySelectorAll(".is-active").forEach(function(A){A!==E&&ja(A,"is-active")});g(E)}),E.addEventListener("click",function(q){q.stopPropagation();
ya(E,"is-active")?ja(E,"is-active"):(e.closeAllMenus(),ka(E,"is-active"),g(E))}));var D=a.querySelector(".zwp-qualityButton");D&&(D.addEventListener("mouseenter",function(q){e.closeAllMenus()}),D.addEventListener("click",function(q){q.stopPropagation();ya(D,"is-active")?ja(D,"is-active"):(e.closeAllMenus(),ka(D,"is-active"))}));var B=a.querySelector(".zwp-recordButton");B&&(B.addEventListener("mouseenter",function(q){e.closeAllMenus()}),B.addEventListener("click",function(q){q.stopPropagation();q.target===
B&&ya(B,"is-active")&&ja(B,"is-active")}));e.playerContainer&&(Ta.addElement(e.playerContainer),e.playerContainer.addEventListener("resize",function(q){this.updateSpeedMenuMaxHeight&&this.updateSpeedMenuMaxHeight()}.bind(e)));e._volumeDockDeps={debug_log:!1,offset:$c,getMouseIsDown:function(){return y},setMouseIsDown:function(q){y=q},getMouseIsOver:function(){return x},setMouseIsOver:function(q){x=q}};Ec(e,e._volumeDockDeps);if(d=a.querySelector(".zwp-optionPanel"))d=d.querySelectorAll(".action-item"),
d.length>0&&d.forEach(function(q){q.addEventListener("click",e.on_optionItemclick)});if(a=a.querySelector(".zwp-vrMenu"))a=a.querySelectorAll(".action-item"),a.length>0&&a.forEach(function(q){q.addEventListener("click",e.on_optionItemclick)})}}e._config.autoSmallWindow&&!e.windowScrollHandler&&(e.windowScrollHandler=function(g){var q=this;q._scrollRaf||(q._scrollRaf=requestAnimationFrame(function(){q._scrollRaf=null;q._evalSmallWindow()}))}.bind(e),e._exitSmallWindow=function(){var g=this.playerContainer;
ja(g,"zwp-smallwindow");ja(document.body,"zwp-smallwindow");g.style.left=null;g.style.top=null;g.style.width=null;g.style.height=null;g.style.right=null}.bind(e),e._evalSmallWindow=function(){if(!this.isFullscr&&!this.isFullscrWin&&this.videoEl&&this.playerElm&&this.isPlaying&&!this.isInPicInPic)if(this.playerElm.getBoundingClientRect().bottom<=100){if(!this.smallWindowMode){var g=this.playerContainer;Xd(g,function(){e._exitSmallWindow()});ka(g,"zwp-smallwindow");ka(document.body,"zwp-smallwindow");
var q=window.innerWidth;q<496&&(g.style.width=q-20+"px",g.style.right="10px");this.smallWindowMode=!0}}else this.smallWindowMode&&(this._exitSmallWindow(),delete this.smallWindowMode)}.bind(e),document.addEventListener("scroll",e.windowScrollHandler,!0));e.videoEl&&(e._config.muted?e.setMuted(!0):!e._config.autoplay||e.isMobile&&e.isMobile()||pb()||(typeof window.zwpAllowAutoAudioPlay==="undefined"?(e.setMuted(!0),Jd(function(g){g?e.setMuted(!1):e._config.disableMutedConfirm||e.mutedConfirmBox();
window.zwpAllowAutoAudioPlay=g})):window.zwpAllowAutoAudioPlay||(e.setMuted(!0),e._config.disableMutedConfirm||e.mutedConfirmBox())),e.videoEl.setAttribute("crossorigin","anonymous"),e.isMobile()||e.audioContext||!e._config.autoplay||e.initAudioContext());e.handleLongPressStart=function(g){var q=this;!("ontouchstart"in document.documentElement||/iphone|ipad|ipod|android/i.test(navigator.userAgent))||!q.longPressState.enabled||q.playerContainer&&q.playerContainer.classList.contains("zwp-smallwindow")||
g.touches&&g.touches.length>1||g.target.closest(".zwp-controlbar")||(g=g.touches[0],q.longPressState.startX=g.clientX,q.longPressState.startY=g.clientY,q.longPressState.isPressed=!0,q.videoEl&&(q.longPressState.originalPlaybackRate=q.videoEl.playbackRate||1),q.longPressState.pressTimer=setTimeout(function(){q.longPressState.isPressed&&!q.longPressState.isFastPlaying&&q.activateLongPressSpeed()},300))};e.handleLongPressEnd=function(g){this.longPressState.pressTimer&&(clearTimeout(this.longPressState.pressTimer),
this.longPressState.pressTimer=null);this.longPressState.isFastPlaying&&this.deactivateLongPressSpeed();this.longPressState.isPressed=!1;this.longPressState.startX=0;this.longPressState.startY=0};e.handleLongPressMove=function(g){if(this.longPressState.isPressed){var q=g.touches[0],A=Math.abs(q.clientY-this.longPressState.startY);(Math.abs(q.clientX-this.longPressState.startX)>10||A>10)&&this.handleLongPressEnd(g)}};e.activateLongPressSpeed=function(){if(this.videoEl&&!this.videoEl.ended){this.videoEl.paused&&
this.videoEl.play().catch(function(q){});this.videoEl.playbackRate=2;this.longPressState.isFastPlaying=!0;var g=this.controlbar?this.controlbar.querySelector(".zwp-speedBtn"):null;g&&(g.innerHTML="2.0x")}};e.deactivateLongPressSpeed=function(){if(this.videoEl){this.videoEl.playbackRate=this.longPressState.originalPlaybackRate;this.longPressState.isFastPlaying=!1;var g=this.controlbar?this.controlbar.querySelector(".zwp-speedBtn"):null;if(g){var q=this.longPressState.originalPlaybackRate;g.innerHTML=
q==1?"1x":q.toFixed(1)+"x"}}};var G=function(g){var q=this;q.controlbar&&(q.isControlbarhidden?(q.controlbar.style.display="flex",ja(q.playerElm,"hide-cursor"),Yc(q.controlbar,500,function(A){A&&q.startHideControlbar(q)}),q.isControlbarhidden=!1,q._controlbarShownAt=Date.now()):q.startHideControlbar(q))}.bind(e);e._playerElmHandlers=e._playerElmHandlers||[];a=function(g,q,A){e.playerElm.addEventListener(g,q,A);e._playerElmHandlers.push([g,q,A])};a("mousemove",G);a("touchmove",G,{passive:!0});a("mouseenter",
function(){window.__zwpKeyboardPlayer=e});a("touchstart",function(){window.__zwpKeyboardPlayer=e},{passive:!0});a("touchstart",function(g){e.handleLongPressStart(g)},{passive:!1});a("touchend",function(g){e.handleLongPressEnd(g)});a("touchcancel",function(g){e.handleLongPressEnd(g)});a("touchmove",function(g){e.handleLongPressMove(g)},{passive:!0});a("dblclick",function(g){this.overlayLayerClickTimer&&(window.clearTimeout(this.overlayLayerClickTimer),delete this.overlayLayerClickTimer);if(this.controlbar&&
(g={},g.currentTarget=this.controlbar.querySelector(".zwp-fullscrBtn"),g.currentTarget))this.on_btnclick(g)}.bind(e));e.getFileExtension=function(g){var q=g.lastIndexOf(".");return q!==-1?g.substring(q).toLowerCase():""};e.isPlaylistUrl=function(g){if(!g||typeof g!=="string")return!1;g=g.split("?")[0].split("#")[0];g=e.getFileExtension(g);return g===".json"||g===".xml"};e.detectAndLoadPlaylist=function(g,q){var A=this;return new Promise(function(M,J){var T=new XMLHttpRequest;T.open("GET",g,!0);T.timeout=
15E3;T.ontimeout=function(){J(Error("Request timeout"))};T.onreadystatechange=function(){if(T.readyState===4)if(T.status>=200&&T.status<400){var b=T.responseText,S=null,H=g.split("?")[0].split("#")[0];H=A.getFileExtension(H);if(H===".json")try{S=JSON.parse(b)}catch(V){J(Error("JSON parse error"));return}else if(H===".xml")try{S=A.parsePlaylistXML(b)}catch(V){J(Error("XML parse error"));return}else try{S=JSON.parse(b)}catch(V){try{S=A.parsePlaylistXML(b)}catch(P){J(Error("Parse error"));return}}A.isValidPlaylistData(S)?
(A._applyPlaylistData(S,g,q!==!1),M(S)):J(Error("Not a playlist format"))}else J(Error("HTTP error: "+T.status))};T.onerror=function(){J(Error("Network error"))};T.send()})};a=function(g,q){if(!e.isPlaylistUrl(g))return!1;e.detectAndLoadPlaylist(g,q).then(function(A){}).catch(function(A){e.play(g,e._config.isLive)});return!0};var N=null,I=!1,C=function(g){return typeof g==="object"&&!Array.isArray(g)&&g&&g.zwp_protocol&&typeof g.zwp_protocol==="string"&&g.zwp_protocol.startsWith("ZWMAP/")&&g.zwp_type===
"playlist"&&g.groups&&Array.isArray(g.groups)?!0:!1};d=function(g,q){if(!C(g))return!1;N=g;I=q!==!1;return!0};e._config.url&&e._config.autoplay&&!d(e._config.url,!0)&&(a(e._config.url,!0)||Kd(e,{debug_log:!1,detectMobile:pb})||e.play(e._config.url));e._config.url&&!e._config.autoplay&&(C(e._config.url)?(N=e._config.url,I=!1):e.isPlaylistUrl(e._config.url)?e.detectAndLoadPlaylist(e._config.url,!1).then(function(g){}).catch(function(g){}):e.videoEl&&!e.videoEl.src&&typeof e._config.url==="string"&&
(a=xc(e._config.url,{detectedFileExt:e._detectedFileExt,streamtype:e._config.streamtype}),a===".mp4"||a===".webm"||a===".mov"||a===".m4v"||a===".ogv"||a===".mp3"||a===".m4a"||a===".aac"||a===".mp4a"||a===".ogg")&&(d=e._config.url,e._config.poster||d.indexOf("#")!==-1||a!==".mp4"&&a!==".webm"&&a!==".mov"&&a!==".m4v"&&a!==".ogv"||(d+="#t=0.001"),e.videoEl.src=d,e.murl=e._config.url));typeof e._config.onready=="function"&&e._config.onready.call(e);e._config.chapters&&(e.chapters=e._config.chapters);
if(e._config.subtitles&&typeof e.addSubtitle==="function")for(a=Array.isArray(e._config.subtitles)?e._config.subtitles:[e._config.subtitles],d=0;d<a.length;d++)(r=a[d])&&typeof r==="object"&&r.url?e.addSubtitle(r.url,r.pos||(d+1).toString(),r.title):typeof r==="string"&&e.addSubtitle(r,(d+1).toString());if(e._config.audioTracks&&typeof e._addAudioTrackInternal==="function"){a=Array.isArray(e._config.audioTracks)?e._config.audioTracks:[e._config.audioTracks];for(d=0;d<a.length;d++)(r=a[d])&&typeof r===
"object"&&r.url?e._addAudioTrackInternal(r.url,r.language,r.label,r.default,r.isAI):typeof r==="string"&&e._addAudioTrackInternal(r);e._defaultAudioId&&e._defaultAudioId!==0&&e.setAudioTrack(e._defaultAudioId);typeof e.updateAudioMenuUI==="function"&&e.updateAudioMenuUI()}e._config.watermarks&&(e._watermarkData=e._config.watermarks,e.loadWatermarks());e._config.lostFocusPause&&typeof document.visibilityState!=="undefined"&&(e._visibilityChangeHandler=function(){e._config.isLive||e.isInPicInPic||(document.visibilityState===
"visible"?e.focusPaused&&e.videoEl.paused&&!e.videoEl.ended&&(e._startPlayback(!0),delete e.focusPaused):e.focusPaused||e.videoEl.paused||e.videoEl.ended||(e._pausePlayback(),e.focusPaused=!0))},document.addEventListener("visibilitychange",e._visibilityChangeHandler));e._config.fluid?(zb(e),e.isMobile&&e.isMobile()||(ka(e.playerElm,"zwp-fluid"),e.playerElm.style.maxWidth="100%",e.playerElm.style.width="100%",e.playerElm.style.height="0",a=qb(e._config),e.playerElm.style.paddingTop=a+"%"),e.isMobile&&
e.isMobile()&&window.matchMedia&&(a=function(){var g=null;return function(){g&&clearTimeout(g);g=setTimeout(function(){zb(e);g=null},200)}}(),d=window.matchMedia("(orientation: landscape)"),d.addEventListener&&(d.addEventListener("change",a),e._orientationQuery=d,e._orientationHandler=a),window.addEventListener("resize",a),e._resizeHandler=a)):e._config.width&&e._config.height&&(e.playerElm.style.width=typeof e._config.width==="number"?e._config.width+"px":e._config.width,e.playerElm.style.height=
typeof e._config.height==="number"?e._config.height+"px":e._config.height);Md(e,{debug_log:!1,resolveThumbnailUrl:nc});e.initKeyboardEvents();e.videoEl&&e.setupEventsHandler();ye(e,{debug_log:!1});N&&(e._applyPlaylistData(N,null,I),N=null);return e};Mb.prototype={on:function(a,t){this.videoEl&&a&&typeof t==="function"&&this.videoEl.addEventListener(a,t);return this},off:function(a,t){this.videoEl&&a&&typeof t==="function"&&this.videoEl.removeEventListener(a,t);return this},play:function(a,t,z){return a&&
(this._playingPlaylistItem?this._playingPlaylistItem=!1:!this.playlistState||!this.playlistState.data||typeof this._clearPlaylistState!=="function"||this._mode==="music"&&this._queueCtrl||this._clearPlaylistState(),this.murl&&this.stop(),typeof a==="object"&&a instanceof File)?(this._resolveFileAndPlay(a,t,z),!0):this._playSource(a,t,z)},_resolveFileAndPlay:function(a,t,z){var y=this;y.detectMimeType(a).then(function(x){return y.isValidVideoFile(a,x).then(function(e){if(!e)return y.toast(K("unsupportedFormat",
"Unsupported format")+": "+x,3E3,!0),y.stop(),!1;e=URL.createObjectURL(a);y._currentFile=a;y._currentBlobUrl=e;y._detectedFileExt=y._fileExtFromMime(a,x);y._detectedMimeType=x;return y._playSource(e,t,z)})}).catch(function(x){y._detectedFileExt="."+a.name.split(".").pop().toLowerCase();x=URL.createObjectURL(a);y._currentFile=a;y._currentBlobUrl=x;y._playSource(x,t,z)})},_fileExtFromMime:function(a,t){return(a=this.getFileExtension(a.name))&&a!=="."?a:t?t.includes("mp4")?".mp4":t.includes("webm")?
".webm":t.includes("ogg")?".ogv":t.includes("avi")?".avi":t.includes("mov")?".mov":t.includes("flv")?".flv":t.includes("m3u8")?".m3u8":t.includes("mpd")?".mpd":t.includes("mp2t")||t.includes("ts")?".ts":t.includes("matroska")||t.includes("webm")?".mkv":"":""},_playSource:function(a,t,z){var y=this;if(a){if(typeof a==="string"&&(a.startsWith("wcdn://")||a.startsWith("wcdns://")))return a=y.playWCDN(a);if(typeof a==="object"){if(typeof a.thumbnails==="object"||typeof a.thumbnail==="object"){var x=JSON.parse(JSON.stringify(a.thumbnails||
a.thumbnail));x&&!Array.isArray(x)&&x.thumbnail&&typeof x.thumbnail==="object"&&(!x.zwp_protocol||x.zwp_protocol&&x.zwp_protocol.indexOf("ZWMAP/")===0&&x.zwp_type==="thumbnail")&&(x=x.thumbnail);y._config.thumbnails=x;nc(y)}else if(typeof a.thumbnails==="string"||typeof a.thumbnail==="string")y._config.thumbnails=a.thumbnails||a.thumbnail;if(typeof a.chapters!=="undefined"||typeof a.chapter!=="undefined")y.chapters=a.chapters||a.chapter,y._config.chapterButton=!0;typeof a.annotations==="undefined"&&
typeof a.annotation==="undefined"||y.loadAnnotations(a.annotations||a.annotation);if(a.subtitles){x=Array.isArray(a.subtitles)?a.subtitles:[a.subtitles];for(var e=0;e<x.length;e++){var d=x[e];typeof d==="object"&&d.url?y.addSubtitle(d.url,d.pos||(e+1).toString(),d.title):y.addSubtitle(d,(e+1).toString())}}if(a.audioTracks){x=Array.isArray(a.audioTracks)?a.audioTracks:[a.audioTracks];for(e=0;e<x.length;e++)(d=x[e])&&typeof d==="object"&&d.url?y._addAudioTrackInternal(d.url,d.language,d.label,d.default,
d.isAI):typeof d==="string"&&y._addAudioTrackInternal(d);y._defaultAudioId&&y._defaultAudioId!==0&&y.setAudioTrack(y._defaultAudioId);typeof y.updateAudioMenuUI==="function"&&y.updateAudioMenuUI()}typeof a.murls==="object"?(y.multiStreams=JSON.parse(JSON.stringify(a)),x=a.murls):(Array.isArray(a)?(y.multiStreams={},x=a):(y.multiStreams={},x=[a]),y.multiStreams.murls=x);var r=!0,n="";e=[];for(var m in x)if(d=x[m],typeof d==="object")if(Array.isArray(d)){var u="";var f=d[0];if(d.length>2){var c=d[2];
u=d[1]}else c=d.length>1?d[1]:m;e.push({url:f,name:c,mime:u});r&&(a=f,n=c,r=!1)}else{if(f=!1,"default"in d&&d["default"]&&(f=d["default"]),r||f)"url"in d&&(a=d.url),n=r="name"in d?d.name:m,r=!1}else typeof d==="string"&&r&&(r=m,a=d,n=r,r=!1);e.length>0&&(y.multiStreams.murls=e);y.multiStreams.curStream=n}y.murl=a;delete y._corsRetryDone}if(!y.murl)return!1;y.force_stopped=!1;y.isPlaying=!0;typeof t!="undefined"&&(t?y._config.isLive=t:delete y._config.isLive);typeof z!="undefined"&&(z?y._config.useOldFlv=
z:delete y._config.useOldFlv);y._applyControlbarMode();a=!1;typeof y.murl=="object"?a=y.playObject():typeof y.murl=="string"&&(a=y._dispatchPlay());a?(y.setupEventsHandler(),y.startHideControlbar(y),y.multiStreams&&(y._deferredTimers=y._deferredTimers||[],y._deferredTimers.push(window.setTimeout(function(){y.buildStreamSelector()},1E3))),y._showLoading(),y.bigPlayOverlay&&(y.bigPlayOverlay.style.display="none")):(y.isPlaying=!1,y._hideLoading(),y.bigPlayOverlay&&(y.bigPlayOverlay.style.display="flex"),
y._hlsCodecSilentFail?delete y._hlsCodecSilentFail:y.toast(K("unsupportedFormat","Unsupported format"),5E3,!0));return a},_dispatchPlay:function(){if(typeof this.murl!=="string")return!1;if(this.murl.indexOf("rtsp")===0)return this.playRtsp();var a=xc(this.murl,{detectedFileExt:this._detectedFileExt,streamtype:this._config.streamtype});return a===".rtc"||this.murl.startsWith("webrtc://")||this.murl.startsWith("brtc://")||this.murl.startsWith("trtc://")||this.murl.startsWith("artc://")?this.playRtc():
a===".flv"?this._config.useOldFlv?this.playFlv():this.playMpegts():a===".m3u8"?this.playHls():a===".mpd"?this.playDash():a===".mp4"?this.playVideo():a===".mp3"||a===".m4a"||a===".aac"||a===".mp4a"||a===".ogg"?this.playAudio():a===".ts"?this.playMpegts():this.playVideo()},__switchStream:function(a){typeof a!=="string"?this.toast(K("unsupportedOperation","Unsupported operation: ")+"switch stream"):(this.murl=a,!this._config.isLive&&this.videoEl&&(this.postSeekTime=this.videoEl.currentTime),this._cleanupStreamAdapters(),
this._resetVideoSource(),this._dispatchPlay()||(this._hlsCodecSilentFail?delete this._hlsCodecSilentFail:this.toast(K("unsupportedFormat","Unsupported format"))))},stop:function(){this.closeAllActivePanels&&this.closeAllActivePanels();this.closeAllMenus&&this.closeAllMenus();this._cleanupStreamAdapters(!0);this._cleanupTimers();this._resetVideoSource();if(this._currentBlobUrl){try{URL.revokeObjectURL(this._currentBlobUrl)}catch(a){}this._detectedFileExt=this._currentFile=this._currentBlobUrl=null}this.isPlaying=
!1;this.setplaystate(!1);this.updateProgress(0);this.timeSpan&&(this.timeSpan.innerHTML="");this.controlbar&&(this.controlbar.querySelector(".zwp__duration-container").style.display="none");this.progressBar&&this.progressBar.streamtype&&(this.progressBar.streamtype.style.display="none");this.progressBar&&this.progressBar.chapters&&(this.progressBar.chapters.innerHTML="");this.clearAllSubtitles&&this.clearAllSubtitles();this.unloadAnnotations&&this.unloadAnnotations();this.mutedTipBox&&(this.popup_layers.removeChild(this.mutedTipBox),
this.popup_layers.style.display=null,delete this.mutedTipBox);this._mutedConfirmDeferTimer&&(clearTimeout(this._mutedConfirmDeferTimer),delete this._mutedConfirmDeferTimer);this._unmuteTimer&&(clearTimeout(this._unmuteTimer),delete this._unmuteTimer);this._unmuteLayer&&(this._unmuteLayer.parentNode&&this._unmuteLayer.parentNode.removeChild(this._unmuteLayer),delete this._unmuteLayer);delete this.multiStreams;this.resetSpeedMenu();this.resetQualitiesMenu();this.removeChapters();this.clearAudioTracks&&
this.clearAudioTracks();this.videoEl&&this.videoEl.removeAttribute("poster");this._config&&delete this._config.poster},pause:function(){this.isPlaying&&(this._userPaused=!0,this.videoEl&&(this.videoEl.paused||this.videoEl.ended||this._pausePlayback()))},resume:function(){this.isPlaying?this.videoEl&&(this.videoEl.paused||this.videoEl.ended)&&this._startPlayback():this.videoEl&&this.videoEl.src&&this.murl===this._config.url?(this.force_stopped=!1,this.isPlaying=!0,this.isMobile()||this.initAudioContext(),
this._startPlayback()):this._config.url&&this.play(this._config.url)},seekTime:function(a){if(this.isPlaying&&this.videoEl&&!(a<0)){var t=this.videoEl.duration;isNaN(t)||t===Infinity||(a>t&&(a=t),this.videoEl.currentTime=a)}},getDuration:function(){if(this.isPlaying&&this.videoEl)return this.videoEl.duration},destroy:function(){if(this.isFullscrWin&&typeof this.setFullscreenWin==="function")try{this.setFullscreenWin(!1,null)}catch(y){}if(this._playerElmHandlers&&this._playerElmHandlers.length){for(var a=
0;a<this._playerElmHandlers.length;a++){var t=this._playerElmHandlers[a];this.playerElm&&this.playerElm.removeEventListener&&this.playerElm.removeEventListener(t[0],t[1],t[2])}this._playerElmHandlers=[]}window.__zwpKeyboardPlayer===this&&(window.__zwpKeyboardPlayer=null);this._runFeatureDestroys(1);this._ttsBlobUrls&&this._ttsBlobUrls.length&&(this._ttsBlobUrls.forEach(function(y){URL.revokeObjectURL(y)}),this._ttsBlobUrls=[]);this._runFeatureDestroys(2);this._watchdogTimer&&(clearTimeout(this._watchdogTimer),
this._watchdogTimer=null);this.videoEl&&this.videoEl.remote&&(this._onCastConnectRef&&this.videoEl.remote.removeEventListener("connect",this._onCastConnectRef),this._onCastDisconnectRef&&this.videoEl.remote.removeEventListener("disconnect",this._onCastDisconnectRef));this.videoEl&&this._onAirPlayChanged&&this.videoEl.removeEventListener("webkitcurrentplaybacktargetiswirelesschanged",this._onAirPlayChanged);this.videoEl&&this._castTimeupdateRef&&(this.videoEl.removeEventListener("timeupdate",this._castTimeupdateRef),
this._castTimeupdateRef=null);this.playerContainer&&(a=this.playerContainer.querySelector(".zwp-casting-overlay"))&&a.parentNode&&a.parentNode.removeChild(a);this.castState="disconnected";this._castPreviousPlayState=!1;this.responsiveControlbarObserver&&(this.responsiveControlbarObserver.disconnect(),delete this.responsiveControlbarObserver);this.cleanupLocalFiles&&this.cleanupLocalFiles();this._cleanupStreamAdapters(!0);this._cleanupTimers();this.videoRemoveWhenClose&&(this.videoEl&&this.videoWrapper&&
(this.videoWrapper.removeChild(this.videoEl),this.playerContainer.removeChild(this.videoWrapper),delete this.videoWrapper),delete this.videoRemoveWhenClose);this.audioContext&&(this.audioContext.state!=="closed"&&this.audioContext.close(),this.audioContext=null,delete this.audioContext);this.audioGainNode&&(this.audioGainNode=null,delete this.audioGainNode);this.audioVolumeNode&&(this.audioVolumeNode=null,delete this.audioVolumeNode);this.audioSource&&(this.audioSource=null,delete this.audioSource);
this.videoEl&&(this.videoEl.removeAttribute("src"),this.videoEl.load(),this.videoEl=null,delete this.videoEl);this.snapCanvas&&delete this.snapCanvas;this.controlbar&&(this.progressBar&&this.progressBar.chapters&&(this.progressBar.chapters.innerHTML=""),this.playerContainer.removeChild(this.controlbar),delete this.controlbar);this.danmuToolbar&&(this.danmuToolbar.remove(),delete this.danmuToolbar);this.subtitles&&delete this.subtitles;this.subtitleList&&(this.subtitleList=[],delete this.subtitleList);
this.overlay_layers&&(this.subtitle1&&delete this.subtitle1,this.subtitle2&&delete this.subtitle2,this.subtitleShow&&(Ta.removeElement(this.subtitleShow),delete this.subtitleShow),this.danmuPlayer&&(this.danmuPlayer.destroy(),delete this.danmuPlayer),this.playerContainer.removeChild(this.overlay_layers),delete this.overlay_layers);this.popup_layers&&(this.playerContainer.removeChild(this.popup_layers),delete this.popup_layers);this._unmuteTimer&&(clearTimeout(this._unmuteTimer),delete this._unmuteTimer);
this._unmuteLayer&&(this._unmuteLayer.parentNode&&this._unmuteLayer.parentNode.removeChild(this._unmuteLayer),delete this._unmuteLayer);this.playerElm&&this.playerContainer&&(delete this.playerContainer.zwpDragable,this.playerElm.removeChild(this.playerContainer),delete this.playerContainer,this.doDeletePlayerElm?(this.playerElm.parentNode.removeChild(this.playerElm),delete this.playerElm):this.doRemovePlayerClass&&(ja(this.playerElm,"zwp-wrap"),this.playerElm.setAttribute("class",this.playerElmOldClass)));
this.windowScrollHandler&&(document.removeEventListener("scroll",this.windowScrollHandler,!0),this._scrollRaf&&(cancelAnimationFrame(this._scrollRaf),this._scrollRaf=null),delete this.windowScrollHandler,this.smallWindowMode&&ja(document.body,"zwp-smallwindow"),delete this._exitSmallWindow,delete this._evalSmallWindow);this._orientationQuery&&this._orientationHandler&&(this._orientationQuery.removeEventListener&&this._orientationQuery.removeEventListener("change",this._orientationHandler),delete this._orientationQuery,
delete this._orientationHandler);this._resizeHandler&&(window.removeEventListener("resize",this._resizeHandler),delete this._resizeHandler);this._visibilityChangeHandler&&(document.removeEventListener("visibilitychange",this._visibilityChangeHandler),delete this._visibilityChangeHandler);this._closeMenusHandler&&(document.removeEventListener("click",this._closeMenusHandler),delete this._closeMenusHandler,delete this._closeMenusHandlerBound);this._invalidateDragCache&&(document.removeEventListener("fullscreenchange",
this._invalidateDragCache),document.removeEventListener("webkitfullscreenchange",this._invalidateDragCache),window.removeEventListener("orientationchange",this._invalidateDragCache),window.removeEventListener("resize",this._invalidateDragCache),delete this._invalidateDragCache,delete this._subDragCacheBound);this._previewController&&(this._previewController.destroy(),this._previewController=null);this._musicController&&(this._musicController.destroy(),this._musicController=null);if(a=this.playerContainer){t=
a.className.split(/\s+/).filter(function(y){return y.indexOf("zwp-mode-")===0});for(var z=0;z<t.length;z++)a.classList.remove(t[z])}this._cleanupThemeCompatibility&&this._cleanupThemeCompatibility();this.updateLocalPlaybackHint&&this.updateLocalPlaybackHint()},seekVideo:function(a){if(this.videoEl){var t=this.videoEl.duration||0;a=this.videoEl.currentTime+a;a<0?a=0:a>t&&(a=t);this.videoEl.currentTime=a}},stepFrame:function(a){if(this.videoEl&&!this._config.isLive){this._frameStepping=!0;this.hidePauseAd&&
this.hidePauseAd();this.videoEl.paused||this._pausePlayback();var t=this.videoEl.duration||0,z=this.videoEl.currentTime+1/30*a;z<0?z=0:z>t&&(z=t);this.videoEl.currentTime=z;a=a>0?K("frameStepForward","Frame Step Forward"):K("frameStepBackward","Frame Step Backward");this.toast(a+" "+sb(z,{showHours:!0,precision:"ms"}),1200)}},setplaystate:function(a){if(a)this._initialPlayDone=!0,this.bigPlayOverlay&&(this.bigPlayOverlay.style.display="none"),this._config.hideBigPlayButton&&this.flashPlayState&&this._lastFlashPlaying!==
!1&&(this._flashOnUserClick==="play"||this._flashOnUserClick===!0)&&(this._lastFlashPlaying=!1,this.flashPlayState(!1)),this._flashOnUserClick=null;else{if(this.keyState&&this.keyState.isRewinding)return;if(this._config.hideBigPlayButton)this.bigPlayOverlay&&(this.bigPlayOverlay.style.display="none"),this.flashPlayState&&this._lastFlashPlaying!==!0&&this._flashOnUserClick==="pause"&&(this._lastFlashPlaying=!0,this.flashPlayState(!0));else if(this.updateLocalPlaybackHint)this.updateLocalPlaybackHint(!0);
else if(this.bigPlayOverlay){var t=!!(this._config.vr||this.isVrActive&&this.isVrActive());this.bigPlayOverlay.style.display=t?"none":"flex"}this._flashOnUserClick!=="play"&&(this._flashOnUserClick=null)}this.playerElm&&(a?(ja(this.playerElm,"zwp-pause"),ka(this.playerElm,"zwp-playing")):(ja(this.playerElm,"zwp-playing"),ka(this.playerElm,"zwp-pause")));this.playerContainer&&(a?(ja(this.playerContainer,"zwp-pause"),ka(this.playerContainer,"zwp-playing")):(ja(this.playerContainer,"zwp-playing"),ka(this.playerContainer,
"zwp-pause")));this._hideLoading();this.controlbar&&(this.playbtn||(this.playbtn=this.controlbar.querySelector(".zwp-playbtn")),this.playbtn&&(a?this.playbtn.setAttribute("data-action","pause"):this.playbtn.setAttribute("data-action","play")))},setEnableDanmu:function(a){a?this.overlay_layers&&!this.danmuPlayer&&(this.danmuPlayer=bd.create({playerId:this.overlay_layers})):this.danmuPlayer&&(this.danmuPlayer.destroy(),delete this.danmuPlayer)},appendDanmu:function(a,t){this.danmuPlayer&&(t||(t=this.danmuSetting),
this.danmuPlayer.addDanmu(a,t))},setChapters:function(a){a===null?this.removeChapters():(this.chapters=a,this._config.chapterButton!==!1&&(this._config.chapterButton=!0),this.videoEl&&setTimeout(function(){this.loadChapters()}.bind(this),1E3))},setWatermarks:function(a){a?(this._watermarkData=a,this.loadWatermarks()):this.removeWatermarks()},addSubtitle:function(a,t,z){this.loadSubtitle(a,t,z,!z)},removeSubtitle:function(){this.showSubtitle(!1)},getSubtitleList:function(){return this.subtitleList?
this.subtitleList.slice():[]},setSubtitleTrack:function(a,t){Object.prototype.hasOwnProperty.call(this,"setSubtitleTrack")&&this.setSubtitleTrack(a,t)},removeSubtitleById:function(a){return this.removeFromSubtitleList(a)},addAudioTrack:function(a,t,z,y){(a=this._addAudioTrackInternal(a,t,z,!1,y))&&typeof this.updateAudioMenuUI==="function"&&this.updateAudioMenuUI();return a?a.id:null},removeAudioTrack:function(a){if(!this.audioTrackList||a===0)return!1;for(var t=0;t<this.audioTrackList.length;t++)if(this.audioTrackList[t].id===
a)return this.audioTrackList.splice(t,1),this.currentAudioId===a&&this.setAudioTrack(0),typeof this.updateAudioMenuUI==="function"&&this.updateAudioMenuUI(),!0;return!1},getAudioTrackList:function(){return this.audioTrackList?this.audioTrackList.slice():[]},setAudioTrack:function(a){this.audioTrackList&&this.setAudioTrack(a)},clearAudioTracks:function(){this.currentAudioId!==0&&this.setAudioTrack(0);this.audioTrackList=[this._makeOriginalAudioEntry()];this._nextAudioId=1;this._defaultAudioId=0;typeof this.updateAudioMenuUI===
"function"&&this.updateAudioMenuUI()},buildDanmuControlbar:function(a,t){this.buildDanmuToolbar(a,t)},notifyResize:function(a,t){this.playerElm&&(typeof a!=="undefined"&&(typeof a==="number"&&(a+="px"),this.playerElm.style.width=a),typeof t!=="undefined"&&(typeof t==="number"&&(t+="px"),this.playerElm.style.height=t))},lightOff:function(){this.playerElm&&ka(this.playerElm,"zwp-state-light-off")},lightOn:function(){this.playerElm&&ja(this.playerElm,"zwp-state-light-off")},get CurrentTime(){return this.isPlaying&&
this.videoEl?this.videoEl.currentTime:-1},set CurrentTime(a){if(this.isPlaying&&this.videoEl&&!(a<0)){var t=this.videoEl.duration;isNaN(t)||t===Infinity||(a>t&&(a=t),this.videoEl.currentTime=a)}},setLanguage:function(a,t){if(!a||!za.languages[a])return!1;var z=za.defaultLang;if(a&&za.languages[a]){var y=za.defaultLang;za.defaultLang=a;t&&typeof window!=="undefined"&&window.dispatchEvent&&(y=new CustomEvent("zwplayerLanguageChanged",{detail:{oldLang:y,newLang:a}}),window.dispatchEvent(y));y=!0}else Bb&&
console.warn('Language "'+a+'" is not supported'),y=!1;if(y){this._config.language=a;t&&this.controlbar&&this.refreshControlbar();if(this._config.onLanguageChange)this._config.onLanguageChange(z,a);return!0}return!1},getMode:function(){return this._mode||"standard"},setMode:function(a,t){return Jb(this,a,t)},getLanguage:function(){return this._config.language||za.defaultLang},getText:function(a,t){var z=this.getLanguage();return K(a,t,z)},refreshControlbar:function(){var a=this;if(a.controlbar&&a._config.controlbar!==
!1){var t=a.isPlaying,z=a.videoEl?a.videoEl.currentTime:0;a.controlbar.innerHTML=kd(a._config);a.playbtn=a.controlbar.querySelector(".zwp-playbtn");a.timeSpan=a.controlbar.querySelector(".zwp__currenttime");var y=a.controlbar.querySelectorAll("button.zwpbtn, .zwp-recording-option");y.length>0&&y.forEach(function(d){d.addEventListener("click",a.on_btnclick)});a._volumeDockDeps&&Ec(a,a._volumeDockDeps);if(y=a.controlbar.querySelector(".zwp-optionPanel"))y=y.querySelectorAll(".action-item"),y.length>
0&&y.forEach(function(d){d.addEventListener("click",a.on_optionItemclick)});if(y=a.controlbar.querySelector(".zwp-vrMenu"))y=y.querySelectorAll(".action-item"),y.length>0&&y.forEach(function(d){d.addEventListener("click",a.on_optionItemclick)});var x=a.controlbar.querySelector(".zwp__currenttime-container");if(x){var e=function(d){d.stopPropagation();a._timeCompactMode&&!a._config.isLive&&(a._showRemaining=!a._showRemaining,x.setAttribute("aria-label",a._showRemaining?K("remainingTime","\u5269\u4f59\u65f6\u95f4"):
K("currentTime","\u5f53\u524d\u65f6\u95f4")),a._renderTimeSpan())};x.addEventListener("click",e);x.addEventListener("keydown",function(d){if(d.key==="Enter"||d.key===" "||d.key==="Spacebar")d.preventDefault(),e(d)})}a.progressBar=null;typeof a.buildProgressBar==="function"&&a.buildProgressBar();if(y=a.controlbar.querySelector(".zwp-subtitleMenu"))y.innerHTML="",ja(y,"zwp-autosize");if(typeof a.updateSubtitleMenu==="function")try{a.updateSubtitleMenu()}catch(d){}if(typeof cc==="function")try{cc(a)}catch(d){}if(typeof a.updateRecordingMenuVisibility===
"function")try{a.updateRecordingMenuVisibility()}catch(d){}if(a.isMobile&&a.isMobile())try{a.removeVolumeBoostButton()}catch(d){}if(a.playlistState&&a.playlistState.data){if(typeof a._ensurePlaylistButton==="function")try{a._ensurePlaylistButton()}catch(d){}if(typeof a._updatePlaylistNavButtons==="function")try{a._updatePlaylistNavButtons()}catch(d){}}delete a.danmuToolbar;if(typeof a.buildDanmuToolbar==="function")try{a.buildDanmuToolbar()}catch(d){}if(a.videoEl){if(typeof a.updateProgress==="function")try{a.updateProgress(a.videoEl.currentTime)}catch(d){}if(typeof a._renderTimeSpan===
"function")try{a._renderTimeSpan(a.videoEl.currentTime)}catch(d){}}t&&a.videoEl&&(a.videoEl.currentTime=z)}a.localPlaybackHint&&a._config.localPlayback&&(t=a.localPlaybackHint.querySelector(".zwp-local-playback-text"),z=a.localPlaybackHint.querySelector(".zwp-local-playback-subtitle"),t&&(t.textContent=Rb()),z&&(z.textContent=K("supportedFormats","Supports MP4, WebM, MOV, MKV, M4V, OGG, FLAC, WAV, M4A, MP3, OPUS and other formats")),a.localPlaybackHint.setAttribute("aria-label",K("selectLocalVideo",
"Select Local Video File")));a.updateDragDropText&&a.updateDragDropText()}};return Mb});
