build all

This commit is contained in:
Harvey Zhao committed 2025-12-13 14:11:16 +08:00
1 parent b84b0af2ec
commit 48b3f76151
228 files changed
+327 -310

No files matched your search

@@ -5,4 +5,4 @@
* (c) 2017-2025 Harvey Zack
* Released under the MIT License.
*/
!function(e,t,r,s,i,n,a,o){var l="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},c="function"==typeof l[s]&&l[s],d=c.i||{},u=c.cache||{},v="undefined"!=typeof module&&"function"==typeof module.require&&module.require.bind(module);function f(t,r){if(!u[t]){if(!e[t]){if(i[t])return i[t];var n="function"==typeof l[s]&&l[s];if(!r&&n)return n(t,!0);if(c)return c(t,!0);if(v&&"string"==typeof t)return v(t);var a=Error("Cannot find module '"+t+"'");throw a.code="MODULE_NOT_FOUND",a}d.resolve=function(r){var s=e[t][1][r];return null!=s?s:r},d.cache={};var o=u[t]=new f.Module(t);e[t][0].call(o.exports,d,o,o.exports,l)}return u[t].exports;function d(e){var t=d.resolve(e);return!1===t?{}:f(t)}}f.isParcelRequire=!0,f.Module=function(e){this.id=e,this.bundle=f,this.require=v,this.exports={}},f.modules=e,f.cache=u,f.parent=c,f.distDir=void 0,f.publicUrl=void 0,f.devServer=void 0,f.i=d,f.register=function(t,r){e[t]=[function(e,t){t.exports=r},{}]},Object.defineProperty(f,"root",{get:function(){return l[s]}}),l[s]=f;for(var h=0;h<t.length;h++)f(t[h]);if(r){var m=f(r);"object"==typeof exports&&"undefined"!=typeof module?module.exports=m:"function"==typeof define&&define.amd&&define(function(){return m})}}({"9G2Gn":[function(e,t,r,s){var i=e("@parcel/transformer-js/src/esmodule-helpers.js");i.defineInteropFlag(r),i.export(r,"default",()=>o);var n=e("./adapter"),a=i.interopDefault(n);function o(e){return t=>{let r=new(0,a.default)(t,e);return{name:"artplayerPluginLibass",libass:r.libass,visible:r.visible,init:r.init.bind(r),switch:r.switch.bind(r),show:r.show.bind(r),hide:r.hide.bind(r),destroy:r.destroy.bind(r)}}}"undefined"!=typeof window&&(window.artplayerPluginLibass=o)},{"./adapter":"aO4ju","@parcel/transformer-js/src/esmodule-helpers.js":"6ykb1"}],aO4ju:[function(e,t,r,s){var i=e("@parcel/transformer-js/src/esmodule-helpers.js");i.defineInteropFlag(r);var n=e("libass-wasm"),a=i.interopDefault(n);let o=`[Script Info] ScriptType: v4.00+`;r.default=class{constructor(e,t){let{constructor:r,template:s}=e;this.art=e,this.$video=s.$video,this.$webvtt=s.$subtitle,this.utils=r.utils,this.libass=null,e.once("ready",this.init.bind(this,t))}async init(e){this.#e(),await this.#t(e),this.#r(),this.art.emit("artplayerPluginLibass:init",this);let t=this.art?.option?.subtitle?.url;t&&"ass"===this.utils.getExt(t)&&this.switch(t)}switch(e){this.art.emit("artplayerPluginLibass:switch",e),e&&"ass"===this.utils.getExt(e)?(this.currentType="ass",this.libass.freeTrack(),this.libass.setTrackByUrl(this.#s(e)),this.visible=this.art.subtitle.show):(this.currentType="webvtt",this.hide(),this.libass.freeTrack())}setVisibility(e){this.visible=e}setOffset(e){this.timeOffset=e}get active(){return"ass"===this.currentType}get visible(){return!!this.libass&&"none"!==this.libass.canvasParent.style.display}set visible(e){this.art.emit("artplayerPluginLibass:visible",e),this.#i(!this.active),this.libass.canvasParent&&(this.libass.canvasParent.style.display=e?"block":"none",e&&this.libass.resize())}get timeOffset(){return this.libass.timeOffset}set timeOffset(e){this.art.emit("artplayerPluginLibass:timeOffset",e),this.libass.timeOffset=e}show(){this.visible=!0}hide(){this.visible=!1}destroy(){this.art.emit("artplayerPluginLibass:destroy"),this.#n(),this.libass.dispose(),URL.revokeObjectURL(this.workerScriptUrl),this.libass=null}async #t(e={}){if(!e.fallbackFont)return this.utils.errorHandle(e.fallbackFont,"artplayerPluginLibass: fallbackFont is required");e.workerUrl||(e.workerUrl="https://cdnjs.cloudflare.com/ajax/libs/libass-wasm/4.1.0/js/subtitles-octopus-worker.js"),e.availableFonts&&(e.availableFonts=Object.entries(e.availableFonts).reduce((e,[t,r])=>(e[t]=this.#s(r),e),{})),this.libass=new(0,a.default)({subContent:o,video:this.$video,...e,workerUrl:await this.#a(e),fallbackFont:this.#s(e.fallbackFont),fonts:e.fonts?.map(e=>this.#s(e))}),this.libass.canvasParent.className="artplayer-plugin-libass",this.libass.canvasParent.style.cssText=` position: absolute; top: 0; left: 0; width: 100%; height: 100%; user-select: none; pointer-events: none; z-index: 20;`}#r(){this.switchHandler=this.switch.bind(this),this.visibleHandler=this.setVisibility.bind(this),this.offsetHandler=this.setOffset.bind(this),this.art.on("subtitle",this.visibleHandler),this.art.on("subtitleLoad",this.switchHandler),this.art.on("subtitleOffset",this.offsetHandler),this.art.once("destroy",this.destroy.bind(this))}#n(){this.art.off("subtitle",this.visibleHandler),this.art.off("subtitleLoad",this.switchHandler),this.art.off("subtitleOffset",this.offsetHandler)}#i(e){this.$webvtt.style.visibility=e?"visible":"hidden"}#s(e){return this.#o(e)?e:new URL(e,document.baseURI).toString()}#o(e){return/^https?:\/\//.test(e)}#a({workerUrl:e,wasmUrl:t}){return new Promise(r=>{fetch(e).then(e=>e.text()).then(s=>{let i=s,n=new Blob([i=i.replace(/wasmBinaryFile\s*=\s*"(subtitles-octopus-worker\.wasm)"/g,(r,s)=>(Line truncated
!function(e,t,r,s,n,i,a,o){var l="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},c="function"==typeof l[s]&&l[s],d=c.i||{},u=c.cache||{},v="undefined"!=typeof module&&"function"==typeof module.require&&module.require.bind(module);function f(t,r){if(!u[t]){if(!e[t]){if(n[t])return n[t];var i="function"==typeof l[s]&&l[s];if(!r&&i)return i(t,!0);if(c)return c(t,!0);if(v&&"string"==typeof t)return v(t);var a=Error("Cannot find module '"+t+"'");throw a.code="MODULE_NOT_FOUND",a}d.resolve=function(r){var s=e[t][1][r];return null!=s?s:r},d.cache={};var o=u[t]=new f.Module(t);e[t][0].call(o.exports,d,o,o.exports,l)}return u[t].exports;function d(e){var t=d.resolve(e);if(!1===t)return{};if(Array.isArray(t)){var r={__esModule:!0};return t.forEach(function(e){var t=e[0],s=e[1],n=e[2]||e[0],i=f(s);"*"===t?Object.keys(i).forEach(function(e){"default"===e||"__esModule"===e||Object.prototype.hasOwnProperty.call(r,e)||Object.defineProperty(r,e,{enumerable:!0,get:function(){return i[e]}})}):"*"===n?Object.defineProperty(r,t,{enumerable:!0,value:i}):Object.defineProperty(r,t,{enumerable:!0,get:function(){return"default"===n?i.__esModule?i.default:i:i[n]}})}),r}return f(t)}}f.isParcelRequire=!0,f.Module=function(e){this.id=e,this.bundle=f,this.require=v,this.exports={}},f.modules=e,f.cache=u,f.parent=c,f.distDir=void 0,f.publicUrl=void 0,f.devServer=void 0,f.i=d,f.register=function(t,r){e[t]=[function(e,t){t.exports=r},{}]},Object.defineProperty(f,"root",{get:function(){return l[s]}}),l[s]=f;for(var h=0;h<t.length;h++)f(t[h]);if(r){var m=f(r);"object"==typeof exports&&"undefined"!=typeof module?module.exports=m:"function"==typeof define&&define.amd&&define(function(){return m})}}({"9G2Gn":[function(e,t,r,s){var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"default",()=>o);var i=e("./adapter"),a=n.interopDefault(i);function o(e){return t=>{let r=new(0,a.default)(t,e);return{name:"artplayerPluginLibass",libass:r.libass,visible:r.visible,init:r.init.bind(r),switch:r.switch.bind(r),show:r.show.bind(r),hide:r.hide.bind(r),destroy:r.destroy.bind(r)}}}"undefined"!=typeof window&&(window.artplayerPluginLibass=o)},{"./adapter":"aO4ju","@parcel/transformer-js/src/esmodule-helpers.js":"6ykb1"}],aO4ju:[function(e,t,r,s){var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r);var i=e("libass-wasm"),a=n.interopDefault(i);let o=`[Script Info] ScriptType: v4.00+`;r.default=class{constructor(e,t){const{constructor:r,template:s}=e;this.art=e,this.$video=s.$video,this.$webvtt=s.$subtitle,this.utils=r.utils,this.libass=null,e.once("ready",this.init.bind(this,t))}async init(e){this.#e(),await this.#t(e),this.#r(),this.art.emit("artplayerPluginLibass:init",this);let t=this.art?.option?.subtitle?.url;t&&"ass"===this.utils.getExt(t)&&this.switch(t)}switch(e){this.art.emit("artplayerPluginLibass:switch",e),e&&"ass"===this.utils.getExt(e)?(this.currentType="ass",this.libass.freeTrack(),this.libass.setTrackByUrl(this.#s(e)),this.visible=this.art.subtitle.show):(this.currentType="webvtt",this.hide(),this.libass.freeTrack())}setVisibility(e){this.visible=e}setOffset(e){this.timeOffset=e}get active(){return"ass"===this.currentType}get visible(){return!!this.libass&&"none"!==this.libass.canvasParent.style.display}set visible(e){this.art.emit("artplayerPluginLibass:visible",e),this.#n(!this.active),this.libass.canvasParent&&(this.libass.canvasParent.style.display=e?"block":"none",e&&this.libass.resize())}get timeOffset(){return this.libass.timeOffset}set timeOffset(e){this.art.emit("artplayerPluginLibass:timeOffset",e),this.libass.timeOffset=e}show(){this.visible=!0}hide(){this.visible=!1}destroy(){this.art.emit("artplayerPluginLibass:destroy"),this.#i(),this.libass.dispose(),URL.revokeObjectURL(this.workerScriptUrl),this.libass=null}async #t(e={}){if(!e.fallbackFont)return this.utils.errorHandle(e.fallbackFont,"artplayerPluginLibass: fallbackFont is required");e.workerUrl||(e.workerUrl="https://cdnjs.cloudflare.com/ajax/libs/libass-wasm/4.1.0/js/subtitles-octopus-worker.js"),e.availableFonts&&(e.availableFonts=Object.entries(e.availableFonts).reduce((e,[t,r])=>(e[t]=this.#s(r),e),{})),this.libass=new(0,a.default)({subContent:o,video:this.$video,...e,workerUrl:await this.#a(e),fallbackFont:this.#s(e.fallbackFont),fonts:e.fonts?.map(e=>this.#s(e))}),this.libass.canvasParent.className="artplayer-plugin-libass",this.libass.canvasParent.style.cssText=` position: absolute; top: 0; left: 0; width: 100%; height: 100%; user-select: none; pointer-events: none; z-index: 20;`}#r(){this.switchHandler=this.switch.bind(this),this.visibleHandler=this.setVisibility.bind(this),this.offsetHandler=this.setOffset.bind(this),this.art.on("subtitle",this.visibleHandler),this.art.on("subtitleLoad",this.switchHandler),this.art.on("subtitleOffset",this.offsetHandler),this.art.once("destroy",this.destroy.bind(this))}#i(){Line truncated
@@ -5,4 +5,4 @@
* (c) 2017-2025 Harvey Zack
* Released under the MIT License.
*/
!function(e,t,r,n,o,i,s,a){var c="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},l="function"==typeof c[n]&&c[n],u=l.i||{},f=l.cache||{},d="undefined"!=typeof module&&"function"==typeof module.require&&module.require.bind(module);function p(t,r){if(!f[t]){if(!e[t]){if(o[t])return o[t];var i="function"==typeof c[n]&&c[n];if(!r&&i)return i(t,!0);if(l)return l(t,!0);if(d&&"string"==typeof t)return d(t);var s=Error("Cannot find module '"+t+"'");throw s.code="MODULE_NOT_FOUND",s}u.resolve=function(r){var n=e[t][1][r];return null!=n?n:r},u.cache={};var a=f[t]=new p.Module(t);e[t][0].call(a.exports,u,a,a.exports,c)}return f[t].exports;function u(e){var t=u.resolve(e);return!1===t?{}:p(t)}}p.isParcelRequire=!0,p.Module=function(e){this.id=e,this.bundle=p,this.require=d,this.exports={}},p.modules=e,p.cache=f,p.parent=l,p.distDir=void 0,p.publicUrl=void 0,p.devServer=void 0,p.i=u,p.register=function(t,r){e[t]=[function(e,t){t.exports=r},{}]},Object.defineProperty(p,"root",{get:function(){return c[n]}}),c[n]=p;for(var h=0;h<t.length;h++)p(t[h]);if(r){var v=p(r);"object"==typeof exports&&"undefined"!=typeof module?module.exports=v:"function"==typeof define&&define.amd&&define(function(){return v})}}({"4kqKD":[function(e,t,r,n){var o=e("@parcel/transformer-js/src/esmodule-helpers.js");o.defineInteropFlag(r),o.export(r,"default",function(){return a});var i=e("./adapter"),s=o.interopDefault(i);function a(e){return function(t){var r=new(0,s.default)(t,e);return{name:"artplayerPluginLibass",libass:r.libass,visible:r.visible,init:r.init.bind(r),switch:r.switch.bind(r),show:r.show.bind(r),hide:r.hide.bind(r),destroy:r.destroy.bind(r)}}}"undefined"!=typeof window&&(window.artplayerPluginLibass=a)},{"./adapter":"jEGLL","@parcel/transformer-js/src/esmodule-helpers.js":"qpMMf"}],jEGLL:[function(e,t,r,n){var o=e("@parcel/transformer-js/src/esmodule-helpers.js");o.defineInteropFlag(r),o.export(r,"default",function(){return O});var i=e("@swc/helpers/cjs/_async_to_generator.cjs"),s=e("@swc/helpers/cjs/_class_call_check.cjs"),a=e("@swc/helpers/cjs/_class_private_method_get.cjs"),c=e("@swc/helpers/cjs/_class_private_method_init.cjs"),l=e("@swc/helpers/cjs/_create_class.cjs"),u=e("@swc/helpers/cjs/_object_spread.cjs"),f=e("@swc/helpers/cjs/_object_spread_props.cjs"),d=e("@swc/helpers/cjs/_sliced_to_array.cjs"),p=e("@swc/helpers/cjs/_type_of.cjs"),h=e("@swc/helpers/cjs/_ts_generator.cjs"),v=e("libass-wasm"),b=o.interopDefault(v),y=new WeakSet,m=new WeakSet,w=new WeakSet,g=new WeakSet,_=new WeakSet,k=new WeakSet,j=new WeakSet,x=new WeakSet,O=function(){"use strict";function e(t,r){(0,s._)(this,e),(0,c._)(this,y),(0,c._)(this,m),(0,c._)(this,w),(0,c._)(this,g),(0,c._)(this,_),(0,c._)(this,k),(0,c._)(this,j),(0,c._)(this,x);var n=t.constructor,o=t.template;this.art=t,this.$video=o.$video,this.$webvtt=o.$subtitle,this.utils=n.utils,this.libass=null,t.once("ready",this.init.bind(this,r))}return(0,l._)(e,[{key:"init",value:function(e){return(0,i._)(function(){var t,r,n,o;return(0,h._)(this,function(i){switch(i.label){case 0:return(0,a._)(this,x,R).call(this),[4,(0,a._)(this,y,E).call(this,e)];case 1:return i.sent(),(0,a._)(this,m,P).call(this),this.art.emit("artplayerPluginLibass:init",this),(o=null==(n=this.art)||null==(r=n.option)||null==(t=r.subtitle)?void 0:t.url)&&"ass"===this.utils.getExt(o)&&this.switch(o),[2]}})}).call(this)}},{key:"switch",value:function(e){this.art.emit("artplayerPluginLibass:switch",e),e&&"ass"===this.utils.getExt(e)?(this.currentType="ass",this.libass.freeTrack(),this.libass.setTrackByUrl((0,a._)(this,_,T).call(this,e)),this.visible=this.art.subtitle.show):(this.currentType="webvtt",this.hide(),this.libass.freeTrack())}},{key:"setVisibility",value:function(e){this.visible=e}},{key:"setOffset",value:function(e){this.timeOffset=e}},{key:"active",get:function(){return"ass"===this.currentType}},{key:"visible",get:function(){return!!this.libass&&"none"!==this.libass.canvasParent.style.display},set:function(e){this.art.emit("artplayerPluginLibass:visible",e),(0,a._)(this,g,S).call(this,!this.active),this.libass.canvasParent&&(this.libass.canvasParent.style.display=e?"block":"none",e&&this.libass.resize())}},{key:"timeOffset",get:function(){return this.libass.timeOffset},set:function(e){this.art.emit("artplayerPluginLibass:timeOffset",e),this.libass.timeOffset=e}},{key:"show",value:function(){this.visible=!0}},{key:"hide",value:function(){this.visible=!1}},{key:"destroy",value:function(){this.art.emit("artplayerPluginLibass:destroy"),(0,a._)(this,w,L).call(this),this.libass.dispose(),URL.revokeObjectURL(this.workerScriptUrl),this.libass=null}}]),e}();function E(){return(0,i._)(function(){var e,t,r,n,o,i,s,c=arguments;return(0,h._)(this,function(l){switch(l.label){case 0:if(e=this,!(t=c.length>0&&void 0!==c[0]?c[0]:{}).fallbackFont)return[2,this.utils.errorHandle(t.fallbackFont,"artplayerPluginLibass: fallbackFont is required")]Line truncated
!function(e,t,r,n,o,i,s,a){var c="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},u="function"==typeof c[n]&&c[n],l=u.i||{},f=u.cache||{},d="undefined"!=typeof module&&"function"==typeof module.require&&module.require.bind(module);function p(t,r){if(!f[t]){if(!e[t]){if(o[t])return o[t];var i="function"==typeof c[n]&&c[n];if(!r&&i)return i(t,!0);if(u)return u(t,!0);if(d&&"string"==typeof t)return d(t);var s=Error("Cannot find module '"+t+"'");throw s.code="MODULE_NOT_FOUND",s}l.resolve=function(r){var n=e[t][1][r];return null!=n?n:r},l.cache={};var a=f[t]=new p.Module(t);e[t][0].call(a.exports,l,a,a.exports,c)}return f[t].exports;function l(e){var t=l.resolve(e);if(!1===t)return{};if(Array.isArray(t)){var r={__esModule:!0};return t.forEach(function(e){var t=e[0],n=e[1],o=e[2]||e[0],i=p(n);"*"===t?Object.keys(i).forEach(function(e){"default"===e||"__esModule"===e||Object.prototype.hasOwnProperty.call(r,e)||Object.defineProperty(r,e,{enumerable:!0,get:function(){return i[e]}})}):"*"===o?Object.defineProperty(r,t,{enumerable:!0,value:i}):Object.defineProperty(r,t,{enumerable:!0,get:function(){return"default"===o?i.__esModule?i.default:i:i[o]}})}),r}return p(t)}}p.isParcelRequire=!0,p.Module=function(e){this.id=e,this.bundle=p,this.require=d,this.exports={}},p.modules=e,p.cache=f,p.parent=u,p.distDir=void 0,p.publicUrl=void 0,p.devServer=void 0,p.i=l,p.register=function(t,r){e[t]=[function(e,t){t.exports=r},{}]},Object.defineProperty(p,"root",{get:function(){return c[n]}}),c[n]=p;for(var h=0;h<t.length;h++)p(t[h]);if(r){var v=p(r);"object"==typeof exports&&"undefined"!=typeof module?module.exports=v:"function"==typeof define&&define.amd&&define(function(){return v})}}({"4kqKD":[function(e,t,r,n){var o=e("@parcel/transformer-js/src/esmodule-helpers.js");o.defineInteropFlag(r),o.export(r,"default",function(){return a});var i=e("./adapter"),s=o.interopDefault(i);function a(e){return function(t){var r=new(0,s.default)(t,e);return{name:"artplayerPluginLibass",libass:r.libass,visible:r.visible,init:r.init.bind(r),switch:r.switch.bind(r),show:r.show.bind(r),hide:r.hide.bind(r),destroy:r.destroy.bind(r)}}}"undefined"!=typeof window&&(window.artplayerPluginLibass=a)},{"./adapter":"jEGLL","@parcel/transformer-js/src/esmodule-helpers.js":"qpMMf"}],jEGLL:[function(e,t,r,n){var o=e("@parcel/transformer-js/src/esmodule-helpers.js");o.defineInteropFlag(r),o.export(r,"default",function(){return x});var i=e("@swc/helpers/cjs/_async_to_generator.cjs"),s=e("@swc/helpers/cjs/_class_call_check.cjs"),a=e("@swc/helpers/cjs/_class_private_method_get.cjs"),c=e("@swc/helpers/cjs/_class_private_method_init.cjs"),u=e("@swc/helpers/cjs/_create_class.cjs"),l=e("@swc/helpers/cjs/_object_spread.cjs"),f=e("@swc/helpers/cjs/_object_spread_props.cjs"),d=e("@swc/helpers/cjs/_sliced_to_array.cjs"),p=e("@swc/helpers/cjs/_type_of.cjs"),h=e("@swc/helpers/cjs/_ts_generator.cjs"),v=e("libass-wasm"),b=o.interopDefault(v),y=new WeakSet,m=new WeakSet,w=new WeakSet,g=new WeakSet,_=new WeakSet,j=new WeakSet,k=new WeakSet,O=new WeakSet,x=function(){"use strict";function e(t,r){(0,s._)(this,e),(0,c._)(this,y),(0,c._)(this,m),(0,c._)(this,w),(0,c._)(this,g),(0,c._)(this,_),(0,c._)(this,j),(0,c._)(this,k),(0,c._)(this,O);var n=t.constructor,o=t.template;this.art=t,this.$video=o.$video,this.$webvtt=o.$subtitle,this.utils=n.utils,this.libass=null,t.once("ready",this.init.bind(this,r))}return(0,u._)(e,[{key:"init",value:function(e){return(0,i._)(function(){var t,r,n,o;return(0,h._)(this,function(i){switch(i.label){case 0:return(0,a._)(this,O,R).call(this),[4,(0,a._)(this,y,E).call(this,e)];case 1:return i.sent(),(0,a._)(this,m,P).call(this),this.art.emit("artplayerPluginLibass:init",this),(o=null==(n=this.art)||null==(r=n.option)||null==(t=r.subtitle)?void 0:t.url)&&"ass"===this.utils.getExt(o)&&this.switch(o),[2]}})}).call(this)}},{key:"switch",value:function(e){this.art.emit("artplayerPluginLibass:switch",e),e&&"ass"===this.utils.getExt(e)?(this.currentType="ass",this.libass.freeTrack(),this.libass.setTrackByUrl((0,a._)(this,_,T).call(this,e)),this.visible=this.art.subtitle.show):(this.currentType="webvtt",this.hide(),this.libass.freeTrack())}},{key:"setVisibility",value:function(e){this.visible=e}},{key:"setOffset",value:function(e){this.timeOffset=e}},{key:"active",get:function(){return"ass"===this.currentType}},{key:"visible",get:function(){return!!this.libass&&"none"!==this.libass.canvasParent.style.display},set:function(e){this.art.emit("artplayerPluginLibass:visible",e),(0,a._)(this,g,S).call(this,!this.active),this.libass.canvasParent&&(this.libass.canvasParent.style.display=e?"block":"none",e&&this.libass.resize())}},{key:"timeOffset",get:function(){return this.libass.timeOffset},set:function(e){this.art.emit("artplayerPluginLibass:timeOffset",e),this.libass.timeOffset=e}},{key:"show",value:function(){this.visible=!0}},{key:"hide",value:function(){this.visible=!Line truncated
@@ -5,4 +5,4 @@
* (c) 2017-2025 Harvey Zack
* Released under the MIT License.
*/
!function(e,t,r,s,i,n,a,o){var l="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},c="function"==typeof l[s]&&l[s],d=c.i||{},u=c.cache||{},v="undefined"!=typeof module&&"function"==typeof module.require&&module.require.bind(module);function f(t,r){if(!u[t]){if(!e[t]){if(i[t])return i[t];var n="function"==typeof l[s]&&l[s];if(!r&&n)return n(t,!0);if(c)return c(t,!0);if(v&&"string"==typeof t)return v(t);var a=Error("Cannot find module '"+t+"'");throw a.code="MODULE_NOT_FOUND",a}d.resolve=function(r){var s=e[t][1][r];return null!=s?s:r},d.cache={};var o=u[t]=new f.Module(t);e[t][0].call(o.exports,d,o,o.exports,l)}return u[t].exports;function d(e){var t=d.resolve(e);return!1===t?{}:f(t)}}f.isParcelRequire=!0,f.Module=function(e){this.id=e,this.bundle=f,this.require=v,this.exports={}},f.modules=e,f.cache=u,f.parent=c,f.distDir=void 0,f.publicUrl=void 0,f.devServer=void 0,f.i=d,f.register=function(t,r){e[t]=[function(e,t){t.exports=r},{}]},Object.defineProperty(f,"root",{get:function(){return l[s]}}),l[s]=f;for(var h=0;h<t.length;h++)f(t[h]);if(r){var m=f(r);"object"==typeof exports&&"undefined"!=typeof module?module.exports=m:"function"==typeof define&&define.amd&&define(function(){return m})}}({hSedR:[function(e,t,r,s){var i=e("@parcel/transformer-js/src/esmodule-helpers.js");i.defineInteropFlag(r),i.export(r,"default",()=>o);var n=e("./adapter"),a=i.interopDefault(n);function o(e){return t=>{let r=new(0,a.default)(t,e);return{name:"artplayerPluginLibass",libass:r.libass,visible:r.visible,init:r.init.bind(r),switch:r.switch.bind(r),show:r.show.bind(r),hide:r.hide.bind(r),destroy:r.destroy.bind(r)}}}"undefined"!=typeof window&&(window.artplayerPluginLibass=o)},{"./adapter":"ba6AI","@parcel/transformer-js/src/esmodule-helpers.js":"loqXi"}],ba6AI:[function(e,t,r,s){var i=e("@parcel/transformer-js/src/esmodule-helpers.js");i.defineInteropFlag(r);var n=e("libass-wasm"),a=i.interopDefault(n);let o=`[Script Info] ScriptType: v4.00+`;r.default=class{constructor(e,t){let{constructor:r,template:s}=e;this.art=e,this.$video=s.$video,this.$webvtt=s.$subtitle,this.utils=r.utils,this.libass=null,e.once("ready",this.init.bind(this,t))}async init(e){this.#e(),await this.#t(e),this.#r(),this.art.emit("artplayerPluginLibass:init",this);let t=this.art?.option?.subtitle?.url;t&&"ass"===this.utils.getExt(t)&&this.switch(t)}switch(e){this.art.emit("artplayerPluginLibass:switch",e),e&&"ass"===this.utils.getExt(e)?(this.currentType="ass",this.libass.freeTrack(),this.libass.setTrackByUrl(this.#s(e)),this.visible=this.art.subtitle.show):(this.currentType="webvtt",this.hide(),this.libass.freeTrack())}setVisibility(e){this.visible=e}setOffset(e){this.timeOffset=e}get active(){return"ass"===this.currentType}get visible(){return!!this.libass&&"none"!==this.libass.canvasParent.style.display}set visible(e){this.art.emit("artplayerPluginLibass:visible",e),this.#i(!this.active),this.libass.canvasParent&&(this.libass.canvasParent.style.display=e?"block":"none",e&&this.libass.resize())}get timeOffset(){return this.libass.timeOffset}set timeOffset(e){this.art.emit("artplayerPluginLibass:timeOffset",e),this.libass.timeOffset=e}show(){this.visible=!0}hide(){this.visible=!1}destroy(){this.art.emit("artplayerPluginLibass:destroy"),this.#n(),this.libass.dispose(),URL.revokeObjectURL(this.workerScriptUrl),this.libass=null}async #t(e={}){if(!e.fallbackFont)return this.utils.errorHandle(e.fallbackFont,"artplayerPluginLibass: fallbackFont is required");e.workerUrl||(e.workerUrl="https://cdnjs.cloudflare.com/ajax/libs/libass-wasm/4.1.0/js/subtitles-octopus-worker.js"),e.availableFonts&&(e.availableFonts=Object.entries(e.availableFonts).reduce((e,[t,r])=>(e[t]=this.#s(r),e),{})),this.libass=new(0,a.default)({subContent:o,video:this.$video,...e,workerUrl:await this.#a(e),fallbackFont:this.#s(e.fallbackFont),fonts:e.fonts?.map(e=>this.#s(e))}),this.libass.canvasParent.className="artplayer-plugin-libass",this.libass.canvasParent.style.cssText=` position: absolute; top: 0; left: 0; width: 100%; height: 100%; user-select: none; pointer-events: none; z-index: 20;`}#r(){this.switchHandler=this.switch.bind(this),this.visibleHandler=this.setVisibility.bind(this),this.offsetHandler=this.setOffset.bind(this),this.art.on("subtitle",this.visibleHandler),this.art.on("subtitleLoad",this.switchHandler),this.art.on("subtitleOffset",this.offsetHandler),this.art.once("destroy",this.destroy.bind(this))}#n(){this.art.off("subtitle",this.visibleHandler),this.art.off("subtitleLoad",this.switchHandler),this.art.off("subtitleOffset",this.offsetHandler)}#i(e){this.$webvtt.style.visibility=e?"visible":"hidden"}#s(e){return this.#o(e)?e:new URL(e,document.baseURI).toString()}#o(e){return/^https?:\/\//.test(e)}#a({workerUrl:e,wasmUrl:t}){return new Promise(r=>{fetch(e).then(e=>e.text()).then(s=>{let i=s,n=new Blob([i=i.replace(/wasmBinaryFile\s*=\s*"(subtitles-octopus-worker\.wasm)"/g,(r,s)=>(t=Line truncated
!function(e,t,r,s,n,i,a,o){var l="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},c="function"==typeof l[s]&&l[s],d=c.i||{},u=c.cache||{},v="undefined"!=typeof module&&"function"==typeof module.require&&module.require.bind(module);function f(t,r){if(!u[t]){if(!e[t]){if(n[t])return n[t];var i="function"==typeof l[s]&&l[s];if(!r&&i)return i(t,!0);if(c)return c(t,!0);if(v&&"string"==typeof t)return v(t);var a=Error("Cannot find module '"+t+"'");throw a.code="MODULE_NOT_FOUND",a}d.resolve=function(r){var s=e[t][1][r];return null!=s?s:r},d.cache={};var o=u[t]=new f.Module(t);e[t][0].call(o.exports,d,o,o.exports,l)}return u[t].exports;function d(e){var t=d.resolve(e);if(!1===t)return{};if(Array.isArray(t)){var r={__esModule:!0};return t.forEach(function(e){var t=e[0],s=e[1],n=e[2]||e[0],i=f(s);"*"===t?Object.keys(i).forEach(function(e){"default"===e||"__esModule"===e||Object.prototype.hasOwnProperty.call(r,e)||Object.defineProperty(r,e,{enumerable:!0,get:function(){return i[e]}})}):"*"===n?Object.defineProperty(r,t,{enumerable:!0,value:i}):Object.defineProperty(r,t,{enumerable:!0,get:function(){return"default"===n?i.__esModule?i.default:i:i[n]}})}),r}return f(t)}}f.isParcelRequire=!0,f.Module=function(e){this.id=e,this.bundle=f,this.require=v,this.exports={}},f.modules=e,f.cache=u,f.parent=c,f.distDir=void 0,f.publicUrl=void 0,f.devServer=void 0,f.i=d,f.register=function(t,r){e[t]=[function(e,t){t.exports=r},{}]},Object.defineProperty(f,"root",{get:function(){return l[s]}}),l[s]=f;for(var h=0;h<t.length;h++)f(t[h]);if(r){var m=f(r);"object"==typeof exports&&"undefined"!=typeof module?module.exports=m:"function"==typeof define&&define.amd&&define(function(){return m})}}({hSedR:[function(e,t,r,s){var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"default",()=>o);var i=e("./adapter"),a=n.interopDefault(i);function o(e){return t=>{let r=new(0,a.default)(t,e);return{name:"artplayerPluginLibass",libass:r.libass,visible:r.visible,init:r.init.bind(r),switch:r.switch.bind(r),show:r.show.bind(r),hide:r.hide.bind(r),destroy:r.destroy.bind(r)}}}"undefined"!=typeof window&&(window.artplayerPluginLibass=o)},{"./adapter":"ba6AI","@parcel/transformer-js/src/esmodule-helpers.js":"loqXi"}],ba6AI:[function(e,t,r,s){var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r);var i=e("libass-wasm"),a=n.interopDefault(i);let o=`[Script Info] ScriptType: v4.00+`;r.default=class{constructor(e,t){let{constructor:r,template:s}=e;this.art=e,this.$video=s.$video,this.$webvtt=s.$subtitle,this.utils=r.utils,this.libass=null,e.once("ready",this.init.bind(this,t))}async init(e){this.#e(),await this.#t(e),this.#r(),this.art.emit("artplayerPluginLibass:init",this);let t=this.art?.option?.subtitle?.url;t&&"ass"===this.utils.getExt(t)&&this.switch(t)}switch(e){this.art.emit("artplayerPluginLibass:switch",e),e&&"ass"===this.utils.getExt(e)?(this.currentType="ass",this.libass.freeTrack(),this.libass.setTrackByUrl(this.#s(e)),this.visible=this.art.subtitle.show):(this.currentType="webvtt",this.hide(),this.libass.freeTrack())}setVisibility(e){this.visible=e}setOffset(e){this.timeOffset=e}get active(){return"ass"===this.currentType}get visible(){return!!this.libass&&"none"!==this.libass.canvasParent.style.display}set visible(e){this.art.emit("artplayerPluginLibass:visible",e),this.#n(!this.active),this.libass.canvasParent&&(this.libass.canvasParent.style.display=e?"block":"none",e&&this.libass.resize())}get timeOffset(){return this.libass.timeOffset}set timeOffset(e){this.art.emit("artplayerPluginLibass:timeOffset",e),this.libass.timeOffset=e}show(){this.visible=!0}hide(){this.visible=!1}destroy(){this.art.emit("artplayerPluginLibass:destroy"),this.#i(),this.libass.dispose(),URL.revokeObjectURL(this.workerScriptUrl),this.libass=null}async #t(e={}){if(!e.fallbackFont)return this.utils.errorHandle(e.fallbackFont,"artplayerPluginLibass: fallbackFont is required");e.workerUrl||(e.workerUrl="https://cdnjs.cloudflare.com/ajax/libs/libass-wasm/4.1.0/js/subtitles-octopus-worker.js"),e.availableFonts&&(e.availableFonts=Object.entries(e.availableFonts).reduce((e,[t,r])=>(e[t]=this.#s(r),e),{})),this.libass=new(0,a.default)({subContent:o,video:this.$video,...e,workerUrl:await this.#a(e),fallbackFont:this.#s(e.fallbackFont),fonts:e.fonts?.map(e=>this.#s(e))}),this.libass.canvasParent.className="artplayer-plugin-libass",this.libass.canvasParent.style.cssText=` position: absolute; top: 0; left: 0; width: 100%; height: 100%; user-select: none; pointer-events: none; z-index: 20;`}#r(){this.switchHandler=this.switch.bind(this),this.visibleHandler=this.setVisibility.bind(this),this.offsetHandler=this.setOffset.bind(this),this.art.on("subtitle",this.visibleHandler),this.art.on("subtitleLoad",this.switchHandler),this.art.on("subtitleOffset",this.offsetHandler),this.art.once("destroy",this.destroy.bind(this))}#i(){thisLine truncated