@remotion/gif 3.3.17 → 3.3.19

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.
package/LICENSE.md CHANGED
@@ -7,7 +7,7 @@ Depending on the type of your legal entity, you are granted permission to use Re
7
7
 
8
8
  ## Free license
9
9
 
10
- Copyright © 2022 [Remotion](https://www.remotion.dev/)
10
+ Copyright © 2023 [Remotion](https://www.remotion.dev/)
11
11
 
12
12
  ### Eligibility
13
13
 
@@ -22,7 +22,6 @@ const parse = (src, { signal, }) => fetch(src, { signal })
22
22
  })
23
23
  .then((buffer) => (0, gifuct_js_1.parseGIF)(buffer))
24
24
  .then((gif) => {
25
- console.log({ gif });
26
25
  validateAndFix(gif);
27
26
  return gif;
28
27
  })
@@ -1 +1 @@
1
- export declare const src = "function e(e){const r={exports:{}};return e(r,r.exports),r.exports}const r=e(((e,r)=> {Object.defineProperty(r,\"__esModule\",{value:!0}),r.loop=r.conditional=r.parse=void 0;r.parse=function e(r,t){const n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}; const a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:n;if(Array.isArray(t))t.forEach(((t)=> {return e(r,t,n,a)}));else if(typeof t===\"function\")t(r,n,a,e);else{const i=Object.keys(t)[0];Array.isArray(t[i])?(a[i]={},e(r,t[i],n,a[i])):a[i]=t[i](r,n,a,e)}return n};r.conditional=function(e,r){return function(t,n,a,i){r(t,n,a)&&i(t,e,n,a)}};r.loop=function(e,r){return function(t,n,a,i){for(var o=[];r(t,n,a);){const s={};i(t,e,n,s),o.push(s)}return o}}})); const t=e(((e,r)=> {Object.defineProperty(r,\"__esModule\",{value:!0}),r.readBits=r.readArray=r.readUnsigned=r.readString=r.peekBytes=r.readBytes=r.peekByte=r.readByte=r.buildStream=void 0;r.buildStream=function(e){return{data:e,pos:0}};const t=function(){return function(e){return e.data[e.pos++]}};r.readByte=t;r.peekByte=function(){const e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return function(r){return r.data[r.pos+e]}};const n=function(e){return function(r){return r.data.subarray(r.pos,r.pos+=e)}};r.readBytes=n;r.peekBytes=function(e){return function(r){return r.data.subarray(r.pos,r.pos+e)}};r.readString=function(e){return function(r){return Array.from(n(e)(r)).map(((e)=> {return String.fromCharCode(e)})).join(\"\")}};r.readUnsigned=function(e){return function(r){const t=n(2)(r);return e?(t[1]<<8)+t[0]:(t[0]<<8)+t[1]}};r.readArray=function(e,r){return function(t,a,i){for(var o=typeof r===\"function\"?r(t,a,i):r,s=n(e),d=new Array(o),c=0;c<o;c++)d[c]=s(t);return d}};r.readBits=function(e){return function(r){for(var t=function(e){return e.data[e.pos++]}(r),n=new Array(8),a=0;a<8;a++)n[7-a]=Boolean(t&1<<a);return Object.keys(e).reduce(((r,t)=> {const a=e[t];return a.length?r[t]=function(e,r,t){for(var n=0,a=0;a<t;a++)n+=e[r+a]&&2**(t-a-1);return n}(n,a.index,a.length):r[t]=n[a.index],r}),{})}}})); const n=e(((e,n)=> {Object.defineProperty(n,\"__esModule\",{value:!0}),n.default=void 0;const a={blocks(e){for(var r=[],n=e.data.length,a=0,i=(0,t.readByte)()(e);i!==0;i=(0,t.readByte)()(e)){if(e.pos+i>=n){const o=n-e.pos;r.push((0,t.readBytes)(o)(e)),a+=o;break}r.push((0,t.readBytes)(i)(e)),a+=i}for(var s=new Uint8Array(a),d=0,c=0;c<r.length;c++)s.set(r[c],d),d+=r[c].length;return s}}; const i=(0,r.conditional)({gce:[{codes:(0,t.readBytes)(2)},{byteSize:(0,t.readByte)()},{extras:(0,t.readBits)({future:{index:0,length:3},disposal:{index:3,length:3},userInput:{index:6},transparentColorGiven:{index:7}})},{delay:(0,t.readUnsigned)(!0)},{transparentColorIndex:(0,t.readByte)()},{terminator:(0,t.readByte)()}]},((e)=> {const r=(0,t.peekBytes)(2)(e);return r[0]===33&&r[1]===249})); const o=(0,r.conditional)({image:[{code:(0,t.readByte)()},{descriptor:[{left:(0,t.readUnsigned)(!0)},{top:(0,t.readUnsigned)(!0)},{width:(0,t.readUnsigned)(!0)},{height:(0,t.readUnsigned)(!0)},{lct:(0,t.readBits)({exists:{index:0},interlaced:{index:1},sort:{index:2},future:{index:3,length:2},size:{index:5,length:3}})}]},(0,r.conditional)({lct:(0,t.readArray)(3,((e,r,t)=> {return 2**(t.descriptor.lct.size+1)}))},((e,r,t)=> {return t.descriptor.lct.exists})),{data:[{minCodeSize:(0,t.readByte)()},a]}]},((e)=> {return (0,t.peekByte)()(e)===44})); const s=(0,r.conditional)({text:[{codes:(0,t.readBytes)(2)},{blockSize:(0,t.readByte)()},{preData(e,r,n){return(0,t.readBytes)(n.text.blockSize)(e)}},a]},((e)=> {const r=(0,t.peekBytes)(2)(e);return r[0]===33&&r[1]===1})); const d=(0,r.conditional)({application:[{codes:(0,t.readBytes)(2)},{blockSize:(0,t.readByte)()},{id(e,r,n){return(0,t.readString)(n.blockSize)(e)}},a]},((e)=> {const r=(0,t.peekBytes)(2)(e);return r[0]===33&&r[1]===255})); const c=(0,r.conditional)({comment:[{codes:(0,t.readBytes)(2)},a]},((e)=> {const r=(0,t.peekBytes)(2)(e);return r[0]===33&&r[1]===254})); const u=[{header:[{signature:(0,t.readString)(3)},{version:(0,t.readString)(3)}]},{lsd:[{width:(0,t.readUnsigned)(!0)},{height:(0,t.readUnsigned)(!0)},{gct:(0,t.readBits)({exists:{index:0},resolution:{index:1,length:3},sort:{index:4},size:{index:5,length:3}})},{backgroundColorIndex:(0,t.readByte)()},{pixelAspectRatio:(0,t.readByte)()}]},(0,r.conditional)({gct:(0,t.readArray)(3,((e,r)=> {return 2**(r.lsd.gct.size+1)}))},((e,r)=> {return r.lsd.gct.exists})),{frames:(0,r.loop)([i,d,c,o,s],((e)=> {const r=(0,t.peekByte)()(e);return r===33||r===44}))}];n.default=u})); const a=e(((e,r)=> {Object.defineProperty(r,\"__esModule\",{value:!0}),r.deinterlace=void 0;r.deinterlace=function(e,r){for(var t=new Array(e.length),n=e.length/r,a=function(n,a){const i=e.slice(a*r,(a+1)*r);t.splice.apply(t,[n*r,r].concat(i))},i=[0,4,2,1],o=[8,8,4,2],s=0,d=0;d<4;d++)for(let c=i[d];c<n;c+=o[d])a(c,s),s++;return t}})); const i=e(((e,r)=> {Object.defineProperty(r,\"__esModule\",{value:!0}),r.lzw=void 0;r.lzw=function(e,r,t){let n; let a; let i; let o; let s; let d; let c; let u; let l; let f; let p; let g; let y; let h; let v; let m; const x=4096; const B=t; const w=new Array(t); const b=new Array(x); const k=new Array(x); const A=new Array(4097);for(s=(a=1<<(f=e))+1,n=a+2,c=-1,i=(1<<(o=f+1))-1,u=0;u<a;u++)b[u]=0,k[u]=u;for(p=g=y=h=v=m=0,l=0;l<B;){if(h===0){if(g<o){p+=r[m]<<g,g+=8,m++;continue}if(u=p&i,p>>=o,g-=o,u>n||u==s)break;if(u==a){i=(1<<(o=f+1))-1,n=a+2,c=-1;continue}if(c==-1){A[h++]=k[u],c=u,y=u;continue}for(d=u,u==n&&(A[h++]=y,u=c);u>a;)A[h++]=k[u],u=b[u];y=255&k[u],A[h++]=y,n<x&&(b[n]=c,k[n]=y,(++n&i)==0&&n<x&&(o++,i+=n)),c=d}h--,w[v++]=A[h],l++}for(l=v;l<B;l++)w[l]=0;return w}})); const o=e(((e,o)=> {Object.defineProperty(o,\"__esModule\",{value:!0}),o.decompressFrames=o.decompressFrame=o.parseGIF=void 0;let s; const d=(s=n)&&s.__esModule?s:{default:s};o.parseGIF=function(e){const n=new Uint8Array(e);return(0,r.parse)((0,t.buildStream)(n),d.default)};const c=function(e,r,t){if(e.image){const n=e.image; const o=n.descriptor.width*n.descriptor.height; let s=(0,i.lzw)(n.data.minCodeSize,n.data.blocks,o);n.descriptor.lct.interlaced&&(s=(0,a.deinterlace)(s,n.descriptor.width));const d={pixels:s,dims:{top:e.image.descriptor.top,left:e.image.descriptor.left,width:e.image.descriptor.width,height:e.image.descriptor.height}};return n.descriptor.lct&&n.descriptor.lct.exists?d.colorTable=n.lct:d.colorTable=r,e.gce&&(d.delay=10*(e.gce.delay||10),d.disposalType=e.gce.extras.disposal,e.gce.extras.transparentColorGiven&&(d.transparentIndex=e.gce.transparentColorIndex)),t&&(d.patch=function(e){for(var r=e.pixels.length,t=new Uint8ClampedArray(4*r),n=0;n<r;n++){const a=4*n; const i=e.pixels[n]; const o=e.colorTable[i]||[0,0,0];t[a]=o[0],t[a+1]=o[1],t[a+2]=o[2],t[a+3]=i!==e.transparentIndex?255:0}return t}(d)),d}console.warn(\"gif frame does not have associated image.\")};o.decompressFrame=c;o.decompressFrames=function(e,r){return e.frames.filter(((e)=> {return e.image})).map(((t)=> {return c(t,e.gct,r)}))}}));const s=(e,r,t)=>{const{width:n,height:a,top:i,left:o}=r.dims; const s=i*t.width+o;for(let i=0;i<a;i++)for(let a=0;a<n;a++){const o=i*n+a; const d=r.pixels[o];if(d!==r.transparentIndex){const n=s+i*t.width+a; const o=r.colorTable[d]||[0,0,0];e[4*n]=o[0],e[4*n+1]=o[1],e[4*n+2]=o[2],e[4*n+3]=255}}return e}; const d=new Map;self.addEventListener(\"message\",(e=>{const{type:r,src:t}=e.data||e;switch(r){case\"parse\":if(!d.has(t)){const e=new AbortController; const r={signal:e.signal};d.set(t,e),((e,{signal:r})=>fetch(e,{signal:r}).then((e=>{if(!e.headers.get(\"Content-Type\").includes(\"image/gif\"))throw Error(`Wrong content type: \"${e.headers.get(\"Content-Type\")}\"`);return e.arrayBuffer()})).then((e=>o.parseGIF(e))).then((e=>((e=>{let r=null;for(const t of e.frames)r=t.gce?t.gce:r,\"image\"in t&&!(\"gce\"in t)&&(t.gce=r)})(e),e))).then((e=>Promise.all([o.decompressFrames(e,!1),{width:e.lsd.width,height:e.lsd.height}]))).then((([e,r])=>{const t=[]; const n=r.width*r.height*4;for(let a=0;a<e.length;++a){const i=e[a]; const o=a===0||e[a-1].disposalType===2?new Uint8ClampedArray(n):t[a-1].slice();t.push(s(o,i,r))}return{...r,loaded:!0,delays:e.map((e=>e.delay)),frames:t}})))(t,r).then((e=>{self.postMessage(Object.assign(e,{src:t}),e.frames.map((e=>e.buffer)))})).catch((e=>{self.postMessage({src:t,error:e,loaded:!0})})).finally((()=>{d.delete(t)}))}break;case\"cancel\":if(d.has(t)){d.get(t).abort(),d.delete(t)}}}));";
1
+ export declare const src = "\"use strict\";(()=>{var ee=Object.create;var R=Object.defineProperty;var re=Object.getOwnPropertyDescriptor;var te=Object.getOwnPropertyNames;var ae=Object.getPrototypeOf,ne=Object.prototype.hasOwnProperty;var S=(a,e)=>()=>(e||a((e={exports:{}}).exports,e),e.exports);var ie=(a,e,r,t)=>{if(e&&typeof e==\"object\"||typeof e==\"function\")for(let n of te(e))!ne.call(a,n)&&n!==r&&R(a,n,{get:()=>e[n],enumerable:!(t=re(e,n))||t.enumerable});return a};var K=(a,e,r)=>(r=a!=null?ee(ae(a)):{},ie(e||!a||!a.__esModule?R(r,\"default\",{value:a,enumerable:!0}):r,a));var D=S(m=>{\"use strict\";Object.defineProperty(m,\"__esModule\",{value:!0});m.loop=m.conditional=m.parse=void 0;var oe=function a(e,r){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:t;if(Array.isArray(r))r.forEach(function(o){return a(e,o,t,n)});else if(typeof r==\"function\")r(e,t,n,a);else{var i=Object.keys(r)[0];Array.isArray(r[i])?(n[i]={},a(e,r[i],t,n[i])):n[i]=r[i](e,t,n,a)}return t};m.parse=oe;var se=function(e,r){return function(t,n,i,o){r(t,n,i)&&o(t,e,n,i)}};m.conditional=se;var de=function(e,r){return function(t,n,i,o){for(var s=[],c=t.pos;r(t,n,i);){var u={};if(o(t,e,n,u),t.pos===c)break;c=t.pos,s.push(u)}return s}};m.loop=de});var E=S(f=>{\"use strict\";Object.defineProperty(f,\"__esModule\",{value:!0});f.readBits=f.readArray=f.readUnsigned=f.readString=f.peekBytes=f.readBytes=f.peekByte=f.readByte=f.buildStream=void 0;var ce=function(e){return{data:e,pos:0}};f.buildStream=ce;var L=function(){return function(e){return e.data[e.pos++]}};f.readByte=L;var ue=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return function(r){return r.data[r.pos+e]}};f.peekByte=ue;var M=function(e){return function(r){return r.data.subarray(r.pos,r.pos+=e)}};f.readBytes=M;var le=function(e){return function(r){return r.data.subarray(r.pos,r.pos+e)}};f.peekBytes=le;var fe=function(e){return function(r){return Array.from(M(e)(r)).map(function(t){return String.fromCharCode(t)}).join(\"\")}};f.readString=fe;var pe=function(e){return function(r){var t=M(2)(r);return e?(t[1]<<8)+t[0]:(t[0]<<8)+t[1]}};f.readUnsigned=pe;var ve=function(e,r){return function(t,n,i){for(var o=typeof r==\"function\"?r(t,n,i):r,s=M(e),c=new Array(o),u=0;u<o;u++)c[u]=s(t);return c}};f.readArray=ve;var ge=function(e,r,t){for(var n=0,i=0;i<t;i++)n+=e[r+i]&&Math.pow(2,t-i-1);return n},ye=function(e){return function(r){for(var t=L()(r),n=new Array(8),i=0;i<8;i++)n[7-i]=!!(t&1<<i);return Object.keys(e).reduce(function(o,s){var c=e[s];return c.length?o[s]=ge(n,c.index,c.length):o[s]=n[c.index],o},{})}};f.readBits=ye});var X=S(G=>{\"use strict\";Object.defineProperty(G,\"__esModule\",{value:!0});G.default=void 0;var h=D(),d=E(),z={blocks:function(e){for(var r=0,t=[],n=e.data.length,i=0,o=(0,d.readByte)()(e);o!==r&&o;o=(0,d.readByte)()(e)){if(e.pos+o>=n){var s=n-e.pos;t.push((0,d.readBytes)(s)(e)),i+=s;break}t.push((0,d.readBytes)(o)(e)),i+=o}for(var c=new Uint8Array(i),u=0,p=0;p<t.length;p++)c.set(t[p],u),u+=t[p].length;return c}},me=(0,h.conditional)({gce:[{codes:(0,d.readBytes)(2)},{byteSize:(0,d.readByte)()},{extras:(0,d.readBits)({future:{index:0,length:3},disposal:{index:3,length:3},userInput:{index:6},transparentColorGiven:{index:7}})},{delay:(0,d.readUnsigned)(!0)},{transparentColorIndex:(0,d.readByte)()},{terminator:(0,d.readByte)()}]},function(a){var e=(0,d.peekBytes)(2)(a);return e[0]===33&&e[1]===249}),he=(0,h.conditional)({image:[{code:(0,d.readByte)()},{descriptor:[{left:(0,d.readUnsigned)(!0)},{top:(0,d.readUnsigned)(!0)},{width:(0,d.readUnsigned)(!0)},{height:(0,d.readUnsigned)(!0)},{lct:(0,d.readBits)({exists:{index:0},interlaced:{index:1},sort:{index:2},future:{index:3,length:2},size:{index:5,length:3}})}]},(0,h.conditional)({lct:(0,d.readArray)(3,function(a,e,r){return Math.pow(2,r.descriptor.lct.size+1)})},function(a,e,r){return r.descriptor.lct.exists}),{data:[{minCodeSize:(0,d.readByte)()},z]}]},function(a){return(0,d.peekByte)()(a)===44}),xe=(0,h.conditional)({text:[{codes:(0,d.readBytes)(2)},{blockSize:(0,d.readByte)()},{preData:function(e,r,t){return(0,d.readBytes)(t.text.blockSize)(e)}},z]},function(a){var e=(0,d.peekBytes)(2)(a);return e[0]===33&&e[1]===1}),be=(0,h.conditional)({application:[{codes:(0,d.readBytes)(2)},{blockSize:(0,d.readByte)()},{id:function(e,r,t){return(0,d.readString)(t.blockSize)(e)}},z]},function(a){var e=(0,d.peekBytes)(2)(a);return e[0]===33&&e[1]===255}),Be=(0,h.conditional)({comment:[{codes:(0,d.readBytes)(2)},z]},function(a){var e=(0,d.peekBytes)(2)(a);return e[0]===33&&e[1]===254}),we=[{header:[{signature:(0,d.readString)(3)},{version:(0,d.readString)(3)}]},{lsd:[{width:(0,d.readUnsigned)(!0)},{height:(0,d.readUnsigned)(!0)},{gct:(0,d.readBits)({exists:{index:0},resolution:{index:1,length:3},sort:{index:4},size:{index:5,length:3}})},{backgroundColorIndex:(0,d.readByte)()},{pixelAspectRatio:(0,d.readByte)()}]},(0,h.conditional)({gct:(0,d.readArray)(3,function(a,e){return Math.pow(2,e.lsd.gct.size+1)})},function(a,e){return e.lsd.gct.exists}),{frames:(0,h.loop)([me,be,Be,he,xe],function(a){var e=(0,d.peekByte)()(a);return e===33||e===44})}],_e=we;G.default=_e});var Z=S(T=>{\"use strict\";Object.defineProperty(T,\"__esModule\",{value:!0});T.deinterlace=void 0;var Se=function(e,r){for(var t=new Array(e.length),n=e.length/r,i=function(g,v){var l=e.slice(v*r,(v+1)*r);t.splice.apply(t,[g*r,r].concat(l))},o=[0,4,2,1],s=[8,8,4,2],c=0,u=0;u<4;u++)for(var p=o[u];p<n;p+=s[u])i(p,c),c++;return t};T.deinterlace=Se});var $=S(j=>{\"use strict\";Object.defineProperty(j,\"__esModule\",{value:!0});j.lzw=void 0;var Ae=function(e,r,t){var n=4096,i=-1,o=t,s,c,u,p,w,g,v,_,l,b,F,C,B,y,I,U,q=new Array(t),O=new Array(n),k=new Array(n),P=new Array(n+1);for(C=e,c=1<<C,w=c+1,s=c+2,v=i,p=C+1,u=(1<<p)-1,l=0;l<c;l++)O[l]=0,k[l]=l;var F,_,Y,B,y,U,I;for(F=_=Y=B=y=U=I=0,b=0;b<o;){if(y===0){if(_<p){F+=r[I]<<_,_+=8,I++;continue}if(l=F&u,F>>=p,_-=p,l>s||l==w)break;if(l==c){p=C+1,u=(1<<p)-1,s=c+2,v=i;continue}if(v==i){P[y++]=k[l],v=l,B=l;continue}for(g=l,l==s&&(P[y++]=B,l=v);l>c;)P[y++]=k[l],l=O[l];B=k[l]&255,P[y++]=B,s<n&&(O[s]=v,k[s]=B,s++,!(s&u)&&s<n&&(p++,u+=s)),v=g}y--,q[U++]=P[y],b++}for(b=U;b<o;b++)q[b]=0;return q};j.lzw=Ae});var W=S(x=>{\"use strict\";Object.defineProperty(x,\"__esModule\",{value:!0});x.decompressFrames=x.decompressFrame=x.parseGIF=void 0;var ke=Ie(X()),Pe=D(),Fe=E(),Ce=Z(),Ue=$();function Ie(a){return a&&a.__esModule?a:{default:a}}var Me=function(e){var r=new Uint8Array(e);return(0,Pe.parse)((0,Fe.buildStream)(r),ke.default)};x.parseGIF=Me;var ze=function(e){for(var r=e.pixels.length,t=new Uint8ClampedArray(r*4),n=0;n<r;n++){var i=n*4,o=e.pixels[n],s=e.colorTable[o]||[0,0,0];t[i]=s[0],t[i+1]=s[1],t[i+2]=s[2],t[i+3]=o!==e.transparentIndex?255:0}return t},H=function(e,r,t){if(!e.image){console.warn(\"gif frame does not have associated image.\");return}var n=e.image,i=n.descriptor.width*n.descriptor.height,o=(0,Ue.lzw)(n.data.minCodeSize,n.data.blocks,i);n.descriptor.lct.interlaced&&(o=(0,Ce.deinterlace)(o,n.descriptor.width));var s={pixels:o,dims:{top:e.image.descriptor.top,left:e.image.descriptor.left,width:e.image.descriptor.width,height:e.image.descriptor.height}};return n.descriptor.lct&&n.descriptor.lct.exists?s.colorTable=n.lct:s.colorTable=r,e.gce&&(s.delay=(e.gce.delay||10)*10,s.disposalType=e.gce.extras.disposal,e.gce.extras.transparentColorGiven&&(s.transparentIndex=e.gce.transparentColorIndex)),t&&(s.patch=ze(s)),s};x.decompressFrame=H;var Ge=function(e,r){return e.frames.filter(function(t){return t.image}).map(function(t){return H(t,e.gct,r)})};x.decompressFrames=Ge});var Q=K(W());var J=K(W()),N=a=>a.frames.filter(e=>!(\"application\"in e)).map(e=>(0,J.decompressFrame)(e,a.gct,!1));var Te=a=>{let e=null;for(let r of a.frames)e=r.gce?r.gce:e,\"image\"in r&&!(\"gce\"in r)&&e!==null&&(r.gce=e)},V=(a,{signal:e})=>fetch(a,{signal:e}).then(r=>{var t;if(!((t=r.headers.get(\"Content-Type\"))!=null&&t.includes(\"image/gif\")))throw Error(`Wrong content type: \"${r.headers.get(\"Content-Type\")}\"`);return r.arrayBuffer()}).then(r=>(0,Q.parseGIF)(r)).then(r=>(Te(r),r)).then(r=>Promise.all([N(r),{width:r.lsd.width,height:r.lsd.height}])).then(([r,t])=>{let n=[],i=t.width*t.height*4;for(let o=0;o<r.length;++o){let s=r[o],c=o===0||r[o-1].disposalType===2?new Uint8ClampedArray(i):n[o-1].slice();n.push(je(c,s,t))}return{...t,loaded:!0,delays:r.map(o=>o.delay),frames:n}}),je=(a,e,r)=>{let{width:t,height:n,top:i,left:o}=e.dims,s=i*r.width+o;for(let c=0;c<n;c++)for(let u=0;u<t;u++){let p=c*t+u,w=e.pixels[p];if(w!==e.transparentIndex){let g=s+c*r.width+u,v=e.colorTable[w]||[0,0,0];a[g*4]=v[0],a[g*4+1]=v[1],a[g*4+2]=v[2],a[g*4+3]=255}}return a};var A=new Map;self.addEventListener(\"message\",a=>{let{type:e,src:r}=a.data||a;switch(e){case\"parse\":{if(!A.has(r)){let t=new AbortController,n={signal:t.signal};A.set(r,t),V(r,n).then(i=>{self.postMessage(Object.assign(i,{src:r}),i.frames.map(o=>o.buffer))}).catch(i=>{self.postMessage({src:r,error:i,loaded:!0})}).finally(()=>{A.delete(r)})}break}case\"cancel\":{A.has(r)&&(A.get(r).abort(),A.delete(r));break}default:break}});})();\n";
@@ -1,5 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.src = void 0;
4
- // Clone react-tools/gifs and then run npm run build. Make sure to escape the `` characters
5
- exports.src = `function e(e){const r={exports:{}};return e(r,r.exports),r.exports}const r=e(((e,r)=> {Object.defineProperty(r,"__esModule",{value:!0}),r.loop=r.conditional=r.parse=void 0;r.parse=function e(r,t){const n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}; const a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:n;if(Array.isArray(t))t.forEach(((t)=> {return e(r,t,n,a)}));else if(typeof t==="function")t(r,n,a,e);else{const i=Object.keys(t)[0];Array.isArray(t[i])?(a[i]={},e(r,t[i],n,a[i])):a[i]=t[i](r,n,a,e)}return n};r.conditional=function(e,r){return function(t,n,a,i){r(t,n,a)&&i(t,e,n,a)}};r.loop=function(e,r){return function(t,n,a,i){for(var o=[];r(t,n,a);){const s={};i(t,e,n,s),o.push(s)}return o}}})); const t=e(((e,r)=> {Object.defineProperty(r,"__esModule",{value:!0}),r.readBits=r.readArray=r.readUnsigned=r.readString=r.peekBytes=r.readBytes=r.peekByte=r.readByte=r.buildStream=void 0;r.buildStream=function(e){return{data:e,pos:0}};const t=function(){return function(e){return e.data[e.pos++]}};r.readByte=t;r.peekByte=function(){const e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return function(r){return r.data[r.pos+e]}};const n=function(e){return function(r){return r.data.subarray(r.pos,r.pos+=e)}};r.readBytes=n;r.peekBytes=function(e){return function(r){return r.data.subarray(r.pos,r.pos+e)}};r.readString=function(e){return function(r){return Array.from(n(e)(r)).map(((e)=> {return String.fromCharCode(e)})).join("")}};r.readUnsigned=function(e){return function(r){const t=n(2)(r);return e?(t[1]<<8)+t[0]:(t[0]<<8)+t[1]}};r.readArray=function(e,r){return function(t,a,i){for(var o=typeof r==="function"?r(t,a,i):r,s=n(e),d=new Array(o),c=0;c<o;c++)d[c]=s(t);return d}};r.readBits=function(e){return function(r){for(var t=function(e){return e.data[e.pos++]}(r),n=new Array(8),a=0;a<8;a++)n[7-a]=Boolean(t&1<<a);return Object.keys(e).reduce(((r,t)=> {const a=e[t];return a.length?r[t]=function(e,r,t){for(var n=0,a=0;a<t;a++)n+=e[r+a]&&2**(t-a-1);return n}(n,a.index,a.length):r[t]=n[a.index],r}),{})}}})); const n=e(((e,n)=> {Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;const a={blocks(e){for(var r=[],n=e.data.length,a=0,i=(0,t.readByte)()(e);i!==0;i=(0,t.readByte)()(e)){if(e.pos+i>=n){const o=n-e.pos;r.push((0,t.readBytes)(o)(e)),a+=o;break}r.push((0,t.readBytes)(i)(e)),a+=i}for(var s=new Uint8Array(a),d=0,c=0;c<r.length;c++)s.set(r[c],d),d+=r[c].length;return s}}; const i=(0,r.conditional)({gce:[{codes:(0,t.readBytes)(2)},{byteSize:(0,t.readByte)()},{extras:(0,t.readBits)({future:{index:0,length:3},disposal:{index:3,length:3},userInput:{index:6},transparentColorGiven:{index:7}})},{delay:(0,t.readUnsigned)(!0)},{transparentColorIndex:(0,t.readByte)()},{terminator:(0,t.readByte)()}]},((e)=> {const r=(0,t.peekBytes)(2)(e);return r[0]===33&&r[1]===249})); const o=(0,r.conditional)({image:[{code:(0,t.readByte)()},{descriptor:[{left:(0,t.readUnsigned)(!0)},{top:(0,t.readUnsigned)(!0)},{width:(0,t.readUnsigned)(!0)},{height:(0,t.readUnsigned)(!0)},{lct:(0,t.readBits)({exists:{index:0},interlaced:{index:1},sort:{index:2},future:{index:3,length:2},size:{index:5,length:3}})}]},(0,r.conditional)({lct:(0,t.readArray)(3,((e,r,t)=> {return 2**(t.descriptor.lct.size+1)}))},((e,r,t)=> {return t.descriptor.lct.exists})),{data:[{minCodeSize:(0,t.readByte)()},a]}]},((e)=> {return (0,t.peekByte)()(e)===44})); const s=(0,r.conditional)({text:[{codes:(0,t.readBytes)(2)},{blockSize:(0,t.readByte)()},{preData(e,r,n){return(0,t.readBytes)(n.text.blockSize)(e)}},a]},((e)=> {const r=(0,t.peekBytes)(2)(e);return r[0]===33&&r[1]===1})); const d=(0,r.conditional)({application:[{codes:(0,t.readBytes)(2)},{blockSize:(0,t.readByte)()},{id(e,r,n){return(0,t.readString)(n.blockSize)(e)}},a]},((e)=> {const r=(0,t.peekBytes)(2)(e);return r[0]===33&&r[1]===255})); const c=(0,r.conditional)({comment:[{codes:(0,t.readBytes)(2)},a]},((e)=> {const r=(0,t.peekBytes)(2)(e);return r[0]===33&&r[1]===254})); const u=[{header:[{signature:(0,t.readString)(3)},{version:(0,t.readString)(3)}]},{lsd:[{width:(0,t.readUnsigned)(!0)},{height:(0,t.readUnsigned)(!0)},{gct:(0,t.readBits)({exists:{index:0},resolution:{index:1,length:3},sort:{index:4},size:{index:5,length:3}})},{backgroundColorIndex:(0,t.readByte)()},{pixelAspectRatio:(0,t.readByte)()}]},(0,r.conditional)({gct:(0,t.readArray)(3,((e,r)=> {return 2**(r.lsd.gct.size+1)}))},((e,r)=> {return r.lsd.gct.exists})),{frames:(0,r.loop)([i,d,c,o,s],((e)=> {const r=(0,t.peekByte)()(e);return r===33||r===44}))}];n.default=u})); const a=e(((e,r)=> {Object.defineProperty(r,"__esModule",{value:!0}),r.deinterlace=void 0;r.deinterlace=function(e,r){for(var t=new Array(e.length),n=e.length/r,a=function(n,a){const i=e.slice(a*r,(a+1)*r);t.splice.apply(t,[n*r,r].concat(i))},i=[0,4,2,1],o=[8,8,4,2],s=0,d=0;d<4;d++)for(let c=i[d];c<n;c+=o[d])a(c,s),s++;return t}})); const i=e(((e,r)=> {Object.defineProperty(r,"__esModule",{value:!0}),r.lzw=void 0;r.lzw=function(e,r,t){let n; let a; let i; let o; let s; let d; let c; let u; let l; let f; let p; let g; let y; let h; let v; let m; const x=4096; const B=t; const w=new Array(t); const b=new Array(x); const k=new Array(x); const A=new Array(4097);for(s=(a=1<<(f=e))+1,n=a+2,c=-1,i=(1<<(o=f+1))-1,u=0;u<a;u++)b[u]=0,k[u]=u;for(p=g=y=h=v=m=0,l=0;l<B;){if(h===0){if(g<o){p+=r[m]<<g,g+=8,m++;continue}if(u=p&i,p>>=o,g-=o,u>n||u==s)break;if(u==a){i=(1<<(o=f+1))-1,n=a+2,c=-1;continue}if(c==-1){A[h++]=k[u],c=u,y=u;continue}for(d=u,u==n&&(A[h++]=y,u=c);u>a;)A[h++]=k[u],u=b[u];y=255&k[u],A[h++]=y,n<x&&(b[n]=c,k[n]=y,(++n&i)==0&&n<x&&(o++,i+=n)),c=d}h--,w[v++]=A[h],l++}for(l=v;l<B;l++)w[l]=0;return w}})); const o=e(((e,o)=> {Object.defineProperty(o,"__esModule",{value:!0}),o.decompressFrames=o.decompressFrame=o.parseGIF=void 0;let s; const d=(s=n)&&s.__esModule?s:{default:s};o.parseGIF=function(e){const n=new Uint8Array(e);return(0,r.parse)((0,t.buildStream)(n),d.default)};const c=function(e,r,t){if(e.image){const n=e.image; const o=n.descriptor.width*n.descriptor.height; let s=(0,i.lzw)(n.data.minCodeSize,n.data.blocks,o);n.descriptor.lct.interlaced&&(s=(0,a.deinterlace)(s,n.descriptor.width));const d={pixels:s,dims:{top:e.image.descriptor.top,left:e.image.descriptor.left,width:e.image.descriptor.width,height:e.image.descriptor.height}};return n.descriptor.lct&&n.descriptor.lct.exists?d.colorTable=n.lct:d.colorTable=r,e.gce&&(d.delay=10*(e.gce.delay||10),d.disposalType=e.gce.extras.disposal,e.gce.extras.transparentColorGiven&&(d.transparentIndex=e.gce.transparentColorIndex)),t&&(d.patch=function(e){for(var r=e.pixels.length,t=new Uint8ClampedArray(4*r),n=0;n<r;n++){const a=4*n; const i=e.pixels[n]; const o=e.colorTable[i]||[0,0,0];t[a]=o[0],t[a+1]=o[1],t[a+2]=o[2],t[a+3]=i!==e.transparentIndex?255:0}return t}(d)),d}console.warn("gif frame does not have associated image.")};o.decompressFrame=c;o.decompressFrames=function(e,r){return e.frames.filter(((e)=> {return e.image})).map(((t)=> {return c(t,e.gct,r)}))}}));const s=(e,r,t)=>{const{width:n,height:a,top:i,left:o}=r.dims; const s=i*t.width+o;for(let i=0;i<a;i++)for(let a=0;a<n;a++){const o=i*n+a; const d=r.pixels[o];if(d!==r.transparentIndex){const n=s+i*t.width+a; const o=r.colorTable[d]||[0,0,0];e[4*n]=o[0],e[4*n+1]=o[1],e[4*n+2]=o[2],e[4*n+3]=255}}return e}; const d=new Map;self.addEventListener("message",(e=>{const{type:r,src:t}=e.data||e;switch(r){case"parse":if(!d.has(t)){const e=new AbortController; const r={signal:e.signal};d.set(t,e),((e,{signal:r})=>fetch(e,{signal:r}).then((e=>{if(!e.headers.get("Content-Type").includes("image/gif"))throw Error(\`Wrong content type: "$\{e.headers.get("Content-Type")}"\`);return e.arrayBuffer()})).then((e=>o.parseGIF(e))).then((e=>((e=>{let r=null;for(const t of e.frames)r=t.gce?t.gce:r,"image"in t&&!("gce"in t)&&(t.gce=r)})(e),e))).then((e=>Promise.all([o.decompressFrames(e,!1),{width:e.lsd.width,height:e.lsd.height}]))).then((([e,r])=>{const t=[]; const n=r.width*r.height*4;for(let a=0;a<e.length;++a){const i=e[a]; const o=a===0||e[a-1].disposalType===2?new Uint8ClampedArray(n):t[a-1].slice();t.push(s(o,i,r))}return{...r,loaded:!0,delays:e.map((e=>e.delay)),frames:t}})))(t,r).then((e=>{self.postMessage(Object.assign(e,{src:t}),e.frames.map((e=>e.buffer)))})).catch((e=>{self.postMessage({src:t,error:e,loaded:!0})})).finally((()=>{d.delete(t)}))}break;case"cancel":if(d.has(t)){d.get(t).abort(),d.delete(t)}}}));`;
4
+ // Auto-generated by build.mjs
5
+ exports.src =
6
+ // eslint-disable-next-line no-template-curly-in-string
7
+ "\"use strict\";(()=>{var ee=Object.create;var R=Object.defineProperty;var re=Object.getOwnPropertyDescriptor;var te=Object.getOwnPropertyNames;var ae=Object.getPrototypeOf,ne=Object.prototype.hasOwnProperty;var S=(a,e)=>()=>(e||a((e={exports:{}}).exports,e),e.exports);var ie=(a,e,r,t)=>{if(e&&typeof e==\"object\"||typeof e==\"function\")for(let n of te(e))!ne.call(a,n)&&n!==r&&R(a,n,{get:()=>e[n],enumerable:!(t=re(e,n))||t.enumerable});return a};var K=(a,e,r)=>(r=a!=null?ee(ae(a)):{},ie(e||!a||!a.__esModule?R(r,\"default\",{value:a,enumerable:!0}):r,a));var D=S(m=>{\"use strict\";Object.defineProperty(m,\"__esModule\",{value:!0});m.loop=m.conditional=m.parse=void 0;var oe=function a(e,r){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:t;if(Array.isArray(r))r.forEach(function(o){return a(e,o,t,n)});else if(typeof r==\"function\")r(e,t,n,a);else{var i=Object.keys(r)[0];Array.isArray(r[i])?(n[i]={},a(e,r[i],t,n[i])):n[i]=r[i](e,t,n,a)}return t};m.parse=oe;var se=function(e,r){return function(t,n,i,o){r(t,n,i)&&o(t,e,n,i)}};m.conditional=se;var de=function(e,r){return function(t,n,i,o){for(var s=[],c=t.pos;r(t,n,i);){var u={};if(o(t,e,n,u),t.pos===c)break;c=t.pos,s.push(u)}return s}};m.loop=de});var E=S(f=>{\"use strict\";Object.defineProperty(f,\"__esModule\",{value:!0});f.readBits=f.readArray=f.readUnsigned=f.readString=f.peekBytes=f.readBytes=f.peekByte=f.readByte=f.buildStream=void 0;var ce=function(e){return{data:e,pos:0}};f.buildStream=ce;var L=function(){return function(e){return e.data[e.pos++]}};f.readByte=L;var ue=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return function(r){return r.data[r.pos+e]}};f.peekByte=ue;var M=function(e){return function(r){return r.data.subarray(r.pos,r.pos+=e)}};f.readBytes=M;var le=function(e){return function(r){return r.data.subarray(r.pos,r.pos+e)}};f.peekBytes=le;var fe=function(e){return function(r){return Array.from(M(e)(r)).map(function(t){return String.fromCharCode(t)}).join(\"\")}};f.readString=fe;var pe=function(e){return function(r){var t=M(2)(r);return e?(t[1]<<8)+t[0]:(t[0]<<8)+t[1]}};f.readUnsigned=pe;var ve=function(e,r){return function(t,n,i){for(var o=typeof r==\"function\"?r(t,n,i):r,s=M(e),c=new Array(o),u=0;u<o;u++)c[u]=s(t);return c}};f.readArray=ve;var ge=function(e,r,t){for(var n=0,i=0;i<t;i++)n+=e[r+i]&&Math.pow(2,t-i-1);return n},ye=function(e){return function(r){for(var t=L()(r),n=new Array(8),i=0;i<8;i++)n[7-i]=!!(t&1<<i);return Object.keys(e).reduce(function(o,s){var c=e[s];return c.length?o[s]=ge(n,c.index,c.length):o[s]=n[c.index],o},{})}};f.readBits=ye});var X=S(G=>{\"use strict\";Object.defineProperty(G,\"__esModule\",{value:!0});G.default=void 0;var h=D(),d=E(),z={blocks:function(e){for(var r=0,t=[],n=e.data.length,i=0,o=(0,d.readByte)()(e);o!==r&&o;o=(0,d.readByte)()(e)){if(e.pos+o>=n){var s=n-e.pos;t.push((0,d.readBytes)(s)(e)),i+=s;break}t.push((0,d.readBytes)(o)(e)),i+=o}for(var c=new Uint8Array(i),u=0,p=0;p<t.length;p++)c.set(t[p],u),u+=t[p].length;return c}},me=(0,h.conditional)({gce:[{codes:(0,d.readBytes)(2)},{byteSize:(0,d.readByte)()},{extras:(0,d.readBits)({future:{index:0,length:3},disposal:{index:3,length:3},userInput:{index:6},transparentColorGiven:{index:7}})},{delay:(0,d.readUnsigned)(!0)},{transparentColorIndex:(0,d.readByte)()},{terminator:(0,d.readByte)()}]},function(a){var e=(0,d.peekBytes)(2)(a);return e[0]===33&&e[1]===249}),he=(0,h.conditional)({image:[{code:(0,d.readByte)()},{descriptor:[{left:(0,d.readUnsigned)(!0)},{top:(0,d.readUnsigned)(!0)},{width:(0,d.readUnsigned)(!0)},{height:(0,d.readUnsigned)(!0)},{lct:(0,d.readBits)({exists:{index:0},interlaced:{index:1},sort:{index:2},future:{index:3,length:2},size:{index:5,length:3}})}]},(0,h.conditional)({lct:(0,d.readArray)(3,function(a,e,r){return Math.pow(2,r.descriptor.lct.size+1)})},function(a,e,r){return r.descriptor.lct.exists}),{data:[{minCodeSize:(0,d.readByte)()},z]}]},function(a){return(0,d.peekByte)()(a)===44}),xe=(0,h.conditional)({text:[{codes:(0,d.readBytes)(2)},{blockSize:(0,d.readByte)()},{preData:function(e,r,t){return(0,d.readBytes)(t.text.blockSize)(e)}},z]},function(a){var e=(0,d.peekBytes)(2)(a);return e[0]===33&&e[1]===1}),be=(0,h.conditional)({application:[{codes:(0,d.readBytes)(2)},{blockSize:(0,d.readByte)()},{id:function(e,r,t){return(0,d.readString)(t.blockSize)(e)}},z]},function(a){var e=(0,d.peekBytes)(2)(a);return e[0]===33&&e[1]===255}),Be=(0,h.conditional)({comment:[{codes:(0,d.readBytes)(2)},z]},function(a){var e=(0,d.peekBytes)(2)(a);return e[0]===33&&e[1]===254}),we=[{header:[{signature:(0,d.readString)(3)},{version:(0,d.readString)(3)}]},{lsd:[{width:(0,d.readUnsigned)(!0)},{height:(0,d.readUnsigned)(!0)},{gct:(0,d.readBits)({exists:{index:0},resolution:{index:1,length:3},sort:{index:4},size:{index:5,length:3}})},{backgroundColorIndex:(0,d.readByte)()},{pixelAspectRatio:(0,d.readByte)()}]},(0,h.conditional)({gct:(0,d.readArray)(3,function(a,e){return Math.pow(2,e.lsd.gct.size+1)})},function(a,e){return e.lsd.gct.exists}),{frames:(0,h.loop)([me,be,Be,he,xe],function(a){var e=(0,d.peekByte)()(a);return e===33||e===44})}],_e=we;G.default=_e});var Z=S(T=>{\"use strict\";Object.defineProperty(T,\"__esModule\",{value:!0});T.deinterlace=void 0;var Se=function(e,r){for(var t=new Array(e.length),n=e.length/r,i=function(g,v){var l=e.slice(v*r,(v+1)*r);t.splice.apply(t,[g*r,r].concat(l))},o=[0,4,2,1],s=[8,8,4,2],c=0,u=0;u<4;u++)for(var p=o[u];p<n;p+=s[u])i(p,c),c++;return t};T.deinterlace=Se});var $=S(j=>{\"use strict\";Object.defineProperty(j,\"__esModule\",{value:!0});j.lzw=void 0;var Ae=function(e,r,t){var n=4096,i=-1,o=t,s,c,u,p,w,g,v,_,l,b,F,C,B,y,I,U,q=new Array(t),O=new Array(n),k=new Array(n),P=new Array(n+1);for(C=e,c=1<<C,w=c+1,s=c+2,v=i,p=C+1,u=(1<<p)-1,l=0;l<c;l++)O[l]=0,k[l]=l;var F,_,Y,B,y,U,I;for(F=_=Y=B=y=U=I=0,b=0;b<o;){if(y===0){if(_<p){F+=r[I]<<_,_+=8,I++;continue}if(l=F&u,F>>=p,_-=p,l>s||l==w)break;if(l==c){p=C+1,u=(1<<p)-1,s=c+2,v=i;continue}if(v==i){P[y++]=k[l],v=l,B=l;continue}for(g=l,l==s&&(P[y++]=B,l=v);l>c;)P[y++]=k[l],l=O[l];B=k[l]&255,P[y++]=B,s<n&&(O[s]=v,k[s]=B,s++,!(s&u)&&s<n&&(p++,u+=s)),v=g}y--,q[U++]=P[y],b++}for(b=U;b<o;b++)q[b]=0;return q};j.lzw=Ae});var W=S(x=>{\"use strict\";Object.defineProperty(x,\"__esModule\",{value:!0});x.decompressFrames=x.decompressFrame=x.parseGIF=void 0;var ke=Ie(X()),Pe=D(),Fe=E(),Ce=Z(),Ue=$();function Ie(a){return a&&a.__esModule?a:{default:a}}var Me=function(e){var r=new Uint8Array(e);return(0,Pe.parse)((0,Fe.buildStream)(r),ke.default)};x.parseGIF=Me;var ze=function(e){for(var r=e.pixels.length,t=new Uint8ClampedArray(r*4),n=0;n<r;n++){var i=n*4,o=e.pixels[n],s=e.colorTable[o]||[0,0,0];t[i]=s[0],t[i+1]=s[1],t[i+2]=s[2],t[i+3]=o!==e.transparentIndex?255:0}return t},H=function(e,r,t){if(!e.image){console.warn(\"gif frame does not have associated image.\");return}var n=e.image,i=n.descriptor.width*n.descriptor.height,o=(0,Ue.lzw)(n.data.minCodeSize,n.data.blocks,i);n.descriptor.lct.interlaced&&(o=(0,Ce.deinterlace)(o,n.descriptor.width));var s={pixels:o,dims:{top:e.image.descriptor.top,left:e.image.descriptor.left,width:e.image.descriptor.width,height:e.image.descriptor.height}};return n.descriptor.lct&&n.descriptor.lct.exists?s.colorTable=n.lct:s.colorTable=r,e.gce&&(s.delay=(e.gce.delay||10)*10,s.disposalType=e.gce.extras.disposal,e.gce.extras.transparentColorGiven&&(s.transparentIndex=e.gce.transparentColorIndex)),t&&(s.patch=ze(s)),s};x.decompressFrame=H;var Ge=function(e,r){return e.frames.filter(function(t){return t.image}).map(function(t){return H(t,e.gct,r)})};x.decompressFrames=Ge});var Q=K(W());var J=K(W()),N=a=>a.frames.filter(e=>!(\"application\"in e)).map(e=>(0,J.decompressFrame)(e,a.gct,!1));var Te=a=>{let e=null;for(let r of a.frames)e=r.gce?r.gce:e,\"image\"in r&&!(\"gce\"in r)&&e!==null&&(r.gce=e)},V=(a,{signal:e})=>fetch(a,{signal:e}).then(r=>{var t;if(!((t=r.headers.get(\"Content-Type\"))!=null&&t.includes(\"image/gif\")))throw Error(`Wrong content type: \"${r.headers.get(\"Content-Type\")}\"`);return r.arrayBuffer()}).then(r=>(0,Q.parseGIF)(r)).then(r=>(Te(r),r)).then(r=>Promise.all([N(r),{width:r.lsd.width,height:r.lsd.height}])).then(([r,t])=>{let n=[],i=t.width*t.height*4;for(let o=0;o<r.length;++o){let s=r[o],c=o===0||r[o-1].disposalType===2?new Uint8ClampedArray(i):n[o-1].slice();n.push(je(c,s,t))}return{...t,loaded:!0,delays:r.map(o=>o.delay),frames:n}}),je=(a,e,r)=>{let{width:t,height:n,top:i,left:o}=e.dims,s=i*r.width+o;for(let c=0;c<n;c++)for(let u=0;u<t;u++){let p=c*t+u,w=e.pixels[p];if(w!==e.transparentIndex){let g=s+c*r.width+u,v=e.colorTable[w]||[0,0,0];a[g*4]=v[0],a[g*4+1]=v[1],a[g*4+2]=v[2],a[g*4+3]=255}}return a};var A=new Map;self.addEventListener(\"message\",a=>{let{type:e,src:r}=a.data||a;switch(e){case\"parse\":{if(!A.has(r)){let t=new AbortController,n={signal:t.signal};A.set(r,t),V(r,n).then(i=>{self.postMessage(Object.assign(i,{src:r}),i.frames.map(o=>o.buffer))}).catch(i=>{self.postMessage({src:r,error:i,loaded:!0})}).finally(()=>{A.delete(r)})}break}case\"cancel\":{A.has(r)&&(A.get(r).abort(),A.delete(r));break}default:break}});})();\n";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remotion/gif",
3
- "version": "3.3.17",
3
+ "version": "3.3.19",
4
4
  "description": "Gif component for remotion",
