1import{ba as C,mP as S,bP as $,rt as q,ru as z}from"./commonChunk.B_cUH0Zs.js";import{g5 as V}from"./0_EntryLoginRegisterChunk.A6wBCaPk.js";import{k as W,l as H}from"./vendorChunk.LVLHXJtX.js";import{a0 as K}from"../vendors/vendor-stable.Bob7ohop.js";var G={exports:{}};(function(I,y){(function(h,s){I.exports=s()})(H,function(){return function(k){var h={};function s(o){if(h[o])return h[o].exports;var l=h[o]={exports:{},id:o,loaded:!1};return k[o].call(l.exports,l,l.exports,s),l.loaded=!0,l.exports}return s.m=k,s.c=h,s.p="",s(0)}([function(k,h,s){Object.defineProperty(h,"__esModule",{value:!0}),h.isNotPNG=r,h.isNotAPNG=a,h.default=n;var o=s(1),l=c(o),m=s(2);function c(v){return v&&v.__esModule?v:{default:v}}var t=new Error("Not a PNG"),e=new Error("Not an animated PNG");function r(v){return v===t}function a(v){return v===e}var i=new Uint8Array([137,80,78,71,13,10,26,10]);function n(v){var _=new Uint8Array(v);if(Array.prototype.some.call(i,function(x,F){return x!==_[F]}))return t;var p=!1;if(d(_,function(x){return!(p=x==="acTL")}),!p)return e;var b=[],A=[],L=null,f=null,T=0,E=new m.APNG;if(d(_,function(x,F,g,O){var N=new DataView(F.buffer);switch(x){case"IHDR":L=F.subarray(g+8,g+8+O),E.width=N.getUint32(g+8),E.height=N.getUint32(g+12);break;case"acTL":E.numPlays=N.getUint32(g+8+4);break;case"fcTL":f&&(E.frames.push(f),T++),f=new m.Frame,f.width=N.getUint32(g+8+4),f.height=N.getUint32(g+8+8),f.left=N.getUint32(g+8+12),f.top=N.getUint32(g+8+16);var B=N.getUint16(g+8+20),U=N.getUint16(g+8+22);U===0&&(U=100),f.delay=1e3*B/U,f.delay<=10&&(f.delay=100),E.playTime+=f.delay,f.disposeOp=N.getUint8(g+8+24),f.blendOp=N.getUint8(g+8+25),f.dataParts=[],T===0&&f.disposeOp===2&&(f.disposeOp=1);break;case"fdAT":f&&f.dataParts.push(F.subarray(g+8+4,g+8+O));break;case"IDAT":f&&f.dataParts.push(F.subarray(g+8,g+8+O));break;case"IEND":A.push(P(F,g,12+O));break;default:b.push(P(F,g,12+O))}}),f&&E.frames.push(f),E.frames.length==0)return e;var M=new Blob(b),j=new Blob(A);return E.frames.forEach(function(x){var F=[];F.push(i),L.set(D(x.width),0),L.set(D(x.height),4),F.push(R("IHDR",L)),F.push(M),x.dataParts.forEach(function(g){return F.push(R("IDAT",g))}),F.push(j),x.imageData=new Blob(F,{type:"image/png"}),delete x.dataParts,F=null}),E}function d(v,_){var p=new DataView(v.buffer),b=8,A=void 0,L=void 0,f=void 0;do L=p.getUint32(b),A=u(v,b+4,4),f=_(A,v,b,L),b+=12+L;while(f!==!1&&A!="IEND"&&b<v.length)}function u(v,_,p){var b=Array.prototype.slice.call(v.subarray(_,_+p));return String.fromCharCode.apply(String,b)}function w(v){for(var _=new Uint8Array(v.length),p=0;p<v.length;p++)_[p]=v.charCodeAt(p);return _}function P(v,_,p){var b=new Uint8Array(p);return b.set(v.subarray(_,_+p)),b}var R=function(_,p){var b=_.length+p.length,A=new Uint8Array(b+8),L=new DataView(A.buffer);L.setUint32(0,p.length),A.set(w(_),4),A.set(p,8);var f=(0,l.default)(A,4,b);return L.setUint32(b+4,f),A},D=function(_){return new Uint8Array([_>>>24&255,_>>>16&255,_>>>8&255,_&255])}},function(k,h){Object.defineProperty(h,"__esModule",{value:!0}),h.default=function(c){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:c.length-t,r=-1,a=t,i=t+e;a<i;a++)r=r>>
1>8^s[(r^c[a])&255];return r^-1};for(var s=new Uint32Array(256),o=0;o<256;o++){for(var l=o,m=0;m<8;m++)l=l&1?3988292384^l>>>1:l>>>1;s[o]=l}},function(k,h,s){Object.defineProperty(h,"__esModule",{value:!0}),h.Frame=h.APNG=void 0;var o=function(){function e(r,a){for(var i=0;i<a.length;i++){var n=a[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(r,n.key,n)}}return function(r,a,i){return a&&e(r.prototype,a),i&&e(r,i),r}}(),l=s(3),m=c(l);function c(e){return e&&e.__esModule?e:{default:e}}function t(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}h.APNG=function(){function e(){t(this,e),this.width=0,this.height=0,this.numPlays=0,this.playTime=0,this.frames=[]}return o(e,[{key:"createImages",value:function(){return Promise.all(this.frames.map(function(a){return a.createImage()}))}},{key:"getPlayer",value:function(a){var i=this,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return this.createImages().then(function(){return new m.default(i,a,n)})}}]),e}(),h.Frame=function(){function e(){t(this,e),this.left=0,this.top=0,this.width=0,this.height=0,this.delay=0,this.disposeOp=0,this.blendOp=0,this.imageData=null,this.imageElement=null}return o(e,[{key:"createImage",value:function(){var a=this;return this.imageElement?Promise.resolve():new Promise(function(i,n){var d=URL.createObjectURL(a.imageData);a.imageElement=document.createElement("img"),a.imageElement.onload=function(){URL.revokeObjectURL(d),i()},a.imageElement.onerror=function(){URL.revokeObjectURL(d),a.imageElement=null,n(new Error("Image creation error"))},a.imageElement.src=d})}}]),e}()},function(k,h,s){Object.defineProperty(h,"__esModule",{value:!0});var o=function(){function i(n,d){for(var u=0;u<d.length;u++){var w=d[u];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(n,w.key,w)}}return function(n,d,u){return d&&i(n.prototype,d),u&&i(n,u),n}}(),l=s(4),m=c(l);function c(i){return i&&i.__esModule?i:{default:i}}function t(i,n){if(!(i instanceof n))throw new TypeError("Cannot call a class as a function")}function e(i,n){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n&&(typeof n=="object"||typeof n=="function")?n:i}function r(i,n){if(typeof n!="function"&&n!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof n);i.prototype=Object.create(n&&n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(i,n):i.__proto__=n)}var a=function(i){r(n,i);function n(d,u,w){t(this,n);var P=e(this,(n.__proto__||Object.getPrototypeOf(n)).call(this));return P.playbackRate=1,P._currentFrameNumber=0,P._ended=!1,P._paused=!0,P._numPlays=0,P._rafId=null,P._apng=d,P.context=u,P.stop(),w&&P.play(),P}return o(n,[{key:"renderNextFrame",value:function(){this._currentFrameNumber=(this._currentFrameNumber+1)%this._apng.frames.length,this._currentFrameNumber===this._apng.frames.length-1&&(this._numPlays++,this._apng.numPlays!==0&&this._numPlays>=this._apng.numPlays&&(this._ended=!0,this._paused=!0)),this._prevFrame&&this._prevFrame.disposeOp==1?this.context.clearRect(this._prevFrame.left,this._prevFrame.top,this._prevFrame.width,this._prevFrame.height):this._prevFrame&&this._prevFrame.disposeOp==2&&this.context.putImageData(this._prevFrameData,this._prevFrame.left,this._prevFrame.top);var u=this.currentFrame;this._prevFrame=u,this._prevFrameData=null,u.disposeOp==2&&(this._prevFrameData=this.context.getImageData(u.left,u.top,u.width,u.height)),u.blendOp==0&&this.context.clearRect(u.left,u.top,u.width,u.height),this.context.drawImage(u.imageElement,u.left,u.top),this.emit("frame",this._currentFrameNumber),this._ended&&this.emit("end")}},{key:"play",value:function(){var u=this;this._rafId&&cancelAnimationFrame(this._rafId),this.emit("play"),this._ended&&this.stop(),this._paused=!1;var w=performance.now()+this.currentFrame.delay/this.playbackRate,P=function R(D){if(!(u._ended||u._paused)){if(D>=w){for(;D-w>
1=u._apng.playTime/u.playbackRate;)w+=u._apng.playTime/u.playbackRate,u._numPlays++;do u.renderNextFrame(),w+=u.currentFrame.delay/u.playbackRate;while(!u._ended&&!u._paused&&D>w)}u._rafId=requestAnimationFrame(R)}};this._rafId=requestAnimationFrame(P)}},{key:"pause",value:function(){this._paused||(this._rafId&&(cancelAnimationFrame(this._rafId),this._rafId=null),this.emit("pause"),this._paused=!0)}},{key:"stop",value:function(){this._rafId&&(cancelAnimationFrame(this._rafId),this._rafId=null),this.emit("stop"),this._numPlays=0,this._ended=!1,this._paused=!0,this._currentFrameNumber=-1,this.context.clearRect(0,0,this._apng.width,this._apng.height),this.renderNextFrame()}},{key:"currentFrameNumber",get:function(){return this._currentFrameNumber}},{key:"currentFrame",get:function(){return this._apng.frames[this._currentFrameNumber]}},{key:"paused",get:function(){return this._paused}},{key:"ended",get:function(){return this._ended}}]),n}(m.default);h.default=a},function(k,h){function s(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}k.exports=s,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._maxListeners=void 0,s.defaultMaxListeners=10,s.prototype.setMaxListeners=function(t){if(!l(t)||t<0||isNaN(t))throw TypeError("n must be a positive number");return this._maxListeners=t,this},s.prototype.emit=function(t){var e,r,a,i,n,d;if(this._events||(this._events={}),t==="error"&&(!this._events.error||m(this._events.error)&&!this._events.error.length)){if(e=arguments[1],e instanceof Error)throw e;var u=new Error('Uncaught, unspecified "error" event. ('+e+")");throw u.context=e,u}if(r=this._events[t],c(r))return!1;if(o(r))switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:i=Array.prototype.slice.call(arguments,1),r.apply(this,i)}else if(m(r))for(i=Array.prototype.slice.call(arguments,1),d=r.slice(),a=d.length,n=0;n<a;n++)d[n].apply(this,i);return!0},s.prototype.addListener=function(t,e){var r;if(!o(e))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",t,o(e.listener)?e.listener:e),this._events[t]?m(this._events[t])?this._events[t].push(e):this._events[t]=[this._events[t],e]:this._events[t]=e,m(this._events[t])&&!this._events[t].warned&&(c(this._maxListeners)?r=s.defaultMaxListeners:r=this._maxListeners,r&&r>0&&this._events[t].length>r&&(this._events[t].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[t].length),typeof console.trace=="function"&&console.trace())),this},s.prototype.on=s.prototype.addListener,s.prototype.once=function(t,e){if(!o(e))throw TypeError("listener must be a function");var r=!1;function a(){this.removeListener(t,a),r||(r=!0,e.apply(this,arguments))}return a.listener=e,this.on(t,a),this},s.prototype.removeListener=function(t,e){var r,a,i,n;if(!o(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(r=this._events[t],i=r.length,a=-1,r===e||o(r.listener)&&r.listener===e)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,e);else if(m(r)){for(n=i;n-- >0;)if(r[n]===e||r[n].listener&&r[n].listener===e){a=n;break}if(a<0)return this;r.length===1?(r.length=0,delete this._events[t]):r.splice(a,1),this._events.removeListener&&this.emit("removeListener",t,e)}return this},s.prototype.removeAllListeners=function(t){var e,r;if(!this._events)return this;if(!this._events.removeListener)return arguments.length===0?this._events={}:this._events[t]&&delete this._events[t],this;if(arguments.length===0){for(e in this._events)e!=="removeListener"&&this.removeAllListeners(e);return this.removeAllListeners("removeListener"),this._events={},this}if(r=this._events[t],o(r))this.removeListener(t,r);else if(r)for(;r.length;)this.removeListener(t,r[r.length-1]);return delete this._events[t],this},s.prototype.listeners=function(t){var e;return!this._events||!this._events[t]?e=[]:o(this._events[t])?e=[this._events[t]]:e=this._events[t].slice(),e},s.prototype.listenerCount=function(t){if(this._events){var e=this._events[t];if(o(e))return 1;if(e)return e.length}return 0},s.listenerCount=function(t,e){return t.listenerCount(e)};function o(t){return typeof t=="function"}function l(t){return typeof t=="number"}function m(t){return typeof t=="object"&&t!==null}function c(t){return t===void 0}}])})})(G);var X=G.exports;
1const Z=W(X),J=C(q,{deleteCache:!1});class Q{async getApngInfo(y,k=y){const h=await J(y,y),s=await S(h),o=Z(s);if(o instanceof Error){const e=V(s);return Promise.reject({blob:h,meta:e,url:y})}const l=K(o),m=10*1024*1024,c="[APNG Frame Filter]",t=l.frames.filter((e,r)=>{if($.notFilterApngFrame())return!0;if((e==null?void 0:e.imageData)instanceof Blob){const a=e.imageData.size;return a>m?(console.warn(`${c} Skipping frame ${r} of ${y}: size ${(a/1024/1024).toFixed(1)} MB exceeds limit`),!1):!0}return console.warn(`${c} Skipping frame ${r} of ${y}: missing or invalid imageData`),!1});return l.frames=t,{apng:l}}async create(y,k={},h=y){try{const{numPlays:s,width:o,height:l,scale:m,autoPlay:c}=Object.assign({autoPlay:!0,numPlays:0,scale:1},k),t=y,{apng:e}=await this.getApngInfo(y,h);e.numPlays=s!=null?s:e.numPlays,await e.createImages();const r=k.canvas||document.createElement("canvas");r.width=o||e.width,r.height=l||e.height,m&&(r.width=m*e.width,r.height=m*e.height);const a=r.getContext("2d"),i=a._player;i&&(i.stop(),i.removeAllListeners()),a.scale(r.width/e.width,r.height/e.height);const n=await e.getPlayer(a,c);return a._player=n,{url:t,apng:e,player:n,canvas:r}}catch(s){return Promise.reject(s)}}}const Y=new Q,ae=async(...[I,y,k])=>{var h;try{return await Y.create(I,y,k)}catch(s){const o=async c=>{const t=(y==null?void 0:y.canvas)||document.createElement("canvas"),{width:e=c.width,height:r=c.height}=y||{};e&&(t.width=e),r&&(t.height=r);try{await c.decode()}catch(i){}const a=t.getContext("2d");return a&&(a.clearRect(0,0,t.width,t.height),a.drawImage(c,0,0,e,r,0,0,e,r)),{canvas:t}},l=(c=I)=>z(c).then(t=>o(t)),m=s;if(m&&m.blob instanceof Blob&&((h=m.meta)!=null&&h.isKnown)){const c=URL.createObjectURL(m.blob);try{const t=await l(c);return URL.revokeObjectURL(c),t}catch(t){return URL.revokeObjectURL(c),await l()}}else return Promise.reject()}};export{Y as apngManager,ae as createCanvas};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.