iking-web-ui-pro 0.2.26 → 0.2.27

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.
@@ -1,5 +1,5 @@
1
- (function(ie,c){typeof exports=="object"&&typeof module<"u"?c(exports,require("vue"),require("iking-utils-pro"),require("element-plus")):typeof define=="function"&&define.amd?define(["exports","vue","iking-utils-pro","element-plus"],c):(ie=typeof globalThis<"u"?globalThis:ie||self,c(ie.index={},ie.vue,ie["iking-utils-pro"],ie["element-plus"]))})(this,function(ie,c,Te,Qi){"use strict";const ce=(a,s)=>{if(a.install=r=>{for(const t of[a,...Object.values(s??{})])r.component(t.name,t)},s)for(const[r,t]of Object.entries(s))a[r]=t;return a},lt=(a,s)=>{var i,n,o,l;const r=(i=a==null?void 0:a.response)!=null&&i.data?Wt((o=(n=a==null?void 0:a.response)==null?void 0:n.data)==null?void 0:o.suffix):((l=a.raw)==null?void 0:l.type)||Wt(a[s.suffix]),t=r==null?void 0:r.toLowerCase(),e={sheet:"excel",excel:"excel",zip:"zip","application/x-compressed":"zip",image:"image",video:"video",audio:"audio",pdf:"pdf",text:"txt",txt:"txt",word:"word",ppt:"ppt",exe:"exe",json:"json"};for(let u in e)if(typeof t=="string"&&(t.includes(u)||t===u))return e[u];return"unknown"},en={".doc":"word",".docx":"word",".docxf":"word",".docm":"word",".dot":"word",".dotm":"word",".dotx":"word",".epub":"word",".fodt":"word",".htm":"word",".html":"word",".mht":"word",".odt":"word",".ott":"word",".rtf":"word",".djvu":"word",".oxps":"word",".oform":"word",".fb2":"word",".xml":"word",".xps":"word",".csv":"excel",".xls":"excel",".xlsx":"excel",".fods":"excel",".ods":"excel",".ots":"excel",".xlsb":"excel",".xlsm":"excel",".xlt":"excel",".xltm":"excel",".xltx":"excel",".fodp":"ppt",".odp":"ppt",".otp":"ppt",".pot":"ppt",".potm":"ppt",".potx":"ppt",".pps":"ppt",".ppsm":"ppt",".ppsx":"ppt",".ppt":"ppt",".pptm":"ppt",".pptx":"ppt",".zip":"zip",".rar":"zip",".7z":"zip",".apz":"zip",".ar":"zip",".bz":"zip",".car":"zip",".dar":"zip",".cpgz":"zip",".f":"zip",".ha":"zip",".hbc":"zip",".hbc2":"zip",".hbe":"zip",".hpk":"zip",".hyp":"zip",".png":"image",".jpg":"image",".jpeg":"image",".bmp":"image",".gif":"image",".webp":"image",".psd":"image",".svg":"image",".tiff":"image",".avi":"video",".wmv":"video",".mpeg":"video",".mp4":"video",".mpm4v":"video",".mov":"video",".asf":"video",".flv":"video",".f4v":"video",".rmvb":"video",".rm":"video",".3gp":"video",".vob":"video",".txt":"txt",".pdf":"pdf"},Wt=a=>{const s=a==null?void 0:a.toLocaleLowerCase(),r=s!=null&&s.startsWith(".")?s:`.${s}`;return r&&en[r]||"unknow"},tn=a=>{let s="",r=["doc","docx"],t=["xls","xlsx"],e=["ppt","pptx"],i=["pdf"];return r.includes(a)&&(s="word"),t.includes(a)&&(s="cell"),e.includes(a)&&(s="slide"),i.includes(a)&&(s="text-pdf"),s},nn={key:0,t:"1686300059786",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"7671",width:"200",height:"200"},rn=[c.createElementVNode("path",{d:"M160 0h512l256 256v704c0 35.3472-28.6528 64-64 64H160c-35.3472 0-64-28.6528-64-64V64c0-35.3472 28.6528-64 64-64z",fill:"#50CD89","p-id":"7672"},null,-1),c.createElementVNode("path",{d:"M258.528 742.0672L351.8336 604.928a14.5024 14.5024 0 0 1 22.1696-2.1824l61.664 60.416 135.296-212.064a14.5024 14.5024 0 0 1 24.8064 0.5568l168.1024 291.328a14.5024 14.5024 0 0 1-12.5696 21.7664H270.528a14.5024 14.5024 0 0 1-12.0064-22.6816z",fill:"#FFF7F7","p-id":"7673"},null,-1),c.createElementVNode("path",{d:"M359.616 431.5456m-73.1456 0a73.1456 73.1456 0 1 0 146.2912 0 73.1456 73.1456 0 1 0-146.2912 0Z",fill:"#FFFFFF","p-id":"7674"},null,-1),c.createElementVNode("path",{d:"M672 0l256 256h-192c-35.3472 0-64-28.6528-64-64V0z",fill:"#a9f6cc","p-id":"7675"},null,-1)],on={key:1,t:"1686301531714",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"9067",width:"200",height:"200"},sn=[c.createElementVNode("path",{d:"M409.6 0v68.266667h-34.133333c-20.48 0-34.133333 13.653333-34.133334 34.133333s13.653333 34.133333 34.133334 34.133333H409.6v68.266667h-34.133333c-20.48 0-34.133333 13.653333-34.133334 34.133333s13.653333 34.133333 34.133334 34.133334H409.6v68.266666h-34.133333c-20.48 0-34.133333 13.653333-34.133334 34.133334s13.653333 34.133333 34.133334 34.133333H409.6v68.266667h-34.133333c-20.48 0-34.133333 13.653333-34.133334 34.133333s13.653333 34.133333 34.133334 34.133333h68.266666c20.48 0 34.133333-13.653333 34.133334-34.133333V477.866667h34.133333c20.48 0 34.133333-13.653333 34.133333-34.133334S532.48 409.6 512 409.6H477.866667V341.333333h34.133333c20.48 0 34.133333-13.653333 34.133333-34.133333S532.48 273.066667 512 273.066667H477.866667V204.8h34.133333c20.48 0 34.133333-13.653333 34.133333-34.133333S532.48 136.533333 512 136.533333H477.866667V0h204.8l273.066666 273.066667v614.4c0 75.093333-61.44 136.533333-136.533333 136.533333H204.8c-75.093333 0-136.533333-61.44-136.533333-136.533333V136.533333C68.266667 61.44 129.706667 0 204.8 0h204.8z m0 682.666667h68.266667v68.266666H409.6v-68.266666z m-34.133333-68.266667c-20.48 0-34.133333 13.653333-34.133334 34.133333v136.533334c0 20.48 13.653333 34.133333 34.133334 34.133333h136.533333c20.48 0 34.133333-13.653333 34.133333-34.133333v-136.533334c0-20.48-13.653333-34.133333-34.133333-34.133333h-136.533333z",fill:"#FFA621","p-id":"9068"},null,-1),c.createElementVNode("path",{d:"M682.666667 0l273.066666 273.066667h-204.8c-40.96 0-68.266667-27.306667-68.266666-68.266667V0z",fill:"#f5d37b","p-id":"9069"},null,-1)],an={key:2,t:"1686300141125",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"8137",width:"200",height:"200"},ln=[c.createElementVNode("path",{d:"M204.8 0h477.866667l273.066666 273.066667v614.4c0 75.093333-61.44 136.533333-136.533333 136.533333H204.8c-75.093333 0-136.533333-61.44-136.533333-136.533333V136.533333C68.266667 61.44 129.706667 0 204.8 0z m204.8 546.133333V443.733333h204.8v136.533334H409.6V546.133333z m0 102.4h204.8c40.96 0 68.266667-27.306667 68.266667-68.266666v-136.533334c0-40.96-27.306667-68.266667-68.266667-68.266666H409.6c-40.96 0-68.266667 27.306667-68.266667 68.266666V819.2c0 20.48 13.653333 34.133333 34.133334 34.133333s34.133333-13.653333 34.133333-34.133333V648.533333z",fill:"#F1416C","p-id":"8138"},null,-1),c.createElementVNode("path",{d:"M682.666667 0l273.066666 273.066667h-204.8c-40.96 0-68.266667-27.306667-68.266666-68.266667V0z",fill:"#f78cbc","p-id":"8139"},null,-1)],un={key:3,t:"1686300157181",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"8292",width:"200",height:"200"},cn=[c.createElementVNode("path",{d:"M204.8 0h477.866667l273.066666 273.066667v614.4c0 75.093333-61.44 136.533333-136.533333 136.533333H204.8c-75.093333 0-136.533333-61.44-136.533333-136.533333V136.533333C68.266667 61.44 129.706667 0 204.8 0z m307.2 607.573333l68.266667 191.146667c13.653333 27.306667 54.613333 27.306667 61.44 0l102.4-273.066667c6.826667-20.48 0-34.133333-20.48-40.96s-34.133333 0-40.96 13.653334l-68.266667 191.146666-68.266667-191.146666c-13.653333-27.306667-54.613333-27.306667-68.266666 0l-68.266667 191.146666-68.266667-191.146666c-6.826667-13.653333-27.306667-27.306667-47.786666-20.48s-27.306667 27.306667-20.48 47.786666l102.4 273.066667c13.653333 27.306667 54.613333 27.306667 61.44 0l75.093333-191.146667z",fill:"#029EF7","p-id":"8293"},null,-1),c.createElementVNode("path",{d:"M682.666667 0l273.066666 273.066667h-204.8c-40.96 0-68.266667-27.306667-68.266666-68.266667V0z",fill:"#64b5ed","p-id":"8294"},null,-1)],fn={key:4,t:"1686300180947",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"8447",width:"200",height:"200"},hn=[c.createElementVNode("path",{d:"M204.8 0h477.866667l273.066666 273.066667v614.4c0 75.093333-61.44 136.533333-136.533333 136.533333H204.8c-75.093333 0-136.533333-61.44-136.533333-136.533333V136.533333C68.266667 61.44 129.706667 0 204.8 0z m477.866667 730.453333c20.48 0 68.266667 0 68.266666-47.786666 0-20.48-6.826667-47.786667-68.266666-47.786667-27.306667 0-54.613333 6.826667-81.92 6.826667-34.133333-27.306667-68.266667-61.44-88.746667-102.4 20.48-75.093333 20.48-122.88 6.826667-150.186667-6.826667-6.826667-20.48-13.653333-34.133334-13.653333-20.48 0-34.133333 6.826667-40.96 20.48-20.48 40.96 13.653333 116.053333 27.306667 150.186666-20.48 54.613333-40.96 109.226667-68.266667 163.84C273.066667 764.586667 273.066667 798.72 273.066667 812.373333c0 13.653333 6.826667 27.306667 20.48 34.133334 6.826667 6.826667 13.653333 6.826667 20.48 6.826666 34.133333 0 68.266667-34.133333 116.053333-109.226666 54.613333-20.48 102.4-40.96 157.013333-47.786667 27.306667 20.48 61.44 34.133333 95.573334 34.133333zM491.52 416.426667c6.826667 20.48 6.826667 47.786667 0 68.266666-13.653333-20.48-13.653333-40.96-13.653333-68.266666h13.653333z m-177.493333 395.946666c13.653333-20.48 27.306667-27.306667 47.786666-40.96-13.653333 20.48-27.306667 34.133333-47.786666 40.96z m184.32-204.8c13.653333 20.48 34.133333 47.786667 54.613333 68.266667H546.133333c-27.306667 6.826667-61.44 13.653333-88.746666 27.306667 13.653333-34.133333 27.306667-61.44 40.96-95.573334z m177.493333 68.266667c27.306667 0 34.133333 6.826667 34.133333 13.653333-6.826667 0-20.48 6.826667-27.306666 0-13.653333 0-27.306667-6.826667-40.96-13.653333h34.133333z",fill:"#F1416C","p-id":"8448"},null,-1),c.createElementVNode("path",{d:"M682.666667 0l273.066666 273.066667h-204.8c-40.96 0-68.266667-27.306667-68.266666-68.266667V0z",fill:"#f78cbc","p-id":"8449"},null,-1)],dn={key:5,t:"1686300195363",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"8602",width:"200",height:"200"},pn=[c.createElementVNode("path",{d:"M204.8 0h477.866667l273.066666 273.066667v614.4c0 75.093333-61.44 136.533333-136.533333 136.533333H204.8c-75.093333 0-136.533333-61.44-136.533333-136.533333V136.533333C68.266667 61.44 129.706667 0 204.8 0z m341.333333 512h136.533334c20.48 0 34.133333-13.653333 34.133333-34.133333s-13.653333-34.133333-34.133333-34.133334H341.333333c-20.48 0-34.133333 13.653333-34.133333 34.133334s13.653333 34.133333 34.133333 34.133333h136.533334V819.2c0 20.48 13.653333 34.133333 34.133333 34.133333s34.133333-13.653333 34.133333-34.133333V512z",fill:"#029EF7","p-id":"8603"},null,-1),c.createElementVNode("path",{d:"M682.666667 0l273.066666 273.066667h-204.8c-40.96 0-68.266667-27.306667-68.266666-68.266667V0z",fill:"#64b5ed","p-id":"8604"},null,-1)],gn={key:6,t:"1686300209288",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"8757",width:"200",height:"200"},vn=[c.createElementVNode("path",{d:"M204.8 0h477.866667l273.066666 273.066667v614.4c0 75.093333-61.44 136.533333-136.533333 136.533333H204.8c-75.093333 0-136.533333-61.44-136.533333-136.533333V136.533333C68.266667 61.44 129.706667 0 204.8 0z m464.213333 375.466667l-232.106666 61.44c-27.306667 13.653333-47.786667 34.133333-47.786667 61.44v218.453333s-20.48-13.653333-54.613333-6.826667c-47.786667 6.826667-95.573333 47.786667-95.573334 88.746667 0 40.96 47.786667 61.44 95.573334 54.613333 54.613333-6.826667 95.573333-40.96 95.573333-81.92V559.786667c0-13.653333 27.306667-27.306667 27.306667-27.306667L655.36 477.866667s20.48-6.826667 20.48 13.653333v170.666667s-20.48-13.653333-54.613333-6.826667c-54.613333 6.826667-95.573333 40.96-95.573334 81.92s47.786667 68.266667 95.573334 61.44 95.573333-40.96 95.573333-81.92V409.6c0-27.306667-27.306667-40.96-47.786667-34.133333z",fill:"#FFA621","p-id":"8758"},null,-1),c.createElementVNode("path",{d:"M682.666667 0l273.066666 273.066667h-204.8c-40.96 0-68.266667-27.306667-68.266666-68.266667V0z",fill:"#f5d37b","p-id":"8759"},null,-1)],mn={key:7,t:"1686300225262",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"8912",width:"200",height:"200"},yn=[c.createElementVNode("path",{d:"M204.8 0h477.866667l273.066666 273.066667v614.4c0 75.093333-61.44 136.533333-136.533333 136.533333H204.8c-75.093333 0-136.533333-61.44-136.533333-136.533333V136.533333C68.266667 61.44 129.706667 0 204.8 0z m307.2 853.333333c150.186667 0 273.066667-122.88 273.066667-273.066666s-122.88-273.066667-273.066667-273.066667-273.066667 122.88-273.066667 273.066667 122.88 273.066667 273.066667 273.066666z m0-68.266666c-116.053333 0-204.8-88.746667-204.8-204.8s88.746667-204.8 204.8-204.8 204.8 88.746667 204.8 204.8-88.746667 204.8-204.8 204.8zM614.4 600.746667l6.826667-6.826667c6.826667-13.653333 6.826667-27.306667-6.826667-34.133333L484.693333 471.04s-6.826667-6.826667-13.653333-6.826667c-13.653333 0-27.306667 13.653333-27.306667 27.306667v170.666667c0 6.826667 0 13.653333 6.826667 13.653333 6.826667 13.653333 27.306667 13.653333 40.96 6.826667L614.4 600.746667z",fill:"#FFA621","p-id":"8913"},null,-1),c.createElementVNode("path",{d:"M682.666667 0l273.066666 273.066667h-204.8c-40.96 0-68.266667-27.306667-68.266666-68.266667V0z",fill:"#f5d37b","p-id":"8914"},null,-1)],_n={key:8,t:"1692251753690",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"4336",width:"200",height:"200"},kn=[c.createElementVNode("path",{d:"M192 0h448.170667l319.829333 320V896a128 128 0 0 1-128 128H192a128 128 0 0 1-128-128V128A128 128 0 0 1 192 0z",fill:"#00BD76","p-id":"4337"},null,-1),c.createElementVNode("path",{d:"M388.5056 631.261867H307.541333v54.852266h95.095467v33.8944H265.3184v-204.765866h136.977067v34.167466H307.5072v48.810667h80.9984v33.041067z m112.093867-45.397334l38.4-70.621866h48.503466l-59.630933 101.546666 61.201067 103.2192h-49.117867l-39.355733-71.714133-39.389867 71.68h-49.0496l61.166933-103.185067-59.630933-101.546666h48.503467l38.4 70.587733z m266.922666 65.9456c-0.648533 9.898667-3.037867 19.592533-7.0656 28.672-3.7888 8.533333-9.352533 16.1792-16.315733 22.4256-6.929067 6.2464-15.36 11.127467-25.258667 14.6432-9.864533 3.4816-21.128533 5.256533-33.792 5.256534-13.1072 0-24.917333-2.286933-35.362133-6.826667a72.260267 72.260267 0 0 1-26.555733-19.626667 89.019733 89.019733 0 0 1-16.725334-30.993066 133.597867 133.597867 0 0 1-5.870933-40.8576v-13.482667c0-15.121067 2.048-28.740267 6.0416-40.925867 4.061867-12.1856 9.728-22.528 17.1008-31.061333 7.338667-8.533333 16.4864-15.2576 26.794667-19.694933 10.478933-4.608 22.186667-6.894933 35.157333-6.894934 12.731733 0 24.029867 1.809067 33.792 5.393067 9.8304 3.618133 18.1248 8.635733 24.9856 15.0528 6.826667 6.485333 12.288 14.267733 16.042667 22.9376 3.822933 8.874667 6.2464 18.466133 7.304533 28.8768h-42.1888a63.829333 63.829333 0 0 0-3.1744-16.145067 31.744 31.744 0 0 0-7.099733-11.810133 29.354667 29.354667 0 0 0-11.946667-7.2704 55.944533 55.944533 0 0 0-17.749333-2.4576c-14.2336 0-24.849067 5.188267-31.812267 15.5648-6.997333 10.3424-10.478933 26.385067-10.478933 48.128v13.789867c0 10.581333 0.750933 19.899733 2.321066 27.8528 1.536 7.953067 3.959467 14.609067 7.304534 19.968a32.221867 32.221867 0 0 0 12.970666 12.014933c5.256533 2.696533 11.639467 4.027733 19.182934 4.027733 6.656 0 12.3904-0.750933 17.2032-2.2528a30.549333 30.549333 0 0 0 12.0832-6.826666 30.685867 30.685867 0 0 0 7.509333-11.4688c1.809067-4.573867 2.935467-9.898667 3.413333-16.042667h42.154667z",fill:"#FFFFFF",opacity:".9","p-id":"4338"},null,-1),c.createElementVNode("path",{d:"M640 0l320 320H768a128 128 0 0 1-128-128V0z",fill:"#19EA9C","p-id":"4339"},null,-1)],Cn={key:9,t:"1692251753690",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"4336",width:"200",height:"200"},En=[c.createElementVNode("path",{d:"M145.6 0C100.8 0 64 36.8 64 81.6v860.8C64 987.2 100.8 1024 145.6 1024h732.8c44.8 0 81.6-36.8 81.6-81.6V324.8L657.6 0h-512z",fill:"#8199AF","p-id":"8002"},null,-1),c.createElementVNode("path",{d:"M960 326.4v16H755.2s-100.8-20.8-99.2-107.2c0 0 3.2 91.2 96 91.2h208z",fill:"#617F9B","p-id":"8003"},null,-1),c.createElementVNode("path",{d:"M657.6 0v233.6c0 25.6 17.6 92.8 97.6 92.8H960L657.6 0z",fill:"#FFFFFF",opacity:".5","p-id":"8004"},null,-1),c.createElementVNode("path",{d:"M344 862.4h-100.8c-9.6 0-17.6-8-17.6-17.6V688c0-9.6 8-17.6 17.6-17.6h100.8c4.8 0 9.6 4.8 9.6 11.2 0 6.4-4.8 9.6-9.6 9.6h-94.4v62.4h91.2c6.4 0 11.2 4.8 11.2 11.2 0 6.4-4.8 9.6-11.2 9.6h-91.2v67.2h94.4c4.8 0 9.6 4.8 9.6 9.6 0 6.4-4.8 11.2-9.6 11.2z m193.6 1.6c-4.8 0-8 0-9.6-3.2l-59.2-80-60.8 80c-1.6 3.2-4.8 3.2-8 3.2-6.4 0-11.2-4.8-11.2-11.2 0-1.6 0-4.8 1.6-6.4l62.4-81.6-57.6-78.4c-1.6-1.6-3.2-3.2-3.2-6.4 0-4.8 4.8-11.2 12.8-11.2 3.2 0 6.4 1.6 8 4.8l56 73.6 54.4-73.6c1.6-3.2 4.8-4.8 9.6-4.8s11.2 4.8 11.2 11.2c0 3.2 0 4.8-1.6 6.4l-57.6 76.8 60.8 83.2c1.6 1.6 3.2 4.8 3.2 6.4 0 6.4-6.4 11.2-11.2 11.2z m171.2-1.6h-99.2c-9.6 0-17.6-8-17.6-17.6V688c0-9.6 8-17.6 17.6-17.6h99.2c6.4 0 11.2 4.8 11.2 11.2 0 6.4-4.8 9.6-11.2 9.6h-92.8v62.4h91.2c6.4 0 11.2 4.8 11.2 11.2 0 6.4-4.8 9.6-11.2 9.6h-91.2v67.2h92.8c6.4 0 11.2 4.8 11.2 9.6 0 6.4-4.8 11.2-11.2 11.2z",fill:"#FFFFFF","p-id":"8005"},null,-1)],bn={key:10,t:"1714099890925",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"2271",width:"200",height:"200"},wn=[c.createElementVNode("path",{d:"M227.555556 28.444444h389.404444a19.911111 19.911111 0 0 1 14.734222 6.542223l271.132445 298.211555a28.444444 28.444444 0 0 1 7.395555 19.143111V938.666667a56.888889 56.888889 0 0 1-56.888889 56.888889H227.555556a56.888889 56.888889 0 0 1-56.888889-56.888889V85.333333a56.888889 56.888889 0 0 1 56.888889-56.888889z",fill:"#0DD59D","p-id":"2272"},null,-1),c.createElementVNode("path",{d:"M625.777778 30.492444a19.911111 19.911111 0 0 1 5.916444 4.465778l271.132445 298.24a28.444444 28.444444 0 0 1 5.176889 8.135111H682.666667a56.888889 56.888889 0 0 1-56.888889-56.888889V30.492444z",fill:"#FFFFFF","fill-opacity":".65","p-id":"2273"},null,-1),c.createElementVNode("path",{d:"M396.288 645.176889c0 5.461333-0.796444 10.865778-2.389333 16.156444-1.592889 5.319111-4.266667 10.069333-7.964445 14.222223-3.697778 4.181333-8.647111 7.509333-14.791111 10.012444a60.871111 60.871111 0 0 1-22.869333 3.754667c-15.160889 0-26.851556-3.982222-35.043556-11.946667-8.192-7.964444-12.288-19.683556-12.288-35.157333v-10.012445h21.617778v6.826667c0 4.721778 0.369778 9.045333 1.137778 12.970667a28.074667 28.074667 0 0 0 3.982222 10.24 18.773333 18.773333 0 0 0 7.964444 6.712888c3.413333 1.592889 7.765333 2.389333 13.084445 2.389334 9.870222 0 16.64-2.645333 20.366222-7.964445 3.697778-5.290667 5.575111-12.430222 5.575111-21.390222v-118.784h21.617778v121.969778z m44.145778 3.413333c0.142222 4.266667 1.137778 7.850667 2.958222 10.808889a20.593778 20.593778 0 0 0 7.168 7.054222c2.958222 1.763556 6.286222 3.015111 10.012444 3.754667 3.697778 0.768 7.537778 1.137778 11.491556 1.137778 3.043556 0 6.229333-0.227556 9.557333-0.682667 3.328-0.455111 6.4-1.28 9.216-2.503111a17.294222 17.294222 0 0 0 6.940445-5.347556 14.250667 14.250667 0 0 0 2.730666-8.988444 12.885333 12.885333 0 0 0-5.688888-11.377778c-3.783111-2.56-8.533333-4.664889-14.222223-6.257778a232.561778 232.561778 0 0 0-18.545777-4.323555 96.227556 96.227556 0 0 1-18.545778-5.461333 38.4 38.4 0 0 1-14.222222-9.898667c-3.783111-4.266667-5.688889-10.154667-5.688889-17.749333a28.16 28.16 0 0 1 3.982222-15.246223c2.645333-4.266667 6.058667-7.68 10.24-10.353777 4.181333-2.645333 8.874667-4.608 14.108444-5.916445 5.233778-1.28 10.439111-1.934222 15.587556-1.934222 6.684444 0 12.8 0.568889 18.432 1.706667 5.603556 1.137778 10.581333 3.128889 14.904889 5.916444 4.323556 2.816 7.765333 6.599111 10.353778 11.377778 2.56 4.778667 4.096 10.752 4.551111 17.863111h-19.342223a19.569778 19.569778 0 0 0-2.958222-9.443556 19.370667 19.370667 0 0 0-6.371555-6.030222 28.956444 28.956444 0 0 0-8.533334-3.299555 43.918222 43.918222 0 0 0-9.443555-1.024c-2.872889 0-5.802667 0.227556-8.760889 0.682666a29.496889 29.496889 0 0 0-8.078222 2.389334 16.270222 16.270222 0 0 0-5.916445 4.551111 11.463111 11.463111 0 0 0-2.275555 7.395555c0 3.356444 1.166222 6.115556 3.527111 8.305778a28.16 28.16 0 0 0 8.988444 5.461333c3.640889 1.422222 7.736889 2.673778 12.288 3.640889 4.551111 0.995556 9.102222 1.991111 13.653334 3.072 4.835556 1.080889 9.585778 2.360889 14.222222 3.868445 4.636444 1.536 8.732444 3.527111 12.288 6.030222s6.456889 5.660444 8.647111 9.443555a27.733333 27.733333 0 0 1 3.299555 14.108445c0 7.111111-1.479111 13.056-4.437333 17.749333a34.702222 34.702222 0 0 1-11.605333 11.377778 48.497778 48.497778 0 0 1-16.156445 6.030222c-5.973333 1.137778-11.946667 1.706667-17.863111 1.706667a82.773333 82.773333 0 0 1-18.659555-2.048 45.795556 45.795556 0 0 1-15.701334-6.712889 34.218667 34.218667 0 0 1-10.922666-12.288 42.581333 42.581333 0 0 1-4.551111-18.545778h19.342222z m116.053333-21.617778c0 7.111111 0.938667 13.482667 2.844445 19.000889 1.905778 5.546667 4.522667 10.183111 7.850666 13.880889a34.076444 34.076444 0 0 0 25.941334 11.491556 34.076444 34.076444 0 0 0 25.941333-11.491556c3.328-3.697778 5.973333-8.334222 7.850667-13.880889 1.905778-5.518222 2.844444-11.861333 2.844444-19.000889 0-7.111111-0.938667-13.454222-2.844444-19.000888a41.016889 41.016889 0 0 0-7.850667-13.994667 33.422222 33.422222 0 0 0-11.719111-8.647111 34.872889 34.872889 0 0 0-14.222222-2.958222c-5.006222 0-9.756444 0.995556-14.222223 2.958222-4.465778 1.991111-8.391111 4.835556-11.719111 8.647111-3.328 3.811556-5.973333 8.476444-7.850666 13.994667-1.905778 5.546667-2.844444 11.889778-2.844445 19.000888z m-20.48 0c0-8.647111 1.223111-16.725333 3.640889-24.234666a54.897778 54.897778 0 0 1 10.922667-19.569778c4.835556-5.518222 10.837333-9.898667 17.976889-13.084444 7.111111-3.185778 15.331556-4.778667 24.576-4.778667 9.386667 0 17.635556 1.592889 24.689777 4.778667 7.054222 3.185778 12.999111 7.566222 17.863111 13.084444 4.835556 5.546667 8.504889 12.060444 10.922667 19.569778 2.417778 7.509333 3.640889 15.587556 3.640889 24.234666 0 8.647111-1.223111 16.696889-3.640889 24.120889-2.417778 7.452444-6.058667 13.937778-10.922667 19.456-4.835556 5.546667-10.808889 9.870222-17.863111 12.970667-7.054222 3.128889-15.274667 4.664889-24.689777 4.664889-9.244444 0-17.436444-1.536-24.576-4.664889a50.261333 50.261333 0 0 1-17.976889-12.970667 55.068444 55.068444 0 0 1-10.922667-19.456 77.283556 77.283556 0 0 1-3.640889-24.120889z m136.988445-58.936888h18.204444v18.659555h0.455111c8.049778-14.250667 20.764444-21.390222 38.229333-21.390222 7.736889 0 14.193778 1.080889 19.342223 3.185778 5.148444 2.133333 9.329778 5.091556 12.515555 8.874666 3.185778 3.811556 5.404444 8.305778 6.712889 13.539556 1.28 5.233778 1.934222 11.036444 1.934222 17.408v77.368889h-19.342222v-79.644445c0-7.281778-2.133333-13.027556-6.371555-17.294222-4.266667-4.266667-10.097778-6.371556-17.521778-6.371555-5.916444 0-11.036444 0.910222-15.36 2.730666a28.814222 28.814222 0 0 0-10.808889 7.736889 33.336889 33.336889 0 0 0-6.485333 11.719111c-1.422222 4.494222-2.161778 9.386667-2.161778 14.677334v66.446222h-19.342222V568.035556z",fill:"#FFFFFF","p-id":"2274"},null,-1)],Tn={key:11,t:"1686300037564",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"7515",width:"200",height:"200"},Sn=[c.createElementVNode("path",{d:"M160 0h512l256 256v704c0 35.3472-28.6528 64-64 64H160c-35.3472 0-64-28.6528-64-64V64c0-35.3472 28.6528-64 64-64z",fill:"#029EF7","p-id":"7516"},null,-1),c.createElementVNode("path",{d:"M672 0l256 256h-192c-35.3472 0-64-28.6528-64-64V0z",fill:"#64b5ed","p-id":"7517"},null,-1),c.createElementVNode("path",{d:"M384 499.2c0-25.6 5.12-46.08 10.24-58.88 5.12-12.8 15.36-25.6 28.16-35.84 12.8-12.8 25.6-20.48 43.52-25.6 15.36-5.12 30.72-7.68 48.64-7.68 35.84 0 64 10.24 89.6 30.72C627.2 422.4 640 448 640 481.28c0 15.36-5.12 28.16-10.24 40.96s-17.92 28.16-38.4 46.08-28.16 30.72-35.84 38.4c-7.68 7.68-10.24 17.92-15.36 28.16-5.12 10.24-2.56 17.92-2.56 43.52h-51.2c0-25.6 2.56-38.4 5.12-51.2s7.68-23.04 15.36-33.28 15.36-23.04 33.28-40.96c17.92-17.92 30.72-30.72 35.84-38.4 5.12-7.68 10.24-20.48 10.24-38.4s-7.68-30.72-20.48-43.52-30.72-20.48-53.76-20.48c-51.2 0-76.8 35.84-76.8 87.04h-51.2z m153.6 281.6h-51.2v-51.2h51.2v51.2z",fill:"#FFFFFF","p-id":"7518"},null,-1)],xn=ce(c.defineComponent({__name:"IkFileIcon",props:{type:{type:String,default:"unknow"},file:{type:Object,default:()=>null},fields:{type:Object,default:()=>({name:"name",url:"url",suffix:"suffix"})}},setup(a){const s=a,r=c.computed(()=>s.file?lt(s.file,s.fields):s.type);return(t,e)=>r.value==="image"?(c.openBlock(),c.createElementBlock("svg",nn,rn)):r.value==="zip"?(c.openBlock(),c.createElementBlock("svg",on,sn)):r.value==="ppt"?(c.openBlock(),c.createElementBlock("svg",an,ln)):r.value==="word"?(c.openBlock(),c.createElementBlock("svg",un,cn)):r.value==="pdf"?(c.openBlock(),c.createElementBlock("svg",fn,hn)):r.value==="txt"?(c.openBlock(),c.createElementBlock("svg",dn,pn)):r.value==="audio"?(c.openBlock(),c.createElementBlock("svg",gn,vn)):r.value==="video"?(c.openBlock(),c.createElementBlock("svg",mn,yn)):r.value==="excel"?(c.openBlock(),c.createElementBlock("svg",_n,kn)):r.value==="exe"?(c.openBlock(),c.createElementBlock("svg",Cn,En)):r.value==="json"?(c.openBlock(),c.createElementBlock("svg",bn,wn)):(c.openBlock(),c.createElementBlock("svg",Tn,Sn))}}));/*! Element Plus Icons Vue v2.3.1 */var In=c.defineComponent({name:"Close",__name:"close",setup(a){return(s,r)=>(c.openBlock(),c.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[c.createElementVNode("path",{fill:"currentColor",d:"M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z"})]))}}),Pn=In;const Me=(a,s)=>{const r=a.__vccOpts||a;for(const[t,e]of s)r[t]=e;return r},An=a=>({nodeType:{发起人节点:"INITIATOR",审批节点:"APPROVE",抄送节点:"CARBON_COPY",办理节点:"DISPOSE",分支节点:"BRANCH",条件节点:"CONDITION",结束节点:"END",并行分支:"PARALLEL",子流程:"SUB_PROCESS",...a.defaultNodeType},defaultFile:{id:"id",parallelInstances:"parallelInstances",backToInstanceNodeName:"backToInstanceNodeName",backToRecordNodeName:"backToRecordNodeName",nodeId:"sortOrder",nodeType:"type",nodeTypeName:"name",approveStatus:"status",approveStatusName:"statusName",approveType:"approveType",multiExecutorType:"multiExecutorType",approveTypeName:"approveTypeName",multiExecutorTypeName:"multiExecutorTypeName",approvalCategory:"approvalCategory",isShowAdd:"initiatorSpecify",isShowAddCopy:"initiatorSpecifyCarbonCopy",executorEmpty:"executorEmpty",executorEmptyStrategy:"executorEmptyStrategy",reserveExecutorUsers:"reserveExecutorUsers",approvePersonList:"executorUsers",initiatorSpecifiedScope:"initiatorSpecifiedScope",initiatorSpecifiedScopeType:"initiatorSpecifiedScopeType",singleApproval:"singleApproval",originator:"username",...a.defaultFieldMap},statusWithoutApprover:{自动通过:"AUTO_PASS",自动拒绝:"AUTO_REJECT",自动转交管理员:"TRANSMIT_TO_MANAGER",指定人员审批:"SPECIFIED_USER",...a.statusWithoutApprover},multiple:!1,chooseType:[],statusOption:{发起:"INITIATE",等待:"WAIT",同意:"PASS",撤销:"REVOKE",拒绝:"REJECT",转交:"TRANSFER",加签:"APPEND",退回:"BACK",评论:"COMMENT",待执行:"WAITING",执行中:"RUNNING",...a.defaultStatus},listData:[]}),Ln=(a,s,r)=>{let t="";switch(s){case a.nodeType.审批节点:r&&r.length==1?t="ikapprove-ziyuan":t="ikapprove-shenpi";break;case a.nodeType.办理节点:t="ikapprove-bianji";break;case a.nodeType.抄送节点:t="ikapprove-chaosong";break;case a.nodeType.并行分支:t="ikapprove-fenzhi";break;case a.nodeType.子流程:t="ikapprove-ziliucheng1";break;default:t="ikapprove-ziyuan"}return`ikapprove ${t}`},ut=a=>{const s=c.inject("loadUrl"),r=c.computed(()=>a.loadUrl||a.fileUrl||(s==null?void 0:s.value)),t=c.inject("uploadUrl"),e=c.computed(()=>a.action||a.uploadUrl||(t==null?void 0:t.value)),i=c.inject("token"),n=c.computed(()=>a.token||(i==null?void 0:i.value)),o=c.inject("onlyofficeConfig"),l=c.computed(()=>a.onlyofficeConfig||(o==null?void 0:o.value)),u=c.inject("userInfo"),f=c.computed(()=>a.userInfo||(u==null?void 0:u.value));return{cLoadUrl:r,cUploadUrl:e,cToken:n,cOnlyofficeConfig:l,cUserInfo:f}},Dn=(a,s=2)=>{if(a===void 0)return"";if(a===0)return"0 B";const r=["B","KB","MB","GB","TB"],t=Math.floor(Math.log(a)/Math.log(1024));let e=a/Math.pow(1024,t);return(e%1===0?e.toFixed(s||0):e.toFixed(s))+" "+r[t]},Se=(a,s)=>s?s.startsWith("http")?s:`${a||location.origin}${s}`:"",On=["onClick"],Rn={class:"fileName simple"},Nn=["onClick"],Fn={class:"text"},Mn={class:"fileName"},Bn={class:"size"},Hn=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}},setup(a){const s=a,{cLoadUrl:r,cOnlyofficeConfig:t}=ut(s),e=c.computed(()=>({name:"name",url:"url",suffix:"suffix",size:"size",...s.field})),i=c.ref({}),n=c.ref(!1),o=h=>{var g,v;i.value={...h,name:h.name,url:Se(r.value,h.url||((v=(g=h==null?void 0:h.response)==null?void 0:g.data)==null?void 0:v.id)||(h==null?void 0:h.id))},n.value=!0},l=h=>{Te.ikFile.downloadFile(Se(r.value,h[e.value.url]||h.attachmentId||h.id),h[e.value.name]||h.attachmentName)},u=c.computed(()=>Te.paramType.isNumber(s.width)?`${s.width}px`:s.width),f=c.computed(()=>s.list.map(h=>({...h,name:h[e.value.name]||h.attachmentName,size:h[e.value.size]||h.fileSize||h.attachmentSize,suffix:h[e.value.suffix]||h.attachmentSuffix})));return(h,g)=>{var p,m,_;const v=c.resolveComponent("tmplate");return c.openBlock(),c.createElementBlock(c.Fragment,null,[(p=a.list)!=null&&p.length?(c.openBlock(),c.createElementBlock(c.Fragment,{key:0},[a.simple?(c.openBlock(!0),c.createElementBlock(c.Fragment,{key:0},c.renderList(f.value,(C,w)=>(c.openBlock(),c.createElementBlock("div",{class:"iking-privew-annex simple",onClick:E=>o(C),style:c.normalizeStyle({width:u.value})},[c.createElementVNode("div",Rn,c.toDisplayString(C.name),1),c.createElementVNode("div",{class:c.normalizeClass(["flex flex-center",{"hover-show":a.iconHoverShow}])},[c.createVNode(c.unref(xe),{name:"iksvg_daochu",onClick:c.withModifiers(E=>l(C),["stop"]),size:20,active:""},null,8,["onClick"]),c.createVNode(c.unref(xe),{name:"iksvg_yulan",size:20,active:""}),c.renderSlot(h.$slots,"operation",{data:{...C,findex:w}})],2)],12,On))),256)):(c.openBlock(),c.createBlock(v,{key:1},{default:c.withCtx(()=>[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(f.value,(C,w)=>{var E;return c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass(["iking-privew-annex",{"is-bg":a.showBg}]),key:w,style:c.normalizeStyle({marginBottom:w==((E=a.list)==null?void 0:E.length)-1?"0":"10px",width:u.value})},[c.createElementVNode("div",{class:"file-card",onClick:N=>o(C)},[c.createVNode(c.unref(xn),{file:C,style:c.normalizeStyle({height:`${a.iconSize}px`}),class:"ikui-w-auto",fields:e.value},null,8,["file","style","fields"]),c.createElementVNode("div",Fn,[c.createElementVNode("div",Mn,c.toDisplayString(C.name),1),c.createElementVNode("div",Bn,c.toDisplayString(c.unref(Dn)(C.size)),1)]),c.createElementVNode("div",{class:c.normalizeClass(["flex flex-center",{"hover-show":a.iconHoverShow}])},[c.createVNode(c.unref(xe),{name:"iksvg_daochu",onClick:c.withModifiers(N=>l(C),["stop"]),bg:a.showBg,size:a.showBg?"default":20,title:"下载"},null,8,["onClick","bg","size"]),c.createVNode(c.unref(xe),{name:"iksvg_yulan",bg:a.showBg,size:a.showBg?"default":20,title:"预览"},null,8,["bg","size"]),c.renderSlot(h.$slots,"operation",{data:{...C,findex:w}})],2)],8,Nn)],6)}),128))]),_:3}))],64)):c.createCommentVNode("v-if",!0),c.createVNode(c.unref(zn),{show:n.value,"onUpdate:show":g[0]||(g[0]=C=>n.value=C),loadUrl:c.unref(r),file:i.value,onlyofficeServer:((m=c.unref(t))==null?void 0:m.serverUrl)||a.onlyofficeServer,onlyOfficeConfig:c.unref(t),onlyOfficeAccept:((_=c.unref(t))==null?void 0:_.accept)||a.onlyOfficeAccept},null,8,["show","loadUrl","file","onlyofficeServer","onlyOfficeConfig","onlyOfficeAccept"])],64)}}}),tl="",Vn=ce(Hn),Un=c.defineComponent({__name:"IkPreviewFileDialog",props:c.mergeModels({file:{type:Object,default:()=>[]},loadUrl:{type:String,default:""},onlyOfficeAccept:{type:String,default:".pdf,.docx,.doc.ppt,.pptx,.xlsx,.xls,"},onlyofficeServer:{type:String,default:""},onlyOfficeConfig:{type:Object,default:()=>({})},field:{type:Object,default:()=>({})}},{show:{default:!1},showModifiers:{}}),emits:["update:show"],setup(a){const s=a,r=c.useModel(a,"show"),t=c.computed(()=>({name:"name",url:"url",suffix:"suffix",size:"fileSize",...s.field})),e=c.ref(null),i=c.ref(null),n=c.reactive({image:!1,office:!1,video:!1}),o=u=>{var f,h,g,v,p,m,_;try{const C=((f=u==null?void 0:u.response)==null?void 0:f.data)||u,w=C[t.value.url]||(C==null?void 0:C.id)||C.attachmentId,E=(h=C[t.value.suffix]||C.attachmentSuffix)==null?void 0:h.toLowerCase(),N=C[t.value.name]||(C==null?void 0:C.attachmentName)||(C==null?void 0:C.originName);if(i.value={...u,name:u[t.value.name],url:Se(s.loadUrl,w)},u&&lt(u,t.value)==="image"){n.image=!0;return}else if(u&&lt(u,t.value)==="video"){n.video=!0;return}else if((((g=s.onlyOfficeConfig)==null?void 0:g.accept)||s.onlyOfficeAccept).includes(E)){n.office=!0,e.value={...s.onlyOfficeConfig,editorConfig:{...((v=s.onlyOfficeConfig)==null?void 0:v.editorConfig)||{},customization:{...((m=(p=s.onlyOfficeConfig)==null?void 0:p.editorConfig)==null?void 0:m.customization)||{},review:{reviewDisplay:"final"}}},document:{key:Te.buildUUID(),title:N,url:Se(s.loadUrl,w),fileType:E,...((_=s.onlyOfficeConfig)==null?void 0:_.document)||{}},documentType:tn(E)};return}}catch(C){console.info("预览错误: ",C)}};c.watch([r,s.file],([u,f])=>{u&&c.nextTick(()=>{o(s.file)})});const l=()=>{r.value=!1,n.office=!1,n.image=!1,n.video=!1,i.value=null};return(u,f)=>{var g,v,p;const h=c.resolveComponent("el-image-viewer");return r.value?(c.openBlock(),c.createElementBlock(c.Fragment,{key:0},[(g=i.value)!=null&&g.url&&n.image?(c.openBlock(),c.createBlock(h,{key:0,onClose:f[0]||(f[0]=m=>l()),ref:"previewImgRef","url-list":[(v=i.value)==null?void 0:v.url],teleported:""},null,8,["url-list"])):c.createCommentVNode("v-if",!0),c.createCommentVNode(' <IkPreviewVideo :file="fileData" v-model:show="modal.video" />'),c.createCommentVNode(" 文档类 "),c.createVNode(c.unref(Ts),{modelValue:n.video,"onUpdate:modelValue":f[1]||(f[1]=m=>n.video=m),url:(p=i.value)==null?void 0:p.url},null,8,["modelValue","url"]),c.createVNode(c.unref(tr),{modelValue:n.office,"onUpdate:modelValue":f[2]||(f[2]=m=>n.office=m),draggable:"","no-footer":"","no-header":"",fullscreen:"","show-close-bg":"","destroy-on-close":"","close-on-click-modal":"","close-on-press-escape":!1,"append-to-body":"",onClose:l,"modal-class":"ik-only-preview-dialog"},{default:c.withCtx(()=>{var m;return[c.createVNode(c.unref(ur),{"config-options":e.value,"document-server-url":((m=a.onlyOfficeConfig)==null?void 0:m.serverUrl)||a.onlyofficeServer},null,8,["config-options","document-server-url"])]}),_:1},8,["modelValue"])],64)):c.createCommentVNode("v-if",!0)}}}),il="",zn=ce(Un),jn={key:0,class:"ik-svg-icon ik-icon-span inline-block inline-flex justify-center box-content line-height-[0]"},$n={key:1,class:"h-[1em] w-[1em]","aria-hidden":"true"},Wn=["xlink:href"],Gn=["src"],Kn={key:1,class:"h-[1em] w-[1em]","aria-hidden":"true"},Yn=["xlink:href"],Xn=["src"],qn=c.defineComponent({name:"IkSvgIcon",__name:"index",props:{active:{type:Boolean,default:!1},bg:{type:Boolean,default:!1},color:{},colorLight:{},disabled:{type:Boolean,default:!1},error:{type:Boolean},flip:{},name:{},notip:{type:Boolean,default:!1},opacity:{default:.5},padding:{default:"6px"},primary:{type:Boolean},rotate:{},showBg:{type:Boolean,default:!1},size:{default:""},success:{type:Boolean},tableIconType:{},title:{},type:{},warning:{type:Boolean},width:{}},setup(a){const s=a,r=c.computed(()=>s),t=c.computed(()=>{const{name:i}=r.value;return/^http?:\/\//.test(i)?"img":/i-[^:]+:[^:]+/.test(i)?"unocss":i!=null&&i.startsWith("iksig")?"iksig":i!=null&&i.includes(":")?"iconify":i!=null&&i.startsWith("iksvg")?"svg":"i"}),e=c.computed(()=>{const i=[];if(r.value.flip)switch(r.value.flip){case"horizontal":i.push("rotateY(180deg)");break;case"vertical":i.push("rotateX(180deg)");break;case"both":i.push("rotateX(180deg)"),i.push("rotateY(180deg)");break}r.value.rotate&&i.push(`rotate(${r.value.rotate%360}deg)`);const n={pointerEvents:r.value.disabled?"none":"auto",...r.value.color&&{color:r.value.color},...r.value.size&&{fontSize:typeof r.value.size=="number"?`${r.value.size}px`:r.value.size},...i.length&&{transform:i.join(" ")},padding:r.value.showBg||r.value.bg?r.value.padding:0,...r.value.color&&t.value!=="iksig"?{"--ik-color-icon-dark":r.value.color,"--ik-color-icon-light":r.value.colorLight||Te.ikColor.setOpacity(r.value.color,r.value.opacity)}:{}};return r.value.width&&(n.width=n.height=typeof r.value.width=="number"?`${r.value.width}px`:r.value.width),n});return(i,n)=>{const o=c.resolveComponent("el-tooltip"),l=c.resolveComponent("el-button");return r.value.tableIconType==="icon"||!r.value.tableIconType?(c.openBlock(),c.createElementBlock("span",jn,[r.value.notip||!r.value.title?(c.openBlock(),c.createElementBlock("i",{key:0,class:c.normalizeClass(["ik-svg-icon ik-icon relative h-[1em] w-[1em] inline-flex items-center justify-center fill-current leading-[1em] transition",{[i.name]:t.value==="unocss","show-bg":r.value.showBg||r.value.bg,default:r.value.size==="default",small:r.value.size==="small",big:r.value.size==="big",warning:r.value.warning||r.value.type==="warning",primary:r.value.primary||r.value.type==="primary",success:i.success||r.value.type==="success",error:r.value.error||r.value.type==="error",active:r.value.active,disabled:r.value.disabled}]),style:c.normalizeStyle(e.value)},[c.createCommentVNode(` <Icon v-if="outputType === 'iconify'" :icon="name" /> `),t.value==="iksig"?(c.openBlock(),c.createElementBlock("i",{key:0,class:c.normalizeClass(`iksig ${r.value.name}`),style:c.normalizeStyle(e.value)},null,6)):t.value==="svg"?(c.openBlock(),c.createElementBlock("svg",$n,[c.createElementVNode("use",{"xlink:href":`#${r.value.name}`},null,8,Wn)])):t.value==="img"?(c.openBlock(),c.createElementBlock("img",{key:2,src:r.value.name,class:"h-[1em] w-[1em]"},null,8,Gn)):(c.openBlock(),c.createElementBlock("i",{key:3,class:c.normalizeClass(r.value.name),style:c.normalizeStyle(e.value)},null,6))],6)):(c.openBlock(),c.createBlock(o,{key:1,content:r.value.title,placement:"top"},{default:c.withCtx(()=>[c.createElementVNode("i",{class:c.normalizeClass(["ik-svg-icon ik-icon relative h-[1em] w-[1em] inline-flex items-center justify-center fill-current leading-[1em] transition",{[i.name]:t.value==="unocss","show-bg":r.value.showBg||r.value.bg,default:r.value.size==="default",small:r.value.size==="small",big:r.value.size==="big",warning:r.value.warning||r.value.type==="warning",primary:i.primary||r.value.type==="primary",success:i.success||r.value.type==="success",error:r.value.error||r.value.type==="error",active:r.value.active}]),style:c.normalizeStyle(e.value)},[t.value==="iksig"?(c.openBlock(),c.createElementBlock("i",{key:0,class:c.normalizeClass(`iksig ${r.value.name}`),style:c.normalizeStyle(e.value)},null,6)):t.value==="svg"?(c.openBlock(),c.createElementBlock("svg",Kn,[c.createElementVNode("use",{"xlink:href":`#${r.value.name}`},null,8,Yn)])):t.value==="img"?(c.openBlock(),c.createElementBlock("img",{key:2,src:r.value.name,class:"h-[1em] w-[1em]"},null,8,Xn)):(c.openBlock(),c.createElementBlock("i",{key:3,class:c.normalizeClass(r.value.name),style:c.normalizeStyle(e.value)},null,6))],6)]),_:1},8,["content"]))])):(c.openBlock(),c.createBlock(l,{key:1,type:["warning","error"].includes(r.value.type)?"danger":""},{default:c.withCtx(()=>[c.createTextVNode(c.toDisplayString(r.value.title),1)]),_:1},8,["type"]))}}}),nl="",xe=ce(Me(qn,[["__scopeId","data-v-52806adf"]])),Jn=c.defineComponent({__name:"CloseIcon",props:{showBg:{type:Boolean,default:!1},fullscreen:{type:Boolean,default:!1}},setup(a){return(s,r)=>(c.openBlock(),c.createBlock(c.unref(xe),{error:"",name:"iksvg_guanbidanchuang",title:"关闭",size:20}))}}),ol="",Zn=Me(Jn,[["__scopeId","data-v-e27fb022"]]),Qn={class:"base-header"},er=c.defineComponent({__name:"IkBaseDialog",props:c.mergeModels({title:{default:""},cancelText:{default:"取消"},confirmText:{default:"确认"},noHeader:{type:Boolean},noFooter:{type:Boolean},showCloseBg:{type:Boolean,default:!1},fullscreen:{type:Boolean,default:!1}},{modelValue:{type:Boolean,default:!1,noHeader:!1,noFooter:!1},modelModifiers:{}}),emits:["update:modelValue"],setup(a){const s=a,r=c.useModel(a,"modelValue"),t=c.ref(s.fullscreen),e=()=>{t.value=!t.value},i=c.defineComponent({setup(){return()=>c.h(Zn,{showBg:s.showCloseBg,fullscreen:s.fullscreen})}});return(n,o)=>{const l=c.resolveComponent("el-dialog");return c.openBlock(),c.createBlock(l,c.mergeProps({modelValue:r.value,"onUpdate:modelValue":o[0]||(o[0]=u=>r.value=u)},n.$attrs,{"close-icon":c.unref(i),class:`ik-base-dialog ${n.noHeader?"no-header":""} ${n.noFooter?"no-footer":""}`,fullscreen:t.value,"modal-class":"baseDialog"}),c.createSlots({icon:c.withCtx(()=>[c.renderSlot(n.$slots,"title",{},()=>[c.createTextVNode(c.toDisplayString(n.title),1)])]),header:c.withCtx(()=>[c.createElementVNode("div",Qn,[c.renderSlot(n.$slots,"header",{},()=>[c.createTextVNode(c.toDisplayString(n.title),1)])]),n.$attrs.showClose?(c.openBlock(),c.createBlock(c.unref(xe),{key:0,onClick:e,name:t.value?"iksvg_tuichuquanping":"iksvg_quanping-daohang",class:"absolute! top-[18px] right-[50px] icon-dialog-full",title:t.value?"退出全屏":"全屏"},null,8,["name","title"])):c.createCommentVNode("v-if",!0)]),default:c.withCtx(()=>[c.renderSlot(n.$slots,"default")]),_:2},[n.$slots.footer?{name:"footer",fn:c.withCtx(()=>[c.renderSlot(n.$slots,"footer")]),key:"0"}:void 0]),1040,["modelValue","close-icon","class","fullscreen"])}}}),sl="",tr=ce(er),al="";var ir=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ct(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}function nr(a,s,r,t){function e(i){return i instanceof r?i:new r(function(n){n(i)})}return new(r||(r=Promise))(function(i,n){function o(f){try{u(t.next(f))}catch(h){n(h)}}function l(f){try{u(t.throw(f))}catch(h){n(h)}}function u(f){f.done?i(f.value):e(f.value).then(o,l)}u((t=t.apply(a,s||[])).next())})}function rr(a,s){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},t,e,i,n;return n={next:o(0),throw:o(1),return:o(2)},typeof Symbol=="function"&&(n[Symbol.iterator]=function(){return this}),n;function o(u){return function(f){return l([u,f])}}function l(u){if(t)throw new TypeError("Generator is already executing.");for(;n&&(n=0,u[0]&&(r=0)),r;)try{if(t=1,e&&(i=u[0]&2?e.return:u[0]?e.throw||((i=e.return)&&i.call(e),0):e.next)&&!(i=i.call(e,u[1])).done)return i;switch(e=0,i&&(u=[u[0]&2,i.value]),u[0]){case 0:case 1:i=u;break;case 4:return r.label++,{value:u[1],done:!1};case 5:r.label++,e=u[1],u=[0];continue;case 7:u=r.ops.pop(),r.trys.pop();continue;default:if(i=r.trys,!(i=i.length>0&&i[i.length-1])&&(u[0]===6||u[0]===2)){r=0;continue}if(u[0]===3&&(!i||u[1]>i[0]&&u[1]<i[3])){r.label=u[1];break}if(u[0]===6&&r.label<i[1]){r.label=i[1],i=u;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(u);break}i[2]&&r.ops.pop(),r.trys.pop();continue}u=s.call(a,r)}catch(f){u=[6,f],e=0}finally{t=i=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}typeof SuppressedError=="function"&&SuppressedError;var or=function(a,s){return nr(void 0,void 0,void 0,function(){return rr(this,function(r){return[2,new Promise(function(t,e){try{if(window.DocsAPI)return t(null);var i=document.getElementById(s);if(i)var n=setInterval(function(){var l=i.getAttribute("loading");if(!l){if(clearInterval(n),window.DocsAPI)return t(null);var u=Gt(s,a,t,e);i.remove(),document.body.appendChild(u)}},500);else{var o=Gt(s,a,t,e);document.body.appendChild(o)}}catch(l){console.error(l)}})]})})},Gt=function(a,s,r,t){var e=document.createElement("script");return e.id=a,e.type="text/javascript",e.src=s,e.async=!0,e.onload=function(){e.removeAttribute("loading"),r(null)},e.onerror=function(i){e.removeAttribute("loading"),t(i)},e.setAttribute("loading",""),e},ft=c.defineComponent({name:"DocumentEditor",props:{id:{type:String,required:!0},documentServerUrl:{type:String,required:!0},config:{type:Object,required:!0},document_fileType:String,document_title:String,documentType:String,editorConfig_lang:String,height:String,type:String,width:String,onLoadComponentError:Function,events_onAppReady:Function,events_onDocumentStateChange:Function,events_onMetaChange:Function,events_onDocumentReady:Function,events_onInfo:Function,events_onWarning:Function,events_onError:Function,events_onRequestSharingSettings:Function,events_onRequestRename:Function,events_onMakeActionLink:Function,events_onRequestInsertImage:Function,events_onRequestSaveAs:Function,events_onRequestMailMergeRecipients:Function,events_onRequestCompareFile:Function,events_onRequestEditRights:Function,events_onRequestHistory:Function,events_onRequestHistoryClose:Function,events_onRequestHistoryData:Function,events_onRequestRestore:Function,events_onRequestSelectSpreadsheet:Function,events_onRequestSelectDocument:Function},mounted:function(){var a=this,s=this.documentServerUrl;s.endsWith("/")||(s+="/");var r="".concat(s,"web-apps/apps/api/documents/api.js");or(r,"onlyoffice-api-script").then(function(){return a.onLoad()}).catch(function(){a.onError(-2)})},unmounted:function(){var a,s=this.id||"";!((a=window==null?void 0:window.DocEditor)===null||a===void 0)&&a.instances[s]&&(window.DocEditor.instances[s].destroyEditor(),window.DocEditor.instances[s]=void 0)},watch:{config:{handler:function(a,s){this.onChangeProps()},deep:!0},document_fileType:function(a,s){this.onChangeProps()},document_title:function(a,s){this.onChangeProps()},documentType:function(a,s){this.onChangeProps()},editorConfig_lang:function(a,s){this.onChangeProps()},height:function(a,s){this.onChangeProps()},type:function(a,s){this.onChangeProps()},width:function(a,s){this.onChangeProps()}},methods:{onLoad:function(){var a,s;try{var r=this.id||"";if(window.DocsAPI||this.onError(-3),!((a=window==null?void 0:window.DocEditor)===null||a===void 0)&&a.instances[r]){console.log("Skip loading. Instance already exists",r);return}!((s=window==null?void 0:window.DocEditor)===null||s===void 0)&&s.instances||(window.DocEditor={instances:{}});var t=Object.assign({document:{fileType:this.document_fileType,title:this.document_title},documentType:this.documentType,editorConfig:{lang:this.editorConfig_lang},events:{onAppReady:this.onAppReady,onDocumentStateChange:this.events_onDocumentStateChange,onMetaChange:this.events_onMetaChange,onDocumentReady:this.events_onDocumentReady,onInfo:this.events_onInfo,onWarning:this.events_onWarning,onError:this.events_onError,onRequestSharingSettings:this.events_onRequestSharingSettings,onRequestRename:this.events_onRequestRename,onMakeActionLink:this.events_onMakeActionLink,onRequestInsertImage:this.events_onRequestInsertImage,onRequestSaveAs:this.events_onRequestSaveAs,onRequestMailMergeRecipients:this.events_onRequestMailMergeRecipients,onRequestCompareFile:this.events_onRequestCompareFile,onRequestEditRights:this.events_onRequestEditRights,onRequestHistory:this.events_onRequestHistory,onRequestHistoryClose:this.events_onRequestHistoryClose,onRequestHistoryData:this.events_onRequestHistoryData,onRequestRestore:this.events_onRequestRestore,onRequestSelectSpreadsheet:this.events_onRequestSelectSpreadsheet,onRequestSelectDocument:this.events_onRequestSelectDocument},height:this.height,type:this.type,width:this.width},this.config||{}),e=window.DocsAPI.DocEditor(r,t);window.DocEditor.instances[r]=e}catch(i){console.error(i),this.onError(-1)}},onError:function(a){var s;switch(a){case-2:s="Error load DocsAPI from "+this.documentServerUrl;break;case-3:s="DocsAPI is not defined";break;default:s="Unknown error loading component",a=-1}typeof this.onLoadComponentError>"u"?console.error(s):this.onLoadComponentError(a,s)},onAppReady:function(){var a=this.id||"";this.events_onAppReady(window.DocEditor.instances[a])},onChangeProps:function(){var a,s=this.id||"";!((a=window==null?void 0:window.DocEditor)===null||a===void 0)&&a.instances[s]&&(window.DocEditor.instances[s].destroyEditor(),window.DocEditor.instances[s]=void 0,console.log("Important props have been changed. Load new Editor."),this.onLoad())}}});const sr=["id"];function ar(a,s,r,t,e,i){return c.openBlock(),c.createElementBlock("div",{id:a.id},null,8,sr)}ft.render=ar,ft.__file="src/components/DocumentEditor.vue";const lr=c.defineComponent({__name:"IkOnlyOffice",props:{documentServerUrl:{type:String,default:""},configOptions:{type:Object,default:()=>{}},officeHeight:{type:String,default:"100%"}},setup(a){const s=a,r=c.ref({width:"100%",height:"100%",...s.configOptions||{},...s.configOptions}),t=()=>{console.info("文档加载完成",s.configOptions)};return(e,i)=>(c.openBlock(),c.createElementBlock("div",{style:c.normalizeStyle({height:s.officeHeight})},[c.createVNode(c.unref(ft),{id:`${new Date().getTime()}`,ref:"editorRef","document-server-url":a.documentServerUrl,config:r.value,events_onDocumentReady:t},null,8,["id","document-server-url","config"])],4))}}),ll="",ur=ce(Me(lr,[["__scopeId","data-v-98d51ef9"]]));function Kt(a,s){var r=Object.keys(a);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(a);s&&(t=t.filter(function(e){return Object.getOwnPropertyDescriptor(a,e).enumerable})),r.push.apply(r,t)}return r}function U(a){for(var s=1;s<arguments.length;s++){var r=arguments[s]!=null?arguments[s]:{};s%2?Kt(Object(r),!0).forEach(function(t){k(a,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(r)):Kt(Object(r)).forEach(function(t){Object.defineProperty(a,t,Object.getOwnPropertyDescriptor(r,t))})}return a}function G(a){"@babel/helpers - typeof";return G=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(s){return typeof s}:function(s){return s&&typeof Symbol=="function"&&s.constructor===Symbol&&s!==Symbol.prototype?"symbol":typeof s},G(a)}function T(a,s){if(!(a instanceof s))throw new TypeError("Cannot call a class as a function")}function Yt(a,s){for(var r=0;r<s.length;r++){var t=s[r];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(a,Xt(t.key),t)}}function S(a,s,r){return s&&Yt(a.prototype,s),r&&Yt(a,r),Object.defineProperty(a,"prototype",{writable:!1}),a}function k(a,s,r){return s=Xt(s),s in a?Object.defineProperty(a,s,{value:r,enumerable:!0,configurable:!0,writable:!0}):a[s]=r,a}function I(a,s){if(typeof s!="function"&&s!==null)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(s&&s.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),Object.defineProperty(a,"prototype",{writable:!1}),s&&ht(a,s)}function A(a){return A=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},A(a)}function ht(a,s){return ht=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ht(a,s)}function cr(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function y(a){if(a===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a}function dt(a,s){if(s&&(typeof s=="object"||typeof s=="function"))return s;if(s!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return y(a)}function P(a){var s=cr();return function(){var t=A(a),e;if(s){var i=A(this).constructor;e=Reflect.construct(t,arguments,i)}else e=t.apply(this,arguments);return dt(this,e)}}function fr(a,s){for(;!Object.prototype.hasOwnProperty.call(a,s)&&(a=A(a),a!==null););return a}function L(){return typeof Reflect<"u"&&Reflect.get?L=Reflect.get.bind():L=function(s,r,t){var e=fr(s,r);if(e){var i=Object.getOwnPropertyDescriptor(e,r);return i.get?i.get.call(arguments.length<3?s:t):i.value}},L.apply(this,arguments)}function Q(a){return hr(a)||dr(a)||pr(a)||gr()}function hr(a){if(Array.isArray(a))return pt(a)}function dr(a){if(typeof Symbol<"u"&&a[Symbol.iterator]!=null||a["@@iterator"]!=null)return Array.from(a)}function pr(a,s){if(a){if(typeof a=="string")return pt(a,s);var r=Object.prototype.toString.call(a).slice(8,-1);if(r==="Object"&&a.constructor&&(r=a.constructor.name),r==="Map"||r==="Set")return Array.from(a);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return pt(a,s)}}function pt(a,s){(s==null||s>a.length)&&(s=a.length);for(var r=0,t=new Array(s);r<s;r++)t[r]=a[r];return t}function gr(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
2
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function vr(a,s){if(typeof a!="object"||a===null)return a;var r=a[Symbol.toPrimitive];if(r!==void 0){var t=r.call(a,s||"default");if(typeof t!="object")return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return(s==="string"?String:Number)(a)}function Xt(a){var s=vr(a,"string");return typeof s=="symbol"?s:String(s)}var qt={exports:{}};(function(a){var s=Object.prototype.hasOwnProperty,r="~";function t(){}Object.create&&(t.prototype=Object.create(null),new t().__proto__||(r=!1));function e(l,u,f){this.fn=l,this.context=u,this.once=f||!1}function i(l,u,f,h,g){if(typeof f!="function")throw new TypeError("The listener must be a function");var v=new e(f,h||l,g),p=r?r+u:u;return l._events[p]?l._events[p].fn?l._events[p]=[l._events[p],v]:l._events[p].push(v):(l._events[p]=v,l._eventsCount++),l}function n(l,u){--l._eventsCount===0?l._events=new t:delete l._events[u]}function o(){this._events=new t,this._eventsCount=0}o.prototype.eventNames=function(){var u=[],f,h;if(this._eventsCount===0)return u;for(h in f=this._events)s.call(f,h)&&u.push(r?h.slice(1):h);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(f)):u},o.prototype.listeners=function(u){var f=r?r+u:u,h=this._events[f];if(!h)return[];if(h.fn)return[h.fn];for(var g=0,v=h.length,p=new Array(v);g<v;g++)p[g]=h[g].fn;return p},o.prototype.listenerCount=function(u){var f=r?r+u:u,h=this._events[f];return h?h.fn?1:h.length:0},o.prototype.emit=function(u,f,h,g,v,p){var m=r?r+u:u;if(!this._events[m])return!1;var _=this._events[m],C=arguments.length,w,E;if(_.fn){switch(_.once&&this.removeListener(u,_.fn,void 0,!0),C){case 1:return _.fn.call(_.context),!0;case 2:return _.fn.call(_.context,f),!0;case 3:return _.fn.call(_.context,f,h),!0;case 4:return _.fn.call(_.context,f,h,g),!0;case 5:return _.fn.call(_.context,f,h,g,v),!0;case 6:return _.fn.call(_.context,f,h,g,v,p),!0}for(E=1,w=new Array(C-1);E<C;E++)w[E-1]=arguments[E];_.fn.apply(_.context,w)}else{var N=_.length,R;for(E=0;E<N;E++)switch(_[E].once&&this.removeListener(u,_[E].fn,void 0,!0),C){case 1:_[E].fn.call(_[E].context);break;case 2:_[E].fn.call(_[E].context,f);break;case 3:_[E].fn.call(_[E].context,f,h);break;case 4:_[E].fn.call(_[E].context,f,h,g);break;default:if(!w)for(R=1,w=new Array(C-1);R<C;R++)w[R-1]=arguments[R];_[E].fn.apply(_[E].context,w)}}return!0},o.prototype.on=function(u,f,h){return i(this,u,f,h,!1)},o.prototype.once=function(u,f,h){return i(this,u,f,h,!0)},o.prototype.removeListener=function(u,f,h,g){var v=r?r+u:u;if(!this._events[v])return this;if(!f)return n(this,v),this;var p=this._events[v];if(p.fn)p.fn===f&&(!g||p.once)&&(!h||p.context===h)&&n(this,v);else{for(var m=0,_=[],C=p.length;m<C;m++)(p[m].fn!==f||g&&!p[m].once||h&&p[m].context!==h)&&_.push(p[m]);_.length?this._events[v]=_.length===1?_[0]:_:n(this,v)}return this},o.prototype.removeAllListeners=function(u){var f;return u?(f=r?r+u:u,this._events[f]&&n(this,f)):(this._events=new t,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=r,o.EventEmitter=o,a.exports=o})(qt);var Jt=qt.exports;const Zt=ct(Jt);var mr=typeof window<"u"&&window.location&&window.location.href.indexOf("xgplayerdebugger=1")>-1,gt={info:"color: #525252; background-color: #90ee90;",error:"color: #525252; background-color: red;",warn:"color: #525252; background-color: yellow; "},vt="%c[xgplayer]",F={config:{debug:mr?3:0},logInfo:function(s){for(var r,t=arguments.length,e=new Array(t>1?t-1:0),i=1;i<t;i++)e[i-1]=arguments[i];this.config.debug>=3&&(r=console).log.apply(r,[vt,gt.info,s].concat(e))},logWarn:function(s){for(var r,t=arguments.length,e=new Array(t>1?t-1:0),i=1;i<t;i++)e[i-1]=arguments[i];this.config.debug>=1&&(r=console).warn.apply(r,[vt,gt.warn,s].concat(e))},logError:function(s){var r;if(!(this.config.debug<1)){for(var t=this.config.debug>=2?"trace":"error",e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];(r=console)[t].apply(r,[vt,gt.error,s].concat(i))}}};function yr(a){a.logInfo=F.logInfo.bind(a),a.logWarn=F.logWarn.bind(a),a.logError=F.logError.bind(a)}var _r=function(){function a(s){T(this,a),this.bufferedList=s}return S(a,[{key:"start",value:function(r){return this.bufferedList[r].start}},{key:"end",value:function(r){return this.bufferedList[r].end}},{key:"length",get:function(){return this.bufferedList.length}}]),a}(),d={};d.createDom=function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"div",s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},t=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"",e=document.createElement(a);return e.className=t,e.innerHTML=s,Object.keys(r).forEach(function(i){var n=i,o=r[i];a==="video"||a==="audio"||a==="live-video"?o&&e.setAttribute(n,o):e.setAttribute(n,o)}),e},d.createDomFromHtml=function(a){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"";try{var t=document.createElement("div");t.innerHTML=a;var e=t.children;return t=null,e.length>0?(e=e[0],r&&d.addClass(e,r),s&&Object.keys(s).forEach(function(i){e.setAttribute(i,s[i])}),e):null}catch(i){return F.logError("util.createDomFromHtml",i),null}},d.hasClass=function(a,s){if(!a||!s)return!1;try{return Array.prototype.some.call(a.classList,function(t){return t===s})}catch{var r=a.className&&G(a.className)==="object"?a.getAttribute("class"):a.className;return r&&!!r.match(new RegExp("(\\s|^)"+s+"(\\s|$)"))}},d.addClass=function(a,s){if(!(!a||!s))try{s.replace(/(^\s+|\s+$)/g,"").split(/\s+/g).forEach(function(r){r&&a.classList.add(r)})}catch{d.hasClass(a,s)||(a.className&&G(a.className)==="object"?a.setAttribute("class",a.getAttribute("class")+" "+s):a.className+=" "+s)}},d.removeClass=function(a,s){if(!(!a||!s))try{s.replace(/(^\s+|\s+$)/g,"").split(/\s+/g).forEach(function(r){r&&a.classList.remove(r)})}catch{d.hasClass(a,s)&&s.split(/\s+/g).forEach(function(t){var e=new RegExp("(\\s|^)"+t+"(\\s|$)");a.className&&G(a.className)==="object"?a.setAttribute("class",a.getAttribute("class").replace(e," ")):a.className=a.className.replace(e," ")})}},d.toggleClass=function(a,s){a&&s.split(/\s+/g).forEach(function(r){d.hasClass(a,r)?d.removeClass(a,r):d.addClass(a,r)})},d.classNames=function(){for(var a=arguments,s=[],r=function(i){d.typeOf(a[i])==="String"?s.push(a[i]):d.typeOf(a[i])==="Object"&&Object.keys(a[i]).map(function(n){a[i][n]&&s.push(n)})},t=0;t<arguments.length;t++)r(t);return s.join(" ")},d.findDom=function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:document,s=arguments.length>1?arguments[1]:void 0,r;try{r=a.querySelector(s)}catch(t){F.logError("util.findDom",t),s.indexOf("#")===0&&(r=a.getElementById(s.slice(1)))}return r},d.getCss=function(a,s){return a.currentStyle?a.currentStyle[s]:document.defaultView.getComputedStyle(a,!1)[s]},d.padStart=function(a,s,r){for(var t=String(r),e=s>>0,i=Math.ceil(e/t.length),n=[],o=String(a);i--;)n.push(t);return n.join("").substring(0,e-o.length)+o},d.format=function(a){if(window.isNaN(a))return"";a=Math.round(a);var s=d.padStart(Math.floor(a/3600),2,0),r=d.padStart(Math.floor((a-s*3600)/60),2,0),t=d.padStart(Math.floor(a-s*3600-r*60),2,0);return(s==="00"?[r,t]:[s,r,t]).join(":")},d.event=function(a){if(a.touches){var s=a.touches[0]||a.changedTouches[0];a.clientX=s.clientX||0,a.clientY=s.clientY||0,a.offsetX=s.pageX-s.target.offsetLeft,a.offsetY=s.pageY-s.target.offsetTop}a._target=a.target||a.srcElement},d.typeOf=function(a){return Object.prototype.toString.call(a).match(/([^\s.*]+)(?=]$)/g)[0]},d.deepCopy=function(a,s){if(d.typeOf(s)==="Object"&&d.typeOf(a)==="Object")return Object.keys(s).forEach(function(r){d.typeOf(s[r])==="Object"&&!(s[r]instanceof Node)?a[r]===void 0||a[r]===void 0?a[r]=s[r]:d.deepCopy(a[r],s[r]):d.typeOf(s[r])==="Array"?a[r]=d.typeOf(a[r])==="Array"?a[r].concat(s[r]):s[r]:a[r]=s[r]}),a},d.deepMerge=function(a,s){return Object.keys(s).map(function(r){if(d.typeOf(s[r])==="Array"&&d.typeOf(a[r])==="Array"){if(d.typeOf(a[r])==="Array"){var t;(t=a[r]).push.apply(t,Q(s[r]))}}else d.typeOf(a[r])===d.typeOf(s[r])&&a[r]!==null&&d.typeOf(a[r])==="Object"&&!(s[r]instanceof window.Node)?d.deepMerge(a[r],s[r]):s[r]!==null&&(a[r]=s[r])}),a},d.getBgImage=function(a){var s=(a.currentStyle||window.getComputedStyle(a,null)).backgroundImage;if(!s||s==="none")return"";var r=document.createElement("a");return r.href=s.replace(/url\("|"\)/g,""),r.href},d.copyDom=function(a){if(a&&a.nodeType===1){var s=document.createElement(a.tagName);return Array.prototype.forEach.call(a.attributes,function(r){s.setAttribute(r.name,r.value)}),a.innerHTML&&(s.innerHTML=a.innerHTML),s}else return""},d.setInterval=function(a,s,r,t){a._interval[s]||(a._interval[s]=window.setInterval(r.bind(a),t))},d.clearInterval=function(a,s){clearInterval(a._interval[s]),a._interval[s]=null},d.setTimeout=function(a,s,r){a._timers||(a._timers=[]);var t=setTimeout(function(){s(),d.clearTimeout(a,t)},r);return a._timers.push(t),t},d.clearTimeout=function(a,s){var r=a._timers;if(d.typeOf(r)==="Array"){for(var t=0;t<r.length;t++)if(r[t]===s){r.splice(t,1),clearTimeout(s);break}}else clearTimeout(s)},d.clearAllTimers=function(a){var s=a._timers;d.typeOf(s)==="Array"&&(s.map(function(r){clearTimeout(r)}),a._timerIds=[])},d.createImgBtn=function(a,s,r,t){var e=d.createDom("xg-".concat(a),"",{},"xgplayer-".concat(a,"-img"));if(e.style.backgroundImage='url("'.concat(s,'")'),r&&t){var i,n,o;["px","rem","em","pt","dp","vw","vh","vm","%"].every(function(l){return r.indexOf(l)>-1&&t.indexOf(l)>-1?(i=parseFloat(r.slice(0,r.indexOf(l)).trim()),n=parseFloat(t.slice(0,t.indexOf(l)).trim()),o=l,!1):!0}),e.style.width="".concat(i).concat(o),e.style.height="".concat(n).concat(o),e.style.backgroundSize="".concat(i).concat(o," ").concat(n).concat(o),a==="start"?e.style.margin="-".concat(n/2).concat(o," auto auto -").concat(i/2).concat(o):e.style.margin="auto 5px auto 5px"}return e},d.Hex2RGBA=function(a,s){var r=[];if(/^\#[0-9A-F]{3}$/i.test(a)){var t="#";a.replace(/[0-9A-F]/ig,function(e){t+=e+e}),a=t}return/^#[0-9A-F]{6}$/i.test(a)?(a.replace(/[0-9A-F]{2}/ig,function(e){r.push(parseInt(e,16))}),"rgba(".concat(r.join(","),", ").concat(s,")")):"rgba(255, 255, 255, 0.1)"},d.getFullScreenEl=function(){return document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement},d.checkIsFunction=function(a){return a&&typeof a=="function"},d.checkIsObject=function(a){return a!==null&&G(a)==="object"},d.hide=function(a){a.style.display="none"},d.show=function(a,s){a.style.display=s||"block"},d.isUndefined=function(a){if(typeof a>"u"||a===null)return!0},d.isNotNull=function(a){return a!=null},d.setStyleFromCsstext=function(a,s){if(s)if(d.typeOf(s)==="String"){var r=s.replace(/\s+/g,"").split(";");r.map(function(t){if(t){var e=t.split(":");e.length>1&&(a.style[e[0]]=e[1])}})}else Object.keys(s).map(function(t){a.style[t]=s[t]})};function kr(a,s){for(var r=0,t=s.length;r<t;r++)if(a.indexOf(s[r])>-1)return!0;return!1}d.filterStyleFromText=function(a){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:["width","height","top","left","bottom","right","position","z-index","padding","margin","transform"],r=a.style.cssText;if(!r)return{};var t=r.replace(/\s+/g,"").split(";"),e={},i={};return t.map(function(n){if(n){var o=n.split(":");o.length>1&&(kr(o[0],s)?e[o[0]]=o[1]:i[o[0]]=o[1])}}),a.setAttribute("style",""),Object.keys(i).map(function(n){a.style[n]=i[n]}),e},d.getStyleFromCsstext=function(a){var s=a.style.cssText;if(!s)return{};var r=s.replace(/\s+/g,"").split(";"),t={};return r.map(function(e){if(e){var i=e.split(":");i.length>1&&(t[i[0]]=i[1])}}),t},d.preloadImg=function(a){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:function(){},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(){};if(a){var t=new window.Image;t.onload=function(e){t=null,s&&s(e)},t.onerror=function(e){t=null,r&&r(e)},t.src=a}},d.stopPropagation=function(a){a&&a.stopPropagation()},d.scrollTop=function(){return window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0},d.scrollLeft=function(){return window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0},d.checkTouchSupport=function(){return"ontouchstart"in window},d.getBuffered2=function(a){for(var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:.5,r=[],t=0;t<a.length;t++)r.push({start:a.start(t)<.5?0:a.start(t),end:a.end(t)});r.sort(function(l,u){var f=l.start-u.start;return f||u.end-l.end});var e=[];if(s)for(var i=0;i<r.length;i++){var n=e.length;if(n){var o=e[n-1].end;r[i].start-o<s?r[i].end>o&&(e[n-1].end=r[i].end):e.push(r[i])}else e.push(r[i])}else e=r;return new _r(e)},d.getEventPos=function(a){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;return a.touches&&a.touches.length>0&&(a=a.touches[0]),{x:a.x/s,y:a.y/s,clientX:a.clientX/s,clientY:a.clientY/s,offsetX:a.offsetX/s,offsetY:a.offsetY/s,pageX:a.pageX/s,pageY:a.pageY/s}},d.requestAnimationFrame=function(a){var s=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame;if(s)return s(a)},d.getHostFromUrl=function(a){if(d.typeOf(a)!=="String")return"";var s=a.split("/"),r="";return s.length>3&&s[2]&&(r=s[2]),r},d.cancelAnimationFrame=function(a){var s=window.cancelAnimationFrame||window.mozCancelAnimationFrame||window.cancelRequestAnimationFrame;s&&s(a)},d.isMSE=function(a){return a.media&&(a=a.media),!a||!(a instanceof HTMLMediaElement)?!1:/^blob/.test(a.currentSrc)||/^blob/.test(a.src)},d.isBlob=function(a){return typeof a=="string"&&/^blob/.test(a)},d.generateSessionId=function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,s=new Date().getTime();try{a=parseInt(a)}catch{a=0}s+=a,window.performance&&typeof window.performance.now=="function"&&(s+=parseInt(window.performance.now()));var r="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var e=(s+Math.random()*16)%16|0;return s=Math.floor(s/16),(t==="x"?e:e&3|8).toString(16)});return r},d.createEvent=function(a){var s;return typeof window.Event=="function"?s=new Event(a):(s=document.createEvent("Event"),s.initEvent(a,!0,!0)),s},d.adjustTimeByDuration=function(a,s,r){return!s||!a?a:a>s||r&&a<s?s:a},d.createPositionBar=function(a,s){var r=d.createDom("xg-bar","",{"data-index":-1},a);return s.appendChild(r),r},d.getTransformStyle=function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{x:0,y:0,scale:1,rotate:0},s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",r={scale:"".concat(a.scale||1),translate:"".concat(a.x||0,"%, ").concat(a.y||0,"%"),rotate:"".concat(a.rotate||0,"deg")},t=Object.keys(r);return t.forEach(function(e){var i=new RegExp("".concat(e,"\\([^\\(]+\\)"),"g"),n="".concat(e,"(").concat(r[e],")");i.test(s)?(i.lastIndex=-1,s=s.replace(i,n)):s+="".concat(n," ")}),s},d.convertDeg=function(a){return Math.abs(a)<=1?a*360:a%360},d.getIndexByTime=function(a,s){var r=s.length,t=-1;if(r<1)return t;if(a<=s[0].end||r<2)t=0;else if(a>s[r-1].end)t=r-1;else for(var e=1;e<r;e++)if(a>s[e-1].end&&a<=s[e].end){t=e;break}return t},d.getOffsetCurrentTime=function(a,s){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:-1,t=-1;if(r>=0&&r<s.length?t=r:t=d.getIndexByTime(a,s),t<0)return-1;var e=s.length,i=s[t],n=i.start,o=i.end,l=i.cTime,u=i.offset;return a<n?l:a>=n&&a<=o?a-u:a>o&&t>=e-1?o:-1},d.getCurrentTimeByOffset=function(a,s){var r=-1;if(!s||s.length<0)return a;for(var t=0;t<s.length;t++)if(a<=s[t].duration){r=t;break}if(r!==-1){var e=s[r].start;return r-1<0?e+a:e+(a-s[r-1].duration)}return a};function Qt(a){var s=G(a);return a!==null&&(s==="object"||s==="function")}function Cr(a,s,r){var t,e,i,n,o,l,u=0,f=!1,h=!1,g=!0,v=!s&&s!==0&&typeof window.requestAnimationFrame=="function";if(typeof a!="function")throw new TypeError("Expected a function");s=+s||0,Qt(r)&&(f=!!r.leading,h="maxWait"in r,i=h?Math.max(+r.maxWait||0,s):i,g="trailing"in r?!!r.trailing:g);function p(x){var $=t,Z=e;return t=e=void 0,u=x,n=a.apply(Z,$),n}function m(x,$){return v?(window.cancelAnimationFrame(o),window.requestAnimationFrame(x)):setTimeout(x,$)}function _(x){if(v)return window.cancelAnimationFrame(x);clearTimeout(x)}function C(x){return u=x,o=m(N,s),f?p(x):n}function w(x){var $=x-l,Z=x-u,te=s-$;return h?Math.min(te,i-Z):te}function E(x){var $=x-l,Z=x-u;return l===void 0||$>=s||$<0||h&&Z>=i}function N(){var x=Date.now();if(E(x))return R(x);o=m(N,w(x))}function R(x){return o=void 0,g&&t?p(x):(t=e=void 0,n)}function H(){o!==void 0&&_(o),u=0,t=l=e=o=void 0}function D(){return o===void 0?n:R(Date.now())}function j(){return o!==void 0}function z(){for(var x=Date.now(),$=E(x),Z=arguments.length,te=new Array(Z),we=0;we<Z;we++)te[we]=arguments[we];if(t=te,e=this,l=x,$){if(o===void 0)return C(l);if(h)return o=m(N,s),p(l)}return o===void 0&&(o=m(N,s)),n}return z.cancel=H,z.flush=D,z.pending=j,z}function Er(a,s,r){var t=!0,e=!0;if(typeof a!="function")throw new TypeError("Expected a function");return Qt(r)&&(t="leading"in r?!!r.leading:t,e="trailing"in r?!!r.trailing:e),Cr(a,s,{leading:t,trailing:e,maxWait:s})}function br(){var a=(document.documentElement.getAttribute("lang")||navigator.language||"zh-cn").toLocaleLowerCase();return a==="zh-cn"&&(a="zh"),a}function wr(a,s,r){if(a){var t=a.getAttribute(r);return!!(t&&t===s&&(a.tagName==="VIDEO"||a.tagName==="AUDIO"))}}var ei={android:/(Android)\s([\d.]+)/,ios:/(Version)\/([\d.]+)/},Tr=["avc1.42E01E, mp4a.40.2","avc1.58A01E, mp4a.40.2","avc1.4D401E, mp4a.40.2","avc1.64001E, mp4a.40.2","avc1.42E01E","mp4v.20.8","avc1.42E01E, mp4a.40.2","avc1.58A01E, mp4a.40.2","avc1.4D401E, mp4a.40.2","avc1.64001E, mp4a.40.2","mp4v.20.8, mp4a.40.2","mp4v.20.240, mp4a.40.2"],O={get device(){var a=O.os;return a.isPc?"pc":"mobile"},get browser(){if(typeof navigator>"u")return"";var a=navigator.userAgent.toLowerCase(),s={ie:/rv:([\d.]+)\) like gecko/,firefox:/firefox\/([\d.]+)/,chrome:/chrome\/([\d.]+)/,opera:/opera.([\d.]+)/,safari:/version\/([\d.]+).*safari/};return[].concat(Object.keys(s).filter(function(r){return s[r].test(a)}))[0]},get os(){if(typeof navigator>"u")return{};var a=navigator.userAgent,s=/(?:Windows Phone)/.test(a),r=/(?:SymbianOS)/.test(a)||s,t=/(?:Android)/.test(a),e=/(?:Firefox)/.test(a),i=/(?:iPad|PlayBook)/.test(a)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1,n=i||t&&!/(?:Mobile)/.test(a)||e&&/(?:Tablet)/.test(a),o=/(?:iPhone)/.test(a)&&!n,l=!o&&!t&&!r&&!n;return{isTablet:n,isPhone:o,isIpad:i,isIos:o||i,isAndroid:t,isPc:l,isSymbian:r,isWindowsPhone:s,isFireFox:e}},get osVersion(){if(typeof navigator>"u")return 0;var a=navigator.userAgent,s="";/(?:iPhone)|(?:iPad|PlayBook)/.test(a)?s=ei.ios:s=ei.android;var r=s?s.exec(a):[];if(r&&r.length>=3){var t=r[2].split(".");return t.length>0?parseInt(t[0]):0}return 0},get isWeixin(){if(typeof navigator>"u")return!1;var a=/(micromessenger)\/([\d.]+)/,s=a.exec(navigator.userAgent.toLocaleLowerCase());return!!s},isSupportMP4:function(){var s={isSupport:!1,mime:""};if(typeof document>"u")return s;if(this.supportResult)return this.supportResult;var r=document.createElement("video");return typeof r.canPlayType=="function"&&Tr.map(function(t){r.canPlayType('video/mp4; codecs="'.concat(t,'"'))==="probably"&&(s.isSupport=!0,s.mime+="||".concat(t))}),this.supportResult=s,r=null,s},isMSESupport:function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:'video/mp4; codecs="avc1.42E01E,mp4a.40.2"';if(typeof MediaSource>"u"||!MediaSource)return!1;try{return MediaSource.isTypeSupported(s)}catch(r){return this._logger.error(s,r),!1}},isHevcSupported:function(){return typeof MediaSource>"u"||!MediaSource.isTypeSupported?!1:MediaSource.isTypeSupported('video/mp4;codecs="hev1.1.6.L120.90"')||MediaSource.isTypeSupported('video/mp4;codecs="hev1.2.4.L120.90"')||MediaSource.isTypeSupported('video/mp4;codecs="hev1.3.E.L120.90"')||MediaSource.isTypeSupported('video/mp4;codecs="hev1.4.10.L120.90"')},probeConfigSupported:function(s){var r={supported:!1,smooth:!1,powerEfficient:!1};if(!s||typeof navigator>"u")return Promise.resolve(r);if(navigator.mediaCapabilities&&navigator.mediaCapabilities.decodingInfo)return navigator.mediaCapabilities.decodingInfo(s);var t=s.video||{},e=s.audio||{};try{var i=MediaSource.isTypeSupported(t.contentType),n=MediaSource.isTypeSupported(e.contentType);return Promise.resolve({supported:i&&n,smooth:!1,powerEfficient:!1})}catch{return Promise.resolve(r)}}},mt="3.0.18",ti={1:"media",2:"media",3:"media",4:"media",5:"media",6:"media"},ii={1:5101,2:5102,3:5103,4:5104,5:5105,6:5106},je=S(function a(s){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{errorType:"",errorCode:0,errorMessage:"",originError:"",ext:{},mediaError:null};T(this,a);var t=s&&s.i18n?s.i18n.ERROR_TYPES:null;if(s.media){var e=r.mediaError?r.mediaError:s.media.error||{},i=s.duration,n=s.currentTime,o=s.ended,l=s.src,u=s.currentSrc,f=s.media,h=f.readyState,g=f.networkState,v=r.errorCode||e.code;ii[v]&&(v=ii[v]);var p={playerVersion:mt,currentTime:n,duration:i,ended:o,readyState:h,networkState:g,src:l||u,errorType:r.errorType,errorCode:v,message:r.errorMessage||e.message,mediaError:e,originError:r.originError?r.originError.stack:"",host:d.getHostFromUrl(l||u)};return r.ext&&Object.keys(r.ext).map(function(w){p[w]=r.ext[w]}),p}else if(arguments.length>1){for(var m={playerVersion:mt,domain:document.domain},_=["errorType","currentTime","duration","networkState","readyState","src","currentSrc","ended","errd","errorCode","mediaError"],C=0;C<arguments.length;C++)m[_[C]]=arguments[C];return m.ex=t?(t[arguments[0]]||{}).msg:"",m}}),X="play",yt="playing",ye="ended",Ie="pause",Be="error",$e="seeking",oe="seeked",q="timeupdate",He="waiting",se="canplay",Sr="canplaythrough",fe="durationchange",ni="volumechange",ae="loadeddata",xr="loadedmetadata",ri="ratechange",oi="progress",_t="loadstart",_e="emptied",Ir="stalled",Pr="suspend",Ar="abort",Lr="bufferedChange",kt="focus",si="blur",Ct="ready",ai="urlNull",ke="autoplay_started",Et="autoplay_was_prevented",We="complete",Ge="replay",bt="destroy",Ke="urlchange",wt="download_speed_change",li="leaveplayer",ui="enterplayer",ci="loading",le="fullscreen_change",Ye="cssFullscreen_change",Xe="mini_state_change",Tt="definition_change",Dr="before_definition_change",St="after_definition_change",Or="SEI_PARSED",Rr="retry",he="video_resize",xt="pip_change",fi="rotate",hi="screenShot",qe="playnext",di="shortcut",pi="xglog",Je="user_action",Ze="reset",gi="source_error",vi="source_success",Nr="switch_subtitle",mi=["play","playing","ended","pause","error","seeking","seeked","timeupdate","waiting","canplay","canplaythrough","durationchange","volumechange","loadeddata","loadedmetadata","ratechange","progress","loadstart","emptied","stalled","suspend","abort","lowdecode"],yi={STATS_INFO:"stats_info",STATS_DOWNLOAD:"stats_download",STATS_RESET:"stats_reset"},_i="fps_stuck";const Fr=Object.freeze(Object.defineProperty({__proto__:null,ABORT:Ar,AFTER_DEFINITION_CHANGE:St,AUTOPLAY_PREVENTED:Et,AUTOPLAY_STARTED:ke,BEFORE_DEFINITION_CHANGE:Dr,BUFFER_CHANGE:Lr,CANPLAY:se,CANPLAY_THROUGH:Sr,COMPLETE:We,CSS_FULLSCREEN_CHANGE:Ye,DEFINITION_CHANGE:Tt,DESTROY:bt,DOWNLOAD_SPEED_CHANGE:wt,DURATION_CHANGE:fe,EMPTIED:_e,ENDED:ye,ENTER_PLAYER:ui,ERROR:Be,FPS_STUCK:_i,FULLSCREEN_CHANGE:le,LEAVE_PLAYER:li,LOADED_DATA:ae,LOADED_METADATA:xr,LOADING:ci,LOAD_START:_t,MINI_STATE_CHANGE:Xe,PAUSE:Ie,PIP_CHANGE:xt,PLAY:X,PLAYER_BLUR:si,PLAYER_FOCUS:kt,PLAYING:yt,PLAYNEXT:qe,PROGRESS:oi,RATE_CHANGE:ri,READY:Ct,REPLAY:Ge,RESET:Ze,RETRY:Rr,ROTATE:fi,SCREEN_SHOT:hi,SEEKED:oe,SEEKING:$e,SEI_PARSED:Or,SHORTCUT:di,SOURCE_ERROR:gi,SOURCE_SUCCESS:vi,STALLED:Ir,STATS_EVENTS:yi,SUSPEND:Pr,SWITCH_SUBTITLE:Nr,TIME_UPDATE:q,URL_CHANGE:Ke,URL_NULL:ai,USER_ACTION:Je,VIDEO_EVENTS:mi,VIDEO_RESIZE:he,VOLUME_CHANGE:ni,WAITING:He,XGLOG:pi},Symbol.toStringTag,{value:"Module"}));function It(a,s){!this||!this.emit||(a==="error"?this.errorHandler(a,s.error):this.emit(a,s))}function Mr(a,s){return function(r,t){var e={player:s,eventName:a,originalEvent:r,detail:r.detail||{},timeStamp:r.timeStamp,currentTime:s.currentTime,duration:s.duration,paused:s.paused,ended:s.ended,isInternalOp:!!s._internalOp[r.type],muted:s.muted,volume:s.volume,host:d.getHostFromUrl(s.currentSrc),vtype:s.vtype};if(s.removeInnerOP(r.type),a==="timeupdate"&&(s._currentTime=s.media&&s.media.currentTime),a==="ratechange"){var i=s.media?s.media.playbackRate:0;if(i&&s._rate===i)return;s._rate=s.media&&s.media.playbackRate}if(a==="durationchange"&&(s._duration=s.media.duration),a==="volumechange"&&(e.isMutedChange=s._lastMuted!==s.muted,s._lastMuted=s.muted),a==="error"&&(e.error=t||s.video.error),s.mediaEventMiddleware[a]){var n=It.bind(s,a,e);try{s.mediaEventMiddleware[a].call(s,e,n)}catch(o){throw It.call(s,a,e),o}}else It.call(s,a,e)}}var Br=function(a){I(r,a);var s=P(r);function r(t){var e;T(this,r),e=s.call(this,t),e._hasStart=!1,e._currentTime=0,e._duration=0,e._internalOp={},e._lastMuted=!1,e.vtype="MP4",e._rate=-1,e.mediaConfig=Object.assign({},{controls:!1,autoplay:t.autoplay,playsinline:t.playsinline,"x5-playsinline":t.playsinline,"webkit-playsinline":t.playsinline,"x5-video-player-fullscreen":t["x5-video-player-fullscreen"]||t.x5VideoPlayerFullscreen,"x5-video-orientation":t["x5-video-orientation"]||t.x5VideoOrientation,airplay:t.airplay,"webkit-airplay":t.airplay,tabindex:t.tabindex|0,mediaType:t.mediaType||"video","data-index":-1},t.videoConfig,t.videoAttributes);var i=t["x5-video-player-type"]||t.x5VideoPlayerType;return O.isWeixin&&O.os.isAndroid&&i&&(e.mediaConfig["x5-video-player-type"]=i,delete e.mediaConfig.playsinline,delete e.mediaConfig["webkit-playsinline"],delete e.mediaConfig["x5-playsinline"]),t.loop&&(e.mediaConfig.loop="loop"),t.autoplayMuted&&!Object.prototype.hasOwnProperty.call(e.mediaConfig,"muted")&&(e.mediaConfig.muted=!0),e.media=d.createDom(e.mediaConfig.mediaType,"",e.mediaConfig,""),t.defaultPlaybackRate&&(e.media.defaultPlaybackRate=e.media.playbackRate=t.defaultPlaybackRate),d.typeOf(t.volume)==="Number"&&(e.volume=t.volume),t.autoplayMuted&&(e.media.muted=!0,e._lastMuted=!0),t.autoplay&&(e.media.autoplay=!0),e._interval={},e.mediaEventMiddleware={},e.attachVideoEvents(),e}return S(r,[{key:"setEventsMiddleware",value:function(e){var i=this;Object.keys(e).map(function(n){i.mediaEventMiddleware[n]=e[n]})}},{key:"removeEventsMiddleware",value:function(e){var i=this;Object.keys(e).map(function(n){delete i.mediaEventMiddleware[n]})}},{key:"attachVideoEvents",value:function(){var e=this,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.media;this._evHandlers||(this._evHandlers=mi.map(function(n){var o="on".concat(n.charAt(0).toUpperCase()).concat(n.slice(1));return typeof e[o]=="function"&&e.on(n,e[o]),k({},n,Mr(n,e))})),this._evHandlers.forEach(function(n){var o=Object.keys(n)[0];i.addEventListener(o,n[o],!1)})}},{key:"detachVideoEvents",value:function(){var e=this,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.media;this._evHandlers.forEach(function(n){var o=Object.keys(n)[0];i.removeEventListener(o,n[o],!1)}),this._evHandlers.forEach(function(n){var o=Object.keys(n)[0],l="on".concat(o.charAt(0).toUpperCase()).concat(o.slice(1));typeof e[l]=="function"&&e.off(o,e[l])}),this._evHandlers=null}},{key:"_attachSourceEvents",value:function(e,i){var n=this;e.removeAttribute("src"),e.load(),i.forEach(function(h,g){n.media.appendChild(d.createDom("source","",{src:"".concat(h.src),type:"".concat(h.type||""),"data-index":g+1}))});var o=e.children;if(o){this._videoSourceCount=o.length,this._videoSourceIndex=o.length,this._vLoadeddata=function(h){n.emit(vi,{src:h.target.currentSrc,host:d.getHostFromUrl(h.target.currentSrc)})};for(var l=null,u=0;u<this._evHandlers.length;u++)if(Object.keys(this._evHandlers[u])[0]==="error"){l=this._evHandlers[u];break}!this._sourceError&&(this._sourceError=function(h){var g=parseInt(h.target.getAttribute("data-index"),10);if(n._videoSourceIndex--,n._videoSourceIndex===0||g>=n._videoSourceCount){var v={code:4,message:"sources_load_error"};l?l.error(h,v):n.errorHandler("error",v)}var p=ti[4];n.emit(gi,new je(n,{errorType:p,errorCode:4,errorMessage:"sources_load_error",mediaError:{code:4,message:"sources_load_error"},src:h.target.src}))});for(var f=0;f<o.length;f++)o[f].addEventListener("error",this._sourceError);e.addEventListener("loadeddata",this._vLoadeddata)}}},{key:"_detachSourceEvents",value:function(e){var i=e.children;if(!(!i||i.length===0||!this._sourceError)){for(var n=0;n<i.length;n++)i[n].removeEventListener("error",this._sourceError);for(;i.length>0;)e.removeChild(i[0]);this._vLoadeddata&&e.removeEventListener("loadeddata",this._vLoadeddata)}}},{key:"errorHandler",value:function(e){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(this.media&&(this.media.error||i)){var n=this.media.error||i,o=n.code?ti[n.code]:"other",l=n.message;this.media.currentSrc||(l="empty_src",n={code:6,message:l}),this.emit(e,new je(this,{errorType:o,errorCode:n.code,errorMessage:n.message||"",mediaError:n}))}}},{key:"destroy",value:function(){this.media&&(this.media.pause&&(this.media.pause(),this.media.muted=!0),this.media.removeAttribute("src"),this.media.load()),this._currentTime=0,this._duration=0,this.mediaConfig=null;for(var e in this._interval)Object.prototype.hasOwnProperty.call(this._interval,e)&&(clearInterval(this._interval[e]),this._interval[e]=null);this.detachVideoEvents(),this.media=null,this.mediaEventMiddleware={},this.removeAllListeners()}},{key:"video",get:function(){return this.media},set:function(e){this.media=e}},{key:"play",value:function(){var e=this.media?this.media.play():null;return e}},{key:"pause",value:function(){this.media&&this.media.pause()}},{key:"load",value:function(){this.media&&this.media.load()}},{key:"canPlayType",value:function(e){return this.media?this.media.canPlayType(e):!1}},{key:"getBufferedRange",value:function(e){var i=[0,0];if(!this.media)return i;e||(e=this.media.buffered);var n=this.media.currentTime;if(e)for(var o=0,l=e.length;o<l&&(i[0]=e.start(o),i[1]=e.end(o),!(i[0]<=n&&n<=i[1]));o++);return i[0]-n<=0&&n-i[1]<=0?i:[0,0]}},{key:"autoplay",get:function(){return this.media?this.media.autoplay:!1},set:function(e){this.media&&(this.media.autoplay=e)}},{key:"buffered",get:function(){return this.media?this.media.buffered:null}},{key:"buffered2",get:function(){return this.media&&this.media.buffered?d.getBuffered2(this.media.buffered):null}},{key:"bufferedPoint",get:function(){var e={start:0,end:0};if(!this.media)return e;var i=this.media.buffered;if(!i||i.length===0)return e;for(var n=0;n<i.length;n++)if((i.start(n)<=this.currentTime||i.start(n)<.1)&&i.end(n)>=this.currentTime)return{start:i.start(n),end:i.end(n)};return e}},{key:"crossOrigin",get:function(){return this.media?this.media.crossOrigin:""},set:function(e){this.media&&(this.media.crossOrigin=e)}},{key:"currentSrc",get:function(){return this.media?this.media.currentSrc:""},set:function(e){this.media&&(this.media.currentSrc=e)}},{key:"currentTime",get:function(){return this.media?this.media.currentTime!==void 0?this.media.currentTime:this._currentTime:0},set:function(e){this.media&&(this.media.currentTime=e)}},{key:"defaultMuted",get:function(){return this.media?this.media.defaultMuted:!1},set:function(e){this.media&&(this.media.defaultMuted=e)}},{key:"duration",get:function(){return this._duration}},{key:"ended",get:function(){return this.media?this.media.ended:!1}},{key:"error",get:function(){return this.media.error}},{key:"errorNote",get:function(){var e=this.media.error;if(!e)return"";var i=["MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED"];return i[this.media.error.code-1]}},{key:"loop",get:function(){return this.media?this.media.loop:!1},set:function(e){this.media&&(this.media.loop=e)}},{key:"muted",get:function(){return this.media?this.media.muted:!1},set:function(e){!this.media||this.media.muted===e||(this._lastMuted=this.media.muted,this.media.muted=e)}},{key:"networkState",get:function(){return this.media.networkState}},{key:"paused",get:function(){return this.media?this.media.paused:!0}},{key:"playbackRate",get:function(){return this.media?this.media.playbackRate:0},set:function(e){!this.media||e===1/0||(this.media.defaultPlaybackRate=e,this.media.playbackRate=e)}},{key:"played",get:function(){return this.media?this.media.played:null}},{key:"preload",get:function(){return this.media?this.media.preload:!1},set:function(e){this.media&&(this.media.preload=e)}},{key:"readyState",get:function(){return this.media.readyState}},{key:"seekable",get:function(){return this.media?this.media.seekable:!1}},{key:"seeking",get:function(){return this.media?this.media.seeking:!1}},{key:"src",get:function(){return this.media?this.media.src:""},set:function(e){if(this.media){if(this.emit(Ke,e),this.emit(He),this._currentTime=0,this._duration=0,d.isMSE(this.media)){this.onWaiting();return}this._detachSourceEvents(this.media),d.typeOf(e)==="Array"?this._attachSourceEvents(this.media,e):e?this.media.src=e:this.media.removeAttribute("src"),this.load()}}},{key:"volume",get:function(){return this.media?this.media.volume:0},set:function(e){e===1/0||!this.media||(this.media.volume=e)}},{key:"aspectRatio",get:function(){return this.media?this.media.videoWidth/this.media.videoHeight:0}},{key:"addInnerOP",value:function(e){this._internalOp[e]=!0}},{key:"removeInnerOP",value:function(e){delete this._internalOp[e]}},{key:"emit",value:function(e,i){for(var n,o=arguments.length,l=new Array(o>2?o-2:0),u=2;u<o;u++)l[u-2]=arguments[u];(n=L(A(r.prototype),"emit",this)).call.apply(n,[this,e,i].concat(l))}},{key:"on",value:function(e,i){for(var n,o=arguments.length,l=new Array(o>2?o-2:0),u=2;u<o;u++)l[u-2]=arguments[u];(n=L(A(r.prototype),"on",this)).call.apply(n,[this,e,i].concat(l))}},{key:"once",value:function(e,i){for(var n,o=arguments.length,l=new Array(o>2?o-2:0),u=2;u<o;u++)l[u-2]=arguments[u];(n=L(A(r.prototype),"once",this)).call.apply(n,[this,e,i].concat(l))}},{key:"off",value:function(e,i){for(var n,o=arguments.length,l=new Array(o>2?o-2:0),u=2;u<o;u++)l[u-2]=arguments[u];(n=L(A(r.prototype),"off",this)).call.apply(n,[this,e,i].concat(l))}},{key:"offAll",value:function(){L(A(r.prototype),"removeAllListeners",this).call(this)}}]),r}(Zt),Hr=function(){function a(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{name:"xgplayer",version:1,db:null,ojstore:{name:"xg-m4a",keypath:"vid"}};T(this,a),this.indexedDB=window.indexedDB||window.webkitindexedDB,this.IDBKeyRange=window.IDBKeyRange||window.webkitIDBKeyRange,this.myDB=s}return S(a,[{key:"openDB",value:function(r){var t=this,e=this,i=this.myDB.version||1,n=e.indexedDB.open(e.myDB.name,i);n.onerror=function(o){},n.onsuccess=function(o){t.myDB.db=o.target.result,r.call(e)},n.onupgradeneeded=function(o){var l=o.target.result;o.target.transaction,l.objectStoreNames.contains(e.myDB.ojstore.name)||l.createObjectStore(e.myDB.ojstore.name,{keyPath:e.myDB.ojstore.keypath})}}},{key:"deletedb",value:function(){var r=this;r.indexedDB.deleteDatabase(this.myDB.name)}},{key:"closeDB",value:function(){this.myDB.db.close()}},{key:"addData",value:function(r,t){for(var e=this.myDB.db.transaction(r,"readwrite").objectStore(r),i,n=0;n<t.length;n++)i=e.add(t[n]),i.onerror=function(){},i.onsuccess=function(){}}},{key:"putData",value:function(r,t){for(var e=this.myDB.db.transaction(r,"readwrite").objectStore(r),i,n=0;n<t.length;n++)i=e.put(t[n]),i.onerror=function(){},i.onsuccess=function(){}}},{key:"getDataByKey",value:function(r,t,e){var i=this,n=this.myDB.db.transaction(r,"readwrite").objectStore(r),o=n.get(t);o.onerror=function(){e.call(i,null)},o.onsuccess=function(l){var u=l.target.result;e.call(i,u)}}},{key:"deleteData",value:function(r,t){var e=this.myDB.db.transaction(r,"readwrite").objectStore(r);e.delete(t)}},{key:"clearData",value:function(r){var t=this.myDB.db.transaction(r,"readwrite").objectStore(r);t.clear()}}]),a}(),ki=["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],Ci=["requestFullscreen","webkitRequestFullscreen","mozRequestFullScreen","msRequestFullscreen"],Ei=["exitFullscreen","webkitExitFullscreen","mozCancelFullScreen","msExitFullscreen"],Ce="data-xgplayerid";function Qe(a,s,r){for(var t=arguments.length,e=new Array(t>3?t-3:0),i=3;i<t;i++)e[i-3]=arguments[i];var n=s.call.apply(s,[a].concat(e));!r||typeof r!="function"||(n&&n.then?n.then(function(){for(var o=arguments.length,l=new Array(o),u=0;u<o;u++)l[u]=arguments[u];r.call.apply(r,[a].concat(l))}):r.call.apply(r,[a].concat(e)))}function et(a,s){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{pre:null,next:null};return this.__hooks||(this.__hooks={}),!this.__hooks[a]&&(this.__hooks[a]=null),(function(){var t=arguments,e=this;if(r.pre)try{var i;(i=r.pre).call.apply(i,[this].concat(Array.prototype.slice.call(arguments)))}catch(l){throw l.message="[pluginName: ".concat(this.pluginName,":").concat(a,":pre error] >> ").concat(l.message),l}if(this.__hooks&&this.__hooks[a])try{var n,o=(n=this.__hooks[a]).call.apply(n,[this,this].concat(Array.prototype.slice.call(arguments)));o?o.then?o.then(function(l){l!==!1&&Qe.apply(void 0,[e,s,r.next].concat(Q(t)))}).catch(function(l){throw l}):Qe.apply(void 0,[this,s,r.next].concat(Array.prototype.slice.call(arguments))):o===void 0&&Qe.apply(void 0,[this,s,r.next].concat(Array.prototype.slice.call(arguments)))}catch(l){throw l.message="[pluginName: ".concat(this.pluginName,":").concat(a,"] >> ").concat(l.message),l}else Qe.apply(void 0,[this,s,r.next].concat(Array.prototype.slice.call(arguments)))}).bind(this)}function tt(a,s){var r=this.__hooks;if(r)return r.hasOwnProperty(a)?(r&&(r[a]=s),!0):(console.warn("has no supported hook which name [".concat(a,"]")),!1)}function it(a,s){var r=this.__hooks;r&&delete r[a]}function bi(a){if(!(!this.plugins||!this.plugins[a.toLowerCase()])){for(var s=this.plugins[a.toLowerCase()],r=arguments.length,t=new Array(r>1?r-1:0),e=1;e<r;e++)t[e-1]=arguments[e];return s.useHooks&&s.useHooks.apply(s,t)}}function wi(a){if(!(!this.plugins||!this.plugins[a.toLowerCase()])){var s=this.plugins[a.toLowerCase()];if(s){for(var r=arguments.length,t=new Array(r>1?r-1:0),e=1;e<r;e++)t[e-1]=arguments[e];return s.removeHooks&&s.removeHooks.apply(s,t)}}}function Ti(a){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];a.__hooks={},s&&s.map(function(r){a.__hooks[r]=null}),Object.defineProperty(a,"hooks",{get:function(){return a.__hooks&&Object.keys(a.__hooks).map(function(t){if(a.__hooks[t])return t})}})}function Si(a){a.__hooks=null}function ue(a,s,r){for(var t=arguments.length,e=new Array(t>3?t-3:0),i=3;i<t;i++)e[i-3]=arguments[i];if(a.__hooks&&a.__hooks[s]){var n,o=(n=a.__hooks[s]).call.apply(n,[a,a].concat(e));if(o&&o.then)o.then(function(l){return l===!1?null:r.call.apply(r,[a,a].concat(e))}).catch(function(l){console.warn("[runHooks]".concat(s," reject"),l.message)});else if(o!==!1)return r.call.apply(r,[a,a].concat(e))}else return r.call.apply(r,[a,a].concat(e))}function Pt(a,s){F.logError("[".concat(a,"] event or callback cant be undefined or null when call ").concat(s))}var de=function(){function a(s){T(this,a),d.checkIsFunction(this.beforeCreate)&&this.beforeCreate(s),Ti(this),this.__args=s,this.__events={},this.__onceEvents={},this.config=s.config||{},this.player=null,this.playerConfig={},this.pluginName="",this.__init(s)}return S(a,[{key:"beforeCreate",value:function(r){}},{key:"afterCreate",value:function(){}},{key:"beforePlayerInit",value:function(){}},{key:"onPluginsReady",value:function(){}},{key:"afterPlayerInit",value:function(){}},{key:"destroy",value:function(){}},{key:"__init",value:function(r){this.player=r.player,this.playerConfig=r.player&&r.player.config,this.pluginName=r.pluginName?r.pluginName.toLowerCase():this.constructor.pluginName.toLowerCase(),this.logger=r.player&&r.player.logger}},{key:"updateLang",value:function(r){r||(r=this.lang)}},{key:"lang",get:function(){return this.player.lang}},{key:"i18n",get:function(){return this.player.i18n}},{key:"i18nKeys",get:function(){return this.player.i18nKeys}},{key:"domEventType",get:function(){var r=d.checkTouchSupport()?"touch":"mouse";return this.playerConfig&&(this.playerConfig.domEventType==="touch"||this.playerConfig.domEventType==="mouse")&&(r=this.playerConfig.domEventType),r}},{key:"on",value:function(r,t){var e=this;if(!r||!t||!this.player){Pt(this.pluginName,"plugin.on(event, callback)");return}typeof r=="string"?(this.__events[r]=t,this.player.on(r,t)):Array.isArray(r)&&r.forEach(function(i){e.__events[i]=t,e.player.on(i,t)})}},{key:"once",value:function(r,t){var e=this;if(!r||!t||!this.player){Pt(this.pluginName,"plugin.once(event, callback)");return}typeof r=="string"?(this.__onceEvents[r]=t,this.player.once(r,t)):Array.isArray(r)&&r.forEach(function(i){e.__onceEvents[i]=t,e.player.once(r,t)})}},{key:"off",value:function(r,t){var e=this;if(!r||!t||!this.player){Pt(this.pluginName,"plugin.off(event, callback)");return}typeof r=="string"?(delete this.__events[r],this.player.off(r,t)):Array.isArray(r)&&r.forEach(function(i){delete e.__events[r],e.player.off(i,t)})}},{key:"offAll",value:function(){var r=this;["__events","__onceEvents"].forEach(function(t){Object.keys(r[t]).forEach(function(e){r[t][e]&&r.off(e,r[t][e]),e&&delete r[t][e]})}),this.__events={},this.__onceEvents={}}},{key:"emit",value:function(r){var t;if(this.player){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];(t=this.player).emit.apply(t,[r].concat(i))}}},{key:"emitUserAction",value:function(r,t){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(this.player){var i=U(U({},e),{},{pluginName:this.pluginName});this.player.emitUserAction(r,t,i)}}},{key:"hook",value:function(r,t){return et.call.apply(et,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"useHooks",value:function(r,t){for(var e=arguments.length,i=new Array(e>2?e-2:0),n=2;n<e;n++)i[n-2]=arguments[n];return tt.call.apply(tt,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"removeHooks",value:function(r,t){for(var e=arguments.length,i=new Array(e>2?e-2:0),n=2;n<e;n++)i[n-2]=arguments[n];return it.call.apply(it,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"registerPlugin",value:function(r){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"";if(this.player)return e&&(t.pluginName=e),this.player.registerPlugin({plugin:r,options:t})}},{key:"getPlugin",value:function(r){return this.player?this.player.getPlugin(r):null}},{key:"__destroy",value:function(){var r=this,t=this.player,e=this.pluginName;this.offAll(),d.clearAllTimers(this),d.checkIsFunction(this.destroy)&&this.destroy(),["player","playerConfig","pluginName","logger","__args","__hooks"].map(function(i){r[i]=null}),t.unRegisterPlugin(e),Si(this)}}],[{key:"defineGetterOrSetter",value:function(r,t){for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&Object.defineProperty(r,e,t[e])}},{key:"defaultConfig",get:function(){return{}}},{key:"pluginName",get:function(){return"pluginName"}}]),a}(),Vr=9;if(typeof Element<"u"&&!Element.prototype.matches){var Pe=Element.prototype;Pe.matches=Pe.matchesSelector||Pe.mozMatchesSelector||Pe.msMatchesSelector||Pe.oMatchesSelector||Pe.webkitMatchesSelector}function Ur(a,s){for(;a&&a.nodeType!==Vr;){if(typeof a.matches=="function"&&a.matches(s))return a;a=a.parentNode}}var zr=Ur,jr=zr;function At(a,s,r,t,e){var i=Wr.apply(this,arguments);return a.addEventListener(r,i,e),{destroy:function(){a.removeEventListener(r,i,e)}}}function $r(a,s,r,t,e){return typeof a.addEventListener=="function"?At.apply(null,arguments):typeof r=="function"?At.bind(null,document).apply(null,arguments):(typeof a=="string"&&(a=document.querySelectorAll(a)),Array.prototype.map.call(a,function(i){return At(i,s,r,t,e)}))}function Wr(a,s,r,t){return function(e){e.delegateTarget=jr(e.target,s),e.delegateTarget&&t.call(a,e)}}var Gr=$r;const xi=ct(Gr);var Kr={CONTROLS:"controls",ROOT:"root"},V={ROOT:"root",ROOT_LEFT:"rootLeft",ROOT_RIGHT:"rootRight",ROOT_TOP:"rootTop",CONTROLS_LEFT:"controlsLeft",CONTROLS_RIGTH:"controlsRight",CONTROLS_RIGHT:"controlsRight",CONTROLS_CENTER:"controlsCenter",CONTROLS:"controls"},Ii={ICON_DISABLE:"xg-icon-disable",ICON_HIDE:"xg-icon-hide"};function Lt(a){return a?a.indexOf&&/^(?:http|data:|\/)/.test(a):!1}function Yr(a,s){return G(a)==="object"&&a.class&&typeof a.class=="string"?"".concat(s," ").concat(a.class):s}function Xr(a,s){return G(a)==="object"&&a.attr&&G(a.attr)==="object"&&Object.keys(a.attr).map(function(r){s[r]=a.attr[r]}),s}function Pi(a,s){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"",t=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},e=arguments.length>4&&arguments[4]!==void 0?arguments[4]:"",i=null;if(a instanceof window.Element)return d.addClass(a,r),Object.keys(t).map(function(n){a.setAttribute(n,t[n])}),a;if(Lt(a)||Lt(a.url))return t.src=Lt(a)?a:a.url||"",i=d.createDom(a.tag||"img","",t,"xg-img ".concat(r)),i;if(typeof a=="function")try{return i=a(),i instanceof window.Element?(d.addClass(i,r),Object.keys(t).map(function(n){i.setAttribute(n,t[n])}),i):(F.logWarn("warn>>icons.".concat(s," in config of plugin named [").concat(e,"] is a function mast return an Element Object")),null)}catch(n){return F.logError("Plugin named [".concat(e,"]:createIcon"),n),null}return typeof a=="string"?d.createDomFromHtml(a,t,r):(F.logWarn("warn>>icons.".concat(s," in config of plugin named [").concat(e,"] is invalid")),null)}function qr(a,s){var r=s.config.icons||s.playerConfig.icons;Object.keys(a).map(function(t){var e=a[t],i=e&&e.class?e.class:"",n=e&&e.attr?e.attr:{},o=null;r&&r[t]&&(i=Yr(r[t],i),n=Xr(r[t],n),o=Pi(r[t],t,i,n,s.pluginName)),!o&&e&&(o=Pi(e.icon?e.icon:e,n,i,{},s.pluginName)),s.icons[t]=o})}function Jr(a,s){Object.keys(a).map(function(r){Object.defineProperty(s.langText,r,{get:function(){var e=s.lang,i=s.i18n;return i[r]?i[r]:a[r]&&a[r][e]||""}})})}var B=function(a){I(r,a);var s=P(r);function r(){var t,e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return T(this,r),t=s.call(this,e),t.__delegates=[],t}return S(r,[{key:"__init",value:function(e){if(L(A(r.prototype),"__init",this).call(this,e),!!e.root){var i=e.root,n=null;this.icons={},this.root=null,this.parent=null;var o=this.registerIcons()||{};qr(o,this),this.langText={};var l=this.registerLanguageTexts()||{};Jr(l,this);var u="";try{u=this.render()}catch(g){throw F.logError("Plugin:".concat(this.pluginName,":render"),g),new Error("Plugin:".concat(this.pluginName,":render:").concat(g.message))}if(u)n=r.insert(u,i,e.index),n.setAttribute("data-index",e.index);else if(e.tag)n=d.createDom(e.tag,"",e.attr,e.name),n.setAttribute("data-index",e.index),i.appendChild(n);else return;this.root=n,this.parent=i;var f=this.config.attr||{},h=this.config.style||{};this.setAttr(f),this.setStyle(h),this.config.index&&this.root.setAttribute("data-index",this.config.index),this.__registerChildren()}}},{key:"__registerChildren",value:function(){var e=this;if(this.root){this._children=[];var i=this.children();i&&G(i)==="object"&&Object.keys(i).length>0&&Object.keys(i).map(function(n){var o=n,l=i[o],u={root:e.root},f,h;typeof l=="function"?(f=e.config[o]||{},h=l):G(l)==="object"&&typeof l.plugin=="function"&&(f=l.options?d.deepCopy(e.config[o]||{},l.options):e.config[o]||{},h=l.plugin),u.config=f,f.index!==void 0&&(u.index=f.index),f.root&&(u.root=f.root),e.registerPlugin(h,u,o)})}}},{key:"updateLang",value:function(e){e||(e=this.lang);function i(u,f){for(var h=0;h<u.children.length;h++)u.children[h].children.length>0?i(u.children[h],f):f(u.children[h])}var n=this.root,o=this.i18n,l=this.langText;n&&i(n,function(u){var f=u.getAttribute&&u.getAttribute("lang-key");if(f){var h=o[f.toUpperCase()]||l[f];h&&(u.innerHTML=typeof h=="function"?h(e):h)}})}},{key:"lang",get:function(){return this.player.lang}},{key:"changeLangTextKey",value:function(e){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",n=this.i18n||{},o=this.langText;e.setAttribute&&e.setAttribute("lang-key",i);var l=n[i]||o[i]||"";l&&(e.innerHTML=l)}},{key:"plugins",value:function(){return this._children}},{key:"disable",value:function(){this.config.disable=!0,d.addClass(this.find(".xgplayer-icon"),Ii.ICON_DISABLE)}},{key:"enable",value:function(){this.config.disable=!1,d.removeClass(this.find(".xgplayer-icon"),Ii.ICON_DISABLE)}},{key:"children",value:function(){return{}}},{key:"registerPlugin",value:function(e){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"";i.root=i.root||this.root;var o=L(A(r.prototype),"registerPlugin",this).call(this,e,i,n);return this._children.push(o),o}},{key:"registerIcons",value:function(){return{}}},{key:"registerLanguageTexts",value:function(){return{}}},{key:"find",value:function(e){if(this.root)return this.root.querySelector(e)}},{key:"bind",value:function(e,i,n){var o=this;if(arguments.length<3&&typeof i=="function")Array.isArray(e)?e.forEach(function(u){o.bindEL(u,i)}):this.bindEL(e,i);else{var l=r.delegate.call(this,this.root,e,i,n);this.__delegates=this.__delegates.concat(l)}}},{key:"unbind",value:function(e,i){var n=this;if(arguments.length<3&&typeof i=="function")Array.isArray(e)?e.forEach(function(u){n.unbindEL(u,i)}):this.unbindEL(e,i);else for(var o="".concat(e,"_").concat(i),l=0;l<this.__delegates.length;l++)if(this.__delegates[l].key===o){this.__delegates[l].destroy(),this.__delegates.splice(l,1);break}}},{key:"setStyle",value:function(e,i){var n=this;if(this.root){if(d.typeOf(e)==="String")return this.root.style[e]=i;d.typeOf(e)==="Object"&&Object.keys(e).map(function(o){n.root.style[o]=e[o]})}}},{key:"setAttr",value:function(e,i){var n=this;if(this.root){if(d.typeOf(e)==="String")return this.root.setAttribute(e,i);d.typeOf(e)==="Object"&&Object.keys(e).map(function(o){n.root.setAttribute(o,e[o])})}}},{key:"setHtml",value:function(e,i){this.root&&(this.root.innerHTML=e,typeof i=="function"&&i())}},{key:"bindEL",value:function(e,i){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;this.root&&"on".concat(e)in this.root&&typeof i=="function"&&this.root.addEventListener(e,i,n)}},{key:"unbindEL",value:function(e,i){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;this.root&&"on".concat(e)in this.root&&typeof i=="function"&&this.root.removeEventListener(e,i,n)}},{key:"show",value:function(e){if(this.root){this.root.style.display=e!==void 0?e:"block";var i=window.getComputedStyle(this.root,null),n=i.getPropertyValue("display");if(n==="none")return this.root.style.display="block"}}},{key:"hide",value:function(){this.root&&(this.root.style.display="none")}},{key:"appendChild",value:function(e,i){if(!this.root)return null;if(arguments.length<2&&arguments[0]instanceof window.Element)return this.root.appendChild(arguments[0]);if(!i||!(i instanceof window.Element))return null;try{return typeof e=="string"?this.find(e).appendChild(i):e.appendChild(i)}catch(n){return F.logError("Plugin:appendChild",n),null}}},{key:"render",value:function(){return""}},{key:"destroy",value:function(){}},{key:"__destroy",value:function(){var e=this,i=this.player;this.__delegates.map(function(n){n.destroy()}),this.__delegates=[],this._children instanceof Array&&(this._children.map(function(n){i.unRegisterPlugin(n.pluginName)}),this._children=null),this.root&&(this.root.hasOwnProperty("remove")?this.root.remove():this.root.parentNode&&this.root.parentNode.removeChild(this.root)),L(A(r.prototype),"__destroy",this).call(this),this.icons={},["root","parent"].map(function(n){e[n]=null})}}],[{key:"insert",value:function(e,i){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,o=i.children.length,l=Number(n),u=e instanceof window.Node;if(o){for(var f=0,h=null,g="";f<o;f++){h=i.children[f];var v=Number(h.getAttribute("data-index"));if(v>=l){g="beforebegin";break}else v<l&&(g="afterend")}return u?g==="afterend"?i.appendChild(e):i.insertBefore(e,h):h.insertAdjacentHTML(g,e),g==="afterend"?i.children[i.children.length-1]:i.children[f]}else return u?i.appendChild(e):i.insertAdjacentHTML("beforeend",e),i.children[i.children.length-1]}},{key:"defaultConfig",get:function(){return{}}},{key:"delegate",value:function(e,i,n,o){var l=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1,u=[];if(e instanceof window.Node&&typeof o=="function")if(Array.isArray(n))n.forEach(function(h){var g=xi(e,i,h,o,l);g.key="".concat(i,"_").concat(h),u.push(g)});else{var f=xi(e,i,n,o,l);f.key="".concat(i,"_").concat(n),u.push(f)}return u}},{key:"ROOT_TYPES",get:function(){return Kr}},{key:"POSITIONS",get:function(){return V}}]),r}(de),Zr=function(){function a(){var s=this;if(T(this,a),k(this,"__trigger",function(r){var t=new Date().getTime();s.timeStamp=t;for(var e=0;e<r.length;e++)s.__runHandler(r[e].target)}),this.__handlers=[],this.timeStamp=0,this.observer=null,!!window.ResizeObserver)try{this.observer=new window.ResizeObserver(Er(this.__trigger,100,{trailing:!0})),this.timeStamp=new Date().getTime()}catch(r){console.error(r)}}return S(a,[{key:"addObserver",value:function(r,t){if(this.observer){this.observer&&this.observer.observe(r);for(var e=r.getAttribute(Ce),i=this.__handlers,n=-1,o=0;o<i.length;o++)i[o]&&r===i[o].target&&(n=o);n>-1?this.__handlers[n].handler=t:this.__handlers.push({target:r,handler:t,playerId:e})}}},{key:"unObserver",value:function(r){var t=-1;this.__handlers.map(function(e,i){r===e.target&&(t=i)});try{this.observer&&this.observer.unobserve(r)}catch{}this.observer&&this.observer.unobserve(r),t>-1&&this.__handlers.splice(t,1)}},{key:"destroyObserver",value:function(){this.observer&&this.observer.disconnect(),this.observer=null,this.__handlers=null}},{key:"__runHandler",value:function(r){for(var t=this.__handlers,e=0;e<t.length;e++)if(t[e]&&r===t[e].target){try{t[e].handler(r)}catch(i){console.error(i)}return!0}return!1}}]),a}(),Ve=null;function Qr(a,s){return Ve||(Ve=new Zr),Ve.addObserver(a,s),Ve}function eo(a,s){Ve.unObserver(a,s)}var W={pluginGroup:{},init:function(s){var r=s._pluginInfoId;r||(r=new Date().getTime(),s._pluginInfoId=r),!s.config.closeResizeObserver&&Qr(s.root,function(){s.resize()}),this.pluginGroup[r]={_originalOptions:s.config||{},_plugins:{}}},formatPluginInfo:function(s,r){var t=null,e=null;return s.plugin&&typeof s.plugin=="function"?(t=s.plugin,e=s.options):(t=s,e={}),r&&(e.config=r||{}),{PLUFGIN:t,options:e}},checkPluginIfExits:function(s,r){for(var t=0;t<r.length;t++)if(s.toLowerCase()===r[t].pluginName.toLowerCase())return!0;return!1},getRootByConfig:function(s,r){for(var t=Object.keys(r),e=null,i=0;i<t.length;i++)if(s.toLowerCase()===t[i].toLowerCase()){e=r[t[i]];break}return d.typeOf(e)==="Object"?{root:e.root,position:e.position}:{}},lazyRegister:function(s,r){var t=this,e=r.timeout||1500;return Promise.race([r.loader().then(function(i){var n;i&&i.__esModule?n=i.default:n=i,t.register(s,n,i.options)}),new Promise(function(i,n){setTimeout(function(){n(new Error("timeout"))},e)})])},register:function(s,r){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(!(!s||!r||typeof r!="function"||r.prototype===void 0)){var e=s._pluginInfoId;if(!(!e||!this.pluginGroup[e])){this.pluginGroup[e]._plugins||(this.pluginGroup[e]._plugins={});var i=this.pluginGroup[e]._plugins,n=this.pluginGroup[e]._originalOptions;t.player=s;var o=t.pluginName||r.pluginName;if(!o)throw new Error("The property pluginName is necessary");if(r.isSupported&&!r.isSupported(s.config.mediaType,s.config.codecType)){console.warn("not supported plugin [".concat(o,"]"));return}t.config||(t.config={});for(var l=Object.keys(n),u=0;u<l.length;u++)if(o.toLowerCase()===l[u].toLowerCase()){var f=n[l[u]];d.typeOf(f)==="Object"?t.config=Object.assign({},t.config,n[l[u]]):d.typeOf(f)==="Boolean"&&(t.config.disable=!f);break}r.defaultConfig&&Object.keys(r.defaultConfig).forEach(function(g){typeof t.config[g]>"u"&&(t.config[g]=r.defaultConfig[g])}),t.root?typeof t.root=="string"&&(t.root=s[t.root]):t.root=s.root,t.index=t.config.index||0;try{i[o.toLowerCase()]&&(this.unRegister(e,o.toLowerCase()),console.warn("the is one plugin with same pluginName [".concat(o,"] exist, destroy the old instance")));var h=new r(t);return i[o.toLowerCase()]=h,i[o.toLowerCase()].func=r,h&&typeof h.afterCreate=="function"&&h.afterCreate(),h}catch(g){throw console.error(g),g}}}},unRegister:function(s,r){s._pluginInfoId&&(s=s._pluginInfoId),r=r.toLowerCase();try{var t=this.pluginGroup[s]._plugins[r];t&&(t.pluginName&&t.__destroy(),delete this.pluginGroup[s]._plugins[r])}catch(e){console.error("[unRegister:".concat(r,"] cgid:[").concat(s,"] error"),e)}},deletePlugin:function(s,r){var t=s._pluginInfoId;t&&this.pluginGroup[t]&&this.pluginGroup[t]._plugins&&delete this.pluginGroup[t]._plugins[r]},getPlugins:function(s){var r=s._pluginInfoId;return r&&this.pluginGroup[r]?this.pluginGroup[r]._plugins:{}},findPlugin:function(s,r){var t=s._pluginInfoId;if(!t||!this.pluginGroup[t])return null;var e=r.toLowerCase();return this.pluginGroup[t]._plugins[e]},beforeInit:function(s){var r=this;function t(e){return!e||!e.then?new Promise(function(i){i()}):e}return new Promise(function(e){if(r.pluginGroup){var i;return s._loadingPlugins&&s._loadingPlugins.length?i=Promise.all(s._loadingPlugins):i=Promise.resolve(),i.then(function(){var n=s._pluginInfoId;if(!r.pluginGroup[n]){e();return}var o=r.pluginGroup[n]._plugins,l=[];Object.keys(o).forEach(function(u){if(o[u]&&o[u].beforePlayerInit)try{var f=o[u].beforePlayerInit();l.push(t(f))}catch(h){throw l.push(t(null)),h}}),Promise.all([].concat(l)).then(function(){e()}).catch(function(u){console.error(u),e()})})}})},afterInit:function(s){var r=s._pluginInfoId;if(!(!r||!this.pluginGroup[r])){var t=this.pluginGroup[r]._plugins;Object.keys(t).forEach(function(e){t[e]&&t[e].afterPlayerInit&&t[e].afterPlayerInit()})}},setLang:function(s,r){var t=r._pluginInfoId;if(!(!t||!this.pluginGroup[t])){var e=this.pluginGroup[t]._plugins;Object.keys(e).forEach(function(i){if(e[i].updateLang)e[i].updateLang(s);else try{e[i].lang=s}catch{console.warn("".concat(i," setLang"))}})}},reRender:function(s){var r=this,t=s._pluginInfoId;if(!(!t||!this.pluginGroup[t])){var e=[],i=this.pluginGroup[t]._plugins;Object.keys(i).forEach(function(n){n!=="controls"&&i[n]&&(e.push({plugin:i[n].func,options:i[n].__args}),r.unRegister(t,n))}),e.forEach(function(n){r.register(s,n.plugin,n.options)})}},onPluginsReady:function(s){var r=s._pluginInfoId;if(!(!r||!this.pluginGroup[r])){var t=this.pluginGroup[r]._plugins||{};Object.keys(t).forEach(function(e){t[e].onPluginsReady&&typeof t[e].onPluginsReady=="function"&&t[e].onPluginsReady()})}},destroy:function(s){var r=s._pluginInfoId;if(this.pluginGroup[r]){eo(s.root);for(var t=this.pluginGroup[r]._plugins,e=0,i=Object.keys(t);e<i.length;e++){var n=i[e];this.unRegister(r,n)}delete this.pluginGroup[r],delete s._pluginInfoId}}},b={DEFAULT:"xgplayer",DEFAULT_SKIN:"xgplayer-skin-default",ENTER:"xgplayer-is-enter",PAUSED:"xgplayer-pause",PLAYING:"xgplayer-playing",ENDED:"xgplayer-ended",CANPLAY:"xgplayer-canplay",LOADING:"xgplayer-isloading",ERROR:"xgplayer-is-error",REPLAY:"xgplayer-replay",NO_START:"xgplayer-nostart",ACTIVE:"xgplayer-active",INACTIVE:"xgplayer-inactive",FULLSCREEN:"xgplayer-is-fullscreen",CSS_FULLSCREEN:"xgplayer-is-cssfullscreen",ROTATE_FULLSCREEN:"xgplayer-rotate-fullscreen",PARENT_ROTATE_FULLSCREEN:"xgplayer-rotate-parent",PARENT_FULLSCREEN:"xgplayer-fullscreen-parent",INNER_FULLSCREEN:"xgplayer-fullscreen-inner",NO_CONTROLS:"no-controls",FLEX_CONTROLS:"flex-controls",CONTROLS_FOLLOW:"controls-follow",CONTROLS_AUTOHIDE:"controls-autohide",TOP_BAR_AUTOHIDE:"top-bar-autohide",NOT_ALLOW_AUTOPLAY:"not-allow-autoplay",SEEKING:"seeking",PC:"xgplayer-pc",MOBILE:"xgplayer-mobile",MINI:"xgplayer-mini"};function Ai(){return{id:"",el:null,url:"",domEventType:"default",nullUrlStart:!1,width:600,height:337.5,fluid:!1,fitVideoSize:"fixed",videoFillMode:"auto",volume:.6,autoplay:!1,autoplayMuted:!1,loop:!1,isLive:!1,zoom:1,videoInit:!0,poster:"",isMobileSimulateMode:!1,defaultPlaybackRate:1,execBeforePluginsCall:null,allowSeekAfterEnded:!0,enableContextmenu:!0,closeVideoClick:!1,closeVideoDblclick:!1,closePlayerBlur:!1,closeDelayBlur:!1,leavePlayerTime:3e3,closePlayVideoFocus:!1,closePauseVideoFocus:!1,closeFocusVideoFocus:!0,closeControlsBlur:!0,topBarAutoHide:!0,videoAttributes:{},startTime:0,seekedStatus:"play",miniprogress:!1,disableSwipeHandler:function(){},enableSwipeHandler:function(){},preProcessUrl:null,ignores:[],whitelist:[],inactive:3e3,lang:br(),controls:!0,marginControls:!1,fullscreenTarget:null,screenShot:!1,rotate:!1,pip:!1,download:!1,mini:!1,cssFullscreen:!0,keyShortcut:!0,presets:[],plugins:[],playbackRate:1,definition:{list:[]},playsinline:!0,customDuration:0,timeOffset:0,icons:{},i18n:[],tabindex:0,thumbnail:null,videoConfig:{},isHideTips:!1,minWaitDelay:200,commonStyle:{progressColor:"",playedColor:"",cachedColor:"",sliderBtnStyle:{},volumeColor:""}}}var to=function(s,r){var t,e,i;r.preset&&r.options?i=new r.preset(r.options,s.config):i=new r({},s.config);var n=i,o=n.plugins,l=o===void 0?[]:o,u=n.ignores,f=u===void 0?[]:u,h=n.icons,g=h===void 0?{}:h,v=n.i18n,p=v===void 0?[]:v;s.config.plugins||(s.config.plugins=[]),s.config.ignores||(s.config.ignores=[]),(t=s.config.plugins).push.apply(t,Q(l)),(e=s.config.ignores).push.apply(e,Q(f)),Object.keys(g).map(function(_){s.config.icons[_]||(s.config.icons[_]=g[_])});var m=s.config.i18n||[];p.push.apply(p,Q(m)),s.config.i18n=p},io=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(y(t),"onMouseEnter",function(o){var l=y(t),u=l.player,f=l.playerConfig;f.closeControlsBlur&&u.focus({autoHide:!1})}),k(y(t),"onMouseLeave",function(o){var l=y(t),u=l.player;u.focus()}),t}return S(r,[{key:"beforeCreate",value:function(e){!e.config.mode&&O.device==="mobile"&&(e.config.mode="flex"),e.player.config.marginControls&&(e.config.autoHide=!1)}},{key:"afterCreate",value:function(){var e=this,i=this.config,n=i.disable,o=i.height,l=i.mode;if(!n){l==="flex"&&this.player.addClass(b.FLEX_CONTROLS);var u={height:"".concat(o,"px")};Object.keys(u).map(function(h){e.root.style[h]=u[h]}),this.left=this.find("xg-left-grid"),this.center=this.find("xg-center-grid"),this.right=this.find("xg-right-grid"),this.innerRoot=this.find("xg-inner-controls"),this.on(Xe,function(h){h?d.addClass(e.root,"mini-controls"):d.removeClass(e.root,"mini-controls")});var f=this.playerConfig.isMobileSimulateMode;O.device!=="mobile"&&f!=="mobile"&&(this.bind("mouseenter",this.onMouseEnter),this.bind("mouseleave",this.onMouseLeave))}}},{key:"focus",value:function(){this.player.focus({autoHide:!1})}},{key:"focusAwhile",value:function(){this.player.focus({autoHide:!0})}},{key:"blur",value:function(){this.player.blur({ignorePaused:!0})}},{key:"recoverAutoHide",value:function(){this.config.autoHide&&d.addClass(this.root,b.CONTROLS_AUTOHIDE)}},{key:"pauseAutoHide",value:function(){d.removeClass(this.root,b.CONTROLS_AUTOHIDE)}},{key:"show",value:function(e){this.root.style.display="",this.player.focus()}},{key:"hide",value:function(){this.root.style.display="none"}},{key:"mode",get:function(){return this.config.mode}},{key:"registerPlugin",value:function(e){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;if(this.root){var o=e.defaultConfig||{};if(!i.root){var l=i.position?i.position:i.config&&i.config.position?i.config.position:o.position;switch(l){case V.CONTROLS_LEFT:i.root=this.left;break;case V.CONTROLS_RIGHT:i.root=this.right;break;case V.CONTROLS_CENTER:i.root=this.center;break;case V.CONTROLS:i.root=this.root;break;default:i.root=this.left}return L(A(r.prototype),"registerPlugin",this).call(this,e,i,n)}}}},{key:"destroy",value:function(){O.device!=="mobile"&&(this.unbind("mouseenter",this.onMouseEnter),this.unbind("mouseleave",this.onMouseLeave))}},{key:"render",value:function(){var e=this.config,i=e.mode,n=e.autoHide,o=e.initShow,l=e.disable;if(!l){var u=d.classNames({"xgplayer-controls":!0},{"flex-controls":i==="flex"},{"bottom-controls":i==="bottom"},k({},b.CONTROLS_AUTOHIDE,n),{"xgplayer-controls-initshow":o||!n});return'<xg-controls class="'.concat(u,`" unselectable="on">
1
+ (function(ie,c){typeof exports=="object"&&typeof module<"u"?c(exports,require("vue"),require("iking-utils-pro"),require("element-plus")):typeof define=="function"&&define.amd?define(["exports","vue","iking-utils-pro","element-plus"],c):(ie=typeof globalThis<"u"?globalThis:ie||self,c(ie.index={},ie.vue,ie["iking-utils-pro"],ie["element-plus"]))})(this,function(ie,c,Te,Qi){"use strict";const ce=(a,s)=>{if(a.install=r=>{for(const t of[a,...Object.values(s??{})])r.component(t.name,t)},s)for(const[r,t]of Object.entries(s))a[r]=t;return a},lt=(a,s)=>{var i,n,o,l;const r=(i=a==null?void 0:a.response)!=null&&i.data?Wt((o=(n=a==null?void 0:a.response)==null?void 0:n.data)==null?void 0:o.suffix):((l=a.raw)==null?void 0:l.type)||Wt(a[s.suffix]),t=r==null?void 0:r.toLowerCase(),e={sheet:"excel",excel:"excel",zip:"zip","application/x-compressed":"zip",image:"image",video:"video",audio:"audio",pdf:"pdf",text:"txt",txt:"txt",word:"word",ppt:"ppt",exe:"exe",json:"json"};for(let u in e)if(typeof t=="string"&&(t.includes(u)||t===u))return e[u];return"unknown"},en={".doc":"word",".docx":"word",".docxf":"word",".docm":"word",".dot":"word",".dotm":"word",".dotx":"word",".epub":"word",".fodt":"word",".htm":"word",".html":"word",".mht":"word",".odt":"word",".ott":"word",".rtf":"word",".djvu":"word",".oxps":"word",".oform":"word",".fb2":"word",".xml":"word",".xps":"word",".csv":"excel",".xls":"excel",".xlsx":"excel",".fods":"excel",".ods":"excel",".ots":"excel",".xlsb":"excel",".xlsm":"excel",".xlt":"excel",".xltm":"excel",".xltx":"excel",".fodp":"ppt",".odp":"ppt",".otp":"ppt",".pot":"ppt",".potm":"ppt",".potx":"ppt",".pps":"ppt",".ppsm":"ppt",".ppsx":"ppt",".ppt":"ppt",".pptm":"ppt",".pptx":"ppt",".zip":"zip",".rar":"zip",".7z":"zip",".apz":"zip",".ar":"zip",".bz":"zip",".car":"zip",".dar":"zip",".cpgz":"zip",".f":"zip",".ha":"zip",".hbc":"zip",".hbc2":"zip",".hbe":"zip",".hpk":"zip",".hyp":"zip",".png":"image",".jpg":"image",".jpeg":"image",".bmp":"image",".gif":"image",".webp":"image",".psd":"image",".svg":"image",".tiff":"image",".avi":"video",".wmv":"video",".mpeg":"video",".mp4":"video",".mpm4v":"video",".mov":"video",".asf":"video",".flv":"video",".f4v":"video",".rmvb":"video",".rm":"video",".3gp":"video",".vob":"video",".txt":"txt",".pdf":"pdf"},Wt=a=>{const s=a==null?void 0:a.toLocaleLowerCase(),r=s!=null&&s.startsWith(".")?s:`.${s}`;return r&&en[r]||"unknow"},tn=a=>{let s="",r=["doc","docx"],t=["xls","xlsx"],e=["ppt","pptx"],i=["pdf"];return r.includes(a)&&(s="word"),t.includes(a)&&(s="cell"),e.includes(a)&&(s="slide"),i.includes(a)&&(s="text-pdf"),s},nn={key:0,t:"1686300059786",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"7671",width:"200",height:"200"},rn=[c.createElementVNode("path",{d:"M160 0h512l256 256v704c0 35.3472-28.6528 64-64 64H160c-35.3472 0-64-28.6528-64-64V64c0-35.3472 28.6528-64 64-64z",fill:"#50CD89","p-id":"7672"},null,-1),c.createElementVNode("path",{d:"M258.528 742.0672L351.8336 604.928a14.5024 14.5024 0 0 1 22.1696-2.1824l61.664 60.416 135.296-212.064a14.5024 14.5024 0 0 1 24.8064 0.5568l168.1024 291.328a14.5024 14.5024 0 0 1-12.5696 21.7664H270.528a14.5024 14.5024 0 0 1-12.0064-22.6816z",fill:"#FFF7F7","p-id":"7673"},null,-1),c.createElementVNode("path",{d:"M359.616 431.5456m-73.1456 0a73.1456 73.1456 0 1 0 146.2912 0 73.1456 73.1456 0 1 0-146.2912 0Z",fill:"#FFFFFF","p-id":"7674"},null,-1),c.createElementVNode("path",{d:"M672 0l256 256h-192c-35.3472 0-64-28.6528-64-64V0z",fill:"#a9f6cc","p-id":"7675"},null,-1)],on={key:1,t:"1686301531714",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"9067",width:"200",height:"200"},sn=[c.createElementVNode("path",{d:"M409.6 0v68.266667h-34.133333c-20.48 0-34.133333 13.653333-34.133334 34.133333s13.653333 34.133333 34.133334 34.133333H409.6v68.266667h-34.133333c-20.48 0-34.133333 13.653333-34.133334 34.133333s13.653333 34.133333 34.133334 34.133334H409.6v68.266666h-34.133333c-20.48 0-34.133333 13.653333-34.133334 34.133334s13.653333 34.133333 34.133334 34.133333H409.6v68.266667h-34.133333c-20.48 0-34.133333 13.653333-34.133334 34.133333s13.653333 34.133333 34.133334 34.133333h68.266666c20.48 0 34.133333-13.653333 34.133334-34.133333V477.866667h34.133333c20.48 0 34.133333-13.653333 34.133333-34.133334S532.48 409.6 512 409.6H477.866667V341.333333h34.133333c20.48 0 34.133333-13.653333 34.133333-34.133333S532.48 273.066667 512 273.066667H477.866667V204.8h34.133333c20.48 0 34.133333-13.653333 34.133333-34.133333S532.48 136.533333 512 136.533333H477.866667V0h204.8l273.066666 273.066667v614.4c0 75.093333-61.44 136.533333-136.533333 136.533333H204.8c-75.093333 0-136.533333-61.44-136.533333-136.533333V136.533333C68.266667 61.44 129.706667 0 204.8 0h204.8z m0 682.666667h68.266667v68.266666H409.6v-68.266666z m-34.133333-68.266667c-20.48 0-34.133333 13.653333-34.133334 34.133333v136.533334c0 20.48 13.653333 34.133333 34.133334 34.133333h136.533333c20.48 0 34.133333-13.653333 34.133333-34.133333v-136.533334c0-20.48-13.653333-34.133333-34.133333-34.133333h-136.533333z",fill:"#FFA621","p-id":"9068"},null,-1),c.createElementVNode("path",{d:"M682.666667 0l273.066666 273.066667h-204.8c-40.96 0-68.266667-27.306667-68.266666-68.266667V0z",fill:"#f5d37b","p-id":"9069"},null,-1)],an={key:2,t:"1686300141125",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"8137",width:"200",height:"200"},ln=[c.createElementVNode("path",{d:"M204.8 0h477.866667l273.066666 273.066667v614.4c0 75.093333-61.44 136.533333-136.533333 136.533333H204.8c-75.093333 0-136.533333-61.44-136.533333-136.533333V136.533333C68.266667 61.44 129.706667 0 204.8 0z m204.8 546.133333V443.733333h204.8v136.533334H409.6V546.133333z m0 102.4h204.8c40.96 0 68.266667-27.306667 68.266667-68.266666v-136.533334c0-40.96-27.306667-68.266667-68.266667-68.266666H409.6c-40.96 0-68.266667 27.306667-68.266667 68.266666V819.2c0 20.48 13.653333 34.133333 34.133334 34.133333s34.133333-13.653333 34.133333-34.133333V648.533333z",fill:"#F1416C","p-id":"8138"},null,-1),c.createElementVNode("path",{d:"M682.666667 0l273.066666 273.066667h-204.8c-40.96 0-68.266667-27.306667-68.266666-68.266667V0z",fill:"#f78cbc","p-id":"8139"},null,-1)],un={key:3,t:"1686300157181",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"8292",width:"200",height:"200"},cn=[c.createElementVNode("path",{d:"M204.8 0h477.866667l273.066666 273.066667v614.4c0 75.093333-61.44 136.533333-136.533333 136.533333H204.8c-75.093333 0-136.533333-61.44-136.533333-136.533333V136.533333C68.266667 61.44 129.706667 0 204.8 0z m307.2 607.573333l68.266667 191.146667c13.653333 27.306667 54.613333 27.306667 61.44 0l102.4-273.066667c6.826667-20.48 0-34.133333-20.48-40.96s-34.133333 0-40.96 13.653334l-68.266667 191.146666-68.266667-191.146666c-13.653333-27.306667-54.613333-27.306667-68.266666 0l-68.266667 191.146666-68.266667-191.146666c-6.826667-13.653333-27.306667-27.306667-47.786666-20.48s-27.306667 27.306667-20.48 47.786666l102.4 273.066667c13.653333 27.306667 54.613333 27.306667 61.44 0l75.093333-191.146667z",fill:"#029EF7","p-id":"8293"},null,-1),c.createElementVNode("path",{d:"M682.666667 0l273.066666 273.066667h-204.8c-40.96 0-68.266667-27.306667-68.266666-68.266667V0z",fill:"#64b5ed","p-id":"8294"},null,-1)],fn={key:4,t:"1686300180947",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"8447",width:"200",height:"200"},hn=[c.createElementVNode("path",{d:"M204.8 0h477.866667l273.066666 273.066667v614.4c0 75.093333-61.44 136.533333-136.533333 136.533333H204.8c-75.093333 0-136.533333-61.44-136.533333-136.533333V136.533333C68.266667 61.44 129.706667 0 204.8 0z m477.866667 730.453333c20.48 0 68.266667 0 68.266666-47.786666 0-20.48-6.826667-47.786667-68.266666-47.786667-27.306667 0-54.613333 6.826667-81.92 6.826667-34.133333-27.306667-68.266667-61.44-88.746667-102.4 20.48-75.093333 20.48-122.88 6.826667-150.186667-6.826667-6.826667-20.48-13.653333-34.133334-13.653333-20.48 0-34.133333 6.826667-40.96 20.48-20.48 40.96 13.653333 116.053333 27.306667 150.186666-20.48 54.613333-40.96 109.226667-68.266667 163.84C273.066667 764.586667 273.066667 798.72 273.066667 812.373333c0 13.653333 6.826667 27.306667 20.48 34.133334 6.826667 6.826667 13.653333 6.826667 20.48 6.826666 34.133333 0 68.266667-34.133333 116.053333-109.226666 54.613333-20.48 102.4-40.96 157.013333-47.786667 27.306667 20.48 61.44 34.133333 95.573334 34.133333zM491.52 416.426667c6.826667 20.48 6.826667 47.786667 0 68.266666-13.653333-20.48-13.653333-40.96-13.653333-68.266666h13.653333z m-177.493333 395.946666c13.653333-20.48 27.306667-27.306667 47.786666-40.96-13.653333 20.48-27.306667 34.133333-47.786666 40.96z m184.32-204.8c13.653333 20.48 34.133333 47.786667 54.613333 68.266667H546.133333c-27.306667 6.826667-61.44 13.653333-88.746666 27.306667 13.653333-34.133333 27.306667-61.44 40.96-95.573334z m177.493333 68.266667c27.306667 0 34.133333 6.826667 34.133333 13.653333-6.826667 0-20.48 6.826667-27.306666 0-13.653333 0-27.306667-6.826667-40.96-13.653333h34.133333z",fill:"#F1416C","p-id":"8448"},null,-1),c.createElementVNode("path",{d:"M682.666667 0l273.066666 273.066667h-204.8c-40.96 0-68.266667-27.306667-68.266666-68.266667V0z",fill:"#f78cbc","p-id":"8449"},null,-1)],dn={key:5,t:"1686300195363",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"8602",width:"200",height:"200"},gn=[c.createElementVNode("path",{d:"M204.8 0h477.866667l273.066666 273.066667v614.4c0 75.093333-61.44 136.533333-136.533333 136.533333H204.8c-75.093333 0-136.533333-61.44-136.533333-136.533333V136.533333C68.266667 61.44 129.706667 0 204.8 0z m341.333333 512h136.533334c20.48 0 34.133333-13.653333 34.133333-34.133333s-13.653333-34.133333-34.133333-34.133334H341.333333c-20.48 0-34.133333 13.653333-34.133333 34.133334s13.653333 34.133333 34.133333 34.133333h136.533334V819.2c0 20.48 13.653333 34.133333 34.133333 34.133333s34.133333-13.653333 34.133333-34.133333V512z",fill:"#029EF7","p-id":"8603"},null,-1),c.createElementVNode("path",{d:"M682.666667 0l273.066666 273.066667h-204.8c-40.96 0-68.266667-27.306667-68.266666-68.266667V0z",fill:"#64b5ed","p-id":"8604"},null,-1)],pn={key:6,t:"1686300209288",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"8757",width:"200",height:"200"},vn=[c.createElementVNode("path",{d:"M204.8 0h477.866667l273.066666 273.066667v614.4c0 75.093333-61.44 136.533333-136.533333 136.533333H204.8c-75.093333 0-136.533333-61.44-136.533333-136.533333V136.533333C68.266667 61.44 129.706667 0 204.8 0z m464.213333 375.466667l-232.106666 61.44c-27.306667 13.653333-47.786667 34.133333-47.786667 61.44v218.453333s-20.48-13.653333-54.613333-6.826667c-47.786667 6.826667-95.573333 47.786667-95.573334 88.746667 0 40.96 47.786667 61.44 95.573334 54.613333 54.613333-6.826667 95.573333-40.96 95.573333-81.92V559.786667c0-13.653333 27.306667-27.306667 27.306667-27.306667L655.36 477.866667s20.48-6.826667 20.48 13.653333v170.666667s-20.48-13.653333-54.613333-6.826667c-54.613333 6.826667-95.573333 40.96-95.573334 81.92s47.786667 68.266667 95.573334 61.44 95.573333-40.96 95.573333-81.92V409.6c0-27.306667-27.306667-40.96-47.786667-34.133333z",fill:"#FFA621","p-id":"8758"},null,-1),c.createElementVNode("path",{d:"M682.666667 0l273.066666 273.066667h-204.8c-40.96 0-68.266667-27.306667-68.266666-68.266667V0z",fill:"#f5d37b","p-id":"8759"},null,-1)],mn={key:7,t:"1686300225262",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"8912",width:"200",height:"200"},yn=[c.createElementVNode("path",{d:"M204.8 0h477.866667l273.066666 273.066667v614.4c0 75.093333-61.44 136.533333-136.533333 136.533333H204.8c-75.093333 0-136.533333-61.44-136.533333-136.533333V136.533333C68.266667 61.44 129.706667 0 204.8 0z m307.2 853.333333c150.186667 0 273.066667-122.88 273.066667-273.066666s-122.88-273.066667-273.066667-273.066667-273.066667 122.88-273.066667 273.066667 122.88 273.066667 273.066667 273.066666z m0-68.266666c-116.053333 0-204.8-88.746667-204.8-204.8s88.746667-204.8 204.8-204.8 204.8 88.746667 204.8 204.8-88.746667 204.8-204.8 204.8zM614.4 600.746667l6.826667-6.826667c6.826667-13.653333 6.826667-27.306667-6.826667-34.133333L484.693333 471.04s-6.826667-6.826667-13.653333-6.826667c-13.653333 0-27.306667 13.653333-27.306667 27.306667v170.666667c0 6.826667 0 13.653333 6.826667 13.653333 6.826667 13.653333 27.306667 13.653333 40.96 6.826667L614.4 600.746667z",fill:"#FFA621","p-id":"8913"},null,-1),c.createElementVNode("path",{d:"M682.666667 0l273.066666 273.066667h-204.8c-40.96 0-68.266667-27.306667-68.266666-68.266667V0z",fill:"#f5d37b","p-id":"8914"},null,-1)],_n={key:8,t:"1692251753690",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"4336",width:"200",height:"200"},kn=[c.createElementVNode("path",{d:"M192 0h448.170667l319.829333 320V896a128 128 0 0 1-128 128H192a128 128 0 0 1-128-128V128A128 128 0 0 1 192 0z",fill:"#00BD76","p-id":"4337"},null,-1),c.createElementVNode("path",{d:"M388.5056 631.261867H307.541333v54.852266h95.095467v33.8944H265.3184v-204.765866h136.977067v34.167466H307.5072v48.810667h80.9984v33.041067z m112.093867-45.397334l38.4-70.621866h48.503466l-59.630933 101.546666 61.201067 103.2192h-49.117867l-39.355733-71.714133-39.389867 71.68h-49.0496l61.166933-103.185067-59.630933-101.546666h48.503467l38.4 70.587733z m266.922666 65.9456c-0.648533 9.898667-3.037867 19.592533-7.0656 28.672-3.7888 8.533333-9.352533 16.1792-16.315733 22.4256-6.929067 6.2464-15.36 11.127467-25.258667 14.6432-9.864533 3.4816-21.128533 5.256533-33.792 5.256534-13.1072 0-24.917333-2.286933-35.362133-6.826667a72.260267 72.260267 0 0 1-26.555733-19.626667 89.019733 89.019733 0 0 1-16.725334-30.993066 133.597867 133.597867 0 0 1-5.870933-40.8576v-13.482667c0-15.121067 2.048-28.740267 6.0416-40.925867 4.061867-12.1856 9.728-22.528 17.1008-31.061333 7.338667-8.533333 16.4864-15.2576 26.794667-19.694933 10.478933-4.608 22.186667-6.894933 35.157333-6.894934 12.731733 0 24.029867 1.809067 33.792 5.393067 9.8304 3.618133 18.1248 8.635733 24.9856 15.0528 6.826667 6.485333 12.288 14.267733 16.042667 22.9376 3.822933 8.874667 6.2464 18.466133 7.304533 28.8768h-42.1888a63.829333 63.829333 0 0 0-3.1744-16.145067 31.744 31.744 0 0 0-7.099733-11.810133 29.354667 29.354667 0 0 0-11.946667-7.2704 55.944533 55.944533 0 0 0-17.749333-2.4576c-14.2336 0-24.849067 5.188267-31.812267 15.5648-6.997333 10.3424-10.478933 26.385067-10.478933 48.128v13.789867c0 10.581333 0.750933 19.899733 2.321066 27.8528 1.536 7.953067 3.959467 14.609067 7.304534 19.968a32.221867 32.221867 0 0 0 12.970666 12.014933c5.256533 2.696533 11.639467 4.027733 19.182934 4.027733 6.656 0 12.3904-0.750933 17.2032-2.2528a30.549333 30.549333 0 0 0 12.0832-6.826666 30.685867 30.685867 0 0 0 7.509333-11.4688c1.809067-4.573867 2.935467-9.898667 3.413333-16.042667h42.154667z",fill:"#FFFFFF",opacity:".9","p-id":"4338"},null,-1),c.createElementVNode("path",{d:"M640 0l320 320H768a128 128 0 0 1-128-128V0z",fill:"#19EA9C","p-id":"4339"},null,-1)],Cn={key:9,t:"1692251753690",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"4336",width:"200",height:"200"},En=[c.createElementVNode("path",{d:"M145.6 0C100.8 0 64 36.8 64 81.6v860.8C64 987.2 100.8 1024 145.6 1024h732.8c44.8 0 81.6-36.8 81.6-81.6V324.8L657.6 0h-512z",fill:"#8199AF","p-id":"8002"},null,-1),c.createElementVNode("path",{d:"M960 326.4v16H755.2s-100.8-20.8-99.2-107.2c0 0 3.2 91.2 96 91.2h208z",fill:"#617F9B","p-id":"8003"},null,-1),c.createElementVNode("path",{d:"M657.6 0v233.6c0 25.6 17.6 92.8 97.6 92.8H960L657.6 0z",fill:"#FFFFFF",opacity:".5","p-id":"8004"},null,-1),c.createElementVNode("path",{d:"M344 862.4h-100.8c-9.6 0-17.6-8-17.6-17.6V688c0-9.6 8-17.6 17.6-17.6h100.8c4.8 0 9.6 4.8 9.6 11.2 0 6.4-4.8 9.6-9.6 9.6h-94.4v62.4h91.2c6.4 0 11.2 4.8 11.2 11.2 0 6.4-4.8 9.6-11.2 9.6h-91.2v67.2h94.4c4.8 0 9.6 4.8 9.6 9.6 0 6.4-4.8 11.2-9.6 11.2z m193.6 1.6c-4.8 0-8 0-9.6-3.2l-59.2-80-60.8 80c-1.6 3.2-4.8 3.2-8 3.2-6.4 0-11.2-4.8-11.2-11.2 0-1.6 0-4.8 1.6-6.4l62.4-81.6-57.6-78.4c-1.6-1.6-3.2-3.2-3.2-6.4 0-4.8 4.8-11.2 12.8-11.2 3.2 0 6.4 1.6 8 4.8l56 73.6 54.4-73.6c1.6-3.2 4.8-4.8 9.6-4.8s11.2 4.8 11.2 11.2c0 3.2 0 4.8-1.6 6.4l-57.6 76.8 60.8 83.2c1.6 1.6 3.2 4.8 3.2 6.4 0 6.4-6.4 11.2-11.2 11.2z m171.2-1.6h-99.2c-9.6 0-17.6-8-17.6-17.6V688c0-9.6 8-17.6 17.6-17.6h99.2c6.4 0 11.2 4.8 11.2 11.2 0 6.4-4.8 9.6-11.2 9.6h-92.8v62.4h91.2c6.4 0 11.2 4.8 11.2 11.2 0 6.4-4.8 9.6-11.2 9.6h-91.2v67.2h92.8c6.4 0 11.2 4.8 11.2 9.6 0 6.4-4.8 11.2-11.2 11.2z",fill:"#FFFFFF","p-id":"8005"},null,-1)],wn={key:10,t:"1714099890925",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"2271",width:"200",height:"200"},bn=[c.createElementVNode("path",{d:"M227.555556 28.444444h389.404444a19.911111 19.911111 0 0 1 14.734222 6.542223l271.132445 298.211555a28.444444 28.444444 0 0 1 7.395555 19.143111V938.666667a56.888889 56.888889 0 0 1-56.888889 56.888889H227.555556a56.888889 56.888889 0 0 1-56.888889-56.888889V85.333333a56.888889 56.888889 0 0 1 56.888889-56.888889z",fill:"#0DD59D","p-id":"2272"},null,-1),c.createElementVNode("path",{d:"M625.777778 30.492444a19.911111 19.911111 0 0 1 5.916444 4.465778l271.132445 298.24a28.444444 28.444444 0 0 1 5.176889 8.135111H682.666667a56.888889 56.888889 0 0 1-56.888889-56.888889V30.492444z",fill:"#FFFFFF","fill-opacity":".65","p-id":"2273"},null,-1),c.createElementVNode("path",{d:"M396.288 645.176889c0 5.461333-0.796444 10.865778-2.389333 16.156444-1.592889 5.319111-4.266667 10.069333-7.964445 14.222223-3.697778 4.181333-8.647111 7.509333-14.791111 10.012444a60.871111 60.871111 0 0 1-22.869333 3.754667c-15.160889 0-26.851556-3.982222-35.043556-11.946667-8.192-7.964444-12.288-19.683556-12.288-35.157333v-10.012445h21.617778v6.826667c0 4.721778 0.369778 9.045333 1.137778 12.970667a28.074667 28.074667 0 0 0 3.982222 10.24 18.773333 18.773333 0 0 0 7.964444 6.712888c3.413333 1.592889 7.765333 2.389333 13.084445 2.389334 9.870222 0 16.64-2.645333 20.366222-7.964445 3.697778-5.290667 5.575111-12.430222 5.575111-21.390222v-118.784h21.617778v121.969778z m44.145778 3.413333c0.142222 4.266667 1.137778 7.850667 2.958222 10.808889a20.593778 20.593778 0 0 0 7.168 7.054222c2.958222 1.763556 6.286222 3.015111 10.012444 3.754667 3.697778 0.768 7.537778 1.137778 11.491556 1.137778 3.043556 0 6.229333-0.227556 9.557333-0.682667 3.328-0.455111 6.4-1.28 9.216-2.503111a17.294222 17.294222 0 0 0 6.940445-5.347556 14.250667 14.250667 0 0 0 2.730666-8.988444 12.885333 12.885333 0 0 0-5.688888-11.377778c-3.783111-2.56-8.533333-4.664889-14.222223-6.257778a232.561778 232.561778 0 0 0-18.545777-4.323555 96.227556 96.227556 0 0 1-18.545778-5.461333 38.4 38.4 0 0 1-14.222222-9.898667c-3.783111-4.266667-5.688889-10.154667-5.688889-17.749333a28.16 28.16 0 0 1 3.982222-15.246223c2.645333-4.266667 6.058667-7.68 10.24-10.353777 4.181333-2.645333 8.874667-4.608 14.108444-5.916445 5.233778-1.28 10.439111-1.934222 15.587556-1.934222 6.684444 0 12.8 0.568889 18.432 1.706667 5.603556 1.137778 10.581333 3.128889 14.904889 5.916444 4.323556 2.816 7.765333 6.599111 10.353778 11.377778 2.56 4.778667 4.096 10.752 4.551111 17.863111h-19.342223a19.569778 19.569778 0 0 0-2.958222-9.443556 19.370667 19.370667 0 0 0-6.371555-6.030222 28.956444 28.956444 0 0 0-8.533334-3.299555 43.918222 43.918222 0 0 0-9.443555-1.024c-2.872889 0-5.802667 0.227556-8.760889 0.682666a29.496889 29.496889 0 0 0-8.078222 2.389334 16.270222 16.270222 0 0 0-5.916445 4.551111 11.463111 11.463111 0 0 0-2.275555 7.395555c0 3.356444 1.166222 6.115556 3.527111 8.305778a28.16 28.16 0 0 0 8.988444 5.461333c3.640889 1.422222 7.736889 2.673778 12.288 3.640889 4.551111 0.995556 9.102222 1.991111 13.653334 3.072 4.835556 1.080889 9.585778 2.360889 14.222222 3.868445 4.636444 1.536 8.732444 3.527111 12.288 6.030222s6.456889 5.660444 8.647111 9.443555a27.733333 27.733333 0 0 1 3.299555 14.108445c0 7.111111-1.479111 13.056-4.437333 17.749333a34.702222 34.702222 0 0 1-11.605333 11.377778 48.497778 48.497778 0 0 1-16.156445 6.030222c-5.973333 1.137778-11.946667 1.706667-17.863111 1.706667a82.773333 82.773333 0 0 1-18.659555-2.048 45.795556 45.795556 0 0 1-15.701334-6.712889 34.218667 34.218667 0 0 1-10.922666-12.288 42.581333 42.581333 0 0 1-4.551111-18.545778h19.342222z m116.053333-21.617778c0 7.111111 0.938667 13.482667 2.844445 19.000889 1.905778 5.546667 4.522667 10.183111 7.850666 13.880889a34.076444 34.076444 0 0 0 25.941334 11.491556 34.076444 34.076444 0 0 0 25.941333-11.491556c3.328-3.697778 5.973333-8.334222 7.850667-13.880889 1.905778-5.518222 2.844444-11.861333 2.844444-19.000889 0-7.111111-0.938667-13.454222-2.844444-19.000888a41.016889 41.016889 0 0 0-7.850667-13.994667 33.422222 33.422222 0 0 0-11.719111-8.647111 34.872889 34.872889 0 0 0-14.222222-2.958222c-5.006222 0-9.756444 0.995556-14.222223 2.958222-4.465778 1.991111-8.391111 4.835556-11.719111 8.647111-3.328 3.811556-5.973333 8.476444-7.850666 13.994667-1.905778 5.546667-2.844444 11.889778-2.844445 19.000888z m-20.48 0c0-8.647111 1.223111-16.725333 3.640889-24.234666a54.897778 54.897778 0 0 1 10.922667-19.569778c4.835556-5.518222 10.837333-9.898667 17.976889-13.084444 7.111111-3.185778 15.331556-4.778667 24.576-4.778667 9.386667 0 17.635556 1.592889 24.689777 4.778667 7.054222 3.185778 12.999111 7.566222 17.863111 13.084444 4.835556 5.546667 8.504889 12.060444 10.922667 19.569778 2.417778 7.509333 3.640889 15.587556 3.640889 24.234666 0 8.647111-1.223111 16.696889-3.640889 24.120889-2.417778 7.452444-6.058667 13.937778-10.922667 19.456-4.835556 5.546667-10.808889 9.870222-17.863111 12.970667-7.054222 3.128889-15.274667 4.664889-24.689777 4.664889-9.244444 0-17.436444-1.536-24.576-4.664889a50.261333 50.261333 0 0 1-17.976889-12.970667 55.068444 55.068444 0 0 1-10.922667-19.456 77.283556 77.283556 0 0 1-3.640889-24.120889z m136.988445-58.936888h18.204444v18.659555h0.455111c8.049778-14.250667 20.764444-21.390222 38.229333-21.390222 7.736889 0 14.193778 1.080889 19.342223 3.185778 5.148444 2.133333 9.329778 5.091556 12.515555 8.874666 3.185778 3.811556 5.404444 8.305778 6.712889 13.539556 1.28 5.233778 1.934222 11.036444 1.934222 17.408v77.368889h-19.342222v-79.644445c0-7.281778-2.133333-13.027556-6.371555-17.294222-4.266667-4.266667-10.097778-6.371556-17.521778-6.371555-5.916444 0-11.036444 0.910222-15.36 2.730666a28.814222 28.814222 0 0 0-10.808889 7.736889 33.336889 33.336889 0 0 0-6.485333 11.719111c-1.422222 4.494222-2.161778 9.386667-2.161778 14.677334v66.446222h-19.342222V568.035556z",fill:"#FFFFFF","p-id":"2274"},null,-1)],Tn={key:11,t:"1686300037564",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"7515",width:"200",height:"200"},Sn=[c.createElementVNode("path",{d:"M160 0h512l256 256v704c0 35.3472-28.6528 64-64 64H160c-35.3472 0-64-28.6528-64-64V64c0-35.3472 28.6528-64 64-64z",fill:"#029EF7","p-id":"7516"},null,-1),c.createElementVNode("path",{d:"M672 0l256 256h-192c-35.3472 0-64-28.6528-64-64V0z",fill:"#64b5ed","p-id":"7517"},null,-1),c.createElementVNode("path",{d:"M384 499.2c0-25.6 5.12-46.08 10.24-58.88 5.12-12.8 15.36-25.6 28.16-35.84 12.8-12.8 25.6-20.48 43.52-25.6 15.36-5.12 30.72-7.68 48.64-7.68 35.84 0 64 10.24 89.6 30.72C627.2 422.4 640 448 640 481.28c0 15.36-5.12 28.16-10.24 40.96s-17.92 28.16-38.4 46.08-28.16 30.72-35.84 38.4c-7.68 7.68-10.24 17.92-15.36 28.16-5.12 10.24-2.56 17.92-2.56 43.52h-51.2c0-25.6 2.56-38.4 5.12-51.2s7.68-23.04 15.36-33.28 15.36-23.04 33.28-40.96c17.92-17.92 30.72-30.72 35.84-38.4 5.12-7.68 10.24-20.48 10.24-38.4s-7.68-30.72-20.48-43.52-30.72-20.48-53.76-20.48c-51.2 0-76.8 35.84-76.8 87.04h-51.2z m153.6 281.6h-51.2v-51.2h51.2v51.2z",fill:"#FFFFFF","p-id":"7518"},null,-1)],xn=ce(c.defineComponent({__name:"IkFileIcon",props:{type:{type:String,default:"unknow"},file:{type:Object,default:()=>null},fields:{type:Object,default:()=>({name:"name",url:"url",suffix:"suffix"})}},setup(a){const s=a,r=c.computed(()=>s.file?lt(s.file,s.fields):s.type);return(t,e)=>r.value==="image"?(c.openBlock(),c.createElementBlock("svg",nn,rn)):r.value==="zip"?(c.openBlock(),c.createElementBlock("svg",on,sn)):r.value==="ppt"?(c.openBlock(),c.createElementBlock("svg",an,ln)):r.value==="word"?(c.openBlock(),c.createElementBlock("svg",un,cn)):r.value==="pdf"?(c.openBlock(),c.createElementBlock("svg",fn,hn)):r.value==="txt"?(c.openBlock(),c.createElementBlock("svg",dn,gn)):r.value==="audio"?(c.openBlock(),c.createElementBlock("svg",pn,vn)):r.value==="video"?(c.openBlock(),c.createElementBlock("svg",mn,yn)):r.value==="excel"?(c.openBlock(),c.createElementBlock("svg",_n,kn)):r.value==="exe"?(c.openBlock(),c.createElementBlock("svg",Cn,En)):r.value==="json"?(c.openBlock(),c.createElementBlock("svg",wn,bn)):(c.openBlock(),c.createElementBlock("svg",Tn,Sn))}}));/*! Element Plus Icons Vue v2.3.1 */var In=c.defineComponent({name:"Close",__name:"close",setup(a){return(s,r)=>(c.openBlock(),c.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[c.createElementVNode("path",{fill:"currentColor",d:"M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z"})]))}}),Pn=In;const Me=(a,s)=>{const r=a.__vccOpts||a;for(const[t,e]of s)r[t]=e;return r},An=a=>({nodeType:{发起人节点:"INITIATOR",审批节点:"APPROVE",抄送节点:"CARBON_COPY",办理节点:"DISPOSE",分支节点:"BRANCH",条件节点:"CONDITION",结束节点:"END",并行分支:"PARALLEL",子流程:"SUB_PROCESS",...a.defaultNodeType},defaultFile:{id:"id",parallelInstances:"parallelInstances",backToInstanceNodeName:"backToInstanceNodeName",backToRecordNodeName:"backToRecordNodeName",nodeId:"sortOrder",nodeType:"type",nodeTypeName:"name",approveStatus:"status",approveStatusName:"statusName",approveType:"approveType",multiExecutorType:"multiExecutorType",approveTypeName:"approveTypeName",multiExecutorTypeName:"multiExecutorTypeName",approvalCategory:"approvalCategory",isShowAdd:"initiatorSpecify",isShowAddCopy:"initiatorSpecifyCarbonCopy",executorEmpty:"executorEmpty",executorEmptyStrategy:"executorEmptyStrategy",reserveExecutorUsers:"reserveExecutorUsers",approvePersonList:"executorUsers",initiatorSpecifiedScope:"initiatorSpecifiedScope",initiatorSpecifiedScopeType:"initiatorSpecifiedScopeType",singleApproval:"singleApproval",originator:"username",...a.defaultFieldMap},statusWithoutApprover:{自动通过:"AUTO_PASS",自动拒绝:"AUTO_REJECT",自动转交管理员:"TRANSMIT_TO_MANAGER",指定人员审批:"SPECIFIED_USER",...a.statusWithoutApprover},multiple:!1,chooseType:[],statusOption:{发起:"INITIATE",等待:"WAIT",同意:"PASS",撤销:"REVOKE",拒绝:"REJECT",转交:"TRANSFER",加签:"APPEND",退回:"BACK",评论:"COMMENT",待执行:"WAITING",执行中:"RUNNING",...a.defaultStatus},listData:[]}),Ln=(a,s,r)=>{let t="";switch(s){case a.nodeType.审批节点:r&&r.length==1?t="ikapprove-ziyuan":t="ikapprove-shenpi";break;case a.nodeType.办理节点:t="ikapprove-bianji";break;case a.nodeType.抄送节点:t="ikapprove-chaosong";break;case a.nodeType.并行分支:t="ikapprove-fenzhi";break;case a.nodeType.子流程:t="ikapprove-ziliucheng1";break;default:t="ikapprove-ziyuan"}return`ikapprove ${t}`},ut=a=>{const s=c.inject("loadUrl"),r=c.computed(()=>a.loadUrl||a.fileUrl||(s==null?void 0:s.value)),t=c.inject("uploadUrl"),e=c.computed(()=>a.action||a.uploadUrl||(t==null?void 0:t.value)),i=c.inject("token"),n=c.computed(()=>a.token||(i==null?void 0:i.value)),o=c.inject("onlyofficeConfig"),l=c.computed(()=>a.onlyofficeConfig||(o==null?void 0:o.value)),u=c.inject("userInfo"),f=c.computed(()=>a.userInfo||(u==null?void 0:u.value));return{cLoadUrl:r,cUploadUrl:e,cToken:n,cOnlyofficeConfig:l,cUserInfo:f}},Dn=(a,s=2)=>{if(a===void 0)return"";if(a===0)return"0 B";const r=["B","KB","MB","GB","TB"],t=Math.floor(Math.log(a)/Math.log(1024));let e=a/Math.pow(1024,t);return(e%1===0?e.toFixed(s||0):e.toFixed(s))+" "+r[t]},Se=(a,s)=>s?s.startsWith("http")?s:`${a||location.origin}${s}`:"",On=["onClick"],Rn={class:"fileName simple"},Nn=["onClick"],Fn={class:"text"},Mn={class:"fileName"},Bn={class:"size"},Hn=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}},setup(a){const s=a,{cLoadUrl:r,cOnlyofficeConfig:t}=ut(s),e=c.computed(()=>({name:"name",url:"url",suffix:"suffix",size:"size",...s.field})),i=c.ref({}),n=c.ref(!1),o=h=>{var p,v;i.value={...h,name:h.name,url:Se(r.value,h.url||((v=(p=h==null?void 0:h.response)==null?void 0:p.data)==null?void 0:v.id)||(h==null?void 0:h.id))},n.value=!0},l=h=>{Te.ikFile.downloadFile(Se(r.value,h[e.value.url]||h.attachmentId||h.id),h[e.value.name]||h.attachmentName)},u=c.computed(()=>Te.paramType.isNumber(s.width)?`${s.width}px`:s.width),f=c.computed(()=>s.list.map(h=>({...h,name:h[e.value.name]||h.attachmentName,size:h[e.value.size]||h.fileSize||h.attachmentSize,suffix:h[e.value.suffix]||h.attachmentSuffix})));return(h,p)=>{var g,m,_;const v=c.resolveComponent("tmplate");return c.openBlock(),c.createElementBlock(c.Fragment,null,[(g=a.list)!=null&&g.length?(c.openBlock(),c.createElementBlock(c.Fragment,{key:0},[a.simple?(c.openBlock(!0),c.createElementBlock(c.Fragment,{key:0},c.renderList(f.value,(C,b)=>(c.openBlock(),c.createElementBlock("div",{class:"iking-privew-annex simple",onClick:E=>o(C),style:c.normalizeStyle({width:u.value})},[c.createElementVNode("div",Rn,c.toDisplayString(C.name),1),c.createElementVNode("div",{class:c.normalizeClass(["flex flex-center",{"hover-show":a.iconHoverShow}])},[c.createVNode(c.unref(xe),{name:"iksvg_daochu",onClick:c.withModifiers(E=>l(C),["stop"]),size:20,active:""},null,8,["onClick"]),c.createVNode(c.unref(xe),{name:"iksvg_yulan",size:20,active:""}),c.renderSlot(h.$slots,"operation",{data:{...C,findex:b}})],2)],12,On))),256)):(c.openBlock(),c.createBlock(v,{key:1},{default:c.withCtx(()=>[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(f.value,(C,b)=>{var E;return c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass(["iking-privew-annex",{"is-bg":a.showBg}]),key:b,style:c.normalizeStyle({marginBottom:b==((E=a.list)==null?void 0:E.length)-1?"0":"10px",width:u.value})},[c.createElementVNode("div",{class:"file-card",onClick:N=>o(C)},[c.createVNode(c.unref(xn),{file:C,style:c.normalizeStyle({height:`${a.iconSize}px`}),class:"ikui-w-auto",fields:e.value},null,8,["file","style","fields"]),c.createElementVNode("div",Fn,[c.createElementVNode("div",Mn,c.toDisplayString(C.name),1),c.createElementVNode("div",Bn,c.toDisplayString(c.unref(Dn)(C.size)),1)]),c.createElementVNode("div",{class:c.normalizeClass(["flex flex-center",{"hover-show":a.iconHoverShow}])},[c.createVNode(c.unref(xe),{name:"iksvg_daochu",onClick:c.withModifiers(N=>l(C),["stop"]),bg:a.showBg,size:a.showBg?"default":20,title:"下载"},null,8,["onClick","bg","size"]),c.createVNode(c.unref(xe),{name:"iksvg_yulan",bg:a.showBg,size:a.showBg?"default":20,title:"预览"},null,8,["bg","size"]),c.renderSlot(h.$slots,"operation",{data:{...C,findex:b}})],2)],8,Nn)],6)}),128))]),_:3}))],64)):c.createCommentVNode("v-if",!0),c.createVNode(c.unref(zn),{show:n.value,"onUpdate:show":p[0]||(p[0]=C=>n.value=C),loadUrl:c.unref(r),file:i.value,onlyofficeServer:((m=c.unref(t))==null?void 0:m.serverUrl)||a.onlyofficeServer,onlyOfficeConfig:c.unref(t),onlyOfficeAccept:((_=c.unref(t))==null?void 0:_.accept)||a.onlyOfficeAccept},null,8,["show","loadUrl","file","onlyofficeServer","onlyOfficeConfig","onlyOfficeAccept"])],64)}}}),tl="",Vn=ce(Hn),Un=c.defineComponent({__name:"IkPreviewFileDialog",props:c.mergeModels({file:{type:Object,default:()=>[]},loadUrl:{type:String,default:""},onlyOfficeAccept:{type:String,default:".pdf,.docx,.doc.ppt,.pptx,.xlsx,.xls,"},onlyofficeServer:{type:String,default:""},onlyOfficeConfig:{type:Object,default:()=>({})},field:{type:Object,default:()=>({})}},{show:{default:!1},showModifiers:{}}),emits:["update:show"],setup(a){const s=a,r=c.useModel(a,"show"),t=c.computed(()=>({name:"name",url:"url",suffix:"suffix",size:"fileSize",...s.field})),e=c.ref(null),i=c.ref(null),n=c.reactive({image:!1,office:!1,video:!1}),o=u=>{var f,h,p,v,g,m,_;try{const C=((f=u==null?void 0:u.response)==null?void 0:f.data)||u,b=C[t.value.url]||(C==null?void 0:C.id)||C.attachmentId,E=(h=C[t.value.suffix]||C.attachmentSuffix)==null?void 0:h.toLowerCase(),N=C[t.value.name]||(C==null?void 0:C.attachmentName)||(C==null?void 0:C.originName);if(i.value={...u,name:u[t.value.name],url:Se(s.loadUrl,b)},u&&lt(u,t.value)==="image"){n.image=!0;return}else if(u&&lt(u,t.value)==="video"){n.video=!0;return}else if((((p=s.onlyOfficeConfig)==null?void 0:p.accept)||s.onlyOfficeAccept).includes(E)){n.office=!0,e.value={...s.onlyOfficeConfig,editorConfig:{...((v=s.onlyOfficeConfig)==null?void 0:v.editorConfig)||{},customization:{...((m=(g=s.onlyOfficeConfig)==null?void 0:g.editorConfig)==null?void 0:m.customization)||{},review:{reviewDisplay:"final"}}},document:{key:Te.buildUUID(),title:N,url:Se(s.loadUrl,b),fileType:E,...((_=s.onlyOfficeConfig)==null?void 0:_.document)||{}},documentType:tn(E)};return}}catch(C){console.info("预览错误: ",C)}};c.watch([r,s.file],([u,f])=>{u&&c.nextTick(()=>{o(s.file)})});const l=()=>{r.value=!1,n.office=!1,n.image=!1,n.video=!1,i.value=null};return(u,f)=>{var p,v,g;const h=c.resolveComponent("el-image-viewer");return r.value?(c.openBlock(),c.createElementBlock(c.Fragment,{key:0},[(p=i.value)!=null&&p.url&&n.image?(c.openBlock(),c.createBlock(h,{key:0,onClose:f[0]||(f[0]=m=>l()),ref:"previewImgRef","url-list":[(v=i.value)==null?void 0:v.url],teleported:""},null,8,["url-list"])):c.createCommentVNode("v-if",!0),c.createCommentVNode(' <IkPreviewVideo :file="fileData" v-model:show="modal.video" />'),c.createCommentVNode(" 文档类 "),c.createVNode(c.unref(Ts),{modelValue:n.video,"onUpdate:modelValue":f[1]||(f[1]=m=>n.video=m),url:(g=i.value)==null?void 0:g.url},null,8,["modelValue","url"]),c.createVNode(c.unref(tr),{modelValue:n.office,"onUpdate:modelValue":f[2]||(f[2]=m=>n.office=m),draggable:"","no-footer":"","no-header":"",fullscreen:"","show-close-bg":"","destroy-on-close":"","close-on-click-modal":"","close-on-press-escape":!1,"append-to-body":"",onClose:l,"modal-class":"ik-only-preview-dialog"},{default:c.withCtx(()=>{var m;return[c.createVNode(c.unref(ur),{"config-options":e.value,"document-server-url":((m=a.onlyOfficeConfig)==null?void 0:m.serverUrl)||a.onlyofficeServer},null,8,["config-options","document-server-url"])]}),_:1},8,["modelValue"])],64)):c.createCommentVNode("v-if",!0)}}}),il="",zn=ce(Un),jn={key:0,class:"ik-svg-icon ik-icon-span inline-block inline-flex justify-center box-content line-height-[0]"},$n={key:1,class:"h-[1em] w-[1em]","aria-hidden":"true"},Wn=["xlink:href"],Gn=["src"],Kn={key:1,class:"h-[1em] w-[1em]","aria-hidden":"true"},Yn=["xlink:href"],Xn=["src"],qn=c.defineComponent({name:"IkSvgIcon",__name:"index",props:{active:{type:Boolean,default:!1},bg:{type:Boolean,default:!1},color:{},colorLight:{},disabled:{type:Boolean,default:!1},error:{type:Boolean},flip:{},name:{},notip:{type:Boolean,default:!1},opacity:{default:.5},padding:{default:"6px"},primary:{type:Boolean},rotate:{},showBg:{type:Boolean,default:!1},size:{default:""},success:{type:Boolean},tableIconType:{},title:{},type:{},warning:{type:Boolean},width:{}},setup(a){const s=a,r=c.computed(()=>s),t=c.computed(()=>{const{name:i}=r.value;return/^http?:\/\//.test(i)?"img":/i-[^:]+:[^:]+/.test(i)?"unocss":i!=null&&i.startsWith("iksig")?"iksig":i!=null&&i.includes(":")?"iconify":i!=null&&i.startsWith("iksvg")?"svg":"i"}),e=c.computed(()=>{const i=[];if(r.value.flip)switch(r.value.flip){case"horizontal":i.push("rotateY(180deg)");break;case"vertical":i.push("rotateX(180deg)");break;case"both":i.push("rotateX(180deg)"),i.push("rotateY(180deg)");break}r.value.rotate&&i.push(`rotate(${r.value.rotate%360}deg)`);const n={pointerEvents:r.value.disabled?"none":"auto",...r.value.color&&{color:r.value.color},...r.value.size&&{fontSize:typeof r.value.size=="number"?`${r.value.size}px`:r.value.size},...i.length&&{transform:i.join(" ")},padding:r.value.showBg||r.value.bg?r.value.padding:0,...r.value.color&&t.value!=="iksig"?{"--ik-color-icon-dark":r.value.color,"--ik-color-icon-light":r.value.colorLight||Te.ikColor.setOpacity(r.value.color,r.value.opacity)}:{}};return r.value.width&&(n.width=n.height=typeof r.value.width=="number"?`${r.value.width}px`:r.value.width),n});return(i,n)=>{const o=c.resolveComponent("el-tooltip"),l=c.resolveComponent("el-button");return r.value.tableIconType==="icon"||!r.value.tableIconType?(c.openBlock(),c.createElementBlock("span",jn,[r.value.notip||!r.value.title?(c.openBlock(),c.createElementBlock("i",{key:0,class:c.normalizeClass(["ik-svg-icon ik-icon relative h-[1em] w-[1em] inline-flex items-center justify-center fill-current leading-[1em] transition",{[i.name]:t.value==="unocss","show-bg":r.value.showBg||r.value.bg,default:r.value.size==="default",small:r.value.size==="small",big:r.value.size==="big",warning:r.value.warning||r.value.type==="warning",primary:r.value.primary||r.value.type==="primary",success:i.success||r.value.type==="success",error:r.value.error||r.value.type==="error",active:r.value.active,disabled:r.value.disabled}]),style:c.normalizeStyle(e.value)},[c.createCommentVNode(` <Icon v-if="outputType === 'iconify'" :icon="name" /> `),t.value==="iksig"?(c.openBlock(),c.createElementBlock("i",{key:0,class:c.normalizeClass(`iksig ${r.value.name}`),style:c.normalizeStyle(e.value)},null,6)):t.value==="svg"?(c.openBlock(),c.createElementBlock("svg",$n,[c.createElementVNode("use",{"xlink:href":`#${r.value.name}`},null,8,Wn)])):t.value==="img"?(c.openBlock(),c.createElementBlock("img",{key:2,src:r.value.name,class:"h-[1em] w-[1em]"},null,8,Gn)):(c.openBlock(),c.createElementBlock("i",{key:3,class:c.normalizeClass(r.value.name),style:c.normalizeStyle(e.value)},null,6))],6)):(c.openBlock(),c.createBlock(o,{key:1,content:r.value.title,placement:"top"},{default:c.withCtx(()=>[c.createElementVNode("i",{class:c.normalizeClass(["ik-svg-icon ik-icon relative h-[1em] w-[1em] inline-flex items-center justify-center fill-current leading-[1em] transition",{[i.name]:t.value==="unocss","show-bg":r.value.showBg||r.value.bg,default:r.value.size==="default",small:r.value.size==="small",big:r.value.size==="big",warning:r.value.warning||r.value.type==="warning",primary:i.primary||r.value.type==="primary",success:i.success||r.value.type==="success",error:r.value.error||r.value.type==="error",active:r.value.active}]),style:c.normalizeStyle(e.value)},[t.value==="iksig"?(c.openBlock(),c.createElementBlock("i",{key:0,class:c.normalizeClass(`iksig ${r.value.name}`),style:c.normalizeStyle(e.value)},null,6)):t.value==="svg"?(c.openBlock(),c.createElementBlock("svg",Kn,[c.createElementVNode("use",{"xlink:href":`#${r.value.name}`},null,8,Yn)])):t.value==="img"?(c.openBlock(),c.createElementBlock("img",{key:2,src:r.value.name,class:"h-[1em] w-[1em]"},null,8,Xn)):(c.openBlock(),c.createElementBlock("i",{key:3,class:c.normalizeClass(r.value.name),style:c.normalizeStyle(e.value)},null,6))],6)]),_:1},8,["content"]))])):(c.openBlock(),c.createBlock(l,{key:1,type:["warning","error"].includes(r.value.type)?"danger":""},{default:c.withCtx(()=>[c.createTextVNode(c.toDisplayString(r.value.title),1)]),_:1},8,["type"]))}}}),nl="",xe=ce(Me(qn,[["__scopeId","data-v-52806adf"]])),Jn=c.defineComponent({__name:"CloseIcon",props:{showBg:{type:Boolean,default:!1},fullscreen:{type:Boolean,default:!1}},setup(a){return(s,r)=>(c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass({"exit-main-page-maximize":a.showBg&&a.fullscreen})},[c.createVNode(c.unref(xe),{name:"iksvg_guanbidanchuang",title:"关闭",size:20,error:""})],2))}}),ol="",Zn=Me(Jn,[["__scopeId","data-v-da39e979"]]),Qn={class:"base-header"},er=c.defineComponent({__name:"IkBaseDialog",props:c.mergeModels({title:{default:""},cancelText:{default:"取消"},confirmText:{default:"确认"},noHeader:{type:Boolean},noFooter:{type:Boolean},showCloseBg:{type:Boolean,default:!1},fullscreen:{type:Boolean,default:!1}},{modelValue:{type:Boolean,default:!1,noHeader:!1,noFooter:!1},modelModifiers:{}}),emits:["update:modelValue"],setup(a){const s=a,r=c.useModel(a,"modelValue"),t=c.ref(s.fullscreen),e=()=>{t.value=!t.value},i=c.defineComponent({setup(){return()=>c.h(Zn,{showBg:s.showCloseBg,fullscreen:s.fullscreen})}});return(n,o)=>{const l=c.resolveComponent("el-dialog");return c.openBlock(),c.createBlock(l,c.mergeProps({modelValue:r.value,"onUpdate:modelValue":o[0]||(o[0]=u=>r.value=u)},n.$attrs,{"close-icon":c.unref(i),class:`ik-base-dialog ${n.noHeader?"no-header":""} ${n.noFooter?"no-footer":""}`,fullscreen:t.value,"modal-class":"baseDialog"}),c.createSlots({icon:c.withCtx(()=>[c.renderSlot(n.$slots,"title",{},()=>[c.createTextVNode(c.toDisplayString(n.title),1)])]),header:c.withCtx(()=>[c.createElementVNode("div",Qn,[c.renderSlot(n.$slots,"header",{},()=>[c.createTextVNode(c.toDisplayString(n.title),1)])]),n.$attrs.showClose?(c.openBlock(),c.createBlock(c.unref(xe),{key:0,onClick:e,name:t.value?"iksvg_tuichuquanping":"iksvg_quanping-daohang",class:"absolute! top-[18px] right-[50px] icon-dialog-full",title:t.value?"退出全屏":"全屏"},null,8,["name","title"])):c.createCommentVNode("v-if",!0)]),default:c.withCtx(()=>[c.renderSlot(n.$slots,"default")]),_:2},[n.$slots.footer?{name:"footer",fn:c.withCtx(()=>[c.renderSlot(n.$slots,"footer")]),key:"0"}:void 0]),1040,["modelValue","close-icon","class","fullscreen"])}}}),sl="",tr=ce(er),al="";var ir=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ct(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}function nr(a,s,r,t){function e(i){return i instanceof r?i:new r(function(n){n(i)})}return new(r||(r=Promise))(function(i,n){function o(f){try{u(t.next(f))}catch(h){n(h)}}function l(f){try{u(t.throw(f))}catch(h){n(h)}}function u(f){f.done?i(f.value):e(f.value).then(o,l)}u((t=t.apply(a,s||[])).next())})}function rr(a,s){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},t,e,i,n;return n={next:o(0),throw:o(1),return:o(2)},typeof Symbol=="function"&&(n[Symbol.iterator]=function(){return this}),n;function o(u){return function(f){return l([u,f])}}function l(u){if(t)throw new TypeError("Generator is already executing.");for(;n&&(n=0,u[0]&&(r=0)),r;)try{if(t=1,e&&(i=u[0]&2?e.return:u[0]?e.throw||((i=e.return)&&i.call(e),0):e.next)&&!(i=i.call(e,u[1])).done)return i;switch(e=0,i&&(u=[u[0]&2,i.value]),u[0]){case 0:case 1:i=u;break;case 4:return r.label++,{value:u[1],done:!1};case 5:r.label++,e=u[1],u=[0];continue;case 7:u=r.ops.pop(),r.trys.pop();continue;default:if(i=r.trys,!(i=i.length>0&&i[i.length-1])&&(u[0]===6||u[0]===2)){r=0;continue}if(u[0]===3&&(!i||u[1]>i[0]&&u[1]<i[3])){r.label=u[1];break}if(u[0]===6&&r.label<i[1]){r.label=i[1],i=u;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(u);break}i[2]&&r.ops.pop(),r.trys.pop();continue}u=s.call(a,r)}catch(f){u=[6,f],e=0}finally{t=i=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}typeof SuppressedError=="function"&&SuppressedError;var or=function(a,s){return nr(void 0,void 0,void 0,function(){return rr(this,function(r){return[2,new Promise(function(t,e){try{if(window.DocsAPI)return t(null);var i=document.getElementById(s);if(i)var n=setInterval(function(){var l=i.getAttribute("loading");if(!l){if(clearInterval(n),window.DocsAPI)return t(null);var u=Gt(s,a,t,e);i.remove(),document.body.appendChild(u)}},500);else{var o=Gt(s,a,t,e);document.body.appendChild(o)}}catch(l){console.error(l)}})]})})},Gt=function(a,s,r,t){var e=document.createElement("script");return e.id=a,e.type="text/javascript",e.src=s,e.async=!0,e.onload=function(){e.removeAttribute("loading"),r(null)},e.onerror=function(i){e.removeAttribute("loading"),t(i)},e.setAttribute("loading",""),e},ft=c.defineComponent({name:"DocumentEditor",props:{id:{type:String,required:!0},documentServerUrl:{type:String,required:!0},config:{type:Object,required:!0},document_fileType:String,document_title:String,documentType:String,editorConfig_lang:String,height:String,type:String,width:String,onLoadComponentError:Function,events_onAppReady:Function,events_onDocumentStateChange:Function,events_onMetaChange:Function,events_onDocumentReady:Function,events_onInfo:Function,events_onWarning:Function,events_onError:Function,events_onRequestSharingSettings:Function,events_onRequestRename:Function,events_onMakeActionLink:Function,events_onRequestInsertImage:Function,events_onRequestSaveAs:Function,events_onRequestMailMergeRecipients:Function,events_onRequestCompareFile:Function,events_onRequestEditRights:Function,events_onRequestHistory:Function,events_onRequestHistoryClose:Function,events_onRequestHistoryData:Function,events_onRequestRestore:Function,events_onRequestSelectSpreadsheet:Function,events_onRequestSelectDocument:Function},mounted:function(){var a=this,s=this.documentServerUrl;s.endsWith("/")||(s+="/");var r="".concat(s,"web-apps/apps/api/documents/api.js");or(r,"onlyoffice-api-script").then(function(){return a.onLoad()}).catch(function(){a.onError(-2)})},unmounted:function(){var a,s=this.id||"";!((a=window==null?void 0:window.DocEditor)===null||a===void 0)&&a.instances[s]&&(window.DocEditor.instances[s].destroyEditor(),window.DocEditor.instances[s]=void 0)},watch:{config:{handler:function(a,s){this.onChangeProps()},deep:!0},document_fileType:function(a,s){this.onChangeProps()},document_title:function(a,s){this.onChangeProps()},documentType:function(a,s){this.onChangeProps()},editorConfig_lang:function(a,s){this.onChangeProps()},height:function(a,s){this.onChangeProps()},type:function(a,s){this.onChangeProps()},width:function(a,s){this.onChangeProps()}},methods:{onLoad:function(){var a,s;try{var r=this.id||"";if(window.DocsAPI||this.onError(-3),!((a=window==null?void 0:window.DocEditor)===null||a===void 0)&&a.instances[r]){console.log("Skip loading. Instance already exists",r);return}!((s=window==null?void 0:window.DocEditor)===null||s===void 0)&&s.instances||(window.DocEditor={instances:{}});var t=Object.assign({document:{fileType:this.document_fileType,title:this.document_title},documentType:this.documentType,editorConfig:{lang:this.editorConfig_lang},events:{onAppReady:this.onAppReady,onDocumentStateChange:this.events_onDocumentStateChange,onMetaChange:this.events_onMetaChange,onDocumentReady:this.events_onDocumentReady,onInfo:this.events_onInfo,onWarning:this.events_onWarning,onError:this.events_onError,onRequestSharingSettings:this.events_onRequestSharingSettings,onRequestRename:this.events_onRequestRename,onMakeActionLink:this.events_onMakeActionLink,onRequestInsertImage:this.events_onRequestInsertImage,onRequestSaveAs:this.events_onRequestSaveAs,onRequestMailMergeRecipients:this.events_onRequestMailMergeRecipients,onRequestCompareFile:this.events_onRequestCompareFile,onRequestEditRights:this.events_onRequestEditRights,onRequestHistory:this.events_onRequestHistory,onRequestHistoryClose:this.events_onRequestHistoryClose,onRequestHistoryData:this.events_onRequestHistoryData,onRequestRestore:this.events_onRequestRestore,onRequestSelectSpreadsheet:this.events_onRequestSelectSpreadsheet,onRequestSelectDocument:this.events_onRequestSelectDocument},height:this.height,type:this.type,width:this.width},this.config||{}),e=window.DocsAPI.DocEditor(r,t);window.DocEditor.instances[r]=e}catch(i){console.error(i),this.onError(-1)}},onError:function(a){var s;switch(a){case-2:s="Error load DocsAPI from "+this.documentServerUrl;break;case-3:s="DocsAPI is not defined";break;default:s="Unknown error loading component",a=-1}typeof this.onLoadComponentError>"u"?console.error(s):this.onLoadComponentError(a,s)},onAppReady:function(){var a=this.id||"";this.events_onAppReady(window.DocEditor.instances[a])},onChangeProps:function(){var a,s=this.id||"";!((a=window==null?void 0:window.DocEditor)===null||a===void 0)&&a.instances[s]&&(window.DocEditor.instances[s].destroyEditor(),window.DocEditor.instances[s]=void 0,console.log("Important props have been changed. Load new Editor."),this.onLoad())}}});const sr=["id"];function ar(a,s,r,t,e,i){return c.openBlock(),c.createElementBlock("div",{id:a.id},null,8,sr)}ft.render=ar,ft.__file="src/components/DocumentEditor.vue";const lr=c.defineComponent({__name:"IkOnlyOffice",props:{documentServerUrl:{type:String,default:""},configOptions:{type:Object,default:()=>{}},officeHeight:{type:String,default:"100%"}},setup(a){const s=a,r=c.ref({width:"100%",height:"100%",...s.configOptions||{},...s.configOptions}),t=()=>{console.info("文档加载完成",s.configOptions)};return(e,i)=>(c.openBlock(),c.createElementBlock("div",{style:c.normalizeStyle({height:s.officeHeight})},[c.createVNode(c.unref(ft),{id:`${new Date().getTime()}`,ref:"editorRef","document-server-url":a.documentServerUrl,config:r.value,events_onDocumentReady:t},null,8,["id","document-server-url","config"])],4))}}),ll="",ur=ce(Me(lr,[["__scopeId","data-v-98d51ef9"]]));function Kt(a,s){var r=Object.keys(a);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(a);s&&(t=t.filter(function(e){return Object.getOwnPropertyDescriptor(a,e).enumerable})),r.push.apply(r,t)}return r}function U(a){for(var s=1;s<arguments.length;s++){var r=arguments[s]!=null?arguments[s]:{};s%2?Kt(Object(r),!0).forEach(function(t){k(a,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(r)):Kt(Object(r)).forEach(function(t){Object.defineProperty(a,t,Object.getOwnPropertyDescriptor(r,t))})}return a}function G(a){"@babel/helpers - typeof";return G=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(s){return typeof s}:function(s){return s&&typeof Symbol=="function"&&s.constructor===Symbol&&s!==Symbol.prototype?"symbol":typeof s},G(a)}function T(a,s){if(!(a instanceof s))throw new TypeError("Cannot call a class as a function")}function Yt(a,s){for(var r=0;r<s.length;r++){var t=s[r];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(a,Xt(t.key),t)}}function S(a,s,r){return s&&Yt(a.prototype,s),r&&Yt(a,r),Object.defineProperty(a,"prototype",{writable:!1}),a}function k(a,s,r){return s=Xt(s),s in a?Object.defineProperty(a,s,{value:r,enumerable:!0,configurable:!0,writable:!0}):a[s]=r,a}function I(a,s){if(typeof s!="function"&&s!==null)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(s&&s.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),Object.defineProperty(a,"prototype",{writable:!1}),s&&ht(a,s)}function A(a){return A=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},A(a)}function ht(a,s){return ht=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ht(a,s)}function cr(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function y(a){if(a===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a}function dt(a,s){if(s&&(typeof s=="object"||typeof s=="function"))return s;if(s!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return y(a)}function P(a){var s=cr();return function(){var t=A(a),e;if(s){var i=A(this).constructor;e=Reflect.construct(t,arguments,i)}else e=t.apply(this,arguments);return dt(this,e)}}function fr(a,s){for(;!Object.prototype.hasOwnProperty.call(a,s)&&(a=A(a),a!==null););return a}function L(){return typeof Reflect<"u"&&Reflect.get?L=Reflect.get.bind():L=function(s,r,t){var e=fr(s,r);if(e){var i=Object.getOwnPropertyDescriptor(e,r);return i.get?i.get.call(arguments.length<3?s:t):i.value}},L.apply(this,arguments)}function Q(a){return hr(a)||dr(a)||gr(a)||pr()}function hr(a){if(Array.isArray(a))return gt(a)}function dr(a){if(typeof Symbol<"u"&&a[Symbol.iterator]!=null||a["@@iterator"]!=null)return Array.from(a)}function gr(a,s){if(a){if(typeof a=="string")return gt(a,s);var r=Object.prototype.toString.call(a).slice(8,-1);if(r==="Object"&&a.constructor&&(r=a.constructor.name),r==="Map"||r==="Set")return Array.from(a);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return gt(a,s)}}function gt(a,s){(s==null||s>a.length)&&(s=a.length);for(var r=0,t=new Array(s);r<s;r++)t[r]=a[r];return t}function pr(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
2
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function vr(a,s){if(typeof a!="object"||a===null)return a;var r=a[Symbol.toPrimitive];if(r!==void 0){var t=r.call(a,s||"default");if(typeof t!="object")return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return(s==="string"?String:Number)(a)}function Xt(a){var s=vr(a,"string");return typeof s=="symbol"?s:String(s)}var qt={exports:{}};(function(a){var s=Object.prototype.hasOwnProperty,r="~";function t(){}Object.create&&(t.prototype=Object.create(null),new t().__proto__||(r=!1));function e(l,u,f){this.fn=l,this.context=u,this.once=f||!1}function i(l,u,f,h,p){if(typeof f!="function")throw new TypeError("The listener must be a function");var v=new e(f,h||l,p),g=r?r+u:u;return l._events[g]?l._events[g].fn?l._events[g]=[l._events[g],v]:l._events[g].push(v):(l._events[g]=v,l._eventsCount++),l}function n(l,u){--l._eventsCount===0?l._events=new t:delete l._events[u]}function o(){this._events=new t,this._eventsCount=0}o.prototype.eventNames=function(){var u=[],f,h;if(this._eventsCount===0)return u;for(h in f=this._events)s.call(f,h)&&u.push(r?h.slice(1):h);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(f)):u},o.prototype.listeners=function(u){var f=r?r+u:u,h=this._events[f];if(!h)return[];if(h.fn)return[h.fn];for(var p=0,v=h.length,g=new Array(v);p<v;p++)g[p]=h[p].fn;return g},o.prototype.listenerCount=function(u){var f=r?r+u:u,h=this._events[f];return h?h.fn?1:h.length:0},o.prototype.emit=function(u,f,h,p,v,g){var m=r?r+u:u;if(!this._events[m])return!1;var _=this._events[m],C=arguments.length,b,E;if(_.fn){switch(_.once&&this.removeListener(u,_.fn,void 0,!0),C){case 1:return _.fn.call(_.context),!0;case 2:return _.fn.call(_.context,f),!0;case 3:return _.fn.call(_.context,f,h),!0;case 4:return _.fn.call(_.context,f,h,p),!0;case 5:return _.fn.call(_.context,f,h,p,v),!0;case 6:return _.fn.call(_.context,f,h,p,v,g),!0}for(E=1,b=new Array(C-1);E<C;E++)b[E-1]=arguments[E];_.fn.apply(_.context,b)}else{var N=_.length,R;for(E=0;E<N;E++)switch(_[E].once&&this.removeListener(u,_[E].fn,void 0,!0),C){case 1:_[E].fn.call(_[E].context);break;case 2:_[E].fn.call(_[E].context,f);break;case 3:_[E].fn.call(_[E].context,f,h);break;case 4:_[E].fn.call(_[E].context,f,h,p);break;default:if(!b)for(R=1,b=new Array(C-1);R<C;R++)b[R-1]=arguments[R];_[E].fn.apply(_[E].context,b)}}return!0},o.prototype.on=function(u,f,h){return i(this,u,f,h,!1)},o.prototype.once=function(u,f,h){return i(this,u,f,h,!0)},o.prototype.removeListener=function(u,f,h,p){var v=r?r+u:u;if(!this._events[v])return this;if(!f)return n(this,v),this;var g=this._events[v];if(g.fn)g.fn===f&&(!p||g.once)&&(!h||g.context===h)&&n(this,v);else{for(var m=0,_=[],C=g.length;m<C;m++)(g[m].fn!==f||p&&!g[m].once||h&&g[m].context!==h)&&_.push(g[m]);_.length?this._events[v]=_.length===1?_[0]:_:n(this,v)}return this},o.prototype.removeAllListeners=function(u){var f;return u?(f=r?r+u:u,this._events[f]&&n(this,f)):(this._events=new t,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=r,o.EventEmitter=o,a.exports=o})(qt);var Jt=qt.exports;const Zt=ct(Jt);var mr=typeof window<"u"&&window.location&&window.location.href.indexOf("xgplayerdebugger=1")>-1,pt={info:"color: #525252; background-color: #90ee90;",error:"color: #525252; background-color: red;",warn:"color: #525252; background-color: yellow; "},vt="%c[xgplayer]",F={config:{debug:mr?3:0},logInfo:function(s){for(var r,t=arguments.length,e=new Array(t>1?t-1:0),i=1;i<t;i++)e[i-1]=arguments[i];this.config.debug>=3&&(r=console).log.apply(r,[vt,pt.info,s].concat(e))},logWarn:function(s){for(var r,t=arguments.length,e=new Array(t>1?t-1:0),i=1;i<t;i++)e[i-1]=arguments[i];this.config.debug>=1&&(r=console).warn.apply(r,[vt,pt.warn,s].concat(e))},logError:function(s){var r;if(!(this.config.debug<1)){for(var t=this.config.debug>=2?"trace":"error",e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];(r=console)[t].apply(r,[vt,pt.error,s].concat(i))}}};function yr(a){a.logInfo=F.logInfo.bind(a),a.logWarn=F.logWarn.bind(a),a.logError=F.logError.bind(a)}var _r=function(){function a(s){T(this,a),this.bufferedList=s}return S(a,[{key:"start",value:function(r){return this.bufferedList[r].start}},{key:"end",value:function(r){return this.bufferedList[r].end}},{key:"length",get:function(){return this.bufferedList.length}}]),a}(),d={};d.createDom=function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"div",s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},t=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"",e=document.createElement(a);return e.className=t,e.innerHTML=s,Object.keys(r).forEach(function(i){var n=i,o=r[i];a==="video"||a==="audio"||a==="live-video"?o&&e.setAttribute(n,o):e.setAttribute(n,o)}),e},d.createDomFromHtml=function(a){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"";try{var t=document.createElement("div");t.innerHTML=a;var e=t.children;return t=null,e.length>0?(e=e[0],r&&d.addClass(e,r),s&&Object.keys(s).forEach(function(i){e.setAttribute(i,s[i])}),e):null}catch(i){return F.logError("util.createDomFromHtml",i),null}},d.hasClass=function(a,s){if(!a||!s)return!1;try{return Array.prototype.some.call(a.classList,function(t){return t===s})}catch{var r=a.className&&G(a.className)==="object"?a.getAttribute("class"):a.className;return r&&!!r.match(new RegExp("(\\s|^)"+s+"(\\s|$)"))}},d.addClass=function(a,s){if(!(!a||!s))try{s.replace(/(^\s+|\s+$)/g,"").split(/\s+/g).forEach(function(r){r&&a.classList.add(r)})}catch{d.hasClass(a,s)||(a.className&&G(a.className)==="object"?a.setAttribute("class",a.getAttribute("class")+" "+s):a.className+=" "+s)}},d.removeClass=function(a,s){if(!(!a||!s))try{s.replace(/(^\s+|\s+$)/g,"").split(/\s+/g).forEach(function(r){r&&a.classList.remove(r)})}catch{d.hasClass(a,s)&&s.split(/\s+/g).forEach(function(t){var e=new RegExp("(\\s|^)"+t+"(\\s|$)");a.className&&G(a.className)==="object"?a.setAttribute("class",a.getAttribute("class").replace(e," ")):a.className=a.className.replace(e," ")})}},d.toggleClass=function(a,s){a&&s.split(/\s+/g).forEach(function(r){d.hasClass(a,r)?d.removeClass(a,r):d.addClass(a,r)})},d.classNames=function(){for(var a=arguments,s=[],r=function(i){d.typeOf(a[i])==="String"?s.push(a[i]):d.typeOf(a[i])==="Object"&&Object.keys(a[i]).map(function(n){a[i][n]&&s.push(n)})},t=0;t<arguments.length;t++)r(t);return s.join(" ")},d.findDom=function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:document,s=arguments.length>1?arguments[1]:void 0,r;try{r=a.querySelector(s)}catch(t){F.logError("util.findDom",t),s.indexOf("#")===0&&(r=a.getElementById(s.slice(1)))}return r},d.getCss=function(a,s){return a.currentStyle?a.currentStyle[s]:document.defaultView.getComputedStyle(a,!1)[s]},d.padStart=function(a,s,r){for(var t=String(r),e=s>>0,i=Math.ceil(e/t.length),n=[],o=String(a);i--;)n.push(t);return n.join("").substring(0,e-o.length)+o},d.format=function(a){if(window.isNaN(a))return"";a=Math.round(a);var s=d.padStart(Math.floor(a/3600),2,0),r=d.padStart(Math.floor((a-s*3600)/60),2,0),t=d.padStart(Math.floor(a-s*3600-r*60),2,0);return(s==="00"?[r,t]:[s,r,t]).join(":")},d.event=function(a){if(a.touches){var s=a.touches[0]||a.changedTouches[0];a.clientX=s.clientX||0,a.clientY=s.clientY||0,a.offsetX=s.pageX-s.target.offsetLeft,a.offsetY=s.pageY-s.target.offsetTop}a._target=a.target||a.srcElement},d.typeOf=function(a){return Object.prototype.toString.call(a).match(/([^\s.*]+)(?=]$)/g)[0]},d.deepCopy=function(a,s){if(d.typeOf(s)==="Object"&&d.typeOf(a)==="Object")return Object.keys(s).forEach(function(r){d.typeOf(s[r])==="Object"&&!(s[r]instanceof Node)?a[r]===void 0||a[r]===void 0?a[r]=s[r]:d.deepCopy(a[r],s[r]):d.typeOf(s[r])==="Array"?a[r]=d.typeOf(a[r])==="Array"?a[r].concat(s[r]):s[r]:a[r]=s[r]}),a},d.deepMerge=function(a,s){return Object.keys(s).map(function(r){if(d.typeOf(s[r])==="Array"&&d.typeOf(a[r])==="Array"){if(d.typeOf(a[r])==="Array"){var t;(t=a[r]).push.apply(t,Q(s[r]))}}else d.typeOf(a[r])===d.typeOf(s[r])&&a[r]!==null&&d.typeOf(a[r])==="Object"&&!(s[r]instanceof window.Node)?d.deepMerge(a[r],s[r]):s[r]!==null&&(a[r]=s[r])}),a},d.getBgImage=function(a){var s=(a.currentStyle||window.getComputedStyle(a,null)).backgroundImage;if(!s||s==="none")return"";var r=document.createElement("a");return r.href=s.replace(/url\("|"\)/g,""),r.href},d.copyDom=function(a){if(a&&a.nodeType===1){var s=document.createElement(a.tagName);return Array.prototype.forEach.call(a.attributes,function(r){s.setAttribute(r.name,r.value)}),a.innerHTML&&(s.innerHTML=a.innerHTML),s}else return""},d.setInterval=function(a,s,r,t){a._interval[s]||(a._interval[s]=window.setInterval(r.bind(a),t))},d.clearInterval=function(a,s){clearInterval(a._interval[s]),a._interval[s]=null},d.setTimeout=function(a,s,r){a._timers||(a._timers=[]);var t=setTimeout(function(){s(),d.clearTimeout(a,t)},r);return a._timers.push(t),t},d.clearTimeout=function(a,s){var r=a._timers;if(d.typeOf(r)==="Array"){for(var t=0;t<r.length;t++)if(r[t]===s){r.splice(t,1),clearTimeout(s);break}}else clearTimeout(s)},d.clearAllTimers=function(a){var s=a._timers;d.typeOf(s)==="Array"&&(s.map(function(r){clearTimeout(r)}),a._timerIds=[])},d.createImgBtn=function(a,s,r,t){var e=d.createDom("xg-".concat(a),"",{},"xgplayer-".concat(a,"-img"));if(e.style.backgroundImage='url("'.concat(s,'")'),r&&t){var i,n,o;["px","rem","em","pt","dp","vw","vh","vm","%"].every(function(l){return r.indexOf(l)>-1&&t.indexOf(l)>-1?(i=parseFloat(r.slice(0,r.indexOf(l)).trim()),n=parseFloat(t.slice(0,t.indexOf(l)).trim()),o=l,!1):!0}),e.style.width="".concat(i).concat(o),e.style.height="".concat(n).concat(o),e.style.backgroundSize="".concat(i).concat(o," ").concat(n).concat(o),a==="start"?e.style.margin="-".concat(n/2).concat(o," auto auto -").concat(i/2).concat(o):e.style.margin="auto 5px auto 5px"}return e},d.Hex2RGBA=function(a,s){var r=[];if(/^\#[0-9A-F]{3}$/i.test(a)){var t="#";a.replace(/[0-9A-F]/ig,function(e){t+=e+e}),a=t}return/^#[0-9A-F]{6}$/i.test(a)?(a.replace(/[0-9A-F]{2}/ig,function(e){r.push(parseInt(e,16))}),"rgba(".concat(r.join(","),", ").concat(s,")")):"rgba(255, 255, 255, 0.1)"},d.getFullScreenEl=function(){return document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement},d.checkIsFunction=function(a){return a&&typeof a=="function"},d.checkIsObject=function(a){return a!==null&&G(a)==="object"},d.hide=function(a){a.style.display="none"},d.show=function(a,s){a.style.display=s||"block"},d.isUndefined=function(a){if(typeof a>"u"||a===null)return!0},d.isNotNull=function(a){return a!=null},d.setStyleFromCsstext=function(a,s){if(s)if(d.typeOf(s)==="String"){var r=s.replace(/\s+/g,"").split(";");r.map(function(t){if(t){var e=t.split(":");e.length>1&&(a.style[e[0]]=e[1])}})}else Object.keys(s).map(function(t){a.style[t]=s[t]})};function kr(a,s){for(var r=0,t=s.length;r<t;r++)if(a.indexOf(s[r])>-1)return!0;return!1}d.filterStyleFromText=function(a){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:["width","height","top","left","bottom","right","position","z-index","padding","margin","transform"],r=a.style.cssText;if(!r)return{};var t=r.replace(/\s+/g,"").split(";"),e={},i={};return t.map(function(n){if(n){var o=n.split(":");o.length>1&&(kr(o[0],s)?e[o[0]]=o[1]:i[o[0]]=o[1])}}),a.setAttribute("style",""),Object.keys(i).map(function(n){a.style[n]=i[n]}),e},d.getStyleFromCsstext=function(a){var s=a.style.cssText;if(!s)return{};var r=s.replace(/\s+/g,"").split(";"),t={};return r.map(function(e){if(e){var i=e.split(":");i.length>1&&(t[i[0]]=i[1])}}),t},d.preloadImg=function(a){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:function(){},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(){};if(a){var t=new window.Image;t.onload=function(e){t=null,s&&s(e)},t.onerror=function(e){t=null,r&&r(e)},t.src=a}},d.stopPropagation=function(a){a&&a.stopPropagation()},d.scrollTop=function(){return window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0},d.scrollLeft=function(){return window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0},d.checkTouchSupport=function(){return"ontouchstart"in window},d.getBuffered2=function(a){for(var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:.5,r=[],t=0;t<a.length;t++)r.push({start:a.start(t)<.5?0:a.start(t),end:a.end(t)});r.sort(function(l,u){var f=l.start-u.start;return f||u.end-l.end});var e=[];if(s)for(var i=0;i<r.length;i++){var n=e.length;if(n){var o=e[n-1].end;r[i].start-o<s?r[i].end>o&&(e[n-1].end=r[i].end):e.push(r[i])}else e.push(r[i])}else e=r;return new _r(e)},d.getEventPos=function(a){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;return a.touches&&a.touches.length>0&&(a=a.touches[0]),{x:a.x/s,y:a.y/s,clientX:a.clientX/s,clientY:a.clientY/s,offsetX:a.offsetX/s,offsetY:a.offsetY/s,pageX:a.pageX/s,pageY:a.pageY/s}},d.requestAnimationFrame=function(a){var s=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame;if(s)return s(a)},d.getHostFromUrl=function(a){if(d.typeOf(a)!=="String")return"";var s=a.split("/"),r="";return s.length>3&&s[2]&&(r=s[2]),r},d.cancelAnimationFrame=function(a){var s=window.cancelAnimationFrame||window.mozCancelAnimationFrame||window.cancelRequestAnimationFrame;s&&s(a)},d.isMSE=function(a){return a.media&&(a=a.media),!a||!(a instanceof HTMLMediaElement)?!1:/^blob/.test(a.currentSrc)||/^blob/.test(a.src)},d.isBlob=function(a){return typeof a=="string"&&/^blob/.test(a)},d.generateSessionId=function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,s=new Date().getTime();try{a=parseInt(a)}catch{a=0}s+=a,window.performance&&typeof window.performance.now=="function"&&(s+=parseInt(window.performance.now()));var r="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var e=(s+Math.random()*16)%16|0;return s=Math.floor(s/16),(t==="x"?e:e&3|8).toString(16)});return r},d.createEvent=function(a){var s;return typeof window.Event=="function"?s=new Event(a):(s=document.createEvent("Event"),s.initEvent(a,!0,!0)),s},d.adjustTimeByDuration=function(a,s,r){return!s||!a?a:a>s||r&&a<s?s:a},d.createPositionBar=function(a,s){var r=d.createDom("xg-bar","",{"data-index":-1},a);return s.appendChild(r),r},d.getTransformStyle=function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{x:0,y:0,scale:1,rotate:0},s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",r={scale:"".concat(a.scale||1),translate:"".concat(a.x||0,"%, ").concat(a.y||0,"%"),rotate:"".concat(a.rotate||0,"deg")},t=Object.keys(r);return t.forEach(function(e){var i=new RegExp("".concat(e,"\\([^\\(]+\\)"),"g"),n="".concat(e,"(").concat(r[e],")");i.test(s)?(i.lastIndex=-1,s=s.replace(i,n)):s+="".concat(n," ")}),s},d.convertDeg=function(a){return Math.abs(a)<=1?a*360:a%360},d.getIndexByTime=function(a,s){var r=s.length,t=-1;if(r<1)return t;if(a<=s[0].end||r<2)t=0;else if(a>s[r-1].end)t=r-1;else for(var e=1;e<r;e++)if(a>s[e-1].end&&a<=s[e].end){t=e;break}return t},d.getOffsetCurrentTime=function(a,s){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:-1,t=-1;if(r>=0&&r<s.length?t=r:t=d.getIndexByTime(a,s),t<0)return-1;var e=s.length,i=s[t],n=i.start,o=i.end,l=i.cTime,u=i.offset;return a<n?l:a>=n&&a<=o?a-u:a>o&&t>=e-1?o:-1},d.getCurrentTimeByOffset=function(a,s){var r=-1;if(!s||s.length<0)return a;for(var t=0;t<s.length;t++)if(a<=s[t].duration){r=t;break}if(r!==-1){var e=s[r].start;return r-1<0?e+a:e+(a-s[r-1].duration)}return a};function Qt(a){var s=G(a);return a!==null&&(s==="object"||s==="function")}function Cr(a,s,r){var t,e,i,n,o,l,u=0,f=!1,h=!1,p=!0,v=!s&&s!==0&&typeof window.requestAnimationFrame=="function";if(typeof a!="function")throw new TypeError("Expected a function");s=+s||0,Qt(r)&&(f=!!r.leading,h="maxWait"in r,i=h?Math.max(+r.maxWait||0,s):i,p="trailing"in r?!!r.trailing:p);function g(x){var $=t,Z=e;return t=e=void 0,u=x,n=a.apply(Z,$),n}function m(x,$){return v?(window.cancelAnimationFrame(o),window.requestAnimationFrame(x)):setTimeout(x,$)}function _(x){if(v)return window.cancelAnimationFrame(x);clearTimeout(x)}function C(x){return u=x,o=m(N,s),f?g(x):n}function b(x){var $=x-l,Z=x-u,te=s-$;return h?Math.min(te,i-Z):te}function E(x){var $=x-l,Z=x-u;return l===void 0||$>=s||$<0||h&&Z>=i}function N(){var x=Date.now();if(E(x))return R(x);o=m(N,b(x))}function R(x){return o=void 0,p&&t?g(x):(t=e=void 0,n)}function H(){o!==void 0&&_(o),u=0,t=l=e=o=void 0}function D(){return o===void 0?n:R(Date.now())}function j(){return o!==void 0}function z(){for(var x=Date.now(),$=E(x),Z=arguments.length,te=new Array(Z),be=0;be<Z;be++)te[be]=arguments[be];if(t=te,e=this,l=x,$){if(o===void 0)return C(l);if(h)return o=m(N,s),g(l)}return o===void 0&&(o=m(N,s)),n}return z.cancel=H,z.flush=D,z.pending=j,z}function Er(a,s,r){var t=!0,e=!0;if(typeof a!="function")throw new TypeError("Expected a function");return Qt(r)&&(t="leading"in r?!!r.leading:t,e="trailing"in r?!!r.trailing:e),Cr(a,s,{leading:t,trailing:e,maxWait:s})}function wr(){var a=(document.documentElement.getAttribute("lang")||navigator.language||"zh-cn").toLocaleLowerCase();return a==="zh-cn"&&(a="zh"),a}function br(a,s,r){if(a){var t=a.getAttribute(r);return!!(t&&t===s&&(a.tagName==="VIDEO"||a.tagName==="AUDIO"))}}var ei={android:/(Android)\s([\d.]+)/,ios:/(Version)\/([\d.]+)/},Tr=["avc1.42E01E, mp4a.40.2","avc1.58A01E, mp4a.40.2","avc1.4D401E, mp4a.40.2","avc1.64001E, mp4a.40.2","avc1.42E01E","mp4v.20.8","avc1.42E01E, mp4a.40.2","avc1.58A01E, mp4a.40.2","avc1.4D401E, mp4a.40.2","avc1.64001E, mp4a.40.2","mp4v.20.8, mp4a.40.2","mp4v.20.240, mp4a.40.2"],O={get device(){var a=O.os;return a.isPc?"pc":"mobile"},get browser(){if(typeof navigator>"u")return"";var a=navigator.userAgent.toLowerCase(),s={ie:/rv:([\d.]+)\) like gecko/,firefox:/firefox\/([\d.]+)/,chrome:/chrome\/([\d.]+)/,opera:/opera.([\d.]+)/,safari:/version\/([\d.]+).*safari/};return[].concat(Object.keys(s).filter(function(r){return s[r].test(a)}))[0]},get os(){if(typeof navigator>"u")return{};var a=navigator.userAgent,s=/(?:Windows Phone)/.test(a),r=/(?:SymbianOS)/.test(a)||s,t=/(?:Android)/.test(a),e=/(?:Firefox)/.test(a),i=/(?:iPad|PlayBook)/.test(a)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1,n=i||t&&!/(?:Mobile)/.test(a)||e&&/(?:Tablet)/.test(a),o=/(?:iPhone)/.test(a)&&!n,l=!o&&!t&&!r&&!n;return{isTablet:n,isPhone:o,isIpad:i,isIos:o||i,isAndroid:t,isPc:l,isSymbian:r,isWindowsPhone:s,isFireFox:e}},get osVersion(){if(typeof navigator>"u")return 0;var a=navigator.userAgent,s="";/(?:iPhone)|(?:iPad|PlayBook)/.test(a)?s=ei.ios:s=ei.android;var r=s?s.exec(a):[];if(r&&r.length>=3){var t=r[2].split(".");return t.length>0?parseInt(t[0]):0}return 0},get isWeixin(){if(typeof navigator>"u")return!1;var a=/(micromessenger)\/([\d.]+)/,s=a.exec(navigator.userAgent.toLocaleLowerCase());return!!s},isSupportMP4:function(){var s={isSupport:!1,mime:""};if(typeof document>"u")return s;if(this.supportResult)return this.supportResult;var r=document.createElement("video");return typeof r.canPlayType=="function"&&Tr.map(function(t){r.canPlayType('video/mp4; codecs="'.concat(t,'"'))==="probably"&&(s.isSupport=!0,s.mime+="||".concat(t))}),this.supportResult=s,r=null,s},isMSESupport:function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:'video/mp4; codecs="avc1.42E01E,mp4a.40.2"';if(typeof MediaSource>"u"||!MediaSource)return!1;try{return MediaSource.isTypeSupported(s)}catch(r){return this._logger.error(s,r),!1}},isHevcSupported:function(){return typeof MediaSource>"u"||!MediaSource.isTypeSupported?!1:MediaSource.isTypeSupported('video/mp4;codecs="hev1.1.6.L120.90"')||MediaSource.isTypeSupported('video/mp4;codecs="hev1.2.4.L120.90"')||MediaSource.isTypeSupported('video/mp4;codecs="hev1.3.E.L120.90"')||MediaSource.isTypeSupported('video/mp4;codecs="hev1.4.10.L120.90"')},probeConfigSupported:function(s){var r={supported:!1,smooth:!1,powerEfficient:!1};if(!s||typeof navigator>"u")return Promise.resolve(r);if(navigator.mediaCapabilities&&navigator.mediaCapabilities.decodingInfo)return navigator.mediaCapabilities.decodingInfo(s);var t=s.video||{},e=s.audio||{};try{var i=MediaSource.isTypeSupported(t.contentType),n=MediaSource.isTypeSupported(e.contentType);return Promise.resolve({supported:i&&n,smooth:!1,powerEfficient:!1})}catch{return Promise.resolve(r)}}},mt="3.0.18",ti={1:"media",2:"media",3:"media",4:"media",5:"media",6:"media"},ii={1:5101,2:5102,3:5103,4:5104,5:5105,6:5106},je=S(function a(s){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{errorType:"",errorCode:0,errorMessage:"",originError:"",ext:{},mediaError:null};T(this,a);var t=s&&s.i18n?s.i18n.ERROR_TYPES:null;if(s.media){var e=r.mediaError?r.mediaError:s.media.error||{},i=s.duration,n=s.currentTime,o=s.ended,l=s.src,u=s.currentSrc,f=s.media,h=f.readyState,p=f.networkState,v=r.errorCode||e.code;ii[v]&&(v=ii[v]);var g={playerVersion:mt,currentTime:n,duration:i,ended:o,readyState:h,networkState:p,src:l||u,errorType:r.errorType,errorCode:v,message:r.errorMessage||e.message,mediaError:e,originError:r.originError?r.originError.stack:"",host:d.getHostFromUrl(l||u)};return r.ext&&Object.keys(r.ext).map(function(b){g[b]=r.ext[b]}),g}else if(arguments.length>1){for(var m={playerVersion:mt,domain:document.domain},_=["errorType","currentTime","duration","networkState","readyState","src","currentSrc","ended","errd","errorCode","mediaError"],C=0;C<arguments.length;C++)m[_[C]]=arguments[C];return m.ex=t?(t[arguments[0]]||{}).msg:"",m}}),X="play",yt="playing",ye="ended",Ie="pause",Be="error",$e="seeking",oe="seeked",q="timeupdate",He="waiting",se="canplay",Sr="canplaythrough",fe="durationchange",ni="volumechange",ae="loadeddata",xr="loadedmetadata",ri="ratechange",oi="progress",_t="loadstart",_e="emptied",Ir="stalled",Pr="suspend",Ar="abort",Lr="bufferedChange",kt="focus",si="blur",Ct="ready",ai="urlNull",ke="autoplay_started",Et="autoplay_was_prevented",We="complete",Ge="replay",wt="destroy",Ke="urlchange",bt="download_speed_change",li="leaveplayer",ui="enterplayer",ci="loading",le="fullscreen_change",Ye="cssFullscreen_change",Xe="mini_state_change",Tt="definition_change",Dr="before_definition_change",St="after_definition_change",Or="SEI_PARSED",Rr="retry",he="video_resize",xt="pip_change",fi="rotate",hi="screenShot",qe="playnext",di="shortcut",gi="xglog",Je="user_action",Ze="reset",pi="source_error",vi="source_success",Nr="switch_subtitle",mi=["play","playing","ended","pause","error","seeking","seeked","timeupdate","waiting","canplay","canplaythrough","durationchange","volumechange","loadeddata","loadedmetadata","ratechange","progress","loadstart","emptied","stalled","suspend","abort","lowdecode"],yi={STATS_INFO:"stats_info",STATS_DOWNLOAD:"stats_download",STATS_RESET:"stats_reset"},_i="fps_stuck";const Fr=Object.freeze(Object.defineProperty({__proto__:null,ABORT:Ar,AFTER_DEFINITION_CHANGE:St,AUTOPLAY_PREVENTED:Et,AUTOPLAY_STARTED:ke,BEFORE_DEFINITION_CHANGE:Dr,BUFFER_CHANGE:Lr,CANPLAY:se,CANPLAY_THROUGH:Sr,COMPLETE:We,CSS_FULLSCREEN_CHANGE:Ye,DEFINITION_CHANGE:Tt,DESTROY:wt,DOWNLOAD_SPEED_CHANGE:bt,DURATION_CHANGE:fe,EMPTIED:_e,ENDED:ye,ENTER_PLAYER:ui,ERROR:Be,FPS_STUCK:_i,FULLSCREEN_CHANGE:le,LEAVE_PLAYER:li,LOADED_DATA:ae,LOADED_METADATA:xr,LOADING:ci,LOAD_START:_t,MINI_STATE_CHANGE:Xe,PAUSE:Ie,PIP_CHANGE:xt,PLAY:X,PLAYER_BLUR:si,PLAYER_FOCUS:kt,PLAYING:yt,PLAYNEXT:qe,PROGRESS:oi,RATE_CHANGE:ri,READY:Ct,REPLAY:Ge,RESET:Ze,RETRY:Rr,ROTATE:fi,SCREEN_SHOT:hi,SEEKED:oe,SEEKING:$e,SEI_PARSED:Or,SHORTCUT:di,SOURCE_ERROR:pi,SOURCE_SUCCESS:vi,STALLED:Ir,STATS_EVENTS:yi,SUSPEND:Pr,SWITCH_SUBTITLE:Nr,TIME_UPDATE:q,URL_CHANGE:Ke,URL_NULL:ai,USER_ACTION:Je,VIDEO_EVENTS:mi,VIDEO_RESIZE:he,VOLUME_CHANGE:ni,WAITING:He,XGLOG:gi},Symbol.toStringTag,{value:"Module"}));function It(a,s){!this||!this.emit||(a==="error"?this.errorHandler(a,s.error):this.emit(a,s))}function Mr(a,s){return function(r,t){var e={player:s,eventName:a,originalEvent:r,detail:r.detail||{},timeStamp:r.timeStamp,currentTime:s.currentTime,duration:s.duration,paused:s.paused,ended:s.ended,isInternalOp:!!s._internalOp[r.type],muted:s.muted,volume:s.volume,host:d.getHostFromUrl(s.currentSrc),vtype:s.vtype};if(s.removeInnerOP(r.type),a==="timeupdate"&&(s._currentTime=s.media&&s.media.currentTime),a==="ratechange"){var i=s.media?s.media.playbackRate:0;if(i&&s._rate===i)return;s._rate=s.media&&s.media.playbackRate}if(a==="durationchange"&&(s._duration=s.media.duration),a==="volumechange"&&(e.isMutedChange=s._lastMuted!==s.muted,s._lastMuted=s.muted),a==="error"&&(e.error=t||s.video.error),s.mediaEventMiddleware[a]){var n=It.bind(s,a,e);try{s.mediaEventMiddleware[a].call(s,e,n)}catch(o){throw It.call(s,a,e),o}}else It.call(s,a,e)}}var Br=function(a){I(r,a);var s=P(r);function r(t){var e;T(this,r),e=s.call(this,t),e._hasStart=!1,e._currentTime=0,e._duration=0,e._internalOp={},e._lastMuted=!1,e.vtype="MP4",e._rate=-1,e.mediaConfig=Object.assign({},{controls:!1,autoplay:t.autoplay,playsinline:t.playsinline,"x5-playsinline":t.playsinline,"webkit-playsinline":t.playsinline,"x5-video-player-fullscreen":t["x5-video-player-fullscreen"]||t.x5VideoPlayerFullscreen,"x5-video-orientation":t["x5-video-orientation"]||t.x5VideoOrientation,airplay:t.airplay,"webkit-airplay":t.airplay,tabindex:t.tabindex|0,mediaType:t.mediaType||"video","data-index":-1},t.videoConfig,t.videoAttributes);var i=t["x5-video-player-type"]||t.x5VideoPlayerType;return O.isWeixin&&O.os.isAndroid&&i&&(e.mediaConfig["x5-video-player-type"]=i,delete e.mediaConfig.playsinline,delete e.mediaConfig["webkit-playsinline"],delete e.mediaConfig["x5-playsinline"]),t.loop&&(e.mediaConfig.loop="loop"),t.autoplayMuted&&!Object.prototype.hasOwnProperty.call(e.mediaConfig,"muted")&&(e.mediaConfig.muted=!0),e.media=d.createDom(e.mediaConfig.mediaType,"",e.mediaConfig,""),t.defaultPlaybackRate&&(e.media.defaultPlaybackRate=e.media.playbackRate=t.defaultPlaybackRate),d.typeOf(t.volume)==="Number"&&(e.volume=t.volume),t.autoplayMuted&&(e.media.muted=!0,e._lastMuted=!0),t.autoplay&&(e.media.autoplay=!0),e._interval={},e.mediaEventMiddleware={},e.attachVideoEvents(),e}return S(r,[{key:"setEventsMiddleware",value:function(e){var i=this;Object.keys(e).map(function(n){i.mediaEventMiddleware[n]=e[n]})}},{key:"removeEventsMiddleware",value:function(e){var i=this;Object.keys(e).map(function(n){delete i.mediaEventMiddleware[n]})}},{key:"attachVideoEvents",value:function(){var e=this,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.media;this._evHandlers||(this._evHandlers=mi.map(function(n){var o="on".concat(n.charAt(0).toUpperCase()).concat(n.slice(1));return typeof e[o]=="function"&&e.on(n,e[o]),k({},n,Mr(n,e))})),this._evHandlers.forEach(function(n){var o=Object.keys(n)[0];i.addEventListener(o,n[o],!1)})}},{key:"detachVideoEvents",value:function(){var e=this,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.media;this._evHandlers.forEach(function(n){var o=Object.keys(n)[0];i.removeEventListener(o,n[o],!1)}),this._evHandlers.forEach(function(n){var o=Object.keys(n)[0],l="on".concat(o.charAt(0).toUpperCase()).concat(o.slice(1));typeof e[l]=="function"&&e.off(o,e[l])}),this._evHandlers=null}},{key:"_attachSourceEvents",value:function(e,i){var n=this;e.removeAttribute("src"),e.load(),i.forEach(function(h,p){n.media.appendChild(d.createDom("source","",{src:"".concat(h.src),type:"".concat(h.type||""),"data-index":p+1}))});var o=e.children;if(o){this._videoSourceCount=o.length,this._videoSourceIndex=o.length,this._vLoadeddata=function(h){n.emit(vi,{src:h.target.currentSrc,host:d.getHostFromUrl(h.target.currentSrc)})};for(var l=null,u=0;u<this._evHandlers.length;u++)if(Object.keys(this._evHandlers[u])[0]==="error"){l=this._evHandlers[u];break}!this._sourceError&&(this._sourceError=function(h){var p=parseInt(h.target.getAttribute("data-index"),10);if(n._videoSourceIndex--,n._videoSourceIndex===0||p>=n._videoSourceCount){var v={code:4,message:"sources_load_error"};l?l.error(h,v):n.errorHandler("error",v)}var g=ti[4];n.emit(pi,new je(n,{errorType:g,errorCode:4,errorMessage:"sources_load_error",mediaError:{code:4,message:"sources_load_error"},src:h.target.src}))});for(var f=0;f<o.length;f++)o[f].addEventListener("error",this._sourceError);e.addEventListener("loadeddata",this._vLoadeddata)}}},{key:"_detachSourceEvents",value:function(e){var i=e.children;if(!(!i||i.length===0||!this._sourceError)){for(var n=0;n<i.length;n++)i[n].removeEventListener("error",this._sourceError);for(;i.length>0;)e.removeChild(i[0]);this._vLoadeddata&&e.removeEventListener("loadeddata",this._vLoadeddata)}}},{key:"errorHandler",value:function(e){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(this.media&&(this.media.error||i)){var n=this.media.error||i,o=n.code?ti[n.code]:"other",l=n.message;this.media.currentSrc||(l="empty_src",n={code:6,message:l}),this.emit(e,new je(this,{errorType:o,errorCode:n.code,errorMessage:n.message||"",mediaError:n}))}}},{key:"destroy",value:function(){this.media&&(this.media.pause&&(this.media.pause(),this.media.muted=!0),this.media.removeAttribute("src"),this.media.load()),this._currentTime=0,this._duration=0,this.mediaConfig=null;for(var e in this._interval)Object.prototype.hasOwnProperty.call(this._interval,e)&&(clearInterval(this._interval[e]),this._interval[e]=null);this.detachVideoEvents(),this.media=null,this.mediaEventMiddleware={},this.removeAllListeners()}},{key:"video",get:function(){return this.media},set:function(e){this.media=e}},{key:"play",value:function(){var e=this.media?this.media.play():null;return e}},{key:"pause",value:function(){this.media&&this.media.pause()}},{key:"load",value:function(){this.media&&this.media.load()}},{key:"canPlayType",value:function(e){return this.media?this.media.canPlayType(e):!1}},{key:"getBufferedRange",value:function(e){var i=[0,0];if(!this.media)return i;e||(e=this.media.buffered);var n=this.media.currentTime;if(e)for(var o=0,l=e.length;o<l&&(i[0]=e.start(o),i[1]=e.end(o),!(i[0]<=n&&n<=i[1]));o++);return i[0]-n<=0&&n-i[1]<=0?i:[0,0]}},{key:"autoplay",get:function(){return this.media?this.media.autoplay:!1},set:function(e){this.media&&(this.media.autoplay=e)}},{key:"buffered",get:function(){return this.media?this.media.buffered:null}},{key:"buffered2",get:function(){return this.media&&this.media.buffered?d.getBuffered2(this.media.buffered):null}},{key:"bufferedPoint",get:function(){var e={start:0,end:0};if(!this.media)return e;var i=this.media.buffered;if(!i||i.length===0)return e;for(var n=0;n<i.length;n++)if((i.start(n)<=this.currentTime||i.start(n)<.1)&&i.end(n)>=this.currentTime)return{start:i.start(n),end:i.end(n)};return e}},{key:"crossOrigin",get:function(){return this.media?this.media.crossOrigin:""},set:function(e){this.media&&(this.media.crossOrigin=e)}},{key:"currentSrc",get:function(){return this.media?this.media.currentSrc:""},set:function(e){this.media&&(this.media.currentSrc=e)}},{key:"currentTime",get:function(){return this.media?this.media.currentTime!==void 0?this.media.currentTime:this._currentTime:0},set:function(e){this.media&&(this.media.currentTime=e)}},{key:"defaultMuted",get:function(){return this.media?this.media.defaultMuted:!1},set:function(e){this.media&&(this.media.defaultMuted=e)}},{key:"duration",get:function(){return this._duration}},{key:"ended",get:function(){return this.media?this.media.ended:!1}},{key:"error",get:function(){return this.media.error}},{key:"errorNote",get:function(){var e=this.media.error;if(!e)return"";var i=["MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED"];return i[this.media.error.code-1]}},{key:"loop",get:function(){return this.media?this.media.loop:!1},set:function(e){this.media&&(this.media.loop=e)}},{key:"muted",get:function(){return this.media?this.media.muted:!1},set:function(e){!this.media||this.media.muted===e||(this._lastMuted=this.media.muted,this.media.muted=e)}},{key:"networkState",get:function(){return this.media.networkState}},{key:"paused",get:function(){return this.media?this.media.paused:!0}},{key:"playbackRate",get:function(){return this.media?this.media.playbackRate:0},set:function(e){!this.media||e===1/0||(this.media.defaultPlaybackRate=e,this.media.playbackRate=e)}},{key:"played",get:function(){return this.media?this.media.played:null}},{key:"preload",get:function(){return this.media?this.media.preload:!1},set:function(e){this.media&&(this.media.preload=e)}},{key:"readyState",get:function(){return this.media.readyState}},{key:"seekable",get:function(){return this.media?this.media.seekable:!1}},{key:"seeking",get:function(){return this.media?this.media.seeking:!1}},{key:"src",get:function(){return this.media?this.media.src:""},set:function(e){if(this.media){if(this.emit(Ke,e),this.emit(He),this._currentTime=0,this._duration=0,d.isMSE(this.media)){this.onWaiting();return}this._detachSourceEvents(this.media),d.typeOf(e)==="Array"?this._attachSourceEvents(this.media,e):e?this.media.src=e:this.media.removeAttribute("src"),this.load()}}},{key:"volume",get:function(){return this.media?this.media.volume:0},set:function(e){e===1/0||!this.media||(this.media.volume=e)}},{key:"aspectRatio",get:function(){return this.media?this.media.videoWidth/this.media.videoHeight:0}},{key:"addInnerOP",value:function(e){this._internalOp[e]=!0}},{key:"removeInnerOP",value:function(e){delete this._internalOp[e]}},{key:"emit",value:function(e,i){for(var n,o=arguments.length,l=new Array(o>2?o-2:0),u=2;u<o;u++)l[u-2]=arguments[u];(n=L(A(r.prototype),"emit",this)).call.apply(n,[this,e,i].concat(l))}},{key:"on",value:function(e,i){for(var n,o=arguments.length,l=new Array(o>2?o-2:0),u=2;u<o;u++)l[u-2]=arguments[u];(n=L(A(r.prototype),"on",this)).call.apply(n,[this,e,i].concat(l))}},{key:"once",value:function(e,i){for(var n,o=arguments.length,l=new Array(o>2?o-2:0),u=2;u<o;u++)l[u-2]=arguments[u];(n=L(A(r.prototype),"once",this)).call.apply(n,[this,e,i].concat(l))}},{key:"off",value:function(e,i){for(var n,o=arguments.length,l=new Array(o>2?o-2:0),u=2;u<o;u++)l[u-2]=arguments[u];(n=L(A(r.prototype),"off",this)).call.apply(n,[this,e,i].concat(l))}},{key:"offAll",value:function(){L(A(r.prototype),"removeAllListeners",this).call(this)}}]),r}(Zt),Hr=function(){function a(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{name:"xgplayer",version:1,db:null,ojstore:{name:"xg-m4a",keypath:"vid"}};T(this,a),this.indexedDB=window.indexedDB||window.webkitindexedDB,this.IDBKeyRange=window.IDBKeyRange||window.webkitIDBKeyRange,this.myDB=s}return S(a,[{key:"openDB",value:function(r){var t=this,e=this,i=this.myDB.version||1,n=e.indexedDB.open(e.myDB.name,i);n.onerror=function(o){},n.onsuccess=function(o){t.myDB.db=o.target.result,r.call(e)},n.onupgradeneeded=function(o){var l=o.target.result;o.target.transaction,l.objectStoreNames.contains(e.myDB.ojstore.name)||l.createObjectStore(e.myDB.ojstore.name,{keyPath:e.myDB.ojstore.keypath})}}},{key:"deletedb",value:function(){var r=this;r.indexedDB.deleteDatabase(this.myDB.name)}},{key:"closeDB",value:function(){this.myDB.db.close()}},{key:"addData",value:function(r,t){for(var e=this.myDB.db.transaction(r,"readwrite").objectStore(r),i,n=0;n<t.length;n++)i=e.add(t[n]),i.onerror=function(){},i.onsuccess=function(){}}},{key:"putData",value:function(r,t){for(var e=this.myDB.db.transaction(r,"readwrite").objectStore(r),i,n=0;n<t.length;n++)i=e.put(t[n]),i.onerror=function(){},i.onsuccess=function(){}}},{key:"getDataByKey",value:function(r,t,e){var i=this,n=this.myDB.db.transaction(r,"readwrite").objectStore(r),o=n.get(t);o.onerror=function(){e.call(i,null)},o.onsuccess=function(l){var u=l.target.result;e.call(i,u)}}},{key:"deleteData",value:function(r,t){var e=this.myDB.db.transaction(r,"readwrite").objectStore(r);e.delete(t)}},{key:"clearData",value:function(r){var t=this.myDB.db.transaction(r,"readwrite").objectStore(r);t.clear()}}]),a}(),ki=["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],Ci=["requestFullscreen","webkitRequestFullscreen","mozRequestFullScreen","msRequestFullscreen"],Ei=["exitFullscreen","webkitExitFullscreen","mozCancelFullScreen","msExitFullscreen"],Ce="data-xgplayerid";function Qe(a,s,r){for(var t=arguments.length,e=new Array(t>3?t-3:0),i=3;i<t;i++)e[i-3]=arguments[i];var n=s.call.apply(s,[a].concat(e));!r||typeof r!="function"||(n&&n.then?n.then(function(){for(var o=arguments.length,l=new Array(o),u=0;u<o;u++)l[u]=arguments[u];r.call.apply(r,[a].concat(l))}):r.call.apply(r,[a].concat(e)))}function et(a,s){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{pre:null,next:null};return this.__hooks||(this.__hooks={}),!this.__hooks[a]&&(this.__hooks[a]=null),(function(){var t=arguments,e=this;if(r.pre)try{var i;(i=r.pre).call.apply(i,[this].concat(Array.prototype.slice.call(arguments)))}catch(l){throw l.message="[pluginName: ".concat(this.pluginName,":").concat(a,":pre error] >> ").concat(l.message),l}if(this.__hooks&&this.__hooks[a])try{var n,o=(n=this.__hooks[a]).call.apply(n,[this,this].concat(Array.prototype.slice.call(arguments)));o?o.then?o.then(function(l){l!==!1&&Qe.apply(void 0,[e,s,r.next].concat(Q(t)))}).catch(function(l){throw l}):Qe.apply(void 0,[this,s,r.next].concat(Array.prototype.slice.call(arguments))):o===void 0&&Qe.apply(void 0,[this,s,r.next].concat(Array.prototype.slice.call(arguments)))}catch(l){throw l.message="[pluginName: ".concat(this.pluginName,":").concat(a,"] >> ").concat(l.message),l}else Qe.apply(void 0,[this,s,r.next].concat(Array.prototype.slice.call(arguments)))}).bind(this)}function tt(a,s){var r=this.__hooks;if(r)return r.hasOwnProperty(a)?(r&&(r[a]=s),!0):(console.warn("has no supported hook which name [".concat(a,"]")),!1)}function it(a,s){var r=this.__hooks;r&&delete r[a]}function wi(a){if(!(!this.plugins||!this.plugins[a.toLowerCase()])){for(var s=this.plugins[a.toLowerCase()],r=arguments.length,t=new Array(r>1?r-1:0),e=1;e<r;e++)t[e-1]=arguments[e];return s.useHooks&&s.useHooks.apply(s,t)}}function bi(a){if(!(!this.plugins||!this.plugins[a.toLowerCase()])){var s=this.plugins[a.toLowerCase()];if(s){for(var r=arguments.length,t=new Array(r>1?r-1:0),e=1;e<r;e++)t[e-1]=arguments[e];return s.removeHooks&&s.removeHooks.apply(s,t)}}}function Ti(a){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];a.__hooks={},s&&s.map(function(r){a.__hooks[r]=null}),Object.defineProperty(a,"hooks",{get:function(){return a.__hooks&&Object.keys(a.__hooks).map(function(t){if(a.__hooks[t])return t})}})}function Si(a){a.__hooks=null}function ue(a,s,r){for(var t=arguments.length,e=new Array(t>3?t-3:0),i=3;i<t;i++)e[i-3]=arguments[i];if(a.__hooks&&a.__hooks[s]){var n,o=(n=a.__hooks[s]).call.apply(n,[a,a].concat(e));if(o&&o.then)o.then(function(l){return l===!1?null:r.call.apply(r,[a,a].concat(e))}).catch(function(l){console.warn("[runHooks]".concat(s," reject"),l.message)});else if(o!==!1)return r.call.apply(r,[a,a].concat(e))}else return r.call.apply(r,[a,a].concat(e))}function Pt(a,s){F.logError("[".concat(a,"] event or callback cant be undefined or null when call ").concat(s))}var de=function(){function a(s){T(this,a),d.checkIsFunction(this.beforeCreate)&&this.beforeCreate(s),Ti(this),this.__args=s,this.__events={},this.__onceEvents={},this.config=s.config||{},this.player=null,this.playerConfig={},this.pluginName="",this.__init(s)}return S(a,[{key:"beforeCreate",value:function(r){}},{key:"afterCreate",value:function(){}},{key:"beforePlayerInit",value:function(){}},{key:"onPluginsReady",value:function(){}},{key:"afterPlayerInit",value:function(){}},{key:"destroy",value:function(){}},{key:"__init",value:function(r){this.player=r.player,this.playerConfig=r.player&&r.player.config,this.pluginName=r.pluginName?r.pluginName.toLowerCase():this.constructor.pluginName.toLowerCase(),this.logger=r.player&&r.player.logger}},{key:"updateLang",value:function(r){r||(r=this.lang)}},{key:"lang",get:function(){return this.player.lang}},{key:"i18n",get:function(){return this.player.i18n}},{key:"i18nKeys",get:function(){return this.player.i18nKeys}},{key:"domEventType",get:function(){var r=d.checkTouchSupport()?"touch":"mouse";return this.playerConfig&&(this.playerConfig.domEventType==="touch"||this.playerConfig.domEventType==="mouse")&&(r=this.playerConfig.domEventType),r}},{key:"on",value:function(r,t){var e=this;if(!r||!t||!this.player){Pt(this.pluginName,"plugin.on(event, callback)");return}typeof r=="string"?(this.__events[r]=t,this.player.on(r,t)):Array.isArray(r)&&r.forEach(function(i){e.__events[i]=t,e.player.on(i,t)})}},{key:"once",value:function(r,t){var e=this;if(!r||!t||!this.player){Pt(this.pluginName,"plugin.once(event, callback)");return}typeof r=="string"?(this.__onceEvents[r]=t,this.player.once(r,t)):Array.isArray(r)&&r.forEach(function(i){e.__onceEvents[i]=t,e.player.once(r,t)})}},{key:"off",value:function(r,t){var e=this;if(!r||!t||!this.player){Pt(this.pluginName,"plugin.off(event, callback)");return}typeof r=="string"?(delete this.__events[r],this.player.off(r,t)):Array.isArray(r)&&r.forEach(function(i){delete e.__events[r],e.player.off(i,t)})}},{key:"offAll",value:function(){var r=this;["__events","__onceEvents"].forEach(function(t){Object.keys(r[t]).forEach(function(e){r[t][e]&&r.off(e,r[t][e]),e&&delete r[t][e]})}),this.__events={},this.__onceEvents={}}},{key:"emit",value:function(r){var t;if(this.player){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];(t=this.player).emit.apply(t,[r].concat(i))}}},{key:"emitUserAction",value:function(r,t){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(this.player){var i=U(U({},e),{},{pluginName:this.pluginName});this.player.emitUserAction(r,t,i)}}},{key:"hook",value:function(r,t){return et.call.apply(et,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"useHooks",value:function(r,t){for(var e=arguments.length,i=new Array(e>2?e-2:0),n=2;n<e;n++)i[n-2]=arguments[n];return tt.call.apply(tt,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"removeHooks",value:function(r,t){for(var e=arguments.length,i=new Array(e>2?e-2:0),n=2;n<e;n++)i[n-2]=arguments[n];return it.call.apply(it,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"registerPlugin",value:function(r){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"";if(this.player)return e&&(t.pluginName=e),this.player.registerPlugin({plugin:r,options:t})}},{key:"getPlugin",value:function(r){return this.player?this.player.getPlugin(r):null}},{key:"__destroy",value:function(){var r=this,t=this.player,e=this.pluginName;this.offAll(),d.clearAllTimers(this),d.checkIsFunction(this.destroy)&&this.destroy(),["player","playerConfig","pluginName","logger","__args","__hooks"].map(function(i){r[i]=null}),t.unRegisterPlugin(e),Si(this)}}],[{key:"defineGetterOrSetter",value:function(r,t){for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&Object.defineProperty(r,e,t[e])}},{key:"defaultConfig",get:function(){return{}}},{key:"pluginName",get:function(){return"pluginName"}}]),a}(),Vr=9;if(typeof Element<"u"&&!Element.prototype.matches){var Pe=Element.prototype;Pe.matches=Pe.matchesSelector||Pe.mozMatchesSelector||Pe.msMatchesSelector||Pe.oMatchesSelector||Pe.webkitMatchesSelector}function Ur(a,s){for(;a&&a.nodeType!==Vr;){if(typeof a.matches=="function"&&a.matches(s))return a;a=a.parentNode}}var zr=Ur,jr=zr;function At(a,s,r,t,e){var i=Wr.apply(this,arguments);return a.addEventListener(r,i,e),{destroy:function(){a.removeEventListener(r,i,e)}}}function $r(a,s,r,t,e){return typeof a.addEventListener=="function"?At.apply(null,arguments):typeof r=="function"?At.bind(null,document).apply(null,arguments):(typeof a=="string"&&(a=document.querySelectorAll(a)),Array.prototype.map.call(a,function(i){return At(i,s,r,t,e)}))}function Wr(a,s,r,t){return function(e){e.delegateTarget=jr(e.target,s),e.delegateTarget&&t.call(a,e)}}var Gr=$r;const xi=ct(Gr);var Kr={CONTROLS:"controls",ROOT:"root"},V={ROOT:"root",ROOT_LEFT:"rootLeft",ROOT_RIGHT:"rootRight",ROOT_TOP:"rootTop",CONTROLS_LEFT:"controlsLeft",CONTROLS_RIGTH:"controlsRight",CONTROLS_RIGHT:"controlsRight",CONTROLS_CENTER:"controlsCenter",CONTROLS:"controls"},Ii={ICON_DISABLE:"xg-icon-disable",ICON_HIDE:"xg-icon-hide"};function Lt(a){return a?a.indexOf&&/^(?:http|data:|\/)/.test(a):!1}function Yr(a,s){return G(a)==="object"&&a.class&&typeof a.class=="string"?"".concat(s," ").concat(a.class):s}function Xr(a,s){return G(a)==="object"&&a.attr&&G(a.attr)==="object"&&Object.keys(a.attr).map(function(r){s[r]=a.attr[r]}),s}function Pi(a,s){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"",t=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},e=arguments.length>4&&arguments[4]!==void 0?arguments[4]:"",i=null;if(a instanceof window.Element)return d.addClass(a,r),Object.keys(t).map(function(n){a.setAttribute(n,t[n])}),a;if(Lt(a)||Lt(a.url))return t.src=Lt(a)?a:a.url||"",i=d.createDom(a.tag||"img","",t,"xg-img ".concat(r)),i;if(typeof a=="function")try{return i=a(),i instanceof window.Element?(d.addClass(i,r),Object.keys(t).map(function(n){i.setAttribute(n,t[n])}),i):(F.logWarn("warn>>icons.".concat(s," in config of plugin named [").concat(e,"] is a function mast return an Element Object")),null)}catch(n){return F.logError("Plugin named [".concat(e,"]:createIcon"),n),null}return typeof a=="string"?d.createDomFromHtml(a,t,r):(F.logWarn("warn>>icons.".concat(s," in config of plugin named [").concat(e,"] is invalid")),null)}function qr(a,s){var r=s.config.icons||s.playerConfig.icons;Object.keys(a).map(function(t){var e=a[t],i=e&&e.class?e.class:"",n=e&&e.attr?e.attr:{},o=null;r&&r[t]&&(i=Yr(r[t],i),n=Xr(r[t],n),o=Pi(r[t],t,i,n,s.pluginName)),!o&&e&&(o=Pi(e.icon?e.icon:e,n,i,{},s.pluginName)),s.icons[t]=o})}function Jr(a,s){Object.keys(a).map(function(r){Object.defineProperty(s.langText,r,{get:function(){var e=s.lang,i=s.i18n;return i[r]?i[r]:a[r]&&a[r][e]||""}})})}var B=function(a){I(r,a);var s=P(r);function r(){var t,e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return T(this,r),t=s.call(this,e),t.__delegates=[],t}return S(r,[{key:"__init",value:function(e){if(L(A(r.prototype),"__init",this).call(this,e),!!e.root){var i=e.root,n=null;this.icons={},this.root=null,this.parent=null;var o=this.registerIcons()||{};qr(o,this),this.langText={};var l=this.registerLanguageTexts()||{};Jr(l,this);var u="";try{u=this.render()}catch(p){throw F.logError("Plugin:".concat(this.pluginName,":render"),p),new Error("Plugin:".concat(this.pluginName,":render:").concat(p.message))}if(u)n=r.insert(u,i,e.index),n.setAttribute("data-index",e.index);else if(e.tag)n=d.createDom(e.tag,"",e.attr,e.name),n.setAttribute("data-index",e.index),i.appendChild(n);else return;this.root=n,this.parent=i;var f=this.config.attr||{},h=this.config.style||{};this.setAttr(f),this.setStyle(h),this.config.index&&this.root.setAttribute("data-index",this.config.index),this.__registerChildren()}}},{key:"__registerChildren",value:function(){var e=this;if(this.root){this._children=[];var i=this.children();i&&G(i)==="object"&&Object.keys(i).length>0&&Object.keys(i).map(function(n){var o=n,l=i[o],u={root:e.root},f,h;typeof l=="function"?(f=e.config[o]||{},h=l):G(l)==="object"&&typeof l.plugin=="function"&&(f=l.options?d.deepCopy(e.config[o]||{},l.options):e.config[o]||{},h=l.plugin),u.config=f,f.index!==void 0&&(u.index=f.index),f.root&&(u.root=f.root),e.registerPlugin(h,u,o)})}}},{key:"updateLang",value:function(e){e||(e=this.lang);function i(u,f){for(var h=0;h<u.children.length;h++)u.children[h].children.length>0?i(u.children[h],f):f(u.children[h])}var n=this.root,o=this.i18n,l=this.langText;n&&i(n,function(u){var f=u.getAttribute&&u.getAttribute("lang-key");if(f){var h=o[f.toUpperCase()]||l[f];h&&(u.innerHTML=typeof h=="function"?h(e):h)}})}},{key:"lang",get:function(){return this.player.lang}},{key:"changeLangTextKey",value:function(e){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",n=this.i18n||{},o=this.langText;e.setAttribute&&e.setAttribute("lang-key",i);var l=n[i]||o[i]||"";l&&(e.innerHTML=l)}},{key:"plugins",value:function(){return this._children}},{key:"disable",value:function(){this.config.disable=!0,d.addClass(this.find(".xgplayer-icon"),Ii.ICON_DISABLE)}},{key:"enable",value:function(){this.config.disable=!1,d.removeClass(this.find(".xgplayer-icon"),Ii.ICON_DISABLE)}},{key:"children",value:function(){return{}}},{key:"registerPlugin",value:function(e){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"";i.root=i.root||this.root;var o=L(A(r.prototype),"registerPlugin",this).call(this,e,i,n);return this._children.push(o),o}},{key:"registerIcons",value:function(){return{}}},{key:"registerLanguageTexts",value:function(){return{}}},{key:"find",value:function(e){if(this.root)return this.root.querySelector(e)}},{key:"bind",value:function(e,i,n){var o=this;if(arguments.length<3&&typeof i=="function")Array.isArray(e)?e.forEach(function(u){o.bindEL(u,i)}):this.bindEL(e,i);else{var l=r.delegate.call(this,this.root,e,i,n);this.__delegates=this.__delegates.concat(l)}}},{key:"unbind",value:function(e,i){var n=this;if(arguments.length<3&&typeof i=="function")Array.isArray(e)?e.forEach(function(u){n.unbindEL(u,i)}):this.unbindEL(e,i);else for(var o="".concat(e,"_").concat(i),l=0;l<this.__delegates.length;l++)if(this.__delegates[l].key===o){this.__delegates[l].destroy(),this.__delegates.splice(l,1);break}}},{key:"setStyle",value:function(e,i){var n=this;if(this.root){if(d.typeOf(e)==="String")return this.root.style[e]=i;d.typeOf(e)==="Object"&&Object.keys(e).map(function(o){n.root.style[o]=e[o]})}}},{key:"setAttr",value:function(e,i){var n=this;if(this.root){if(d.typeOf(e)==="String")return this.root.setAttribute(e,i);d.typeOf(e)==="Object"&&Object.keys(e).map(function(o){n.root.setAttribute(o,e[o])})}}},{key:"setHtml",value:function(e,i){this.root&&(this.root.innerHTML=e,typeof i=="function"&&i())}},{key:"bindEL",value:function(e,i){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;this.root&&"on".concat(e)in this.root&&typeof i=="function"&&this.root.addEventListener(e,i,n)}},{key:"unbindEL",value:function(e,i){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;this.root&&"on".concat(e)in this.root&&typeof i=="function"&&this.root.removeEventListener(e,i,n)}},{key:"show",value:function(e){if(this.root){this.root.style.display=e!==void 0?e:"block";var i=window.getComputedStyle(this.root,null),n=i.getPropertyValue("display");if(n==="none")return this.root.style.display="block"}}},{key:"hide",value:function(){this.root&&(this.root.style.display="none")}},{key:"appendChild",value:function(e,i){if(!this.root)return null;if(arguments.length<2&&arguments[0]instanceof window.Element)return this.root.appendChild(arguments[0]);if(!i||!(i instanceof window.Element))return null;try{return typeof e=="string"?this.find(e).appendChild(i):e.appendChild(i)}catch(n){return F.logError("Plugin:appendChild",n),null}}},{key:"render",value:function(){return""}},{key:"destroy",value:function(){}},{key:"__destroy",value:function(){var e=this,i=this.player;this.__delegates.map(function(n){n.destroy()}),this.__delegates=[],this._children instanceof Array&&(this._children.map(function(n){i.unRegisterPlugin(n.pluginName)}),this._children=null),this.root&&(this.root.hasOwnProperty("remove")?this.root.remove():this.root.parentNode&&this.root.parentNode.removeChild(this.root)),L(A(r.prototype),"__destroy",this).call(this),this.icons={},["root","parent"].map(function(n){e[n]=null})}}],[{key:"insert",value:function(e,i){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,o=i.children.length,l=Number(n),u=e instanceof window.Node;if(o){for(var f=0,h=null,p="";f<o;f++){h=i.children[f];var v=Number(h.getAttribute("data-index"));if(v>=l){p="beforebegin";break}else v<l&&(p="afterend")}return u?p==="afterend"?i.appendChild(e):i.insertBefore(e,h):h.insertAdjacentHTML(p,e),p==="afterend"?i.children[i.children.length-1]:i.children[f]}else return u?i.appendChild(e):i.insertAdjacentHTML("beforeend",e),i.children[i.children.length-1]}},{key:"defaultConfig",get:function(){return{}}},{key:"delegate",value:function(e,i,n,o){var l=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1,u=[];if(e instanceof window.Node&&typeof o=="function")if(Array.isArray(n))n.forEach(function(h){var p=xi(e,i,h,o,l);p.key="".concat(i,"_").concat(h),u.push(p)});else{var f=xi(e,i,n,o,l);f.key="".concat(i,"_").concat(n),u.push(f)}return u}},{key:"ROOT_TYPES",get:function(){return Kr}},{key:"POSITIONS",get:function(){return V}}]),r}(de),Zr=function(){function a(){var s=this;if(T(this,a),k(this,"__trigger",function(r){var t=new Date().getTime();s.timeStamp=t;for(var e=0;e<r.length;e++)s.__runHandler(r[e].target)}),this.__handlers=[],this.timeStamp=0,this.observer=null,!!window.ResizeObserver)try{this.observer=new window.ResizeObserver(Er(this.__trigger,100,{trailing:!0})),this.timeStamp=new Date().getTime()}catch(r){console.error(r)}}return S(a,[{key:"addObserver",value:function(r,t){if(this.observer){this.observer&&this.observer.observe(r);for(var e=r.getAttribute(Ce),i=this.__handlers,n=-1,o=0;o<i.length;o++)i[o]&&r===i[o].target&&(n=o);n>-1?this.__handlers[n].handler=t:this.__handlers.push({target:r,handler:t,playerId:e})}}},{key:"unObserver",value:function(r){var t=-1;this.__handlers.map(function(e,i){r===e.target&&(t=i)});try{this.observer&&this.observer.unobserve(r)}catch{}this.observer&&this.observer.unobserve(r),t>-1&&this.__handlers.splice(t,1)}},{key:"destroyObserver",value:function(){this.observer&&this.observer.disconnect(),this.observer=null,this.__handlers=null}},{key:"__runHandler",value:function(r){for(var t=this.__handlers,e=0;e<t.length;e++)if(t[e]&&r===t[e].target){try{t[e].handler(r)}catch(i){console.error(i)}return!0}return!1}}]),a}(),Ve=null;function Qr(a,s){return Ve||(Ve=new Zr),Ve.addObserver(a,s),Ve}function eo(a,s){Ve.unObserver(a,s)}var W={pluginGroup:{},init:function(s){var r=s._pluginInfoId;r||(r=new Date().getTime(),s._pluginInfoId=r),!s.config.closeResizeObserver&&Qr(s.root,function(){s.resize()}),this.pluginGroup[r]={_originalOptions:s.config||{},_plugins:{}}},formatPluginInfo:function(s,r){var t=null,e=null;return s.plugin&&typeof s.plugin=="function"?(t=s.plugin,e=s.options):(t=s,e={}),r&&(e.config=r||{}),{PLUFGIN:t,options:e}},checkPluginIfExits:function(s,r){for(var t=0;t<r.length;t++)if(s.toLowerCase()===r[t].pluginName.toLowerCase())return!0;return!1},getRootByConfig:function(s,r){for(var t=Object.keys(r),e=null,i=0;i<t.length;i++)if(s.toLowerCase()===t[i].toLowerCase()){e=r[t[i]];break}return d.typeOf(e)==="Object"?{root:e.root,position:e.position}:{}},lazyRegister:function(s,r){var t=this,e=r.timeout||1500;return Promise.race([r.loader().then(function(i){var n;i&&i.__esModule?n=i.default:n=i,t.register(s,n,i.options)}),new Promise(function(i,n){setTimeout(function(){n(new Error("timeout"))},e)})])},register:function(s,r){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(!(!s||!r||typeof r!="function"||r.prototype===void 0)){var e=s._pluginInfoId;if(!(!e||!this.pluginGroup[e])){this.pluginGroup[e]._plugins||(this.pluginGroup[e]._plugins={});var i=this.pluginGroup[e]._plugins,n=this.pluginGroup[e]._originalOptions;t.player=s;var o=t.pluginName||r.pluginName;if(!o)throw new Error("The property pluginName is necessary");if(r.isSupported&&!r.isSupported(s.config.mediaType,s.config.codecType)){console.warn("not supported plugin [".concat(o,"]"));return}t.config||(t.config={});for(var l=Object.keys(n),u=0;u<l.length;u++)if(o.toLowerCase()===l[u].toLowerCase()){var f=n[l[u]];d.typeOf(f)==="Object"?t.config=Object.assign({},t.config,n[l[u]]):d.typeOf(f)==="Boolean"&&(t.config.disable=!f);break}r.defaultConfig&&Object.keys(r.defaultConfig).forEach(function(p){typeof t.config[p]>"u"&&(t.config[p]=r.defaultConfig[p])}),t.root?typeof t.root=="string"&&(t.root=s[t.root]):t.root=s.root,t.index=t.config.index||0;try{i[o.toLowerCase()]&&(this.unRegister(e,o.toLowerCase()),console.warn("the is one plugin with same pluginName [".concat(o,"] exist, destroy the old instance")));var h=new r(t);return i[o.toLowerCase()]=h,i[o.toLowerCase()].func=r,h&&typeof h.afterCreate=="function"&&h.afterCreate(),h}catch(p){throw console.error(p),p}}}},unRegister:function(s,r){s._pluginInfoId&&(s=s._pluginInfoId),r=r.toLowerCase();try{var t=this.pluginGroup[s]._plugins[r];t&&(t.pluginName&&t.__destroy(),delete this.pluginGroup[s]._plugins[r])}catch(e){console.error("[unRegister:".concat(r,"] cgid:[").concat(s,"] error"),e)}},deletePlugin:function(s,r){var t=s._pluginInfoId;t&&this.pluginGroup[t]&&this.pluginGroup[t]._plugins&&delete this.pluginGroup[t]._plugins[r]},getPlugins:function(s){var r=s._pluginInfoId;return r&&this.pluginGroup[r]?this.pluginGroup[r]._plugins:{}},findPlugin:function(s,r){var t=s._pluginInfoId;if(!t||!this.pluginGroup[t])return null;var e=r.toLowerCase();return this.pluginGroup[t]._plugins[e]},beforeInit:function(s){var r=this;function t(e){return!e||!e.then?new Promise(function(i){i()}):e}return new Promise(function(e){if(r.pluginGroup){var i;return s._loadingPlugins&&s._loadingPlugins.length?i=Promise.all(s._loadingPlugins):i=Promise.resolve(),i.then(function(){var n=s._pluginInfoId;if(!r.pluginGroup[n]){e();return}var o=r.pluginGroup[n]._plugins,l=[];Object.keys(o).forEach(function(u){if(o[u]&&o[u].beforePlayerInit)try{var f=o[u].beforePlayerInit();l.push(t(f))}catch(h){throw l.push(t(null)),h}}),Promise.all([].concat(l)).then(function(){e()}).catch(function(u){console.error(u),e()})})}})},afterInit:function(s){var r=s._pluginInfoId;if(!(!r||!this.pluginGroup[r])){var t=this.pluginGroup[r]._plugins;Object.keys(t).forEach(function(e){t[e]&&t[e].afterPlayerInit&&t[e].afterPlayerInit()})}},setLang:function(s,r){var t=r._pluginInfoId;if(!(!t||!this.pluginGroup[t])){var e=this.pluginGroup[t]._plugins;Object.keys(e).forEach(function(i){if(e[i].updateLang)e[i].updateLang(s);else try{e[i].lang=s}catch{console.warn("".concat(i," setLang"))}})}},reRender:function(s){var r=this,t=s._pluginInfoId;if(!(!t||!this.pluginGroup[t])){var e=[],i=this.pluginGroup[t]._plugins;Object.keys(i).forEach(function(n){n!=="controls"&&i[n]&&(e.push({plugin:i[n].func,options:i[n].__args}),r.unRegister(t,n))}),e.forEach(function(n){r.register(s,n.plugin,n.options)})}},onPluginsReady:function(s){var r=s._pluginInfoId;if(!(!r||!this.pluginGroup[r])){var t=this.pluginGroup[r]._plugins||{};Object.keys(t).forEach(function(e){t[e].onPluginsReady&&typeof t[e].onPluginsReady=="function"&&t[e].onPluginsReady()})}},destroy:function(s){var r=s._pluginInfoId;if(this.pluginGroup[r]){eo(s.root);for(var t=this.pluginGroup[r]._plugins,e=0,i=Object.keys(t);e<i.length;e++){var n=i[e];this.unRegister(r,n)}delete this.pluginGroup[r],delete s._pluginInfoId}}},w={DEFAULT:"xgplayer",DEFAULT_SKIN:"xgplayer-skin-default",ENTER:"xgplayer-is-enter",PAUSED:"xgplayer-pause",PLAYING:"xgplayer-playing",ENDED:"xgplayer-ended",CANPLAY:"xgplayer-canplay",LOADING:"xgplayer-isloading",ERROR:"xgplayer-is-error",REPLAY:"xgplayer-replay",NO_START:"xgplayer-nostart",ACTIVE:"xgplayer-active",INACTIVE:"xgplayer-inactive",FULLSCREEN:"xgplayer-is-fullscreen",CSS_FULLSCREEN:"xgplayer-is-cssfullscreen",ROTATE_FULLSCREEN:"xgplayer-rotate-fullscreen",PARENT_ROTATE_FULLSCREEN:"xgplayer-rotate-parent",PARENT_FULLSCREEN:"xgplayer-fullscreen-parent",INNER_FULLSCREEN:"xgplayer-fullscreen-inner",NO_CONTROLS:"no-controls",FLEX_CONTROLS:"flex-controls",CONTROLS_FOLLOW:"controls-follow",CONTROLS_AUTOHIDE:"controls-autohide",TOP_BAR_AUTOHIDE:"top-bar-autohide",NOT_ALLOW_AUTOPLAY:"not-allow-autoplay",SEEKING:"seeking",PC:"xgplayer-pc",MOBILE:"xgplayer-mobile",MINI:"xgplayer-mini"};function Ai(){return{id:"",el:null,url:"",domEventType:"default",nullUrlStart:!1,width:600,height:337.5,fluid:!1,fitVideoSize:"fixed",videoFillMode:"auto",volume:.6,autoplay:!1,autoplayMuted:!1,loop:!1,isLive:!1,zoom:1,videoInit:!0,poster:"",isMobileSimulateMode:!1,defaultPlaybackRate:1,execBeforePluginsCall:null,allowSeekAfterEnded:!0,enableContextmenu:!0,closeVideoClick:!1,closeVideoDblclick:!1,closePlayerBlur:!1,closeDelayBlur:!1,leavePlayerTime:3e3,closePlayVideoFocus:!1,closePauseVideoFocus:!1,closeFocusVideoFocus:!0,closeControlsBlur:!0,topBarAutoHide:!0,videoAttributes:{},startTime:0,seekedStatus:"play",miniprogress:!1,disableSwipeHandler:function(){},enableSwipeHandler:function(){},preProcessUrl:null,ignores:[],whitelist:[],inactive:3e3,lang:wr(),controls:!0,marginControls:!1,fullscreenTarget:null,screenShot:!1,rotate:!1,pip:!1,download:!1,mini:!1,cssFullscreen:!0,keyShortcut:!0,presets:[],plugins:[],playbackRate:1,definition:{list:[]},playsinline:!0,customDuration:0,timeOffset:0,icons:{},i18n:[],tabindex:0,thumbnail:null,videoConfig:{},isHideTips:!1,minWaitDelay:200,commonStyle:{progressColor:"",playedColor:"",cachedColor:"",sliderBtnStyle:{},volumeColor:""}}}var to=function(s,r){var t,e,i;r.preset&&r.options?i=new r.preset(r.options,s.config):i=new r({},s.config);var n=i,o=n.plugins,l=o===void 0?[]:o,u=n.ignores,f=u===void 0?[]:u,h=n.icons,p=h===void 0?{}:h,v=n.i18n,g=v===void 0?[]:v;s.config.plugins||(s.config.plugins=[]),s.config.ignores||(s.config.ignores=[]),(t=s.config.plugins).push.apply(t,Q(l)),(e=s.config.ignores).push.apply(e,Q(f)),Object.keys(p).map(function(_){s.config.icons[_]||(s.config.icons[_]=p[_])});var m=s.config.i18n||[];g.push.apply(g,Q(m)),s.config.i18n=g},io=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(y(t),"onMouseEnter",function(o){var l=y(t),u=l.player,f=l.playerConfig;f.closeControlsBlur&&u.focus({autoHide:!1})}),k(y(t),"onMouseLeave",function(o){var l=y(t),u=l.player;u.focus()}),t}return S(r,[{key:"beforeCreate",value:function(e){!e.config.mode&&O.device==="mobile"&&(e.config.mode="flex"),e.player.config.marginControls&&(e.config.autoHide=!1)}},{key:"afterCreate",value:function(){var e=this,i=this.config,n=i.disable,o=i.height,l=i.mode;if(!n){l==="flex"&&this.player.addClass(w.FLEX_CONTROLS);var u={height:"".concat(o,"px")};Object.keys(u).map(function(h){e.root.style[h]=u[h]}),this.left=this.find("xg-left-grid"),this.center=this.find("xg-center-grid"),this.right=this.find("xg-right-grid"),this.innerRoot=this.find("xg-inner-controls"),this.on(Xe,function(h){h?d.addClass(e.root,"mini-controls"):d.removeClass(e.root,"mini-controls")});var f=this.playerConfig.isMobileSimulateMode;O.device!=="mobile"&&f!=="mobile"&&(this.bind("mouseenter",this.onMouseEnter),this.bind("mouseleave",this.onMouseLeave))}}},{key:"focus",value:function(){this.player.focus({autoHide:!1})}},{key:"focusAwhile",value:function(){this.player.focus({autoHide:!0})}},{key:"blur",value:function(){this.player.blur({ignorePaused:!0})}},{key:"recoverAutoHide",value:function(){this.config.autoHide&&d.addClass(this.root,w.CONTROLS_AUTOHIDE)}},{key:"pauseAutoHide",value:function(){d.removeClass(this.root,w.CONTROLS_AUTOHIDE)}},{key:"show",value:function(e){this.root.style.display="",this.player.focus()}},{key:"hide",value:function(){this.root.style.display="none"}},{key:"mode",get:function(){return this.config.mode}},{key:"registerPlugin",value:function(e){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;if(this.root){var o=e.defaultConfig||{};if(!i.root){var l=i.position?i.position:i.config&&i.config.position?i.config.position:o.position;switch(l){case V.CONTROLS_LEFT:i.root=this.left;break;case V.CONTROLS_RIGHT:i.root=this.right;break;case V.CONTROLS_CENTER:i.root=this.center;break;case V.CONTROLS:i.root=this.root;break;default:i.root=this.left}return L(A(r.prototype),"registerPlugin",this).call(this,e,i,n)}}}},{key:"destroy",value:function(){O.device!=="mobile"&&(this.unbind("mouseenter",this.onMouseEnter),this.unbind("mouseleave",this.onMouseLeave))}},{key:"render",value:function(){var e=this.config,i=e.mode,n=e.autoHide,o=e.initShow,l=e.disable;if(!l){var u=d.classNames({"xgplayer-controls":!0},{"flex-controls":i==="flex"},{"bottom-controls":i==="bottom"},k({},w.CONTROLS_AUTOHIDE,n),{"xgplayer-controls-initshow":o||!n});return'<xg-controls class="'.concat(u,`" unselectable="on">
3
3
  <xg-inner-controls class="xg-inner-controls xg-pos">
4
4
  <xg-left-grid class="xg-left-grid">
5
5
  </xg-left-grid>
@@ -7,7 +7,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
7
7
  <xg-right-grid class="xg-right-grid">
8
8
  </xg-right-grid>
9
9
  </xg-inner-controls>
10
- </xg-controls>`)}}}],[{key:"pluginName",get:function(){return"controls"}},{key:"defaultConfig",get:function(){return{disable:!1,autoHide:!0,mode:"",initShow:!1}}}]),r}(B),no={LANG:"en",TEXT:{ERROR_TYPES:{network:{code:1,msg:"video download error"},mse:{code:2,msg:"stream append error"},parse:{code:3,msg:"parsing error"},format:{code:4,msg:"wrong format"},decoder:{code:5,msg:"decoding error"},runtime:{code:6,msg:"grammatical errors"},timeout:{code:7,msg:"play timeout"},other:{code:8,msg:"other errors"}},HAVE_NOTHING:"There is no information on whether audio/video is ready",HAVE_METADATA:"Audio/video metadata is ready ",HAVE_CURRENT_DATA:"Data about the current play location is available, but there is not enough data to play the next frame/millisecond",HAVE_FUTURE_DATA:"Current and at least one frame of data is available",HAVE_ENOUGH_DATA:"The available data is sufficient to start playing",NETWORK_EMPTY:"Audio/video has not been initialized",NETWORK_IDLE:"Audio/video is active and has been selected for resources, but no network is used",NETWORK_LOADING:"The browser is downloading the data",NETWORK_NO_SOURCE:"No audio/video source was found",MEDIA_ERR_ABORTED:"The fetch process is aborted by the user",MEDIA_ERR_NETWORK:"An error occurred while downloading",MEDIA_ERR_DECODE:"An error occurred while decoding",MEDIA_ERR_SRC_NOT_SUPPORTED:"Audio/video is not supported",REPLAY:"Replay",ERROR:"Network is offline",PLAY_TIPS:"Play",PAUSE_TIPS:"Pause",PLAYNEXT_TIPS:"Play next",DOWNLOAD_TIPS:"Download",ROTATE_TIPS:"Rotate",RELOAD_TIPS:"Reload",FULLSCREEN_TIPS:"Fullscreen",EXITFULLSCREEN_TIPS:"Exit fullscreen",CSSFULLSCREEN_TIPS:"Cssfullscreen",EXITCSSFULLSCREEN_TIPS:"Exit cssfullscreen",TEXTTRACK:"Caption",PIP:"PIP",SCREENSHOT:"Screenshot",LIVE:"LIVE",OFF:"Off",OPEN:"Open",MINI_DRAG:"Click and hold to drag",MINISCREEN:"Miniscreen",REFRESH_TIPS:"Please Try",REFRESH:"Refresh",FORWARD:"forward",LIVE_TIP:"Live"}},J={lang:{},langKeys:[],textKeys:[]};function Ue(a,s){return Object.keys(s).forEach(function(r){var t=d.typeOf(s[r]),e=d.typeOf(a[r]);if(t==="Array"){var i;e!=="Array"&&(a[r]=[]),(i=a[r]).push.apply(i,Q(s[r]))}else t==="Object"?(e!=="Object"&&(a[r]={}),Ue(a[r],s[r])):a[r]=s[r]}),a}function Li(){Object.keys(J.lang.en).map(function(a){J.textKeys[a]=a})}function ro(a,s){var r=[];if(s||(s=J),!!s.lang){d.typeOf(a)!=="Array"?r=Object.keys(a).map(function(i){var n=i==="zh"?"zh-cn":i;return{LANG:n,TEXT:a[i]}}):r=a;var t=s,e=t.lang;r.map(function(i){i.LANG==="zh"&&(i.LANG="zh-cn"),e[i.LANG]?Ue(e[i.LANG]||{},i.TEXT||{}):Dt(i,s)}),Li()}}function Dt(a,s){var r=a.LANG;if(s||(s=J),!!s.lang){var t=a.TEXT||{};r==="zh"&&(r="zh-cn"),s.lang[r]?Ue(s.lang[r],t):(s.langKeys.push(r),s.lang[r]=t),Li()}}function oo(a){var s,r={lang:{},langKeys:[],textKeys:{},pId:a};return Ue(r.lang,J.lang),(s=r.langKeys).push.apply(s,Q(J.langKeys)),Ue(r.textKeys,J.textKeys),r}Dt(no);var Ae={get textKeys(){return J.textKeys},get langKeys(){return J.langKeys},get lang(){var a={};return J.langKeys.map(function(s){a[s]=J.lang[s]}),J.lang["zh-cn"]&&(a.zh=J.lang["zh-cn"]||{}),a},extend:ro,use:Dt,init:oo},M={INITIAL:1,READY:2,ATTACHING:3,ATTACHED:4,NOTALLOW:5,RUNNING:6,ENDED:7,DESTROYED:8},Di=["ERROR","INITIAL","READY","ATTACHING","ATTACHED","NOTALLOW","RUNNING","ENDED","DESTROYED"],Y={},Ot=null,Oi=function(a){I(r,a);var s=P(r);function r(){return T(this,r),s.apply(this,arguments)}return S(r,[{key:"add",value:function(e){e&&(Y[e.playerId]=e,Object.keys(Y).length===1&&this.setActive(e.playerId,!0))}},{key:"remove",value:function(e){e&&(e.isUserActive,delete Y[e.playerId])}},{key:"_iterate",value:function(e){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;for(var n in Y)if(Object.prototype.hasOwnProperty.call(Y,n)){var o=Y[n];if(i){if(e(o))break}else e(o)}}},{key:"forEach",value:function(e){this._iterate(e)}},{key:"find",value:function(e){var i=null;return this._iterate(function(n){var o=e(n);return o&&(i=n),o},!0),i}},{key:"findAll",value:function(e){var i=[];return this._iterate(function(n){e(n)&&i.push(n)}),i}},{key:"setActive",value:function(e){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(Y[e])return i?this.forEach(function(n){e===n.playerId?(n.isUserActive=!0,n.isInstNext=!1):n.isUserActive=!1}):Y[e].isUserActive=i,e}},{key:"getActiveId",value:function(){for(var e=Object.keys(Y),i=0;i<e.length;i++){var n=Y[e[i]];if(n&&n.isUserActive)return e[i]}return null}},{key:"setNext",value:function(e){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(Y[e])return i?this.forEach(function(n){e===n.playerId?(n.isUserActive=!1,n.isInstNext=!0):n.isInstNext=!1}):Y[e].isInstNext=i,e}}],[{key:"getInstance",value:function(){return Ot||(Ot=new r),Ot}}]),r}(Jt.EventEmitter);function so(a){for(var s=Object.keys(Y),r=0;r<s.length;r++){var t=Y[s[r]];if(t.root===a)return t}return null}var ao=["play","pause","replay","retry"],Ri=0,Ni=0,pe=null,nt=function(a){I(r,a);var s=P(r);function r(t){var e;T(this,r);var i=d.deepMerge(Ai(),t);e=s.call(this,i),k(y(e),"canPlayFunc",function(){if(e.config){var p=e.config,m=p.autoplay,_=p.defaultPlaybackRate;F.logInfo("player","canPlayFunc, startTime",e.__startTime),e.__startTime>0&&e.duration>0&&(e.currentTime=e.__startTime>e.duration?e.duration:e.__startTime,e.__startTime=-1),e.playbackRate=_,(m||e._useAutoplay)&&e.mediaPlay(),e.off(se,e.canPlayFunc),e.removeClass(b.ENTER)}}),k(y(e),"onFullscreenChange",function(p,m){var _=function(){d.setTimeout(y(e),function(){e.resize()},100)},C=d.getFullScreenEl();e._fullActionFrom?e._fullActionFrom="":e.emit(Je,{eventType:"system",action:"switch_fullscreen",pluginName:"player",currentTime:e.currentTime,duration:e.duration,props:[{prop:"fullscreen",from:!0,to:!1}]});var w=wr(C,e.playerId,Ce);if(m||C&&(C===e._fullscreenEl||w))_(),!e.config.closeFocusVideoFocus&&e.media.focus(),e.fullscreen=!0,e.changeFullStyle(e.root,C,b.FULLSCREEN),e.emit(le,!0,e._fullScreenOffset),e.cssfullscreen&&e.exitCssFullscreen();else if(e.fullscreen){_();var E=y(e),N=E._fullScreenOffset,R=E.config;if(R.needFullscreenScroll?(window.scrollTo(N.left,N.top),d.setTimeout(y(e),function(){e.fullscreen=!1,e._fullScreenOffset=null},100)):(!e.config.closeFocusVideoFocus&&e.media.focus(),e.fullscreen=!1,e._fullScreenOffset=null),e.cssfullscreen)e.removeClass(b.FULLSCREEN);else{var H=e._fullscreenEl;!H&&(e.root.contains(p.target)||p.target===e.root)&&(H=p.target),e.recoverFullStyle(e.root,H,b.FULLSCREEN)}e._fullscreenEl=null,e.emit(le,!1)}}),k(y(e),"_onWebkitbeginfullscreen",function(p){e._fullscreenEl=e.media,e.onFullscreenChange(p,!0)}),k(y(e),"_onWebkitendfullscreen",function(p){e.onFullscreenChange(p,!1)}),Ti(y(e),ao),e.config=i,e._pluginInfoId=d.generateSessionId(),yr(y(e));var n=e.constructor.defaultPreset;if(e.config.presets.length){var o=e.config.presets.indexOf("default");o>=0&&n&&(e.config.presets[o]=n)}else n&&e.config.presets.push(n);e.userTimer=null,e.waitTimer=null,e.handleSource=!0,e._state=M.INITIAL,e.isError=!1,e._hasStart=!1,e.isSeeking=!1,e.isCanplay=!1,e._useAutoplay=!1,e.__startTime=-1,e.rotateDeg=0,e.isActive=!1,e.fullscreen=!1,e.cssfullscreen=!1,e.isRotateFullscreen=!1,e._fullscreenEl=null,e.timeSegments=[],e._cssfullscreenEl=null,e.curDefinition=null,e._orgCss="",e._fullScreenOffset=null,e._videoHeight=0,e._videoWidth=0,e.videoPos={pi:1,scale:0,rotate:-1,x:0,y:0,h:-1,w:-1,vy:0,vx:0},e.sizeInfo={width:0,height:0,left:0,top:0},e._accPlayed={t:0,acc:0,loopAcc:0},e._offsetInfo={currentTime:-1,duration:0},e.innerContainer=null,e.controls=null,e.topBar=null,e.root=null,e.__i18n=Ae.init(e._pluginInfoId),O.os.isAndroid&&O.osVersion>0&&O.osVersion<6&&(e.config.autoplay=!1),e.database=new Hr,e.isUserActive=!1,e._onceSeekCanplay=null,e._isPauseBeforeSeek=0,e.innerStates={isActiveLocked:!1},e.instManager=pe;var l=e._initDOM();if(!l)return console.error(new Error("can't find the dom which id is ".concat(e.config.id," or this.config.el does not exist"))),dt(e);var u=e.config,f=u.definition,h=f===void 0?{}:f,g=u.url;if(!g&&h.list&&h.list.length>0){var v=h.list.find(function(p){return p.definition&&p.definition===h.defaultDefinition});v||(h.defaultDefinition=h.list[0].definition,v=h.list[0]),e.config.url=v.url,e.curDefinition=v}return e._bindEvents(),e._registerPresets(),e._registerPlugins(),W.onPluginsReady(y(e)),e.getInitDefinition(),e.setState(M.READY),d.setTimeout(y(e),function(){e.emit(Ct)},0),e.onReady&&e.onReady(),(e.config.videoInit||e.config.autoplay)&&(!e.hasStart||e.state<M.ATTACHED)&&e.start(),e}return S(r,[{key:"_initDOM",value:function(){var e,i=this;if(this.root=this.config.id?document.getElementById(this.config.id):null,!this.root){var n=this.config.el;if(n&&n.nodeType===1)this.root=n;else return this.emit(Be,new je("use",this.config.vid,{line:32,handle:"Constructor",msg:"container id can't be empty"})),console.error("this.confg.id or this.config.el can't be empty"),!1}var o=so(this.root);o&&(F.logWarn("The is an Player instance already exists in this.root, destroy it and reinitialize"),o.destroy()),this.root.setAttribute(Ce,this.playerId),(e=pe)===null||e===void 0||e.add(this),W.init(this),this._initBaseDoms();var l=this.constructor.XgVideoProxy;if(l&&this.mediaConfig.mediaType===l.mediaType){var u=this.innerContainer||this.root;this.detachVideoEvents(this.media);var f=new l(u,this.config,this.mediaConfig);this.attachVideoEvents(f),this.media=f}if(this.media.setAttribute(Ce,this.playerId),this.config.controls){var h=this.config.controls.root||null,g=W.register(this,io,{root:h});this.controls=g}var v=this.config.isMobileSimulateMode==="mobile"?"mobile":O.device;if(this.addClass("".concat(b.DEFAULT," ").concat(b.INACTIVE," xgplayer-").concat(v," ").concat(this.config.controls?"":b.NO_CONTROLS)),this.config.autoplay?this.addClass(b.ENTER):this.addClass(b.NO_START),this.config.fluid){var p=this.config,m=p.width,_=p.height;(typeof m!="number"||typeof _!="number")&&(m=600,_=337.5);var C={width:"100%",height:"0","max-width":"100%","padding-top":"".concat(_*100/m,"%")};Object.keys(C).forEach(function(D){i.root.style[D]=C[D]})}else["width","height"].forEach(function(D){i.config[D]&&(typeof i.config[D]!="number"?i.root.style[D]=i.config[D]:i.root.style[D]="".concat(i.config[D],"px"))});var w=this.root.getBoundingClientRect(),E=w.width,N=w.height,R=w.left,H=w.top;return this.sizeInfo.width=E,this.sizeInfo.height=N,this.sizeInfo.left=R,this.sizeInfo.top=H,!0}},{key:"_initBaseDoms",value:function(){this.topBar=null,this.leftBar=null,this.rightBar=null,this.config.marginControls&&(this.innerContainer=d.createDom("xg-video-container","",{"data-index":-1},"xg-video-container"),this.root.appendChild(this.innerContainer))}},{key:"_bindEvents",value:function(){var e=this;["focus","blur"].forEach(function(i){e.on(i,e["on"+i.charAt(0).toUpperCase()+i.slice(1)])}),ki.forEach(function(i){document&&document.addEventListener(i,e.onFullscreenChange)}),O.os.isIos&&(this.media.addEventListener("webkitbeginfullscreen",this._onWebkitbeginfullscreen),this.media.addEventListener("webkitendfullscreen",this._onWebkitendfullscreen)),this.once(ae,this.resize),this.playFunc=function(){e.config.closeFocusVideoFocus||e.media.focus()},this.once(X,this.playFunc)}},{key:"_unbindEvents",value:function(){var e=this;this.root.removeEventListener("mousemove",this.mousemoveFunc),ki.forEach(function(i){document.removeEventListener(i,e.onFullscreenChange)}),this.playFunc&&this.off(X,this.playFunc),this.off(se,this.canPlayFunc),this.media.removeEventListener("webkitbeginfullscreen",this._onWebkitbeginfullscreen),this.media.removeEventListener("webkitendfullscreen",this._onWebkitendfullscreen)}},{key:"_clearUserTimer",value:function(){this.userTimer&&(d.clearTimeout(this,this.userTimer),this.userTimer=null)}},{key:"_startInit",value:function(e){var i=this;if(this.media&&!((!e||e===""||d.typeOf(e)==="Array"&&e.length===0)&&(e="",this.emit(ai),F.logWarn("config.url is null, please get url and run player._startInit(url)"),this.config.nullUrlStart))){this.handleSource&&(this._detachSourceEvents(this.media),d.typeOf(e)==="Array"&&e.length>0?this._attachSourceEvents(this.media,e):!this.media.src||this.media.src!==e?this.media.src=e:e||this.media.removeAttribute("src")),d.typeOf(this.config.volume)==="Number"&&(this.volume=this.config.volume);var n=this.innerContainer?this.innerContainer:this.root;this.media instanceof window.Element&&!n.contains(this.media)&&n.insertBefore(this.media,n.firstChild);var o=this.media.readyState;F.logInfo("_startInit readyState",o),this.config.autoplay&&(!d.isMSE(this.media)&&this.load(),(O.os.isIpad||O.os.isPhone)&&this.mediaPlay());var l=this.config.startTime;this.__startTime=l>0?l:-1,this.config.startTime=0,o>=2&&this.duration>0?this.canPlayFunc():this.on(se,this.canPlayFunc),(!this.hasStart||this.state<M.ATTACHED)&&W.afterInit(this),this.hasStart=!0,this.setState(M.ATTACHED),d.setTimeout(this,function(){i.emit(We)},0)}}},{key:"_registerPlugins",value:function(){var e=this,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this._loadingPlugins=[];var n=this.config.ignores||[],o=this.config.plugins||[],l=this.config.i18n||[];i&&Ae.extend(l,this.__i18n);var u=n.join("||").toLowerCase().split("||"),f=this.plugins;o.forEach(function(h){try{var g=h.plugin?h.plugin.pluginName:h.pluginName;if(g&&u.indexOf(g.toLowerCase())>-1)return null;if(!i&&f[g.toLowerCase()])return;if(h.lazy&&h.loader){var v=W.lazyRegister(e,h);h.forceBeforeInit&&(v.then(function(){e._loadingPlugins.splice(e._loadingPlugins.indexOf(v),1)}).catch(function(p){F.logError("_registerPlugins:loadingPlugin",p),e._loadingPlugins.splice(e._loadingPlugins.indexOf(v),1)}),e._loadingPlugins.push(v));return}return e.registerPlugin(h)}catch(p){F.logError("_registerPlugins:",p)}})}},{key:"_registerPresets",value:function(){var e=this;this.config.presets.forEach(function(i){to(e,i)})}},{key:"_getRootByPosition",value:function(e){var i=null;switch(e){case V.ROOT_RIGHT:this.rightBar||(this.rightBar=d.createPositionBar("xg-right-bar",this.root)),i=this.rightBar;break;case V.ROOT_LEFT:this.leftBar||(this.leftBar=d.createPositionBar("xg-left-bar",this.root)),i=this.leftBar;break;case V.ROOT_TOP:this.topBar||(this.topBar=d.createPositionBar("xg-top-bar",this.root),this.config.topBarAutoHide&&d.addClass(this.topBar,b.TOP_BAR_AUTOHIDE)),i=this.topBar;break;default:i=this.innerContainer||this.root;break}return i}},{key:"registerPlugin",value:function(e,i){var n=W.formatPluginInfo(e,i),o=n.PLUFGIN,l=n.options,u=this.config.plugins,f=W.checkPluginIfExits(o.pluginName,u);!f&&u.push(o);var h=W.getRootByConfig(o.pluginName,this.config);h.root&&(l.root=h.root),h.position&&(l.position=h.position);var g=l.position?l.position:l.config&&l.config.position||o.defaultConfig&&o.defaultConfig.position;return!l.root&&typeof g=="string"&&g.indexOf("controls")>-1?this.controls&&this.controls.registerPlugin(o,l,o.pluginName):(l.root||(l.root=this._getRootByPosition(g)),W.register(this,o,l))}},{key:"deregister",value:function(e){typeof e=="string"?W.unRegister(this,e):e instanceof de&&W.unRegister(this,e.pluginName)}},{key:"unRegisterPlugin",value:function(e){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;this.deregister(e),i&&this.removePluginFromConfig(e)}},{key:"removePluginFromConfig",value:function(e){var i;if(typeof e=="string"?i=e:e instanceof de&&(i=e.pluginName),!!i)for(var n=this.config.plugins.length-1;n>-1;n--){var o=this.config.plugins[n];if(o.pluginName.toLowerCase()===i.toLowerCase()){this.config.plugins.splice(n,1);break}}}},{key:"plugins",get:function(){return W.getPlugins(this)}},{key:"getPlugin",value:function(e){var i=W.findPlugin(this,e);return i&&i.pluginName?i:null}},{key:"addClass",value:function(e){this.root&&(d.hasClass(this.root,e)||d.addClass(this.root,e))}},{key:"removeClass",value:function(e){this.root&&d.removeClass(this.root,e)}},{key:"hasClass",value:function(e){if(this.root)return d.hasClass(this.root,e)}},{key:"setAttribute",value:function(e,i){this.root&&this.root.setAttribute(e,i)}},{key:"removeAttribute",value:function(e,i){this.root&&this.root.removeAttribute(e,i)}},{key:"start",value:function(e){var i=this;if(!(this.state>M.ATTACHING))return!e&&!this.config.url&&this.getInitDefinition(),this.hasStart=!0,this.setState(M.ATTACHING),this._registerPlugins(!1),W.beforeInit(this).then(function(){if(i.config){e||(e=i.url||i.config.url);var n=i._preProcessUrl(e),o=i._startInit(n.url);return o}}).catch(function(n){throw n.fileName="player",n.lineNumber="236",F.logError("start:beforeInit:",n),n})}},{key:"switchURL",value:function(e,i){var n=this,o=e;d.typeOf(e)==="Object"&&(o=e.url),o=this._preProcessUrl(o).url;var l=this.currentTime;this.__startTime=l;var u=this.paused&&!this.isError;return this.src=o,new Promise(function(f,h){var g=function(m){n.off("timeupdate",v),n.off("canplay",v),h(m)},v=function(){n.duration>0&&n.__startTime>0&&(n.currentTime=n.__startTime,n.__startTime=-1),u&&n.pause(),n.off("error",g),f(!0)};if(n.once("error",g),!o){n.errorHandler("error",{code:6,message:"empty_src"});return}O.os.isAndroid?n.once("timeupdate",v):n.once("canplay",v),n.play()})}},{key:"videoPlay",value:function(){this.mediaPlay()}},{key:"mediaPlay",value:function(){var e=this;if(!this.hasStart&&this.state<M.ATTACHED){this.removeClass(b.NO_START),this.addClass(b.ENTER),this.start(),this._useAutoplay=!0;return}this.state<M.RUNNING&&(this.removeClass(b.NO_START),!this.isCanplay&&this.addClass(b.ENTER));var i=L(A(r.prototype),"play",this).call(this);return i!==void 0&&i&&i.then?i.then(function(){e.removeClass(b.NOT_ALLOW_AUTOPLAY),e.addClass(b.PLAYING),e.state<M.RUNNING&&(F.logInfo(">>>>playPromise.then"),e.setState(M.RUNNING),e.emit(ke))}).catch(function(n){if(F.logWarn(">>>>playPromise.catch",n.name),e.media&&e.media.error){e.onError(),e.removeClass(b.ENTER);return}n.name==="NotAllowedError"&&(e._errorTimer=d.setTimeout(e,function(){e._errorTimer=null,e.emit(Et),e.addClass(b.NOT_ALLOW_AUTOPLAY),e.removeClass(b.ENTER),e.pause(),e.setState(M.NOTALLOW)},0))}):(F.logWarn("video.play not return promise"),this.state<M.RUNNING&&(this.setState(M.RUNNING),this.removeClass(b.NOT_ALLOW_AUTOPLAY),this.removeClass(b.NO_START),this.removeClass(b.ENTER),this.addClass(b.PLAYING),this.emit(ke))),i}},{key:"mediaPause",value:function(){L(A(r.prototype),"pause",this).call(this)}},{key:"videoPause",value:function(){L(A(r.prototype),"pause",this).call(this)}},{key:"play",value:function(){var e=this;return this.removeClass(b.PAUSED),ue(this,"play",function(){return e.mediaPlay()})}},{key:"pause",value:function(){var e=this;ue(this,"pause",function(){L(A(r.prototype),"pause",e).call(e)})}},{key:"seek",value:function(e,i){var n=this;if(!(!this.media||Number.isNaN(Number(e))||!this.hasStart)){var o=this.config,l=o.isSeekedPlay,u=o.seekedStatus,f=i||(l?"play":u);e=e<0?0:e>this.duration?parseInt(this.duration,10):e,!this._isPauseBeforeSeek&&(this._isPauseBeforeSeek=this.paused?2:1),this._onceSeekCanplay&&this.off(oe,this._onceSeekCanplay),this._onceSeekCanplay=function(){switch(n.removeClass(b.ENTER),n.isSeeking=!1,f){case"play":n.play();break;case"pause":n.pause();break;default:n._isPauseBeforeSeek>1||n.paused?n.pause():n.play()}n._isPauseBeforeSeek=0,n._onceSeekCanplay=null},this.once(oe,this._onceSeekCanplay),this.state<M.RUNNING?(this.removeClass(b.NO_START),this.currentTime=e,this.play()):this.currentTime=e}}},{key:"getInitDefinition",value:function(){var e=this,i=this.config,n=i.definition,o=i.url;!o&&n&&n.list&&n.list.length>0&&n.defaultDefinition&&n.list.map(function(l){l.definition===n.defaultDefinition&&(e.config.url=l.url,e.curDefinition=l)})}},{key:"changeDefinition",value:function(e,i){var n=this,o=this.config.definition;if(Array.isArray(o==null?void 0:o.list)&&o.list.forEach(function(u){(e==null?void 0:e.definition)===u.definition&&(n.curDefinition=u)}),e!=null&&e.bitrate&&typeof e.bitrate!="number"&&(e.bitrate=parseInt(e.bitrate,10)||0),this.emit(Tt,{from:i,to:e}),!this.hasStart){this.config.url=e.url;return}var l=this.switchURL(e.url,U({seamless:o.seamless!==!1&&typeof MediaSource<"u"&&typeof MediaSource.isTypeSupported=="function"},e));l&&l.then?l.then(function(){n.emit(St,{from:i,to:e})}):this.emit(St,{from:i,to:e})}},{key:"reload",value:function(){this.load(),this.reloadFunc=function(){this.play()},this.once(ae,this.reloadFunc)}},{key:"resetState",value:function(){var e=this,i=b.NOT_ALLOW_AUTOPLAY,n=b.PLAYING,o=b.NO_START,l=b.PAUSED,u=b.REPLAY,f=b.ENTER,h=b.ENDED,g=b.ERROR,v=b.LOADING,p=[i,n,o,l,u,f,h,g,v];this.hasStart=!1,this.isError=!1,this._useAutoplay=!1,this.mediaPause(),this._accPlayed.acc=0,this._accPlayed.t=0,this._accPlayed.loopAcc=0,p.forEach(function(m){e.removeClass(m)}),this.addClass(b.NO_START),this.emit(Ze)}},{key:"reset",value:function(){var e=this,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],n=arguments.length>1?arguments[1]:void 0;this.resetState();var o=this.plugins;if(o&&(i.map(function(u){e.deregister(u)}),n)){var l=Ai();Object.keys(this.config).keys(function(u){e.config[u]!=="undefined"&&(u==="plugins"||u==="presets"||u==="el"||u==="id")&&(e.config[u]=l[u])})}}},{key:"destroy",value:function(){var e,i=this,n=this.innerContainer,o=this.root,l=this.media;if(!(!o||!l)){if(this.hasStart=!1,this._useAutoplay=!1,o.removeAttribute(Ce),this.updateAcc("destroy"),this._unbindEvents(),this._detachSourceEvents(this.media),d.clearAllTimers(this),this.emit(bt),(e=pe)===null||e===void 0||e.remove(this),W.destroy(this),Si(this),L(A(r.prototype),"destroy",this).call(this),this.fullscreen&&this._fullscreenEl===this.root&&this.exitFullscreen(),n)for(var u=n.children,f=0;f<u.length;f++)n.removeChild(u[f]);!n&&l instanceof window.Node&&o.contains(l)&&o.removeChild(l),["topBar","leftBar","rightBar","innerContainer"].map(function(g){i[g]&&o.removeChild(i[g]),i[g]=null});var h=o.className.split(" ");h.length>0?o.className=h.filter(function(g){return g.indexOf("xgplayer")<0}).join(" "):o.className="",this.removeAttribute("data-xgfill"),["isSeeking","isCanplay","isActive","cssfullscreen","fullscreen"].forEach(function(g){i[g]=!1})}}},{key:"replay",value:function(){var e=this;this.removeClass(b.ENDED),this.currentTime=0,this.isSeeking=!1,ue(this,"replay",function(){e.once(oe,function(){var i=e.mediaPlay();i&&i.catch&&i.catch(function(n){console.log(n)})}),e.emit(Ge),e.onPlay()})}},{key:"retry",value:function(){var e=this;this.removeClass(b.ERROR),this.addClass(b.LOADING),ue(this,"retry",function(){var i=e.currentTime,n=e.config.url,o=d.isMSE(e.media)?{url:n}:e._preProcessUrl(n);e.src=o.url,!e.config.isLive&&(e.currentTime=i),e.once(se,function(){e.mediaPlay()})})}},{key:"changeFullStyle",value:function(e,i,n,o){e&&(o||(o=b.PARENT_FULLSCREEN),this._orgCss||(this._orgCss=d.filterStyleFromText(e)),d.addClass(e,n),i&&i!==e&&!this._orgPCss&&(this._orgPCss=d.filterStyleFromText(i),d.addClass(i,o),i.setAttribute(Ce,this.playerId)))}},{key:"recoverFullStyle",value:function(e,i,n,o){o||(o=b.PARENT_FULLSCREEN),this._orgCss&&(d.setStyleFromCsstext(e,this._orgCss),this._orgCss=""),d.removeClass(e,n),i&&i!==e&&this._orgPCss&&(d.setStyleFromCsstext(i,this._orgPCss),this._orgPCss="",d.removeClass(i,o),i.removeAttribute(Ce))}},{key:"getFullscreen",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.config.fullscreenTarget,i=this.root,n=this.media;(e==="video"||e==="media")&&(e=this[e]),e||(e=i),this._fullScreenOffset={top:d.scrollTop(),left:d.scrollLeft()},this._fullscreenEl=e,this._fullActionFrom="get";var o=d.getFullScreenEl();if(o===this._fullscreenEl)return this.onFullscreenChange(),Promise.resolve();try{for(var l=0;l<Ci.length;l++){var u=Ci[l];if(e[u]){var f=u==="webkitRequestFullscreen"?e.webkitRequestFullscreen(window.Element.ALLOW_KEYBOARD_INPUT):e[u]();return f&&f.then?f:Promise.resolve()}}return n.fullscreenEnabled||n.webkitSupportsFullscreen?(n.webkitEnterFullscreen(),Promise.resolve()):Promise.reject(new Error("call getFullscreen fail"))}catch{return Promise.reject(new Error("call getFullscreen fail"))}}},{key:"exitFullscreen",value:function(e){if(this.isRotateFullscreen&&this.exitRotateFullscreen(),!(!this._fullscreenEl&&!d.getFullScreenEl())){this.root;var i=this.media;this._fullActionFrom="exit";try{for(var n=0;n<Ei.length;n++){var o=Ei[n];if(document[o]){var l=document[o]();return l&&l.then?l:Promise.resolve()}}return i&&i.webkitSupportsFullscreen?(i.webkitExitFullScreen(),Promise.resolve()):Promise.reject(new Error("call exitFullscreen fail"))}catch{return Promise.reject(new Error("call exitFullscreen fail"))}}}},{key:"getCssFullscreen",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.config.fullscreenTarget;this.isRotateFullscreen?this.exitRotateFullscreen():this.fullscreen&&this.exitFullscreen();var i=e?"".concat(b.INNER_FULLSCREEN," ").concat(b.CSS_FULLSCREEN):b.CSS_FULLSCREEN;this.changeFullStyle(this.root,e,i);var n=this.config.fullscreen,o=n===void 0?{}:n,l=o.useCssFullscreen===!0||typeof o.useCssFullscreen=="function"&&o.useCssFullscreen();l&&(this.fullscreen=!0,this.emit(le,!0)),this._cssfullscreenEl=e,this.cssfullscreen=!0,this.emit(Ye,!0)}},{key:"exitCssFullscreen",value:function(){var e=this._cssfullscreenEl?"".concat(b.INNER_FULLSCREEN," ").concat(b.CSS_FULLSCREEN):b.CSS_FULLSCREEN;if(!this.fullscreen)this.recoverFullStyle(this.root,this._cssfullscreenEl,e);else{var i=this.config.fullscreen,n=i===void 0?{}:i,o=n.useCssFullscreen===!0||typeof n.useCssFullscreen=="function"&&n.useCssFullscreen();o?(this.recoverFullStyle(this.root,this._cssfullscreenEl,e),this.fullscreen=!1,this.emit(le,!1)):this.removeClass(e)}this._cssfullscreenEl=null,this.cssfullscreen=!1,this.emit(Ye,!1)}},{key:"getRotateFullscreen",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.config.fullscreenTarget;this.cssfullscreen&&this.exitCssFullscreen(e);var i=e?"".concat(b.INNER_FULLSCREEN," ").concat(b.ROTATE_FULLSCREEN):b.ROTATE_FULLSCREEN;this._fullscreenEl=e||this.root,this.changeFullStyle(this.root,e,i,b.PARENT_ROTATE_FULLSCREEN),this.isRotateFullscreen=!0,this.fullscreen=!0,this.setRotateDeg(90),this._rootStyle=this.root.getAttribute("style"),this.root.style.width="".concat(window.innerHeight,"px"),this.emit(le,!0)}},{key:"exitRotateFullscreen",value:function(e){var i=this._fullscreenEl!==this.root?"".concat(b.INNER_FULLSCREEN," ").concat(b.ROTATE_FULLSCREEN):b.ROTATE_FULLSCREEN;this.recoverFullStyle(this.root,this._fullscreenEl,i,b.PARENT_ROTATE_FULLSCREEN),this.isRotateFullscreen=!1,this.fullscreen=!1,this.setRotateDeg(0),this.emit(le,!1),this._rootStyle&&(this.root.style.style=this._rootStyle,this._rootStyle=!1)}},{key:"setRotateDeg",value:function(e){window.orientation===90||window.orientation===-90?this.rotateDeg=0:this.rotateDeg=e}},{key:"focus",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{autoHide:!this.config.closeDelayBlur,delay:this.config.inactive};if(this.isActive){this.onFocus(e);return}this.emit(kt,U({paused:this.paused,ended:this.ended},e))}},{key:"blur",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{ignorePaused:!1};if(!this.isActive){this.onBlur(e);return}this._clearUserTimer(),this.emit(si,U({paused:this.paused,ended:this.ended},e))}},{key:"onFocus",value:function(){var e=this,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{autoHide:!0,delay:3e3},n=this.innerStates;if(this.isActive=!0,this.removeClass(b.INACTIVE),this._clearUserTimer(),i.isLock!==void 0&&(n.isActiveLocked=i.isLock),i.autoHide===!1||i.isLock===!0||n.isActiveLocked){this._clearUserTimer();return}var o=i&&i.delay?i.delay:this.config.inactive;this.userTimer=d.setTimeout(this,function(){e.userTimer=null,e.blur()},o)}},{key:"onBlur",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=e.ignorePaused,n=i===void 0?!1:i;if(!this.innerStates.isActiveLocked){var o=this.config.closePauseVideoFocus;this.isActive=!1,(n||o||!this.paused&&!this.ended)&&this.addClass(b.INACTIVE)}}},{key:"onEmptied",value:function(){this.updateAcc("emptied")}},{key:"onCanplay",value:function(){this.removeClass(b.ENTER),this.removeClass(b.ERROR),this.removeClass(b.LOADING),this.isCanplay=!0,this.waitTimer&&d.clearTimeout(this,this.waitTimer)}},{key:"onLoadeddata",value:function(){this.isError=!1,this.isSeeking=!1,this.__startTime>0&&this.duration>0&&(this.currentTime=this.__startTime,this.__startTime=-1)}},{key:"onLoadstart",value:function(){this.removeClass(b.ERROR),this.isCanplay=!1}},{key:"onPlay",value:function(){this.state===M.ENDED&&this.setState(M.RUNNING),this.removeClass(b.PAUSED),this.ended&&this.removeClass(b.ENDED),!this.config.closePlayVideoFocus&&this.focus()}},{key:"onPause",value:function(){this.addClass(b.PAUSED),this.updateAcc("pause"),this.config.closePauseVideoFocus||(this._clearUserTimer(),this.focus())}},{key:"onEnded",value:function(){this.updateAcc("ended"),this.addClass(b.ENDED),this.setState(M.ENDED)}},{key:"onError",value:function(){this.isError=!0,this.updateAcc("error"),this.removeClass(b.NOT_ALLOW_AUTOPLAY),this.removeClass(b.NO_START),this.removeClass(b.ENTER),this.removeClass(b.LOADING),this.addClass(b.ERROR)}},{key:"onSeeking",value:function(){this.isSeeking||this.updateAcc("seeking"),this.isSeeking=!0,this.addClass(b.SEEKING)}},{key:"onSeeked",value:function(){this.isSeeking=!1,this.waitTimer&&d.clearTimeout(this,this.waitTimer),this.removeClass(b.LOADING),this.removeClass(b.SEEKING)}},{key:"onWaiting",value:function(){var e=this;this.waitTimer&&d.clearTimeout(this,this.waitTimer),this.updateAcc("waiting"),this.waitTimer=d.setTimeout(this,function(){e.addClass(b.LOADING),e.emit(ci),d.clearTimeout(e,e.waitTimer),e.waitTimer=null},this.config.minWaitDelay)}},{key:"onPlaying",value:function(){var e=this;this.isError=!1;var i=b.NO_START,n=b.PAUSED,o=b.ENDED,l=b.ERROR,u=b.REPLAY,f=b.LOADING,h=[i,n,o,l,u,f];h.forEach(function(g){e.removeClass(g)}),!this._accPlayed.t&&!this.paused&&!this.ended&&(this._accPlayed.t=new Date().getTime())}},{key:"onTimeupdate",value:function(){!this._videoHeight&&this.media.videoHeight&&this.resize(),(this.waitTimer||this.hasClass(b.LOADING))&&this.media.readyState>2&&(this.removeClass(b.LOADING),d.clearTimeout(this,this.waitTimer),this.waitTimer=null),!this.paused&&this.state===M.NOTALLOW&&this.duration&&(this.setState(M.RUNNING),this.emit(ke)),!this._accPlayed.t&&!this.paused&&!this.ended&&(this._accPlayed.t=new Date().getTime())}},{key:"onVolumechange",value:function(){d.typeOf(this.config.volume)==="Number"&&(this.config.volume=this.volume)}},{key:"onRatechange",value:function(){this.config.defaultPlaybackRate=this.playbackRate}},{key:"emitUserAction",value:function(e,i,n){if(!(!this.media||!i||!e)){var o=d.typeOf(e)==="String"?e:e.type||"";n.props&&d.typeOf(n.props)!=="Array"&&(n.props=[n.props]),this.emit(Je,U({eventType:o,action:i,currentTime:this.currentTime,duration:this.duration,ended:this.ended,event:e},n))}}},{key:"updateAcc",value:function(e){if(this._accPlayed.t){var i=new Date().getTime()-this._accPlayed.t;this._accPlayed.acc+=i,this._accPlayed.t=0,(e==="ended"||this.ended)&&(this._accPlayed.loopAcc=this._accPlayed.acc)}}},{key:"checkBuffer",value:function(e){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{startDiff:0,endDiff:0},n=i||{},o=n.startDiff,l=o===void 0?0:o,u=n.endDiff,f=u===void 0?0:u,h=this.media.buffered;if(!h||h.length===0||!this.duration)return!0;for(var g=e||this.media.currentTime||.2,v=h.length,p=0;p<v;p++)if(h.start(p)+l<=g&&h.end(p)-f>g)return!0;return!1}},{key:"resizePosition",value:function(){var e=this.videoPos,i=e.vy,n=e.vx,o=e.h,l=e.w,u=this.videoPos.rotate;if(!(u<0&&o<0&&l<0)){var f=this.videoPos._pi;if(!f&&this.media.videoHeight&&(f=this.media.videoWidth/this.media.videoHeight*100),!!f){this.videoPos.pi=f,u=u<0?0:u;var h={rotate:u},g=0,v=0,p=1,m=Math.abs(u/90),_=this.root,C=this.innerContainer,w=_.offsetWidth,E=C?C.offsetHeight:_.offsetHeight,N=E,R=w;if(m%2===0)p=o>0?100/o:l>0?100/l:1,h.scale=p,g=i>0?(100-o)/2-i:0,h.y=m===2?0-g:g,v=n>0?(100-l)/2-n:0,h.x=m===2?0-v:v,this.media.style.width="".concat(R,"px"),this.media.style.height="".concat(N,"px");else if(m%2===1){R=E,N=w;var H=E-w;v=-H/2/R*100,h.x=m===3?v+i/2:v-i/2,g=H/2/N*100,h.y=m===3?g+n/2:g-n/2,h.scale=p,this.media.style.width="".concat(R,"px"),this.media.style.height="".concat(N,"px")}var D=d.getTransformStyle(h,this.media.style.transform||this.media.style.webkitTransform);this.media.style.transform=D,this.media.style.webkitTransform=D}}}},{key:"position",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{h:0,y:0,x:0,w:0};if(!(!this.media||!e||!e.h)){var i=this.videoPos;i.h=e.h*100||0,i.w=e.w*100||0,i.vx=e.x*100||0,i.vy=e.y*100||0,this.resizePosition()}}},{key:"setConfig",value:function(e){var i=this;e&&Object.keys(e).map(function(n){if(n!=="plugins"){i.config[n]=e[n];var o=i.plugins[n.toLowerCase()];o&&d.typeOf(o.setConfig)==="Function"&&o.setConfig(e[n])}})}},{key:"playNext",value:function(e){var i=this;this.resetState(),this.setConfig(e),this._currentTime=0,this._duration=0,ue(this,"playnext",function(){i.start(),i.emit(qe,e)})}},{key:"resize",value:function(){var e=this;if(this.media){var i=this.root.getBoundingClientRect();this.sizeInfo.width=i.width,this.sizeInfo.height=i.height,this.sizeInfo.left=i.left,this.sizeInfo.top=i.top;var n=this.media,o=n.videoWidth,l=n.videoHeight,u=this.config,f=u.fitVideoSize,h=u.videoFillMode;if((h==="fill"||h==="cover"||h==="contain")&&this.setAttribute("data-xgfill",h),!(!l||!o)){this._videoHeight=l,this._videoWidth=o;var g=this.controls&&this.innerContainer?this.controls.root.getBoundingClientRect().height:0,v=i.width,p=i.height-g,m=parseInt(o/l*1e3,10),_=parseInt(v/p*1e3,10),C=v,w=p,E={};f==="auto"&&_>m||f==="fixWidth"?(w=v/m*1e3,this.config.fluid?E.paddingTop="".concat(w*100/C,"%"):E.height="".concat(w+g,"px")):(f==="auto"&&_<m||f==="fixHeight")&&(C=m*p/1e3,E.width="".concat(C,"px")),!this.fullscreen&&!this.cssfullscreen&&Object.keys(E).forEach(function(R){e.root.style[R]=E[R]}),(h==="fillHeight"&&_<m||h==="fillWidth"&&_>m)&&this.setAttribute("data-xgfill","cover");var N={videoScale:m,vWidth:C,vHeight:w,cWidth:C,cHeight:w+g};this.resizePosition(),this.emit(he,N)}}}},{key:"updateObjectPosition",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;if(this.media.updateObjectPosition){this.media.updateObjectPosition(e,i);return}this.media.style.objectPosition="".concat(e*100,"% ").concat(i*100,"%")}},{key:"setState",value:function(e){F.logInfo("setState","state from:".concat(Di[this.state]," to:").concat(Di[e])),this._state=e}},{key:"_preProcessUrl",value:function(e,i){var n=this.config,o=n.preProcessUrl,l=n.preProcessUrlOptions,u=Object.assign({},l,i);return!d.isBlob(e)&&typeof o=="function"?o(e,u):{url:e}}},{key:"state",get:function(){return this._state}},{key:"isFullscreen",get:function(){return this.fullscreen}},{key:"isCssfullScreen",get:function(){return this.cssfullscreen}},{key:"hasStart",get:function(){return this._hasStart},set:function(e){typeof e=="boolean"&&(this._hasStart=e,e===!1&&this.setState(M.READY),this.emit("hasstart"))}},{key:"isPlaying",get:function(){return this._state===M.RUNNING||this._state===M.ENDED},set:function(e){e?this.setState(M.RUNNING):this._state>=M.RUNNING&&this.setState(M.ATTACHED)}},{key:"definitionList",get:function(){return!this.config||!this.config.definition?[]:this.config.definition.list||[]},set:function(e){var i=this,n=this.config.definition,o=null,l=null;n.list=e,this.emit("resourceReady",e),e.forEach(function(u){var f;((f=i.curDefinition)===null||f===void 0?void 0:f.definition)===u.definition&&(o=u),n.defaultDefinition===u.definition&&(l=u)}),!l&&e.length>0&&(l=e[0]),o?this.changeDefinition(o):l&&this.changeDefinition(l)}},{key:"videoFrameInfo",get:function(){var e={total:0,dropped:0,corrupted:0,droppedRate:0,droppedDuration:0};if(!this.media||!this.media.getVideoPlaybackQuality)return e;var i=this.media.getVideoPlaybackQuality();return e.dropped=i.droppedVideoFrames||0,e.total=i.totalVideoFrames||0,e.corrupted=i.corruptedVideoFrames||0,e.total>0&&(e.droppedRate=e.dropped/e.total*100,e.droppedDuration=parseInt(this.cumulateTime/e.total*e.dropped,0)),e}},{key:"lang",get:function(){return this.config.lang},set:function(e){var i=Ae.langKeys.filter(function(n){return n===e});if(i.length===0&&e!=="zh"){console.error("Sorry, set lang fail, because the language [".concat(e,"] is not supported now, list of all supported languages is [").concat(Ae.langKeys.join(),"] "));return}this.config.lang=e,W.setLang(e,this)}},{key:"i18n",get:function(){var e=this.config.lang;return e==="zh"&&(e="zh-cn"),this.__i18n.lang[e]||this.__i18n.lang.en}},{key:"i18nKeys",get:function(){return this.__i18n.textKeys||{}}},{key:"version",get:function(){return mt}},{key:"playerId",get:function(){return this._pluginInfoId}},{key:"url",get:function(){return this.__url||this.config.url},set:function(e){this.__url=e}},{key:"poster",get:function(){return this.plugins.poster?this.plugins.poster.config.poster:this.config.poster},set:function(e){this.plugins.poster&&this.plugins.poster.update(e)}},{key:"readyState",get:function(){return L(A(r.prototype),"readyState",this)}},{key:"error",get:function(){var e=L(A(r.prototype),"error",this);return this.i18n[e]||e}},{key:"networkState",get:function(){return L(A(r.prototype),"networkState",this)}},{key:"fullscreenChanging",get:function(){return this._fullScreenOffset!==null}},{key:"cumulateTime",get:function(){var e=this._accPlayed,i=e.acc,n=e.t;return n?new Date().getTime()-n+i:i}},{key:"zoom",get:function(){return this.config.zoom},set:function(e){this.config.zoom=e}},{key:"videoRotateDeg",get:function(){return this.videoPos.rotate},set:function(e){e=d.convertDeg(e),!(e%90!==0||e===this.videoPos.rotate)&&(this.videoPos.rotate=e,this.resizePosition())}},{key:"avgSpeed",get:function(){return Ni},set:function(e){Ni=e}},{key:"realTimeSpeed",get:function(){return Ri},set:function(e){Ri=e}},{key:"offsetCurrentTime",get:function(){return this._offsetInfo.currentTime||0},set:function(e){this._offsetInfo.currentTime=e}},{key:"offsetDuration",get:function(){return this._offsetInfo.duration||0},set:function(e){this._offsetInfo.duration=e||0}},{key:"hook",value:function(e,i){return et.call.apply(et,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"useHooks",value:function(e,i){return tt.call.apply(tt,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"removeHooks",value:function(e,i){return it.call.apply(it,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"usePluginHooks",value:function(e,i,n){for(var o=arguments.length,l=new Array(o>3?o-3:0),u=3;u<o;u++)l[u-3]=arguments[u];return bi.call.apply(bi,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"removePluginHooks",value:function(e,i,n){for(var o=arguments.length,l=new Array(o>3?o-3:0),u=3;u<o;u++)l[u-3]=arguments[u];return wi.call.apply(wi,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"setUserActive",value:function(e,i){var n;typeof i=="boolean"&&i!==this.muted&&(this.addInnerOP("volumechange"),d.typeOf(i)===Boolean&&(this.muted=i)),(n=pe)===null||n===void 0||n.setActive(this.playerId,e)}}],[{key:"debugger",get:function(){return F.config.debug},set:function(e){F.config.debug=e}},{key:"instManager",get:function(){return pe},set:function(e){pe=e}},{key:"getCurrentUserActivePlayerId",value:function(){var e;return(e=pe)===null||e===void 0?void 0:e.getActiveId()}},{key:"setCurrentUserActive",value:function(e,i){var n;(n=pe)===null||n===void 0||n.setActive(e,i)}},{key:"isHevcSupported",value:function(){return O.isHevcSupported()}},{key:"probeConfigSupported",value:function(e){return O.probeConfigSupported(e)}},{key:"install",value:function(e,i){r.plugins||(r.plugins={}),r.plugins[e]||(r.plugins[e]=i)}},{key:"use",value:function(e,i){r.plugins||(r.plugins={}),r.plugins[e]=i}}]),r}(Br);k(nt,"defaultPreset",null),k(nt,"XgVideoProxy",null),nt.instManager=Oi.getInstance();function K(){return new Date().getTime()}var ge={LOAD_START:"loadstart",LOADED_DATA:"loadeddata",FIRST_FRAME:"firstFrame",WAIT_START:"waitingStart",WAIT_END:"waitingEnd",SEEK_START:"seekStart",SEEK_END:"seekEnd"},lo=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(y(t),"_onTimeupdate",function(){t._state.isTimeUpdate=!0,t._state.autoplayStart&&(F.logInfo("[xgLogger]".concat(t.player.playerId," _onTimeupdate")),t._sendFF("onTimeupdate"))}),k(y(t),"_onAutoplayStart",function(){F.logInfo("[xgLogger]".concat(t.player.playerId," _onAutoplayStart")),t._state.autoplayStart=!0,t.vt&&t._sendFF("onAutoplayStart")}),k(y(t),"_onReset",function(){t._state={autoplayStart:!1,isFFLoading:!1,isTimeUpdate:!1,isFFSend:!1,isLs:!1},t.vt=0,t.pt=0,t.fvt=0,t.newPointTime=K(),t.loadedCostTime=0,t.startCostTime=0,t._isSeeking=!1,t.seekingStart=0,t.waitingStart=0,t.fixedWaitingStart=0,t._isWaiting=!1,t._waitTimer&&d.clearTimeout(y(t),t._waitTimer),t._waittTimer&&d.clearTimeout(y(t),t._waittTimer),t._waitTimer=null,t._waittTimer=null,t._waitType=0}),k(y(t),"_onSeeking",function(){t.seekingStart||(t.suspendWaitingStatus("seek"),t.seekingStart=K(),t.emitLog(ge.SEEK_START,{start:K()}))}),k(y(t),"_onSeeked",function(){t.suspendSeekingStatus("seeked")}),k(y(t),"_onWaitingLoadStart",function(){t._isWaiting||t.vt||(t._isWaiting=!0,t.waitingStart=K(),t.fixedWaitingStart=K(),t._waitType=1,t.emitLog(ge.WAIT_START,{fixedStart:t.fixedWaitingStart,start:t.waitingStart,type:1,endType:"loadstart"}))}),k(y(t),"_onWaiting",function(){t._isWaiting||!t.vt||(t._isWaiting=!0,t.vt?t.seekingStart?t._waitType=2:t._waitType=0:t._waitType=1,t.fixedWaitingStart=K(),t._waitTimer=d.setTimeout(y(t),function(){t._isWaiting&&(t.waitingStart=K(),d.clearTimeout(y(t),t._waitTimer),t._waitTimer=null,t._startWaitTimeout(),t.emitLog(ge.WAIT_START,{fixedStart:t.fixedWaitingStart,start:t.waitingStart,type:t._waitType,endType:t._waitType===2?"seek":"playing"}))},200))}),k(y(t),"_onError",function(){t.suspendSeekingStatus("error"),t.suspendWaitingStatus("error")}),k(y(t),"_onPlaying",function(){t._isWaiting&&t.suspendWaitingStatus("playing")}),t}return S(r,[{key:"afterCreate",value:function(){var e=this;this._onReset(),this._waitType="firstFrame",this._initOnceEvents(),this.newPointTime=K(),this.loadedCostTime=0,this.startCostTime=0,this.on(_t,function(){var i=e._state,n=i.autoplayStart,o=i.isFFSend;e.startCostTime=K()-e.newPointTime,F.logInfo("[xgLogger]".concat(e.player.playerId," LOAD_START"),"autoplayStart:".concat(n," isFFSend:").concat(o," startCostTime:").concat(e.startCostTime," newPointTime").concat(e.newPointTime)),!o&&(!i.isLs&&e.emitLog(ge.LOAD_START,{}),i.isLs=!0,i.isTimeUpdate=!1,i.isFFLoading=!0,e.pt=K(),e.vt=0,e.fvt=0,e._initOnceEvents(),e._onWaitingLoadStart())}),this.on(ae,function(){e.vt=K(),e.fvt=e.vt-e.pt,e.loadedCostTime=e.vt-e.newPointTime;var i=e._state,n=i.isTimeUpdate,o=i.isFFSend,l=i.autoplayStart;F.logInfo("[xgLogger]".concat(e.player.playerId," LOADED_DATA"),"fvt:".concat(e.fvt," isTimeUpdate:").concat(e._state.isTimeUpdate," loadedCostTime:").concat(e.loadedCostTime)),(n||l)&&e._sendFF("loadedData"),o||e.emitLog(ge.LOADED_DATA,{}),e.suspendWaitingStatus("loadeddata")}),this.on($e,this._onSeeking),this.on(oe,this._onSeeked),this.on(bt,function(){e.endState("destroy")}),this.on(Ke,function(){e.endState("urlChange"),F.logInfo("[xgLogger]".concat(e.player.playerId," URL_CHANGE")),e._state.isFFSend&&e._onReset()}),this.on([yt,se],this._onPlaying),this.on(He,this._onWaiting),this.on(Be,this._onError),this.on(Ze,function(){F.logInfo("[xgLogger]".concat(e.player.playerId," RESET")),e.endState("reset"),e._initOnceEvents(),e._onReset()})}},{key:"_initOnceEvents",value:function(){this.off(ke,this._onAutoplayStart),this.off(q,this._onTimeupdate),this.once(ke,this._onAutoplayStart),this.once(q,this._onTimeupdate)}},{key:"_sendFF",value:function(e){this.s=K();var i=this._state,n=i.isFFLoading,o=i.isFFSend;F.logInfo("[xgLogger]".concat(this.player.playerId," _sendFF"),"".concat(e," fvt:").concat(this.fvt," isFFLoading:").concat(n," !isFFSend:").concat(!o)),this.vt>0&&n&&!o&&(F.logInfo("[xgLogger]".concat(this.player.playerId," emitLog_firstFrame"),e),this._state.isFFLoading=!1,this._state.isFFSend=!0,this.emitLog(ge.FIRST_FRAME,{fvt:this.fvt,costTime:this.fvt,vt:this.vt,startCostTime:this.startCostTime,loadedCostTime:this.loadedCostTime}))}},{key:"_startWaitTimeout",value:function(){var e=this;this._waittTimer&&d.clearTimeout(this,this._waittTimer),this._waittTimer=d.setTimeout(this,function(){e.suspendWaitingStatus("timeout"),d.clearTimeout(e,e._waittTimer),e._waittTimer=null},this.config.waitTimeout)}},{key:"endState",value:function(e){this.suspendWaitingStatus(e),this.suspendSeekingStatus(e)}},{key:"suspendSeekingStatus",value:function(e){if(this.seekingStart){var i=K(),n=i-this.seekingStart;this.seekingStart=0,this.emitLog(ge.SEEK_END,{end:i,costTime:n,endType:e})}}},{key:"suspendWaitingStatus",value:function(e){if(this._waitTimer&&(d.clearTimeout(this,this._waitTimer),this._waitTimer=null),this._waittTimer&&(d.clearTimeout(this,this._waittTimer),this._waittTimer=null),this._isWaiting=!1,!!this.waitingStart){var i=K(),n=i-this.waitingStart,o=i-this.fixedWaitingStart,l=this.config.waitTimeout;this._isWaiting=!1,this.waitingStart=0,this.fixedWaitingStart=0,this.emitLog(ge.WAIT_END,{fixedCostTime:o>l?l:o,costTime:n>l?l:n,type:e==="loadeddata"?1:this._waitType,endType:this._waitType===2?"seek":e})}}},{key:"emitLog",value:function(e,i){var n=this.player;this.emit(pi,U({t:K(),host:d.getHostFromUrl(n.currentSrc),vtype:n.vtype,eventType:e,currentTime:this.player.currentTime,readyState:n.video.readyState,networkState:n.video.networkState},i))}}],[{key:"pluginName",get:function(){return"xgLogger"}},{key:"defaultConfig",get:function(){return{waitTimeout:1e4}}}]),r}(B);function uo(){return new DOMParser().parseFromString(`<svg class="xgplayer-replay-svg" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 78 78" width="78" height="78">
10
+ </xg-controls>`)}}}],[{key:"pluginName",get:function(){return"controls"}},{key:"defaultConfig",get:function(){return{disable:!1,autoHide:!0,mode:"",initShow:!1}}}]),r}(B),no={LANG:"en",TEXT:{ERROR_TYPES:{network:{code:1,msg:"video download error"},mse:{code:2,msg:"stream append error"},parse:{code:3,msg:"parsing error"},format:{code:4,msg:"wrong format"},decoder:{code:5,msg:"decoding error"},runtime:{code:6,msg:"grammatical errors"},timeout:{code:7,msg:"play timeout"},other:{code:8,msg:"other errors"}},HAVE_NOTHING:"There is no information on whether audio/video is ready",HAVE_METADATA:"Audio/video metadata is ready ",HAVE_CURRENT_DATA:"Data about the current play location is available, but there is not enough data to play the next frame/millisecond",HAVE_FUTURE_DATA:"Current and at least one frame of data is available",HAVE_ENOUGH_DATA:"The available data is sufficient to start playing",NETWORK_EMPTY:"Audio/video has not been initialized",NETWORK_IDLE:"Audio/video is active and has been selected for resources, but no network is used",NETWORK_LOADING:"The browser is downloading the data",NETWORK_NO_SOURCE:"No audio/video source was found",MEDIA_ERR_ABORTED:"The fetch process is aborted by the user",MEDIA_ERR_NETWORK:"An error occurred while downloading",MEDIA_ERR_DECODE:"An error occurred while decoding",MEDIA_ERR_SRC_NOT_SUPPORTED:"Audio/video is not supported",REPLAY:"Replay",ERROR:"Network is offline",PLAY_TIPS:"Play",PAUSE_TIPS:"Pause",PLAYNEXT_TIPS:"Play next",DOWNLOAD_TIPS:"Download",ROTATE_TIPS:"Rotate",RELOAD_TIPS:"Reload",FULLSCREEN_TIPS:"Fullscreen",EXITFULLSCREEN_TIPS:"Exit fullscreen",CSSFULLSCREEN_TIPS:"Cssfullscreen",EXITCSSFULLSCREEN_TIPS:"Exit cssfullscreen",TEXTTRACK:"Caption",PIP:"PIP",SCREENSHOT:"Screenshot",LIVE:"LIVE",OFF:"Off",OPEN:"Open",MINI_DRAG:"Click and hold to drag",MINISCREEN:"Miniscreen",REFRESH_TIPS:"Please Try",REFRESH:"Refresh",FORWARD:"forward",LIVE_TIP:"Live"}},J={lang:{},langKeys:[],textKeys:[]};function Ue(a,s){return Object.keys(s).forEach(function(r){var t=d.typeOf(s[r]),e=d.typeOf(a[r]);if(t==="Array"){var i;e!=="Array"&&(a[r]=[]),(i=a[r]).push.apply(i,Q(s[r]))}else t==="Object"?(e!=="Object"&&(a[r]={}),Ue(a[r],s[r])):a[r]=s[r]}),a}function Li(){Object.keys(J.lang.en).map(function(a){J.textKeys[a]=a})}function ro(a,s){var r=[];if(s||(s=J),!!s.lang){d.typeOf(a)!=="Array"?r=Object.keys(a).map(function(i){var n=i==="zh"?"zh-cn":i;return{LANG:n,TEXT:a[i]}}):r=a;var t=s,e=t.lang;r.map(function(i){i.LANG==="zh"&&(i.LANG="zh-cn"),e[i.LANG]?Ue(e[i.LANG]||{},i.TEXT||{}):Dt(i,s)}),Li()}}function Dt(a,s){var r=a.LANG;if(s||(s=J),!!s.lang){var t=a.TEXT||{};r==="zh"&&(r="zh-cn"),s.lang[r]?Ue(s.lang[r],t):(s.langKeys.push(r),s.lang[r]=t),Li()}}function oo(a){var s,r={lang:{},langKeys:[],textKeys:{},pId:a};return Ue(r.lang,J.lang),(s=r.langKeys).push.apply(s,Q(J.langKeys)),Ue(r.textKeys,J.textKeys),r}Dt(no);var Ae={get textKeys(){return J.textKeys},get langKeys(){return J.langKeys},get lang(){var a={};return J.langKeys.map(function(s){a[s]=J.lang[s]}),J.lang["zh-cn"]&&(a.zh=J.lang["zh-cn"]||{}),a},extend:ro,use:Dt,init:oo},M={INITIAL:1,READY:2,ATTACHING:3,ATTACHED:4,NOTALLOW:5,RUNNING:6,ENDED:7,DESTROYED:8},Di=["ERROR","INITIAL","READY","ATTACHING","ATTACHED","NOTALLOW","RUNNING","ENDED","DESTROYED"],Y={},Ot=null,Oi=function(a){I(r,a);var s=P(r);function r(){return T(this,r),s.apply(this,arguments)}return S(r,[{key:"add",value:function(e){e&&(Y[e.playerId]=e,Object.keys(Y).length===1&&this.setActive(e.playerId,!0))}},{key:"remove",value:function(e){e&&(e.isUserActive,delete Y[e.playerId])}},{key:"_iterate",value:function(e){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;for(var n in Y)if(Object.prototype.hasOwnProperty.call(Y,n)){var o=Y[n];if(i){if(e(o))break}else e(o)}}},{key:"forEach",value:function(e){this._iterate(e)}},{key:"find",value:function(e){var i=null;return this._iterate(function(n){var o=e(n);return o&&(i=n),o},!0),i}},{key:"findAll",value:function(e){var i=[];return this._iterate(function(n){e(n)&&i.push(n)}),i}},{key:"setActive",value:function(e){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(Y[e])return i?this.forEach(function(n){e===n.playerId?(n.isUserActive=!0,n.isInstNext=!1):n.isUserActive=!1}):Y[e].isUserActive=i,e}},{key:"getActiveId",value:function(){for(var e=Object.keys(Y),i=0;i<e.length;i++){var n=Y[e[i]];if(n&&n.isUserActive)return e[i]}return null}},{key:"setNext",value:function(e){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(Y[e])return i?this.forEach(function(n){e===n.playerId?(n.isUserActive=!1,n.isInstNext=!0):n.isInstNext=!1}):Y[e].isInstNext=i,e}}],[{key:"getInstance",value:function(){return Ot||(Ot=new r),Ot}}]),r}(Jt.EventEmitter);function so(a){for(var s=Object.keys(Y),r=0;r<s.length;r++){var t=Y[s[r]];if(t.root===a)return t}return null}var ao=["play","pause","replay","retry"],Ri=0,Ni=0,ge=null,nt=function(a){I(r,a);var s=P(r);function r(t){var e;T(this,r);var i=d.deepMerge(Ai(),t);e=s.call(this,i),k(y(e),"canPlayFunc",function(){if(e.config){var g=e.config,m=g.autoplay,_=g.defaultPlaybackRate;F.logInfo("player","canPlayFunc, startTime",e.__startTime),e.__startTime>0&&e.duration>0&&(e.currentTime=e.__startTime>e.duration?e.duration:e.__startTime,e.__startTime=-1),e.playbackRate=_,(m||e._useAutoplay)&&e.mediaPlay(),e.off(se,e.canPlayFunc),e.removeClass(w.ENTER)}}),k(y(e),"onFullscreenChange",function(g,m){var _=function(){d.setTimeout(y(e),function(){e.resize()},100)},C=d.getFullScreenEl();e._fullActionFrom?e._fullActionFrom="":e.emit(Je,{eventType:"system",action:"switch_fullscreen",pluginName:"player",currentTime:e.currentTime,duration:e.duration,props:[{prop:"fullscreen",from:!0,to:!1}]});var b=br(C,e.playerId,Ce);if(m||C&&(C===e._fullscreenEl||b))_(),!e.config.closeFocusVideoFocus&&e.media.focus(),e.fullscreen=!0,e.changeFullStyle(e.root,C,w.FULLSCREEN),e.emit(le,!0,e._fullScreenOffset),e.cssfullscreen&&e.exitCssFullscreen();else if(e.fullscreen){_();var E=y(e),N=E._fullScreenOffset,R=E.config;if(R.needFullscreenScroll?(window.scrollTo(N.left,N.top),d.setTimeout(y(e),function(){e.fullscreen=!1,e._fullScreenOffset=null},100)):(!e.config.closeFocusVideoFocus&&e.media.focus(),e.fullscreen=!1,e._fullScreenOffset=null),e.cssfullscreen)e.removeClass(w.FULLSCREEN);else{var H=e._fullscreenEl;!H&&(e.root.contains(g.target)||g.target===e.root)&&(H=g.target),e.recoverFullStyle(e.root,H,w.FULLSCREEN)}e._fullscreenEl=null,e.emit(le,!1)}}),k(y(e),"_onWebkitbeginfullscreen",function(g){e._fullscreenEl=e.media,e.onFullscreenChange(g,!0)}),k(y(e),"_onWebkitendfullscreen",function(g){e.onFullscreenChange(g,!1)}),Ti(y(e),ao),e.config=i,e._pluginInfoId=d.generateSessionId(),yr(y(e));var n=e.constructor.defaultPreset;if(e.config.presets.length){var o=e.config.presets.indexOf("default");o>=0&&n&&(e.config.presets[o]=n)}else n&&e.config.presets.push(n);e.userTimer=null,e.waitTimer=null,e.handleSource=!0,e._state=M.INITIAL,e.isError=!1,e._hasStart=!1,e.isSeeking=!1,e.isCanplay=!1,e._useAutoplay=!1,e.__startTime=-1,e.rotateDeg=0,e.isActive=!1,e.fullscreen=!1,e.cssfullscreen=!1,e.isRotateFullscreen=!1,e._fullscreenEl=null,e.timeSegments=[],e._cssfullscreenEl=null,e.curDefinition=null,e._orgCss="",e._fullScreenOffset=null,e._videoHeight=0,e._videoWidth=0,e.videoPos={pi:1,scale:0,rotate:-1,x:0,y:0,h:-1,w:-1,vy:0,vx:0},e.sizeInfo={width:0,height:0,left:0,top:0},e._accPlayed={t:0,acc:0,loopAcc:0},e._offsetInfo={currentTime:-1,duration:0},e.innerContainer=null,e.controls=null,e.topBar=null,e.root=null,e.__i18n=Ae.init(e._pluginInfoId),O.os.isAndroid&&O.osVersion>0&&O.osVersion<6&&(e.config.autoplay=!1),e.database=new Hr,e.isUserActive=!1,e._onceSeekCanplay=null,e._isPauseBeforeSeek=0,e.innerStates={isActiveLocked:!1},e.instManager=ge;var l=e._initDOM();if(!l)return console.error(new Error("can't find the dom which id is ".concat(e.config.id," or this.config.el does not exist"))),dt(e);var u=e.config,f=u.definition,h=f===void 0?{}:f,p=u.url;if(!p&&h.list&&h.list.length>0){var v=h.list.find(function(g){return g.definition&&g.definition===h.defaultDefinition});v||(h.defaultDefinition=h.list[0].definition,v=h.list[0]),e.config.url=v.url,e.curDefinition=v}return e._bindEvents(),e._registerPresets(),e._registerPlugins(),W.onPluginsReady(y(e)),e.getInitDefinition(),e.setState(M.READY),d.setTimeout(y(e),function(){e.emit(Ct)},0),e.onReady&&e.onReady(),(e.config.videoInit||e.config.autoplay)&&(!e.hasStart||e.state<M.ATTACHED)&&e.start(),e}return S(r,[{key:"_initDOM",value:function(){var e,i=this;if(this.root=this.config.id?document.getElementById(this.config.id):null,!this.root){var n=this.config.el;if(n&&n.nodeType===1)this.root=n;else return this.emit(Be,new je("use",this.config.vid,{line:32,handle:"Constructor",msg:"container id can't be empty"})),console.error("this.confg.id or this.config.el can't be empty"),!1}var o=so(this.root);o&&(F.logWarn("The is an Player instance already exists in this.root, destroy it and reinitialize"),o.destroy()),this.root.setAttribute(Ce,this.playerId),(e=ge)===null||e===void 0||e.add(this),W.init(this),this._initBaseDoms();var l=this.constructor.XgVideoProxy;if(l&&this.mediaConfig.mediaType===l.mediaType){var u=this.innerContainer||this.root;this.detachVideoEvents(this.media);var f=new l(u,this.config,this.mediaConfig);this.attachVideoEvents(f),this.media=f}if(this.media.setAttribute(Ce,this.playerId),this.config.controls){var h=this.config.controls.root||null,p=W.register(this,io,{root:h});this.controls=p}var v=this.config.isMobileSimulateMode==="mobile"?"mobile":O.device;if(this.addClass("".concat(w.DEFAULT," ").concat(w.INACTIVE," xgplayer-").concat(v," ").concat(this.config.controls?"":w.NO_CONTROLS)),this.config.autoplay?this.addClass(w.ENTER):this.addClass(w.NO_START),this.config.fluid){var g=this.config,m=g.width,_=g.height;(typeof m!="number"||typeof _!="number")&&(m=600,_=337.5);var C={width:"100%",height:"0","max-width":"100%","padding-top":"".concat(_*100/m,"%")};Object.keys(C).forEach(function(D){i.root.style[D]=C[D]})}else["width","height"].forEach(function(D){i.config[D]&&(typeof i.config[D]!="number"?i.root.style[D]=i.config[D]:i.root.style[D]="".concat(i.config[D],"px"))});var b=this.root.getBoundingClientRect(),E=b.width,N=b.height,R=b.left,H=b.top;return this.sizeInfo.width=E,this.sizeInfo.height=N,this.sizeInfo.left=R,this.sizeInfo.top=H,!0}},{key:"_initBaseDoms",value:function(){this.topBar=null,this.leftBar=null,this.rightBar=null,this.config.marginControls&&(this.innerContainer=d.createDom("xg-video-container","",{"data-index":-1},"xg-video-container"),this.root.appendChild(this.innerContainer))}},{key:"_bindEvents",value:function(){var e=this;["focus","blur"].forEach(function(i){e.on(i,e["on"+i.charAt(0).toUpperCase()+i.slice(1)])}),ki.forEach(function(i){document&&document.addEventListener(i,e.onFullscreenChange)}),O.os.isIos&&(this.media.addEventListener("webkitbeginfullscreen",this._onWebkitbeginfullscreen),this.media.addEventListener("webkitendfullscreen",this._onWebkitendfullscreen)),this.once(ae,this.resize),this.playFunc=function(){e.config.closeFocusVideoFocus||e.media.focus()},this.once(X,this.playFunc)}},{key:"_unbindEvents",value:function(){var e=this;this.root.removeEventListener("mousemove",this.mousemoveFunc),ki.forEach(function(i){document.removeEventListener(i,e.onFullscreenChange)}),this.playFunc&&this.off(X,this.playFunc),this.off(se,this.canPlayFunc),this.media.removeEventListener("webkitbeginfullscreen",this._onWebkitbeginfullscreen),this.media.removeEventListener("webkitendfullscreen",this._onWebkitendfullscreen)}},{key:"_clearUserTimer",value:function(){this.userTimer&&(d.clearTimeout(this,this.userTimer),this.userTimer=null)}},{key:"_startInit",value:function(e){var i=this;if(this.media&&!((!e||e===""||d.typeOf(e)==="Array"&&e.length===0)&&(e="",this.emit(ai),F.logWarn("config.url is null, please get url and run player._startInit(url)"),this.config.nullUrlStart))){this.handleSource&&(this._detachSourceEvents(this.media),d.typeOf(e)==="Array"&&e.length>0?this._attachSourceEvents(this.media,e):!this.media.src||this.media.src!==e?this.media.src=e:e||this.media.removeAttribute("src")),d.typeOf(this.config.volume)==="Number"&&(this.volume=this.config.volume);var n=this.innerContainer?this.innerContainer:this.root;this.media instanceof window.Element&&!n.contains(this.media)&&n.insertBefore(this.media,n.firstChild);var o=this.media.readyState;F.logInfo("_startInit readyState",o),this.config.autoplay&&(!d.isMSE(this.media)&&this.load(),(O.os.isIpad||O.os.isPhone)&&this.mediaPlay());var l=this.config.startTime;this.__startTime=l>0?l:-1,this.config.startTime=0,o>=2&&this.duration>0?this.canPlayFunc():this.on(se,this.canPlayFunc),(!this.hasStart||this.state<M.ATTACHED)&&W.afterInit(this),this.hasStart=!0,this.setState(M.ATTACHED),d.setTimeout(this,function(){i.emit(We)},0)}}},{key:"_registerPlugins",value:function(){var e=this,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this._loadingPlugins=[];var n=this.config.ignores||[],o=this.config.plugins||[],l=this.config.i18n||[];i&&Ae.extend(l,this.__i18n);var u=n.join("||").toLowerCase().split("||"),f=this.plugins;o.forEach(function(h){try{var p=h.plugin?h.plugin.pluginName:h.pluginName;if(p&&u.indexOf(p.toLowerCase())>-1)return null;if(!i&&f[p.toLowerCase()])return;if(h.lazy&&h.loader){var v=W.lazyRegister(e,h);h.forceBeforeInit&&(v.then(function(){e._loadingPlugins.splice(e._loadingPlugins.indexOf(v),1)}).catch(function(g){F.logError("_registerPlugins:loadingPlugin",g),e._loadingPlugins.splice(e._loadingPlugins.indexOf(v),1)}),e._loadingPlugins.push(v));return}return e.registerPlugin(h)}catch(g){F.logError("_registerPlugins:",g)}})}},{key:"_registerPresets",value:function(){var e=this;this.config.presets.forEach(function(i){to(e,i)})}},{key:"_getRootByPosition",value:function(e){var i=null;switch(e){case V.ROOT_RIGHT:this.rightBar||(this.rightBar=d.createPositionBar("xg-right-bar",this.root)),i=this.rightBar;break;case V.ROOT_LEFT:this.leftBar||(this.leftBar=d.createPositionBar("xg-left-bar",this.root)),i=this.leftBar;break;case V.ROOT_TOP:this.topBar||(this.topBar=d.createPositionBar("xg-top-bar",this.root),this.config.topBarAutoHide&&d.addClass(this.topBar,w.TOP_BAR_AUTOHIDE)),i=this.topBar;break;default:i=this.innerContainer||this.root;break}return i}},{key:"registerPlugin",value:function(e,i){var n=W.formatPluginInfo(e,i),o=n.PLUFGIN,l=n.options,u=this.config.plugins,f=W.checkPluginIfExits(o.pluginName,u);!f&&u.push(o);var h=W.getRootByConfig(o.pluginName,this.config);h.root&&(l.root=h.root),h.position&&(l.position=h.position);var p=l.position?l.position:l.config&&l.config.position||o.defaultConfig&&o.defaultConfig.position;return!l.root&&typeof p=="string"&&p.indexOf("controls")>-1?this.controls&&this.controls.registerPlugin(o,l,o.pluginName):(l.root||(l.root=this._getRootByPosition(p)),W.register(this,o,l))}},{key:"deregister",value:function(e){typeof e=="string"?W.unRegister(this,e):e instanceof de&&W.unRegister(this,e.pluginName)}},{key:"unRegisterPlugin",value:function(e){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;this.deregister(e),i&&this.removePluginFromConfig(e)}},{key:"removePluginFromConfig",value:function(e){var i;if(typeof e=="string"?i=e:e instanceof de&&(i=e.pluginName),!!i)for(var n=this.config.plugins.length-1;n>-1;n--){var o=this.config.plugins[n];if(o.pluginName.toLowerCase()===i.toLowerCase()){this.config.plugins.splice(n,1);break}}}},{key:"plugins",get:function(){return W.getPlugins(this)}},{key:"getPlugin",value:function(e){var i=W.findPlugin(this,e);return i&&i.pluginName?i:null}},{key:"addClass",value:function(e){this.root&&(d.hasClass(this.root,e)||d.addClass(this.root,e))}},{key:"removeClass",value:function(e){this.root&&d.removeClass(this.root,e)}},{key:"hasClass",value:function(e){if(this.root)return d.hasClass(this.root,e)}},{key:"setAttribute",value:function(e,i){this.root&&this.root.setAttribute(e,i)}},{key:"removeAttribute",value:function(e,i){this.root&&this.root.removeAttribute(e,i)}},{key:"start",value:function(e){var i=this;if(!(this.state>M.ATTACHING))return!e&&!this.config.url&&this.getInitDefinition(),this.hasStart=!0,this.setState(M.ATTACHING),this._registerPlugins(!1),W.beforeInit(this).then(function(){if(i.config){e||(e=i.url||i.config.url);var n=i._preProcessUrl(e),o=i._startInit(n.url);return o}}).catch(function(n){throw n.fileName="player",n.lineNumber="236",F.logError("start:beforeInit:",n),n})}},{key:"switchURL",value:function(e,i){var n=this,o=e;d.typeOf(e)==="Object"&&(o=e.url),o=this._preProcessUrl(o).url;var l=this.currentTime;this.__startTime=l;var u=this.paused&&!this.isError;return this.src=o,new Promise(function(f,h){var p=function(m){n.off("timeupdate",v),n.off("canplay",v),h(m)},v=function(){n.duration>0&&n.__startTime>0&&(n.currentTime=n.__startTime,n.__startTime=-1),u&&n.pause(),n.off("error",p),f(!0)};if(n.once("error",p),!o){n.errorHandler("error",{code:6,message:"empty_src"});return}O.os.isAndroid?n.once("timeupdate",v):n.once("canplay",v),n.play()})}},{key:"videoPlay",value:function(){this.mediaPlay()}},{key:"mediaPlay",value:function(){var e=this;if(!this.hasStart&&this.state<M.ATTACHED){this.removeClass(w.NO_START),this.addClass(w.ENTER),this.start(),this._useAutoplay=!0;return}this.state<M.RUNNING&&(this.removeClass(w.NO_START),!this.isCanplay&&this.addClass(w.ENTER));var i=L(A(r.prototype),"play",this).call(this);return i!==void 0&&i&&i.then?i.then(function(){e.removeClass(w.NOT_ALLOW_AUTOPLAY),e.addClass(w.PLAYING),e.state<M.RUNNING&&(F.logInfo(">>>>playPromise.then"),e.setState(M.RUNNING),e.emit(ke))}).catch(function(n){if(F.logWarn(">>>>playPromise.catch",n.name),e.media&&e.media.error){e.onError(),e.removeClass(w.ENTER);return}n.name==="NotAllowedError"&&(e._errorTimer=d.setTimeout(e,function(){e._errorTimer=null,e.emit(Et),e.addClass(w.NOT_ALLOW_AUTOPLAY),e.removeClass(w.ENTER),e.pause(),e.setState(M.NOTALLOW)},0))}):(F.logWarn("video.play not return promise"),this.state<M.RUNNING&&(this.setState(M.RUNNING),this.removeClass(w.NOT_ALLOW_AUTOPLAY),this.removeClass(w.NO_START),this.removeClass(w.ENTER),this.addClass(w.PLAYING),this.emit(ke))),i}},{key:"mediaPause",value:function(){L(A(r.prototype),"pause",this).call(this)}},{key:"videoPause",value:function(){L(A(r.prototype),"pause",this).call(this)}},{key:"play",value:function(){var e=this;return this.removeClass(w.PAUSED),ue(this,"play",function(){return e.mediaPlay()})}},{key:"pause",value:function(){var e=this;ue(this,"pause",function(){L(A(r.prototype),"pause",e).call(e)})}},{key:"seek",value:function(e,i){var n=this;if(!(!this.media||Number.isNaN(Number(e))||!this.hasStart)){var o=this.config,l=o.isSeekedPlay,u=o.seekedStatus,f=i||(l?"play":u);e=e<0?0:e>this.duration?parseInt(this.duration,10):e,!this._isPauseBeforeSeek&&(this._isPauseBeforeSeek=this.paused?2:1),this._onceSeekCanplay&&this.off(oe,this._onceSeekCanplay),this._onceSeekCanplay=function(){switch(n.removeClass(w.ENTER),n.isSeeking=!1,f){case"play":n.play();break;case"pause":n.pause();break;default:n._isPauseBeforeSeek>1||n.paused?n.pause():n.play()}n._isPauseBeforeSeek=0,n._onceSeekCanplay=null},this.once(oe,this._onceSeekCanplay),this.state<M.RUNNING?(this.removeClass(w.NO_START),this.currentTime=e,this.play()):this.currentTime=e}}},{key:"getInitDefinition",value:function(){var e=this,i=this.config,n=i.definition,o=i.url;!o&&n&&n.list&&n.list.length>0&&n.defaultDefinition&&n.list.map(function(l){l.definition===n.defaultDefinition&&(e.config.url=l.url,e.curDefinition=l)})}},{key:"changeDefinition",value:function(e,i){var n=this,o=this.config.definition;if(Array.isArray(o==null?void 0:o.list)&&o.list.forEach(function(u){(e==null?void 0:e.definition)===u.definition&&(n.curDefinition=u)}),e!=null&&e.bitrate&&typeof e.bitrate!="number"&&(e.bitrate=parseInt(e.bitrate,10)||0),this.emit(Tt,{from:i,to:e}),!this.hasStart){this.config.url=e.url;return}var l=this.switchURL(e.url,U({seamless:o.seamless!==!1&&typeof MediaSource<"u"&&typeof MediaSource.isTypeSupported=="function"},e));l&&l.then?l.then(function(){n.emit(St,{from:i,to:e})}):this.emit(St,{from:i,to:e})}},{key:"reload",value:function(){this.load(),this.reloadFunc=function(){this.play()},this.once(ae,this.reloadFunc)}},{key:"resetState",value:function(){var e=this,i=w.NOT_ALLOW_AUTOPLAY,n=w.PLAYING,o=w.NO_START,l=w.PAUSED,u=w.REPLAY,f=w.ENTER,h=w.ENDED,p=w.ERROR,v=w.LOADING,g=[i,n,o,l,u,f,h,p,v];this.hasStart=!1,this.isError=!1,this._useAutoplay=!1,this.mediaPause(),this._accPlayed.acc=0,this._accPlayed.t=0,this._accPlayed.loopAcc=0,g.forEach(function(m){e.removeClass(m)}),this.addClass(w.NO_START),this.emit(Ze)}},{key:"reset",value:function(){var e=this,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],n=arguments.length>1?arguments[1]:void 0;this.resetState();var o=this.plugins;if(o&&(i.map(function(u){e.deregister(u)}),n)){var l=Ai();Object.keys(this.config).keys(function(u){e.config[u]!=="undefined"&&(u==="plugins"||u==="presets"||u==="el"||u==="id")&&(e.config[u]=l[u])})}}},{key:"destroy",value:function(){var e,i=this,n=this.innerContainer,o=this.root,l=this.media;if(!(!o||!l)){if(this.hasStart=!1,this._useAutoplay=!1,o.removeAttribute(Ce),this.updateAcc("destroy"),this._unbindEvents(),this._detachSourceEvents(this.media),d.clearAllTimers(this),this.emit(wt),(e=ge)===null||e===void 0||e.remove(this),W.destroy(this),Si(this),L(A(r.prototype),"destroy",this).call(this),this.fullscreen&&this._fullscreenEl===this.root&&this.exitFullscreen(),n)for(var u=n.children,f=0;f<u.length;f++)n.removeChild(u[f]);!n&&l instanceof window.Node&&o.contains(l)&&o.removeChild(l),["topBar","leftBar","rightBar","innerContainer"].map(function(p){i[p]&&o.removeChild(i[p]),i[p]=null});var h=o.className.split(" ");h.length>0?o.className=h.filter(function(p){return p.indexOf("xgplayer")<0}).join(" "):o.className="",this.removeAttribute("data-xgfill"),["isSeeking","isCanplay","isActive","cssfullscreen","fullscreen"].forEach(function(p){i[p]=!1})}}},{key:"replay",value:function(){var e=this;this.removeClass(w.ENDED),this.currentTime=0,this.isSeeking=!1,ue(this,"replay",function(){e.once(oe,function(){var i=e.mediaPlay();i&&i.catch&&i.catch(function(n){console.log(n)})}),e.emit(Ge),e.onPlay()})}},{key:"retry",value:function(){var e=this;this.removeClass(w.ERROR),this.addClass(w.LOADING),ue(this,"retry",function(){var i=e.currentTime,n=e.config.url,o=d.isMSE(e.media)?{url:n}:e._preProcessUrl(n);e.src=o.url,!e.config.isLive&&(e.currentTime=i),e.once(se,function(){e.mediaPlay()})})}},{key:"changeFullStyle",value:function(e,i,n,o){e&&(o||(o=w.PARENT_FULLSCREEN),this._orgCss||(this._orgCss=d.filterStyleFromText(e)),d.addClass(e,n),i&&i!==e&&!this._orgPCss&&(this._orgPCss=d.filterStyleFromText(i),d.addClass(i,o),i.setAttribute(Ce,this.playerId)))}},{key:"recoverFullStyle",value:function(e,i,n,o){o||(o=w.PARENT_FULLSCREEN),this._orgCss&&(d.setStyleFromCsstext(e,this._orgCss),this._orgCss=""),d.removeClass(e,n),i&&i!==e&&this._orgPCss&&(d.setStyleFromCsstext(i,this._orgPCss),this._orgPCss="",d.removeClass(i,o),i.removeAttribute(Ce))}},{key:"getFullscreen",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.config.fullscreenTarget,i=this.root,n=this.media;(e==="video"||e==="media")&&(e=this[e]),e||(e=i),this._fullScreenOffset={top:d.scrollTop(),left:d.scrollLeft()},this._fullscreenEl=e,this._fullActionFrom="get";var o=d.getFullScreenEl();if(o===this._fullscreenEl)return this.onFullscreenChange(),Promise.resolve();try{for(var l=0;l<Ci.length;l++){var u=Ci[l];if(e[u]){var f=u==="webkitRequestFullscreen"?e.webkitRequestFullscreen(window.Element.ALLOW_KEYBOARD_INPUT):e[u]();return f&&f.then?f:Promise.resolve()}}return n.fullscreenEnabled||n.webkitSupportsFullscreen?(n.webkitEnterFullscreen(),Promise.resolve()):Promise.reject(new Error("call getFullscreen fail"))}catch{return Promise.reject(new Error("call getFullscreen fail"))}}},{key:"exitFullscreen",value:function(e){if(this.isRotateFullscreen&&this.exitRotateFullscreen(),!(!this._fullscreenEl&&!d.getFullScreenEl())){this.root;var i=this.media;this._fullActionFrom="exit";try{for(var n=0;n<Ei.length;n++){var o=Ei[n];if(document[o]){var l=document[o]();return l&&l.then?l:Promise.resolve()}}return i&&i.webkitSupportsFullscreen?(i.webkitExitFullScreen(),Promise.resolve()):Promise.reject(new Error("call exitFullscreen fail"))}catch{return Promise.reject(new Error("call exitFullscreen fail"))}}}},{key:"getCssFullscreen",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.config.fullscreenTarget;this.isRotateFullscreen?this.exitRotateFullscreen():this.fullscreen&&this.exitFullscreen();var i=e?"".concat(w.INNER_FULLSCREEN," ").concat(w.CSS_FULLSCREEN):w.CSS_FULLSCREEN;this.changeFullStyle(this.root,e,i);var n=this.config.fullscreen,o=n===void 0?{}:n,l=o.useCssFullscreen===!0||typeof o.useCssFullscreen=="function"&&o.useCssFullscreen();l&&(this.fullscreen=!0,this.emit(le,!0)),this._cssfullscreenEl=e,this.cssfullscreen=!0,this.emit(Ye,!0)}},{key:"exitCssFullscreen",value:function(){var e=this._cssfullscreenEl?"".concat(w.INNER_FULLSCREEN," ").concat(w.CSS_FULLSCREEN):w.CSS_FULLSCREEN;if(!this.fullscreen)this.recoverFullStyle(this.root,this._cssfullscreenEl,e);else{var i=this.config.fullscreen,n=i===void 0?{}:i,o=n.useCssFullscreen===!0||typeof n.useCssFullscreen=="function"&&n.useCssFullscreen();o?(this.recoverFullStyle(this.root,this._cssfullscreenEl,e),this.fullscreen=!1,this.emit(le,!1)):this.removeClass(e)}this._cssfullscreenEl=null,this.cssfullscreen=!1,this.emit(Ye,!1)}},{key:"getRotateFullscreen",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.config.fullscreenTarget;this.cssfullscreen&&this.exitCssFullscreen(e);var i=e?"".concat(w.INNER_FULLSCREEN," ").concat(w.ROTATE_FULLSCREEN):w.ROTATE_FULLSCREEN;this._fullscreenEl=e||this.root,this.changeFullStyle(this.root,e,i,w.PARENT_ROTATE_FULLSCREEN),this.isRotateFullscreen=!0,this.fullscreen=!0,this.setRotateDeg(90),this._rootStyle=this.root.getAttribute("style"),this.root.style.width="".concat(window.innerHeight,"px"),this.emit(le,!0)}},{key:"exitRotateFullscreen",value:function(e){var i=this._fullscreenEl!==this.root?"".concat(w.INNER_FULLSCREEN," ").concat(w.ROTATE_FULLSCREEN):w.ROTATE_FULLSCREEN;this.recoverFullStyle(this.root,this._fullscreenEl,i,w.PARENT_ROTATE_FULLSCREEN),this.isRotateFullscreen=!1,this.fullscreen=!1,this.setRotateDeg(0),this.emit(le,!1),this._rootStyle&&(this.root.style.style=this._rootStyle,this._rootStyle=!1)}},{key:"setRotateDeg",value:function(e){window.orientation===90||window.orientation===-90?this.rotateDeg=0:this.rotateDeg=e}},{key:"focus",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{autoHide:!this.config.closeDelayBlur,delay:this.config.inactive};if(this.isActive){this.onFocus(e);return}this.emit(kt,U({paused:this.paused,ended:this.ended},e))}},{key:"blur",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{ignorePaused:!1};if(!this.isActive){this.onBlur(e);return}this._clearUserTimer(),this.emit(si,U({paused:this.paused,ended:this.ended},e))}},{key:"onFocus",value:function(){var e=this,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{autoHide:!0,delay:3e3},n=this.innerStates;if(this.isActive=!0,this.removeClass(w.INACTIVE),this._clearUserTimer(),i.isLock!==void 0&&(n.isActiveLocked=i.isLock),i.autoHide===!1||i.isLock===!0||n.isActiveLocked){this._clearUserTimer();return}var o=i&&i.delay?i.delay:this.config.inactive;this.userTimer=d.setTimeout(this,function(){e.userTimer=null,e.blur()},o)}},{key:"onBlur",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=e.ignorePaused,n=i===void 0?!1:i;if(!this.innerStates.isActiveLocked){var o=this.config.closePauseVideoFocus;this.isActive=!1,(n||o||!this.paused&&!this.ended)&&this.addClass(w.INACTIVE)}}},{key:"onEmptied",value:function(){this.updateAcc("emptied")}},{key:"onCanplay",value:function(){this.removeClass(w.ENTER),this.removeClass(w.ERROR),this.removeClass(w.LOADING),this.isCanplay=!0,this.waitTimer&&d.clearTimeout(this,this.waitTimer)}},{key:"onLoadeddata",value:function(){this.isError=!1,this.isSeeking=!1,this.__startTime>0&&this.duration>0&&(this.currentTime=this.__startTime,this.__startTime=-1)}},{key:"onLoadstart",value:function(){this.removeClass(w.ERROR),this.isCanplay=!1}},{key:"onPlay",value:function(){this.state===M.ENDED&&this.setState(M.RUNNING),this.removeClass(w.PAUSED),this.ended&&this.removeClass(w.ENDED),!this.config.closePlayVideoFocus&&this.focus()}},{key:"onPause",value:function(){this.addClass(w.PAUSED),this.updateAcc("pause"),this.config.closePauseVideoFocus||(this._clearUserTimer(),this.focus())}},{key:"onEnded",value:function(){this.updateAcc("ended"),this.addClass(w.ENDED),this.setState(M.ENDED)}},{key:"onError",value:function(){this.isError=!0,this.updateAcc("error"),this.removeClass(w.NOT_ALLOW_AUTOPLAY),this.removeClass(w.NO_START),this.removeClass(w.ENTER),this.removeClass(w.LOADING),this.addClass(w.ERROR)}},{key:"onSeeking",value:function(){this.isSeeking||this.updateAcc("seeking"),this.isSeeking=!0,this.addClass(w.SEEKING)}},{key:"onSeeked",value:function(){this.isSeeking=!1,this.waitTimer&&d.clearTimeout(this,this.waitTimer),this.removeClass(w.LOADING),this.removeClass(w.SEEKING)}},{key:"onWaiting",value:function(){var e=this;this.waitTimer&&d.clearTimeout(this,this.waitTimer),this.updateAcc("waiting"),this.waitTimer=d.setTimeout(this,function(){e.addClass(w.LOADING),e.emit(ci),d.clearTimeout(e,e.waitTimer),e.waitTimer=null},this.config.minWaitDelay)}},{key:"onPlaying",value:function(){var e=this;this.isError=!1;var i=w.NO_START,n=w.PAUSED,o=w.ENDED,l=w.ERROR,u=w.REPLAY,f=w.LOADING,h=[i,n,o,l,u,f];h.forEach(function(p){e.removeClass(p)}),!this._accPlayed.t&&!this.paused&&!this.ended&&(this._accPlayed.t=new Date().getTime())}},{key:"onTimeupdate",value:function(){!this._videoHeight&&this.media.videoHeight&&this.resize(),(this.waitTimer||this.hasClass(w.LOADING))&&this.media.readyState>2&&(this.removeClass(w.LOADING),d.clearTimeout(this,this.waitTimer),this.waitTimer=null),!this.paused&&this.state===M.NOTALLOW&&this.duration&&(this.setState(M.RUNNING),this.emit(ke)),!this._accPlayed.t&&!this.paused&&!this.ended&&(this._accPlayed.t=new Date().getTime())}},{key:"onVolumechange",value:function(){d.typeOf(this.config.volume)==="Number"&&(this.config.volume=this.volume)}},{key:"onRatechange",value:function(){this.config.defaultPlaybackRate=this.playbackRate}},{key:"emitUserAction",value:function(e,i,n){if(!(!this.media||!i||!e)){var o=d.typeOf(e)==="String"?e:e.type||"";n.props&&d.typeOf(n.props)!=="Array"&&(n.props=[n.props]),this.emit(Je,U({eventType:o,action:i,currentTime:this.currentTime,duration:this.duration,ended:this.ended,event:e},n))}}},{key:"updateAcc",value:function(e){if(this._accPlayed.t){var i=new Date().getTime()-this._accPlayed.t;this._accPlayed.acc+=i,this._accPlayed.t=0,(e==="ended"||this.ended)&&(this._accPlayed.loopAcc=this._accPlayed.acc)}}},{key:"checkBuffer",value:function(e){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{startDiff:0,endDiff:0},n=i||{},o=n.startDiff,l=o===void 0?0:o,u=n.endDiff,f=u===void 0?0:u,h=this.media.buffered;if(!h||h.length===0||!this.duration)return!0;for(var p=e||this.media.currentTime||.2,v=h.length,g=0;g<v;g++)if(h.start(g)+l<=p&&h.end(g)-f>p)return!0;return!1}},{key:"resizePosition",value:function(){var e=this.videoPos,i=e.vy,n=e.vx,o=e.h,l=e.w,u=this.videoPos.rotate;if(!(u<0&&o<0&&l<0)){var f=this.videoPos._pi;if(!f&&this.media.videoHeight&&(f=this.media.videoWidth/this.media.videoHeight*100),!!f){this.videoPos.pi=f,u=u<0?0:u;var h={rotate:u},p=0,v=0,g=1,m=Math.abs(u/90),_=this.root,C=this.innerContainer,b=_.offsetWidth,E=C?C.offsetHeight:_.offsetHeight,N=E,R=b;if(m%2===0)g=o>0?100/o:l>0?100/l:1,h.scale=g,p=i>0?(100-o)/2-i:0,h.y=m===2?0-p:p,v=n>0?(100-l)/2-n:0,h.x=m===2?0-v:v,this.media.style.width="".concat(R,"px"),this.media.style.height="".concat(N,"px");else if(m%2===1){R=E,N=b;var H=E-b;v=-H/2/R*100,h.x=m===3?v+i/2:v-i/2,p=H/2/N*100,h.y=m===3?p+n/2:p-n/2,h.scale=g,this.media.style.width="".concat(R,"px"),this.media.style.height="".concat(N,"px")}var D=d.getTransformStyle(h,this.media.style.transform||this.media.style.webkitTransform);this.media.style.transform=D,this.media.style.webkitTransform=D}}}},{key:"position",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{h:0,y:0,x:0,w:0};if(!(!this.media||!e||!e.h)){var i=this.videoPos;i.h=e.h*100||0,i.w=e.w*100||0,i.vx=e.x*100||0,i.vy=e.y*100||0,this.resizePosition()}}},{key:"setConfig",value:function(e){var i=this;e&&Object.keys(e).map(function(n){if(n!=="plugins"){i.config[n]=e[n];var o=i.plugins[n.toLowerCase()];o&&d.typeOf(o.setConfig)==="Function"&&o.setConfig(e[n])}})}},{key:"playNext",value:function(e){var i=this;this.resetState(),this.setConfig(e),this._currentTime=0,this._duration=0,ue(this,"playnext",function(){i.start(),i.emit(qe,e)})}},{key:"resize",value:function(){var e=this;if(this.media){var i=this.root.getBoundingClientRect();this.sizeInfo.width=i.width,this.sizeInfo.height=i.height,this.sizeInfo.left=i.left,this.sizeInfo.top=i.top;var n=this.media,o=n.videoWidth,l=n.videoHeight,u=this.config,f=u.fitVideoSize,h=u.videoFillMode;if((h==="fill"||h==="cover"||h==="contain")&&this.setAttribute("data-xgfill",h),!(!l||!o)){this._videoHeight=l,this._videoWidth=o;var p=this.controls&&this.innerContainer?this.controls.root.getBoundingClientRect().height:0,v=i.width,g=i.height-p,m=parseInt(o/l*1e3,10),_=parseInt(v/g*1e3,10),C=v,b=g,E={};f==="auto"&&_>m||f==="fixWidth"?(b=v/m*1e3,this.config.fluid?E.paddingTop="".concat(b*100/C,"%"):E.height="".concat(b+p,"px")):(f==="auto"&&_<m||f==="fixHeight")&&(C=m*g/1e3,E.width="".concat(C,"px")),!this.fullscreen&&!this.cssfullscreen&&Object.keys(E).forEach(function(R){e.root.style[R]=E[R]}),(h==="fillHeight"&&_<m||h==="fillWidth"&&_>m)&&this.setAttribute("data-xgfill","cover");var N={videoScale:m,vWidth:C,vHeight:b,cWidth:C,cHeight:b+p};this.resizePosition(),this.emit(he,N)}}}},{key:"updateObjectPosition",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;if(this.media.updateObjectPosition){this.media.updateObjectPosition(e,i);return}this.media.style.objectPosition="".concat(e*100,"% ").concat(i*100,"%")}},{key:"setState",value:function(e){F.logInfo("setState","state from:".concat(Di[this.state]," to:").concat(Di[e])),this._state=e}},{key:"_preProcessUrl",value:function(e,i){var n=this.config,o=n.preProcessUrl,l=n.preProcessUrlOptions,u=Object.assign({},l,i);return!d.isBlob(e)&&typeof o=="function"?o(e,u):{url:e}}},{key:"state",get:function(){return this._state}},{key:"isFullscreen",get:function(){return this.fullscreen}},{key:"isCssfullScreen",get:function(){return this.cssfullscreen}},{key:"hasStart",get:function(){return this._hasStart},set:function(e){typeof e=="boolean"&&(this._hasStart=e,e===!1&&this.setState(M.READY),this.emit("hasstart"))}},{key:"isPlaying",get:function(){return this._state===M.RUNNING||this._state===M.ENDED},set:function(e){e?this.setState(M.RUNNING):this._state>=M.RUNNING&&this.setState(M.ATTACHED)}},{key:"definitionList",get:function(){return!this.config||!this.config.definition?[]:this.config.definition.list||[]},set:function(e){var i=this,n=this.config.definition,o=null,l=null;n.list=e,this.emit("resourceReady",e),e.forEach(function(u){var f;((f=i.curDefinition)===null||f===void 0?void 0:f.definition)===u.definition&&(o=u),n.defaultDefinition===u.definition&&(l=u)}),!l&&e.length>0&&(l=e[0]),o?this.changeDefinition(o):l&&this.changeDefinition(l)}},{key:"videoFrameInfo",get:function(){var e={total:0,dropped:0,corrupted:0,droppedRate:0,droppedDuration:0};if(!this.media||!this.media.getVideoPlaybackQuality)return e;var i=this.media.getVideoPlaybackQuality();return e.dropped=i.droppedVideoFrames||0,e.total=i.totalVideoFrames||0,e.corrupted=i.corruptedVideoFrames||0,e.total>0&&(e.droppedRate=e.dropped/e.total*100,e.droppedDuration=parseInt(this.cumulateTime/e.total*e.dropped,0)),e}},{key:"lang",get:function(){return this.config.lang},set:function(e){var i=Ae.langKeys.filter(function(n){return n===e});if(i.length===0&&e!=="zh"){console.error("Sorry, set lang fail, because the language [".concat(e,"] is not supported now, list of all supported languages is [").concat(Ae.langKeys.join(),"] "));return}this.config.lang=e,W.setLang(e,this)}},{key:"i18n",get:function(){var e=this.config.lang;return e==="zh"&&(e="zh-cn"),this.__i18n.lang[e]||this.__i18n.lang.en}},{key:"i18nKeys",get:function(){return this.__i18n.textKeys||{}}},{key:"version",get:function(){return mt}},{key:"playerId",get:function(){return this._pluginInfoId}},{key:"url",get:function(){return this.__url||this.config.url},set:function(e){this.__url=e}},{key:"poster",get:function(){return this.plugins.poster?this.plugins.poster.config.poster:this.config.poster},set:function(e){this.plugins.poster&&this.plugins.poster.update(e)}},{key:"readyState",get:function(){return L(A(r.prototype),"readyState",this)}},{key:"error",get:function(){var e=L(A(r.prototype),"error",this);return this.i18n[e]||e}},{key:"networkState",get:function(){return L(A(r.prototype),"networkState",this)}},{key:"fullscreenChanging",get:function(){return this._fullScreenOffset!==null}},{key:"cumulateTime",get:function(){var e=this._accPlayed,i=e.acc,n=e.t;return n?new Date().getTime()-n+i:i}},{key:"zoom",get:function(){return this.config.zoom},set:function(e){this.config.zoom=e}},{key:"videoRotateDeg",get:function(){return this.videoPos.rotate},set:function(e){e=d.convertDeg(e),!(e%90!==0||e===this.videoPos.rotate)&&(this.videoPos.rotate=e,this.resizePosition())}},{key:"avgSpeed",get:function(){return Ni},set:function(e){Ni=e}},{key:"realTimeSpeed",get:function(){return Ri},set:function(e){Ri=e}},{key:"offsetCurrentTime",get:function(){return this._offsetInfo.currentTime||0},set:function(e){this._offsetInfo.currentTime=e}},{key:"offsetDuration",get:function(){return this._offsetInfo.duration||0},set:function(e){this._offsetInfo.duration=e||0}},{key:"hook",value:function(e,i){return et.call.apply(et,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"useHooks",value:function(e,i){return tt.call.apply(tt,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"removeHooks",value:function(e,i){return it.call.apply(it,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"usePluginHooks",value:function(e,i,n){for(var o=arguments.length,l=new Array(o>3?o-3:0),u=3;u<o;u++)l[u-3]=arguments[u];return wi.call.apply(wi,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"removePluginHooks",value:function(e,i,n){for(var o=arguments.length,l=new Array(o>3?o-3:0),u=3;u<o;u++)l[u-3]=arguments[u];return bi.call.apply(bi,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"setUserActive",value:function(e,i){var n;typeof i=="boolean"&&i!==this.muted&&(this.addInnerOP("volumechange"),d.typeOf(i)===Boolean&&(this.muted=i)),(n=ge)===null||n===void 0||n.setActive(this.playerId,e)}}],[{key:"debugger",get:function(){return F.config.debug},set:function(e){F.config.debug=e}},{key:"instManager",get:function(){return ge},set:function(e){ge=e}},{key:"getCurrentUserActivePlayerId",value:function(){var e;return(e=ge)===null||e===void 0?void 0:e.getActiveId()}},{key:"setCurrentUserActive",value:function(e,i){var n;(n=ge)===null||n===void 0||n.setActive(e,i)}},{key:"isHevcSupported",value:function(){return O.isHevcSupported()}},{key:"probeConfigSupported",value:function(e){return O.probeConfigSupported(e)}},{key:"install",value:function(e,i){r.plugins||(r.plugins={}),r.plugins[e]||(r.plugins[e]=i)}},{key:"use",value:function(e,i){r.plugins||(r.plugins={}),r.plugins[e]=i}}]),r}(Br);k(nt,"defaultPreset",null),k(nt,"XgVideoProxy",null),nt.instManager=Oi.getInstance();function K(){return new Date().getTime()}var pe={LOAD_START:"loadstart",LOADED_DATA:"loadeddata",FIRST_FRAME:"firstFrame",WAIT_START:"waitingStart",WAIT_END:"waitingEnd",SEEK_START:"seekStart",SEEK_END:"seekEnd"},lo=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(y(t),"_onTimeupdate",function(){t._state.isTimeUpdate=!0,t._state.autoplayStart&&(F.logInfo("[xgLogger]".concat(t.player.playerId," _onTimeupdate")),t._sendFF("onTimeupdate"))}),k(y(t),"_onAutoplayStart",function(){F.logInfo("[xgLogger]".concat(t.player.playerId," _onAutoplayStart")),t._state.autoplayStart=!0,t.vt&&t._sendFF("onAutoplayStart")}),k(y(t),"_onReset",function(){t._state={autoplayStart:!1,isFFLoading:!1,isTimeUpdate:!1,isFFSend:!1,isLs:!1},t.vt=0,t.pt=0,t.fvt=0,t.newPointTime=K(),t.loadedCostTime=0,t.startCostTime=0,t._isSeeking=!1,t.seekingStart=0,t.waitingStart=0,t.fixedWaitingStart=0,t._isWaiting=!1,t._waitTimer&&d.clearTimeout(y(t),t._waitTimer),t._waittTimer&&d.clearTimeout(y(t),t._waittTimer),t._waitTimer=null,t._waittTimer=null,t._waitType=0}),k(y(t),"_onSeeking",function(){t.seekingStart||(t.suspendWaitingStatus("seek"),t.seekingStart=K(),t.emitLog(pe.SEEK_START,{start:K()}))}),k(y(t),"_onSeeked",function(){t.suspendSeekingStatus("seeked")}),k(y(t),"_onWaitingLoadStart",function(){t._isWaiting||t.vt||(t._isWaiting=!0,t.waitingStart=K(),t.fixedWaitingStart=K(),t._waitType=1,t.emitLog(pe.WAIT_START,{fixedStart:t.fixedWaitingStart,start:t.waitingStart,type:1,endType:"loadstart"}))}),k(y(t),"_onWaiting",function(){t._isWaiting||!t.vt||(t._isWaiting=!0,t.vt?t.seekingStart?t._waitType=2:t._waitType=0:t._waitType=1,t.fixedWaitingStart=K(),t._waitTimer=d.setTimeout(y(t),function(){t._isWaiting&&(t.waitingStart=K(),d.clearTimeout(y(t),t._waitTimer),t._waitTimer=null,t._startWaitTimeout(),t.emitLog(pe.WAIT_START,{fixedStart:t.fixedWaitingStart,start:t.waitingStart,type:t._waitType,endType:t._waitType===2?"seek":"playing"}))},200))}),k(y(t),"_onError",function(){t.suspendSeekingStatus("error"),t.suspendWaitingStatus("error")}),k(y(t),"_onPlaying",function(){t._isWaiting&&t.suspendWaitingStatus("playing")}),t}return S(r,[{key:"afterCreate",value:function(){var e=this;this._onReset(),this._waitType="firstFrame",this._initOnceEvents(),this.newPointTime=K(),this.loadedCostTime=0,this.startCostTime=0,this.on(_t,function(){var i=e._state,n=i.autoplayStart,o=i.isFFSend;e.startCostTime=K()-e.newPointTime,F.logInfo("[xgLogger]".concat(e.player.playerId," LOAD_START"),"autoplayStart:".concat(n," isFFSend:").concat(o," startCostTime:").concat(e.startCostTime," newPointTime").concat(e.newPointTime)),!o&&(!i.isLs&&e.emitLog(pe.LOAD_START,{}),i.isLs=!0,i.isTimeUpdate=!1,i.isFFLoading=!0,e.pt=K(),e.vt=0,e.fvt=0,e._initOnceEvents(),e._onWaitingLoadStart())}),this.on(ae,function(){e.vt=K(),e.fvt=e.vt-e.pt,e.loadedCostTime=e.vt-e.newPointTime;var i=e._state,n=i.isTimeUpdate,o=i.isFFSend,l=i.autoplayStart;F.logInfo("[xgLogger]".concat(e.player.playerId," LOADED_DATA"),"fvt:".concat(e.fvt," isTimeUpdate:").concat(e._state.isTimeUpdate," loadedCostTime:").concat(e.loadedCostTime)),(n||l)&&e._sendFF("loadedData"),o||e.emitLog(pe.LOADED_DATA,{}),e.suspendWaitingStatus("loadeddata")}),this.on($e,this._onSeeking),this.on(oe,this._onSeeked),this.on(wt,function(){e.endState("destroy")}),this.on(Ke,function(){e.endState("urlChange"),F.logInfo("[xgLogger]".concat(e.player.playerId," URL_CHANGE")),e._state.isFFSend&&e._onReset()}),this.on([yt,se],this._onPlaying),this.on(He,this._onWaiting),this.on(Be,this._onError),this.on(Ze,function(){F.logInfo("[xgLogger]".concat(e.player.playerId," RESET")),e.endState("reset"),e._initOnceEvents(),e._onReset()})}},{key:"_initOnceEvents",value:function(){this.off(ke,this._onAutoplayStart),this.off(q,this._onTimeupdate),this.once(ke,this._onAutoplayStart),this.once(q,this._onTimeupdate)}},{key:"_sendFF",value:function(e){this.s=K();var i=this._state,n=i.isFFLoading,o=i.isFFSend;F.logInfo("[xgLogger]".concat(this.player.playerId," _sendFF"),"".concat(e," fvt:").concat(this.fvt," isFFLoading:").concat(n," !isFFSend:").concat(!o)),this.vt>0&&n&&!o&&(F.logInfo("[xgLogger]".concat(this.player.playerId," emitLog_firstFrame"),e),this._state.isFFLoading=!1,this._state.isFFSend=!0,this.emitLog(pe.FIRST_FRAME,{fvt:this.fvt,costTime:this.fvt,vt:this.vt,startCostTime:this.startCostTime,loadedCostTime:this.loadedCostTime}))}},{key:"_startWaitTimeout",value:function(){var e=this;this._waittTimer&&d.clearTimeout(this,this._waittTimer),this._waittTimer=d.setTimeout(this,function(){e.suspendWaitingStatus("timeout"),d.clearTimeout(e,e._waittTimer),e._waittTimer=null},this.config.waitTimeout)}},{key:"endState",value:function(e){this.suspendWaitingStatus(e),this.suspendSeekingStatus(e)}},{key:"suspendSeekingStatus",value:function(e){if(this.seekingStart){var i=K(),n=i-this.seekingStart;this.seekingStart=0,this.emitLog(pe.SEEK_END,{end:i,costTime:n,endType:e})}}},{key:"suspendWaitingStatus",value:function(e){if(this._waitTimer&&(d.clearTimeout(this,this._waitTimer),this._waitTimer=null),this._waittTimer&&(d.clearTimeout(this,this._waittTimer),this._waittTimer=null),this._isWaiting=!1,!!this.waitingStart){var i=K(),n=i-this.waitingStart,o=i-this.fixedWaitingStart,l=this.config.waitTimeout;this._isWaiting=!1,this.waitingStart=0,this.fixedWaitingStart=0,this.emitLog(pe.WAIT_END,{fixedCostTime:o>l?l:o,costTime:n>l?l:n,type:e==="loadeddata"?1:this._waitType,endType:this._waitType===2?"seek":e})}}},{key:"emitLog",value:function(e,i){var n=this.player;this.emit(gi,U({t:K(),host:d.getHostFromUrl(n.currentSrc),vtype:n.vtype,eventType:e,currentTime:this.player.currentTime,readyState:n.video.readyState,networkState:n.video.networkState},i))}}],[{key:"pluginName",get:function(){return"xgLogger"}},{key:"defaultConfig",get:function(){return{waitTimeout:1e4}}}]),r}(B);function uo(){return new DOMParser().parseFromString(`<svg class="xgplayer-replay-svg" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 78 78" width="78" height="78">
11
11
  <path fill="#fff" transform="translate(20, 20)" d="M8.22708362,13.8757234 L11.2677371,12.6472196 C11.7798067,12.4403301 12.3626381,12.6877273 12.5695276,13.1997969 L12.9441342,14.1269807 C13.1510237,14.6390502 12.9036264,15.2218816 12.3915569,15.4287712 L6.8284538,17.6764107 L5.90126995,18.0510173 C5.38920044,18.2579068 4.80636901,18.0105096 4.5994795,17.49844 L1.97723335,11.0081531 C1.77034384,10.4960836 2.0177411,9.91325213 2.52981061,9.70636262 L3.45699446,9.33175602 C3.96906396,9.12486652 4.5518954,9.37226378 4.75878491,9.88433329 L5.67885163,12.1615783 C7.99551726,6.6766934 13.3983951,3 19.5,3 C27.7842712,3 34.5,9.71572875 34.5,18 C34.5,26.2842712 27.7842712,33 19.5,33 C15.4573596,33 11.6658607,31.3912946 8.87004692,28.5831991 C8.28554571,27.9961303 8.28762719,27.0463851 8.87469603,26.4618839 C9.46176488,25.8773827 10.4115101,25.8794641 10.9960113,26.466533 C13.2344327,28.7147875 16.263503,30 19.5,30 C26.127417,30 31.5,24.627417 31.5,18 C31.5,11.372583 26.127417,6 19.5,6 C14.4183772,6 9.94214483,9.18783811 8.22708362,13.8757234 Z"></path>
12
12
  </svg>
13
13
  `,"image/svg+xml").firstChild}var co=function(a){I(r,a);var s=P(r);function r(){return T(this,r),s.apply(this,arguments)}return S(r,[{key:"registerIcons",value:function(){return{replay:uo}}},{key:"afterCreate",value:function(){var e=this;B.insert(this.icons.replay,this.root,0),this.__handleReplay=this.hook("replayClick",function(){e.player.replay()},{pre:function(n){n.preventDefault(),n.stopPropagation()}}),this.bind(".xgplayer-replay",["click","touchend"],this.__handleReplay),this.on(ye,function(){if(e.playerConfig.loop||d.addClass(e.player.root,"replay"),!e.config.disable){e.show();var i=e.root.querySelector("path");if(i){var n=window.getComputedStyle(i).getPropertyValue("transform");if(typeof n=="string"&&n.indexOf("none")>-1)return null;i.setAttribute("transform",n)}}}),this.on(X,function(){e.hide()})}},{key:"handleReplay",value:function(e){e.preventDefault(),e.stopPropagation(),this.player.replay(),d.removeClass(this.player.root,"replay")}},{key:"show",value:function(e){this.config.disable||(this.root.style.display="flex")}},{key:"enable",value:function(){this.config.disable=!1}},{key:"disable",value:function(){this.config.disable=!0,this.hide()}},{key:"destroy",value:function(){this.unbind(".xgplayer-replay",["click","touchend"],this.__handleReplay)}},{key:"render",value:function(){return`<xg-replay class="xgplayer-replay">
@@ -19,15 +19,15 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
19
19
  `,"image/svg+xml").firstChild}function Nt(){return new DOMParser().parseFromString(`<svg class="pause" xmlns="http://www.w3.org/2000/svg" width="28" height="40" viewBox="3 -4 28 40">
20
20
  <path fill="#fff" transform="scale(0.0320625 0.0320625)" d="M598,214h170v596h-170v-596zM256 810v-596h170v596h-170z"></path>
21
21
  </svg>
22
- `,"image/svg+xml").firstChild}var ne={};function ho(a,s){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{start:null,end:null};return ne[a]&&window.clearTimeout(ne[a].id),ne[a]={},r.start&&r.start(),ne[a].id=window.setTimeout(function(){r.end&&r.end(),window.clearTimeout(ne[a].id),delete ne[a]},s),ne[a].id}function Fi(a){if(a){window.clearTimeout(a);return}Object.keys(ne).map(function(s){window.clearTimeout(ne[s].id),delete ne[s]})}var po=function(a){I(r,a);var s=P(r);function r(t){var e;return T(this,r),e=s.call(this,t),k(y(e),"onPlayerReset",function(){e.autoPlayStart=!1;var i=e.config.mode==="auto"?"auto-hide":"hide";e.setAttr("data-state","play"),d.removeClass(e.root,i),e.show()}),k(y(e),"onAutoplayStart",function(){if(!e.autoPlayStart){var i=e.config.mode==="auto"?"auto-hide":"hide";d.addClass(e.root,i),e.autoPlayStart=!0,e.onPlayPause("play")}}),e.autoPlayStart=!1,e}return S(r,[{key:"afterCreate",value:function(){var e=this,i=this.player,n=this.playerConfig;this.initIcons(),this.once(Ct,function(){n&&(n.lang&&n.lang==="en"?d.addClass(i.root,"lang-is-en"):n.lang==="jp"&&d.addClass(i.root,"lang-is-jp"))}),this.on(ke,this.onAutoplayStart),n.autoplay||this.show(),this.on(Et,function(){var o=e.config.mode==="auto"?"auto-hide":"hide";e.setAttr("data-state","play"),d.removeClass(e.root,o),e.show()}),this.on(X,function(){e.onPlayPause("play")}),this.on(Ie,function(){e.onPlayPause("pause")}),this.on(Ze,function(){e.onPlayerReset()}),this.clickHandler=this.hook("startClick",this.switchPausePlay,{pre:function(l){l.cancelable&&l.preventDefault(),l.stopPropagation();var u=e.player.paused;e.emitUserAction(l,"switch_play_pause",{props:"paused",from:u,to:!u})}}),this.bind(["click","touchend"],this.clickHandler)}},{key:"registerIcons",value:function(){return{startPlay:{icon:Rt,class:"xg-icon-play"},startPause:{icon:Nt,class:"xg-icon-pause"}}}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild("xg-start-inner",e.startPlay),this.appendChild("xg-start-inner",e.startPause)}},{key:"hide",value:function(){d.addClass(this.root,"hide")}},{key:"show",value:function(e){d.removeClass(this.root,"hide")}},{key:"focusHide",value:function(){d.addClass(this.root,"focus-hide")}},{key:"recover",value:function(){d.removeClass(this.root,"focus-hide")}},{key:"switchStatus",value:function(e){e?this.setAttr("data-state",this.player.paused?"pause":"play"):this.setAttr("data-state",this.player.paused?"play":"pause")}},{key:"animate",value:function(e){var i=this;this._animateId=ho("pauseplay",400,{start:function(){d.addClass(i.root,"interact"),i.show(),i.switchStatus(!0)},end:function(){d.removeClass(i.root,"interact"),!e&&i.hide(),i._animateId=null}})}},{key:"endAnimate",value:function(){d.removeClass(this.root,"interact"),Fi(this._animateId),this._animateId=null}},{key:"switchPausePlay",value:function(e){var i=this.player;if(e.cancelable&&e.preventDefault(),e.stopPropagation(),!(i.state<M.READY)){var n=this.player.paused;!n&&i.state===M.RUNNING?i.pause():i.play()}}},{key:"onPlayPause",value:function(e){var i=this.config,n=this.player;if(!(!n||n.state<M.RUNNING||!this.autoPlayStart)){if(i.mode==="show"){this.switchStatus(),this.show();return}if(i.mode==="auto"){this.switchStatus();return}if(i.isShowPause&&n.paused&&!n.ended||i.isShowEnd&&n.ended){this.switchStatus(),this.show(),this.endAnimate();return}if(i.disableAnimate){this.switchStatus(),this.hide();return}if(e==="play")this.autoPlayStart?this.animate():this.hide();else{if(!this.autoPlayStart||n.ended)return;this.animate()}}}},{key:"destroy",value:function(){this.unbind(["click","touchend"],this.clickHandler),Fi(this._animateId)}},{key:"render",value:function(){var e=this.playerConfig.autoplay?this.config.mode==="auto"?"auto-hide":"hide":"";return`
22
+ `,"image/svg+xml").firstChild}var ne={};function ho(a,s){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{start:null,end:null};return ne[a]&&window.clearTimeout(ne[a].id),ne[a]={},r.start&&r.start(),ne[a].id=window.setTimeout(function(){r.end&&r.end(),window.clearTimeout(ne[a].id),delete ne[a]},s),ne[a].id}function Fi(a){if(a){window.clearTimeout(a);return}Object.keys(ne).map(function(s){window.clearTimeout(ne[s].id),delete ne[s]})}var go=function(a){I(r,a);var s=P(r);function r(t){var e;return T(this,r),e=s.call(this,t),k(y(e),"onPlayerReset",function(){e.autoPlayStart=!1;var i=e.config.mode==="auto"?"auto-hide":"hide";e.setAttr("data-state","play"),d.removeClass(e.root,i),e.show()}),k(y(e),"onAutoplayStart",function(){if(!e.autoPlayStart){var i=e.config.mode==="auto"?"auto-hide":"hide";d.addClass(e.root,i),e.autoPlayStart=!0,e.onPlayPause("play")}}),e.autoPlayStart=!1,e}return S(r,[{key:"afterCreate",value:function(){var e=this,i=this.player,n=this.playerConfig;this.initIcons(),this.once(Ct,function(){n&&(n.lang&&n.lang==="en"?d.addClass(i.root,"lang-is-en"):n.lang==="jp"&&d.addClass(i.root,"lang-is-jp"))}),this.on(ke,this.onAutoplayStart),n.autoplay||this.show(),this.on(Et,function(){var o=e.config.mode==="auto"?"auto-hide":"hide";e.setAttr("data-state","play"),d.removeClass(e.root,o),e.show()}),this.on(X,function(){e.onPlayPause("play")}),this.on(Ie,function(){e.onPlayPause("pause")}),this.on(Ze,function(){e.onPlayerReset()}),this.clickHandler=this.hook("startClick",this.switchPausePlay,{pre:function(l){l.cancelable&&l.preventDefault(),l.stopPropagation();var u=e.player.paused;e.emitUserAction(l,"switch_play_pause",{props:"paused",from:u,to:!u})}}),this.bind(["click","touchend"],this.clickHandler)}},{key:"registerIcons",value:function(){return{startPlay:{icon:Rt,class:"xg-icon-play"},startPause:{icon:Nt,class:"xg-icon-pause"}}}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild("xg-start-inner",e.startPlay),this.appendChild("xg-start-inner",e.startPause)}},{key:"hide",value:function(){d.addClass(this.root,"hide")}},{key:"show",value:function(e){d.removeClass(this.root,"hide")}},{key:"focusHide",value:function(){d.addClass(this.root,"focus-hide")}},{key:"recover",value:function(){d.removeClass(this.root,"focus-hide")}},{key:"switchStatus",value:function(e){e?this.setAttr("data-state",this.player.paused?"pause":"play"):this.setAttr("data-state",this.player.paused?"play":"pause")}},{key:"animate",value:function(e){var i=this;this._animateId=ho("pauseplay",400,{start:function(){d.addClass(i.root,"interact"),i.show(),i.switchStatus(!0)},end:function(){d.removeClass(i.root,"interact"),!e&&i.hide(),i._animateId=null}})}},{key:"endAnimate",value:function(){d.removeClass(this.root,"interact"),Fi(this._animateId),this._animateId=null}},{key:"switchPausePlay",value:function(e){var i=this.player;if(e.cancelable&&e.preventDefault(),e.stopPropagation(),!(i.state<M.READY)){var n=this.player.paused;!n&&i.state===M.RUNNING?i.pause():i.play()}}},{key:"onPlayPause",value:function(e){var i=this.config,n=this.player;if(!(!n||n.state<M.RUNNING||!this.autoPlayStart)){if(i.mode==="show"){this.switchStatus(),this.show();return}if(i.mode==="auto"){this.switchStatus();return}if(i.isShowPause&&n.paused&&!n.ended||i.isShowEnd&&n.ended){this.switchStatus(),this.show(),this.endAnimate();return}if(i.disableAnimate){this.switchStatus(),this.hide();return}if(e==="play")this.autoPlayStart?this.animate():this.hide();else{if(!this.autoPlayStart||n.ended)return;this.animate()}}}},{key:"destroy",value:function(){this.unbind(["click","touchend"],this.clickHandler),Fi(this._animateId)}},{key:"render",value:function(){var e=this.playerConfig.autoplay?this.config.mode==="auto"?"auto-hide":"hide":"";return`
23
23
  <xg-start class="xgplayer-start `.concat(e,`">
24
24
  <xg-start-inner></xg-start-inner>
25
- </xg-start>`)}}],[{key:"pluginName",get:function(){return"start"}},{key:"defaultConfig",get:function(){return{isShowPause:!1,isShowEnd:!1,disableAnimate:!1,mode:"hide"}}}]),r}(B),go=function(a){I(r,a);var s=P(r);function r(){return T(this,r),s.apply(this,arguments)}return S(r,[{key:"render",value:function(){var e=this.config.innerHtml,i=d.createDom("xg-enter","",{},"xgplayer-enter");if(e&&e instanceof window.HTMLElement)i.appendChild(e);else if(e&&typeof e=="string")i.innerHTML=e;else{for(var n="",o=1;o<=12;o++)n+='<div class="xgplayer-enter-bar'.concat(o,'"></div>');i.innerHTML='<div class="xgplayer-enter-spinner">'.concat(n,"</div>")}return i}}],[{key:"pluginName",get:function(){return"enter"}},{key:"defaultConfig",get:function(){return{innerHtml:"",logo:""}}}]),r}(B);function ve(a,s,r){try{return' <div class="xg-tips '.concat(r?"hide":" ",'" lang-key="').concat(a.i18nKeys[s],`">
25
+ </xg-start>`)}}],[{key:"pluginName",get:function(){return"start"}},{key:"defaultConfig",get:function(){return{isShowPause:!1,isShowEnd:!1,disableAnimate:!1,mode:"hide"}}}]),r}(B),po=function(a){I(r,a);var s=P(r);function r(){return T(this,r),s.apply(this,arguments)}return S(r,[{key:"render",value:function(){var e=this.config.innerHtml,i=d.createDom("xg-enter","",{},"xgplayer-enter");if(e&&e instanceof window.HTMLElement)i.appendChild(e);else if(e&&typeof e=="string")i.innerHTML=e;else{for(var n="",o=1;o<=12;o++)n+='<div class="xgplayer-enter-bar'.concat(o,'"></div>');i.innerHTML='<div class="xgplayer-enter-spinner">'.concat(n,"</div>")}return i}}],[{key:"pluginName",get:function(){return"enter"}},{key:"defaultConfig",get:function(){return{innerHtml:"",logo:""}}}]),r}(B);function ve(a,s,r){try{return' <div class="xg-tips '.concat(r?"hide":" ",'" lang-key="').concat(a.i18nKeys[s],`">
26
26
  `).concat(a.i18n[s],`
27
27
  </div>`)}catch{return'<div class="xg-tips hide"></div>'}}var Mi=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(){this.getMini=this.getMini.bind(this),this.exitMini=this.exitMini.bind(this),this.bind("click",this.getMini)}},{key:"getMini",value:function(){this.config.onClick&&this.config.onClick()}},{key:"exitMini",value:function(){this.config.onClick&&this.config.onClick()}},{key:"destroy",value:function(){this.unbind(["click","touchend"],this.getMini)}},{key:"render",value:function(){var e="MINISCREEN";return`
28
28
  <xg-icon class="xgplayer-miniicon">
29
29
  <div class="xgplayer-icon btn-text"><span class="icon-text" lang-key="`.concat(this.i18nKeys[e],'">').concat(this.i18n[e],`</span></div>
30
- </xg-icon>`)}}],[{key:"pluginName",get:function(){return"miniscreenIcon"}},{key:"defaultConfig",get:function(){return{position:V.CONTROLS_RIGHT,index:10}}}]),r}(B);function Bi(a){var s=parseFloat(a),r=a.indexOf("%")===-1&&!Number.isNaN(s);return r&&s}var Ft=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"],Hi=Ft.length;function vo(){for(var a={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0},s=0;s<Hi;s++){var r=Ft[s];a[r]=0}return a}function mo(a){var s=window.getComputedStyle(a);return s}function Vi(a){if(typeof a=="string"&&(a=document.querySelector(a)),!(!a||G(a)!=="object"||!a.nodeType)){var s=mo(a);if(s.display==="none")return vo();var r={};r.width=a.offsetWidth,r.height=a.offsetHeight;for(var t=r.isBorderBox=s.boxSizing==="border-box",e=0;e<Hi;e++){var i=Ft[e],n=s[i],o=parseFloat(n);r[i]=Number.isNaN(o)?0:o}var l=r.paddingLeft+r.paddingRight,u=r.paddingTop+r.paddingBottom,f=r.marginLeft+r.marginRight,h=r.marginTop+r.marginBottom,g=r.borderLeftWidth+r.borderRightWidth,v=r.borderTopWidth+r.borderBottomWidth,p=t,m=Bi(s.width);m!==!1&&(r.width=m+(p?0:l+g));var _=Bi(s.height);return _!==!1&&(r.height=_+(p?0:u+v)),r.innerWidth=r.width-(l+g),r.innerHeight=r.height-(u+v),r.outerWidth=r.width+f,r.outerHeight=r.height+h,r}}function Mt(a,s){for(var r=0;r<a.length;r++){var t=a[r];if(t.identifier===s)return t}}var Bt={START:"dragStart",MOVE:"dragMove",ENDED:"dragEnded"},Ui={mousedown:["mousemove","mouseup"],touchstart:["touchmove","touchend","touchcancel"],pointerdown:["pointermove","pointerup","pointercancel"]},yo=function(a){I(r,a);var s=P(r);function r(t){var e,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return T(this,r),e=s.call(this),e.isEnabled=!0,e.isDragging=!1,e.isDown=!1,e.position={},e.downPoint={},e.dragPoint={x:0,y:0},e.startPos={x:0,y:0},e._root=t instanceof Element?t:document.querySelector(t),e._handlerDom=i.handle instanceof Element?i.handle:document.querySelector(i.handle),!e._root||!e._handlerDom?dt(e):(e._bindStartEvent(),e)}return S(r,[{key:"_bindStartEvent",value:function(){var e=this;"ontouchstart"in window?this._startKey="touchstart":this._startKey="mousedown",this["on".concat(this._startKey)]=this["on".concat(this._startKey)].bind(this),this._handlerDom.addEventListener(this._startKey,this["on".concat(this._startKey)]),Ui[this._startKey].map(function(i){e["on".concat(i)]=e["on".concat(i)].bind(e)})}},{key:"_unbindStartEvent",value:function(){this._handlerDom.removeEventListener(this._startKey,this["on".concat(this._startKey)])}},{key:"_bindPostStartEvents",value:function(e){var i=this;if(e){var n=Ui[this._startKey];n.map(function(o){window.addEventListener(o,i["on".concat(o)])}),this._boundPointerEvents=n}}},{key:"_unbindPostStartEvents",value:function(){var e=this;this._boundPointerEvents&&(this._boundPointerEvents.map(function(i){window.removeEventListener(i,e["on".concat(i)])}),delete this._boundPointerEvents)}},{key:"enable",value:function(){this.isEnabled=!0}},{key:"disable",value:function(){this.isEnabled=!1,this.isDragging&&this.onUp()}},{key:"onDocUp",value:function(e){this.onUp()}},{key:"animate",value:function(){var e=this;this.isDragging&&(this.positionDrag(),window.requestAnimationFrame(function(){e.animate()}))}},{key:"positionDrag",value:function(){var e="translate3d(".concat(this.dragPoint.x,"px, ").concat(this.dragPoint.y,"px, 0)");this._root.style.transform=e,this._root.style.webKitTransform=e}},{key:"setLeftTop",value:function(){this._root.style.left=this.position.x+"px",this._root.style.top=this.position.y+"px"}},{key:"onmousedown",value:function(e){this.dragStart(e,e)}},{key:"onmousemove",value:function(e){this.dragMove(e,e)}},{key:"onmouseup",value:function(e){this.dragEnd(e,e)}},{key:"ontouchstart",value:function(e){var i=e.changedTouches[0];this.dragStart(e,i),this.touchIdentifier=i.pointerId!==void 0?i.pointerId:i.identifier,e.preventDefault()}},{key:"ontouchmove",value:function(e){var i=Mt(e.changedTouches,this.touchIdentifier);i&&this.dragMove(e,i)}},{key:"ontouchend",value:function(e){var i=Mt(e.changedTouches,this.touchIdentifier);i&&this.dragEnd(e,i),e.preventDefault()}},{key:"ontouchcancel",value:function(e){var i=Mt(e.changedTouches,this.touchIdentifier);i&&this.dragCancel(e,i)}},{key:"dragStart",value:function(e,i){if(!(!this._root||this.isDown||!this.isEnabled)){this.downPoint=i,this.dragPoint.x=0,this.dragPoint.y=0,this._getPosition();var n=Vi(this._root);this.startPos.x=this.position.x,this.startPos.y=this.position.y,this.startPos.maxY=window.innerHeight-n.height,this.startPos.maxX=window.innerWidth-n.width,this.setLeftTop(),this.isDown=!0,this._bindPostStartEvents(e)}}},{key:"dragRealStart",value:function(e,i){this.isDragging=!0,this.animate(),this.emit(Bt.START,this.startPos)}},{key:"dragEnd",value:function(e,i){this._root&&(this._unbindPostStartEvents(),this.isDragging&&(this._root.style.transform="",this.setLeftTop(),this.emit(Bt.ENDED)),this.presetInfo())}},{key:"_dragPointerMove",value:function(e,i){var n={x:i.pageX-this.downPoint.pageX,y:i.pageY-this.downPoint.pageY};return!this.isDragging&&this.hasDragStarted(n)&&this.dragRealStart(e,i),n}},{key:"dragMove",value:function(e,i){if(e=e||window.event,!!this.isDown){var n=this.startPos,o=n.x,l=n.y,u=this._dragPointerMove(e,i),f=u.x,h=u.y;f=this.checkContain("x",f,o),h=this.checkContain("y",h,l),this.position.x=o+f,this.position.y=l+h,this.dragPoint.x=f,this.dragPoint.y=h,this.emit(Bt.MOVE,this.position)}}},{key:"dragCancel",value:function(e,i){this.dragEnd(e,i)}},{key:"presetInfo",value:function(){this.isDragging=!1,this.startPos={x:0,y:0},this.dragPoint={x:0,y:0},this.isDown=!1}},{key:"destroy",value:function(){this._unbindStartEvent(),this._unbindPostStartEvents(),this.isDragging&&this.dragEnd(),this.removeAllListeners(),this._handlerDom=null}},{key:"hasDragStarted",value:function(e){return Math.abs(e.x)>3||Math.abs(e.y)>3}},{key:"checkContain",value:function(e,i,n){return i+n<0?0-n:e==="x"&&i+n>this.startPos.maxX?this.startPos.maxX-n:e==="y"&&i+n>this.startPos.maxY?this.startPos.maxY-n:i}},{key:"_getPosition",value:function(){var e=window.getComputedStyle(this._root),i=this._getPositionCoord(e.left,"width"),n=this._getPositionCoord(e.top,"height");this.position.x=Number.isNaN(i)?0:i,this.position.y=Number.isNaN(n)?0:n,this._addTransformPosition(e)}},{key:"_addTransformPosition",value:function(e){var i=e.transform;if(i.indexOf("matrix")===0){var n=i.split(","),o=i.indexOf("matrix3d")===0?12:4,l=parseInt(n[o],10),u=parseInt(n[o+1],10);this.position.x+=l,this.position.y+=u}}},{key:"_getPositionCoord",value:function(e,i){if(e.indexOf("%")!==-1){var n=Vi(this._root.parentNode);return n?parseFloat(e)/100*n[i]:0}return parseInt(e,10)}}]),r}(Zt),_o=function(a){I(r,a);var s=P(r);function r(t){var e;T(this,r),e=s.call(this,t),k(y(e),"onCancelClick",function(o){e.exitMini(),e.isClose=!0}),k(y(e),"onCenterClick",function(o){var l=y(e),u=l.player;u.paused?u.play():u.pause()}),k(y(e),"onScroll",function(o){if(!(!window.scrollY&&window.scrollY!==0||Math.abs(window.scrollY-e.pos.scrollY)<50)){var l=parseInt(d.getCss(e.player.root,"height"));l+=e.config.scrollTop,e.pos.scrollY=window.scrollY,window.scrollY>l+5?!e.isMini&&!e.isClose&&e.getMini():window.scrollY<=l&&(e.isMini&&e.exitMini(),e.isClose=!1)}}),e.isMini=!1,e.isClose=!1;var i=y(e),n=i.config;return e.pos={left:n.left<0?window.innerWidth-n.width-20:n.left,top:n.top<0?window.innerHeight-n.height-20:n.top,height:e.config.height,width:e.config.width,scrollY:window.scrollY||0},e.lastStyle=null,e}return S(r,[{key:"beforeCreate",value:function(e){typeof e.player.config.mini=="boolean"&&(e.config.isShowIcon=e.player.config.mini)}},{key:"afterCreate",value:function(){var e=this;this.initIcons(),this.on(Ie,function(){e.setAttr("data-state","pause")}),this.on(X,function(){e.setAttr("data-state","play")})}},{key:"onPluginsReady",value:function(){var e=this,i=this.player,n=this.config;if(!n.disable){if(this.config.isShowIcon){var o={config:{onClick:function(){e.getMini()}}};i.controls.registerPlugin(Mi,o,Mi.pluginName)}var l=d.checkTouchSupport()?"touchend":"click";this.bind(".mini-cancel-btn",l,this.onCancelClick),this.bind(".play-icon",l,this.onCenterClick),this.config.disableDrag||(this._draggabilly=new yo(this.player.root,{handle:this.root})),this.config.isScrollSwitch&&window.addEventListener("scroll",this.onScroll)}}},{key:"registerIcons",value:function(){return{play:{icon:Rt,class:"xg-icon-play"},pause:{icon:Nt,class:"xg-icon-pause"}}}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(".play-icon",e.play),this.appendChild(".play-icon",e.pause)}},{key:"getMini",value:function(){var e=this;if(!this.isMini){var i=this.player,n=this.playerConfig,o=this.config.target||this.player.root;this.lastStyle={},d.addClass(i.root,"xgplayer-mini"),["width","height","top","left"].map(function(l){e.lastStyle[l]=o.style[l],o.style[l]="".concat(e.pos[l],"px")}),n.fluid&&(o.style["padding-top"]=""),this.emit(Xe,!0),i.isMini=this.isMini=!0}}},{key:"exitMini",value:function(){var e=this;if(!this.isMini)return!1;var i=this.player,n=this.playerConfig,o=this.config.target||this.player.root;d.removeClass(i.root,"xgplayer-mini"),this.lastStyle&&Object.keys(this.lastStyle).map(function(l){o.style[l]=e.lastStyle[l]}),this.lastStyle=null,n.fluid&&(i.root.style.width="100%",i.root.style.height="0",i.root.style["padding-top"]="".concat(n.height*100/n.width,"%")),this.emit(Xe,!1),this.isMini=i.isMini=!1}},{key:"destroy",value:function(){window.removeEventListener("scroll",this.onScroll);var e=d.checkTouchSupport()?"touchend":"click";this.unbind(".mini-cancel-btn",e,this.onCancelClick),this.unbind(".play-icon",e,this.onCenterClick),this._draggabilly&&this._draggabilly.destroy(),this._draggabilly=null,this.exitMini()}},{key:"render",value:function(){if(!this.config.disable)return`
30
+ </xg-icon>`)}}],[{key:"pluginName",get:function(){return"miniscreenIcon"}},{key:"defaultConfig",get:function(){return{position:V.CONTROLS_RIGHT,index:10}}}]),r}(B);function Bi(a){var s=parseFloat(a),r=a.indexOf("%")===-1&&!Number.isNaN(s);return r&&s}var Ft=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"],Hi=Ft.length;function vo(){for(var a={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0},s=0;s<Hi;s++){var r=Ft[s];a[r]=0}return a}function mo(a){var s=window.getComputedStyle(a);return s}function Vi(a){if(typeof a=="string"&&(a=document.querySelector(a)),!(!a||G(a)!=="object"||!a.nodeType)){var s=mo(a);if(s.display==="none")return vo();var r={};r.width=a.offsetWidth,r.height=a.offsetHeight;for(var t=r.isBorderBox=s.boxSizing==="border-box",e=0;e<Hi;e++){var i=Ft[e],n=s[i],o=parseFloat(n);r[i]=Number.isNaN(o)?0:o}var l=r.paddingLeft+r.paddingRight,u=r.paddingTop+r.paddingBottom,f=r.marginLeft+r.marginRight,h=r.marginTop+r.marginBottom,p=r.borderLeftWidth+r.borderRightWidth,v=r.borderTopWidth+r.borderBottomWidth,g=t,m=Bi(s.width);m!==!1&&(r.width=m+(g?0:l+p));var _=Bi(s.height);return _!==!1&&(r.height=_+(g?0:u+v)),r.innerWidth=r.width-(l+p),r.innerHeight=r.height-(u+v),r.outerWidth=r.width+f,r.outerHeight=r.height+h,r}}function Mt(a,s){for(var r=0;r<a.length;r++){var t=a[r];if(t.identifier===s)return t}}var Bt={START:"dragStart",MOVE:"dragMove",ENDED:"dragEnded"},Ui={mousedown:["mousemove","mouseup"],touchstart:["touchmove","touchend","touchcancel"],pointerdown:["pointermove","pointerup","pointercancel"]},yo=function(a){I(r,a);var s=P(r);function r(t){var e,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return T(this,r),e=s.call(this),e.isEnabled=!0,e.isDragging=!1,e.isDown=!1,e.position={},e.downPoint={},e.dragPoint={x:0,y:0},e.startPos={x:0,y:0},e._root=t instanceof Element?t:document.querySelector(t),e._handlerDom=i.handle instanceof Element?i.handle:document.querySelector(i.handle),!e._root||!e._handlerDom?dt(e):(e._bindStartEvent(),e)}return S(r,[{key:"_bindStartEvent",value:function(){var e=this;"ontouchstart"in window?this._startKey="touchstart":this._startKey="mousedown",this["on".concat(this._startKey)]=this["on".concat(this._startKey)].bind(this),this._handlerDom.addEventListener(this._startKey,this["on".concat(this._startKey)]),Ui[this._startKey].map(function(i){e["on".concat(i)]=e["on".concat(i)].bind(e)})}},{key:"_unbindStartEvent",value:function(){this._handlerDom.removeEventListener(this._startKey,this["on".concat(this._startKey)])}},{key:"_bindPostStartEvents",value:function(e){var i=this;if(e){var n=Ui[this._startKey];n.map(function(o){window.addEventListener(o,i["on".concat(o)])}),this._boundPointerEvents=n}}},{key:"_unbindPostStartEvents",value:function(){var e=this;this._boundPointerEvents&&(this._boundPointerEvents.map(function(i){window.removeEventListener(i,e["on".concat(i)])}),delete this._boundPointerEvents)}},{key:"enable",value:function(){this.isEnabled=!0}},{key:"disable",value:function(){this.isEnabled=!1,this.isDragging&&this.onUp()}},{key:"onDocUp",value:function(e){this.onUp()}},{key:"animate",value:function(){var e=this;this.isDragging&&(this.positionDrag(),window.requestAnimationFrame(function(){e.animate()}))}},{key:"positionDrag",value:function(){var e="translate3d(".concat(this.dragPoint.x,"px, ").concat(this.dragPoint.y,"px, 0)");this._root.style.transform=e,this._root.style.webKitTransform=e}},{key:"setLeftTop",value:function(){this._root.style.left=this.position.x+"px",this._root.style.top=this.position.y+"px"}},{key:"onmousedown",value:function(e){this.dragStart(e,e)}},{key:"onmousemove",value:function(e){this.dragMove(e,e)}},{key:"onmouseup",value:function(e){this.dragEnd(e,e)}},{key:"ontouchstart",value:function(e){var i=e.changedTouches[0];this.dragStart(e,i),this.touchIdentifier=i.pointerId!==void 0?i.pointerId:i.identifier,e.preventDefault()}},{key:"ontouchmove",value:function(e){var i=Mt(e.changedTouches,this.touchIdentifier);i&&this.dragMove(e,i)}},{key:"ontouchend",value:function(e){var i=Mt(e.changedTouches,this.touchIdentifier);i&&this.dragEnd(e,i),e.preventDefault()}},{key:"ontouchcancel",value:function(e){var i=Mt(e.changedTouches,this.touchIdentifier);i&&this.dragCancel(e,i)}},{key:"dragStart",value:function(e,i){if(!(!this._root||this.isDown||!this.isEnabled)){this.downPoint=i,this.dragPoint.x=0,this.dragPoint.y=0,this._getPosition();var n=Vi(this._root);this.startPos.x=this.position.x,this.startPos.y=this.position.y,this.startPos.maxY=window.innerHeight-n.height,this.startPos.maxX=window.innerWidth-n.width,this.setLeftTop(),this.isDown=!0,this._bindPostStartEvents(e)}}},{key:"dragRealStart",value:function(e,i){this.isDragging=!0,this.animate(),this.emit(Bt.START,this.startPos)}},{key:"dragEnd",value:function(e,i){this._root&&(this._unbindPostStartEvents(),this.isDragging&&(this._root.style.transform="",this.setLeftTop(),this.emit(Bt.ENDED)),this.presetInfo())}},{key:"_dragPointerMove",value:function(e,i){var n={x:i.pageX-this.downPoint.pageX,y:i.pageY-this.downPoint.pageY};return!this.isDragging&&this.hasDragStarted(n)&&this.dragRealStart(e,i),n}},{key:"dragMove",value:function(e,i){if(e=e||window.event,!!this.isDown){var n=this.startPos,o=n.x,l=n.y,u=this._dragPointerMove(e,i),f=u.x,h=u.y;f=this.checkContain("x",f,o),h=this.checkContain("y",h,l),this.position.x=o+f,this.position.y=l+h,this.dragPoint.x=f,this.dragPoint.y=h,this.emit(Bt.MOVE,this.position)}}},{key:"dragCancel",value:function(e,i){this.dragEnd(e,i)}},{key:"presetInfo",value:function(){this.isDragging=!1,this.startPos={x:0,y:0},this.dragPoint={x:0,y:0},this.isDown=!1}},{key:"destroy",value:function(){this._unbindStartEvent(),this._unbindPostStartEvents(),this.isDragging&&this.dragEnd(),this.removeAllListeners(),this._handlerDom=null}},{key:"hasDragStarted",value:function(e){return Math.abs(e.x)>3||Math.abs(e.y)>3}},{key:"checkContain",value:function(e,i,n){return i+n<0?0-n:e==="x"&&i+n>this.startPos.maxX?this.startPos.maxX-n:e==="y"&&i+n>this.startPos.maxY?this.startPos.maxY-n:i}},{key:"_getPosition",value:function(){var e=window.getComputedStyle(this._root),i=this._getPositionCoord(e.left,"width"),n=this._getPositionCoord(e.top,"height");this.position.x=Number.isNaN(i)?0:i,this.position.y=Number.isNaN(n)?0:n,this._addTransformPosition(e)}},{key:"_addTransformPosition",value:function(e){var i=e.transform;if(i.indexOf("matrix")===0){var n=i.split(","),o=i.indexOf("matrix3d")===0?12:4,l=parseInt(n[o],10),u=parseInt(n[o+1],10);this.position.x+=l,this.position.y+=u}}},{key:"_getPositionCoord",value:function(e,i){if(e.indexOf("%")!==-1){var n=Vi(this._root.parentNode);return n?parseFloat(e)/100*n[i]:0}return parseInt(e,10)}}]),r}(Zt),_o=function(a){I(r,a);var s=P(r);function r(t){var e;T(this,r),e=s.call(this,t),k(y(e),"onCancelClick",function(o){e.exitMini(),e.isClose=!0}),k(y(e),"onCenterClick",function(o){var l=y(e),u=l.player;u.paused?u.play():u.pause()}),k(y(e),"onScroll",function(o){if(!(!window.scrollY&&window.scrollY!==0||Math.abs(window.scrollY-e.pos.scrollY)<50)){var l=parseInt(d.getCss(e.player.root,"height"));l+=e.config.scrollTop,e.pos.scrollY=window.scrollY,window.scrollY>l+5?!e.isMini&&!e.isClose&&e.getMini():window.scrollY<=l&&(e.isMini&&e.exitMini(),e.isClose=!1)}}),e.isMini=!1,e.isClose=!1;var i=y(e),n=i.config;return e.pos={left:n.left<0?window.innerWidth-n.width-20:n.left,top:n.top<0?window.innerHeight-n.height-20:n.top,height:e.config.height,width:e.config.width,scrollY:window.scrollY||0},e.lastStyle=null,e}return S(r,[{key:"beforeCreate",value:function(e){typeof e.player.config.mini=="boolean"&&(e.config.isShowIcon=e.player.config.mini)}},{key:"afterCreate",value:function(){var e=this;this.initIcons(),this.on(Ie,function(){e.setAttr("data-state","pause")}),this.on(X,function(){e.setAttr("data-state","play")})}},{key:"onPluginsReady",value:function(){var e=this,i=this.player,n=this.config;if(!n.disable){if(this.config.isShowIcon){var o={config:{onClick:function(){e.getMini()}}};i.controls.registerPlugin(Mi,o,Mi.pluginName)}var l=d.checkTouchSupport()?"touchend":"click";this.bind(".mini-cancel-btn",l,this.onCancelClick),this.bind(".play-icon",l,this.onCenterClick),this.config.disableDrag||(this._draggabilly=new yo(this.player.root,{handle:this.root})),this.config.isScrollSwitch&&window.addEventListener("scroll",this.onScroll)}}},{key:"registerIcons",value:function(){return{play:{icon:Rt,class:"xg-icon-play"},pause:{icon:Nt,class:"xg-icon-pause"}}}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(".play-icon",e.play),this.appendChild(".play-icon",e.pause)}},{key:"getMini",value:function(){var e=this;if(!this.isMini){var i=this.player,n=this.playerConfig,o=this.config.target||this.player.root;this.lastStyle={},d.addClass(i.root,"xgplayer-mini"),["width","height","top","left"].map(function(l){e.lastStyle[l]=o.style[l],o.style[l]="".concat(e.pos[l],"px")}),n.fluid&&(o.style["padding-top"]=""),this.emit(Xe,!0),i.isMini=this.isMini=!0}}},{key:"exitMini",value:function(){var e=this;if(!this.isMini)return!1;var i=this.player,n=this.playerConfig,o=this.config.target||this.player.root;d.removeClass(i.root,"xgplayer-mini"),this.lastStyle&&Object.keys(this.lastStyle).map(function(l){o.style[l]=e.lastStyle[l]}),this.lastStyle=null,n.fluid&&(i.root.style.width="100%",i.root.style.height="0",i.root.style["padding-top"]="".concat(n.height*100/n.width,"%")),this.emit(Xe,!1),this.isMini=i.isMini=!1}},{key:"destroy",value:function(){window.removeEventListener("scroll",this.onScroll);var e=d.checkTouchSupport()?"touchend":"click";this.unbind(".mini-cancel-btn",e,this.onCancelClick),this.unbind(".play-icon",e,this.onCenterClick),this._draggabilly&&this._draggabilly.destroy(),this._draggabilly=null,this.exitMini()}},{key:"render",value:function(){if(!this.config.disable)return`
31
31
  <xg-mini-layer class="xg-mini-layer">
32
32
  <xg-mini-header class="xgplayer-mini-header">
33
33
  `.concat(ve(this,"MINI_DRAG",this.playerConfig.isHideTips),`
@@ -39,13 +39,13 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
39
39
  </div>
40
40
  <div class="play-icon">
41
41
  </div>
42
- </xg-mini-layer>`)}}],[{key:"pluginName",get:function(){return"miniscreen"}},{key:"defaultConfig",get:function(){return{index:10,disable:!1,width:320,height:180,left:-1,top:-1,isShowIcon:!1,isScrollSwitch:!1,scrollTop:0,disableDrag:!1}}}]),r}(B),rt={mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",mousemove:"onMouseMove"},Ht=["videoClick","videoDbClick"],Vt=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(y(t),"onMouseMove",function(o){var l=y(t),u=l.player,f=l.playerConfig;u.isActive||(u.focus({autoHide:!f.closeDelayBlur}),!f.closeFocusVideoFocus&&u.media.focus())}),k(y(t),"onMouseEnter",function(o){var l=y(t),u=l.playerConfig,f=l.player;!u.closeFocusVideoFocus&&f.media.focus(),u.closeDelayBlur?f.focus({autoHide:!1}):f.focus(),t.emit(ui)}),k(y(t),"onMouseLeave",function(o){var l=t.playerConfig,u=l.closePlayerBlur,f=l.leavePlayerTime,h=l.closeDelayBlur;!u&&!h&&(f?t.player.focus({autoHide:!0,delay:f}):t.player.blur({ignorePaused:!0})),t.emit(li)}),k(y(t),"onVideoClick",function(o){var l=y(t),u=l.player,f=l.playerConfig;o.target&&f.closeVideoClick||(o.target===u.root||o.target===u.media||o.target===u.innerContainer||o.target===u.media.__canvas)&&(o.preventDefault(),f.closeVideoStopPropagation||o.stopPropagation(),t._clickCount++,t.clickTimer&&(clearTimeout(t.clickTimer),t.clickTimer=null),t.clickTimer=setTimeout(function(){t._clickCount&&(t._clickCount--,ue(y(t),Ht[0],function(h,g){t.switchPlayPause(g.e)},{e:o,paused:u.paused}),clearTimeout(t.clickTimer),t.clickTimer=null)},300))}),k(y(t),"onVideoDblClick",function(o){var l=y(t),u=l.player,f=l.playerConfig;if(!(f.closeVideoDblclick||!o.target||o.target!==u.media&&o.target!==u.media.__canvas)){if(!f.closeVideoClick&&t._clickCount<2){t._clickCount=0;return}t._clickCount=0,t.clickTimer&&(clearTimeout(t.clickTimer),t.clickTimer=null),o.preventDefault(),o.stopPropagation(),ue(y(t),Ht[1],function(h,g){t.emitUserAction(g.e,"switch_fullscreen",{props:"fullscreen",from:u.fullscreen,to:!u.fullscreen}),u.fullscreen?u.exitFullscreen():u.getFullscreen()},{e:o,fullscreen:u.fullscreen})}}),t}return S(r,[{key:"afterCreate",value:function(){var e=this;this._clickCount=0,Ht.map(function(n){e.__hooks[n]=null});var i=this.playerConfig.isMobileSimulateMode;i==="mobile"||O.device==="mobile"&&!O.os.isIpad||this.initEvents()}},{key:"initEvents",value:function(){var e=this,i=this.player,n=i.media,o=i.root,l=this.playerConfig.enableContextmenu;o&&o.addEventListener("click",this.onVideoClick,!1),o&&o.addEventListener("dblclick",this.onVideoDblClick,!1),Object.keys(rt).map(function(u){o.addEventListener(u,e[rt[u]],!1)}),!l&&n&&n.addEventListener("contextmenu",this.onContextmenu,!1)}},{key:"switchPlayPause",value:function(e){var i=this.player;this.emitUserAction(e,"switch_play_pause",{props:"paused",from:i.paused,to:!i.paused}),i.ended?i.duration!==1/0&&i.duration>0&&i.replay():i.paused?i.play():i.pause()}},{key:"onContextmenu",value:function(e){e=e||window.event,e.preventDefault&&e.preventDefault(),e.stopPropagation?e.stopPropagation():(e.returnValue=!1,e.cancelBubble=!0)}},{key:"destroy",value:function(){var e=this,i=this.player,n=i.video,o=i.root;this.clickTimer&&clearTimeout(this.clickTimer),o.removeEventListener("click",this.onVideoClick,!1),o.removeEventListener("dblclick",this.onVideoDblClick,!1),n.removeEventListener("contextmenu",this.onContextmenu,!1),Object.keys(rt).map(function(l){o.removeEventListener(l,e[rt[l]],!1)})}}],[{key:"pluginName",get:function(){return"pc"}},{key:"defaultConfig",get:function(){return{}}}]),r}(de),me={PRESS:"press",PRESS_END:"pressend",DOUBlE_CLICK:"doubleclick",CLICK:"click",TOUCH_MOVE:"touchmove",TOUCH_START:"touchstart",TOUCH_END:"touchend"},ko={start:"touchstart",end:"touchend",move:"touchmove",cancel:"touchcancel"},Co={start:"mousedown",end:"mouseup",move:"mousemove",cancel:"mouseleave"};function zi(a){return a&&a.length>0?a[a.length-1]:null}function Eo(){return{pressDelay:600,dbClickDelay:200,disablePress:!1,disableDbClick:!1,miniStep:2,needPreventDefault:!0}}var bo=function(){function a(s){var r=this,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{eventType:"touch"};T(this,a),k(this,"onTouchStart",function(e){var i=r._pos,n=r.root,o=zi(e.touches);i.x=o?parseInt(o.pageX,10):e.pageX,i.y=o?parseInt(o.pageX,10):e.pageX,i.start=!0,r.__setPress(e),n.addEventListener(r.events.end,r.onTouchEnd),n.addEventListener(r.events.cancel,r.onTouchCancel),n.addEventListener(r.events.move,r.onTouchMove),r.trigger(me.TOUCH_START,e)}),k(this,"onTouchCancel",function(e){r.onTouchEnd(e)}),k(this,"onTouchEnd",function(e){var i=r._pos,n=r.root;r.__clearPress(),n.removeEventListener(r.events.cancel,r.onTouchCancel),n.removeEventListener(r.events.end,r.onTouchEnd),n.removeEventListener(r.events.move,r.onTouchMove),e.moving=i.moving,e.press=i.press,i.press&&r.trigger(me.PRESS_END,e),r.trigger(me.TOUCH_END,e),!i.press&&!i.moving&&r.__setDb(e),i.press=!1,i.start=!1,i.moving=!1}),k(this,"onTouchMove",function(e){var i=r._pos,n=r.config,o=zi(e.touches),l=o?parseInt(o.pageX,10):e.pageX,u=o?parseInt(o.pageY,10):e.pageX,f=l-i.x,h=u-i.y;Math.abs(h)<n.miniStep&&Math.abs(f)<n.miniStep||(r.__clearPress(),i.press&&r.trigger(me.PRESS_END,e),i.press=!1,i.moving=!0,r.trigger(me.TOUCH_MOVE,e))}),this._pos={moving:!1,start:!1,x:0,y:0},this.config=Eo(),Object.keys(t).map(function(e){r.config[e]=t[e]}),this.root=s,this.events=t.eventType==="mouse"?Co:ko,this.pressIntrvalId=null,this.dbIntrvalId=null,this.__handlers={},this._initEvent()}return S(a,[{key:"_initEvent",value:function(){this.root.addEventListener(this.events.start,this.onTouchStart)}},{key:"__setPress",value:function(r){var t=this,e=this.config;this.pressIntrvalId&&this.__clearPress(),this.pressIntrvalId=setTimeout(function(){t.trigger(me.PRESS,r),t._pos.press=!0,t.__clearPress()},e.pressDelay)}},{key:"__clearPress",value:function(){window.clearTimeout(this.pressIntrvalId),this.pressIntrvalId=null}},{key:"__setDb",value:function(r){var t=this,e=this.config;if(this.dbIntrvalId){this.__clearDb(),this.trigger(me.DOUBlE_CLICK,r);return}this.dbIntrvalId=setTimeout(function(){t.__clearDb(),!t._pos.start&&!t._pos.press&&!t._pos.moving&&t.trigger(me.CLICK,r)},e.dbClickDelay)}},{key:"__clearDb",value:function(){clearTimeout(this.dbIntrvalId),this.dbIntrvalId=null}},{key:"on",value:function(r,t){this.__handlers[r]||(this.__handlers[r]=[]),this.__handlers[r].push(t)}},{key:"off",value:function(r,t){if(this.__handlers[r]){for(var e=this.__handlers[r],i=-1,n=0;n<e.length;n++)if(e[n]===t){i=n;break}i>=0&&this.__handlers[r].splice(i,1)}}},{key:"trigger",value:function(r,t){this.__handlers[r]&&this.__handlers[r].map(function(e){try{e(t)}catch(i){console.error("trigger>>:".concat(r),i)}})}},{key:"destroy",value:function(){var r=this,t={touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart"};Object.keys(t).forEach(function(e){r.root.removeEventListener(e,r[t[e]])})}}]),a}();function wo(){return new DOMParser().parseFromString(`<svg width="20" height="9" viewBox="0 0 8 9" fill="none" xmlns="http://www.w3.org/2000/svg"
42
+ </xg-mini-layer>`)}}],[{key:"pluginName",get:function(){return"miniscreen"}},{key:"defaultConfig",get:function(){return{index:10,disable:!1,width:320,height:180,left:-1,top:-1,isShowIcon:!1,isScrollSwitch:!1,scrollTop:0,disableDrag:!1}}}]),r}(B),rt={mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",mousemove:"onMouseMove"},Ht=["videoClick","videoDbClick"],Vt=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(y(t),"onMouseMove",function(o){var l=y(t),u=l.player,f=l.playerConfig;u.isActive||(u.focus({autoHide:!f.closeDelayBlur}),!f.closeFocusVideoFocus&&u.media.focus())}),k(y(t),"onMouseEnter",function(o){var l=y(t),u=l.playerConfig,f=l.player;!u.closeFocusVideoFocus&&f.media.focus(),u.closeDelayBlur?f.focus({autoHide:!1}):f.focus(),t.emit(ui)}),k(y(t),"onMouseLeave",function(o){var l=t.playerConfig,u=l.closePlayerBlur,f=l.leavePlayerTime,h=l.closeDelayBlur;!u&&!h&&(f?t.player.focus({autoHide:!0,delay:f}):t.player.blur({ignorePaused:!0})),t.emit(li)}),k(y(t),"onVideoClick",function(o){var l=y(t),u=l.player,f=l.playerConfig;o.target&&f.closeVideoClick||(o.target===u.root||o.target===u.media||o.target===u.innerContainer||o.target===u.media.__canvas)&&(o.preventDefault(),f.closeVideoStopPropagation||o.stopPropagation(),t._clickCount++,t.clickTimer&&(clearTimeout(t.clickTimer),t.clickTimer=null),t.clickTimer=setTimeout(function(){t._clickCount&&(t._clickCount--,ue(y(t),Ht[0],function(h,p){t.switchPlayPause(p.e)},{e:o,paused:u.paused}),clearTimeout(t.clickTimer),t.clickTimer=null)},300))}),k(y(t),"onVideoDblClick",function(o){var l=y(t),u=l.player,f=l.playerConfig;if(!(f.closeVideoDblclick||!o.target||o.target!==u.media&&o.target!==u.media.__canvas)){if(!f.closeVideoClick&&t._clickCount<2){t._clickCount=0;return}t._clickCount=0,t.clickTimer&&(clearTimeout(t.clickTimer),t.clickTimer=null),o.preventDefault(),o.stopPropagation(),ue(y(t),Ht[1],function(h,p){t.emitUserAction(p.e,"switch_fullscreen",{props:"fullscreen",from:u.fullscreen,to:!u.fullscreen}),u.fullscreen?u.exitFullscreen():u.getFullscreen()},{e:o,fullscreen:u.fullscreen})}}),t}return S(r,[{key:"afterCreate",value:function(){var e=this;this._clickCount=0,Ht.map(function(n){e.__hooks[n]=null});var i=this.playerConfig.isMobileSimulateMode;i==="mobile"||O.device==="mobile"&&!O.os.isIpad||this.initEvents()}},{key:"initEvents",value:function(){var e=this,i=this.player,n=i.media,o=i.root,l=this.playerConfig.enableContextmenu;o&&o.addEventListener("click",this.onVideoClick,!1),o&&o.addEventListener("dblclick",this.onVideoDblClick,!1),Object.keys(rt).map(function(u){o.addEventListener(u,e[rt[u]],!1)}),!l&&n&&n.addEventListener("contextmenu",this.onContextmenu,!1)}},{key:"switchPlayPause",value:function(e){var i=this.player;this.emitUserAction(e,"switch_play_pause",{props:"paused",from:i.paused,to:!i.paused}),i.ended?i.duration!==1/0&&i.duration>0&&i.replay():i.paused?i.play():i.pause()}},{key:"onContextmenu",value:function(e){e=e||window.event,e.preventDefault&&e.preventDefault(),e.stopPropagation?e.stopPropagation():(e.returnValue=!1,e.cancelBubble=!0)}},{key:"destroy",value:function(){var e=this,i=this.player,n=i.video,o=i.root;this.clickTimer&&clearTimeout(this.clickTimer),o.removeEventListener("click",this.onVideoClick,!1),o.removeEventListener("dblclick",this.onVideoDblClick,!1),n.removeEventListener("contextmenu",this.onContextmenu,!1),Object.keys(rt).map(function(l){o.removeEventListener(l,e[rt[l]],!1)})}}],[{key:"pluginName",get:function(){return"pc"}},{key:"defaultConfig",get:function(){return{}}}]),r}(de),me={PRESS:"press",PRESS_END:"pressend",DOUBlE_CLICK:"doubleclick",CLICK:"click",TOUCH_MOVE:"touchmove",TOUCH_START:"touchstart",TOUCH_END:"touchend"},ko={start:"touchstart",end:"touchend",move:"touchmove",cancel:"touchcancel"},Co={start:"mousedown",end:"mouseup",move:"mousemove",cancel:"mouseleave"};function zi(a){return a&&a.length>0?a[a.length-1]:null}function Eo(){return{pressDelay:600,dbClickDelay:200,disablePress:!1,disableDbClick:!1,miniStep:2,needPreventDefault:!0}}var wo=function(){function a(s){var r=this,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{eventType:"touch"};T(this,a),k(this,"onTouchStart",function(e){var i=r._pos,n=r.root,o=zi(e.touches);i.x=o?parseInt(o.pageX,10):e.pageX,i.y=o?parseInt(o.pageX,10):e.pageX,i.start=!0,r.__setPress(e),n.addEventListener(r.events.end,r.onTouchEnd),n.addEventListener(r.events.cancel,r.onTouchCancel),n.addEventListener(r.events.move,r.onTouchMove),r.trigger(me.TOUCH_START,e)}),k(this,"onTouchCancel",function(e){r.onTouchEnd(e)}),k(this,"onTouchEnd",function(e){var i=r._pos,n=r.root;r.__clearPress(),n.removeEventListener(r.events.cancel,r.onTouchCancel),n.removeEventListener(r.events.end,r.onTouchEnd),n.removeEventListener(r.events.move,r.onTouchMove),e.moving=i.moving,e.press=i.press,i.press&&r.trigger(me.PRESS_END,e),r.trigger(me.TOUCH_END,e),!i.press&&!i.moving&&r.__setDb(e),i.press=!1,i.start=!1,i.moving=!1}),k(this,"onTouchMove",function(e){var i=r._pos,n=r.config,o=zi(e.touches),l=o?parseInt(o.pageX,10):e.pageX,u=o?parseInt(o.pageY,10):e.pageX,f=l-i.x,h=u-i.y;Math.abs(h)<n.miniStep&&Math.abs(f)<n.miniStep||(r.__clearPress(),i.press&&r.trigger(me.PRESS_END,e),i.press=!1,i.moving=!0,r.trigger(me.TOUCH_MOVE,e))}),this._pos={moving:!1,start:!1,x:0,y:0},this.config=Eo(),Object.keys(t).map(function(e){r.config[e]=t[e]}),this.root=s,this.events=t.eventType==="mouse"?Co:ko,this.pressIntrvalId=null,this.dbIntrvalId=null,this.__handlers={},this._initEvent()}return S(a,[{key:"_initEvent",value:function(){this.root.addEventListener(this.events.start,this.onTouchStart)}},{key:"__setPress",value:function(r){var t=this,e=this.config;this.pressIntrvalId&&this.__clearPress(),this.pressIntrvalId=setTimeout(function(){t.trigger(me.PRESS,r),t._pos.press=!0,t.__clearPress()},e.pressDelay)}},{key:"__clearPress",value:function(){window.clearTimeout(this.pressIntrvalId),this.pressIntrvalId=null}},{key:"__setDb",value:function(r){var t=this,e=this.config;if(this.dbIntrvalId){this.__clearDb(),this.trigger(me.DOUBlE_CLICK,r);return}this.dbIntrvalId=setTimeout(function(){t.__clearDb(),!t._pos.start&&!t._pos.press&&!t._pos.moving&&t.trigger(me.CLICK,r)},e.dbClickDelay)}},{key:"__clearDb",value:function(){clearTimeout(this.dbIntrvalId),this.dbIntrvalId=null}},{key:"on",value:function(r,t){this.__handlers[r]||(this.__handlers[r]=[]),this.__handlers[r].push(t)}},{key:"off",value:function(r,t){if(this.__handlers[r]){for(var e=this.__handlers[r],i=-1,n=0;n<e.length;n++)if(e[n]===t){i=n;break}i>=0&&this.__handlers[r].splice(i,1)}}},{key:"trigger",value:function(r,t){this.__handlers[r]&&this.__handlers[r].map(function(e){try{e(t)}catch(i){console.error("trigger>>:".concat(r),i)}})}},{key:"destroy",value:function(){var r=this,t={touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart"};Object.keys(t).forEach(function(e){r.root.removeEventListener(e,r[t[e]])})}}]),a}();function bo(){return new DOMParser().parseFromString(`<svg width="20" height="9" viewBox="0 0 8 9" fill="none" xmlns="http://www.w3.org/2000/svg"
43
43
  xmlns:xlink="http://www.w3.org/1999/xlink">
44
44
  <path opacity="0.54"
45
45
  d="M7.5 3.63397C8.16667 4.01887 8.16667 4.98113 7.5 5.36603L1.5 8.83013C0.833334 9.21503 0 8.7339 0 7.9641L0 1.0359C0 0.266098 0.833333 -0.215027 1.5 0.169873L7.5 3.63397Z"
46
46
  fill="white" />
47
47
  <path transform="translate(5 0)" d="M7.5 3.63397C8.16667 4.01887 8.16667 4.98113 7.5 5.36603L1.5 8.83013C0.833334 9.21503 0 8.7339 0 7.9641L0 1.0359C0 0.266098 0.833333 -0.215027 1.5 0.169873L7.5 3.63397Z" fill="white"/>
48
- </svg>`,"image/svg+xml").firstChild}var Le={AUTO:"auto",SEEKING:"seeking",PLAYBACK:"playbackrate",LIGHT:""},Ut=["videoClick","videoDbClick"],To=function(a){I(r,a);var s=P(r);function r(t){var e;return T(this,r),e=s.call(this,t),k(y(e),"onTouchStart",function(i){var n=y(e),o=n.player,l=n.config,u=n.pos,f=n.playerConfig,h=e.getTouche(i);if(h&&!l.disableGesture&&e.duration>0&&!o.ended){u.isStart=!0,e.timer&&clearTimeout(e.timer),d.checkIsFunction(f.disableSwipeHandler)&&f.disableSwipeHandler(),e.find(".xg-dur").innerHTML=d.format(e.duration);var g=e.root.getBoundingClientRect();o.rotateDeg===90?(u.top=g.left,u.left=g.top,u.width=g.height,u.height=g.width):(u.top=g.top,u.left=g.left,u.width=g.width,u.height=g.height);var v=parseInt(h.pageX-u.left,10),p=parseInt(h.pageY-u.top,10);u.x=o.rotateDeg===90?p:v,u.y=o.rotateDeg===90?v:p,u.scopeL=l.scopeL*u.width,u.scopeR=(1-l.scopeR)*u.width,u.scopeM1=u.width*(1-l.scopeM)/2,u.scopeM2=u.width-u.scopeM1}}),k(y(e),"onTouchMove",function(i){var n=e.getTouche(i),o=y(e),l=o.pos,u=o.config,f=o.player;if(!(!n||u.disableGesture||!e.duration||!l.isStart)){var h=u.miniMoveStep,g=u.hideControlsActive,v=parseInt(n.pageX-l.left,10),p=parseInt(n.pageY-l.top,10),m=f.rotateDeg===90?p:v,_=f.rotateDeg===90?v:p;if(Math.abs(m-l.x)>h||Math.abs(_-l.y)>h){var C=m-l.x,w=_-l.y,E=l.scope;if(E===-1&&(E=e.checkScope(m,_,C,w,l),E===0&&(g?f.blur():f.focus({autoHide:!1}),!l.time&&(l.time=parseInt(f.currentTime*1e3,10)+e.timeOffset*1e3)),l.scope=E),E===-1||E>0&&!u.gestureY||E===0&&!u.gestureX)return;e.executeMove(C,w,E,l.width,l.height),l.x=m,l.y=_}}}),k(y(e),"onTouchEnd",function(i){var n=y(e),o=n.player,l=n.pos,u=n.playerConfig;if(setTimeout(function(){o.getPlugin("progress")&&o.getPlugin("progress").resetSeekState()},10),!!l.isStart){l.scope>-1&&i.cancelable&&i.preventDefault();var f=e.config,h=f.disableGesture,g=f.gestureX;!h&&g?e.endLastMove(l.scope):l.time=0,l.scope=-1,e.resetPos(),d.checkIsFunction(u.enableSwipeHandler)&&u.enableSwipeHandler(),e.changeAction(Le.AUTO)}}),k(y(e),"onRootTouchMove",function(i){e.config.disableGesture||!e.config.gestureX||e.checkIsRootTarget(i)&&(i.stopPropagation(),e.pos.isStart?e.onTouchMove(i):e.onTouchStart(i))}),k(y(e),"onRootTouchEnd",function(i){e.pos.scope>-1&&e.onTouchEnd(i)}),e.pos={isStart:!1,x:0,y:0,time:0,volume:0,rate:1,light:0,width:0,height:0,scopeL:0,scopeR:0,scopeM1:0,scopeM2:0,scope:-1},e.timer=null,e}return S(r,[{key:"duration",get:function(){return this.playerConfig.customDuration||this.player.duration}},{key:"timeOffset",get:function(){return this.playerConfig.timeOffset||0}},{key:"registerIcons",value:function(){return{seekTipIcon:{icon:wo,class:"xg-seek-pre"}}}},{key:"afterCreate",value:function(){var e=this;Ut.map(function(g){e.__hooks[g]=null});var i=this.playerConfig,n=this.config,o=this.player;i.closeVideoDblclick===!0&&(n.closedbClick=!0),this.resetPos(),d.isUndefined(i.disableGesture)||(n.disableGesture=!!i.disableGesture),this.appendChild(".xg-seek-icon",this.icons.seekTipIcon),this.xgMask=d.createDom("xg-mask","",{},"xgmask"),o.root.appendChild(this.xgMask),this.initCustomStyle(),this.registerThumbnail();var l=this.domEventType==="mouse"?"mouse":"touch";this.touch=new bo(this.root,{eventType:l,needPreventDefault:!this.config.disableGesture}),this.root.addEventListener("contextmenu",function(g){g.preventDefault()}),o.root.addEventListener("touchmove",this.onRootTouchMove,!0),o.root.addEventListener("touchend",this.onRootTouchEnd,!0),o.root.addEventListener("touchcancel",this.onRootTouchEnd,!0);var u=this.player.controls;u&&u.center&&(u.center.addEventListener("touchmove",this.onRootTouchMove,!0),u.center.addEventListener("touchend",this.onRootTouchEnd,!0),u.center.addEventListener("touchcancel",this.onRootTouchEnd,!0)),this.on(fe,function(){var g=e.player,v=e.config;g.duration*1e3<v.moveDuration&&(v.moveDuration=g.duration*1e3)}),this.on([se,ye],function(){var g=e.pos,v=g.time,p=g.isStart;!p&&v>0&&(e.pos.time=0)});var f={touchstart:"onTouchStart",touchmove:"onTouchMove",touchend:"onTouchEnd",press:"onPress",pressend:"onPressEnd",click:"onClick",doubleclick:"onDbClick"};if(Object.keys(f).map(function(g){e.touch.on(g,function(v){e[f[g]](v)})}),!n.disableActive){var h=o.plugins.progress;h&&(h.addCallBack("dragmove",function(g){e.activeSeekNote(g.currentTime,g.forward)}),["dragend","click"].forEach(function(g){h.addCallBack(g,function(){e.changeAction(Le.AUTO)})}))}}},{key:"registerThumbnail",value:function(){var e=this.player,i=e.plugins.thumbnail;if(i&&i.usable){this.thumbnail=i.createThumbnail(null,"mobile-thumbnail");var n=this.find(".time-preview");n.insertBefore(this.thumbnail,n.children[0])}}},{key:"initCustomStyle",value:function(){var e=this.playerConfig||{},i=e.commonStyle,n=i.playedColor,o=i.progressColor,l=i.timePreviewStyle,u=i.curTimeColor,f=i.durationColor;if(n&&(this.find(".xg-curbar").style.backgroundColor=n),o&&(this.find(".xg-bar").style.backgroundColor=o),l){var h=this.find(".time-preview");Object.keys(l).forEach(function(p){h.style[p]=l[p]})}var g=u||n,v=f;g&&(this.find(".xg-cur").style.color=g),v&&(this.find(".xg-dur").style.color=v),this.config.disableTimeProgress&&d.addClass(this.find(".xg-timebar"),"hide")}},{key:"resetPos",value:function(){var e=this;this.pos?(this.pos.isStart=!1,this.pos.scope=-1,["x","y","width","height","scopeL","scopeR","scopeM1","scopeM2"].map(function(i){e.pos[i]=0})):this.pos={isStart:!1,x:0,y:0,volume:0,rate:1,light:0,width:0,height:0,scopeL:0,scopeR:0,scopeM1:0,scopeM2:0,scope:-1,time:0}}},{key:"changeAction",value:function(e){var i=this.player,n=this.root;n.setAttribute("data-xg-action",e);var o=i.plugins.start;o&&o.recover()}},{key:"getTouche",value:function(e){var i=this.player.rotateDeg,n=e.touches&&e.touches.length>0?e.touches[e.touches.length-1]:e;return i===0?{pageX:n.pageX,pageY:n.pageY}:{pageX:n.pageX,pageY:n.pageY}}},{key:"checkScope",value:function(e,i,n,o,l){var u=l.width,f=-1;if(e<0||e>u)return f;var h=Math.abs(o===0?n:n/o);return Math.abs(n)>0&&h>=1.73&&e>l.scopeM1&&e<l.scopeM2?f=0:(Math.abs(n)===0||h<=.57)&&(f=e<l.scopeL?1:e>l.scopeR?2:3),f}},{key:"executeMove",value:function(e,i,n,o,l){switch(n){case 0:this.updateTime(e/o*this.config.scopeM);break;case 1:this.updateBrightness(i/l);break;case 2:O.os.isIos||this.updateVolume(i/l);break}}},{key:"endLastMove",value:function(e){var i=this,n=this.pos,o=this.player,l=this.config,u=(n.time-this.timeOffset)/1e3;switch(e){case 0:o.seek(Number(u).toFixed(1)),l.hideControlsEnd?o.blur():o.focus(),this.timer=setTimeout(function(){i.pos.time=0},500);break}this.changeAction(Le.AUTO)}},{key:"checkIsRootTarget",value:function(e){var i=this.player.plugins||{};return i.progress&&i.progress.root.contains(e.target)?!1:i.start&&i.start.root.contains(e.target)||i.controls&&i.controls.root.contains(e.target)}},{key:"sendUseAction",value:function(e){var i=this.player.paused;this.emitUserAction(e,"switch_play_pause",{prop:"paused",from:i,to:!i})}},{key:"clickHandler",value:function(e){var i=this.player,n=this.config,o=this.playerConfig;if(i.state<M.RUNNING){o.closeVideoClick||(this.sendUseAction(d.createEvent("click")),i.play());return}!n.closedbClick||o.closeVideoClick?i.isActive?i.blur():i.focus():o.closeVideoClick||((i.isActive||n.focusVideoClick)&&(this.sendUseAction(d.createEvent("click")),this.switchPlayPause()),i.focus())}},{key:"dbClickHandler",value:function(e){var i=this.config,n=this.player;!i.closedbClick&&n.state>=M.RUNNING&&(this.sendUseAction(d.createEvent("dblclick")),this.switchPlayPause())}},{key:"onClick",value:function(e){var i=this,n=this.player;ue(this,Ut[0],function(o,l){i.clickHandler(l.e)},{e,paused:n.paused})}},{key:"onDbClick",value:function(e){var i=this,n=this.player;ue(this,Ut[1],function(o,l){i.dbClickHandler(l.e)},{e,paused:n.paused})}},{key:"onPress",value:function(e){var i=this.pos,n=this.config,o=this.player;n.disablePress||(i.rate=this.player.playbackRate,this.emitUserAction("press","change_rate",{prop:"playbackRate",from:o.playbackRate,to:n.pressRate}),o.playbackRate=n.pressRate,this.changeAction(Le.PLAYBACK))}},{key:"onPressEnd",value:function(e){var i=this.pos,n=this.config,o=this.player;n.disablePress||(this.emitUserAction("pressend","change_rate",{prop:"playbackRate",from:o.playbackRate,to:i.rate}),o.playbackRate=i.rate,i.rate=1,this.changeAction(Le.AUTO))}},{key:"updateTime",value:function(e){var i=this.player,n=this.config,o=this.player.duration;e=Number(e.toFixed(4));var l=parseInt(e*n.moveDuration,10)+this.timeOffset;l+=this.pos.time,l=l<0?0:l>o*1e3?o*1e3-200:l,i.getPlugin("time")&&i.getPlugin("time").updateTime(l/1e3),i.getPlugin("progress")&&i.getPlugin("progress").updatePercent(l/1e3/this.duration,!0),this.activeSeekNote(l/1e3,e>0),n.isTouchingSeek&&i.seek(Number((l-this.timeOffset)/1e3).toFixed(1)),this.pos.time=l}},{key:"updateVolume",value:function(e){this.player.rotateDeg&&(e=-e);var i=this.player,n=this.pos;if(e=parseInt(e*100,10),n.volume+=e,!(Math.abs(n.volume)<10)){var o=parseInt(i.volume*10,10)-parseInt(n.volume/10,10);o=o>10?10:o<1?0:o,i.volume=o/10,n.volume=0}}},{key:"updateBrightness",value:function(e){this.player.rotateDeg&&(e=-e);var i=this.pos,n=this.config,o=this.xgMask,l=i.light+.8*e;l=l>n.maxDarkness?n.maxDarkness:l<0?0:l,o&&(o.style.backgroundColor="rgba(0,0,0,".concat(l,")")),i.light=l}},{key:"activeSeekNote",value:function(e){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=this.player,o=this.config,l=!(this.duration!==1/0&&this.duration>0);if(!(!e||typeof e!="number"||l||o.disableActive)){e<0?e=0:e>n.duration&&(e=n.duration-.2),this.changeAction(Le.SEEKING);var u=n.plugins.start;u&&u.focusHide(),this.find(".xg-dur").innerHTML=d.format(this.duration),this.find(".xg-cur").innerHTML=d.format(e),this.find(".xg-curbar").style.width="".concat(e/this.duration*100,"%"),i?d.removeClass(this.find(".xg-seek-show"),"xg-back"):d.addClass(this.find(".xg-seek-show"),"xg-back"),this.updateThumbnails(e)}}},{key:"updateThumbnails",value:function(e){var i=this.player,n=i.plugins.thumbnail;n&&n.usable&&this.thumbnail&&n.update(this.thumbnail,e,160,90)}},{key:"switchPlayPause",value:function(){var e=this.player;if(e.state<M.ATTACHED)return!1;e.ended||(e.paused?e.play():e.pause())}},{key:"disableGesture",value:function(){this.config.disableGesture=!1}},{key:"enableGesture",value:function(){this.config.disableGesture=!0}},{key:"destroy",value:function(){var e=this.player;this.timer&&clearTimeout(this.timer),this.thumbnail=null,e.root.removeChild(this.xgMask),this.xgMask=null,this.touch&&this.touch.destroy(),this.touch=null,e.root.removeEventListener("touchmove",this.onRootTouchMove,!0),e.root.removeEventListener("touchend",this.onRootTouchEnd,!0),e.root.removeEventListener("touchcancel",this.onRootTouchEnd,!0);var i=this.player.controls;i&&i.center&&(i.center.removeEventListener("touchmove",this.onRootTouchMove,!0),i.center.removeEventListener("touchend",this.onRootTouchEnd,!0),i.center.removeEventListener("touchcancel",this.onRootTouchEnd,!0))}},{key:"render",value:function(){var e=this.config.gradient!=="normal"?"gradient ".concat(this.config.gradient):"gradient";return`
48
+ </svg>`,"image/svg+xml").firstChild}var Le={AUTO:"auto",SEEKING:"seeking",PLAYBACK:"playbackrate",LIGHT:""},Ut=["videoClick","videoDbClick"],To=function(a){I(r,a);var s=P(r);function r(t){var e;return T(this,r),e=s.call(this,t),k(y(e),"onTouchStart",function(i){var n=y(e),o=n.player,l=n.config,u=n.pos,f=n.playerConfig,h=e.getTouche(i);if(h&&!l.disableGesture&&e.duration>0&&!o.ended){u.isStart=!0,e.timer&&clearTimeout(e.timer),d.checkIsFunction(f.disableSwipeHandler)&&f.disableSwipeHandler(),e.find(".xg-dur").innerHTML=d.format(e.duration);var p=e.root.getBoundingClientRect();o.rotateDeg===90?(u.top=p.left,u.left=p.top,u.width=p.height,u.height=p.width):(u.top=p.top,u.left=p.left,u.width=p.width,u.height=p.height);var v=parseInt(h.pageX-u.left,10),g=parseInt(h.pageY-u.top,10);u.x=o.rotateDeg===90?g:v,u.y=o.rotateDeg===90?v:g,u.scopeL=l.scopeL*u.width,u.scopeR=(1-l.scopeR)*u.width,u.scopeM1=u.width*(1-l.scopeM)/2,u.scopeM2=u.width-u.scopeM1}}),k(y(e),"onTouchMove",function(i){var n=e.getTouche(i),o=y(e),l=o.pos,u=o.config,f=o.player;if(!(!n||u.disableGesture||!e.duration||!l.isStart)){var h=u.miniMoveStep,p=u.hideControlsActive,v=parseInt(n.pageX-l.left,10),g=parseInt(n.pageY-l.top,10),m=f.rotateDeg===90?g:v,_=f.rotateDeg===90?v:g;if(Math.abs(m-l.x)>h||Math.abs(_-l.y)>h){var C=m-l.x,b=_-l.y,E=l.scope;if(E===-1&&(E=e.checkScope(m,_,C,b,l),E===0&&(p?f.blur():f.focus({autoHide:!1}),!l.time&&(l.time=parseInt(f.currentTime*1e3,10)+e.timeOffset*1e3)),l.scope=E),E===-1||E>0&&!u.gestureY||E===0&&!u.gestureX)return;e.executeMove(C,b,E,l.width,l.height),l.x=m,l.y=_}}}),k(y(e),"onTouchEnd",function(i){var n=y(e),o=n.player,l=n.pos,u=n.playerConfig;if(setTimeout(function(){o.getPlugin("progress")&&o.getPlugin("progress").resetSeekState()},10),!!l.isStart){l.scope>-1&&i.cancelable&&i.preventDefault();var f=e.config,h=f.disableGesture,p=f.gestureX;!h&&p?e.endLastMove(l.scope):l.time=0,l.scope=-1,e.resetPos(),d.checkIsFunction(u.enableSwipeHandler)&&u.enableSwipeHandler(),e.changeAction(Le.AUTO)}}),k(y(e),"onRootTouchMove",function(i){e.config.disableGesture||!e.config.gestureX||e.checkIsRootTarget(i)&&(i.stopPropagation(),e.pos.isStart?e.onTouchMove(i):e.onTouchStart(i))}),k(y(e),"onRootTouchEnd",function(i){e.pos.scope>-1&&e.onTouchEnd(i)}),e.pos={isStart:!1,x:0,y:0,time:0,volume:0,rate:1,light:0,width:0,height:0,scopeL:0,scopeR:0,scopeM1:0,scopeM2:0,scope:-1},e.timer=null,e}return S(r,[{key:"duration",get:function(){return this.playerConfig.customDuration||this.player.duration}},{key:"timeOffset",get:function(){return this.playerConfig.timeOffset||0}},{key:"registerIcons",value:function(){return{seekTipIcon:{icon:bo,class:"xg-seek-pre"}}}},{key:"afterCreate",value:function(){var e=this;Ut.map(function(p){e.__hooks[p]=null});var i=this.playerConfig,n=this.config,o=this.player;i.closeVideoDblclick===!0&&(n.closedbClick=!0),this.resetPos(),d.isUndefined(i.disableGesture)||(n.disableGesture=!!i.disableGesture),this.appendChild(".xg-seek-icon",this.icons.seekTipIcon),this.xgMask=d.createDom("xg-mask","",{},"xgmask"),o.root.appendChild(this.xgMask),this.initCustomStyle(),this.registerThumbnail();var l=this.domEventType==="mouse"?"mouse":"touch";this.touch=new wo(this.root,{eventType:l,needPreventDefault:!this.config.disableGesture}),this.root.addEventListener("contextmenu",function(p){p.preventDefault()}),o.root.addEventListener("touchmove",this.onRootTouchMove,!0),o.root.addEventListener("touchend",this.onRootTouchEnd,!0),o.root.addEventListener("touchcancel",this.onRootTouchEnd,!0);var u=this.player.controls;u&&u.center&&(u.center.addEventListener("touchmove",this.onRootTouchMove,!0),u.center.addEventListener("touchend",this.onRootTouchEnd,!0),u.center.addEventListener("touchcancel",this.onRootTouchEnd,!0)),this.on(fe,function(){var p=e.player,v=e.config;p.duration*1e3<v.moveDuration&&(v.moveDuration=p.duration*1e3)}),this.on([se,ye],function(){var p=e.pos,v=p.time,g=p.isStart;!g&&v>0&&(e.pos.time=0)});var f={touchstart:"onTouchStart",touchmove:"onTouchMove",touchend:"onTouchEnd",press:"onPress",pressend:"onPressEnd",click:"onClick",doubleclick:"onDbClick"};if(Object.keys(f).map(function(p){e.touch.on(p,function(v){e[f[p]](v)})}),!n.disableActive){var h=o.plugins.progress;h&&(h.addCallBack("dragmove",function(p){e.activeSeekNote(p.currentTime,p.forward)}),["dragend","click"].forEach(function(p){h.addCallBack(p,function(){e.changeAction(Le.AUTO)})}))}}},{key:"registerThumbnail",value:function(){var e=this.player,i=e.plugins.thumbnail;if(i&&i.usable){this.thumbnail=i.createThumbnail(null,"mobile-thumbnail");var n=this.find(".time-preview");n.insertBefore(this.thumbnail,n.children[0])}}},{key:"initCustomStyle",value:function(){var e=this.playerConfig||{},i=e.commonStyle,n=i.playedColor,o=i.progressColor,l=i.timePreviewStyle,u=i.curTimeColor,f=i.durationColor;if(n&&(this.find(".xg-curbar").style.backgroundColor=n),o&&(this.find(".xg-bar").style.backgroundColor=o),l){var h=this.find(".time-preview");Object.keys(l).forEach(function(g){h.style[g]=l[g]})}var p=u||n,v=f;p&&(this.find(".xg-cur").style.color=p),v&&(this.find(".xg-dur").style.color=v),this.config.disableTimeProgress&&d.addClass(this.find(".xg-timebar"),"hide")}},{key:"resetPos",value:function(){var e=this;this.pos?(this.pos.isStart=!1,this.pos.scope=-1,["x","y","width","height","scopeL","scopeR","scopeM1","scopeM2"].map(function(i){e.pos[i]=0})):this.pos={isStart:!1,x:0,y:0,volume:0,rate:1,light:0,width:0,height:0,scopeL:0,scopeR:0,scopeM1:0,scopeM2:0,scope:-1,time:0}}},{key:"changeAction",value:function(e){var i=this.player,n=this.root;n.setAttribute("data-xg-action",e);var o=i.plugins.start;o&&o.recover()}},{key:"getTouche",value:function(e){var i=this.player.rotateDeg,n=e.touches&&e.touches.length>0?e.touches[e.touches.length-1]:e;return i===0?{pageX:n.pageX,pageY:n.pageY}:{pageX:n.pageX,pageY:n.pageY}}},{key:"checkScope",value:function(e,i,n,o,l){var u=l.width,f=-1;if(e<0||e>u)return f;var h=Math.abs(o===0?n:n/o);return Math.abs(n)>0&&h>=1.73&&e>l.scopeM1&&e<l.scopeM2?f=0:(Math.abs(n)===0||h<=.57)&&(f=e<l.scopeL?1:e>l.scopeR?2:3),f}},{key:"executeMove",value:function(e,i,n,o,l){switch(n){case 0:this.updateTime(e/o*this.config.scopeM);break;case 1:this.updateBrightness(i/l);break;case 2:O.os.isIos||this.updateVolume(i/l);break}}},{key:"endLastMove",value:function(e){var i=this,n=this.pos,o=this.player,l=this.config,u=(n.time-this.timeOffset)/1e3;switch(e){case 0:o.seek(Number(u).toFixed(1)),l.hideControlsEnd?o.blur():o.focus(),this.timer=setTimeout(function(){i.pos.time=0},500);break}this.changeAction(Le.AUTO)}},{key:"checkIsRootTarget",value:function(e){var i=this.player.plugins||{};return i.progress&&i.progress.root.contains(e.target)?!1:i.start&&i.start.root.contains(e.target)||i.controls&&i.controls.root.contains(e.target)}},{key:"sendUseAction",value:function(e){var i=this.player.paused;this.emitUserAction(e,"switch_play_pause",{prop:"paused",from:i,to:!i})}},{key:"clickHandler",value:function(e){var i=this.player,n=this.config,o=this.playerConfig;if(i.state<M.RUNNING){o.closeVideoClick||(this.sendUseAction(d.createEvent("click")),i.play());return}!n.closedbClick||o.closeVideoClick?i.isActive?i.blur():i.focus():o.closeVideoClick||((i.isActive||n.focusVideoClick)&&(this.sendUseAction(d.createEvent("click")),this.switchPlayPause()),i.focus())}},{key:"dbClickHandler",value:function(e){var i=this.config,n=this.player;!i.closedbClick&&n.state>=M.RUNNING&&(this.sendUseAction(d.createEvent("dblclick")),this.switchPlayPause())}},{key:"onClick",value:function(e){var i=this,n=this.player;ue(this,Ut[0],function(o,l){i.clickHandler(l.e)},{e,paused:n.paused})}},{key:"onDbClick",value:function(e){var i=this,n=this.player;ue(this,Ut[1],function(o,l){i.dbClickHandler(l.e)},{e,paused:n.paused})}},{key:"onPress",value:function(e){var i=this.pos,n=this.config,o=this.player;n.disablePress||(i.rate=this.player.playbackRate,this.emitUserAction("press","change_rate",{prop:"playbackRate",from:o.playbackRate,to:n.pressRate}),o.playbackRate=n.pressRate,this.changeAction(Le.PLAYBACK))}},{key:"onPressEnd",value:function(e){var i=this.pos,n=this.config,o=this.player;n.disablePress||(this.emitUserAction("pressend","change_rate",{prop:"playbackRate",from:o.playbackRate,to:i.rate}),o.playbackRate=i.rate,i.rate=1,this.changeAction(Le.AUTO))}},{key:"updateTime",value:function(e){var i=this.player,n=this.config,o=this.player.duration;e=Number(e.toFixed(4));var l=parseInt(e*n.moveDuration,10)+this.timeOffset;l+=this.pos.time,l=l<0?0:l>o*1e3?o*1e3-200:l,i.getPlugin("time")&&i.getPlugin("time").updateTime(l/1e3),i.getPlugin("progress")&&i.getPlugin("progress").updatePercent(l/1e3/this.duration,!0),this.activeSeekNote(l/1e3,e>0),n.isTouchingSeek&&i.seek(Number((l-this.timeOffset)/1e3).toFixed(1)),this.pos.time=l}},{key:"updateVolume",value:function(e){this.player.rotateDeg&&(e=-e);var i=this.player,n=this.pos;if(e=parseInt(e*100,10),n.volume+=e,!(Math.abs(n.volume)<10)){var o=parseInt(i.volume*10,10)-parseInt(n.volume/10,10);o=o>10?10:o<1?0:o,i.volume=o/10,n.volume=0}}},{key:"updateBrightness",value:function(e){this.player.rotateDeg&&(e=-e);var i=this.pos,n=this.config,o=this.xgMask,l=i.light+.8*e;l=l>n.maxDarkness?n.maxDarkness:l<0?0:l,o&&(o.style.backgroundColor="rgba(0,0,0,".concat(l,")")),i.light=l}},{key:"activeSeekNote",value:function(e){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=this.player,o=this.config,l=!(this.duration!==1/0&&this.duration>0);if(!(!e||typeof e!="number"||l||o.disableActive)){e<0?e=0:e>n.duration&&(e=n.duration-.2),this.changeAction(Le.SEEKING);var u=n.plugins.start;u&&u.focusHide(),this.find(".xg-dur").innerHTML=d.format(this.duration),this.find(".xg-cur").innerHTML=d.format(e),this.find(".xg-curbar").style.width="".concat(e/this.duration*100,"%"),i?d.removeClass(this.find(".xg-seek-show"),"xg-back"):d.addClass(this.find(".xg-seek-show"),"xg-back"),this.updateThumbnails(e)}}},{key:"updateThumbnails",value:function(e){var i=this.player,n=i.plugins.thumbnail;n&&n.usable&&this.thumbnail&&n.update(this.thumbnail,e,160,90)}},{key:"switchPlayPause",value:function(){var e=this.player;if(e.state<M.ATTACHED)return!1;e.ended||(e.paused?e.play():e.pause())}},{key:"disableGesture",value:function(){this.config.disableGesture=!1}},{key:"enableGesture",value:function(){this.config.disableGesture=!0}},{key:"destroy",value:function(){var e=this.player;this.timer&&clearTimeout(this.timer),this.thumbnail=null,e.root.removeChild(this.xgMask),this.xgMask=null,this.touch&&this.touch.destroy(),this.touch=null,e.root.removeEventListener("touchmove",this.onRootTouchMove,!0),e.root.removeEventListener("touchend",this.onRootTouchEnd,!0),e.root.removeEventListener("touchcancel",this.onRootTouchEnd,!0);var i=this.player.controls;i&&i.center&&(i.center.removeEventListener("touchmove",this.onRootTouchMove,!0),i.center.removeEventListener("touchend",this.onRootTouchEnd,!0),i.center.removeEventListener("touchcancel",this.onRootTouchEnd,!0))}},{key:"render",value:function(){var e=this.config.gradient!=="normal"?"gradient ".concat(this.config.gradient):"gradient";return`
49
49
  <xg-trigger class="trigger">
50
50
  <div class="`.concat(e,`"></div>
51
51
  <div class="time-preview">
@@ -63,13 +63,13 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
63
63
  <span><i>`).concat(this.config.pressRate,"X</i>").concat(this.i18n.FORWARD,`</span>
64
64
  </div>
65
65
  </xg-trigger>
66
- `)}}],[{key:"pluginName",get:function(){return"mobile"}},{key:"defaultConfig",get:function(){return{index:0,disableGesture:!1,gestureX:!0,gestureY:!0,gradient:"normal",isTouchingSeek:!1,miniMoveStep:5,miniYPer:5,scopeL:.25,scopeR:.25,scopeM:.9,pressRate:2,darkness:!0,maxDarkness:.8,disableActive:!1,disableTimeProgress:!1,hideControlsActive:!1,hideControlsEnd:!1,moveDuration:60*6*1e3,closedbClick:!1,disablePress:!0,disableSeekIcon:!1,focusVideoClick:!1}}}]),r}(B);function So(a){a.preventDefault(),a.returnValue=!1}function ji(a){var s=a.tagName;return!!(s==="INPUT"||s==="TEXTAREA"||a.isContentEditable)}var $i=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(y(t),"onBodyKeyDown",function(o){if(t.player){var l=o||window.event,u=l.keyCode,f=y(t),h=f._keyState,g=f.player,v=t.config,p=v.disable,m=v.disableBodyTrigger,_=v.isIgnoreUserActive;if(p||m||!(g.isUserActive||_)||ji(l.target)||!t.checkIsVisible()||l.metaKey||l.altKey||l.ctrlKey){h.isBodyKeyDown=!1;return}!o.repeat&&!h.isKeyDown&&((l.target===document.body||t.config.isGlobalTrigger&&!ji(l.target))&&t.checkCode(u,!0)&&(h.isBodyKeyDown=!0),document.addEventListener("keyup",t.onBodyKeyUp)),h.isBodyKeyDown&&t.handleKeyDown(l)}}),k(y(t),"onBodyKeyUp",function(o){t.player&&(document.removeEventListener("keyup",t.onBodyKeyUp),t.handleKeyUp(o))}),k(y(t),"onKeydown",function(o){if(t.player){var l=o||window.event,u=y(t),f=u._keyState;if(!l.repeat){if(t.config.disable||t.config.disableRootTrigger||l.metaKey||l.altKey||l.ctrlKey)return;l&&(l.keyCode===37||t.checkCode(l.keyCode))&&(l.target===t.player.root||l.target===t.player.video||l.target===t.player.controls.el)&&(f.isKeyDown=!0),t.player.root.addEventListener("keyup",t.onKeyup)}f.isKeyDown&&t.handleKeyDown(l)}}),k(y(t),"onKeyup",function(o){t.player&&(t.player.root.removeEventListener("keyup",t.onKeyup),t.handleKeyUp(o))}),t}return S(r,[{key:"mergekeyCodeMap",value:function(){var e=this,i=this.config.keyCodeMap;i&&Object.keys(i).map(function(n){e.keyCodeMap[n]?["keyCode","action","disable","pressAction","disablePress","isBodyTarget"].map(function(o){i[n][o]&&(e.keyCodeMap[n][o]=i[n][o])}):e.keyCodeMap[n]=i[n]})}},{key:"afterCreate",value:function(){this.config.disable=!this.playerConfig.keyShortcut;var e=typeof this.config.seekStep=="function"?this.config.seekStep(this.player):this.config.seekStep;!e||typeof e!="number"||(this.seekStep=e),this.keyCodeMap={space:{keyCode:32,action:"playPause",disable:!1,disablePress:!1,noBodyTarget:!1},up:{keyCode:38,action:"upVolume",disable:!1,disablePress:!1,noBodyTarget:!0},down:{keyCode:40,action:"downVolume",disable:!1,disablePress:!1,noBodyTarget:!0},left:{keyCode:37,action:"seekBack",disablePress:!1,disable:!1},right:{keyCode:39,action:"seek",pressAction:"changePlaybackRate",disablePress:!1,disable:!1},esc:{keyCode:27,action:"exitFullscreen",disablePress:!0,disable:!1}},this.mergekeyCodeMap(),this._keyState={isKeyDown:!1,isBodyKeyDown:!1,isPress:!1,tt:0,playbackRate:0},this.player.root.addEventListener("keydown",this.onKeydown),document.addEventListener("keydown",this.onBodyKeyDown)}},{key:"setConfig",value:function(e){var i=this;Object.keys(e).forEach(function(n){i.config[n]=e[n]})}},{key:"checkIsVisible",value:function(){if(!this.config.checkVisible)return!0;var e=this.player.root.getBoundingClientRect(),i=e.height,n=e.top,o=e.bottom,l=window.innerHeight;return!(n<0&&n<0-i*.9||o>0&&o-l>i*.9)}},{key:"checkCode",value:function(e,i){var n=this,o=!1;return Object.keys(this.keyCodeMap).map(function(l){n.keyCodeMap[l]&&e===n.keyCodeMap[l].keyCode&&!n.keyCodeMap[l].disable&&(o=!i||i&&!n.keyCodeMap[l].noBodyTarget)}),o}},{key:"downVolume",value:function(e){var i=this.player;if(!(i.volume<=0)){var n=parseFloat((i.volume-.1).toFixed(1)),o={volume:{from:i.volume,to:n}};this.emitUserAction(e,"change_volume",{props:o}),n>=0?i.volume=n:i.volume=0}}},{key:"upVolume",value:function(e){var i=this.player;if(!(i.volume>=1)){var n=parseFloat((i.volume+.1).toFixed(1)),o={volume:{from:i.volume,to:n}};this.emitUserAction(e,"change_volume",{props:o}),n<=1?i.volume=n:i.volume=1}}},{key:"seek",value:function(e){var i=this.player,n=i.currentTime,o=i.offsetCurrentTime,l=i.duration,u=i.offsetDuration,f=i.timeSegments,h=o>-1?o:n,g=u||l,v=e.repeat&&this.seekStep>=4?parseInt(this.seekStep/2,10):this.seekStep;h+v<=g?h=h+v:h=g;var p=d.getCurrentTimeByOffset(h,f),m={currentTime:{from:n,to:p}};this.emitUserAction(e,"seek",{props:m}),this.player.currentTime=p}},{key:"seekBack",value:function(e){var i=this.player,n=i.currentTime,o=i.offsetCurrentTime,l=i.timeSegments,u=e.repeat?parseInt(this.seekStep/2,10):this.seekStep,f=o>-1?o:n,h=f-u;h<0&&(h=0),h=d.getCurrentTimeByOffset(h,l);var g={currentTime:{from:n,to:h}};this.emitUserAction(e,"seek",{props:g}),this.player.currentTime=h}},{key:"changePlaybackRate",value:function(e){var i=this._keyState,n=this.config,o=this.player;i.playbackRate===0&&(i.playbackRate=o.playbackRate,o.playbackRate=n.playbackRate)}},{key:"playPause",value:function(e){var i=this.player;i&&(this.emitUserAction(e,"switch_play_pause"),i.paused?i.play():i.pause())}},{key:"exitFullscreen",value:function(e){var i=this.player,n=i.fullscreen,o=i.cssfullscreen;n&&(this.emitUserAction("keyup","switch_fullscreen",{prop:"fullscreen",from:n,to:!n}),i.exitFullscreen()),o&&(this.emitUserAction("keyup","switch_css_fullscreen",{prop:"cssfullscreen",from:o,to:!o}),i.exitCssFullscreen())}},{key:"handleKeyDown",value:function(e){var i=this._keyState;if(e.repeat){i.isPress=!0;var n=Date.now();if(n-i.tt<200)return;i.tt=n}this.handleKeyCode(e.keyCode,e,i.isPress)}},{key:"handleKeyUp",value:function(e){var i=this._keyState;i.playbackRate>0&&(this.player.playbackRate=i.playbackRate,i.playbackRate=0),i.isKeyDown=!1,i.isPress=!1,i.tt=0}},{key:"handleKeyCode",value:function(e,i,n){for(var o=Object.keys(this.keyCodeMap),l=0;l<o.length;l++){var u=this.keyCodeMap[o[l]],f=u.action,h=u.keyCode,g=u.disable,v=u.pressAction,p=u.disablePress;if(h===e){if(!g&&!(n&&p)){var m=n&&v||f;typeof m=="function"?f(i,this.player,n):typeof m=="string"&&typeof this[m]=="function"&&this[m](i,this.player,n),this.emit(di,U({key:o[l],target:i.target,isPress:n},this.keyCodeMap[o[l]]))}So(i),i.stopPropagation();break}}}},{key:"destroy",value:function(){this.player.root.removeEventListener("keydown",this.onKeydown),document.removeEventListener("keydown",this.onBodyKeyDown),this.player.root.removeEventListener("keyup",this.onKeyup),document.removeEventListener("keyup",this.onBodyKeyUp)}},{key:"disable",value:function(){this.config.disable=!0}},{key:"enable",value:function(){this.config.disable=!1}}],[{key:"pluginName",get:function(){return"keyboard"}},{key:"defaultConfig",get:function(){return{seekStep:10,checkVisible:!1,disableBodyTrigger:!1,disableRootTrigger:!1,isGlobalTrigger:!0,keyCodeMap:{},disable:!1,playbackRate:2,isIgnoreUserActive:!0}}}]),r}(de);function xo(){return new DOMParser().parseFromString(`<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="-5 -5 110 110">
66
+ `)}}],[{key:"pluginName",get:function(){return"mobile"}},{key:"defaultConfig",get:function(){return{index:0,disableGesture:!1,gestureX:!0,gestureY:!0,gradient:"normal",isTouchingSeek:!1,miniMoveStep:5,miniYPer:5,scopeL:.25,scopeR:.25,scopeM:.9,pressRate:2,darkness:!0,maxDarkness:.8,disableActive:!1,disableTimeProgress:!1,hideControlsActive:!1,hideControlsEnd:!1,moveDuration:60*6*1e3,closedbClick:!1,disablePress:!0,disableSeekIcon:!1,focusVideoClick:!1}}}]),r}(B);function So(a){a.preventDefault(),a.returnValue=!1}function ji(a){var s=a.tagName;return!!(s==="INPUT"||s==="TEXTAREA"||a.isContentEditable)}var $i=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(y(t),"onBodyKeyDown",function(o){if(t.player){var l=o||window.event,u=l.keyCode,f=y(t),h=f._keyState,p=f.player,v=t.config,g=v.disable,m=v.disableBodyTrigger,_=v.isIgnoreUserActive;if(g||m||!(p.isUserActive||_)||ji(l.target)||!t.checkIsVisible()||l.metaKey||l.altKey||l.ctrlKey){h.isBodyKeyDown=!1;return}!o.repeat&&!h.isKeyDown&&((l.target===document.body||t.config.isGlobalTrigger&&!ji(l.target))&&t.checkCode(u,!0)&&(h.isBodyKeyDown=!0),document.addEventListener("keyup",t.onBodyKeyUp)),h.isBodyKeyDown&&t.handleKeyDown(l)}}),k(y(t),"onBodyKeyUp",function(o){t.player&&(document.removeEventListener("keyup",t.onBodyKeyUp),t.handleKeyUp(o))}),k(y(t),"onKeydown",function(o){if(t.player){var l=o||window.event,u=y(t),f=u._keyState;if(!l.repeat){if(t.config.disable||t.config.disableRootTrigger||l.metaKey||l.altKey||l.ctrlKey)return;l&&(l.keyCode===37||t.checkCode(l.keyCode))&&(l.target===t.player.root||l.target===t.player.video||l.target===t.player.controls.el)&&(f.isKeyDown=!0),t.player.root.addEventListener("keyup",t.onKeyup)}f.isKeyDown&&t.handleKeyDown(l)}}),k(y(t),"onKeyup",function(o){t.player&&(t.player.root.removeEventListener("keyup",t.onKeyup),t.handleKeyUp(o))}),t}return S(r,[{key:"mergekeyCodeMap",value:function(){var e=this,i=this.config.keyCodeMap;i&&Object.keys(i).map(function(n){e.keyCodeMap[n]?["keyCode","action","disable","pressAction","disablePress","isBodyTarget"].map(function(o){i[n][o]&&(e.keyCodeMap[n][o]=i[n][o])}):e.keyCodeMap[n]=i[n]})}},{key:"afterCreate",value:function(){this.config.disable=!this.playerConfig.keyShortcut;var e=typeof this.config.seekStep=="function"?this.config.seekStep(this.player):this.config.seekStep;!e||typeof e!="number"||(this.seekStep=e),this.keyCodeMap={space:{keyCode:32,action:"playPause",disable:!1,disablePress:!1,noBodyTarget:!1},up:{keyCode:38,action:"upVolume",disable:!1,disablePress:!1,noBodyTarget:!0},down:{keyCode:40,action:"downVolume",disable:!1,disablePress:!1,noBodyTarget:!0},left:{keyCode:37,action:"seekBack",disablePress:!1,disable:!1},right:{keyCode:39,action:"seek",pressAction:"changePlaybackRate",disablePress:!1,disable:!1},esc:{keyCode:27,action:"exitFullscreen",disablePress:!0,disable:!1}},this.mergekeyCodeMap(),this._keyState={isKeyDown:!1,isBodyKeyDown:!1,isPress:!1,tt:0,playbackRate:0},this.player.root.addEventListener("keydown",this.onKeydown),document.addEventListener("keydown",this.onBodyKeyDown)}},{key:"setConfig",value:function(e){var i=this;Object.keys(e).forEach(function(n){i.config[n]=e[n]})}},{key:"checkIsVisible",value:function(){if(!this.config.checkVisible)return!0;var e=this.player.root.getBoundingClientRect(),i=e.height,n=e.top,o=e.bottom,l=window.innerHeight;return!(n<0&&n<0-i*.9||o>0&&o-l>i*.9)}},{key:"checkCode",value:function(e,i){var n=this,o=!1;return Object.keys(this.keyCodeMap).map(function(l){n.keyCodeMap[l]&&e===n.keyCodeMap[l].keyCode&&!n.keyCodeMap[l].disable&&(o=!i||i&&!n.keyCodeMap[l].noBodyTarget)}),o}},{key:"downVolume",value:function(e){var i=this.player;if(!(i.volume<=0)){var n=parseFloat((i.volume-.1).toFixed(1)),o={volume:{from:i.volume,to:n}};this.emitUserAction(e,"change_volume",{props:o}),n>=0?i.volume=n:i.volume=0}}},{key:"upVolume",value:function(e){var i=this.player;if(!(i.volume>=1)){var n=parseFloat((i.volume+.1).toFixed(1)),o={volume:{from:i.volume,to:n}};this.emitUserAction(e,"change_volume",{props:o}),n<=1?i.volume=n:i.volume=1}}},{key:"seek",value:function(e){var i=this.player,n=i.currentTime,o=i.offsetCurrentTime,l=i.duration,u=i.offsetDuration,f=i.timeSegments,h=o>-1?o:n,p=u||l,v=e.repeat&&this.seekStep>=4?parseInt(this.seekStep/2,10):this.seekStep;h+v<=p?h=h+v:h=p;var g=d.getCurrentTimeByOffset(h,f),m={currentTime:{from:n,to:g}};this.emitUserAction(e,"seek",{props:m}),this.player.currentTime=g}},{key:"seekBack",value:function(e){var i=this.player,n=i.currentTime,o=i.offsetCurrentTime,l=i.timeSegments,u=e.repeat?parseInt(this.seekStep/2,10):this.seekStep,f=o>-1?o:n,h=f-u;h<0&&(h=0),h=d.getCurrentTimeByOffset(h,l);var p={currentTime:{from:n,to:h}};this.emitUserAction(e,"seek",{props:p}),this.player.currentTime=h}},{key:"changePlaybackRate",value:function(e){var i=this._keyState,n=this.config,o=this.player;i.playbackRate===0&&(i.playbackRate=o.playbackRate,o.playbackRate=n.playbackRate)}},{key:"playPause",value:function(e){var i=this.player;i&&(this.emitUserAction(e,"switch_play_pause"),i.paused?i.play():i.pause())}},{key:"exitFullscreen",value:function(e){var i=this.player,n=i.fullscreen,o=i.cssfullscreen;n&&(this.emitUserAction("keyup","switch_fullscreen",{prop:"fullscreen",from:n,to:!n}),i.exitFullscreen()),o&&(this.emitUserAction("keyup","switch_css_fullscreen",{prop:"cssfullscreen",from:o,to:!o}),i.exitCssFullscreen())}},{key:"handleKeyDown",value:function(e){var i=this._keyState;if(e.repeat){i.isPress=!0;var n=Date.now();if(n-i.tt<200)return;i.tt=n}this.handleKeyCode(e.keyCode,e,i.isPress)}},{key:"handleKeyUp",value:function(e){var i=this._keyState;i.playbackRate>0&&(this.player.playbackRate=i.playbackRate,i.playbackRate=0),i.isKeyDown=!1,i.isPress=!1,i.tt=0}},{key:"handleKeyCode",value:function(e,i,n){for(var o=Object.keys(this.keyCodeMap),l=0;l<o.length;l++){var u=this.keyCodeMap[o[l]],f=u.action,h=u.keyCode,p=u.disable,v=u.pressAction,g=u.disablePress;if(h===e){if(!p&&!(n&&g)){var m=n&&v||f;typeof m=="function"?f(i,this.player,n):typeof m=="string"&&typeof this[m]=="function"&&this[m](i,this.player,n),this.emit(di,U({key:o[l],target:i.target,isPress:n},this.keyCodeMap[o[l]]))}So(i),i.stopPropagation();break}}}},{key:"destroy",value:function(){this.player.root.removeEventListener("keydown",this.onKeydown),document.removeEventListener("keydown",this.onBodyKeyDown),this.player.root.removeEventListener("keyup",this.onKeyup),document.removeEventListener("keyup",this.onBodyKeyUp)}},{key:"disable",value:function(){this.config.disable=!0}},{key:"enable",value:function(){this.config.disable=!1}}],[{key:"pluginName",get:function(){return"keyboard"}},{key:"defaultConfig",get:function(){return{seekStep:10,checkVisible:!1,disableBodyTrigger:!1,disableRootTrigger:!1,isGlobalTrigger:!0,keyCodeMap:{},disable:!1,playbackRate:2,isIgnoreUserActive:!0}}}]),r}(de);function xo(){return new DOMParser().parseFromString(`<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="-5 -5 110 110">
67
67
  <path d="M100,50A50,50,0,1,1,50,0" stroke-width="5" stroke="#ddd" stroke-dasharray="236" fill="none"></path>
68
68
  </svg>
69
69
  `,"image/svg+xml").firstChild}var Io=function(a){I(r,a);var s=P(r);function r(){return T(this,r),s.apply(this,arguments)}return S(r,[{key:"registerIcons",value:function(){return{loadingIcon:xo}}},{key:"afterCreate",value:function(){this.appendChild("xg-loading-inner",this.icons.loadingIcon)}},{key:"render",value:function(){return`
70
70
  <xg-loading class="xgplayer-loading">
71
71
  <xg-loading-inner></xg-loading-inner>
72
- </xg-loading>`}}],[{key:"pluginName",get:function(){return"loading"}},{key:"defaultConfig",get:function(){return{position:V.ROOT}}}]),r}(B),Po=[{tag:"xg-cache",className:"xgplayer-progress-cache",styleKey:"cachedColor"},{tag:"xg-played",className:"xgplayer-progress-played",styleKey:"playedColor"}],Ao=function(){function a(s){T(this,a),this.fragments=s.fragments||[],this.fragments.length===0&&this.fragments.push({percent:1}),this._callBack=s.actionCallback,this.fragConfig={fragFocusClass:s.fragFocusClass||"inner-focus-point",fragAutoFocus:!!s.fragAutoFocus,fragClass:s.fragClass||""},this.style=s.style||{playedColor:"",cachedColor:"",progressColor:""},this.duration=0,this.cachedIndex=0,this.playedIndex=0,this.focusIndex=-1}return S(a,[{key:"updateDuration",value:function(r){var t=this;this.duration=r;var e=0,i=this.fragments;this.fragments=i.map(function(n){return n.start=parseInt(e,10),n.end=parseInt(e+n.percent*t.duration,10),n.duration=parseInt(n.percent*t.duration,10),e+=n.percent*t.duration,n})}},{key:"updateProgress",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"played",t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{newIndex:0,curIndex:0,millisecond:0},e=this.progressList,i=this.fragments;if(!(e.length<1)){var n=t.newIndex,o=t.curIndex,l=t.millisecond;n!==o&&e.map(function(h,g){g<n?h[r].style.width="100%":g>n&&(h[r].style.width=0)});var u=i[n],f=l===0?0:(l-u.start)/u.duration;e[n][r].style.width=f<0?0:"".concat(f*100,"%")}}},{key:"updateFocus",value:function(r){if(!(!this.fragConfig.fragAutoFocus||this.fragments.length<2)){if(!r){if(this.focusIndex>-1){this.unHightLight(this.focusIndex);var t={index:-1,preIndex:this.focusIndex,fragment:null};this._callBack&&this._callBack(t),this.focusIndex=-1}return}var e=this.findIndex(r.currentTime*1e3,this.focusIndex);if(e>=0&&e!==this.focusIndex){this.focusIndex>-1&&this.unHightLight(this.focusIndex),this.setHightLight(e);var i={index:e,preIndex:this.focusIndex,fragment:this.fragments[this.focusIndex]};this.focusIndex=e,this._callBack&&this._callBack(i)}}}},{key:"update",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{cached:0,played:0},t=arguments.length>1?arguments[1]:void 0;if(!this.duration||parseInt(t*1e3,10)!==this.duration){if(!t&&t!==0)return;this.updateDuration(parseInt(t*1e3,10))}var e=this.playedIndex,i=this.cachedIndex;if(d.typeOf(r.played)!=="Undefined"){var n=this.findIndex(r.played*1e3,e);if(n<0)return;this.updateProgress("played",{newIndex:n,curIndex:e,millisecond:parseInt(r.played*1e3,10)}),this.playedIndex=n}if(d.typeOf(r.cached)!=="Undefined"){var o=this.findIndex(r.cached*1e3,i);if(o<0)return;this.updateProgress("cached",{newIndex:o,curIndex:i,millisecond:parseInt(r.cached*1e3,10)}),this.cachedIndex=o}}},{key:"findIndex",value:function(r,t){var e=this.fragments;if(!e||e.length===0)return-1;if(e.length===1)return 0;if(t>-1&&t<e.length&&r>e[t].start&&r<e[t].end)return t;if(r>e[e.length-1].start)return e.length-1;for(var i=0;i<e.length;i++)if(r>e[i].start&&r<=e[i].end){t=i;break}return t}},{key:"findHightLight",value:function(){for(var r=this.root.children,t=0;t<r.length;t++)if(d.hasClass(r[t],this.fragConfig.fragFocusClass))return{dom:r[t],pos:r[t].getBoundingClientRect()}}},{key:"findFragment",value:function(r){var t=this.root.children;return r<0||r>=t.length?null:{dom:t[r],pos:t[r].getBoundingClientRect()}}},{key:"unHightLight",value:function(){for(var r=this.root.children,t=0;t<r.length;t++)d.removeClass(r[t],this.fragConfig.fragFocusClass)}},{key:"setHightLight",value:function(r){var t=this.root.children;if(r<t.length)return d.addClass(t[r],this.fragConfig.fragFocusClass),{dom:t[r],pos:t[r].getBoundingClientRect()}}},{key:"destroy",value:function(){this.progressList=null,this.fragments=null,this.root.innerHTML=""}},{key:"reset",value:function(r){var t=this;if(Object.keys(this.fragConfig).forEach(function(i){r[i]!==void 0&&(t.fragConfig[i]=r[i])}),r.fragments){if(this.fragments=r.fragments.length===0?[{percent:1}]:r.fragments,this.updateDuration(this.duration),this.playedIndex=0,this.cachedIndex=0,this.root)for(var e=this.root.children;e.length>0;)this.root.removeChild(e[0]);this.render()}}},{key:"render",value:function(){var r=this,t=this.style.progressColor;if(this.root||(this.root=d.createDom("xg-inners","",{},"progress-list")),this.fragments){var e=this.fragConfig,i=e.fragClass,n=e.fragFocusClass;this.progressList=this.fragments.map(function(o){var l=d.createDom("xg-inner","",{style:t?"background:".concat(t,"; flex: ").concat(o.percent):"flex: ".concat(o.percent)},"".concat(o.isFocus?n:""," xgplayer-progress-inner ").concat(i));return r.root.appendChild(l),Po.forEach(function(u){l.appendChild(d.createDom(u.tag,"",{style:u.styleKey?"background: ".concat(r.style[u.styleKey],"; width:0;"):"width:0;"},u.className))}),{cached:l.children[0],played:l.children[1]}})}return this.root}}]),a}(),Wi={POINT:"inner-focus-point",HIGHLIGHT:"inner-focus-highlight"},Lo=function(a){I(r,a);var s=P(r);function r(t){var e;return T(this,r),e=s.call(this,t),k(y(e),"onMoveOnly",function(i,n){var o=y(e),l=o.pos,u=o.config,f=o.player,h=n;if(i){d.event(i);var g=d.getEventPos(i,f.zoom),v=f.rotateDeg===90?g.clientY:g.clientX;if(l.moving&&Math.abs(l.x-v)<u.miniMoveStep)return;l.moving=!0,l.x=v,h=e.computeTime(i,v)}e.triggerCallbacks("dragmove",h,i),e._updateInnerFocus(h)}),k(y(e),"onBodyClick",function(i){e.pos.isLocked&&(e.pos.isLocked=!1,i.preventDefault(),i.stopPropagation())}),k(y(e),"_mouseDownHandler",function(i,n){e._state.time=n.currentTime,e.updateWidth(n.currentTime,n.seekTime,n.percent,0),e._updateInnerFocus(n)}),k(y(e),"_mouseUpHandler",function(i,n){var o=y(e),l=o.pos;l.moving&&e.updateWidth(n.currentTime,n.seekTime,n.percent,2)}),k(y(e),"_mouseMoveHandler",function(i,n){var o=y(e),l=o._state,u=o.pos,f=o.config,h=o.player;l.time<n.currentTime?n.forward=!0:n.forward=!1,l.time=n.currentTime,u.isDown&&!u.moving&&(u.moving=!0,f.isPauseMoving&&h.pause(),e.triggerCallbacks("dragstart",n,i),e.emitUserAction("drag","dragstart",n)),e.updateWidth(n.currentTime,n.seekTime,n.percent,1),e.triggerCallbacks("dragmove",n,i),e._updateInnerFocus(n)}),k(y(e),"onMouseDown",function(i){var n=y(e),o=n._state,l=n.player,u=n.pos,f=n.config,h=n.playerConfig,g=d.getEventPos(i,l.zoom),v=l.rotateDeg===90?g.clientY:g.clientX;if(!(l.isMini||f.closeMoveSeek||!h.allowSeekAfterEnded&&l.ended)){if(!l.duration&&!l.isPlaying){l.play();return}i.stopPropagation(),e.focus(),d.checkIsFunction(h.disableSwipeHandler)&&h.disableSwipeHandler(),d.checkIsFunction(f.onMoveStart)&&f.onMoveStart(),d.event(i),u.x=v,u.isDown=!0,u.moving=!1,o.prePlayTime=l.currentTime,l.focus({autoHide:!1}),e.isProgressMoving=!0,d.addClass(e.progressBtn,"active");var p=e.computeTime(i,v);p.prePlayTime=o.prePlayTime,e._mouseDownHandlerHook(i,p);var m=i.type;return m==="touchstart"?(e.root.addEventListener("touchmove",e.onMouseMove),e.root.addEventListener("touchend",e.onMouseUp),e.root.addEventListener("touchcancel",e.onMouseUp)):(e.unbind("mousemove",e.onMoveOnly),document.addEventListener("mousemove",e.onMouseMove,!1),document.addEventListener("mouseup",e.onMouseUp,!1)),!0}}),k(y(e),"onMouseUp",function(i){var n=y(e),o=n.player,l=n.config,u=n.pos,f=n.playerConfig,h=n._state;i.stopPropagation(),i.preventDefault(),d.checkIsFunction(f.enableSwipeHandler)&&f.enableSwipeHandler(),d.checkIsFunction(l.onMoveEnd)&&l.onMoveEnd(),d.event(i),d.removeClass(e.progressBtn,"active");var g=e.computeTime(i,u.x);g.prePlayTime=h.prePlayTime,u.moving?(e.triggerCallbacks("dragend",g,i),e.emitUserAction("drag","dragend",g)):(e.triggerCallbacks("click",g,i),e.emitUserAction("click","click",g)),e._mouseUpHandlerHook(i,g),u.moving=!1,u.isDown=!1,u.x=0,u.y=0,u.isLocked=!0,h.prePlayTime=0,h.time=0;var v=i.type;v==="touchend"||v==="touchcancel"?(e.root.removeEventListener("touchmove",e.onMouseMove),e.root.removeEventListener("touchend",e.onMouseUp),e.root.removeEventListener("touchcancel",e.onMouseUp),e.blur()):(document.removeEventListener("mousemove",e.onMouseMove,!1),document.removeEventListener("mouseup",e.onMouseUp,!1),u.isEnter?f.isMobileSimulateMode!=="mobile"&&e.bind("mousemove",e.onMoveOnly):e.onMouseLeave(i)),d.setTimeout(y(e),function(){e.resetSeekState()},1),o.focus()}),k(y(e),"onMouseMove",function(i){var n=y(e),o=n._state,l=n.pos,u=n.player,f=n.config;d.checkTouchSupport()&&i.preventDefault(),d.event(i);var h=d.getEventPos(i,u.zoom),g=u.rotateDeg===90?h.clientY:h.clientX,v=Math.abs(l.x-g);if(!(l.moving&&v<f.miniMoveStep||!l.moving&&v<f.miniStartStep)){l.x=g;var p=e.computeTime(i,g);p.prePlayTime=o.prePlayTime,e._mouseMoveHandlerHook(i,p)}}),k(y(e),"onMouseOut",function(i){e.triggerCallbacks("mouseout",null,i)}),k(y(e),"onMouseOver",function(i){e.triggerCallbacks("mouseover",null,i)}),k(y(e),"onMouseEnter",function(i){var n=y(e),o=n.player,l=n.pos;if(!(l.isDown||l.isEnter||o.isMini||!o.config.allowSeekAfterEnded&&o.ended)){l.isEnter=!0,e.bind("mousemove",e.onMoveOnly),e.bind("mouseleave",e.onMouseLeave),d.event(i);var u=d.getEventPos(i,o.zoom),f=o.rotateDeg===90?u.clientY:u.clientX,h=e.computeTime(i,f);e.triggerCallbacks("mouseenter",h,i),e.focus()}}),k(y(e),"onMouseLeave",function(i){e.triggerCallbacks("mouseleave",null,i),e.unlock(),e._updateInnerFocus(null)}),k(y(e),"onVideoResize",function(){var i=e.pos,n=i.x,o=i.isDown,l=i.isEnter;if(l&&!o){var u=e.computeTime(null,n);e.onMoveOnly(null,u)}}),e.useable=!1,e.isProgressMoving=!1,e.__dragCallBacks=[],e._state={now:-1,direc:0,time:0,prePlayTime:-1},e._disableBlur=!1,e}return S(r,[{key:"offsetDuration",get:function(){return this.playerConfig.customDuration||this.player.offsetDuration||this.player.duration}},{key:"duration",get:function(){return this.playerConfig.customDuration||this.player.duration}},{key:"timeOffset",get:function(){return this.playerConfig.timeOffset||0}},{key:"currentTime",get:function(){var e=this.player,i=e.offsetCurrentTime,n=e.currentTime;return i>=0?i:n+this.timeOffset}},{key:"changeState",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.useable=e}},{key:"show",value:function(e){this.root&&(this.root.style.display="flex")}},{key:"_initInner",value:function(){var e=this,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};(!i||i.length===0)&&(i=[{percent:1}]);var o=U(U({fragments:i},n),{},{actionCallback:function(u){e.emitUserAction("fragment_focus","fragment_focus",u)}});this.innerList?this.innerList.reset(o):(this.innerList=new Ao(o),this.outer.insertBefore(this.innerList.render(),this.outer.children[0]),["findHightLight","unHightLight","setHightLight","findFragment"].map(function(l){e[l]=e.innerList[l].bind(e.innerList)}))}},{key:"_updateInnerFocus",value:function(e){this.innerList&&this.innerList.updateFocus(e)}},{key:"afterCreate",value:function(){var e=this;if(!(this.config.disable||this.playerConfig.isLive)){this.pos={x:0,y:0,moving:!1,isDown:!1,isEnter:!1,isLocked:!1},this.outer=this.find("xg-outer");var i=this.config,n=i.fragFocusClass,o=i.fragAutoFocus,l=i.fragClass;this._initInner(this.config.fragments,{fragFocusClass:n,fragAutoFocus:o,fragClass:l,style:this.playerConfig.commonStyle||{}}),O.device==="mobile"&&(this.config.isDragingSeek=!1,this.isMobile=!0),this.progressBtn=this.find(".xgplayer-progress-btn"),this.on(fe,function(){e.onMouseLeave()}),this.on(q,function(){e.onTimeupdate()}),this.on(oe,function(){e.onTimeupdate(),e.onCacheUpdate()}),this.on(oi,function(){e.onCacheUpdate()}),this.on(ye,function(){e.onCacheUpdate(!0),e.onTimeupdate(!0),e._state.now=0}),this.on(_e,function(){e.onReset()}),this.on(he,function(){e.onVideoResize()}),this.bindDomEvents(),this.initCustomStyle()}}},{key:"setConfig",value:function(e){var i=this,n=null;Object.keys(e).forEach(function(o){i.config[o]=e[o],o==="fragments"&&(n=e[o])}),n&&this._initInner(n,e)}},{key:"initCustomStyle",value:function(){var e=this.playerConfig||{},i=e.commonStyle,n=i.sliderBtnStyle,o=this.progressBtn;n&&(typeof n=="string"?o.style.boxShadow=n:G(n)==="object"&&Object.keys(n).map(function(l){o.style[l]=n[l]}))}},{key:"triggerCallbacks",value:function(e,i,n){this.__dragCallBacks.length>0&&this.__dragCallBacks.map(function(o){if(o&&o.handler&&o.type===e)try{o.handler(i,n)}catch(l){console.error("[XGPLAYER][triggerCallbacks] ".concat(o," error"),l)}})}},{key:"addCallBack",value:function(e,i){i&&typeof i=="function"&&this.__dragCallBacks.push({type:e,handler:i})}},{key:"removeCallBack",value:function(e,i){var n=this.__dragCallBacks,o=-1;n.map(function(l,u){l&&l.type===e&&l.handler===i&&(o=u)}),o>-1&&n.splice(o,1)}},{key:"unlock",value:function(){var e=this.player,i=this.pos;if(i.isEnter=!1,i.isLocked=!1,!e.isMini){if(this.unbind("mousemove",this.onMoveOnly),i.isDown){this.unbind("mouseleave",this.onMouseLeave);return}this.blur()}}},{key:"bindDomEvents",value:function(){var e=this.player.config;this._mouseDownHandlerHook=this.hook("dragstart",this._mouseDownHandler),this._mouseUpHandlerHook=this.hook("dragend",this._mouseUpHandler),this._mouseMoveHandlerHook=this.hook("drag",this._mouseMoveHandler),(this.domEventType==="touch"||this.domEventType==="compatible")&&this.root.addEventListener("touchstart",this.onMouseDown),(this.domEventType==="mouse"||this.domEventType==="compatible")&&(this.bind("mousedown",this.onMouseDown),e.isMobileSimulateMode!=="mobile"&&this.bind("mouseenter",this.onMouseEnter),this.bind("mouseover",this.onMouseOver),this.bind("mouseout",this.onMouseOut),this.player.root.addEventListener("click",this.onBodyClick,!0))}},{key:"focus",value:function(){this.player.controls.pauseAutoHide(),d.addClass(this.root,"active")}},{key:"blur",value:function(){this._disableBlur||(this.player.controls.recoverAutoHide(),d.removeClass(this.root,"active"))}},{key:"disableBlur",value:function(){this._disableBlur=!0}},{key:"enableBlur",value:function(){this._disableBlur=!1}},{key:"updateWidth",value:function(e,i,n,o){var l=this.config,u=this.player;if(!(l.isCloseClickSeek&&o===0)){var f=i=i>=u.duration?u.duration-l.endedDiff:Number(i).toFixed(1);this.updatePercent(n),this.updateTime(e),!(o===1&&(!l.isDragingSeek||u.config.mediaType==="audio"))&&(this._state.now=f,this._state.direc=f>u.currentTime?0:1,u.seek(f))}}},{key:"computeTime",value:function(e,i){var n=this.player,o=this.root.getBoundingClientRect(),l=o.width,u=o.height,f=o.top,h=o.left,g,v,p=i;n.rotateDeg===90?(g=u,v=f):(g=l,v=h);var m=p-v;m=m>g?g:m<0?0:m;var _=m/g;_=_<0?0:_>1?1:_;var C=parseInt(_*this.offsetDuration*1e3,10)/1e3,w=d.getCurrentTimeByOffset(C,n.timeSegments);return{percent:_,currentTime:C,seekTime:w,offset:m,width:g,left:v,e}}},{key:"updateTime",value:function(e){var i=this.player,n=this.duration;e>n?e=n:e<0&&(e=0);var o=i.plugins.time;o&&o.updateTime(e)}},{key:"resetSeekState",value:function(){this.isProgressMoving=!1;var e=this.player.plugins.time;e&&e.resetActive()}},{key:"updatePercent",value:function(e,i){if(this.isProgressMoving=!0,!this.config.disable){e=e>1?1:e<0?0:e,this.progressBtn.style.left="".concat(e*100,"%"),this.innerList.update({played:e*this.offsetDuration},this.offsetDuration);var n=this.player.plugins.miniprogress;n&&n.update({played:e*this.offsetDuration},this.offsetDuration)}}},{key:"onTimeupdate",value:function(e){var i=this.player,n=this._state,o=this.offsetDuration;if(!(i.isSeeking&&i.media.seeking||this.isProgressMoving||!i.hasStart)){if(n.now>-1){var l=parseInt(n.now*1e3,10)-parseInt(i.currentTime*1e3,10);if(n.direc===0&&l>300||n.direc===1&&l>-300){n.now=-1;return}else n.now=-1}var u=this.currentTime;u=d.adjustTimeByDuration(u,o,e),this.innerList.update({played:u},o),this.progressBtn.style.left="".concat(u/o*100,"%")}}},{key:"onCacheUpdate",value:function(e){var i=this.player,n=this.duration;if(i){var o=i.bufferedPoint.end;o=d.adjustTimeByDuration(o,n,e),this.innerList.update({cached:o},n)}}},{key:"onReset",value:function(){this.innerList.update({played:0,cached:0},0),this.progressBtn.style.left="0%"}},{key:"destroy",value:function(){var e=this.player;this.thumbnailPlugin=null,this.innerList.destroy(),this.innerList=null;var i=this.domEventType;(i==="touch"||i==="compatible")&&(this.root.removeEventListener("touchstart",this.onMouseDown),this.root.removeEventListener("touchmove",this.onMouseMove),this.root.removeEventListener("touchend",this.onMouseUp),this.root.removeEventListener("touchcancel",this.onMouseUp)),(i==="mouse"||i==="compatible")&&(this.unbind("mousedown",this.onMouseDown),this.unbind("mouseenter",this.onMouseEnter),this.unbind("mousemove",this.onMoveOnly),this.unbind("mouseleave",this.onMouseLeave),document.removeEventListener("mousemove",this.onMouseMove,!1),document.removeEventListener("mouseup",this.onMouseUp,!1),e.root.removeEventListener("click",this.onBodyClick,!0))}},{key:"render",value:function(){if(!(this.config.disable||this.playerConfig.isLive)){var e=this.player.controls?this.player.controls.config.mode:"",i=e==="bottom"?"xgplayer-progress-bottom":"";return`
72
+ </xg-loading>`}}],[{key:"pluginName",get:function(){return"loading"}},{key:"defaultConfig",get:function(){return{position:V.ROOT}}}]),r}(B),Po=[{tag:"xg-cache",className:"xgplayer-progress-cache",styleKey:"cachedColor"},{tag:"xg-played",className:"xgplayer-progress-played",styleKey:"playedColor"}],Ao=function(){function a(s){T(this,a),this.fragments=s.fragments||[],this.fragments.length===0&&this.fragments.push({percent:1}),this._callBack=s.actionCallback,this.fragConfig={fragFocusClass:s.fragFocusClass||"inner-focus-point",fragAutoFocus:!!s.fragAutoFocus,fragClass:s.fragClass||""},this.style=s.style||{playedColor:"",cachedColor:"",progressColor:""},this.duration=0,this.cachedIndex=0,this.playedIndex=0,this.focusIndex=-1}return S(a,[{key:"updateDuration",value:function(r){var t=this;this.duration=r;var e=0,i=this.fragments;this.fragments=i.map(function(n){return n.start=parseInt(e,10),n.end=parseInt(e+n.percent*t.duration,10),n.duration=parseInt(n.percent*t.duration,10),e+=n.percent*t.duration,n})}},{key:"updateProgress",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"played",t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{newIndex:0,curIndex:0,millisecond:0},e=this.progressList,i=this.fragments;if(!(e.length<1)){var n=t.newIndex,o=t.curIndex,l=t.millisecond;n!==o&&e.map(function(h,p){p<n?h[r].style.width="100%":p>n&&(h[r].style.width=0)});var u=i[n],f=l===0?0:(l-u.start)/u.duration;e[n][r].style.width=f<0?0:"".concat(f*100,"%")}}},{key:"updateFocus",value:function(r){if(!(!this.fragConfig.fragAutoFocus||this.fragments.length<2)){if(!r){if(this.focusIndex>-1){this.unHightLight(this.focusIndex);var t={index:-1,preIndex:this.focusIndex,fragment:null};this._callBack&&this._callBack(t),this.focusIndex=-1}return}var e=this.findIndex(r.currentTime*1e3,this.focusIndex);if(e>=0&&e!==this.focusIndex){this.focusIndex>-1&&this.unHightLight(this.focusIndex),this.setHightLight(e);var i={index:e,preIndex:this.focusIndex,fragment:this.fragments[this.focusIndex]};this.focusIndex=e,this._callBack&&this._callBack(i)}}}},{key:"update",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{cached:0,played:0},t=arguments.length>1?arguments[1]:void 0;if(!this.duration||parseInt(t*1e3,10)!==this.duration){if(!t&&t!==0)return;this.updateDuration(parseInt(t*1e3,10))}var e=this.playedIndex,i=this.cachedIndex;if(d.typeOf(r.played)!=="Undefined"){var n=this.findIndex(r.played*1e3,e);if(n<0)return;this.updateProgress("played",{newIndex:n,curIndex:e,millisecond:parseInt(r.played*1e3,10)}),this.playedIndex=n}if(d.typeOf(r.cached)!=="Undefined"){var o=this.findIndex(r.cached*1e3,i);if(o<0)return;this.updateProgress("cached",{newIndex:o,curIndex:i,millisecond:parseInt(r.cached*1e3,10)}),this.cachedIndex=o}}},{key:"findIndex",value:function(r,t){var e=this.fragments;if(!e||e.length===0)return-1;if(e.length===1)return 0;if(t>-1&&t<e.length&&r>e[t].start&&r<e[t].end)return t;if(r>e[e.length-1].start)return e.length-1;for(var i=0;i<e.length;i++)if(r>e[i].start&&r<=e[i].end){t=i;break}return t}},{key:"findHightLight",value:function(){for(var r=this.root.children,t=0;t<r.length;t++)if(d.hasClass(r[t],this.fragConfig.fragFocusClass))return{dom:r[t],pos:r[t].getBoundingClientRect()}}},{key:"findFragment",value:function(r){var t=this.root.children;return r<0||r>=t.length?null:{dom:t[r],pos:t[r].getBoundingClientRect()}}},{key:"unHightLight",value:function(){for(var r=this.root.children,t=0;t<r.length;t++)d.removeClass(r[t],this.fragConfig.fragFocusClass)}},{key:"setHightLight",value:function(r){var t=this.root.children;if(r<t.length)return d.addClass(t[r],this.fragConfig.fragFocusClass),{dom:t[r],pos:t[r].getBoundingClientRect()}}},{key:"destroy",value:function(){this.progressList=null,this.fragments=null,this.root.innerHTML=""}},{key:"reset",value:function(r){var t=this;if(Object.keys(this.fragConfig).forEach(function(i){r[i]!==void 0&&(t.fragConfig[i]=r[i])}),r.fragments){if(this.fragments=r.fragments.length===0?[{percent:1}]:r.fragments,this.updateDuration(this.duration),this.playedIndex=0,this.cachedIndex=0,this.root)for(var e=this.root.children;e.length>0;)this.root.removeChild(e[0]);this.render()}}},{key:"render",value:function(){var r=this,t=this.style.progressColor;if(this.root||(this.root=d.createDom("xg-inners","",{},"progress-list")),this.fragments){var e=this.fragConfig,i=e.fragClass,n=e.fragFocusClass;this.progressList=this.fragments.map(function(o){var l=d.createDom("xg-inner","",{style:t?"background:".concat(t,"; flex: ").concat(o.percent):"flex: ".concat(o.percent)},"".concat(o.isFocus?n:""," xgplayer-progress-inner ").concat(i));return r.root.appendChild(l),Po.forEach(function(u){l.appendChild(d.createDom(u.tag,"",{style:u.styleKey?"background: ".concat(r.style[u.styleKey],"; width:0;"):"width:0;"},u.className))}),{cached:l.children[0],played:l.children[1]}})}return this.root}}]),a}(),Wi={POINT:"inner-focus-point",HIGHLIGHT:"inner-focus-highlight"},Lo=function(a){I(r,a);var s=P(r);function r(t){var e;return T(this,r),e=s.call(this,t),k(y(e),"onMoveOnly",function(i,n){var o=y(e),l=o.pos,u=o.config,f=o.player,h=n;if(i){d.event(i);var p=d.getEventPos(i,f.zoom),v=f.rotateDeg===90?p.clientY:p.clientX;if(l.moving&&Math.abs(l.x-v)<u.miniMoveStep)return;l.moving=!0,l.x=v,h=e.computeTime(i,v)}e.triggerCallbacks("dragmove",h,i),e._updateInnerFocus(h)}),k(y(e),"onBodyClick",function(i){e.pos.isLocked&&(e.pos.isLocked=!1,i.preventDefault(),i.stopPropagation())}),k(y(e),"_mouseDownHandler",function(i,n){e._state.time=n.currentTime,e.updateWidth(n.currentTime,n.seekTime,n.percent,0),e._updateInnerFocus(n)}),k(y(e),"_mouseUpHandler",function(i,n){var o=y(e),l=o.pos;l.moving&&e.updateWidth(n.currentTime,n.seekTime,n.percent,2)}),k(y(e),"_mouseMoveHandler",function(i,n){var o=y(e),l=o._state,u=o.pos,f=o.config,h=o.player;l.time<n.currentTime?n.forward=!0:n.forward=!1,l.time=n.currentTime,u.isDown&&!u.moving&&(u.moving=!0,f.isPauseMoving&&h.pause(),e.triggerCallbacks("dragstart",n,i),e.emitUserAction("drag","dragstart",n)),e.updateWidth(n.currentTime,n.seekTime,n.percent,1),e.triggerCallbacks("dragmove",n,i),e._updateInnerFocus(n)}),k(y(e),"onMouseDown",function(i){var n=y(e),o=n._state,l=n.player,u=n.pos,f=n.config,h=n.playerConfig,p=d.getEventPos(i,l.zoom),v=l.rotateDeg===90?p.clientY:p.clientX;if(!(l.isMini||f.closeMoveSeek||!h.allowSeekAfterEnded&&l.ended)){if(!l.duration&&!l.isPlaying){l.play();return}i.stopPropagation(),e.focus(),d.checkIsFunction(h.disableSwipeHandler)&&h.disableSwipeHandler(),d.checkIsFunction(f.onMoveStart)&&f.onMoveStart(),d.event(i),u.x=v,u.isDown=!0,u.moving=!1,o.prePlayTime=l.currentTime,l.focus({autoHide:!1}),e.isProgressMoving=!0,d.addClass(e.progressBtn,"active");var g=e.computeTime(i,v);g.prePlayTime=o.prePlayTime,e._mouseDownHandlerHook(i,g);var m=i.type;return m==="touchstart"?(e.root.addEventListener("touchmove",e.onMouseMove),e.root.addEventListener("touchend",e.onMouseUp),e.root.addEventListener("touchcancel",e.onMouseUp)):(e.unbind("mousemove",e.onMoveOnly),document.addEventListener("mousemove",e.onMouseMove,!1),document.addEventListener("mouseup",e.onMouseUp,!1)),!0}}),k(y(e),"onMouseUp",function(i){var n=y(e),o=n.player,l=n.config,u=n.pos,f=n.playerConfig,h=n._state;i.stopPropagation(),i.preventDefault(),d.checkIsFunction(f.enableSwipeHandler)&&f.enableSwipeHandler(),d.checkIsFunction(l.onMoveEnd)&&l.onMoveEnd(),d.event(i),d.removeClass(e.progressBtn,"active");var p=e.computeTime(i,u.x);p.prePlayTime=h.prePlayTime,u.moving?(e.triggerCallbacks("dragend",p,i),e.emitUserAction("drag","dragend",p)):(e.triggerCallbacks("click",p,i),e.emitUserAction("click","click",p)),e._mouseUpHandlerHook(i,p),u.moving=!1,u.isDown=!1,u.x=0,u.y=0,u.isLocked=!0,h.prePlayTime=0,h.time=0;var v=i.type;v==="touchend"||v==="touchcancel"?(e.root.removeEventListener("touchmove",e.onMouseMove),e.root.removeEventListener("touchend",e.onMouseUp),e.root.removeEventListener("touchcancel",e.onMouseUp),e.blur()):(document.removeEventListener("mousemove",e.onMouseMove,!1),document.removeEventListener("mouseup",e.onMouseUp,!1),u.isEnter?f.isMobileSimulateMode!=="mobile"&&e.bind("mousemove",e.onMoveOnly):e.onMouseLeave(i)),d.setTimeout(y(e),function(){e.resetSeekState()},1),o.focus()}),k(y(e),"onMouseMove",function(i){var n=y(e),o=n._state,l=n.pos,u=n.player,f=n.config;d.checkTouchSupport()&&i.preventDefault(),d.event(i);var h=d.getEventPos(i,u.zoom),p=u.rotateDeg===90?h.clientY:h.clientX,v=Math.abs(l.x-p);if(!(l.moving&&v<f.miniMoveStep||!l.moving&&v<f.miniStartStep)){l.x=p;var g=e.computeTime(i,p);g.prePlayTime=o.prePlayTime,e._mouseMoveHandlerHook(i,g)}}),k(y(e),"onMouseOut",function(i){e.triggerCallbacks("mouseout",null,i)}),k(y(e),"onMouseOver",function(i){e.triggerCallbacks("mouseover",null,i)}),k(y(e),"onMouseEnter",function(i){var n=y(e),o=n.player,l=n.pos;if(!(l.isDown||l.isEnter||o.isMini||!o.config.allowSeekAfterEnded&&o.ended)){l.isEnter=!0,e.bind("mousemove",e.onMoveOnly),e.bind("mouseleave",e.onMouseLeave),d.event(i);var u=d.getEventPos(i,o.zoom),f=o.rotateDeg===90?u.clientY:u.clientX,h=e.computeTime(i,f);e.triggerCallbacks("mouseenter",h,i),e.focus()}}),k(y(e),"onMouseLeave",function(i){e.triggerCallbacks("mouseleave",null,i),e.unlock(),e._updateInnerFocus(null)}),k(y(e),"onVideoResize",function(){var i=e.pos,n=i.x,o=i.isDown,l=i.isEnter;if(l&&!o){var u=e.computeTime(null,n);e.onMoveOnly(null,u)}}),e.useable=!1,e.isProgressMoving=!1,e.__dragCallBacks=[],e._state={now:-1,direc:0,time:0,prePlayTime:-1},e._disableBlur=!1,e}return S(r,[{key:"offsetDuration",get:function(){return this.playerConfig.customDuration||this.player.offsetDuration||this.player.duration}},{key:"duration",get:function(){return this.playerConfig.customDuration||this.player.duration}},{key:"timeOffset",get:function(){return this.playerConfig.timeOffset||0}},{key:"currentTime",get:function(){var e=this.player,i=e.offsetCurrentTime,n=e.currentTime;return i>=0?i:n+this.timeOffset}},{key:"changeState",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.useable=e}},{key:"show",value:function(e){this.root&&(this.root.style.display="flex")}},{key:"_initInner",value:function(){var e=this,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};(!i||i.length===0)&&(i=[{percent:1}]);var o=U(U({fragments:i},n),{},{actionCallback:function(u){e.emitUserAction("fragment_focus","fragment_focus",u)}});this.innerList?this.innerList.reset(o):(this.innerList=new Ao(o),this.outer.insertBefore(this.innerList.render(),this.outer.children[0]),["findHightLight","unHightLight","setHightLight","findFragment"].map(function(l){e[l]=e.innerList[l].bind(e.innerList)}))}},{key:"_updateInnerFocus",value:function(e){this.innerList&&this.innerList.updateFocus(e)}},{key:"afterCreate",value:function(){var e=this;if(!(this.config.disable||this.playerConfig.isLive)){this.pos={x:0,y:0,moving:!1,isDown:!1,isEnter:!1,isLocked:!1},this.outer=this.find("xg-outer");var i=this.config,n=i.fragFocusClass,o=i.fragAutoFocus,l=i.fragClass;this._initInner(this.config.fragments,{fragFocusClass:n,fragAutoFocus:o,fragClass:l,style:this.playerConfig.commonStyle||{}}),O.device==="mobile"&&(this.config.isDragingSeek=!1,this.isMobile=!0),this.progressBtn=this.find(".xgplayer-progress-btn"),this.on(fe,function(){e.onMouseLeave()}),this.on(q,function(){e.onTimeupdate()}),this.on(oe,function(){e.onTimeupdate(),e.onCacheUpdate()}),this.on(oi,function(){e.onCacheUpdate()}),this.on(ye,function(){e.onCacheUpdate(!0),e.onTimeupdate(!0),e._state.now=0}),this.on(_e,function(){e.onReset()}),this.on(he,function(){e.onVideoResize()}),this.bindDomEvents(),this.initCustomStyle()}}},{key:"setConfig",value:function(e){var i=this,n=null;Object.keys(e).forEach(function(o){i.config[o]=e[o],o==="fragments"&&(n=e[o])}),n&&this._initInner(n,e)}},{key:"initCustomStyle",value:function(){var e=this.playerConfig||{},i=e.commonStyle,n=i.sliderBtnStyle,o=this.progressBtn;n&&(typeof n=="string"?o.style.boxShadow=n:G(n)==="object"&&Object.keys(n).map(function(l){o.style[l]=n[l]}))}},{key:"triggerCallbacks",value:function(e,i,n){this.__dragCallBacks.length>0&&this.__dragCallBacks.map(function(o){if(o&&o.handler&&o.type===e)try{o.handler(i,n)}catch(l){console.error("[XGPLAYER][triggerCallbacks] ".concat(o," error"),l)}})}},{key:"addCallBack",value:function(e,i){i&&typeof i=="function"&&this.__dragCallBacks.push({type:e,handler:i})}},{key:"removeCallBack",value:function(e,i){var n=this.__dragCallBacks,o=-1;n.map(function(l,u){l&&l.type===e&&l.handler===i&&(o=u)}),o>-1&&n.splice(o,1)}},{key:"unlock",value:function(){var e=this.player,i=this.pos;if(i.isEnter=!1,i.isLocked=!1,!e.isMini){if(this.unbind("mousemove",this.onMoveOnly),i.isDown){this.unbind("mouseleave",this.onMouseLeave);return}this.blur()}}},{key:"bindDomEvents",value:function(){var e=this.player.config;this._mouseDownHandlerHook=this.hook("dragstart",this._mouseDownHandler),this._mouseUpHandlerHook=this.hook("dragend",this._mouseUpHandler),this._mouseMoveHandlerHook=this.hook("drag",this._mouseMoveHandler),(this.domEventType==="touch"||this.domEventType==="compatible")&&this.root.addEventListener("touchstart",this.onMouseDown),(this.domEventType==="mouse"||this.domEventType==="compatible")&&(this.bind("mousedown",this.onMouseDown),e.isMobileSimulateMode!=="mobile"&&this.bind("mouseenter",this.onMouseEnter),this.bind("mouseover",this.onMouseOver),this.bind("mouseout",this.onMouseOut),this.player.root.addEventListener("click",this.onBodyClick,!0))}},{key:"focus",value:function(){this.player.controls.pauseAutoHide(),d.addClass(this.root,"active")}},{key:"blur",value:function(){this._disableBlur||(this.player.controls.recoverAutoHide(),d.removeClass(this.root,"active"))}},{key:"disableBlur",value:function(){this._disableBlur=!0}},{key:"enableBlur",value:function(){this._disableBlur=!1}},{key:"updateWidth",value:function(e,i,n,o){var l=this.config,u=this.player;if(!(l.isCloseClickSeek&&o===0)){var f=i=i>=u.duration?u.duration-l.endedDiff:Number(i).toFixed(1);this.updatePercent(n),this.updateTime(e),!(o===1&&(!l.isDragingSeek||u.config.mediaType==="audio"))&&(this._state.now=f,this._state.direc=f>u.currentTime?0:1,u.seek(f))}}},{key:"computeTime",value:function(e,i){var n=this.player,o=this.root.getBoundingClientRect(),l=o.width,u=o.height,f=o.top,h=o.left,p,v,g=i;n.rotateDeg===90?(p=u,v=f):(p=l,v=h);var m=g-v;m=m>p?p:m<0?0:m;var _=m/p;_=_<0?0:_>1?1:_;var C=parseInt(_*this.offsetDuration*1e3,10)/1e3,b=d.getCurrentTimeByOffset(C,n.timeSegments);return{percent:_,currentTime:C,seekTime:b,offset:m,width:p,left:v,e}}},{key:"updateTime",value:function(e){var i=this.player,n=this.duration;e>n?e=n:e<0&&(e=0);var o=i.plugins.time;o&&o.updateTime(e)}},{key:"resetSeekState",value:function(){this.isProgressMoving=!1;var e=this.player.plugins.time;e&&e.resetActive()}},{key:"updatePercent",value:function(e,i){if(this.isProgressMoving=!0,!this.config.disable){e=e>1?1:e<0?0:e,this.progressBtn.style.left="".concat(e*100,"%"),this.innerList.update({played:e*this.offsetDuration},this.offsetDuration);var n=this.player.plugins.miniprogress;n&&n.update({played:e*this.offsetDuration},this.offsetDuration)}}},{key:"onTimeupdate",value:function(e){var i=this.player,n=this._state,o=this.offsetDuration;if(!(i.isSeeking&&i.media.seeking||this.isProgressMoving||!i.hasStart)){if(n.now>-1){var l=parseInt(n.now*1e3,10)-parseInt(i.currentTime*1e3,10);if(n.direc===0&&l>300||n.direc===1&&l>-300){n.now=-1;return}else n.now=-1}var u=this.currentTime;u=d.adjustTimeByDuration(u,o,e),this.innerList.update({played:u},o),this.progressBtn.style.left="".concat(u/o*100,"%")}}},{key:"onCacheUpdate",value:function(e){var i=this.player,n=this.duration;if(i){var o=i.bufferedPoint.end;o=d.adjustTimeByDuration(o,n,e),this.innerList.update({cached:o},n)}}},{key:"onReset",value:function(){this.innerList.update({played:0,cached:0},0),this.progressBtn.style.left="0%"}},{key:"destroy",value:function(){var e=this.player;this.thumbnailPlugin=null,this.innerList.destroy(),this.innerList=null;var i=this.domEventType;(i==="touch"||i==="compatible")&&(this.root.removeEventListener("touchstart",this.onMouseDown),this.root.removeEventListener("touchmove",this.onMouseMove),this.root.removeEventListener("touchend",this.onMouseUp),this.root.removeEventListener("touchcancel",this.onMouseUp)),(i==="mouse"||i==="compatible")&&(this.unbind("mousedown",this.onMouseDown),this.unbind("mouseenter",this.onMouseEnter),this.unbind("mousemove",this.onMoveOnly),this.unbind("mouseleave",this.onMouseLeave),document.removeEventListener("mousemove",this.onMouseMove,!1),document.removeEventListener("mouseup",this.onMouseUp,!1),e.root.removeEventListener("click",this.onBodyClick,!0))}},{key:"render",value:function(){if(!(this.config.disable||this.playerConfig.isLive)){var e=this.player.controls?this.player.controls.config.mode:"",i=e==="bottom"?"xgplayer-progress-bottom":"";return`
73
73
  <xg-progress class="xgplayer-progress `.concat(i,`">
74
74
  <xg-outer class="xgplayer-progress-outer">
75
75
  <xg-progress-btn class="xgplayer-progress-btn"></xg-progress-btn>
@@ -99,7 +99,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
99
99
  <span class="time-separator">/</span>
100
100
  <span class="time-duration">00:00</span>
101
101
  <span class="time-live-tag">`.concat(this.i18n.LIVE_TIP,`</span>
102
- </xg-icon>`)}}],[{key:"pluginName",get:function(){return"time"}},{key:"defaultConfig",get:function(){return{position:V.CONTROLS_LEFT,index:2,disable:!1}}}]),r}(B),Ho=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(y(t),"_onDurationChange",function(){t.updateSegments();var o=t.player,l=o.currentTime,u=o.timeSegments;if(t._checkIfEnabled(u)){var f=d.getIndexByTime(l,u),h=d.getOffsetCurrentTime(l,u,f);t.player.offsetCurrentTime=h,t.changeIndex(f,u)}}),k(y(t),"_onLoadedData",function(){var o=t.player.timeSegments;if(t._checkIfEnabled(o)){var l=d.getOffsetCurrentTime(0,o);t.player.offsetCurrentTime=l,t.changeIndex(0,o),t.curPos.start>0&&(t.player.currentTime=t.curPos.start)}}),k(y(t),"_onTimeupdate",function(){var o=t.player,l=o.currentTime,u=o.timeSegments;if(t._checkIfEnabled(u)){var f=u.length;t.lastCurrentTime=l;var h=d.getIndexByTime(l,u);h!==t.curIndex&&t.changeIndex(h,u);var g=d.getOffsetCurrentTime(l,u,h);if(t.player.offsetCurrentTime=g,!!t.curPos){var v=t.curPos,p=v.start,m=v.end;l<p?t.player.currentTime=p:l>m&&h>=f-1&&t.player.pause()}}}),k(y(t),"_onSeeking",function(){var o=t.player,l=o.currentTime,u=o.timeSegments;if(t._checkIfEnabled(u))if(l<u[0].start)t.player.currentTime=u[0].start;else if(l>u[u.length-1].end)t.player.currentTime=u[u.length-1].end;else{var f=d.getIndexByTime(l,u);if(f>=0){var h=t.getSeekTime(l,t.lastCurrentTime,f,u);h>=0&&(t.player.currentTime=h)}}}),k(y(t),"_onPlay",function(){var o=t.player,l=o.currentTime,u=o.timeSegments;t._checkIfEnabled(u)&&l>=u[u.length-1].end&&(t.player.currentTime=u[0].start)}),t}return S(r,[{key:"afterCreate",value:function(){this.curIndex=-1,this.curPos=null,this.lastCurrentTime=0,this.updateSegments(),this.on(fe,this._onDurationChange),this.on(ae,this._onLoadedData),this.on(q,this._onTimeupdate),this.on($e,this._onSeeking),this.on(X,this._onPlay)}},{key:"setConfig",value:function(e){var i=this;if(e){var n=Object.keys(e);n.length<1||(n.forEach(function(o){i.config[o]=e[o]}),this.updateSegments())}}},{key:"updateSegments",value:function(){var e=this.config,i=e.disable,n=e.segments,o=this.player;if(i||!n||n.length===0)o.timeSegments=[],o.offsetDuration=0,o.offsetCurrentTime=-1;else{var l=this.formatTimeSegments(n,o.duration);o.timeSegments=l,o.offsetDuration=l.length>0?l[l.length-1].duration:0}}},{key:"formatTimeSegments",value:function(e,i){var n=[];return e?(e.sort(function(o,l){return o.start-l.start}),e.forEach(function(o,l){var u={};if(u.start=o.start<0?0:o.start,u.end=i>0&&o.end>i?i:o.end,!(i>0&&u.start>i)){n.push(u);var f=u.end-u.start;if(l===0)u.offset=o.start,u.cTime=0,u.segDuration=f,u.duration=f;else{var h=n[l-1];u.offset=h.offset+(u.start-h.end),u.cTime=h.duration+h.cTime,u.segDuration=f,u.duration=h.duration+f}}}),n):[]}},{key:"getSeekTime",value:function(e,i,n,o){var l=-1,u=o[n],f=u.start,h=u.end;if(e>=f&&e<=h)return l;var g=e-i;if(g<0&&e<f){var v=i>f?i-f:0;return l=n-1>=0?o[n-1].end+g+v:0,l}return-1}},{key:"_checkIfEnabled",value:function(e){return!(!e||e.length<1)}},{key:"changeIndex",value:function(e,i){this.curIndex=e,e>=0&&i.length>0?this.curPos=i[e]:this.curPos=null}}],[{key:"pluginName",get:function(){return"TimeSegmentsControls"}},{key:"defaultConfig",get:function(){return{disable:!0,segments:[]}}}]),r}(de);function Vo(){return new DOMParser().parseFromString(`<svg xmlns="http://www.w3.org/2000/svg" width="28" height="40" viewBox="0 -10 28 40">
102
+ </xg-icon>`)}}],[{key:"pluginName",get:function(){return"time"}},{key:"defaultConfig",get:function(){return{position:V.CONTROLS_LEFT,index:2,disable:!1}}}]),r}(B),Ho=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(y(t),"_onDurationChange",function(){t.updateSegments();var o=t.player,l=o.currentTime,u=o.timeSegments;if(t._checkIfEnabled(u)){var f=d.getIndexByTime(l,u),h=d.getOffsetCurrentTime(l,u,f);t.player.offsetCurrentTime=h,t.changeIndex(f,u)}}),k(y(t),"_onLoadedData",function(){var o=t.player.timeSegments;if(t._checkIfEnabled(o)){var l=d.getOffsetCurrentTime(0,o);t.player.offsetCurrentTime=l,t.changeIndex(0,o),t.curPos.start>0&&(t.player.currentTime=t.curPos.start)}}),k(y(t),"_onTimeupdate",function(){var o=t.player,l=o.currentTime,u=o.timeSegments;if(t._checkIfEnabled(u)){var f=u.length;t.lastCurrentTime=l;var h=d.getIndexByTime(l,u);h!==t.curIndex&&t.changeIndex(h,u);var p=d.getOffsetCurrentTime(l,u,h);if(t.player.offsetCurrentTime=p,!!t.curPos){var v=t.curPos,g=v.start,m=v.end;l<g?t.player.currentTime=g:l>m&&h>=f-1&&t.player.pause()}}}),k(y(t),"_onSeeking",function(){var o=t.player,l=o.currentTime,u=o.timeSegments;if(t._checkIfEnabled(u))if(l<u[0].start)t.player.currentTime=u[0].start;else if(l>u[u.length-1].end)t.player.currentTime=u[u.length-1].end;else{var f=d.getIndexByTime(l,u);if(f>=0){var h=t.getSeekTime(l,t.lastCurrentTime,f,u);h>=0&&(t.player.currentTime=h)}}}),k(y(t),"_onPlay",function(){var o=t.player,l=o.currentTime,u=o.timeSegments;t._checkIfEnabled(u)&&l>=u[u.length-1].end&&(t.player.currentTime=u[0].start)}),t}return S(r,[{key:"afterCreate",value:function(){this.curIndex=-1,this.curPos=null,this.lastCurrentTime=0,this.updateSegments(),this.on(fe,this._onDurationChange),this.on(ae,this._onLoadedData),this.on(q,this._onTimeupdate),this.on($e,this._onSeeking),this.on(X,this._onPlay)}},{key:"setConfig",value:function(e){var i=this;if(e){var n=Object.keys(e);n.length<1||(n.forEach(function(o){i.config[o]=e[o]}),this.updateSegments())}}},{key:"updateSegments",value:function(){var e=this.config,i=e.disable,n=e.segments,o=this.player;if(i||!n||n.length===0)o.timeSegments=[],o.offsetDuration=0,o.offsetCurrentTime=-1;else{var l=this.formatTimeSegments(n,o.duration);o.timeSegments=l,o.offsetDuration=l.length>0?l[l.length-1].duration:0}}},{key:"formatTimeSegments",value:function(e,i){var n=[];return e?(e.sort(function(o,l){return o.start-l.start}),e.forEach(function(o,l){var u={};if(u.start=o.start<0?0:o.start,u.end=i>0&&o.end>i?i:o.end,!(i>0&&u.start>i)){n.push(u);var f=u.end-u.start;if(l===0)u.offset=o.start,u.cTime=0,u.segDuration=f,u.duration=f;else{var h=n[l-1];u.offset=h.offset+(u.start-h.end),u.cTime=h.duration+h.cTime,u.segDuration=f,u.duration=h.duration+f}}}),n):[]}},{key:"getSeekTime",value:function(e,i,n,o){var l=-1,u=o[n],f=u.start,h=u.end;if(e>=f&&e<=h)return l;var p=e-i;if(p<0&&e<f){var v=i>f?i-f:0;return l=n-1>=0?o[n-1].end+p+v:0,l}return-1}},{key:"_checkIfEnabled",value:function(e){return!(!e||e.length<1)}},{key:"changeIndex",value:function(e,i){this.curIndex=e,e>=0&&i.length>0?this.curPos=i[e]:this.curPos=null}}],[{key:"pluginName",get:function(){return"TimeSegmentsControls"}},{key:"defaultConfig",get:function(){return{disable:!0,segments:[]}}}]),r}(de);function Vo(){return new DOMParser().parseFromString(`<svg xmlns="http://www.w3.org/2000/svg" width="28" height="40" viewBox="0 -10 28 40">
103
103
  <path fill="#fff" transform="scale(0.0220625 0.0220625)" d="M358.4 358.4h-204.8v307.2h204.8l256 256v-819.2l-256 256z"></path>
104
104
  <path fill="#fff" transform="scale(0.0220625 0.0220625)" d="M940.632 837.632l-72.192-72.192c65.114-64.745 105.412-154.386 105.412-253.44s-40.299-188.695-105.396-253.424l-0.016-0.016 72.192-72.192c83.639 83.197 135.401 198.37 135.401 325.632s-51.762 242.434-135.381 325.612l-0.020 0.020zM795.648 693.248l-72.704-72.704c27.756-27.789 44.921-66.162 44.921-108.544s-17.165-80.755-44.922-108.546l0.002 0.002 72.704-72.704c46.713 46.235 75.639 110.363 75.639 181.248s-28.926 135.013-75.617 181.227l-0.021 0.021z"></path>
105
105
  </svg>
@@ -111,7 +111,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
111
111
  <path fill="#fff" transform="scale(0.0220625 0.0220625)" d="M358.4 358.4h-204.8v307.2h204.8l256 256v-819.2l-256 256z"></path>
112
112
  <path fill="#fff" transform="scale(0.0220625 0.0220625)" d="M920.4 439.808l-108.544-109.056-72.704 72.704 109.568 108.544-109.056 108.544 72.704 72.704 108.032-109.568 108.544 109.056 72.704-72.704-109.568-108.032 109.056-108.544-72.704-72.704-108.032 109.568z"></path>
113
113
  </svg>
114
- `,"image/svg+xml").firstChild}var jo=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(y(t),"onBarMousedown",function(o){var l=y(t),u=l.player,f=t.find(".xgplayer-bar");d.event(o);var h=f.getBoundingClientRect(),g=d.getEventPos(o,u.zoom),v=h.height-(g.clientY-h.top);if(g.h=v,g.barH=h.height,t.pos=g,!(v<-2))return t.updateVolumePos(v,o),document.addEventListener("mouseup",t.onBarMouseUp),t._d.isStart=!0,!1}),k(y(t),"onBarMouseMove",function(o){var l=y(t),u=l._d;if(u.isStart){var f=y(t),h=f.pos,g=f.player;o.preventDefault(),o.stopPropagation(),d.event(o);var v=d.getEventPos(o,g.zoom);u.isMoving=!0;var p=h.h-v.clientY+h.clientY;p>h.barH||t.updateVolumePos(p,o)}}),k(y(t),"onBarMouseUp",function(o){d.event(o),document.removeEventListener("mouseup",t.onBarMouseUp);var l=y(t),u=l._d;u.isStart=!1,u.isMoving=!1}),k(y(t),"onMouseenter",function(o){t._d.isActive=!0,t.focus(),t.emit("icon_mouseenter",{pluginName:t.pluginName})}),k(y(t),"onMouseleave",function(o){t._d.isActive=!1,t.unFocus(100,!1,o),t.emit("icon_mouseleave",{pluginName:t.pluginName})}),k(y(t),"onVolumeChange",function(o){if(t.player){var l=t.player,u=l.muted,f=l.volume;t._d.isMoving||(t.find(".xgplayer-drag").style.height=u||f===0?"4px":"".concat(f*100,"%"),t.config.showValueLabel&&t.updateVolumeValue()),t.animate(u,f)}}),t}return S(r,[{key:"registerIcons",value:function(){return{volumeSmall:{icon:Uo,class:"xg-volume-small"},volumeLarge:{icon:Vo,class:"xg-volume"},volumeMuted:{icon:zo,class:"xg-volume-mute"}}}},{key:"afterCreate",value:function(){var e=this;if(this._timerId=null,this._d={isStart:!1,isMoving:!1,isActive:!1},!this.config.disable){this.initIcons();var i=this.playerConfig,n=i.commonStyle,o=i.volume;n.volumeColor&&(this.find(".xgplayer-drag").style.backgroundColor=n.volumeColor),this.changeMutedHandler=this.hook("mutedChange",function(l){e.changeMuted(l)},{pre:function(u){u.preventDefault(),u.stopPropagation()}}),this._onMouseenterHandler=this.hook("mouseenter",this.onMouseenter),this._onMouseleaveHandler=this.hook("mouseleave",this.onMouseleave),O.device!=="mobile"&&this.playerConfig.isMobileSimulateMode!=="mobile"&&(this.bind("mouseenter",this._onMouseenterHandler),this.bind(["blur","mouseleave"],this._onMouseleaveHandler),this.bind(".xgplayer-slider","mousedown",this.onBarMousedown),this.bind(".xgplayer-slider","mousemove",this.onBarMouseMove),this.bind(".xgplayer-slider","mouseup",this.onBarMouseUp)),this.bind(".xgplayer-icon",["touchend","click"],this.changeMutedHandler),this.on(ni,this.onVolumeChange),this.once(ae,this.onVolumeChange),d.typeOf(o)!=="Number"&&(this.player.volume=this.config.default),this.onVolumeChange()}}},{key:"updateVolumePos",value:function(e,i){var n=this.player,o=this.find(".xgplayer-drag"),l=this.find(".xgplayer-bar");if(!(!l||!o)){var u=parseInt(e/l.getBoundingClientRect().height*1e3,10);o.style.height="".concat(e,"px");var f=Math.max(Math.min(u/1e3,1),0),h={volume:{from:n.volume,to:f}};n.muted&&(h.muted={from:!0,to:!1}),this.emitUserAction(i,"change_volume",{muted:n.muted,volume:n.volume,props:h}),n.volume=Math.max(Math.min(u/1e3,1),0),n.muted&&(n.muted=!1),this.config.showValueLabel&&this.updateVolumeValue()}}},{key:"updateVolumeValue",value:function(){var e=this.player,i=e.volume,n=e.muted,o=this.find(".xgplayer-value-label"),l=Math.max(Math.min(i,1),0);o.innerText=n?0:Math.round(l*100)}},{key:"focus",value:function(){var e=this.player;e.focus({autoHide:!1}),this._timerId&&(d.clearTimeout(this,this._timerId),this._timerId=null),d.addClass(this.root,"slide-show")}},{key:"unFocus",value:function(){var e=this,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:100,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,o=arguments.length>2?arguments[2]:void 0,l=this._d,u=this.player;l.isActive||(this._timerId&&(d.clearTimeout(this,this._timerId),this._timerId=null),this._timerId=d.setTimeout(this,function(){l.isActive||(n?u.blur():u.focus(),d.removeClass(e.root,"slide-show"),l.isStart&&e.onBarMouseUp(o)),e._timerId=null},i))}},{key:"changeMuted",value:function(e){e&&e.stopPropagation();var i=this.player,n=this._d;n.isStart&&this.onBarMouseUp(e),this.emitUserAction(e,"change_muted",{muted:i.muted,volume:i.volume,props:{muted:{from:i.muted,to:!i.muted}}}),i.volume>0&&(i.muted=!i.muted),i.volume<.01&&(i.volume=this.config.miniVolume)}},{key:"animate",value:function(e,i){e||i===0?this.setAttr("data-state","mute"):i<.5&&this.icons.volumeSmall?this.setAttr("data-state","small"):this.setAttr("data-state","normal")}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(".xgplayer-icon",e.volumeSmall),this.appendChild(".xgplayer-icon",e.volumeLarge),this.appendChild(".xgplayer-icon",e.volumeMuted)}},{key:"destroy",value:function(){this._timerId&&(d.clearTimeout(this,this._timerId),this._timerId=null),this.unbind("mouseenter",this.onMouseenter),this.unbind(["blur","mouseleave"],this.onMouseleave),this.unbind(".xgplayer-slider","mousedown",this.onBarMousedown),this.unbind(".xgplayer-slider","mousemove",this.onBarMouseMove),this.unbind(".xgplayer-slider","mouseup",this.onBarMouseUp),document.removeEventListener("mouseup",this.onBarMouseUp),this.unbind(".xgplayer-icon",O.device==="mobile"?"touchend":"click",this.changeMutedHandler)}},{key:"render",value:function(){if(!this.config.disable){var e=this.config.default||this.player.volume,i=this.config.showValueLabel;return`
114
+ `,"image/svg+xml").firstChild}var jo=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(y(t),"onBarMousedown",function(o){var l=y(t),u=l.player,f=t.find(".xgplayer-bar");d.event(o);var h=f.getBoundingClientRect(),p=d.getEventPos(o,u.zoom),v=h.height-(p.clientY-h.top);if(p.h=v,p.barH=h.height,t.pos=p,!(v<-2))return t.updateVolumePos(v,o),document.addEventListener("mouseup",t.onBarMouseUp),t._d.isStart=!0,!1}),k(y(t),"onBarMouseMove",function(o){var l=y(t),u=l._d;if(u.isStart){var f=y(t),h=f.pos,p=f.player;o.preventDefault(),o.stopPropagation(),d.event(o);var v=d.getEventPos(o,p.zoom);u.isMoving=!0;var g=h.h-v.clientY+h.clientY;g>h.barH||t.updateVolumePos(g,o)}}),k(y(t),"onBarMouseUp",function(o){d.event(o),document.removeEventListener("mouseup",t.onBarMouseUp);var l=y(t),u=l._d;u.isStart=!1,u.isMoving=!1}),k(y(t),"onMouseenter",function(o){t._d.isActive=!0,t.focus(),t.emit("icon_mouseenter",{pluginName:t.pluginName})}),k(y(t),"onMouseleave",function(o){t._d.isActive=!1,t.unFocus(100,!1,o),t.emit("icon_mouseleave",{pluginName:t.pluginName})}),k(y(t),"onVolumeChange",function(o){if(t.player){var l=t.player,u=l.muted,f=l.volume;t._d.isMoving||(t.find(".xgplayer-drag").style.height=u||f===0?"4px":"".concat(f*100,"%"),t.config.showValueLabel&&t.updateVolumeValue()),t.animate(u,f)}}),t}return S(r,[{key:"registerIcons",value:function(){return{volumeSmall:{icon:Uo,class:"xg-volume-small"},volumeLarge:{icon:Vo,class:"xg-volume"},volumeMuted:{icon:zo,class:"xg-volume-mute"}}}},{key:"afterCreate",value:function(){var e=this;if(this._timerId=null,this._d={isStart:!1,isMoving:!1,isActive:!1},!this.config.disable){this.initIcons();var i=this.playerConfig,n=i.commonStyle,o=i.volume;n.volumeColor&&(this.find(".xgplayer-drag").style.backgroundColor=n.volumeColor),this.changeMutedHandler=this.hook("mutedChange",function(l){e.changeMuted(l)},{pre:function(u){u.preventDefault(),u.stopPropagation()}}),this._onMouseenterHandler=this.hook("mouseenter",this.onMouseenter),this._onMouseleaveHandler=this.hook("mouseleave",this.onMouseleave),O.device!=="mobile"&&this.playerConfig.isMobileSimulateMode!=="mobile"&&(this.bind("mouseenter",this._onMouseenterHandler),this.bind(["blur","mouseleave"],this._onMouseleaveHandler),this.bind(".xgplayer-slider","mousedown",this.onBarMousedown),this.bind(".xgplayer-slider","mousemove",this.onBarMouseMove),this.bind(".xgplayer-slider","mouseup",this.onBarMouseUp)),this.bind(".xgplayer-icon",["touchend","click"],this.changeMutedHandler),this.on(ni,this.onVolumeChange),this.once(ae,this.onVolumeChange),d.typeOf(o)!=="Number"&&(this.player.volume=this.config.default),this.onVolumeChange()}}},{key:"updateVolumePos",value:function(e,i){var n=this.player,o=this.find(".xgplayer-drag"),l=this.find(".xgplayer-bar");if(!(!l||!o)){var u=parseInt(e/l.getBoundingClientRect().height*1e3,10);o.style.height="".concat(e,"px");var f=Math.max(Math.min(u/1e3,1),0),h={volume:{from:n.volume,to:f}};n.muted&&(h.muted={from:!0,to:!1}),this.emitUserAction(i,"change_volume",{muted:n.muted,volume:n.volume,props:h}),n.volume=Math.max(Math.min(u/1e3,1),0),n.muted&&(n.muted=!1),this.config.showValueLabel&&this.updateVolumeValue()}}},{key:"updateVolumeValue",value:function(){var e=this.player,i=e.volume,n=e.muted,o=this.find(".xgplayer-value-label"),l=Math.max(Math.min(i,1),0);o.innerText=n?0:Math.round(l*100)}},{key:"focus",value:function(){var e=this.player;e.focus({autoHide:!1}),this._timerId&&(d.clearTimeout(this,this._timerId),this._timerId=null),d.addClass(this.root,"slide-show")}},{key:"unFocus",value:function(){var e=this,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:100,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,o=arguments.length>2?arguments[2]:void 0,l=this._d,u=this.player;l.isActive||(this._timerId&&(d.clearTimeout(this,this._timerId),this._timerId=null),this._timerId=d.setTimeout(this,function(){l.isActive||(n?u.blur():u.focus(),d.removeClass(e.root,"slide-show"),l.isStart&&e.onBarMouseUp(o)),e._timerId=null},i))}},{key:"changeMuted",value:function(e){e&&e.stopPropagation();var i=this.player,n=this._d;n.isStart&&this.onBarMouseUp(e),this.emitUserAction(e,"change_muted",{muted:i.muted,volume:i.volume,props:{muted:{from:i.muted,to:!i.muted}}}),i.volume>0&&(i.muted=!i.muted),i.volume<.01&&(i.volume=this.config.miniVolume)}},{key:"animate",value:function(e,i){e||i===0?this.setAttr("data-state","mute"):i<.5&&this.icons.volumeSmall?this.setAttr("data-state","small"):this.setAttr("data-state","normal")}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(".xgplayer-icon",e.volumeSmall),this.appendChild(".xgplayer-icon",e.volumeLarge),this.appendChild(".xgplayer-icon",e.volumeMuted)}},{key:"destroy",value:function(){this._timerId&&(d.clearTimeout(this,this._timerId),this._timerId=null),this.unbind("mouseenter",this.onMouseenter),this.unbind(["blur","mouseleave"],this.onMouseleave),this.unbind(".xgplayer-slider","mousedown",this.onBarMousedown),this.unbind(".xgplayer-slider","mousemove",this.onBarMouseMove),this.unbind(".xgplayer-slider","mouseup",this.onBarMouseUp),document.removeEventListener("mouseup",this.onBarMouseUp),this.unbind(".xgplayer-icon",O.device==="mobile"?"touchend":"click",this.changeMutedHandler)}},{key:"render",value:function(){if(!this.config.disable){var e=this.config.default||this.player.volume,i=this.config.showValueLabel;return`
115
115
  <xg-icon class="xgplayer-volume" data-state="normal">
116
116
  <div class="xgplayer-icon">
117
117
  </div>
@@ -132,7 +132,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
132
132
  </clipPath>
133
133
  </defs>
134
134
  </svg>
135
- `,"image/svg+xml").firstChild}var Wo=function(a){I(r,a);var s=P(r);function r(t){var e;return T(this,r),e=s.call(this,t),e.rotateDeg=e.config.rotateDeg||0,e}return S(r,[{key:"afterCreate",value:function(){var e=this;if(!this.config.disable){L(A(r.prototype),"afterCreate",this).call(this),this.appendChild(".xgplayer-icon",this.icons.rotate),this.onBtnClick=this.onBtnClick.bind(this),this.bind(".xgplayer-icon",["click","touchend"],this.onBtnClick),this.on(he,function(){e.rotateDeg&&e.config.innerRotate&&d.setTimeout(e,function(){e.updateRotateDeg(e.rotateDeg,e.config.innerRotate)},100)});var i=this.player.root;this.rootWidth=i.style.width||i.offsetWidth||i.clientWidth,this.rootHeight=i.style.height||i.offsetHeight||i.clientHeight,this.rotateDeg&&this.updateRotateDeg(this.rotateDeg,this.config.innerRotate)}}},{key:"destroy",value:function(){L(A(r.prototype),"destroy",this).call(this),this.unbind(".xgplayer-icon",["click","touchend"],this.onBtnClick)}},{key:"onBtnClick",value:function(e){e.preventDefault(),e.stopPropagation(),this.emitUserAction(e,"rotate"),this.rotate(this.config.clockwise,this.config.innerRotate,1)}},{key:"updateRotateDeg",value:function(e,i){if(e||(e=0),i){this.player.videoRotateDeg=e;return}var n=this.player,o=this.rootWidth,l=this.rootHeight,u=n.root,f=n.innerContainer,h=n.media,g=u.offsetWidth,v=f&&i?f.offsetHeight:u.offsetHeight,p=o,m=l,_=0,C=0;(e===.75||e===.25)&&(p="".concat(v,"px"),m="".concat(g,"px"),_=-(v-g)/2,C=-(g-v)/2);var w="translate(".concat(_,"px,").concat(C,"px) rotate(").concat(e,"turn)"),E={transformOrigin:"center center",transform:w,webKitTransform:w,height:m,width:p},N=i?h:u,R=i?n.getPlugin("poster"):null;Object.keys(E).map(function(H){N.style[H]=E[H],R&&R.root&&(R.root.style[H]=E[H])})}},{key:"rotate",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,o=this.player;this.rotateDeg||(this.rotateDeg=0);var l=e?1:-1;this.rotateDeg=(this.rotateDeg+1+l*.25*n)%1,this.updateRotateDeg(this.rotateDeg,i),o.emit(fi,this.rotateDeg*360)}},{key:"registerIcons",value:function(){return{rotate:$o}}},{key:"render",value:function(){if(!this.config.disable)return`
135
+ `,"image/svg+xml").firstChild}var Wo=function(a){I(r,a);var s=P(r);function r(t){var e;return T(this,r),e=s.call(this,t),e.rotateDeg=e.config.rotateDeg||0,e}return S(r,[{key:"afterCreate",value:function(){var e=this;if(!this.config.disable){L(A(r.prototype),"afterCreate",this).call(this),this.appendChild(".xgplayer-icon",this.icons.rotate),this.onBtnClick=this.onBtnClick.bind(this),this.bind(".xgplayer-icon",["click","touchend"],this.onBtnClick),this.on(he,function(){e.rotateDeg&&e.config.innerRotate&&d.setTimeout(e,function(){e.updateRotateDeg(e.rotateDeg,e.config.innerRotate)},100)});var i=this.player.root;this.rootWidth=i.style.width||i.offsetWidth||i.clientWidth,this.rootHeight=i.style.height||i.offsetHeight||i.clientHeight,this.rotateDeg&&this.updateRotateDeg(this.rotateDeg,this.config.innerRotate)}}},{key:"destroy",value:function(){L(A(r.prototype),"destroy",this).call(this),this.unbind(".xgplayer-icon",["click","touchend"],this.onBtnClick)}},{key:"onBtnClick",value:function(e){e.preventDefault(),e.stopPropagation(),this.emitUserAction(e,"rotate"),this.rotate(this.config.clockwise,this.config.innerRotate,1)}},{key:"updateRotateDeg",value:function(e,i){if(e||(e=0),i){this.player.videoRotateDeg=e;return}var n=this.player,o=this.rootWidth,l=this.rootHeight,u=n.root,f=n.innerContainer,h=n.media,p=u.offsetWidth,v=f&&i?f.offsetHeight:u.offsetHeight,g=o,m=l,_=0,C=0;(e===.75||e===.25)&&(g="".concat(v,"px"),m="".concat(p,"px"),_=-(v-p)/2,C=-(p-v)/2);var b="translate(".concat(_,"px,").concat(C,"px) rotate(").concat(e,"turn)"),E={transformOrigin:"center center",transform:b,webKitTransform:b,height:m,width:g},N=i?h:u,R=i?n.getPlugin("poster"):null;Object.keys(E).map(function(H){N.style[H]=E[H],R&&R.root&&(R.root.style[H]=E[H])})}},{key:"rotate",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,o=this.player;this.rotateDeg||(this.rotateDeg=0);var l=e?1:-1;this.rotateDeg=(this.rotateDeg+1+l*.25*n)%1,this.updateRotateDeg(this.rotateDeg,i),o.emit(fi,this.rotateDeg*360)}},{key:"registerIcons",value:function(){return{rotate:$o}}},{key:"render",value:function(){if(!this.config.disable)return`
136
136
  <xg-icon class="xgplayer-rotate">
137
137
  <div class="xgplayer-icon">
138
138
  </div>
@@ -149,9 +149,9 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
149
149
  d="M9.4998 7.7C9.77595 7.7 9.9998 7.47614 9.9998 7.2V6.5C9.9998 6.22386 9.77595 6 9.4998 6H5.5402L5.52754 6.00016H5.5C5.22386 6.00016 5 6.22401 5 6.50016V10.4598C5 10.7359 5.22386 10.9598 5.5 10.9598H6.2C6.47614 10.9598 6.7 10.7359 6.7 10.4598V8.83005L8.76983 10.9386C8.96327 11.1357 9.27984 11.1386 9.47691 10.9451L9.97645 10.4548C10.1735 10.2613 10.1764 9.94476 9.983 9.7477L7.97289 7.7H9.4998Z"
150
150
  fill="white" />
151
151
  </svg>`,"image/svg+xml").firstChild}var De={PIP:"picture-in-picture",INLINE:"inline",FULLSCREEN:"fullscreen"},Yo=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(y(t),"switchPIP",function(o){if(!t.isPIPAvailable())return!1;o.stopPropagation&&o.stopPropagation(),t.isPip?(t.exitPIP(),t.emitUserAction(o,"change_pip",{props:"pip",from:!0,to:!1}),t.setAttr("data-state","normal")):t.player.media.readyState===4&&(t.requestPIP(),t.emitUserAction(o,"change_pip",{props:"pip",from:!1,to:!0}),t.setAttr("data-state","pip"))}),t}return S(r,[{key:"beforeCreate",value:function(e){typeof e.player.config.pip=="boolean"&&(e.config.showIcon=e.player.config.pip)}},{key:"afterCreate",value:function(){var e=this;this.isPIPAvailable()&&(L(A(r.prototype),"afterCreate",this).call(this),this.pMode=De.INLINE,this.initPipEvents(),this.config.showIcon&&this.initIcons(),this.once(We,function(){e.config.showIcon&&(d.removeClass(e.find(".xgplayer-icon"),"xg-icon-disable"),e.bind("click",e.switchPIP))}))}},{key:"registerIcons",value:function(){return{pipIcon:{icon:Go,class:"xg-get-pip"},pipIconExit:{icon:Ko,class:"xg-exit-pip"}}}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(".xgplayer-icon",e.pipIcon),this.appendChild(".xgplayer-icon",e.pipIconExit)}},{key:"initPipEvents",value:function(){var e=this,i=this.player;this.leavePIPCallback=function(){var n=i.paused;d.setTimeout(e,function(){!n&&i.mediaPlay()},0),!n&&i.mediaPlay(),e.setAttr("data-state","normal"),e.pipWindow=null,i.emit(xt,!1)},this.enterPIPCallback=function(n){i.emit(xt,!0),n!=null&&n.pictureInPictureWindow&&(e.pipWindow=n.pictureInPictureWindow),e.setAttr("data-state","pip")},this.onWebkitpresentationmodechanged=function(n){var o=i.media.webkitPresentationMode;e.pMode===De.FULLSCREEN&&o!==De.FULLSCREEN&&i.onFullscreenChange(null,!1),e.pMode=o,o===De.PIP?e.enterPIPCallback(n):o===De.INLINE&&e.leavePIPCallback(n)},i.media&&(i.media.addEventListener("enterpictureinpicture",this.enterPIPCallback),i.media.addEventListener("leavepictureinpicture",this.leavePIPCallback),r.checkWebkitSetPresentationMode(i.media)&&i.media.addEventListener("webkitpresentationmodechanged",this.onWebkitpresentationmodechanged))}},{key:"copyStyleIntoPiPWindow",value:function(e){var i=Q(document.styleSheets).map(function(o){try{return Q(o.cssRules).map(function(u){return u.cssText}).join("")}catch{var l=document.createElement("link");l.rel="stylesheet",l.type=o.type,l.media=o.media,l.href=o.href,e.document.head.appendChild(l)}return""}).filter(Boolean).join(`
152
- `),n=document.createElement("style");n.textContent=i,e.document.head.appendChild(n)}},{key:"requestPIP",value:function(){var e=this,i=this.player,n=this.playerConfig,o=this.config;if(!(!this.isPIPAvailable()||this.isPip))try{var l=n.poster;if(l&&(i.media.poster=d.typeOf(l)==="String"?l:l.poster),o.preferDocument&&this.isDocPIPAvailable()){var u={};if(o.width&&o.height)u.width=o.width,u.height=o.height;else{var f=i.root.getBoundingClientRect();u.width=f.width,u.height=f.height}documentPictureInPicture.requestWindow(u).then(function(h){var g=o.docPiPNode,v=o.docPiPStyle;e.enterPIPCallback();var p=g||i.root,m=p.parentElement,_=p.previousSibling,C=p.nextSibling;e.copyStyleIntoPiPWindow(h);var w=document.createElement("style");if(w.append("body{padding:0; margin:0;}"),v){var E="";typeof v=="string"?E=v:typeof v=="function"&&(E=v.call(o)),E&&w.append(E)}else p===i.root&&w.append(`
152
+ `),n=document.createElement("style");n.textContent=i,e.document.head.appendChild(n)}},{key:"requestPIP",value:function(){var e=this,i=this.player,n=this.playerConfig,o=this.config;if(!(!this.isPIPAvailable()||this.isPip))try{var l=n.poster;if(l&&(i.media.poster=d.typeOf(l)==="String"?l:l.poster),o.preferDocument&&this.isDocPIPAvailable()){var u={};if(o.width&&o.height)u.width=o.width,u.height=o.height;else{var f=i.root.getBoundingClientRect();u.width=f.width,u.height=f.height}documentPictureInPicture.requestWindow(u).then(function(h){var p=o.docPiPNode,v=o.docPiPStyle;e.enterPIPCallback();var g=p||i.root,m=g.parentElement,_=g.previousSibling,C=g.nextSibling;e.copyStyleIntoPiPWindow(h);var b=document.createElement("style");if(b.append("body{padding:0; margin:0;}"),v){var E="";typeof v=="string"?E=v:typeof v=="function"&&(E=v.call(o)),E&&b.append(E)}else g===i.root&&b.append(`
153
153
  .xgplayer{width: 100%!important; height: 100%!important;}
154
- `);h.document.head.append(w),h.document.body.append(p),h.addEventListener("pagehide",function(N){m&&(C?m.insertBefore(p,C):_?m.insertBefore(p,_.nextSibling):m.appendChild(p)),e.leavePIPCallback()},{once:!0})})}else r.checkWebkitSetPresentationMode(i.media)?i.media.webkitSetPresentationMode("picture-in-picture"):i.media.requestPictureInPicture();return!0}catch(h){return console.error("requestPiP",h),!1}}},{key:"exitPIP",value:function(){var e=this.player;try{if(this.isPIPAvailable()&&this.isPip){var i;this.isDocPIPAvailable()&&(i=documentPictureInPicture)!==null&&i!==void 0&&i.window?documentPictureInPicture.window.close():r.checkWebkitSetPresentationMode(e.media)?e.media.webkitSetPresentationMode("inline"):document.exitPictureInPicture()}return!0}catch(n){return console.error("exitPIP",n),!1}}},{key:"isPip",get:function(){var e,i=this.player;return!!(this.isDocPIPAvailable()&&(e=documentPictureInPicture)!==null&&e!==void 0&&e.window)||document.pictureInPictureElement&&document.pictureInPictureElement===i.media||i.media.webkitPresentationMode===De.PIP}},{key:"isPIPAvailable",value:function(){var e=this.player.media,i=d.typeOf(document.pictureInPictureEnabled)==="Boolean"?document.pictureInPictureEnabled:!0;return i&&(d.typeOf(e.disablePictureInPicture)==="Boolean"&&!e.disablePictureInPicture||e.webkitSupportsPresentationMode&&d.typeOf(e.webkitSetPresentationMode)==="Function")||this.isDocPIPAvailable()}},{key:"isDocPIPAvailable",value:function(){return"documentPictureInPicture"in window&&/^(https|file)/.test(location.protocol)}},{key:"destroy",value:function(){L(A(r.prototype),"destroy",this).call(this);var e=this.player;e.media.removeEventListener("enterpictureinpicture",this.enterPIPCallback),e.media.removeEventListener("leavepictureinpicture",this.leavePIPCallback),r.checkWebkitSetPresentationMode(e.media)&&e.media.removeEventListener("webkitpresentationmodechanged",this.onWebkitpresentationmodechanged),this.exitPIP(),this.unbind("click",this.btnClick)}},{key:"render",value:function(){if(!(!this.config.showIcon||!this.isPIPAvailable()))return`<xg-icon class="xgplayer-pip">
154
+ `);h.document.head.append(b),h.document.body.append(g),h.addEventListener("pagehide",function(N){m&&(C?m.insertBefore(g,C):_?m.insertBefore(g,_.nextSibling):m.appendChild(g)),e.leavePIPCallback()},{once:!0})})}else r.checkWebkitSetPresentationMode(i.media)?i.media.webkitSetPresentationMode("picture-in-picture"):i.media.requestPictureInPicture();return!0}catch(h){return console.error("requestPiP",h),!1}}},{key:"exitPIP",value:function(){var e=this.player;try{if(this.isPIPAvailable()&&this.isPip){var i;this.isDocPIPAvailable()&&(i=documentPictureInPicture)!==null&&i!==void 0&&i.window?documentPictureInPicture.window.close():r.checkWebkitSetPresentationMode(e.media)?e.media.webkitSetPresentationMode("inline"):document.exitPictureInPicture()}return!0}catch(n){return console.error("exitPIP",n),!1}}},{key:"isPip",get:function(){var e,i=this.player;return!!(this.isDocPIPAvailable()&&(e=documentPictureInPicture)!==null&&e!==void 0&&e.window)||document.pictureInPictureElement&&document.pictureInPictureElement===i.media||i.media.webkitPresentationMode===De.PIP}},{key:"isPIPAvailable",value:function(){var e=this.player.media,i=d.typeOf(document.pictureInPictureEnabled)==="Boolean"?document.pictureInPictureEnabled:!0;return i&&(d.typeOf(e.disablePictureInPicture)==="Boolean"&&!e.disablePictureInPicture||e.webkitSupportsPresentationMode&&d.typeOf(e.webkitSetPresentationMode)==="Function")||this.isDocPIPAvailable()}},{key:"isDocPIPAvailable",value:function(){return"documentPictureInPicture"in window&&/^(https|file)/.test(location.protocol)}},{key:"destroy",value:function(){L(A(r.prototype),"destroy",this).call(this);var e=this.player;e.media.removeEventListener("enterpictureinpicture",this.enterPIPCallback),e.media.removeEventListener("leavepictureinpicture",this.leavePIPCallback),r.checkWebkitSetPresentationMode(e.media)&&e.media.removeEventListener("webkitpresentationmodechanged",this.onWebkitpresentationmodechanged),this.exitPIP(),this.unbind("click",this.btnClick)}},{key:"render",value:function(){if(!(!this.config.showIcon||!this.isPIPAvailable()))return`<xg-icon class="xgplayer-pip">
155
155
  <div class="xgplayer-icon xg-icon-disable">
156
156
  </div>
157
157
  `.concat(ve(this,"PIP",this.playerConfig.isHideTips),`
@@ -164,9 +164,9 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
164
164
  </div>
165
165
  `.concat(ve(this,"PLAYNEXT_TIPS",this.playerConfig.isHideTips),`
166
166
  </xg-icon>
167
- `)}}],[{key:"pluginName",get:function(){return"playNext"}},{key:"defaultConfig",get:function(){return{position:V.CONTROLS_LEFT,index:1,url:null,urlList:[]}}}]),r}(B),Gi={exports:{}};(function(a,s){(function(r,t){a.exports=t()})(ir,function(){return function r(t,e,i){var n=window,o="application/octet-stream",l=i||o,u=t,f=!e&&!i&&u,h=document.createElement("a"),g=function(D){return String(D)},v=n.Blob||n.MozBlob||n.WebKitBlob||g,p=e||"download",m,_;if(v=v.call?v.bind(n):Blob,String(this)==="true"&&(u=[u,l],l=u[0],u=u[1]),f&&f.length<2048&&(p=f.split("/").pop().split("?")[0],h.href=f,h.href.indexOf(f)!==-1)){var C=new XMLHttpRequest;return C.open("GET",f,!0),C.responseType="blob",C.onload=function(D){r(D.target.response,p,o)},setTimeout(function(){C.send()},0),C}if(/^data:([\w+-]+\/[\w+.-]+)?[,;]/.test(u))if(u.length>1024*1024*1.999&&v!==g)u=R(u),l=u.type||o;else return navigator.msSaveBlob?navigator.msSaveBlob(R(u),p):H(u);else if(/([\x80-\xff])/.test(u)){var w=0,E=new Uint8Array(u.length),N=E.length;for(w;w<N;++w)E[w]=u.charCodeAt(w);u=new v([E],{type:l})}m=u instanceof v?u:new v([u],{type:l});function R(D){var j=D.split(/[:;,]/),z=j[1],x=j[2]=="base64"?atob:decodeURIComponent,$=x(j.pop()),Z=$.length,te=0,we=new Uint8Array(Z);for(te;te<Z;++te)we[te]=$.charCodeAt(te);return new v([we],{type:z})}function H(D,j){if("download"in h)return h.href=D,h.setAttribute("download",p),h.className="download-js-link",h.innerHTML="downloading...",h.style.display="none",document.body.appendChild(h),setTimeout(function(){h.click(),document.body.removeChild(h),j===!0&&setTimeout(function(){n.URL.revokeObjectURL(h.href)},250)},66),!0;if(/(Version)\/(\d+)\.(\d+)(?:\.(\d+))?.*Safari\//.test(navigator.userAgent))return/^data:/.test(D)&&(D="data:"+D.replace(/^data:([\w\/\-\+]+)/,o)),window.open(D)||confirm(`Displaying New Document
167
+ `)}}],[{key:"pluginName",get:function(){return"playNext"}},{key:"defaultConfig",get:function(){return{position:V.CONTROLS_LEFT,index:1,url:null,urlList:[]}}}]),r}(B),Gi={exports:{}};(function(a,s){(function(r,t){a.exports=t()})(ir,function(){return function r(t,e,i){var n=window,o="application/octet-stream",l=i||o,u=t,f=!e&&!i&&u,h=document.createElement("a"),p=function(D){return String(D)},v=n.Blob||n.MozBlob||n.WebKitBlob||p,g=e||"download",m,_;if(v=v.call?v.bind(n):Blob,String(this)==="true"&&(u=[u,l],l=u[0],u=u[1]),f&&f.length<2048&&(g=f.split("/").pop().split("?")[0],h.href=f,h.href.indexOf(f)!==-1)){var C=new XMLHttpRequest;return C.open("GET",f,!0),C.responseType="blob",C.onload=function(D){r(D.target.response,g,o)},setTimeout(function(){C.send()},0),C}if(/^data:([\w+-]+\/[\w+.-]+)?[,;]/.test(u))if(u.length>1024*1024*1.999&&v!==p)u=R(u),l=u.type||o;else return navigator.msSaveBlob?navigator.msSaveBlob(R(u),g):H(u);else if(/([\x80-\xff])/.test(u)){var b=0,E=new Uint8Array(u.length),N=E.length;for(b;b<N;++b)E[b]=u.charCodeAt(b);u=new v([E],{type:l})}m=u instanceof v?u:new v([u],{type:l});function R(D){var j=D.split(/[:;,]/),z=j[1],x=j[2]=="base64"?atob:decodeURIComponent,$=x(j.pop()),Z=$.length,te=0,be=new Uint8Array(Z);for(te;te<Z;++te)be[te]=$.charCodeAt(te);return new v([be],{type:z})}function H(D,j){if("download"in h)return h.href=D,h.setAttribute("download",g),h.className="download-js-link",h.innerHTML="downloading...",h.style.display="none",document.body.appendChild(h),setTimeout(function(){h.click(),document.body.removeChild(h),j===!0&&setTimeout(function(){n.URL.revokeObjectURL(h.href)},250)},66),!0;if(/(Version)\/(\d+)\.(\d+)(?:\.(\d+))?.*Safari\//.test(navigator.userAgent))return/^data:/.test(D)&&(D="data:"+D.replace(/^data:([\w\/\-\+]+)/,o)),window.open(D)||confirm(`Displaying New Document
168
168
 
169
- Use Save As... to download, then click back to return to this page.`)&&(location.href=D),!0;var z=document.createElement("iframe");document.body.appendChild(z),!j&&/^data:/.test(D)&&(D="data:"+D.replace(/^data:([\w\/\-\+]+)/,o)),z.src=D,setTimeout(function(){document.body.removeChild(z)},333)}if(navigator.msSaveBlob)return navigator.msSaveBlob(m,p);if(n.URL)H(n.URL.createObjectURL(m),!0);else{if(typeof m=="string"||m.constructor===g)try{return H("data:"+l+";base64,"+n.btoa(m))}catch{return H("data:"+l+","+encodeURIComponent(m))}_=new FileReader,_.onload=function(D){H(this.result)},_.readAsDataURL(m)}return!0}})})(Gi);var Jo=Gi.exports;const Zo=ct(Jo);function Qo(){return new DOMParser().parseFromString(`<svg xmlns="http://www.w3.org/2000/svg" width="24px" height="24px" viewBox="0 0 24 24">
169
+ Use Save As... to download, then click back to return to this page.`)&&(location.href=D),!0;var z=document.createElement("iframe");document.body.appendChild(z),!j&&/^data:/.test(D)&&(D="data:"+D.replace(/^data:([\w\/\-\+]+)/,o)),z.src=D,setTimeout(function(){document.body.removeChild(z)},333)}if(navigator.msSaveBlob)return navigator.msSaveBlob(m,g);if(n.URL)H(n.URL.createObjectURL(m),!0);else{if(typeof m=="string"||m.constructor===p)try{return H("data:"+l+";base64,"+n.btoa(m))}catch{return H("data:"+l+","+encodeURIComponent(m))}_=new FileReader,_.onload=function(D){H(this.result)},_.readAsDataURL(m)}return!0}})})(Gi);var Jo=Gi.exports;const Zo=ct(Jo);function Qo(){return new DOMParser().parseFromString(`<svg xmlns="http://www.w3.org/2000/svg" width="24px" height="24px" viewBox="0 0 24 24">
170
170
  <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
171
171
  <g transform="translate(-488.000000, -340.000000)" fill="#FFFFFF">
172
172
  <g id="Group-2">
@@ -184,15 +184,15 @@ Use Save As... to download, then click back to return to this page.`)&&(location
184
184
  <div class="xgplayer-icon">
185
185
  </div>
186
186
  `.concat(ve(this,"DOWNLOAD_TIPS",this.playerConfig.isHideTips),`
187
- </xg-icon>`)}}],[{key:"pluginName",get:function(){return"download"}},{key:"defaultConfig",get:function(){return{position:V.CONTROLS_RIGHT,index:3,disable:!0}}}]),r}(Ee),ts=function(a){I(r,a);var s=P(r);function r(){return T(this,r),s.apply(this,arguments)}return S(r,[{key:"beforeCreate",value:function(e){typeof e.player.config.screenShot=="boolean"&&(e.config.disable=!e.player.config.screenShot)}},{key:"afterCreate",value:function(){L(A(r.prototype),"afterCreate",this).call(this),this.appendChild(".xgplayer-icon",this.icons.screenshotIcon);var e=this.config;this.initSize=function(i){e.fitVideo&&(e.width=i.vWidth,e.height=i.vHeight)},this.once(he,this.initSize)}},{key:"onPluginsReady",value:function(){this.show(),this.onClickBtn=this.onClickBtn.bind(this),this.bind(["click","touchend"],this.onClickBtn)}},{key:"saveScreenShot",value:function(e,i){var n=document.createElement("a");n.href=e,n.download=i;var o;try{typeof MouseEvent<"u"?o=new MouseEvent("click",{bubbles:!0,cancelable:!0,view:window}):(o=document.createEvent("MouseEvents"),o.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null))}catch(l){console.error("MouseEvent unsupported",l)}o&&n.dispatchEvent(o)}},{key:"createCanvas",value:function(e,i){var n=document.createElement("canvas"),o=n.getContext("2d");this.canvasCtx=o,this.canvas=n,n.width=e||this.config.width,n.height=i||this.config.height,o.imageSmoothingEnabled=!0,o.imageSmoothingEnabled&&(o.imageSmoothingQuality="high")}},{key:"onClickBtn",value:function(e){var i=this;e.preventDefault(),e.stopPropagation(),this.emitUserAction(e,"shot");var n=this.config;this.shot(n.width,n.height).then(function(o){i.emit(hi,o),n.saveImg&&i.saveScreenShot(o,n.name+n.format)})}},{key:"shot",value:function(e,i){var n=this,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{quality:.92,type:"image/png"},l=this.config,u=this.player,f=o.quality||l.quality,h=o.type||l.type;return new Promise(function(g,v){var p=null,m;if(u.media.canvas)p=u.media.canvas;else{n.canvas?(n.canvas.width=e||l.width,n.canvas.height=i||l.height):n.createCanvas(e,i),p=n.canvas,m=n.canvasCtx;var _=u.media.videoWidth/u.media.videoHeight,C=p.width/p.height,w=0,E=0,N=u.media.videoWidth,R=u.media.videoHeight,H,D,j,z;_>C?(j=p.width,z=p.width/_,H=0,D=Math.round((p.height-z)/2)):_===C?(j=p.width,z=p.height,H=0,D=0):_<C&&(j=p.height*_,z=p.height,H=Math.round((p.width-j)/2),D=0),m.drawImage(u.media,w,E,N,R,H,D,j,z)}var x=p.toDataURL(h,f).replace(h,"image/octet-stream");x=x.replace(/^data:image\/[^;]+/,"data:application/octet-stream"),g(x)})}},{key:"registerIcons",value:function(){return{screenshotIcon:null}}},{key:"destroy",value:function(){L(A(r.prototype),"destroy",this).call(this),this.unbind(["click","touchend"],this.onClickBtn),this.off(he,this.initSize)}},{key:"render",value:function(){if(!this.config.disable){var e=this.icons.screenshotIcon?"xgplayer-icon":"xgplayer-icon btn-text",i="SCREENSHOT";return`
187
+ </xg-icon>`)}}],[{key:"pluginName",get:function(){return"download"}},{key:"defaultConfig",get:function(){return{position:V.CONTROLS_RIGHT,index:3,disable:!0}}}]),r}(Ee),ts=function(a){I(r,a);var s=P(r);function r(){return T(this,r),s.apply(this,arguments)}return S(r,[{key:"beforeCreate",value:function(e){typeof e.player.config.screenShot=="boolean"&&(e.config.disable=!e.player.config.screenShot)}},{key:"afterCreate",value:function(){L(A(r.prototype),"afterCreate",this).call(this),this.appendChild(".xgplayer-icon",this.icons.screenshotIcon);var e=this.config;this.initSize=function(i){e.fitVideo&&(e.width=i.vWidth,e.height=i.vHeight)},this.once(he,this.initSize)}},{key:"onPluginsReady",value:function(){this.show(),this.onClickBtn=this.onClickBtn.bind(this),this.bind(["click","touchend"],this.onClickBtn)}},{key:"saveScreenShot",value:function(e,i){var n=document.createElement("a");n.href=e,n.download=i;var o;try{typeof MouseEvent<"u"?o=new MouseEvent("click",{bubbles:!0,cancelable:!0,view:window}):(o=document.createEvent("MouseEvents"),o.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null))}catch(l){console.error("MouseEvent unsupported",l)}o&&n.dispatchEvent(o)}},{key:"createCanvas",value:function(e,i){var n=document.createElement("canvas"),o=n.getContext("2d");this.canvasCtx=o,this.canvas=n,n.width=e||this.config.width,n.height=i||this.config.height,o.imageSmoothingEnabled=!0,o.imageSmoothingEnabled&&(o.imageSmoothingQuality="high")}},{key:"onClickBtn",value:function(e){var i=this;e.preventDefault(),e.stopPropagation(),this.emitUserAction(e,"shot");var n=this.config;this.shot(n.width,n.height).then(function(o){i.emit(hi,o),n.saveImg&&i.saveScreenShot(o,n.name+n.format)})}},{key:"shot",value:function(e,i){var n=this,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{quality:.92,type:"image/png"},l=this.config,u=this.player,f=o.quality||l.quality,h=o.type||l.type;return new Promise(function(p,v){var g=null,m;if(u.media.canvas)g=u.media.canvas;else{n.canvas?(n.canvas.width=e||l.width,n.canvas.height=i||l.height):n.createCanvas(e,i),g=n.canvas,m=n.canvasCtx;var _=u.media.videoWidth/u.media.videoHeight,C=g.width/g.height,b=0,E=0,N=u.media.videoWidth,R=u.media.videoHeight,H,D,j,z;_>C?(j=g.width,z=g.width/_,H=0,D=Math.round((g.height-z)/2)):_===C?(j=g.width,z=g.height,H=0,D=0):_<C&&(j=g.height*_,z=g.height,H=Math.round((g.width-j)/2),D=0),m.drawImage(u.media,b,E,N,R,H,D,j,z)}var x=g.toDataURL(h,f).replace(h,"image/octet-stream");x=x.replace(/^data:image\/[^;]+/,"data:application/octet-stream"),p(x)})}},{key:"registerIcons",value:function(){return{screenshotIcon:null}}},{key:"destroy",value:function(){L(A(r.prototype),"destroy",this).call(this),this.unbind(["click","touchend"],this.onClickBtn),this.off(he,this.initSize)}},{key:"render",value:function(){if(!this.config.disable){var e=this.icons.screenshotIcon?"xgplayer-icon":"xgplayer-icon btn-text",i="SCREENSHOT";return`
188
188
  <xg-icon class="xgplayer-shot">
189
189
  <div class="`.concat(e,`">
190
190
  `).concat(this.icons.screenshotIcon?"":'<span lang-key="'.concat(this.i18nKeys[i],'">').concat(this.i18n[i],"</span>"),`
191
191
  </div>
192
- </xg-icon>`)}}}],[{key:"pluginName",get:function(){return"screenShot"}},{key:"defaultConfig",get:function(){return{position:V.CONTROLS_RIGHT,index:5,quality:.92,type:"image/png",format:".png",width:600,height:337,saveImg:!0,fitVideo:!0,disable:!1,name:"screenshot"}}}]),r}(Ee),is=function(){function a(s){T(this,a),this.config=s.config,this.parent=s.root,this.root=d.createDom("ul","",{},"xg-options-list xg-list-slide-scroll ".concat(this.config.className)),s.root.appendChild(this.root);var r=this.config.maxHeight;r&&this.setStyle({maxHeight:r}),this.onItemClick=this.onItemClick.bind(this),this.renderItemList();var t=this.config.domEventType==="touch"?"touchend":"click";this._delegates=B.delegate.call(this,this.root,"li",t,this.onItemClick)}return S(a,[{key:"renderItemList",value:function(r){var t=this,e=this.config,i=this.root;r?e.data=r:r=e.data,e.style&&Object.keys(e.style).map(function(n){i.style[n]=e[n]}),r.length>0&&(this.attrKeys=Object.keys(r[0])),this.root.innerHTML="",r.map(function(n,o){var l=n.selected?"option-item selected":"option-item";n["data-index"]=o,t.root.appendChild(d.createDom("li","<span>".concat(n.showText,"</span>"),n,l))})}},{key:"onItemClick",value:function(r){r.delegateTarget||(r.delegateTarget=r.target);var t=r.delegateTarget;if(t&&d.hasClass(t,"selected"))return!1;var e=typeof this.config.onItemClick=="function"?this.config.onItemClick:null,i=this.root.querySelector(".selected");d.addClass(t,"selected"),i&&d.removeClass(i,"selected"),e(r,{from:i?this.getAttrObj(i,this.attrKeys):null,to:this.getAttrObj(t,this.attrKeys)})}},{key:"getAttrObj",value:function(r,t){if(!r||!t)return{};var e={};t.map(function(n){e[n]=r.getAttribute(n)});var i=r.getAttribute("data-index");return i&&(e.index=Number(i)),e}},{key:"show",value:function(){d.removeClass(this.root,"hide"),d.addClass(this.root,"active")}},{key:"hide",value:function(){d.removeClass(this.root,"active"),d.addClass(this.root,"hide")}},{key:"setStyle",value:function(r){var t=this;Object.keys(r).forEach(function(e){t.root.style[e]=r[e]})}},{key:"destroy",value:function(){this._delegates&&(this._delegates.map(function(r){r.destroy&&r.destroy()}),this._delegates=null),this.root.innerHTML=null,this.parent.removeChild(this.root),this.root=null}}]),a}(),re={SIDE:"side",MIDDLE:"middle",DEFAULT:"default"},Oe={CLICK:"click",HOVER:"hover"};function ns(a,s){return a===re.SIDE?s===V.CONTROLS_LEFT?"xg-side-list xg-left-side":"xg-side-list xg-right-side":""}var be=O.device==="mobile",ot=function(a){I(r,a);var s=P(r);function r(t){var e;return T(this,r),e=s.call(this,t),k(y(e),"onEnter",function(i){i.stopPropagation(),e.emit("icon_mouseenter",{pluginName:e.pluginName}),e.switchActiveState(i)}),k(y(e),"switchActiveState",function(i){i.stopPropagation();var n=e.config.toggleMode;n===Oe.CLICK?e.toggle(!e.isActive):e.toggle(!0)}),k(y(e),"onLeave",function(i){i.stopPropagation(),e.emit("icon_mouseleave",{pluginName:e.pluginName}),e.config.listType!==re.SIDE&&e.isActive&&e.toggle(!1)}),k(y(e),"onListEnter",function(i){e.enterType=2}),k(y(e),"onListLeave",function(i){e.enterType=0,e.isActive&&e.toggle(!1)}),e.isIcons=!1,e.isActive=!1,e.curValue=null,e.curIndex=0,e}return S(r,[{key:"updateLang",value:function(e){this.renderItemList(this.config.list,this.curIndex)}},{key:"afterCreate",value:function(){var e=this,i=this.config;this.initIcons(),be=be||this.domEventType==="touch",be&&O.device==="mobile"&&i.listType===re.DEFAULT&&(i.listType=re.SIDE),i.hidePortrait&&d.addClass(this.root,"portrait"),this.on([he,le],function(){e._resizeList()}),this.once(se,function(){i.list&&i.list.length>0&&(e.renderItemList(i.list),e.show())}),be&&this.on(kt,function(){e.isActive&&(e.optionsList&&e.optionsList.hide(),e.isActive=!1)}),be?(i.toggleMode=Oe.CLICK,this.activeEvent="touchend"):this.activeEvent=i.toggleMode===Oe.CLICK?"click":"mouseenter",i.toggleMode===Oe.CLICK?this.bind(this.activeEvent,this.switchActiveState):(this.bind(this.activeEvent,this.onEnter),this.bind("mouseleave",this.onLeave)),this.isIcons&&this.bind("click",this.onIconClick)}},{key:"initIcons",value:function(){var e=this,i=this.icons,n=Object.keys(i),o=!1;n.length>0&&(n.forEach(function(l){e.appendChild(".xgplayer-icon",i[l]),!o&&(o=i[l])}),this.isIcons=o),!o&&(this.appendChild(".xgplayer-icon",d.createDom("span","",{},"icon-text")),d.addClass(this.find(".xgplayer-icon"),"btn-text"))}},{key:"show",value:function(e){!this.config.list||this.config.list.length<2||d.addClass(this.root,"show")}},{key:"hide",value:function(){d.removeClass(this.root,"show")}},{key:"getTextByLang",value:function(e,i,n){if(e===void 0)return"";var o=this.config.list;!n&&(n=this.player.lang),i=!i||d.isUndefined(e[i])?"text":i,typeof e=="number"&&(e=o[e]);try{return G(e[i])==="object"?e[i][n]||e[i].en:e[i]}catch(l){return console.warn(l),""}}},{key:"toggle",value:function(e){if(!(e===this.isActive||this.config.disable)){var i=this.player.controls,n=this.config.listType;e?(n===re.SIDE?i.blur():i.focus(),this.optionsList&&this.optionsList.show()):(n===re.SIDE?i.focus():i.focusAwhile(),this.optionsList&&this.optionsList.hide()),this.isActive=e}}},{key:"onItemClick",value:function(e,i){e.stopPropagation();var n=this.config,o=n.listType,l=n.list;this.curIndex=i.to.index,this.curItem=l[this.curIndex],this.changeCurrentText();var u=this.config.isItemClickHide;(u||be||o===re.SIDE)&&this.toggle(!1)}},{key:"onIconClick",value:function(e){}},{key:"changeCurrentText",value:function(){if(!this.isIcons){var e=this.config.list,i=this.curIndex<e.length?this.curIndex:0,n=e[i];n&&(this.find(".icon-text").innerHTML=this.getTextByLang(n,"iconText"))}}},{key:"renderItemList",value:function(e,i){var n=this,o=this.config,l=this.optionsList,u=this.player;if(typeof i=="number"&&(this.curIndex=i,this.curItem=o.list[i]),l){l.renderItemList(e),this.changeCurrentText();return}var f={config:{data:e||[],className:ns(o.listType,o.position),onItemClick:function(m,_){n.onItemClick(m,_)},domEventType:be?"touch":"mouse"},root:o.listType===re.SIDE?u.innerContainer||u.root:this.root};if(this.config.isShowIcon){var h=this.player.root.getBoundingClientRect(),g=h.height,v=o.listType===re.MIDDLE?g-50:g;v&&o.heightLimit&&(f.config.maxHeight="".concat(v,"px")),this.optionsList=new is(f),this.changeCurrentText(),this.show()}this._resizeList()}},{key:"_resizeList",value:function(){if(this.config.heightLimit){var e=this.player.root.getBoundingClientRect(),i=e.height,n=this.config.listType===re.MIDDLE?i-50:i;this.optionsList&&this.optionsList.setStyle({maxHeight:"".concat(n,"px")})}}},{key:"destroy",value:function(){var e=this.config;e.toggleMode===Oe.CLICK?this.unbind(this.activeEvent,this.switchActiveState):(this.unbind(this.activeEvent,this.onEnter),this.unbind("mouseleave",this.onLeave)),this.isIcons&&this.unbind("click",this.onIconClick),this.optionsList&&(this.optionsList.destroy(),this.optionsList=null)}},{key:"render",value:function(){if(this.config.isShowIcon)return'<xg-icon class="xg-options-icon '.concat(this.config.className||"",`">
192
+ </xg-icon>`)}}}],[{key:"pluginName",get:function(){return"screenShot"}},{key:"defaultConfig",get:function(){return{position:V.CONTROLS_RIGHT,index:5,quality:.92,type:"image/png",format:".png",width:600,height:337,saveImg:!0,fitVideo:!0,disable:!1,name:"screenshot"}}}]),r}(Ee),is=function(){function a(s){T(this,a),this.config=s.config,this.parent=s.root,this.root=d.createDom("ul","",{},"xg-options-list xg-list-slide-scroll ".concat(this.config.className)),s.root.appendChild(this.root);var r=this.config.maxHeight;r&&this.setStyle({maxHeight:r}),this.onItemClick=this.onItemClick.bind(this),this.renderItemList();var t=this.config.domEventType==="touch"?"touchend":"click";this._delegates=B.delegate.call(this,this.root,"li",t,this.onItemClick)}return S(a,[{key:"renderItemList",value:function(r){var t=this,e=this.config,i=this.root;r?e.data=r:r=e.data,e.style&&Object.keys(e.style).map(function(n){i.style[n]=e[n]}),r.length>0&&(this.attrKeys=Object.keys(r[0])),this.root.innerHTML="",r.map(function(n,o){var l=n.selected?"option-item selected":"option-item";n["data-index"]=o,t.root.appendChild(d.createDom("li","<span>".concat(n.showText,"</span>"),n,l))})}},{key:"onItemClick",value:function(r){r.delegateTarget||(r.delegateTarget=r.target);var t=r.delegateTarget;if(t&&d.hasClass(t,"selected"))return!1;var e=typeof this.config.onItemClick=="function"?this.config.onItemClick:null,i=this.root.querySelector(".selected");d.addClass(t,"selected"),i&&d.removeClass(i,"selected"),e(r,{from:i?this.getAttrObj(i,this.attrKeys):null,to:this.getAttrObj(t,this.attrKeys)})}},{key:"getAttrObj",value:function(r,t){if(!r||!t)return{};var e={};t.map(function(n){e[n]=r.getAttribute(n)});var i=r.getAttribute("data-index");return i&&(e.index=Number(i)),e}},{key:"show",value:function(){d.removeClass(this.root,"hide"),d.addClass(this.root,"active")}},{key:"hide",value:function(){d.removeClass(this.root,"active"),d.addClass(this.root,"hide")}},{key:"setStyle",value:function(r){var t=this;Object.keys(r).forEach(function(e){t.root.style[e]=r[e]})}},{key:"destroy",value:function(){this._delegates&&(this._delegates.map(function(r){r.destroy&&r.destroy()}),this._delegates=null),this.root.innerHTML=null,this.parent.removeChild(this.root),this.root=null}}]),a}(),re={SIDE:"side",MIDDLE:"middle",DEFAULT:"default"},Oe={CLICK:"click",HOVER:"hover"};function ns(a,s){return a===re.SIDE?s===V.CONTROLS_LEFT?"xg-side-list xg-left-side":"xg-side-list xg-right-side":""}var we=O.device==="mobile",ot=function(a){I(r,a);var s=P(r);function r(t){var e;return T(this,r),e=s.call(this,t),k(y(e),"onEnter",function(i){i.stopPropagation(),e.emit("icon_mouseenter",{pluginName:e.pluginName}),e.switchActiveState(i)}),k(y(e),"switchActiveState",function(i){i.stopPropagation();var n=e.config.toggleMode;n===Oe.CLICK?e.toggle(!e.isActive):e.toggle(!0)}),k(y(e),"onLeave",function(i){i.stopPropagation(),e.emit("icon_mouseleave",{pluginName:e.pluginName}),e.config.listType!==re.SIDE&&e.isActive&&e.toggle(!1)}),k(y(e),"onListEnter",function(i){e.enterType=2}),k(y(e),"onListLeave",function(i){e.enterType=0,e.isActive&&e.toggle(!1)}),e.isIcons=!1,e.isActive=!1,e.curValue=null,e.curIndex=0,e}return S(r,[{key:"updateLang",value:function(e){this.renderItemList(this.config.list,this.curIndex)}},{key:"afterCreate",value:function(){var e=this,i=this.config;this.initIcons(),we=we||this.domEventType==="touch",we&&O.device==="mobile"&&i.listType===re.DEFAULT&&(i.listType=re.SIDE),i.hidePortrait&&d.addClass(this.root,"portrait"),this.on([he,le],function(){e._resizeList()}),this.once(se,function(){i.list&&i.list.length>0&&(e.renderItemList(i.list),e.show())}),we&&this.on(kt,function(){e.isActive&&(e.optionsList&&e.optionsList.hide(),e.isActive=!1)}),we?(i.toggleMode=Oe.CLICK,this.activeEvent="touchend"):this.activeEvent=i.toggleMode===Oe.CLICK?"click":"mouseenter",i.toggleMode===Oe.CLICK?this.bind(this.activeEvent,this.switchActiveState):(this.bind(this.activeEvent,this.onEnter),this.bind("mouseleave",this.onLeave)),this.isIcons&&this.bind("click",this.onIconClick)}},{key:"initIcons",value:function(){var e=this,i=this.icons,n=Object.keys(i),o=!1;n.length>0&&(n.forEach(function(l){e.appendChild(".xgplayer-icon",i[l]),!o&&(o=i[l])}),this.isIcons=o),!o&&(this.appendChild(".xgplayer-icon",d.createDom("span","",{},"icon-text")),d.addClass(this.find(".xgplayer-icon"),"btn-text"))}},{key:"show",value:function(e){!this.config.list||this.config.list.length<2||d.addClass(this.root,"show")}},{key:"hide",value:function(){d.removeClass(this.root,"show")}},{key:"getTextByLang",value:function(e,i,n){if(e===void 0)return"";var o=this.config.list;!n&&(n=this.player.lang),i=!i||d.isUndefined(e[i])?"text":i,typeof e=="number"&&(e=o[e]);try{return G(e[i])==="object"?e[i][n]||e[i].en:e[i]}catch(l){return console.warn(l),""}}},{key:"toggle",value:function(e){if(!(e===this.isActive||this.config.disable)){var i=this.player.controls,n=this.config.listType;e?(n===re.SIDE?i.blur():i.focus(),this.optionsList&&this.optionsList.show()):(n===re.SIDE?i.focus():i.focusAwhile(),this.optionsList&&this.optionsList.hide()),this.isActive=e}}},{key:"onItemClick",value:function(e,i){e.stopPropagation();var n=this.config,o=n.listType,l=n.list;this.curIndex=i.to.index,this.curItem=l[this.curIndex],this.changeCurrentText();var u=this.config.isItemClickHide;(u||we||o===re.SIDE)&&this.toggle(!1)}},{key:"onIconClick",value:function(e){}},{key:"changeCurrentText",value:function(){if(!this.isIcons){var e=this.config.list,i=this.curIndex<e.length?this.curIndex:0,n=e[i];n&&(this.find(".icon-text").innerHTML=this.getTextByLang(n,"iconText"))}}},{key:"renderItemList",value:function(e,i){var n=this,o=this.config,l=this.optionsList,u=this.player;if(typeof i=="number"&&(this.curIndex=i,this.curItem=o.list[i]),l){l.renderItemList(e),this.changeCurrentText();return}var f={config:{data:e||[],className:ns(o.listType,o.position),onItemClick:function(m,_){n.onItemClick(m,_)},domEventType:we?"touch":"mouse"},root:o.listType===re.SIDE?u.innerContainer||u.root:this.root};if(this.config.isShowIcon){var h=this.player.root.getBoundingClientRect(),p=h.height,v=o.listType===re.MIDDLE?p-50:p;v&&o.heightLimit&&(f.config.maxHeight="".concat(v,"px")),this.optionsList=new is(f),this.changeCurrentText(),this.show()}this._resizeList()}},{key:"_resizeList",value:function(){if(this.config.heightLimit){var e=this.player.root.getBoundingClientRect(),i=e.height,n=this.config.listType===re.MIDDLE?i-50:i;this.optionsList&&this.optionsList.setStyle({maxHeight:"".concat(n,"px")})}}},{key:"destroy",value:function(){var e=this.config;e.toggleMode===Oe.CLICK?this.unbind(this.activeEvent,this.switchActiveState):(this.unbind(this.activeEvent,this.onEnter),this.unbind("mouseleave",this.onLeave)),this.isIcons&&this.unbind("click",this.onIconClick),this.optionsList&&(this.optionsList.destroy(),this.optionsList=null)}},{key:"render",value:function(){if(this.config.isShowIcon)return'<xg-icon class="xg-options-icon '.concat(this.config.className||"",`">
193
193
  <div class="xgplayer-icon">
194
194
  </div>
195
- </xg-icon>`)}}],[{key:"pluginName",get:function(){return"optionsIcon"}},{key:"defaultConfig",get:function(){return{position:V.CONTROLS_RIGHT,index:100,list:[],listType:"default",listStyle:{},hidePortrait:!0,isShowIcon:!1,isItemClickHide:!0,toggleMode:Oe.HOVER,heightLimit:!0}}}]),r}(B),rs=function(a){I(r,a);var s=P(r);function r(t){var e;return T(this,r),e=s.call(this,t),e.curTime=0,e.isPaused=!0,e}return S(r,[{key:"beforeCreate",value:function(e){var i=e.config.list;Array.isArray(i)&&i.length>0&&(e.config.list=i.map(function(n){return!n.text&&n.name&&(n.text=n.name),n.text||(n.text=n.definition),n}))}},{key:"afterCreate",value:function(){var e=this;L(A(r.prototype),"afterCreate",this).call(this),this.on("resourceReady",function(i){e.changeDefinitionList(i)}),this.on(Tt,function(i){e.renderItemList(e.config.list,i.to)}),this.player.definitionList.length<2&&this.hide()}},{key:"show",value:function(e){!this.config.list||this.config.list.length<2||d.addClass(this.root,"show")}},{key:"initDefinition",value:function(){var e=this.config,i=e.list,n=e.defaultDefinition;if(i.length>0){var o=null;i.map(function(l){l.definition===n&&(o=l)}),o||(o=i[0]),this.changeDefinition(o)}}},{key:"renderItemList",value:function(){var e=this,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.config.list||[],n=arguments.length>1?arguments[1]:void 0,o=n&&n.definition?n.definition:this.config.defaultDefinition;n&&i.forEach(function(f){f.selected=!1});var l=0,u=i.map(function(f,h){var g=U(U({},f),{},{showText:e.getTextByLang(f)||f.definition,selected:!1});return(f.selected||f.definition&&f.definition==o)&&(g.selected=!0,l=h),g});L(A(r.prototype),"renderItemList",this).call(this,u,l)}},{key:"changeDefinitionList",value:function(e){Array.isArray(e)&&(this.config.list=e.map(function(i){return!i.text&&i.name&&(i.text=i.name),i.text||(i.text=i.definition),i}),this.renderItemList(),this.config.list.length<2?this.hide():this.show())}},{key:"changeDefinition",value:function(e,i){this.player.changeDefinition(e,i)}},{key:"onItemClick",value:function(e,i){var n=this.player.definitionList;L(A(r.prototype),"onItemClick",this).apply(this,arguments),this.emitUserAction(e,"change_definition",{from:i.from,to:i.to});for(var o=0;o<n.length;o++)i.to&&n[o].definition===i.to.definition&&(i.to.url=n[o].url),i.from&&n[o].definition===i.from.definition&&(i.from.url=n[o].url);this.player.changeDefinition(i.to,i.from)}}],[{key:"pluginName",get:function(){return"definition"}},{key:"defaultConfig",get:function(){return U(U({},ot.defaultConfig),{},{position:V.CONTROLS_RIGHT,index:3,list:[],defaultDefinition:"",disable:!1,hidePortrait:!1,className:"xgplayer-definition",isShowIcon:!0})}}]),r}(ot),os=function(a){I(r,a);var s=P(r);function r(t){var e;return T(this,r),e=s.call(this,t),e.curRate=1,e}return S(r,[{key:"beforeCreate",value:function(e){var i=e.player.config.playbackRate,n=i?Array.isArray(i)?i:e.config.list:[];Array.isArray(n)&&(e.config.list=n.map(function(o){return typeof o=="number"?o={rate:o,text:"".concat(o,"x")}:!o.text&&o.rate&&(o.text="".concat(o.rate,"x")),o}))}},{key:"afterCreate",value:function(){var e=this;L(A(r.prototype),"afterCreate",this).call(this),this.on(ri,function(){e.curValue!==e.player.playbackRate&&e.renderItemList()}),this.renderItemList()}},{key:"show",value:function(e){!this.config.list||this.config.list.length===0||L(A(r.prototype),"show",this).call(this)}},{key:"onItemClick",value:function(e,i){L(A(r.prototype),"onItemClick",this).call(this,e,i);var n=e.delegateTarget,o=Number(n.getAttribute("rate"));if(!o||o===this.curValue)return!1;var l={playbackRate:{from:this.player.playbackRate,to:o}};this.emitUserAction(e,"change_rate",{props:l}),this.curValue=o,this.player.playbackRate=o}},{key:"renderItemList",value:function(){var e=this,i=this.player.playbackRate||1;this.curValue=i;var n=-1,o=this.config.list.map(function(l,u){var f={rate:l.rate};return f.rate===i&&(f.selected=!0,n=u),f.showText=e.getTextByLang(l),f});L(A(r.prototype),"renderItemList",this).call(this,o,n)}},{key:"changeCurrentText",value:function(){if(!this.isIcons){var e=this.config.list,i=this.curIndex<e.length?this.curIndex:0,n=e[i],o="";!n||this.curIndex<0?o="".concat(this.player.playbackRate,"x"):o=this.getTextByLang(n,"iconText"),this.find(".icon-text").innerHTML=o}}},{key:"destroy",value:function(){L(A(r.prototype),"destroy",this).call(this)}}],[{key:"pluginName",get:function(){return"playbackRate"}},{key:"defaultConfig",get:function(){return U(U({},ot.defaultConfig),{},{position:V.CONTROLS_RIGHT,index:4,list:[2,1.5,1,.75,.5],className:"xgplayer-playbackrate",isShowIcon:!0,hidePortrait:!1})}}]),r}(ot);function ss(){return new DOMParser().parseFromString(`<svg xmlns="http://www.w3.org/2000/svg" width="31" height="40" viewBox="0 -5 31 40">
195
+ </xg-icon>`)}}],[{key:"pluginName",get:function(){return"optionsIcon"}},{key:"defaultConfig",get:function(){return{position:V.CONTROLS_RIGHT,index:100,list:[],listType:"default",listStyle:{},hidePortrait:!0,isShowIcon:!1,isItemClickHide:!0,toggleMode:Oe.HOVER,heightLimit:!0}}}]),r}(B),rs=function(a){I(r,a);var s=P(r);function r(t){var e;return T(this,r),e=s.call(this,t),e.curTime=0,e.isPaused=!0,e}return S(r,[{key:"beforeCreate",value:function(e){var i=e.config.list;Array.isArray(i)&&i.length>0&&(e.config.list=i.map(function(n){return!n.text&&n.name&&(n.text=n.name),n.text||(n.text=n.definition),n}))}},{key:"afterCreate",value:function(){var e=this;L(A(r.prototype),"afterCreate",this).call(this),this.on("resourceReady",function(i){e.changeDefinitionList(i)}),this.on(Tt,function(i){e.renderItemList(e.config.list,i.to)}),this.player.definitionList.length<2&&this.hide()}},{key:"show",value:function(e){!this.config.list||this.config.list.length<2||d.addClass(this.root,"show")}},{key:"initDefinition",value:function(){var e=this.config,i=e.list,n=e.defaultDefinition;if(i.length>0){var o=null;i.map(function(l){l.definition===n&&(o=l)}),o||(o=i[0]),this.changeDefinition(o)}}},{key:"renderItemList",value:function(){var e=this,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.config.list||[],n=arguments.length>1?arguments[1]:void 0,o=n&&n.definition?n.definition:this.config.defaultDefinition;n&&i.forEach(function(f){f.selected=!1});var l=0,u=i.map(function(f,h){var p=U(U({},f),{},{showText:e.getTextByLang(f)||f.definition,selected:!1});return(f.selected||f.definition&&f.definition==o)&&(p.selected=!0,l=h),p});L(A(r.prototype),"renderItemList",this).call(this,u,l)}},{key:"changeDefinitionList",value:function(e){Array.isArray(e)&&(this.config.list=e.map(function(i){return!i.text&&i.name&&(i.text=i.name),i.text||(i.text=i.definition),i}),this.renderItemList(),this.config.list.length<2?this.hide():this.show())}},{key:"changeDefinition",value:function(e,i){this.player.changeDefinition(e,i)}},{key:"onItemClick",value:function(e,i){var n=this.player.definitionList;L(A(r.prototype),"onItemClick",this).apply(this,arguments),this.emitUserAction(e,"change_definition",{from:i.from,to:i.to});for(var o=0;o<n.length;o++)i.to&&n[o].definition===i.to.definition&&(i.to.url=n[o].url),i.from&&n[o].definition===i.from.definition&&(i.from.url=n[o].url);this.player.changeDefinition(i.to,i.from)}}],[{key:"pluginName",get:function(){return"definition"}},{key:"defaultConfig",get:function(){return U(U({},ot.defaultConfig),{},{position:V.CONTROLS_RIGHT,index:3,list:[],defaultDefinition:"",disable:!1,hidePortrait:!1,className:"xgplayer-definition",isShowIcon:!0})}}]),r}(ot),os=function(a){I(r,a);var s=P(r);function r(t){var e;return T(this,r),e=s.call(this,t),e.curRate=1,e}return S(r,[{key:"beforeCreate",value:function(e){var i=e.player.config.playbackRate,n=i?Array.isArray(i)?i:e.config.list:[];Array.isArray(n)&&(e.config.list=n.map(function(o){return typeof o=="number"?o={rate:o,text:"".concat(o,"x")}:!o.text&&o.rate&&(o.text="".concat(o.rate,"x")),o}))}},{key:"afterCreate",value:function(){var e=this;L(A(r.prototype),"afterCreate",this).call(this),this.on(ri,function(){e.curValue!==e.player.playbackRate&&e.renderItemList()}),this.renderItemList()}},{key:"show",value:function(e){!this.config.list||this.config.list.length===0||L(A(r.prototype),"show",this).call(this)}},{key:"onItemClick",value:function(e,i){L(A(r.prototype),"onItemClick",this).call(this,e,i);var n=e.delegateTarget,o=Number(n.getAttribute("rate"));if(!o||o===this.curValue)return!1;var l={playbackRate:{from:this.player.playbackRate,to:o}};this.emitUserAction(e,"change_rate",{props:l}),this.curValue=o,this.player.playbackRate=o}},{key:"renderItemList",value:function(){var e=this,i=this.player.playbackRate||1;this.curValue=i;var n=-1,o=this.config.list.map(function(l,u){var f={rate:l.rate};return f.rate===i&&(f.selected=!0,n=u),f.showText=e.getTextByLang(l),f});L(A(r.prototype),"renderItemList",this).call(this,o,n)}},{key:"changeCurrentText",value:function(){if(!this.isIcons){var e=this.config.list,i=this.curIndex<e.length?this.curIndex:0,n=e[i],o="";!n||this.curIndex<0?o="".concat(this.player.playbackRate,"x"):o=this.getTextByLang(n,"iconText"),this.find(".icon-text").innerHTML=o}}},{key:"destroy",value:function(){L(A(r.prototype),"destroy",this).call(this)}}],[{key:"pluginName",get:function(){return"playbackRate"}},{key:"defaultConfig",get:function(){return U(U({},ot.defaultConfig),{},{position:V.CONTROLS_RIGHT,index:4,list:[2,1.5,1,.75,.5],className:"xgplayer-playbackrate",isShowIcon:!0,hidePortrait:!1})}}]),r}(ot);function ss(){return new DOMParser().parseFromString(`<svg xmlns="http://www.w3.org/2000/svg" width="31" height="40" viewBox="0 -5 31 40">
196
196
  <path fill="#fff" transform="scale(1.3, 1.3)" class='path_full' d="M9,10v1a.9.9,0,0,1-1,1,.9.9,0,0,1-1-1V9A.9.9,0,0,1,8,8h2a.9.9,0,0,1,1,1,.9.9,0,0,1-1,1Zm6,4V13a1,1,0,0,1,2,0v2a.9.9,0,0,1-1,1H14a1,1,0,0,1,0-2Zm3-7H6V17H18Zm2,0V17a2,2,0,0,1-2,2H6a2,2,0,0,1-2-2V7A2,2,0,0,1,6,5H18A2,2,0,0,1,20,7Z"></path>
197
197
  </svg>
198
198
  `,"image/svg+xml").firstChild}function as(){return new DOMParser().parseFromString(`<svg xmlns="http://www.w3.org/2000/svg" width="31" height="40" viewBox="0 -5 31 40">
@@ -207,9 +207,9 @@ Use Save As... to download, then click back to return to this page.`)&&(location
207
207
  <span class="xgplayer-error-text"></span>
208
208
  <span class="xgplayer-error-tips"><em class="xgplayer-error-refresh"></em></span>
209
209
  </div>
210
- </xg-error>`}}],[{key:"pluginName",get:function(){return"error"}}]),r}(B),us=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;this.intervalId=0,this.customConfig=null,this.bind(".highlight",["click","touchend"],function(i){(e.config.onClick||e.customOnClick)&&(i.preventDefault(),i.stopPropagation(),e.customOnClick?e.customOnClick(i):e.config.onClick(i))}),this.player.showPrompt=function(){e.showPrompt.apply(e,arguments)},this.player.hidePrompt=function(){e.hide()}}},{key:"setStyle",value:function(e){var i=this;Object.keys(e).map(function(n){i.root.style[n]=e[n]})}},{key:"showPrompt",value:function(e){var i=this,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(){};if(e){this.customOnClick=o;var l=this.config.interval;this.intervalId&&(clearTimeout(this.intervalId),this.intervalId=null),d.addClass(this.root,"show"),n.mode==="arrow"&&d.addClass(this.root,"arrow"),typeof e=="string"?this.find(".xgplayer-prompt-detail").innerHTML=e:this.find(".xgplayer-prompt-detail").innerHTML="".concat(e.text||"")+"".concat(e.highlight?'<i class="highlight">'.concat(e.highlight,"</i>"):""),n.style&&this.setStyle(n.style);var u=typeof n.autoHide=="boolean"?n.autoHide:this.config.autoHide;if(u){var f=n.interval||l;this.intervalId=setTimeout(function(){i.hide()},f)}}}},{key:"hide",value:function(){d.removeClass(this.root,"show"),d.removeClass(this.root,"arrow"),this.root.removeAttribute("style"),this.customOnClick=null}},{key:"render",value:function(){return'<xg-prompt class="xgplayer-prompt '.concat(b.CONTROLS_FOLLOW,`">
210
+ </xg-error>`}}],[{key:"pluginName",get:function(){return"error"}}]),r}(B),us=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;this.intervalId=0,this.customConfig=null,this.bind(".highlight",["click","touchend"],function(i){(e.config.onClick||e.customOnClick)&&(i.preventDefault(),i.stopPropagation(),e.customOnClick?e.customOnClick(i):e.config.onClick(i))}),this.player.showPrompt=function(){e.showPrompt.apply(e,arguments)},this.player.hidePrompt=function(){e.hide()}}},{key:"setStyle",value:function(e){var i=this;Object.keys(e).map(function(n){i.root.style[n]=e[n]})}},{key:"showPrompt",value:function(e){var i=this,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(){};if(e){this.customOnClick=o;var l=this.config.interval;this.intervalId&&(clearTimeout(this.intervalId),this.intervalId=null),d.addClass(this.root,"show"),n.mode==="arrow"&&d.addClass(this.root,"arrow"),typeof e=="string"?this.find(".xgplayer-prompt-detail").innerHTML=e:this.find(".xgplayer-prompt-detail").innerHTML="".concat(e.text||"")+"".concat(e.highlight?'<i class="highlight">'.concat(e.highlight,"</i>"):""),n.style&&this.setStyle(n.style);var u=typeof n.autoHide=="boolean"?n.autoHide:this.config.autoHide;if(u){var f=n.interval||l;this.intervalId=setTimeout(function(){i.hide()},f)}}}},{key:"hide",value:function(){d.removeClass(this.root,"show"),d.removeClass(this.root,"arrow"),this.root.removeAttribute("style"),this.customOnClick=null}},{key:"render",value:function(){return'<xg-prompt class="xgplayer-prompt '.concat(w.CONTROLS_FOLLOW,`">
211
211
  <span class="xgplayer-prompt-detail"></span>
212
- </xg-prompt>`)}}],[{key:"pluginName",get:function(){return"prompt"}},{key:"defaultConfig",get:function(){return{interval:3e3,style:{},mode:"arrow",autoHide:!0,detail:{text:"",highlight:""},onClick:function(){}}}}]),r}(B),Yi={time:0,text:"",id:1,duration:1,color:"#fff",style:{},width:6,height:6};function Xi(a){Object.keys(Yi).map(function(s){a[s]===void 0&&(a[s]=Yi[s])})}var qi={_updateDotDom:function(s,r){if(r){var t=this.calcuPosition(s.time,s.duration),e=s.style||{};e.left="".concat(t.left,"%"),e.width="".concat(t.width,"%"),r.setAttribute("data-text",s.text),r.setAttribute("data-time",s.time),t.isMini?d.addClass(r,"mini"):d.removeClass(r,"mini"),Object.keys(e).map(function(i){r.style[i]=e[i]})}},initDots:function(){var s=this;this._ispots.map(function(r){s.createDot(r,!1)}),this.ispotsInit=!0},createDot:function(s){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,t=this.player.plugins.progress;if(t&&(r&&(Xi(s),this._ispots.push(s)),!(!this.ispotsInit&&r))){var e=this.calcuPosition(s.time,s.duration),i=s.style||{};i.left="".concat(e.left,"%"),i.width="".concat(e.width,"%");var n="xgspot_".concat(s.id," xgplayer-spot");e.isMini&&(n+=" mini");var o=s.template?'<div class="xgplayer-spot-pop">'.concat(s.template,"</div>"):"",l=d.createDom("xg-spot",o,{"data-text":s.text,"data-time":s.time,"data-id":s.id},n);Object.keys(i).map(function(u){l.style[u]=i[u]}),t.outer&&t.outer.appendChild(l),this.positionDot(l,s.id)}},findDot:function(s){if(this.player.plugins.progress){var r=this._ispots.filter(function(t,e){return t.id===s});return r.length>0?r[0]:null}},updateDot:function(s){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,t=this.player.plugins.progress;if(t){var e=this.findDot(s.id);if(e&&Object.keys(s).map(function(n){e[n]=s[n]}),!!this.ispotsInit){var i=t.find('xg-spot[data-id="'.concat(s.id,'"]'));i&&(this._updateDotDom(s,i),r&&this.showDot(s.id))}}},deleteDot:function(s){var r=this._ispots,t=this.player.plugins.progress;if(t){for(var e=[],i=0;i<r.length;i++)r[i].id===s&&e.push(i);for(var n=e.length,o=n-1;o>=0;o--)if(r.splice(e[o],1),this.ispotsInit){var l=t.find('xg-spot[data-id="'.concat(s,'"]'));l&&l.parentElement.removeChild(l)}}},deleteAllDots:function(){var s=this.player.plugins.progress;if(s){if(!this.ispotsInit){this._ispots=[];return}for(var r=s.root.getElementsByTagName("xg-spot"),t=r.length-1;t>=0;t--)s.outer.removeChild(r[t]);this._ispots=[]}},updateAllDots:function(){var s=this,r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=this.player.plugins.progress;if(t){if(!this.ispotsInit){this._ispots=r;return}this._ispots=[];var e=t.root.getElementsByTagName("xg-spot"),i=e.length;if(i>r.length)for(var n=i-1;n>r.length-1;n--)t.outer.removeChild(e[n]);r.forEach(function(o,l){l<i?(e[l].setAttribute("data-id","".concat(o.id)),s._ispots.push(o),s.updateDot(o)):s.createDot(o)})}},positionDots:function(){var s=this,r=this._ispots,t=this.playerSize,e=this.player.sizeInfo,i=this.player.plugins.progress;!i||e.width===t.width||(t.width=e.width,t.left=e.left,r.forEach(function(n){var o=i.find('xg-spot[data-id="'.concat(n.id,'"]'));o&&s.positionDot(o,n.id)}))},positionDot:function(s,r){var t=d.findDom(s,".xgplayer-spot-pop");if(t){var e=this.playerSize,i=s.getBoundingClientRect(),n=t.getBoundingClientRect(),o=i.left-e.left,l=e.width-o-i.width/2;if(o<n.width/2||e.width<n.width){var u=n.width/2-o;t.style.left="".concat(u,"px")}else if(l<n.width/2){var f=l-n.width/2+i.width/2;t.style.left="".concat(f,"px")}else t.style.left="50%"}},updateDuration:function(){var s=this,r=this.player.plugins.progress;if(r){var t=this._ispots;t.forEach(function(e){var i=r.find('xg-spot[data-id="'.concat(e.id,'"]'));s._updateDotDom(e,i)})}},getAllDotsDom:function(){var s=this.player.plugins.progress;if(!s)return[];var r=s.root.getElementsByTagName("xg-spot");return r},getDotDom:function(s){var r=this.player.plugins.progress;if(r)return r.find('xg-spot[data-id="'.concat(s,'"]'))}};function cs(a){var s=a.config,r=a.player;Object.keys(qi).map(function(e){a[e]=qi[e].bind(a)});var t=r.config.progressDot||s.ispots||[];a._ispots=t.map(function(e){return Xi(e),e}),a.ispotsInit=!1,a.playerSize={left:r.sizeInfo.left,width:r.sizeInfo.width},a.on(fe,function(){a.ispotsInit?a.updateDuration():a.initDots()}),a.on(he,function(){a.positionDots()})}var Re={dragmove:"onProgressMove",dragstart:"onProgressDragStart",dragend:"onProgressDragEnd",click:"onProgressClick",mouseover:"onProgressMouseOver",mouseenter:"onProgressMouseOver"},fs=function(a){I(r,a);var s=P(r);function r(t){var e;return T(this,r),e=s.call(this,t),k(y(e),"onMousemove",function(i){if(!e.config.disable){if(d.hasClass(i.target,"xg-spot-content")&&e.config.isHideThumbnailHover){e.player.plugins.progress.onMouseLeave(i);return}(e._state.f||d.hasClass(i.target,"xg-spot-content"))&&(d.event(i),i.stopPropagation())}}),k(y(e),"onMousedown",function(i){e.config.disable||(e._state.f||d.hasClass(i.target,"xg-spot-content"))&&(d.event(i),i.stopPropagation())}),k(y(e),"onMouseup",function(i){if(e.isDrag){var n=e.player.plugins.progress;n&&n.pos&&(n.onMouseUp(i),!n.pos.isEnter&&n.onMouseLeave(i))}}),k(y(e),"onDotMouseLeave",function(i){if(!e.config.disable){e._curDot.removeEventListener("mouseleave",e.onDotMouseLeave),e.blurDot(i.target),e._curDot=null;var n=e.player.plugins.progress;n&&n.enableBlur(),e.show()}}),k(y(e),"onProgressMouseOver",function(i,n){if(!e.config.disable&&d.hasClass(n.target,"xgplayer-spot")&&!e._curDot){e._curDot=n.target,e.focusDot(n.target),e._curDot.children.length>0&&e.hide();var o=e.player.plugins.progress;o&&o.disableBlur(),e._curDot.addEventListener("mouseleave",e.onDotMouseLeave)}}),e._ispots=[],e.videoPreview=null,e.videothumbnail=null,e.thumbnail=null,e.timeStr="",e._state={now:0,f:!1},e}return S(r,[{key:"beforeCreate",value:function(e){var i=e.player.plugins.progress;i&&(e.root=i.root)}},{key:"afterCreate",value:function(){var e=this;this._curDot=null,this.handlerSpotClick=this.hook("spotClick",function(i,n){n.seekTime&&e.player.seek(n.seekTime)}),this.transformTimeHook=this.hook("transformTime",function(i){e.setTimeContent(d.format(i))}),cs(this),this.on(fe,function(){e.show()}),this.config.disable&&this.disable(),this.extTextRoot=this.find(".xg-spot-ext-text")}},{key:"setConfig",value:function(e){var i=this;e&&Object.keys(e).map(function(n){i.config[n]=e[n]})}},{key:"onPluginsReady",value:function(){var e=this.player;e.plugins.progress&&(this.previewLine=this.find(".xg-spot-line"),this.timePoint=this.find(".xgplayer-progress-point"),this.timeText=this.find(".xg-spot-time"),this.tipText=this.find(".spot-inner-text"),this._hasThumnail=!1,this.registerThumbnail(),this.bindEvents())}},{key:"bindEvents",value:function(){var e=this,i=this.player.plugins.progress;if(i&&(Object.keys(Re).map(function(o){e[Re[o]]=e[Re[o]].bind(e),i.addCallBack(o,e[Re[o]])}),O.device!=="mobile")){this.bind(".xg-spot-info","mousemove",this.onMousemove),this.bind(".xg-spot-info","mousedown",this.onMousedown),this.bind(".xg-spot-info","mouseup",this.onMouseup);var n=this.hook("previewClick",function(){});this.handlerPreviewClick=function(o){o.stopPropagation(),n(parseInt(e._state.now*1e3,10)/1e3,o)},this.bind(".xg-spot-content","mouseup",this.handlerPreviewClick)}}},{key:"onProgressMove",value:function(e,i){this.config.disable||!this.player.duration||this.updatePosition(e.offset,e.width,e.currentTime,e.e)}},{key:"onProgressDragStart",value:function(e){this.config.disable||!this.player.duration||(this.isDrag=!0,this.videoPreview&&d.addClass(this.videoPreview,"show"))}},{key:"onProgressDragEnd",value:function(e){this.config.disable||!this.player.duration||(this.isDrag=!1,this.videoPreview&&d.removeClass(this.videoPreview,"show"))}},{key:"onProgressClick",value:function(e,i){this.config.disable||d.hasClass(i.target,"xgplayer-spot")&&(i.stopPropagation(),i.preventDefault(),["time","id","text"].map(function(n){e[n]=i.target.getAttribute("data-".concat(n))}),e.time&&(e.time=Number(e.time)),this.handlerSpotClick(i,e))}},{key:"updateLinePos",value:function(e,i){var n=this.root,o=this.previewLine,l=this.player,u=this.config,f=l.controls.mode,h=f==="flex",g=n.getBoundingClientRect().width;if(!(!g&&this._hasThumnail)){g=this._hasThumnail&&g<u.width?u.width:g;var v=e-g/2,p;v<0&&!h?(v=0,p=e-g/2):v>i-g&&!h?(p=v-(i-g),v=i-g):p=0,p!==void 0&&(o.style.transform="translateX(".concat(p.toFixed(2),"px)")),n.style.transform="translateX(".concat(v.toFixed(2),"px) translateZ(0)")}}},{key:"updateTimeText",value:function(e){var i=this.timeText,n=this.timePoint;i.innerHTML=e,!this.thumbnail&&(n.innerHTML=e)}},{key:"updatePosition",value:function(e,i,n,o){var l=this.root,u=this.config,f=this._state;if(l){f.now=n,this.transformTimeHook(n);var h=this.timeStr;o&&o.target&&d.hasClass(o.target,"xgplayer-spot")?(this.showTips(o.target.getAttribute("data-text"),!1,h),this.focusDot(o.target),f.f=!0,u.isFocusDots&&f.f&&(f.now=parseInt(o.target.getAttribute("data-time"),10))):u.defaultText?(f.f=!1,this.showTips(u.defaultText,!0,h)):(f.f=!1,this.hideTips("")),this.updateTimeText(h),this.updateThumbnails(f.now),this.updateLinePos(e,i)}}},{key:"setTimeContent",value:function(e){this.timeStr=e}},{key:"updateThumbnails",value:function(e){var i=this.player,n=this.videoPreview,o=this.config,l=i.plugins.thumbnail;if(l&&l.usable){this.thumbnail&&l.update(this.thumbnail,e,o.width,o.height);var u=n&&n.getBoundingClientRect();this.videothumbnail&&l.update(this.videothumbnail,e,u.width,u.height)}}},{key:"registerThumbnail",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(O.device!=="mobile"){var i=this.player,n=this.config,o=i.getPlugin("thumbnail");if(o&&o.setConfig(e),!o||!o.usable||!n.isShowThumbnail){d.addClass(this.root,"short-line no-thumbnail");return}else d.removeClass(this.root,"short-line no-thumbnail");n.mode==="short"&&d.addClass(this.root,"short-line"),this._hasThumnail=!0;var l=this.find(".xg-spot-thumbnail");this.thumbnail=o.createThumbnail(l,"progress-thumbnail"),n.isShowCoverPreview&&(this.videoPreview=d.createDom("xg-video-preview","",{},"xgvideo-preview"),i.root.appendChild(this.videoPreview),this.videothumbnail=o.createThumbnail(this.videoPreview,"xgvideo-thumbnail")),this.updateThumbnails(0)}}},{key:"calcuPosition",value:function(e,i){var n=this.player.plugins.progress,o=this.player,l=n.root.getBoundingClientRect().width,u=o.duration/l*6;return e+i>o.duration&&(i=o.duration-e),e/o.duration*100,i/o.duration,{left:e/o.duration*100,width:i/o.duration*100,isMini:i<u}}},{key:"showDot",value:function(e){var i=this.findDot(e);if(i){var n=this.root.getBoundingClientRect(),o=n.width,l=i.time/this.player.duration*o;this.updatePosition(l,o,i.time)}}},{key:"focusDot",value:function(e,i){e&&(i||(i=e.getAttribute("data-id")),d.addClass(e,"active"),this._activeDotId=i)}},{key:"blurDot",value:function(e){if(!e){var i=this._activeDotId;e=this.getDotDom(i)}e&&(d.removeClass(e,"active"),this._activeDotId=null)}},{key:"showTips",value:function(e,i){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"";d.addClass(this.root,"no-timepoint"),e&&(d.addClass(this.find(".xg-spot-content"),"show-text"),i&&this.config.mode==="production"?(d.addClass(this.root,"product"),this.tipText.textContent=e):(d.removeClass(this.root,"product"),this.tipText.textContent=this._hasThumnail?e:"".concat(n," ").concat(e)))}},{key:"hideTips",value:function(){d.removeClass(this.root,"no-timepoint"),this.tipText.textContent="",d.removeClass(this.find(".xg-spot-content"),"show-text"),d.removeClass(this.root,"product")}},{key:"hide",value:function(){d.addClass(this.root,"hide")}},{key:"show",value:function(e){d.removeClass(this.root,"hide")}},{key:"enable",value:function(){var e=this.config,i=this.playerConfig;this.config.disable=!1,this.show(),!this.thumbnail&&e.isShowThumbnail&&this.registerThumbnail(i.thumbnail||{})}},{key:"disable",value:function(){this.config.disable=!0,this.hide()}},{key:"destroy",value:function(){var e=this,i=this.player.plugins.progress;i&&Object.keys(Re).map(function(n){i.removeCallBack(n,e[Re[n]])}),this.videothumbnail=null,this.thumbnail=null,this.videoPreview&&this.player.root.removeChild(this.videoPreview),this.unbind(".xg-spot-info","mousemove",this.onMousemove),this.unbind(".xg-spot-info","mousedown",this.onMousedown),this.unbind(".xg-spot-info","mouseup",this.onMouseup),this.unbind(".xg-spot-content","mouseup",this.handlerPreviewClick)}},{key:"render",value:function(){return O.device==="mobile"||this.playerConfig.isMobileSimulateMode==="mobile"?"":'<div class="xg-spot-info hide '.concat(this.config.mode==="short"?"short-line":"",`">
212
+ </xg-prompt>`)}}],[{key:"pluginName",get:function(){return"prompt"}},{key:"defaultConfig",get:function(){return{interval:3e3,style:{},mode:"arrow",autoHide:!0,detail:{text:"",highlight:""},onClick:function(){}}}}]),r}(B),Yi={time:0,text:"",id:1,duration:1,color:"#fff",style:{},width:6,height:6};function Xi(a){Object.keys(Yi).map(function(s){a[s]===void 0&&(a[s]=Yi[s])})}var qi={_updateDotDom:function(s,r){if(r){var t=this.calcuPosition(s.time,s.duration),e=s.style||{};e.left="".concat(t.left,"%"),e.width="".concat(t.width,"%"),r.setAttribute("data-text",s.text),r.setAttribute("data-time",s.time),t.isMini?d.addClass(r,"mini"):d.removeClass(r,"mini"),Object.keys(e).map(function(i){r.style[i]=e[i]})}},initDots:function(){var s=this;this._ispots.map(function(r){s.createDot(r,!1)}),this.ispotsInit=!0},createDot:function(s){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,t=this.player.plugins.progress;if(t&&(r&&(Xi(s),this._ispots.push(s)),!(!this.ispotsInit&&r))){var e=this.calcuPosition(s.time,s.duration),i=s.style||{};i.left="".concat(e.left,"%"),i.width="".concat(e.width,"%");var n="xgspot_".concat(s.id," xgplayer-spot");e.isMini&&(n+=" mini");var o=s.template?'<div class="xgplayer-spot-pop">'.concat(s.template,"</div>"):"",l=d.createDom("xg-spot",o,{"data-text":s.text,"data-time":s.time,"data-id":s.id},n);Object.keys(i).map(function(u){l.style[u]=i[u]}),t.outer&&t.outer.appendChild(l),this.positionDot(l,s.id)}},findDot:function(s){if(this.player.plugins.progress){var r=this._ispots.filter(function(t,e){return t.id===s});return r.length>0?r[0]:null}},updateDot:function(s){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,t=this.player.plugins.progress;if(t){var e=this.findDot(s.id);if(e&&Object.keys(s).map(function(n){e[n]=s[n]}),!!this.ispotsInit){var i=t.find('xg-spot[data-id="'.concat(s.id,'"]'));i&&(this._updateDotDom(s,i),r&&this.showDot(s.id))}}},deleteDot:function(s){var r=this._ispots,t=this.player.plugins.progress;if(t){for(var e=[],i=0;i<r.length;i++)r[i].id===s&&e.push(i);for(var n=e.length,o=n-1;o>=0;o--)if(r.splice(e[o],1),this.ispotsInit){var l=t.find('xg-spot[data-id="'.concat(s,'"]'));l&&l.parentElement.removeChild(l)}}},deleteAllDots:function(){var s=this.player.plugins.progress;if(s){if(!this.ispotsInit){this._ispots=[];return}for(var r=s.root.getElementsByTagName("xg-spot"),t=r.length-1;t>=0;t--)s.outer.removeChild(r[t]);this._ispots=[]}},updateAllDots:function(){var s=this,r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=this.player.plugins.progress;if(t){if(!this.ispotsInit){this._ispots=r;return}this._ispots=[];var e=t.root.getElementsByTagName("xg-spot"),i=e.length;if(i>r.length)for(var n=i-1;n>r.length-1;n--)t.outer.removeChild(e[n]);r.forEach(function(o,l){l<i?(e[l].setAttribute("data-id","".concat(o.id)),s._ispots.push(o),s.updateDot(o)):s.createDot(o)})}},positionDots:function(){var s=this,r=this._ispots,t=this.playerSize,e=this.player.sizeInfo,i=this.player.plugins.progress;!i||e.width===t.width||(t.width=e.width,t.left=e.left,r.forEach(function(n){var o=i.find('xg-spot[data-id="'.concat(n.id,'"]'));o&&s.positionDot(o,n.id)}))},positionDot:function(s,r){var t=d.findDom(s,".xgplayer-spot-pop");if(t){var e=this.playerSize,i=s.getBoundingClientRect(),n=t.getBoundingClientRect(),o=i.left-e.left,l=e.width-o-i.width/2;if(o<n.width/2||e.width<n.width){var u=n.width/2-o;t.style.left="".concat(u,"px")}else if(l<n.width/2){var f=l-n.width/2+i.width/2;t.style.left="".concat(f,"px")}else t.style.left="50%"}},updateDuration:function(){var s=this,r=this.player.plugins.progress;if(r){var t=this._ispots;t.forEach(function(e){var i=r.find('xg-spot[data-id="'.concat(e.id,'"]'));s._updateDotDom(e,i)})}},getAllDotsDom:function(){var s=this.player.plugins.progress;if(!s)return[];var r=s.root.getElementsByTagName("xg-spot");return r},getDotDom:function(s){var r=this.player.plugins.progress;if(r)return r.find('xg-spot[data-id="'.concat(s,'"]'))}};function cs(a){var s=a.config,r=a.player;Object.keys(qi).map(function(e){a[e]=qi[e].bind(a)});var t=r.config.progressDot||s.ispots||[];a._ispots=t.map(function(e){return Xi(e),e}),a.ispotsInit=!1,a.playerSize={left:r.sizeInfo.left,width:r.sizeInfo.width},a.on(fe,function(){a.ispotsInit?a.updateDuration():a.initDots()}),a.on(he,function(){a.positionDots()})}var Re={dragmove:"onProgressMove",dragstart:"onProgressDragStart",dragend:"onProgressDragEnd",click:"onProgressClick",mouseover:"onProgressMouseOver",mouseenter:"onProgressMouseOver"},fs=function(a){I(r,a);var s=P(r);function r(t){var e;return T(this,r),e=s.call(this,t),k(y(e),"onMousemove",function(i){if(!e.config.disable){if(d.hasClass(i.target,"xg-spot-content")&&e.config.isHideThumbnailHover){e.player.plugins.progress.onMouseLeave(i);return}(e._state.f||d.hasClass(i.target,"xg-spot-content"))&&(d.event(i),i.stopPropagation())}}),k(y(e),"onMousedown",function(i){e.config.disable||(e._state.f||d.hasClass(i.target,"xg-spot-content"))&&(d.event(i),i.stopPropagation())}),k(y(e),"onMouseup",function(i){if(e.isDrag){var n=e.player.plugins.progress;n&&n.pos&&(n.onMouseUp(i),!n.pos.isEnter&&n.onMouseLeave(i))}}),k(y(e),"onDotMouseLeave",function(i){if(!e.config.disable){e._curDot.removeEventListener("mouseleave",e.onDotMouseLeave),e.blurDot(i.target),e._curDot=null;var n=e.player.plugins.progress;n&&n.enableBlur(),e.show()}}),k(y(e),"onProgressMouseOver",function(i,n){if(!e.config.disable&&d.hasClass(n.target,"xgplayer-spot")&&!e._curDot){e._curDot=n.target,e.focusDot(n.target),e._curDot.children.length>0&&e.hide();var o=e.player.plugins.progress;o&&o.disableBlur(),e._curDot.addEventListener("mouseleave",e.onDotMouseLeave)}}),e._ispots=[],e.videoPreview=null,e.videothumbnail=null,e.thumbnail=null,e.timeStr="",e._state={now:0,f:!1},e}return S(r,[{key:"beforeCreate",value:function(e){var i=e.player.plugins.progress;i&&(e.root=i.root)}},{key:"afterCreate",value:function(){var e=this;this._curDot=null,this.handlerSpotClick=this.hook("spotClick",function(i,n){n.seekTime&&e.player.seek(n.seekTime)}),this.transformTimeHook=this.hook("transformTime",function(i){e.setTimeContent(d.format(i))}),cs(this),this.on(fe,function(){e.show()}),this.config.disable&&this.disable(),this.extTextRoot=this.find(".xg-spot-ext-text")}},{key:"setConfig",value:function(e){var i=this;e&&Object.keys(e).map(function(n){i.config[n]=e[n]})}},{key:"onPluginsReady",value:function(){var e=this.player;e.plugins.progress&&(this.previewLine=this.find(".xg-spot-line"),this.timePoint=this.find(".xgplayer-progress-point"),this.timeText=this.find(".xg-spot-time"),this.tipText=this.find(".spot-inner-text"),this._hasThumnail=!1,this.registerThumbnail(),this.bindEvents())}},{key:"bindEvents",value:function(){var e=this,i=this.player.plugins.progress;if(i&&(Object.keys(Re).map(function(o){e[Re[o]]=e[Re[o]].bind(e),i.addCallBack(o,e[Re[o]])}),O.device!=="mobile")){this.bind(".xg-spot-info","mousemove",this.onMousemove),this.bind(".xg-spot-info","mousedown",this.onMousedown),this.bind(".xg-spot-info","mouseup",this.onMouseup);var n=this.hook("previewClick",function(){});this.handlerPreviewClick=function(o){o.stopPropagation(),n(parseInt(e._state.now*1e3,10)/1e3,o)},this.bind(".xg-spot-content","mouseup",this.handlerPreviewClick)}}},{key:"onProgressMove",value:function(e,i){this.config.disable||!this.player.duration||this.updatePosition(e.offset,e.width,e.currentTime,e.e)}},{key:"onProgressDragStart",value:function(e){this.config.disable||!this.player.duration||(this.isDrag=!0,this.videoPreview&&d.addClass(this.videoPreview,"show"))}},{key:"onProgressDragEnd",value:function(e){this.config.disable||!this.player.duration||(this.isDrag=!1,this.videoPreview&&d.removeClass(this.videoPreview,"show"))}},{key:"onProgressClick",value:function(e,i){this.config.disable||d.hasClass(i.target,"xgplayer-spot")&&(i.stopPropagation(),i.preventDefault(),["time","id","text"].map(function(n){e[n]=i.target.getAttribute("data-".concat(n))}),e.time&&(e.time=Number(e.time)),this.handlerSpotClick(i,e))}},{key:"updateLinePos",value:function(e,i){var n=this.root,o=this.previewLine,l=this.player,u=this.config,f=l.controls.mode,h=f==="flex",p=n.getBoundingClientRect().width;if(!(!p&&this._hasThumnail)){p=this._hasThumnail&&p<u.width?u.width:p;var v=e-p/2,g;v<0&&!h?(v=0,g=e-p/2):v>i-p&&!h?(g=v-(i-p),v=i-p):g=0,g!==void 0&&(o.style.transform="translateX(".concat(g.toFixed(2),"px)")),n.style.transform="translateX(".concat(v.toFixed(2),"px) translateZ(0)")}}},{key:"updateTimeText",value:function(e){var i=this.timeText,n=this.timePoint;i.innerHTML=e,!this.thumbnail&&(n.innerHTML=e)}},{key:"updatePosition",value:function(e,i,n,o){var l=this.root,u=this.config,f=this._state;if(l){f.now=n,this.transformTimeHook(n);var h=this.timeStr;o&&o.target&&d.hasClass(o.target,"xgplayer-spot")?(this.showTips(o.target.getAttribute("data-text"),!1,h),this.focusDot(o.target),f.f=!0,u.isFocusDots&&f.f&&(f.now=parseInt(o.target.getAttribute("data-time"),10))):u.defaultText?(f.f=!1,this.showTips(u.defaultText,!0,h)):(f.f=!1,this.hideTips("")),this.updateTimeText(h),this.updateThumbnails(f.now),this.updateLinePos(e,i)}}},{key:"setTimeContent",value:function(e){this.timeStr=e}},{key:"updateThumbnails",value:function(e){var i=this.player,n=this.videoPreview,o=this.config,l=i.plugins.thumbnail;if(l&&l.usable){this.thumbnail&&l.update(this.thumbnail,e,o.width,o.height);var u=n&&n.getBoundingClientRect();this.videothumbnail&&l.update(this.videothumbnail,e,u.width,u.height)}}},{key:"registerThumbnail",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(O.device!=="mobile"){var i=this.player,n=this.config,o=i.getPlugin("thumbnail");if(o&&o.setConfig(e),!o||!o.usable||!n.isShowThumbnail){d.addClass(this.root,"short-line no-thumbnail");return}else d.removeClass(this.root,"short-line no-thumbnail");n.mode==="short"&&d.addClass(this.root,"short-line"),this._hasThumnail=!0;var l=this.find(".xg-spot-thumbnail");this.thumbnail=o.createThumbnail(l,"progress-thumbnail"),n.isShowCoverPreview&&(this.videoPreview=d.createDom("xg-video-preview","",{},"xgvideo-preview"),i.root.appendChild(this.videoPreview),this.videothumbnail=o.createThumbnail(this.videoPreview,"xgvideo-thumbnail")),this.updateThumbnails(0)}}},{key:"calcuPosition",value:function(e,i){var n=this.player.plugins.progress,o=this.player,l=n.root.getBoundingClientRect().width,u=o.duration/l*6;return e+i>o.duration&&(i=o.duration-e),e/o.duration*100,i/o.duration,{left:e/o.duration*100,width:i/o.duration*100,isMini:i<u}}},{key:"showDot",value:function(e){var i=this.findDot(e);if(i){var n=this.root.getBoundingClientRect(),o=n.width,l=i.time/this.player.duration*o;this.updatePosition(l,o,i.time)}}},{key:"focusDot",value:function(e,i){e&&(i||(i=e.getAttribute("data-id")),d.addClass(e,"active"),this._activeDotId=i)}},{key:"blurDot",value:function(e){if(!e){var i=this._activeDotId;e=this.getDotDom(i)}e&&(d.removeClass(e,"active"),this._activeDotId=null)}},{key:"showTips",value:function(e,i){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"";d.addClass(this.root,"no-timepoint"),e&&(d.addClass(this.find(".xg-spot-content"),"show-text"),i&&this.config.mode==="production"?(d.addClass(this.root,"product"),this.tipText.textContent=e):(d.removeClass(this.root,"product"),this.tipText.textContent=this._hasThumnail?e:"".concat(n," ").concat(e)))}},{key:"hideTips",value:function(){d.removeClass(this.root,"no-timepoint"),this.tipText.textContent="",d.removeClass(this.find(".xg-spot-content"),"show-text"),d.removeClass(this.root,"product")}},{key:"hide",value:function(){d.addClass(this.root,"hide")}},{key:"show",value:function(e){d.removeClass(this.root,"hide")}},{key:"enable",value:function(){var e=this.config,i=this.playerConfig;this.config.disable=!1,this.show(),!this.thumbnail&&e.isShowThumbnail&&this.registerThumbnail(i.thumbnail||{})}},{key:"disable",value:function(){this.config.disable=!0,this.hide()}},{key:"destroy",value:function(){var e=this,i=this.player.plugins.progress;i&&Object.keys(Re).map(function(n){i.removeCallBack(n,e[Re[n]])}),this.videothumbnail=null,this.thumbnail=null,this.videoPreview&&this.player.root.removeChild(this.videoPreview),this.unbind(".xg-spot-info","mousemove",this.onMousemove),this.unbind(".xg-spot-info","mousedown",this.onMousedown),this.unbind(".xg-spot-info","mouseup",this.onMouseup),this.unbind(".xg-spot-content","mouseup",this.handlerPreviewClick)}},{key:"render",value:function(){return O.device==="mobile"||this.playerConfig.isMobileSimulateMode==="mobile"?"":'<div class="xg-spot-info hide '.concat(this.config.mode==="short"?"short-line":"",`">
213
213
  <div class="xg-spot-content">
214
214
  <div class="xg-spot-thumbnail">
215
215
  <span class="xg-spot-time"></span>
@@ -219,8 +219,8 @@ Use Save As... to download, then click back to return to this page.`)&&(location
219
219
  <div class="xgplayer-progress-point">00:00</div>
220
220
  <div class="xg-spot-ext-text"></div>
221
221
  <div class="xg-spot-line"></div>
222
- </div>`)}}],[{key:"pluginName",get:function(){return"progresspreview"}},{key:"defaultConfig",get:function(){return{index:1,miniWidth:6,ispots:[],defaultText:"",isFocusDots:!0,isHideThumbnailHover:!0,isShowThumbnail:!0,isShowCoverPreview:!1,mode:"",disable:!1,width:160,height:90}}}]),r}(B),hs=function(a){I(r,a);var s=P(r);function r(t){var e;return T(this,r),e=s.call(this,t),e.ratio=1,e.interval=null,e._preloadMark={},e}return S(r,[{key:"afterCreate",value:function(){var e=this;this.usable&&this.initThumbnail(),this.on([fe],function(){var i=e.config,n=i.pic_num,o=i.interval;e.usable&&(e.interval=o>0?o:Math.round(e.player.duration*1e3/n)/1e3)})}},{key:"setConfig",value:function(e){var i=this;if(e){var n=Object.keys(e);n.length<1||(n.forEach(function(o){i.config[o]=e[o]}),this.usable&&this.initThumbnail())}}},{key:"usable",get:function(){var e=this.config,i=e.urls,n=e.pic_num;return i&&i.length>0&&n>0}},{key:"initThumbnail",value:function(){var e=this.config,i=e.width,n=e.height,o=e.pic_num,l=e.interval;this.ratio=i/n*100,this.interval=l||Math.round(this.player.duration/o),this._preloadMark={}}},{key:"getUrlByIndex",value:function(e){return e>=0&&e<this.config.urls.length?this.config.urls[e]:""}},{key:"preload",value:function(e){var i=this;if(!this._preloadMark[e]){var n=this.config.urls,o=n.length,l=[];e>0&&l.push(e-1),l.push(e),e>0&&e<o-1&&l.push(e+1),l.map(function(u){!i._preloadMark[u]&&u>=0&&u<o&&(i._preloadMark[u]=1,d.preloadImg(n[u],function(){i._preloadMark[u]=2}))})}}},{key:"getPosition",value:function(e){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,o=this.config,l=o.pic_num,u=o.row,f=o.col,h=o.width,g=o.height;this.interval=Math.round(this.player.duration/l);var v=Math.ceil(e/this.interval);v=v>l?l:v;var p=v<u*f?0:Math.ceil(v/(u*f))-1,m=v-p*(f*u),_=m>0?Math.ceil(m/f)-1:0,C=m>0?m-_*f-1:0,w=0,E=0;if(i&&n){var N=i/n;N<h/g?(E=n,w=E*(h/g)):(w=i,E=w/(h/g))}else n?i||(E=n||g,w=E*(h/g)):(w=i||h,E=w/(h/g));var R=this.getUrlByIndex(p);return{urlIndex:p,rowIndex:_,colIndex:C,url:R,height:E,width:w,style:{backgroundImage:"url(".concat(R,")"),backgroundSize:"".concat(w*f,"px auto"),backgroundPosition:"-".concat(C*w,"px -").concat(_*E,"px"),width:"".concat(w,"px"),height:"".concat(E,"px")}}}},{key:"update",value:function(e,i){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,l=arguments.length>4&&arguments[4]!==void 0?arguments[4]:"",u=this.config,f=u.pic_num,h=u.urls;if(!(f<=0||!h||h.length===0)){var g=this.getPosition(i,n,o);this.preload(g.urlIndex),Object.keys(g.style).map(function(v){e.style[v]=g.style[v]}),Object.keys(l).map(function(v){e.style[v]=l[v]})}}},{key:"changeConfig",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.setConfig(e)}},{key:"createThumbnail",value:function(e,i){var n=d.createDom("xg-thumbnail","",{},"thumbnail ".concat(i));return e&&e.appendChild(n),n}}],[{key:"pluginName",get:function(){return"thumbnail"}},{key:"defaultConfig",get:function(){return{isShow:!1,urls:[],pic_num:0,col:0,row:0,height:90,width:160,scale:1,className:"",hidePortrait:!1}}}]),r}(B);function zt(a){return a?"background:".concat(a,";"):""}var ds=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(y(t),"onTimeupdate",function(){var o=t.player.ended,l=y(t),u=l.offsetDuration,f=t.currentTime;f=d.adjustTimeByDuration(f,u,o),t.update({played:f},u)}),t}return S(r,[{key:"offsetDuration",get:function(){return this.playerConfig.customDuration||this.player.offsetDuration||this.player.duration}},{key:"currentTime",get:function(){var e=this.player,i=e.offsetCurrentTime,n=e.currentTime;return i>=0?i:n}},{key:"afterCreate",value:function(){var e=this;this.root&&(this.on(q,this.onTimeupdate),this.on(_e,function(){e.reset()}))}},{key:"reset",value:function(){this.update({played:0,cached:0},0)}},{key:"update",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{cached:0,played:0},i=arguments.length>1?arguments[1]:void 0;!i||!this.root||(e.cached&&(this.find("xg-mini-progress-cache").style.width="".concat(e.cached/i*100,"%")),e.played&&(this.find("xg-mini-progress-played").style.width="".concat(e.played/i*100,"%")))}},{key:"render",value:function(){var e=this.playerConfig,i=e.commonStyle,n=e.miniprogress;if(n){var o=this.config,l=o.mode,u=o.height,f={cached:zt(i.cachedColor),played:zt(i.playedColor),progress:zt(i.progressColor),height:u>0&&u!==2?"height: ".concat(u,"px;"):""},h=l==="show"?"xg-mini-progress-show":"";return'<xg-mini-progress class="xg-mini-progress '.concat(h,'" style="').concat(f.progress," ").concat(f.height,`">
222
+ </div>`)}}],[{key:"pluginName",get:function(){return"progresspreview"}},{key:"defaultConfig",get:function(){return{index:1,miniWidth:6,ispots:[],defaultText:"",isFocusDots:!0,isHideThumbnailHover:!0,isShowThumbnail:!0,isShowCoverPreview:!1,mode:"",disable:!1,width:160,height:90}}}]),r}(B),hs=function(a){I(r,a);var s=P(r);function r(t){var e;return T(this,r),e=s.call(this,t),e.ratio=1,e.interval=null,e._preloadMark={},e}return S(r,[{key:"afterCreate",value:function(){var e=this;this.usable&&this.initThumbnail(),this.on([fe],function(){var i=e.config,n=i.pic_num,o=i.interval;e.usable&&(e.interval=o>0?o:Math.round(e.player.duration*1e3/n)/1e3)})}},{key:"setConfig",value:function(e){var i=this;if(e){var n=Object.keys(e);n.length<1||(n.forEach(function(o){i.config[o]=e[o]}),this.usable&&this.initThumbnail())}}},{key:"usable",get:function(){var e=this.config,i=e.urls,n=e.pic_num;return i&&i.length>0&&n>0}},{key:"initThumbnail",value:function(){var e=this.config,i=e.width,n=e.height,o=e.pic_num,l=e.interval;this.ratio=i/n*100,this.interval=l||Math.round(this.player.duration/o),this._preloadMark={}}},{key:"getUrlByIndex",value:function(e){return e>=0&&e<this.config.urls.length?this.config.urls[e]:""}},{key:"preload",value:function(e){var i=this;if(!this._preloadMark[e]){var n=this.config.urls,o=n.length,l=[];e>0&&l.push(e-1),l.push(e),e>0&&e<o-1&&l.push(e+1),l.map(function(u){!i._preloadMark[u]&&u>=0&&u<o&&(i._preloadMark[u]=1,d.preloadImg(n[u],function(){i._preloadMark[u]=2}))})}}},{key:"getPosition",value:function(e){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,o=this.config,l=o.pic_num,u=o.row,f=o.col,h=o.width,p=o.height;this.interval=Math.round(this.player.duration/l);var v=Math.ceil(e/this.interval);v=v>l?l:v;var g=v<u*f?0:Math.ceil(v/(u*f))-1,m=v-g*(f*u),_=m>0?Math.ceil(m/f)-1:0,C=m>0?m-_*f-1:0,b=0,E=0;if(i&&n){var N=i/n;N<h/p?(E=n,b=E*(h/p)):(b=i,E=b/(h/p))}else n?i||(E=n||p,b=E*(h/p)):(b=i||h,E=b/(h/p));var R=this.getUrlByIndex(g);return{urlIndex:g,rowIndex:_,colIndex:C,url:R,height:E,width:b,style:{backgroundImage:"url(".concat(R,")"),backgroundSize:"".concat(b*f,"px auto"),backgroundPosition:"-".concat(C*b,"px -").concat(_*E,"px"),width:"".concat(b,"px"),height:"".concat(E,"px")}}}},{key:"update",value:function(e,i){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,l=arguments.length>4&&arguments[4]!==void 0?arguments[4]:"",u=this.config,f=u.pic_num,h=u.urls;if(!(f<=0||!h||h.length===0)){var p=this.getPosition(i,n,o);this.preload(p.urlIndex),Object.keys(p.style).map(function(v){e.style[v]=p.style[v]}),Object.keys(l).map(function(v){e.style[v]=l[v]})}}},{key:"changeConfig",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.setConfig(e)}},{key:"createThumbnail",value:function(e,i){var n=d.createDom("xg-thumbnail","",{},"thumbnail ".concat(i));return e&&e.appendChild(n),n}}],[{key:"pluginName",get:function(){return"thumbnail"}},{key:"defaultConfig",get:function(){return{isShow:!1,urls:[],pic_num:0,col:0,row:0,height:90,width:160,scale:1,className:"",hidePortrait:!1}}}]),r}(B);function zt(a){return a?"background:".concat(a,";"):""}var ds=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(y(t),"onTimeupdate",function(){var o=t.player.ended,l=y(t),u=l.offsetDuration,f=t.currentTime;f=d.adjustTimeByDuration(f,u,o),t.update({played:f},u)}),t}return S(r,[{key:"offsetDuration",get:function(){return this.playerConfig.customDuration||this.player.offsetDuration||this.player.duration}},{key:"currentTime",get:function(){var e=this.player,i=e.offsetCurrentTime,n=e.currentTime;return i>=0?i:n}},{key:"afterCreate",value:function(){var e=this;this.root&&(this.on(q,this.onTimeupdate),this.on(_e,function(){e.reset()}))}},{key:"reset",value:function(){this.update({played:0,cached:0},0)}},{key:"update",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{cached:0,played:0},i=arguments.length>1?arguments[1]:void 0;!i||!this.root||(e.cached&&(this.find("xg-mini-progress-cache").style.width="".concat(e.cached/i*100,"%")),e.played&&(this.find("xg-mini-progress-played").style.width="".concat(e.played/i*100,"%")))}},{key:"render",value:function(){var e=this.playerConfig,i=e.commonStyle,n=e.miniprogress;if(n){var o=this.config,l=o.mode,u=o.height,f={cached:zt(i.cachedColor),played:zt(i.playedColor),progress:zt(i.progressColor),height:u>0&&u!==2?"height: ".concat(u,"px;"):""},h=l==="show"?"xg-mini-progress-show":"";return'<xg-mini-progress class="xg-mini-progress '.concat(h,'" style="').concat(f.progress," ").concat(f.height,`">
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
- </xg-mini-progress>`)}}}],[{key:"pluginName",get:function(){return"MiniProgress"}},{key:"defaultConfig",get:function(){return{mode:"auto",height:2}}}]),r}(B),Ne={REAL_TIME:"realtime",FIRST_FRAME:"firstframe",FRAME_RATE:"framerate",POSTER:"poster"};function ps(){try{return parseInt(window.performance.now(),10)}catch{return new Date().getTime()}}function gs(){try{var a=document.createElement("canvas").getContext;return!!a}catch{return!1}}var st=null,vs=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(y(t),"onLoadedData",function(o){t.player&&(t._frameCount=t.config.startFrameCount,t.stop(),t.renderOnTimeupdate(o),t.off(q,t.renderOnTimeupdate),t.on(q,t.renderOnTimeupdate))}),k(y(t),"onVisibilitychange",function(o){document.visibilityState==="visible"?t._checkIfCanStart()&&t.start():document.visibilityState==="hidden"&&t.stop()}),k(y(t),"renderOnTimeupdate",function(o){if(t._frameCount>0)t.renderOnce(),t._frameCount--;else{t._isLoaded=!0,t.off(q,t.renderOnTimeupdate);var l=t.config.startInterval;!t.player.paused&&t._checkIfCanStart()&&t.start(0,l)}}),k(y(t),"start",function(o,l){var u=t.player.video,f=ps(),h=t.checkVideoIsSupport(u);!h||!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===Ne.REAL_TIME||f-t.preTime>=l)&&(u&&u.videoWidth&&t.update(h,t.videoPI),t.preTime=f)),t.frameId=t._loopType==="timer"?d.setTimeout(y(t),t.start,l):d.requestAnimationFrame(t.start))}),k(y(t),"stop",function(){t.frameId&&(t._loopType==="timer"?d.clearTimeout(y(t),t.frameId):d.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!==Ne.REAL_TIME&&this.interval>=1e3?"timer":"animation",this.once(We,function(){e.player&&(e.init(),e.renderByPoster(),e.player.paused||e.start())}),o!==Ne.POSTER&&(o!==Ne.FIRST_FRAME&&(this.on(_e,function(){e.stop()}),this.on(X,function(){var u=e.config.startInterval;e._checkIfCanStart()&&e.start(0,u)}),this.on(Ie,function(){e.stop()})),this.on(ae,this.onLoadedData),this.on(_t,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){F.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&&!(O.browser==="safari"&&d.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=d.typeOf(e)==="String"?e:d.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!==Ne.FIRST_FRAME&&e!==Ne.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 h=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;h<i?v=parseInt(f*i/100,10):h>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){F.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 st=="boolean"||(st=gs()),st}},{key:"supportCanvasFilter",value:function(){return!(O.browser==="safari"||O.browser==="firefox")}}]),r}(B),ms={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:"直播"}},ze="info",jt=yi,ys=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(y(t),"_recordUserActions",function(o){var l=t._getTime(),u=Object.assign({},o,{msg:o.msg||o.action});t._stats[ze].push(U(U({type:"userAction"},l),{},{payload:u}))}),k(y(t),"_onReset",function(){t.reset()}),k(y(t),"_recordInfo",function(o){t.info(o)}),k(y(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(Je,this._recordUserActions),this.on(jt.STATS_INFO,this._recordInfo),this.on(jt.STATS_DOWNLOAD,this._downloadStats),this.on(jt.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[ze].push(U(U({},i),{},{payload:e}))}},{key:"_infoProfile",value:function(e){if(e&&e.startMs){var i=Date.now(),n=i-e.startMs,o=U({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,ze,[]),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[ze],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[ze];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}(de),Ji=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(y(t),"onGapJump",function(){var o=y(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,h=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 m=f.start(p)+.1,_=l.media.duration;if(!(m>_)){var C=m-v,w=C<=h;C<r.BROWSER_GAP_TOLERANCE||w&&(u.useGapJump!==!1&&(l.media.currentTime=t.isSafari?m+.1:m),t.player&&t.player.emit("detectGap"),console.log("gapJump gapIndex",p," isGapSamll:",w," currentTime:",l.media.currentTime," jumpSize:",v-l.media.currentTime),m!==.08&&l&&l.emit("log",{type:"oneevent",end_type:"gap",vid:l.config.vid,ext:{video_postion:Math.floor(m*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(He,this.onGapJump),this.on(X,function(){e.hasPlayed=!0}),this.on($e,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}(B);Ji.BROWSER_GAP_TOLERANCE=.001;var _s=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(y(t),"onWaiting",function(){var o=y(t),l=o.config;t.jumpCnt>l.jumpCntMax||t.timer||l.useWaitingTimeoutJump===!1||(t.timer=setTimeout(t.onJump,l.waitingTime*1e3))}),k(y(t),"onJump",function(){var o=y(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,h=l.media.duration;f>h||(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(He,this.onWaiting),this.on([yt,se],function(){clearTimeout(e.timer),e.timer=null,e.jumpSize=e.config.jumpSize}),this.on(X,function(){e.hasPlayed=!0}))}}],[{key:"pluginName",get:function(){return"waitingTimeoutJump"}},{key:"defaultConfig",get:function(){return{useWaitingTimeoutJump:!1,waitingTime:15,jumpSize:2,jumpCntMax:4}}}]),r}(B),Fe="cdn",at=["cdn"],ks=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(y(t),"getSpeed",function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Fe;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(y(t),"startTimer",function(){d.isMSE(t.player.video)||(t.initSpeedList(),t.cnt=0,t.timer=setTimeout(t.testSpeed,t.config.testTimeStep))}),k(y(t),"initSpeedList",function(){t.speedListCache={},at.forEach(function(o){t.speedListCache[o]=[]})}),k(y(t),"_onRealSpeedChange",function(o){o.speed&&t.appendList(o.speed,o.type||Fe)}),k(y(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,h=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,m=new XMLHttpRequest;t.xhr=m,m.open("GET",g);var _={},C=Math.floor(Math.random()*10);_.Range="bytes="+C+"-"+(u+C),_&&Object.keys(_).forEach(function(w){m.setRequestHeader(w,_[w])}),m.onreadystatechange=function(){if(m.readyState===4){t.xhr=null,p=new Date().getTime();var w=m.getResponseHeader("Content-Length")/1024*8,E=Math.round(w*1e3/(p-v));t.appendList(E),t.timer=setTimeout(t.testSpeed,h)}},m.send()}catch(w){console.error(w)}}}}),k(y(t),"appendList",function(o){var l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Fe;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=y(t),h=f.player;h&&(l===Fe?h.realTimeSpeed=o:h[t.getSpeedName("realTime",l)]=o),t.updateSpeed(l)}}),k(y(t),"updateSpeed",function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Fe,l=t.getSpeed(o),u=y(t),f=u.player;if(f)if(o===Fe)(!f.avgSpeed||l!==f.avgSpeed)&&(f.avgSpeed=l,f.emit(wt,{speed:l,realTimeSpeed:f.realTimeSpeed}));else{var h=t.getSpeedName("avg",o);(!f[h]||l!==f[h])&&(f[h]=l,f.emit(wt,{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&&at.push.apply(at,Q(n)),this.initSpeedList(),this.on("real_time_speed",this._onRealSpeedChange),this.timer=null,this.cnt=0,this.xhr=null,i&&this.on([ae,Ge],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([ae,Ge],this.startTimer),at.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}(B),Cs=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(X,function(){e._startTick()}),this.on(Ie,function(){e._stopTick()}),this.on(ye,function(){e._stopTick()}),this.on(_e,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,h=l.readyState,g=l.currentTime,v=l.buffered;if(!(u||f||h<4)){var p=this._checkBuffer(g,v),m=p.enoughBuffer,_=p.buffers;m&&(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(_i,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}(B);Ae.use(ms);var Es=S(function a(s,r){var t,e,i;T(this,a);var n=r&&r.isMobileSimulateMode==="mobile",o=r.isLive,l=o?[]:[Ho,Lo,ds,fs,Bo],u=[].concat(l,[Do,Mo,Wo,qo,rs,os,es,ts,jo,Yo]),f=[co,fo,po,Io,go,ls,us,hs,_o];this.plugins=[ys,lo].concat(Q(u),f,[Ji,_s]);var h=n?"mobile":O.device;switch(h){case"pc":(t=this.plugins).push.apply(t,[$i,Vt,Ki,ks,Cs]);break;case"mobile":(e=this.plugins).push.apply(e,[To]);break;default:(i=this.plugins).push.apply(i,[$i,Vt,Ki])}(O.os.isIpad||h==="pc")&&this.plugins.push(vs),O.os.isIpad&&this.plugins.push(Vt),this.ignores=[],this.i18n=[]}),ee=function(a){I(r,a);var s=P(r);function r(){return T(this,r),s.apply(this,arguments)}return S(r)}(nt);k(ee,"defaultPreset",Es),k(ee,"Util",d),k(ee,"Sniffer",O),k(ee,"Errors",je),k(ee,"Events",Fr),k(ee,"Plugin",B),k(ee,"BasePlugin",de),k(ee,"I18N",Ae),k(ee,"STATE_CLASS",b),k(ee,"InstManager",Oi);const cl="",bs=["id"],ws=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}=ut(t),i=c.computed(()=>Se(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=Te.buildUUID(),h=Qi.useNamespace("image-viewer");function g(){l("close"),u.value=!1,r.destroy()}return c.watch(()=>u.value,v=>{v&&c.nextTick(()=>{r=new ee({id:f,url:i.value,...o.value})})}),(v,p)=>{const m=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(h).e("wrapper")),style:c.normalizeStyle({zIndex:a.zIndex})},[c.createElementVNode("div",{class:c.normalizeClass(c.unref(h).e("mask"))},null,2),c.createCommentVNode(" CANVAS "),c.createElementVNode("div",{class:c.normalizeClass(c.unref(h).e("canvas"))},[c.createElementVNode("div",{id:c.unref(f)},null,8,bs),c.createCommentVNode(" CLOSE "),c.createElementVNode("span",{class:c.normalizeClass([c.unref(h).e("btn"),c.unref(h).e("close")]),onClick:g},[c.createVNode(m,{onClick:g},{default:c.withCtx(()=>[c.createVNode(c.unref(Pn))]),_:1})],2)],2),c.renderSlot(v.$slots,"default",{},void 0,!0)],6)]),_:3})])):c.createCommentVNode("v-if",!0)}}}),fl="",Ts=ce(Me(ws,[["__scopeId","data-v-b301aa7d"]])),$t=a=>(c.pushScopeId("data-v-48f27627"),a=a(),c.popScopeId(),a),Ss={class:"approveProcess",id:"approveProcess"},xs=["id"],Is={class:"topBlock"},Ps={class:"left"},As={class:"nodeBg"},Ls=["src"],Ds={class:"right"},Os={class:"topInfo"},Rs={key:0},Ns={key:0,class:"main-text"},Fs={class:"name"},Ms={key:0},Bs={key:0},Hs={key:1},Vs=$t(()=>c.createElementVNode("span",{class:"red",style:{margin:"0px 5px"}}," 退回至",-1)),Us={key:0},zs={key:0},js={key:1},$s={key:1},Ws=$t(()=>c.createElementVNode("div",{class:"main-text"},"抄送人员",-1)),Gs={class:"name"},Ks={key:0},Ys={style:{color:"#000"}},Xs={class:"blue",style:{"margin-left":"5px","font-size":"12px"}},qs={key:1},Js={key:0,class:"blue",style:{"font-size":"12px"}},Zs={key:1},Qs={key:0,class:"blue",style:{"font-size":"12px"}},ea={key:1,class:"blue",style:{"font-size":"12px"}},ta={class:"time"},ia={key:0},na={key:1},ra=["onClick"],oa=["onClick"],sa={key:0,class:"opinion"},aa={key:0},la={key:1},ua=$t(()=>c.createElementVNode("span",{class:"ik-text-primary"},"添加审批人",-1)),ca={style:{color:"var(--el-text-color-primary)","margin-left":"8px"}},fa={key:2,class:"annexImage"},ha={key:3,class:"approveList"},da={class:"nodeBg-list"},pa=["src"],ga={key:1},va={key:2,class:"ikapprove ikapprove-duihao2 green read"},ma=["title"],ya={key:0,class:"branch"},_a={class:"branch-card"},ka={class:"branch-name"},Ca={name:"IkingApprovalProcessDetail"},Ea=c.defineComponent({...Ca,props:{local:{type:Boolean,default:!1},defaultStatus:{type:Object,default:()=>({})},defaultNodeType:{type:Object,default:()=>({})},dataList:{type:Array,default:()=>[]},defaultFieldMap:{type:Object,default:()=>({})},returnNode:{type:Array,default:()=>[]},fileUrl:{type:String,default:""},kkUrl:{type:String,default:""},isOnlyOfficePreview:{type:Boolean,default:!1},onlyOfficeAccept:{type:String,default:".pdf,.docx,.doc.ppt,.pptx,.xlsx,.xls,"},onlyofficeServer:{type:String,default:""}},emits:["preview"],setup(a,{emit:s}){const r=a,{cLoadUrl:t}=ut(r),e=c.reactive(An(r));c.watch(()=>r.dataList,f=>{f&&(c.nextTick(()=>{e.listData=f}),setTimeout(()=>{r.returnNode.length&&i()},500))},{deep:!0}),c.onMounted(()=>{r.dataList.length&&(e.listData=r.dataList,setTimeout(()=>{r.returnNode.length&&i()},500))});const i=()=>{let f=null;if(r!=null&&r.returnNode)for(f of r==null?void 0:r.returnNode){if(isNaN(f[1]))return;let h=Array.from(new Array(f[1]+1).keys()).slice(f[0]);c.nextTick(()=>{n(h)})}},n=f=>{var C,w,E;let h=document.createElement("div"),g=document.getElementById("approveProcess"),v=0,p=(C=document.getElementById(`${f[0]}`))==null?void 0:C.offsetWidth,m=(w=document.getElementById(`${f[0]}`))==null?void 0:w.offsetLeft,_=(E=document.getElementById(`${f[0]}`))==null?void 0:E.offsetTop;f.forEach(N=>{let R=document.getElementById(`${N}`);v+=R.offsetHeight}),setTimeout(()=>{h.style.width=p+32+"px",h.style.height=v+"px",h.style.background="#f9f9f9",h.style.position="absolute",h.style.top=_-16+"px",h.style.left=m-16+"px",h.style.zIndex=-1,g==null||g.appendChild(h)})},o=(f,h,g)=>{var m,_;let v=(m=e.listData)==null?void 0:m.findIndex(C=>C.lineType=="dashed"),p="";if(g&&((_=g[e.defaultFile.approvePersonList])==null?void 0:_.findIndex(w=>w[e.defaultFile.approveStatus]===e.statusOption.执行中))>-1)return"ikapprove ikapprove-dengdai orange";switch(f){case e.statusOption.发起:p="ikapprove-duihao2 green";break;case e.statusOption.执行中:p=v==h?"ikapprove-dengdai orange":"";break;case e.statusOption.同意:p="ikapprove-duihao2 green";break;case e.statusOption.拒绝:p="ikapprove-jujue red";break;case e.statusOption.转交:p="ikapprove-zhuanjiao blue";break;case e.statusOption.加签:p="ikapprove-tianjia blue";break;case e.statusOption.退回:p="ikapprove-s_fanhui2 red";break;case e.statusOption.评论:p="ikapprove-pinglun1 blue";break}return`ikapprove ${p}`},l=(f,h)=>{f.show=!f.show;let g=document.getElementById(`${f[e.defaultFile.nodeId]}`),v=Array.from(g==null?void 0:g.getElementsByClassName("approveList"));for(let p of v)p.style.display=h},u=f=>Se(t.value,f);return(f,h)=>{const g=c.resolveComponent("el-image"),v=c.resolveComponent("IkingApprovalProcessDetail");return c.openBlock(),c.createElementBlock("div",Ss,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(e.listData,(p,m)=>{var _,C,w,E,N,R,H,D,j,z;return c.openBlock(),c.createElementBlock("div",{class:"approveBlock",id:p[e.defaultFile.nodeId],key:p[e.defaultFile.nodeId]},[c.createElementVNode("div",Is,[c.createElementVNode("div",Ps,[c.createElementVNode("span",As,[c.createCommentVNode(' 用户列表长度等于1, :src="formatUrl(it)"并且存在头像 '),((_=p[e.defaultFile.approvePersonList])==null?void 0:_.length)==1&&p[e.defaultFile.approvePersonList][0].userAvatar?(c.openBlock(),c.createElementBlock("img",{key:0,style:{width:"100%",height:"100%","border-radius":"10px"},src:u(p[e.defaultFile.approvePersonList][0].userAvatar),alt:""},null,8,Ls)):(c.openBlock(),c.createElementBlock(c.Fragment,{key:1},[c.createCommentVNode(" 否则显示对应节点 "),c.createElementVNode("i",{class:c.normalizeClass(c.unref(Ln)(e,p[e.defaultFile.nodeType],p[e.defaultFile.approvePersonList]))},null,2)],2112)),c.createCommentVNode(" 审批状态图标 "),c.createElementVNode("i",{class:c.normalizeClass(o(p[e.defaultFile.approveStatus],m,p))},null,2)])]),c.createElementVNode("div",Ds,[c.createElementVNode("div",Os,[c.createElementVNode("div",null,[c.createCommentVNode(" 不是抄送节点 "),e.nodeType.抄送节点!==p[e.defaultFile.nodeType]?(c.openBlock(),c.createElementBlock("div",Rs,[c.createCommentVNode(" 撤销,评论不显示节点名称 "),p[e.defaultFile.approveStatus]!=e.statusOption.撤销&&p[e.defaultFile.approveStatus]!=e.statusOption.评论&&p[e.defaultFile.nodeType]!==e.nodeType.并行分支?(c.openBlock(),c.createElementBlock("div",Ns,c.toDisplayString(p[e.defaultFile.nodeTypeName]),1)):c.createCommentVNode("v-if",!0),c.createCommentVNode(" 名字+审批状态 "),c.createElementVNode("div",Fs,[c.createCommentVNode(" 已审批节点文本 "),p[e.defaultFile.lineType]=="solid"?(c.openBlock(),c.createElementBlock("div",Ms,[c.createElementVNode("span",{style:c.normalizeStyle({color:p[e.defaultFile.approveStatus]==e.statusOption.评论?"#000":""})},c.toDisplayString(p[e.defaultFile.originator]),5),c.createCommentVNode(" 发起,退回不显示状态 "),p[e.defaultFile.approveStatusName]&&p[e.defaultFile.approveStatus]!=e.statusOption.发起&&p[e.defaultFile.approveStatus]!=e.statusOption.退回?(c.openBlock(),c.createElementBlock("span",Bs,c.toDisplayString(p[e.defaultFile.approveStatus]==e.statusOption.评论?" 添加了评论":p!=null&&p.nodeActionAliasName?`(已${p.nodeActionAliasName})`:`(${p[e.defaultFile.approveStatusName]})`),1)):c.createCommentVNode("v-if",!0),c.createCommentVNode(" 退回状态显示 "),p[e.defaultFile.approveStatus]==e.statusOption.退回?(c.openBlock(),c.createElementBlock("span",Hs,[Vs,c.createTextVNode(" "+c.toDisplayString(p[e.defaultFile.backToInstanceNodeName]||p[e.defaultFile.backToRecordNodeName]),1)])):c.createCommentVNode("v-if",!0)])):(c.openBlock(),c.createElementBlock(c.Fragment,{key:1},[c.createCommentVNode(" 待审批节点 "),c.createElementVNode("div",null,[((C=p[e.defaultFile.approvePersonList])==null?void 0:C.length)==1?(c.openBlock(),c.createElementBlock("span",Us,[c.createTextVNode(c.toDisplayString(p[e.defaultFile.originator])+" ",1),p[e.defaultFile.approveStatus]==e.statusOption.等待?(c.openBlock(),c.createElementBlock("span",zs,c.toDisplayString(p!=null&&p.nodeActionAliasName?`(已${p.nodeActionAliasName})`:`(${p[e.defaultFile.approveStatusName]})`),1)):c.createCommentVNode("v-if",!0)])):p[e.defaultFile.approvePersonList]?(c.openBlock(),c.createElementBlock("span",js,c.toDisplayString(`${(w=p[e.defaultFile.approvePersonList])==null?void 0:w.length}人${p[e.defaultFile.approveTypeName]}`),1)):c.createCommentVNode("v-if",!0)])],2112))])])):(c.openBlock(),c.createElementBlock("div",$s,[Ws,c.createElementVNode("div",Gs,[c.createCommentVNode(" 抄送一人时 "),((E=p[e.defaultFile.approvePersonList])==null?void 0:E.length)==1?(c.openBlock(),c.createElementBlock("span",Ks,[c.createElementVNode("span",null,[c.createTextVNode("已抄送给 "),c.createElementVNode("span",Ys,c.toDisplayString(p[e.defaultFile.approvePersonList][0].userName),1)]),c.createElementVNode("span",Xs,c.toDisplayString(p[e.defaultFile.approvePersonList][0].status==="END"?"已读":"未读"),1)])):c.createCommentVNode("v-if",!0),c.createCommentVNode(" 抄送多人时 "),((N=p[e.defaultFile.approvePersonList])==null?void 0:N.length)>1?(c.openBlock(),c.createElementBlock("span",qs,[c.createTextVNode(c.toDisplayString(`已抄送${(R=p[e.defaultFile.approvePersonList])==null?void 0:R.length}人`)+" ",1),p[e.defaultFile.allRead]?(c.openBlock(),c.createElementBlock("span",Js," 全部已读 ")):(c.openBlock(),c.createElementBlock("span",Zs,[p[e.defaultFile.read]?c.createCommentVNode("v-if",!0):(c.openBlock(),c.createElementBlock("span",Qs," 全部未读 ")),p[e.defaultFile.read]?(c.openBlock(),c.createElementBlock("span",ea,c.toDisplayString(p[e.defaultFile.read])+"人已读 ",1)):c.createCommentVNode("v-if",!0)]))])):c.createCommentVNode("v-if",!0)])]))]),c.createElementVNode("div",ta,[c.createCommentVNode(" 不是抄送节点,展示时间 "),p[e.defaultFile.nodeType]!=e.nodeType.抄送节点&&p[e.defaultFile.approveStatus]!==e.statusOption.等待?(c.openBlock(),c.createElementBlock("span",ia,c.toDisplayString(c.unref(Te.ikDate).toDateTime(p[e.defaultFile.operationTime],"MM/DD HH:mm")),1)):c.createCommentVNode("v-if",!0),c.createCommentVNode(" 是抄送节点,并且抄送人员大于1时,展示图标 "),p[e.defaultFile.nodeType]==e.nodeType.抄送节点&&((H=p[e.defaultFile.approvePersonList])==null?void 0:H.length)>1?(c.openBlock(),c.createElementBlock("span",na,[p!=null&&p.show?(c.openBlock(),c.createElementBlock("i",{key:0,class:"ikapprove ikapprove-a-putongjiantouzhankai",onClick:x=>l(p,"grid")},null,8,ra)):(c.openBlock(),c.createElementBlock("i",{key:1,onClick:x=>l(p,"none"),class:"ikapprove ikapprove-a-putongjiantoushouqi"},null,8,oa))])):c.createCommentVNode("v-if",!0)])])])]),c.createElementVNode("div",{class:"bottomBlock",style:c.normalizeStyle({borderLeft:m==e.listData.length-1?"":`2px ${p[e.defaultFile.lineType]||"dashed"} var(--el-border-color)`})},[c.createCommentVNode(" 审批意见 "),p[e.defaultFile.approveOpinion]||p[e.defaultFile.approveStatus]==e.statusOption.加签?(c.openBlock(),c.createElementBlock("div",sa,[p[e.defaultFile.approveOpinion]?(c.openBlock(),c.createElementBlock("span",aa,c.toDisplayString(p[e.defaultFile.approveOpinion]),1)):c.createCommentVNode("v-if",!0),p[e.defaultFile.approveStatus]==e.statusOption.加签?(c.openBlock(),c.createElementBlock("span",la,[ua,(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(p[e.defaultFile.countersignPer],(x,$)=>(c.openBlock(),c.createElementBlock("span",ca,c.toDisplayString(x==null?void 0:x.userName)+c.toDisplayString($<p[e.defaultFile.countersignPer].length-1?"、":""),1))),256))])):c.createCommentVNode("v-if",!0)])):c.createCommentVNode("v-if",!0),c.createCommentVNode(" 附件 "),(D=p[e.defaultFile.attachment])!=null&&D.length?(c.openBlock(),c.createBlock(c.unref(Vn),{key:1,list:p[e.defaultFile.attachment]},null,8,["list"])):c.createCommentVNode("v-if",!0),c.createCommentVNode(" 附件图片 "),(j=p[e.defaultFile.attachmentImg])!=null&&j.length?(c.openBlock(),c.createElementBlock("div",fa,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(p[e.defaultFile.attachmentImg],(x,$)=>(c.openBlock(),c.createElementBlock("div",{class:"image",key:$},[c.createVNode(g,{src:u(x),"preview-src-list":p[e.defaultFile.attachmentImg].map(Z=>u(Z)),fit:"cover","z-index":"9999","zoom-rate":1.2,alt:u(x)},null,8,["src","preview-src-list","alt"])]))),128))])):c.createCommentVNode("v-if",!0),c.createCommentVNode(" 抄送节点或是等待审批状态并且列表长度大于1 "),(p[e.defaultFile.nodeType]==e.nodeType.抄送节点||p[e.defaultFile.approveStatus]==e.statusOption.等待)&&((z=p[e.defaultFile.approvePersonList])==null?void 0:z.length)>1?(c.openBlock(),c.createElementBlock("div",ha,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(p[e.defaultFile.approvePersonList],x=>(c.openBlock(),c.createElementBlock("div",{class:"perBlock",key:x.userName},[c.createElementVNode("span",da,[x.userAvatar?(c.openBlock(),c.createElementBlock("img",{key:0,style:{width:"100%",height:"100%","border-radius":"50%"},src:u(x.userAvatar),alt:""},null,8,pa)):(c.openBlock(),c.createElementBlock("span",ga,c.toDisplayString(x.userName.slice(-2)),1)),x.status==="END"?(c.openBlock(),c.createElementBlock("i",va)):c.createCommentVNode("v-if",!0)]),c.createElementVNode("div",{class:"main-text",title:x.userName},c.toDisplayString(x.userName),9,ma)]))),128))])):c.createCommentVNode("v-if",!0)],4),p[e.defaultFile.nodeType]===e.nodeType.并行分支?(c.openBlock(),c.createElementBlock("div",ya,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(p[e.defaultFile.parallelInstances],x=>(c.openBlock(),c.createElementBlock("div",_a,[c.createElementVNode("div",ka,c.toDisplayString(x.name),1),c.createVNode(v,c.mergeProps({ref_for:!0},r,{"data-list":(x==null?void 0:x.processInstanceNodes)||[]}),null,16,["data-list"])]))),256))])):c.createCommentVNode("v-if",!0)],8,xs)}),128))])}}}),dl="",Zi=ce(Me(Ea,[["__scopeId","data-v-48f27627"]]));ie.IKApprovalProcessDetail=Zi,ie.default=Zi,Object.defineProperties(ie,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
225
+ </xg-mini-progress>`)}}}],[{key:"pluginName",get:function(){return"MiniProgress"}},{key:"defaultConfig",get:function(){return{mode:"auto",height:2}}}]),r}(B),Ne={REAL_TIME:"realtime",FIRST_FRAME:"firstframe",FRAME_RATE:"framerate",POSTER:"poster"};function gs(){try{return parseInt(window.performance.now(),10)}catch{return new Date().getTime()}}function ps(){try{var a=document.createElement("canvas").getContext;return!!a}catch{return!1}}var st=null,vs=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(y(t),"onLoadedData",function(o){t.player&&(t._frameCount=t.config.startFrameCount,t.stop(),t.renderOnTimeupdate(o),t.off(q,t.renderOnTimeupdate),t.on(q,t.renderOnTimeupdate))}),k(y(t),"onVisibilitychange",function(o){document.visibilityState==="visible"?t._checkIfCanStart()&&t.start():document.visibilityState==="hidden"&&t.stop()}),k(y(t),"renderOnTimeupdate",function(o){if(t._frameCount>0)t.renderOnce(),t._frameCount--;else{t._isLoaded=!0,t.off(q,t.renderOnTimeupdate);var l=t.config.startInterval;!t.player.paused&&t._checkIfCanStart()&&t.start(0,l)}}),k(y(t),"start",function(o,l){var u=t.player.video,f=gs(),h=t.checkVideoIsSupport(u);!h||!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===Ne.REAL_TIME||f-t.preTime>=l)&&(u&&u.videoWidth&&t.update(h,t.videoPI),t.preTime=f)),t.frameId=t._loopType==="timer"?d.setTimeout(y(t),t.start,l):d.requestAnimationFrame(t.start))}),k(y(t),"stop",function(){t.frameId&&(t._loopType==="timer"?d.clearTimeout(y(t),t.frameId):d.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!==Ne.REAL_TIME&&this.interval>=1e3?"timer":"animation",this.once(We,function(){e.player&&(e.init(),e.renderByPoster(),e.player.paused||e.start())}),o!==Ne.POSTER&&(o!==Ne.FIRST_FRAME&&(this.on(_e,function(){e.stop()}),this.on(X,function(){var u=e.config.startInterval;e._checkIfCanStart()&&e.start(0,u)}),this.on(Ie,function(){e.stop()})),this.on(ae,this.onLoadedData),this.on(_t,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){F.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&&!(O.browser==="safari"&&d.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=d.typeOf(e)==="String"?e:d.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!==Ne.FIRST_FRAME&&e!==Ne.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 h=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 p=f,v=u;h<i?v=parseInt(f*i/100,10):h>i&&(p=parseInt(u*100/i,10)),n.rwidth=v*o.multiple,n.rheight=p*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(g){F.logError("plugin:DynamicBg",g)}}},{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 st=="boolean"||(st=ps()),st}},{key:"supportCanvasFilter",value:function(){return!(O.browser==="safari"||O.browser==="firefox")}}]),r}(B),ms={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:"直播"}},ze="info",jt=yi,ys=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(y(t),"_recordUserActions",function(o){var l=t._getTime(),u=Object.assign({},o,{msg:o.msg||o.action});t._stats[ze].push(U(U({type:"userAction"},l),{},{payload:u}))}),k(y(t),"_onReset",function(){t.reset()}),k(y(t),"_recordInfo",function(o){t.info(o)}),k(y(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(Je,this._recordUserActions),this.on(jt.STATS_INFO,this._recordInfo),this.on(jt.STATS_DOWNLOAD,this._downloadStats),this.on(jt.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[ze].push(U(U({},i),{},{payload:e}))}},{key:"_infoProfile",value:function(e){if(e&&e.startMs){var i=Date.now(),n=i-e.startMs,o=U({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,ze,[]),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[ze],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[ze];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}(de),Ji=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(y(t),"onGapJump",function(){var o=y(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,h=u.smallGapLimit||.5,p=u.gapDetectionThreshold||.3,v=l.media.currentTime,g=t._getIndex(f,v,p);if(!(g===null||g===0)){console.log("GapJump bufferRange ",f.start(g),f.end(g));var m=f.start(g)+.1,_=l.media.duration;if(!(m>_)){var C=m-v,b=C<=h;C<r.BROWSER_GAP_TOLERANCE||b&&(u.useGapJump!==!1&&(l.media.currentTime=t.isSafari?m+.1:m),t.player&&t.player.emit("detectGap"),console.log("gapJump gapIndex",g," isGapSamll:",b," currentTime:",l.media.currentTime," jumpSize:",v-l.media.currentTime),m!==.08&&l&&l.emit("log",{type:"oneevent",end_type:"gap",vid:l.config.vid,ext:{video_postion:Math.floor(m*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(He,this.onGapJump),this.on(X,function(){e.hasPlayed=!0}),this.on($e,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}(B);Ji.BROWSER_GAP_TOLERANCE=.001;var _s=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(y(t),"onWaiting",function(){var o=y(t),l=o.config;t.jumpCnt>l.jumpCntMax||t.timer||l.useWaitingTimeoutJump===!1||(t.timer=setTimeout(t.onJump,l.waitingTime*1e3))}),k(y(t),"onJump",function(){var o=y(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,h=l.media.duration;f>h||(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(He,this.onWaiting),this.on([yt,se],function(){clearTimeout(e.timer),e.timer=null,e.jumpSize=e.config.jumpSize}),this.on(X,function(){e.hasPlayed=!0}))}}],[{key:"pluginName",get:function(){return"waitingTimeoutJump"}},{key:"defaultConfig",get:function(){return{useWaitingTimeoutJump:!1,waitingTime:15,jumpSize:2,jumpCntMax:4}}}]),r}(B),Fe="cdn",at=["cdn"],ks=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(y(t),"getSpeed",function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Fe;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(y(t),"startTimer",function(){d.isMSE(t.player.video)||(t.initSpeedList(),t.cnt=0,t.timer=setTimeout(t.testSpeed,t.config.testTimeStep))}),k(y(t),"initSpeedList",function(){t.speedListCache={},at.forEach(function(o){t.speedListCache[o]=[]})}),k(y(t),"_onRealSpeedChange",function(o){o.speed&&t.appendList(o.speed,o.type||Fe)}),k(y(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,h=o.testTimeStep,p=l+(l.indexOf("?")<0?"?testst=":"&testst=")+Date.now();if(!(t.cnt>=f)){t.cnt++;try{var v=new Date().getTime(),g=null,m=new XMLHttpRequest;t.xhr=m,m.open("GET",p);var _={},C=Math.floor(Math.random()*10);_.Range="bytes="+C+"-"+(u+C),_&&Object.keys(_).forEach(function(b){m.setRequestHeader(b,_[b])}),m.onreadystatechange=function(){if(m.readyState===4){t.xhr=null,g=new Date().getTime();var b=m.getResponseHeader("Content-Length")/1024*8,E=Math.round(b*1e3/(g-v));t.appendList(E),t.timer=setTimeout(t.testSpeed,h)}},m.send()}catch(b){console.error(b)}}}}),k(y(t),"appendList",function(o){var l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Fe;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=y(t),h=f.player;h&&(l===Fe?h.realTimeSpeed=o:h[t.getSpeedName("realTime",l)]=o),t.updateSpeed(l)}}),k(y(t),"updateSpeed",function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Fe,l=t.getSpeed(o),u=y(t),f=u.player;if(f)if(o===Fe)(!f.avgSpeed||l!==f.avgSpeed)&&(f.avgSpeed=l,f.emit(bt,{speed:l,realTimeSpeed:f.realTimeSpeed}));else{var h=t.getSpeedName("avg",o);(!f[h]||l!==f[h])&&(f[h]=l,f.emit(bt,{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&&at.push.apply(at,Q(n)),this.initSpeedList(),this.on("real_time_speed",this._onRealSpeedChange),this.timer=null,this.cnt=0,this.xhr=null,i&&this.on([ae,Ge],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([ae,Ge],this.startTimer),at.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}(B),Cs=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(X,function(){e._startTick()}),this.on(Ie,function(){e._stopTick()}),this.on(ye,function(){e._stopTick()}),this.on(_e,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,h=l.readyState,p=l.currentTime,v=l.buffered;if(!(u||f||h<4)){var g=this._checkBuffer(p,v),m=g.enoughBuffer,_=g.buffers;m&&(e<=this.config.reportFrame?(this._currentStuckCount++,this._payload.push({currentTime:p,buffers:_,curDecodedFrames:e,totalVideoFrames:i,droppedVideoFrames:n,checkInterval:o}),this._currentStuckCount>=this.config.stuckCount&&(this.emit(_i,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}(B);Ae.use(ms);var Es=S(function a(s,r){var t,e,i;T(this,a);var n=r&&r.isMobileSimulateMode==="mobile",o=r.isLive,l=o?[]:[Ho,Lo,ds,fs,Bo],u=[].concat(l,[Do,Mo,Wo,qo,rs,os,es,ts,jo,Yo]),f=[co,fo,go,Io,po,ls,us,hs,_o];this.plugins=[ys,lo].concat(Q(u),f,[Ji,_s]);var h=n?"mobile":O.device;switch(h){case"pc":(t=this.plugins).push.apply(t,[$i,Vt,Ki,ks,Cs]);break;case"mobile":(e=this.plugins).push.apply(e,[To]);break;default:(i=this.plugins).push.apply(i,[$i,Vt,Ki])}(O.os.isIpad||h==="pc")&&this.plugins.push(vs),O.os.isIpad&&this.plugins.push(Vt),this.ignores=[],this.i18n=[]}),ee=function(a){I(r,a);var s=P(r);function r(){return T(this,r),s.apply(this,arguments)}return S(r)}(nt);k(ee,"defaultPreset",Es),k(ee,"Util",d),k(ee,"Sniffer",O),k(ee,"Errors",je),k(ee,"Events",Fr),k(ee,"Plugin",B),k(ee,"BasePlugin",de),k(ee,"I18N",Ae),k(ee,"STATE_CLASS",w),k(ee,"InstManager",Oi);const cl="",ws=["id"],bs=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}=ut(t),i=c.computed(()=>Se(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=Te.buildUUID(),h=Qi.useNamespace("image-viewer");function p(){l("close"),u.value=!1,r.destroy()}return c.watch(()=>u.value,v=>{v&&c.nextTick(()=>{r=new ee({id:f,url:i.value,...o.value})})}),(v,g)=>{const m=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(h).e("wrapper")),style:c.normalizeStyle({zIndex:a.zIndex})},[c.createElementVNode("div",{class:c.normalizeClass(c.unref(h).e("mask"))},null,2),c.createCommentVNode(" CANVAS "),c.createElementVNode("div",{class:c.normalizeClass(c.unref(h).e("canvas"))},[c.createElementVNode("div",{id:c.unref(f)},null,8,ws),c.createCommentVNode(" CLOSE "),c.createElementVNode("span",{class:c.normalizeClass([c.unref(h).e("btn"),c.unref(h).e("close")]),onClick:p},[c.createVNode(m,{onClick:p},{default:c.withCtx(()=>[c.createVNode(c.unref(Pn))]),_:1})],2)],2),c.renderSlot(v.$slots,"default",{},void 0,!0)],6)]),_:3})])):c.createCommentVNode("v-if",!0)}}}),fl="",Ts=ce(Me(bs,[["__scopeId","data-v-b301aa7d"]])),$t=a=>(c.pushScopeId("data-v-48f27627"),a=a(),c.popScopeId(),a),Ss={class:"approveProcess",id:"approveProcess"},xs=["id"],Is={class:"topBlock"},Ps={class:"left"},As={class:"nodeBg"},Ls=["src"],Ds={class:"right"},Os={class:"topInfo"},Rs={key:0},Ns={key:0,class:"main-text"},Fs={class:"name"},Ms={key:0},Bs={key:0},Hs={key:1},Vs=$t(()=>c.createElementVNode("span",{class:"red",style:{margin:"0px 5px"}}," 退回至",-1)),Us={key:0},zs={key:0},js={key:1},$s={key:1},Ws=$t(()=>c.createElementVNode("div",{class:"main-text"},"抄送人员",-1)),Gs={class:"name"},Ks={key:0},Ys={style:{color:"#000"}},Xs={class:"blue",style:{"margin-left":"5px","font-size":"12px"}},qs={key:1},Js={key:0,class:"blue",style:{"font-size":"12px"}},Zs={key:1},Qs={key:0,class:"blue",style:{"font-size":"12px"}},ea={key:1,class:"blue",style:{"font-size":"12px"}},ta={class:"time"},ia={key:0},na={key:1},ra=["onClick"],oa=["onClick"],sa={key:0,class:"opinion"},aa={key:0},la={key:1},ua=$t(()=>c.createElementVNode("span",{class:"ik-text-primary"},"添加审批人",-1)),ca={style:{color:"var(--el-text-color-primary)","margin-left":"8px"}},fa={key:2,class:"annexImage"},ha={key:3,class:"approveList"},da={class:"nodeBg-list"},ga=["src"],pa={key:1},va={key:2,class:"ikapprove ikapprove-duihao2 green read"},ma=["title"],ya={key:0,class:"branch"},_a={class:"branch-card"},ka={class:"branch-name"},Ca={name:"IkingApprovalProcessDetail"},Ea=c.defineComponent({...Ca,props:{local:{type:Boolean,default:!1},defaultStatus:{type:Object,default:()=>({})},defaultNodeType:{type:Object,default:()=>({})},dataList:{type:Array,default:()=>[]},defaultFieldMap:{type:Object,default:()=>({})},returnNode:{type:Array,default:()=>[]},fileUrl:{type:String,default:""},kkUrl:{type:String,default:""},isOnlyOfficePreview:{type:Boolean,default:!1},onlyOfficeAccept:{type:String,default:".pdf,.docx,.doc.ppt,.pptx,.xlsx,.xls,"},onlyofficeServer:{type:String,default:""}},emits:["preview"],setup(a,{emit:s}){const r=a,{cLoadUrl:t}=ut(r),e=c.reactive(An(r));c.watch(()=>r.dataList,f=>{f&&(c.nextTick(()=>{e.listData=f}),setTimeout(()=>{r.returnNode.length&&i()},500))},{deep:!0}),c.onMounted(()=>{r.dataList.length&&(e.listData=r.dataList,setTimeout(()=>{r.returnNode.length&&i()},500))});const i=()=>{let f=null;if(r!=null&&r.returnNode)for(f of r==null?void 0:r.returnNode){if(isNaN(f[1]))return;let h=Array.from(new Array(f[1]+1).keys()).slice(f[0]);c.nextTick(()=>{n(h)})}},n=f=>{var C,b,E;let h=document.createElement("div"),p=document.getElementById("approveProcess"),v=0,g=(C=document.getElementById(`${f[0]}`))==null?void 0:C.offsetWidth,m=(b=document.getElementById(`${f[0]}`))==null?void 0:b.offsetLeft,_=(E=document.getElementById(`${f[0]}`))==null?void 0:E.offsetTop;f.forEach(N=>{let R=document.getElementById(`${N}`);v+=R.offsetHeight}),setTimeout(()=>{h.style.width=g+32+"px",h.style.height=v+"px",h.style.background="#f9f9f9",h.style.position="absolute",h.style.top=_-16+"px",h.style.left=m-16+"px",h.style.zIndex=-1,p==null||p.appendChild(h)})},o=(f,h,p)=>{var m,_;let v=(m=e.listData)==null?void 0:m.findIndex(C=>C.lineType=="dashed"),g="";if(p&&((_=p[e.defaultFile.approvePersonList])==null?void 0:_.findIndex(b=>b[e.defaultFile.approveStatus]===e.statusOption.执行中))>-1)return"ikapprove ikapprove-dengdai orange";switch(f){case e.statusOption.发起:g="ikapprove-duihao2 green";break;case e.statusOption.执行中:g=v==h?"ikapprove-dengdai orange":"";break;case e.statusOption.同意:g="ikapprove-duihao2 green";break;case e.statusOption.拒绝:g="ikapprove-jujue red";break;case e.statusOption.转交:g="ikapprove-zhuanjiao blue";break;case e.statusOption.加签:g="ikapprove-tianjia blue";break;case e.statusOption.退回:g="ikapprove-s_fanhui2 red";break;case e.statusOption.评论:g="ikapprove-pinglun1 blue";break}return`ikapprove ${g}`},l=(f,h)=>{f.show=!f.show;let p=document.getElementById(`${f[e.defaultFile.nodeId]}`),v=Array.from(p==null?void 0:p.getElementsByClassName("approveList"));for(let g of v)g.style.display=h},u=f=>Se(t.value,f);return(f,h)=>{const p=c.resolveComponent("el-image"),v=c.resolveComponent("IkingApprovalProcessDetail");return c.openBlock(),c.createElementBlock("div",Ss,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(e.listData,(g,m)=>{var _,C,b,E,N,R,H,D,j,z;return c.openBlock(),c.createElementBlock("div",{class:"approveBlock",id:g[e.defaultFile.nodeId],key:g[e.defaultFile.nodeId]},[c.createElementVNode("div",Is,[c.createElementVNode("div",Ps,[c.createElementVNode("span",As,[c.createCommentVNode(' 用户列表长度等于1, :src="formatUrl(it)"并且存在头像 '),((_=g[e.defaultFile.approvePersonList])==null?void 0:_.length)==1&&g[e.defaultFile.approvePersonList][0].userAvatar?(c.openBlock(),c.createElementBlock("img",{key:0,style:{width:"100%",height:"100%","border-radius":"10px"},src:u(g[e.defaultFile.approvePersonList][0].userAvatar),alt:""},null,8,Ls)):(c.openBlock(),c.createElementBlock(c.Fragment,{key:1},[c.createCommentVNode(" 否则显示对应节点 "),c.createElementVNode("i",{class:c.normalizeClass(c.unref(Ln)(e,g[e.defaultFile.nodeType],g[e.defaultFile.approvePersonList]))},null,2)],2112)),c.createCommentVNode(" 审批状态图标 "),c.createElementVNode("i",{class:c.normalizeClass(o(g[e.defaultFile.approveStatus],m,g))},null,2)])]),c.createElementVNode("div",Ds,[c.createElementVNode("div",Os,[c.createElementVNode("div",null,[c.createCommentVNode(" 不是抄送节点 "),e.nodeType.抄送节点!==g[e.defaultFile.nodeType]?(c.openBlock(),c.createElementBlock("div",Rs,[c.createCommentVNode(" 撤销,评论不显示节点名称 "),g[e.defaultFile.approveStatus]!=e.statusOption.撤销&&g[e.defaultFile.approveStatus]!=e.statusOption.评论&&g[e.defaultFile.nodeType]!==e.nodeType.并行分支?(c.openBlock(),c.createElementBlock("div",Ns,c.toDisplayString(g[e.defaultFile.nodeTypeName]),1)):c.createCommentVNode("v-if",!0),c.createCommentVNode(" 名字+审批状态 "),c.createElementVNode("div",Fs,[c.createCommentVNode(" 已审批节点文本 "),g[e.defaultFile.lineType]=="solid"?(c.openBlock(),c.createElementBlock("div",Ms,[c.createElementVNode("span",{style:c.normalizeStyle({color:g[e.defaultFile.approveStatus]==e.statusOption.评论?"#000":""})},c.toDisplayString(g[e.defaultFile.originator]),5),c.createCommentVNode(" 发起,退回不显示状态 "),g[e.defaultFile.approveStatusName]&&g[e.defaultFile.approveStatus]!=e.statusOption.发起&&g[e.defaultFile.approveStatus]!=e.statusOption.退回?(c.openBlock(),c.createElementBlock("span",Bs,c.toDisplayString(g[e.defaultFile.approveStatus]==e.statusOption.评论?" 添加了评论":g!=null&&g.nodeActionAliasName?`(已${g.nodeActionAliasName})`:`(${g[e.defaultFile.approveStatusName]})`),1)):c.createCommentVNode("v-if",!0),c.createCommentVNode(" 退回状态显示 "),g[e.defaultFile.approveStatus]==e.statusOption.退回?(c.openBlock(),c.createElementBlock("span",Hs,[Vs,c.createTextVNode(" "+c.toDisplayString(g[e.defaultFile.backToInstanceNodeName]||g[e.defaultFile.backToRecordNodeName]),1)])):c.createCommentVNode("v-if",!0)])):(c.openBlock(),c.createElementBlock(c.Fragment,{key:1},[c.createCommentVNode(" 待审批节点 "),c.createElementVNode("div",null,[((C=g[e.defaultFile.approvePersonList])==null?void 0:C.length)==1?(c.openBlock(),c.createElementBlock("span",Us,[c.createTextVNode(c.toDisplayString(g[e.defaultFile.originator])+" ",1),g[e.defaultFile.approveStatus]==e.statusOption.等待?(c.openBlock(),c.createElementBlock("span",zs,c.toDisplayString(g!=null&&g.nodeActionAliasName?`(已${g.nodeActionAliasName})`:`(${g[e.defaultFile.approveStatusName]})`),1)):c.createCommentVNode("v-if",!0)])):g[e.defaultFile.approvePersonList]?(c.openBlock(),c.createElementBlock("span",js,c.toDisplayString(`${(b=g[e.defaultFile.approvePersonList])==null?void 0:b.length}人${g[e.defaultFile.approveTypeName]}`),1)):c.createCommentVNode("v-if",!0)])],2112))])])):(c.openBlock(),c.createElementBlock("div",$s,[Ws,c.createElementVNode("div",Gs,[c.createCommentVNode(" 抄送一人时 "),((E=g[e.defaultFile.approvePersonList])==null?void 0:E.length)==1?(c.openBlock(),c.createElementBlock("span",Ks,[c.createElementVNode("span",null,[c.createTextVNode("已抄送给 "),c.createElementVNode("span",Ys,c.toDisplayString(g[e.defaultFile.approvePersonList][0].userName),1)]),c.createElementVNode("span",Xs,c.toDisplayString(g[e.defaultFile.approvePersonList][0].status==="END"?"已读":"未读"),1)])):c.createCommentVNode("v-if",!0),c.createCommentVNode(" 抄送多人时 "),((N=g[e.defaultFile.approvePersonList])==null?void 0:N.length)>1?(c.openBlock(),c.createElementBlock("span",qs,[c.createTextVNode(c.toDisplayString(`已抄送${(R=g[e.defaultFile.approvePersonList])==null?void 0:R.length}人`)+" ",1),g[e.defaultFile.allRead]?(c.openBlock(),c.createElementBlock("span",Js," 全部已读 ")):(c.openBlock(),c.createElementBlock("span",Zs,[g[e.defaultFile.read]?c.createCommentVNode("v-if",!0):(c.openBlock(),c.createElementBlock("span",Qs," 全部未读 ")),g[e.defaultFile.read]?(c.openBlock(),c.createElementBlock("span",ea,c.toDisplayString(g[e.defaultFile.read])+"人已读 ",1)):c.createCommentVNode("v-if",!0)]))])):c.createCommentVNode("v-if",!0)])]))]),c.createElementVNode("div",ta,[c.createCommentVNode(" 不是抄送节点,展示时间 "),g[e.defaultFile.nodeType]!=e.nodeType.抄送节点&&g[e.defaultFile.approveStatus]!==e.statusOption.等待?(c.openBlock(),c.createElementBlock("span",ia,c.toDisplayString(c.unref(Te.ikDate).toDateTime(g[e.defaultFile.operationTime],"MM/DD HH:mm")),1)):c.createCommentVNode("v-if",!0),c.createCommentVNode(" 是抄送节点,并且抄送人员大于1时,展示图标 "),g[e.defaultFile.nodeType]==e.nodeType.抄送节点&&((H=g[e.defaultFile.approvePersonList])==null?void 0:H.length)>1?(c.openBlock(),c.createElementBlock("span",na,[g!=null&&g.show?(c.openBlock(),c.createElementBlock("i",{key:0,class:"ikapprove ikapprove-a-putongjiantouzhankai",onClick:x=>l(g,"grid")},null,8,ra)):(c.openBlock(),c.createElementBlock("i",{key:1,onClick:x=>l(g,"none"),class:"ikapprove ikapprove-a-putongjiantoushouqi"},null,8,oa))])):c.createCommentVNode("v-if",!0)])])])]),c.createElementVNode("div",{class:"bottomBlock",style:c.normalizeStyle({borderLeft:m==e.listData.length-1?"":`2px ${g[e.defaultFile.lineType]||"dashed"} var(--el-border-color)`})},[c.createCommentVNode(" 审批意见 "),g[e.defaultFile.approveOpinion]||g[e.defaultFile.approveStatus]==e.statusOption.加签?(c.openBlock(),c.createElementBlock("div",sa,[g[e.defaultFile.approveOpinion]?(c.openBlock(),c.createElementBlock("span",aa,c.toDisplayString(g[e.defaultFile.approveOpinion]),1)):c.createCommentVNode("v-if",!0),g[e.defaultFile.approveStatus]==e.statusOption.加签?(c.openBlock(),c.createElementBlock("span",la,[ua,(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(g[e.defaultFile.countersignPer],(x,$)=>(c.openBlock(),c.createElementBlock("span",ca,c.toDisplayString(x==null?void 0:x.userName)+c.toDisplayString($<g[e.defaultFile.countersignPer].length-1?"、":""),1))),256))])):c.createCommentVNode("v-if",!0)])):c.createCommentVNode("v-if",!0),c.createCommentVNode(" 附件 "),(D=g[e.defaultFile.attachment])!=null&&D.length?(c.openBlock(),c.createBlock(c.unref(Vn),{key:1,list:g[e.defaultFile.attachment]},null,8,["list"])):c.createCommentVNode("v-if",!0),c.createCommentVNode(" 附件图片 "),(j=g[e.defaultFile.attachmentImg])!=null&&j.length?(c.openBlock(),c.createElementBlock("div",fa,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(g[e.defaultFile.attachmentImg],(x,$)=>(c.openBlock(),c.createElementBlock("div",{class:"image",key:$},[c.createVNode(p,{src:u(x),"preview-src-list":g[e.defaultFile.attachmentImg].map(Z=>u(Z)),fit:"cover","z-index":"9999","zoom-rate":1.2,alt:u(x)},null,8,["src","preview-src-list","alt"])]))),128))])):c.createCommentVNode("v-if",!0),c.createCommentVNode(" 抄送节点或是等待审批状态并且列表长度大于1 "),(g[e.defaultFile.nodeType]==e.nodeType.抄送节点||g[e.defaultFile.approveStatus]==e.statusOption.等待)&&((z=g[e.defaultFile.approvePersonList])==null?void 0:z.length)>1?(c.openBlock(),c.createElementBlock("div",ha,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(g[e.defaultFile.approvePersonList],x=>(c.openBlock(),c.createElementBlock("div",{class:"perBlock",key:x.userName},[c.createElementVNode("span",da,[x.userAvatar?(c.openBlock(),c.createElementBlock("img",{key:0,style:{width:"100%",height:"100%","border-radius":"50%"},src:u(x.userAvatar),alt:""},null,8,ga)):(c.openBlock(),c.createElementBlock("span",pa,c.toDisplayString(x.userName.slice(-2)),1)),x.status==="END"?(c.openBlock(),c.createElementBlock("i",va)):c.createCommentVNode("v-if",!0)]),c.createElementVNode("div",{class:"main-text",title:x.userName},c.toDisplayString(x.userName),9,ma)]))),128))])):c.createCommentVNode("v-if",!0)],4),g[e.defaultFile.nodeType]===e.nodeType.并行分支?(c.openBlock(),c.createElementBlock("div",ya,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(g[e.defaultFile.parallelInstances],x=>(c.openBlock(),c.createElementBlock("div",_a,[c.createElementVNode("div",ka,c.toDisplayString(x.name),1),c.createVNode(v,c.mergeProps({ref_for:!0},r,{"data-list":(x==null?void 0:x.processInstanceNodes)||[]}),null,16,["data-list"])]))),256))])):c.createCommentVNode("v-if",!0)],8,xs)}),128))])}}}),dl="",Zi=ce(Me(Ea,[["__scopeId","data-v-48f27627"]]));ie.IKApprovalProcessDetail=Zi,ie.default=Zi,Object.defineProperties(ie,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});