5
5
  "sideEffects": false,
6
6
  "repository": {
@@ -17,19 +17,20 @@
17
17
  ],
18
18
  "scripts": {
19
19
  "lint": "eslint src --ext ts,tsx",
20
- "build": "tsc -d",
20
+ "build": "node build.mjs && tsc -d",
21
21
  "watch": "tsc -w"
22
22
  },
23
23
  "dependencies": {
24
24
  "gifuct-js": "2.1.2",
25
25
  "lru_map": "0.4.1",
26
- "remotion": "3.3.17"
26
+ "remotion": "3.3.19"
27
27
  },
28
28
  "devDependencies": {
29
29
  "@jonny/eslint-config": "3.0.266",
30
30
  "@types/node": "^16.7.5",
31
31
  "@types/react": "18.0.23",
32
32
  "@types/react-dom": "18.0.0",
33
+ "esbuild": "0.16.12",
33
34
  "eslint": "8.25.0",
34
35
  "prettier": "2.6.2",
35
36
  "prettier-plugin-organize-imports": "^2.3.4",
@@ -53,5 +54,5 @@
53
54
  "publishConfig": {
54
55
  "access": "public"
55
56
  },
56
- "gitHead": "0b80927c47c4216f84a4a34320d48b6f55488747"
57
+ "gitHead": "097ff40cd34ecba3c7ebbbc08b442827b0f4ad7d"
57
58
  }