/*! * artplayer-proxy-canvas.js v1.0.0 * Github: https://github.com/zhw2590582/ArtPlayer * (c) 2017-2025 Harvey Zack * Released under the MIT License. */ !function(e,t,r,n,o,i,a,c){var u="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},f="function"==typeof u[n]&&u[n],s=f.i||{},l=f.cache||{},p="undefined"!=typeof module&&"function"==typeof module.require&&module.require.bind(module);function d(t,r){if(!l[t]){if(!e[t]){if(o[t])return o[t];var i="function"==typeof u[n]&&u[n];if(!r&&i)return i(t,!0);if(f)return f(t,!0);if(p&&"string"==typeof t)return p(t);var a=Error("Cannot find module '"+t+"'");throw a.code="MODULE_NOT_FOUND",a}s.resolve=function(r){var n=e[t][1][r];return null!=n?n:r},s.cache={};var c=l[t]=new d.Module(t);e[t][0].call(c.exports,s,c,c.exports,u)}return l[t].exports;function s(e){var t=s.resolve(e);return!1===t?{}:d(t)}}d.isParcelRequire=!0,d.Module=function(e){this.id=e,this.bundle=d,this.require=p,this.exports={}},d.modules=e,d.cache=l,d.parent=f,d.distDir=void 0,d.publicUrl=void 0,d.devServer=void 0,d.i=s,d.register=function(t,r){e[t]=[function(e,t){t.exports=r},{}]},Object.defineProperty(d,"root",{get:function(){return u[n]}}),u[n]=d;for(var y=0;yi?r=(n=c)*i:n=(r=a)/i,s.width=r,s.height=n;var u=(a-r)/2,f=(c-n)/2;Object.assign(s.style,{padding:"".concat(f,"px ").concat(u,"px")})}}(),b()}),t.on("destroy",function(){cancelAnimationFrame(d)}),s;function b(){return m.apply(this,arguments)}function m(){return(m=(0,i._)(function(){var r,n;return(0,c._)(this,function(o){switch(o.label){case 0:if(o.trys.push([0,4,,5]),"undefined"==typeof createImageBitmap)return[3,2];return[4,createImageBitmap(l)];case 1:return r=o.sent(),p.drawImage(r,0,0,s.width,s.height),r.close(),[3,3];case 2:p.drawImage(l,0,0,s.width,s.height),o.label=3;case 3:return e&&e(p,l),t.emit("artplayerProxyCanvas:draw",p,l),[3,5];case 4:return n=o.sent(),t.emit("artplayerProxyCanvas:error",n),[3,5];case 5:return[2]}})})).apply(this,arguments)}function w(){return g.apply(this,arguments)}function g(){return(g=(0,i._)(function(){return(0,c._)(this,function(e){switch(e.label){case 0:return[4,b()];case 1:return e.sent(),d=requestAnimationFrame(w),[2]}})})).apply(this,arguments)}}}"undefined"!=typeof window&&(window.artplayerProxyCanvas=u)},{"@swc/helpers/cjs/_async_to_generator.cjs":"4ElRo","@swc/helpers/cjs/_to_consumable_array.cjs":"1LaMX","@swc/helpers/cjs/_ts_generator.cjs":"a4h1C","@parcel/transformer-js/src/esmodule-helpers.js":"ihnSZ"}],"4ElRo":[function(e,t,r,n){"use strict";function o(e,t,r,n,o,i,a){try{var c=e[i](a),u=c.value}catch(e){r(e);return}c.done?t(u):Promise.resolve(u).then(n,o)}r._=function(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var a=e.apply(t,r);function c(e){o(a,n,i,c,u,"next",e)}function u(e){o(a,n,i,c,u,"throw",e)}c(void 0)})}}},{}],"1LaMX":[function(e,t,r,n){"use strict";var o=e("39b649abd35ac2e2"),i=e("8428e13fa0ef5403"),a=e("8d50a6b373b717fa"),c=e("3c184cf684436bb9");r._=function(e){return o._(e)||i._(e)||c._(e)||a._()}},{"39b649abd35ac2e2":"i3OgW","8428e13fa0ef5403":"5CLcV","8d50a6b373b717fa":"cpcPX","3c184cf684436bb9":"ikxEb"}],i3OgW:[function(e,t,r,n){"use strict";var o=e("ec82543f1393b568");r._=function(e){if(Array.isArray(e))return o._(e)}},{ec82543f1393b568:"8HLaN"}],"8HLaN":[function(e,t,r,n){"use strict";r._=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);rt.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,n=Object.getOwnPropertySymbols(e);ot.indexOf(n[o])&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r}function s(e,t,r,n){var o,a=arguments.length,c=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if(("undefined"==typeof Reflect?"undefined":(0,i._)(Reflect))==="object"&&"function"==typeof Reflect.decorate)c=Reflect.decorate(e,t,r,n);else for(var u=e.length-1;u>=0;u--)(o=e[u])&&(c=(a<3?o(c):a>3?o(t,r,c):o(t,r))||c);return a>3&&c&&Object.defineProperty(t,r,c),c}function l(e,t){return function(r,n){t(r,n,e)}}function p(e,t,r,n,o,a){function c(e){if(void 0!==e&&"function"!=typeof e)throw TypeError("Function expected");return e}for(var u,f=n.kind,s="getter"===f?"get":"setter"===f?"set":"value",l=!t&&e?n.static?e:e.prototype:null,p=t||(l?Object.getOwnPropertyDescriptor(l,n.name):{}),d=!1,y=r.length-1;y>=0;y--){var _={};for(var h in n)_[h]="access"===h?{}:n[h];for(var h in n.access)_.access[h]=n.access[h];_.addInitializer=function(e){if(d)throw TypeError("Cannot add initializers after decoration has completed");a.push(c(e||null))};var v=(0,r[y])("accessor"===f?{get:p.get,set:p.set}:p[s],_);if("accessor"===f){if(void 0===v)continue;if(null===v||(void 0===v?"undefined":(0,i._)(v))!=="object")throw TypeError("Object expected");(u=c(v.get))&&(p.get=u),(u=c(v.set))&&(p.set=u),(u=c(v.init))&&o.unshift(u)}else(u=c(v))&&("field"===f?o.unshift(u):p[s]=u)}l&&Object.defineProperty(l,n.name,p),d=!0}function d(e,t,r){for(var n=arguments.length>2,o=0;o0&&o[o.length-1])&&(6===f[0]||2===f[0])){i=0;continue}if(3===f[0]&&(!o||f[1]>o[0]&&f[1]=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function j(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a}function x(){for(var e=[],t=0;t1||c(e,t)})},t&&(n[e]=t(n[e])))}function c(e,t){try{var r;(r=o[e](t)).value instanceof S?Promise.resolve(r.value.v).then(u,f):s(i[0][2],r)}catch(e){s(i[0][3],e)}}function u(e){c("next",e)}function f(e){c("throw",e)}function s(e,t){e(t),i.shift(),i.length&&c(i[0][0],i[0][1])}}function I(e){var t,r;return t={},n("next"),n("throw",function(e){throw e}),n("return"),t[Symbol.iterator]=function(){return this},t;function n(n,o){t[n]=e[n]?function(t){return(r=!r)?{value:S(e[n](t)),done:!1}:o?o(t):t}:o}}function T(e){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e=g(e),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=e[r]&&function(t){return new Promise(function(n,o){var i,a,c;i=n,a=o,c=(t=e[r](t)).done,Promise.resolve(t.value).then(function(e){i({value:e,done:c})},a)})}}}function A(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var F=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t},D=function(e){return(D=Object.getOwnPropertyNames||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[t.length]=r);return t})(e)};function R(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=D(e),n=0;n