const _r=typeof window<"u"?window:self,fe=navigator?navigator.userAgent:null;navigator.userAgent.search(/OS X|iPhone|iPad|iOS/i);navigator.userAgent.toLowerCase().indexOf("android");(()=>{try{return+navigator.userAgent.match(/Chrom(?:e|ium)\/(.+?)(?:\s|\.)/)[1]}catch{}})();const Er="safari"in _r||!!(fe&&(/\b(iPad|iPhone|iPod)\b/.test(fe)||fe.match("Safari")&&!fe.match("Chrome")));navigator.userAgent.toLowerCase().indexOf("firefox")>-1;(navigator.maxTouchPoints===void 0||navigator.maxTouchPoints>0)&&navigator.userAgent.search(/iOS|iPhone OS|Android|BlackBerry|BB10|Series ?[64]0|J2ME|MIDP|opera mini|opera mobi|mobi.+Gecko|Windows Phone/i)!=-1;let he;if(!Er)he=!0;else try{he=+navigator.userAgent.match(/Version\/(.+?) /)[1]>=14}catch{he=!1}var kr=he;const Dr=typeof ImageBitmap<"u";function Ar(e,r){return new Promise(n=>{const o=new FileReader;o.addEventListener("loadend",i=>{n(i.target.result)}),o[r](e)})}function Sr(e){return Ar(e,"readAsText")}const br=[[[16219713,13335381],[16757049,16168585],[16765248,16764327],[16768889,16768965]],[[16219713,10771e3],[16757049,14653547],[16765248,15577475],[16768889,16040864]],[[16219713,7354903],[16757049,11233085],[16765248,12812110],[16768889,14194279]],[[16219713,4858889],[16757049,8207886],[16765248,9852201],[16768889,11100983]],[[16219713,2101002],[16757049,4270372],[16765248,5848375],[16768889,6505791]]],Fe=e=>Math.round(Math.min(Math.max(e,0),1)*255);function Pr(e,r){const n=br[Math.max(r-1,0)],o=s=>{const u=s.c.k,c=Fe(u[2])|Fe(u[1])<<8|Fe(u[0])<<16,d=n.find(m=>m[0]===c);d&&(u[0]=(d[1]>>16&255)/255,u[1]=(d[1]>>8&255)/255,u[2]=(d[1]&255)/255)},i=s=>{switch(s.ty){case"st":case"fl":o(s);break}s.hasOwnProperty("it")&&a(s.it)},a=s=>{for(const u of s)i(u)};try{for(const s of e.layers)if(s.shapes)for(const u of s.shapes){if(!u.it){i(u);continue}a(u.it)}}catch(s){console.warn("cant apply replacements",s,e,r)}}var f=typeof f<"u"?f:{},J={},I;for(I in f)f.hasOwnProperty(I)&&(J[I]=f[I]);var xe="./this.program",Ae=!1,z=!1,se=!1,qe=!1;Ae=typeof window=="object";z=typeof importScripts=="function";se=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string";qe=!Ae&&!se&&!z;var N="";function Rr(e){return f.locateFile?f.locateFile(e,N):N+e}var G,$,ge,Me;se?(z?N=require("path").dirname(N)+"/":N=__dirname+"/",G=function(r,n){return ge||(ge=require("fs")),Me||(Me=require("path")),r=Me.normalize(r),ge.readFileSync(r,n?null:"utf8")},$=function(r){var n=G(r,!0);return n.buffer||(n=new Uint8Array(n)),oe(n.buffer),n},process.argv.length>1&&(xe=process.argv[1].replace(/\\/g,"/")),process.argv.slice(2),process.on("uncaughtException",function(e){if(!(e instanceof xn))throw e}),process.on("unhandledRejection",R),f.inspect=function(){return"[Emscripten Module object]"}):qe?(typeof read<"u"&&(G=function(r){return read(r)}),$=function(r){var n;return typeof readbuffer=="function"?new Uint8Array(readbuffer(r)):(n=read(r,"binary"),oe(typeof n=="object"),n)},typeof scriptArgs<"u"?scriptArgs:typeof arguments<"u"&&arguments,typeof print<"u"&&(typeof console>"u"&&(console={}),console.log=print,console.warn=console.error=typeof printErr<"u"?printErr:print)):(Ae||z)&&(z?N=self.location.href:document.currentScript&&(N=document.currentScript.src),N.indexOf("blob:")!==0?N=N.substr(0,N.lastIndexOf("/")+1):N="",G=function(r){var n=new XMLHttpRequest;return n.open("GET",r,!1),n.send(null),n.responseText},z&&($=function(r){var n=new XMLHttpRequest;return n.open("GET",r,!1),n.responseType="arraybuffer",n.send(null),new Uint8Array(n.response)}));var ne=f.print||console.log.bind(console),P=f.printErr||console.warn.bind(console);for(I in J)J.hasOwnProperty(I)&&(f[I]=J[I]);J=null;f.arguments&&f.arguments;f.thisProgram&&(xe=f.thisProgram);f.quit&&f.quit;function Fr(e){var r=p[Oe>>2],n=r+e+15&-16;return p[Oe>>2]=n,r}function Mr(e){switch(e){case"i1":case"i8":return 1;case"i16":return 2;case"i32":return 4;case"i64":return 8;case"float":return 4;case"double":return 8;default:{if(e[e.length-1]==="*")return 4;if(e[0]==="i"){var r=Number(e.substr(1));return oe(r%8===0,"getNativeTypeSize invalid bits "+r+", type "+e),r/8}else return 0}}}var Xe=0,Ne=function(e){Xe=e},Tr=function(){return Xe},te;f.wasmBinary&&(te=f.wasmBinary);f.noExitRuntime&&f.noExitRuntime;typeof WebAssembly!="object"&&P("no native wasm support detected");function Nr(e,r,n,o){switch(n=n||"i8",n.charAt(n.length-1)==="*"&&(n="i32"),n){case"i1":T[e>>0]=r;break;case"i8":T[e>>0]=r;break;case"i16":Ie[e>>1]=r;break;case"i32":p[e>>2]=r;break;case"i64":O=[r>>>0,(S=r,+_e(S)>=1?S>0?(Ee(+ae(S/4294967296),4294967295)|0)>>>0:~~+ie((S-+(~~S>>>0))/4294967296)>>>0:0)],p[e>>2]=O[0],p[e+4>>2]=O[1];break;case"float":Qe[e>>2]=r;break;case"double":er[e>>3]=r;break;default:R("invalid type for setValue: "+n)}}var X,Or=new WebAssembly.Table({initial:522,maximum:522,element:"anyfunc"}),Ge=!1;function oe(e,r){e||R("Assertion failed: "+r)}function Ke(e){var r=f["_"+e];return oe(r,"Cannot call unknown function "+e+", make sure it is exported"),r}function Br(e,r,n,o,i){var a={string:function(h){var w=0;if(h!=null&&h!==0){var F=(h.length<<2)+1;w=ke(F),Je(h,w,F)}return w},array:function(h){var w=ke(h.length);return $e(h,w),w}};function s(h){return r==="string"?V(h):r==="boolean"?!!h:h}var u=Ke(e),c=[],d=0;if(o)for(var m=0;m>2]=0;for(c=u+a;o>0]=0;return u}if(s==="i8")return e.subarray||e.slice?U.set(e,u):U.set(new Uint8Array(e),u),u;for(var d=0,m,y,v;d=o);)++i;if(i-r>16&&e.subarray&&He)return He.decode(e.subarray(r,i));for(var a="";r>10,56320|d&1023)}}return a}function V(e,r){return e?K(U,e,r):""}function Ce(e,r,n,o){if(!(o>0))return 0;for(var i=n,a=n+o-1,s=0;s=55296&&u<=57343){var c=e.charCodeAt(++s);u=65536+((u&1023)<<10)|c&1023}if(u<=127){if(n>=a)break;r[n++]=u}else if(u<=2047){if(n+1>=a)break;r[n++]=192|u>>6,r[n++]=128|u&63}else if(u<=65535){if(n+2>=a)break;r[n++]=224|u>>12,r[n++]=128|u>>6&63,r[n++]=128|u&63}else{if(n+3>=a)break;r[n++]=240|u>>18,r[n++]=128|u>>12&63,r[n++]=128|u>>6&63,r[n++]=128|u&63}}return r[n]=0,n-i}function Je(e,r,n){return Ce(e,U,r,n)}function Le(e){for(var r=0,n=0;n=55296&&o<=57343&&(o=65536+((o&1023)<<10)|e.charCodeAt(++n)&1023),o<=127?++r:o<=2047?r+=2:o<=65535?r+=3:r+=4}return r}function $e(e,r){T.set(e,r)}function Lr(e,r,n){for(var o=0;o>0]=e.charCodeAt(o);T[r>>0]=0}var je=65536;function Ir(e,r){return e%r>0&&(e+=r-e%r),e}var ue,T,U,Ie,p,Qe,er;function rr(e){ue=e,f.HEAP8=T=new Int8Array(e),f.HEAP16=Ie=new Int16Array(e),f.HEAP32=p=new Int32Array(e),f.HEAPU8=U=new Uint8Array(e),f.HEAPU16=new Uint16Array(e),f.HEAPU32=new Uint32Array(e),f.HEAPF32=Qe=new Float32Array(e),f.HEAPF64=er=new Float64Array(e)}var zr=5275232,Oe=32192,nr=f.INITIAL_MEMORY||16777216;f.wasmMemory?X=f.wasmMemory:X=new WebAssembly.Memory({initial:nr/je,maximum:2147483648/je});X&&(ue=X.buffer);nr=ue.byteLength;rr(ue);p[Oe>>2]=zr;function Se(e){for(;e.length>0;){var r=e.shift();if(typeof r=="function"){r(f);continue}var n=r.func;typeof n=="number"?r.arg===void 0?f.dynCall_v(n):f.dynCall_vi(n,r.arg):n(r.arg===void 0?null:r.arg)}}var tr=[],or=[],Ur=[],ir=[];function Hr(){if(f.preRun)for(typeof f.preRun=="function"&&(f.preRun=[f.preRun]);f.preRun.length;)Vr(f.preRun.shift());Se(tr)}function jr(){!f.noFSInit&&!t.init.initialized&&t.init(),Se(or)}function Wr(){t.ignorePermissions=!1,Se(Ur)}function Yr(){if(f.postRun)for(typeof f.postRun=="function"&&(f.postRun=[f.postRun]);f.postRun.length;)qr(f.postRun.shift());Se(ir)}function Vr(e){tr.unshift(e)}function qr(e){ir.unshift(e)}var _e=Math.abs,ie=Math.ceil,ae=Math.floor,Ee=Math.min,q=0,Q=null;function ar(e){q++,f.monitorRunDependencies&&f.monitorRunDependencies(q)}function Be(e){if(q--,f.monitorRunDependencies&&f.monitorRunDependencies(q),q==0&&Q){var r=Q;Q=null,r()}}f.preloadedImages={};f.preloadedAudios={};function R(e){throw f.onAbort&&f.onAbort(e),e+="",ne(e),P(e),Ge=!0,e="abort("+e+"). Build with -s ASSERTIONS=1 for more info.",new WebAssembly.RuntimeError(e)}function sr(e,r){return String.prototype.startsWith?e.startsWith(r):e.indexOf(r)===0}var Xr="data:application/octet-stream;base64,";function ur(e){return sr(e,Xr)}var Gr="file://";function fr(e){return sr(e,Gr)}var x="rlottie-wasm.wasm";ur(x)||(x=Rr(x));function We(){try{if(te)return new Uint8Array(te);if($)return $(x);throw"both async and sync fetching of the wasm failed"}catch(e){R(e)}}function Kr(){return!te&&(Ae||z)&&typeof fetch=="function"&&!fr(x)?fetch(x,{credentials:"same-origin"}).then(function(e){if(!e.ok)throw"failed to load wasm binary file at '"+x+"'";return e.arrayBuffer()}).catch(function(){return We()}):new Promise(function(e,r){e(We())})}function Zr(){var e={a:Nn};function r(s,u){var c=s.exports;f.asm=c,Be()}ar();function n(s){r(s.instance)}function o(s){return Kr().then(function(u){return WebAssembly.instantiate(u,e)}).then(s,function(u){P("failed to asynchronously prepare wasm: "+u),R(u)})}function i(){if(!te&&typeof WebAssembly.instantiateStreaming=="function"&&!ur(x)&&!fr(x)&&typeof fetch=="function")fetch(x,{credentials:"same-origin"}).then(function(s){var u=WebAssembly.instantiateStreaming(s,e);return u.then(n,function(c){P("wasm streaming compile failed: "+c),P("falling back to ArrayBuffer instantiation"),o(n)})});else return o(n)}if(f.instantiateWasm)try{var a=f.instantiateWasm(e,r);return a}catch(s){return P("Module.instantiateWasm callback failed with error: "+s),!1}return i(),{}}var S,O;or.push({func:function(){mr()}});function Jr(e){var r=/\b_Z[\w\d_]+/g;return e.replace(r,function(n){var o=n;return n===o?n:o+" ["+n+"]"})}function $r(){var e=new Error;if(!e.stack){try{throw new Error}catch(r){e=r}if(!e.stack)return"(no stack trace available)"}return e.stack.toString()}function Qr(){var e=$r();return f.extraStackTrace&&(e+=` `+f.extraStackTrace()),Jr(e)}function en(){P("missing function: _ZN7VRegionC1ERK5VRect"),R(-1)}function rn(){P("missing function: _ZN7VRegionD1Ev"),R(-1)}function nn(){P("missing function: _ZN7VRegionpLERK5VRect"),R(-1)}function tn(){P("missing function: _ZNK7VRegion12boundingRectEv"),R(-1)}function on(e,r,n,o){R("Assertion failed: "+V(e)+", at: "+[r?V(r):"unknown filename",n,o?V(o):"unknown function"])}function ee(e){return p[gr()>>2]=e,e}function an(e,r){return ee(63),-1}var E={splitPath:function(e){var r=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return r.exec(e).slice(1)},normalizeArray:function(e,r){for(var n=0,o=e.length-1;o>=0;o--){var i=e[o];i==="."?e.splice(o,1):i===".."?(e.splice(o,1),n++):n&&(e.splice(o,1),n--)}if(r)for(;n;n--)e.unshift("..");return e},normalize:function(e){var r=e.charAt(0)==="/",n=e.substr(-1)==="/";return e=E.normalizeArray(e.split("/").filter(function(o){return!!o}),!r).join("/"),!e&&!r&&(e="."),e&&n&&(e+="/"),(r?"/":"")+e},dirname:function(e){var r=E.splitPath(e),n=r[0],o=r[1];return!n&&!o?".":(o&&(o=o.substr(0,o.length-1)),n+o)},basename:function(e){if(e==="/")return"/";var r=e.lastIndexOf("/");return r===-1?e:e.substr(r+1)},extname:function(e){return E.splitPath(e)[3]},join:function(){var e=Array.prototype.slice.call(arguments,0);return E.normalize(e.join("/"))},join2:function(e,r){return E.normalize(e+"/"+r)}},B={resolve:function(){for(var e="",r=!1,n=arguments.length-1;n>=-1&&!r;n--){var o=n>=0?arguments[n]:t.cwd();if(typeof o!="string")throw new TypeError("Arguments to path.resolve must be strings");if(!o)return"";e=o+"/"+e,r=o.charAt(0)==="/"}return e=E.normalizeArray(e.split("/").filter(function(i){return!!i}),!r).join("/"),(r?"/":"")+e||"."},relative:function(e,r){e=B.resolve(e).substr(1),r=B.resolve(r).substr(1);function n(d){for(var m=0;m=0&&d[y]==="";y--);return m>y?[]:d.slice(m,y-m+1)}for(var o=n(e.split("/")),i=n(r.split("/")),a=Math.min(o.length,i.length),s=a,u=0;u0?r=o.slice(0,i).toString("utf-8"):r=null}else typeof window<"u"&&typeof window.prompt=="function"?(r=window.prompt("Input: "),r!==null&&(r+=` `)):typeof readline=="function"&&(r=readline(),r!==null&&(r+=` `));if(!r)return null;e.input=Z(r,!0)}return e.input.shift()},put_char:function(e,r){r===null||r===10?(ne(K(e.output,0)),e.output=[]):r!=0&&e.output.push(r)},flush:function(e){e.output&&e.output.length>0&&(ne(K(e.output,0)),e.output=[])}},default_tty1_ops:{put_char:function(e,r){r===null||r===10?(P(K(e.output,0)),e.output=[]):r!=0&&e.output.push(r)},flush:function(e){e.output&&e.output.length>0&&(P(K(e.output,0)),e.output=[])}}},_={ops_table:null,mount:function(e){return _.createNode(null,"/",16895,0)},createNode:function(e,r,n,o){if(t.isBlkdev(n)||t.isFIFO(n))throw new t.ErrnoError(63);_.ops_table||(_.ops_table={dir:{node:{getattr:_.node_ops.getattr,setattr:_.node_ops.setattr,lookup:_.node_ops.lookup,mknod:_.node_ops.mknod,rename:_.node_ops.rename,unlink:_.node_ops.unlink,rmdir:_.node_ops.rmdir,readdir:_.node_ops.readdir,symlink:_.node_ops.symlink},stream:{llseek:_.stream_ops.llseek}},file:{node:{getattr:_.node_ops.getattr,setattr:_.node_ops.setattr},stream:{llseek:_.stream_ops.llseek,read:_.stream_ops.read,write:_.stream_ops.write,allocate:_.stream_ops.allocate,mmap:_.stream_ops.mmap,msync:_.stream_ops.msync}},link:{node:{getattr:_.node_ops.getattr,setattr:_.node_ops.setattr,readlink:_.node_ops.readlink},stream:{}},chrdev:{node:{getattr:_.node_ops.getattr,setattr:_.node_ops.setattr},stream:t.chrdev_stream_ops}});var i=t.createNode(e,r,n,o);return t.isDir(i.mode)?(i.node_ops=_.ops_table.dir.node,i.stream_ops=_.ops_table.dir.stream,i.contents={}):t.isFile(i.mode)?(i.node_ops=_.ops_table.file.node,i.stream_ops=_.ops_table.file.stream,i.usedBytes=0,i.contents=null):t.isLink(i.mode)?(i.node_ops=_.ops_table.link.node,i.stream_ops=_.ops_table.link.stream):t.isChrdev(i.mode)&&(i.node_ops=_.ops_table.chrdev.node,i.stream_ops=_.ops_table.chrdev.stream),i.timestamp=Date.now(),e&&(e.contents[r]=i),i},getFileDataAsRegularArray:function(e){if(e.contents&&e.contents.subarray){for(var r=[],n=0;n=r)){var o=1024*1024;r=Math.max(r,n*(n>>0),n!=0&&(r=Math.max(r,256));var i=e.contents;e.contents=new Uint8Array(r),e.usedBytes>0&&e.contents.set(i.subarray(0,e.usedBytes),0)}},resizeFileStorage:function(e,r){if(e.usedBytes!=r){if(r==0){e.contents=null,e.usedBytes=0;return}if(!e.contents||e.contents.subarray){var n=e.contents;e.contents=new Uint8Array(r),n&&e.contents.set(n.subarray(0,Math.min(r,e.usedBytes))),e.usedBytes=r;return}if(e.contents||(e.contents=[]),e.contents.length>r)e.contents.length=r;else for(;e.contents.length=e.node.usedBytes)return 0;var s=Math.min(e.node.usedBytes-i,o);if(s>8&&a.subarray)r.set(a.subarray(i,i+s),n);else for(var u=0;u0||i+o8)throw new t.ErrnoError(32);for(var i=E.normalizeArray(e.split("/").filter(function(v){return!!v}),!1),a=t.root,s="/",u=0;u40)throw new t.ErrnoError(32)}}return{path:s,node:a}},getPath:function(e){for(var r;;){if(t.isRoot(e)){var n=e.mount.mountpoint;return r?n[n.length-1]!=="/"?n+"/"+r:n+r:n}r=r?e.name+"/"+r:e.name,e=e.parent}},hashName:function(e,r){for(var n=0,o=0;o>>0)%t.nameTable.length},hashAddNode:function(e){var r=t.hashName(e.parent.id,e.name);e.name_next=t.nameTable[r],t.nameTable[r]=e},hashRemoveNode:function(e){var r=t.hashName(e.parent.id,e.name);if(t.nameTable[r]===e)t.nameTable[r]=e.name_next;else for(var n=t.nameTable[r];n;){if(n.name_next===e){n.name_next=e.name_next;break}n=n.name_next}},lookupNode:function(e,r){var n=t.mayLookup(e);if(n)throw new t.ErrnoError(n,e);for(var o=t.hashName(e.id,r),i=t.nameTable[o];i;i=i.name_next){var a=i.name;if(i.parent.id===e.id&&a===r)return i}return t.lookup(e,r)},createNode:function(e,r,n,o){var i=new t.FSNode(e,r,n,o);return t.hashAddNode(i),i},destroyNode:function(e){t.hashRemoveNode(e)},isRoot:function(e){return e===e.parent},isMountpoint:function(e){return!!e.mounted},isFile:function(e){return(e&61440)===32768},isDir:function(e){return(e&61440)===16384},isLink:function(e){return(e&61440)===40960},isChrdev:function(e){return(e&61440)===8192},isBlkdev:function(e){return(e&61440)===24576},isFIFO:function(e){return(e&61440)===4096},isSocket:function(e){return(e&49152)===49152},flagModes:{r:0,rs:1052672,"r+":2,w:577,wx:705,xw:705,"w+":578,"wx+":706,"xw+":706,a:1089,ax:1217,xa:1217,"a+":1090,"ax+":1218,"xa+":1218},modeStringToFlags:function(e){var r=t.flagModes[e];if(typeof r>"u")throw new Error("Unknown file open mode: "+e);return r},flagsToPermissionString:function(e){var r=["r","w","rw"][e&3];return e&512&&(r+="w"),r},nodePermissions:function(e,r){return t.ignorePermissions?0:r.indexOf("r")!==-1&&!(e.mode&292)||r.indexOf("w")!==-1&&!(e.mode&146)||r.indexOf("x")!==-1&&!(e.mode&73)?2:0},mayLookup:function(e){var r=t.nodePermissions(e,"x");return r||(e.node_ops.lookup?0:2)},mayCreate:function(e,r){try{var n=t.lookupNode(e,r);return 20}catch{}return t.nodePermissions(e,"wx")},mayDelete:function(e,r,n){var o;try{o=t.lookupNode(e,r)}catch(a){return a.errno}var i=t.nodePermissions(e,"wx");if(i)return i;if(n){if(!t.isDir(o.mode))return 54;if(t.isRoot(o)||t.getPath(o)===t.cwd())return 10}else if(t.isDir(o.mode))return 31;return 0},mayOpen:function(e,r){return e?t.isLink(e.mode)?32:t.isDir(e.mode)&&(t.flagsToPermissionString(r)!=="r"||r&512)?31:t.nodePermissions(e,t.flagsToPermissionString(r)):44},MAX_OPEN_FDS:4096,nextfd:function(e,r){e=e||0,r=r||t.MAX_OPEN_FDS;for(var n=e;n<=r;n++)if(!t.streams[n])return n;throw new t.ErrnoError(33)},getStream:function(e){return t.streams[e]},createStream:function(e,r,n){t.FSStream||(t.FSStream=function(){},t.FSStream.prototype={object:{get:function(){return this.node},set:function(s){this.node=s}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}}});var o=new t.FSStream;for(var i in e)o[i]=e[i];e=o;var a=t.nextfd(r,n);return e.fd=a,t.streams[a]=e,e},closeStream:function(e){t.streams[e]=null},chrdev_stream_ops:{open:function(e){var r=t.getDevice(e.node.rdev);e.stream_ops=r.stream_ops,e.stream_ops.open&&e.stream_ops.open(e)},llseek:function(){throw new t.ErrnoError(70)}},major:function(e){return e>>8},minor:function(e){return e&255},makedev:function(e,r){return e<<8|r},registerDevice:function(e,r){t.devices[e]={stream_ops:r}},getDevice:function(e){return t.devices[e]},getMounts:function(e){for(var r=[],n=[e];n.length;){var o=n.pop();r.push(o),n.push.apply(n,o.mounts)}return r},syncfs:function(e,r){typeof e=="function"&&(r=e,e=!1),t.syncFSRequests++,t.syncFSRequests>1&&P("warning: "+t.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work");var n=t.getMounts(t.root.mount),o=0;function i(s){return t.syncFSRequests--,r(s)}function a(s){if(s)return a.errored?void 0:(a.errored=!0,i(s));++o>=n.length&&i(null)}n.forEach(function(s){if(!s.type.syncfs)return a(null);s.type.syncfs(s,e,a)})},mount:function(e,r,n){var o=n==="/",i=!n,a;if(o&&t.root)throw new t.ErrnoError(10);if(!o&&!i){var s=t.lookupPath(n,{follow_mount:!1});if(n=s.path,a=s.node,t.isMountpoint(a))throw new t.ErrnoError(10);if(!t.isDir(a.mode))throw new t.ErrnoError(54)}var u={type:e,opts:r,mountpoint:n,mounts:[]},c=e.mount(u);return c.mount=u,u.root=c,o?t.root=c:a&&(a.mounted=u,a.mount&&a.mount.mounts.push(u)),c},unmount:function(e){var r=t.lookupPath(e,{follow_mount:!1});if(!t.isMountpoint(r.node))throw new t.ErrnoError(28);var n=r.node,o=n.mounted,i=t.getMounts(o);Object.keys(t.nameTable).forEach(function(s){for(var u=t.nameTable[s];u;){var c=u.name_next;i.indexOf(u.mount)!==-1&&t.destroyNode(u),u=c}}),n.mounted=null;var a=n.mount.mounts.indexOf(o);n.mount.mounts.splice(a,1)},lookup:function(e,r){return e.node_ops.lookup(e,r)},mknod:function(e,r,n){var o=t.lookupPath(e,{parent:!0}),i=o.node,a=E.basename(e);if(!a||a==="."||a==="..")throw new t.ErrnoError(28);var s=t.mayCreate(i,a);if(s)throw new t.ErrnoError(s);if(!i.node_ops.mknod)throw new t.ErrnoError(63);return i.node_ops.mknod(i,a,r,n)},create:function(e,r){return r=r!==void 0?r:438,r&=4095,r|=32768,t.mknod(e,r,0)},mkdir:function(e,r){return r=r!==void 0?r:511,r&=1023,r|=16384,t.mknod(e,r,0)},mkdirTree:function(e,r){for(var n=e.split("/"),o="",i=0;i"u"&&(n=r,r=438),r|=8192,t.mknod(e,r,n)},symlink:function(e,r){if(!B.resolve(e))throw new t.ErrnoError(44);var n=t.lookupPath(r,{parent:!0}),o=n.node;if(!o)throw new t.ErrnoError(44);var i=E.basename(r),a=t.mayCreate(o,i);if(a)throw new t.ErrnoError(a);if(!o.node_ops.symlink)throw new t.ErrnoError(63);return o.node_ops.symlink(o,i,e)},rename:function(e,r){var n=E.dirname(e),o=E.dirname(r),i=E.basename(e),a=E.basename(r),s,u,c;try{s=t.lookupPath(e,{parent:!0}),u=s.node,s=t.lookupPath(r,{parent:!0}),c=s.node}catch{throw new t.ErrnoError(10)}if(!u||!c)throw new t.ErrnoError(44);if(u.mount!==c.mount)throw new t.ErrnoError(75);var d=t.lookupNode(u,i),m=B.relative(e,o);if(m.charAt(0)!==".")throw new t.ErrnoError(28);if(m=B.relative(r,n),m.charAt(0)!==".")throw new t.ErrnoError(55);var y;try{y=t.lookupNode(c,a)}catch{}if(d!==y){var v=t.isDir(d.mode),h=t.mayDelete(u,i,v);if(h)throw new t.ErrnoError(h);if(h=y?t.mayDelete(c,a,v):t.mayCreate(c,a),h)throw new t.ErrnoError(h);if(!u.node_ops.rename)throw new t.ErrnoError(63);if(t.isMountpoint(d)||y&&t.isMountpoint(y))throw new t.ErrnoError(10);if(c!==u&&(h=t.nodePermissions(u,"w"),h))throw new t.ErrnoError(h);try{t.trackingDelegate.willMovePath&&t.trackingDelegate.willMovePath(e,r)}catch(w){P("FS.trackingDelegate['willMovePath']('"+e+"', '"+r+"') threw an exception: "+w.message)}t.hashRemoveNode(d);try{u.node_ops.rename(d,c,a)}catch(w){throw w}finally{t.hashAddNode(d)}try{t.trackingDelegate.onMovePath&&t.trackingDelegate.onMovePath(e,r)}catch(w){P("FS.trackingDelegate['onMovePath']('"+e+"', '"+r+"') threw an exception: "+w.message)}}},rmdir:function(e){var r=t.lookupPath(e,{parent:!0}),n=r.node,o=E.basename(e),i=t.lookupNode(n,o),a=t.mayDelete(n,o,!0);if(a)throw new t.ErrnoError(a);if(!n.node_ops.rmdir)throw new t.ErrnoError(63);if(t.isMountpoint(i))throw new t.ErrnoError(10);try{t.trackingDelegate.willDeletePath&&t.trackingDelegate.willDeletePath(e)}catch(s){P("FS.trackingDelegate['willDeletePath']('"+e+"') threw an exception: "+s.message)}n.node_ops.rmdir(n,o),t.destroyNode(i);try{t.trackingDelegate.onDeletePath&&t.trackingDelegate.onDeletePath(e)}catch(s){P("FS.trackingDelegate['onDeletePath']('"+e+"') threw an exception: "+s.message)}},readdir:function(e){var r=t.lookupPath(e,{follow:!0}),n=r.node;if(!n.node_ops.readdir)throw new t.ErrnoError(54);return n.node_ops.readdir(n)},unlink:function(e){var r=t.lookupPath(e,{parent:!0}),n=r.node,o=E.basename(e),i=t.lookupNode(n,o),a=t.mayDelete(n,o,!1);if(a)throw new t.ErrnoError(a);if(!n.node_ops.unlink)throw new t.ErrnoError(63);if(t.isMountpoint(i))throw new t.ErrnoError(10);try{t.trackingDelegate.willDeletePath&&t.trackingDelegate.willDeletePath(e)}catch(s){P("FS.trackingDelegate['willDeletePath']('"+e+"') threw an exception: "+s.message)}n.node_ops.unlink(n,o),t.destroyNode(i);try{t.trackingDelegate.onDeletePath&&t.trackingDelegate.onDeletePath(e)}catch(s){P("FS.trackingDelegate['onDeletePath']('"+e+"') threw an exception: "+s.message)}},readlink:function(e){var r=t.lookupPath(e),n=r.node;if(!n)throw new t.ErrnoError(44);if(!n.node_ops.readlink)throw new t.ErrnoError(28);return B.resolve(t.getPath(n.parent),n.node_ops.readlink(n))},stat:function(e,r){var n=t.lookupPath(e,{follow:!r}),o=n.node;if(!o)throw new t.ErrnoError(44);if(!o.node_ops.getattr)throw new t.ErrnoError(63);return o.node_ops.getattr(o)},lstat:function(e){return t.stat(e,!0)},chmod:function(e,r,n){var o;if(typeof e=="string"){var i=t.lookupPath(e,{follow:!n});o=i.node}else o=e;if(!o.node_ops.setattr)throw new t.ErrnoError(63);o.node_ops.setattr(o,{mode:r&4095|o.mode&-4096,timestamp:Date.now()})},lchmod:function(e,r){t.chmod(e,r,!0)},fchmod:function(e,r){var n=t.getStream(e);if(!n)throw new t.ErrnoError(8);t.chmod(n.node,r)},chown:function(e,r,n,o){var i;if(typeof e=="string"){var a=t.lookupPath(e,{follow:!o});i=a.node}else i=e;if(!i.node_ops.setattr)throw new t.ErrnoError(63);i.node_ops.setattr(i,{timestamp:Date.now()})},lchown:function(e,r,n){t.chown(e,r,n,!0)},fchown:function(e,r,n){var o=t.getStream(e);if(!o)throw new t.ErrnoError(8);t.chown(o.node,r,n)},truncate:function(e,r){if(r<0)throw new t.ErrnoError(28);var n;if(typeof e=="string"){var o=t.lookupPath(e,{follow:!0});n=o.node}else n=e;if(!n.node_ops.setattr)throw new t.ErrnoError(63);if(t.isDir(n.mode))throw new t.ErrnoError(31);if(!t.isFile(n.mode))throw new t.ErrnoError(28);var i=t.nodePermissions(n,"w");if(i)throw new t.ErrnoError(i);n.node_ops.setattr(n,{size:r,timestamp:Date.now()})},ftruncate:function(e,r){var n=t.getStream(e);if(!n)throw new t.ErrnoError(8);if(!(n.flags&2097155))throw new t.ErrnoError(28);t.truncate(n.node,r)},utime:function(e,r,n){var o=t.lookupPath(e,{follow:!0}),i=o.node;i.node_ops.setattr(i,{timestamp:Math.max(r,n)})},open:function(e,r,n,o,i){if(e==="")throw new t.ErrnoError(44);r=typeof r=="string"?t.modeStringToFlags(r):r,n=typeof n>"u"?438:n,r&64?n=n&4095|32768:n=0;var a;if(typeof e=="object")a=e;else{e=E.normalize(e);try{var s=t.lookupPath(e,{follow:!(r&131072)});a=s.node}catch{}}var u=!1;if(r&64)if(a){if(r&128)throw new t.ErrnoError(20)}else a=t.mknod(e,n,0),u=!0;if(!a)throw new t.ErrnoError(44);if(t.isChrdev(a.mode)&&(r&=-513),r&65536&&!t.isDir(a.mode))throw new t.ErrnoError(54);if(!u){var c=t.mayOpen(a,r);if(c)throw new t.ErrnoError(c)}r&512&&t.truncate(a,0),r&=-131713;var d=t.createStream({node:a,path:t.getPath(a),flags:r,seekable:!0,position:0,stream_ops:a.stream_ops,ungotten:[],error:!1},o,i);d.stream_ops.open&&d.stream_ops.open(d),f.logReadFiles&&!(r&1)&&(t.readFiles||(t.readFiles={}),e in t.readFiles||(t.readFiles[e]=1,P("FS.trackingDelegate error on read file: "+e)));try{if(t.trackingDelegate.onOpenFile){var m=0;(r&2097155)!==1&&(m|=t.tracking.openFlags.READ),r&2097155&&(m|=t.tracking.openFlags.WRITE),t.trackingDelegate.onOpenFile(e,m)}}catch(y){P("FS.trackingDelegate['onOpenFile']('"+e+"', flags) threw an exception: "+y.message)}return d},close:function(e){if(t.isClosed(e))throw new t.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(r){throw r}finally{t.closeStream(e.fd)}e.fd=null},isClosed:function(e){return e.fd===null},llseek:function(e,r,n){if(t.isClosed(e))throw new t.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new t.ErrnoError(70);if(n!=0&&n!=1&&n!=2)throw new t.ErrnoError(28);return e.position=e.stream_ops.llseek(e,r,n),e.ungotten=[],e.position},read:function(e,r,n,o,i){if(o<0||i<0)throw new t.ErrnoError(28);if(t.isClosed(e))throw new t.ErrnoError(8);if((e.flags&2097155)===1)throw new t.ErrnoError(8);if(t.isDir(e.node.mode))throw new t.ErrnoError(31);if(!e.stream_ops.read)throw new t.ErrnoError(28);var a=typeof i<"u";if(!a)i=e.position;else if(!e.seekable)throw new t.ErrnoError(70);var s=e.stream_ops.read(e,r,n,o,i);return a||(e.position+=s),s},write:function(e,r,n,o,i,a){if(o<0||i<0)throw new t.ErrnoError(28);if(t.isClosed(e))throw new t.ErrnoError(8);if(!(e.flags&2097155))throw new t.ErrnoError(8);if(t.isDir(e.node.mode))throw new t.ErrnoError(31);if(!e.stream_ops.write)throw new t.ErrnoError(28);e.seekable&&e.flags&1024&&t.llseek(e,0,2);var s=typeof i<"u";if(!s)i=e.position;else if(!e.seekable)throw new t.ErrnoError(70);var u=e.stream_ops.write(e,r,n,o,i,a);s||(e.position+=u);try{e.path&&t.trackingDelegate.onWriteToFile&&t.trackingDelegate.onWriteToFile(e.path)}catch(c){P("FS.trackingDelegate['onWriteToFile']('"+e.path+"') threw an exception: "+c.message)}return u},allocate:function(e,r,n){if(t.isClosed(e))throw new t.ErrnoError(8);if(r<0||n<=0)throw new t.ErrnoError(28);if(!(e.flags&2097155))throw new t.ErrnoError(8);if(!t.isFile(e.node.mode)&&!t.isDir(e.node.mode))throw new t.ErrnoError(43);if(!e.stream_ops.allocate)throw new t.ErrnoError(138);e.stream_ops.allocate(e,r,n)},mmap:function(e,r,n,o,i,a,s){if(a&2&&!(s&2)&&(e.flags&2097155)!==2)throw new t.ErrnoError(2);if((e.flags&2097155)===1)throw new t.ErrnoError(2);if(!e.stream_ops.mmap)throw new t.ErrnoError(43);return e.stream_ops.mmap(e,r,n,o,i,a,s)},msync:function(e,r,n,o,i){return!e||!e.stream_ops.msync?0:e.stream_ops.msync(e,r,n,o,i)},munmap:function(e){return 0},ioctl:function(e,r,n){if(!e.stream_ops.ioctl)throw new t.ErrnoError(59);return e.stream_ops.ioctl(e,r,n)},readFile:function(e,r){if(r=r||{},r.flags=r.flags||"r",r.encoding=r.encoding||"binary",r.encoding!=="utf8"&&r.encoding!=="binary")throw new Error('Invalid encoding type "'+r.encoding+'"');var n,o=t.open(e,r.flags),i=t.stat(e),a=i.size,s=new Uint8Array(a);return t.read(o,s,0,a,0),r.encoding==="utf8"?n=K(s,0):r.encoding==="binary"&&(n=s),t.close(o),n},writeFile:function(e,r,n){n=n||{},n.flags=n.flags||"w";var o=t.open(e,n.flags,n.mode);if(typeof r=="string"){var i=new Uint8Array(Le(r)+1),a=Ce(r,i,0,i.length);t.write(o,i,0,a,void 0,n.canOwn)}else if(ArrayBuffer.isView(r))t.write(o,r,0,r.byteLength,void 0,n.canOwn);else throw new Error("Unsupported data type");t.close(o)},cwd:function(){return t.currentPath},chdir:function(e){var r=t.lookupPath(e,{follow:!0});if(r.node===null)throw new t.ErrnoError(44);if(!t.isDir(r.node.mode))throw new t.ErrnoError(54);var n=t.nodePermissions(r.node,"x");if(n)throw new t.ErrnoError(n);t.currentPath=r.path},createDefaultDirectories:function(){t.mkdir("/tmp"),t.mkdir("/home"),t.mkdir("/home/web_user")},createDefaultDevices:function(){t.mkdir("/dev"),t.registerDevice(t.makedev(1,3),{read:function(){return 0},write:function(o,i,a,s,u){return s}}),t.mkdev("/dev/null",t.makedev(1,3)),Y.register(t.makedev(5,0),Y.default_tty_ops),Y.register(t.makedev(6,0),Y.default_tty1_ops),t.mkdev("/dev/tty",t.makedev(5,0)),t.mkdev("/dev/tty1",t.makedev(6,0));var e;if(typeof crypto=="object"&&typeof crypto.getRandomValues=="function"){var r=new Uint8Array(1);e=function(){return crypto.getRandomValues(r),r[0]}}else if(se)try{var n=require("crypto");e=function(){return n.randomBytes(1)[0]}}catch{}e||(e=function(){R("random_device")}),t.createDevice("/dev","random",e),t.createDevice("/dev","urandom",e),t.mkdir("/dev/shm"),t.mkdir("/dev/shm/tmp")},createSpecialDirectories:function(){t.mkdir("/proc"),t.mkdir("/proc/self"),t.mkdir("/proc/self/fd"),t.mount({mount:function(){var e=t.createNode("/proc/self","fd",16895,73);return e.node_ops={lookup:function(r,n){var o=+n,i=t.getStream(o);if(!i)throw new t.ErrnoError(8);var a={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:function(){return i.path}}};return a.parent=a,a}},e}},{},"/proc/self/fd")},createStandardStreams:function(){f.stdin?t.createDevice("/dev","stdin",f.stdin):t.symlink("/dev/tty","/dev/stdin"),f.stdout?t.createDevice("/dev","stdout",null,f.stdout):t.symlink("/dev/tty","/dev/stdout"),f.stderr?t.createDevice("/dev","stderr",null,f.stderr):t.symlink("/dev/tty1","/dev/stderr"),t.open("/dev/stdin","r"),t.open("/dev/stdout","w"),t.open("/dev/stderr","w")},ensureErrnoError:function(){t.ErrnoError||(t.ErrnoError=function(r,n){this.node=n,this.setErrno=function(o){this.errno=o},this.setErrno(r),this.message="FS error"},t.ErrnoError.prototype=new Error,t.ErrnoError.prototype.constructor=t.ErrnoError,[44].forEach(function(e){t.genericErrors[e]=new t.ErrnoError(e),t.genericErrors[e].stack=""}))},staticInit:function(){t.ensureErrnoError(),t.nameTable=new Array(4096),t.mount(_,{},"/"),t.createDefaultDirectories(),t.createDefaultDevices(),t.createSpecialDirectories(),t.filesystems={MEMFS:_}},init:function(e,r,n){t.init.initialized=!0,t.ensureErrnoError(),f.stdin=e||f.stdin,f.stdout=r||f.stdout,f.stderr=n||f.stderr,t.createStandardStreams()},quit:function(){t.init.initialized=!1;var e=f._fflush;e&&e(0);for(var r=0;rthis.length-1||v<0)){var h=v%this.chunkSize,w=v/this.chunkSize|0;return this.getter(w)[h]}},a.prototype.setDataGetter=function(v){this.getter=v},a.prototype.cacheLength=function(){var v=new XMLHttpRequest;if(v.open("HEAD",n,!1),v.send(null),!(v.status>=200&&v.status<300||v.status===304))throw new Error("Couldn't load "+n+". Status: "+v.status);var h=Number(v.getResponseHeader("Content-length")),w,F=(w=v.getResponseHeader("Accept-Ranges"))&&w==="bytes",C=(w=v.getResponseHeader("Content-Encoding"))&&w==="gzip",M=1024*1024;F||(M=h);var l=function(D,k){if(D>k)throw new Error("invalid range ("+D+", "+k+") or no bytes requested!");if(k>h-1)throw new Error("only "+h+" bytes available! programmer error!");var A=new XMLHttpRequest;if(A.open("GET",n,!1),h!==M&&A.setRequestHeader("Range","bytes="+D+"-"+k),typeof Uint8Array<"u"&&(A.responseType="arraybuffer"),A.overrideMimeType&&A.overrideMimeType("text/plain; charset=x-user-defined"),A.send(null),!(A.status>=200&&A.status<300||A.status===304))throw new Error("Couldn't load "+n+". Status: "+A.status);return A.response!==void 0?new Uint8Array(A.response||[]):Z(A.responseText||"",!0)},g=this;g.setDataGetter(function(D){var k=D*M,A=(D+1)*M-1;if(A=Math.min(A,h-1),typeof g.chunks[D]>"u"&&(g.chunks[D]=l(k,A)),typeof g.chunks[D]>"u")throw new Error("doXHR failed!");return g.chunks[D]}),(C||!h)&&(M=h=1,h=this.getter(0).length,M=h,ne("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=h,this._chunkSize=M,this.lengthKnown=!0},typeof XMLHttpRequest<"u"){if(!z)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var s=new a;Object.defineProperties(s,{length:{get:function(){return this.lengthKnown||this.cacheLength(),this._length}},chunkSize:{get:function(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}});var u={isDevice:!1,contents:s}}else var u={isDevice:!1,url:n};var c=t.createFile(e,r,u,o,i);u.contents?c.contents=u.contents:u.url&&(c.contents=null,c.url=u.url),Object.defineProperties(c,{usedBytes:{get:function(){return this.contents.length}}});var d={},m=Object.keys(c.stream_ops);return m.forEach(function(y){var v=c.stream_ops[y];d[y]=function(){if(!t.forceLoadFile(c))throw new t.ErrnoError(29);return v.apply(null,arguments)}}),d.read=function(v,h,w,F,C){if(!t.forceLoadFile(c))throw new t.ErrnoError(29);var M=v.node.contents;if(C>=M.length)return 0;var l=Math.min(M.length-C,F);if(M.slice)for(var g=0;g>2]=o.dev,p[n+4>>2]=0,p[n+8>>2]=o.ino,p[n+12>>2]=o.mode,p[n+16>>2]=o.nlink,p[n+20>>2]=o.uid,p[n+24>>2]=o.gid,p[n+28>>2]=o.rdev,p[n+32>>2]=0,O=[o.size>>>0,(S=o.size,+_e(S)>=1?S>0?(Ee(+ae(S/4294967296),4294967295)|0)>>>0:~~+ie((S-+(~~S>>>0))/4294967296)>>>0:0)],p[n+40>>2]=O[0],p[n+44>>2]=O[1],p[n+48>>2]=4096,p[n+52>>2]=o.blocks,p[n+56>>2]=o.atime.getTime()/1e3|0,p[n+60>>2]=0,p[n+64>>2]=o.mtime.getTime()/1e3|0,p[n+68>>2]=0,p[n+72>>2]=o.ctime.getTime()/1e3|0,p[n+76>>2]=0,O=[o.ino>>>0,(S=o.ino,+_e(S)>=1?S>0?(Ee(+ae(S/4294967296),4294967295)|0)>>>0:~~+ie((S-+(~~S>>>0))/4294967296)>>>0:0)],p[n+80>>2]=O[0],p[n+84>>2]=O[1],0},doMsync:function(e,r,n,o,i){var a=U.slice(e,e+n);t.msync(r,a,i,n,o)},doMkdir:function(e,r){return e=E.normalize(e),e[e.length-1]==="/"&&(e=e.substr(0,e.length-1)),t.mkdir(e,r,0),0},doMknod:function(e,r,n){switch(r&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}return t.mknod(e,r,n),0},doReadlink:function(e,r,n){if(n<=0)return-28;var o=t.readlink(e),i=Math.min(n,Le(o)),a=T[r+i];return Je(o,r,n+1),T[r+i]=a,i},doAccess:function(e,r){if(r&-8)return-28;var n,o=t.lookupPath(e,{follow:!0});if(n=o.node,!n)return-44;var i="";return r&4&&(i+="r"),r&2&&(i+="w"),r&1&&(i+="x"),i&&t.nodePermissions(n,i)?-2:0},doDup:function(e,r,n){var o=t.getStream(n);return o&&t.close(o),t.open(e,r,0,n,n).fd},doReadv:function(e,r,n,o){for(var i=0,a=0;a>2],u=p[r+(a*8+4)>>2],c=t.read(e,T,s,u,o);if(c<0)return-1;if(i+=c,c>2],u=p[r+(a*8+4)>>2],c=t.write(e,T,s,u,o);if(c<0)return-1;i+=c}return i},varargs:void 0,get:function(){b.varargs+=4;var e=p[b.varargs-4>>2];return e},getStr:function(e){var r=V(e);return r},getStreamFromFD:function(e){var r=t.getStream(e);if(!r)throw new t.ErrnoError(8);return r},get64:function(e,r){return e}};function sn(e,r,n){b.varargs=n;try{var o=b.getStreamFromFD(e);switch(r){case 0:{var i=b.get();if(i<0)return-28;var a;return a=t.open(o.path,o.flags,0,i),a.fd}case 1:case 2:return 0;case 3:return o.flags;case 4:{var i=b.get();return o.flags|=i,0}case 12:{var i=b.get(),s=0;return Ie[i+s>>1]=2,0}case 13:case 14:return 0;case 16:case 8:return-28;case 9:return ee(28),-1;default:return-28}}catch(u){return(typeof t>"u"||!(u instanceof t.ErrnoError))&&R(u),-u.errno}}function un(e,r,n){b.varargs=n;try{var o=b.getStreamFromFD(e);switch(r){case 21509:case 21505:return o.tty?0:-59;case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:return o.tty?0:-59;case 21519:{if(!o.tty)return-59;var i=b.get();return p[i>>2]=0,0}case 21520:return o.tty?-28:-59;case 21531:{var i=b.get();return t.ioctl(o,r,i)}case 21523:return o.tty?0:-59;case 21524:return o.tty?0:-59;default:R("bad ioctl syscall "+r)}}catch(a){return(typeof t>"u"||!(a instanceof t.ErrnoError))&&R(a),-a.errno}}function fn(e,r){if((e|0)===-1||r===0)return-28;var n=b.mappings[e];if(!n)return 0;if(r===n.len){var o=t.getStream(n.fd);n.prot&2&&b.doMsync(e,o,r,n.flags,n.offset),b.mappings[e]=null,n.allocated&&vr(n.malloc)}return 0}function cn(e,r){try{return fn(e,r)}catch(n){return(typeof t>"u"||!(n instanceof t.ErrnoError))&&R(n),-n.errno}}function ln(e,r,n){b.varargs=n;try{var o=b.getStr(e),i=b.get(),a=t.open(o,r,i);return a.fd}catch(s){return(typeof t>"u"||!(s instanceof t.ErrnoError))&&R(s),-s.errno}}function dn(){R()}var ce=0;function cr(e,r,n,o){e=e|0,r=r|0,n=n|0,o=o|0;var i=0;for(ce=ce+1|0,p[e>>2]=ce;(i|0)<(o|0);){if(!(p[n+(i<<3)>>2]|0))return p[n+(i<<3)>>2]=ce,p[n+((i<<3)+4)>>2]=r,p[n+((i<<3)+8)>>2]=0,Ne(o|0),n|0;i=i+1|0}return o=o*2|0,n=hr(n|0,8*(o+1|0)|0)|0,n=cr(e|0,r|0,n|0,o|0)|0,Ne(o|0),n|0}function mn(e,r,n){e=e|0,r=r|0,n=n|0;for(var o=0,i=0;(o|0)<(n|0)&&(i=p[r+(o<<3)>>2]|0,!!(i|0));){if((i|0)==(e|0))return p[r+((o<<3)+4)>>2]|0;o=o+1|0}return 0}function vn(e,r){throw be(e,r||1),"longjmp"}function hn(e,r){vn(e,r)}function gn(e,r,n){U.copyWithin(e,r,r+n)}function pn(){return U.length}function wn(e){try{return X.grow(e-ue.byteLength+65535>>>16),rr(X.buffer),1}catch{}}function yn(e){e=e>>>0;var r=pn(),n=65536,o=2147483648;if(e>o)return!1;for(var i=16777216,a=1;a<=4;a*=2){var s=r*(1+.2/a);s=Math.min(s,e+100663296);var u=Math.min(o,Ir(Math.max(i,e,s),n)),c=wn(u);if(c)return!0}return!1}var Ye={};function _n(){return xe||"./this.program"}function re(){if(!re.strings){var e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:_n()};for(var r in Ye)e[r]=Ye[r];var n=[];for(var r in e)n.push(r+"="+e[r]);re.strings=n}return re.strings}function En(e,r){var n=0;return re().forEach(function(o,i){var a=r+n;p[e+i*4>>2]=a,Lr(o,a),n+=o.length+1}),0}function kn(e,r){var n=re();p[e>>2]=n.length;var o=0;return n.forEach(function(i){o+=i.length+1}),p[r>>2]=o,0}function Dn(e){try{var r=b.getStreamFromFD(e);return t.close(r),0}catch(n){return(typeof t>"u"||!(n instanceof t.ErrnoError))&&R(n),n.errno}}function An(e,r,n,o){try{var i=b.getStreamFromFD(e),a=b.doReadv(i,r,n);return p[o>>2]=a,0}catch(s){return(typeof t>"u"||!(s instanceof t.ErrnoError))&&R(s),s.errno}}function Sn(e,r,n,o,i){try{var a=b.getStreamFromFD(e),s=4294967296,u=n*s+(r>>>0),c=9007199254740992;return u<=-c||u>=c?-61:(t.llseek(a,u,o),O=[a.position>>>0,(S=a.position,+_e(S)>=1?S>0?(Ee(+ae(S/4294967296),4294967295)|0)>>>0:~~+ie((S-+(~~S>>>0))/4294967296)>>>0:0)],p[i>>2]=O[0],p[i+4>>2]=O[1],a.getdents&&u===0&&o===0&&(a.getdents=null),0)}catch(d){return(typeof t>"u"||!(d instanceof t.ErrnoError))&&R(d),d.errno}}function bn(e,r,n,o){try{var i=b.getStreamFromFD(e),a=b.doWritev(i,r,n);return p[o>>2]=a,0}catch(s){return(typeof t>"u"||!(s instanceof t.ErrnoError))&&R(s),s.errno}}function Pn(){return Tr()|0}function Rn(e){return e=+e,e>=0?+ae(e+.5):+ie(e-.5)}function Fn(e){Ne(e|0)}function pe(e){return e%4===0&&(e%100!==0||e%400===0)}function Te(e,r){for(var n=0,o=0;o<=r;n+=e[o++]);return n}var we=[31,29,31,30,31,30,31,31,30,31,30,31],ye=[31,28,31,30,31,30,31,31,30,31,30,31];function le(e,r){for(var n=new Date(e.getTime());r>0;){var o=pe(n.getFullYear()),i=n.getMonth(),a=(o?we:ye)[i];if(r>a-n.getDate())r-=a-n.getDate()+1,n.setDate(1),i<11?n.setMonth(i+1):(n.setMonth(0),n.setFullYear(n.getFullYear()+1));else return n.setDate(n.getDate()+r),n}return n}function Mn(e,r,n,o){var i=p[o+40>>2],a={tm_sec:p[o>>2],tm_min:p[o+4>>2],tm_hour:p[o+8>>2],tm_mday:p[o+12>>2],tm_mon:p[o+16>>2],tm_year:p[o+20>>2],tm_wday:p[o+24>>2],tm_yday:p[o+28>>2],tm_isdst:p[o+32>>2],tm_gmtoff:p[o+36>>2],tm_zone:i?V(i):""},s=V(n),u={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var c in u)s=s.replace(new RegExp(c,"g"),u[c]);var d=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],m=["January","February","March","April","May","June","July","August","September","October","November","December"];function y(l,g,D){for(var k=typeof l=="number"?l.toString():l||"";k.length0?1:0}var k;return(k=D(l.getFullYear()-g.getFullYear()))===0&&(k=D(l.getMonth()-g.getMonth()))===0&&(k=D(l.getDate()-g.getDate())),k}function w(l){switch(l.getDay()){case 0:return new Date(l.getFullYear()-1,11,29);case 1:return l;case 2:return new Date(l.getFullYear(),0,3);case 3:return new Date(l.getFullYear(),0,2);case 4:return new Date(l.getFullYear(),0,1);case 5:return new Date(l.getFullYear()-1,11,31);case 6:return new Date(l.getFullYear()-1,11,30)}}function F(l){var g=le(new Date(l.tm_year+1900,0,1),l.tm_yday),D=new Date(g.getFullYear(),0,4),k=new Date(g.getFullYear()+1,0,4),A=w(D),L=w(k);return h(A,g)<=0?h(L,g)<=0?g.getFullYear()+1:g.getFullYear():g.getFullYear()-1}var C={"%a":function(l){return d[l.tm_wday].substring(0,3)},"%A":function(l){return d[l.tm_wday]},"%b":function(l){return m[l.tm_mon].substring(0,3)},"%B":function(l){return m[l.tm_mon]},"%C":function(l){var g=l.tm_year+1900;return v(g/100|0,2)},"%d":function(l){return v(l.tm_mday,2)},"%e":function(l){return y(l.tm_mday,2," ")},"%g":function(l){return F(l).toString().substring(2)},"%G":function(l){return F(l)},"%H":function(l){return v(l.tm_hour,2)},"%I":function(l){var g=l.tm_hour;return g==0?g=12:g>12&&(g-=12),v(g,2)},"%j":function(l){return v(l.tm_mday+Te(pe(l.tm_year+1900)?we:ye,l.tm_mon-1),3)},"%m":function(l){return v(l.tm_mon+1,2)},"%M":function(l){return v(l.tm_min,2)},"%n":function(){return` `},"%p":function(l){return l.tm_hour>=0&&l.tm_hour<12?"AM":"PM"},"%S":function(l){return v(l.tm_sec,2)},"%t":function(){return" "},"%u":function(l){return l.tm_wday||7},"%U":function(l){var g=new Date(l.tm_year+1900,0,1),D=g.getDay()===0?g:le(g,7-g.getDay()),k=new Date(l.tm_year+1900,l.tm_mon,l.tm_mday);if(h(D,k)<0){var A=Te(pe(k.getFullYear())?we:ye,k.getMonth()-1)-31,L=31-D.getDate(),H=L+A+k.getDate();return v(Math.ceil(H/7),2)}return h(D,g)===0?"01":"00"},"%V":function(l){var g=new Date(l.tm_year+1900,0,4),D=new Date(l.tm_year+1901,0,4),k=w(g),A=w(D),L=le(new Date(l.tm_year+1900,0,1),l.tm_yday);if(h(L,k)<0)return"53";if(h(A,L)<=0)return"01";var H;return k.getFullYear()=0;return g=Math.abs(g)/60,g=g/60*100+g%60,(D?"+":"-")+("0000"+g).slice(-4)},"%Z":function(l){return l.tm_zone},"%%":function(){return"%"}};for(var c in C)s.indexOf(c)>=0&&(s=s.replace(new RegExp(c,"g"),C[c](a)));var M=Z(s,!1);return M.length>r?0:($e(M,e),M.length-1)}function Tn(e,r,n,o){return Mn(e,r,n,o)}var lr=function(e,r,n,o){e||(e=this),this.parent=e,this.mount=e.mount,this.mounted=null,this.id=t.nextInode++,this.name=r,this.mode=n,this.node_ops={},this.stream_ops={},this.rdev=o},de=365,me=146;Object.defineProperties(lr.prototype,{read:{get:function(){return(this.mode&de)===de},set:function(e){e?this.mode|=de:this.mode&=~de}},write:{get:function(){return(this.mode&me)===me},set:function(e){e?this.mode|=me:this.mode&=~me}},isFolder:{get:function(){return t.isDir(this.mode)}},isDevice:{get:function(){return t.isChrdev(this.mode)}}});t.FSNode=lr;t.staticInit();function Z(e,r,n){var o=n>0?n:Le(e)+1,i=new Array(o),a=Ce(e,i,0,i.length);return r&&(i.length=a),i}var Nn={o:en,m:rn,n:nn,x:tn,a:on,u:an,h:sn,z:un,t:cn,A:ln,d:dn,c:hn,q:gn,r:yn,v:En,w:kn,g:Dn,y:An,p:Sn,f:bn,b:Pn,k:On,B:Bn,memory:X,i:Rn,l:cr,j:Fn,s:Tn,table:Or,e:mn},dr=Zr();f.asm=dr;var mr=f.___wasm_call_ctors=function(){return(mr=f.___wasm_call_ctors=f.asm.C).apply(null,arguments)};f._lottie_init=function(){return(f._lottie_init=f.asm.D).apply(null,arguments)};f._lottie_resize=function(){return(f._lottie_resize=f.asm.E).apply(null,arguments)};var vr=f._free=function(){return(vr=f._free=f.asm.F).apply(null,arguments)};f._lottie_load_from_data=function(){return(f._lottie_load_from_data=f.asm.G).apply(null,arguments)};f._lottie_buffer=function(){return(f._lottie_buffer=f.asm.H).apply(null,arguments)};f._lottie_destroy=function(){return(f._lottie_destroy=f.asm.I).apply(null,arguments)};f._lottie_render=function(){return(f._lottie_render=f.asm.J).apply(null,arguments)};var ze=f._malloc=function(){return(ze=f._malloc=f.asm.K).apply(null,arguments)},hr=f._realloc=function(){return(hr=f._realloc=f.asm.L).apply(null,arguments)},gr=f.___errno_location=function(){return(gr=f.___errno_location=f.asm.M).apply(null,arguments)},be=f._setThrew=function(){return(be=f._setThrew=f.asm.N).apply(null,arguments)},pr=f.dynCall_vi=function(){return(pr=f.dynCall_vi=f.asm.O).apply(null,arguments)},wr=f.dynCall_iii=function(){return(wr=f.dynCall_iii=f.asm.P).apply(null,arguments)},Pe=f.stackSave=function(){return(Pe=f.stackSave=f.asm.Q).apply(null,arguments)},ke=f.stackAlloc=function(){return(ke=f.stackAlloc=f.asm.R).apply(null,arguments)},Re=f.stackRestore=function(){return(Re=f.stackRestore=f.asm.S).apply(null,arguments)};f.dynCall_v=function(){return(f.dynCall_v=f.asm.T).apply(null,arguments)};function On(e,r,n){var o=Pe();try{return wr(e,r,n)}catch(i){if(Re(o),i!==i+0&&i!=="longjmp")throw i;be(1,0)}}function Bn(e,r){var n=Pe();try{pr(e,r)}catch(o){if(Re(n),o!==o+0&&o!=="longjmp")throw o;be(1,0)}}f.asm=dr;f.intArrayFromString=Z;f.cwrap=xr;f.allocate=Ze;var De;function xn(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}Q=function e(){De||Ue(),De||(Q=e)};function Ue(e){if(q>0||(Hr(),q>0))return;function r(){De||(De=!0,f.calledRun=!0,!Ge&&(jr(),Wr(),f.onRuntimeInitialized&&f.onRuntimeInitialized(),Yr()))}f.setStatus?(f.setStatus("Running..."),setTimeout(function(){setTimeout(function(){f.setStatus("")},1),r()},1)):r()}f.run=Ue;if(f.preInit)for(typeof f.preInit=="function"&&(f.preInit=[f.preInit]);f.preInit.length>0;)f.preInit.pop()();Ue();const yr=60;class Cn{constructor(r,n,o,i){this.reqId=r,this.width=n,this.height=o,this.raw=i}init(r,n){if(!this.dead){this.fps=Math.max(1,Math.min(60,n||yr));try{this.handle=j.Api.init(),this.stringOnWasmHeap=Ze(Z(r),"i8",0),this.frameCount=j.Api.loadFromData(this.handle,this.stringOnWasmHeap),j.Api.resize(this.handle,this.width,this.height),W(["loaded",this.reqId,this.frameCount,this.fps]),!this.raw&&Dr&&(this.imageData=new ImageData(this.width,this.height))}catch(o){console.error("init RLottieItem error:",o),W(["error",this.reqId,o])}}}render(r,n){if(!(this.dead||this.handle===void 0)&&!(this.frameCount{W(["frame",this.reqId,r,a],[a])})):(n?n.set(i):n=new Uint8ClampedArray(i),W(["frame",this.reqId,r,n],[n.buffer]))}catch(o){console.error("Render error:",o),this.dead=!0,W(["error",this.reqId,o])}}destroy(){this.dead=!0,this.handle!==void 0&&j.Api.destroy(this.handle)}}class Ln{constructor(){this.Api={}}initApi(){this.Api={init:f.cwrap("lottie_init","",[]),destroy:f.cwrap("lottie_destroy","",["number"]),resize:f.cwrap("lottie_resize","",["number","number","number"]),buffer:f.cwrap("lottie_buffer","number",["number"]),render:f.cwrap("lottie_render","",["number","number"]),loadFromData:f.cwrap("lottie_load_from_data","number",["number","number"])}}init(){this.initApi(),W(["ready"])}}const j=new Ln;f.onRuntimeInitialized=function(){j.init()};const ve={},Ve={loadFromData:function(e,r,n,o,i,a){const s=ve[e]=new Cn(e,n,o,a);Sr(r).then(u=>{try{if(typeof i=="number"&&i>=1&&i<=5){const m=JSON.parse(u);Pr(m,i),u=JSON.stringify(m)}const d=+u.match(/"fr":\s*?(\d+?),/)?.[1]||yr;s.init(u,d)}catch(c){console.error("Invalid file for sticker:",u),W(["error",e,c])}})},destroy:function(e){const r=ve[e];r&&(r.destroy(),delete ve[e])},renderFrame:function(e,r,n){ve[e].render(r,n)}};function W(e,r){postMessage({queryMethodListener:e.shift(),queryMethodArguments:e},kr?r:void 0)}onmessage=function(e){Ve[e.data.queryMethod].apply(Ve,e.data.queryMethodArguments)}; //# sourceMappingURL=rlottie.worker--aUfWGB2.js.map