yamlover 0.3.13 → 0.3.21

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.
Files changed (34) hide show
  1. package/README.md +11 -2
  2. package/dist/agent-docs/AGENTS.md +4 -2
  3. package/dist/builtin-taxonomy/$defs/board +7 -7
  4. package/dist/builtin-taxonomy/$defs/chapter +17 -11
  5. package/dist/builtin-taxonomy/$defs/chunk +5 -3
  6. package/dist/builtin-taxonomy/$defs/task +15 -16
  7. package/dist/builtin-taxonomy/$defs/workflow +1 -1
  8. package/dist/client/assets/decoded-CY5-anyl.js +1 -0
  9. package/dist/client/assets/djvu-CbL4_9ak.js +1 -0
  10. package/dist/client/assets/{docx-B_9I-KwO.js → docx-CCEuxO9n.js} +1 -1
  11. package/dist/client/assets/{heic-Ce7tu8UK.js → heic-BvS6Unla.js} +2 -2
  12. package/dist/client/assets/imagemap-DBji1qL1.js +1 -0
  13. package/dist/client/assets/index-1sCxQdj3.css +1 -0
  14. package/dist/client/assets/index-DqdQvRi4.js +632 -0
  15. package/dist/client/assets/map-BfHrzAqt.js +1 -0
  16. package/dist/client/assets/openable-DIyqYrzm.js +4 -0
  17. package/dist/client/assets/{paged-CBui7Gsu.js → paged-COP9CRTO.js} +1 -1
  18. package/dist/client/assets/{pdf-DEAMWCiJ.js → pdf-C-kvASQl.js} +9 -9
  19. package/dist/client/assets/psd-KxbPOIwA.js +11 -0
  20. package/dist/client/assets/{spreadsheet-DM8lRCkI.js → spreadsheet-DkG5umsc.js} +1 -1
  21. package/dist/client/assets/tiff-sq_Q9sNj.js +1 -0
  22. package/dist/client/index.html +2 -2
  23. package/dist/server.js +1014 -274
  24. package/package.json +1 -1
  25. package/dist/client/assets/decoded-7CsibQKd.js +0 -1
  26. package/dist/client/assets/djvu-BXFlPnkK.js +0 -1
  27. package/dist/client/assets/imagemap-DlsYOgu-.js +0 -1
  28. package/dist/client/assets/index-D7TqaRqy.js +0 -620
  29. package/dist/client/assets/index-DEBdytA6.css +0 -1
  30. package/dist/client/assets/map-CKyCg437.js +0 -1
  31. package/dist/client/assets/panzoom-BDtxTlLr.js +0 -4
  32. package/dist/client/assets/psd-BUfV7J7j.js +0 -11
  33. package/dist/client/assets/tiff-DvGVB25t.js +0 -1
  34. /package/dist/client/assets/{panzoom-CIGW-MKW.css → openable-CIGW-MKW.css} +0 -0
