iking-web-ui-pro 0.2.35 → 0.2.36

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -13183,12 +13183,16 @@ const Gl = /* @__PURE__ */ At(Wl, [["__scopeId", "data-v-b301aa7d"]]), $l = Fe(G
13183
13183
  ),
13184
13184
  g[s.value.name] || g.attachmentName
13185
13185
  );
13186
- }, d = Y(() => ni.isNumber(r.width) ? `${r.width}px` : r.width), p = Y(() => r.list.map((g) => ({
13187
- ...g,
13188
- name: g[s.value.name] || g.attachmentName,
13189
- size: g[s.value.size] || g.fileSize || g.attachmentSize,
13190
- suffix: g[s.value.suffix] || g.attachmentSuffix
13191
- })));
13186
+ }, d = Y(() => ni.isNumber(r.width) ? `${r.width}px` : r.width), p = Y(() => r.list.map((g) => {
13187
+ var y;
13188
+ const m = g[s.value.name] || g.attachmentName;
13189
+ return {
13190
+ ...g,
13191
+ name: m,
13192
+ size: g[s.value.size] || (g == null ? void 0 : g.fileSize) || (g == null ? void 0 : g.attachmentSize),
13193
+ suffix: g[s.value.suffix] || (g == null ? void 0 : g.attachmentSuffix) || ((y = m.split(".")) == null ? void 0 : y.at(-1))
13194
+ };
13195
+ }));
13192
13196
  return (g, m) => {
13193
13197
  var k, b, w;
13194
13198
  const y = ct("tmplate");
@@ -223,4 +223,4 @@ Use Save As... to download, then click back to return to this page.`)&&(location
223
223
  <xg-mini-progress-cache class="xg-mini-progress-cache" style="`).concat(f.cached,`"></xg-mini-progress-cache>
224
224
  <xg-mini-progress-played class="xg-mini-progress-played" style="`).concat(f.played,`"></xg-mini-progress-played>
225
225
  </xg-mini-progress>`)}}}],[{key:"pluginName",get:function(){return"MiniProgress"}},{key:"defaultConfig",get:function(){return{mode:"auto",height:2}}}]),r}(V),je={REAL_TIME:"realtime",FIRST_FRAME:"firstframe",FRAME_RATE:"framerate",POSTER:"poster"};function sa(){try{return parseInt(window.performance.now(),10)}catch{return new Date().getTime()}}function aa(){try{var a=document.createElement("canvas").getContext;return!!a}catch{return!1}}var mt=null,la=function(a){I(r,a);var s=P(r);function r(){var t;T(this,r);for(var e=arguments.length,i=new Array(e),n=0;n<e;n++)i[n]=arguments[n];return t=s.call.apply(s,[this].concat(i)),k(m(t),"onLoadedData",function(o){t.player&&(t._frameCount=t.config.startFrameCount,t.stop(),t.renderOnTimeupdate(o),t.off(ee,t.renderOnTimeupdate),t.on(ee,t.renderOnTimeupdate))}),k(m(t),"onVisibilitychange",function(o){document.visibilityState==="visible"?t._checkIfCanStart()&&t.start():document.visibilityState==="hidden"&&t.stop()}),k(m(t),"renderOnTimeupdate",function(o){if(t._frameCount>0)t.renderOnce(),t._frameCount--;else{t._isLoaded=!0,t.off(ee,t.renderOnTimeupdate);var l=t.config.startInterval;!t.player.paused&&t._checkIfCanStart()&&t.start(0,l)}}),k(m(t),"start",function(o,l){var u=t.player.video,f=sa(),d=t.checkVideoIsSupport(u);!d||!t.canvasCtx||(l||(l=t.interval),t.stop(),u.videoWidth&&u.videoHeight&&(t.videoPI=u.videoHeight>0?parseInt(u.videoWidth/u.videoHeight*100,10):0,(t.config.mode===je.REAL_TIME||f-t.preTime>=l)&&(u&&u.videoWidth&&t.update(d,t.videoPI),t.preTime=f)),t.frameId=t._loopType==="timer"?h.setTimeout(m(t),t.start,l):h.requestAnimationFrame(t.start))}),k(m(t),"stop",function(){t.frameId&&(t._loopType==="timer"?h.clearTimeout(m(t),t.frameId):h.cancelAnimationFrame(t.frameId),t.frameId=null)}),t}return S(r,[{key:"afterCreate",value:function(){var e=this;this.playerConfig.dynamicBg===!0&&(this.config.disable=!1),r.isSupport||(this.config.disable=!0);var i=this.config,n=i.disable,o=i.mode,l=i.frameRate;n||(this._pos={width:0,height:0,rwidth:0,rheight:0,x:0,y:0,pi:0},this.isStart=!1,this._isLoaded=!1,this.videoPI=0,this.preTime=0,this.interval=parseInt(1e3/l,10),this.canvas=null,this.canvasCtx=null,this._frameCount=0,this._loopType=this.config.mode!==je.REAL_TIME&&this.interval>=1e3?"timer":"animation",this.once(it,function(){e.player&&(e.init(),e.renderByPoster(),e.player.paused||e.start())}),o!==je.POSTER&&(o!==je.FIRST_FRAME&&(this.on(Pe,function(){e.stop()}),this.on(Q,function(){var u=e.config.startInterval;e._checkIfCanStart()&&e.start(0,u)}),this.on(Me,function(){e.stop()})),this.on(pe,this.onLoadedData),this.on(Pt,function(){e._isLoaded=!1,e.stop()}),document.addEventListener("visibilitychange",this.onVisibilitychange)))}},{key:"setConfig",value:function(e){var i=this;Object.keys(e).forEach(function(n){n==="root"&&e[n]!==i.config[n]?i.reRender(e[n]):n==="frameRate"?i.interval=parseInt(1e3/e[n],10):n==="disable"&&e[n]&&i.stop(),i.config[n]=e[n]})}},{key:"init",value:function(e){var i=this.player,n=this.config;this.canvasFilter=r.supportCanvasFilter();try{var o=e||n.root;o||(o=n.isInnerRender&&i.innerContainer||i.root),o.insertAdjacentHTML("afterbegin",'<div class="xgplayer-dynamic-bg" data-index="'.concat(n.index,`"><canvas>
226
- </canvas><xgmask></xgmask></div>`)),this.root=o.children[0],this.canvas=this.find("canvas"),this.canvasFilter||(this.canvas.style.filter=n.filter,this.canvas.style.webkitFilter=n.filter),this.mask=this.find("xgmask"),n.addMask&&(this.mask.style.background=n.maskBg),this.canvasCtx=this.canvas.getContext("2d")}catch(l){M.logError("plugin:DynamicBg",l)}}},{key:"reRender",value:function(e){var i=this.config.disable;if(!(!i&&!this.root)){this.stop();var n=this.root?this.root.parentElement:null;if(n!==e&&n.removeChild(this.root),!e){this.root=null;return}this.init(e),this.renderOnce();var o=this.config.startInterval;this._checkIfCanStart()&&this.start(0,o)}}},{key:"checkVideoIsSupport",value:function(e){if(!e)return null;var i=e&&e instanceof window.HTMLVideoElement?e:e.canvas?e.canvas:e.flyVideo?e.flyVideo:null;if(i&&!(N.browser==="safari"&&h.isMSE(i)))return i;var n=i?i.tagName.toLowerCase():"";return n==="canvas"||n==="img"?i:null}},{key:"renderByPoster",value:function(){var e=this.playerConfig.poster;if(e){var i=h.typeOf(e)==="String"?e:h.typeOf(e.poster)==="String"?e.poster:null;this.updateImg(i)}}},{key:"_checkIfCanStart",value:function(){var e=this.config.mode;return this._isLoaded&&!this.player.paused&&e!==je.FIRST_FRAME&&e!==je.POSTER}},{key:"renderOnce",value:function(){var e=this.player.video;if(!(!e.videoWidth||!e.videoHeight)){this.videoPI=parseInt(e.videoWidth/e.videoHeight*100,10);var i=this.checkVideoIsSupport(e);i&&this.update(i,this.videoPI)}}},{key:"updateImg",value:function(e){var i=this;if(e){var n=this.canvas.getBoundingClientRect(),o=n.width,l=n.height,u=new window.Image;u.onload=function(){if(!(!i.canvas||i.frameId||i.isStart)){i.canvas.height=l,i.canvas.width=o;var f=parseInt(o/l*100,10);i.update(u,f),u=null}},u.src=e}}},{key:"update",value:function(e,i){if(!(!this.canvas||!this.canvasCtx||!i))try{var n=this._pos,o=this.config,l=this.canvas.getBoundingClientRect(),u=l.width,f=l.height;if(u!==n.width||f!==n.height||n.pi!==i){var d=parseInt(u/f*100,10);n.pi=i,n.width!==u&&(n.width=this.canvas.width=u),n.height!==f&&(n.height=this.canvas.height=f);var g=f,v=u;d<i?v=parseInt(f*i/100,10):d>i&&(g=parseInt(u*100/i,10)),n.rwidth=v*o.multiple,n.rheight=g*o.multiple,n.x=(u-n.rwidth)/2,n.y=(f-n.rheight)/2}this.canvasFilter&&(this.canvasCtx.filter=o.filter),this.canvasCtx.drawImage(e,n.x,n.y,n.rwidth,n.rheight)}catch(p){M.logError("plugin:DynamicBg",p)}}},{key:"destroy",value:function(){this.stop(),document.removeEventListener("visibilitychange",this.onVisibilitychange),this.canvasCtx=null,this.canvas=null}},{key:"render",value:function(){return""}}],[{key:"pluginName",get:function(){return"dynamicBg"}},{key:"defaultConfig",get:function(){return{isInnerRender:!1,disable:!0,index:-1,mode:"framerate",frameRate:10,filter:"blur(50px)",startFrameCount:2,startInterval:0,addMask:!0,multiple:1.2,maskBg:"rgba(0,0,0,0.7)"}}},{key:"isSupport",get:function(){return typeof mt=="boolean"||(mt=aa()),mt}},{key:"supportCanvasFilter",value:function(){return!(N.browser==="safari"||N.browser==="firefox")}}]),r}(V),ua={LANG:"zh-cn",TEXT:{ERROR_TYPES:{network:{code:1,msg:"视频下载错误"},mse:{code:2,msg:"流追加错误"},parse:{code:3,msg:"解析错误"},format:{code:4,msg:"格式错误"},decoder:{code:5,msg:"解码错误"},runtime:{code:6,msg:"语法错误"},timeout:{code:7,msg:"播放超时"},other:{code:8,msg:"其他错误"}},HAVE_NOTHING:"没有关于音频/视频是否就绪的信息",HAVE_METADATA:"音频/视频的元数据已就绪",HAVE_CURRENT_DATA:"关于当前播放位置的数据是可用的,但没有足够的数据来播放下一帧/毫秒",HAVE_FUTURE_DATA:"当前及至少下一帧的数据是可用的",HAVE_ENOUGH_DATA:"可用数据足以开始播放",NETWORK_EMPTY:"音频/视频尚未初始化",NETWORK_IDLE:"音频/视频是活动的且已选取资源,但并未使用网络",NETWORK_LOADING:"浏览器正在下载数据",NETWORK_NO_SOURCE:"未找到音频/视频来源",MEDIA_ERR_ABORTED:"取回过程被用户中止",MEDIA_ERR_NETWORK:"网络错误",MEDIA_ERR_DECODE:"解码错误",MEDIA_ERR_SRC_NOT_SUPPORTED:"不支持的音频/视频格式",REPLAY:"重播",ERROR:"网络连接似乎出现了问题",PLAY_TIPS:"播放",PAUSE_TIPS:"暂停",PLAYNEXT_TIPS:"下一集",DOWNLOAD_TIPS:"下载",ROTATE_TIPS:"旋转",RELOAD_TIPS:"重新载入",FULLSCREEN_TIPS:"进入全屏",EXITFULLSCREEN_TIPS:"退出全屏",CSSFULLSCREEN_TIPS:"进入样式全屏",EXITCSSFULLSCREEN_TIPS:"退出样式全屏",TEXTTRACK:"字幕",PIP:"画中画",SCREENSHOT:"截图",LIVE:"正在直播",OFF:"关闭",OPEN:"开启",MINI_DRAG:"点击按住可拖动视频",MINISCREEN:"小屏幕",REFRESH_TIPS:"请试试",REFRESH:"刷新",FORWARD:"快进中",LIVE_TIP:"直播"}},qe="info",Qt=Vi,ca=function(a){I(r,a);var s=P(r);function r(){var t;T(this,r);for(var e=arguments.length,i=new Array(e),n=0;n<e;n++)i[n]=arguments[n];return t=s.call.apply(s,[this].concat(i)),k(m(t),"_recordUserActions",function(o){var l=t._getTime(),u=Object.assign({},o,{msg:o.msg||o.action});t._stats[qe].push(j(j({type:"userAction"},l),{},{payload:u}))}),k(m(t),"_onReset",function(){t.reset()}),k(m(t),"_recordInfo",function(o){t.info(o)}),k(m(t),"_downloadStats",function(){var o=t.getStats(),l=new Blob([JSON.stringify(o)],{type:"application/json"}),u=window.URL.createObjectURL(l),f=document.createElement("a");f.style.display="none",f.href=u,f.download="player.txt",f.disabled=!1,f.click()}),t}return S(r,[{key:"_getTime",value:function(){return{timestamp:Date.now(),timeFormat:new Date().toISOString()}}},{key:"afterCreate",value:function(){this.reset(),this.on(lt,this._recordUserActions),this.on(Qt.STATS_INFO,this._recordInfo),this.on(Qt.STATS_DOWNLOAD,this._downloadStats),this.on(Qt.STATS_RESET,this._onReset)}},{key:"destroy",value:function(){this.offAll()}},{key:"downloadStats",value:function(){this._downloadStats()}},{key:"info",value:function(e){e.profile?this._infoProfile(e):this._info(e)}},{key:"_info",value:function(e){var i=this._getTime();this._stats[qe].push(j(j({},i),{},{payload:e}))}},{key:"_infoProfile",value:function(e){if(e&&e.startMs){var i=Date.now(),n=i-e.startMs,o=j({cat:"function",dur:n,name:e.name||e.msg,ph:"X",pid:0,tid:0,ts:e.startMs,profile:!0},e);this._info(o)}else console.warn("infoProfile need object data, include startMs")}},{key:"reset",value:function(){var e;this._stats=(e={},k(e,qe,[]),k(e,"media",{}),e)}},{key:"getStats",value:function(){for(var e=this.player,i=e.media,n=[],o=0;o<i.buffered.length;o++)n.push({start:i.buffered.start(o),end:i.buffered.end(o)});var l={currentTime:i.currentTime,readyState:i.readyState,buffered:n,paused:i.paused,ended:i.ended};return this._stats.media=l,{raw:this._stats,timestat:this._getTimeStats(),profile:this._getProfile()}}},{key:"_getTimeStats",value:function(){var e=this._stats[qe],i=e.map(function(n){var o=n.payload.data,l="";try{o instanceof Error?l=o.msg:o!==void 0&&(l=JSON.stringify(o))}catch(u){console.log("err",u)}return"[".concat(n.timeFormat,"] : ").concat(n.payload.msg," ").concat(l," ")});return i}},{key:"_getProfile",value:function(){var e={traceEvents:[]},i=this._stats[qe];return i.forEach(function(n){n.payload.profile&&e.traceEvents.push(n.payload)}),e}}],[{key:"pluginName",get:function(){return"stats"}},{key:"defaultConfig",get:function(){return{}}}]),r}(we),kn=function(a){I(r,a);var s=P(r);function r(){var t;T(this,r);for(var e=arguments.length,i=new Array(e),n=0;n<e;n++)i[n]=arguments[n];return t=s.call.apply(s,[this].concat(i)),k(m(t),"onGapJump",function(){var o=m(t),l=o.player,u=o.config;if(l.media.readyState!==HTMLMediaElement.HAVE_NOTHING){if(l.media.seeking){if(!t.seekingEventReceived)return}else t.seekingEventReceived=!1;if(!(l.media.paused&&l.media.currentTime!==0&&t.hasPlayed)){var f=l.media.buffered,d=u.smallGapLimit||.5,g=u.gapDetectionThreshold||.3,v=l.media.currentTime,p=t._getIndex(f,v,g);if(!(p===null||p===0)){console.log("GapJump bufferRange ",f.start(p),f.end(p));var y=f.start(p)+.1,_=l.media.duration;if(!(y>_)){var w=y-v,E=w<=d;w<r.BROWSER_GAP_TOLERANCE||E&&(u.useGapJump!==!1&&(l.media.currentTime=t.isSafari?y+.1:y),t.player&&t.player.emit("detectGap"),console.log("gapJump gapIndex",p," isGapSamll:",E," currentTime:",l.media.currentTime," jumpSize:",v-l.media.currentTime),y!==.08&&l&&l.emit("log",{type:"oneevent",end_type:"gap",vid:l.config.vid,ext:{video_postion:Math.floor(y*1e3)}}))}}}}}),t}return S(r,[{key:"afterCreate",value:function(){var e=this,i=this.config.useGapJump;i!==!1&&(this.hasPlayed=!1,this.seekingEventReceived=!1,this.isSafari=/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),this.on(Ke,this.onGapJump),this.on(Q,function(){e.hasPlayed=!0}),this.on(tt,function(){e.seekingEventReceived=!0}))}},{key:"_getIndex",value:function(e,i,n){if(!e||!e.length||e.length===1&&e.end(0)-e.start(0)<1e-6)return null;for(var o=this._getBuffered(e),l=null,u=0;u<o.length;u++){var f=o[u];if(f.start>i&&(u===0||o[u-1].end-i<=n)){l=u;break}}return l}},{key:"_getBuffered",value:function(e){if(!e)return[];for(var i=[],n=0;n<e.length;n++)i.push({start:e.start(n),end:e.end(n)});return i}}],[{key:"pluginName",get:function(){return"gapJump"}},{key:"defaultConfig",get:function(){return{useGapJump:!1,smallGapLimit:.5,gapDetectionThreshold:.3}}}]),r}(V);kn.BROWSER_GAP_TOLERANCE=.001;var fa=function(a){I(r,a);var s=P(r);function r(){var t;T(this,r);for(var e=arguments.length,i=new Array(e),n=0;n<e;n++)i[n]=arguments[n];return t=s.call.apply(s,[this].concat(i)),k(m(t),"onWaiting",function(){var o=m(t),l=o.config;t.jumpCnt>l.jumpCntMax||t.timer||l.useWaitingTimeoutJump===!1||(t.timer=setTimeout(t.onJump,l.waitingTime*1e3))}),k(m(t),"onJump",function(){var o=m(t),l=o.player,u=o.config;if(clearTimeout(t.timer),t.timer=null,!(t.jumpCnt>u.jumpCntMax||u.useWaitingTimeoutJump===!1)&&!(l.media.paused&&l.media.currentTime!==0&&t.hasPlayed)){t.jumpSize=u.jumpSize*(t.jumpCnt+1),t.jumpCnt===u.jumpSize&&t.jumpSize<6&&(t.jumpSize=6);var f=l.currentTime+t.jumpSize,d=l.media.duration;f>d||(t.jumpCnt++,l.currentTime=f)}}),t}return S(r,[{key:"afterCreate",value:function(){var e=this,i=this.config,n=i.useWaitingTimeoutJump,o=i.jumpSize;n!==!1&&(this.hasPlayed=!1,this.jumpCnt=0,this.timer=null,this.jumpSize=o,this.on(Ke,this.onWaiting),this.on([It,ge],function(){clearTimeout(e.timer),e.timer=null,e.jumpSize=e.config.jumpSize}),this.on(Q,function(){e.hasPlayed=!0}))}}],[{key:"pluginName",get:function(){return"waitingTimeoutJump"}},{key:"defaultConfig",get:function(){return{useWaitingTimeoutJump:!1,waitingTime:15,jumpSize:2,jumpCntMax:4}}}]),r}(V),We="cdn",yt=["cdn"],ha=function(a){I(r,a);var s=P(r);function r(){var t;T(this,r);for(var e=arguments.length,i=new Array(e),n=0;n<e;n++)i[n]=arguments[n];return t=s.call.apply(s,[this].concat(i)),k(m(t),"getSpeed",function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:We;if(!t.speedListCache||!t.speedListCache[o]||t.speedListCache[o].length<=0)return 0;var l=0;return t.speedListCache[o].map(function(u){l+=u}),Math.floor(l/t.speedListCache[o].length)}),k(m(t),"startTimer",function(){h.isMSE(t.player.video)||(t.initSpeedList(),t.cnt=0,t.timer=setTimeout(t.testSpeed,t.config.testTimeStep))}),k(m(t),"initSpeedList",function(){t.speedListCache={},yt.forEach(function(o){t.speedListCache[o]=[]})}),k(m(t),"_onRealSpeedChange",function(o){o.speed&&t.appendList(o.speed,o.type||We)}),k(m(t),"testSpeed",function(){if(clearTimeout(t.timer),t.timer=null,!(!t.player||!t.config.openSpeed)){var o=t.config,l=o.url,u=o.loadSize,f=o.testCnt,d=o.testTimeStep,g=l+(l.indexOf("?")<0?"?testst=":"&testst=")+Date.now();if(!(t.cnt>=f)){t.cnt++;try{var v=new Date().getTime(),p=null,y=new XMLHttpRequest;t.xhr=y,y.open("GET",g);var _={},w=Math.floor(Math.random()*10);_.Range="bytes="+w+"-"+(u+w),_&&Object.keys(_).forEach(function(E){y.setRequestHeader(E,_[E])}),y.onreadystatechange=function(){if(y.readyState===4){t.xhr=null,p=new Date().getTime();var E=y.getResponseHeader("Content-Length")/1024*8,b=Math.round(E*1e3/(p-v));t.appendList(b),t.timer=setTimeout(t.testSpeed,d)}},y.send()}catch(E){console.error(E)}}}}),k(m(t),"appendList",function(o){var l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:We;if(!(!t.speedListCache||!t.speedListCache[l])){var u=t.config.saveSpeedMax;t.speedListCache[l].length>=u&&t.speedListCache[l].shift(),t.speedListCache[l].push(o);var f=m(t),d=f.player;d&&(l===We?d.realTimeSpeed=o:d[t.getSpeedName("realTime",l)]=o),t.updateSpeed(l)}}),k(m(t),"updateSpeed",function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:We,l=t.getSpeed(o),u=m(t),f=u.player;if(f)if(o===We)(!f.avgSpeed||l!==f.avgSpeed)&&(f.avgSpeed=l,f.emit(Rt,{speed:l,realTimeSpeed:f.realTimeSpeed}));else{var d=t.getSpeedName("avg",o);(!f[d]||l!==f[d])&&(f[d]=l,f.emit(Rt,{speed:l,realTimeSpeed:f.realTimeSpeed}))}}),t}return S(r,[{key:"afterCreate",value:function(){var e=this.config,i=e.openSpeed,n=e.addSpeedTypeList;(n==null?void 0:n.length)>0&&yt.push.apply(yt,re(n)),this.initSpeedList(),this.on("real_time_speed",this._onRealSpeedChange),this.timer=null,this.cnt=0,this.xhr=null,i&&this.on([pe,nt],this.startTimer)}},{key:"getSpeedName",value:function(e,i){return e+"Speed"+i.toUpperCase()}},{key:"openSpeed",get:function(){return this.config.openSpeed},set:function(e){if(this.config.openSpeed=e,!e&&this.timer){clearTimeout(this.timer),this.timer=null;return}if(this.config.openSpeed){if(this.timer)return;this.timer=setTimeout(this.testSpeed,this.config.testTimeStep)}}},{key:"destroy",value:function(){var e=this;this.off("real_time_speed",this._onRealSpeedChange),this.off([pe,nt],this.startTimer),yt.forEach(function(i){e.speedListCache&&e.speedListCache[i]&&(e.speedListCache[i]=[])}),this.speedListCache&&(this.speedListCache={}),clearTimeout(this.timer),this.timer=null,this.xhr&&this.xhr.readyState!==4&&(this.xhr.cancel&&this.xhr.cancel(),this.xhr=null)}}],[{key:"pluginName",get:function(){return"testspeed"}},{key:"defaultConfig",get:function(){return{openSpeed:!1,testCnt:3,loadSize:200*1024,testTimeStep:3e3,url:"",saveSpeedMax:5,addSpeedTypeList:[]}}}]),r}(V),da=function(a){I(r,a);var s=P(r);function r(){return T(this,r),s.apply(this,arguments)}return S(r,[{key:"afterCreate",value:function(){var e=this,i=this.player,n=this.config,o=i.media||i.video;if(this.timer=null,this._lastDecodedFrames=0,this._currentStuckCount=0,this._lastCheckPoint=null,this._payload=[],!n.disabled){var l=o.getVideoPlaybackQuality;l&&(this.on(Q,function(){e._startTick()}),this.on(Me,function(){e._stopTick()}),this.on(Ie,function(){e._stopTick()}),this.on(Pe,function(){e._stopTick()}))}}},{key:"_startTick",value:function(){var e=this;this._stopTick(),this._timer=setTimeout(function(){e._checkDecodeFPS(),e._startTick()},this.config.tick)}},{key:"_stopTick",value:function(){clearTimeout(this._timer),this._timer=null}},{key:"_checkBuffer",value:function(e,i){for(var n=!1,o=[],l=0;l<i.length;l++){var u=i.start(l),f=i.end(l);if(o.push({start:u,end:f}),u<=e&&e<=f-1){n=!0;break}}return{enoughBuffer:n,buffers:o}}},{key:"_checkStuck",value:function(e,i,n,o){var l=this.player.media||this.player.video,u=document.hidden,f=l.paused,d=l.readyState,g=l.currentTime,v=l.buffered;if(!(u||f||d<4)){var p=this._checkBuffer(g,v),y=p.enoughBuffer,_=p.buffers;y&&(e<=this.config.reportFrame?(this._currentStuckCount++,this._payload.push({currentTime:g,buffers:_,curDecodedFrames:e,totalVideoFrames:i,droppedVideoFrames:n,checkInterval:o}),this._currentStuckCount>=this.config.stuckCount&&(this.emit(zi,this._payload),this._reset())):this._reset())}}},{key:"_reset",value:function(){this._payload=[],this._currentStuckCount=0}},{key:"_checkDecodeFPS",value:function(){var e=this.player.media||this.player.video;if(e){var i=e.getVideoPlaybackQuality(),n=i.totalVideoFrames,o=i.droppedVideoFrames,l=performance.now();if(n&&this._lastCheckPoint){var u=n-this._lastDecodedFrames,f=l-this._lastCheckPoint;this._checkStuck(u,n,o,f)}this._lastDecodedFrames=n,this._lastCheckPoint=l}}},{key:"destroy",value:function(){this._stopTick()}}],[{key:"pluginName",get:function(){return"FpsDetect"}},{key:"defaultConfig",get:function(){return{disabled:!1,tick:1e3,stuckCount:3,reportFrame:0}}}]),r}(V);Be.use(ua);var ga=S(function a(s,r){var t,e,i;T(this,a);var n=r&&r.isMobileSimulateMode==="mobile",o=r.isLive,l=o?[]:[As,bs,oa,na,Ls],u=[].concat(l,[Es,Ps,Fs,Us,qs,Zs,$s,Ks,Ns,Vs]),f=[ns,rs,ss,ks,as,ea,ta,ra,fs];this.plugins=[ca,ts].concat(re(u),f,[kn,fa]);var d=n?"mobile":N.device;switch(d){case"pc":(t=this.plugins).push.apply(t,[dn,qt,vn,ha,da]);break;case"mobile":(e=this.plugins).push.apply(e,[ms]);break;default:(i=this.plugins).push.apply(i,[dn,qt,vn])}(N.os.isIpad||d==="pc")&&this.plugins.push(la),N.os.isIpad&&this.plugins.push(qt),this.ignores=[],this.i18n=[]}),oe=function(a){I(r,a);var s=P(r);function r(){return T(this,r),s.apply(this,arguments)}return S(r)}(gt);k(oe,"defaultPreset",ga),k(oe,"Util",h),k(oe,"Sniffer",N),k(oe,"Errors",et),k(oe,"Events",Po),k(oe,"Plugin",V),k(oe,"BasePlugin",we),k(oe,"I18N",Be),k(oe,"STATE_CLASS",C),k(oe,"InstManager",tn);const dl="",pa=["id"],va=c.defineComponent({name:"ElImageViewer",__name:"Player",props:c.mergeModels({url:{type:String,default:""},zIndex:{type:Number,default:200},config:{type:Object,default:()=>({})}},{modelValue:{type:Boolean,default:!1},modelModifiers:{}}),emits:c.mergeModels({close:()=>!0},["update:modelValue"]),setup(a,{emit:s}){let r=null;const t=a,{cLoadUrl:e}=oi(t),i=c.computed(()=>Ge(e.value,t.url)),n={width:"100%",height:"100%",autoplay:!1,volume:.6,controls:!0,playbackRate:[.5,.75,1,1.5,2],crossOrigin:!0,preload:"auto",muted:!1,loop:!0,poster:"",lang:"zh-CN",screenShot:!0},o=c.computed(()=>({...n,...t.config})),l=s,u=c.useModel(a,"modelValue"),f=le.buildUUID(),d=$.useNamespace("image-viewer");function g(){l("close"),u.value=!1,r.destroy()}return c.watch(()=>u.value,v=>{v&&c.nextTick(()=>{r=new oe({id:f,url:i.value,...o.value})})}),(v,p)=>{const y=c.resolveComponent("el-icon");return u.value?(c.openBlock(),c.createBlock(c.Teleport,{key:0,to:"body"},[c.createVNode(c.Transition,{name:"viewer-fade",appear:""},{default:c.withCtx(()=>[c.createElementVNode("div",{ref:"wrapper",tabindex:-1,class:c.normalizeClass(c.unref(d).e("wrapper")),style:c.normalizeStyle({zIndex:a.zIndex})},[c.createElementVNode("div",{class:c.normalizeClass(c.unref(d).e("mask"))},null,2),c.createCommentVNode(" CANVAS "),c.createElementVNode("div",{class:c.normalizeClass(c.unref(d).e("canvas"))},[c.createElementVNode("div",{id:c.unref(f)},null,8,pa),c.createCommentVNode(" CLOSE "),c.createElementVNode("span",{class:c.normalizeClass([c.unref(d).e("btn"),c.unref(d).e("close")]),onClick:g},[c.createVNode(y,{onClick:g},{default:c.withCtx(()=>[c.createVNode(c.unref(ni))]),_:1})],2)],2),c.renderSlot(v.$slots,"default",{},void 0,!0)],6)]),_:3})])):c.createCommentVNode("v-if",!0)}}}),gl="",ma=_e(Je(va,[["__scopeId","data-v-b301aa7d"]])),ya=["onClick"],_a={class:"fileName simple"},ka=["onClick"],Ca={class:"text"},wa={class:"fileName"},ba={class:"size"},Ea=c.defineComponent({__name:"IkPreviewFile",props:{list:{type:Array,default:()=>[]},url:{required:!0,type:String,default:""},loadUrl:{type:String,default:""},field:{required:!0,type:Object,default:()=>({})},iconSize:{type:Number,default:40},showBg:{type:Boolean,default:!0},width:{type:Number||String,default:"100%"},iconHoverShow:{type:Boolean,default:!1},isOnlyOfficePreview:{type:Boolean,default:!0},onlyOfficeAccept:{type:String,default:".pdf,.docx,.doc.ppt,.pptx,.xlsx,.xls,"},onlyofficeServer:{type:String,default:""},onlyOfficeConfig:{type:Object,default:()=>({})},jwtToken:{type:String,default:""},simple:{type:Boolean,default:!1}},emits:["handPreview"],setup(a,{emit:s}){const r=a,{cLoadUrl:t,cOnlyofficeConfig:e,cOnlyofficePreviewType:i}=oi(r),n=s,o=c.computed(()=>({name:"name",url:"url",suffix:"suffix",size:"size",...r.field})),l=c.ref({}),u=c.ref(!1),f=p=>{var y,_;l.value={...p,name:p.name,url:Ge(t.value,(p==null?void 0:p.url)||((_=(y=p==null?void 0:p.response)==null?void 0:y.data)==null?void 0:_.id)||(p==null?void 0:p.id))},r.isOnlyOfficePreview&&(u.value=!0),n("handPreview",l.value)},d=p=>{le.ikFile.downloadFile(Ge(t.value,p[o.value.url]||p.attachmentId||p.id),p[o.value.name]||p.attachmentName)},g=c.computed(()=>le.paramType.isNumber(r.width)?`${r.width}px`:r.width),v=c.computed(()=>r.list.map(p=>({...p,name:p[o.value.name]||p.attachmentName,size:p[o.value.size]||p.fileSize||p.attachmentSize,suffix:p[o.value.suffix]||p.attachmentSuffix})));return(p,y)=>{var w,E,b;const _=c.resolveComponent("tmplate");return c.openBlock(),c.createElementBlock(c.Fragment,null,[(w=a.list)!=null&&w.length?(c.openBlock(),c.createElementBlock(c.Fragment,{key:0},[a.simple?(c.openBlock(!0),c.createElementBlock(c.Fragment,{key:0},c.renderList(v.value,(x,O)=>(c.openBlock(),c.createElementBlock("div",{class:"iking-privew-annex simple",onClick:F=>f(x),style:c.normalizeStyle({width:g.value})},[c.createElementVNode("div",_a,c.toDisplayString(x.name),1),c.createElementVNode("div",{class:c.normalizeClass(["flex flex-center",{"hover-show":a.iconHoverShow}])},[c.createVNode(c.unref(Ne),{name:"iksvg_daochu",onClick:c.withModifiers(F=>d(x),["stop"]),size:20,active:""},null,8,["onClick"]),c.unref(i).includes(x.suffix)?(c.openBlock(),c.createBlock(c.unref(Ne),{key:0,name:"iksvg_yulan",size:20,active:""})):c.createCommentVNode("v-if",!0),c.renderSlot(p.$slots,"operation",{data:{...x,findex:O}})],2)],12,ya))),256)):(c.openBlock(),c.createBlock(_,{key:1},{default:c.withCtx(()=>[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(v.value,(x,O)=>{var F;return c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass(["iking-privew-annex",{"is-bg":a.showBg}]),key:O,style:c.normalizeStyle({marginBottom:O==((F=a.list)==null?void 0:F.length)-1?"0":"10px",width:g.value})},[c.createElementVNode("div",{class:"file-card",onClick:A=>f(x)},[c.createVNode(c.unref(er),{file:x,style:c.normalizeStyle({height:`${a.iconSize}px`}),class:"ikui-w-auto",fields:o.value},null,8,["file","style","fields"]),c.createElementVNode("div",Ca,[c.createElementVNode("div",wa,c.toDisplayString(x.name),1),c.createElementVNode("div",ba,c.toDisplayString(c.unref(yr)(x.size)),1)]),c.createElementVNode("div",{class:c.normalizeClass(["flex flex-center",{"hover-show":a.iconHoverShow}])},[c.createVNode(c.unref(Ne),{name:"iksvg_daochu",onClick:c.withModifiers(A=>d(x),["stop"]),bg:a.showBg,size:a.showBg?"default":20,title:"下载"},null,8,["onClick","bg","size"]),c.unref(i).includes(x.suffix)?(c.openBlock(),c.createBlock(c.unref(Ne),{key:0,name:"iksvg_yulan",bg:a.showBg,size:a.showBg?"default":20,title:"预览"},null,8,["bg","size"])):c.createCommentVNode("v-if",!0),c.renderSlot(p.$slots,"operation",{data:{...x,findex:O}})],2)],8,ka)],6)}),128))]),_:3}))],64)):c.createCommentVNode("v-if",!0),c.createVNode(c.unref(kr),{show:u.value,"onUpdate:show":y[0]||(y[0]=x=>u.value=x),loadUrl:c.unref(t),file:l.value,onlyofficeServer:((E=c.unref(e))==null?void 0:E.serverUrl)||a.onlyofficeServer,onlyOfficeConfig:c.unref(e),onlyOfficeAccept:((b=c.unref(e))==null?void 0:b.accept)||a.onlyOfficeAccept},null,8,["show","loadUrl","file","onlyofficeServer","onlyOfficeConfig","onlyOfficeAccept"])],64)}}}),vl="",Cn=_e(Ea);ae.IkPreviewFile=Cn,ae.default=Cn,Object.defineProperties(ae,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
226
+ </canvas><xgmask></xgmask></div>`)),this.root=o.children[0],this.canvas=this.find("canvas"),this.canvasFilter||(this.canvas.style.filter=n.filter,this.canvas.style.webkitFilter=n.filter),this.mask=this.find("xgmask"),n.addMask&&(this.mask.style.background=n.maskBg),this.canvasCtx=this.canvas.getContext("2d")}catch(l){M.logError("plugin:DynamicBg",l)}}},{key:"reRender",value:function(e){var i=this.config.disable;if(!(!i&&!this.root)){this.stop();var n=this.root?this.root.parentElement:null;if(n!==e&&n.removeChild(this.root),!e){this.root=null;return}this.init(e),this.renderOnce();var o=this.config.startInterval;this._checkIfCanStart()&&this.start(0,o)}}},{key:"checkVideoIsSupport",value:function(e){if(!e)return null;var i=e&&e instanceof window.HTMLVideoElement?e:e.canvas?e.canvas:e.flyVideo?e.flyVideo:null;if(i&&!(N.browser==="safari"&&h.isMSE(i)))return i;var n=i?i.tagName.toLowerCase():"";return n==="canvas"||n==="img"?i:null}},{key:"renderByPoster",value:function(){var e=this.playerConfig.poster;if(e){var i=h.typeOf(e)==="String"?e:h.typeOf(e.poster)==="String"?e.poster:null;this.updateImg(i)}}},{key:"_checkIfCanStart",value:function(){var e=this.config.mode;return this._isLoaded&&!this.player.paused&&e!==je.FIRST_FRAME&&e!==je.POSTER}},{key:"renderOnce",value:function(){var e=this.player.video;if(!(!e.videoWidth||!e.videoHeight)){this.videoPI=parseInt(e.videoWidth/e.videoHeight*100,10);var i=this.checkVideoIsSupport(e);i&&this.update(i,this.videoPI)}}},{key:"updateImg",value:function(e){var i=this;if(e){var n=this.canvas.getBoundingClientRect(),o=n.width,l=n.height,u=new window.Image;u.onload=function(){if(!(!i.canvas||i.frameId||i.isStart)){i.canvas.height=l,i.canvas.width=o;var f=parseInt(o/l*100,10);i.update(u,f),u=null}},u.src=e}}},{key:"update",value:function(e,i){if(!(!this.canvas||!this.canvasCtx||!i))try{var n=this._pos,o=this.config,l=this.canvas.getBoundingClientRect(),u=l.width,f=l.height;if(u!==n.width||f!==n.height||n.pi!==i){var d=parseInt(u/f*100,10);n.pi=i,n.width!==u&&(n.width=this.canvas.width=u),n.height!==f&&(n.height=this.canvas.height=f);var g=f,v=u;d<i?v=parseInt(f*i/100,10):d>i&&(g=parseInt(u*100/i,10)),n.rwidth=v*o.multiple,n.rheight=g*o.multiple,n.x=(u-n.rwidth)/2,n.y=(f-n.rheight)/2}this.canvasFilter&&(this.canvasCtx.filter=o.filter),this.canvasCtx.drawImage(e,n.x,n.y,n.rwidth,n.rheight)}catch(p){M.logError("plugin:DynamicBg",p)}}},{key:"destroy",value:function(){this.stop(),document.removeEventListener("visibilitychange",this.onVisibilitychange),this.canvasCtx=null,this.canvas=null}},{key:"render",value:function(){return""}}],[{key:"pluginName",get:function(){return"dynamicBg"}},{key:"defaultConfig",get:function(){return{isInnerRender:!1,disable:!0,index:-1,mode:"framerate",frameRate:10,filter:"blur(50px)",startFrameCount:2,startInterval:0,addMask:!0,multiple:1.2,maskBg:"rgba(0,0,0,0.7)"}}},{key:"isSupport",get:function(){return typeof mt=="boolean"||(mt=aa()),mt}},{key:"supportCanvasFilter",value:function(){return!(N.browser==="safari"||N.browser==="firefox")}}]),r}(V),ua={LANG:"zh-cn",TEXT:{ERROR_TYPES:{network:{code:1,msg:"视频下载错误"},mse:{code:2,msg:"流追加错误"},parse:{code:3,msg:"解析错误"},format:{code:4,msg:"格式错误"},decoder:{code:5,msg:"解码错误"},runtime:{code:6,msg:"语法错误"},timeout:{code:7,msg:"播放超时"},other:{code:8,msg:"其他错误"}},HAVE_NOTHING:"没有关于音频/视频是否就绪的信息",HAVE_METADATA:"音频/视频的元数据已就绪",HAVE_CURRENT_DATA:"关于当前播放位置的数据是可用的,但没有足够的数据来播放下一帧/毫秒",HAVE_FUTURE_DATA:"当前及至少下一帧的数据是可用的",HAVE_ENOUGH_DATA:"可用数据足以开始播放",NETWORK_EMPTY:"音频/视频尚未初始化",NETWORK_IDLE:"音频/视频是活动的且已选取资源,但并未使用网络",NETWORK_LOADING:"浏览器正在下载数据",NETWORK_NO_SOURCE:"未找到音频/视频来源",MEDIA_ERR_ABORTED:"取回过程被用户中止",MEDIA_ERR_NETWORK:"网络错误",MEDIA_ERR_DECODE:"解码错误",MEDIA_ERR_SRC_NOT_SUPPORTED:"不支持的音频/视频格式",REPLAY:"重播",ERROR:"网络连接似乎出现了问题",PLAY_TIPS:"播放",PAUSE_TIPS:"暂停",PLAYNEXT_TIPS:"下一集",DOWNLOAD_TIPS:"下载",ROTATE_TIPS:"旋转",RELOAD_TIPS:"重新载入",FULLSCREEN_TIPS:"进入全屏",EXITFULLSCREEN_TIPS:"退出全屏",CSSFULLSCREEN_TIPS:"进入样式全屏",EXITCSSFULLSCREEN_TIPS:"退出样式全屏",TEXTTRACK:"字幕",PIP:"画中画",SCREENSHOT:"截图",LIVE:"正在直播",OFF:"关闭",OPEN:"开启",MINI_DRAG:"点击按住可拖动视频",MINISCREEN:"小屏幕",REFRESH_TIPS:"请试试",REFRESH:"刷新",FORWARD:"快进中",LIVE_TIP:"直播"}},qe="info",Qt=Vi,ca=function(a){I(r,a);var s=P(r);function r(){var t;T(this,r);for(var e=arguments.length,i=new Array(e),n=0;n<e;n++)i[n]=arguments[n];return t=s.call.apply(s,[this].concat(i)),k(m(t),"_recordUserActions",function(o){var l=t._getTime(),u=Object.assign({},o,{msg:o.msg||o.action});t._stats[qe].push(j(j({type:"userAction"},l),{},{payload:u}))}),k(m(t),"_onReset",function(){t.reset()}),k(m(t),"_recordInfo",function(o){t.info(o)}),k(m(t),"_downloadStats",function(){var o=t.getStats(),l=new Blob([JSON.stringify(o)],{type:"application/json"}),u=window.URL.createObjectURL(l),f=document.createElement("a");f.style.display="none",f.href=u,f.download="player.txt",f.disabled=!1,f.click()}),t}return S(r,[{key:"_getTime",value:function(){return{timestamp:Date.now(),timeFormat:new Date().toISOString()}}},{key:"afterCreate",value:function(){this.reset(),this.on(lt,this._recordUserActions),this.on(Qt.STATS_INFO,this._recordInfo),this.on(Qt.STATS_DOWNLOAD,this._downloadStats),this.on(Qt.STATS_RESET,this._onReset)}},{key:"destroy",value:function(){this.offAll()}},{key:"downloadStats",value:function(){this._downloadStats()}},{key:"info",value:function(e){e.profile?this._infoProfile(e):this._info(e)}},{key:"_info",value:function(e){var i=this._getTime();this._stats[qe].push(j(j({},i),{},{payload:e}))}},{key:"_infoProfile",value:function(e){if(e&&e.startMs){var i=Date.now(),n=i-e.startMs,o=j({cat:"function",dur:n,name:e.name||e.msg,ph:"X",pid:0,tid:0,ts:e.startMs,profile:!0},e);this._info(o)}else console.warn("infoProfile need object data, include startMs")}},{key:"reset",value:function(){var e;this._stats=(e={},k(e,qe,[]),k(e,"media",{}),e)}},{key:"getStats",value:function(){for(var e=this.player,i=e.media,n=[],o=0;o<i.buffered.length;o++)n.push({start:i.buffered.start(o),end:i.buffered.end(o)});var l={currentTime:i.currentTime,readyState:i.readyState,buffered:n,paused:i.paused,ended:i.ended};return this._stats.media=l,{raw:this._stats,timestat:this._getTimeStats(),profile:this._getProfile()}}},{key:"_getTimeStats",value:function(){var e=this._stats[qe],i=e.map(function(n){var o=n.payload.data,l="";try{o instanceof Error?l=o.msg:o!==void 0&&(l=JSON.stringify(o))}catch(u){console.log("err",u)}return"[".concat(n.timeFormat,"] : ").concat(n.payload.msg," ").concat(l," ")});return i}},{key:"_getProfile",value:function(){var e={traceEvents:[]},i=this._stats[qe];return i.forEach(function(n){n.payload.profile&&e.traceEvents.push(n.payload)}),e}}],[{key:"pluginName",get:function(){return"stats"}},{key:"defaultConfig",get:function(){return{}}}]),r}(we),kn=function(a){I(r,a);var s=P(r);function r(){var t;T(this,r);for(var e=arguments.length,i=new Array(e),n=0;n<e;n++)i[n]=arguments[n];return t=s.call.apply(s,[this].concat(i)),k(m(t),"onGapJump",function(){var o=m(t),l=o.player,u=o.config;if(l.media.readyState!==HTMLMediaElement.HAVE_NOTHING){if(l.media.seeking){if(!t.seekingEventReceived)return}else t.seekingEventReceived=!1;if(!(l.media.paused&&l.media.currentTime!==0&&t.hasPlayed)){var f=l.media.buffered,d=u.smallGapLimit||.5,g=u.gapDetectionThreshold||.3,v=l.media.currentTime,p=t._getIndex(f,v,g);if(!(p===null||p===0)){console.log("GapJump bufferRange ",f.start(p),f.end(p));var y=f.start(p)+.1,_=l.media.duration;if(!(y>_)){var w=y-v,E=w<=d;w<r.BROWSER_GAP_TOLERANCE||E&&(u.useGapJump!==!1&&(l.media.currentTime=t.isSafari?y+.1:y),t.player&&t.player.emit("detectGap"),console.log("gapJump gapIndex",p," isGapSamll:",E," currentTime:",l.media.currentTime," jumpSize:",v-l.media.currentTime),y!==.08&&l&&l.emit("log",{type:"oneevent",end_type:"gap",vid:l.config.vid,ext:{video_postion:Math.floor(y*1e3)}}))}}}}}),t}return S(r,[{key:"afterCreate",value:function(){var e=this,i=this.config.useGapJump;i!==!1&&(this.hasPlayed=!1,this.seekingEventReceived=!1,this.isSafari=/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),this.on(Ke,this.onGapJump),this.on(Q,function(){e.hasPlayed=!0}),this.on(tt,function(){e.seekingEventReceived=!0}))}},{key:"_getIndex",value:function(e,i,n){if(!e||!e.length||e.length===1&&e.end(0)-e.start(0)<1e-6)return null;for(var o=this._getBuffered(e),l=null,u=0;u<o.length;u++){var f=o[u];if(f.start>i&&(u===0||o[u-1].end-i<=n)){l=u;break}}return l}},{key:"_getBuffered",value:function(e){if(!e)return[];for(var i=[],n=0;n<e.length;n++)i.push({start:e.start(n),end:e.end(n)});return i}}],[{key:"pluginName",get:function(){return"gapJump"}},{key:"defaultConfig",get:function(){return{useGapJump:!1,smallGapLimit:.5,gapDetectionThreshold:.3}}}]),r}(V);kn.BROWSER_GAP_TOLERANCE=.001;var fa=function(a){I(r,a);var s=P(r);function r(){var t;T(this,r);for(var e=arguments.length,i=new Array(e),n=0;n<e;n++)i[n]=arguments[n];return t=s.call.apply(s,[this].concat(i)),k(m(t),"onWaiting",function(){var o=m(t),l=o.config;t.jumpCnt>l.jumpCntMax||t.timer||l.useWaitingTimeoutJump===!1||(t.timer=setTimeout(t.onJump,l.waitingTime*1e3))}),k(m(t),"onJump",function(){var o=m(t),l=o.player,u=o.config;if(clearTimeout(t.timer),t.timer=null,!(t.jumpCnt>u.jumpCntMax||u.useWaitingTimeoutJump===!1)&&!(l.media.paused&&l.media.currentTime!==0&&t.hasPlayed)){t.jumpSize=u.jumpSize*(t.jumpCnt+1),t.jumpCnt===u.jumpSize&&t.jumpSize<6&&(t.jumpSize=6);var f=l.currentTime+t.jumpSize,d=l.media.duration;f>d||(t.jumpCnt++,l.currentTime=f)}}),t}return S(r,[{key:"afterCreate",value:function(){var e=this,i=this.config,n=i.useWaitingTimeoutJump,o=i.jumpSize;n!==!1&&(this.hasPlayed=!1,this.jumpCnt=0,this.timer=null,this.jumpSize=o,this.on(Ke,this.onWaiting),this.on([It,ge],function(){clearTimeout(e.timer),e.timer=null,e.jumpSize=e.config.jumpSize}),this.on(Q,function(){e.hasPlayed=!0}))}}],[{key:"pluginName",get:function(){return"waitingTimeoutJump"}},{key:"defaultConfig",get:function(){return{useWaitingTimeoutJump:!1,waitingTime:15,jumpSize:2,jumpCntMax:4}}}]),r}(V),We="cdn",yt=["cdn"],ha=function(a){I(r,a);var s=P(r);function r(){var t;T(this,r);for(var e=arguments.length,i=new Array(e),n=0;n<e;n++)i[n]=arguments[n];return t=s.call.apply(s,[this].concat(i)),k(m(t),"getSpeed",function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:We;if(!t.speedListCache||!t.speedListCache[o]||t.speedListCache[o].length<=0)return 0;var l=0;return t.speedListCache[o].map(function(u){l+=u}),Math.floor(l/t.speedListCache[o].length)}),k(m(t),"startTimer",function(){h.isMSE(t.player.video)||(t.initSpeedList(),t.cnt=0,t.timer=setTimeout(t.testSpeed,t.config.testTimeStep))}),k(m(t),"initSpeedList",function(){t.speedListCache={},yt.forEach(function(o){t.speedListCache[o]=[]})}),k(m(t),"_onRealSpeedChange",function(o){o.speed&&t.appendList(o.speed,o.type||We)}),k(m(t),"testSpeed",function(){if(clearTimeout(t.timer),t.timer=null,!(!t.player||!t.config.openSpeed)){var o=t.config,l=o.url,u=o.loadSize,f=o.testCnt,d=o.testTimeStep,g=l+(l.indexOf("?")<0?"?testst=":"&testst=")+Date.now();if(!(t.cnt>=f)){t.cnt++;try{var v=new Date().getTime(),p=null,y=new XMLHttpRequest;t.xhr=y,y.open("GET",g);var _={},w=Math.floor(Math.random()*10);_.Range="bytes="+w+"-"+(u+w),_&&Object.keys(_).forEach(function(E){y.setRequestHeader(E,_[E])}),y.onreadystatechange=function(){if(y.readyState===4){t.xhr=null,p=new Date().getTime();var E=y.getResponseHeader("Content-Length")/1024*8,b=Math.round(E*1e3/(p-v));t.appendList(b),t.timer=setTimeout(t.testSpeed,d)}},y.send()}catch(E){console.error(E)}}}}),k(m(t),"appendList",function(o){var l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:We;if(!(!t.speedListCache||!t.speedListCache[l])){var u=t.config.saveSpeedMax;t.speedListCache[l].length>=u&&t.speedListCache[l].shift(),t.speedListCache[l].push(o);var f=m(t),d=f.player;d&&(l===We?d.realTimeSpeed=o:d[t.getSpeedName("realTime",l)]=o),t.updateSpeed(l)}}),k(m(t),"updateSpeed",function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:We,l=t.getSpeed(o),u=m(t),f=u.player;if(f)if(o===We)(!f.avgSpeed||l!==f.avgSpeed)&&(f.avgSpeed=l,f.emit(Rt,{speed:l,realTimeSpeed:f.realTimeSpeed}));else{var d=t.getSpeedName("avg",o);(!f[d]||l!==f[d])&&(f[d]=l,f.emit(Rt,{speed:l,realTimeSpeed:f.realTimeSpeed}))}}),t}return S(r,[{key:"afterCreate",value:function(){var e=this.config,i=e.openSpeed,n=e.addSpeedTypeList;(n==null?void 0:n.length)>0&&yt.push.apply(yt,re(n)),this.initSpeedList(),this.on("real_time_speed",this._onRealSpeedChange),this.timer=null,this.cnt=0,this.xhr=null,i&&this.on([pe,nt],this.startTimer)}},{key:"getSpeedName",value:function(e,i){return e+"Speed"+i.toUpperCase()}},{key:"openSpeed",get:function(){return this.config.openSpeed},set:function(e){if(this.config.openSpeed=e,!e&&this.timer){clearTimeout(this.timer),this.timer=null;return}if(this.config.openSpeed){if(this.timer)return;this.timer=setTimeout(this.testSpeed,this.config.testTimeStep)}}},{key:"destroy",value:function(){var e=this;this.off("real_time_speed",this._onRealSpeedChange),this.off([pe,nt],this.startTimer),yt.forEach(function(i){e.speedListCache&&e.speedListCache[i]&&(e.speedListCache[i]=[])}),this.speedListCache&&(this.speedListCache={}),clearTimeout(this.timer),this.timer=null,this.xhr&&this.xhr.readyState!==4&&(this.xhr.cancel&&this.xhr.cancel(),this.xhr=null)}}],[{key:"pluginName",get:function(){return"testspeed"}},{key:"defaultConfig",get:function(){return{openSpeed:!1,testCnt:3,loadSize:200*1024,testTimeStep:3e3,url:"",saveSpeedMax:5,addSpeedTypeList:[]}}}]),r}(V),da=function(a){I(r,a);var s=P(r);function r(){return T(this,r),s.apply(this,arguments)}return S(r,[{key:"afterCreate",value:function(){var e=this,i=this.player,n=this.config,o=i.media||i.video;if(this.timer=null,this._lastDecodedFrames=0,this._currentStuckCount=0,this._lastCheckPoint=null,this._payload=[],!n.disabled){var l=o.getVideoPlaybackQuality;l&&(this.on(Q,function(){e._startTick()}),this.on(Me,function(){e._stopTick()}),this.on(Ie,function(){e._stopTick()}),this.on(Pe,function(){e._stopTick()}))}}},{key:"_startTick",value:function(){var e=this;this._stopTick(),this._timer=setTimeout(function(){e._checkDecodeFPS(),e._startTick()},this.config.tick)}},{key:"_stopTick",value:function(){clearTimeout(this._timer),this._timer=null}},{key:"_checkBuffer",value:function(e,i){for(var n=!1,o=[],l=0;l<i.length;l++){var u=i.start(l),f=i.end(l);if(o.push({start:u,end:f}),u<=e&&e<=f-1){n=!0;break}}return{enoughBuffer:n,buffers:o}}},{key:"_checkStuck",value:function(e,i,n,o){var l=this.player.media||this.player.video,u=document.hidden,f=l.paused,d=l.readyState,g=l.currentTime,v=l.buffered;if(!(u||f||d<4)){var p=this._checkBuffer(g,v),y=p.enoughBuffer,_=p.buffers;y&&(e<=this.config.reportFrame?(this._currentStuckCount++,this._payload.push({currentTime:g,buffers:_,curDecodedFrames:e,totalVideoFrames:i,droppedVideoFrames:n,checkInterval:o}),this._currentStuckCount>=this.config.stuckCount&&(this.emit(zi,this._payload),this._reset())):this._reset())}}},{key:"_reset",value:function(){this._payload=[],this._currentStuckCount=0}},{key:"_checkDecodeFPS",value:function(){var e=this.player.media||this.player.video;if(e){var i=e.getVideoPlaybackQuality(),n=i.totalVideoFrames,o=i.droppedVideoFrames,l=performance.now();if(n&&this._lastCheckPoint){var u=n-this._lastDecodedFrames,f=l-this._lastCheckPoint;this._checkStuck(u,n,o,f)}this._lastDecodedFrames=n,this._lastCheckPoint=l}}},{key:"destroy",value:function(){this._stopTick()}}],[{key:"pluginName",get:function(){return"FpsDetect"}},{key:"defaultConfig",get:function(){return{disabled:!1,tick:1e3,stuckCount:3,reportFrame:0}}}]),r}(V);Be.use(ua);var ga=S(function a(s,r){var t,e,i;T(this,a);var n=r&&r.isMobileSimulateMode==="mobile",o=r.isLive,l=o?[]:[As,bs,oa,na,Ls],u=[].concat(l,[Es,Ps,Fs,Us,qs,Zs,$s,Ks,Ns,Vs]),f=[ns,rs,ss,ks,as,ea,ta,ra,fs];this.plugins=[ca,ts].concat(re(u),f,[kn,fa]);var d=n?"mobile":N.device;switch(d){case"pc":(t=this.plugins).push.apply(t,[dn,qt,vn,ha,da]);break;case"mobile":(e=this.plugins).push.apply(e,[ms]);break;default:(i=this.plugins).push.apply(i,[dn,qt,vn])}(N.os.isIpad||d==="pc")&&this.plugins.push(la),N.os.isIpad&&this.plugins.push(qt),this.ignores=[],this.i18n=[]}),oe=function(a){I(r,a);var s=P(r);function r(){return T(this,r),s.apply(this,arguments)}return S(r)}(gt);k(oe,"defaultPreset",ga),k(oe,"Util",h),k(oe,"Sniffer",N),k(oe,"Errors",et),k(oe,"Events",Po),k(oe,"Plugin",V),k(oe,"BasePlugin",we),k(oe,"I18N",Be),k(oe,"STATE_CLASS",C),k(oe,"InstManager",tn);const dl="",pa=["id"],va=c.defineComponent({name:"ElImageViewer",__name:"Player",props:c.mergeModels({url:{type:String,default:""},zIndex:{type:Number,default:200},config:{type:Object,default:()=>({})}},{modelValue:{type:Boolean,default:!1},modelModifiers:{}}),emits:c.mergeModels({close:()=>!0},["update:modelValue"]),setup(a,{emit:s}){let r=null;const t=a,{cLoadUrl:e}=oi(t),i=c.computed(()=>Ge(e.value,t.url)),n={width:"100%",height:"100%",autoplay:!1,volume:.6,controls:!0,playbackRate:[.5,.75,1,1.5,2],crossOrigin:!0,preload:"auto",muted:!1,loop:!0,poster:"",lang:"zh-CN",screenShot:!0},o=c.computed(()=>({...n,...t.config})),l=s,u=c.useModel(a,"modelValue"),f=le.buildUUID(),d=$.useNamespace("image-viewer");function g(){l("close"),u.value=!1,r.destroy()}return c.watch(()=>u.value,v=>{v&&c.nextTick(()=>{r=new oe({id:f,url:i.value,...o.value})})}),(v,p)=>{const y=c.resolveComponent("el-icon");return u.value?(c.openBlock(),c.createBlock(c.Teleport,{key:0,to:"body"},[c.createVNode(c.Transition,{name:"viewer-fade",appear:""},{default:c.withCtx(()=>[c.createElementVNode("div",{ref:"wrapper",tabindex:-1,class:c.normalizeClass(c.unref(d).e("wrapper")),style:c.normalizeStyle({zIndex:a.zIndex})},[c.createElementVNode("div",{class:c.normalizeClass(c.unref(d).e("mask"))},null,2),c.createCommentVNode(" CANVAS "),c.createElementVNode("div",{class:c.normalizeClass(c.unref(d).e("canvas"))},[c.createElementVNode("div",{id:c.unref(f)},null,8,pa),c.createCommentVNode(" CLOSE "),c.createElementVNode("span",{class:c.normalizeClass([c.unref(d).e("btn"),c.unref(d).e("close")]),onClick:g},[c.createVNode(y,{onClick:g},{default:c.withCtx(()=>[c.createVNode(c.unref(ni))]),_:1})],2)],2),c.renderSlot(v.$slots,"default",{},void 0,!0)],6)]),_:3})])):c.createCommentVNode("v-if",!0)}}}),gl="",ma=_e(Je(va,[["__scopeId","data-v-b301aa7d"]])),ya=["onClick"],_a={class:"fileName simple"},ka=["onClick"],Ca={class:"text"},wa={class:"fileName"},ba={class:"size"},Ea=c.defineComponent({__name:"IkPreviewFile",props:{list:{type:Array,default:()=>[]},url:{required:!0,type:String,default:""},loadUrl:{type:String,default:""},field:{required:!0,type:Object,default:()=>({})},iconSize:{type:Number,default:40},showBg:{type:Boolean,default:!0},width:{type:Number||String,default:"100%"},iconHoverShow:{type:Boolean,default:!1},isOnlyOfficePreview:{type:Boolean,default:!0},onlyOfficeAccept:{type:String,default:".pdf,.docx,.doc.ppt,.pptx,.xlsx,.xls,"},onlyofficeServer:{type:String,default:""},onlyOfficeConfig:{type:Object,default:()=>({})},jwtToken:{type:String,default:""},simple:{type:Boolean,default:!1}},emits:["handPreview"],setup(a,{emit:s}){const r=a,{cLoadUrl:t,cOnlyofficeConfig:e,cOnlyofficePreviewType:i}=oi(r),n=s,o=c.computed(()=>({name:"name",url:"url",suffix:"suffix",size:"size",...r.field})),l=c.ref({}),u=c.ref(!1),f=p=>{var y,_;l.value={...p,name:p.name,url:Ge(t.value,(p==null?void 0:p.url)||((_=(y=p==null?void 0:p.response)==null?void 0:y.data)==null?void 0:_.id)||(p==null?void 0:p.id))},r.isOnlyOfficePreview&&(u.value=!0),n("handPreview",l.value)},d=p=>{le.ikFile.downloadFile(Ge(t.value,p[o.value.url]||p.attachmentId||p.id),p[o.value.name]||p.attachmentName)},g=c.computed(()=>le.paramType.isNumber(r.width)?`${r.width}px`:r.width),v=c.computed(()=>r.list.map(p=>{var _;const y=p[o.value.name]||p.attachmentName;return{...p,name:y,size:p[o.value.size]||(p==null?void 0:p.fileSize)||(p==null?void 0:p.attachmentSize),suffix:p[o.value.suffix]||(p==null?void 0:p.attachmentSuffix)||((_=y.split("."))==null?void 0:_.at(-1))}}));return(p,y)=>{var w,E,b;const _=c.resolveComponent("tmplate");return c.openBlock(),c.createElementBlock(c.Fragment,null,[(w=a.list)!=null&&w.length?(c.openBlock(),c.createElementBlock(c.Fragment,{key:0},[a.simple?(c.openBlock(!0),c.createElementBlock(c.Fragment,{key:0},c.renderList(v.value,(x,O)=>(c.openBlock(),c.createElementBlock("div",{class:"iking-privew-annex simple",onClick:F=>f(x),style:c.normalizeStyle({width:g.value})},[c.createElementVNode("div",_a,c.toDisplayString(x.name),1),c.createElementVNode("div",{class:c.normalizeClass(["flex flex-center",{"hover-show":a.iconHoverShow}])},[c.createVNode(c.unref(Ne),{name:"iksvg_daochu",onClick:c.withModifiers(F=>d(x),["stop"]),size:20,active:""},null,8,["onClick"]),c.unref(i).includes(x.suffix)?(c.openBlock(),c.createBlock(c.unref(Ne),{key:0,name:"iksvg_yulan",size:20,active:""})):c.createCommentVNode("v-if",!0),c.renderSlot(p.$slots,"operation",{data:{...x,findex:O}})],2)],12,ya))),256)):(c.openBlock(),c.createBlock(_,{key:1},{default:c.withCtx(()=>[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(v.value,(x,O)=>{var F;return c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass(["iking-privew-annex",{"is-bg":a.showBg}]),key:O,style:c.normalizeStyle({marginBottom:O==((F=a.list)==null?void 0:F.length)-1?"0":"10px",width:g.value})},[c.createElementVNode("div",{class:"file-card",onClick:A=>f(x)},[c.createVNode(c.unref(er),{file:x,style:c.normalizeStyle({height:`${a.iconSize}px`}),class:"ikui-w-auto",fields:o.value},null,8,["file","style","fields"]),c.createElementVNode("div",Ca,[c.createElementVNode("div",wa,c.toDisplayString(x.name),1),c.createElementVNode("div",ba,c.toDisplayString(c.unref(yr)(x.size)),1)]),c.createElementVNode("div",{class:c.normalizeClass(["flex flex-center",{"hover-show":a.iconHoverShow}])},[c.createVNode(c.unref(Ne),{name:"iksvg_daochu",onClick:c.withModifiers(A=>d(x),["stop"]),bg:a.showBg,size:a.showBg?"default":20,title:"下载"},null,8,["onClick","bg","size"]),c.unref(i).includes(x.suffix)?(c.openBlock(),c.createBlock(c.unref(Ne),{key:0,name:"iksvg_yulan",bg:a.showBg,size:a.showBg?"default":20,title:"预览"},null,8,["bg","size"])):c.createCommentVNode("v-if",!0),c.renderSlot(p.$slots,"operation",{data:{...x,findex:O}})],2)],8,ka)],6)}),128))]),_:3}))],64)):c.createCommentVNode("v-if",!0),c.createVNode(c.unref(kr),{show:u.value,"onUpdate:show":y[0]||(y[0]=x=>u.value=x),loadUrl:c.unref(t),file:l.value,onlyofficeServer:((E=c.unref(e))==null?void 0:E.serverUrl)||a.onlyofficeServer,onlyOfficeConfig:c.unref(e),onlyOfficeAccept:((b=c.unref(e))==null?void 0:b.accept)||a.onlyOfficeAccept},null,8,["show","loadUrl","file","onlyofficeServer","onlyOfficeConfig","onlyOfficeAccept"])],64)}}}),vl="",Cn=_e(Ea);ae.IkPreviewFile=Cn,ae.default=Cn,Object.defineProperties(ae,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
@@ -1039,12 +1039,16 @@ const vt = (o, a) => {
1039
1039
  ),
1040
1040
  d[s.value.name] || d.attachmentName
1041
1041
  );
1042
- }, g = Z(() => ri.isNumber(r.width) ? `${r.width}px` : r.width), p = Z(() => r.list.map((d) => ({
1043
- ...d,
1044
- name: d[s.value.name] || d.attachmentName,
1045
- size: d[s.value.size] || d.fileSize || d.attachmentSize,
1046
- suffix: d[s.value.suffix] || d.attachmentSuffix
1047
- })));
1042
+ }, g = Z(() => ri.isNumber(r.width) ? `${r.width}px` : r.width), p = Z(() => r.list.map((d) => {
1043
+ var m;
1044
+ const v = d[s.value.name] || d.attachmentName;
1045
+ return {
1046
+ ...d,
1047
+ name: v,
1048
+ size: d[s.value.size] || (d == null ? void 0 : d.fileSize) || (d == null ? void 0 : d.attachmentSize),
1049
+ suffix: d[s.value.suffix] || (d == null ? void 0 : d.attachmentSuffix) || ((m = v.split(".")) == null ? void 0 : m.at(-1))
1050
+ };
1051
+ }));
1048
1052
  return (d, v) => {
1049
1053
  var C, E, w;
1050
1054
  const m = Ke("tmplate");