@@ -0,0 +1,11 @@
1
+ import{j as _a}from"./index-DqdQvRi4.js";import{D as za,c as Na}from"./decoded-CY5-anyl.js";import"./imagemap-DBji1qL1.js";import"./openable-DIyqYrzm.js";var Kr=Ha,$r=Za,Re=[],Ie=[],Ga=typeof Uint8Array<"u"?Uint8Array:Array,Ft="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var un=0,Ua=Ft.length;un<Ua;++un)Re[un]=Ft[un],Ie[Ft.charCodeAt(un)]=un;Ie[45]=62;Ie[95]=63;function Va(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");n===-1&&(n=t);var i=n===t?0:4-n%4;return[n,i]}function ja(e,t,n){return(t+n)*3/4-n}function Ha(e){var t,n=Va(e),i=n[0],r=n[1],o=new Ga(ja(e,i,r)),a=0,l=r>0?i-4:i,u;for(u=0;u<l;u+=4)t=Ie[e.charCodeAt(u)]<<18|Ie[e.charCodeAt(u+1)]<<12|Ie[e.charCodeAt(u+2)]<<6|Ie[e.charCodeAt(u+3)],o[a++]=t>>16&255,o[a++]=t>>8&255,o[a++]=t&255;return r===2&&(t=Ie[e.charCodeAt(u)]<<2|Ie[e.charCodeAt(u+1)]>>4,o[a++]=t&255),r===1&&(t=Ie[e.charCodeAt(u)]<<10|Ie[e.charCodeAt(u+1)]<<4|Ie[e.charCodeAt(u+2)]>>2,o[a++]=t>>8&255,o[a++]=t&255),o}function Wa(e){return Re[e>>18&63]+Re[e>>12&63]+Re[e>>6&63]+Re[e&63]}function Xa(e,t,n){for(var i,r=[],o=t;o<n;o+=3)i=(e[o]<<16&16711680)+(e[o+1]<<8&65280)+(e[o+2]&255),r.push(Wa(i));return r.join("")}function Za(e){for(var t,n=e.length,i=n%3,r=[],o=16383,a=0,l=n-i;a<l;a+=o)r.push(Xa(e,a,a+o>l?l:a+o));return i===1?(t=e[n-1],r.push(Re[t>>2]+Re[t<<4&63]+"==")):i===2&&(t=(e[n-2]<<8)+e[n-1],r.push(Re[t>>10]+Re[t>>4&63]+Re[t<<2&63]+"=")),r.join("")}function In(e){let t=e.length;for(;--t>=0;)e[t]=0}const Ya=3,Ka=258,qr=29,$a=256,qa=$a+1+qr,Jr=30,Ja=512,Qa=new Array((qa+2)*2);In(Qa);const el=new Array(Jr*2);In(el);const nl=new Array(Ja);In(nl);const tl=new Array(Ka-Ya+1);In(tl);const il=new Array(qr);In(il);const rl=new Array(Jr);In(rl);const ol=(e,t,n,i)=>{let r=e&65535|0,o=e>>>16&65535|0,a=0;for(;n!==0;){a=n>2e3?2e3:n,n-=a;do r=r+t[i++]|0,o=o+r|0;while(--a);r%=65521,o%=65521}return r|o<<16|0};var Ht=ol;const al=()=>{let e,t=[];for(var n=0;n<256;n++){e=n;for(var i=0;i<8;i++)e=e&1?3988292384^e>>>1:e>>>1;t[n]=e}return t},ll=new Uint32Array(al()),sl=(e,t,n,i)=>{const r=ll,o=i+n;e^=-1;for(let a=i;a<o;a++)e=e>>>8^r[(e^t[a])&255];return e^-1};var Le=sl,Wt={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},Qr={Z_NO_FLUSH:0,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_DEFLATED:8};const ul=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var cl=function(e){const t=Array.prototype.slice.call(arguments,1);for(;t.length;){const n=t.shift();if(n){if(typeof n!="object")throw new TypeError(n+"must be non-object");for(const i in n)ul(n,i)&&(e[i]=n[i])}}return e},fl=e=>{let t=0;for(let i=0,r=e.length;i<r;i++)t+=e[i].length;const n=new Uint8Array(t);for(let i=0,r=0,o=e.length;i<o;i++){let a=e[i];n.set(a,r),r+=a.length}return n},eo={assign:cl,flattenChunks:fl};let no=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{no=!1}const Nn=new Uint8Array(256);for(let e=0;e<256;e++)Nn[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;Nn[254]=Nn[254]=1;var dl=e=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(e);let t,n,i,r,o,a=e.length,l=0;for(r=0;r<a;r++)n=e.charCodeAt(r),(n&64512)===55296&&r+1<a&&(i=e.charCodeAt(r+1),(i&64512)===56320&&(n=65536+(n-55296<<10)+(i-56320),r++)),l+=n<128?1:n<2048?2:n<65536?3:4;for(t=new Uint8Array(l),o=0,r=0;o<l;r++)n=e.charCodeAt(r),(n&64512)===55296&&r+1<a&&(i=e.charCodeAt(r+1),(i&64512)===56320&&(n=65536+(n-55296<<10)+(i-56320),r++)),n<128?t[o++]=n:n<2048?(t[o++]=192|n>>>6,t[o++]=128|n&63):n<65536?(t[o++]=224|n>>>12,t[o++]=128|n>>>6&63,t[o++]=128|n&63):(t[o++]=240|n>>>18,t[o++]=128|n>>>12&63,t[o++]=128|n>>>6&63,t[o++]=128|n&63);return t};const hl=(e,t)=>{if(t<65534&&e.subarray&&no)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));let n="";for(let i=0;i<t;i++)n+=String.fromCharCode(e[i]);return n};var pl=(e,t)=>{const n=t||e.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(e.subarray(0,t));let i,r;const o=new Array(n*2);for(r=0,i=0;i<n;){let a=e[i++];if(a<128){o[r++]=a;continue}let l=Nn[a];if(l>4){o[r++]=65533,i+=l-1;continue}for(a&=l===2?31:l===3?15:7;l>1&&i<n;)a=a<<6|e[i++]&63,l--;if(l>1){o[r++]=65533;continue}a<65536?o[r++]=a:(a-=65536,o[r++]=55296|a>>10&1023,o[r++]=56320|a&1023)}return hl(o,r)},vl=(e,t)=>{t=t||e.length,t>e.length&&(t=e.length);let n=t-1;for(;n>=0&&(e[n]&192)===128;)n--;return n<0||n===0?t:n+Nn[e[n]]>t?n:t},Xt={string2buf:dl,buf2string:pl,utf8border:vl};function ml(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var gl=ml;const Xn=16209,bl=16191;var yl=function(t,n){let i,r,o,a,l,u,s,c,d,p,h,g,v,F,y,m,b,S,E,G,A,R,N,B;const z=t.state;i=t.next_in,N=t.input,r=i+(t.avail_in-5),o=t.next_out,B=t.output,a=o-(n-t.avail_out),l=o+(t.avail_out-257),u=z.dmax,s=z.wsize,c=z.whave,d=z.wnext,p=z.window,h=z.hold,g=z.bits,v=z.lencode,F=z.distcode,y=(1<<z.lenbits)-1,m=(1<<z.distbits)-1;e:do{g<15&&(h+=N[i++]<<g,g+=8,h+=N[i++]<<g,g+=8),b=v[h&y];n:for(;;){if(S=b>>>24,h>>>=S,g-=S,S=b>>>16&255,S===0)B[o++]=b&65535;else if(S&16){E=b&65535,S&=15,S&&(g<S&&(h+=N[i++]<<g,g+=8),E+=h&(1<<S)-1,h>>>=S,g-=S),g<15&&(h+=N[i++]<<g,g+=8,h+=N[i++]<<g,g+=8),b=F[h&m];t:for(;;){if(S=b>>>24,h>>>=S,g-=S,S=b>>>16&255,S&16){if(G=b&65535,S&=15,g<S&&(h+=N[i++]<<g,g+=8,g<S&&(h+=N[i++]<<g,g+=8)),G+=h&(1<<S)-1,G>u){t.msg="invalid distance too far back",z.mode=Xn;break e}if(h>>>=S,g-=S,S=o-a,G>S){if(S=G-S,S>c&&z.sane){t.msg="invalid distance too far back",z.mode=Xn;break e}if(A=0,R=p,d===0){if(A+=s-S,S<E){E-=S;do B[o++]=p[A++];while(--S);A=o-G,R=B}}else if(d<S){if(A+=s+d-S,S-=d,S<E){E-=S;do B[o++]=p[A++];while(--S);if(A=0,d<E){S=d,E-=S;do B[o++]=p[A++];while(--S);A=o-G,R=B}}}else if(A+=d-S,S<E){E-=S;do B[o++]=p[A++];while(--S);A=o-G,R=B}for(;E>2;)B[o++]=R[A++],B[o++]=R[A++],B[o++]=R[A++],E-=3;E&&(B[o++]=R[A++],E>1&&(B[o++]=R[A++]))}else{A=o-G;do B[o++]=B[A++],B[o++]=B[A++],B[o++]=B[A++],E-=3;while(E>2);E&&(B[o++]=B[A++],E>1&&(B[o++]=B[A++]))}}else if(S&64){t.msg="invalid distance code",z.mode=Xn;break e}else{b=F[(b&65535)+(h&(1<<S)-1)];continue t}break}}else if(S&64)if(S&32){z.mode=bl;break e}else{t.msg="invalid literal/length code",z.mode=Xn;break e}else{b=v[(b&65535)+(h&(1<<S)-1)];continue n}break}}while(i<r&&o<l);E=g>>3,i-=E,g-=E<<3,h&=(1<<g)-1,t.next_in=i,t.next_out=o,t.avail_in=i<r?5+(r-i):5-(i-r),t.avail_out=o<l?257+(l-o):257-(o-l),z.hold=h,z.bits=g};const cn=15,hi=852,pi=592,vi=0,xt=1,mi=2,Sl=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),Fl=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),xl=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),Il=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),Cl=(e,t,n,i,r,o,a,l)=>{const u=l.bits;let s=0,c=0,d=0,p=0,h=0,g=0,v=0,F=0,y=0,m=0,b,S,E,G,A,R=null,N;const B=new Uint16Array(cn+1),z=new Uint16Array(cn+1);let re=null,de,te,ue;for(s=0;s<=cn;s++)B[s]=0;for(c=0;c<i;c++)B[t[n+c]]++;for(h=u,p=cn;p>=1&&B[p]===0;p--);if(h>p&&(h=p),p===0)return r[o++]=1<<24|64<<16|0,r[o++]=1<<24|64<<16|0,l.bits=1,0;for(d=1;d<p&&B[d]===0;d++);for(h<d&&(h=d),F=1,s=1;s<=cn;s++)if(F<<=1,F-=B[s],F<0)return-1;if(F>0&&(e===vi||p!==1))return-1;for(z[1]=0,s=1;s<cn;s++)z[s+1]=z[s]+B[s];for(c=0;c<i;c++)t[n+c]!==0&&(a[z[t[n+c]]++]=c);if(e===vi?(R=re=a,N=20):e===xt?(R=Sl,re=Fl,N=257):(R=xl,re=Il,N=0),m=0,c=0,s=d,A=o,g=h,v=0,E=-1,y=1<<h,G=y-1,e===xt&&y>hi||e===mi&&y>pi)return 1;for(;;){de=s-v,a[c]+1<N?(te=0,ue=a[c]):a[c]>=N?(te=re[a[c]-N],ue=R[a[c]-N]):(te=96,ue=0),b=1<<s-v,S=1<<g,d=S;do S-=b,r[A+(m>>v)+S]=de<<24|te<<16|ue|0;while(S!==0);for(b=1<<s-1;m&b;)b>>=1;if(b!==0?(m&=b-1,m+=b):m=0,c++,--B[s]===0){if(s===p)break;s=t[n+a[c]]}if(s>h&&(m&G)!==E){for(v===0&&(v=h),A+=d,g=s-v,F=1<<g;g+v<p&&(F-=B[g+v],!(F<=0));)g++,F<<=1;if(y+=1<<g,e===xt&&y>hi||e===mi&&y>pi)return 1;E=m&G,r[E]=h<<24|g<<16|A-o|0}}return m!==0&&(r[A+m]=s-v<<24|64<<16|0),l.bits=h,0};var Ln=Cl;const kl=0,to=1,io=2,{Z_FINISH:gi,Z_BLOCK:Dl,Z_TREES:Zn,Z_OK:rn,Z_STREAM_END:Pl,Z_NEED_DICT:Al,Z_STREAM_ERROR:De,Z_DATA_ERROR:ro,Z_MEM_ERROR:oo,Z_BUF_ERROR:wl,Z_DEFLATED:bi}=Qr,mt=16180,yi=16181,Si=16182,Fi=16183,xi=16184,Ii=16185,Ci=16186,ki=16187,Di=16188,Pi=16189,ft=16190,_e=16191,It=16192,Ai=16193,Ct=16194,wi=16195,Ei=16196,Ti=16197,Oi=16198,Yn=16199,Kn=16200,Li=16201,Mi=16202,Ri=16203,Bi=16204,_i=16205,kt=16206,zi=16207,Ni=16208,ne=16209,ao=16210,lo=16211,El=852,Tl=592,Ol=15,Ll=Ol,Gi=e=>(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24);function Ml(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const an=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.mode<mt||t.mode>lo?1:0},so=e=>{if(an(e))return De;const t=e.state;return e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=t.wrap&1),t.mode=mt,t.last=0,t.havedict=0,t.flags=-1,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(El),t.distcode=t.distdyn=new Int32Array(Tl),t.sane=1,t.back=-1,rn},uo=e=>{if(an(e))return De;const t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,so(e)},co=(e,t)=>{let n;if(an(e))return De;const i=e.state;return t<0?(n=0,t=-t):(n=(t>>4)+5,t<48&&(t&=15)),t&&(t<8||t>15)?De:(i.window!==null&&i.wbits!==t&&(i.window=null),i.wrap=n,i.wbits=t,uo(e))},fo=(e,t)=>{if(!e)return De;const n=new Ml;e.state=n,n.strm=e,n.window=null,n.mode=mt;const i=co(e,t);return i!==rn&&(e.state=null),i},Rl=e=>fo(e,Ll);let Ui=!0,Dt,Pt;const Bl=e=>{if(Ui){Dt=new Int32Array(512),Pt=new Int32Array(32);let t=0;for(;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(Ln(to,e.lens,0,288,Dt,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;Ln(io,e.lens,0,32,Pt,0,e.work,{bits:5}),Ui=!1}e.lencode=Dt,e.lenbits=9,e.distcode=Pt,e.distbits=5},ho=(e,t,n,i)=>{let r;const o=e.state;return o.window===null&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new Uint8Array(o.wsize)),i>=o.wsize?(o.window.set(t.subarray(n-o.wsize,n),0),o.wnext=0,o.whave=o.wsize):(r=o.wsize-o.wnext,r>i&&(r=i),o.window.set(t.subarray(n-i,n-i+r),o.wnext),i-=r,i?(o.window.set(t.subarray(n-i,n),0),o.wnext=i,o.whave=o.wsize):(o.wnext+=r,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=r))),0},_l=(e,t)=>{let n,i,r,o,a,l,u,s,c,d,p,h,g,v,F=0,y,m,b,S,E,G,A,R;const N=new Uint8Array(4);let B,z;const re=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(an(e)||!e.output||!e.input&&e.avail_in!==0)return De;n=e.state,n.mode===_e&&(n.mode=It),a=e.next_out,r=e.output,u=e.avail_out,o=e.next_in,i=e.input,l=e.avail_in,s=n.hold,c=n.bits,d=l,p=u,R=rn;e:for(;;)switch(n.mode){case mt:if(n.wrap===0){n.mode=It;break}for(;c<16;){if(l===0)break e;l--,s+=i[o++]<<c,c+=8}if(n.wrap&2&&s===35615){n.wbits===0&&(n.wbits=15),n.check=0,N[0]=s&255,N[1]=s>>>8&255,n.check=Le(n.check,N,2,0),s=0,c=0,n.mode=yi;break}if(n.head&&(n.head.done=!1),!(n.wrap&1)||(((s&255)<<8)+(s>>8))%31){e.msg="incorrect header check",n.mode=ne;break}if((s&15)!==bi){e.msg="unknown compression method",n.mode=ne;break}if(s>>>=4,c-=4,A=(s&15)+8,n.wbits===0&&(n.wbits=A),A>15||A>n.wbits){e.msg="invalid window size",n.mode=ne;break}n.dmax=1<<n.wbits,n.flags=0,e.adler=n.check=1,n.mode=s&512?Pi:_e,s=0,c=0;break;case yi:for(;c<16;){if(l===0)break e;l--,s+=i[o++]<<c,c+=8}if(n.flags=s,(n.flags&255)!==bi){e.msg="unknown compression method",n.mode=ne;break}if(n.flags&57344){e.msg="unknown header flags set",n.mode=ne;break}n.head&&(n.head.text=s>>8&1),n.flags&512&&n.wrap&4&&(N[0]=s&255,N[1]=s>>>8&255,n.check=Le(n.check,N,2,0)),s=0,c=0,n.mode=Si;case Si:for(;c<32;){if(l===0)break e;l--,s+=i[o++]<<c,c+=8}n.head&&(n.head.time=s),n.flags&512&&n.wrap&4&&(N[0]=s&255,N[1]=s>>>8&255,N[2]=s>>>16&255,N[3]=s>>>24&255,n.check=Le(n.check,N,4,0)),s=0,c=0,n.mode=Fi;case Fi:for(;c<16;){if(l===0)break e;l--,s+=i[o++]<<c,c+=8}n.head&&(n.head.xflags=s&255,n.head.os=s>>8),n.flags&512&&n.wrap&4&&(N[0]=s&255,N[1]=s>>>8&255,n.check=Le(n.check,N,2,0)),s=0,c=0,n.mode=xi;case xi:if(n.flags&1024){for(;c<16;){if(l===0)break e;l--,s+=i[o++]<<c,c+=8}n.length=s,n.head&&(n.head.extra_len=s),n.flags&512&&n.wrap&4&&(N[0]=s&255,N[1]=s>>>8&255,n.check=Le(n.check,N,2,0)),s=0,c=0}else n.head&&(n.head.extra=null);n.mode=Ii;case Ii:if(n.flags&1024&&(h=n.length,h>l&&(h=l),h&&(n.head&&(A=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Uint8Array(n.head.extra_len)),n.head.extra.set(i.subarray(o,o+h),A)),n.flags&512&&n.wrap&4&&(n.check=Le(n.check,i,h,o)),l-=h,o+=h,n.length-=h),n.length))break e;n.length=0,n.mode=Ci;case Ci:if(n.flags&2048){if(l===0)break e;h=0;do A=i[o+h++],n.head&&A&&n.length<65536&&(n.head.name+=String.fromCharCode(A));while(A&&h<l);if(n.flags&512&&n.wrap&4&&(n.check=Le(n.check,i,h,o)),l-=h,o+=h,A)break e}else n.head&&(n.head.name=null);n.length=0,n.mode=ki;case ki:if(n.flags&4096){if(l===0)break e;h=0;do A=i[o+h++],n.head&&A&&n.length<65536&&(n.head.comment+=String.fromCharCode(A));while(A&&h<l);if(n.flags&512&&n.wrap&4&&(n.check=Le(n.check,i,h,o)),l-=h,o+=h,A)break e}else n.head&&(n.head.comment=null);n.mode=Di;case Di:if(n.flags&512){for(;c<16;){if(l===0)break e;l--,s+=i[o++]<<c,c+=8}if(n.wrap&4&&s!==(n.check&65535)){e.msg="header crc mismatch",n.mode=ne;break}s=0,c=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=_e;break;case Pi:for(;c<32;){if(l===0)break e;l--,s+=i[o++]<<c,c+=8}e.adler=n.check=Gi(s),s=0,c=0,n.mode=ft;case ft:if(n.havedict===0)return e.next_out=a,e.avail_out=u,e.next_in=o,e.avail_in=l,n.hold=s,n.bits=c,Al;e.adler=n.check=1,n.mode=_e;case _e:if(t===Dl||t===Zn)break e;case It:if(n.last){s>>>=c&7,c-=c&7,n.mode=kt;break}for(;c<3;){if(l===0)break e;l--,s+=i[o++]<<c,c+=8}switch(n.last=s&1,s>>>=1,c-=1,s&3){case 0:n.mode=Ai;break;case 1:if(Bl(n),n.mode=Yn,t===Zn){s>>>=2,c-=2;break e}break;case 2:n.mode=Ei;break;case 3:e.msg="invalid block type",n.mode=ne}s>>>=2,c-=2;break;case Ai:for(s>>>=c&7,c-=c&7;c<32;){if(l===0)break e;l--,s+=i[o++]<<c,c+=8}if((s&65535)!==(s>>>16^65535)){e.msg="invalid stored block lengths",n.mode=ne;break}if(n.length=s&65535,s=0,c=0,n.mode=Ct,t===Zn)break e;case Ct:n.mode=wi;case wi:if(h=n.length,h){if(h>l&&(h=l),h>u&&(h=u),h===0)break e;r.set(i.subarray(o,o+h),a),l-=h,o+=h,u-=h,a+=h,n.length-=h;break}n.mode=_e;break;case Ei:for(;c<14;){if(l===0)break e;l--,s+=i[o++]<<c,c+=8}if(n.nlen=(s&31)+257,s>>>=5,c-=5,n.ndist=(s&31)+1,s>>>=5,c-=5,n.ncode=(s&15)+4,s>>>=4,c-=4,n.nlen>286||n.ndist>30){e.msg="too many length or distance symbols",n.mode=ne;break}n.have=0,n.mode=Ti;case Ti:for(;n.have<n.ncode;){for(;c<3;){if(l===0)break e;l--,s+=i[o++]<<c,c+=8}n.lens[re[n.have++]]=s&7,s>>>=3,c-=3}for(;n.have<19;)n.lens[re[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,B={bits:n.lenbits},R=Ln(kl,n.lens,0,19,n.lencode,0,n.work,B),n.lenbits=B.bits,R){e.msg="invalid code lengths set",n.mode=ne;break}n.have=0,n.mode=Oi;case Oi:for(;n.have<n.nlen+n.ndist;){for(;F=n.lencode[s&(1<<n.lenbits)-1],y=F>>>24,m=F>>>16&255,b=F&65535,!(y<=c);){if(l===0)break e;l--,s+=i[o++]<<c,c+=8}if(b<16)s>>>=y,c-=y,n.lens[n.have++]=b;else{if(b===16){for(z=y+2;c<z;){if(l===0)break e;l--,s+=i[o++]<<c,c+=8}if(s>>>=y,c-=y,n.have===0){e.msg="invalid bit length repeat",n.mode=ne;break}A=n.lens[n.have-1],h=3+(s&3),s>>>=2,c-=2}else if(b===17){for(z=y+3;c<z;){if(l===0)break e;l--,s+=i[o++]<<c,c+=8}s>>>=y,c-=y,A=0,h=3+(s&7),s>>>=3,c-=3}else{for(z=y+7;c<z;){if(l===0)break e;l--,s+=i[o++]<<c,c+=8}s>>>=y,c-=y,A=0,h=11+(s&127),s>>>=7,c-=7}if(n.have+h>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=ne;break}for(;h--;)n.lens[n.have++]=A}}if(n.mode===ne)break;if(n.lens[256]===0){e.msg="invalid code -- missing end-of-block",n.mode=ne;break}if(n.lenbits=9,B={bits:n.lenbits},R=Ln(to,n.lens,0,n.nlen,n.lencode,0,n.work,B),n.lenbits=B.bits,R){e.msg="invalid literal/lengths set",n.mode=ne;break}if(n.distbits=6,n.distcode=n.distdyn,B={bits:n.distbits},R=Ln(io,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,B),n.distbits=B.bits,R){e.msg="invalid distances set",n.mode=ne;break}if(n.mode=Yn,t===Zn)break e;case Yn:n.mode=Kn;case Kn:if(l>=6&&u>=258){e.next_out=a,e.avail_out=u,e.next_in=o,e.avail_in=l,n.hold=s,n.bits=c,yl(e,p),a=e.next_out,r=e.output,u=e.avail_out,o=e.next_in,i=e.input,l=e.avail_in,s=n.hold,c=n.bits,n.mode===_e&&(n.back=-1);break}for(n.back=0;F=n.lencode[s&(1<<n.lenbits)-1],y=F>>>24,m=F>>>16&255,b=F&65535,!(y<=c);){if(l===0)break e;l--,s+=i[o++]<<c,c+=8}if(m&&!(m&240)){for(S=y,E=m,G=b;F=n.lencode[G+((s&(1<<S+E)-1)>>S)],y=F>>>24,m=F>>>16&255,b=F&65535,!(S+y<=c);){if(l===0)break e;l--,s+=i[o++]<<c,c+=8}s>>>=S,c-=S,n.back+=S}if(s>>>=y,c-=y,n.back+=y,n.length=b,m===0){n.mode=_i;break}if(m&32){n.back=-1,n.mode=_e;break}if(m&64){e.msg="invalid literal/length code",n.mode=ne;break}n.extra=m&15,n.mode=Li;case Li:if(n.extra){for(z=n.extra;c<z;){if(l===0)break e;l--,s+=i[o++]<<c,c+=8}n.length+=s&(1<<n.extra)-1,s>>>=n.extra,c-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=Mi;case Mi:for(;F=n.distcode[s&(1<<n.distbits)-1],y=F>>>24,m=F>>>16&255,b=F&65535,!(y<=c);){if(l===0)break e;l--,s+=i[o++]<<c,c+=8}if(!(m&240)){for(S=y,E=m,G=b;F=n.distcode[G+((s&(1<<S+E)-1)>>S)],y=F>>>24,m=F>>>16&255,b=F&65535,!(S+y<=c);){if(l===0)break e;l--,s+=i[o++]<<c,c+=8}s>>>=S,c-=S,n.back+=S}if(s>>>=y,c-=y,n.back+=y,m&64){e.msg="invalid distance code",n.mode=ne;break}n.offset=b,n.extra=m&15,n.mode=Ri;case Ri:if(n.extra){for(z=n.extra;c<z;){if(l===0)break e;l--,s+=i[o++]<<c,c+=8}n.offset+=s&(1<<n.extra)-1,s>>>=n.extra,c-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg="invalid distance too far back",n.mode=ne;break}n.mode=Bi;case Bi:if(u===0)break e;if(h=p-u,n.offset>h){if(h=n.offset-h,h>n.whave&&n.sane){e.msg="invalid distance too far back",n.mode=ne;break}h>n.wnext?(h-=n.wnext,g=n.wsize-h):g=n.wnext-h,h>n.length&&(h=n.length),v=n.window}else v=r,g=a-n.offset,h=n.length;h>u&&(h=u),u-=h,n.length-=h;do r[a++]=v[g++];while(--h);n.length===0&&(n.mode=Kn);break;case _i:if(u===0)break e;r[a++]=n.length,u--,n.mode=Kn;break;case kt:if(n.wrap){for(;c<32;){if(l===0)break e;l--,s|=i[o++]<<c,c+=8}if(p-=u,e.total_out+=p,n.total+=p,n.wrap&4&&p&&(e.adler=n.check=n.flags?Le(n.check,r,p,a-p):Ht(n.check,r,p,a-p)),p=u,n.wrap&4&&(n.flags?s:Gi(s))!==n.check){e.msg="incorrect data check",n.mode=ne;break}s=0,c=0}n.mode=zi;case zi:if(n.wrap&&n.flags){for(;c<32;){if(l===0)break e;l--,s+=i[o++]<<c,c+=8}if(n.wrap&4&&s!==(n.total&4294967295)){e.msg="incorrect length check",n.mode=ne;break}s=0,c=0}n.mode=Ni;case Ni:R=Pl;break e;case ne:R=ro;break e;case ao:return oo;case lo:default:return De}return e.next_out=a,e.avail_out=u,e.next_in=o,e.avail_in=l,n.hold=s,n.bits=c,(n.wsize||p!==e.avail_out&&n.mode<ne&&(n.mode<kt||t!==gi))&&ho(e,e.output,e.next_out,p-e.avail_out),d-=e.avail_in,p-=e.avail_out,e.total_in+=d,e.total_out+=p,n.total+=p,n.wrap&4&&p&&(e.adler=n.check=n.flags?Le(n.check,r,p,e.next_out-p):Ht(n.check,r,p,e.next_out-p)),e.data_type=n.bits+(n.last?64:0)+(n.mode===_e?128:0)+(n.mode===Yn||n.mode===Ct?256:0),(d===0&&p===0||t===gi)&&R===rn&&(R=wl),R},zl=e=>{if(an(e))return De;let t=e.state;return t.window&&(t.window=null),e.state=null,rn},Nl=(e,t)=>{if(an(e))return De;const n=e.state;return n.wrap&2?(n.head=t,t.done=!1,rn):De},Gl=(e,t)=>{const n=t.length;let i,r,o;return an(e)||(i=e.state,i.wrap!==0&&i.mode!==ft)?De:i.mode===ft&&(r=1,r=Ht(r,t,n,0),r!==i.check)?ro:(o=ho(e,t,n,n),o?(i.mode=ao,oo):(i.havedict=1,rn))};var Ul=uo,Vl=co,jl=so,Hl=Rl,Wl=fo,Xl=_l,Zl=zl,Yl=Nl,Kl=Gl,$l="pako inflate (from Nodeca project)",Ge={inflateReset:Ul,inflateReset2:Vl,inflateResetKeep:jl,inflateInit:Hl,inflateInit2:Wl,inflate:Xl,inflateEnd:Zl,inflateGetHeader:Yl,inflateSetDictionary:Kl,inflateInfo:$l};function ql(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var Jl=ql;const po=Object.prototype.toString,{Z_NO_FLUSH:Ql,Z_FINISH:es,Z_OK:Gn,Z_STREAM_END:At,Z_NEED_DICT:wt,Z_STREAM_ERROR:ns,Z_DATA_ERROR:Vi,Z_MEM_ERROR:ts}=Qr;function gt(e){this.options=eo.assign({chunkSize:1024*64,windowBits:15,to:""},e||{});const t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,t.windowBits===0&&(t.windowBits=-15)),t.windowBits>=0&&t.windowBits<16&&!(e&&e.windowBits)&&(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(t.windowBits&15||(t.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new gl,this.strm.avail_out=0;let n=Ge.inflateInit2(this.strm,t.windowBits);if(n!==Gn)throw new Error(Wt[n]);if(this.header=new Jl,Ge.inflateGetHeader(this.strm,this.header),t.dictionary&&(typeof t.dictionary=="string"?t.dictionary=Xt.string2buf(t.dictionary):po.call(t.dictionary)==="[object ArrayBuffer]"&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(n=Ge.inflateSetDictionary(this.strm,t.dictionary),n!==Gn)))throw new Error(Wt[n])}gt.prototype.push=function(e,t){const n=this.strm,i=this.options.chunkSize,r=this.options.dictionary;let o,a,l;if(this.ended)return!1;for(t===~~t?a=t:a=t===!0?es:Ql,po.call(e)==="[object ArrayBuffer]"?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;;){for(n.avail_out===0&&(n.output=new Uint8Array(i),n.next_out=0,n.avail_out=i),o=Ge.inflate(n,a),o===wt&&r&&(o=Ge.inflateSetDictionary(n,r),o===Gn?o=Ge.inflate(n,a):o===Vi&&(o=wt));n.avail_in>0&&o===At&&n.state.wrap>0&&e[n.next_in]!==0;)Ge.inflateReset(n),o=Ge.inflate(n,a);switch(o){case ns:case Vi:case wt:case ts:return this.onEnd(o),this.ended=!0,!1}if(l=n.avail_out,n.next_out&&(n.avail_out===0||o===At))if(this.options.to==="string"){let u=Xt.utf8border(n.output,n.next_out),s=n.next_out-u,c=Xt.buf2string(n.output,u);n.next_out=s,n.avail_out=i-s,s&&n.output.set(n.output.subarray(u,u+s),0),this.onData(c)}else this.onData(n.output.length===n.next_out?n.output:n.output.subarray(0,n.next_out));if(!(o===Gn&&l===0)){if(o===At)return o=Ge.inflateEnd(this.strm),this.onEnd(o),this.ended=!0,!0;if(n.avail_in===0)break}}return!0};gt.prototype.onData=function(e){this.chunks.push(e)};gt.prototype.onEnd=function(e){e===Gn&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=eo.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function is(e,t){const n=new gt(t);if(n.push(e),n.err)throw n.msg||Wt[n.err];return n.result}var rs=is,os={inflate:rs};const{inflate:as}=os;var ls=as,vo={},Sn={pass:"pass through",norm:"normal",diss:"dissolve",dark:"darken","mul ":"multiply",idiv:"color burn",lbrn:"linear burn",dkCl:"darker color",lite:"lighten",scrn:"screen","div ":"color dodge",lddg:"linear dodge",lgCl:"lighter color",over:"overlay",sLit:"soft light",hLit:"hard light",vLit:"vivid light",lLit:"linear light",pLit:"pin light",hMix:"hard mix",diff:"difference",smud:"exclusion",fsub:"subtract",fdiv:"divide","hue ":"hue","sat ":"saturation",colr:"color","lum ":"luminosity"};Object.keys(Sn).forEach(function(e){return vo[Sn[e]]=e});var ji=["none","red","orange","yellow","green","blue","violet","gray"],ss=["LMsk","Lr16","Lr32","Layr","Mt16","Mt32","Mtrn","Alph","FMsk","lnk2","FEid","FXid","PxSD","cinf"];function us(e){var t={};return Object.keys(e).forEach(function(n){return t[e[n]]=n}),t}function M(e,t,n){var i=us(n),r=function(a){var l=a.split(".")[1];if(l&&!i[l])throw new Error("Unrecognized value for enum: '".concat(a,"'"));return i[l]||t},o=function(a){if(a&&!n[a])throw new Error("Invalid value for enum: '".concat(a,"'"));return"".concat(e,".").concat(n[a]||n[t])};return{decode:r,encode:o}}var Hi;(function(e){e[e.RGB=0]="RGB",e[e.HSB=1]="HSB",e[e.CMYK=2]="CMYK",e[e.Lab=7]="Lab",e[e.Grayscale=8]="Grayscale"})(Hi||(Hi={}));var Wi;(function(e){e[e.PositionRelativeToLayer=1]="PositionRelativeToLayer",e[e.LayerMaskDisabled=2]="LayerMaskDisabled",e[e.InvertLayerMaskWhenBlending=4]="InvertLayerMaskWhenBlending",e[e.LayerMaskFromRenderingOtherData=8]="LayerMaskFromRenderingOtherData",e[e.MaskHasParametersAppliedToIt=16]="MaskHasParametersAppliedToIt"})(Wi||(Wi={}));var Xi;(function(e){e[e.UserMaskDensity=1]="UserMaskDensity",e[e.UserMaskFeather=2]="UserMaskFeather",e[e.VectorMaskDensity=4]="VectorMaskDensity",e[e.VectorMaskFeather=8]="VectorMaskFeather"})(Xi||(Xi={}));var Zi;(function(e){e[e.Color0=0]="Color0",e[e.Color1=1]="Color1",e[e.Color2=2]="Color2",e[e.Color3=3]="Color3",e[e.Transparency=-1]="Transparency",e[e.UserMask=-2]="UserMask",e[e.RealUserMask=-3]="RealUserMask"})(Zi||(Zi={}));var Yi;(function(e){e[e.RawData=0]="RawData",e[e.RleCompressed=1]="RleCompressed",e[e.ZipWithoutPrediction=2]="ZipWithoutPrediction",e[e.ZipWithPrediction=3]="ZipWithPrediction"})(Yi||(Yi={}));function cs(e,t){switch(e){case 0:return 0;case 1:return 1;case 2:return 2;case 3:return t?3:e+1;case-1:return t?4:3;default:return e+1}}function mo(e,t,n){return e<t?t:e>n?n:e}function Zt(e){for(var t=e.data,n=t instanceof Float32Array?1:t instanceof Uint16Array?65535:255,i=0,r=t.length|0;i<r;i=i+4|0)t[i+0]=0,t[i+1]=0,t[i+2]=0,t[i+3]=n}function Yt(e){var t=ni(e.width,e.height),n;if(e.data instanceof Uint8ClampedArray)n=e;else{n=ti(e.width,e.height);var i=e.data,r=n.data;if(i instanceof Float32Array)for(var o=0,a=i.length;o<a;o+=4)r[o+0]=Math.round(Math.pow(i[o+0],1/2.2)*255),r[o+1]=Math.round(Math.pow(i[o+1],1/2.2)*255),r[o+2]=Math.round(Math.pow(i[o+2],1/2.2)*255),r[o+3]=Math.round(i[o+3]*255);else for(var l=i instanceof Uint16Array?8:0,o=0,a=i.length;o<a;o++)r[o]=i[o]>>>l}return t.getContext("2d").putImageData(n,0,0),t}function fs(e,t,n,i){if(!(e instanceof Uint8Array||e instanceof Uint8ClampedArray))throw new Error("Invalid bit depth");for(var r=0,o=0,a=0;r<i;r++)for(var l=0;l<n;)for(var u=e[a++],s=0;s<8&&l<n;s++,l++,o+=4){var c=u&128?0:255;u=u<<1,t[o+0]=c,t[o+1]=c,t[o+2]=c,t[o+3]=255}}var ni=function(){throw new Error("Canvas not initialized, use initializeCanvas method to set up createCanvas method")},go=function(){throw new Error("Canvas not initialized, use initializeCanvas method to set up createCanvasFromData method")},Et=void 0,ti=function(e,t){return Et||(Et=ni(1,1)),Et.getContext("2d").createImageData(e,t)};typeof document<"u"&&(ni=function(e,t){var n=document.createElement("canvas");return n.width=e,n.height=t,n},go=function(e){var t=new Image;t.src="data:image/jpeg;base64,"+$r(e);var n=document.createElement("canvas");return n.width=t.width,n.height=t.height,n.getContext("2d").drawImage(t,0,0),n});function Kt(e){return e&4294967168?e&4294965248?e&4294901760?4:3:2:1}function ds(e){for(var t=0,n=0;n<e.length;n++){var i=e.charCodeAt(n);if(i>=55296&&i<=56319){if(n+1<e.length){var r=e.charCodeAt(n+1);(r&64512)===56320&&(n++,t+=Kt(((i&1023)<<10)+(r&1023)+65536))}}else t+=Kt(i)}return t}function Ki(e,t,n){var i=Kt(n);switch(i){case 1:e[t]=n;break;case 2:e[t]=n>>6&31|192,e[t+1]=n&63|128;break;case 3:e[t]=n>>12&15|224,e[t+1]=n>>6&63|128,e[t+2]=n&63|128;break;default:e[t]=n>>18&7|240,e[t+1]=n>>12&63|128,e[t+2]=n>>6&63|128,e[t+3]=n&63|128;break}return i}function hs(e,t,n){for(var i=0;i<n.length;i++){var r=n.charCodeAt(i);if(r>=55296&&r<=56319){if(i+1<n.length){var o=n.charCodeAt(i+1);if((o&64512)===56320){i++;var a=((r&1023)<<10)+(o&1023)+65536;t+=Ki(e,t,a)}}}else t+=Ki(e,t,r)}return t}function bo(e){if(e.length>1e3&&typeof TextEncoder<"u")return new TextEncoder().encode(e);var t=new Uint8Array(ds(e));return hs(t,0,e),t}function fn(e,t){if(t>=e.length)throw Error("Invalid byte index");var n=e[t];if((n&192)===128)return n&63;throw Error("Invalid continuation byte")}function yo(e){if(e.byteLength>1e3&&typeof TextDecoder<"u")return new TextDecoder().decode(e);for(var t=[],n=0;n<e.length;){var i=e[n++],r=void 0;if(!(i&128))r=i;else if((i&224)===192){var o=fn(e,n++);if(r=(i&31)<<6|o,r<128)throw Error("Invalid continuation byte")}else if((i&240)===224){var o=fn(e,n++),a=fn(e,n++);if(r=(i&15)<<12|o<<6|a,r<2048)throw Error("Invalid continuation byte");if(r>=55296&&r<=57343)throw Error("Lone surrogate U+".concat(r.toString(16).toUpperCase()," is not a scalar value"))}else if((i&248)===240){var o=fn(e,n++),a=fn(e,n++),l=fn(e,n++);if(r=(i&15)<<18|o<<12|a<<6|l,r<65536||r>1114111)throw Error("Invalid continuation byte")}else throw Error("Invalid UTF-8 detected");r>65535&&(r-=65536,t.push(String.fromCharCode(r>>>10&1023|55296)),r=56320|r&1023),t.push(String.fromCharCode(r))}return t.join("")}var Ue=function(){return Ue=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},Ue.apply(this,arguments)},ps=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]]);return n};function vs(e){var t={};return Object.keys(e).forEach(function(n){return t[e[n]]=n}),t}var En={"#Ang":"Angle","#Rsl":"Density","#Rlt":"Distance","#Nne":"None","#Prc":"Percent","#Pxl":"Pixels","#Mlm":"Millimeters","#Pnt":"Points",RrPi:"Picas",RrIn:"Inches",RrCm:"Centimeters"},$n=vs(En);function k(e,t){return{name:e,classID:t}}var W=k("","null"),So={strokeStyleContent:k("","solidColorLayer"),printProofSetup:k("Proof Setup","proofSetup"),Grad:k("Gradient","Grdn"),Trnf:k("Transform","Trnf"),patternFill:k("","patternFill"),ebbl:k("","ebbl"),SoFi:k("","SoFi"),GrFl:k("","GrFl"),sdwC:k("","RGBC"),hglC:k("","RGBC"),"Clr ":k("","RGBC"),tintColor:k("","RGBC"),Ofst:k("","Pnt "),ChFX:k("","ChFX"),MpgS:k("","ShpC"),DrSh:k("","DrSh"),IrSh:k("","IrSh"),OrGl:k("","OrGl"),IrGl:k("","IrGl"),TrnS:k("","ShpC"),Ptrn:k("","Ptrn"),FrFX:k("","FrFX"),phase:k("","Pnt "),frameStep:W,duration:W,workInTime:W,workOutTime:W,audioClipGroupList:W,bounds:k("","Rctn"),customEnvelopeWarp:k("","customEnvelopeWarp"),warp:k("","warp"),"Sz ":k("","Pnt "),origin:k("","Pnt "),autoExpandOffset:k("","Pnt "),keyOriginShapeBBox:k("","unitRect"),Vrsn:W,psVersion:W,docDefaultNewArtboardBackgroundColor:k("","RGBC"),artboardRect:k("","classFloatRect"),keyOriginRRectRadii:k("","radii"),keyOriginBoxCorners:W,rectangleCornerA:k("","Pnt "),rectangleCornerB:k("","Pnt "),rectangleCornerC:k("","Pnt "),rectangleCornerD:k("","Pnt "),compInfo:W,quiltWarp:k("","quiltWarp"),generatorSettings:W,crema:W,FrIn:W,blendOptions:W,FXRf:W,Lefx:W,time:W,animKey:W,timeScope:W,inTime:W,outTime:W,sheetStyle:W,translation:W,Skew:W,boundingBox:k("","boundingBox"),"Lnk ":k("","ExternalFileLink"),frameReader:k("","FrameReader"),effectParams:k("","motionTrackEffectParams"),Impr:k("None","none"),Anch:k("","Pnt "),"Fwd ":k("","Pnt "),"Bwd ":k("","Pnt "),FlrC:k("","Pnt "),meshBoundaryPath:k("","pathClass"),filterFX:k("","filterFXStyle"),Fltr:k("","rigidTransform"),FrgC:k("","RGBC"),BckC:k("","RGBC"),sdwM:k("Parameters","adaptCorrectTones"),hglM:k("Parameters","adaptCorrectTones"),customShape:k("","customShape"),origFXRefPoint:W,FXRefPoint:W,ClMg:k("","ClMg")},Fo={"Crv ":k("","CrPt"),Clrs:k("","Clrt"),Trns:k("","TrnS"),keyDescriptorList:W,solidFillMulti:k("","SoFi"),gradientFillMulti:k("","GrFl"),dropShadowMulti:k("","DrSh"),innerShadowMulti:k("","IrSh"),frameFXMulti:k("","FrFX"),FrIn:W,FSts:W,LaSt:W,sheetTimelineOptions:W,trackList:k("","animationTrack"),globalTrackList:k("","animationTrack"),keyList:W,audioClipGroupList:W,audioClipList:W,countObjectList:k("","countObject"),countGroupList:k("","countGroup"),slices:k("","slice"),"Pts ":k("","Pthp"),SbpL:k("","SbpL"),pathComponents:k("","PaCm"),filterFXList:k("","filterFX"),puppetShapeList:k("","puppetShape"),channelDenoise:k("","channelDenoiseParams"),ShrP:k("","Pnt "),layerSettings:W,list:W,Adjs:k("","CrvA")},$i={TEXT:["Txt ","printerName","Nm ","Idnt","blackAndWhitePresetFileName","LUT3DFileName","presetFileName","curvesPresetFileName","mixerPresetFileName","placed","description","reason","artboardPresetName","json","clipID","relPath","fullPath","mediaDescriptor","Msge","altTag","url","cellText","preset","KnNm","FPth","comment","originalPath"],tdta:["EngineData","LUT3DFileData","indexArray","originalVertexArray","deformedVertexArray","LqMe"],long:["TextIndex","RndS","Mdpn","Smth","Lctn","strokeStyleVersion","LaID","Vrsn","Cnt ","Brgh","Cntr","means","vibrance","Strt","bwPresetKind","comp","compID","originalCompID","curvesPresetKind","mixerPresetKind","uOrder","vOrder","PgNm","totalPages","Crop","numerator","denominator","frameCount","Annt","keyOriginType","unitValueQuadVersion","keyOriginIndex","major","minor","fix","docDefaultNewArtboardBackgroundType","artboardBackgroundType","numModifyingFX","deformNumRows","deformNumCols","FrID","FrDl","FsID","LCnt","AFrm","AFSt","numBefore","numAfter","Spcn","minOpacity","maxOpacity","BlnM","sheetID","gblA","globalAltitude","descVersion","frameReaderType","LyrI","zoomOrigin","fontSize","Rds ","sliceID","topOutset","leftOutset","bottomOutset","rightOutset","filterID","meshQuality","meshExpansion","meshRigidity","VrsM","VrsN","NmbG","WLMn","WLMx","AmMn","AmMx","SclH","SclV","Lvl ","TlNm","TlOf","FlRs","Thsh","ShrS","ShrE","FlRs","Vrnc","Strg","ExtS","ExtD","HrzS","VrtS","NmbR","EdgF","Ang1","Ang2","Ang3","Ang4","lastAppliedComp","capturedInfo"],enum:["textGridding","Ornt","warpStyle","warpRotate","Inte","Bltn","ClrS","BlrQ","bvlT","bvlS","bvlD","Md ","glwS","GrdF","GlwT","RplS","BlrM","SmBM","strokeStyleLineCapType","strokeStyleLineJoinType","strokeStyleLineAlignment","strokeStyleBlendMode","PntT","Styl","lookupType","LUTFormat","dataOrder","tableOrder","enableCompCore","enableCompCoreGPU","compCoreSupport","compCoreGPUSupport","Engn","enableCompCoreThreads","gs99","FrDs","trackID","animInterpStyle","horzAlign","vertAlign","bgColorType","shapeOperation","UndA","Wvtp","Drct","WndM","Edg ","FlCl","IntE","IntC","Cnvr","Fl ","Dstr","MztT","Lns ","ExtT","DspM","ExtR","ZZTy","SphM","SmBQ","placedLayerOCIOConversion","gradientsInterpolationMethod"],bool:["PstS","printSixteenBit","masterFXSwitch","enab","uglg","antialiasGloss","useShape","useTexture","uglg","antialiasGloss","useShape","Vsbl","useTexture","Algn","Rvrs","Dthr","Invr","VctC","ShTr","layerConceals","strokeEnabled","fillEnabled","strokeStyleScaleLock","strokeStyleStrokeAdjust","hardProof","MpBl","paperWhite","useLegacy","Auto","Lab ","useTint","keyShapeInvalidated","autoExpandEnabled","autoNestEnabled","autoPositionEnabled","shrinkwrapOnSaveEnabled","present","showInDialog","overprint","sheetDisclosed","lightsDisclosed","meshesDisclosed","materialsDisclosed","hasMotion","muted","Effc","selected","autoScope","fillCanvas","cellTextIsHTML","Smoo","Clsp","validAtPosition","rigidType","hasoptions","filterMaskEnable","filterMaskLinked","filterMaskExtendWithWhite","removeJPEGArtifact","Mnch","ExtF","ExtM","moreAccurate","GpuY","LIWy","Cnty"],doub:["warpValue","warpPerspective","warpPerspectiveOther","Intr","Wdth","Hght","strokeStyleMiterLimit","strokeStyleResolution","layerTime","keyOriginResolution","xx","xy","yx","yy","tx","ty","FrGA","frameRate","audioLevel","rotation","X ","Y ","redFloat","greenFloat","blueFloat","imageResolution","PuX0","PuX1","PuX2","PuX3","PuY0","PuY1","PuY2","PuY3"],UntF:["sdwO","hglO","lagl","Lald","srgR","blur","Sftn","Opct","Dstn","Angl","Ckmt","Nose","Inpr","ShdN","strokeStyleLineWidth","strokeStyleLineDashOffset","strokeStyleOpacity","H ","Top ","Left","Btom","Rght","Rslt","topRight","topLeft","bottomLeft","bottomRight","ClNs","Shrp"],VlLs:["Crv ","Clrs","Mnm ","Mxm ","Trns","pathList","strokeStyleLineDashSet","FrLs","slices","LaSt","Trnf","nonAffineTransform","keyDescriptorList","guideIndeces","gradientFillMulti","solidFillMulti","frameFXMulti","innerShadowMulti","dropShadowMulti","FrIn","FSts","FsFr","sheetTimelineOptions","audioClipList","trackList","globalTrackList","keyList","audioClipList","warpValues","selectedPin","Pts ","SbpL","pathComponents","pinOffsets","posFinalPins","pinVertexIndices","PinP","PnRt","PnOv","PnDp","filterFXList","puppetShapeList","ShrP","channelDenoise","Mtrx","layerSettings","list","compList","Adjs"],ObAr:["meshPoints","quiltSliceX","quiltSliceY"],"obj ":["null","Chnl"],"Pth ":["DspF"]},ms=["Rd ","Grn ","Bl ","Yllw","Ylw ","Cyn ","Mgnt","Blck","Gry ","Lmnc","A ","B "],xo={"Mnm ":"long","Mxm ":"long",FrLs:"long",strokeStyleLineDashSet:"UntF",Trnf:"doub",nonAffineTransform:"doub",keyDescriptorList:"Objc",gradientFillMulti:"Objc",solidFillMulti:"Objc",frameFXMulti:"Objc",innerShadowMulti:"Objc",dropShadowMulti:"Objc",LaSt:"Objc",FrIn:"Objc",FSts:"Objc",FsFr:"long",blendOptions:"Objc",sheetTimelineOptions:"Objc",keyList:"Objc",warpValues:"doub",selectedPin:"long","Pts ":"Objc",SbpL:"Objc",pathComponents:"Objc",pinOffsets:"doub",posFinalPins:"doub",pinVertexIndices:"long",PinP:"doub",PnRt:"long",PnOv:"bool",PnDp:"doub",filterFXList:"Objc",puppetShapeList:"Objc",ShrP:"Objc",channelDenoise:"Objc",Mtrx:"long",compList:"long",Chnl:"enum"},dt={};for(var Tt=0,qi=Object.keys($i);Tt<qi.length;Tt++)for(var Ji=qi[Tt],Ot=0,Qi=$i[Ji];Ot<Qi.length;Ot++){var Fn=Qi[Ot];dt[Fn]=Ji}for(var Lt=0,er=Object.keys(So);Lt<er.length;Lt++){var Fn=er[Lt];dt[Fn]||(dt[Fn]="Objc")}for(var Mt=0,nr=Object.keys(Fo);Mt<nr.length;Mt++){var Fn=nr[Mt];xo[Fn]="Objc"}function gs(e,t,n,i){return e==="presetKind"?typeof t=="string"?"enum":"long":e==="null"&&n==="slices"?"TEXT":e==="groupID"?n==="slices"?"long":"TEXT":e==="Sz "?"Wdth"in t?"Objc":"units"in t?"UntF":"doub":e==="Type"?typeof t=="string"?"enum":"long":e==="AntA"?typeof t=="string"?"enum":"bool":(e==="Hrzn"||e==="Vrtc")&&(i.Type==="keyType.Pstn"||i._classID==="Ofst")?"long":e==="Hrzn"||e==="Vrtc"||e==="Top "||e==="Left"||e==="Btom"||e==="Rght"?n==="slices"?"long":typeof t=="number"?"doub":"UntF":e==="Vrsn"?typeof t=="number"?"long":"Objc":e==="Rd "||e==="Grn "||e==="Bl "?n==="artd"?"long":"doub":e==="Trnf"?Array.isArray(t)?"VlLs":"Objc":dt[e]}function Ve(e){var t=O(e);return St(e,t||4)}function je(e,t){if(t.length===4&&t!=="warp"&&t!=="time"&&t!=="hold"&&t!=="list")U(e,0),_(e,t);else{U(e,t.length);for(var n=0;n<t.length;n++)T(e,t.charCodeAt(n))}}function Io(e,t){for(var n=nn(e),i=t?{_name:n.name,_classID:n.classID}:{},r=C(e),o=0;o<r;o++){var a=Ve(e),l=Q(e),u=ko(e,l,t);i[a]=u}return i}function Co(e,t,n,i,r){on(e,t),je(e,n);var o=Object.keys(i),a=o.length;"_name"in i&&a--,"_classID"in i&&a--,D(e,a);for(var l=0,u=o;l<u.length;l++){var s=u[l];if(!(s==="_name"||s==="_classID")){var c=gs(s,i[s],r,i),d=So[s];s==="bounds"&&r==="text"?d=k("","bounds"):s==="origin"?c=r==="slices"?"enum":"Objc":(s==="Cyn "||s==="Mgnt"||s==="Ylw "||s==="Blck")&&i._classID==="CMYC"?c="doub":/^PN[a-z][a-z]$/.test(s)?c="TEXT":/^PT[a-z][a-z]$/.test(s)?c="long":/^PF[a-z][a-z]$/.test(s)||(s==="Rds "||s==="Thsh")&&typeof i[s]=="number"&&i._classID==="SmrB"?c="doub":s==="ClSz"||s==="Rds "||s==="Amnt"?c=typeof i[s]=="number"?"long":"UntF":(s==="sdwM"||s==="hglM")&&typeof i[s]=="string"||s==="blur"&&typeof i[s]=="string"?c="enum":s==="Hght"&&typeof i[s]=="number"&&i._classID==="Embs"||s==="Angl"&&typeof i[s]=="number"&&(i._classID==="Embs"||i._classID==="smartSharpen"||i._classID==="Twrl"||i._classID==="MtnB")?c="long":s==="Angl"&&typeof i[s]=="number"?c="doub":s==="bounds"&&r==="slices"?(c="Objc",d=k("","Rct1")):s==="Scl "?typeof i[s]=="object"&&"Hrzn"in i[s]?(c="Objc",d=W):typeof i[s]=="number"?c="long":c="UntF":s==="audioClipGroupList"&&o.length===1?c="VlLs":(s==="Strt"||s==="Brgh")&&"H "in i?c="doub":s==="Wdth"&&typeof i[s]=="object"?c="UntF":s==="Ofst"&&typeof i[s]=="number"?c="long":s==="Strt"&&typeof i[s]=="object"?(c="Objc",d=W):ms.indexOf(s)!==-1?c=n==="RGBC"&&r!=="artd"?"doub":"long":s==="profile"?c=n==="printOutput"?"TEXT":"tdta":s==="strokeStyleContent"?i[s]["Clr "]?d=k("","solidColorLayer"):i[s].Grad?d=k("","gradientLayer"):i[s].Ptrn&&(d=k("","patternLayer")):s==="bounds"&&r==="quiltWarp"&&(d=k("","classFloatRect")),d&&d.classID==="RGBC"&&"H "in i[s]&&(d={classID:"HSBC",name:""}),je(e,s),_(e,c||"long"),Do(e,c||"long",i[s],s,d,r)}}}function ko(e,t,n){switch(t){case"obj ":return ys(e);case"Objc":case"GlbO":return Io(e,n);case"VlLs":{for(var i=O(e),r=[],o=0;o<i;o++){var a=Q(e);r.push(ko(e,a,n))}return r}case"doub":return ke(e);case"UntF":{var l=Q(e),u=ke(e);if(!En[l])throw new Error("Invalid units: ".concat(l));return{units:En[l],value:u}}case"UnFl":{var l=Q(e),u=we(e);if(!En[l])throw new Error("Invalid units: ".concat(l));return{units:En[l],value:u}}case"TEXT":return se(e);case"enum":{var s=Ve(e),u=Ve(e);return"".concat(s,".").concat(u)}case"long":return O(e);case"comp":{var c=C(e),d=C(e);return{low:c,high:d}}case"bool":return!!P(e);case"type":case"GlbC":return nn(e);case"alis":{var p=O(e);return St(e,p)}case"tdta":{var h=O(e);return ce(e,h)}case"ObAr":{O(e),se(e),Ve(e);for(var g=O(e),r=[],o=0;o<g;o++){var v=Ve(e);Q(e),Q(e);for(var F=O(e),y=[],m=0;m<F;m++)y.push(ke(e));r.push({type:v,values:y})}return r}case"Pth ":{O(e);var b=Q(e);wr(e);var S=wr(e),E=Es(e,S);return{sig:b,path:E}}default:throw new Error("Invalid TySh descriptor OSType: ".concat(t," at ").concat(e.offset.toString(16)))}}var bs={meshPoints:"rationalPoint",quiltSliceX:"UntF",quiltSliceY:"UntF"};function Do(e,t,n,i,r,o){switch(t){case"obj ":Ss(e,i,n);break;case"Objc":case"GlbO":{if(typeof n!="object")throw new Error("Invalid struct value: ".concat(JSON.stringify(n),", key: ").concat(i));if(!r)throw new Error("Missing ext type for: '".concat(i,"' (").concat(JSON.stringify(n),")"));var a=n._name||r.name,l=n._classID||r.classID;Co(e,a,l,n,o);break}case"VlLs":if(!Array.isArray(n))throw new Error("Invalid list value: ".concat(JSON.stringify(n),", key: ").concat(i));U(e,n.length);for(var u=0;u<n.length;u++){var s=xo[i];_(e,s||"long"),Do(e,s||"long",n[u],"".concat(i,"[]"),Fo[i],o)}break;case"doub":if(typeof n!="number")throw new Error("Invalid number value: ".concat(JSON.stringify(n),", key: ").concat(i));Be(e,n);break;case"UntF":if(!$n[n.units])throw new Error("Invalid units: ".concat(n.units," in ").concat(i));_(e,$n[n.units]),Be(e,n.value);break;case"UnFl":if(!$n[n.units])throw new Error("Invalid units: ".concat(n.units," in ").concat(i));_(e,$n[n.units]),Ee(e,n.value);break;case"TEXT":on(e,n);break;case"enum":{if(typeof n!="string")throw new Error("Invalid enum value: ".concat(JSON.stringify(n),", key: ").concat(i));var c=n.split("."),d=c[0],p=c[1];je(e,d),je(e,p);break}case"long":if(typeof n!="number")throw new Error("Invalid integer value: ".concat(JSON.stringify(n),", key: ").concat(i));U(e,n);break;case"bool":if(typeof n!="boolean")throw new Error("Invalid boolean value: ".concat(JSON.stringify(n),", key: ").concat(i));T(e,n?1:0);break;case"tdta":U(e,n.byteLength),He(e,n);break;case"ObAr":{U(e,16),on(e,"");var h=bs[i];if(!h)throw new Error("Not implemented ObArType for: ".concat(i));je(e,h),U(e,n.length);for(var u=0;u<n.length;u++){je(e,n[u].type),_(e,"UnFl"),_(e,"#Pxl"),U(e,n[u].values.length);for(var g=0;g<n[u].values.length;g++)Be(e,n[u].values[g])}break}case"Pth ":{var v=12+n.path.length*2;U(e,v),_(e,n.sig),Wr(e,v),Wr(e,n.path.length),mu(e,n.path);break}default:throw new Error("Not implemented descriptor OSType: ".concat(t))}}function ys(e){for(var t=O(e),n=[],i=0;i<t;i++){var r=Q(e);switch(r){case"prop":{nn(e);var o=Ve(e);n.push(o);break}case"Clss":n.push(nn(e));break;case"Enmr":{nn(e);var a=Ve(e),l=Ve(e);n.push("".concat(a,".").concat(l));break}case"rele":{nn(e),n.push(C(e));break}case"Idnt":n.push(O(e));break;case"indx":n.push(O(e));break;case"name":{nn(e),n.push(se(e));break}default:throw new Error("Invalid descriptor reference type: ".concat(r))}}return n}function Ss(e,t,n){U(e,n.length);for(var i=0;i<n.length;i++){var r=n[i],o="unknown";switch(typeof r=="string"&&(/^[a-z ]+\.[a-z ]+$/i.test(r)?o="Enmr":o="name"),_(e,o),o){case"Enmr":{var a=r.split("."),l=a[0],u=a[1];tr(e,"\0",l),je(e,l),je(e,u);break}case"name":{tr(e,"\0","Lyr "),Se(e,r+"\0");break}default:throw new Error("Invalid descriptor reference type: ".concat(o))}}return n}function nn(e){var t=se(e),n=Ve(e);return{name:t,classID:n}}function tr(e,t,n){Se(e,t),je(e,n)}function V(e,t){t===void 0&&(t=!1);var n=C(e);if(n!==16)throw new Error("Invalid descriptor version: ".concat(n));var i=Io(e,t);return i}function j(e,t,n,i,r){r===void 0&&(r=""),D(e,16),Co(e,t,n,i,r)}function Mn(e){return{x:e.Hrzn,y:e.Vrtc}}function Rn(e){return{Hrzn:e.x,Vrtc:e.y}}function ir(e){return{top:K(e["Top "]),left:K(e.Left),right:K(e.Rght),bottom:K(e.Btom)}}function rr(e){var t;return t={Left:ee(e.left,"bounds.left")},t["Top "]=ee(e.top,"bounds.top"),t.Rght=ee(e.right,"bounds.right"),t.Btom=ee(e.bottom,"bounds.bottom"),t}function or(e){var t={enabled:!!e.enab,position:yt.decode(e.Styl),fillType:Vo.decode(e.PntT),blendMode:Ce.decode(e["Md "]),opacity:J(e.Opct),size:K(e["Sz "])};return e.present!==void 0&&(t.present=e.present),e.showInDialog!==void 0&&(t.showInDialog=e.showInDialog),e.overprint!==void 0&&(t.overprint=e.overprint),e["Clr "]&&(t.color=Te(e["Clr "])),e.Grad&&(t.gradient=To(e)),e.Ptrn&&(t.pattern=Oo(e)),t}function ar(e){var t={};return t.enab=!!e.enabled,e.present!==void 0&&(t.present=!!e.present),e.showInDialog!==void 0&&(t.showInDialog=!!e.showInDialog),t.Styl=yt.encode(e.position),t.PntT=Vo.encode(e.fillType),t["Md "]=Ce.encode(e.blendMode),t.Opct=ae(e.opacity),t["Sz "]=ee(e.size,"size"),e.color&&(t["Clr "]=Oe(e.color)),e.gradient&&(t=Ue(Ue({},t),Lo(e.gradient))),e.pattern&&(t=Ue(Ue({},t),Mo(e.pattern))),e.overprint!==void 0&&(t.overprint=!!e.overprint),t}function Un(e,t,n){for(var i,r,o,a=n?{"Scl ":xe((i=e.scale)!==null&&i!==void 0?i:1),masterFXSwitch:!e.disabled}:{masterFXSwitch:!e.disabled,"Scl ":xe((r=e.scale)!==null&&r!==void 0?r:1)},l=["dropShadow","innerShadow","solidFill","gradientOverlay","stroke"],u=0,s=l;u<s.length;u++){var c=s[u];if(e[c]&&!Array.isArray(e[c]))throw new Error("".concat(c," should be an array"))}var d=function(b){return!!b&&b.length>1&&n},p=function(b){return!!b&&b.length>=1&&(!n||b.length===1)};if(p(e.dropShadow)&&(a.DrSh=me(e.dropShadow[0],"dropShadow",t)),d(e.dropShadow)&&(a.dropShadowMulti=e.dropShadow.map(function(b){return me(b,"dropShadow",t)})),p(e.innerShadow)&&(a.IrSh=me(e.innerShadow[0],"innerShadow",t)),d(e.innerShadow)&&(a.innerShadowMulti=e.innerShadow.map(function(b){return me(b,"innerShadow",t)})),e.outerGlow&&(a.OrGl=me(e.outerGlow,"outerGlow",t)),d(e.solidFill)&&(a.solidFillMulti=e.solidFill.map(function(b){return me(b,"solidFill",t)})),d(e.gradientOverlay)&&(a.gradientFillMulti=e.gradientOverlay.map(function(b){return me(b,"gradientOverlay",t)})),d(e.stroke)&&(a.frameFXMulti=e.stroke.map(function(b){return ar(b)})),e.innerGlow&&(a.IrGl=me(e.innerGlow,"innerGlow",t)),e.bevel&&(a.ebbl=me(e.bevel,"bevel",t)),p(e.solidFill)&&(a.SoFi=me(e.solidFill[0],"solidFill",t)),e.patternOverlay&&(a.patternFill=me(e.patternOverlay,"patternOverlay",t)),p(e.gradientOverlay)&&(a.GrFl=me(e.gradientOverlay[0],"gradientOverlay",t)),e.satin&&(a.ChFX=me(e.satin,"satin",t)),p(e.stroke)&&(a.FrFX=ar((o=e.stroke)===null||o===void 0?void 0:o[0])),n){a.numModifyingFX=0;for(var h=0,g=Object.keys(e);h<g.length;h++){var c=g[h],v=e[c];if(Array.isArray(v))for(var F=0,y=v;F<y.length;F++){var m=y[F];m.enabled&&a.numModifyingFX++}else v.enabled&&a.numModifyingFX++}}return a}function Vn(e,t){var n={},i=e.masterFXSwitch,r=e.DrSh,o=e.dropShadowMulti,a=e.IrSh,l=e.innerShadowMulti,u=e.OrGl,s=e.IrGl,c=e.ebbl,d=e.SoFi,p=e.solidFillMulti,h=e.patternFill,g=e.GrFl,v=e.gradientFillMulti,F=e.ChFX,y=e.FrFX,m=e.frameFXMulti;e.numModifyingFX;var b=ps(e,["masterFXSwitch","DrSh","dropShadowMulti","IrSh","innerShadowMulti","OrGl","IrGl","ebbl","SoFi","solidFillMulti","patternFill","GrFl","gradientFillMulti","ChFX","FrFX","frameFXMulti","numModifyingFX"]);return i||(n.disabled=!0),e["Scl "]&&(n.scale=J(e["Scl "])),r&&(n.dropShadow=[ve(r,t)]),o&&(n.dropShadow=o.map(function(S){return ve(S,t)})),a&&(n.innerShadow=[ve(a,t)]),l&&(n.innerShadow=l.map(function(S){return ve(S,t)})),u&&(n.outerGlow=ve(u,t)),s&&(n.innerGlow=ve(s,t)),c&&(n.bevel=ve(c,t)),d&&(n.solidFill=[ve(d,t)]),p&&(n.solidFill=p.map(function(S){return ve(S,t)})),h&&(n.patternOverlay=ve(h,t)),g&&(n.gradientOverlay=[ve(g,t)]),v&&(n.gradientOverlay=v.map(function(S){return ve(S,t)})),F&&(n.satin=ve(F,t)),y&&(n.stroke=[or(y)]),m&&(n.stroke=m.map(function(S){return or(S)})),t&&Object.keys(b).length>1&&console.log("Unhandled effect keys:",b),n}function lr(e,t){for(var n=[],i=0;i<e.length;i++){var r=e[i],o=r.time,a=o.denominator,l=o.numerator,u=r.selected,s=r.animKey,c={numerator:l,denominator:a},d=Go.decode(r.animInterpStyle);switch(s.Type){case"keyType.Opct":n.push({interpolation:d,time:c,selected:u,type:"opacity",value:J(s.Opct)});break;case"keyType.Pstn":n.push({interpolation:d,time:c,selected:u,type:"position",x:s.Hrzn,y:s.Vrtc});break;case"keyType.Trnf":n.push({interpolation:d,time:c,selected:u,type:"transform",scale:Mn(s["Scl "]),skew:Mn(s.Skew),rotation:s.rotation,translation:Mn(s.translation)});break;case"keyType.sheetStyle":{var p={interpolation:d,time:c,selected:u,type:"style"};s.sheetStyle.Lefx&&(p.style=Vn(s.sheetStyle.Lefx,t)),n.push(p);break}case"keyType.globalLighting":{n.push({interpolation:d,time:c,selected:u,type:"globalLighting",globalAngle:s.gblA,globalAltitude:s.globalAltitude});break}default:throw new Error("Unsupported keyType value")}}return n}function sr(e){for(var t=[],n=0;n<e.length;n++){var i=e[n],r=i.time,o=i.selected,a=o===void 0?!1:o,l=i.interpolation,u=Go.encode(l),s=void 0;switch(i.type){case"opacity":s={Type:"keyType.Opct",Opct:ae(i.value)};break;case"position":s={Type:"keyType.Pstn",Hrzn:i.x,Vrtc:i.y};break;case"transform":s={Type:"keyType.Trnf","Scl ":Rn(i.scale),Skew:Rn(i.skew),rotation:i.rotation,translation:Rn(i.translation)};break;case"style":s={Type:"keyType.sheetStyle",sheetStyle:{Vrsn:1,blendOptions:{}}},i.style&&(s.sheetStyle={Vrsn:1,Lefx:Un(i.style,!1,!1),blendOptions:{}});break;case"globalLighting":{s={Type:"keyType.globalLighting",gblA:i.globalAngle,globalAltitude:i.globalAltitude};break}default:throw new Error("Unsupported keyType value")}t.push({Vrsn:1,animInterpStyle:u,time:r,animKey:s,selected:a})}return t}function Po(e,t){for(var n=[],i=0;i<e.length;i++){var r=e[i],o={type:Uo.decode(r.trackID),enabled:r.enab,keys:lr(r.keyList,t)};r.effectParams&&(o.effectParams={fillCanvas:r.effectParams.fillCanvas,zoomOrigin:r.effectParams.zoomOrigin,keys:lr(r.effectParams.keyList,t)}),n.push(o)}return n}function Ao(e){for(var t=[],n=0;n<e.length;n++){var i=e[n];t.push(Ue(Ue({trackID:Uo.encode(i.type),Vrsn:1,enab:!!i.enabled,Effc:!!i.effectParams},i.effectParams?{effectParams:{keyList:sr(i.keys),fillCanvas:i.effectParams.fillCanvas,zoomOrigin:i.effectParams.zoomOrigin}}:{}),{keyList:sr(i.keys)}))}return t}function ve(e,t){for(var n={},i=0,r=Object.keys(e);i<r.length;i++){var o=r[i],a=e[o];switch(o){case"enab":n.enabled=!!a;break;case"uglg":n.useGlobalLight=!!a;break;case"AntA":n.antialiased=!!a;break;case"Algn":n.align=!!a;break;case"Dthr":n.dither=!!a;break;case"Invr":n.invert=!!a;break;case"Rvrs":n.reverse=!!a;break;case"Clr ":n.color=Te(a);break;case"hglC":n.highlightColor=Te(a);break;case"sdwC":n.shadowColor=Te(a);break;case"Styl":n.position=yt.decode(a);break;case"Md ":n.blendMode=Ce.decode(a);break;case"hglM":n.highlightBlendMode=Ce.decode(a);break;case"sdwM":n.shadowBlendMode=Ce.decode(a);break;case"bvlS":n.style=Ro.decode(a);break;case"bvlD":n.direction=_o.decode(a);break;case"bvlT":n.technique=Bo.decode(a);break;case"GlwT":n.technique=zo.decode(a);break;case"glwS":n.source=No.decode(a);break;case"Type":n.type=bt.decode(a);break;case"gs99":n.interpolationMethod=xn.decode(a);break;case"Opct":n.opacity=J(a);break;case"hglO":n.highlightOpacity=J(a);break;case"sdwO":n.shadowOpacity=J(a);break;case"lagl":n.angle=ut(a);break;case"Angl":n.angle=ut(a);break;case"Lald":n.altitude=ut(a);break;case"Sftn":n.soften=K(a);break;case"srgR":n.strength=J(a);break;case"blur":n.size=K(a);break;case"Nose":n.noise=J(a);break;case"Inpr":n.range=J(a);break;case"Ckmt":n.choke=K(a);break;case"ShdN":n.jitter=J(a);break;case"Dstn":n.distance=K(a);break;case"Scl ":n.scale=J(a);break;case"Ptrn":n.pattern={name:a["Nm "],id:a.Idnt};break;case"phase":n.phase={x:a.Hrzn,y:a.Vrtc};break;case"Ofst":n.offset={x:J(a.Hrzn),y:J(a.Vrtc)};break;case"MpgS":case"TrnS":n.contour={name:a["Nm "],curve:a["Crv "].map(function(l){return{x:l.Hrzn,y:l.Vrtc}})};break;case"Grad":n.gradient=wo(a);break;case"useTexture":case"useShape":case"layerConceals":case"present":case"showInDialog":case"antialiasGloss":n[o]=a;break;case"_name":case"_classID":break;default:t&&console.log("Invalid effect key: '".concat(o,"', value:"),a)}}return n}function me(e,t,n){var i={enab:!1};t==="dropShadow"&&(i.TrnS={"Nm ":"","Crv ":[]});for(var r=0,o=Object.keys(e);r<o.length;r++){var a=o[r],l=a,u=e[l];switch(l){case"enabled":i.enab=!!u;break;case"useGlobalLight":i.uglg=!!u;break;case"antialiased":i.AntA=!!u;break;case"align":i.Algn=!!u;break;case"dither":i.Dthr=!!u;break;case"invert":i.Invr=!!u;break;case"reverse":i.Rvrs=!!u;break;case"color":i["Clr "]=Oe(u);break;case"highlightColor":i.hglC=Oe(u);break;case"shadowColor":i.sdwC=Oe(u);break;case"position":i.Styl=yt.encode(u);break;case"blendMode":i["Md "]=Ce.encode(u);break;case"highlightBlendMode":i.hglM=Ce.encode(u);break;case"shadowBlendMode":i.sdwM=Ce.encode(u);break;case"style":i.bvlS=Ro.encode(u);break;case"direction":i.bvlD=_o.encode(u);break;case"technique":t==="bevel"?i.bvlT=Bo.encode(u):i.GlwT=zo.encode(u);break;case"source":i.glwS=No.encode(u);break;case"type":i.Type=bt.encode(u);break;case"interpolationMethod":i.gs99=xn.encode(u);break;case"opacity":i.Opct=ae(u);break;case"highlightOpacity":i.hglO=ae(u);break;case"shadowOpacity":i.sdwO=ae(u);break;case"angle":t==="gradientOverlay"||t==="patternFill"?i.Angl=Bn(u):i.lagl=Bn(u);break;case"altitude":i.Lald=Bn(u);break;case"soften":i.Sftn=ee(u,l);break;case"strength":i.srgR=ae(u);break;case"size":i.blur=ee(u,l);break;case"noise":i.Nose=ae(u);break;case"range":i.Inpr=ae(u);break;case"choke":i.Ckmt=ee(u,l);break;case"jitter":i.ShdN=ae(u);break;case"distance":i.Dstn=ee(u,l);break;case"scale":i["Scl "]=ae(u);break;case"pattern":i.Ptrn={"Nm ":u.name,Idnt:u.id};break;case"phase":i.phase={Hrzn:u.x,Vrtc:u.y};break;case"offset":i.Ofst={Hrzn:ae(u.x),Vrtc:ae(u.y)};break;case"contour":{i[t==="satin"?"MpgS":"TrnS"]={"Nm ":u.name,"Crv ":u.curve.map(function(s){return{Hrzn:s.x,Vrtc:s.y}})};break}case"gradient":i.Grad=Eo(u);break;case"useTexture":case"useShape":case"layerConceals":case"present":case"showInDialog":case"antialiasGloss":i[l]=u;break;default:n&&console.log("Invalid effect key: '".concat(l,"', value:"),u)}}return i}function wo(e){if(e.GrdF==="GrdF.CstS"){var t=e.Intr||4096;return{type:"solid",name:e["Nm "],smoothness:e.Intr/4096,colorStops:e.Clrs.map(function(n){return{color:Te(n["Clr "]),location:n.Lctn/t,midpoint:n.Mdpn/100}}),opacityStops:e.Trns.map(function(n){return{opacity:J(n.Opct),location:n.Lctn/t,midpoint:n.Mdpn/100}})}}else return{type:"noise",name:e["Nm "],roughness:e.Smth/4096,colorModel:ht.decode(e.ClrS),randomSeed:e.RndS,restrictColors:!!e.VctC,addTransparency:!!e.ShTr,min:e["Mnm "].map(function(n){return n/100}),max:e["Mxm "].map(function(n){return n/100})}}function Eo(e){var t,n;if(e.type==="solid"){var i=Math.round(((t=e.smoothness)!==null&&t!==void 0?t:1)*4096);return{"Nm ":e.name||"",GrdF:"GrdF.CstS",Intr:i,Clrs:e.colorStops.map(function(r){var o;return{"Clr ":Oe(r.color),Type:"Clry.UsrS",Lctn:Math.round(r.location*i),Mdpn:Math.round(((o=r.midpoint)!==null&&o!==void 0?o:.5)*100)}}),Trns:e.opacityStops.map(function(r){var o;return{Opct:ae(r.opacity),Lctn:Math.round(r.location*i),Mdpn:Math.round(((o=r.midpoint)!==null&&o!==void 0?o:.5)*100)}})}}else return{GrdF:"GrdF.ClNs","Nm ":e.name||"",ShTr:!!e.addTransparency,VctC:!!e.restrictColors,ClrS:ht.encode(e.colorModel),RndS:e.randomSeed||0,Smth:Math.round(((n=e.roughness)!==null&&n!==void 0?n:1)*4096),"Mnm ":(e.min||[0,0,0,0]).map(function(r){return r*100}),"Mxm ":(e.max||[1,1,1,1]).map(function(r){return r*100})}}function To(e){var t=wo(e.Grad);return t.style=bt.decode(e.Type),e.Dthr!==void 0&&(t.dither=e.Dthr),e.gradientsInterpolationMethod!==void 0&&(t.interpolationMethod=xn.decode(e.gradientsInterpolationMethod)),e.Rvrs!==void 0&&(t.reverse=e.Rvrs),e.Angl!==void 0&&(t.angle=ut(e.Angl)),e["Scl "]!==void 0&&(t.scale=J(e["Scl "])),e.Algn!==void 0&&(t.align=e.Algn),e.Ofst!==void 0&&(t.offset={x:J(e.Ofst.Hrzn),y:J(e.Ofst.Vrtc)}),t}function Oo(e){var t={name:e.Ptrn["Nm "],id:e.Ptrn.Idnt};return e.Lnkd!==void 0&&(t.linked=e.Lnkd),e.phase!==void 0&&(t.phase={x:e.phase.Hrzn,y:e.phase.Vrtc}),t}function jn(e){if("Grad"in e)return To(e);if("Ptrn"in e)return Ue({type:"pattern"},Oo(e));if("Clr "in e)return{type:"color",color:Te(e["Clr "])};throw new Error("Invalid vector content")}function Lo(e){var t={};return e.dither!==void 0&&(t.Dthr=e.dither),e.interpolationMethod!==void 0&&(t.gradientsInterpolationMethod=xn.encode(e.interpolationMethod)),e.reverse!==void 0&&(t.Rvrs=e.reverse),e.angle!==void 0&&(t.Angl=Bn(e.angle)),t.Type=bt.encode(e.style),e.align!==void 0&&(t.Algn=e.align),e.scale!==void 0&&(t["Scl "]=ae(e.scale)),e.offset&&(t.Ofst={Hrzn:ae(e.offset.x),Vrtc:ae(e.offset.y)}),t.Grad=Eo(e),t}function Mo(e){var t={Ptrn:{"Nm ":e.name||"",Idnt:e.id||""}};return e.linked!==void 0&&(t.Lnkd=!!e.linked),e.phase!==void 0&&(t.phase={Hrzn:e.phase.x,Vrtc:e.phase.y}),t}function Hn(e){return e.type==="color"?{key:"SoCo",descriptor:{"Clr ":Oe(e.color)}}:e.type==="pattern"?{key:"PtFl",descriptor:Mo(e)}:{key:"GdFl",descriptor:Lo(e)}}function Te(e){if("H "in e)return{h:Fs(e["H "]),s:e.Strt,b:e.Brgh};if("Rd "in e)return{r:e["Rd "],g:e["Grn "],b:e["Bl "]};if("Cyn "in e)return{c:e["Cyn "],m:e.Mgnt,y:e["Ylw "],k:e.Blck};if("Gry "in e)return{k:e["Gry "]};if("Lmnc"in e)return{l:e.Lmnc,a:e["A "],b:e["B "]};if("redFloat"in e)return{fr:e.redFloat,fg:e.greenFloat,fb:e.blueFloat};throw new Error("Unsupported color descriptor")}function Oe(e){if(e){if("r"in e)return{_name:"",_classID:"RGBC","Rd ":e.r||0,"Grn ":e.g||0,"Bl ":e.b||0};if("fr"in e)return{_name:"",_classID:"RGBC",redFloat:e.fr,greenFloat:e.fg,blueFloat:e.fb};if("h"in e)return{_name:"",_classID:"HSBC","H ":Bn(e.h*360),Strt:e.s||0,Brgh:e.b||0};if("c"in e)return{_name:"",_classID:"CMYC","Cyn ":e.c||0,Mgnt:e.m||0,"Ylw ":e.y||0,Blck:e.k||0};if("l"in e)return{_name:"",_classID:"LABC",Lmnc:e.l||0,"A ":e.a||0,"B ":e.b||0};if("k"in e)return{_name:"",_classID:"GRYC","Gry ":e.k};throw new Error("Invalid color value")}else return{_name:"",_classID:"RGBC","Rd ":0,"Grn ":0,"Bl ":0}}function ut(e){if(e===void 0)return 0;if(e.units!=="Angle")throw new Error("Invalid units: ".concat(e.units));return e.value}function J(e){if(e===void 0)return 1;if(e.units!=="Percent")throw new Error("Invalid units: ".concat(e.units));return e.value/100}function Fs(e){if(e===void 0)return 1;if(e.units==="Percent")return e.value/100;if(e.units==="Angle")return e.value/360;throw new Error("Invalid units: ".concat(e.units))}function K(e){var t=e.units,n=e.value;if(t!=="Pixels"&&t!=="Millimeters"&&t!=="Points"&&t!=="None"&&t!=="Picas"&&t!=="Inches"&&t!=="Centimeters"&&t!=="Density")throw new Error("Invalid units: ".concat(JSON.stringify({units:t,value:n})));return{value:n,units:t}}function Ke(e,t){return t===void 0&&(t="Pixels"),typeof e=="number"?{value:e,units:t}:K(e)}function Bn(e){return{units:"Angle",value:e||0}}function ae(e){return{units:"Percent",value:Math.round((e||0)*100)}}function xe(e){return{units:"Percent",value:(e||0)*100}}function ee(e,t){if(e==null)return{units:"Pixels",value:0};if(typeof e!="object")throw new Error("Invalid value: ".concat(JSON.stringify(e)," (key: ").concat(t,") (should have value and units)"));var n=e.units,i=e.value;if(typeof i!="number")throw new Error("Invalid value in ".concat(JSON.stringify(e)," (key: ").concat(t,")"));if(n!=="Pixels"&&n!=="Millimeters"&&n!=="Points"&&n!=="None"&&n!=="Picas"&&n!=="Inches"&&n!=="Centimeters"&&n!=="Density")throw new Error("Invalid units in ".concat(JSON.stringify(e)," (key: ").concat(t,")"));return{units:n,value:i}}function he(e){var t=e.numerator,n=e.denominator;return{numerator:t,denominator:n}}var ur=M("textGridding","none",{none:"None",round:"Rnd "}),_n=M("Ornt","horizontal",{horizontal:"Hrzn",vertical:"Vrtc"}),cr=M("Annt","sharp",{none:"Anno",sharp:"antiAliasSharp",crisp:"AnCr",strong:"AnSt",smooth:"AnSm",platform:"antiAliasPlatformGray",platformLCD:"antiAliasPlatformLCD"}),ii=M("warpStyle","none",{none:"warpNone",arc:"warpArc",arcLower:"warpArcLower",arcUpper:"warpArcUpper",arch:"warpArch",bulge:"warpBulge",shellLower:"warpShellLower",shellUpper:"warpShellUpper",flag:"warpFlag",wave:"warpWave",fish:"warpFish",rise:"warpRise",fisheye:"warpFisheye",inflate:"warpInflate",squeeze:"warpSqueeze",twist:"warpTwist",cylinder:"warpCylinder",custom:"warpCustom"}),Ce=M("BlnM","normal",{normal:"Nrml",dissolve:"Dslv",darken:"Drkn",multiply:"Mltp","color burn":"CBrn","linear burn":"linearBurn","darker color":"darkerColor",lighten:"Lghn",screen:"Scrn","color dodge":"CDdg","linear dodge":"linearDodge","lighter color":"lighterColor",overlay:"Ovrl","soft light":"SftL","hard light":"HrdL","vivid light":"vividLight","linear light":"linearLight","pin light":"pinLight","hard mix":"hardMix",difference:"Dfrn",exclusion:"Xclu",subtract:"blendSubtraction",divide:"blendDivide",hue:"H ",saturation:"Strt",color:"Clr ",luminosity:"Lmns","linear height":"linearHeight",height:"Hght",subtraction:"Sbtr"}),Ro=M("BESl","inner bevel",{"inner bevel":"InrB","outer bevel":"OtrB",emboss:"Embs","pillow emboss":"PlEb","stroke emboss":"strokeEmboss"}),Bo=M("bvlT","smooth",{smooth:"SfBL","chisel hard":"PrBL","chisel soft":"Slmt"}),_o=M("BESs","up",{up:"In ",down:"Out "}),zo=M("BETE","softer",{softer:"SfBL",precise:"PrBL"}),No=M("IGSr","edge",{edge:"SrcE",center:"SrcC"}),bt=M("GrdT","linear",{linear:"Lnr ",radial:"Rdl ",angle:"Angl",reflected:"Rflc",diamond:"Dmnd"}),Go=M("animInterpStyle","linear",{linear:"Lnr ",hold:"hold"}),Uo=M("stdTrackID","opacity",{opacity:"opacityTrack",style:"styleTrack",sheetTransform:"sheetTransformTrack",sheetPosition:"sheetPositionTrack",globalLighting:"globalLightingTrack"}),xn=M("gradientInterpolationMethodType","perceptual",{perceptual:"Perc",linear:"Lnr ",classic:"Gcls",smooth:"Smoo"}),ht=M("ClrS","rgb",{rgb:"RGBC",hsb:"HSBl",lab:"LbCl",hsl:"HSLC"}),yt=M("FStl","outside",{outside:"OutF",center:"CtrF",inside:"InsF"}),Vo=M("FrFl","color",{color:"SClr",gradient:"GrFl",pattern:"Ptrn"}),fr=M("ESliceType","image",{image:"Img ",noImage:"noImage"}),dr=M("ESliceHorzAlign","default",{default:"default"}),hr=M("ESliceVertAlign","default",{default:"default"}),pr=M("ESliceOrigin","userGenerated",{userGenerated:"userGenerated",autoGenerated:"autoGenerated",layer:"layer"}),vr=M("ESliceBGColorType","none",{none:"None",matte:"matte",color:"Clr "}),mr=M("strokeStyleLineCapType","butt",{butt:"strokeStyleButtCap",round:"strokeStyleRoundCap",square:"strokeStyleSquareCap"}),gr=M("strokeStyleLineJoinType","miter",{miter:"strokeStyleMiterJoin",round:"strokeStyleRoundJoin",bevel:"strokeStyleBevelJoin"}),br=M("strokeStyleLineAlignment","inside",{inside:"strokeStyleAlignInside",center:"strokeStyleAlignCenter",outside:"strokeStyleAlignOutside"}),jo=M("BlrM","ispinmage",{spin:"Spn ",zoom:"Zm "}),Ho=M("BlrQ","good",{draft:"Drft",good:"Gd ",best:"Bst "}),Wo=M("SmBM","normal",{normal:"SBMN","edge only":"SBME","overlay edge":"SBMO"}),Xo=M("SmBQ","medium",{low:"SBQL",medium:"SBQM",high:"SBQH"}),Zo=M("DspM","stretch to fit",{"stretch to fit":"StrF",tile:"Tile"}),bn=M("UndA","repeat edge pixels",{"wrap around":"WrpA","repeat edge pixels":"RptE"}),Yo=M("Cnvr","rectangular to polar",{"rectangular to polar":"RctP","polar to rectangular":"PlrR"}),Ko=M("RplS","medium",{small:"Sml ",medium:"Mdm ",large:"Lrg "}),$o=M("SphM","normal",{normal:"Nrml","horizontal only":"HrzO","vertical only":"VrtO"}),qo=M("Wvtp","sine",{sine:"WvSn",triangle:"WvTr",square:"WvSq"}),Jo=M("ZZTy","pond ripples",{"around center":"ArnC","out from center":"OtFr","pond ripples":"PndR"}),Qo=M("Dstr","uniform",{uniform:"Unfr",gaussian:"Gsn "}),zn=M("Chnl","composite",{red:"Rd ",green:"Grn ",blue:"Bl ",composite:"Cmps"}),ea=M("MztT","fine dots",{"fine dots":"FnDt","medium dots":"MdmD","grainy dots":"GrnD","coarse dots":"CrsD","short lines":"ShrL","medium lines":"MdmL","long lines":"LngL","short strokes":"ShSt","medium strokes":"MdmS","long strokes":"LngS"}),na=M("Lns ","50-300mm zoom",{"50-300mm zoom":"Zm ","32mm prime":"Nkn ","105mm prime":"Nkn1","movie prime":"PnVs"}),ta=M("blurType","gaussian blur",{"gaussian blur":"GsnB","lens blur":"lensBlur","motion blur":"MtnB"}),ia=M("DfsM","normal",{normal:"Nrml","darken only":"DrkO","lighten only":"LghO",anisotropic:"anisotropic"}),ra=M("ExtT","blocks",{blocks:"Blks",pyramids:"Pyrm"}),oa=M("ExtR","random",{random:"Rndm","level-based":"LvlB"}),aa=M("FlCl","background color",{"background color":"FlBc","foreground color":"FlFr","inverse image":"FlIn","unaltered image":"FlSm"}),la=M("CntE","upper",{lower:"Lwr ",upper:"Upr "}),sa=M("WndM","wind",{wind:"Wnd ",blast:"Blst",stagger:"Stgr"}),ua=M("Drct","from the right",{left:"Left",right:"Rght"}),ca=M("IntE","odd lines",{"odd lines":"ElmO","even lines":"ElmE"}),fa=M("IntC","interpolation",{duplication:"CrtD",interpolation:"CrtI"}),da=M("FlMd","wrap around",{"set to transparent":"Bckg","repeat edge pixels":"Rpt ","wrap around":"Wrp "});M("prjM","fisheye",{fisheye:"fisP",perspective:"perP",auto:"auto","full spherical":"fusP"});var ha=M("presetKindType","presetKindCustom",{custom:"presetKindCustom",default:"presetKindDefault"}),mn=function(){return mn=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},mn.apply(this,arguments)},pa={};function X(e,t,n,i){var r={key:e,has:t,read:n,write:i};pa[r.key]=r}var qn=[void 0,"PPI","PPCM"],Jn=[void 0,"Inches","Centimeters","Points","Picas","Columns"],yr="0123456789abcdef";function Sr(e){return e<=57?e-48:e-87}function xs(e,t){return Sr(e.charCodeAt(t))<<4|Sr(e.charCodeAt(t+1))}function ri(e,t){var n=ce(e,t);return yo(n)}function oi(e,t){var n=bo(t);He(e,n)}function Is(e){for(var t=P(e),n=ce(e,t),i=!1,r=0;r<n.byteLength;r++)if(n[r]&128){i=!0;break}if(i){var o=new TextDecoder("gbk");return o.decode(n)}else return yo(n)}function Cs(e,t){for(var n="",i=0,r=t.codePointAt(i++);r!==void 0;r=t.codePointAt(i++))n+=r>127?"?":String.fromCodePoint(r);var o=bo(n);T(e,o.byteLength),He(e,o)}X(1061,function(e){return e.captionDigest!==void 0},function(e,t){for(var n="",i=0;i<16;i++){var r=P(e);n+=yr[r>>4],n+=yr[r&15]}t.captionDigest=n},function(e,t){for(var n=0;n<16;n++)T(e,xs(t.captionDigest,n*2))});X(1060,function(e){return e.xmpMetadata!==void 0},function(e,t,n){t.xmpMetadata=ri(e,n())},function(e,t){oi(e,t.xmpMetadata)});var Qn=M("Inte","perceptual",{perceptual:"Img ",saturation:"Grp ","relative colorimetric":"Clrm","absolute colorimetric":"AClr"});X(1082,function(e){return e.printInformation!==void 0},function(e,t){var n,i,r=V(e);t.printInformation={printerName:r.printerName||"",renderingIntent:Qn.decode((n=r.Inte)!==null&&n!==void 0?n:"Inte.Img ")};var o=t.printInformation;r.PstS!==void 0&&(o.printerManagesColors=r.PstS),r["Nm "]!==void 0&&(o.printerProfile=r["Nm "]),r.MpBl!==void 0&&(o.blackPointCompensation=r.MpBl),r.printSixteenBit!==void 0&&(o.printSixteenBit=r.printSixteenBit),r.hardProof!==void 0&&(o.hardProof=r.hardProof),r.printProofSetup&&("Bltn"in r.printProofSetup?o.proofSetup={builtin:r.printProofSetup.Bltn.split(".")[1]}:o.proofSetup={profile:r.printProofSetup.profile,renderingIntent:Qn.decode((i=r.printProofSetup.Inte)!==null&&i!==void 0?i:"Inte.Img "),blackPointCompensation:!!r.printProofSetup.MpBl,paperWhite:!!r.printProofSetup.paperWhite})},function(e,t){var n,i,r=t.printInformation,o={};r.printerManagesColors?o.PstS=!0:(r.hardProof!==void 0&&(o.hardProof=!!r.hardProof),o.ClrS="ClrS.RGBC",o["Nm "]=(n=r.printerProfile)!==null&&n!==void 0?n:"CIE RGB"),o.Inte=Qn.encode(r.renderingIntent),r.printerManagesColors||(o.MpBl=!!r.blackPointCompensation),o.printSixteenBit=!!r.printSixteenBit,o.printerName=r.printerName||"",r.proofSetup&&"profile"in r.proofSetup?o.printProofSetup={profile:r.proofSetup.profile||"",Inte:Qn.encode(r.proofSetup.renderingIntent),MpBl:!!r.proofSetup.blackPointCompensation,paperWhite:!!r.proofSetup.paperWhite}:o.printProofSetup={Bltn:!((i=r.proofSetup)===null||i===void 0)&&i.builtin?"builtinProof.".concat(r.proofSetup.builtin):"builtinProof.proofCMYK"},j(e,"","printOutput",o)});X(1005,function(e){return e.resolutionInfo!==void 0},function(e,t){var n=ge(e),i=I(e),r=I(e),o=ge(e),a=I(e),l=I(e);t.resolutionInfo={horizontalResolution:n,horizontalResolutionUnit:qn[i]||"PPI",widthUnit:Jn[r]||"Inches",verticalResolution:o,verticalResolutionUnit:qn[a]||"PPI",heightUnit:Jn[l]||"Inches"}},function(e,t){var n=t.resolutionInfo;ye(e,n.horizontalResolution||0),x(e,Math.max(1,qn.indexOf(n.horizontalResolutionUnit))),x(e,Math.max(1,Jn.indexOf(n.widthUnit))),ye(e,n.verticalResolution||0),x(e,Math.max(1,qn.indexOf(n.verticalResolutionUnit))),x(e,Math.max(1,Jn.indexOf(n.heightUnit)))});var Fr=["centered","size to fit","user defined"];X(1062,function(e){return e.printScale!==void 0},function(e,t){t.printScale={style:Fr[H(e)],x:we(e),y:we(e),scale:we(e)}},function(e,t){var n=t.printScale,i=n.style,r=n.x,o=n.y,a=n.scale;Y(e,Math.max(0,Fr.indexOf(i))),Ee(e,r||0),Ee(e,o||0),Ee(e,a||0)});X(1006,function(e){return e.alphaChannelNames!==void 0},function(e,t,n){if(t.alphaChannelNames)w(e,n());else for(t.alphaChannelNames=[];n()>0;){var i=Is(e);t.alphaChannelNames.push(i)}},function(e,t){for(var n=0,i=t.alphaChannelNames;n<i.length;n++){var r=i[n];Cs(e,r)}});X(1045,function(e){return e.alphaChannelNames!==void 0},function(e,t,n){for(t.alphaChannelNames=[];n()>0;)t.alphaChannelNames.push(se(e))},function(e,t){for(var n=0,i=t.alphaChannelNames;n<i.length;n++){var r=i[n];on(e,r)}});X(1053,function(e){return e.alphaIdentifiers!==void 0},function(e,t,n){for(t.alphaIdentifiers=[];n()>=4;)t.alphaIdentifiers.push(C(e))},function(e,t){for(var n=0,i=t.alphaIdentifiers;n<i.length;n++){var r=i[n];D(e,r)}});X(1010,function(e){return e.backgroundColor!==void 0},function(e,t){return t.backgroundColor=oe(e)},function(e,t){return le(e,t.backgroundColor)});X(1037,function(e){return e.globalAngle!==void 0},function(e,t){return t.globalAngle=O(e)},function(e,t){return U(e,t.globalAngle)});X(1049,function(e){return e.globalAltitude!==void 0},function(e,t){return t.globalAltitude=C(e)},function(e,t){return D(e,t.globalAltitude)});X(1011,function(e){return e.printFlags!==void 0},function(e,t){t.printFlags={labels:!!P(e),cropMarks:!!P(e),colorBars:!!P(e),registrationMarks:!!P(e),negative:!!P(e),flip:!!P(e),interpolate:!!P(e),caption:!!P(e),printFlags:!!P(e)}},function(e,t){var n=t.printFlags;T(e,n.labels?1:0),T(e,n.cropMarks?1:0),T(e,n.colorBars?1:0),T(e,n.registrationMarks?1:0),T(e,n.negative?1:0),T(e,n.flip?1:0),T(e,n.interpolate?1:0),T(e,n.caption?1:0),T(e,n.printFlags?1:0)});X(1034,function(e){return e.copyrighted!==void 0},function(e,t){t.copyrighted=!!P(e)},function(e,t){T(e,t.copyrighted?1:0)});X(1035,function(e){return e.url!==void 0},function(e,t,n){t.url=St(e,n())},function(e,t){pu(e,t.url)});X(1080,function(e){return e.countInformation!==void 0},function(e,t){var n=V(e);t.countInformation=n.countGroupList.map(function(i){return{color:{r:i["Rd "],g:i["Grn "],b:i["Bl "]},name:i["Nm "],size:i["Rds "],fontSize:i.fontSize,visible:i.Vsbl,points:i.countObjectList.map(function(r){return{x:r["X "],y:r["Y "]}})}})},function(e,t){var n={Vrsn:1,countGroupList:t.countInformation.map(function(i){return{"Rd ":i.color.r,"Grn ":i.color.g,"Bl ":i.color.b,"Nm ":i.name,"Rds ":i.size,fontSize:i.fontSize,Vsbl:i.visible,countObjectList:i.points.map(function(r){return{"X ":r.x,"Y ":r.y}})}})};j(e,"","Cnt ",n)});X(1024,function(e){return e.layerState!==void 0},function(e,t){return t.layerState=I(e)},function(e,t){return x(e,t.layerState)});X(1026,function(e){return e.layersGroup!==void 0},function(e,t,n){for(t.layersGroup=[];n()>0;)t.layersGroup.push(I(e))},function(e,t){for(var n=0,i=t.layersGroup;n<i.length;n++){var r=i[n];x(e,r)}});X(1072,function(e){return e.layerGroupsEnabledId!==void 0},function(e,t,n){for(t.layerGroupsEnabledId=[];n()>0;)t.layerGroupsEnabledId.push(P(e))},function(e,t){for(var n=0,i=t.layerGroupsEnabledId;n<i.length;n++){var r=i[n];T(e,r)}});X(1069,function(e){return e.layerSelectionIds!==void 0},function(e,t){var n=I(e);for(t.layerSelectionIds=[];n--;)t.layerSelectionIds.push(C(e))},function(e,t){x(e,t.layerSelectionIds.length);for(var n=0,i=t.layerSelectionIds;n<i.length;n++){var r=i[n];D(e,r)}});X(1032,function(e){return e.gridAndGuidesInformation!==void 0},function(e,t){var n=C(e),i=C(e),r=C(e),o=C(e);if(n!==1)throw new Error("Invalid 1032 resource version: ".concat(n));t.gridAndGuidesInformation={grid:{horizontal:i,vertical:r},guides:[]};for(var a=0;a<o;a++)t.gridAndGuidesInformation.guides.push({location:C(e)/32,direction:P(e)?"horizontal":"vertical"})},function(e,t){var n=t.gridAndGuidesInformation,i=n.grid||{horizontal:18*32,vertical:18*32},r=n.guides||[];D(e,1),D(e,i.horizontal),D(e,i.vertical),D(e,r.length);for(var o=0,a=r;o<a.length;o++){var l=a[o];D(e,l.location*32),T(e,l.direction==="horizontal"?1:0)}});X(1065,function(e){return e.layerComps!==void 0},function(e,t){var n=V(e,!0);t.layerComps={list:[]};for(var i=0,r=n.list;i<r.length;i++){var o=r[i];t.layerComps.list.push({id:o.compID,name:o["Nm "],capturedInfo:o.capturedInfo}),"comment"in o&&(t.layerComps.list[t.layerComps.list.length-1].comment=o.comment)}"lastAppliedComp"in n&&(t.layerComps.lastApplied=n.lastAppliedComp)},function(e,t){for(var n=t.layerComps,i={list:[]},r=0,o=n.list;r<o.length;r++){var a=o[r],l={};l._classID="Comp",l["Nm "]=a.name,"comment"in a&&(l.comment=a.comment),l.compID=a.id,l.capturedInfo=a.capturedInfo,i.list.push(l)}"lastApplied"in n&&(i.lastAppliedComp=n.lastApplied),j(e,"","CompList",i)});var xr=["normal",void 0,void 0,void 0,void 0,void 0,void 0,"multiply","screen",void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,"difference"];X(1078,function(e){return e.onionSkins!==void 0},function(e,t){var n=V(e);t.onionSkins={enabled:n.enab,framesBefore:n.numBefore,framesAfter:n.numAfter,frameSpacing:n.Spcn,minOpacity:n.minOpacity/100,maxOpacity:n.maxOpacity/100,blendMode:xr[n.BlnM]||"normal"}},function(e,t){var n=t.onionSkins,i={Vrsn:1,enab:n.enabled,numBefore:n.framesBefore,numAfter:n.framesAfter,Spcn:n.frameSpacing,minOpacity:n.minOpacity*100|0,maxOpacity:n.maxOpacity*100|0,BlnM:Math.max(0,xr.indexOf(n.blendMode))};j(e,"","null",i)});X(1075,function(e){return e.timelineInformation!==void 0},function(e,t){var n,i,r=V(e);t.timelineInformation={enabled:r.enab,frameStep:he(r.frameStep),frameRate:r.frameRate,time:he(r.time),duration:he(r.duration),workInTime:he(r.workInTime),workOutTime:he(r.workOutTime),repeats:r.LCnt,hasMotion:r.hasMotion,globalTracks:Po(r.globalTrackList,!!e.logMissingFeatures)},!((i=(n=r.audioClipGroupList)===null||n===void 0?void 0:n.audioClipGroupList)===null||i===void 0)&&i.length&&(t.timelineInformation.audioClipGroups=r.audioClipGroupList.audioClipGroupList.map(function(o){return{id:o.groupID,muted:o.muted,audioClips:o.audioClipList.map(function(a){var l=a.clipID,u=a.timeScope,s=a.muted,c=a.audioLevel,d=a.frameReader;return{id:l,start:he(u.Strt),duration:he(u.duration),inTime:he(u.inTime),outTime:he(u.outTime),muted:s,audioLevel:c,frameReader:{type:d.frameReaderType,mediaDescriptor:d.mediaDescriptor,link:{name:d["Lnk "]["Nm "],fullPath:d["Lnk "].fullPath,relativePath:d["Lnk "].relPath}}}})}}))},function(e,t){var n,i=t.timelineInformation,r={Vrsn:1,enab:i.enabled,frameStep:i.frameStep,frameRate:i.frameRate,time:i.time,duration:i.duration,workInTime:i.workInTime,workOutTime:i.workOutTime,LCnt:i.repeats,globalTrackList:Ao(i.globalTracks),audioClipGroupList:{audioClipGroupList:(n=i.audioClipGroups)===null||n===void 0?void 0:n.map(function(o){return{groupID:o.id,muted:o.muted,audioClipList:o.audioClips.map(function(a){return{clipID:a.id,timeScope:{Vrsn:1,Strt:a.start,duration:a.duration,inTime:a.inTime,outTime:a.outTime},frameReader:{frameReaderType:a.frameReader.type,descVersion:1,"Lnk ":{descVersion:1,"Nm ":a.frameReader.link.name,fullPath:a.frameReader.link.fullPath,relPath:a.frameReader.link.relativePath},mediaDescriptor:a.frameReader.mediaDescriptor},muted:a.muted,audioLevel:a.audioLevel}})}})},hasMotion:i.hasMotion};j(e,"","null",r,"anim")});X(1076,function(e){return e.sheetDisclosure!==void 0},function(e,t){var n=V(e);t.sheetDisclosure={},n.sheetTimelineOptions&&(t.sheetDisclosure.sheetTimelineOptions=n.sheetTimelineOptions.map(function(i){return{sheetID:i.sheetID,sheetDisclosed:i.sheetDisclosed,lightsDisclosed:i.lightsDisclosed,meshesDisclosed:i.meshesDisclosed,materialsDisclosed:i.materialsDisclosed}}))},function(e,t){var n=t.sheetDisclosure,i={Vrsn:1};n.sheetTimelineOptions&&(i.sheetTimelineOptions=n.sheetTimelineOptions.map(function(r){return{Vrsn:2,sheetID:r.sheetID,sheetDisclosed:r.sheetDisclosed,lightsDisclosed:r.lightsDisclosed,meshesDisclosed:r.meshesDisclosed,materialsDisclosed:r.materialsDisclosed}})),j(e,"","null",i)});X(1054,function(e){return e.urlsList!==void 0},function(e,t){var n=C(e);t.urlsList=[];for(var i=0;i<n;i++){var r=Q(e);if(r!=="slic"&&e.throwForMissingFeatures)throw new Error("Unknown long");var o=C(e),a=se(e);t.urlsList.push({id:o,url:a,ref:"slice"})}},function(e,t){var n=t.urlsList;D(e,n.length);for(var i=0;i<n.length;i++)_(e,"slic"),D(e,n[i].id),Se(e,n[i].url)});function Ir(e){return{"Top ":e.top,Left:e.left,Btom:e.bottom,Rght:e.right}}function Cr(e){return{top:e["Top "],left:e.Left,bottom:e.Btom,right:e.Rght}}function et(e,t){return e[Math.max(0,Math.min(e.length-1,t))]}var kr=["autoGenerated","layer","userGenerated"],Dr=["noImage","image"],nt=["default"];X(1050,function(e){return e.slices?e.slices.length:0},function(e,t){var n=C(e);if(n===6){t.slices||(t.slices=[]);var i=O(e),r=O(e),o=O(e),a=O(e),l=se(e),u=C(e);t.slices.push({bounds:{top:i,left:r,bottom:o,right:a},groupName:l,slices:[]});for(var s=t.slices[t.slices.length-1].slices,c=0;c<u;c++){var d=C(e),p=C(e),h=et(kr,C(e)),g=h=="layer"?C(e):0,v=se(e),F=et(Dr,C(e)),y=O(e),m=O(e),b=O(e),S=O(e),E=se(e),G=se(e),A=se(e),R=se(e),N=!!P(e),B=se(e),z=et(nt,C(e)),re=et(nt,C(e)),de=P(e),te=P(e),ue=P(e),Xe=P(e),Je=de+te+ue+Xe===0?"none":de===0?"matte":"color";s.push({id:d,groupId:p,origin:h,associatedLayerId:g,name:v,target:G,message:A,altTag:R,cellTextIsHTML:N,cellText:B,horizontalAlignment:z,verticalAlignment:re,type:F,url:E,bounds:{top:m,left:y,bottom:S,right:b},backgroundColorType:Je,backgroundColor:{r:te,g:ue,b:Xe,a:de}})}var pe=V(e);pe.slices.forEach(function(Ze){var Z=s.find(function(ln){return Ze.sliceID==ln.id});Z&&(Z.topOutset=Ze.topOutset,Z.leftOutset=Ze.leftOutset,Z.bottomOutset=Ze.bottomOutset,Z.rightOutset=Ze.rightOutset)})}else if(n===7||n===8){var pe=V(e);t.slices||(t.slices=[]),t.slices.push({groupName:pe.baseName,bounds:Cr(pe.bounds),slices:pe.slices.map(function(Z){return mn(mn({},Z["Nm "]?{name:Z["Nm "]}:{}),{id:Z.sliceID,groupId:Z.groupID,associatedLayerId:0,origin:pr.decode(Z.origin),type:fr.decode(Z.Type),bounds:Cr(Z.bounds),url:Z.url,target:Z.null,message:Z.Msge,altTag:Z.altTag,cellTextIsHTML:Z.cellTextIsHTML,cellText:Z.cellText,horizontalAlignment:dr.decode(Z.horzAlign),verticalAlignment:hr.decode(Z.vertAlign),backgroundColorType:vr.decode(Z.bgColorType),backgroundColor:Z.bgColor?{r:Z.bgColor["Rd "],g:Z.bgColor["Grn "],b:Z.bgColor["Bl "],a:Z.bgColor.alpha}:{r:0,g:0,b:0,a:0},topOutset:Z.topOutset||0,leftOutset:Z.leftOutset||0,bottomOutset:Z.bottomOutset||0,rightOutset:Z.rightOutset||0})})})}else throw new Error("Invalid slices version (".concat(n,")"))},function(e,t,n){var i=t.slices[n],r=i.bounds,o=i.groupName,a=i.slices;D(e,6),U(e,r.top),U(e,r.left),U(e,r.bottom),U(e,r.right),Se(e,o),D(e,a.length);for(var l=0;l<a.length;l++){var u=a[l],s=u.backgroundColor,c=s.a,d=s.r,p=s.g,h=s.b;u.backgroundColorType==="none"?c=d=p=h=0:u.backgroundColorType==="matte"&&(c=0,d=p=h=255),D(e,u.id),D(e,u.groupId),D(e,kr.indexOf(u.origin)),u.origin==="layer"&&D(e,u.associatedLayerId),Se(e,u.name||""),D(e,Dr.indexOf(u.type)),U(e,u.bounds.left),U(e,u.bounds.top),U(e,u.bounds.right),U(e,u.bounds.bottom),Se(e,u.url),Se(e,u.target),Se(e,u.message),Se(e,u.altTag),T(e,u.cellTextIsHTML?1:0),Se(e,u.cellText),D(e,nt.indexOf(u.horizontalAlignment)),D(e,nt.indexOf(u.verticalAlignment)),T(e,c),T(e,d),T(e,p),T(e,h)}var g={bounds:Ir(r),slices:[]};a.forEach(function(v){var F=mn(mn({sliceID:v.id,groupID:v.groupId,origin:pr.encode(v.origin),Type:fr.encode(v.type),bounds:Ir(v.bounds)},v.name?{"Nm ":v.name}:{}),{url:v.url,null:v.target,Msge:v.message,altTag:v.altTag,cellTextIsHTML:v.cellTextIsHTML,cellText:v.cellText,horzAlign:dr.encode(v.horizontalAlignment),vertAlign:hr.encode(v.verticalAlignment),bgColorType:vr.encode(v.backgroundColorType)});if(v.backgroundColorType==="color"){var y=v.backgroundColor,m=y.r,b=y.g,S=y.b,E=y.a;F.bgColor={"Rd ":m,"Grn ":b,"Bl ":S,alpha:E}}F.topOutset=v.topOutset||0,F.leftOutset=v.leftOutset||0,F.bottomOutset=v.bottomOutset||0,F.rightOutset=v.rightOutset||0,g.slices.push(F)}),j(e,"","null",g,"slices")});X(1064,function(e){return e.pixelAspectRatio!==void 0},function(e,t){if(C(e)>2)throw new Error("Invalid pixelAspectRatio version");t.pixelAspectRatio={aspect:ke(e)}},function(e,t){D(e,2),Be(e,t.pixelAspectRatio.aspect)});X(1041,function(e){return e.iccUntaggedProfile!==void 0},function(e,t){t.iccUntaggedProfile=!!P(e)},function(e,t){T(e,t.iccUntaggedProfile?1:0)});X(1044,function(e){return e.idsSeedNumber!==void 0},function(e,t){return t.idsSeedNumber=C(e)},function(e,t){return D(e,t.idsSeedNumber)});X(1036,function(e){return e.thumbnail!==void 0||e.thumbnailRaw!==void 0},function(e,t,n){var i=C(e),r=C(e),o=C(e);C(e),C(e),C(e);var a=I(e),l=I(e);if(i!==1||a!==24||l!==1){e.logMissingFeatures&&e.log("Invalid thumbnail data (format: ".concat(i,", bitsPerPixel: ").concat(a,", planes: ").concat(l,")")),w(e,n());return}var u=n(),s=ce(e,u);e.useRawThumbnail?t.thumbnailRaw={width:r,height:o,data:s}:s.byteLength&&(t.thumbnail=go(s))},function(e,t){var n,i=0,r=0,o=new Uint8Array(0);if(t.thumbnailRaw)i=t.thumbnailRaw.width,r=t.thumbnailRaw.height,o=t.thumbnailRaw.data;else try{var a=(n=t.thumbnail.toDataURL("image/jpeg",1))===null||n===void 0?void 0:n.substring(23);a&&(o=Kr(a),i=t.thumbnail.width,r=t.thumbnail.height)}catch{}var l=24,u=Math.floor((i*l+31)/32)*4,s=1,c=u*r*s,d=o.length;D(e,1),D(e,i),D(e,r),D(e,u),D(e,c),D(e,d),x(e,l),x(e,s),He(e,o)});X(1057,function(e){return e.versionInfo!==void 0},function(e,t,n){var i=C(e);if(i!==1)throw new Error("Invalid versionInfo version");t.versionInfo={hasRealMergedData:!!P(e),writerName:se(e),readerName:se(e),fileVersion:C(e)},w(e,n())},function(e,t){var n=t.versionInfo;D(e,1),T(e,n.hasRealMergedData?1:0),Se(e,n.writerName),Se(e,n.readerName),D(e,n.fileVersion)});X(7e3,function(e){return e.imageReadyVariables!==void 0},function(e,t,n){t.imageReadyVariables=ri(e,n())},function(e,t){oi(e,t.imageReadyVariables)});X(7001,function(e){return e.imageReadyDataSets!==void 0},function(e,t,n){t.imageReadyDataSets=ri(e,n())},function(e,t){oi(e,t.imageReadyDataSets)});X(1088,function(e){return e.pathSelectionState!==void 0},function(e,t,n){var i=V(e);t.pathSelectionState=i.null},function(e,t){var n={null:t.pathSelectionState};j(e,"","null",n)});var Pr=M("FrmD","",{auto:"Auto",none:"None",dispose:"Disp"});X(4e3,function(e){return e.animations!==void 0},function(e,t,n){var i=Q(e);if(i==="mani")qe(e,"IRFR"),Fe(e,1,function(o){for(var a=function(){qe(e,"8BIM");var l=Q(e);Fe(e,1,function(u){if(l==="AnDs"){var s=V(e);t.animations={frames:s.FrIn.map(function(d){return{id:d.FrID,delay:(d.FrDl||0)/100,dispose:d.FrDs?Pr.decode(d.FrDs):"auto"}}),animations:s.FSts.map(function(d){return{id:d.FsID,frames:d.FsFr,repeats:d.LCnt,activeFrame:d.AFrm||0}})}}else if(l==="Roll"){var c=ce(e,u());e.logDevFeatures&&e.log("#4000 Roll",c)}else e.logMissingFeatures&&e.log("Unhandled subsection in #4000",l)})};o()>0;)a()});else if(i==="mopt"){var r=ce(e,n());e.logDevFeatures&&e.log("#4000 mopt",r)}else e.logMissingFeatures&&e.log("Unhandled key in #4000:",i)},function(e,t){t.animations&&(_(e,"mani"),_(e,"IRFR"),tn(e,1,function(){_(e,"8BIM"),_(e,"AnDs"),tn(e,1,function(){for(var n={FrIn:[],FSts:[]},i=0;i<t.animations.frames.length;i++){var r=t.animations.frames[i],o={FrID:r.id};r.delay&&(o.FrDl=r.delay*100|0),o.FrDs=Pr.encode(r.dispose),n.FrIn.push(o)}for(var i=0;i<t.animations.animations.length;i++){var a=t.animations.animations[i],l={FsID:a.id,AFrm:a.activeFrame|0,FsFr:a.frames,LCnt:a.repeats|0};n.FSts.push(l)}j(e,"","null",n)})}))});var ks=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]]);return n},va=[0,1,3,2],Ds=["bitmap","grayscale","indexed","RGB","CMYK","multichannel","duotone","lab"];function $t(e){for(var t=e.width*e.height*4,n=0;n<t;n+=4){var i=e.data[n];e.data[n+1]=i,e.data[n+2]=i}}function Ar(e,t,n){var i=new DataView(e,t,n);return{view:i,offset:0,strict:!1,debug:!1,large:!1,globalAlpha:!1,log:console.log}}function qt(e,t){if(e.strict)throw new Error(t);e.debug&&e.log(t)}function P(e){return e.offset+=1,e.view.getUint8(e.offset-1)}function Ps(e){return e.view.getUint8(e.offset)}function H(e){return e.offset+=2,e.view.getInt16(e.offset-2,!1)}function I(e){return e.offset+=2,e.view.getUint16(e.offset-2,!1)}function As(e){return e.offset+=2,e.view.getUint16(e.offset-2,!0)}function O(e){return e.offset+=4,e.view.getInt32(e.offset-4,!1)}function wr(e){return e.offset+=4,e.view.getInt32(e.offset-4,!0)}function C(e){return e.offset+=4,e.view.getUint32(e.offset-4,!1)}function we(e){return e.offset+=4,e.view.getFloat32(e.offset-4,!1)}function ke(e){return e.offset+=8,e.view.getFloat64(e.offset-8,!1)}function ge(e){return O(e)/65536}function Pe(e){return O(e)/(1<<24)}function ce(e,t){var n=e.view.byteOffset+e.offset;if(e.offset+=t,n+t>e.view.buffer.byteLength){if(qt(e,"Reading bytes exceeding buffer length"),t>100*1024*1024)throw new Error("Reading past end of file");var i=new Uint8Array(t),r=Math.min(t,e.view.byteLength-n);return r>0&&i.set(new Uint8Array(e.view.buffer,n,r)),i}else return new Uint8Array(e.view.buffer,n,t)}function Q(e){return ma(e,4)}function ws(e,t){var n=String.fromCharCode(e.view.getUint8(t))+String.fromCharCode(e.view.getUint8(t+1))+String.fromCharCode(e.view.getUint8(t+2))+String.fromCharCode(e.view.getUint8(t+3));return n=="8BIM"||n=="8B64"}function $e(e,t){for(var n=P(e),i=n?ma(e,n):"";++n%t;)e.offset++;return i}function se(e){var t=C(e);return ai(e,t)}function ai(e,t){for(var n="";t--;){var i=I(e);(i||t>0)&&(n+=String.fromCharCode(i))}return n}function Es(e,t){for(var n="";t--;){var i=As(e);(i||t>0)&&(n+=String.fromCharCode(i))}return n}function St(e,t){for(var n="";t--;)n+=String.fromCharCode(P(e));return n}function w(e,t){e.offset+=t}function qe(e,t,n){var i=e.offset,r=Q(e);if(r!==t&&r!==n)throw new Error("Invalid signature: '".concat(r,"' at 0x").concat(i.toString(16)))}function ma(e,t){for(var n=ce(e,t),i="",r=0;r<n.length;r++)i+=String.fromCharCode(n[r]);return i}function Ts(e){return e==="8BIM"||e==="MeSa"||e==="AgHg"||e==="PHUT"||e==="DCSR"}function Os(e,t){var n;t===void 0&&(t={}),qe(e,"8BPS");var i=I(e);if(i!==1&&i!==2)throw new Error("Invalid PSD file version: ".concat(i));w(e,6);var r=I(e),o=C(e),a=C(e),l=I(e),u=I(e),s=i===1?3e4:3e5;if(a>s||o>s)throw new Error("Invalid size: ".concat(a,"x").concat(o));if(r>16)throw new Error("Invalid channel count: ".concat(r));if(![1,8,16,32].includes(l))throw new Error("Invalid bitsPerChannel: ".concat(l));if(va.indexOf(u)===-1)throw new Error("Color mode not supported: ".concat((n=Ds[u])!==null&&n!==void 0?n:u));var c={width:a,height:o,channels:r,bitsPerChannel:l,colorMode:u};Object.assign(e,t),e.large=i===2,e.globalAlpha=!1,Fe(e,1,function(v){if(v()){if(u===2){if(v()!=768)throw new Error("Invalid color palette size");c.palette=[];for(var F=0;F<256;F++)c.palette.push({r:P(e),g:0,b:0});for(var F=0;F<256;F++)c.palette[F].g=P(e);for(var F=0;F<256;F++)c.palette[F].b=P(e)}w(e,v())}});var d={};Fe(e,1,function(v){for(var F=function(){ga(e,Ts);var y=I(e);$e(e,2),Fe(e,2,function(m){var b=pa[y],S=y===1036&&!!e.skipThumbnail;if(b&&!S)try{b.read(e,d,m)}catch(E){if(e.throwForMissingFeatures)throw E;w(e,m())}else w(e,m())})};v()>0;)F()}),d.layersGroup,d.layerGroupsEnabledId;var p=ks(d,["layersGroup","layerGroupsEnabledId"]);Object.keys(p)&&(c.imageResources=p),Fe(e,1,function(v){if(Fe(e,2,function(y){li(e,c,d),w(e,y())},void 0,e.large),v()>0){var F=_s(e);F&&(c.globalLayerMaskInfo=F)}else w(e,v());for(;v()>0;){for(;v()&&Ps(e)===0;)w(e,1);v()>=12?ba(e,c,c,d):w(e,v())}},void 0,e.large);var h=c.children&&c.children.length,g=e.skipCompositeImageData&&(e.skipLayerImageData||h);return g||Gs(e,c),c}function li(e,t,n){var i,r,o=n.layersGroup,a=o===void 0?[]:o,l=n.layerGroupsEnabledId,u=l===void 0?[]:l,s=H(e);s<0&&(e.globalAlpha=!0,s=-s);for(var c=[],d=[],p=0;p<s;p++){var h=Ls(e,t,n),g=h.layer,v=h.channels;a[p]!==void 0&&(g.linkGroup=a[p]),u[p]!==void 0&&(g.linkGroupEnabled=!!u[p]),c.push(g),d.push(v)}if(!e.skipLayerImageData)for(var p=0;p<s;p++)Bs(e,t,c[p],d[p]);t.children||(t.children=[]);for(var F=[t],p=c.length-1;p>=0;p--){var y=c[p],m=y.sectionDivider?y.sectionDivider.type:0;m===1||m===2?(y.opened=m===1,y.children=[],!((i=y.sectionDivider)===null||i===void 0)&&i.key&&(y.blendMode=(r=Sn[y.sectionDivider.key])!==null&&r!==void 0?r:y.blendMode),F[F.length-1].children.unshift(y),F.push(y)):m===3?F.pop():F[F.length-1].children.unshift(y)}}function Ls(e,t,n){var i={};i.top=O(e),i.left=O(e),i.bottom=O(e),i.right=O(e);for(var r=I(e),o=[],a=0;a<r;a++){var l=H(e),u=C(e);if(e.large){if(u!==0)throw new Error("Sizes larger than 4GB are not supported");u=C(e)}o.push({id:l,length:u})}qe(e,"8BIM");var s=Q(e);if(!Sn[s])throw new Error("Invalid blend mode: '".concat(s,"'"));i.blendMode=Sn[s],i.opacity=P(e)/255,i.clipping=P(e)===1;var c=P(e);return i.transparencyProtected=(c&1)!==0,i.hidden=(c&2)!==0,c&32&&(i.effectsOpen=!0),w(e,1),Fe(e,1,function(d){Ms(e,i);var p=Rs(e);for(p&&(i.blendingRanges=p),i.name=$e(e,1);d()>4&&!ws(e,e.offset);)e.offset++;for(;d()>=12;)ba(e,i,t,n);w(e,d())}),{layer:i,channels:o}}function Ms(e,t){return Fe(e,1,function(n){if(n()){var i={};t.mask=i,i.top=O(e),i.left=O(e),i.bottom=O(e),i.right=O(e),i.defaultColor=P(e);var r=P(e);if(i.positionRelativeToLayer=(r&1)!==0,i.disabled=(r&2)!==0,i.fromVectorData=(r&8)!==0,n()>=18){var o={};t.realMask=o;var a=P(e);o.positionRelativeToLayer=(a&1)!==0,o.disabled=(a&2)!==0,o.fromVectorData=(a&8)!==0,o.defaultColor=P(e),o.top=O(e),o.left=O(e),o.bottom=O(e),o.right=O(e)}if(r&16){var l=P(e);l&1&&(i.userMaskDensity=P(e)/255),l&2&&(i.userMaskFeather=ke(e)),l&4&&(i.vectorMaskDensity=P(e)/255),l&8&&(i.vectorMaskFeather=ke(e))}w(e,n())}})}function tt(e){return[P(e),P(e),P(e),P(e)]}function Rs(e){return Fe(e,1,function(t){for(var n=tt(e),i=tt(e),r=[];t()>0;){var o=tt(e),a=tt(e);r.push({sourceRange:o,destRange:a})}return{compositeGrayBlendSource:n,compositeGraphBlendDestinationRange:i,ranges:r}})}function Bs(e,t,n,i){var r,o,a,l,u=(n.right||0)-(n.left||0),s=(n.bottom||0)-(n.top||0),c=t.colorMode===4,d;if(u&&s)if(c){if(t.bitsPerChannel!==8)throw new Error("bitsPerChannel Not supproted");d={width:u,height:s,data:new Uint8ClampedArray(u*s*5)};for(var p=4;p<d.data.byteLength;p+=5)d.data[p]=255}else d=Jt(u,s,(r=t.bitsPerChannel)!==null&&r!==void 0?r:8),Zt(d);for(var h=0,g=i;h<g.length;h++){var v=g[h];if(v.length!==0){if(v.length<2)throw new Error("Invalid channel length");var F=e.offset,y=I(e);if(y>3&&(e.offset-=1,y=I(e)),y>3&&(e.offset-=3,y=I(e)),y>3)throw new Error("Invalid compression: ".concat(y));if(v.id===-2||v.id===-3){var m=v.id===-2?n.mask:n.realMask;if(!m)throw new Error("Missing layer ".concat(v.id===-2?"mask":"real mask"," data"));var b=(m.right||0)-(m.left||0),S=(m.bottom||0)-(m.top||0);if(b<0||S<0||b>3e4||S>3e4)throw new Error("Invalid mask size");if(b&&S){var E=Jt(b,S,(o=t.bitsPerChannel)!==null&&o!==void 0?o:8);Zt(E),e.offset,Er(e,v.length,E,y,b,S,(a=t.bitsPerChannel)!==null&&a!==void 0?a:8,0,e.large,4),$t(E),e.useImageData?m.imageData=E:m.canvas=Yt(E)}}else{var G=cs(v.id,c),A=d;if(G<0&&(A=void 0,e.throwForMissingFeatures))throw new Error("Channel not supported: ".concat(v.id));Er(e,v.length,A,y,u,s,(l=t.bitsPerChannel)!==null&&l!==void 0?l:8,G,e.large,c?5:4),e.offset=F+v.length,A&&t.colorMode===1&&$t(A)}}}if(d){if(c){var R=d;d=ti(R.width,R.height),ya(R,d,!1)}e.useImageData?n.imageData=d:n.canvas=Yt(d)}}function Er(e,t,n,i,r,o,a,l,u,s){if(i===0)Fa(e,n,r,o,a,s,l);else if(i===1)Tn(e,n,r,o,a,s,[l],u);else if(i===2)Tr(e,t,n,r,o,a,s,l,!1);else if(i===3)Tr(e,t,n,r,o,a,s,l,!0);else throw new Error("Invalid Compression type: ".concat(i))}function _s(e){return Fe(e,1,function(t){if(t()){var n=I(e),i=I(e),r=I(e),o=I(e),a=I(e),l=I(e)/255,u=P(e);return w(e,t()),{overlayColorSpace:n,colorSpace1:i,colorSpace2:r,colorSpace3:o,colorSpace4:a,opacity:l,kind:u}}})}var zs=[0,1,-1,2,-2,3,-3,4,-4];function ga(e,t){for(var n=e.offset,i="",r=0,o=zs;r<o.length;r++){var a=o[r];try{e.offset=n+a,i=Q(e)}catch{}if(t(i))break}if(!t(i))throw new Error("Invalid signature: '".concat(i,"' at 0x").concat(n.toString(16)));return i}function Ns(e){return e==="8BIM"||e==="8B64"}function ba(e,t,n,i){var r=ga(e,Ns),o=Q(e),a=r==="8B64"||e.large&&ss.indexOf(o)!==-1;Fe(e,2,function(l){var u=pt[o];if(u)try{u.read(e,t,l,n,i)}catch(s){if(e.throwForMissingFeatures)throw s}else e.logMissingFeatures&&e.log("Unhandled additional info: ".concat(o)),w(e,l());l()&&(e.logMissingFeatures&&e.log("Unread ".concat(l()," bytes left for additional info: ").concat(o)),w(e,l()))},!1,a)}function Jt(e,t,n,i){if(i===void 0&&(i=4),n===1||n===8)return i===4?ti(e,t):{width:e,height:t,data:new Uint8ClampedArray(e*t*i)};if(n===16)return{width:e,height:t,data:new Uint16Array(e*t*i)};if(n===32)return{width:e,height:t,data:new Float32Array(e*t*i)};throw new Error("Invalid bitDepth (".concat(n,")"))}function Gs(e,t){var n,i=I(e),r=(n=t.bitsPerChannel)!==null&&n!==void 0?n:8;if(va.indexOf(t.colorMode)===-1)throw new Error("Color mode not supported: ".concat(t.colorMode));if(i!==0&&i!==1)throw new Error("Compression type not supported: ".concat(i));var o=Jt(t.width,t.height,r);switch(Zt(o),t.colorMode){case 0:{if(r!==1)throw new Error("Invalid bitsPerChannel for bitmap color mode");var a=void 0;if(i===0)a=ce(e,Math.ceil(t.width/8)*t.height);else if(i===1)a=new Uint8Array(t.width*t.height),Tn(e,{data:a,width:t.width,height:t.height},t.width,t.height,8,1,[0],e.large);else throw new Error("Bitmap compression not supported: ".concat(i));fs(a,o.data,t.width,t.height);break}case 3:case 1:{var l=t.colorMode===1?[0]:[0,1,2];if(t.channels&&t.channels>3)for(var u=3;u<t.channels;u++)l.push(u);else e.globalAlpha&&l.push(3);if(i===0)for(var u=0;u<l.length;u++)Fa(e,o,t.width,t.height,r,4,l[u]);else i===1&&(e.offset,Tn(e,o,t.width,t.height,r,4,l,e.large));t.colorMode===1&&$t(o);break}case 2:{if(r!==8)throw new Error("bitsPerChannel Not supproted");if(t.channels!==1)throw new Error("Invalid channel count");if(!t.palette)throw new Error("Missing color palette");if(i===0)throw new Error("Not implemented");if(i===1){var s={width:o.width,height:o.height,data:new Uint8Array(o.width*o.height)};Tn(e,s,t.width,t.height,r,1,[0],e.large),Us(s,o,t.palette)}else throw new Error("Not implemented");break}case 4:{if(r!==8)throw new Error("bitsPerChannel Not supproted");if(t.channels!==4)throw new Error("Invalid channel count");var l=[0,1,2,3];if(e.globalAlpha&&l.push(4),i===0)throw new Error("Not implemented");if(i===1){var c={width:o.width,height:o.height,data:new Uint8Array(o.width*o.height*5)};e.offset,Tn(e,c,t.width,t.height,r,5,l,e.large),ya(c,o,!0)}else throw new Error("Not implemented");break}default:throw new Error("Color mode not supported: ".concat(t.colorMode))}if(e.globalAlpha){if(t.bitsPerChannel!==8)throw new Error("bitsPerChannel Not supproted");for(var d=o.data,p=o.width*o.height*4,u=0;u<p;u+=4){var h=d[u+3];if(h!=0&&h!=255){var g=h/255,v=1/g,F=255*(1-v);d[u+0]=d[u+0]*v+F,d[u+1]=d[u+1]*v+F,d[u+2]=d[u+2]*v+F}}}e.useImageData?t.imageData=o:t.canvas=Yt(o)}function ya(e,t,n){for(var i=t.width*t.height*4,r=e.data,o=t.data,a=0,l=0;l<i;a+=5,l+=4){var u=r[a],s=r[a+1],c=r[a+2],d=r[a+3];o[l]=(u*d|0)/255|0,o[l+1]=(s*d|0)/255|0,o[l+2]=(c*d|0)/255|0,o[l+3]=n?255-r[a+4]:r[a+4]}}function Us(e,t,n){for(var i=e.width*e.height,r=e.data,o=t.data,a=0,l=0;a<i;a++,l+=4){var u=n[r[a]];o[l+0]=u.r,o[l+1]=u.g,o[l+2]=u.b,o[l+3]=255}}function Vs(e,t){if(e.byteLength/e.length!==t.byteLength/t.length)throw new Error("Invalid array types")}function Sa(e,t){if(t===8)return e;if(t===16)if(e.byteOffset%2){var n=new Uint16Array(e.byteLength/2);return new Uint8Array(n.buffer,n.byteOffset,n.byteLength).set(e),n}else return new Uint16Array(e.buffer,e.byteOffset,e.byteLength/2);else if(t===32)if(e.byteOffset%4){var n=new Float32Array(e.byteLength/4);return new Uint8Array(n.buffer,n.byteOffset,n.byteLength).set(e),n}else return new Float32Array(e.buffer,e.byteOffset,e.byteLength/4);else throw new Error("Invalid bitDepth (".concat(t,")"))}function Qt(e,t,n,i){Vs(e.data,t);for(var r=e.width*e.height,o=e.data,a=0,l=n|0;a<r;a++,l=l+i|0)o[l]=t[a]}function Fa(e,t,n,i,r,o,a){var l=ce(e,n*i*Math.floor(r/8));if(r==32)for(var u=0;u<l.byteLength;u+=4){var s=l[u+0],c=l[u+1],d=l[u+2],p=l[u+3];l[u+0]=p,l[u+1]=d,l[u+2]=c,l[u+3]=s}var h=Sa(l,r);t&&a<o&&Qt(t,h,a,o)}function Rt(e,t,n,i){for(var r=0;r<n;r++)for(var o=r*t,a=1,l=o+1;a<t;a++,l++)e[l]=(e[l-1]+e[l])%i}function Tr(e,t,n,i,r,o,a,l,u){var s=ce(e,t),c=ls(s);if(n&&l<a){var d=Sa(c,o);if(o===8)u&&Rt(c,i,r,256),Qt(n,c,l,a);else if(o===16)u&&Rt(d,i,r,65536),Qt(n,d,l,a);else if(o===32){u&&Rt(c,i*4,r,256);for(var p=l,h=new Uint32Array(n.data.buffer,n.data.byteOffset,n.data.length),g=0;g<r;g++)for(var v=i*4*g,F=0;F<i;F++,v++,p+=a){var y=v+i,m=y+i,b=m+i;h[p]=(c[v]<<24|c[y]<<16|c[m]<<8|c[b])>>>0}}else throw new Error("Invalid bitDepth")}}function Tn(e,t,n,i,r,o,a,l){var u=t&&t.data,s;if(l){s=new Uint32Array(a.length*i);for(var c=0,d=0;c<a.length;c++)for(var p=0;p<i;p++,d++)s[d]=C(e)}else{s=new Uint16Array(a.length*i);for(var c=0,d=0;c<a.length;c++)for(var p=0;p<i;p++,d++)s[d]=I(e)}if(r!==1&&r!==8)throw new Error("Invalid bit depth (".concat(r,")"));for(var h=o-1|0,g=0,d=0;g<a.length;g++){var v=a[g]|0,F=g>h||v>h;if(!u||F)for(var p=0;p<i;p++,d++)w(e,s[d]);else for(var p=0,y=v|0;p<i;p++,d++)for(var m=s[d],b=ce(e,m),S=0,E=0;S<m;S++){var G=b[S];if(G>128){var A=b[++S];G=256-G|0;for(var R=0;R<=G&&E<n;R=R+1|0,E=E+1|0)u[y]=A,y=y+o|0}else if(G<128)for(var R=0;R<=G&&E<n;R=R+1|0,E=E+1|0)u[y]=b[++S],y=y+o|0}}}function Fe(e,t,n,i,r){i===void 0&&(i=!0),r===void 0&&(r=!1);var o=C(e);if(r){if(o!==0)throw new Error("Sizes larger than 4GB are not supported");o=C(e)}if(!(o<=0&&i)){var a=e.offset+o;if(a>e.view.byteLength)throw new Error("Section exceeds file size");var l=n(function(){return a-e.offset});for(e.offset!==a&&(e.offset>a?qt(e,"Exceeded section limits"):qt(e,"Unread section data"));o%t;)o++,a++;return e.offset=a,l}}function oe(e){var t=I(e);switch(t){case 0:{var n=I(e)/257,i=I(e)/257,r=I(e)/257;return w(e,2),{r:n,g:i,b:r}}case 1:{var o=I(e)/65535,a=I(e)/65535,r=I(e)/65535;return w(e,2),{h:o,s:a,b:r}}case 2:{var l=I(e)/257,u=I(e)/257,s=I(e)/257,c=I(e)/257;return{c:l,m:u,y:s,k:c}}case 7:{var d=H(e)/1e4,p=H(e),h=H(e),g=p<0?p/12800:p/12700,r=h<0?h/12800:h/12700;return w(e,2),{l:d,a:g,b:r}}case 8:{var c=I(e)*255/1e4;return w(e,6),{k:c}}default:throw new Error("Invalid color space")}}var xa=[void 0,"outer bevel","inner bevel","emboss","pillow emboss","stroke emboss"];function dn(e){return qe(e,"8BIM"),Sn[Q(e)]||"normal"}function pn(e,t){_(e,"8BIM"),_(e,vo[t]||"norm")}function hn(e){return P(e)/255}function vn(e,t){T(e,Math.round(t*255)|0)}function js(e){var t=I(e);if(t!==0)throw new Error("Invalid effects layer version: ".concat(t));for(var n=I(e),i={},r=0;r<n;r++){qe(e,"8BIM");var o=Q(e);switch(o){case"cmnS":{var a=C(e),l=C(e),u=!!P(e);if(w(e,2),a!==7||l!==0||!u)throw new Error("Invalid effects common state");break}case"dsdw":case"isdw":{var s=C(e),c=C(e);if(s!==41&&s!==51)throw new Error("Invalid shadow size: ".concat(s));if(c!==0&&c!==2)throw new Error("Invalid shadow version: ".concat(c));var a=ge(e);ge(e);var d=ge(e),p=ge(e),h=oe(e),g=dn(e),v=!!P(e),F=!!P(e),y=hn(e);s>=51&&oe(e);var m={size:{units:"Pixels",value:a},distance:{units:"Pixels",value:p},angle:d,color:h,blendMode:g,enabled:v,useGlobalLight:F,opacity:y};o==="dsdw"?i.dropShadow=[m]:i.innerShadow=[m];break}case"oglw":{var s=C(e),b=C(e);if(s!==32&&s!==42)throw new Error("Invalid outer glow size: ".concat(s));if(b!==0&&b!==2)throw new Error("Invalid outer glow version: ".concat(b));var a=ge(e);ge(e);var h=oe(e),g=dn(e),v=!!P(e),y=hn(e);s>=42&&oe(e),i.outerGlow={size:{units:"Pixels",value:a},color:h,blendMode:g,enabled:v,opacity:y};break}case"iglw":{var s=C(e),S=C(e);if(s!==32&&s!==43)throw new Error("Invalid inner glow size: ".concat(s));if(S!==0&&S!==2)throw new Error("Invalid inner glow version: ".concat(S));var a=ge(e);ge(e);var h=oe(e),g=dn(e),v=!!P(e),y=hn(e);s>=43&&(P(e),oe(e)),i.innerGlow={size:{units:"Pixels",value:a},color:h,blendMode:g,enabled:v,opacity:y};break}case"bevl":{var s=C(e),E=C(e);if(s!==58&&s!==78)throw new Error("Invalid bevel size: ".concat(s));if(E!==0&&E!==2)throw new Error("Invalid bevel version: ".concat(E));var d=ge(e),G=ge(e),a=ge(e),A=dn(e),R=dn(e),N=oe(e),B=oe(e),z=xa[P(e)]||"inner bevel",re=hn(e),de=hn(e),v=!!P(e),F=!!P(e),te=P(e)?"down":"up";s>=78&&(oe(e),oe(e)),i.bevel={size:{units:"Pixels",value:a},angle:d,strength:G,highlightBlendMode:A,shadowBlendMode:R,highlightColor:N,shadowColor:B,style:z,highlightOpacity:re,shadowOpacity:de,enabled:v,useGlobalLight:F,direction:te};break}case"sofi":{var a=C(e),ue=C(e);if(a!==34)throw new Error("Invalid effects solid fill info size: ".concat(a));if(ue!==2)throw new Error("Invalid effects solid fill info version: ".concat(ue));var g=dn(e),h=oe(e),y=hn(e),v=!!P(e);oe(e),i.solidFill=[{blendMode:g,color:h,opacity:y,enabled:v}];break}default:throw new Error("Invalid effect type: '".concat(o,"'"))}}return i}function Or(e,t){var n;D(e,51),D(e,2),ye(e,t.size&&t.size.value||0),ye(e,0),ye(e,t.angle||0),ye(e,t.distance&&t.distance.value||0),le(e,t.color),pn(e,t.blendMode),T(e,t.enabled?1:0),T(e,t.useGlobalLight?1:0),vn(e,(n=t.opacity)!==null&&n!==void 0?n:1),le(e,t.color)}function Hs(e,t){var n,i,r,o,a,l,u=(n=t.dropShadow)===null||n===void 0?void 0:n[0],s=(i=t.innerShadow)===null||i===void 0?void 0:i[0],c=t.outerGlow,d=t.innerGlow,p=t.bevel,h=(r=t.solidFill)===null||r===void 0?void 0:r[0],g=1;if(u&&g++,s&&g++,c&&g++,d&&g++,p&&g++,h&&g++,x(e,0),x(e,g),_(e,"8BIM"),_(e,"cmnS"),D(e,7),D(e,0),T(e,1),$(e,2),u&&(_(e,"8BIM"),_(e,"dsdw"),Or(e,u)),s&&(_(e,"8BIM"),_(e,"isdw"),Or(e,s)),c&&(_(e,"8BIM"),_(e,"oglw"),D(e,42),D(e,2),ye(e,((o=c.size)===null||o===void 0?void 0:o.value)||0),ye(e,0),le(e,c.color),pn(e,c.blendMode),T(e,c.enabled?1:0),vn(e,c.opacity||0),le(e,c.color)),d&&(_(e,"8BIM"),_(e,"iglw"),D(e,43),D(e,2),ye(e,((a=d.size)===null||a===void 0?void 0:a.value)||0),ye(e,0),le(e,d.color),pn(e,d.blendMode),T(e,d.enabled?1:0),vn(e,d.opacity||0),T(e,0),le(e,d.color)),p){_(e,"8BIM"),_(e,"bevl"),D(e,78),D(e,2),ye(e,p.angle||0),ye(e,p.strength||0),ye(e,((l=p.size)===null||l===void 0?void 0:l.value)||0),pn(e,p.highlightBlendMode),pn(e,p.shadowBlendMode),le(e,p.highlightColor),le(e,p.shadowColor);var v=xa.indexOf(p.style);T(e,v<=0?1:v),vn(e,p.highlightOpacity||0),vn(e,p.shadowOpacity||0),T(e,p.enabled?1:0),T(e,p.useGlobalLight?1:0),T(e,p.direction==="down"?1:0),le(e,p.highlightColor),le(e,p.shadowColor)}h&&(_(e,"8BIM"),_(e,"sofi"),D(e,34),D(e,2),pn(e,h.blendMode),le(e,h.color),vn(e,h.opacity||0),T(e,h.enabled?1:0),le(e,h.color))}function Lr(e){return e===32||e===10||e===13||e===9}function Mr(e){return e>=48&&e<=57||e===46||e===45}function Ia(e){var t=0;function n(){for(;t<e.length&&Lr(e[t]);)t++}function i(){var m=e[t];return t++,m===92&&(m=e[t],t++),m}function r(){var m="";if(e[t]===41)return t++,m;if(e[t]!==254||e[t+1]!==255)throw new Error("Invalid utf-16 BOM");for(t+=2;t<e.length&&e[t]!==41;){var b=i(),S=i(),E=b<<8|S;m+=String.fromCharCode(E)}return t++,m}var o=null,a=[];function l(m){a.length?(u(m),a.push(m)):(a.push(m),o=m)}function u(m){if(!a.length)throw new Error("Invalid data");var b=a[a.length-1];if(typeof b=="string")a[a.length-2][b]=m,c();else if(Array.isArray(b))b.push(m);else throw new Error("Invalid data")}function s(m){a.length||l({});var b=a[a.length-1];if(b&&typeof b=="string")u(m==="nil"?null:"/".concat(m));else if(b&&typeof b=="object")a.push(m);else throw new Error("Invalid data")}function c(){if(!a.length)throw new Error("Invalid data");a.pop()}n();for(var d=e.length;d>0&&e[d-1]===0;)d--;for(;t<d;){var p=t,h=e[p];if(h===60&&e[p+1]===60)t+=2,l({});else if(h===62&&e[p+1]===62)t+=2,c();else if(h===47){t+=1;for(var g=t;t<e.length&&!Lr(e[t]);)t++;for(var v="",F=g;F<t;F++)v+=String.fromCharCode(e[F]);s(v)}else if(h===40)t+=1,u(r());else if(h===91)t+=1,l([]);else if(h===93)t+=1,c();else if(h===110&&e[p+1]===117&&e[p+2]===108&&e[p+3]===108)t+=4,u(null);else if(h===116&&e[p+1]===114&&e[p+2]===117&&e[p+3]===101)t+=4,u(!0);else if(h===102&&e[p+1]===97&&e[p+2]===108&&e[p+3]===115&&e[p+4]===101)t+=5,u(!1);else if(Mr(h)){for(var y="";t<e.length&&Mr(e[t]);)y+=String.fromCharCode(e[t]),t++;u(parseFloat(y))}else t+=1,console.log("Invalid token '".concat(String.fromCharCode(h),"' (").concat(h,") at ").concat(t));n()}return o}var Ws=["Axis","XY","Zone","WordSpacing","FirstLineIndent","GlyphSpacing","StartIndent","EndIndent","SpaceBefore","SpaceAfter","LetterSpacing","Values","GridSize","GridLeading","PointBase","BoxBounds","TransformPoint0","TransformPoint1","TransformPoint2","FontSize","Leading","HorizontalScale","VerticalScale","BaselineShift","Tsume","OutlineWidth","AutoLeading"],Xs=["RunLengthArray"];function Zs(e,t){t===void 0&&(t=!1);var n=new Uint8Array(1024),i=0,r=0;function o(m){if(i>=n.length){var b=new Uint8Array(n.length*2);b.set(n),n=b}n[i]=m,i++}function a(m){for(var b=0;b<m.length;b++)o(m.charCodeAt(b))}function l(){if(t)a(" ");else for(var m=0;m<r;m++)a(" ")}function u(m,b){l(),a("/".concat(m)),g(b,m,!0),t||a(`
2
+ `)}function s(m){return m.toString()}function c(m){return m.toFixed(5).replace(/(\d)0+$/g,"$1").replace(/^0+\.([1-9])/g,".$1").replace(/^-0+\.0(\d)/g,"-.0$1")}function d(m,b){var S=b&&Ws.indexOf(b)!==-1||(m|0)!==m;return S?c(m):s(m)}function p(m){var b=Object.keys(m);return b.indexOf("98")!==-1&&b.unshift.apply(b,b.splice(b.indexOf("99"),1)),b.indexOf("99")!==-1&&b.unshift.apply(b,b.splice(b.indexOf("99"),1)),b}function h(m){(m===40||m===41||m===92)&&o(92),o(m)}function g(m,b,S){S===void 0&&(S=!1);function E(){S?a(" "):l()}if(m===null)E(),a(t?"/nil":"null");else if(typeof m=="number")E(),a(d(m,b));else if(typeof m=="boolean")E(),a(m?"true":"false");else if(typeof m=="string")if(E(),(b==="99"||b==="98")&&m.charAt(0)==="/")a(m);else{a("("),o(254),o(255);for(var G=0;G<m.length;G++){var A=m.charCodeAt(G);h(A>>8&255),h(A&255)}a(")")}else if(Array.isArray(m))if(E(),m.every(function(Je){return typeof Je=="number"})){a("[");for(var R=Xs.indexOf(b)!==-1,N=0,B=m;N<B.length;N++){var z=B[N];a(" "),a(R?d(z):c(z))}a(" ]")}else{a("["),t||a(`
3
+ `);for(var re=0,de=m;re<de.length;re++){var z=de[re];g(z,b),t||a(`
4
+ `)}l(),a("]")}else if(typeof m=="object"){S&&!t&&a(`
5
+ `),l(),a("<<"),t||a(`
6
+ `),r++;for(var te=0,ue=p(m);te<ue.length;te++){var Xe=ue[te];u(Xe,m[Xe])}r--,l(),a(">>")}}if(t){if(typeof e=="object")for(var v=0,F=p(e);v<F.length;v++){var y=F[v];u(y,e[y])}}else a(`
7
+
8
+ `),g(e);return n.slice(0,i)}var ie=function(){return ie=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},ie.apply(this,arguments)},Ca={name:"MyriadPro-Regular",script:0,type:0,synthetic:0},it={justification:"left",firstLineIndent:0,startIndent:0,endIndent:0,spaceBefore:0,spaceAfter:0,autoHyphenate:!0,hyphenatedWordSize:6,preHyphen:2,postHyphen:2,consecutiveHyphens:8,zone:36,wordSpacing:[.8,1,1.33],letterSpacing:[0,0,0],glyphSpacing:[1,1,1],autoLeading:1.2,leadingType:0,hanging:!1,burasagari:!1,kinsokuOrder:0,everyLineComposer:!1},Ys={font:Ca,fontSize:12,fauxBold:!1,fauxItalic:!1,autoLeading:!0,leading:0,horizontalScale:1,verticalScale:1,tracking:0,autoKerning:!0,kerning:0,baselineShift:0,fontCaps:0,fontBaseline:0,underline:!1,strikethrough:!1,ligatures:!0,dLigatures:!1,baselineDirection:2,tsume:0,styleRunAlignment:2,language:0,noBreak:!1,fillColor:{r:0,g:0,b:0},strokeColor:{r:0,g:0,b:0},fillFlag:!0,strokeFlag:!1,fillFirst:!0,yUnderline:1,outlineWidth:1,characterDirection:0,hindiNumbers:!1,kashida:1,diacriticPos:2},Ks={isOn:!1,show:!1,size:18,leading:22,color:{r:0,g:0,b:255},leadingFillColor:{r:0,g:0,b:255},alignLineHeightToGridFlags:!1},si=["justification","firstLineIndent","startIndent","endIndent","spaceBefore","spaceAfter","autoHyphenate","hyphenatedWordSize","preHyphen","postHyphen","consecutiveHyphens","zone","wordSpacing","letterSpacing","glyphSpacing","autoLeading","leadingType","hanging","burasagari","kinsokuOrder","everyLineComposer"],ui=["font","fontSize","fauxBold","fauxItalic","autoLeading","leading","horizontalScale","verticalScale","tracking","autoKerning","kerning","baselineShift","fontCaps","fontBaseline","underline","strikethrough","ligatures","dLigatures","baselineDirection","tsume","styleRunAlignment","language","noBreak","fillColor","strokeColor","fillFlag","strokeFlag","fillFirst","yUnderline","outlineWidth","characterDirection","hindiNumbers","kashida","diacriticPos"],ka=["none","crisp","strong","smooth","sharp"],Da=["left","right","center","justify-left","justify-right","justify-center","justify-all"];function Pa(e){return e.substring(0,1).toUpperCase()+e.substring(1)}function $s(e){var t=e.Values;switch(e.Type){case 0:return{k:t[1]*255};case 1:return t[0]===1?{r:t[1]*255,g:t[2]*255,b:t[3]*255}:{r:t[1]*255,g:t[2]*255,b:t[3]*255,a:t[0]*255};case 2:return{c:t[1]*255,m:t[2]*255,y:t[3]*255,k:t[4]*255};default:throw new Error("Unknown color type in text layer")}}function ei(e){if(e){if("r"in e)return{Type:1,Values:["a"in e?e.a/255:1,e.r/255,e.g/255,e.b/255]};if("c"in e)return{Type:2,Values:[1,e.c/255,e.m/255,e.y/255,e.k/255]};if("k"in e)return{Type:0,Values:[1,e.k/255]};throw new Error("Invalid color type in text layer")}else return{Type:1,Values:[0,0,0,0]}}function Rr(e,t){if(!e||!t||e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function Br(e,t){if(!e||!t)return!1;for(var n=0,i=Object.keys(e);n<i.length;n++){var r=i[n];if(e[r]!==t[r])return!1}for(var o=0,a=Object.keys(t);o<a.length;o++){var r=a[o];if(e[r]!==t[r])return!1}return!0}function qs(e,t){for(var n=0;n<e.length;n++)if(e[n].name===t.name)return n;return e.push(t),e.length-1}function Aa(e,t,n){for(var i={},r=0,o=t;r<o.length;r++){var a=o[r],l=Pa(a);e[l]!==void 0&&(a==="justification"?i[a]=Da[e[l]]:a==="font"?i[a]=n[e[l]]:a==="fillColor"||a==="strokeColor"?i[a]=$s(e[l]):i[a]=e[l])}return i}function wa(e,t,n){for(var i,r={},o=0,a=t;o<a.length;o++){var l=a[o],u=Pa(l);e[l]!==void 0&&(l==="justification"?r[u]=Da.indexOf((i=e[l])!==null&&i!==void 0?i:"left"):l==="font"?r[u]=qs(n,e[l]):l==="fillColor"||l==="strokeColor"?r[u]=ei(e[l]):r[u]=e[l])}return r}function Js(e,t){return Aa(e,si,t)}function Qs(e,t){return Aa(e,ui,t)}function rt(e,t){return wa(e,si,t)}function Bt(e,t){return wa(e,ui,t)}function _r(e,t,n){if(t.length){for(var i=function(l){var u=t[0].style[l];if(u!==void 0){var s=!1;Array.isArray(u)?s=t.every(function(v){return Rr(v.style[l],u)}):typeof u=="object"?s=t.every(function(v){return Br(v.style[l],u)}):s=t.every(function(v){return v.style[l]===u}),s&&(e[l]=u)}var c=e[l];if(c!==void 0)for(var d=0,p=t;d<p.length;d++){var h=p[d],g=!1;Array.isArray(u)?g=Rr(h.style[l],u):typeof u=="object"?g=Br(h.style[l],u):g=h.style[l]===u,g&&delete h.style[l]}},r=0,o=n;r<o.length;r++){var a=o[r];i(a)}t.every(function(l){return Object.keys(l.style).length===0})&&(t.length=0)}}function eu(e){for(var t,n,i,r,o,a,l=e.EngineDict,u=e.ResourceDict,s=u.FontSet.map(function(G){return{name:G.Name,script:G.Script,type:G.FontType,synthetic:G.Synthetic}}),c=l.Editor.Text.replace(/\r/g,`
9
+ `),d=0;/\n$/.test(c);)c=c.substring(0,c.length-1),d++;var p={text:c,antiAlias:(t=ka[l.AntiAlias])!==null&&t!==void 0?t:"smooth",useFractionalGlyphWidths:!!l.UseFractionalGlyphWidths,superscriptSize:u.SuperscriptSize,superscriptPosition:u.SuperscriptPosition,subscriptSize:u.SubscriptSize,subscriptPosition:u.SubscriptPosition,smallCapSize:u.SmallCapSize},h=(a=(o=(r=(i=(n=l.Rendered)===null||n===void 0?void 0:n.Shapes)===null||i===void 0?void 0:i.Children)===null||r===void 0?void 0:r[0])===null||o===void 0?void 0:o.Cookie)===null||a===void 0?void 0:a.Photoshop;h&&(p.shapeType=h.ShapeType===1?"box":"point",h.PointBase&&(p.pointBase=h.PointBase),h.BoxBounds&&(p.boxBounds=h.BoxBounds));var g=l.ParagraphRun;p.paragraphStyle={},p.paragraphStyleRuns=[];for(var v=0;v<g.RunArray.length;v++){var F=g.RunArray[v],y=g.RunLengthArray[v],m=Js(F.ParagraphSheet.Properties,s);p.paragraphStyleRuns.push({length:y,style:m})}for(var b=d;p.paragraphStyleRuns.length&&b>0;b--)--p.paragraphStyleRuns[p.paragraphStyleRuns.length-1].length===0&&p.paragraphStyleRuns.pop();_r(p.paragraphStyle,p.paragraphStyleRuns,si),p.paragraphStyleRuns.length||delete p.paragraphStyleRuns;var S=l.StyleRun;p.style={},p.styleRuns=[];for(var v=0;v<S.RunArray.length;v++){var E=S.RunLengthArray[v],m=Qs(S.RunArray[v].StyleSheet.StyleSheetData,s);m.font||(m.font=s[0]),p.styleRuns.push({length:E,style:m})}for(var b=d;p.styleRuns.length&&b>0;b--)--p.styleRuns[p.styleRuns.length-1].length===0&&p.styleRuns.pop();return _r(p.style,p.styleRuns,ui),p.styleRuns.length||delete p.styleRuns,p}function nu(e){var t,n,i,r,o,a,l,u,s,c,d,p,h="".concat((e.text||"").replace(/\r?\n/g,"\r"),"\r"),g=[{name:"AdobeInvisFont",script:0,type:0,synthetic:0}],v=((t=e.style)===null||t===void 0?void 0:t.font)||((i=(n=e.styleRuns)===null||n===void 0?void 0:n.find(function(sn){return sn.style.font}))===null||i===void 0?void 0:i.style.font)||Ca,F=[],y=[],m=e.paragraphStyleRuns;if(m&&m.length){for(var b=h.length,S=0,E=m;S<E.length;S++){var G=E[S],A=Math.min(G.length,b);b-=A,A&&(b===1&&G===m[m.length-1]&&(A++,b--),y.push(A),F.push({ParagraphSheet:{DefaultStyleSheet:0,Properties:rt(ie(ie(ie({},it),e.paragraphStyle),G.style),g)},Adjustments:{Axis:[1,0,1],XY:[0,0]}}))}b&&(y.push(b),F.push({ParagraphSheet:{DefaultStyleSheet:0,Properties:rt(ie(ie({},it),e.paragraphStyle),g)},Adjustments:{Axis:[1,0,1],XY:[0,0]}}))}else for(var R=0,N=0;R<h.length;R++)h.charCodeAt(R)===13&&(y.push(R-N+1),F.push({ParagraphSheet:{DefaultStyleSheet:0,Properties:rt(ie(ie({},it),e.paragraphStyle),g)},Adjustments:{Axis:[1,0,1],XY:[0,0]}}),N=R+1);for(var B=Bt(ie(ie({},Ys),{font:v}),g),z=e.styleRuns||[{length:h.length,style:e.style||{}}],re=[],de=[],te=h.length,ue=0,Xe=z;ue<Xe.length;ue++){var Je=Xe[ue],A=Math.min(Je.length,te);te-=A,A&&(te===1&&Je===z[z.length-1]&&(A++,te--),de.push(A),re.push({StyleSheet:{StyleSheetData:Bt(ie(ie({kerning:0,autoKerning:!0,fillColor:{r:0,g:0,b:0}},e.style),Je.style),g)}}))}te&&z.length&&(de.push(te),re.push({StyleSheet:{StyleSheetData:Bt(ie({kerning:0,autoKerning:!0,fillColor:{r:0,g:0,b:0}},e.style),g)}}));var pe=ie(ie({},Ks),e.gridInfo),Ze=e.orientation==="vertical"?2:0,Z=e.orientation==="vertical"?1:0,ln=e.shapeType==="box"?1:0,Wn={ShapeType:ln};ln===0?Wn.PointBase=e.pointBase||[0,0]:Wn.BoxBounds=e.boxBounds||[0,0,0,0],Wn.Base={ShapeType:ln,TransformPoint0:[1,0],TransformPoint1:[0,1],TransformPoint2:[0,0]};var di={KinsokuSet:[{Name:"PhotoshopKinsokuHard",NoStart:"、。,.・:;?!ー―’”)〕]}〉》」』】ヽヾゝゞ々ぁぃぅぇぉっゃゅょゎァィゥェォッャュョヮヵヶ゛゜?!)]},.:;℃℉¢%‰",NoEnd:"‘“(〔[{〈《「『【([{¥$£@§〒#",Keep:"―‥",Hanging:"、。.,"},{Name:"PhotoshopKinsokuSoft",NoStart:"、。,.・:;?!’”)〕]}〉》」』】ヽヾゝゞ々",NoEnd:"‘“(〔[{〈《「『【",Keep:"―‥",Hanging:"、。.,"}],MojiKumiSet:[{InternalName:"Photoshop6MojiKumiSet1"},{InternalName:"Photoshop6MojiKumiSet2"},{InternalName:"Photoshop6MojiKumiSet3"},{InternalName:"Photoshop6MojiKumiSet4"}],TheNormalStyleSheet:0,TheNormalParagraphSheet:0,ParagraphSheetSet:[{Name:"Normal RGB",DefaultStyleSheet:0,Properties:rt(ie(ie({},it),e.paragraphStyle),g)}],StyleSheetSet:[{Name:"Normal RGB",StyleSheetData:B}],FontSet:g.map(function(sn){return{Name:sn.name,Script:sn.script||0,FontType:sn.type||0,Synthetic:sn.synthetic||0}}),SuperscriptSize:(r=e.superscriptSize)!==null&&r!==void 0?r:.583,SuperscriptPosition:(o=e.superscriptPosition)!==null&&o!==void 0?o:.333,SubscriptSize:(a=e.subscriptSize)!==null&&a!==void 0?a:.583,SubscriptPosition:(l=e.subscriptPosition)!==null&&l!==void 0?l:.333,SmallCapSize:(u=e.smallCapSize)!==null&&u!==void 0?u:.7},Ba={EngineDict:{Editor:{Text:h},ParagraphRun:{DefaultRunData:{ParagraphSheet:{DefaultStyleSheet:0,Properties:{}},Adjustments:{Axis:[1,0,1],XY:[0,0]}},RunArray:F,RunLengthArray:y,IsJoinable:1},StyleRun:{DefaultRunData:{StyleSheet:{StyleSheetData:{}}},RunArray:re,RunLengthArray:de,IsJoinable:2},GridInfo:{GridIsOn:!!pe.isOn,ShowGrid:!!pe.show,GridSize:(s=pe.size)!==null&&s!==void 0?s:18,GridLeading:(c=pe.leading)!==null&&c!==void 0?c:22,GridColor:ei(pe.color),GridLeadingFillColor:ei(pe.color),AlignLineHeightToGridFlags:!!pe.alignLineHeightToGridFlags},AntiAlias:ka.indexOf((d=e.antiAlias)!==null&&d!==void 0?d:"sharp"),UseFractionalGlyphWidths:(p=e.useFractionalGlyphWidths)!==null&&p!==void 0?p:!0,Rendered:{Version:1,Shapes:{WritingDirection:Ze,Children:[{ShapeType:ln,Procession:Z,Lines:{WritingDirection:Ze,Children:[]},Cookie:{Photoshop:Wn}}]}}},ResourceDict:ie({},di),DocumentResources:ie({},di)};return Ba}var _t={0:{uproot:!0,children:{0:{name:"Type"},1:{name:"Values"}}}},ci={0:{name:"Font"},1:{name:"FontSize"},2:{name:"FauxBold"},3:{name:"FauxItalic"},4:{name:"AutoLeading"},5:{name:"Leading"},6:{name:"HorizontalScale"},7:{name:"VerticalScale"},8:{name:"Tracking"},9:{name:"BaselineShift"},11:{name:"Kerning?"},12:{name:"FontCaps"},13:{name:"FontBaseline"},15:{name:"Strikethrough?"},16:{name:"Underline?"},18:{name:"Ligatures"},19:{name:"DLigatures"},23:{name:"Fractions"},24:{name:"Ordinals"},28:{name:"StylisticAlternates"},30:{name:"OldStyle?"},35:{name:"BaselineDirection"},38:{name:"Language"},52:{name:"NoBreak"},53:{name:"FillColor",children:_t},54:{name:"StrokeColor",children:_t},55:{children:{99:{uproot:!0}}},79:{children:_t}},zt={0:{name:"Justification"},1:{name:"FirstLineIndent"},2:{name:"StartIndent"},3:{name:"EndIndent"},4:{name:"SpaceBefore"},5:{name:"SpaceAfter"},7:{name:"AutoLeading"},9:{name:"AutoHyphenate"},10:{name:"HyphenatedWordSize"},11:{name:"PreHyphen"},12:{name:"PostHyphen"},13:{name:"ConsecutiveHyphens?"},14:{name:"Zone"},15:{name:"HypenateCapitalizedWords"},17:{name:"WordSpacing"},18:{name:"LetterSpacing"},19:{name:"GlyphSpacing"},32:{name:"StyleSheet",children:ci}},zr={name:"StyleSheetData",children:ci},tu={0:{name:"ResourceDict",children:{1:{name:"FontSet",children:{0:{uproot:!0,children:{0:{uproot:!0,children:{0:{uproot:!0,children:{0:{name:"Name"},2:{name:"FontType"}}}}}}}}},2:{name:"2",children:{}},3:{name:"MojiKumiSet",children:{0:{uproot:!0,children:{0:{uproot:!0,children:{0:{name:"InternalName"}}}}}}},4:{name:"KinsokuSet",children:{0:{uproot:!0,children:{0:{uproot:!0,children:{0:{name:"Name"},5:{uproot:!0,children:{0:{name:"NoStart"},1:{name:"NoEnd"},2:{name:"Keep"},3:{name:"Hanging"},4:{name:"Name"}}}}}}}}},5:{name:"StyleSheetSet",children:{0:{uproot:!0,children:{0:{uproot:!0,children:{0:{name:"Name"},6:zr}}}}}},6:{name:"ParagraphSheetSet",children:{0:{uproot:!0,children:{0:{uproot:!0,children:{0:{name:"Name"},5:{name:"Properties",children:zt},6:{name:"DefaultStyleSheet"}}}}}}},8:{name:"TextFrameSet",children:{0:{uproot:!0,children:{0:{name:"path",children:{0:{name:"name"},1:{name:"bezierCurve",children:{0:{name:"controlPoints"}}},2:{name:"data",children:{0:{name:"type"},1:{name:"orientation"},2:{name:"frameMatrix"},4:{name:"4"},6:{name:"textRange"},7:{name:"rowGutter"},8:{name:"columnGutter"},9:{name:"9"},10:{name:"baselineAlignment",children:{0:{name:"flag"},1:{name:"min"}}},11:{name:"pathData",children:{1:{name:"1"},0:{name:"reversed"},2:{name:"2"},3:{name:"3"},4:{name:"spacing"},5:{name:"5"},6:{name:"6"},7:{name:"7"},18:{name:"18"}}},12:{name:"12"},13:{name:"13"}}},3:{name:"3"},97:{name:"uuid"}}}}}}},9:{name:"Predefined",children:{0:{children:{0:{uproot:!0}}},1:{children:{0:{uproot:!0}}}}}}},1:{name:"EngineDict",children:{0:{name:"0",children:{3:{name:"SuperscriptSize"},4:{name:"SuperscriptPosition"},5:{name:"SubscriptSize"},6:{name:"SubscriptPosition"},7:{name:"SmallCapSize"},8:{name:"UseFractionalGlyphWidths"},15:{children:{0:{uproot:!0}}}}},1:{name:"Editors?",children:{0:{name:"Editor",children:{0:{name:"Text"},5:{name:"ParagraphRun",children:{0:{name:"RunArray",children:{0:{name:"ParagraphSheet",children:{0:{uproot:!0,children:{0:{name:"0"},5:{name:"5",children:zt},6:{name:"6"}}}}},1:{name:"RunLength"}}}}},6:{name:"StyleRun",children:{0:{name:"RunArray",children:{0:{name:"StyleSheet",children:{0:{uproot:!0,children:{6:zr}}}},1:{name:"RunLength"}}}}}}},1:{name:"FontVectorData ???"}}},2:{name:"StyleSheet",children:ci},3:{name:"ParagraphSheet",children:zt}}}};function On(e,t){var n,i;if(e===null)return e;if(Array.isArray(e))return e.map(function(u){return On(u,t)});if(typeof e!="object")return e;for(var r={},o=0,a=Object.keys(e);o<a.length;o++){var l=a[o];if(t[l])if(t[l].uproot){l!=="99"&&(r=On(e[l],(n=t[l].children)!==null&&n!==void 0?n:{})),e[99]&&(r._type=e[99]);break}else r[t[l].name||l]=On(e[l],(i=t[l].children)!==null&&i!==void 0?i:{});else l==="99"?r._type=e[l]:r[l]=On(e[l],{})}return r}function iu(e){return On(e,tu)}var f=function(){return f=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},f.apply(this,arguments)},be="abcdefghijklmnopqrstuvwxyz",pt={};function L(e,t,n,i){var r={key:e,has:t,read:n,write:i};pt[r.key]=r}function Cn(e,t){pt[e]=pt[t]}function q(e){return function(t){return t[e]!==void 0}}function Nt(e){if(C(e))throw new Error("Resource size above 4 GB limit at ".concat(e.offset.toString(16)));return C(e)}function Gt(e,t){D(e,0),D(e,t)}L("TySh",q("text"),function(e,t,n){if(H(e)!==1)throw new Error("Invalid TySh version");for(var i=[],r=0;r<6;r++)i.push(ke(e));if(H(e)!==50)throw new Error("Invalid TySh text version");var o=V(e);if(H(e)!==1)throw new Error("Invalid TySh warp version");var a=V(e);if(t.text={transform:i,left:we(e),top:we(e),right:we(e),bottom:we(e),text:o["Txt "].replace(/\r/g,`
10
+ `),index:o.TextIndex||0,gridding:ur.decode(o.textGridding),antiAlias:cr.decode(o.AntA),orientation:_n.decode(o.Ornt),warp:{style:ii.decode(a.warpStyle),value:a.warpValue||0,perspective:a.warpPerspective||0,perspectiveOther:a.warpPerspectiveOther||0,rotate:_n.decode(a.warpRotate)}},o.bounds&&(t.text.bounds=ir(o.bounds)),o.boundingBox&&(t.text.boundingBox=ir(o.boundingBox)),o.EngineData){var l=Ia(o.EngineData),u=eu(l);t.text=f(f({},t.text),u)}w(e,n())},function(e,t){var n=t.text,i=n.warp||{},r=n.transform||[1,0,0,1,0,0],o=f(f(f({"Txt ":(n.text||"").replace(/\r?\n/g,"\r"),textGridding:ur.encode(n.gridding),Ornt:_n.encode(n.orientation),AntA:cr.encode(n.antiAlias)},n.bounds?{bounds:rr(n.bounds)}:{}),n.boundingBox?{boundingBox:rr(n.boundingBox)}:{}),{TextIndex:n.index||0,EngineData:Zs(nu(n))});Y(e,1);for(var a=0;a<6;a++)Be(e,r[a]);Y(e,50),j(e,"","TxLr",o,"text"),Y(e,1),j(e,"","warp",vt(i)),Ee(e,n.left),Ee(e,n.top),Ee(e,n.right),Ee(e,n.bottom)});L("SoCo",function(e){return e.vectorFill!==void 0&&e.vectorStroke===void 0&&e.vectorFill.type==="color"},function(e,t){var n=V(e);t.vectorFill=jn(n)},function(e,t){var n=Hn(t.vectorFill).descriptor;j(e,"","null",n)});L("GdFl",function(e){return e.vectorFill!==void 0&&e.vectorStroke===void 0&&(e.vectorFill.type==="solid"||e.vectorFill.type==="noise")},function(e,t,n){var i=V(e);t.vectorFill=jn(i),w(e,n())},function(e,t){var n=Hn(t.vectorFill).descriptor;j(e,"","null",n)});L("PtFl",function(e){return e.vectorFill!==void 0&&e.vectorStroke===void 0&&e.vectorFill.type==="pattern"},function(e,t){var n=V(e);t.vectorFill=jn(n)},function(e,t){var n=Hn(t.vectorFill).descriptor;j(e,"","null",n)});L("vscg",function(e){return e.vectorFill!==void 0&&e.vectorStroke!==void 0},function(e,t,n){Q(e);var i=V(e);t.vectorFill=jn(i),w(e,n())},function(e,t){var n=Hn(t.vectorFill),i=n.descriptor,r=n.key;_(e,r),j(e,"","null",i)});function ru(e,t,n){var i=Pe(e)*n,r=Pe(e)*t,o=Pe(e)*n,a=Pe(e)*t,l=Pe(e)*n,u=Pe(e)*t;return[r,i,a,o,u,l]}function ou(e,t,n,i){Ae(e,t[1]/i),Ae(e,t[0]/n),Ae(e,t[3]/i),Ae(e,t[2]/n),Ae(e,t[5]/i),Ae(e,t[4]/n)}var Ea=["exclude","combine","subtract","intersect"];function au(e,t,n,i,r){for(var o=e.offset+r,a=t.paths,l=void 0;o-e.offset>=26;){var u=I(e);switch(u){case 0:case 3:{I(e);var s=H(e),c=I(e);w(e,18),l={open:u===3,knots:[],fillRule:c===2?"non-zero":"even-odd"},s!==-1&&(l.operation=Ea[s]),a.push(l);break}case 1:case 2:case 4:case 5:l.knots.push({linked:u===1||u===4,points:ru(e,n,i)});break;case 6:w(e,24);break;case 7:{var d=Pe(e),p=Pe(e),h=Pe(e),g=Pe(e),v=Pe(e);w(e,4),t.clipboard={top:d,left:p,bottom:h,right:g,resolution:v};break}case 8:t.fillStartsWithAllPixels=!!I(e),w(e,22);break;default:throw new Error("Invalid vmsk section")}}return a}L("vmsk",q("vectorMask"),function(e,t,n,i){var r=i.width,o=i.height;if(C(e)!==3)throw new Error("Invalid vmsk version");t.vectorMask={paths:[]};var a=t.vectorMask,l=C(e);a.invert=(l&1)!==0,a.notLink=(l&2)!==0,a.disable=(l&4)!==0,au(e,a,r,o,n()),w(e,n())},function(e,t,n){var i=n.width,r=n.height,o=t.vectorMask,a=(o.invert?1:0)|(o.notLink?2:0)|(o.disable?4:0);D(e,3),D(e,a),x(e,6),$(e,24);var l=o.clipboard;l&&(x(e,7),Ae(e,l.top),Ae(e,l.left),Ae(e,l.bottom),Ae(e,l.right),Ae(e,l.resolution),$(e,4)),x(e,8),x(e,o.fillStartsWithAllPixels?1:0),$(e,22);for(var u=0,s=o.paths;u<s.length;u++){var c=s[u];x(e,c.open?3:0),x(e,c.knots.length),x(e,c.operation?Ea.indexOf(c.operation):-1),x(e,c.fillRule==="non-zero"?2:1),$(e,18);for(var d=c.open?4:1,p=c.open?5:2,h=0,g=c.knots;h<g.length;h++){var v=g[h],F=v.linked,y=v.points;x(e,F?d:p),ou(e,y,i,r)}}});Cn("vsms","vmsk");L("vowv",q("vowv"),function(e,t){t.vowv=C(e)},function(e,t){D(e,t.vowv)});L("vogk",q("vectorOrigination"),function(e,t,n){if(O(e)!==1)throw new Error("Invalid vogk version");var i=V(e);t.vectorOrigination={keyDescriptorList:[]};for(var r=0,o=i.keyDescriptorList;r<o.length;r++){var a=o[r],l={};a.keyShapeInvalidated!=null&&(l.keyShapeInvalidated=a.keyShapeInvalidated),a.keyOriginType!=null&&(l.keyOriginType=a.keyOriginType),a.keyOriginResolution!=null&&(l.keyOriginResolution=a.keyOriginResolution),a.keyOriginShapeBBox&&(l.keyOriginShapeBoundingBox={top:Ke(a.keyOriginShapeBBox["Top "]),left:Ke(a.keyOriginShapeBBox.Left),bottom:Ke(a.keyOriginShapeBBox.Btom),right:Ke(a.keyOriginShapeBBox.Rght)});var u=a.keyOriginRRectRadii;u&&(l.keyOriginRRectRadii={topRight:K(u.topRight),topLeft:K(u.topLeft),bottomLeft:K(u.bottomLeft),bottomRight:K(u.bottomRight)});var s=a.keyOriginBoxCorners;s&&(l.keyOriginBoxCorners=[{x:s.rectangleCornerA.Hrzn,y:s.rectangleCornerA.Vrtc},{x:s.rectangleCornerB.Hrzn,y:s.rectangleCornerB.Vrtc},{x:s.rectangleCornerC.Hrzn,y:s.rectangleCornerC.Vrtc},{x:s.rectangleCornerD.Hrzn,y:s.rectangleCornerD.Vrtc}]);var c=a.Trnf;c&&(l.transform=[c.xx,c.xy,c.yx,c.yy,c.tx,c.ty]),t.vectorOrigination.keyDescriptorList.push(l)}w(e,n())},function(e,t){for(var n=t.vectorOrigination,i={keyDescriptorList:[]},r=0;r<n.keyDescriptorList.length;r++){var o=n.keyDescriptorList[r];i.keyDescriptorList.push({});var a=i.keyDescriptorList[i.keyDescriptorList.length-1];o.keyOriginType!=null&&(a.keyOriginType=o.keyOriginType),o.keyOriginResolution!=null&&(a.keyOriginResolution=o.keyOriginResolution);var l=o.keyOriginRRectRadii;l&&(a.keyOriginRRectRadii={unitValueQuadVersion:1,topRight:ee(l.topRight,"topRight"),topLeft:ee(l.topLeft,"topLeft"),bottomLeft:ee(l.bottomLeft,"bottomLeft"),bottomRight:ee(l.bottomRight,"bottomRight")});var u=o.keyOriginShapeBoundingBox;u&&(a.keyOriginShapeBBox={unitValueQuadVersion:1,"Top ":ee(u.top,"top"),Left:ee(u.left,"left"),Btom:ee(u.bottom,"bottom"),Rght:ee(u.right,"right")});var s=o.keyOriginBoxCorners;s&&s.length===4&&(a.keyOriginBoxCorners={rectangleCornerA:{Hrzn:s[0].x,Vrtc:s[0].y},rectangleCornerB:{Hrzn:s[1].x,Vrtc:s[1].y},rectangleCornerC:{Hrzn:s[2].x,Vrtc:s[2].y},rectangleCornerD:{Hrzn:s[3].x,Vrtc:s[3].y}});var c=o.transform;c&&c.length===6&&(a.Trnf={xx:c[0],xy:c[1],yx:c[2],yy:c[3],tx:c[4],ty:c[5]}),o.keyShapeInvalidated!=null&&(a.keyShapeInvalidated=o.keyShapeInvalidated),a.keyOriginIndex=r}U(e,1),j(e,"","null",i)});L("lmfx",function(e){return e.effects!==void 0&&Ma(e.effects)},function(e,t,n){var i=C(e);if(i!==0)throw new Error("Invalid lmfx version");var r=V(e);t.effects=Vn(r,!!e.logMissingFeatures),w(e,n())},function(e,t,n,i){var r=Un(t.effects,!!i.logMissingFeatures,!0);D(e,0),j(e,"","null",r)});L("lrFX",q("effects"),function(e,t,n){t.effects||(t.effects=js(e)),w(e,n())},function(e,t){Hs(e,t.effects)});L("luni",q("name"),function(e,t,n){if(n()>4){var i=C(e);n()>=i*2?t.name=ai(e,i):e.logDevFeatures&&e.log("name in luni section is too long")}else e.logDevFeatures&&e.log("empty luni section");w(e,n())},function(e,t){Se(e,t.name)});L("lnsr",q("nameSource"),function(e,t){return t.nameSource=Q(e)},function(e,t){return _(e,t.nameSource)});L("lyid",q("id"),function(e,t){t.id=C(e)},function(e,t,n,i){for(var r=t.id;i.layerIds.has(r);)r+=100;D(e,r),i.layerIds.add(r),i.layerToId.set(t,r)});L("lsct",q("sectionDivider"),function(e,t,n){t.sectionDivider={type:C(e)},n()&&(qe(e,"8BIM"),t.sectionDivider.key=Q(e)),n()&&(t.sectionDivider.subType=C(e))},function(e,t){D(e,t.sectionDivider.type),t.sectionDivider.key&&(_(e,"8BIM"),_(e,t.sectionDivider.key),t.sectionDivider.subType!==void 0&&D(e,t.sectionDivider.subType))});Cn("lsdk","lsct");L("clbl",q("blendClippendElements"),function(e,t){t.blendClippendElements=!!P(e),w(e,3)},function(e,t){T(e,t.blendClippendElements?1:0),$(e,3)});L("infx",q("blendInteriorElements"),function(e,t){t.blendInteriorElements=!!P(e),w(e,3)},function(e,t){T(e,t.blendInteriorElements?1:0),$(e,3)});L("knko",q("knockout"),function(e,t){t.knockout=!!P(e),w(e,3)},function(e,t){T(e,t.knockout?1:0),$(e,3)});L("lmgm",q("layerMaskAsGlobalMask"),function(e,t){t.layerMaskAsGlobalMask=!!P(e),w(e,3)},function(e,t){T(e,t.layerMaskAsGlobalMask?1:0),$(e,3)});L("lspf",q("protected"),function(e,t){var n=C(e);t.protected={transparency:(n&1)!==0,composite:(n&2)!==0,position:(n&4)!==0},n&8&&(t.protected.artboards=!0)},function(e,t){var n=(t.protected.transparency?1:0)|(t.protected.composite?2:0)|(t.protected.position?4:0)|(t.protected.artboards?8:0);D(e,n)});L("lclr",q("layerColor"),function(e,t){var n=I(e);w(e,6),t.layerColor=ji[n]},function(e,t){var n=ji.indexOf(t.layerColor);x(e,n===-1?0:n),$(e,6)});L("shmd",function(e){return e.timestamp!==void 0||e.animationFrames!==void 0||e.animationFrameFlags!==void 0||e.timeline!==void 0||e.comps!==void 0},function(e,t,n){for(var i=C(e),r=function(a){qe(e,"8BIM");var l=Q(e);P(e),w(e,3),Fe(e,1,function(u){if(l==="cust"){var s=V(e);s.layerTime!==void 0&&(t.timestamp=s.layerTime)}else if(l==="mlst"){var s=V(e);t.animationFrames=[];for(var c=0;c<s.LaSt.length;c++){var d=s.LaSt[c],p={frames:d.FrLs};d.enab!==void 0&&(p.enable=d.enab),d.Ofst&&(p.offset=Mn(d.Ofst)),d.FXRf&&(p.referencePoint=Mn(d.FXRf)),d.Lefx&&(p.effects=Vn(d.Lefx,!!e.logMissingFeatures)),d.blendOptions&&d.blendOptions.Opct&&(p.opacity=J(d.blendOptions.Opct)),t.animationFrames.push(p)}}else if(l==="mdyn"){I(e);var h=P(e),g=P(e);t.animationFrameFlags={propagateFrameOne:!h,unifyLayerPosition:(g&1)!==0,unifyLayerStyle:(g&2)!==0,unifyLayerVisibility:(g&4)!==0}}else if(l==="tmln"){var s=V(e),v=s.timeScope,F={start:he(v.Strt),duration:he(v.duration),inTime:he(v.inTime),outTime:he(v.outTime),autoScope:s.autoScope,audioLevel:s.audioLevel};s.trackList&&(F.tracks=Po(s.trackList,!!e.logMissingFeatures)),t.timeline=F}else if(l==="cmls"){var s=V(e);t.comps={settings:[]},s.origFXRefPoint&&(t.comps.originalEffectsReferencePoint={x:s.origFXRefPoint.Hrzn,y:s.origFXRefPoint.Vrtc});for(var y=0,m=s.layerSettings;y<m.length;y++){var b=m[y];t.comps.settings.push({compList:b.compList});var S=t.comps.settings[t.comps.settings.length-1];"enab"in b&&(S.enabled=b.enab),b.Ofst&&(S.offset={x:b.Ofst.Hrzn,y:b.Ofst.Vrtc}),b.FXRefPoint&&(S.effectsReferencePoint={x:b.FXRefPoint.Hrzn,y:b.FXRefPoint.Vrtc})}}else if(l==="extn"){var s=V(e);e.logMissingFeatures&&e.log('Unhandled "shmd" section key',l)}else e.logMissingFeatures&&e.log('Unhandled "shmd" section key',l);w(e,u())})},o=0;o<i;o++)r();w(e,n())},function(e,t,n,i){var r=t.animationFrames,o=t.animationFrameFlags,a=t.timestamp,l=t.timeline,u=t.comps,s=0;r&&s++,o&&s++,l&&s++,a!==void 0&&s++,u&&s++,D(e,s),r&&(_(e,"8BIM"),_(e,"mlst"),T(e,0),$(e,3),tn(e,2,function(){for(var c,d={LaID:(c=t.id)!==null&&c!==void 0?c:0,LaSt:[]},p=0;p<r.length;p++){var h=r[p],g={};h.enable!==void 0&&(g.enab=h.enable),g.FrLs=h.frames,h.offset&&(g.Ofst=Rn(h.offset)),h.referencePoint&&(g.FXRf=Rn(h.referencePoint)),h.effects&&(g.Lefx=Un(h.effects,!1,!1)),h.opacity!==void 0&&(g.blendOptions={Opct:ae(h.opacity)}),d.LaSt.push(g)}j(e,"","null",d)},!0)),o&&(_(e,"8BIM"),_(e,"mdyn"),T(e,0),$(e,3),tn(e,2,function(){x(e,0),T(e,o.propagateFrameOne?0:15),T(e,(o.unifyLayerPosition?1:0)|(o.unifyLayerStyle?2:0)|(o.unifyLayerVisibility?4:0))})),l&&(_(e,"8BIM"),_(e,"tmln"),T(e,0),$(e,3),tn(e,2,function(){var c={Vrsn:1,timeScope:{Vrsn:1,Strt:l.start,duration:l.duration,inTime:l.inTime,outTime:l.outTime},autoScope:l.autoScope,audioLevel:l.audioLevel};l.tracks&&(c.trackList=Ao(l.tracks));var d=i.layerToId.get(t)||t.id;if(!d)throw new Error("You need to provide layer.id value whan writing document with animations");c.LyrI=d,j(e,"","null",c,"anim")},!0)),a!==void 0&&(_(e,"8BIM"),_(e,"cust"),T(e,0),$(e,3),tn(e,2,function(){var c={layerTime:a};j(e,"","metadata",c)},!0)),u&&(_(e,"8BIM"),_(e,"cmls"),T(e,0),$(e,3),tn(e,2,function(){var c=i.layerToId.get(t)||t.id;if(!c)throw new Error("You need to provide layer.id value whan writing document with layer comps");var d={};u.originalEffectsReferencePoint&&(d.origFXRefPoint={Hrzn:u.originalEffectsReferencePoint.x,Vrtc:u.originalEffectsReferencePoint.y}),d.LyrI=c,d.layerSettings=[];for(var p=0,h=u.settings;p<h.length;p++){var g=h[p],v={};g.enabled!==void 0&&(v.enab=g.enabled),g.offset&&(v.Ofst={Hrzn:g.offset.x,Vrtc:g.offset.y}),g.effectsReferencePoint&&(v.FXRefPoint={Hrzn:g.effectsReferencePoint.x,Vrtc:g.effectsReferencePoint.y}),v.compList=g.compList,d.layerSettings.push(v)}j(e,"","null",d)},!0))});L("PxSc",function(){return!1},function(e,t){var n=V(e,!0);n.pixelSourceType===1986285651?t.pixelSource={type:"vdPS",origin:{x:n.origin.Hrzn,y:n.origin.Vrtc},interpretation:{interpretAlpha:n.interpretation.interpretAlpha.split(".")[1],profile:n.interpretation.profile},frameReader:{type:"QTFR",link:{name:n.frameReader["Lnk "]["Nm "],fullPath:n.frameReader["Lnk "].fullPath,originalPath:n.frameReader["Lnk "].originalPath,relativePath:n.frameReader["Lnk "].relPath,alias:n.frameReader["Lnk "].alis},mediaDescriptor:n.frameReader.mediaDescriptor},showAlteredVideo:n.showAlteredVideo}:e.log("Unknown pixelSourceType")},function(e,t){var n=t.pixelSource,i={_name:"",_classID:"PixelSource",pixelSourceType:1986285651,descVersion:1,origin:{Hrzn:n.origin.x,Vrtc:n.origin.y},interpretation:{_name:"",_classID:"footageInterpretation",Vrsn:1,interpretAlpha:"alphaInterpretation.".concat(n.interpretation.interpretAlpha),profile:n.interpretation.profile},frameReader:{_name:"",_classID:"FrameReader",frameReaderType:1364477522,descVersion:1,"Lnk ":{_name:"",_classID:"ExternalFileLink",descVersion:2,"Nm ":n.frameReader.link.name,fullPath:n.frameReader.link.fullPath,originalPath:n.frameReader.link.originalPath,alis:n.frameReader.link.alias,relPath:n.frameReader.link.relativePath},mediaDescriptor:n.frameReader.mediaDescriptor},showAlteredVideo:n.showAlteredVideo};j(e,"","PixelSource",i)});L("vstk",q("vectorStroke"),function(e,t,n){var i=V(e);t.vectorStroke={strokeEnabled:i.strokeEnabled,fillEnabled:i.fillEnabled,lineWidth:K(i.strokeStyleLineWidth),lineDashOffset:K(i.strokeStyleLineDashOffset),miterLimit:i.strokeStyleMiterLimit,lineCapType:mr.decode(i.strokeStyleLineCapType),lineJoinType:gr.decode(i.strokeStyleLineJoinType),lineAlignment:br.decode(i.strokeStyleLineAlignment),scaleLock:i.strokeStyleScaleLock,strokeAdjust:i.strokeStyleStrokeAdjust,lineDashSet:i.strokeStyleLineDashSet.map(K),blendMode:Ce.decode(i.strokeStyleBlendMode),opacity:J(i.strokeStyleOpacity),content:jn(i.strokeStyleContent),resolution:i.strokeStyleResolution},w(e,n())},function(e,t){var n,i,r,o=t.vectorStroke,a={strokeStyleVersion:2,strokeEnabled:!!o.strokeEnabled,fillEnabled:!!o.fillEnabled,strokeStyleLineWidth:o.lineWidth||{value:3,units:"Points"},strokeStyleLineDashOffset:o.lineDashOffset||{value:0,units:"Points"},strokeStyleMiterLimit:(n=o.miterLimit)!==null&&n!==void 0?n:100,strokeStyleLineCapType:mr.encode(o.lineCapType),strokeStyleLineJoinType:gr.encode(o.lineJoinType),strokeStyleLineAlignment:br.encode(o.lineAlignment),strokeStyleScaleLock:!!o.scaleLock,strokeStyleStrokeAdjust:!!o.strokeAdjust,strokeStyleLineDashSet:o.lineDashSet||[],strokeStyleBlendMode:Ce.encode(o.blendMode),strokeStyleOpacity:ae((i=o.opacity)!==null&&i!==void 0?i:1),strokeStyleContent:Hn(o.content||{type:"color",color:{r:0,g:0,b:0}}).descriptor,strokeStyleResolution:(r=o.resolution)!==null&&r!==void 0?r:72};j(e,"","strokeStyle",a)});L("artb",q("artboard"),function(e,t,n){var i=V(e),r=i.artboardRect;t.artboard={rect:{top:r["Top "],left:r.Left,bottom:r.Btom,right:r.Rght},guideIndices:i.guideIndeces,presetName:i.artboardPresetName,color:Te(i["Clr "]),backgroundType:i.artboardBackgroundType},w(e,n())},function(e,t){var n,i=t.artboard,r=i.rect,o={artboardRect:{"Top ":r.top,Left:r.left,Btom:r.bottom,Rght:r.right},guideIndeces:i.guideIndices||[],artboardPresetName:i.presetName||"","Clr ":Oe(i.color),artboardBackgroundType:(n=i.backgroundType)!==null&&n!==void 0?n:1};j(e,"","artboard",o)});L("sn2P",q("usingAlignedRendering"),function(e,t){return t.usingAlignedRendering=!!C(e)},function(e,t){return D(e,t.usingAlignedRendering?1:0)});var gn=["unknown","vector","raster","image stack"];function Ta(e){var t,n,i,r,o,a,l=f(f({style:ii.decode(e.warpStyle)},e.warpValues?{values:e.warpValues}:{value:e.warpValue||0}),{perspective:e.warpPerspective||0,perspectiveOther:e.warpPerspectiveOther||0,rotate:_n.decode(e.warpRotate),bounds:e.bounds&&{top:Ke(e.bounds["Top "]),left:Ke(e.bounds.Left),bottom:Ke(e.bounds.Btom),right:Ke(e.bounds.Rght)},uOrder:e.uOrder,vOrder:e.vOrder});(e.deformNumRows!=null||e.deformNumCols!=null)&&(l.deformNumRows=e.deformNumRows,l.deformNumCols=e.deformNumCols);var u=e.customEnvelopeWarp;if(u){l.customEnvelopeWarp={meshPoints:[]};for(var s=((t=u.meshPoints.find(function(p){return p.type==="Hrzn"}))===null||t===void 0?void 0:t.values)||[],c=((n=u.meshPoints.find(function(p){return p.type==="Vrtc"}))===null||n===void 0?void 0:n.values)||[],d=0;d<s.length;d++)l.customEnvelopeWarp.meshPoints.push({x:s[d],y:c[d]});(u.quiltSliceX||u.quiltSliceY)&&(l.customEnvelopeWarp.quiltSliceX=((r=(i=u.quiltSliceX)===null||i===void 0?void 0:i[0])===null||r===void 0?void 0:r.values)||[],l.customEnvelopeWarp.quiltSliceY=((a=(o=u.quiltSliceY)===null||o===void 0?void 0:o[0])===null||a===void 0?void 0:a.values)||[])}return l}function fi(e){var t,n;return e.deformNumCols!=null||e.deformNumRows!=null||((t=e.customEnvelopeWarp)===null||t===void 0?void 0:t.quiltSliceX)||((n=e.customEnvelopeWarp)===null||n===void 0?void 0:n.quiltSliceY)}function vt(e){var t=e.bounds,n=f(f({warpStyle:ii.encode(e.style)},e.values?{warpValues:e.values}:{warpValue:e.value||0}),{warpPerspective:e.perspective||0,warpPerspectiveOther:e.perspectiveOther||0,warpRotate:_n.encode(e.rotate),bounds:{"Top ":ee(t&&t.top||{units:"Pixels",value:0},"bounds.top"),Left:ee(t&&t.left||{units:"Pixels",value:0},"bounds.left"),Btom:ee(t&&t.bottom||{units:"Pixels",value:0},"bounds.bottom"),Rght:ee(t&&t.right||{units:"Pixels",value:0},"bounds.right")},uOrder:e.uOrder||0,vOrder:e.vOrder||0}),i=fi(e);if(i){var r=n;r.deformNumRows=e.deformNumRows||0,r.deformNumCols=e.deformNumCols||0}var o=e.customEnvelopeWarp;if(o){var a=o.meshPoints||[];if(i){var r=n;r.customEnvelopeWarp={_name:"",_classID:"customEnvelopeWarp",quiltSliceX:[{type:"quiltSliceX",values:o.quiltSliceX||[]}],quiltSliceY:[{type:"quiltSliceY",values:o.quiltSliceY||[]}],meshPoints:[{type:"Hrzn",values:a.map(function(u){return u.x})},{type:"Vrtc",values:a.map(function(u){return u.y})}]}}else n.customEnvelopeWarp={_name:"",_classID:"customEnvelopeWarp",meshPoints:[{type:"Hrzn",values:a.map(function(l){return l.x})},{type:"Vrtc",values:a.map(function(l){return l.y})}]}}return n}L("PlLd",q("placedLayer"),function(e,t,n){if(Q(e)!=="plcL")throw new Error("Invalid PlLd signature");if(O(e)!==3)throw new Error("Invalid PlLd version");var i=$e(e,1),r=O(e),o=O(e);O(e);var a=O(e);if(!gn[a])throw new Error("Invalid PlLd type");for(var l=[],u=0;u<8;u++)l.push(ke(e));var s=O(e);if(s!==0)throw new Error("Invalid Warp version ".concat(s));var c=V(e);t.placedLayer=t.placedLayer||{id:i,type:gn[a],pageNumber:r,totalPages:o,transform:l,warp:Ta(c)},w(e,n())},function(e,t){var n=t.placedLayer;if(_(e,"plcL"),U(e,3),!n.id||typeof n.id!="string"||!/^[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}$/.test(n.id))throw new Error("Placed layer ID must be in a GUID format (example: 20953ddb-9391-11ec-b4f1-c15674f50bc4)");if(yn(e,n.id,1),U(e,1),U(e,1),U(e,16),gn.indexOf(n.type)===-1)throw new Error("Invalid placedLayer type");U(e,gn.indexOf(n.type));for(var i=0;i<8;i++)Be(e,n.transform[i]);U(e,0);var r=Oa(n),o=fi(r),a=o?"quiltWarp":"warp";j(e,"",a,vt(r),a)});function lu(e){return new Float32Array(e.buffer.slice(e.byteOffset),0,e.byteLength/4)}function su(e){return new Uint32Array(e.buffer.slice(e.byteOffset),0,e.byteLength/4)}function Ut(e){return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}function ct(e){for(var t=[],n=0;n<e.length;n+=2)t.push({x:e[n],y:e[n+1]});return t}function kn(e){for(var t=[],n=0;n<e.length;n++)t.push(e[n].x,e[n].y);return t}function Nr(e){return ct(lu(e))}function Dn(e){return{x:K(e.Hrzn),y:K(e.Vrtc)}}function Pn(e){return{_name:"",_classID:"Pnt ",Hrzn:ee(e.x,"x"),Vrtc:ee(e.y,"y")}}function uu(e,t){var n={name:e["Nm "],opacity:J(e.blendOptions.Opct),blendMode:Ce.decode(e.blendOptions["Md "]),enabled:e.enab,hasOptions:e.hasoptions,foregroundColor:Te(e.FrgC),backgroundColor:Te(e.BckC)};if("Fltr"in e)switch(e.Fltr._classID){case"boxblur":return f(f({},n),{type:"box blur",filter:{radius:K(e.Fltr["Rds "])}});case"GsnB":return f(f({},n),{type:"gaussian blur",filter:{radius:K(e.Fltr["Rds "])}});case"MtnB":return f(f({},n),{type:"motion blur",filter:{angle:e.Fltr.Angl,distance:K(e.Fltr.Dstn)}});case"RdlB":return f(f({},n),{type:"radial blur",filter:{amount:e.Fltr.Amnt,method:jo.decode(e.Fltr.BlrM),quality:Ho.decode(e.Fltr.BlrQ)}});case"shapeBlur":return f(f({},n),{type:"shape blur",filter:{radius:K(e.Fltr["Rds "]),customShape:{name:e.Fltr.customShape["Nm "],id:e.Fltr.customShape.Idnt}}});case"SmrB":return f(f({},n),{type:"smart blur",filter:{radius:e.Fltr["Rds "],threshold:e.Fltr.Thsh,quality:Xo.decode(e.Fltr.SmBQ),mode:Wo.decode(e.Fltr.SmBM)}});case"surfaceBlur":return f(f({},n),{type:"surface blur",filter:{radius:K(e.Fltr["Rds "]),threshold:e.Fltr.Thsh}});case"Dspl":return f(f({},n),{type:"displace",filter:{horizontalScale:e.Fltr.HrzS,verticalScale:e.Fltr.VrtS,displacementMap:Zo.decode(e.Fltr.DspM),undefinedAreas:bn.decode(e.Fltr.UndA),displacementFile:{signature:e.Fltr.DspF.sig,path:e.Fltr.DspF.path}}});case"Pnch":return f(f({},n),{type:"pinch",filter:{amount:e.Fltr.Amnt}});case"Plr ":return f(f({},n),{type:"polar coordinates",filter:{conversion:Yo.decode(e.Fltr.Cnvr)}});case"Rple":return f(f({},n),{type:"ripple",filter:{amount:e.Fltr.Amnt,size:Ko.decode(e.Fltr.RplS)}});case"Shr ":return f(f({},n),{type:"shear",filter:{shearPoints:e.Fltr.ShrP.map(function(l){return{x:l.Hrzn,y:l.Vrtc}}),shearStart:e.Fltr.ShrS,shearEnd:e.Fltr.ShrE,undefinedAreas:bn.decode(e.Fltr.UndA)}});case"Sphr":return f(f({},n),{type:"spherize",filter:{amount:e.Fltr.Amnt,mode:$o.decode(e.Fltr.SphM)}});case"Twrl":return f(f({},n),{type:"twirl",filter:{angle:e.Fltr.Angl}});case"Wave":return f(f({},n),{type:"wave",filter:{numberOfGenerators:e.Fltr.NmbG,type:qo.decode(e.Fltr.Wvtp),wavelength:{min:e.Fltr.WLMn,max:e.Fltr.WLMx},amplitude:{min:e.Fltr.AmMn,max:e.Fltr.AmMx},scale:{x:e.Fltr.SclH,y:e.Fltr.SclV},randomSeed:e.Fltr.RndS,undefinedAreas:bn.decode(e.Fltr.UndA)}});case"ZgZg":return f(f({},n),{type:"zigzag",filter:{amount:e.Fltr.Amnt,ridges:e.Fltr.NmbR,style:Jo.decode(e.Fltr.ZZTy)}});case"AdNs":return f(f({},n),{type:"add noise",filter:{amount:J(e.Fltr.Nose),distribution:Qo.decode(e.Fltr.Dstr),monochromatic:e.Fltr.Mnch,randomSeed:e.Fltr.FlRs}});case"DstS":return f(f({},n),{type:"dust and scratches",filter:{radius:e.Fltr["Rds "],threshold:e.Fltr.Thsh}});case"Mdn ":return f(f({},n),{type:"median",filter:{radius:K(e.Fltr["Rds "])}});case"denoise":return f(f({},n),{type:"reduce noise",filter:{preset:e.Fltr.preset,removeJpegArtifact:e.Fltr.removeJPEGArtifact,reduceColorNoise:J(e.Fltr.ClNs),sharpenDetails:J(e.Fltr.Shrp),channelDenoise:e.Fltr.channelDenoise.map(function(l){return f({channels:l.Chnl.map(zn.decode),amount:l.Amnt},l.EdgF?{preserveDetails:l.EdgF}:{})})}});case"ClrH":return f(f({},n),{type:"color halftone",filter:{radius:e.Fltr["Rds "],angle1:e.Fltr.Ang1,angle2:e.Fltr.Ang2,angle3:e.Fltr.Ang3,angle4:e.Fltr.Ang4}});case"Crst":return f(f({},n),{type:"crystallize",filter:{cellSize:e.Fltr.ClSz,randomSeed:e.Fltr.FlRs}});case"Mztn":return f(f({},n),{type:"mezzotint",filter:{type:ea.decode(e.Fltr.MztT),randomSeed:e.Fltr.FlRs}});case"Msc ":return f(f({},n),{type:"mosaic",filter:{cellSize:K(e.Fltr.ClSz)}});case"Pntl":return f(f({},n),{type:"pointillize",filter:{cellSize:e.Fltr.ClSz,randomSeed:e.Fltr.FlRs}});case"Clds":return f(f({},n),{type:"clouds",filter:{randomSeed:e.Fltr.FlRs}});case"DfrC":return f(f({},n),{type:"difference clouds",filter:{randomSeed:e.Fltr.FlRs}});case"Fbrs":return f(f({},n),{type:"fibers",filter:{variance:e.Fltr.Vrnc,strength:e.Fltr.Strg,randomSeed:e.Fltr.RndS}});case"LnsF":return f(f({},n),{type:"lens flare",filter:{brightness:e.Fltr.Brgh,position:{x:e.Fltr.FlrC.Hrzn,y:e.Fltr.FlrC.Vrtc},lensType:na.decode(e.Fltr["Lns "])}});case"smartSharpen":return f(f({},n),{type:"smart sharpen",filter:{amount:J(e.Fltr.Amnt),radius:K(e.Fltr["Rds "]),threshold:e.Fltr.Thsh,angle:e.Fltr.Angl,moreAccurate:e.Fltr.moreAccurate,blur:ta.decode(e.Fltr.blur),preset:e.Fltr.preset,shadow:{fadeAmount:J(e.Fltr.sdwM.Amnt),tonalWidth:J(e.Fltr.sdwM.Wdth),radius:e.Fltr.sdwM["Rds "]},highlight:{fadeAmount:J(e.Fltr.hglM.Amnt),tonalWidth:J(e.Fltr.hglM.Wdth),radius:e.Fltr.hglM["Rds "]}}});case"UnsM":return f(f({},n),{type:"unsharp mask",filter:{amount:J(e.Fltr.Amnt),radius:K(e.Fltr["Rds "]),threshold:e.Fltr.Thsh}});case"Dfs ":return f(f({},n),{type:"diffuse",filter:{mode:ia.decode(e.Fltr["Md "]),randomSeed:e.Fltr.FlRs}});case"Embs":return f(f({},n),{type:"emboss",filter:{angle:e.Fltr.Angl,height:e.Fltr.Hght,amount:e.Fltr.Amnt}});case"Extr":return f(f({},n),{type:"extrude",filter:{type:ra.decode(e.Fltr.ExtT),size:e.Fltr.ExtS,depth:e.Fltr.ExtD,depthMode:oa.decode(e.Fltr.ExtR),randomSeed:e.Fltr.FlRs,solidFrontFaces:e.Fltr.ExtF,maskIncompleteBlocks:e.Fltr.ExtM}});case"Tls ":return f(f({},n),{type:"tiles",filter:{numberOfTiles:e.Fltr.TlNm,maximumOffset:e.Fltr.TlOf,fillEmptyAreaWith:aa.decode(e.Fltr.FlCl),randomSeed:e.Fltr.FlRs}});case"TrcC":return f(f({},n),{type:"trace contour",filter:{level:e.Fltr["Lvl "],edge:la.decode(e.Fltr["Edg "])}});case"Wnd ":return f(f({},n),{type:"wind",filter:{method:sa.decode(e.Fltr.WndM),direction:ua.decode(e.Fltr.Drct)}});case"Dntr":return f(f({},n),{type:"de-interlace",filter:{eliminate:ca.decode(e.Fltr.IntE),newFieldsBy:fa.decode(e.Fltr.IntC)}});case"Cstm":return f(f({},n),{type:"custom",filter:{scale:e.Fltr["Scl "],offset:e.Fltr.Ofst,matrix:e.Fltr.Mtrx}});case"HghP":return f(f({},n),{type:"high pass",filter:{radius:K(e.Fltr["Rds "])}});case"Mxm ":return f(f({},n),{type:"maximum",filter:{radius:K(e.Fltr["Rds "])}});case"Mnm ":return f(f({},n),{type:"minimum",filter:{radius:K(e.Fltr["Rds "])}});case"Ofst":return f(f({},n),{type:"offset",filter:{horizontal:e.Fltr.Hrzn,vertical:e.Fltr.Vrtc,undefinedAreas:da.decode(e.Fltr["Fl "])}});case"rigidTransform":return f(f({},n),{type:"puppet",filter:{rigidType:e.Fltr.rigidType,bounds:[{x:e.Fltr.PuX0,y:e.Fltr.PuY0},{x:e.Fltr.PuX1,y:e.Fltr.PuY1},{x:e.Fltr.PuX2,y:e.Fltr.PuY2},{x:e.Fltr.PuX3,y:e.Fltr.PuY3}],puppetShapeList:e.Fltr.puppetShapeList.map(function(l){return{rigidType:l.rigidType,originalVertexArray:Nr(l.originalVertexArray),deformedVertexArray:Nr(l.deformedVertexArray),indexArray:Array.from(su(l.indexArray)),pinOffsets:ct(l.pinOffsets),posFinalPins:ct(l.posFinalPins),pinVertexIndices:l.pinVertexIndices,selectedPin:l.selectedPin,pinPosition:ct(l.PinP),pinRotation:l.PnRt,pinOverlay:l.PnOv,pinDepth:l.PnDp,meshQuality:l.meshQuality,meshExpansion:l.meshExpansion,meshRigidity:l.meshRigidity,imageResolution:l.imageResolution,meshBoundaryPath:{pathComponents:l.meshBoundaryPath.pathComponents.map(function(u){return{shapeOperation:u.shapeOperation.split(".")[1],paths:u.SbpL.map(function(s){return{closed:s.Clsp,points:s["Pts "].map(function(c){return{anchor:Dn(c.Anch),forward:Dn(c["Fwd "]),backward:Dn(c["Bwd "]),smooth:c.Smoo}})}})}})}}})}});case"PbPl":{for(var i=[],r=e.Fltr,o=0;o<be.length&&r["PN".concat(be[o],"a")];o++)for(var a=0;a<be.length&&r["PN".concat(be[o]).concat(be[a])];a++)i.push({name:r["PN".concat(be[o]).concat(be[a])],value:r["PF".concat(be[o]).concat(be[a])]});return f(f({},n),{type:"oil paint plugin",filter:{name:e.Fltr.KnNm,gpu:e.Fltr.GpuY,lighting:e.Fltr.LIWy,parameters:i}})}case"HsbP":return f(f({},n),{type:"hsb/hsl",filter:{inputMode:ht.decode(e.Fltr.Inpt),rowOrder:ht.decode(e.Fltr.Otpt)}});case"oilPaint":return f(f({},n),{type:"oil paint",filter:{lightingOn:e.Fltr.lightingOn,stylization:e.Fltr.stylization,cleanliness:e.Fltr.cleanliness,brushScale:e.Fltr.brushScale,microBrush:e.Fltr.microBrush,lightDirection:e.Fltr.LghD,specularity:e.Fltr.specularity}});case"LqFy":return f(f({},n),{type:"liquify",filter:{liquifyMesh:e.Fltr.LqMe}});case"perspectiveWarpTransform":return f(f({},n),{type:"perspective warp",filter:{vertices:e.Fltr.vertices.map(Dn),warpedVertices:e.Fltr.warpedVertices.map(Dn),quads:e.Fltr.quads.map(function(l){return l.indices})}});case"Crvs":return f(f({},n),{type:"curves",filter:f({presetKind:ha.decode(e.Fltr.presetKind)},e.Fltr.Adjs?{adjustments:e.Fltr.Adjs.map(function(l){var u=l.Chnl.map(zn.decode);if(l["Crv "])return{channels:u,curve:l["Crv "].map(function(s){var c={x:s.Hrzn,y:s.Vrtc};return s.Cnty&&(c.curved=!0),c})};if(l.Mpng)return{channels:u,values:l.Mpng};throw new Error("Unknown curve adjustment")})}:{})});case"BrgC":return f(f({},n),{type:"brightness/contrast",filter:{brightness:e.Fltr.Brgh,contrast:e.Fltr.Cntr,useLegacy:!!e.Fltr.useLegacy}});default:if(t.throwForMissingFeatures)throw new Error("Unknown filter classId: ".concat(e.Fltr._classID));return}else switch(e.filterID){case 1098281575:return f(f({},n),{type:"average"});case 1114403360:return f(f({},n),{type:"blur"});case 1114403405:return f(f({},n),{type:"blur more"});case 1148416099:return f(f({},n),{type:"despeckle"});case 1180922912:return f(f({},n),{type:"facet"});case 1181902701:return f(f({},n),{type:"fragment"});case 1399353968:return f(f({},n),{type:"sharpen"});case 1399353925:return f(f({},n),{type:"sharpen edges"});case 1399353933:return f(f({},n),{type:"sharpen more"});case 1181639749:return f(f({},n),{type:"find edges"});case 1399616122:return f(f({},n),{type:"solarize"});case 1314149187:return f(f({},n),{type:"ntsc colors"});case 1231976050:return f(f({},n),{type:"invert"});default:if(t.throwForMissingFeatures)throw new Error("Unknown filterID: ".concat(e.filterID))}}function cu(e,t){return{enabled:e.enab,validAtPosition:e.validAtPosition,maskEnabled:e.filterMaskEnable,maskLinked:e.filterMaskLinked,maskExtendWithWhite:e.filterMaskExtendWithWhite,list:e.filterFXList.map(function(n){return uu(n,t)}).filter(function(n){return!!n})}}function Me(e){return ee(e.radius,"radius")}function fu(e){var t={_name:"",_classID:"filterFX","Nm ":e.name,blendOptions:{_name:"",_classID:"blendOptions",Opct:xe(e.opacity),"Md ":Ce.encode(e.blendMode)},enab:e.enabled,hasoptions:e.hasOptions,FrgC:Oe(e.foregroundColor),BckC:Oe(e.backgroundColor)};switch(e.type){case"average":return f(f({},t),{filterID:1098281575});case"blur":return f(f({},t),{filterID:1114403360});case"blur more":return f(f({},t),{filterID:1114403405});case"box blur":return f(f({},t),{Fltr:{_name:"Box Blur",_classID:"boxblur","Rds ":Me(e.filter)},filterID:697});case"gaussian blur":return f(f({},t),{Fltr:{_name:"Gaussian Blur",_classID:"GsnB","Rds ":Me(e.filter)},filterID:1198747202});case"motion blur":return f(f({},t),{Fltr:{_name:"Motion Blur",_classID:"MtnB",Angl:e.filter.angle,Dstn:ee(e.filter.distance,"distance")},filterID:1299476034});case"radial blur":return f(f({},t),{Fltr:{_name:"Radial Blur",_classID:"RdlB",Amnt:e.filter.amount,BlrM:jo.encode(e.filter.method),BlrQ:Ho.encode(e.filter.quality)},filterID:1382313026});case"shape blur":return f(f({},t),{Fltr:{_name:"Shape Blur",_classID:"shapeBlur","Rds ":Me(e.filter),customShape:{_name:"",_classID:"customShape","Nm ":e.filter.customShape.name,Idnt:e.filter.customShape.id}},filterID:702});case"smart blur":return f(f({},t),{Fltr:{_name:"Smart Blur",_classID:"SmrB","Rds ":e.filter.radius,Thsh:e.filter.threshold,SmBQ:Xo.encode(e.filter.quality),SmBM:Wo.encode(e.filter.mode)},filterID:1399681602});case"surface blur":return f(f({},t),{Fltr:{_name:"Surface Blur",_classID:"surfaceBlur","Rds ":Me(e.filter),Thsh:e.filter.threshold},filterID:701});case"displace":return f(f({},t),{Fltr:{_name:"Displace",_classID:"Dspl",HrzS:e.filter.horizontalScale,VrtS:e.filter.verticalScale,DspM:Zo.encode(e.filter.displacementMap),UndA:bn.encode(e.filter.undefinedAreas),DspF:{sig:e.filter.displacementFile.signature,path:e.filter.displacementFile.path}},filterID:1148416108});case"pinch":return f(f({},t),{Fltr:{_name:"Pinch",_classID:"Pnch",Amnt:e.filter.amount},filterID:1349411688});case"polar coordinates":return f(f({},t),{Fltr:{_name:"Polar Coordinates",_classID:"Plr ",Cnvr:Yo.encode(e.filter.conversion)},filterID:1349284384});case"ripple":return f(f({},t),{Fltr:{_name:"Ripple",_classID:"Rple",Amnt:e.filter.amount,RplS:Ko.encode(e.filter.size)},filterID:1383099493});case"shear":return f(f({},t),{Fltr:{_name:"Shear",_classID:"Shr ",ShrP:e.filter.shearPoints.map(function(u){return{_name:"",_classID:"Pnt ",Hrzn:u.x,Vrtc:u.y}}),UndA:bn.encode(e.filter.undefinedAreas),ShrS:e.filter.shearStart,ShrE:e.filter.shearEnd},filterID:1399353888});case"spherize":return f(f({},t),{Fltr:{_name:"Spherize",_classID:"Sphr",Amnt:e.filter.amount,SphM:$o.encode(e.filter.mode)},filterID:1399875698});case"twirl":return f(f({},t),{Fltr:{_name:"Twirl",_classID:"Twrl",Angl:e.filter.angle},filterID:1417114220});case"wave":return f(f({},t),{Fltr:{_name:"Wave",_classID:"Wave",Wvtp:qo.encode(e.filter.type),NmbG:e.filter.numberOfGenerators,WLMn:e.filter.wavelength.min,WLMx:e.filter.wavelength.max,AmMn:e.filter.amplitude.min,AmMx:e.filter.amplitude.max,SclH:e.filter.scale.x,SclV:e.filter.scale.y,UndA:bn.encode(e.filter.undefinedAreas),RndS:e.filter.randomSeed},filterID:1466005093});case"zigzag":return f(f({},t),{Fltr:{_name:"ZigZag",_classID:"ZgZg",Amnt:e.filter.amount,NmbR:e.filter.ridges,ZZTy:Jo.encode(e.filter.style)},filterID:1516722791});case"add noise":return f(f({},t),{Fltr:{_name:"Add Noise",_classID:"AdNs",Dstr:Qo.encode(e.filter.distribution),Nose:xe(e.filter.amount),Mnch:e.filter.monochromatic,FlRs:e.filter.randomSeed},filterID:1097092723});case"despeckle":return f(f({},t),{filterID:1148416099});case"dust and scratches":return f(f({},t),{Fltr:{_name:"Dust & Scratches",_classID:"DstS","Rds ":e.filter.radius,Thsh:e.filter.threshold},filterID:1148417107});case"median":return f(f({},t),{Fltr:{_name:"Median",_classID:"Mdn ","Rds ":Me(e.filter)},filterID:1298427424});case"reduce noise":return f(f({},t),{Fltr:{_name:"Reduce Noise",_classID:"denoise",ClNs:xe(e.filter.reduceColorNoise),Shrp:xe(e.filter.sharpenDetails),removeJPEGArtifact:e.filter.removeJpegArtifact,channelDenoise:e.filter.channelDenoise.map(function(u){return f({_name:"",_classID:"channelDenoiseParams",Chnl:u.channels.map(function(s){return zn.encode(s)}),Amnt:u.amount},u.preserveDetails?{EdgF:u.preserveDetails}:{})}),preset:e.filter.preset},filterID:633});case"color halftone":return f(f({},t),{Fltr:{_name:"Color Halftone",_classID:"ClrH","Rds ":e.filter.radius,Ang1:e.filter.angle1,Ang2:e.filter.angle2,Ang3:e.filter.angle3,Ang4:e.filter.angle4},filterID:1131180616});case"crystallize":return f(f({},t),{Fltr:{_name:"Crystallize",_classID:"Crst",ClSz:e.filter.cellSize,FlRs:e.filter.randomSeed},filterID:1131574132});case"facet":return f(f({},t),{filterID:1180922912});case"fragment":return f(f({},t),{filterID:1181902701});case"mezzotint":return f(f({},t),{Fltr:{_name:"Mezzotint",_classID:"Mztn",MztT:ea.encode(e.filter.type),FlRs:e.filter.randomSeed},filterID:1299870830});case"mosaic":return f(f({},t),{Fltr:{_name:"Mosaic",_classID:"Msc ",ClSz:ee(e.filter.cellSize,"cellSize")},filterID:1299407648});case"pointillize":return f(f({},t),{Fltr:{_name:"Pointillize",_classID:"Pntl",ClSz:e.filter.cellSize,FlRs:e.filter.randomSeed},filterID:1349416044});case"clouds":return f(f({},t),{Fltr:{_name:"Clouds",_classID:"Clds",FlRs:e.filter.randomSeed},filterID:1131177075});case"difference clouds":return f(f({},t),{Fltr:{_name:"Difference Clouds",_classID:"DfrC",FlRs:e.filter.randomSeed},filterID:1147564611});case"fibers":return f(f({},t),{Fltr:{_name:"Fibers",_classID:"Fbrs",Vrnc:e.filter.variance,Strg:e.filter.strength,RndS:e.filter.randomSeed},filterID:1180856947});case"lens flare":return f(f({},t),{Fltr:{_name:"Lens Flare",_classID:"LnsF",Brgh:e.filter.brightness,FlrC:{_name:"",_classID:"Pnt ",Hrzn:e.filter.position.x,Vrtc:e.filter.position.y},"Lns ":na.encode(e.filter.lensType)},filterID:1282306886});case"sharpen":return f(f({},t),{filterID:1399353968});case"sharpen edges":return f(f({},t),{filterID:1399353925});case"sharpen more":return f(f({},t),{filterID:1399353933});case"smart sharpen":return f(f({},t),{Fltr:{_name:"Smart Sharpen",_classID:"smartSharpen",Amnt:xe(e.filter.amount),"Rds ":Me(e.filter),Thsh:e.filter.threshold,Angl:e.filter.angle,moreAccurate:e.filter.moreAccurate,blur:ta.encode(e.filter.blur),preset:e.filter.preset,sdwM:{_name:"Parameters",_classID:"adaptCorrectTones",Amnt:xe(e.filter.shadow.fadeAmount),Wdth:xe(e.filter.shadow.tonalWidth),"Rds ":e.filter.shadow.radius},hglM:{_name:"Parameters",_classID:"adaptCorrectTones",Amnt:xe(e.filter.highlight.fadeAmount),Wdth:xe(e.filter.highlight.tonalWidth),"Rds ":e.filter.highlight.radius}},filterID:698});case"unsharp mask":return f(f({},t),{Fltr:{_name:"Unsharp Mask",_classID:"UnsM",Amnt:xe(e.filter.amount),"Rds ":Me(e.filter),Thsh:e.filter.threshold},filterID:1433301837});case"diffuse":return f(f({},t),{Fltr:{_name:"Diffuse",_classID:"Dfs ","Md ":ia.encode(e.filter.mode),FlRs:e.filter.randomSeed},filterID:1147564832});case"emboss":return f(f({},t),{Fltr:{_name:"Emboss",_classID:"Embs",Angl:e.filter.angle,Hght:e.filter.height,Amnt:e.filter.amount},filterID:1164796531});case"extrude":return f(f({},t),{Fltr:{_name:"Extrude",_classID:"Extr",ExtS:e.filter.size,ExtD:e.filter.depth,ExtF:e.filter.solidFrontFaces,ExtM:e.filter.maskIncompleteBlocks,ExtT:ra.encode(e.filter.type),ExtR:oa.encode(e.filter.depthMode),FlRs:e.filter.randomSeed},filterID:1165522034});case"find edges":return f(f({},t),{filterID:1181639749});case"solarize":return f(f({},t),{filterID:1399616122});case"tiles":return f(f({},t),{Fltr:{_name:"Tiles",_classID:"Tls ",TlNm:e.filter.numberOfTiles,TlOf:e.filter.maximumOffset,FlCl:aa.encode(e.filter.fillEmptyAreaWith),FlRs:e.filter.randomSeed},filterID:1416393504});case"trace contour":return f(f({},t),{Fltr:{_name:"Trace Contour",_classID:"TrcC","Lvl ":e.filter.level,"Edg ":la.encode(e.filter.edge)},filterID:1416782659});case"wind":return f(f({},t),{Fltr:{_name:"Wind",_classID:"Wnd ",WndM:sa.encode(e.filter.method),Drct:ua.encode(e.filter.direction)},filterID:1466852384});case"de-interlace":return f(f({},t),{Fltr:{_name:"De-Interlace",_classID:"Dntr",IntE:ca.encode(e.filter.eliminate),IntC:fa.encode(e.filter.newFieldsBy)},filterID:1148089458});case"ntsc colors":return f(f({},t),{filterID:1314149187});case"invert":return f(f({},t),{filterID:1231976050});case"custom":return f(f({},t),{Fltr:{_name:"Custom",_classID:"Cstm","Scl ":e.filter.scale,Ofst:e.filter.offset,Mtrx:e.filter.matrix},filterID:1131639917});case"high pass":return f(f({},t),{Fltr:{_name:"High Pass",_classID:"HghP","Rds ":Me(e.filter)},filterID:1214736464});case"maximum":return f(f({},t),{Fltr:{_name:"Maximum",_classID:"Mxm ","Rds ":Me(e.filter)},filterID:1299737888});case"minimum":return f(f({},t),{Fltr:{_name:"Minimum",_classID:"Mnm ","Rds ":Me(e.filter)},filterID:1299082528});case"offset":return f(f({},t),{Fltr:{_name:"Offset",_classID:"Ofst",Hrzn:e.filter.horizontal,Vrtc:e.filter.vertical,"Fl ":da.encode(e.filter.undefinedAreas)},filterID:1332114292});case"puppet":return f(f({},t),{Fltr:{_name:"Rigid Transform",_classID:"rigidTransform",null:["Ordn.Trgt"],rigidType:e.filter.rigidType,puppetShapeList:e.filter.puppetShapeList.map(function(u){return{_name:"",_classID:"puppetShape",rigidType:u.rigidType,VrsM:1,VrsN:0,originalVertexArray:Ut(new Float32Array(kn(u.originalVertexArray))),deformedVertexArray:Ut(new Float32Array(kn(u.deformedVertexArray))),indexArray:Ut(new Uint32Array(u.indexArray)),pinOffsets:kn(u.pinOffsets),posFinalPins:kn(u.posFinalPins),pinVertexIndices:u.pinVertexIndices,PinP:kn(u.pinPosition),PnRt:u.pinRotation,PnOv:u.pinOverlay,PnDp:u.pinDepth,meshQuality:u.meshQuality,meshExpansion:u.meshExpansion,meshRigidity:u.meshRigidity,imageResolution:u.imageResolution,meshBoundaryPath:{_name:"",_classID:"pathClass",pathComponents:u.meshBoundaryPath.pathComponents.map(function(s){return{_name:"",_classID:"PaCm",shapeOperation:"shapeOperation.".concat(s.shapeOperation),SbpL:s.paths.map(function(c){return{_name:"",_classID:"Sbpl",Clsp:c.closed,"Pts ":c.points.map(function(d){return{_name:"",_classID:"Pthp",Anch:Pn(d.anchor),"Fwd ":Pn(d.forward),"Bwd ":Pn(d.backward),Smoo:d.smooth}})}})}})},selectedPin:u.selectedPin}}),PuX0:e.filter.bounds[0].x,PuX1:e.filter.bounds[1].x,PuX2:e.filter.bounds[2].x,PuX3:e.filter.bounds[3].x,PuY0:e.filter.bounds[0].y,PuY1:e.filter.bounds[1].y,PuY2:e.filter.bounds[2].y,PuY3:e.filter.bounds[3].y},filterID:991});case"oil paint plugin":{for(var n={},i=0;i<e.filter.parameters.length;i++){var r=e.filter.parameters[i],o=r.name,a=r.value,l="".concat(be[Math.floor(i/be.length)]).concat(be[i%be.length]);n["PN".concat(l)]=o,n["PT".concat(l)]=0,n["PF".concat(l)]=a}return f(f({},t),{Fltr:f({_name:"Oil Paint Plugin",_classID:"PbPl",KnNm:e.filter.name,GpuY:e.filter.gpu,LIWy:e.filter.lighting,FPth:"1"},n),filterID:1348620396})}case"oil paint":return f(f({},t),{Fltr:{_name:"Oil Paint",_classID:"oilPaint",lightingOn:e.filter.lightingOn,stylization:e.filter.stylization,cleanliness:e.filter.cleanliness,brushScale:e.filter.brushScale,microBrush:e.filter.microBrush,LghD:e.filter.lightDirection,specularity:e.filter.specularity},filterID:1122});case"liquify":return f(f({},t),{Fltr:{_name:"Liquify",_classID:"LqFy",LqMe:e.filter.liquifyMesh},filterID:1282492025});case"perspective warp":return f(f({},t),{Fltr:{_name:"Perspective Warp",_classID:"perspectiveWarpTransform",vertices:e.filter.vertices.map(Pn),warpedVertices:e.filter.warpedVertices.map(Pn),quads:e.filter.quads.map(function(u){return{indices:u}})},filterID:442});case"curves":return f(f({},t),{Fltr:f({_name:"Curves",_classID:"Crvs",presetKind:ha.encode(e.filter.presetKind)},e.filter.adjustments?{Adjs:e.filter.adjustments.map(function(u){return"curve"in u?{_name:"",_classID:"CrvA",Chnl:u.channels.map(zn.encode),"Crv ":u.curve.map(function(s){return f({_name:"",_classID:"Pnt ",Hrzn:s.x,Vrtc:s.y},s.curved?{Cnty:!0}:{})})}:{_name:"",_classID:"CrvA",Chnl:u.channels.map(zn.encode),Mpng:u.values}})}:{}),filterID:1131574899});case"brightness/contrast":return f(f({},t),{Fltr:{_name:"Brightness/Contrast",_classID:"BrgC",Brgh:e.filter.brightness,Cntr:e.filter.contrast,useLegacy:!!e.filter.useLegacy},filterID:1114793795});default:throw new Error("Unknow filter type: ".concat(e.type))}}function Oa(e){if(e.warp)return e.warp;if(!e.width||!e.height)throw new Error("You must provide width and height of the linked image in placedLayer");var t=e.width,n=e.height,i=0,r=t/3,o=t*2/3,a=t,l=0,u=n/3,s=n*2/3,c=n;return{style:"custom",value:0,perspective:0,perspectiveOther:0,rotate:"horizontal",bounds:{top:{value:0,units:"Pixels"},left:{value:0,units:"Pixels"},bottom:{value:n,units:"Pixels"},right:{value:t,units:"Pixels"}},uOrder:4,vOrder:4,customEnvelopeWarp:{meshPoints:[{x:i,y:l},{x:r,y:l},{x:o,y:l},{x:a,y:l},{x:i,y:u},{x:r,y:u},{x:o,y:u},{x:a,y:u},{x:i,y:s},{x:r,y:s},{x:o,y:s},{x:a,y:s},{x:i,y:c},{x:r,y:c},{x:o,y:c},{x:a,y:c}]}}}L("SoLd",q("placedLayer"),function(e,t,n){if(Q(e)!=="soLD")throw new Error("Invalid SoLd type");var i=O(e);if(i!==4&&i!==5)throw new Error("Invalid SoLd version");var r=V(e,!0);t.placedLayer={id:r.Idnt,placed:r.placed,type:gn[r.Type],pageNumber:r.PgNm,totalPages:r.totalPages,frameStep:he(r.frameStep),duration:he(r.duration),frameCount:r.frameCount,transform:r.Trnf,width:r["Sz "].Wdth,height:r["Sz "].Hght,resolution:K(r.Rslt),warp:Ta(r.quiltWarp||r.warp)},r.nonAffineTransform&&r.nonAffineTransform.some(function(o,a){return o!==r.Trnf[a]})&&(t.placedLayer.nonAffineTransform=r.nonAffineTransform),r.Crop&&(t.placedLayer.crop=r.Crop),r.comp&&(t.placedLayer.comp=r.comp),r.compInfo&&(t.placedLayer.compInfo={compID:r.compInfo.compID,originalCompID:r.compInfo.originalCompID}),r.filterFX&&(t.placedLayer.filter=cu(r.filterFX,e)),w(e,n())},function(e,t){var n,i;_(e,"soLD"),U(e,4);var r=t.placedLayer;if(!r.id||typeof r.id!="string"||!/^[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}$/.test(r.id))throw new Error("Placed layer ID must be in a GUID format (example: 20953ddb-9391-11ec-b4f1-c15674f50bc4)");var o=f(f({Idnt:r.id,placed:(n=r.placed)!==null&&n!==void 0?n:r.id,PgNm:r.pageNumber||1,totalPages:r.totalPages||1},r.crop?{Crop:r.crop}:{}),{frameStep:r.frameStep||{numerator:0,denominator:600},duration:r.duration||{numerator:0,denominator:600},frameCount:r.frameCount||0,Annt:16,Type:gn.indexOf(r.type),Trnf:r.transform,nonAffineTransform:(i=r.nonAffineTransform)!==null&&i!==void 0?i:r.transform,warp:vt(Oa(r)),"Sz ":{_name:"",_classID:"Pnt ",Wdth:r.width||0,Hght:r.height||0},Rslt:r.resolution?ee(r.resolution,"resolution"):{units:"Density",value:72}});if(r.filter&&(o.filterFX={_name:"",_classID:"filterFXStyle",enab:r.filter.enabled,validAtPosition:r.filter.validAtPosition,filterMaskEnable:r.filter.maskEnabled,filterMaskLinked:r.filter.maskLinked,filterMaskExtendWithWhite:r.filter.maskExtendWithWhite,filterFXList:r.filter.list.map(function(l){return fu(l)})}),r.warp&&fi(r.warp)){var a=vt(r.warp);o.quiltWarp=a,o.warp={warpStyle:"warpStyle.warpNone",warpValue:a.warpValue,warpPerspective:a.warpPerspective,warpPerspectiveOther:a.warpPerspectiveOther,warpRotate:a.warpRotate,bounds:a.bounds,uOrder:a.uOrder,vOrder:a.vOrder}}else delete o.quiltWarp;r.comp&&(o.comp=r.comp),r.compInfo&&(o.compInfo=r.compInfo),j(e,"","null",o,o.quiltWarp?"quiltWarp":"warp")});Cn("SoLE","SoLd");L("fxrp",q("referencePoint"),function(e,t){t.referencePoint={x:ke(e),y:ke(e)}},function(e,t){Be(e,t.referencePoint.x),Be(e,t.referencePoint.y)});L("Lr16",function(){return!1},function(e,t,n,i,r){li(e,i,r)},function(e,t){});L("Lr32",function(){return!1},function(e,t,n,i,r){li(e,i,r)},function(e,t){});L("LMsk",q("userMask"),function(e,t){t.userMask={colorSpace:oe(e),opacity:I(e)/255};var n=P(e);if(n!==128)throw new Error("Invalid flag value");w(e,1)},function(e,t){var n=t.userMask;le(e,n.colorSpace),x(e,mo(n.opacity,0,1)*255),T(e,128),$(e,1)});L("Patt",function(e){return!e},function(e,t,n){n()&&w(e,n())},function(e,t){});function Gr(e){var t=O(e),n=O(e),i=O(e),r=O(e);return{top:t,left:n,bottom:i,right:r}}function Ur(e,t){U(e,t.top),U(e,t.left),U(e,t.bottom),U(e,t.right)}L("Anno",function(e){return e.annotations!==void 0},function(e,t,n){var i=I(e),r=I(e);if(i!==2||r!==1)throw new Error("Invalid Anno version");for(var o=C(e),a=[],l=0;l<o;l++){C(e);var u=Q(e),s=!!P(e);P(e),I(e);var c=Gr(e),d=Gr(e),p=oe(e),h=$e(e,2),g=$e(e,2),v=$e(e,2);C(e),Q(e);var F=C(e),y=void 0;if(u==="txtA")F>=2&&I(e)===65279?y=ai(e,(F-2)/2):(e.offset-=2,y=St(e,F)),y=y.replace(/\r/g,`
11
+ `);else if(u==="sndA")y=ce(e,F);else throw new Error("Unknown annotation type");a.push({type:u==="txtA"?"text":"sound",open:s,iconLocation:c,popupLocation:d,color:p,author:h,name:g,date:v,data:y})}t.annotations=a,w(e,n())},function(e,t){var n=t.annotations;x(e,2),x(e,1),D(e,n.length);for(var i=0,r=n;i<r.length;i++){var o=r[i],a=o.type==="sound";if(a&&!(o.data instanceof Uint8Array))throw new Error("Sound annotation data should be Uint8Array");if(!a&&typeof o.data!="string")throw new Error("Text annotation data should be string");var l=e.offset;D(e,0),_(e,a?"sndA":"txtA"),T(e,o.open?1:0),T(e,28),x(e,1),Ur(e,o.iconLocation),Ur(e,o.popupLocation),le(e,o.color),yn(e,o.author||"",2),yn(e,o.name||"",2),yn(e,o.date||"",2);var u=e.offset;D(e,0),_(e,a?"sndM":"txtC"),D(e,0);var s=e.offset;if(a)He(e,o.data);else{x(e,65279);for(var c=o.data.replace(/\n/g,"\r"),d=0;d<c.length;d++)x(e,c.charCodeAt(d))}e.view.setUint32(l,e.offset-l,!1),e.view.setUint32(u,e.offset-u,!1),e.view.setUint32(s-4,e.offset-s,!1)}});function La(e){L(e,function(t){var n=t;return!(!n.linkedFiles||!n.linkedFiles.length||e==="lnkE"&&!n.linkedFiles.some(function(i){return i.linkedFile}))},function(t,n,i,r){var o=n;for(o.linkedFiles=o.linkedFiles||[];i()>8;){var a=Nt(t),l=t.offset,u=Q(t),s=O(t),c=$e(t,1),d=se(t),p=Q(t).trim(),h=Q(t).trim(),g=Nt(t),v=P(t),F=v?V(t):void 0,y=u==="liFE"?V(t):void 0,m={id:c,name:d};if(p&&(m.type=p),h&&(m.creator=h),F&&(m.descriptor={compInfo:{compID:F.compInfo.compID,originalCompID:F.compInfo.originalCompID}}),u==="liFE"&&s>3){var b=O(t),S=P(t),E=P(t),G=P(t),A=P(t),R=ke(t),N=Math.floor(R),B=(R-N)*1e3;m.time=new Date(Date.UTC(b,S,E,G,A,N,B)).toISOString()}var z=u==="liFE"?Nt(t):0;for(u==="liFA"&&w(t,8),u==="liFD"&&(m.data=ce(t,g)),s>=5&&(m.childDocumentID=se(t)),s>=6&&(m.assetModTime=ke(t)),s>=7&&(m.assetLockedState=P(t)),u==="liFE"&&s===2&&(m.data=ce(t,z)),t.skipLinkedFilesData&&(m.data=void 0),e==="lnkE"&&(m.linkedFile={fileSize:z,name:y?.["Nm "]||"",fullPath:y?.fullPath||"",originalPath:y?.originalPath||"",relativePath:y?.relPath||""}),o.linkedFiles.push(m);a%4;)a++;t.offset=l+a}w(t,i())},function(t,n){for(var i,r,o,a,l,u,s,c,d,p=n,h=0,g=p.linkedFiles;h<g.length;h++){var v=g[h];if(e==="lnkE"==!!v.linkedFile){var F=2;v.assetLockedState!=null?F=7:v.assetModTime!=null?F=6:v.childDocumentID!=null?F=5:e=="lnkE"&&(F=3),Gt(t,0);var y=t.offset;if(_(t,e==="lnkE"?"liFE":v.data?"liFD":"liFA"),U(t,F),!v.id||typeof v.id!="string"||!/^[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}$/.test(v.id))throw new Error("Linked file ID must be in a GUID format (example: 20953ddb-9391-11ec-b4f1-c15674f50bc4)");if(yn(t,v.id,1),on(t,v.name||""),_(t,v.type?"".concat(v.type," ").substring(0,4):" "),_(t,v.creator?"".concat(v.creator," ").substring(0,4):"\0\0\0\0"),Gt(t,v.data?v.data.byteLength:0),v.descriptor&&v.descriptor.compInfo){var m={compInfo:{compID:v.descriptor.compInfo.compID,originalCompID:v.descriptor.compInfo.originalCompID}};T(t,1),j(t,"","null",m)}else T(t,0);if(e==="lnkE"){var m={descVersion:2,"Nm ":(r=(i=v.linkedFile)===null||i===void 0?void 0:i.name)!==null&&r!==void 0?r:"",fullPath:(a=(o=v.linkedFile)===null||o===void 0?void 0:o.fullPath)!==null&&a!==void 0?a:"",originalPath:(u=(l=v.linkedFile)===null||l===void 0?void 0:l.originalPath)!==null&&u!==void 0?u:"",relPath:(c=(s=v.linkedFile)===null||s===void 0?void 0:s.relativePath)!==null&&c!==void 0?c:""};j(t,"","ExternalFileLink",m);var b=v.time?new Date(v.time):new Date;U(t,b.getUTCFullYear()),T(t,b.getUTCMonth()),T(t,b.getUTCDate()),T(t,b.getUTCHours()),T(t,b.getUTCMinutes()),Be(t,b.getUTCSeconds()+b.getUTCMilliseconds()/1e3)}v.data?He(t,v.data):Gt(t,((d=v.linkedFile)===null||d===void 0?void 0:d.fileSize)||0),F>=5&&on(t,v.childDocumentID||""),F>=6&&Be(t,v.assetModTime||0),F>=7&&T(t,v.assetLockedState||0);var S=t.offset-y;for(t.view.setUint32(y-4,S,!1);S%4;)S++,T(t,0)}}})}La("lnk2");La("lnkE");Cn("lnkD","lnk2");Cn("lnk3","lnk2");L("pths",q("pathList"),function(e,t){V(e,!0),t.pathList=[]},function(e,t){var n={pathList:[]};j(e,"","pathsDataClass",n)});L("lyvr",q("version"),function(e,t){return t.version=C(e)},function(e,t){return D(e,t.version)});L("lfxs",function(){return!1},function(e,t,n){var i=C(e);if(i!==0)throw new Error("Invalid lfxs version");var r=V(e);t.effects=Vn(r,!!e.logMissingFeatures),w(e,n())},function(e,t,n,i){var r=Un(t.effects,!!i.logMissingFeatures,!0);D(e,0),j(e,"","null",r)});function fe(e){return function(t){return!!t.adjustment&&t.adjustment.type===e}}L("brit",fe("brightness/contrast"),function(e,t,n){t.adjustment||(t.adjustment={type:"brightness/contrast",brightness:H(e),contrast:H(e),meanValue:H(e),labColorOnly:!!P(e),useLegacy:!0}),w(e,n())},function(e,t){var n,i=t.adjustment;Y(e,i.brightness||0),Y(e,i.contrast||0),Y(e,(n=i.meanValue)!==null&&n!==void 0?n:127),T(e,i.labColorOnly?1:0),$(e,1)});function ot(e){var t=H(e),n=H(e),i=H(e),r=H(e),o=H(e)/100;return{shadowInput:t,highlightInput:n,shadowOutput:i,highlightOutput:r,midtoneInput:o}}function An(e,t){Y(e,t.shadowInput),Y(e,t.highlightInput),Y(e,t.shadowOutput),Y(e,t.highlightOutput),Y(e,Math.round(t.midtoneInput*100))}L("levl",fe("levels"),function(e,t,n){if(I(e)!==2)throw new Error("Invalid levl version");t.adjustment=f(f({},t.adjustment),{type:"levels",rgb:ot(e),red:ot(e),green:ot(e),blue:ot(e)}),w(e,n())},function(e,t){var n=t.adjustment,i={shadowInput:0,highlightInput:255,shadowOutput:0,highlightOutput:255,midtoneInput:1};x(e,2),An(e,n.rgb||i),An(e,n.red||i),An(e,n.blue||i),An(e,n.green||i);for(var r=0;r<59;r++)An(e,i)});function at(e){for(var t=I(e),n=[],i=0;i<t;i++){var r=H(e),o=H(e);n.push({input:o,output:r})}return n}function Ye(e,t){x(e,t.length);for(var n=0,i=t;n<i.length;n++){var r=i[n];x(e,r.output),x(e,r.input)}}L("curv",fe("curves"),function(e,t,n){if(P(e),I(e)!==1)throw new Error("Invalid curv version");I(e);var i=I(e),r={type:"curves"};i&1&&(r.rgb=at(e)),i&2&&(r.red=at(e)),i&4&&(r.green=at(e)),i&8&&(r.blue=at(e)),t.adjustment=f(f({},t.adjustment),r),w(e,n())},function(e,t){var n=t.adjustment,i=n.rgb,r=n.red,o=n.green,a=n.blue,l=0,u=0;i&&i.length&&(l|=1,u++),r&&r.length&&(l|=2,u++),o&&o.length&&(l|=4,u++),a&&a.length&&(l|=8,u++),T(e,0),x(e,1),x(e,0),x(e,l),i&&i.length&&Ye(e,i),r&&r.length&&Ye(e,r),o&&o.length&&Ye(e,o),a&&a.length&&Ye(e,a),_(e,"Crv "),x(e,4),x(e,0),x(e,u),i&&i.length&&(x(e,0),Ye(e,i)),r&&r.length&&(x(e,1),Ye(e,r)),o&&o.length&&(x(e,2),Ye(e,o)),a&&a.length&&(x(e,3),Ye(e,a))});L("expA",fe("exposure"),function(e,t,n){if(I(e)!==1)throw new Error("Invalid expA version");t.adjustment=f(f({},t.adjustment),{type:"exposure",exposure:we(e),offset:we(e),gamma:we(e)}),w(e,n())},function(e,t){var n=t.adjustment;x(e,1),Ee(e,n.exposure),Ee(e,n.offset),Ee(e,n.gamma),$(e,2)});L("vibA",fe("vibrance"),function(e,t,n){var i=V(e);t.adjustment={type:"vibrance"},i.vibrance!==void 0&&(t.adjustment.vibrance=i.vibrance),i.Strt!==void 0&&(t.adjustment.saturation=i.Strt),w(e,n())},function(e,t){var n=t.adjustment,i={};n.vibrance!==void 0&&(i.vibrance=n.vibrance),n.saturation!==void 0&&(i.Strt=n.saturation),j(e,"","null",i)});function Qe(e){return{a:H(e),b:H(e),c:H(e),d:H(e),hue:H(e),saturation:H(e),lightness:H(e)}}function en(e,t){var n=t||{};Y(e,n.a||0),Y(e,n.b||0),Y(e,n.c||0),Y(e,n.d||0),Y(e,n.hue||0),Y(e,n.saturation||0),Y(e,n.lightness||0)}L("hue2",fe("hue/saturation"),function(e,t,n){if(I(e)!==2)throw new Error("Invalid hue2 version");t.adjustment=f(f({},t.adjustment),{type:"hue/saturation",master:Qe(e),reds:Qe(e),yellows:Qe(e),greens:Qe(e),cyans:Qe(e),blues:Qe(e),magentas:Qe(e)}),w(e,n())},function(e,t){var n=t.adjustment;x(e,2),en(e,n.master),en(e,n.reds),en(e,n.yellows),en(e,n.greens),en(e,n.cyans),en(e,n.blues),en(e,n.magentas)});function Vt(e){return{cyanRed:H(e),magentaGreen:H(e),yellowBlue:H(e)}}function jt(e,t){Y(e,t.cyanRed||0),Y(e,t.magentaGreen||0),Y(e,t.yellowBlue||0)}L("blnc",fe("color balance"),function(e,t,n){t.adjustment={type:"color balance",shadows:Vt(e),midtones:Vt(e),highlights:Vt(e),preserveLuminosity:!!P(e)},w(e,n())},function(e,t){var n=t.adjustment;jt(e,n.shadows||{}),jt(e,n.midtones||{}),jt(e,n.highlights||{}),T(e,n.preserveLuminosity?1:0),$(e,1)});L("blwh",fe("black & white"),function(e,t,n){var i=V(e);t.adjustment={type:"black & white",reds:i["Rd "],yellows:i.Yllw,greens:i["Grn "],cyans:i["Cyn "],blues:i["Bl "],magentas:i.Mgnt,useTint:!!i.useTint,presetKind:i.bwPresetKind,presetFileName:i.blackAndWhitePresetFileName},i.tintColor!==void 0&&(t.adjustment.tintColor=Te(i.tintColor)),w(e,n())},function(e,t){var n=t.adjustment,i={"Rd ":n.reds||0,Yllw:n.yellows||0,"Grn ":n.greens||0,"Cyn ":n.cyans||0,"Bl ":n.blues||0,Mgnt:n.magentas||0,useTint:!!n.useTint,tintColor:Oe(n.tintColor),bwPresetKind:n.presetKind||0,blackAndWhitePresetFileName:n.presetFileName||""};j(e,"","null",i)});L("phfl",fe("photo filter"),function(e,t,n){var i=I(e);if(i!==2&&i!==3)throw new Error("Invalid phfl version");var r;i===2?r=oe(e):r={l:O(e)/100,a:O(e)/100,b:O(e)/100},t.adjustment={type:"photo filter",color:r,density:C(e)/100,preserveLuminosity:!!P(e)},w(e,n())},function(e,t){var n=t.adjustment;x(e,2),le(e,n.color||{l:0,a:0,b:0}),D(e,(n.density||0)*100),T(e,n.preserveLuminosity?1:0),$(e,3)});function lt(e){var t=H(e),n=H(e),i=H(e);w(e,2);var r=H(e);return{red:t,green:n,blue:i,constant:r}}function wn(e,t){var n=t||{};Y(e,n.red),Y(e,n.green),Y(e,n.blue),$(e,2),Y(e,n.constant)}L("mixr",fe("channel mixer"),function(e,t,n){if(I(e)!==1)throw new Error("Invalid mixr version");var i=t.adjustment=f(f({},t.adjustment),{type:"channel mixer",monochrome:!!I(e)});i.monochrome||(i.red=lt(e),i.green=lt(e),i.blue=lt(e)),i.gray=lt(e),w(e,n())},function(e,t){var n=t.adjustment;x(e,1),x(e,n.monochrome?1:0),n.monochrome?(wn(e,n.gray),$(e,3*5*2)):(wn(e,n.red),wn(e,n.green),wn(e,n.blue),wn(e,n.gray))});var Vr=M("colorLookupType","3DLUT",{"3dlut":"3DLUT",abstractProfile:"abstractProfile",deviceLinkProfile:"deviceLinkProfile"}),jr=M("LUTFormatType","look",{look:"LUTFormatLOOK",cube:"LUTFormatCUBE","3dl":"LUTFormat3DL"}),st=M("colorLookupOrder","rgb",{rgb:"rgbOrder",bgr:"bgrOrder"});L("clrL",fe("color lookup"),function(e,t,n){if(I(e)!==1)throw new Error("Invalid clrL version");var i=V(e);t.adjustment={type:"color lookup"};var r=t.adjustment;i.lookupType!==void 0&&(r.lookupType=Vr.decode(i.lookupType)),i["Nm "]!==void 0&&(r.name=i["Nm "]),i.Dthr!==void 0&&(r.dither=i.Dthr),i.profile!==void 0&&(r.profile=i.profile),i.LUTFormat!==void 0&&(r.lutFormat=jr.decode(i.LUTFormat)),i.dataOrder!==void 0&&(r.dataOrder=st.decode(i.dataOrder)),i.tableOrder!==void 0&&(r.tableOrder=st.decode(i.tableOrder)),i.LUT3DFileData!==void 0&&(r.lut3DFileData=i.LUT3DFileData),i.LUT3DFileName!==void 0&&(r.lut3DFileName=i.LUT3DFileName),w(e,n())},function(e,t){var n=t.adjustment,i={};n.lookupType!==void 0&&(i.lookupType=Vr.encode(n.lookupType)),n.name!==void 0&&(i["Nm "]=n.name),n.dither!==void 0&&(i.Dthr=n.dither),n.profile!==void 0&&(i.profile=n.profile),n.lutFormat!==void 0&&(i.LUTFormat=jr.encode(n.lutFormat)),n.dataOrder!==void 0&&(i.dataOrder=st.encode(n.dataOrder)),n.tableOrder!==void 0&&(i.tableOrder=st.encode(n.tableOrder)),n.lut3DFileData!==void 0&&(i.LUT3DFileData=n.lut3DFileData),n.lut3DFileName!==void 0&&(i.LUT3DFileName=n.lut3DFileName),x(e,1),j(e,"","null",i)});L("nvrt",fe("invert"),function(e,t,n){t.adjustment={type:"invert"},w(e,n())},function(){});L("post",fe("posterize"),function(e,t,n){t.adjustment={type:"posterize",levels:I(e)},w(e,n())},function(e,t){var n,i=t.adjustment;x(e,(n=i.levels)!==null&&n!==void 0?n:4),$(e,2)});L("thrs",fe("threshold"),function(e,t,n){t.adjustment={type:"threshold",level:I(e)},w(e,n())},function(e,t){var n,i=t.adjustment;x(e,(n=i.level)!==null&&n!==void 0?n:128),$(e,2)});var Hr=["","","","rgb","hsb","","lab"];L("grdm",fe("gradient map"),function(e,t,n){var i=I(e);if(i!==1&&i!==3)throw new Error("Invalid grdm version");var r={type:"gradient map",gradientType:"solid"};r.reverse=!!P(e),r.dither=!!P(e);var o=!!P(e);if(e.offset--,o){var a=Q(e);r.method=xn.decode(a)}r.name=se(e),r.colorStops=[],r.opacityStops=[];for(var l=I(e),u=0;u<l;u++)r.colorStops.push({location:C(e),midpoint:C(e)/100,color:oe(e)}),w(e,2);for(var s=I(e),u=0;u<s;u++)r.opacityStops.push({location:C(e),midpoint:C(e)/100,opacity:I(e)/255});var c=I(e);if(c!==2)throw new Error("Invalid grdm expansion count");var d=I(e);r.smoothness=d/4096;var p=I(e);if(p!==32)throw new Error("Invalid grdm length");r.gradientType=I(e)?"noise":"solid",r.randomSeed=C(e),r.addTransparency=!!I(e),r.restrictColors=!!I(e),r.roughness=C(e)/4096,r.colorModel=Hr[I(e)]||"rgb",r.min=[I(e)/32768,I(e)/32768,I(e)/32768,I(e)/32768],r.max=[I(e)/32768,I(e)/32768,I(e)/32768,I(e)/32768],w(e,n());for(var h=0,g=r.colorStops;h<g.length;h++){var v=g[h];v.location/=d}for(var F=0,y=r.opacityStops;F<y.length;F++){var v=y[F];v.location/=d}t.adjustment=r},function(e,t){var n,i,r,o=t.adjustment;x(e,o.method!==void 0?3:1),T(e,o.reverse?1:0),T(e,o.dither?1:0),o.method!==void 0&&_(e,xn.encode(o.method)),on(e,o.name||""),x(e,o.colorStops&&o.colorStops.length||0);for(var a=Math.round(((n=o.smoothness)!==null&&n!==void 0?n:1)*4096),l=0,u=o.colorStops||[];l<u.length;l++){var s=u[l];D(e,Math.round(s.location*a)),D(e,Math.round(s.midpoint*100)),le(e,s.color),$(e,2)}x(e,o.opacityStops&&o.opacityStops.length||0);for(var c=0,d=o.opacityStops||[];c<d.length;c++){var s=d[c];D(e,Math.round(s.location*a)),D(e,Math.round(s.midpoint*100)),x(e,Math.round(s.opacity*255))}x(e,2),x(e,a),x(e,32),x(e,o.gradientType==="noise"?1:0),D(e,o.randomSeed||0),x(e,o.addTransparency?1:0),x(e,o.restrictColors?1:0),D(e,Math.round(((i=o.roughness)!==null&&i!==void 0?i:1)*4096));var p=Hr.indexOf((r=o.colorModel)!==null&&r!==void 0?r:"rgb");x(e,p===-1?3:p);for(var h=0;h<4;h++)x(e,Math.round((o.min&&o.min[h]||0)*32768));for(var h=0;h<4;h++)x(e,Math.round((o.max&&o.max[h]||0)*32768));$(e,4)});function ze(e){return{c:H(e),m:H(e),y:H(e),k:H(e)}}function Ne(e,t){var n=t||{};Y(e,n.c),Y(e,n.m),Y(e,n.y),Y(e,n.k)}L("selc",fe("selective color"),function(e,t){if(I(e)!==1)throw new Error("Invalid selc version");var n=I(e)?"absolute":"relative";w(e,8),t.adjustment={type:"selective color",mode:n,reds:ze(e),yellows:ze(e),greens:ze(e),cyans:ze(e),blues:ze(e),magentas:ze(e),whites:ze(e),neutrals:ze(e),blacks:ze(e)}},function(e,t){var n=t.adjustment;x(e,1),x(e,n.mode==="absolute"?1:0),$(e,8),Ne(e,n.reds),Ne(e,n.yellows),Ne(e,n.greens),Ne(e,n.cyans),Ne(e,n.blues),Ne(e,n.magentas),Ne(e,n.whites),Ne(e,n.neutrals),Ne(e,n.blacks)});L("CgEd",function(e){var t=e.adjustment;return t?t.type==="brightness/contrast"&&!t.useLegacy||(t.type==="levels"||t.type==="curves"||t.type==="exposure"||t.type==="channel mixer"||t.type==="hue/saturation")&&t.presetFileName!==void 0:!1},function(e,t,n){var i=V(e);if(i.Vrsn!==1)throw new Error("Invalid CgEd version");"presetFileName"in i?t.adjustment=f(f({},t.adjustment),{presetKind:i.presetKind,presetFileName:i.presetFileName}):"curvesPresetFileName"in i?t.adjustment=f(f({},t.adjustment),{presetKind:i.curvesPresetKind,presetFileName:i.curvesPresetFileName}):"mixerPresetFileName"in i?t.adjustment=f(f({},t.adjustment),{presetKind:i.mixerPresetKind,presetFileName:i.mixerPresetFileName}):t.adjustment={type:"brightness/contrast",brightness:i.Brgh,contrast:i.Cntr,meanValue:i.means,useLegacy:!!i.useLegacy,labColorOnly:!!i["Lab "],auto:!!i.Auto},w(e,n())},function(e,t){var n,i,r,o,a=t.adjustment;if(a.type==="levels"||a.type==="exposure"||a.type==="hue/saturation"){var l={Vrsn:1,presetKind:(n=a.presetKind)!==null&&n!==void 0?n:1,presetFileName:a.presetFileName||""};j(e,"","null",l)}else if(a.type==="curves"){var l={Vrsn:1,curvesPresetKind:(i=a.presetKind)!==null&&i!==void 0?i:1,curvesPresetFileName:a.presetFileName||""};j(e,"","null",l)}else if(a.type==="channel mixer"){var l={Vrsn:1,mixerPresetKind:(r=a.presetKind)!==null&&r!==void 0?r:1,mixerPresetFileName:a.presetFileName||""};j(e,"","null",l)}else if(a.type==="brightness/contrast"){var l={Vrsn:1,Brgh:a.brightness||0,Cntr:a.contrast||0,means:(o=a.meanValue)!==null&&o!==void 0?o:127,"Lab ":!!a.labColorOnly,useLegacy:!!a.useLegacy,Auto:!!a.auto};j(e,"","null",l)}else throw new Error("Unhandled CgEd case")});function du(e){var t=[];function n(i){var r;if(i.children)for(var o=0,a=i.children;o<a.length;o++){var l=a[o];((r=l.text)===null||r===void 0?void 0:r.index)!==void 0&&(t[l.text.index]=l),n(l)}}return n(e),t}L("Txt2",q("engineData"),function(e,t,n,i){var r=ce(e,n());t.engineData=$r(r);var o=du(i),a=Ia(r),l=iu(a),u=l.ResourceDict.TextFrameSet;if(u)for(var s=0;s<u.length;s++){var c=o[s];u[s].path&&c?.text&&(c.text.textPath=u[s].path)}},function(e,t){var n=Kr(t.engineData);He(e,n)});L("FEid",q("filterEffectsMasks"),function(e,t,n){var i=O(e);if(i<1||i>3)throw new Error("Invalid filterEffects version ".concat(i));for(t.filterEffectsMasks=[];n()>8;){if(C(e))throw new Error("filterEffects: 64 bit length is not supported");var r=C(e),o=e.offset+r,a=$e(e,1),l=O(e);if(l!==1)throw new Error("Invalid filterEffect version ".concat(l));if(C(e))throw new Error("filterEffect: 64 bit length is not supported");C(e);for(var u=O(e),s=O(e),c=O(e),d=O(e),p=O(e),h=O(e),g=[],v=0;v<h+2;v++){var F=O(e);if(F){if(C(e))throw new Error("filterEffect: 64 bit length is not supported");var y=C(e);if(!y)throw new Error("filterEffect: Empty channel");var m=I(e),b=ce(e,y-2);g.push({compressionMode:m,data:b})}else g.push(void 0)}if(t.filterEffectsMasks.push({id:a,top:u,left:s,bottom:c,right:d,depth:p,channels:g}),e.offset<o&&P(e)){var S=O(e),E=O(e),G=O(e),A=O(e);if(C(e))throw new Error("filterEffect: 64 bit length is not supported");var R=C(e),m=I(e),b=ce(e,R-2);t.filterEffectsMasks[t.filterEffectsMasks.length-1].extra={top:S,left:E,bottom:G,right:A,compressionMode:m,data:b}}e.offset=o;for(var N=r;N%4;)e.offset++,N++}},function(e,t){var n;U(e,3);for(var i=0,r=t.filterEffectsMasks;i<r.length;i++){var o=r[i];D(e,0),D(e,0);var a=e.offset;yn(e,o.id,1),U(e,1),D(e,0),D(e,0);var l=e.offset;U(e,o.top),U(e,o.left),U(e,o.bottom),U(e,o.right),U(e,o.depth);var u=Math.max(0,o.channels.length-2);U(e,u);for(var s=0;s<u+2;s++){var c=o.channels[s];U(e,c?1:0),c&&(D(e,0),D(e,c.data.length+2),x(e,c.compressionMode),He(e,c.data))}e.view.setUint32(l-4,e.offset-l,!1);var d=(n=t.filterEffectsMasks[t.filterEffectsMasks.length-1])===null||n===void 0?void 0:n.extra;d&&(T(e,1),U(e,d.top),U(e,d.left),U(e,d.bottom),U(e,d.right),D(e,0),D(e,d.data.byteLength+2),x(e,d.compressionMode),He(e,d.data));var p=e.offset-a;for(e.view.setUint32(a-4,p,!1);p%4;)$(e,1),p++}});Cn("FXid","FEid");L("FMsk",q("filterMask"),function(e,t){t.filterMask={colorSpace:oe(e),opacity:I(e)/255}},function(e,t){var n;le(e,t.filterMask.colorSpace),x(e,mo((n=t.filterMask.opacity)!==null&&n!==void 0?n:1,0,1)*255)});L("artd",function(e){return e.artboards!==void 0},function(e,t,n){var i=V(e);t.artboards={count:i["Cnt "],autoExpandOffset:{horizontal:i.autoExpandOffset.Hrzn,vertical:i.autoExpandOffset.Vrtc},origin:{horizontal:i.origin.Hrzn,vertical:i.origin.Vrtc},autoExpandEnabled:i.autoExpandEnabled,autoNestEnabled:i.autoNestEnabled,autoPositionEnabled:i.autoPositionEnabled,shrinkwrapOnSaveEnabled:!!i.shrinkwrapOnSaveEnabled,docDefaultNewArtboardBackgroundColor:Te(i.docDefaultNewArtboardBackgroundColor),docDefaultNewArtboardBackgroundType:i.docDefaultNewArtboardBackgroundType},w(e,n())},function(e,t){var n,i,r,o,a,l=t.artboards,u={"Cnt ":l.count,autoExpandOffset:l.autoExpandOffset?{Hrzn:l.autoExpandOffset.horizontal,Vrtc:l.autoExpandOffset.vertical}:{Hrzn:0,Vrtc:0},origin:l.origin?{Hrzn:l.origin.horizontal,Vrtc:l.origin.vertical}:{Hrzn:0,Vrtc:0},autoExpandEnabled:(n=l.autoExpandEnabled)!==null&&n!==void 0?n:!0,autoNestEnabled:(i=l.autoNestEnabled)!==null&&i!==void 0?i:!0,autoPositionEnabled:(r=l.autoPositionEnabled)!==null&&r!==void 0?r:!0,shrinkwrapOnSaveEnabled:(o=l.shrinkwrapOnSaveEnabled)!==null&&o!==void 0?o:!0,docDefaultNewArtboardBackgroundColor:Oe(l.docDefaultNewArtboardBackgroundColor),docDefaultNewArtboardBackgroundType:(a=l.docDefaultNewArtboardBackgroundType)!==null&&a!==void 0?a:1};j(e,"","null",u,"artd")});function Ma(e){return Object.keys(e).map(function(t){return e[t]}).some(function(t){return Array.isArray(t)&&t.length>1})}L("lfx2",function(e){return e.effects!==void 0&&!Ma(e.effects)},function(e,t,n){var i=C(e);if(i!==0)throw new Error("Invalid lfx2 version");var r=V(e);t.effects=Vn(r,!!e.logMissingFeatures),w(e,n())},function(e,t,n,i){var r=Un(t.effects,!!i.logMissingFeatures,!0);D(e,0),j(e,"","null",r)});L("cinf",q("compositorUsed"),function(e,t,n){var i=V(e);function r(o){return o.split(".")[1]}t.compositorUsed={description:i.description,reason:i.reason,engine:r(i.Engn)},i.Vrsn&&(t.compositorUsed.version=i.Vrsn),i.psVersion&&(t.compositorUsed.photoshopVersion=i.psVersion),i.enableCompCore&&(t.compositorUsed.enableCompCore=r(i.enableCompCore)),i.enableCompCoreGPU&&(t.compositorUsed.enableCompCoreGPU=r(i.enableCompCoreGPU)),i.enableCompCoreThreads&&(t.compositorUsed.enableCompCoreThreads=r(i.enableCompCoreThreads)),i.compCoreSupport&&(t.compositorUsed.compCoreSupport=r(i.compCoreSupport)),i.compCoreGPUSupport&&(t.compositorUsed.compCoreGPUSupport=r(i.compCoreGPUSupport)),w(e,n())},function(e,t){var n=t.compositorUsed,i={Vrsn:n.version||{major:1,minor:0,fix:0}};n.photoshopVersion&&(i.psVersion=n.photoshopVersion),i.description=n.description,i.reason=n.reason,i.Engn="Engn.".concat(n.engine),n.enableCompCore&&(i.enableCompCore="enable.".concat(n.enableCompCore)),n.enableCompCoreGPU&&(i.enableCompCoreGPU="enable.".concat(n.enableCompCoreGPU)),n.enableCompCoreThreads&&(i.enableCompCoreThreads="enable.".concat(n.enableCompCoreThreads)),n.compCoreSupport&&(i.compCoreSupport="reason.".concat(n.compCoreSupport)),n.compCoreGPUSupport&&(i.compCoreGPUSupport="reason.".concat(n.compCoreGPUSupport)),j(e,"","null",i)});L("extn",function(e){return e._extn!==void 0},function(e,t){V(e)},function(e,t){});L("iOpa",q("fillOpacity"),function(e,t){t.fillOpacity=P(e)/255,w(e,3)},function(e,t){T(e,t.fillOpacity*255),$(e,3)});L("brst",q("channelBlendingRestrictions"),function(e,t,n){for(t.channelBlendingRestrictions=[];n()>4;)t.channelBlendingRestrictions.push(O(e))},function(e,t){for(var n=0,i=t.channelBlendingRestrictions;n<i.length;n++){var r=i[n];U(e,r)}});L("tsly",q("transparencyShapesLayer"),function(e,t){t.transparencyShapesLayer=!!P(e),w(e,3)},function(e,t){T(e,t.transparencyShapesLayer?1:0),$(e,3)});function T(e,t){var n=We(e,1);e.view.setUint8(n,t)}function Y(e,t){var n=We(e,2);e.view.setInt16(n,t,!1)}function x(e,t){var n=We(e,2);e.view.setUint16(n,t,!1)}function hu(e,t){var n=We(e,2);e.view.setUint16(n,t,!0)}function U(e,t){var n=We(e,4);e.view.setInt32(n,t,!1)}function Wr(e,t){var n=We(e,4);e.view.setInt32(n,t,!0)}function D(e,t){var n=We(e,4);e.view.setUint32(n,t,!1)}function Ee(e,t){var n=We(e,4);e.view.setFloat32(n,t,!1)}function Be(e,t){var n=We(e,8);e.view.setFloat64(n,t,!1)}function ye(e,t){U(e,t*65536)}function Ae(e,t){U(e,t*(1<<24))}function He(e,t){if(t){Ra(e,e.offset+t.length);var n=new Uint8Array(e.buffer);n.set(t,e.offset),e.offset+=t.length}}function $(e,t){for(var n=0;n<t;n++)T(e,0)}function _(e,t){if(t.length!==4)throw new Error("Invalid signature: '".concat(t,"'"));for(var n=0;n<4;n++)T(e,t.charCodeAt(n))}function pu(e,t){for(var n=0;n<t.length;n++)T(e,t.charCodeAt(n))}function yn(e,t,n){var i=t.length;if(i>255)throw new Error("String too long");T(e,i);for(var r=0;r<i;r++){var o=t.charCodeAt(r);T(e,o<128?o:63)}for(;++i%n;)T(e,0)}function vu(e,t){for(var n=0;n<t.length;n++)x(e,t.charCodeAt(n))}function mu(e,t){for(var n=0;n<t.length;n++)hu(e,t.charCodeAt(n))}function Se(e,t){D(e,t.length),vu(e,t)}function on(e,t){D(e,t.length+1);for(var n=0;n<t.length;n++)x(e,t.charCodeAt(n));x(e,0)}function tn(e,t,n,i,r){i===void 0&&(i=!1),r===void 0&&(r=!1),r&&D(e,0);var o=e.offset;D(e,0),n();for(var a=e.offset-o-4,l=a;l%t;)T(e,0),l++;i&&(a=l),e.view.setUint32(o,a,!1)}function gu(e,t){var n=e.buffer.byteLength;do n*=2;while(t>n);var i=new ArrayBuffer(n),r=new Uint8Array(i),o=new Uint8Array(e.buffer);r.set(o),e.buffer=i,e.view=new DataView(e.buffer)}function Ra(e,t){t>e.buffer.byteLength&&gu(e,t)}function We(e,t){var n=e.offset;return Ra(e,e.offset+=t),n}function le(e,t){t?"r"in t?(x(e,0),x(e,Math.round(t.r*257)),x(e,Math.round(t.g*257)),x(e,Math.round(t.b*257)),x(e,0)):"fr"in t?(x(e,0),x(e,Math.round(t.fr*255*257)),x(e,Math.round(t.fg*255*257)),x(e,Math.round(t.fb*255*257)),x(e,0)):"l"in t?(x(e,7),Y(e,Math.round(t.l*1e4)),Y(e,Math.round(t.a<0?t.a*12800:t.a*12700)),Y(e,Math.round(t.b<0?t.b*12800:t.b*12700)),x(e,0)):"h"in t?(x(e,1),x(e,Math.round(t.h*65535)),x(e,Math.round(t.s*65535)),x(e,Math.round(t.b*65535)),x(e,0)):"c"in t?(x(e,2),x(e,Math.round(t.c*257)),x(e,Math.round(t.m*257)),x(e,Math.round(t.y*257)),x(e,Math.round(t.k*257))):(x(e,8),x(e,Math.round(t.k*1e4/255)),$(e,6)):(x(e,0),$(e,8))}var Xr;(function(e){e[e.Bitmap=0]="Bitmap",e[e.Grayscale=1]="Grayscale",e[e.Indexed=2]="Indexed",e[e.RGB=3]="RGB",e[e.CMYK=4]="CMYK",e[e.Multichannel=7]="Multichannel",e[e.Duotone=8]="Duotone",e[e.Lab=9]="Lab"})(Xr||(Xr={}));var Zr;(function(e){e[e.Other=0]="Other",e[e.OpenFolder=1]="OpenFolder",e[e.ClosedFolder=2]="ClosedFolder",e[e.BoundingSectionDivider=3]="BoundingSectionDivider"})(Zr||(Zr={}));var Yr;(function(e){e[e.None=0]="None",e[e.Visibility=1]="Visibility",e[e.Position=2]="Position",e[e.Appearance=4]="Appearance"})(Yr||(Yr={}));function bu(e,t){var n="buffer"in e?Ar(e.buffer,e.byteOffset,e.byteLength):Ar(e);return Os(n,t)}function Iu({node:e,chunk:t}){return _a.jsx(za,{node:e,label:"psd",chunk:t,decode:async n=>{const i=bu(n,{skipLayerImageData:!0,skipThumbnail:!0});if(!i.canvas)throw new Error("no composite image in this PSD");return[await Na(i.canvas)]}})}export{Iu as PsdView};