@zappar/zappar-cv 2.1.5 → 2.1.7

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.
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.ZCV=t():e.ZCV=t()}(self,(function(){return(()=>{"use strict";var e,t,r={56:(e,t,r)=>{var a,n=(a="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0,function(e){var t,r,n;e=e||{},t||(t=void 0!==e?e:{}),t.ready=new Promise((function(e,t){r=e,n=t}));var i,o={};for(i in t)t.hasOwnProperty(i)&&(o[i]=t[i]);var s="./this.program";function _(e,t){throw t}var c,f="";f=self.location.href,a&&(f=a),f=0!==f.indexOf("blob:")?f.substr(0,f.lastIndexOf("/")+1):"",c=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)};var u,l,p=t.print||console.log.bind(console),d=t.printErr||console.warn.bind(console);for(i in o)o.hasOwnProperty(i)&&(t[i]=o[i]);o=null,t.thisProgram&&(s=t.thisProgram),t.quit&&(_=t.quit),t.wasmBinary&&(l=t.wasmBinary);var h=t.noExitRuntime||!0;"object"!=typeof WebAssembly&&j("no native wasm support detected");var m,b,g=!1;function w(e,t){e||j("Assertion failed: "+t)}function y(e){var r=t["_"+e];return w(r,"Cannot call unknown function "+e+", make sure it is exported"),r}var v,E,A,T,R,x,k,L,F,z="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function M(e,t,r){var a=t+r;for(r=t;e[r]&&!(r>=a);)++r;if(16<r-t&&e.subarray&&z)return z.decode(e.subarray(t,r));for(a="";t<r;){var n=e[t++];if(128&n){var i=63&e[t++];if(192==(224&n))a+=String.fromCharCode((31&n)<<6|i);else{var o=63&e[t++];65536>(n=224==(240&n)?(15&n)<<12|i<<6|o:(7&n)<<18|i<<12|o<<6|63&e[t++])?a+=String.fromCharCode(n):(n-=65536,a+=String.fromCharCode(55296|n>>10,56320|1023&n))}}else a+=String.fromCharCode(n)}return a}function I(e,t){return e?M(A,e,t):""}function P(e,t,r,a){if(!(0<a))return 0;var n=r;a=r+a-1;for(var i=0;i<e.length;++i){var o=e.charCodeAt(i);if(55296<=o&&57343>=o&&(o=65536+((1023&o)<<10)|1023&e.charCodeAt(++i)),127>=o){if(r>=a)break;t[r++]=o}else{if(2047>=o){if(r+1>=a)break;t[r++]=192|o>>6}else{if(65535>=o){if(r+2>=a)break;t[r++]=224|o>>12}else{if(r+3>=a)break;t[r++]=240|o>>18,t[r++]=128|o>>12&63}t[r++]=128|o>>6&63}t[r++]=128|63&o}}return t[r]=0,r-n}function O(e){for(var t=0,r=0;r<e.length;++r){var a=e.charCodeAt(r);55296<=a&&57343>=a&&(a=65536+((1023&a)<<10)|1023&e.charCodeAt(++r)),127>=a?++t:t=2047>=a?t+2:65535>=a?t+3:t+4}return t}function S(e){var t=O(e)+1,r=_r(t);return r&&P(e,E,r,t),r}function B(e,t){for(var r=0;r<e.length;++r)E[t++>>0]=e.charCodeAt(r);E[t>>0]=0}function D(){var e=m.buffer;v=e,t.HEAP8=E=new Int8Array(e),t.HEAP16=T=new Int16Array(e),t.HEAP32=x=new Int32Array(e),t.HEAPU8=A=new Uint8Array(e),t.HEAPU16=R=new Uint16Array(e),t.HEAPU32=k=new Uint32Array(e),t.HEAPF32=L=new Float32Array(e),t.HEAPF64=F=new Float64Array(e)}var C,U=[],V=[],N=[],G=[];function W(){var e=t.preRun.shift();U.unshift(e)}var H=0,q=null,Y=null;function X(){H++,t.monitorRunDependencies&&t.monitorRunDependencies(H)}function Z(){if(H--,t.monitorRunDependencies&&t.monitorRunDependencies(H),0==H&&(null!==q&&(clearInterval(q),q=null),Y)){var e=Y;Y=null,e()}}function j(e){throw t.onAbort&&t.onAbort(e),d(e),g=!0,b=1,e=new WebAssembly.RuntimeError("abort("+e+"). Build with -s ASSERTIONS=1 for more info."),n(e),e}t.preloadedImages={},t.preloadedAudios={};var K,J,$,Q="zappar-cv.wasm";if(String.prototype.startsWith?!Q.startsWith("data:application/octet-stream;base64,"):0!==Q.indexOf("data:application/octet-stream;base64,")){var ee=Q;Q=t.locateFile?t.locateFile(ee,f):f+ee}function te(e){for(;0<e.length;){var r=e.shift();if("function"==typeof r)r(t);else{var a=r.vd;"number"==typeof a?void 0===r.Oc?C.get(a)():C.get(a)(r.Oc):a(void 0===r.Oc?null:r.Oc)}}}function re(e,t){if(0===e)e=Date.now();else{if(1!==e&&4!==e)return x[fr()>>2]=28,-1;e=$()}return x[t>>2]=e/1e3|0,x[t+4>>2]=e%1e3*1e6|0,0}function ae(e){this.Hc=e-16,this.Md=function(e){x[this.Hc+8>>2]=e},this.Jd=function(e){x[this.Hc+0>>2]=e},this.Kd=function(){x[this.Hc+4>>2]=0},this.Id=function(){E[this.Hc+12>>0]=0},this.Ld=function(){E[this.Hc+13>>0]=0},this.yd=function(e,t){this.Md(e),this.Jd(t),this.Kd(),this.Id(),this.Ld()}}function ne(e,t){for(var r=0,a=e.length-1;0<=a;a--){var n=e[a];"."===n?e.splice(a,1):".."===n?(e.splice(a,1),r++):r&&(e.splice(a,1),r--)}if(t)for(;r;r--)e.unshift("..");return e}function ie(e){var t="/"===e.charAt(0),r="/"===e.substr(-1);return(e=ne(e.split("/").filter((function(e){return!!e})),!t).join("/"))||t||(e="."),e&&r&&(e+="/"),(t?"/":"")+e}function oe(e){var t=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1);return e=t[0],t=t[1],e||t?(t&&(t=t.substr(0,t.length-1)),e+t):"."}function se(e){if("/"===e)return"/";var t=(e=(e=ie(e)).replace(/\/$/,"")).lastIndexOf("/");return-1===t?e:e.substr(t+1)}function _e(){for(var e="",t=!1,r=arguments.length-1;-1<=r&&!t;r--){if("string"!=typeof(t=0<=r?arguments[r]:"/"))throw new TypeError("Arguments to path.resolve must be strings");if(!t)return"";e=t+"/"+e,t="/"===t.charAt(0)}return(t?"/":"")+(e=ne(e.split("/").filter((function(e){return!!e})),!t).join("/"))||"."}$=function(){return performance.now()};var ce=[];function fe(e,t){ce[e]={input:[],wc:[],Gc:t},Se(e,ue)}var ue={open:function(e){var t=ce[e.node.Lc];if(!t)throw new Ee(43);e.uc=t,e.seekable=!1},close:function(e){e.uc.Gc.flush(e.uc)},flush:function(e){e.uc.Gc.flush(e.uc)},read:function(e,t,r,a){if(!e.uc||!e.uc.Gc.hd)throw new Ee(60);for(var n=0,i=0;i<a;i++){try{var o=e.uc.Gc.hd(e.uc)}catch(e){throw new Ee(29)}if(void 0===o&&0===n)throw new Ee(6);if(null==o)break;n++,t[r+i]=o}return n&&(e.node.timestamp=Date.now()),n},write:function(e,t,r,a){if(!e.uc||!e.uc.Gc.$c)throw new Ee(60);try{for(var n=0;n<a;n++)e.uc.Gc.$c(e.uc,t[r+n])}catch(e){throw new Ee(29)}return a&&(e.node.timestamp=Date.now()),n}},le={hd:function(e){if(!e.input.length){var t=null;if("undefined"!=typeof window&&"function"==typeof window.prompt?null!==(t=window.prompt("Input: "))&&(t+="\n"):"function"==typeof readline&&null!==(t=readline())&&(t+="\n"),!t)return null;e.input=nr(t,!0)}return e.input.shift()},$c:function(e,t){null===t||10===t?(p(M(e.wc,0)),e.wc=[]):0!=t&&e.wc.push(t)},flush:function(e){e.wc&&0<e.wc.length&&(p(M(e.wc,0)),e.wc=[])}},pe={$c:function(e,t){null===t||10===t?(d(M(e.wc,0)),e.wc=[]):0!=t&&e.wc.push(t)},flush:function(e){e.wc&&0<e.wc.length&&(d(M(e.wc,0)),e.wc=[])}},de={zc:null,Bc:function(){return de.createNode(null,"/",16895,0)},createNode:function(e,t,r,a){if(24576==(61440&r)||4096==(61440&r))throw new Ee(63);return de.zc||(de.zc={dir:{node:{yc:de.qc.yc,Ac:de.qc.Ac,Jc:de.qc.Jc,Qc:de.qc.Qc,nd:de.qc.nd,Wc:de.qc.Wc,od:de.qc.od,Rc:de.qc.Rc,Sc:de.qc.Sc},stream:{Ec:de.sc.Ec}},file:{node:{yc:de.qc.yc,Ac:de.qc.Ac},stream:{Ec:de.sc.Ec,read:de.sc.read,write:de.sc.write,cd:de.sc.cd,jd:de.sc.jd,ld:de.sc.ld}},link:{node:{yc:de.qc.yc,Ac:de.qc.Ac,Mc:de.qc.Mc},stream:{}},dd:{node:{yc:de.qc.yc,Ac:de.qc.Ac},stream:Oe}}),16384==(61440&(r=Le(e,t,r,a)).mode)?(r.qc=de.zc.dir.node,r.sc=de.zc.dir.stream,r.rc={}):32768==(61440&r.mode)?(r.qc=de.zc.file.node,r.sc=de.zc.file.stream,r.tc=0,r.rc=null):40960==(61440&r.mode)?(r.qc=de.zc.link.node,r.sc=de.zc.link.stream):8192==(61440&r.mode)&&(r.qc=de.zc.dd.node,r.sc=de.zc.dd.stream),r.timestamp=Date.now(),e&&(e.rc[t]=r,e.timestamp=r.timestamp),r},Yd:function(e){return e.rc?e.rc.subarray?e.rc.subarray(0,e.tc):new Uint8Array(e.rc):new Uint8Array(0)},ed:function(e,t){var r=e.rc?e.rc.length:0;r>=t||(t=Math.max(t,r*(1048576>r?2:1.125)>>>0),0!=r&&(t=Math.max(t,256)),r=e.rc,e.rc=new Uint8Array(t),0<e.tc&&e.rc.set(r.subarray(0,e.tc),0))},Gd:function(e,t){if(e.tc!=t)if(0==t)e.rc=null,e.tc=0;else{var r=e.rc;e.rc=new Uint8Array(t),r&&e.rc.set(r.subarray(0,Math.min(t,e.tc))),e.tc=t}},qc:{yc:function(e){var t={};return t.td=8192==(61440&e.mode)?e.id:1,t.Zc=e.id,t.mode=e.mode,t.Ed=1,t.uid=0,t.wd=0,t.Lc=e.Lc,16384==(61440&e.mode)?t.size=4096:32768==(61440&e.mode)?t.size=e.tc:40960==(61440&e.mode)?t.size=e.link.length:t.size=0,t.pd=new Date(e.timestamp),t.Dd=new Date(e.timestamp),t.sd=new Date(e.timestamp),t.qd=4096,t.rd=Math.ceil(t.size/t.qd),t},Ac:function(e,t){void 0!==t.mode&&(e.mode=t.mode),void 0!==t.timestamp&&(e.timestamp=t.timestamp),void 0!==t.size&&de.Gd(e,t.size)},Jc:function(){throw Ae[44]},Qc:function(e,t,r,a){return de.createNode(e,t,r,a)},nd:function(e,t,r){if(16384==(61440&e.mode)){try{var a=ke(t,r)}catch(e){}if(a)for(var n in a.rc)throw new Ee(55)}delete e.parent.rc[e.name],e.parent.timestamp=Date.now(),e.name=r,t.rc[r]=e,t.timestamp=e.parent.timestamp,e.parent=t},Wc:function(e,t){delete e.rc[t],e.timestamp=Date.now()},od:function(e,t){var r,a=ke(e,t);for(r in a.rc)throw new Ee(55);delete e.rc[t],e.timestamp=Date.now()},Rc:function(e){var t,r=[".",".."];for(t in e.rc)e.rc.hasOwnProperty(t)&&r.push(t);return r},Sc:function(e,t,r){return(e=de.createNode(e,t,41471,0)).link=r,e},Mc:function(e){if(40960!=(61440&e.mode))throw new Ee(28);return e.link}},sc:{read:function(e,t,r,a,n){var i=e.node.rc;if(n>=e.node.tc)return 0;if(8<(e=Math.min(e.node.tc-n,a))&&i.subarray)t.set(i.subarray(n,n+e),r);else for(a=0;a<e;a++)t[r+a]=i[n+a];return e},write:function(e,t,r,a,n,i){if(t.buffer===E.buffer&&(i=!1),!a)return 0;if((e=e.node).timestamp=Date.now(),t.subarray&&(!e.rc||e.rc.subarray)){if(i)return e.rc=t.subarray(r,r+a),e.tc=a;if(0===e.tc&&0===n)return e.rc=t.slice(r,r+a),e.tc=a;if(n+a<=e.tc)return e.rc.set(t.subarray(r,r+a),n),a}if(de.ed(e,n+a),e.rc.subarray&&t.subarray)e.rc.set(t.subarray(r,r+a),n);else for(i=0;i<a;i++)e.rc[n+i]=t[r+i];return e.tc=Math.max(e.tc,n+a),a},Ec:function(e,t,r){if(1===r?t+=e.position:2===r&&32768==(61440&e.node.mode)&&(t+=e.node.tc),0>t)throw new Ee(28);return t},cd:function(e,t,r){de.ed(e.node,t+r),e.node.tc=Math.max(e.node.tc,t+r)},jd:function(e,t,r,a,n,i){if(0!==t)throw new Ee(28);if(32768!=(61440&e.node.mode))throw new Ee(43);if(e=e.node.rc,2&i||e.buffer!==v){for((0<a||a+r<e.length)&&(e=e.subarray?e.subarray(a,a+r):Array.prototype.slice.call(e,a,a+r)),a=!0,i=16384*Math.ceil(r/16384),t=_r(i);r<i;)E[t+r++]=0;if(!(r=t))throw new Ee(48);E.set(e,r)}else a=!1,r=e.byteOffset;return{Hc:r,Ud:a}},ld:function(e,t,r,a,n){if(32768!=(61440&e.node.mode))throw new Ee(43);return 2&n||de.sc.write(e,t,0,a,r,!1),0}}},he=null,me={},be=[],ge=1,we=null,ye=!0,ve={},Ee=null,Ae={};function Te(e,t){if(t=t||{},!(e=_e("/",e)))return{path:"",node:null};var r,a={fd:!0,ad:0};for(r in a)void 0===t[r]&&(t[r]=a[r]);if(8<t.ad)throw new Ee(32);e=ne(e.split("/").filter((function(e){return!!e})),!1);var n=he;for(a="/",r=0;r<e.length;r++){var i=r===e.length-1;if(i&&t.parent)break;if(n=ke(n,e[r]),a=ie(a+"/"+e[r]),n.Kc&&(!i||i&&t.fd)&&(n=n.Kc.root),!i||t.Pc)for(i=0;40960==(61440&n.mode);)if(n=Ne(a),n=Te(a=_e(oe(a),n),{ad:t.ad}).node,40<i++)throw new Ee(32)}return{path:a,node:n}}function Re(e){for(var t;;){if(e===e.parent)return e=e.Bc.kd,t?"/"!==e[e.length-1]?e+"/"+t:e+t:e;t=t?e.name+"/"+t:e.name,e=e.parent}}function xe(e,t){for(var r=0,a=0;a<t.length;a++)r=(r<<5)-r+t.charCodeAt(a)|0;return(e+r>>>0)%we.length}function ke(e,t){var r;if(r=(r=Me(e,"x"))?r:e.qc.Jc?0:2)throw new Ee(r,e);for(r=we[xe(e.id,t)];r;r=r.Fc){var a=r.name;if(r.parent.id===e.id&&a===t)return r}return e.qc.Jc(e,t)}function Le(e,t,r,a){return t=xe((e=new ar(e,t,r,a)).parent.id,e.name),e.Fc=we[t],we[t]=e}var Fe={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090};function ze(e){var t=["r","w","rw"][3&e];return 512&e&&(t+="w"),t}function Me(e,t){return ye||(-1===t.indexOf("r")||292&e.mode)&&(-1===t.indexOf("w")||146&e.mode)&&(-1===t.indexOf("x")||73&e.mode)?0:2}function Ie(e,t){try{return ke(e,t),20}catch(e){}return Me(e,"wx")}var Pe,Oe={open:function(e){e.sc=me[e.node.Lc].sc,e.sc.open&&e.sc.open(e)},Ec:function(){throw new Ee(70)}};function Se(e,t){me[e]={sc:t}}function Be(e,t){var r="/"===t,a=!t;if(r&&he)throw new Ee(10);if(!r&&!a){var n=Te(t,{fd:!1});if(t=n.path,(n=n.node).Kc)throw new Ee(10);if(16384!=(61440&n.mode))throw new Ee(54)}t={type:e,be:{},kd:t,Cd:[]},(e=e.Bc(t)).Bc=t,t.root=e,r?he=e:n&&(n.Kc=t,n.Bc&&n.Bc.Cd.push(t))}function De(e,t,r){var a=Te(e,{parent:!0}).node;if(!(e=se(e))||"."===e||".."===e)throw new Ee(28);var n=Ie(a,e);if(n)throw new Ee(n);if(!a.qc.Qc)throw new Ee(63);return a.qc.Qc(a,e,t,r)}function Ce(e){return De(e,16895,0)}function Ue(e,t,r){void 0===r&&(r=t,t=438),De(e,8192|t,r)}function Ve(e,t){if(!_e(e))throw new Ee(44);var r=Te(t,{parent:!0}).node;if(!r)throw new Ee(44);var a=Ie(r,t=se(t));if(a)throw new Ee(a);if(!r.qc.Sc)throw new Ee(63);r.qc.Sc(r,t,e)}function Ne(e){if(!(e=Te(e).node))throw new Ee(44);if(!e.qc.Mc)throw new Ee(28);return _e(Re(e.parent),e.qc.Mc(e))}function Ge(e,t){if(!(e=Te(e,{Pc:!t}).node))throw new Ee(44);if(!e.qc.yc)throw new Ee(63);return e.qc.yc(e)}function We(e){return Ge(e,!0)}function He(e,r,a,n){if(""===e)throw new Ee(44);if("string"==typeof r){var i=Fe[r];if(void 0===i)throw Error("Unknown file open mode: "+r);r=i}if(a=64&r?4095&(void 0===a?438:a)|32768:0,"object"==typeof e)var o=e;else{e=ie(e);try{o=Te(e,{Pc:!(131072&r)}).node}catch(e){}}if(i=!1,64&r)if(o){if(128&r)throw new Ee(20)}else o=De(e,a,0),i=!0;if(!o)throw new Ee(44);if(8192==(61440&o.mode)&&(r&=-513),65536&r&&16384!=(61440&o.mode))throw new Ee(54);if(!i&&(a=o?40960==(61440&o.mode)?32:16384==(61440&o.mode)&&("r"!==ze(r)||512&r)?31:Me(o,ze(r)):44))throw new Ee(a);if(512&r){if(!(a="string"==typeof(a=o)?Te(a,{Pc:!0}).node:a).qc.Ac)throw new Ee(63);if(16384==(61440&a.mode))throw new Ee(31);if(32768!=(61440&a.mode))throw new Ee(28);if(i=Me(a,"w"))throw new Ee(i);a.qc.Ac(a,{size:0,timestamp:Date.now()})}r&=-131713,(n=function(e,t){je||((je=function(){}).prototype={});var r,a=new je;for(r in e)a[r]=e[r];return e=a,t=function(e){for(e=e||0;e<=4096;e++)if(!be[e])return e;throw new Ee(33)}(t),e.Cc=t,be[t]=e}({node:o,path:Re(o),flags:r,seekable:!0,position:0,sc:o.sc,Rd:[],error:!1},n)).sc.open&&n.sc.open(n),!t.logReadFiles||1&r||(Ke||(Ke={}),e in Ke||(Ke[e]=1,d("FS.trackingDelegate error on read file: "+e)));try{ve.onOpenFile&&(o=0,1!=(2097155&r)&&(o|=1),0!=(2097155&r)&&(o|=2),ve.onOpenFile(e,o))}catch(t){d("FS.trackingDelegate['onOpenFile']('"+e+"', flags) threw an exception: "+t.message)}return n}function qe(e,t,r){if(null===e.Cc)throw new Ee(8);if(!e.seekable||!e.sc.Ec)throw new Ee(70);if(0!=r&&1!=r&&2!=r)throw new Ee(28);return e.position=e.sc.Ec(e,t,r),e.Rd=[],e.position}function Ye(){Ee||((Ee=function(e,t){this.node=t,this.Hd=function(e){this.vc=e},this.Hd(e),this.message="FS error"}).prototype=Error(),Ee.prototype.constructor=Ee,[44].forEach((function(e){Ae[e]=new Ee(e),Ae[e].stack="<generic error, no stack>"})))}function Xe(e,t,r){e=ie("/dev/"+e);var a=function(e,t){var r=0;return e&&(r|=365),t&&(r|=146),r}(!!t,!!r);Ze||(Ze=64);var n=Ze++<<8|0;Se(n,{open:function(e){e.seekable=!1},close:function(){r&&r.buffer&&r.buffer.length&&r(10)},read:function(e,r,a,n){for(var i=0,o=0;o<n;o++){try{var s=t()}catch(e){throw new Ee(29)}if(void 0===s&&0===i)throw new Ee(6);if(null==s)break;i++,r[a+o]=s}return i&&(e.node.timestamp=Date.now()),i},write:function(e,t,a,n){for(var i=0;i<n;i++)try{r(t[a+i])}catch(e){throw new Ee(29)}return n&&(e.node.timestamp=Date.now()),i}}),Ue(e,a,n)}var Ze,je,Ke,Je={};function $e(e,t,r){try{var a=e(t)}catch(e){if(e&&e.node&&ie(t)!==ie(Re(e.node)))return-54;throw e}return x[r>>2]=a.td,x[r+4>>2]=0,x[r+8>>2]=a.Zc,x[r+12>>2]=a.mode,x[r+16>>2]=a.Ed,x[r+20>>2]=a.uid,x[r+24>>2]=a.wd,x[r+28>>2]=a.Lc,x[r+32>>2]=0,J=[a.size>>>0,(K=a.size,1<=+Math.abs(K)?0<K?(0|Math.min(+Math.floor(K/4294967296),4294967295))>>>0:~~+Math.ceil((K-+(~~K>>>0))/4294967296)>>>0:0)],x[r+40>>2]=J[0],x[r+44>>2]=J[1],x[r+48>>2]=4096,x[r+52>>2]=a.rd,x[r+56>>2]=a.pd.getTime()/1e3|0,x[r+60>>2]=0,x[r+64>>2]=a.Dd.getTime()/1e3|0,x[r+68>>2]=0,x[r+72>>2]=a.sd.getTime()/1e3|0,x[r+76>>2]=0,J=[a.Zc>>>0,(K=a.Zc,1<=+Math.abs(K)?0<K?(0|Math.min(+Math.floor(K/4294967296),4294967295))>>>0:~~+Math.ceil((K-+(~~K>>>0))/4294967296)>>>0:0)],x[r+80>>2]=J[0],x[r+84>>2]=J[1],0}var Qe=void 0;function et(){return x[(Qe+=4)-4>>2]}function tt(e){if(!(e=be[e]))throw new Ee(8);return e}function rt(e){try{e()}catch(e){if(!(e instanceof br)&&"unwind"!==e)throw e&&"object"==typeof e&&e.stack&&d("exception thrown: "+[e,e.stack]),e}}var at,nt,it,ot=!1,st=null,_t=0,ct=null,ft=0,ut=0,lt=0,pt=[],dt={},ht=!1,mt=!1,bt=[];function gt(e,r,a,n){if(r&&t.Yc&&e==t.canvas)return t.Yc;var i;if(r){var o={antialias:!1,alpha:!1,Bd:1};if(n)for(var s in n)o[s]=n[s];if(void 0!==Kt&&(i=function(e,t){e.gd||(e.gd=e.getContext,e.getContext=function(t,r){return"webgl"==t==(r=e.gd(t,r))instanceof WebGLRenderingContext?r:null});var r=e.getContext("webgl",t);return r?function(e,t){var r=Yt(qt),a={Zd:r,attributes:t,version:t.Bd,Xc:e};return e.canvas&&(e.canvas.Td=a),qt[r]=a,(void 0===t.ud||t.ud)&&function(e){if(e||(e=Zt),!e.zd){e.zd=!0;var t=e.Xc;!function(e){var t=e.getExtension("ANGLE_instanced_arrays");t&&(e.vertexAttribDivisor=function(e,r){t.vertexAttribDivisorANGLE(e,r)},e.drawArraysInstanced=function(e,r,a,n){t.drawArraysInstancedANGLE(e,r,a,n)},e.drawElementsInstanced=function(e,r,a,n,i){t.drawElementsInstancedANGLE(e,r,a,n,i)})}(t),function(e){var t=e.getExtension("OES_vertex_array_object");t&&(e.createVertexArray=function(){return t.createVertexArrayOES()},e.deleteVertexArray=function(e){t.deleteVertexArrayOES(e)},e.bindVertexArray=function(e){t.bindVertexArrayOES(e)},e.isVertexArray=function(e){return t.isVertexArrayOES(e)})}(t),function(e){var t=e.getExtension("WEBGL_draw_buffers");t&&(e.drawBuffers=function(e,r){t.drawBuffersWEBGL(e,r)})}(t),t.Wd=t.getExtension("EXT_disjoint_timer_query"),t.$d=t.getExtension("WEBGL_multi_draw"),(t.getSupportedExtensions()||[]).forEach((function(e){0>e.indexOf("lose_context")&&0>e.indexOf("debug")&&t.getExtension(e)}))}}(a),r}(r,t):0}(e,o)))var _=qt[i].Xc}else _=e.getContext("2d");return _?(a&&(r||w(void 0===Qt,"cannot set in module if GLctx is used, but we are a non-GL context that would replace it"),t.Yc=_,r&&(Zt=qt[i],t.Yc=Qt=Zt&&Zt.Xc),t.ee=r,bt.forEach((function(e){e()})),function(){function e(){mt=document.pointerLockElement===t.canvas||document.mozPointerLockElement===t.canvas||document.webkitPointerLockElement===t.canvas||document.msPointerLockElement===t.canvas}if(t.preloadPlugins||(t.preloadPlugins=[]),!kt){kt=!0;try{Lt=!0}catch(e){Lt=!1,console.log("warning: no blob constructor, cannot create blobs with mimetypes")}Ft="undefined"!=typeof MozBlobBuilder?MozBlobBuilder:"undefined"!=typeof WebKitBlobBuilder?WebKitBlobBuilder:Lt?null:console.log("warning: no BlobBuilder"),zt="undefined"!=typeof window?window.URL?window.URL:window.webkitURL:void 0,t.md||void 0!==zt||(console.log("warning: Browser does not support creating object URLs. Built-in browser image decoding will not be available."),t.md=!0),t.preloadPlugins.push({canHandle:function(e){return!t.md&&/\.(jpg|jpeg|png|bmp)$/i.test(e)},handle:function(e,r,a,n){var i=null;if(Lt)try{(i=new Blob([e],{type:xt(r)})).size!==e.length&&(i=new Blob([new Uint8Array(e).buffer],{type:xt(r)}))}catch(e){!function(e){u||(u={}),u[e]||(u[e]=1,d(e))}("Blob constructor present but fails: "+e+"; falling back to blob builder")}i||((i=new Ft).append(new Uint8Array(e).buffer),i=i.getBlob());var o=zt.createObjectURL(i),s=new Image;s.onload=function(){w(s.complete,"Image "+r+" could not be decoded");var n=document.createElement("canvas");n.width=s.width,n.height=s.height,n.getContext("2d").drawImage(s,0,0),t.preloadedImages[r]=n,zt.revokeObjectURL(o),a&&a(e)},s.onerror=function(){console.log("Image "+o+" could not be decoded"),n&&n()},s.src=o}}),t.preloadPlugins.push({canHandle:function(e){return!t.ae&&e.substr(-4)in{".ogg":1,".wav":1,".mp3":1}},handle:function(e,r,a,n){function i(n){s||(s=!0,t.preloadedAudios[r]=n,a&&a(e))}function o(){s||(s=!0,t.preloadedAudios[r]=new Audio,n&&n())}var s=!1;if(!Lt)return o();try{var _=new Blob([e],{type:xt(r)})}catch(e){return o()}_=zt.createObjectURL(_);var c=new Audio;c.addEventListener("canplaythrough",(function(){i(c)}),!1),c.onerror=function(){if(!s){console.log("warning: browser could not fully decode audio "+r+", trying slower base64 approach");for(var t="",a=0,n=0,o=0;o<e.length;o++)for(a=a<<8|e[o],n+=8;6<=n;){var _=a>>n-6&63;n-=6,t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[_]}2==n?(t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(3&a)<<4],t+="=="):4==n&&(t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(15&a)<<2],t+="="),c.src="data:audio/x-"+r.substr(-3)+";base64,"+t,i(c)}},c.src=_,Rt((function(){i(c)}),1e4)}});var r=t.canvas;r&&(r.requestPointerLock=r.requestPointerLock||r.mozRequestPointerLock||r.webkitRequestPointerLock||r.msRequestPointerLock||function(){},r.exitPointerLock=document.exitPointerLock||document.mozExitPointerLock||document.webkitExitPointerLock||document.msExitPointerLock||function(){},r.exitPointerLock=r.exitPointerLock.bind(document),document.addEventListener("pointerlockchange",e,!1),document.addEventListener("mozpointerlockchange",e,!1),document.addEventListener("webkitpointerlockchange",e,!1),document.addEventListener("mspointerlockchange",e,!1),t.elementPointerLock&&r.addEventListener("click",(function(e){!mt&&t.canvas.requestPointerLock&&(t.canvas.requestPointerLock(),e.preventDefault())}),!1))}}()),_):null}var wt=!1,yt=void 0,vt=void 0;function Et(){return!!ht&&((document.exitFullscreen||document.cancelFullScreen||document.mozCancelFullScreen||document.msExitFullscreen||document.webkitCancelFullScreen||function(){}).apply(document,[]),!0)}var At=0;function Tt(e){if("function"==typeof requestAnimationFrame)requestAnimationFrame(e);else{var t=Date.now();if(0===At)At=t+1e3/60;else for(;t+2>=At;)At+=1e3/60;setTimeout(e,Math.max(At-t,0))}}function Rt(e,t){setTimeout((function(){rt(e)}),t)}function xt(e){return{jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",bmp:"image/bmp",ogg:"audio/ogg",wav:"audio/wav",mp3:"audio/mpeg"}[e.substr(e.lastIndexOf(".")+1)]}var kt,Lt,Ft,zt,Mt=[];function It(){var e=t.canvas;Mt.forEach((function(t){t(e.width,e.height)}))}function Pt(e,r,a){r&&a?(e.Sd=r,e.xd=a):(r=e.Sd,a=e.xd);var n=r,i=a;if(t.forcedAspectRatio&&0<t.forcedAspectRatio&&(n/i<t.forcedAspectRatio?n=Math.round(i*t.forcedAspectRatio):i=Math.round(n/t.forcedAspectRatio)),(document.fullscreenElement||document.mozFullScreenElement||document.msFullscreenElement||document.webkitFullscreenElement||document.webkitCurrentFullScreenElement)===e.parentNode&&"undefined"!=typeof screen){var o=Math.min(screen.width/n,screen.height/i);n=Math.round(n*o),i=Math.round(i*o)}vt?(e.width!=n&&(e.width=n),e.height!=i&&(e.height=i),void 0!==e.style&&(e.style.removeProperty("width"),e.style.removeProperty("height"))):(e.width!=r&&(e.width=r),e.height!=a&&(e.height=a),void 0!==e.style&&(n!=r||i!=a?(e.style.setProperty("width",n+"px","important"),e.style.setProperty("height",i+"px","important")):(e.style.removeProperty("width"),e.style.removeProperty("height"))))}function Ot(){return!1}t._emscripten_is_main_browser_thread=Ot;var St,Bt=[];function Dt(e,t){k[e>>2]=t,k[e+4>>2]=t/4294967296|0}function Ct(e,t,r,a,n){function i(t){var r=0,a=0;t&&(a=y.response?y.response.byteLength:0,r=_r(a),A.set(new Uint8Array(y.response),r)),k[e+12>>2]=r,Dt(e+16,a)}var o=k[e+8>>2];if(o){var s=I(o),_=e+112,c=I(_);c||(c="GET");var f=k[_+52>>2],u=k[_+56>>2],l=!!k[_+60>>2],p=k[_+68>>2],d=k[_+72>>2];o=k[_+76>>2];var h=k[_+80>>2],m=k[_+84>>2];_=k[_+88>>2];var b=!!(1&f),g=!!(2&f);f=!!(64&f),p=p?I(p):void 0,d=d?I(d):void 0;var w=h?I(h):void 0,y=new XMLHttpRequest;if(y.withCredentials=l,y.open(c,s,!f,p,d),f||(y.timeout=u),y.ce=s,y.responseType="arraybuffer",h&&y.overrideMimeType(w),o)for(;(c=k[o>>2])&&(s=k[o+4>>2]);)o+=8,c=I(c),s=I(s),y.setRequestHeader(c,s);Bt.push(y),k[e+0>>2]=Bt.length,o=m&&_?A.slice(m,m+_):null,y.onload=function(a){i(b&&!g);var n=y.response?y.response.byteLength:0;Dt(e+24,0),n&&Dt(e+32,n),R[e+40>>1]=y.readyState,R[e+42>>1]=y.status,y.statusText&&P(y.statusText,A,e+44,64),200<=y.status&&300>y.status?t&&t(e,y,a):r&&r(e,y,a)},y.onerror=function(t){i(b);var a=y.status;Dt(e+24,0),Dt(e+32,y.response?y.response.byteLength:0),R[e+40>>1]=y.readyState,R[e+42>>1]=a,r&&r(e,y,t)},y.ontimeout=function(t){r&&r(e,y,t)},y.onprogress=function(t){var r=b&&g&&y.response?y.response.byteLength:0,n=0;b&&g&&(n=_r(r),A.set(new Uint8Array(y.response),n)),k[e+12>>2]=n,Dt(e+16,r),Dt(e+24,t.loaded-r),Dt(e+32,t.total),R[e+40>>1]=y.readyState,3<=y.readyState&&0===y.status&&0<t.loaded&&(y.status=200),R[e+42>>1]=y.status,y.statusText&&P(y.statusText,A,e+44,64),a&&a(e,y,t),n&&sr(n)},y.onreadystatechange=function(t){R[e+40>>1]=y.readyState,2<=y.readyState&&(R[e+42>>1]=y.status),n&&n(e,y,t)};try{y.send(o)}catch(t){r&&r(e,y,t)}}else r(e,0,"no url specified!")}function Ut(e,t,r,a){var n=St;if(n){var i=k[e+112+64>>2];i||(i=k[e+8>>2]);var o=I(i);try{var s=n.transaction(["FILES"],"readwrite").objectStore("FILES").put(t,o);s.onsuccess=function(){R[e+40>>1]=4,R[e+42>>1]=200,P("OK",A,e+44,64),r(e,0,o)},s.onerror=function(t){R[e+40>>1]=4,R[e+42>>1]=413,P("Payload Too Large",A,e+44,64),a(e,0,t)}}catch(t){a(e,0,t)}}else a(e,0,"IndexedDB not available!")}var Vt,Nt={};function Gt(){if(!Vt){var e,t={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:s||"./this.program"};for(e in Nt)t[e]=Nt[e];var r=[];for(e in t)r.push(e+"="+t[e]);Vt=r}return Vt}var Wt=1,Ht=[],qt=[];function Yt(e){for(var t=Wt++,r=e.length;r<t;r++)e[r]=null;return t}var Xt,Zt,jt,Kt={};function Jt(e){return 0==e%4&&(0!=e%100||0==e%400)}function $t(e,t){for(var r=0,a=0;a<=t;r+=e[a++]);return r}var Qt,er=[31,29,31,30,31,30,31,31,30,31,30,31],tr=[31,28,31,30,31,30,31,31,30,31,30,31];function rr(e,t){for(e=new Date(e.getTime());0<t;){var r=e.getMonth(),a=(Jt(e.getFullYear())?er:tr)[r];if(!(t>a-e.getDate())){e.setDate(e.getDate()+t);break}t-=a-e.getDate()+1,e.setDate(1),11>r?e.setMonth(r+1):(e.setMonth(0),e.setFullYear(e.getFullYear()+1))}return e}function ar(e,t,r,a){e||(e=this),this.parent=e,this.Bc=e.Bc,this.Kc=null,this.id=ge++,this.name=t,this.mode=r,this.qc={},this.sc={},this.Lc=a}function nr(e,t){var r=Array(O(e)+1);return e=P(e,r,0,r.length),t&&(r.length=e),r}Object.defineProperties(ar.prototype,{read:{get:function(){return 365==(365&this.mode)},set:function(e){e?this.mode|=365:this.mode&=-366}},write:{get:function(){return 146==(146&this.mode)},set:function(e){e?this.mode|=146:this.mode&=-147}}}),Ye(),we=Array(4096),Be(de,"/"),Ce("/tmp"),Ce("/home"),Ce("/home/web_user"),function(){Ce("/dev"),Se(259,{read:function(){return 0},write:function(e,t,r,a){return a}}),Ue("/dev/null",259),fe(1280,le),fe(1536,pe),Ue("/dev/tty",1280),Ue("/dev/tty1",1536);var e=function(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var e=new Uint8Array(1);return function(){return crypto.getRandomValues(e),e[0]}}return function(){j("randomDevice")}}();Xe("random",e),Xe("urandom",e),Ce("/dev/shm"),Ce("/dev/shm/tmp")}(),function(){Ce("/proc");var e=Ce("/proc/self");Ce("/proc/self/fd"),Be({Bc:function(){var t=Le(e,"fd",16895,73);return t.qc={Jc:function(e,t){var r=be[+t];if(!r)throw new Ee(8);return(e={parent:null,Bc:{kd:"fake"},qc:{Mc:function(){return r.path}}}).parent=e}},t}},"/proc/self/fd")}(),t.requestFullscreen=function(e,r){!function(e,r){function a(){ht=!1;var e=n.parentNode;(document.fullscreenElement||document.mozFullScreenElement||document.msFullscreenElement||document.webkitFullscreenElement||document.webkitCurrentFullScreenElement)===e?(n.exitFullscreen=Et,yt&&n.requestPointerLock(),ht=!0,vt?("undefined"!=typeof SDL&&(x[SDL.screen>>2]=8388608|k[SDL.screen>>2]),Pt(t.canvas),It()):Pt(n)):(e.parentNode.insertBefore(n,e),e.parentNode.removeChild(e),vt?("undefined"!=typeof SDL&&(x[SDL.screen>>2]=-8388609&k[SDL.screen>>2]),Pt(t.canvas),It()):Pt(n)),t.onFullScreen&&t.onFullScreen(ht),t.onFullscreen&&t.onFullscreen(ht)}void 0===(yt=e)&&(yt=!0),void 0===(vt=r)&&(vt=!1);var n=t.canvas;wt||(wt=!0,document.addEventListener("fullscreenchange",a,!1),document.addEventListener("mozfullscreenchange",a,!1),document.addEventListener("webkitfullscreenchange",a,!1),document.addEventListener("MSFullscreenChange",a,!1));var i=document.createElement("div");n.parentNode.insertBefore(i,n),i.appendChild(n),i.requestFullscreen=i.requestFullscreen||i.mozRequestFullScreen||i.msRequestFullscreen||(i.webkitRequestFullscreen?function(){i.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT)}:null)||(i.webkitRequestFullScreen?function(){i.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT)}:null),i.requestFullscreen()}(e,r)},t.requestAnimationFrame=function(e){Tt(e)},t.setCanvasSize=function(e,r,a){Pt(t.canvas,e,r),a||It()},t.pauseMainLoop=function(){st=null,_t++},t.resumeMainLoop=function(){_t++;var e=ft,r=ut,a=ct;ct=null,function(e){function r(){if(a<_t){if(!h)try{wr(b)}catch(e){if(!(e instanceof br))throw e}return!1}return!0}w(!ct,"emscripten_set_main_loop: there can only be one main loop function at once: call emscripten_cancel_main_loop to cancel the previous one before setting a new one with different parameters."),ct=e;var a=_t;ot=!1,nt=function(){if(!g)if(0<pt.length){var a=Date.now(),n=pt.shift();if(n.vd(n.Oc),it){var i=it,o=0==i%1?i-1:Math.floor(i);it=n.Vd?o:(8*i+(o+.5))/9}console.log('main loop blocker "'+n.name+'" took '+(Date.now()-a)+" ms"),t.setStatus&&(a=t.statusMessage||"Please wait...",i=dt.Xd,(n=it)?n<i?t.setStatus(a+" ("+(i-n)+"/"+i+")"):t.setStatus(a):t.setStatus("")),r()&&setTimeout(nt,0)}else r()&&(lt=lt+1|0,1==ft&&1<ut&&0!=lt%ut?st():(0==ft&&(at=$()),g||t.preMainLoop&&!1===t.preMainLoop()||(rt(e),t.postMainLoop&&t.postMainLoop()),r()&&("object"==typeof SDL&&SDL.audio&&SDL.audio.Fd&&SDL.audio.Fd(),st())))}}(a),function(e,r){if(ft=e,ut=r,ct)if(ot||(ot=!0),0==e)st=function(){var e=0|Math.max(0,at+r-$());setTimeout(nt,e)};else if(1==e)st=function(){Tt(nt)};else if(2==e){if("undefined"==typeof setImmediate){var a=[];addEventListener("message",(function(e){"setimmediate"!==e.data&&"setimmediate"!==e.data.target||(e.stopPropagation(),a.shift()())}),!0),setImmediate=function(e){a.push(e),void 0===t.setImmediates&&(t.setImmediates=[]),t.setImmediates.push(e),postMessage({target:"setimmediate"})}}st=function(){setImmediate(nt)}}}(e,r),st()},t.getUserMedia=function(){window.getUserMedia||(window.getUserMedia=navigator.getUserMedia||navigator.mozGetUserMedia),window.getUserMedia(void 0)},t.createContext=function(e,t,r,a){return gt(e,t,r,a)},function(e,t){try{var r=indexedDB.open("emscripten_filesystem",1)}catch(e){return void t()}r.onupgradeneeded=function(e){(e=e.target.result).objectStoreNames.contains("FILES")&&e.deleteObjectStore("FILES"),e.createObjectStore("FILES")},r.onsuccess=function(e){!function(e){St=e,Z()}(e.target.result)},r.onerror=function(e){t()}}(0,(function(){St=!1,Z()})),"undefined"!=typeof ENVIRONMENT_IS_FETCH_WORKER&&ENVIRONMENT_IS_FETCH_WORKER||X();var ir={I:function(e,t){return re(e,t)},a:function(e){return _r(e+16)+16},b:function(e,t,r){throw new ae(e).yd(t,r),e},e:function(e,t,r){Qe=r;try{var a=tt(e);switch(t){case 0:var n=et();return 0>n?-28:He(a.path,a.flags,0,n).Cc;case 1:case 2:case 13:case 14:return 0;case 3:return a.flags;case 4:return n=et(),a.flags|=n,0;case 12:return n=et(),T[n+0>>1]=2,0;case 16:case 8:default:return-28;case 9:return x[fr()>>2]=28,-1}}catch(e){return void 0!==Je&&e instanceof Ee||j(e),-e.vc}},E:function(e,t,r){try{var a=tt(e);if(!a.Dc){var n=Te(a.path,{Pc:!0}).node;if(!n.qc.Rc)throw new Ee(54);var i=n.qc.Rc(n);a.Dc=i}e=0;for(var o=qe(a,0,1),s=Math.floor(o/280);s<a.Dc.length&&e+280<=r;){var _=a.Dc[s];if("."===_[0])var c=1,f=4;else{var u=ke(a.node,_);c=u.id,f=8192==(61440&u.mode)?2:16384==(61440&u.mode)?4:40960==(61440&u.mode)?10:8}J=[c>>>0,(K=c,1<=+Math.abs(K)?0<K?(0|Math.min(+Math.floor(K/4294967296),4294967295))>>>0:~~+Math.ceil((K-+(~~K>>>0))/4294967296)>>>0:0)],x[t+e>>2]=J[0],x[t+e+4>>2]=J[1],J=[280*(s+1)>>>0,(K=280*(s+1),1<=+Math.abs(K)?0<K?(0|Math.min(+Math.floor(K/4294967296),4294967295))>>>0:~~+Math.ceil((K-+(~~K>>>0))/4294967296)>>>0:0)],x[t+e+8>>2]=J[0],x[t+e+12>>2]=J[1],T[t+e+16>>1]=280,E[t+e+18>>0]=f,P(_,A,t+e+19,256),e+=280,s+=1}return qe(a,280*s,0),e}catch(e){return void 0!==Je&&e instanceof Ee||j(e),-e.vc}},n:function(){return 42},G:function(e,t,r){Qe=r;try{var a=tt(e);switch(t){case 21509:case 21505:case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:case 21523:case 21524:return a.uc?0:-59;case 21519:if(!a.uc)return-59;var n=et();return x[n>>2]=0;case 21520:return a.uc?-28:-59;case 21531:if(e=n=et(),!a.sc.Ad)throw new Ee(59);return a.sc.Ad(a,t,e);default:j("bad ioctl syscall "+t)}}catch(e){return void 0!==Je&&e instanceof Ee||j(e),-e.vc}},H:function(e,t){try{return $e(We,e=I(e),t)}catch(e){return void 0!==Je&&e instanceof Ee||j(e),-e.vc}},p:function(e,t,r){Qe=r;try{return He(I(e),t,r?et():0).Cc}catch(e){return void 0!==Je&&e instanceof Ee||j(e),-e.vc}},J:function(e,t){try{return $e(Ge,e=I(e),t)}catch(e){return void 0!==Je&&e instanceof Ee||j(e),-e.vc}},C:function(e,t){try{return Ve(e=I(e),t=I(t)),0}catch(e){return void 0!==Je&&e instanceof Ee||j(e),-e.vc}},K:function(e){try{if(!e)return-21;var t={__size__:390,domainname:325,machine:260,nodename:65,release:130,sysname:0,version:195};return B("Emscripten",e+t.sysname),B("emscripten",e+t.nodename),B("1.0",e+t.release),B("#1",e+t.version),B("wasm32",e+t.machine),0}catch(e){return void 0!==Je&&e instanceof Ee||j(e),-e.vc}},D:function(e){try{var t=Te(e=I(e),{parent:!0}).node,r=se(e),a=ke(t,r);e:{try{var n=ke(t,r)}catch(e){var i=e.vc;break e}i=Me(t,"wx")||(16384==(61440&n.mode)?31:0)}if(i)throw new Ee(i);if(!t.qc.Wc)throw new Ee(63);if(a.Kc)throw new Ee(10);try{ve.willDeletePath&&ve.willDeletePath(e)}catch(t){d("FS.trackingDelegate['willDeletePath']('"+e+"') threw an exception: "+t.message)}t.qc.Wc(t,r);var o=xe(a.parent.id,a.name);if(we[o]===a)we[o]=a.Fc;else for(var s=we[o];s;){if(s.Fc===a){s.Fc=a.Fc;break}s=s.Fc}try{ve.onDeletePath&&ve.onDeletePath(e)}catch(t){d("FS.trackingDelegate['onDeletePath']('"+e+"') threw an exception: "+t.message)}return 0}catch(e){return void 0!==Je&&e instanceof Ee||j(e),-e.vc}},L:function(e){delete Bt[e-1]},c:function(){j()},h:re,P:function(e,t){return e-t},R:function(){self.postMessage({t:"gfx"})},t:function(){var e=new URL(location.origin).hostname;if(0===e.length&&(e=new URL(location.href.replace("blob:","")).hostname),/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?).(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?).(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?).(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test(e))0===e.indexOf("10.")&&(e="10.*"),0===e.indexOf("192.168.")&&(e="192.168.*"),0===e.indexOf("172.")&&(e="172.*"),0===e.indexOf("127.")&&(e="127.*");else{var t=new RegExp("("+String.fromCharCode(92)+".ngrok"+String.fromCharCode(92)+".io)$","i");t.test(e)&&(e="*.ngrok.io"),(t=new RegExp("("+String.fromCharCode(92)+".ngrok-free"+String.fromCharCode(92)+".app)$","i")).test(e)&&(e="*.ngrok.io"),(t=new RegExp("("+String.fromCharCode(92)+".arweb"+String.fromCharCode(92)+".app)$","i")).test(e)&&(e="*.arweb.app")}t=O(e)+1;var r=_r(t);return P(e,A,r,t+1),r},s:function(){self.postMessage({t:"licerr"})},l:function(e,t,r){function a(){C.get(e)(t)}0<=r?Rt(a,r):function(e){Tt((function(){rt(e)}))}(a)},x:function(){return 2147483648},N:Ot,v:function(e,t,r){A.copyWithin(e,t,t+r)},w:function(e){var t=A.length;if(2147483648<e)return!1;for(var r=1;4>=r;r*=2){var a=t*(1+.2/r);a=Math.min(a,e+100663296),0<(a=Math.max(e,a))%65536&&(a+=65536-a%65536);e:{try{m.grow(Math.min(2147483648,a)-v.byteLength+65535>>>16),D();var n=1;break e}catch(e){}n=void 0}if(n)return!0}return!1},M:function(e,t,r,a,n){function i(e,r){Ut(e,r.response,(function(e){rt((function(){l?C.get(l)(e):t&&t(e)}))}),(function(e){rt((function(){l?C.get(l)(e):t&&t(e)}))}))}function o(e){rt((function(){h?C.get(h)(e):n&&n(e)}))}function s(e){rt((function(){p?C.get(p)(e):r&&r(e)}))}function _(e){rt((function(){d?C.get(d)(e):a&&a(e)}))}function c(e){rt((function(){l?C.get(l)(e):t&&t(e)}))}var f=e+112,u=I(f),l=k[f+36>>2],p=k[f+40>>2],d=k[f+44>>2],h=k[f+48>>2],m=k[f+52>>2],b=!!(4&m),g=!!(32&m);if(m=!!(16&m),"EM_IDB_STORE"===u)u=k[f+84>>2],Ut(e,A.slice(u,u+k[f+88>>2]),c,s);else if("EM_IDB_DELETE"===u)!function(e,t,r){var a=St;if(a){var n=k[e+112+64>>2];n||(n=k[e+8>>2]),n=I(n);try{var i=a.transaction(["FILES"],"readwrite").objectStore("FILES").delete(n);i.onsuccess=function(r){r=r.target.result,k[e+12>>2]=0,Dt(e+16,0),Dt(e+24,0),Dt(e+32,0),R[e+40>>1]=4,R[e+42>>1]=200,P("OK",A,e+44,64),t(e,0,r)},i.onerror=function(t){R[e+40>>1]=4,R[e+42>>1]=404,P("Not Found",A,e+44,64),r(e,0,t)}}catch(t){r(e,0,t)}}else r(e,0,"IndexedDB not available!")}(e,c,s);else if(m){if(g)return 0;Ct(e,b?i:c,s,_,o)}else!function(e,t,r){var a=St;if(a){var n=k[e+112+64>>2];n||(n=k[e+8>>2]),n=I(n);try{var i=a.transaction(["FILES"],"readonly").objectStore("FILES").get(n);i.onsuccess=function(a){if(a.target.result){var n=(a=a.target.result).byteLength||a.length,i=_r(n);A.set(new Uint8Array(a),i),k[e+12>>2]=i,Dt(e+16,n),Dt(e+24,0),Dt(e+32,n),R[e+40>>1]=4,R[e+42>>1]=200,P("OK",A,e+44,64),t(e,0,a)}else R[e+40>>1]=4,R[e+42>>1]=404,P("Not Found",A,e+44,64),r(e,0,"no data")},i.onerror=function(t){R[e+40>>1]=4,R[e+42>>1]=404,P("Not Found",A,e+44,64),r(e,0,t)}}catch(t){r(e,0,t)}}else r(e,0,"IndexedDB not available!")}(e,c,g?s:b?function(e){Ct(e,i,s,_,o)}:function(e){Ct(e,c,s,_,o)});return e},A:function(e,t){try{var r=0;return Gt().forEach((function(a,n){var i=t+r;x[e+4*n>>2]=i,B(a,i),r+=a.length+1})),0}catch(e){return void 0!==Je&&e instanceof Ee||j(e),e.vc}},B:function(e,t){try{var r=Gt();x[e>>2]=r.length;var a=0;return r.forEach((function(e){a+=e.length+1})),x[t>>2]=a,0}catch(e){return void 0!==Je&&e instanceof Ee||j(e),e.vc}},O:function(e){wr(e)},g:function(e){try{var t=tt(e);if(null===t.Cc)throw new Ee(8);t.Dc&&(t.Dc=null);try{t.sc.close&&t.sc.close(t)}catch(e){throw e}finally{be[t.Cc]=null}return t.Cc=null,0}catch(e){return void 0!==Je&&e instanceof Ee||j(e),e.vc}},F:function(e,t,r,a){try{e:{for(var n=tt(e),i=e=0;i<r;i++){var o=x[t+(8*i+4)>>2],s=n,_=x[t+8*i>>2],c=o,f=void 0,u=E;if(0>c||0>f)throw new Ee(28);if(null===s.Cc)throw new Ee(8);if(1==(2097155&s.flags))throw new Ee(8);if(16384==(61440&s.node.mode))throw new Ee(31);if(!s.sc.read)throw new Ee(28);var l=void 0!==f;if(l){if(!s.seekable)throw new Ee(70)}else f=s.position;var p=s.sc.read(s,u,_,c,f);l||(s.position+=p);var d=p;if(0>d){var h=-1;break e}if(e+=d,d<o)break}h=e}return x[a>>2]=h,0}catch(e){return void 0!==Je&&e instanceof Ee||j(e),e.vc}},u:function(e,t,r,a,n){try{var i=tt(e);return-9007199254740992>=(e=4294967296*r+(t>>>0))||9007199254740992<=e?-61:(qe(i,e,a),J=[i.position>>>0,(K=i.position,1<=+Math.abs(K)?0<K?(0|Math.min(+Math.floor(K/4294967296),4294967295))>>>0:~~+Math.ceil((K-+(~~K>>>0))/4294967296)>>>0:0)],x[n>>2]=J[0],x[n+4>>2]=J[1],i.Dc&&0===e&&0===a&&(i.Dc=null),0)}catch(e){return void 0!==Je&&e instanceof Ee||j(e),e.vc}},k:function(e,t,r,a){try{e:{for(var n=tt(e),i=e=0;i<r;i++){var o=n,s=x[t+8*i>>2],_=x[t+(8*i+4)>>2],c=void 0,f=E;if(0>_||0>c)throw new Ee(28);if(null===o.Cc)throw new Ee(8);if(0==(2097155&o.flags))throw new Ee(8);if(16384==(61440&o.node.mode))throw new Ee(31);if(!o.sc.write)throw new Ee(28);o.seekable&&1024&o.flags&&qe(o,0,2);var u=void 0!==c;if(u){if(!o.seekable)throw new Ee(70)}else c=o.position;var l=o.sc.write(o,f,s,_,c,void 0);u||(o.position+=l);try{o.path&&ve.onWriteToFile&&ve.onWriteToFile(o.path)}catch(e){d("FS.trackingDelegate['onWriteToFile']('"+o.path+"') threw an exception: "+e.message)}var p=l;if(0>p){var h=-1;break e}e+=p}h=e}return x[a>>2]=h,0}catch(e){return void 0!==Je&&e instanceof Ee||j(e),e.vc}},f:function(e){var t=Date.now();return x[e>>2]=t/1e3|0,x[e+4>>2]=t%1e3*1e3|0,0},m:function(e,t){Qt.bindTexture(e,Ht[t])},o:function(e,t){for(var r=0;r<e;r++){var a=Qt.createTexture(),n=a&&Yt(Ht);a?(a.name=n,Ht[n]=a):Xt||(Xt=1282),x[t+4*r>>2]=n}},i:function(e,t,r,a,n,i,o,s,_){var c=Qt,f=c.texImage2D;if(_){var u=s-5120;u=1==u?A:4==u?x:6==u?L:5==u||28922==u?k:R;var l=31-Math.clz32(u.BYTES_PER_ELEMENT);_=u.subarray(_>>l,_+n*(a*({5:3,6:4,8:2,29502:3,29504:4}[o-6402]||1)*(1<<l)+4-1&-4)>>l)}else _=null;f.call(c,e,t,r,a,n,i,o,s,_)},j:function(e,t,r){Qt.texParameteri(e,t,r)},r:function e(t,r){return t=new Date(1e3*x[t>>2]),x[r>>2]=t.getUTCSeconds(),x[r+4>>2]=t.getUTCMinutes(),x[r+8>>2]=t.getUTCHours(),x[r+12>>2]=t.getUTCDate(),x[r+16>>2]=t.getUTCMonth(),x[r+20>>2]=t.getUTCFullYear()-1900,x[r+24>>2]=t.getUTCDay(),x[r+36>>2]=0,x[r+32>>2]=0,x[r+28>>2]=(t.getTime()-Date.UTC(t.getUTCFullYear(),0,1,0,0,0,0))/864e5|0,e.bd||(e.bd=S("GMT")),x[r+40>>2]=e.bd,r},q:function(e,t){!function(){function e(e){return(e=e.toTimeString().match(/\(([A-Za-z ]+)\)$/))?e[1]:"GMT"}if(!jt){jt=!0;var t=(new Date).getFullYear(),r=new Date(t,0,1),a=new Date(t,6,1);t=r.getTimezoneOffset();var n=a.getTimezoneOffset(),i=Math.max(t,n);x[pr()>>2]=60*i,x[lr()>>2]=Number(t!=n),r=e(r),a=e(a),r=S(r),a=S(a),n<t?(x[ur()>>2]=r,x[ur()+4>>2]=a):(x[ur()>>2]=a,x[ur()+4>>2]=r)}}(),e=new Date(1e3*x[e>>2]),x[t>>2]=e.getSeconds(),x[t+4>>2]=e.getMinutes(),x[t+8>>2]=e.getHours(),x[t+12>>2]=e.getDate(),x[t+16>>2]=e.getMonth(),x[t+20>>2]=e.getFullYear()-1900,x[t+24>>2]=e.getDay();var r=new Date(e.getFullYear(),0,1);x[t+28>>2]=(e.getTime()-r.getTime())/864e5|0,x[t+36>>2]=-60*e.getTimezoneOffset();var a=new Date(e.getFullYear(),6,1).getTimezoneOffset();return e=0|(a!=(r=r.getTimezoneOffset())&&e.getTimezoneOffset()==Math.min(r,a)),x[t+32>>2]=e,e=x[ur()+(e?4:0)>>2],x[t+40>>2]=e,t},Q:function(){return 6},y:function(){return 28},z:function(e,t,r,a){return function(e,t,r,a){function n(e,t,r){for(e="number"==typeof e?e.toString():e||"";e.length<t;)e=r[0]+e;return e}function i(e,t){return n(e,t,"0")}function o(e,t){function r(e){return 0>e?-1:0<e?1:0}var a;return 0===(a=r(e.getFullYear()-t.getFullYear()))&&0===(a=r(e.getMonth()-t.getMonth()))&&(a=r(e.getDate()-t.getDate())),a}function s(e){switch(e.getDay()){case 0:return new Date(e.getFullYear()-1,11,29);case 1:return e;case 2:return new Date(e.getFullYear(),0,3);case 3:return new Date(e.getFullYear(),0,2);case 4:return new Date(e.getFullYear(),0,1);case 5:return new Date(e.getFullYear()-1,11,31);case 6:return new Date(e.getFullYear()-1,11,30)}}function _(e){e=rr(new Date(e.xc+1900,0,1),e.Vc);var t=new Date(e.getFullYear()+1,0,4),r=s(new Date(e.getFullYear(),0,4));return t=s(t),0>=o(r,e)?0>=o(t,e)?e.getFullYear()+1:e.getFullYear():e.getFullYear()-1}var c=x[a+40>>2];for(var f in a={Pd:x[a>>2],Od:x[a+4>>2],Tc:x[a+8>>2],Nc:x[a+12>>2],Ic:x[a+16>>2],xc:x[a+20>>2],Uc:x[a+24>>2],Vc:x[a+28>>2],de:x[a+32>>2],Nd:x[a+36>>2],Qd:c?I(c):""},r=I(r),c={"%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"})r=r.replace(new RegExp(f,"g"),c[f]);var u="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),l="January February March April May June July August September October November December".split(" ");for(f in c={"%a":function(e){return u[e.Uc].substring(0,3)},"%A":function(e){return u[e.Uc]},"%b":function(e){return l[e.Ic].substring(0,3)},"%B":function(e){return l[e.Ic]},"%C":function(e){return i((e.xc+1900)/100|0,2)},"%d":function(e){return i(e.Nc,2)},"%e":function(e){return n(e.Nc,2," ")},"%g":function(e){return _(e).toString().substring(2)},"%G":function(e){return _(e)},"%H":function(e){return i(e.Tc,2)},"%I":function(e){return 0==(e=e.Tc)?e=12:12<e&&(e-=12),i(e,2)},"%j":function(e){return i(e.Nc+$t(Jt(e.xc+1900)?er:tr,e.Ic-1),3)},"%m":function(e){return i(e.Ic+1,2)},"%M":function(e){return i(e.Od,2)},"%n":function(){return"\n"},"%p":function(e){return 0<=e.Tc&&12>e.Tc?"AM":"PM"},"%S":function(e){return i(e.Pd,2)},"%t":function(){return"\t"},"%u":function(e){return e.Uc||7},"%U":function(e){var t=new Date(e.xc+1900,0,1),r=0===t.getDay()?t:rr(t,7-t.getDay());return 0>o(r,e=new Date(e.xc+1900,e.Ic,e.Nc))?i(Math.ceil((31-r.getDate()+($t(Jt(e.getFullYear())?er:tr,e.getMonth()-1)-31)+e.getDate())/7),2):0===o(r,t)?"01":"00"},"%V":function(e){var t=new Date(e.xc+1901,0,4),r=s(new Date(e.xc+1900,0,4));t=s(t);var a=rr(new Date(e.xc+1900,0,1),e.Vc);return 0>o(a,r)?"53":0>=o(t,a)?"01":i(Math.ceil((r.getFullYear()<e.xc+1900?e.Vc+32-r.getDate():e.Vc+1-r.getDate())/7),2)},"%w":function(e){return e.Uc},"%W":function(e){var t=new Date(e.xc,0,1),r=1===t.getDay()?t:rr(t,0===t.getDay()?1:7-t.getDay()+1);return 0>o(r,e=new Date(e.xc+1900,e.Ic,e.Nc))?i(Math.ceil((31-r.getDate()+($t(Jt(e.getFullYear())?er:tr,e.getMonth()-1)-31)+e.getDate())/7),2):0===o(r,t)?"01":"00"},"%y":function(e){return(e.xc+1900).toString().substring(2)},"%Y":function(e){return e.xc+1900},"%z":function(e){var t=0<=(e=e.Nd);return e=Math.abs(e)/60,(t?"+":"-")+String("0000"+(e/60*100+e%60)).slice(-4)},"%Z":function(e){return e.Qd},"%%":function(){return"%"}})0<=r.indexOf(f)&&(r=r.replace(new RegExp(f,"g"),c[f](a)));return(f=nr(r,!1)).length>t?0:(E.set(f,e),f.length-1)}(e,t,r,a)},d:function(e){var t=Date.now()/1e3|0;return e&&(x[e>>2]=t),t}},or=function(){function e(e){t.asm=e.exports,m=t.asm.S,D(),C=t.asm.X,V.unshift(t.asm.T),Z()}var r={a:ir};if(X(),t.instantiateWasm)try{return t.instantiateWasm(r,e)}catch(e){return d("Module.instantiateWasm callback failed with error: "+e),!1}return r=function(e){var t=Q;try{e:{try{if(t==Q&&l){var r=new Uint8Array(l);break e}if(c){r=c(t);break e}throw"sync fetching of the wasm failed: you can preload it to Module['wasmBinary'] manually, or emcc.py will do that for you when generating HTML (but not JS)"}catch(e){j(e)}r=void 0}var a=new WebAssembly.Module(r),n=new WebAssembly.Instance(a,e)}catch(t){throw e=t.toString(),d("failed to compile wasm module: "+e),(0<=e.indexOf("imported Memory")||0<=e.indexOf("memory import"))&&d("Memory size incompatibility issues may be due to changing INITIAL_MEMORY at runtime to something too large. Use ALLOW_MEMORY_GROWTH to allow any size memory (and also make sure not to set INITIAL_MEMORY at runtime to something smaller than it was at compile time)."),t}return[n,a]}(r),e(r[0]),t.asm}();t.___wasm_call_ctors=or.T,t._zappar_has_initialized=or.U,t._zappar_invert=or.V,t._zappar_loaded=or.W,t._zappar_pipeline_create=or.Y,t._zappar_pipeline_destroy=or.Z,t._zappar_pipeline_camera_frame_submit=or._,t._zappar_pipeline_camera_frame_submit_raw_pointer=or.$,t._zappar_pipeline_frame_update=or.aa,t._zappar_pipeline_camera_frame_user_data=or.ba,t._zappar_pipeline_camera_model=or.ca,t._zappar_pipeline_frame_number=or.da,t._zappar_pipeline_motion_accelerometer_submit=or.ea,t._zappar_pipeline_motion_rotation_rate_submit=or.fa,t._zappar_pipeline_motion_attitude_submit=or.ga,t._zappar_pipeline_motion_attitude_matrix_submit=or.ha,t._zappar_pipeline_camera_frame_user_facing=or.ia,t._zappar_pipeline_camera_frame_texture_matrix=or.ja,t._zappar_pipeline_camera_pose_with_attitude=or.ka,t._zappar_pipeline_camera_pose_with_origin=or.la,t._zappar_pipeline_camera_frame_camera_attitude=or.ma,t._zappar_pipeline_camera_frame_device_attitude=or.na,t._zappar_pipeline_camera_frame_texture_gl=or.oa,t._zappar_pipeline_camera_frame_upload_gl=or.pa,t._zappar_pipeline_sequence_record_start=or.qa,t._zappar_pipeline_sequence_record_stop=or.ra,t._zappar_pipeline_sequence_record_clear=or.sa,t._zappar_pipeline_sequence_record_device_attitude_matrices_set=or.ta,t._zappar_pipeline_sequence_record_data_size=or.ua,t._zappar_pipeline_sequence_record_data=or.va,t._zappar_pipeline_process_gl=or.wa,t._zappar_pipeline_camera_pose_default=or.xa,t._zappar_instant_world_tracker_create=or.ya,t._zappar_instant_world_tracker_destroy=or.za,t._zappar_instant_world_tracker_anchor_pose_set_from_camera_offset_raw=or.Aa,t._zappar_instant_world_tracker_anchor_pose_raw=or.Ba,t._zappar_instant_world_tracker_enabled_set=or.Ca,t._zappar_instant_world_tracker_enabled=or.Da,t._zappar_image_tracker_create=or.Ea,t._zappar_image_tracker_destroy=or.Fa,t._zappar_image_tracker_target_load_from_memory=or.Ga,t.__Z42zappar_image_tracker_target_load_from_fileP23zappar_image_tracker_tiPKc=or.Ha;var sr=t._free=or.Ia;t._zappar_image_tracker_anchor_count=or.Ja,t._zappar_image_tracker_anchor_id=or.Ka,t._zappar_image_tracker_anchor_pose_raw=or.La,t._zappar_image_tracker_enabled_set=or.Ma,t._zappar_image_tracker_enabled=or.Na,t._zappar_image_tracker_target_loaded_version=or.Oa,t.__Z33zappar_image_tracker_target_countP23zappar_image_tracker_ti=or.Pa,t.__Z46zappar_image_tracker_target_preview_compressedP23zappar_image_tracker_tii=or.Qa,t.__Z51zappar_image_tracker_target_preview_compressed_sizeP23zappar_image_tracker_tii=or.Ra,t.__Z55zappar_image_tracker_target_preview_compressed_mimetypeP23zappar_image_tracker_tii=or.Sa,t.__Z40zappar_image_tracker_target_preview_rgbaP23zappar_image_tracker_tii=or.Ta,t.__Z45zappar_image_tracker_target_preview_rgba_sizeP23zappar_image_tracker_tii=or.Ua,t.__Z46zappar_image_tracker_target_preview_rgba_widthP23zappar_image_tracker_tii=or.Va,t.__Z47zappar_image_tracker_target_preview_rgba_heightP23zappar_image_tracker_tii=or.Wa,t.__Z38zappar_image_tracker_target_radius_topP23zappar_image_tracker_tii=or.Xa,t.__Z41zappar_image_tracker_target_radius_bottomP23zappar_image_tracker_tii=or.Ya,t.__Z39zappar_image_tracker_target_side_lengthP23zappar_image_tracker_tii=or.Za,t.__Z49zappar_image_tracker_target_physical_scale_factorP23zappar_image_tracker_tii=or._a,t.__Z49zappar_image_tracker_target_preview_mesh_verticesP23zappar_image_tracker_tii=or.$a,t.__Z48zappar_image_tracker_target_preview_mesh_normalsP23zappar_image_tracker_tii=or.ab,t.__Z44zappar_image_tracker_target_preview_mesh_uvsP23zappar_image_tracker_tii=or.bb,t.__Z48zappar_image_tracker_target_preview_mesh_indicesP23zappar_image_tracker_tii=or.cb,t.__Z54zappar_image_tracker_target_preview_mesh_vertices_sizeP23zappar_image_tracker_tii=or.db,t.__Z53zappar_image_tracker_target_preview_mesh_normals_sizeP23zappar_image_tracker_tii=or.eb,t.__Z49zappar_image_tracker_target_preview_mesh_uvs_sizeP23zappar_image_tracker_tii=or.fb,t.__Z53zappar_image_tracker_target_preview_mesh_indices_sizeP23zappar_image_tracker_tii=or.gb,t.__Z32zappar_image_tracker_target_typeP23zappar_image_tracker_tii=or.hb,t._zappar_face_tracker_create=or.ib,t._zappar_face_tracker_destroy=or.jb,t._zappar_face_tracker_model_load_from_memory=or.kb,t._zappar_face_tracker_anchor_count=or.lb,t._zappar_face_tracker_anchor_id=or.mb,t._zappar_face_tracker_anchor_pose_raw=or.nb,t._zappar_face_tracker_anchor_identity_coefficients=or.ob,t._zappar_face_tracker_anchor_expression_coefficients=or.pb,t._zappar_face_tracker_enabled_set=or.qb,t._zappar_face_tracker_enabled=or.rb,t._zappar_face_tracker_max_faces_set=or.sb,t._zappar_face_tracker_max_faces=or.tb,t._zappar_face_tracker_model_loaded_version=or.ub,t._zappar_face_landmark_create=or.vb,t._zappar_face_landmark_destroy=or.wb,t.__Z27zappar_face_landmark_updateP23zappar_face_landmark_tiPKfS2_i=or.xb,t._zappar_face_landmark_anchor_pose=or.yb,t._zappar_barcode_finder_create=or.zb,t._zappar_barcode_finder_destroy=or.Ab,t._zappar_barcode_finder_found_number=or.Bb,t._zappar_barcode_finder_found_text=or.Cb,t._zappar_barcode_finder_enabled_set=or.Db,t._zappar_barcode_finder_enabled=or.Eb,t._zappar_barcode_finder_found_format=or.Fb,t._zappar_barcode_finder_formats=or.Gb,t._zappar_barcode_finder_formats_set=or.Hb;var _r=t._malloc=or.Ib;t._zappar_face_mesh_create=or.Jb,t._zappar_face_mesh_destroy=or.Kb,t.__Z33zappar_face_mesh_load_from_memoryP19zappar_face_mesh_tiPKciiiii=or.Lb,t.__Z29zappar_face_mesh_indices_sizeP19zappar_face_mesh_ti=or.Mb,t.__Z25zappar_face_mesh_uvs_sizeP19zappar_face_mesh_ti=or.Nb,t.__Z30zappar_face_mesh_vertices_sizeP19zappar_face_mesh_ti=or.Ob,t.__Z31zappar_face_mesh_loaded_versionP19zappar_face_mesh_ti=or.Pb,t.__Z25zappar_face_mesh_verticesP19zappar_face_mesh_ti=or.Qb,t.__Z20zappar_face_mesh_uvsP19zappar_face_mesh_ti=or.Rb,t.__Z24zappar_face_mesh_indicesP19zappar_face_mesh_ti=or.Sb,t.__Z23zappar_face_mesh_updateP19zappar_face_mesh_tiPKfS2_i=or.Tb,t.__Z29zappar_face_mesh_normals_sizeP19zappar_face_mesh_ti=or.Ub,t.__Z24zappar_face_mesh_normalsP19zappar_face_mesh_ti=or.Vb,t._zappar_camera_source_create=or.Wb,t._zappar_camera_source_destroy=or.Xb,t._zappar_camera_source_start=or.Yb,t._zappar_camera_source_pause=or.Zb,t._zappar_camera_default_device_id=or._b,t._zappar_sequence_source_create=or.$b,t.__Z28zappar_sequence_source_startP25zappar_sequence_source_ti=or.ac,t.__Z39zappar_sequence_source_load_from_memoryP25zappar_sequence_source_tiPKci=or.bc,t.__Z28zappar_sequence_source_pauseP25zappar_sequence_source_ti=or.cc,t._zappar_sequence_source_destroy=or.dc,t._zappar_sequence_source_max_playback_fps_set=or.ec,t._zappar_log_level_set=or.fc,t._zappar_log_level=or.gc,t.__Z23zappar_log_redirect_setPFv18zappar_log_level_tPKcE=or.hc,t._zappar_analytics_project_id_set=or.ic;var cr,fr=t.___errno_location=or.jc,ur=t.__get_tzname=or.kc,lr=t.__get_daylight=or.lc,pr=t.__get_timezone=or.mc,dr=t.stackSave=or.nc,hr=t.stackRestore=or.oc,mr=t.stackAlloc=or.pc;function br(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}function gr(){function e(){if(!cr&&(cr=!0,t.calledRun=!0,!g)){if(t.noFSInit||Pe||(Pe=!0,Ye(),t.stdin=t.stdin,t.stdout=t.stdout,t.stderr=t.stderr,t.stdin?Xe("stdin",t.stdin):Ve("/dev/tty","/dev/stdin"),t.stdout?Xe("stdout",null,t.stdout):Ve("/dev/tty","/dev/stdout"),t.stderr?Xe("stderr",null,t.stderr):Ve("/dev/tty1","/dev/stderr"),He("/dev/stdin",0),He("/dev/stdout",1),He("/dev/stderr",1)),te(V),ye=!1,te(N),r(t),t.onRuntimeInitialized&&t.onRuntimeInitialized(),t.postRun)for("function"==typeof t.postRun&&(t.postRun=[t.postRun]);t.postRun.length;){var e=t.postRun.shift();G.unshift(e)}te(G)}}if(!(0<H)){if(t.preRun)for("function"==typeof t.preRun&&(t.preRun=[t.preRun]);t.preRun.length;)W();te(U),0<H||(t.setStatus?(t.setStatus("Running..."),setTimeout((function(){setTimeout((function(){t.setStatus("")}),1),e()}),1)):e())}}function wr(e){b=e,h||(t.onExit&&t.onExit(e),g=!0),_(e,new br(e))}if(t.cwrap=function(e,t,r,a){var n=(r=r||[]).every((function(e){return"number"===e}));return"string"!==t&&n&&!a?y(e):function(){return function(e,t,r,a){var n,i={string:function(e){var t=0;if(null!=e&&0!==e){var r=1+(e.length<<2);t=mr(r),P(e,A,t,r)}return t},array:function(e){var t=mr(e.length);return E.set(e,t),t}},o=y(e),s=[];if(e=0,a)for(var _=0;_<a.length;_++){var c=i[r[_]];c?(0===e&&(e=dr()),s[_]=c(a[_])):s[_]=a[_]}return n=r=o.apply(null,s),r="string"===t?I(n):"boolean"===t?!!n:n,0!==e&&hr(e),r}(e,t,r,arguments)}},t.setValue=function(e,t,r){switch("*"===(r=r||"i8").charAt(r.length-1)&&(r="i32"),r){case"i1":case"i8":E[e>>0]=t;break;case"i16":T[e>>1]=t;break;case"i32":x[e>>2]=t;break;case"i64":J=[t>>>0,(K=t,1<=+Math.abs(K)?0<K?(0|Math.min(+Math.floor(K/4294967296),4294967295))>>>0:~~+Math.ceil((K-+(~~K>>>0))/4294967296)>>>0:0)],x[e>>2]=J[0],x[e+4>>2]=J[1];break;case"float":L[e>>2]=t;break;case"double":F[e>>3]=t;break;default:j("invalid type for setValue: "+r)}},t.getValue=function(e,t){switch("*"===(t=t||"i8").charAt(t.length-1)&&(t="i32"),t){case"i1":case"i8":return E[e>>0];case"i16":return T[e>>1];case"i32":case"i64":return x[e>>2];case"float":return L[e>>2];case"double":return F[e>>3];default:j("invalid type for getValue: "+t)}return null},t.UTF8ToString=I,Y=function e(){cr||gr(),cr||(Y=e)},t.run=gr,t.preInit)for("function"==typeof t.preInit&&(t.preInit=[t.preInit]);0<t.preInit.length;)t.preInit.pop()();return gr(),e});const i=n;class o{constructor(e){this._messageSender=e,this._freeBufferPool=[],this._buffer=new ArrayBuffer(16),this._i32View=new Int32Array(this._buffer),this._f32View=new Float32Array(this._buffer),this._f64View=new Float64Array(this._buffer),this._u8View=new Uint8Array(this._buffer),this._u8cView=new Uint8ClampedArray(this._buffer),this._u16View=new Uint16Array(this._buffer),this._u32View=new Uint32Array(this._buffer),this._offset=1,this._startOffset=-1,this._timeoutSet=!1,this._appender={int:e=>this.int(e),bool:e=>this.int(e?1:0),float:e=>this.float(e),string:e=>this.string(e),dataWithLength:e=>this.arrayBuffer(e),type:e=>this.int(e),matrix4x4:e=>this.float32ArrayBuffer(e),matrix3x3:e=>this.float32ArrayBuffer(e),identityCoefficients:e=>this.float32ArrayBuffer(e),expressionCoefficients:e=>this.float32ArrayBuffer(e),cameraModel:e=>this.float32ArrayBuffer(e),timestamp:e=>this.double(e),barcodeFormat:e=>this.int(e),faceLandmarkName:e=>this.int(e),instantTrackerTransformOrientation:e=>this.int(e),logLevel:e=>this.int(e)},this._freeBufferPool.push(new ArrayBuffer(16)),this._freeBufferPool.push(new ArrayBuffer(16))}bufferReturn(e){this._freeBufferPool.push(e)}_ensureArrayBuffer(e){let t,r=4*(this._offset+e+8);if(this._buffer&&this._buffer.byteLength>=r)return;if(!t){let e=r;e--,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,e++,t=new ArrayBuffer(e)}let a=this._buffer?this._i32View:void 0;this._buffer=t,this._i32View=new Int32Array(this._buffer),this._f32View=new Float32Array(this._buffer),this._f64View=new Float64Array(this._buffer),this._u8View=new Uint8Array(this._buffer),this._u8cView=new Uint8ClampedArray(this._buffer),this._u16View=new Uint16Array(this._buffer),this._u32View=new Uint32Array(this._buffer),a&&this._i32View.set(a.subarray(0,this._offset))}sendMessage(e,t){this._ensureArrayBuffer(4),this._startOffset=this._offset,this._i32View[this._offset+1]=e,this._offset+=2,t(this._appender),this._i32View[this._startOffset]=this._offset-this._startOffset,this._startOffset=-1,this._sendOneTime()}_sendOneTime(){!1===this._timeoutSet&&(this._timeoutSet=!0,setTimeout((()=>{this._timeoutSet=!1,this._send()}),0))}_send(){0!==this._freeBufferPool.length?(this._i32View[0]=this._offset,this._messageSender(this._buffer),this._buffer=void 0,this._buffer=this._freeBufferPool.pop(),this._i32View=new Int32Array(this._buffer),this._f32View=new Float32Array(this._buffer),this._f64View=new Float64Array(this._buffer),this._u8View=new Uint8Array(this._buffer),this._u8cView=new Uint8ClampedArray(this._buffer),this._u16View=new Uint16Array(this._buffer),this._u32View=new Uint32Array(this._buffer),this._offset=1,this._startOffset=-1):this._sendOneTime()}int(e){this._ensureArrayBuffer(1),this._i32View[this._offset]=e,this._offset++}double(e){this._ensureArrayBuffer(2),this._offset%2==1&&this._offset++,this._f64View[this._offset/2]=e,this._offset+=2}float(e){this._ensureArrayBuffer(1),this._f32View[this._offset]=e,this._offset++}int32Array(e){this._ensureArrayBuffer(e.length);for(let t=0;t<e.length;++t)this._i32View[this._offset+t]=e[t];this._offset+=e.length}float32Array(e){this._ensureArrayBuffer(e.length);for(let t=0;t<e.length;++t)this._f32View[this._offset+t]=e[t];this._offset+=e.length}booleanArray(e){this._ensureArrayBuffer(e.length);for(let t=0;t<e.length;++t)this._i32View[this._offset+t]=e[t]?1:0;this._offset+=e.length}uint8ArrayBuffer(e){this._ensureArrayBuffer(e.byteLength/4),this._i32View[this._offset]=e.byteLength,this._offset++,this._u8View.set(e,4*this._offset),this._offset+=e.byteLength>>2,0!=(3&e.byteLength)&&this._offset++}arrayBuffer(e){let t=new Uint8Array(e);this.uint8ArrayBuffer(t)}uint8ClampedArrayBuffer(e){this._ensureArrayBuffer(e.byteLength/4),this._i32View[this._offset]=e.byteLength,this._offset++,this._u8cView.set(e,4*this._offset),this._offset+=e.byteLength>>2,0!=(3&e.byteLength)&&this._offset++}float32ArrayBuffer(e){this._ensureArrayBuffer(e.byteLength/4),this._i32View[this._offset]=e.length,this._offset++,this._f32View.set(e,this._offset),this._offset+=e.length}uint16ArrayBuffer(e){this._ensureArrayBuffer(e.byteLength/4),this._i32View[this._offset]=e.length,this._offset++;let t=2*this._offset;this._u16View.set(e,t),this._offset+=e.length>>1,0!=(1&e.length)&&this._offset++}int32ArrayBuffer(e){this._ensureArrayBuffer(e.byteLength/4),this._i32View[this._offset]=e.length,this._offset++,this._i32View.set(e,this._offset),this._offset+=e.length}uint32ArrayBuffer(e){this._ensureArrayBuffer(e.byteLength/4),this._i32View[this._offset]=e.length,this._offset++,this._u32View.set(e,this._offset),this._offset+=e.length}string(e){let t=(new TextEncoder).encode(e);this._ensureArrayBuffer(t.byteLength/4),this._i32View[this._offset]=t.byteLength,this._offset++,this._u8View.set(t,4*this._offset),this._offset+=t.byteLength>>2,0!=(3&t.byteLength)&&this._offset++}}class s{constructor(){this._buffer=new ArrayBuffer(0),this._i32View=new Int32Array(this._buffer),this._f32View=new Float32Array(this._buffer),this._f64View=new Float64Array(this._buffer),this._u8View=new Uint8Array(this._buffer),this._u16View=new Uint16Array(this._buffer),this._u32View=new Uint32Array(this._buffer),this._offset=0,this._length=0,this._startOffset=-1,this._processor={int:()=>this._i32View[this._startOffset++],bool:()=>1===this._i32View[this._startOffset++],type:()=>this._i32View[this._startOffset++],float:()=>this._f32View[this._startOffset++],timestamp:()=>{this._startOffset%2==1&&this._startOffset++;let e=this._f64View[this._startOffset/2];return this._startOffset+=2,e},string:()=>{let e=this._i32View[this._startOffset++],t=(new TextDecoder).decode(new Uint8Array(this._buffer,4*this._startOffset,e));return this._startOffset+=e>>2,0!=(3&e)&&this._startOffset++,t},dataWithLength:()=>{let e=this._i32View[this._startOffset++],t=new Uint8Array(e);return t.set(this._u8View.subarray(4*this._startOffset,4*this._startOffset+e)),this._startOffset+=t.byteLength>>2,0!=(3&t.byteLength)&&this._startOffset++,t.buffer},matrix4x4:()=>{let e=this._i32View[this._startOffset++],t=new Float32Array(e);return t.set(this._f32View.subarray(this._startOffset,this._startOffset+16)),this._startOffset+=e,t},matrix3x3:()=>{let e=this._i32View[this._startOffset++],t=new Float32Array(e);return t.set(this._f32View.subarray(this._startOffset,this._startOffset+9)),this._startOffset+=e,t},identityCoefficients:()=>{let e=this._i32View[this._startOffset++],t=new Float32Array(e);return t.set(this._f32View.subarray(this._startOffset,this._startOffset+50)),this._startOffset+=e,t},expressionCoefficients:()=>{let e=this._i32View[this._startOffset++],t=new Float32Array(e);return t.set(this._f32View.subarray(this._startOffset,this._startOffset+29)),this._startOffset+=e,t},cameraModel:()=>{let e=this._i32View[this._startOffset++],t=new Float32Array(e);return t.set(this._f32View.subarray(this._startOffset,this._startOffset+6)),this._startOffset+=e,t},barcodeFormat:()=>this._i32View[this._startOffset++],faceLandmarkName:()=>this._i32View[this._startOffset++],instantTrackerTransformOrientation:()=>this._i32View[this._startOffset++],logLevel:()=>this._i32View[this._startOffset++]}}setData(e){this._buffer=e,this._i32View=new Int32Array(this._buffer),this._f32View=new Float32Array(this._buffer),this._f64View=new Float64Array(this._buffer),this._u8View=new Uint8Array(this._buffer),this._u16View=new Uint16Array(this._buffer),this._u32View=new Uint32Array(this._buffer),this._offset=0,this._length=0,e.byteLength>=4&&(this._offset=1,this._length=this._i32View[0]),this._startOffset=-1}hasMessage(){return this._offset+1<this._length}forMessages(e){for(;this.hasMessage();){let t=this._i32View[this._offset],r=this._i32View[this._offset+1];this._startOffset=this._offset+2,this._offset+=t,e(r,this._processor)}}}class _{constructor(e,t){this._impl=e,this._sender=t,this._deserializer=new s,this.serializersByPipelineId=new Map,this._pipeline_id_by_pipeline_id=new Map,this._pipeline_by_instance=new Map,this._pipeline_id_by_camera_source_id=new Map,this._camera_source_by_instance=new Map,this._pipeline_id_by_sequence_source_id=new Map,this._sequence_source_by_instance=new Map,this._pipeline_id_by_image_tracker_id=new Map,this._image_tracker_by_instance=new Map,this._pipeline_id_by_face_tracker_id=new Map,this._face_tracker_by_instance=new Map,this._pipeline_id_by_face_mesh_id=new Map,this._face_mesh_by_instance=new Map,this._pipeline_id_by_face_landmark_id=new Map,this._face_landmark_by_instance=new Map,this._pipeline_id_by_barcode_finder_id=new Map,this._barcode_finder_by_instance=new Map,this._pipeline_id_by_instant_world_tracker_id=new Map,this._instant_world_tracker_by_instance=new Map}processBuffer(e){this._deserializer.setData(e),this._deserializer.forMessages(((e,t)=>{switch(e){case 34:this._impl.log_level_set(t.logLevel());break;case 31:this._impl.analytics_project_id_set(t.string(),t.string());break;case 27:{let e=t.type(),r=this._impl.pipeline_create();this._pipeline_by_instance.set(e,r),this._pipeline_id_by_pipeline_id.set(e,e),this.serializersByPipelineId.set(e,new o((t=>{this._sender(e,t)})));break}case 28:{let e=t.type(),r=this._pipeline_by_instance.get(e);if(void 0===r)return;this._impl.pipeline_destroy(r),this._pipeline_by_instance.delete(e);break}case 9:{let e=t.type(),r=this._pipeline_by_instance.get(e);if(void 0===r)return;this._impl.pipeline_frame_update(r);break}case 8:{let e=t.type(),r=this._pipeline_by_instance.get(e);if(void 0===r)return;this._impl.pipeline_camera_frame_submit(r,t.dataWithLength(),t.int(),t.int(),t.int(),t.matrix4x4(),t.cameraModel(),t.bool());break}case 10:{let e=t.type(),r=this._pipeline_by_instance.get(e);if(void 0===r)return;this._impl.pipeline_motion_accelerometer_submit(r,t.timestamp(),t.float(),t.float(),t.float());break}case 11:{let e=t.type(),r=this._pipeline_by_instance.get(e);if(void 0===r)return;this._impl.pipeline_motion_rotation_rate_submit(r,t.timestamp(),t.float(),t.float(),t.float());break}case 12:{let e=t.type(),r=this._pipeline_by_instance.get(e);if(void 0===r)return;this._impl.pipeline_motion_attitude_submit(r,t.timestamp(),t.float(),t.float(),t.float());break}case 13:{let e=t.type(),r=this._pipeline_by_instance.get(e);if(void 0===r)return;this._impl.pipeline_motion_attitude_matrix_submit(r,t.matrix4x4());break}case 29:{let e=t.type(),r=t.type(),a=this._pipeline_by_instance.get(r),n=t.string(),i=this._impl.camera_source_create(a,n);this._camera_source_by_instance.set(e,i),this._pipeline_id_by_camera_source_id.set(e,r);break}case 30:{let e=t.type(),r=this._camera_source_by_instance.get(e);if(void 0===r)return;this._impl.camera_source_destroy(r),this._camera_source_by_instance.delete(e);break}case 35:{let e=t.type(),r=t.type(),a=this._pipeline_by_instance.get(r),n=this._impl.sequence_source_create(a);this._sequence_source_by_instance.set(e,n),this._pipeline_id_by_sequence_source_id.set(e,r);break}case 36:{let e=t.type(),r=this._sequence_source_by_instance.get(e);if(void 0===r)return;this._impl.sequence_source_destroy(r),this._sequence_source_by_instance.delete(e);break}case 2:{let e=t.type(),r=t.type(),a=this._pipeline_by_instance.get(r),n=this._impl.image_tracker_create(a);this._image_tracker_by_instance.set(e,n),this._pipeline_id_by_image_tracker_id.set(e,r);break}case 14:{let e=t.type(),r=this._image_tracker_by_instance.get(e);if(void 0===r)return;this._impl.image_tracker_destroy(r),this._image_tracker_by_instance.delete(e);break}case 4:{let e=t.type(),r=this._image_tracker_by_instance.get(e);if(void 0===r)return;this._impl.image_tracker_target_load_from_memory(r,t.dataWithLength());break}case 3:{let e=t.type(),r=this._image_tracker_by_instance.get(e);if(void 0===r)return;this._impl.image_tracker_enabled_set(r,t.bool());break}case 20:{let e=t.type(),r=t.type(),a=this._pipeline_by_instance.get(r),n=this._impl.face_tracker_create(a);this._face_tracker_by_instance.set(e,n),this._pipeline_id_by_face_tracker_id.set(e,r);break}case 21:{let e=t.type(),r=this._face_tracker_by_instance.get(e);if(void 0===r)return;this._impl.face_tracker_destroy(r),this._face_tracker_by_instance.delete(e);break}case 22:{let e=t.type(),r=this._face_tracker_by_instance.get(e);if(void 0===r)return;this._impl.face_tracker_model_load_from_memory(r,t.dataWithLength());break}case 23:{let e=t.type(),r=this._face_tracker_by_instance.get(e);if(void 0===r)return;this._impl.face_tracker_enabled_set(r,t.bool());break}case 24:{let e=t.type(),r=this._face_tracker_by_instance.get(e);if(void 0===r)return;this._impl.face_tracker_max_faces_set(r,t.int());break}case 25:{let e=t.type(),r=this._impl.face_mesh_create();this._face_mesh_by_instance.set(e,r);break}case 26:{let e=t.type(),r=this._face_mesh_by_instance.get(e);if(void 0===r)return;this._impl.face_mesh_destroy(r),this._face_mesh_by_instance.delete(e);break}case 32:{let e=t.type(),r=t.faceLandmarkName(),a=this._impl.face_landmark_create(r);this._face_landmark_by_instance.set(e,a);break}case 33:{let e=t.type(),r=this._face_landmark_by_instance.get(e);if(void 0===r)return;this._impl.face_landmark_destroy(r),this._face_landmark_by_instance.delete(e);break}case 16:{let e=t.type(),r=t.type(),a=this._pipeline_by_instance.get(r),n=this._impl.barcode_finder_create(a);this._barcode_finder_by_instance.set(e,n),this._pipeline_id_by_barcode_finder_id.set(e,r);break}case 17:{let e=t.type(),r=this._barcode_finder_by_instance.get(e);if(void 0===r)return;this._impl.barcode_finder_destroy(r),this._barcode_finder_by_instance.delete(e);break}case 18:{let e=t.type(),r=this._barcode_finder_by_instance.get(e);if(void 0===r)return;this._impl.barcode_finder_enabled_set(r,t.bool());break}case 19:{let e=t.type(),r=this._barcode_finder_by_instance.get(e);if(void 0===r)return;this._impl.barcode_finder_formats_set(r,t.barcodeFormat());break}case 5:{let e=t.type(),r=t.type(),a=this._pipeline_by_instance.get(r),n=this._impl.instant_world_tracker_create(a);this._instant_world_tracker_by_instance.set(e,n),this._pipeline_id_by_instant_world_tracker_id.set(e,r);break}case 15:{let e=t.type(),r=this._instant_world_tracker_by_instance.get(e);if(void 0===r)return;this._impl.instant_world_tracker_destroy(r),this._instant_world_tracker_by_instance.delete(e);break}case 6:{let e=t.type(),r=this._instant_world_tracker_by_instance.get(e);if(void 0===r)return;this._impl.instant_world_tracker_enabled_set(r,t.bool());break}case 7:{let e=t.type(),r=this._instant_world_tracker_by_instance.get(e);if(void 0===r)return;this._impl.instant_world_tracker_anchor_pose_set_from_camera_offset_raw(r,t.float(),t.float(),t.float(),t.instantTrackerTransformOrientation());break}}}))}exploreState(){for(let[e,t]of this._pipeline_by_instance){let r=this._pipeline_id_by_pipeline_id.get(e);if(!r)continue;let a=this.serializersByPipelineId.get(r);a&&(a.sendMessage(7,(r=>{r.type(e),r.int(this._impl.pipeline_frame_number(t))})),a.sendMessage(6,(r=>{r.type(e),r.cameraModel(this._impl.pipeline_camera_model(t))})),a.sendMessage(5,(r=>{r.type(e),r.int(this._impl.pipeline_camera_frame_user_data(t))})),a.sendMessage(11,(r=>{r.type(e),r.matrix4x4(this._impl.pipeline_camera_frame_camera_attitude(t))})),a.sendMessage(12,(r=>{r.type(e),r.matrix4x4(this._impl.pipeline_camera_frame_device_attitude(t))})))}for(let[e,t]of this._camera_source_by_instance){let t=this._pipeline_id_by_camera_source_id.get(e);t&&this.serializersByPipelineId.get(t)}for(let[e,t]of this._sequence_source_by_instance){let t=this._pipeline_id_by_sequence_source_id.get(e);t&&this.serializersByPipelineId.get(t)}for(let[e,t]of this._image_tracker_by_instance){let r=this._pipeline_id_by_image_tracker_id.get(e);if(!r)continue;let a=this.serializersByPipelineId.get(r);if(a){a.sendMessage(19,(r=>{r.type(e),r.int(this._impl.image_tracker_target_loaded_version(t))})),a.sendMessage(1,(r=>{r.type(e),r.int(this._impl.image_tracker_anchor_count(t))}));for(let r=0;r<this._impl.image_tracker_anchor_count(t);r++)a.sendMessage(2,(a=>{a.type(e),a.int(r),a.string(this._impl.image_tracker_anchor_id(t,r))}));for(let r=0;r<this._impl.image_tracker_anchor_count(t);r++)a.sendMessage(3,(a=>{a.type(e),a.int(r),a.matrix4x4(this._impl.image_tracker_anchor_pose_raw(t,r))}))}}for(let[e,t]of this._face_tracker_by_instance){let r=this._pipeline_id_by_face_tracker_id.get(e);if(!r)continue;let a=this.serializersByPipelineId.get(r);if(a){a.sendMessage(18,(r=>{r.type(e),r.int(this._impl.face_tracker_model_loaded_version(t))})),a.sendMessage(13,(r=>{r.type(e),r.int(this._impl.face_tracker_anchor_count(t))}));for(let r=0;r<this._impl.face_tracker_anchor_count(t);r++)a.sendMessage(14,(a=>{a.type(e),a.int(r),a.string(this._impl.face_tracker_anchor_id(t,r))}));for(let r=0;r<this._impl.face_tracker_anchor_count(t);r++)a.sendMessage(15,(a=>{a.type(e),a.int(r),a.matrix4x4(this._impl.face_tracker_anchor_pose_raw(t,r))}));for(let r=0;r<this._impl.face_tracker_anchor_count(t);r++)a.sendMessage(16,(a=>{a.type(e),a.int(r),a.identityCoefficients(this._impl.face_tracker_anchor_identity_coefficients(t,r))}));for(let r=0;r<this._impl.face_tracker_anchor_count(t);r++)a.sendMessage(17,(a=>{a.type(e),a.int(r),a.expressionCoefficients(this._impl.face_tracker_anchor_expression_coefficients(t,r))}))}}for(let[e,t]of this._face_mesh_by_instance){let t=this._pipeline_id_by_face_mesh_id.get(e);t&&this.serializersByPipelineId.get(t)}for(let[e,t]of this._face_landmark_by_instance){let t=this._pipeline_id_by_face_landmark_id.get(e);t&&this.serializersByPipelineId.get(t)}for(let[e,t]of this._barcode_finder_by_instance){let r=this._pipeline_id_by_barcode_finder_id.get(e);if(!r)continue;let a=this.serializersByPipelineId.get(r);if(a){a.sendMessage(8,(r=>{r.type(e),r.int(this._impl.barcode_finder_found_number(t))}));for(let r=0;r<this._impl.barcode_finder_found_number(t);r++)a.sendMessage(9,(a=>{a.type(e),a.int(r),a.string(this._impl.barcode_finder_found_text(t,r))}));for(let r=0;r<this._impl.barcode_finder_found_number(t);r++)a.sendMessage(10,(a=>{a.type(e),a.int(r),a.barcodeFormat(this._impl.barcode_finder_found_format(t,r))}))}}for(let[e,t]of this._instant_world_tracker_by_instance){let r=this._pipeline_id_by_instant_world_tracker_id.get(e);if(!r)continue;let a=this.serializersByPipelineId.get(r);a&&a.sendMessage(4,(r=>{r.type(e),r.matrix4x4(this._impl.instant_world_tracker_anchor_pose_raw(t))}))}}}class c{constructor(){this._funcs=[]}bind(e){this._funcs.push(e)}unbind(e){let t=this._funcs.indexOf(e);t>-1&&this._funcs.splice(t,1)}emit(){for(var e=0,t=this._funcs.length;e<t;e++)this._funcs[e]()}}class f{constructor(){this._funcs=[]}bind(e){this._funcs.push(e)}unbind(e){let t=this._funcs.indexOf(e);t>-1&&this._funcs.splice(t,1)}emit(e){for(var t=0,r=this._funcs.length;t<r;t++)this._funcs[t](e)}}var u,l,p,d,h,m,b=r(975);!function(e){e[e.UNKNOWN=131072]="UNKNOWN",e[e.AZTEC=1]="AZTEC",e[e.CODABAR=2]="CODABAR",e[e.CODE_39=4]="CODE_39",e[e.CODE_93=8]="CODE_93",e[e.CODE_128=16]="CODE_128",e[e.DATA_MATRIX=32]="DATA_MATRIX",e[e.EAN_8=64]="EAN_8",e[e.EAN_13=128]="EAN_13",e[e.ITF=256]="ITF",e[e.MAXICODE=512]="MAXICODE",e[e.PDF_417=1024]="PDF_417",e[e.QR_CODE=2048]="QR_CODE",e[e.RSS_14=4096]="RSS_14",e[e.RSS_EXPANDED=8192]="RSS_EXPANDED",e[e.UPC_A=16384]="UPC_A",e[e.UPC_E=32768]="UPC_E",e[e.UPC_EAN_EXTENSION=65536]="UPC_EAN_EXTENSION",e[e.ALL=131071]="ALL"}(u||(u={})),function(e){e[e.EYE_LEFT=0]="EYE_LEFT",e[e.EYE_RIGHT=1]="EYE_RIGHT",e[e.EAR_LEFT=2]="EAR_LEFT",e[e.EAR_RIGHT=3]="EAR_RIGHT",e[e.NOSE_BRIDGE=4]="NOSE_BRIDGE",e[e.NOSE_TIP=5]="NOSE_TIP",e[e.NOSE_BASE=6]="NOSE_BASE",e[e.LIP_TOP=7]="LIP_TOP",e[e.LIP_BOTTOM=8]="LIP_BOTTOM",e[e.MOUTH_CENTER=9]="MOUTH_CENTER",e[e.CHIN=10]="CHIN",e[e.EYEBROW_LEFT=11]="EYEBROW_LEFT",e[e.EYEBROW_RIGHT=12]="EYEBROW_RIGHT"}(l||(l={})),function(e){e[e.WORLD=3]="WORLD",e[e.MINUS_Z_AWAY_FROM_USER=4]="MINUS_Z_AWAY_FROM_USER",e[e.MINUS_Z_HEADING=5]="MINUS_Z_HEADING",e[e.UNCHANGED=6]="UNCHANGED"}(p||(p={})),function(e){e[e.LOG_LEVEL_NONE=0]="LOG_LEVEL_NONE",e[e.LOG_LEVEL_ERROR=1]="LOG_LEVEL_ERROR",e[e.LOG_LEVEL_WARNING=2]="LOG_LEVEL_WARNING",e[e.LOG_LEVEL_VERBOSE=3]="LOG_LEVEL_VERBOSE"}(d||(d={})),function(e){e[e.FRAME_PIXEL_FORMAT_I420=0]="FRAME_PIXEL_FORMAT_I420",e[e.FRAME_PIXEL_FORMAT_I420A=1]="FRAME_PIXEL_FORMAT_I420A",e[e.FRAME_PIXEL_FORMAT_I422=2]="FRAME_PIXEL_FORMAT_I422",e[e.FRAME_PIXEL_FORMAT_I444=3]="FRAME_PIXEL_FORMAT_I444",e[e.FRAME_PIXEL_FORMAT_NV12=4]="FRAME_PIXEL_FORMAT_NV12",e[e.FRAME_PIXEL_FORMAT_RGBA=5]="FRAME_PIXEL_FORMAT_RGBA",e[e.FRAME_PIXEL_FORMAT_BGRA=6]="FRAME_PIXEL_FORMAT_BGRA",e[e.FRAME_PIXEL_FORMAT_Y=7]="FRAME_PIXEL_FORMAT_Y"}(h||(h={})),function(e){e[e.IMAGE_TRACKER_TYPE_PLANAR=0]="IMAGE_TRACKER_TYPE_PLANAR",e[e.IMAGE_TRACKER_TYPE_CYLINDRICAL=1]="IMAGE_TRACKER_TYPE_CYLINDRICAL",e[e.IMAGE_TRACKER_TYPE_CONICAL=2]="IMAGE_TRACKER_TYPE_CONICAL"}(m||(m={}));const g=new Map;class w{constructor(e){this._gl=e,this._viewports=[],this._underlyingViewport=this._gl.viewport,this._viewports.push(this._gl.getParameter(this._gl.VIEWPORT)),this._gl.viewport=(e,t,r,a)=>{this._viewports[this._viewports.length-1]=[e,t,r,a],this._underlyingViewport.call(this._gl,e,t,r,a)}}static get(e){let t=g.get(e);return t||(t=new w(e),g.set(e,t)),t}push(){this._viewports.push(this._viewports[this._viewports.length-1])}pop(){const e=this._viewports.pop(),t=this._viewports[this._viewports.length-1];e&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]||this._underlyingViewport.call(this._gl,t[0],t[1],t[2],t[3])}}var y,v=r(238);!function(e){e[e.OBJECT_URL=0]="OBJECT_URL",e[e.SRC_OBJECT=1]="SRC_OBJECT"}(y||(y={}));let E={deviceMotionMutliplier:-1,blacklisted:!1,showGyroPermissionsWarningIfNecessary:!1,showSafariPermissionsResetIfNecessary:!1,requestHighFrameRate:!1,videoWidth:640,videoHeight:480,dataWidth:320,dataHeight:240,videoElementInDOM:!1,preferMediaStreamTrackProcessorCamera:!1,preferImageBitmapCamera:!1,ios164CameraSelection:!1,forceWindowOrientation:!1};"undefined"!=typeof window&&(window.zeeProfile=E,window.location.href.indexOf("_mstppipeline")>=0&&(console.log("Configuring for MSTP camera pipeline (if supported)"),E.preferMediaStreamTrackProcessorCamera=!0),window.location.href.indexOf("_imagebitmappipeline")>=0&&(console.log("Configuring for ImageBitmap camera pipeline (if supported)"),E.preferImageBitmapCamera=!0));let A=new v.UAParser,T=(A.getOS().name||"unknown").toLowerCase(),R=(A.getEngine().name||"unknown").toLowerCase();function x(e){E.forceWindowOrientation=!0;let t=e.split(".");if(t.length>=2){const e=parseInt(t[0]),r=parseInt(t[1]);(e<11||11===e&&r<3)&&(E.blacklisted=!0),(e<12||12===e&&r<2)&&(E.videoElementInDOM=!0),(12===e&&r>=2||e>=13)&&(E.showGyroPermissionsWarningIfNecessary=!0),e>=13&&(E.showSafariPermissionsResetIfNecessary=!0),(e>=12&&r>1||e>=13)&&navigator.mediaDevices&&navigator.mediaDevices.getSupportedConstraints&&navigator.mediaDevices.getSupportedConstraints().frameRate&&(E.requestHighFrameRate=!0,e<14&&(E.videoHeight=360,E.dataHeight=180)),(16===e&&r>=4||e>16)&&(E.ios164CameraSelection=!0)}}function k(e,t,r){let a=e.createShader(t);if(!a)throw new Error("Unable to create shader");e.shaderSource(a,r),e.compileShader(a);let n=e.getShaderInfoLog(a);if(n&&n.trim().length>0)throw new Error("Shader compile error: "+n);return a}"webkit"===R&&"ios"!==T&&(E.deviceMotionMutliplier=1,"undefined"!=typeof window&&void 0!==window.orientation&&x("15.0")),"webkit"===R&&"ios"===T&&(E.deviceMotionMutliplier=1,x(A.getOS().version||"15.0"));class L{constructor(e){this._gl=e,this._isPaused=!0,this._hadFrames=!1,this._isUserFacing=!1,this._cameraToScreenRotation=0,this._isUploadFrame=!0,this._computedTransformRotation=-1,this._computedFrontCameraRotation=!1,this._cameraUvTransform=b.Ue(),this._framebufferWidth=0,this._framebufferHeight=0,this._framebufferId=null,this._renderTexture=null,this._isWebGL2=!1,this._isWebGL2=e.getParameter(e.VERSION).indexOf("WebGL 2")>=0,this._isWebGL2||(this._instancedArraysExtension=this._gl.getExtension("ANGLE_instanced_arrays"))}resetGLContext(){this._framebufferId=null,this._renderTexture=null,this._vertexBuffer=void 0,this._indexBuffer=void 0,this._greyscaleShader=void 0}destroy(){this.resetGLContext()}uploadFrame(e,t,r,a){let n=this._gl;const i=w.get(n);i.push();const o=n.isEnabled(n.SCISSOR_TEST),s=n.isEnabled(n.DEPTH_TEST),_=n.isEnabled(n.BLEND),c=n.isEnabled(n.CULL_FACE),f=n.isEnabled(n.STENCIL_TEST),u=n.getParameter(n.ACTIVE_TEXTURE),l=n.getParameter(n.UNPACK_FLIP_Y_WEBGL),p=n.getParameter(n.CURRENT_PROGRAM);n.activeTexture(n.TEXTURE0);const d=n.getParameter(n.TEXTURE_BINDING_2D),h=n.getParameter(n.FRAMEBUFFER_BINDING),m=n.getParameter(n.ARRAY_BUFFER_BINDING),b=n.getParameter(n.ELEMENT_ARRAY_BUFFER_BINDING);n.disable(n.SCISSOR_TEST),n.disable(n.DEPTH_TEST),n.disable(n.BLEND),n.disable(n.CULL_FACE),n.disable(n.STENCIL_TEST),n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,!1),n.bindTexture(n.TEXTURE_2D,e);const g=n.RGBA,y=n.RGBA,v=n.UNSIGNED_BYTE;n.texImage2D(n.TEXTURE_2D,0,g,y,v,t);let A=0,T=0;"undefined"!=typeof HTMLVideoElement&&t instanceof HTMLVideoElement?(A=t.videoWidth,T=t.videoHeight):(A=t.width,T=t.height),T>A&&(T=[A,A=T][0]),this._updateTransforms(r,a);let R=this._getFramebuffer(n,E.dataWidth/4,E.dataHeight),x=this._getVertexBuffer(n),k=this._getIndexBuffer(n),L=this._getGreyscaleShader(n);const F=n.getVertexAttrib(L.aVertexPositionLoc,n.VERTEX_ATTRIB_ARRAY_SIZE),z=n.getVertexAttrib(L.aVertexPositionLoc,n.VERTEX_ATTRIB_ARRAY_TYPE),M=n.getVertexAttrib(L.aVertexPositionLoc,n.VERTEX_ATTRIB_ARRAY_NORMALIZED),I=n.getVertexAttrib(L.aVertexPositionLoc,n.VERTEX_ATTRIB_ARRAY_STRIDE),P=n.getVertexAttribOffset(L.aVertexPositionLoc,n.VERTEX_ATTRIB_ARRAY_POINTER),O=n.getVertexAttrib(L.aVertexPositionLoc,n.VERTEX_ATTRIB_ARRAY_ENABLED),S=n.getVertexAttrib(L.aVertexPositionLoc,n.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING),B=n.getVertexAttrib(L.aTextureCoordLoc,n.VERTEX_ATTRIB_ARRAY_SIZE),D=n.getVertexAttrib(L.aTextureCoordLoc,n.VERTEX_ATTRIB_ARRAY_TYPE),C=n.getVertexAttrib(L.aTextureCoordLoc,n.VERTEX_ATTRIB_ARRAY_NORMALIZED),U=n.getVertexAttrib(L.aTextureCoordLoc,n.VERTEX_ATTRIB_ARRAY_STRIDE),V=n.getVertexAttribOffset(L.aTextureCoordLoc,n.VERTEX_ATTRIB_ARRAY_POINTER),N=n.getVertexAttrib(L.aTextureCoordLoc,n.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING),G=n.getVertexAttrib(L.aTextureCoordLoc,n.VERTEX_ATTRIB_ARRAY_ENABLED);let W=0,H=0;this._isWebGL2?(W=n.getVertexAttrib(L.aVertexPositionLoc,n.VERTEX_ATTRIB_ARRAY_DIVISOR),H=n.getVertexAttrib(L.aTextureCoordLoc,n.VERTEX_ATTRIB_ARRAY_DIVISOR),n.vertexAttribDivisor(L.aVertexPositionLoc,0),n.vertexAttribDivisor(L.aTextureCoordLoc,0)):this._instancedArraysExtension&&(W=n.getVertexAttrib(L.aVertexPositionLoc,this._instancedArraysExtension.VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE),H=n.getVertexAttrib(L.aTextureCoordLoc,this._instancedArraysExtension.VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE),this._instancedArraysExtension.vertexAttribDivisorANGLE(L.aVertexPositionLoc,0),this._instancedArraysExtension.vertexAttribDivisorANGLE(L.aTextureCoordLoc,0)),n.bindFramebuffer(n.FRAMEBUFFER,R),n.viewport(0,0,this._framebufferWidth,this._framebufferHeight),n.clear(n.COLOR_BUFFER_BIT),n.bindBuffer(n.ARRAY_BUFFER,x),n.vertexAttribPointer(L.aVertexPositionLoc,2,n.FLOAT,!1,16,0),n.enableVertexAttribArray(L.aVertexPositionLoc),n.vertexAttribPointer(L.aTextureCoordLoc,2,n.FLOAT,!1,16,8),n.enableVertexAttribArray(L.aTextureCoordLoc),n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,k),n.useProgram(L.program),n.uniform1f(L.uTexWidthLoc,E.dataWidth),n.uniformMatrix4fv(L.uUvTransformLoc,!1,this._cameraUvTransform),n.activeTexture(n.TEXTURE0),n.bindTexture(n.TEXTURE_2D,e),n.uniform1i(L.uSamplerLoc,0),n.drawElements(n.TRIANGLES,6,n.UNSIGNED_SHORT,0),n.bindBuffer(n.ARRAY_BUFFER,S),n.vertexAttribPointer(L.aVertexPositionLoc,F,z,M,I,P),n.bindBuffer(n.ARRAY_BUFFER,N),n.vertexAttribPointer(L.aTextureCoordLoc,B,D,C,U,V),n.bindBuffer(n.ARRAY_BUFFER,m),n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,b),O||n.disableVertexAttribArray(L.aVertexPositionLoc),G||n.disableVertexAttribArray(L.aTextureCoordLoc),this._isWebGL2?(n.vertexAttribDivisor(L.aVertexPositionLoc,W),n.vertexAttribDivisor(L.aTextureCoordLoc,H)):this._instancedArraysExtension&&(this._instancedArraysExtension.vertexAttribDivisorANGLE(L.aVertexPositionLoc,W),this._instancedArraysExtension.vertexAttribDivisorANGLE(L.aTextureCoordLoc,H)),n.bindFramebuffer(n.FRAMEBUFFER,h),n.useProgram(p),n.bindTexture(n.TEXTURE_2D,d),n.activeTexture(u),n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,l),i.pop(),_&&n.enable(n.BLEND),c&&n.enable(n.CULL_FACE),s&&n.enable(n.DEPTH_TEST),o&&n.enable(n.SCISSOR_TEST),f&&n.enable(n.STENCIL_TEST)}readFrame(e,t){let r=this._gl,a=new Uint8Array(t);const n=r.getParameter(r.FRAMEBUFFER_BINDING);let i=this._getFramebuffer(r,E.dataWidth/4,E.dataHeight);return r.bindFramebuffer(r.FRAMEBUFFER,i),r.readPixels(0,0,this._framebufferWidth,this._framebufferHeight,r.RGBA,r.UNSIGNED_BYTE,a),r.bindFramebuffer(r.FRAMEBUFFER,n),{uvTransform:this._cameraUvTransform,data:t,texture:e,dataWidth:E.dataWidth,dataHeight:E.dataHeight,userFacing:this._computedFrontCameraRotation}}_updateTransforms(e,t){e==this._computedTransformRotation&&t==this._computedFrontCameraRotation||(this._computedTransformRotation=e,this._computedFrontCameraRotation=t,this._cameraUvTransform=this._getCameraUvTransform())}_getCameraUvTransform(){switch(this._computedTransformRotation){case 270:return new Float32Array([0,1,0,0,-1,0,0,0,0,0,1,0,1,0,0,1]);case 180:return new Float32Array([-1,0,0,0,0,-1,0,0,0,0,1,0,1,1,0,1]);case 90:return new Float32Array([0,-1,0,0,1,0,0,0,0,0,1,0,0,1,0,1])}return new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}_getFramebuffer(e,t,r){if(this._framebufferWidth===t&&this._framebufferHeight===r&&this._framebufferId)return this._framebufferId;if(this._framebufferId&&(e.deleteFramebuffer(this._framebufferId),this._framebufferId=null),this._renderTexture&&(e.deleteTexture(this._renderTexture),this._renderTexture=null),this._framebufferId=e.createFramebuffer(),!this._framebufferId)throw new Error("Unable to create framebuffer");if(e.bindFramebuffer(e.FRAMEBUFFER,this._framebufferId),this._renderTexture=e.createTexture(),!this._renderTexture)throw new Error("Unable to create render texture");e.activeTexture(e.TEXTURE0);const a=e.getParameter(e.TEXTURE_BINDING_2D);e.bindTexture(e.TEXTURE_2D,this._renderTexture),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,t,r,0,e.RGBA,e.UNSIGNED_BYTE,null),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texParameterf(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,this._renderTexture,0);let n=e.checkFramebufferStatus(e.FRAMEBUFFER);if(n!==e.FRAMEBUFFER_COMPLETE)throw new Error("Framebuffer not complete: "+n.toString());return this._framebufferWidth=t,this._framebufferHeight=r,e.bindTexture(e.TEXTURE_2D,a),e.bindFramebuffer(e.FRAMEBUFFER,null),this._framebufferId}_getVertexBuffer(e){if(this._vertexBuffer)return this._vertexBuffer;if(this._vertexBuffer=e.createBuffer(),!this._vertexBuffer)throw new Error("Unable to create vertex buffer");e.bindBuffer(e.ARRAY_BUFFER,this._vertexBuffer);let t=new Float32Array([-1,-1,0,0,-1,1,0,1,1,1,1,1,1,-1,1,0]);return e.bufferData(e.ARRAY_BUFFER,t,e.STATIC_DRAW),this._vertexBuffer}_getIndexBuffer(e){if(this._indexBuffer)return this._indexBuffer;if(this._indexBuffer=e.createBuffer(),!this._indexBuffer)throw new Error("Unable to create index buffer");e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,this._indexBuffer);let t=new Uint16Array([0,1,2,0,2,3]);return e.bufferData(e.ELEMENT_ARRAY_BUFFER,t,e.STATIC_DRAW),this._indexBuffer}_getGreyscaleShader(e){if(this._greyscaleShader)return this._greyscaleShader;let t=e.createProgram();if(!t)throw new Error("Unable to create program");let r=k(e,e.VERTEX_SHADER,P),a=k(e,e.FRAGMENT_SHADER,O);e.attachShader(t,r),e.attachShader(t,a),function(e,t){e.linkProgram(t);let r=e.getProgramInfoLog(t);if(r&&r.trim().length>0)throw new Error("Unable to link: "+r)}(e,t);let n=e.getUniformLocation(t,"uTexWidth");if(!n)throw new Error("Unable to get uniform location uTexWidth");let i=e.getUniformLocation(t,"uUvTransform");if(!i)throw new Error("Unable to get uniform location uUvTransform");let o=e.getUniformLocation(t,"uSampler");if(!o)throw new Error("Unable to get uniform location uSampler");return this._greyscaleShader={program:t,aVertexPositionLoc:e.getAttribLocation(t,"aVertexPosition"),aTextureCoordLoc:e.getAttribLocation(t,"aTextureCoord"),uTexWidthLoc:n,uUvTransformLoc:i,uSamplerLoc:o},this._greyscaleShader}}let F,z,M,I,P="\n attribute vec4 aVertexPosition;\n attribute vec2 aTextureCoord;\n\n varying highp vec2 vTextureCoord1;\n varying highp vec2 vTextureCoord2;\n varying highp vec2 vTextureCoord3;\n varying highp vec2 vTextureCoord4;\n\n uniform float uTexWidth;\n\tuniform mat4 uUvTransform;\n\n void main(void) {\n highp vec2 offset1 = vec2(1.5 / uTexWidth, 0);\n highp vec2 offset2 = vec2(0.5 / uTexWidth, 0);\n\n gl_Position = aVertexPosition;\n vTextureCoord1 = (uUvTransform * vec4(aTextureCoord - offset1, 0, 1)).xy;\n vTextureCoord2 = (uUvTransform * vec4(aTextureCoord - offset2, 0, 1)).xy;\n vTextureCoord3 = (uUvTransform * vec4(aTextureCoord + offset2, 0, 1)).xy;\n vTextureCoord4 = (uUvTransform * vec4(aTextureCoord + offset1, 0, 1)).xy;\n }\n",O="\n varying highp vec2 vTextureCoord1;\n varying highp vec2 vTextureCoord2;\n varying highp vec2 vTextureCoord3;\n varying highp vec2 vTextureCoord4;\n\n uniform sampler2D uSampler;\n\n const lowp vec3 colorWeights = vec3(77.0 / 256.0, 150.0 / 256.0, 29.0 / 256.0);\n\n void main(void) {\n lowp vec4 outpx;\n\n outpx.r = dot(colorWeights, texture2D(uSampler, vTextureCoord1).xyz);\n outpx.g = dot(colorWeights, texture2D(uSampler, vTextureCoord2).xyz);\n outpx.b = dot(colorWeights, texture2D(uSampler, vTextureCoord3).xyz);\n outpx.a = dot(colorWeights, texture2D(uSampler, vTextureCoord4).xyz);\n\n gl_FragColor = outpx;\n }\n";var S=function(e,t,r,a){return new(r||(r=Promise))((function(n,i){function o(e){try{_(a.next(e))}catch(e){i(e)}}function s(e){try{_(a.throw(e))}catch(e){i(e)}}function _(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,s)}_((a=a.apply(e,t||[])).next())}))};let B=new class{constructor(){this.onOutgoingMessage=new c,this.onIncomingMessage=new f,this._outgoingMessages=[]}postIncomingMessage(e){this.onIncomingMessage.emit(e)}postOutgoingMessage(e,t){this._outgoingMessages.push({msg:e,transferables:t}),this.onOutgoingMessage.emit()}getOutgoingMessages(){let e=this._outgoingMessages;return this._outgoingMessages=[],e}},D=0;function C(e){return S(this,void 0,void 0,(function*(){let t=i({locateFile:(t,r)=>t.endsWith("zappar-cv.wasm")?e:r+t,onRuntimeInitialized:()=>{let e=function(e){let t=e.cwrap("zappar_log_level","number",[]),r=e.cwrap("zappar_log_level_set",null,["number"]),a=e.cwrap("zappar_analytics_project_id_set",null,["string","string"]),n=e.cwrap("zappar_pipeline_create","number",[]),i=e.cwrap("zappar_pipeline_destroy",null,["number"]),o=e.cwrap("zappar_pipeline_frame_update",null,["number"]),s=e.cwrap("zappar_pipeline_frame_number","number",["number"]),_=e.cwrap("zappar_pipeline_camera_model","number",["number"]),c=e.cwrap("zappar_pipeline_camera_frame_user_data","number",["number"]),f=e.cwrap("zappar_pipeline_camera_frame_submit",null,["number","number","number","number","number","number","number","number","number"]),u=e.cwrap("zappar_pipeline_camera_frame_submit_raw_pointer",null,["number","number","number","number","number","number","number","number","number","number","number"]),l=e.cwrap("zappar_pipeline_camera_frame_camera_attitude","number",["number"]),p=e.cwrap("zappar_pipeline_camera_frame_device_attitude","number",["number"]),d=e.cwrap("zappar_pipeline_motion_accelerometer_submit",null,["number","number","number","number","number"]),h=e.cwrap("zappar_pipeline_motion_rotation_rate_submit",null,["number","number","number","number","number"]),m=e.cwrap("zappar_pipeline_motion_attitude_submit",null,["number","number","number","number","number"]),b=e.cwrap("zappar_pipeline_motion_attitude_matrix_submit",null,["number","number"]),g=e.cwrap("zappar_camera_source_create","number",["number","string"]),w=e.cwrap("zappar_camera_source_destroy",null,["number"]),y=e.cwrap("zappar_sequence_source_create","number",["number"]),v=e.cwrap("zappar_sequence_source_destroy",null,["number"]),E=e.cwrap("zappar_image_tracker_create","number",["number"]),A=e.cwrap("zappar_image_tracker_destroy",null,["number"]),T=e.cwrap("zappar_image_tracker_target_load_from_memory",null,["number","number","number"]),R=e.cwrap("zappar_image_tracker_target_loaded_version","number",["number"]),x=e.cwrap("zappar_image_tracker_enabled","number",["number"]),k=e.cwrap("zappar_image_tracker_enabled_set",null,["number","number"]),L=e.cwrap("zappar_image_tracker_anchor_count","number",["number"]),F=e.cwrap("zappar_image_tracker_anchor_id","string",["number","number"]),z=e.cwrap("zappar_image_tracker_anchor_pose_raw","number",["number","number"]),M=e.cwrap("zappar_face_tracker_create","number",["number"]),I=e.cwrap("zappar_face_tracker_destroy",null,["number"]),P=e.cwrap("zappar_face_tracker_model_load_from_memory",null,["number","number","number"]),O=e.cwrap("zappar_face_tracker_model_loaded_version","number",["number"]),S=e.cwrap("zappar_face_tracker_enabled_set",null,["number","number"]),B=e.cwrap("zappar_face_tracker_enabled","number",["number"]),D=e.cwrap("zappar_face_tracker_max_faces_set",null,["number","number"]),C=e.cwrap("zappar_face_tracker_max_faces","number",["number"]),U=e.cwrap("zappar_face_tracker_anchor_count","number",["number"]),V=e.cwrap("zappar_face_tracker_anchor_id","string",["number","number"]),N=e.cwrap("zappar_face_tracker_anchor_pose_raw","number",["number","number"]),G=e.cwrap("zappar_face_tracker_anchor_identity_coefficients","number",["number","number"]),W=e.cwrap("zappar_face_tracker_anchor_expression_coefficients","number",["number","number"]),H=e.cwrap("zappar_face_mesh_create","number",[]),q=e.cwrap("zappar_face_mesh_destroy",null,["number"]),Y=e.cwrap("zappar_face_landmark_create","number",["number"]),X=e.cwrap("zappar_face_landmark_destroy",null,["number"]),Z=e.cwrap("zappar_barcode_finder_create","number",["number"]),j=e.cwrap("zappar_barcode_finder_destroy",null,["number"]),K=e.cwrap("zappar_barcode_finder_enabled_set",null,["number","number"]),J=e.cwrap("zappar_barcode_finder_enabled","number",["number"]),$=e.cwrap("zappar_barcode_finder_found_number","number",["number"]),Q=e.cwrap("zappar_barcode_finder_found_text","string",["number","number"]),ee=e.cwrap("zappar_barcode_finder_found_format","number",["number","number"]),te=e.cwrap("zappar_barcode_finder_formats","number",["number"]),re=e.cwrap("zappar_barcode_finder_formats_set",null,["number","number"]),ae=e.cwrap("zappar_instant_world_tracker_create","number",["number"]),ne=e.cwrap("zappar_instant_world_tracker_destroy",null,["number"]),ie=e.cwrap("zappar_instant_world_tracker_enabled_set",null,["number","number"]),oe=e.cwrap("zappar_instant_world_tracker_enabled","number",["number"]),se=e.cwrap("zappar_instant_world_tracker_anchor_pose_raw","number",["number"]),_e=e.cwrap("zappar_instant_world_tracker_anchor_pose_set_from_camera_offset_raw",null,["number","number","number","number","number"]),ce=32,fe=e._malloc(ce),ue=(e._malloc(64),new Map),le=(t,r)=>{let a=ue.get(t);return(!a||a[0]<r)&&(a&&e._free(a[1]),a=[r,e._malloc(r)],ue.set(t,a)),a[1]};return{log_level:()=>t(),log_level_set:e=>r(e),analytics_project_id_set:(e,t)=>a(e,t),pipeline_create:()=>n(),pipeline_destroy:()=>{i()},pipeline_frame_update:e=>o(e),pipeline_frame_number:e=>s(e),pipeline_camera_model:t=>{let r=_(t),a=new Float32Array(6);return a.set(e.HEAPF32.subarray(r/4,6+r/4)),r=a,r},pipeline_camera_frame_user_data:e=>c(e),pipeline_camera_frame_submit:(t,r,a,n,i,o,s,_)=>{ce<r.byteLength&&(e._free(fe),ce=r.byteLength,fe=e._malloc(ce));let c=fe,u=r.byteLength;e.HEAPU8.set(new Uint8Array(r),fe);let l=a,p=n,d=i,h=le(4,o.byteLength);e.HEAPF32.set(o,h/4);let m=le(5,s.byteLength);return e.HEAPF32.set(s,m/4),f(t,c,u,l,p,d,h,m,_?1:0)},pipeline_camera_frame_submit_raw_pointer:(t,r,a,n,i,o,s,_,c,f,l)=>{let p=r,d=a,h=n,m=i,b=o,g=s,w=le(6,_.byteLength);e.HEAPF32.set(_,w/4);let y=c,v=le(8,f.byteLength);return e.HEAPF32.set(f,v/4),u(t,p,d,h,m,b,g,w,y,v,l?1:0)},pipeline_camera_frame_camera_attitude:t=>{let r=l(t),a=new Float32Array(16);return a.set(e.HEAPF32.subarray(r/4,16+r/4)),r=a,r},pipeline_camera_frame_device_attitude:t=>{let r=p(t),a=new Float32Array(16);return a.set(e.HEAPF32.subarray(r/4,16+r/4)),r=a,r},pipeline_motion_accelerometer_submit:(e,t,r,a,n)=>d(e,t,r,a,n),pipeline_motion_rotation_rate_submit:(e,t,r,a,n)=>h(e,t,r,a,n),pipeline_motion_attitude_submit:(e,t,r,a,n)=>m(e,t,r,a,n),pipeline_motion_attitude_matrix_submit:(t,r)=>{let a=le(0,r.byteLength);return e.HEAPF32.set(r,a/4),b(t,a)},camera_source_create:(e,t)=>g(e,t),camera_source_destroy:()=>{w()},sequence_source_create:e=>y(e),sequence_source_destroy:()=>{v()},image_tracker_create:e=>E(e),image_tracker_destroy:()=>{A()},image_tracker_target_load_from_memory:(t,r)=>{ce<r.byteLength&&(e._free(fe),ce=r.byteLength,fe=e._malloc(ce));let a=fe,n=r.byteLength;return e.HEAPU8.set(new Uint8Array(r),fe),T(t,a,n)},image_tracker_target_loaded_version:e=>R(e),image_tracker_enabled:e=>{let t=x(e);return t=1===t,t},image_tracker_enabled_set:(e,t)=>k(e,t?1:0),image_tracker_anchor_count:e=>L(e),image_tracker_anchor_id:(e,t)=>F(e,t),image_tracker_anchor_pose_raw:(t,r)=>{let a=z(t,r),n=new Float32Array(16);return n.set(e.HEAPF32.subarray(a/4,16+a/4)),a=n,a},face_tracker_create:e=>M(e),face_tracker_destroy:()=>{I()},face_tracker_model_load_from_memory:(t,r)=>{ce<r.byteLength&&(e._free(fe),ce=r.byteLength,fe=e._malloc(ce));let a=fe,n=r.byteLength;return e.HEAPU8.set(new Uint8Array(r),fe),P(t,a,n)},face_tracker_model_loaded_version:e=>O(e),face_tracker_enabled_set:(e,t)=>S(e,t?1:0),face_tracker_enabled:e=>{let t=B(e);return t=1===t,t},face_tracker_max_faces_set:(e,t)=>D(e,t),face_tracker_max_faces:e=>C(e),face_tracker_anchor_count:e=>U(e),face_tracker_anchor_id:(e,t)=>V(e,t),face_tracker_anchor_pose_raw:(t,r)=>{let a=N(t,r),n=new Float32Array(16);return n.set(e.HEAPF32.subarray(a/4,16+a/4)),a=n,a},face_tracker_anchor_identity_coefficients:(t,r)=>{let a=G(t,r),n=new Float32Array(50);return n.set(e.HEAPF32.subarray(a/4,50+a/4)),a=n,a},face_tracker_anchor_expression_coefficients:(t,r)=>{let a=W(t,r),n=new Float32Array(29);return n.set(e.HEAPF32.subarray(a/4,29+a/4)),a=n,a},face_mesh_create:()=>H(),face_mesh_destroy:()=>{q()},face_landmark_create:e=>Y(e),face_landmark_destroy:()=>{X()},barcode_finder_create:e=>Z(e),barcode_finder_destroy:()=>{j()},barcode_finder_enabled_set:(e,t)=>K(e,t?1:0),barcode_finder_enabled:e=>{let t=J(e);return t=1===t,t},barcode_finder_found_number:e=>$(e),barcode_finder_found_text:(e,t)=>Q(e,t),barcode_finder_found_format:(e,t)=>ee(e,t),barcode_finder_formats:e=>te(e),barcode_finder_formats_set:(e,t)=>re(e,t),instant_world_tracker_create:e=>ae(e),instant_world_tracker_destroy:()=>{ne()},instant_world_tracker_enabled_set:(e,t)=>ie(e,t?1:0),instant_world_tracker_enabled:e=>{let t=oe(e);return t=1===t,t},instant_world_tracker_anchor_pose_raw:t=>{let r=se(t),a=new Float32Array(16);return a.set(e.HEAPF32.subarray(r/4,16+r/4)),r=a,r},instant_world_tracker_anchor_pose_set_from_camera_offset_raw:(e,t,r,a,n)=>_e(e,t,r,a,n)}}(t),r=new _(e,((e,t)=>{B.postOutgoingMessage({p:e,t:"zappar",d:t},[t])}));B.postOutgoingMessage("loaded",[]),B.onIncomingMessage.bind((a=>{var n;switch(a.t){case"zappar":r.processBuffer(a.d),B.postOutgoingMessage({t:"buf",d:a.d},[a.d]);break;case"buf":null===(n=r.serializersByPipelineId.get(a.p))||void 0===n||n.bufferReturn(a.d);break;case"cameraFrameC2S":{let t,n=a,i=r._pipeline_by_instance.get(n.p);i&&(e.pipeline_camera_frame_submit(i,n.d,n.width,n.height,n.token,n.c2d,n.cm,n.userFacing),e.pipeline_frame_update(i),t=e.pipeline_camera_frame_device_attitude(i),r.exploreState());let o={token:n.token,d:n.d,p:n.p,t:"cameraFrameRecycleS2C",att:t};B.postOutgoingMessage(o,[n.d]);break}case"streamC2S":{let n=a;!function(e,t,r,a,n,i,o){S(this,void 0,void 0,(function*(){const s=yield r.getReader();for(;;){let r=yield s.read();if(r.done)return void console.log("Stream done");let _=r.value,c=_.allocationSize();c>V&&(U>0&&e._free(U),U=e._malloc(c),V=c),yield _.copyTo(e.HEAPU8.subarray(U,U+V));let f=N;N++;const u=_.visibleRect.width,l=_.visibleRect.height;let p,d=u,h=l;switch(D){case 270:p=new Float32Array([0,1,0,0,-1,0,0,0,0,0,1,0,1,0,0,1]),d=l,h=u;break;case 180:p=new Float32Array([-1,0,0,0,0,-1,0,0,0,0,1,0,1,1,0,1]);break;case 90:p=new Float32Array([0,-1,0,0,1,0,0,0,0,0,1,0,0,1,0,1]),d=l,h=u;break;default:p=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}let m=_.clone();n?b.xJ(G,[-1,1,-1]):b.yR(G);let g=300*E.dataWidth/320;W[0]=g,W[1]=g,W[2]=.5*E.dataWidth,W[3]=.5*E.dataHeight;const w={token:f,d:m,p:a,t:"videoFrameS2C",userFacing:n,uvTransform:p,w:d,h,cameraToDevice:G,cameraModel:W,source:o};B.postOutgoingMessage(w,[w.d,w.uvTransform.buffer]);const y=i._pipeline_by_instance.get(a);y&&(t.pipeline_camera_frame_submit_raw_pointer(y,U,c,H(_.format),u,l,f,G,D,W,n),t.pipeline_frame_update(y),i.exploreState()),_.close()}}))}(t,e,n.s,n.p,n.userFacing,r,n.source);break}case"cameraToScreenC2S":D=a.r;break;case"imageBitmapC2S":!function(e,t,r,a){const[n,i]=function(){if(!M||!I){const e=new OffscreenCanvas(1,1);if(I=e.getContext("webgl"),!I)throw new Error("Unable to get offscreen GL context");M=new L(I)}return[M,I]}();if(z||(z=i.createTexture(),i.bindTexture(i.TEXTURE_2D,z),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,i.LINEAR)),!z)return;(!F||F.byteLength<E.dataWidth*E.dataHeight)&&(console.log("Generating pixel buffer",E.dataWidth*E.dataHeight),F=new ArrayBuffer(E.dataWidth*E.dataHeight)),n.uploadFrame(z,e.i,e.r,e.userFacing);let o=n.readFrame(z,F),s={t:"imageBitmapS2C",dataWidth:o.dataWidth,dataHeight:o.dataHeight,frame:e.i,userFacing:o.userFacing,uvTransform:o.uvTransform||b.Ue(),tokenId:e.tokenId,p:e.p};a.postOutgoingMessage(s,[e.i]);let _=r._pipeline_by_instance.get(e.p);_&&(t.pipeline_camera_frame_submit(_,F,o.dataWidth,o.dataHeight,e.tokenId,e.cameraToDevice,e.cameraModel,o.userFacing),t.pipeline_frame_update(_),r.exploreState())}(a,e,r,B)}}))}})}))}let U=0,V=0,N=1;const G=b.Ue(),W=new Float32Array([300,300,160,120,0,0]);function H(e){switch(e){case"I420":return h.FRAME_PIXEL_FORMAT_I420;case"I420A":return h.FRAME_PIXEL_FORMAT_I420A;case"I422":return h.FRAME_PIXEL_FORMAT_I422;case"I444":return h.FRAME_PIXEL_FORMAT_I444;case"NV12":return h.FRAME_PIXEL_FORMAT_NV12;case"RGBA":case"RGBX":return h.FRAME_PIXEL_FORMAT_RGBA;case"BGRA":case"BGRX":return h.FRAME_PIXEL_FORMAT_BGRA}return h.FRAME_PIXEL_FORMAT_Y}const q=self;B.onOutgoingMessage.bind((()=>{let e=B.getOutgoingMessages();for(let t of e)q.postMessage(t.msg,t.transferables)}));let Y=e=>{e&&e.data&&"wasm"===e.data.t&&(C(location.href.startsWith("blob")?e.data.url:new URL(r(751),r.b).toString()),q.removeEventListener("message",Y))};q.addEventListener("message",Y),q.addEventListener("message",(e=>{B.postIncomingMessage(e.data)}))},751:(e,t,r)=>{e.exports=r.p+"c85c7df8e3132b359723.wasm"}},a={};function n(e){var t=a[e];if(void 0!==t)return t.exports;var i=a[e]={exports:{}};return r[e].call(i.exports,i,i.exports,n),i.exports}return n.m=r,n.x=()=>{var e=n.O(void 0,[169],(()=>n(56)));return n.O(e)},n.amdO={},e=[],n.O=(t,r,a,i)=>{if(!r){var o=1/0;for(f=0;f<e.length;f++){for(var[r,a,i]=e[f],s=!0,_=0;_<r.length;_++)(!1&i||o>=i)&&Object.keys(n.O).every((e=>n.O[e](r[_])))?r.splice(_--,1):(s=!1,i<o&&(o=i));if(s){e.splice(f--,1);var c=a();void 0!==c&&(t=c)}}return t}i=i||0;for(var f=e.length;f>0&&e[f-1][2]>i;f--)e[f]=e[f-1];e[f]=[r,a,i]},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce(((t,r)=>(n.f[r](e,t),t)),[])),n.u=e=>e+".zappar-cv.js",n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e;n.g.importScripts&&(e=n.g.location+"");var t=n.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName("script");r.length&&(e=r[r.length-1].src)}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=e})(),(()=>{n.b=self.location+"";var e={56:1};n.f.i=(t,r)=>{e[t]||importScripts(n.p+n.u(t))};var t=self.webpackChunkZCV=self.webpackChunkZCV||[],r=t.push.bind(t);t.push=t=>{var[a,i,o]=t;for(var s in i)n.o(i,s)&&(n.m[s]=i[s]);for(o&&o(n);a.length;)e[a.pop()]=1;r(t)}})(),t=n.x,n.x=()=>n.e(169).then(t),n.x()})()}));
1
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.ZCV=t():e.ZCV=t()}(self,(function(){return(()=>{"use strict";var e,t,r={56:(e,t,r)=>{var a,n=(a="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0,function(e){var t,r,n;e=e||{},t||(t=void 0!==e?e:{}),t.ready=new Promise((function(e,t){r=e,n=t}));var i,o={};for(i in t)t.hasOwnProperty(i)&&(o[i]=t[i]);var s="./this.program";function _(e,t){throw t}var c,f="";f=self.location.href,a&&(f=a),f=0!==f.indexOf("blob:")?f.substr(0,f.lastIndexOf("/")+1):"",c=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)};var u,l,p=t.print||console.log.bind(console),d=t.printErr||console.warn.bind(console);for(i in o)o.hasOwnProperty(i)&&(t[i]=o[i]);o=null,t.thisProgram&&(s=t.thisProgram),t.quit&&(_=t.quit),t.wasmBinary&&(l=t.wasmBinary);var h=t.noExitRuntime||!0;"object"!=typeof WebAssembly&&j("no native wasm support detected");var m,b,g=!1;function w(e,t){e||j("Assertion failed: "+t)}function y(e){var r=t["_"+e];return w(r,"Cannot call unknown function "+e+", make sure it is exported"),r}var v,E,A,T,R,x,k,L,F,z="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function M(e,t,r){var a=t+r;for(r=t;e[r]&&!(r>=a);)++r;if(16<r-t&&e.subarray&&z)return z.decode(e.subarray(t,r));for(a="";t<r;){var n=e[t++];if(128&n){var i=63&e[t++];if(192==(224&n))a+=String.fromCharCode((31&n)<<6|i);else{var o=63&e[t++];65536>(n=224==(240&n)?(15&n)<<12|i<<6|o:(7&n)<<18|i<<12|o<<6|63&e[t++])?a+=String.fromCharCode(n):(n-=65536,a+=String.fromCharCode(55296|n>>10,56320|1023&n))}}else a+=String.fromCharCode(n)}return a}function I(e,t){return e?M(A,e,t):""}function O(e,t,r,a){if(!(0<a))return 0;var n=r;a=r+a-1;for(var i=0;i<e.length;++i){var o=e.charCodeAt(i);if(55296<=o&&57343>=o&&(o=65536+((1023&o)<<10)|1023&e.charCodeAt(++i)),127>=o){if(r>=a)break;t[r++]=o}else{if(2047>=o){if(r+1>=a)break;t[r++]=192|o>>6}else{if(65535>=o){if(r+2>=a)break;t[r++]=224|o>>12}else{if(r+3>=a)break;t[r++]=240|o>>18,t[r++]=128|o>>12&63}t[r++]=128|o>>6&63}t[r++]=128|63&o}}return t[r]=0,r-n}function P(e){for(var t=0,r=0;r<e.length;++r){var a=e.charCodeAt(r);55296<=a&&57343>=a&&(a=65536+((1023&a)<<10)|1023&e.charCodeAt(++r)),127>=a?++t:t=2047>=a?t+2:65535>=a?t+3:t+4}return t}function S(e){var t=P(e)+1,r=_r(t);return r&&O(e,E,r,t),r}function B(e,t){for(var r=0;r<e.length;++r)E[t++>>0]=e.charCodeAt(r);E[t>>0]=0}function C(){var e=m.buffer;v=e,t.HEAP8=E=new Int8Array(e),t.HEAP16=T=new Int16Array(e),t.HEAP32=x=new Int32Array(e),t.HEAPU8=A=new Uint8Array(e),t.HEAPU16=R=new Uint16Array(e),t.HEAPU32=k=new Uint32Array(e),t.HEAPF32=L=new Float32Array(e),t.HEAPF64=F=new Float64Array(e)}var D,U=[],V=[],N=[],G=[];function W(){var e=t.preRun.shift();U.unshift(e)}var H=0,q=null,Y=null;function X(){H++,t.monitorRunDependencies&&t.monitorRunDependencies(H)}function Z(){if(H--,t.monitorRunDependencies&&t.monitorRunDependencies(H),0==H&&(null!==q&&(clearInterval(q),q=null),Y)){var e=Y;Y=null,e()}}function j(e){throw t.onAbort&&t.onAbort(e),d(e),g=!0,b=1,e=new WebAssembly.RuntimeError("abort("+e+"). Build with -s ASSERTIONS=1 for more info."),n(e),e}t.preloadedImages={},t.preloadedAudios={};var K,J,$,Q="zappar-cv.wasm";if(String.prototype.startsWith?!Q.startsWith("data:application/octet-stream;base64,"):0!==Q.indexOf("data:application/octet-stream;base64,")){var ee=Q;Q=t.locateFile?t.locateFile(ee,f):f+ee}function te(e){for(;0<e.length;){var r=e.shift();if("function"==typeof r)r(t);else{var a=r.vd;"number"==typeof a?void 0===r.Oc?D.get(a)():D.get(a)(r.Oc):a(void 0===r.Oc?null:r.Oc)}}}function re(e,t){if(0===e)e=Date.now();else{if(1!==e&&4!==e)return x[fr()>>2]=28,-1;e=$()}return x[t>>2]=e/1e3|0,x[t+4>>2]=e%1e3*1e6|0,0}function ae(e){this.Hc=e-16,this.Md=function(e){x[this.Hc+8>>2]=e},this.Jd=function(e){x[this.Hc+0>>2]=e},this.Kd=function(){x[this.Hc+4>>2]=0},this.Id=function(){E[this.Hc+12>>0]=0},this.Ld=function(){E[this.Hc+13>>0]=0},this.yd=function(e,t){this.Md(e),this.Jd(t),this.Kd(),this.Id(),this.Ld()}}function ne(e,t){for(var r=0,a=e.length-1;0<=a;a--){var n=e[a];"."===n?e.splice(a,1):".."===n?(e.splice(a,1),r++):r&&(e.splice(a,1),r--)}if(t)for(;r;r--)e.unshift("..");return e}function ie(e){var t="/"===e.charAt(0),r="/"===e.substr(-1);return(e=ne(e.split("/").filter((function(e){return!!e})),!t).join("/"))||t||(e="."),e&&r&&(e+="/"),(t?"/":"")+e}function oe(e){var t=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1);return e=t[0],t=t[1],e||t?(t&&(t=t.substr(0,t.length-1)),e+t):"."}function se(e){if("/"===e)return"/";var t=(e=(e=ie(e)).replace(/\/$/,"")).lastIndexOf("/");return-1===t?e:e.substr(t+1)}function _e(){for(var e="",t=!1,r=arguments.length-1;-1<=r&&!t;r--){if("string"!=typeof(t=0<=r?arguments[r]:"/"))throw new TypeError("Arguments to path.resolve must be strings");if(!t)return"";e=t+"/"+e,t="/"===t.charAt(0)}return(t?"/":"")+(e=ne(e.split("/").filter((function(e){return!!e})),!t).join("/"))||"."}$=function(){return performance.now()};var ce=[];function fe(e,t){ce[e]={input:[],wc:[],Gc:t},Se(e,ue)}var ue={open:function(e){var t=ce[e.node.Lc];if(!t)throw new Ee(43);e.uc=t,e.seekable=!1},close:function(e){e.uc.Gc.flush(e.uc)},flush:function(e){e.uc.Gc.flush(e.uc)},read:function(e,t,r,a){if(!e.uc||!e.uc.Gc.hd)throw new Ee(60);for(var n=0,i=0;i<a;i++){try{var o=e.uc.Gc.hd(e.uc)}catch(e){throw new Ee(29)}if(void 0===o&&0===n)throw new Ee(6);if(null==o)break;n++,t[r+i]=o}return n&&(e.node.timestamp=Date.now()),n},write:function(e,t,r,a){if(!e.uc||!e.uc.Gc.$c)throw new Ee(60);try{for(var n=0;n<a;n++)e.uc.Gc.$c(e.uc,t[r+n])}catch(e){throw new Ee(29)}return a&&(e.node.timestamp=Date.now()),n}},le={hd:function(e){if(!e.input.length){var t=null;if("undefined"!=typeof window&&"function"==typeof window.prompt?null!==(t=window.prompt("Input: "))&&(t+="\n"):"function"==typeof readline&&null!==(t=readline())&&(t+="\n"),!t)return null;e.input=nr(t,!0)}return e.input.shift()},$c:function(e,t){null===t||10===t?(p(M(e.wc,0)),e.wc=[]):0!=t&&e.wc.push(t)},flush:function(e){e.wc&&0<e.wc.length&&(p(M(e.wc,0)),e.wc=[])}},pe={$c:function(e,t){null===t||10===t?(d(M(e.wc,0)),e.wc=[]):0!=t&&e.wc.push(t)},flush:function(e){e.wc&&0<e.wc.length&&(d(M(e.wc,0)),e.wc=[])}},de={zc:null,Bc:function(){return de.createNode(null,"/",16895,0)},createNode:function(e,t,r,a){if(24576==(61440&r)||4096==(61440&r))throw new Ee(63);return de.zc||(de.zc={dir:{node:{yc:de.qc.yc,Ac:de.qc.Ac,Jc:de.qc.Jc,Qc:de.qc.Qc,nd:de.qc.nd,Wc:de.qc.Wc,od:de.qc.od,Rc:de.qc.Rc,Sc:de.qc.Sc},stream:{Ec:de.sc.Ec}},file:{node:{yc:de.qc.yc,Ac:de.qc.Ac},stream:{Ec:de.sc.Ec,read:de.sc.read,write:de.sc.write,cd:de.sc.cd,jd:de.sc.jd,ld:de.sc.ld}},link:{node:{yc:de.qc.yc,Ac:de.qc.Ac,Mc:de.qc.Mc},stream:{}},dd:{node:{yc:de.qc.yc,Ac:de.qc.Ac},stream:Pe}}),16384==(61440&(r=Le(e,t,r,a)).mode)?(r.qc=de.zc.dir.node,r.sc=de.zc.dir.stream,r.rc={}):32768==(61440&r.mode)?(r.qc=de.zc.file.node,r.sc=de.zc.file.stream,r.tc=0,r.rc=null):40960==(61440&r.mode)?(r.qc=de.zc.link.node,r.sc=de.zc.link.stream):8192==(61440&r.mode)&&(r.qc=de.zc.dd.node,r.sc=de.zc.dd.stream),r.timestamp=Date.now(),e&&(e.rc[t]=r,e.timestamp=r.timestamp),r},Yd:function(e){return e.rc?e.rc.subarray?e.rc.subarray(0,e.tc):new Uint8Array(e.rc):new Uint8Array(0)},ed:function(e,t){var r=e.rc?e.rc.length:0;r>=t||(t=Math.max(t,r*(1048576>r?2:1.125)>>>0),0!=r&&(t=Math.max(t,256)),r=e.rc,e.rc=new Uint8Array(t),0<e.tc&&e.rc.set(r.subarray(0,e.tc),0))},Gd:function(e,t){if(e.tc!=t)if(0==t)e.rc=null,e.tc=0;else{var r=e.rc;e.rc=new Uint8Array(t),r&&e.rc.set(r.subarray(0,Math.min(t,e.tc))),e.tc=t}},qc:{yc:function(e){var t={};return t.td=8192==(61440&e.mode)?e.id:1,t.Zc=e.id,t.mode=e.mode,t.Ed=1,t.uid=0,t.wd=0,t.Lc=e.Lc,16384==(61440&e.mode)?t.size=4096:32768==(61440&e.mode)?t.size=e.tc:40960==(61440&e.mode)?t.size=e.link.length:t.size=0,t.pd=new Date(e.timestamp),t.Dd=new Date(e.timestamp),t.sd=new Date(e.timestamp),t.qd=4096,t.rd=Math.ceil(t.size/t.qd),t},Ac:function(e,t){void 0!==t.mode&&(e.mode=t.mode),void 0!==t.timestamp&&(e.timestamp=t.timestamp),void 0!==t.size&&de.Gd(e,t.size)},Jc:function(){throw Ae[44]},Qc:function(e,t,r,a){return de.createNode(e,t,r,a)},nd:function(e,t,r){if(16384==(61440&e.mode)){try{var a=ke(t,r)}catch(e){}if(a)for(var n in a.rc)throw new Ee(55)}delete e.parent.rc[e.name],e.parent.timestamp=Date.now(),e.name=r,t.rc[r]=e,t.timestamp=e.parent.timestamp,e.parent=t},Wc:function(e,t){delete e.rc[t],e.timestamp=Date.now()},od:function(e,t){var r,a=ke(e,t);for(r in a.rc)throw new Ee(55);delete e.rc[t],e.timestamp=Date.now()},Rc:function(e){var t,r=[".",".."];for(t in e.rc)e.rc.hasOwnProperty(t)&&r.push(t);return r},Sc:function(e,t,r){return(e=de.createNode(e,t,41471,0)).link=r,e},Mc:function(e){if(40960!=(61440&e.mode))throw new Ee(28);return e.link}},sc:{read:function(e,t,r,a,n){var i=e.node.rc;if(n>=e.node.tc)return 0;if(8<(e=Math.min(e.node.tc-n,a))&&i.subarray)t.set(i.subarray(n,n+e),r);else for(a=0;a<e;a++)t[r+a]=i[n+a];return e},write:function(e,t,r,a,n,i){if(t.buffer===E.buffer&&(i=!1),!a)return 0;if((e=e.node).timestamp=Date.now(),t.subarray&&(!e.rc||e.rc.subarray)){if(i)return e.rc=t.subarray(r,r+a),e.tc=a;if(0===e.tc&&0===n)return e.rc=t.slice(r,r+a),e.tc=a;if(n+a<=e.tc)return e.rc.set(t.subarray(r,r+a),n),a}if(de.ed(e,n+a),e.rc.subarray&&t.subarray)e.rc.set(t.subarray(r,r+a),n);else for(i=0;i<a;i++)e.rc[n+i]=t[r+i];return e.tc=Math.max(e.tc,n+a),a},Ec:function(e,t,r){if(1===r?t+=e.position:2===r&&32768==(61440&e.node.mode)&&(t+=e.node.tc),0>t)throw new Ee(28);return t},cd:function(e,t,r){de.ed(e.node,t+r),e.node.tc=Math.max(e.node.tc,t+r)},jd:function(e,t,r,a,n,i){if(0!==t)throw new Ee(28);if(32768!=(61440&e.node.mode))throw new Ee(43);if(e=e.node.rc,2&i||e.buffer!==v){for((0<a||a+r<e.length)&&(e=e.subarray?e.subarray(a,a+r):Array.prototype.slice.call(e,a,a+r)),a=!0,i=16384*Math.ceil(r/16384),t=_r(i);r<i;)E[t+r++]=0;if(!(r=t))throw new Ee(48);E.set(e,r)}else a=!1,r=e.byteOffset;return{Hc:r,Ud:a}},ld:function(e,t,r,a,n){if(32768!=(61440&e.node.mode))throw new Ee(43);return 2&n||de.sc.write(e,t,0,a,r,!1),0}}},he=null,me={},be=[],ge=1,we=null,ye=!0,ve={},Ee=null,Ae={};function Te(e,t){if(t=t||{},!(e=_e("/",e)))return{path:"",node:null};var r,a={fd:!0,ad:0};for(r in a)void 0===t[r]&&(t[r]=a[r]);if(8<t.ad)throw new Ee(32);e=ne(e.split("/").filter((function(e){return!!e})),!1);var n=he;for(a="/",r=0;r<e.length;r++){var i=r===e.length-1;if(i&&t.parent)break;if(n=ke(n,e[r]),a=ie(a+"/"+e[r]),n.Kc&&(!i||i&&t.fd)&&(n=n.Kc.root),!i||t.Pc)for(i=0;40960==(61440&n.mode);)if(n=Ne(a),n=Te(a=_e(oe(a),n),{ad:t.ad}).node,40<i++)throw new Ee(32)}return{path:a,node:n}}function Re(e){for(var t;;){if(e===e.parent)return e=e.Bc.kd,t?"/"!==e[e.length-1]?e+"/"+t:e+t:e;t=t?e.name+"/"+t:e.name,e=e.parent}}function xe(e,t){for(var r=0,a=0;a<t.length;a++)r=(r<<5)-r+t.charCodeAt(a)|0;return(e+r>>>0)%we.length}function ke(e,t){var r;if(r=(r=Me(e,"x"))?r:e.qc.Jc?0:2)throw new Ee(r,e);for(r=we[xe(e.id,t)];r;r=r.Fc){var a=r.name;if(r.parent.id===e.id&&a===t)return r}return e.qc.Jc(e,t)}function Le(e,t,r,a){return t=xe((e=new ar(e,t,r,a)).parent.id,e.name),e.Fc=we[t],we[t]=e}var Fe={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090};function ze(e){var t=["r","w","rw"][3&e];return 512&e&&(t+="w"),t}function Me(e,t){return ye||(-1===t.indexOf("r")||292&e.mode)&&(-1===t.indexOf("w")||146&e.mode)&&(-1===t.indexOf("x")||73&e.mode)?0:2}function Ie(e,t){try{return ke(e,t),20}catch(e){}return Me(e,"wx")}var Oe,Pe={open:function(e){e.sc=me[e.node.Lc].sc,e.sc.open&&e.sc.open(e)},Ec:function(){throw new Ee(70)}};function Se(e,t){me[e]={sc:t}}function Be(e,t){var r="/"===t,a=!t;if(r&&he)throw new Ee(10);if(!r&&!a){var n=Te(t,{fd:!1});if(t=n.path,(n=n.node).Kc)throw new Ee(10);if(16384!=(61440&n.mode))throw new Ee(54)}t={type:e,be:{},kd:t,Cd:[]},(e=e.Bc(t)).Bc=t,t.root=e,r?he=e:n&&(n.Kc=t,n.Bc&&n.Bc.Cd.push(t))}function Ce(e,t,r){var a=Te(e,{parent:!0}).node;if(!(e=se(e))||"."===e||".."===e)throw new Ee(28);var n=Ie(a,e);if(n)throw new Ee(n);if(!a.qc.Qc)throw new Ee(63);return a.qc.Qc(a,e,t,r)}function De(e){return Ce(e,16895,0)}function Ue(e,t,r){void 0===r&&(r=t,t=438),Ce(e,8192|t,r)}function Ve(e,t){if(!_e(e))throw new Ee(44);var r=Te(t,{parent:!0}).node;if(!r)throw new Ee(44);var a=Ie(r,t=se(t));if(a)throw new Ee(a);if(!r.qc.Sc)throw new Ee(63);r.qc.Sc(r,t,e)}function Ne(e){if(!(e=Te(e).node))throw new Ee(44);if(!e.qc.Mc)throw new Ee(28);return _e(Re(e.parent),e.qc.Mc(e))}function Ge(e,t){if(!(e=Te(e,{Pc:!t}).node))throw new Ee(44);if(!e.qc.yc)throw new Ee(63);return e.qc.yc(e)}function We(e){return Ge(e,!0)}function He(e,r,a,n){if(""===e)throw new Ee(44);if("string"==typeof r){var i=Fe[r];if(void 0===i)throw Error("Unknown file open mode: "+r);r=i}if(a=64&r?4095&(void 0===a?438:a)|32768:0,"object"==typeof e)var o=e;else{e=ie(e);try{o=Te(e,{Pc:!(131072&r)}).node}catch(e){}}if(i=!1,64&r)if(o){if(128&r)throw new Ee(20)}else o=Ce(e,a,0),i=!0;if(!o)throw new Ee(44);if(8192==(61440&o.mode)&&(r&=-513),65536&r&&16384!=(61440&o.mode))throw new Ee(54);if(!i&&(a=o?40960==(61440&o.mode)?32:16384==(61440&o.mode)&&("r"!==ze(r)||512&r)?31:Me(o,ze(r)):44))throw new Ee(a);if(512&r){if(!(a="string"==typeof(a=o)?Te(a,{Pc:!0}).node:a).qc.Ac)throw new Ee(63);if(16384==(61440&a.mode))throw new Ee(31);if(32768!=(61440&a.mode))throw new Ee(28);if(i=Me(a,"w"))throw new Ee(i);a.qc.Ac(a,{size:0,timestamp:Date.now()})}r&=-131713,(n=function(e,t){je||((je=function(){}).prototype={});var r,a=new je;for(r in e)a[r]=e[r];return e=a,t=function(e){for(e=e||0;e<=4096;e++)if(!be[e])return e;throw new Ee(33)}(t),e.Cc=t,be[t]=e}({node:o,path:Re(o),flags:r,seekable:!0,position:0,sc:o.sc,Rd:[],error:!1},n)).sc.open&&n.sc.open(n),!t.logReadFiles||1&r||(Ke||(Ke={}),e in Ke||(Ke[e]=1,d("FS.trackingDelegate error on read file: "+e)));try{ve.onOpenFile&&(o=0,1!=(2097155&r)&&(o|=1),0!=(2097155&r)&&(o|=2),ve.onOpenFile(e,o))}catch(t){d("FS.trackingDelegate['onOpenFile']('"+e+"', flags) threw an exception: "+t.message)}return n}function qe(e,t,r){if(null===e.Cc)throw new Ee(8);if(!e.seekable||!e.sc.Ec)throw new Ee(70);if(0!=r&&1!=r&&2!=r)throw new Ee(28);return e.position=e.sc.Ec(e,t,r),e.Rd=[],e.position}function Ye(){Ee||((Ee=function(e,t){this.node=t,this.Hd=function(e){this.vc=e},this.Hd(e),this.message="FS error"}).prototype=Error(),Ee.prototype.constructor=Ee,[44].forEach((function(e){Ae[e]=new Ee(e),Ae[e].stack="<generic error, no stack>"})))}function Xe(e,t,r){e=ie("/dev/"+e);var a=function(e,t){var r=0;return e&&(r|=365),t&&(r|=146),r}(!!t,!!r);Ze||(Ze=64);var n=Ze++<<8|0;Se(n,{open:function(e){e.seekable=!1},close:function(){r&&r.buffer&&r.buffer.length&&r(10)},read:function(e,r,a,n){for(var i=0,o=0;o<n;o++){try{var s=t()}catch(e){throw new Ee(29)}if(void 0===s&&0===i)throw new Ee(6);if(null==s)break;i++,r[a+o]=s}return i&&(e.node.timestamp=Date.now()),i},write:function(e,t,a,n){for(var i=0;i<n;i++)try{r(t[a+i])}catch(e){throw new Ee(29)}return n&&(e.node.timestamp=Date.now()),i}}),Ue(e,a,n)}var Ze,je,Ke,Je={};function $e(e,t,r){try{var a=e(t)}catch(e){if(e&&e.node&&ie(t)!==ie(Re(e.node)))return-54;throw e}return x[r>>2]=a.td,x[r+4>>2]=0,x[r+8>>2]=a.Zc,x[r+12>>2]=a.mode,x[r+16>>2]=a.Ed,x[r+20>>2]=a.uid,x[r+24>>2]=a.wd,x[r+28>>2]=a.Lc,x[r+32>>2]=0,J=[a.size>>>0,(K=a.size,1<=+Math.abs(K)?0<K?(0|Math.min(+Math.floor(K/4294967296),4294967295))>>>0:~~+Math.ceil((K-+(~~K>>>0))/4294967296)>>>0:0)],x[r+40>>2]=J[0],x[r+44>>2]=J[1],x[r+48>>2]=4096,x[r+52>>2]=a.rd,x[r+56>>2]=a.pd.getTime()/1e3|0,x[r+60>>2]=0,x[r+64>>2]=a.Dd.getTime()/1e3|0,x[r+68>>2]=0,x[r+72>>2]=a.sd.getTime()/1e3|0,x[r+76>>2]=0,J=[a.Zc>>>0,(K=a.Zc,1<=+Math.abs(K)?0<K?(0|Math.min(+Math.floor(K/4294967296),4294967295))>>>0:~~+Math.ceil((K-+(~~K>>>0))/4294967296)>>>0:0)],x[r+80>>2]=J[0],x[r+84>>2]=J[1],0}var Qe=void 0;function et(){return x[(Qe+=4)-4>>2]}function tt(e){if(!(e=be[e]))throw new Ee(8);return e}function rt(e){try{e()}catch(e){if(!(e instanceof br)&&"unwind"!==e)throw e&&"object"==typeof e&&e.stack&&d("exception thrown: "+[e,e.stack]),e}}var at,nt,it,ot=!1,st=null,_t=0,ct=null,ft=0,ut=0,lt=0,pt=[],dt={},ht=!1,mt=!1,bt=[];function gt(e,r,a,n){if(r&&t.Yc&&e==t.canvas)return t.Yc;var i;if(r){var o={antialias:!1,alpha:!1,Bd:1};if(n)for(var s in n)o[s]=n[s];if(void 0!==Kt&&(i=function(e,t){e.gd||(e.gd=e.getContext,e.getContext=function(t,r){return"webgl"==t==(r=e.gd(t,r))instanceof WebGLRenderingContext?r:null});var r=e.getContext("webgl",t);return r?function(e,t){var r=Yt(qt),a={Zd:r,attributes:t,version:t.Bd,Xc:e};return e.canvas&&(e.canvas.Td=a),qt[r]=a,(void 0===t.ud||t.ud)&&function(e){if(e||(e=Zt),!e.zd){e.zd=!0;var t=e.Xc;!function(e){var t=e.getExtension("ANGLE_instanced_arrays");t&&(e.vertexAttribDivisor=function(e,r){t.vertexAttribDivisorANGLE(e,r)},e.drawArraysInstanced=function(e,r,a,n){t.drawArraysInstancedANGLE(e,r,a,n)},e.drawElementsInstanced=function(e,r,a,n,i){t.drawElementsInstancedANGLE(e,r,a,n,i)})}(t),function(e){var t=e.getExtension("OES_vertex_array_object");t&&(e.createVertexArray=function(){return t.createVertexArrayOES()},e.deleteVertexArray=function(e){t.deleteVertexArrayOES(e)},e.bindVertexArray=function(e){t.bindVertexArrayOES(e)},e.isVertexArray=function(e){return t.isVertexArrayOES(e)})}(t),function(e){var t=e.getExtension("WEBGL_draw_buffers");t&&(e.drawBuffers=function(e,r){t.drawBuffersWEBGL(e,r)})}(t),t.Wd=t.getExtension("EXT_disjoint_timer_query"),t.$d=t.getExtension("WEBGL_multi_draw"),(t.getSupportedExtensions()||[]).forEach((function(e){0>e.indexOf("lose_context")&&0>e.indexOf("debug")&&t.getExtension(e)}))}}(a),r}(r,t):0}(e,o)))var _=qt[i].Xc}else _=e.getContext("2d");return _?(a&&(r||w(void 0===Qt,"cannot set in module if GLctx is used, but we are a non-GL context that would replace it"),t.Yc=_,r&&(Zt=qt[i],t.Yc=Qt=Zt&&Zt.Xc),t.ee=r,bt.forEach((function(e){e()})),function(){function e(){mt=document.pointerLockElement===t.canvas||document.mozPointerLockElement===t.canvas||document.webkitPointerLockElement===t.canvas||document.msPointerLockElement===t.canvas}if(t.preloadPlugins||(t.preloadPlugins=[]),!kt){kt=!0;try{Lt=!0}catch(e){Lt=!1,console.log("warning: no blob constructor, cannot create blobs with mimetypes")}Ft="undefined"!=typeof MozBlobBuilder?MozBlobBuilder:"undefined"!=typeof WebKitBlobBuilder?WebKitBlobBuilder:Lt?null:console.log("warning: no BlobBuilder"),zt="undefined"!=typeof window?window.URL?window.URL:window.webkitURL:void 0,t.md||void 0!==zt||(console.log("warning: Browser does not support creating object URLs. Built-in browser image decoding will not be available."),t.md=!0),t.preloadPlugins.push({canHandle:function(e){return!t.md&&/\.(jpg|jpeg|png|bmp)$/i.test(e)},handle:function(e,r,a,n){var i=null;if(Lt)try{(i=new Blob([e],{type:xt(r)})).size!==e.length&&(i=new Blob([new Uint8Array(e).buffer],{type:xt(r)}))}catch(e){!function(e){u||(u={}),u[e]||(u[e]=1,d(e))}("Blob constructor present but fails: "+e+"; falling back to blob builder")}i||((i=new Ft).append(new Uint8Array(e).buffer),i=i.getBlob());var o=zt.createObjectURL(i),s=new Image;s.onload=function(){w(s.complete,"Image "+r+" could not be decoded");var n=document.createElement("canvas");n.width=s.width,n.height=s.height,n.getContext("2d").drawImage(s,0,0),t.preloadedImages[r]=n,zt.revokeObjectURL(o),a&&a(e)},s.onerror=function(){console.log("Image "+o+" could not be decoded"),n&&n()},s.src=o}}),t.preloadPlugins.push({canHandle:function(e){return!t.ae&&e.substr(-4)in{".ogg":1,".wav":1,".mp3":1}},handle:function(e,r,a,n){function i(n){s||(s=!0,t.preloadedAudios[r]=n,a&&a(e))}function o(){s||(s=!0,t.preloadedAudios[r]=new Audio,n&&n())}var s=!1;if(!Lt)return o();try{var _=new Blob([e],{type:xt(r)})}catch(e){return o()}_=zt.createObjectURL(_);var c=new Audio;c.addEventListener("canplaythrough",(function(){i(c)}),!1),c.onerror=function(){if(!s){console.log("warning: browser could not fully decode audio "+r+", trying slower base64 approach");for(var t="",a=0,n=0,o=0;o<e.length;o++)for(a=a<<8|e[o],n+=8;6<=n;){var _=a>>n-6&63;n-=6,t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[_]}2==n?(t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(3&a)<<4],t+="=="):4==n&&(t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(15&a)<<2],t+="="),c.src="data:audio/x-"+r.substr(-3)+";base64,"+t,i(c)}},c.src=_,Rt((function(){i(c)}),1e4)}});var r=t.canvas;r&&(r.requestPointerLock=r.requestPointerLock||r.mozRequestPointerLock||r.webkitRequestPointerLock||r.msRequestPointerLock||function(){},r.exitPointerLock=document.exitPointerLock||document.mozExitPointerLock||document.webkitExitPointerLock||document.msExitPointerLock||function(){},r.exitPointerLock=r.exitPointerLock.bind(document),document.addEventListener("pointerlockchange",e,!1),document.addEventListener("mozpointerlockchange",e,!1),document.addEventListener("webkitpointerlockchange",e,!1),document.addEventListener("mspointerlockchange",e,!1),t.elementPointerLock&&r.addEventListener("click",(function(e){!mt&&t.canvas.requestPointerLock&&(t.canvas.requestPointerLock(),e.preventDefault())}),!1))}}()),_):null}var wt=!1,yt=void 0,vt=void 0;function Et(){return!!ht&&((document.exitFullscreen||document.cancelFullScreen||document.mozCancelFullScreen||document.msExitFullscreen||document.webkitCancelFullScreen||function(){}).apply(document,[]),!0)}var At=0;function Tt(e){if("function"==typeof requestAnimationFrame)requestAnimationFrame(e);else{var t=Date.now();if(0===At)At=t+1e3/60;else for(;t+2>=At;)At+=1e3/60;setTimeout(e,Math.max(At-t,0))}}function Rt(e,t){setTimeout((function(){rt(e)}),t)}function xt(e){return{jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",bmp:"image/bmp",ogg:"audio/ogg",wav:"audio/wav",mp3:"audio/mpeg"}[e.substr(e.lastIndexOf(".")+1)]}var kt,Lt,Ft,zt,Mt=[];function It(){var e=t.canvas;Mt.forEach((function(t){t(e.width,e.height)}))}function Ot(e,r,a){r&&a?(e.Sd=r,e.xd=a):(r=e.Sd,a=e.xd);var n=r,i=a;if(t.forcedAspectRatio&&0<t.forcedAspectRatio&&(n/i<t.forcedAspectRatio?n=Math.round(i*t.forcedAspectRatio):i=Math.round(n/t.forcedAspectRatio)),(document.fullscreenElement||document.mozFullScreenElement||document.msFullscreenElement||document.webkitFullscreenElement||document.webkitCurrentFullScreenElement)===e.parentNode&&"undefined"!=typeof screen){var o=Math.min(screen.width/n,screen.height/i);n=Math.round(n*o),i=Math.round(i*o)}vt?(e.width!=n&&(e.width=n),e.height!=i&&(e.height=i),void 0!==e.style&&(e.style.removeProperty("width"),e.style.removeProperty("height"))):(e.width!=r&&(e.width=r),e.height!=a&&(e.height=a),void 0!==e.style&&(n!=r||i!=a?(e.style.setProperty("width",n+"px","important"),e.style.setProperty("height",i+"px","important")):(e.style.removeProperty("width"),e.style.removeProperty("height"))))}function Pt(){return!1}t._emscripten_is_main_browser_thread=Pt;var St,Bt=[];function Ct(e,t){k[e>>2]=t,k[e+4>>2]=t/4294967296|0}function Dt(e,t,r,a,n){function i(t){var r=0,a=0;t&&(a=y.response?y.response.byteLength:0,r=_r(a),A.set(new Uint8Array(y.response),r)),k[e+12>>2]=r,Ct(e+16,a)}var o=k[e+8>>2];if(o){var s=I(o),_=e+112,c=I(_);c||(c="GET");var f=k[_+52>>2],u=k[_+56>>2],l=!!k[_+60>>2],p=k[_+68>>2],d=k[_+72>>2];o=k[_+76>>2];var h=k[_+80>>2],m=k[_+84>>2];_=k[_+88>>2];var b=!!(1&f),g=!!(2&f);f=!!(64&f),p=p?I(p):void 0,d=d?I(d):void 0;var w=h?I(h):void 0,y=new XMLHttpRequest;if(y.withCredentials=l,y.open(c,s,!f,p,d),f||(y.timeout=u),y.ce=s,y.responseType="arraybuffer",h&&y.overrideMimeType(w),o)for(;(c=k[o>>2])&&(s=k[o+4>>2]);)o+=8,c=I(c),s=I(s),y.setRequestHeader(c,s);Bt.push(y),k[e+0>>2]=Bt.length,o=m&&_?A.slice(m,m+_):null,y.onload=function(a){i(b&&!g);var n=y.response?y.response.byteLength:0;Ct(e+24,0),n&&Ct(e+32,n),R[e+40>>1]=y.readyState,R[e+42>>1]=y.status,y.statusText&&O(y.statusText,A,e+44,64),200<=y.status&&300>y.status?t&&t(e,y,a):r&&r(e,y,a)},y.onerror=function(t){i(b);var a=y.status;Ct(e+24,0),Ct(e+32,y.response?y.response.byteLength:0),R[e+40>>1]=y.readyState,R[e+42>>1]=a,r&&r(e,y,t)},y.ontimeout=function(t){r&&r(e,y,t)},y.onprogress=function(t){var r=b&&g&&y.response?y.response.byteLength:0,n=0;b&&g&&(n=_r(r),A.set(new Uint8Array(y.response),n)),k[e+12>>2]=n,Ct(e+16,r),Ct(e+24,t.loaded-r),Ct(e+32,t.total),R[e+40>>1]=y.readyState,3<=y.readyState&&0===y.status&&0<t.loaded&&(y.status=200),R[e+42>>1]=y.status,y.statusText&&O(y.statusText,A,e+44,64),a&&a(e,y,t),n&&sr(n)},y.onreadystatechange=function(t){R[e+40>>1]=y.readyState,2<=y.readyState&&(R[e+42>>1]=y.status),n&&n(e,y,t)};try{y.send(o)}catch(t){r&&r(e,y,t)}}else r(e,0,"no url specified!")}function Ut(e,t,r,a){var n=St;if(n){var i=k[e+112+64>>2];i||(i=k[e+8>>2]);var o=I(i);try{var s=n.transaction(["FILES"],"readwrite").objectStore("FILES").put(t,o);s.onsuccess=function(){R[e+40>>1]=4,R[e+42>>1]=200,O("OK",A,e+44,64),r(e,0,o)},s.onerror=function(t){R[e+40>>1]=4,R[e+42>>1]=413,O("Payload Too Large",A,e+44,64),a(e,0,t)}}catch(t){a(e,0,t)}}else a(e,0,"IndexedDB not available!")}var Vt,Nt={};function Gt(){if(!Vt){var e,t={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:s||"./this.program"};for(e in Nt)t[e]=Nt[e];var r=[];for(e in t)r.push(e+"="+t[e]);Vt=r}return Vt}var Wt=1,Ht=[],qt=[];function Yt(e){for(var t=Wt++,r=e.length;r<t;r++)e[r]=null;return t}var Xt,Zt,jt,Kt={};function Jt(e){return 0==e%4&&(0!=e%100||0==e%400)}function $t(e,t){for(var r=0,a=0;a<=t;r+=e[a++]);return r}var Qt,er=[31,29,31,30,31,30,31,31,30,31,30,31],tr=[31,28,31,30,31,30,31,31,30,31,30,31];function rr(e,t){for(e=new Date(e.getTime());0<t;){var r=e.getMonth(),a=(Jt(e.getFullYear())?er:tr)[r];if(!(t>a-e.getDate())){e.setDate(e.getDate()+t);break}t-=a-e.getDate()+1,e.setDate(1),11>r?e.setMonth(r+1):(e.setMonth(0),e.setFullYear(e.getFullYear()+1))}return e}function ar(e,t,r,a){e||(e=this),this.parent=e,this.Bc=e.Bc,this.Kc=null,this.id=ge++,this.name=t,this.mode=r,this.qc={},this.sc={},this.Lc=a}function nr(e,t){var r=Array(P(e)+1);return e=O(e,r,0,r.length),t&&(r.length=e),r}Object.defineProperties(ar.prototype,{read:{get:function(){return 365==(365&this.mode)},set:function(e){e?this.mode|=365:this.mode&=-366}},write:{get:function(){return 146==(146&this.mode)},set:function(e){e?this.mode|=146:this.mode&=-147}}}),Ye(),we=Array(4096),Be(de,"/"),De("/tmp"),De("/home"),De("/home/web_user"),function(){De("/dev"),Se(259,{read:function(){return 0},write:function(e,t,r,a){return a}}),Ue("/dev/null",259),fe(1280,le),fe(1536,pe),Ue("/dev/tty",1280),Ue("/dev/tty1",1536);var e=function(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var e=new Uint8Array(1);return function(){return crypto.getRandomValues(e),e[0]}}return function(){j("randomDevice")}}();Xe("random",e),Xe("urandom",e),De("/dev/shm"),De("/dev/shm/tmp")}(),function(){De("/proc");var e=De("/proc/self");De("/proc/self/fd"),Be({Bc:function(){var t=Le(e,"fd",16895,73);return t.qc={Jc:function(e,t){var r=be[+t];if(!r)throw new Ee(8);return(e={parent:null,Bc:{kd:"fake"},qc:{Mc:function(){return r.path}}}).parent=e}},t}},"/proc/self/fd")}(),t.requestFullscreen=function(e,r){!function(e,r){function a(){ht=!1;var e=n.parentNode;(document.fullscreenElement||document.mozFullScreenElement||document.msFullscreenElement||document.webkitFullscreenElement||document.webkitCurrentFullScreenElement)===e?(n.exitFullscreen=Et,yt&&n.requestPointerLock(),ht=!0,vt?("undefined"!=typeof SDL&&(x[SDL.screen>>2]=8388608|k[SDL.screen>>2]),Ot(t.canvas),It()):Ot(n)):(e.parentNode.insertBefore(n,e),e.parentNode.removeChild(e),vt?("undefined"!=typeof SDL&&(x[SDL.screen>>2]=-8388609&k[SDL.screen>>2]),Ot(t.canvas),It()):Ot(n)),t.onFullScreen&&t.onFullScreen(ht),t.onFullscreen&&t.onFullscreen(ht)}void 0===(yt=e)&&(yt=!0),void 0===(vt=r)&&(vt=!1);var n=t.canvas;wt||(wt=!0,document.addEventListener("fullscreenchange",a,!1),document.addEventListener("mozfullscreenchange",a,!1),document.addEventListener("webkitfullscreenchange",a,!1),document.addEventListener("MSFullscreenChange",a,!1));var i=document.createElement("div");n.parentNode.insertBefore(i,n),i.appendChild(n),i.requestFullscreen=i.requestFullscreen||i.mozRequestFullScreen||i.msRequestFullscreen||(i.webkitRequestFullscreen?function(){i.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT)}:null)||(i.webkitRequestFullScreen?function(){i.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT)}:null),i.requestFullscreen()}(e,r)},t.requestAnimationFrame=function(e){Tt(e)},t.setCanvasSize=function(e,r,a){Ot(t.canvas,e,r),a||It()},t.pauseMainLoop=function(){st=null,_t++},t.resumeMainLoop=function(){_t++;var e=ft,r=ut,a=ct;ct=null,function(e){function r(){if(a<_t){if(!h)try{wr(b)}catch(e){if(!(e instanceof br))throw e}return!1}return!0}w(!ct,"emscripten_set_main_loop: there can only be one main loop function at once: call emscripten_cancel_main_loop to cancel the previous one before setting a new one with different parameters."),ct=e;var a=_t;ot=!1,nt=function(){if(!g)if(0<pt.length){var a=Date.now(),n=pt.shift();if(n.vd(n.Oc),it){var i=it,o=0==i%1?i-1:Math.floor(i);it=n.Vd?o:(8*i+(o+.5))/9}console.log('main loop blocker "'+n.name+'" took '+(Date.now()-a)+" ms"),t.setStatus&&(a=t.statusMessage||"Please wait...",i=dt.Xd,(n=it)?n<i?t.setStatus(a+" ("+(i-n)+"/"+i+")"):t.setStatus(a):t.setStatus("")),r()&&setTimeout(nt,0)}else r()&&(lt=lt+1|0,1==ft&&1<ut&&0!=lt%ut?st():(0==ft&&(at=$()),g||t.preMainLoop&&!1===t.preMainLoop()||(rt(e),t.postMainLoop&&t.postMainLoop()),r()&&("object"==typeof SDL&&SDL.audio&&SDL.audio.Fd&&SDL.audio.Fd(),st())))}}(a),function(e,r){if(ft=e,ut=r,ct)if(ot||(ot=!0),0==e)st=function(){var e=0|Math.max(0,at+r-$());setTimeout(nt,e)};else if(1==e)st=function(){Tt(nt)};else if(2==e){if("undefined"==typeof setImmediate){var a=[];addEventListener("message",(function(e){"setimmediate"!==e.data&&"setimmediate"!==e.data.target||(e.stopPropagation(),a.shift()())}),!0),setImmediate=function(e){a.push(e),void 0===t.setImmediates&&(t.setImmediates=[]),t.setImmediates.push(e),postMessage({target:"setimmediate"})}}st=function(){setImmediate(nt)}}}(e,r),st()},t.getUserMedia=function(){window.getUserMedia||(window.getUserMedia=navigator.getUserMedia||navigator.mozGetUserMedia),window.getUserMedia(void 0)},t.createContext=function(e,t,r,a){return gt(e,t,r,a)},function(e,t){try{var r=indexedDB.open("emscripten_filesystem",1)}catch(e){return void t()}r.onupgradeneeded=function(e){(e=e.target.result).objectStoreNames.contains("FILES")&&e.deleteObjectStore("FILES"),e.createObjectStore("FILES")},r.onsuccess=function(e){!function(e){St=e,Z()}(e.target.result)},r.onerror=function(e){t()}}(0,(function(){St=!1,Z()})),"undefined"!=typeof ENVIRONMENT_IS_FETCH_WORKER&&ENVIRONMENT_IS_FETCH_WORKER||X();var ir={I:function(e,t){return re(e,t)},a:function(e){return _r(e+16)+16},b:function(e,t,r){throw new ae(e).yd(t,r),e},e:function(e,t,r){Qe=r;try{var a=tt(e);switch(t){case 0:var n=et();return 0>n?-28:He(a.path,a.flags,0,n).Cc;case 1:case 2:case 13:case 14:return 0;case 3:return a.flags;case 4:return n=et(),a.flags|=n,0;case 12:return n=et(),T[n+0>>1]=2,0;case 16:case 8:default:return-28;case 9:return x[fr()>>2]=28,-1}}catch(e){return void 0!==Je&&e instanceof Ee||j(e),-e.vc}},E:function(e,t,r){try{var a=tt(e);if(!a.Dc){var n=Te(a.path,{Pc:!0}).node;if(!n.qc.Rc)throw new Ee(54);var i=n.qc.Rc(n);a.Dc=i}e=0;for(var o=qe(a,0,1),s=Math.floor(o/280);s<a.Dc.length&&e+280<=r;){var _=a.Dc[s];if("."===_[0])var c=1,f=4;else{var u=ke(a.node,_);c=u.id,f=8192==(61440&u.mode)?2:16384==(61440&u.mode)?4:40960==(61440&u.mode)?10:8}J=[c>>>0,(K=c,1<=+Math.abs(K)?0<K?(0|Math.min(+Math.floor(K/4294967296),4294967295))>>>0:~~+Math.ceil((K-+(~~K>>>0))/4294967296)>>>0:0)],x[t+e>>2]=J[0],x[t+e+4>>2]=J[1],J=[280*(s+1)>>>0,(K=280*(s+1),1<=+Math.abs(K)?0<K?(0|Math.min(+Math.floor(K/4294967296),4294967295))>>>0:~~+Math.ceil((K-+(~~K>>>0))/4294967296)>>>0:0)],x[t+e+8>>2]=J[0],x[t+e+12>>2]=J[1],T[t+e+16>>1]=280,E[t+e+18>>0]=f,O(_,A,t+e+19,256),e+=280,s+=1}return qe(a,280*s,0),e}catch(e){return void 0!==Je&&e instanceof Ee||j(e),-e.vc}},n:function(){return 42},G:function(e,t,r){Qe=r;try{var a=tt(e);switch(t){case 21509:case 21505:case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:case 21523:case 21524:return a.uc?0:-59;case 21519:if(!a.uc)return-59;var n=et();return x[n>>2]=0;case 21520:return a.uc?-28:-59;case 21531:if(e=n=et(),!a.sc.Ad)throw new Ee(59);return a.sc.Ad(a,t,e);default:j("bad ioctl syscall "+t)}}catch(e){return void 0!==Je&&e instanceof Ee||j(e),-e.vc}},H:function(e,t){try{return $e(We,e=I(e),t)}catch(e){return void 0!==Je&&e instanceof Ee||j(e),-e.vc}},p:function(e,t,r){Qe=r;try{return He(I(e),t,r?et():0).Cc}catch(e){return void 0!==Je&&e instanceof Ee||j(e),-e.vc}},J:function(e,t){try{return $e(Ge,e=I(e),t)}catch(e){return void 0!==Je&&e instanceof Ee||j(e),-e.vc}},C:function(e,t){try{return Ve(e=I(e),t=I(t)),0}catch(e){return void 0!==Je&&e instanceof Ee||j(e),-e.vc}},K:function(e){try{if(!e)return-21;var t={__size__:390,domainname:325,machine:260,nodename:65,release:130,sysname:0,version:195};return B("Emscripten",e+t.sysname),B("emscripten",e+t.nodename),B("1.0",e+t.release),B("#1",e+t.version),B("wasm32",e+t.machine),0}catch(e){return void 0!==Je&&e instanceof Ee||j(e),-e.vc}},D:function(e){try{var t=Te(e=I(e),{parent:!0}).node,r=se(e),a=ke(t,r);e:{try{var n=ke(t,r)}catch(e){var i=e.vc;break e}i=Me(t,"wx")||(16384==(61440&n.mode)?31:0)}if(i)throw new Ee(i);if(!t.qc.Wc)throw new Ee(63);if(a.Kc)throw new Ee(10);try{ve.willDeletePath&&ve.willDeletePath(e)}catch(t){d("FS.trackingDelegate['willDeletePath']('"+e+"') threw an exception: "+t.message)}t.qc.Wc(t,r);var o=xe(a.parent.id,a.name);if(we[o]===a)we[o]=a.Fc;else for(var s=we[o];s;){if(s.Fc===a){s.Fc=a.Fc;break}s=s.Fc}try{ve.onDeletePath&&ve.onDeletePath(e)}catch(t){d("FS.trackingDelegate['onDeletePath']('"+e+"') threw an exception: "+t.message)}return 0}catch(e){return void 0!==Je&&e instanceof Ee||j(e),-e.vc}},L:function(e){delete Bt[e-1]},c:function(){j()},h:re,P:function(e,t){return e-t},R:function(){self.postMessage({t:"gfx"})},t:function(){var e=new URL(location.origin).hostname;if(0===e.length&&(e=new URL(location.href.replace("blob:","")).hostname),/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?).(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?).(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?).(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test(e))0===e.indexOf("10.")&&(e="10.*"),0===e.indexOf("192.168.")&&(e="192.168.*"),0===e.indexOf("172.")&&(e="172.*"),0===e.indexOf("127.")&&(e="127.*");else{var t=new RegExp("("+String.fromCharCode(92)+".ngrok"+String.fromCharCode(92)+".io)$","i");t.test(e)&&(e="*.ngrok.io"),(t=new RegExp("("+String.fromCharCode(92)+".ngrok-free"+String.fromCharCode(92)+".app)$","i")).test(e)&&(e="*.ngrok.io"),(t=new RegExp("("+String.fromCharCode(92)+".arweb"+String.fromCharCode(92)+".app)$","i")).test(e)&&(e="*.arweb.app")}t=P(e)+1;var r=_r(t);return O(e,A,r,t+1),r},s:function(){self.postMessage({t:"licerr"})},l:function(e,t,r){function a(){D.get(e)(t)}0<=r?Rt(a,r):function(e){Tt((function(){rt(e)}))}(a)},x:function(){return 2147483648},N:Pt,v:function(e,t,r){A.copyWithin(e,t,t+r)},w:function(e){var t=A.length;if(2147483648<e)return!1;for(var r=1;4>=r;r*=2){var a=t*(1+.2/r);a=Math.min(a,e+100663296),0<(a=Math.max(e,a))%65536&&(a+=65536-a%65536);e:{try{m.grow(Math.min(2147483648,a)-v.byteLength+65535>>>16),C();var n=1;break e}catch(e){}n=void 0}if(n)return!0}return!1},M:function(e,t,r,a,n){function i(e,r){Ut(e,r.response,(function(e){rt((function(){l?D.get(l)(e):t&&t(e)}))}),(function(e){rt((function(){l?D.get(l)(e):t&&t(e)}))}))}function o(e){rt((function(){h?D.get(h)(e):n&&n(e)}))}function s(e){rt((function(){p?D.get(p)(e):r&&r(e)}))}function _(e){rt((function(){d?D.get(d)(e):a&&a(e)}))}function c(e){rt((function(){l?D.get(l)(e):t&&t(e)}))}var f=e+112,u=I(f),l=k[f+36>>2],p=k[f+40>>2],d=k[f+44>>2],h=k[f+48>>2],m=k[f+52>>2],b=!!(4&m),g=!!(32&m);if(m=!!(16&m),"EM_IDB_STORE"===u)u=k[f+84>>2],Ut(e,A.slice(u,u+k[f+88>>2]),c,s);else if("EM_IDB_DELETE"===u)!function(e,t,r){var a=St;if(a){var n=k[e+112+64>>2];n||(n=k[e+8>>2]),n=I(n);try{var i=a.transaction(["FILES"],"readwrite").objectStore("FILES").delete(n);i.onsuccess=function(r){r=r.target.result,k[e+12>>2]=0,Ct(e+16,0),Ct(e+24,0),Ct(e+32,0),R[e+40>>1]=4,R[e+42>>1]=200,O("OK",A,e+44,64),t(e,0,r)},i.onerror=function(t){R[e+40>>1]=4,R[e+42>>1]=404,O("Not Found",A,e+44,64),r(e,0,t)}}catch(t){r(e,0,t)}}else r(e,0,"IndexedDB not available!")}(e,c,s);else if(m){if(g)return 0;Dt(e,b?i:c,s,_,o)}else!function(e,t,r){var a=St;if(a){var n=k[e+112+64>>2];n||(n=k[e+8>>2]),n=I(n);try{var i=a.transaction(["FILES"],"readonly").objectStore("FILES").get(n);i.onsuccess=function(a){if(a.target.result){var n=(a=a.target.result).byteLength||a.length,i=_r(n);A.set(new Uint8Array(a),i),k[e+12>>2]=i,Ct(e+16,n),Ct(e+24,0),Ct(e+32,n),R[e+40>>1]=4,R[e+42>>1]=200,O("OK",A,e+44,64),t(e,0,a)}else R[e+40>>1]=4,R[e+42>>1]=404,O("Not Found",A,e+44,64),r(e,0,"no data")},i.onerror=function(t){R[e+40>>1]=4,R[e+42>>1]=404,O("Not Found",A,e+44,64),r(e,0,t)}}catch(t){r(e,0,t)}}else r(e,0,"IndexedDB not available!")}(e,c,g?s:b?function(e){Dt(e,i,s,_,o)}:function(e){Dt(e,c,s,_,o)});return e},A:function(e,t){try{var r=0;return Gt().forEach((function(a,n){var i=t+r;x[e+4*n>>2]=i,B(a,i),r+=a.length+1})),0}catch(e){return void 0!==Je&&e instanceof Ee||j(e),e.vc}},B:function(e,t){try{var r=Gt();x[e>>2]=r.length;var a=0;return r.forEach((function(e){a+=e.length+1})),x[t>>2]=a,0}catch(e){return void 0!==Je&&e instanceof Ee||j(e),e.vc}},O:function(e){wr(e)},g:function(e){try{var t=tt(e);if(null===t.Cc)throw new Ee(8);t.Dc&&(t.Dc=null);try{t.sc.close&&t.sc.close(t)}catch(e){throw e}finally{be[t.Cc]=null}return t.Cc=null,0}catch(e){return void 0!==Je&&e instanceof Ee||j(e),e.vc}},F:function(e,t,r,a){try{e:{for(var n=tt(e),i=e=0;i<r;i++){var o=x[t+(8*i+4)>>2],s=n,_=x[t+8*i>>2],c=o,f=void 0,u=E;if(0>c||0>f)throw new Ee(28);if(null===s.Cc)throw new Ee(8);if(1==(2097155&s.flags))throw new Ee(8);if(16384==(61440&s.node.mode))throw new Ee(31);if(!s.sc.read)throw new Ee(28);var l=void 0!==f;if(l){if(!s.seekable)throw new Ee(70)}else f=s.position;var p=s.sc.read(s,u,_,c,f);l||(s.position+=p);var d=p;if(0>d){var h=-1;break e}if(e+=d,d<o)break}h=e}return x[a>>2]=h,0}catch(e){return void 0!==Je&&e instanceof Ee||j(e),e.vc}},u:function(e,t,r,a,n){try{var i=tt(e);return-9007199254740992>=(e=4294967296*r+(t>>>0))||9007199254740992<=e?-61:(qe(i,e,a),J=[i.position>>>0,(K=i.position,1<=+Math.abs(K)?0<K?(0|Math.min(+Math.floor(K/4294967296),4294967295))>>>0:~~+Math.ceil((K-+(~~K>>>0))/4294967296)>>>0:0)],x[n>>2]=J[0],x[n+4>>2]=J[1],i.Dc&&0===e&&0===a&&(i.Dc=null),0)}catch(e){return void 0!==Je&&e instanceof Ee||j(e),e.vc}},k:function(e,t,r,a){try{e:{for(var n=tt(e),i=e=0;i<r;i++){var o=n,s=x[t+8*i>>2],_=x[t+(8*i+4)>>2],c=void 0,f=E;if(0>_||0>c)throw new Ee(28);if(null===o.Cc)throw new Ee(8);if(0==(2097155&o.flags))throw new Ee(8);if(16384==(61440&o.node.mode))throw new Ee(31);if(!o.sc.write)throw new Ee(28);o.seekable&&1024&o.flags&&qe(o,0,2);var u=void 0!==c;if(u){if(!o.seekable)throw new Ee(70)}else c=o.position;var l=o.sc.write(o,f,s,_,c,void 0);u||(o.position+=l);try{o.path&&ve.onWriteToFile&&ve.onWriteToFile(o.path)}catch(e){d("FS.trackingDelegate['onWriteToFile']('"+o.path+"') threw an exception: "+e.message)}var p=l;if(0>p){var h=-1;break e}e+=p}h=e}return x[a>>2]=h,0}catch(e){return void 0!==Je&&e instanceof Ee||j(e),e.vc}},f:function(e){var t=Date.now();return x[e>>2]=t/1e3|0,x[e+4>>2]=t%1e3*1e3|0,0},m:function(e,t){Qt.bindTexture(e,Ht[t])},o:function(e,t){for(var r=0;r<e;r++){var a=Qt.createTexture(),n=a&&Yt(Ht);a?(a.name=n,Ht[n]=a):Xt||(Xt=1282),x[t+4*r>>2]=n}},i:function(e,t,r,a,n,i,o,s,_){var c=Qt,f=c.texImage2D;if(_){var u=s-5120;u=1==u?A:4==u?x:6==u?L:5==u||28922==u?k:R;var l=31-Math.clz32(u.BYTES_PER_ELEMENT);_=u.subarray(_>>l,_+n*(a*({5:3,6:4,8:2,29502:3,29504:4}[o-6402]||1)*(1<<l)+4-1&-4)>>l)}else _=null;f.call(c,e,t,r,a,n,i,o,s,_)},j:function(e,t,r){Qt.texParameteri(e,t,r)},r:function e(t,r){return t=new Date(1e3*x[t>>2]),x[r>>2]=t.getUTCSeconds(),x[r+4>>2]=t.getUTCMinutes(),x[r+8>>2]=t.getUTCHours(),x[r+12>>2]=t.getUTCDate(),x[r+16>>2]=t.getUTCMonth(),x[r+20>>2]=t.getUTCFullYear()-1900,x[r+24>>2]=t.getUTCDay(),x[r+36>>2]=0,x[r+32>>2]=0,x[r+28>>2]=(t.getTime()-Date.UTC(t.getUTCFullYear(),0,1,0,0,0,0))/864e5|0,e.bd||(e.bd=S("GMT")),x[r+40>>2]=e.bd,r},q:function(e,t){!function(){function e(e){return(e=e.toTimeString().match(/\(([A-Za-z ]+)\)$/))?e[1]:"GMT"}if(!jt){jt=!0;var t=(new Date).getFullYear(),r=new Date(t,0,1),a=new Date(t,6,1);t=r.getTimezoneOffset();var n=a.getTimezoneOffset(),i=Math.max(t,n);x[pr()>>2]=60*i,x[lr()>>2]=Number(t!=n),r=e(r),a=e(a),r=S(r),a=S(a),n<t?(x[ur()>>2]=r,x[ur()+4>>2]=a):(x[ur()>>2]=a,x[ur()+4>>2]=r)}}(),e=new Date(1e3*x[e>>2]),x[t>>2]=e.getSeconds(),x[t+4>>2]=e.getMinutes(),x[t+8>>2]=e.getHours(),x[t+12>>2]=e.getDate(),x[t+16>>2]=e.getMonth(),x[t+20>>2]=e.getFullYear()-1900,x[t+24>>2]=e.getDay();var r=new Date(e.getFullYear(),0,1);x[t+28>>2]=(e.getTime()-r.getTime())/864e5|0,x[t+36>>2]=-60*e.getTimezoneOffset();var a=new Date(e.getFullYear(),6,1).getTimezoneOffset();return e=0|(a!=(r=r.getTimezoneOffset())&&e.getTimezoneOffset()==Math.min(r,a)),x[t+32>>2]=e,e=x[ur()+(e?4:0)>>2],x[t+40>>2]=e,t},Q:function(){return 6},y:function(){return 28},z:function(e,t,r,a){return function(e,t,r,a){function n(e,t,r){for(e="number"==typeof e?e.toString():e||"";e.length<t;)e=r[0]+e;return e}function i(e,t){return n(e,t,"0")}function o(e,t){function r(e){return 0>e?-1:0<e?1:0}var a;return 0===(a=r(e.getFullYear()-t.getFullYear()))&&0===(a=r(e.getMonth()-t.getMonth()))&&(a=r(e.getDate()-t.getDate())),a}function s(e){switch(e.getDay()){case 0:return new Date(e.getFullYear()-1,11,29);case 1:return e;case 2:return new Date(e.getFullYear(),0,3);case 3:return new Date(e.getFullYear(),0,2);case 4:return new Date(e.getFullYear(),0,1);case 5:return new Date(e.getFullYear()-1,11,31);case 6:return new Date(e.getFullYear()-1,11,30)}}function _(e){e=rr(new Date(e.xc+1900,0,1),e.Vc);var t=new Date(e.getFullYear()+1,0,4),r=s(new Date(e.getFullYear(),0,4));return t=s(t),0>=o(r,e)?0>=o(t,e)?e.getFullYear()+1:e.getFullYear():e.getFullYear()-1}var c=x[a+40>>2];for(var f in a={Pd:x[a>>2],Od:x[a+4>>2],Tc:x[a+8>>2],Nc:x[a+12>>2],Ic:x[a+16>>2],xc:x[a+20>>2],Uc:x[a+24>>2],Vc:x[a+28>>2],de:x[a+32>>2],Nd:x[a+36>>2],Qd:c?I(c):""},r=I(r),c={"%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"})r=r.replace(new RegExp(f,"g"),c[f]);var u="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),l="January February March April May June July August September October November December".split(" ");for(f in c={"%a":function(e){return u[e.Uc].substring(0,3)},"%A":function(e){return u[e.Uc]},"%b":function(e){return l[e.Ic].substring(0,3)},"%B":function(e){return l[e.Ic]},"%C":function(e){return i((e.xc+1900)/100|0,2)},"%d":function(e){return i(e.Nc,2)},"%e":function(e){return n(e.Nc,2," ")},"%g":function(e){return _(e).toString().substring(2)},"%G":function(e){return _(e)},"%H":function(e){return i(e.Tc,2)},"%I":function(e){return 0==(e=e.Tc)?e=12:12<e&&(e-=12),i(e,2)},"%j":function(e){return i(e.Nc+$t(Jt(e.xc+1900)?er:tr,e.Ic-1),3)},"%m":function(e){return i(e.Ic+1,2)},"%M":function(e){return i(e.Od,2)},"%n":function(){return"\n"},"%p":function(e){return 0<=e.Tc&&12>e.Tc?"AM":"PM"},"%S":function(e){return i(e.Pd,2)},"%t":function(){return"\t"},"%u":function(e){return e.Uc||7},"%U":function(e){var t=new Date(e.xc+1900,0,1),r=0===t.getDay()?t:rr(t,7-t.getDay());return 0>o(r,e=new Date(e.xc+1900,e.Ic,e.Nc))?i(Math.ceil((31-r.getDate()+($t(Jt(e.getFullYear())?er:tr,e.getMonth()-1)-31)+e.getDate())/7),2):0===o(r,t)?"01":"00"},"%V":function(e){var t=new Date(e.xc+1901,0,4),r=s(new Date(e.xc+1900,0,4));t=s(t);var a=rr(new Date(e.xc+1900,0,1),e.Vc);return 0>o(a,r)?"53":0>=o(t,a)?"01":i(Math.ceil((r.getFullYear()<e.xc+1900?e.Vc+32-r.getDate():e.Vc+1-r.getDate())/7),2)},"%w":function(e){return e.Uc},"%W":function(e){var t=new Date(e.xc,0,1),r=1===t.getDay()?t:rr(t,0===t.getDay()?1:7-t.getDay()+1);return 0>o(r,e=new Date(e.xc+1900,e.Ic,e.Nc))?i(Math.ceil((31-r.getDate()+($t(Jt(e.getFullYear())?er:tr,e.getMonth()-1)-31)+e.getDate())/7),2):0===o(r,t)?"01":"00"},"%y":function(e){return(e.xc+1900).toString().substring(2)},"%Y":function(e){return e.xc+1900},"%z":function(e){var t=0<=(e=e.Nd);return e=Math.abs(e)/60,(t?"+":"-")+String("0000"+(e/60*100+e%60)).slice(-4)},"%Z":function(e){return e.Qd},"%%":function(){return"%"}})0<=r.indexOf(f)&&(r=r.replace(new RegExp(f,"g"),c[f](a)));return(f=nr(r,!1)).length>t?0:(E.set(f,e),f.length-1)}(e,t,r,a)},d:function(e){var t=Date.now()/1e3|0;return e&&(x[e>>2]=t),t}},or=function(){function e(e){t.asm=e.exports,m=t.asm.S,C(),D=t.asm.X,V.unshift(t.asm.T),Z()}var r={a:ir};if(X(),t.instantiateWasm)try{return t.instantiateWasm(r,e)}catch(e){return d("Module.instantiateWasm callback failed with error: "+e),!1}return r=function(e){var t=Q;try{e:{try{if(t==Q&&l){var r=new Uint8Array(l);break e}if(c){r=c(t);break e}throw"sync fetching of the wasm failed: you can preload it to Module['wasmBinary'] manually, or emcc.py will do that for you when generating HTML (but not JS)"}catch(e){j(e)}r=void 0}var a=new WebAssembly.Module(r),n=new WebAssembly.Instance(a,e)}catch(t){throw e=t.toString(),d("failed to compile wasm module: "+e),(0<=e.indexOf("imported Memory")||0<=e.indexOf("memory import"))&&d("Memory size incompatibility issues may be due to changing INITIAL_MEMORY at runtime to something too large. Use ALLOW_MEMORY_GROWTH to allow any size memory (and also make sure not to set INITIAL_MEMORY at runtime to something smaller than it was at compile time)."),t}return[n,a]}(r),e(r[0]),t.asm}();t.___wasm_call_ctors=or.T,t._zappar_has_initialized=or.U,t._zappar_invert=or.V,t._zappar_loaded=or.W,t._zappar_pipeline_create=or.Y,t._zappar_pipeline_destroy=or.Z,t._zappar_pipeline_camera_frame_submit=or._,t._zappar_pipeline_camera_frame_submit_raw_pointer=or.$,t._zappar_pipeline_frame_update=or.aa,t._zappar_pipeline_camera_frame_user_data=or.ba,t._zappar_pipeline_camera_model=or.ca,t._zappar_pipeline_frame_number=or.da,t._zappar_pipeline_motion_accelerometer_submit=or.ea,t._zappar_pipeline_motion_rotation_rate_submit=or.fa,t._zappar_pipeline_motion_attitude_submit=or.ga,t._zappar_pipeline_motion_attitude_matrix_submit=or.ha,t._zappar_pipeline_camera_frame_user_facing=or.ia,t._zappar_pipeline_camera_frame_texture_matrix=or.ja,t._zappar_pipeline_camera_pose_with_attitude=or.ka,t._zappar_pipeline_camera_pose_with_origin=or.la,t._zappar_pipeline_camera_frame_camera_attitude=or.ma,t._zappar_pipeline_camera_frame_device_attitude=or.na,t._zappar_pipeline_camera_frame_texture_gl=or.oa,t._zappar_pipeline_camera_frame_upload_gl=or.pa,t._zappar_pipeline_sequence_record_start=or.qa,t._zappar_pipeline_sequence_record_stop=or.ra,t._zappar_pipeline_sequence_record_clear=or.sa,t._zappar_pipeline_sequence_record_device_attitude_matrices_set=or.ta,t._zappar_pipeline_sequence_record_data_size=or.ua,t._zappar_pipeline_sequence_record_data=or.va,t._zappar_pipeline_process_gl=or.wa,t._zappar_pipeline_camera_pose_default=or.xa,t._zappar_instant_world_tracker_create=or.ya,t._zappar_instant_world_tracker_destroy=or.za,t._zappar_instant_world_tracker_anchor_pose_set_from_camera_offset_raw=or.Aa,t._zappar_instant_world_tracker_anchor_pose_raw=or.Ba,t._zappar_instant_world_tracker_enabled_set=or.Ca,t._zappar_instant_world_tracker_enabled=or.Da,t._zappar_image_tracker_create=or.Ea,t._zappar_image_tracker_destroy=or.Fa,t._zappar_image_tracker_target_load_from_memory=or.Ga,t.__Z42zappar_image_tracker_target_load_from_fileP23zappar_image_tracker_tiPKc=or.Ha;var sr=t._free=or.Ia;t._zappar_image_tracker_anchor_count=or.Ja,t._zappar_image_tracker_anchor_id=or.Ka,t._zappar_image_tracker_anchor_pose_raw=or.La,t._zappar_image_tracker_enabled_set=or.Ma,t._zappar_image_tracker_enabled=or.Na,t._zappar_image_tracker_target_loaded_version=or.Oa,t.__Z33zappar_image_tracker_target_countP23zappar_image_tracker_ti=or.Pa,t.__Z46zappar_image_tracker_target_preview_compressedP23zappar_image_tracker_tii=or.Qa,t.__Z51zappar_image_tracker_target_preview_compressed_sizeP23zappar_image_tracker_tii=or.Ra,t.__Z55zappar_image_tracker_target_preview_compressed_mimetypeP23zappar_image_tracker_tii=or.Sa,t.__Z40zappar_image_tracker_target_preview_rgbaP23zappar_image_tracker_tii=or.Ta,t.__Z45zappar_image_tracker_target_preview_rgba_sizeP23zappar_image_tracker_tii=or.Ua,t.__Z46zappar_image_tracker_target_preview_rgba_widthP23zappar_image_tracker_tii=or.Va,t.__Z47zappar_image_tracker_target_preview_rgba_heightP23zappar_image_tracker_tii=or.Wa,t.__Z38zappar_image_tracker_target_radius_topP23zappar_image_tracker_tii=or.Xa,t.__Z41zappar_image_tracker_target_radius_bottomP23zappar_image_tracker_tii=or.Ya,t.__Z39zappar_image_tracker_target_side_lengthP23zappar_image_tracker_tii=or.Za,t.__Z49zappar_image_tracker_target_physical_scale_factorP23zappar_image_tracker_tii=or._a,t.__Z49zappar_image_tracker_target_preview_mesh_verticesP23zappar_image_tracker_tii=or.$a,t.__Z48zappar_image_tracker_target_preview_mesh_normalsP23zappar_image_tracker_tii=or.ab,t.__Z44zappar_image_tracker_target_preview_mesh_uvsP23zappar_image_tracker_tii=or.bb,t.__Z48zappar_image_tracker_target_preview_mesh_indicesP23zappar_image_tracker_tii=or.cb,t.__Z54zappar_image_tracker_target_preview_mesh_vertices_sizeP23zappar_image_tracker_tii=or.db,t.__Z53zappar_image_tracker_target_preview_mesh_normals_sizeP23zappar_image_tracker_tii=or.eb,t.__Z49zappar_image_tracker_target_preview_mesh_uvs_sizeP23zappar_image_tracker_tii=or.fb,t.__Z53zappar_image_tracker_target_preview_mesh_indices_sizeP23zappar_image_tracker_tii=or.gb,t.__Z32zappar_image_tracker_target_typeP23zappar_image_tracker_tii=or.hb,t._zappar_face_tracker_create=or.ib,t._zappar_face_tracker_destroy=or.jb,t._zappar_face_tracker_model_load_from_memory=or.kb,t._zappar_face_tracker_anchor_count=or.lb,t._zappar_face_tracker_anchor_id=or.mb,t._zappar_face_tracker_anchor_pose_raw=or.nb,t._zappar_face_tracker_anchor_identity_coefficients=or.ob,t._zappar_face_tracker_anchor_expression_coefficients=or.pb,t._zappar_face_tracker_enabled_set=or.qb,t._zappar_face_tracker_enabled=or.rb,t._zappar_face_tracker_max_faces_set=or.sb,t._zappar_face_tracker_max_faces=or.tb,t._zappar_face_tracker_model_loaded_version=or.ub,t._zappar_face_landmark_create=or.vb,t._zappar_face_landmark_destroy=or.wb,t.__Z27zappar_face_landmark_updateP23zappar_face_landmark_tiPKfS2_i=or.xb,t._zappar_face_landmark_anchor_pose=or.yb,t._zappar_barcode_finder_create=or.zb,t._zappar_barcode_finder_destroy=or.Ab,t._zappar_barcode_finder_found_number=or.Bb,t._zappar_barcode_finder_found_text=or.Cb,t._zappar_barcode_finder_enabled_set=or.Db,t._zappar_barcode_finder_enabled=or.Eb,t._zappar_barcode_finder_found_format=or.Fb,t._zappar_barcode_finder_formats=or.Gb,t._zappar_barcode_finder_formats_set=or.Hb;var _r=t._malloc=or.Ib;t._zappar_face_mesh_create=or.Jb,t._zappar_face_mesh_destroy=or.Kb,t.__Z33zappar_face_mesh_load_from_memoryP19zappar_face_mesh_tiPKciiiii=or.Lb,t.__Z29zappar_face_mesh_indices_sizeP19zappar_face_mesh_ti=or.Mb,t.__Z25zappar_face_mesh_uvs_sizeP19zappar_face_mesh_ti=or.Nb,t.__Z30zappar_face_mesh_vertices_sizeP19zappar_face_mesh_ti=or.Ob,t.__Z31zappar_face_mesh_loaded_versionP19zappar_face_mesh_ti=or.Pb,t.__Z25zappar_face_mesh_verticesP19zappar_face_mesh_ti=or.Qb,t.__Z20zappar_face_mesh_uvsP19zappar_face_mesh_ti=or.Rb,t.__Z24zappar_face_mesh_indicesP19zappar_face_mesh_ti=or.Sb,t.__Z23zappar_face_mesh_updateP19zappar_face_mesh_tiPKfS2_i=or.Tb,t.__Z29zappar_face_mesh_normals_sizeP19zappar_face_mesh_ti=or.Ub,t.__Z24zappar_face_mesh_normalsP19zappar_face_mesh_ti=or.Vb,t._zappar_camera_source_create=or.Wb,t._zappar_camera_source_destroy=or.Xb,t._zappar_camera_source_start=or.Yb,t._zappar_camera_source_pause=or.Zb,t._zappar_camera_default_device_id=or._b,t._zappar_sequence_source_create=or.$b,t.__Z28zappar_sequence_source_startP25zappar_sequence_source_ti=or.ac,t.__Z39zappar_sequence_source_load_from_memoryP25zappar_sequence_source_tiPKci=or.bc,t.__Z28zappar_sequence_source_pauseP25zappar_sequence_source_ti=or.cc,t._zappar_sequence_source_destroy=or.dc,t._zappar_sequence_source_max_playback_fps_set=or.ec,t._zappar_log_level_set=or.fc,t._zappar_log_level=or.gc,t.__Z23zappar_log_redirect_setPFv18zappar_log_level_tPKcE=or.hc,t._zappar_analytics_project_id_set=or.ic;var cr,fr=t.___errno_location=or.jc,ur=t.__get_tzname=or.kc,lr=t.__get_daylight=or.lc,pr=t.__get_timezone=or.mc,dr=t.stackSave=or.nc,hr=t.stackRestore=or.oc,mr=t.stackAlloc=or.pc;function br(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}function gr(){function e(){if(!cr&&(cr=!0,t.calledRun=!0,!g)){if(t.noFSInit||Oe||(Oe=!0,Ye(),t.stdin=t.stdin,t.stdout=t.stdout,t.stderr=t.stderr,t.stdin?Xe("stdin",t.stdin):Ve("/dev/tty","/dev/stdin"),t.stdout?Xe("stdout",null,t.stdout):Ve("/dev/tty","/dev/stdout"),t.stderr?Xe("stderr",null,t.stderr):Ve("/dev/tty1","/dev/stderr"),He("/dev/stdin",0),He("/dev/stdout",1),He("/dev/stderr",1)),te(V),ye=!1,te(N),r(t),t.onRuntimeInitialized&&t.onRuntimeInitialized(),t.postRun)for("function"==typeof t.postRun&&(t.postRun=[t.postRun]);t.postRun.length;){var e=t.postRun.shift();G.unshift(e)}te(G)}}if(!(0<H)){if(t.preRun)for("function"==typeof t.preRun&&(t.preRun=[t.preRun]);t.preRun.length;)W();te(U),0<H||(t.setStatus?(t.setStatus("Running..."),setTimeout((function(){setTimeout((function(){t.setStatus("")}),1),e()}),1)):e())}}function wr(e){b=e,h||(t.onExit&&t.onExit(e),g=!0),_(e,new br(e))}if(t.cwrap=function(e,t,r,a){var n=(r=r||[]).every((function(e){return"number"===e}));return"string"!==t&&n&&!a?y(e):function(){return function(e,t,r,a){var n,i={string:function(e){var t=0;if(null!=e&&0!==e){var r=1+(e.length<<2);t=mr(r),O(e,A,t,r)}return t},array:function(e){var t=mr(e.length);return E.set(e,t),t}},o=y(e),s=[];if(e=0,a)for(var _=0;_<a.length;_++){var c=i[r[_]];c?(0===e&&(e=dr()),s[_]=c(a[_])):s[_]=a[_]}return n=r=o.apply(null,s),r="string"===t?I(n):"boolean"===t?!!n:n,0!==e&&hr(e),r}(e,t,r,arguments)}},t.setValue=function(e,t,r){switch("*"===(r=r||"i8").charAt(r.length-1)&&(r="i32"),r){case"i1":case"i8":E[e>>0]=t;break;case"i16":T[e>>1]=t;break;case"i32":x[e>>2]=t;break;case"i64":J=[t>>>0,(K=t,1<=+Math.abs(K)?0<K?(0|Math.min(+Math.floor(K/4294967296),4294967295))>>>0:~~+Math.ceil((K-+(~~K>>>0))/4294967296)>>>0:0)],x[e>>2]=J[0],x[e+4>>2]=J[1];break;case"float":L[e>>2]=t;break;case"double":F[e>>3]=t;break;default:j("invalid type for setValue: "+r)}},t.getValue=function(e,t){switch("*"===(t=t||"i8").charAt(t.length-1)&&(t="i32"),t){case"i1":case"i8":return E[e>>0];case"i16":return T[e>>1];case"i32":case"i64":return x[e>>2];case"float":return L[e>>2];case"double":return F[e>>3];default:j("invalid type for getValue: "+t)}return null},t.UTF8ToString=I,Y=function e(){cr||gr(),cr||(Y=e)},t.run=gr,t.preInit)for("function"==typeof t.preInit&&(t.preInit=[t.preInit]);0<t.preInit.length;)t.preInit.pop()();return gr(),e});const i=n;class o{constructor(e){this._messageSender=e,this._freeBufferPool=[],this._buffer=new ArrayBuffer(16),this._i32View=new Int32Array(this._buffer),this._f32View=new Float32Array(this._buffer),this._f64View=new Float64Array(this._buffer),this._u8View=new Uint8Array(this._buffer),this._u8cView=new Uint8ClampedArray(this._buffer),this._u16View=new Uint16Array(this._buffer),this._u32View=new Uint32Array(this._buffer),this._offset=1,this._startOffset=-1,this._timeoutSet=!1,this._appender={int:e=>this.int(e),bool:e=>this.int(e?1:0),float:e=>this.float(e),string:e=>this.string(e),dataWithLength:e=>this.arrayBuffer(e),type:e=>this.int(e),matrix4x4:e=>this.float32ArrayBuffer(e),matrix3x3:e=>this.float32ArrayBuffer(e),identityCoefficients:e=>this.float32ArrayBuffer(e),expressionCoefficients:e=>this.float32ArrayBuffer(e),cameraModel:e=>this.float32ArrayBuffer(e),timestamp:e=>this.double(e),barcodeFormat:e=>this.int(e),faceLandmarkName:e=>this.int(e),instantTrackerTransformOrientation:e=>this.int(e),logLevel:e=>this.int(e)},this._freeBufferPool.push(new ArrayBuffer(16)),this._freeBufferPool.push(new ArrayBuffer(16))}bufferReturn(e){this._freeBufferPool.push(e)}_ensureArrayBuffer(e){let t,r=4*(this._offset+e+8);if(this._buffer&&this._buffer.byteLength>=r)return;if(!t){let e=r;e--,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,e++,t=new ArrayBuffer(e)}let a=this._buffer?this._i32View:void 0;this._buffer=t,this._i32View=new Int32Array(this._buffer),this._f32View=new Float32Array(this._buffer),this._f64View=new Float64Array(this._buffer),this._u8View=new Uint8Array(this._buffer),this._u8cView=new Uint8ClampedArray(this._buffer),this._u16View=new Uint16Array(this._buffer),this._u32View=new Uint32Array(this._buffer),a&&this._i32View.set(a.subarray(0,this._offset))}sendMessage(e,t){this._ensureArrayBuffer(4),this._startOffset=this._offset,this._i32View[this._offset+1]=e,this._offset+=2,t(this._appender),this._i32View[this._startOffset]=this._offset-this._startOffset,this._startOffset=-1,this._sendOneTime()}_sendOneTime(){!1===this._timeoutSet&&(this._timeoutSet=!0,setTimeout((()=>{this._timeoutSet=!1,this._send()}),0))}_send(){0!==this._freeBufferPool.length?(this._i32View[0]=this._offset,this._messageSender(this._buffer),this._buffer=void 0,this._buffer=this._freeBufferPool.pop(),this._i32View=new Int32Array(this._buffer),this._f32View=new Float32Array(this._buffer),this._f64View=new Float64Array(this._buffer),this._u8View=new Uint8Array(this._buffer),this._u8cView=new Uint8ClampedArray(this._buffer),this._u16View=new Uint16Array(this._buffer),this._u32View=new Uint32Array(this._buffer),this._offset=1,this._startOffset=-1):this._sendOneTime()}int(e){this._ensureArrayBuffer(1),this._i32View[this._offset]=e,this._offset++}double(e){this._ensureArrayBuffer(2),this._offset%2==1&&this._offset++,this._f64View[this._offset/2]=e,this._offset+=2}float(e){this._ensureArrayBuffer(1),this._f32View[this._offset]=e,this._offset++}int32Array(e){this._ensureArrayBuffer(e.length);for(let t=0;t<e.length;++t)this._i32View[this._offset+t]=e[t];this._offset+=e.length}float32Array(e){this._ensureArrayBuffer(e.length);for(let t=0;t<e.length;++t)this._f32View[this._offset+t]=e[t];this._offset+=e.length}booleanArray(e){this._ensureArrayBuffer(e.length);for(let t=0;t<e.length;++t)this._i32View[this._offset+t]=e[t]?1:0;this._offset+=e.length}uint8ArrayBuffer(e){this._ensureArrayBuffer(e.byteLength/4),this._i32View[this._offset]=e.byteLength,this._offset++,this._u8View.set(e,4*this._offset),this._offset+=e.byteLength>>2,0!=(3&e.byteLength)&&this._offset++}arrayBuffer(e){let t=new Uint8Array(e);this.uint8ArrayBuffer(t)}uint8ClampedArrayBuffer(e){this._ensureArrayBuffer(e.byteLength/4),this._i32View[this._offset]=e.byteLength,this._offset++,this._u8cView.set(e,4*this._offset),this._offset+=e.byteLength>>2,0!=(3&e.byteLength)&&this._offset++}float32ArrayBuffer(e){this._ensureArrayBuffer(e.byteLength/4),this._i32View[this._offset]=e.length,this._offset++,this._f32View.set(e,this._offset),this._offset+=e.length}uint16ArrayBuffer(e){this._ensureArrayBuffer(e.byteLength/4),this._i32View[this._offset]=e.length,this._offset++;let t=2*this._offset;this._u16View.set(e,t),this._offset+=e.length>>1,0!=(1&e.length)&&this._offset++}int32ArrayBuffer(e){this._ensureArrayBuffer(e.byteLength/4),this._i32View[this._offset]=e.length,this._offset++,this._i32View.set(e,this._offset),this._offset+=e.length}uint32ArrayBuffer(e){this._ensureArrayBuffer(e.byteLength/4),this._i32View[this._offset]=e.length,this._offset++,this._u32View.set(e,this._offset),this._offset+=e.length}string(e){let t=(new TextEncoder).encode(e);this._ensureArrayBuffer(t.byteLength/4),this._i32View[this._offset]=t.byteLength,this._offset++,this._u8View.set(t,4*this._offset),this._offset+=t.byteLength>>2,0!=(3&t.byteLength)&&this._offset++}}class s{constructor(){this._buffer=new ArrayBuffer(0),this._i32View=new Int32Array(this._buffer),this._f32View=new Float32Array(this._buffer),this._f64View=new Float64Array(this._buffer),this._u8View=new Uint8Array(this._buffer),this._u16View=new Uint16Array(this._buffer),this._u32View=new Uint32Array(this._buffer),this._offset=0,this._length=0,this._startOffset=-1,this._processor={int:()=>this._i32View[this._startOffset++],bool:()=>1===this._i32View[this._startOffset++],type:()=>this._i32View[this._startOffset++],float:()=>this._f32View[this._startOffset++],timestamp:()=>{this._startOffset%2==1&&this._startOffset++;let e=this._f64View[this._startOffset/2];return this._startOffset+=2,e},string:()=>{let e=this._i32View[this._startOffset++],t=(new TextDecoder).decode(new Uint8Array(this._buffer,4*this._startOffset,e));return this._startOffset+=e>>2,0!=(3&e)&&this._startOffset++,t},dataWithLength:()=>{let e=this._i32View[this._startOffset++],t=new Uint8Array(e);return t.set(this._u8View.subarray(4*this._startOffset,4*this._startOffset+e)),this._startOffset+=t.byteLength>>2,0!=(3&t.byteLength)&&this._startOffset++,t.buffer},matrix4x4:()=>{let e=this._i32View[this._startOffset++],t=new Float32Array(e);return t.set(this._f32View.subarray(this._startOffset,this._startOffset+16)),this._startOffset+=e,t},matrix3x3:()=>{let e=this._i32View[this._startOffset++],t=new Float32Array(e);return t.set(this._f32View.subarray(this._startOffset,this._startOffset+9)),this._startOffset+=e,t},identityCoefficients:()=>{let e=this._i32View[this._startOffset++],t=new Float32Array(e);return t.set(this._f32View.subarray(this._startOffset,this._startOffset+50)),this._startOffset+=e,t},expressionCoefficients:()=>{let e=this._i32View[this._startOffset++],t=new Float32Array(e);return t.set(this._f32View.subarray(this._startOffset,this._startOffset+29)),this._startOffset+=e,t},cameraModel:()=>{let e=this._i32View[this._startOffset++],t=new Float32Array(e);return t.set(this._f32View.subarray(this._startOffset,this._startOffset+6)),this._startOffset+=e,t},barcodeFormat:()=>this._i32View[this._startOffset++],faceLandmarkName:()=>this._i32View[this._startOffset++],instantTrackerTransformOrientation:()=>this._i32View[this._startOffset++],logLevel:()=>this._i32View[this._startOffset++]}}setData(e){this._buffer=e,this._i32View=new Int32Array(this._buffer),this._f32View=new Float32Array(this._buffer),this._f64View=new Float64Array(this._buffer),this._u8View=new Uint8Array(this._buffer),this._u16View=new Uint16Array(this._buffer),this._u32View=new Uint32Array(this._buffer),this._offset=0,this._length=0,e.byteLength>=4&&(this._offset=1,this._length=this._i32View[0]),this._startOffset=-1}hasMessage(){return this._offset+1<this._length}forMessages(e){for(;this.hasMessage();){let t=this._i32View[this._offset],r=this._i32View[this._offset+1];this._startOffset=this._offset+2,this._offset+=t,e(r,this._processor)}}}class _{constructor(e,t){this._impl=e,this._sender=t,this._deserializer=new s,this.serializersByPipelineId=new Map,this._pipeline_id_by_pipeline_id=new Map,this._pipeline_by_instance=new Map,this._pipeline_id_by_camera_source_id=new Map,this._camera_source_by_instance=new Map,this._pipeline_id_by_sequence_source_id=new Map,this._sequence_source_by_instance=new Map,this._pipeline_id_by_image_tracker_id=new Map,this._image_tracker_by_instance=new Map,this._pipeline_id_by_face_tracker_id=new Map,this._face_tracker_by_instance=new Map,this._pipeline_id_by_face_mesh_id=new Map,this._face_mesh_by_instance=new Map,this._pipeline_id_by_face_landmark_id=new Map,this._face_landmark_by_instance=new Map,this._pipeline_id_by_barcode_finder_id=new Map,this._barcode_finder_by_instance=new Map,this._pipeline_id_by_instant_world_tracker_id=new Map,this._instant_world_tracker_by_instance=new Map}processBuffer(e){this._deserializer.setData(e),this._deserializer.forMessages(((e,t)=>{switch(e){case 34:this._impl.log_level_set(t.logLevel());break;case 31:this._impl.analytics_project_id_set(t.string(),t.string());break;case 27:{let e=t.type(),r=this._impl.pipeline_create();this._pipeline_by_instance.set(e,r),this._pipeline_id_by_pipeline_id.set(e,e),this.serializersByPipelineId.set(e,new o((t=>{this._sender(e,t)})));break}case 28:{let e=t.type(),r=this._pipeline_by_instance.get(e);if(void 0===r)return;this._impl.pipeline_destroy(r),this._pipeline_by_instance.delete(e);break}case 9:{let e=t.type(),r=this._pipeline_by_instance.get(e);if(void 0===r)return;this._impl.pipeline_frame_update(r);break}case 8:{let e=t.type(),r=this._pipeline_by_instance.get(e);if(void 0===r)return;this._impl.pipeline_camera_frame_submit(r,t.dataWithLength(),t.int(),t.int(),t.int(),t.matrix4x4(),t.cameraModel(),t.bool());break}case 10:{let e=t.type(),r=this._pipeline_by_instance.get(e);if(void 0===r)return;this._impl.pipeline_motion_accelerometer_submit(r,t.timestamp(),t.float(),t.float(),t.float());break}case 11:{let e=t.type(),r=this._pipeline_by_instance.get(e);if(void 0===r)return;this._impl.pipeline_motion_rotation_rate_submit(r,t.timestamp(),t.float(),t.float(),t.float());break}case 12:{let e=t.type(),r=this._pipeline_by_instance.get(e);if(void 0===r)return;this._impl.pipeline_motion_attitude_submit(r,t.timestamp(),t.float(),t.float(),t.float());break}case 13:{let e=t.type(),r=this._pipeline_by_instance.get(e);if(void 0===r)return;this._impl.pipeline_motion_attitude_matrix_submit(r,t.matrix4x4());break}case 29:{let e=t.type(),r=t.type(),a=this._pipeline_by_instance.get(r),n=t.string(),i=this._impl.camera_source_create(a,n);this._camera_source_by_instance.set(e,i),this._pipeline_id_by_camera_source_id.set(e,r);break}case 30:{let e=t.type(),r=this._camera_source_by_instance.get(e);if(void 0===r)return;this._impl.camera_source_destroy(r),this._camera_source_by_instance.delete(e);break}case 35:{let e=t.type(),r=t.type(),a=this._pipeline_by_instance.get(r),n=this._impl.sequence_source_create(a);this._sequence_source_by_instance.set(e,n),this._pipeline_id_by_sequence_source_id.set(e,r);break}case 36:{let e=t.type(),r=this._sequence_source_by_instance.get(e);if(void 0===r)return;this._impl.sequence_source_destroy(r),this._sequence_source_by_instance.delete(e);break}case 2:{let e=t.type(),r=t.type(),a=this._pipeline_by_instance.get(r),n=this._impl.image_tracker_create(a);this._image_tracker_by_instance.set(e,n),this._pipeline_id_by_image_tracker_id.set(e,r);break}case 14:{let e=t.type(),r=this._image_tracker_by_instance.get(e);if(void 0===r)return;this._impl.image_tracker_destroy(r),this._image_tracker_by_instance.delete(e);break}case 4:{let e=t.type(),r=this._image_tracker_by_instance.get(e);if(void 0===r)return;this._impl.image_tracker_target_load_from_memory(r,t.dataWithLength());break}case 3:{let e=t.type(),r=this._image_tracker_by_instance.get(e);if(void 0===r)return;this._impl.image_tracker_enabled_set(r,t.bool());break}case 20:{let e=t.type(),r=t.type(),a=this._pipeline_by_instance.get(r),n=this._impl.face_tracker_create(a);this._face_tracker_by_instance.set(e,n),this._pipeline_id_by_face_tracker_id.set(e,r);break}case 21:{let e=t.type(),r=this._face_tracker_by_instance.get(e);if(void 0===r)return;this._impl.face_tracker_destroy(r),this._face_tracker_by_instance.delete(e);break}case 22:{let e=t.type(),r=this._face_tracker_by_instance.get(e);if(void 0===r)return;this._impl.face_tracker_model_load_from_memory(r,t.dataWithLength());break}case 23:{let e=t.type(),r=this._face_tracker_by_instance.get(e);if(void 0===r)return;this._impl.face_tracker_enabled_set(r,t.bool());break}case 24:{let e=t.type(),r=this._face_tracker_by_instance.get(e);if(void 0===r)return;this._impl.face_tracker_max_faces_set(r,t.int());break}case 25:{let e=t.type(),r=this._impl.face_mesh_create();this._face_mesh_by_instance.set(e,r);break}case 26:{let e=t.type(),r=this._face_mesh_by_instance.get(e);if(void 0===r)return;this._impl.face_mesh_destroy(r),this._face_mesh_by_instance.delete(e);break}case 32:{let e=t.type(),r=t.faceLandmarkName(),a=this._impl.face_landmark_create(r);this._face_landmark_by_instance.set(e,a);break}case 33:{let e=t.type(),r=this._face_landmark_by_instance.get(e);if(void 0===r)return;this._impl.face_landmark_destroy(r),this._face_landmark_by_instance.delete(e);break}case 16:{let e=t.type(),r=t.type(),a=this._pipeline_by_instance.get(r),n=this._impl.barcode_finder_create(a);this._barcode_finder_by_instance.set(e,n),this._pipeline_id_by_barcode_finder_id.set(e,r);break}case 17:{let e=t.type(),r=this._barcode_finder_by_instance.get(e);if(void 0===r)return;this._impl.barcode_finder_destroy(r),this._barcode_finder_by_instance.delete(e);break}case 18:{let e=t.type(),r=this._barcode_finder_by_instance.get(e);if(void 0===r)return;this._impl.barcode_finder_enabled_set(r,t.bool());break}case 19:{let e=t.type(),r=this._barcode_finder_by_instance.get(e);if(void 0===r)return;this._impl.barcode_finder_formats_set(r,t.barcodeFormat());break}case 5:{let e=t.type(),r=t.type(),a=this._pipeline_by_instance.get(r),n=this._impl.instant_world_tracker_create(a);this._instant_world_tracker_by_instance.set(e,n),this._pipeline_id_by_instant_world_tracker_id.set(e,r);break}case 15:{let e=t.type(),r=this._instant_world_tracker_by_instance.get(e);if(void 0===r)return;this._impl.instant_world_tracker_destroy(r),this._instant_world_tracker_by_instance.delete(e);break}case 6:{let e=t.type(),r=this._instant_world_tracker_by_instance.get(e);if(void 0===r)return;this._impl.instant_world_tracker_enabled_set(r,t.bool());break}case 7:{let e=t.type(),r=this._instant_world_tracker_by_instance.get(e);if(void 0===r)return;this._impl.instant_world_tracker_anchor_pose_set_from_camera_offset_raw(r,t.float(),t.float(),t.float(),t.instantTrackerTransformOrientation());break}}}))}exploreState(){for(let[e,t]of this._pipeline_by_instance){let r=this._pipeline_id_by_pipeline_id.get(e);if(!r)continue;let a=this.serializersByPipelineId.get(r);a&&(a.sendMessage(7,(r=>{r.type(e),r.int(this._impl.pipeline_frame_number(t))})),a.sendMessage(6,(r=>{r.type(e),r.cameraModel(this._impl.pipeline_camera_model(t))})),a.sendMessage(5,(r=>{r.type(e),r.int(this._impl.pipeline_camera_frame_user_data(t))})),a.sendMessage(11,(r=>{r.type(e),r.matrix4x4(this._impl.pipeline_camera_frame_camera_attitude(t))})),a.sendMessage(12,(r=>{r.type(e),r.matrix4x4(this._impl.pipeline_camera_frame_device_attitude(t))})))}for(let[e,t]of this._camera_source_by_instance){let t=this._pipeline_id_by_camera_source_id.get(e);t&&this.serializersByPipelineId.get(t)}for(let[e,t]of this._sequence_source_by_instance){let t=this._pipeline_id_by_sequence_source_id.get(e);t&&this.serializersByPipelineId.get(t)}for(let[e,t]of this._image_tracker_by_instance){let r=this._pipeline_id_by_image_tracker_id.get(e);if(!r)continue;let a=this.serializersByPipelineId.get(r);if(a){a.sendMessage(19,(r=>{r.type(e),r.int(this._impl.image_tracker_target_loaded_version(t))})),a.sendMessage(1,(r=>{r.type(e),r.int(this._impl.image_tracker_anchor_count(t))}));for(let r=0;r<this._impl.image_tracker_anchor_count(t);r++)a.sendMessage(2,(a=>{a.type(e),a.int(r),a.string(this._impl.image_tracker_anchor_id(t,r))}));for(let r=0;r<this._impl.image_tracker_anchor_count(t);r++)a.sendMessage(3,(a=>{a.type(e),a.int(r),a.matrix4x4(this._impl.image_tracker_anchor_pose_raw(t,r))}))}}for(let[e,t]of this._face_tracker_by_instance){let r=this._pipeline_id_by_face_tracker_id.get(e);if(!r)continue;let a=this.serializersByPipelineId.get(r);if(a){a.sendMessage(18,(r=>{r.type(e),r.int(this._impl.face_tracker_model_loaded_version(t))})),a.sendMessage(13,(r=>{r.type(e),r.int(this._impl.face_tracker_anchor_count(t))}));for(let r=0;r<this._impl.face_tracker_anchor_count(t);r++)a.sendMessage(14,(a=>{a.type(e),a.int(r),a.string(this._impl.face_tracker_anchor_id(t,r))}));for(let r=0;r<this._impl.face_tracker_anchor_count(t);r++)a.sendMessage(15,(a=>{a.type(e),a.int(r),a.matrix4x4(this._impl.face_tracker_anchor_pose_raw(t,r))}));for(let r=0;r<this._impl.face_tracker_anchor_count(t);r++)a.sendMessage(16,(a=>{a.type(e),a.int(r),a.identityCoefficients(this._impl.face_tracker_anchor_identity_coefficients(t,r))}));for(let r=0;r<this._impl.face_tracker_anchor_count(t);r++)a.sendMessage(17,(a=>{a.type(e),a.int(r),a.expressionCoefficients(this._impl.face_tracker_anchor_expression_coefficients(t,r))}))}}for(let[e,t]of this._face_mesh_by_instance){let t=this._pipeline_id_by_face_mesh_id.get(e);t&&this.serializersByPipelineId.get(t)}for(let[e,t]of this._face_landmark_by_instance){let t=this._pipeline_id_by_face_landmark_id.get(e);t&&this.serializersByPipelineId.get(t)}for(let[e,t]of this._barcode_finder_by_instance){let r=this._pipeline_id_by_barcode_finder_id.get(e);if(!r)continue;let a=this.serializersByPipelineId.get(r);if(a){a.sendMessage(8,(r=>{r.type(e),r.int(this._impl.barcode_finder_found_number(t))}));for(let r=0;r<this._impl.barcode_finder_found_number(t);r++)a.sendMessage(9,(a=>{a.type(e),a.int(r),a.string(this._impl.barcode_finder_found_text(t,r))}));for(let r=0;r<this._impl.barcode_finder_found_number(t);r++)a.sendMessage(10,(a=>{a.type(e),a.int(r),a.barcodeFormat(this._impl.barcode_finder_found_format(t,r))}))}}for(let[e,t]of this._instant_world_tracker_by_instance){let r=this._pipeline_id_by_instant_world_tracker_id.get(e);if(!r)continue;let a=this.serializersByPipelineId.get(r);a&&a.sendMessage(4,(r=>{r.type(e),r.matrix4x4(this._impl.instant_world_tracker_anchor_pose_raw(t))}))}}}class c{constructor(){this._funcs=[]}bind(e){this._funcs.push(e)}unbind(e){let t=this._funcs.indexOf(e);t>-1&&this._funcs.splice(t,1)}emit(){for(var e=0,t=this._funcs.length;e<t;e++)this._funcs[e]()}}class f{constructor(){this._funcs=[]}bind(e){this._funcs.push(e)}unbind(e){let t=this._funcs.indexOf(e);t>-1&&this._funcs.splice(t,1)}emit(e){for(var t=0,r=this._funcs.length;t<r;t++)this._funcs[t](e)}}var u,l,p,d,h,m,b=r(975);!function(e){e[e.UNKNOWN=131072]="UNKNOWN",e[e.AZTEC=1]="AZTEC",e[e.CODABAR=2]="CODABAR",e[e.CODE_39=4]="CODE_39",e[e.CODE_93=8]="CODE_93",e[e.CODE_128=16]="CODE_128",e[e.DATA_MATRIX=32]="DATA_MATRIX",e[e.EAN_8=64]="EAN_8",e[e.EAN_13=128]="EAN_13",e[e.ITF=256]="ITF",e[e.MAXICODE=512]="MAXICODE",e[e.PDF_417=1024]="PDF_417",e[e.QR_CODE=2048]="QR_CODE",e[e.RSS_14=4096]="RSS_14",e[e.RSS_EXPANDED=8192]="RSS_EXPANDED",e[e.UPC_A=16384]="UPC_A",e[e.UPC_E=32768]="UPC_E",e[e.UPC_EAN_EXTENSION=65536]="UPC_EAN_EXTENSION",e[e.ALL=131071]="ALL"}(u||(u={})),function(e){e[e.EYE_LEFT=0]="EYE_LEFT",e[e.EYE_RIGHT=1]="EYE_RIGHT",e[e.EAR_LEFT=2]="EAR_LEFT",e[e.EAR_RIGHT=3]="EAR_RIGHT",e[e.NOSE_BRIDGE=4]="NOSE_BRIDGE",e[e.NOSE_TIP=5]="NOSE_TIP",e[e.NOSE_BASE=6]="NOSE_BASE",e[e.LIP_TOP=7]="LIP_TOP",e[e.LIP_BOTTOM=8]="LIP_BOTTOM",e[e.MOUTH_CENTER=9]="MOUTH_CENTER",e[e.CHIN=10]="CHIN",e[e.EYEBROW_LEFT=11]="EYEBROW_LEFT",e[e.EYEBROW_RIGHT=12]="EYEBROW_RIGHT"}(l||(l={})),function(e){e[e.WORLD=3]="WORLD",e[e.MINUS_Z_AWAY_FROM_USER=4]="MINUS_Z_AWAY_FROM_USER",e[e.MINUS_Z_HEADING=5]="MINUS_Z_HEADING",e[e.UNCHANGED=6]="UNCHANGED"}(p||(p={})),function(e){e[e.LOG_LEVEL_NONE=0]="LOG_LEVEL_NONE",e[e.LOG_LEVEL_ERROR=1]="LOG_LEVEL_ERROR",e[e.LOG_LEVEL_WARNING=2]="LOG_LEVEL_WARNING",e[e.LOG_LEVEL_VERBOSE=3]="LOG_LEVEL_VERBOSE"}(d||(d={})),function(e){e[e.FRAME_PIXEL_FORMAT_I420=0]="FRAME_PIXEL_FORMAT_I420",e[e.FRAME_PIXEL_FORMAT_I420A=1]="FRAME_PIXEL_FORMAT_I420A",e[e.FRAME_PIXEL_FORMAT_I422=2]="FRAME_PIXEL_FORMAT_I422",e[e.FRAME_PIXEL_FORMAT_I444=3]="FRAME_PIXEL_FORMAT_I444",e[e.FRAME_PIXEL_FORMAT_NV12=4]="FRAME_PIXEL_FORMAT_NV12",e[e.FRAME_PIXEL_FORMAT_RGBA=5]="FRAME_PIXEL_FORMAT_RGBA",e[e.FRAME_PIXEL_FORMAT_BGRA=6]="FRAME_PIXEL_FORMAT_BGRA",e[e.FRAME_PIXEL_FORMAT_Y=7]="FRAME_PIXEL_FORMAT_Y"}(h||(h={})),function(e){e[e.IMAGE_TRACKER_TYPE_PLANAR=0]="IMAGE_TRACKER_TYPE_PLANAR",e[e.IMAGE_TRACKER_TYPE_CYLINDRICAL=1]="IMAGE_TRACKER_TYPE_CYLINDRICAL",e[e.IMAGE_TRACKER_TYPE_CONICAL=2]="IMAGE_TRACKER_TYPE_CONICAL"}(m||(m={}));const g=new Map;class w{constructor(e){this._gl=e,this._viewports=[],this._underlyingViewport=this._gl.viewport,this._viewports.push(this._gl.getParameter(this._gl.VIEWPORT)),this._gl.viewport=(e,t,r,a)=>{this._viewports[this._viewports.length-1]=[e,t,r,a],this._underlyingViewport.call(this._gl,e,t,r,a)}}static get(e){let t=g.get(e);return t||(t=new w(e),g.set(e,t)),t}push(){this._viewports.push(this._viewports[this._viewports.length-1])}pop(){const e=this._viewports.pop(),t=this._viewports[this._viewports.length-1];e&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]||this._underlyingViewport.call(this._gl,t[0],t[1],t[2],t[3])}}var y,v=r(238);!function(e){e[e.OBJECT_URL=0]="OBJECT_URL",e[e.SRC_OBJECT=1]="SRC_OBJECT"}(y||(y={}));let E={deviceMotionMutliplier:-1,blacklisted:!1,showGyroPermissionsWarningIfNecessary:!1,showSafariPermissionsResetIfNecessary:!1,requestHighFrameRate:!1,videoWidth:640,videoHeight:480,dataWidth:320,dataHeight:240,videoElementInDOM:!1,preferMediaStreamTrackProcessorCamera:!1,preferImageBitmapCamera:!1,ios164CameraSelection:!1,relyOnConstraintsForCameraSelection:!1,forceWindowOrientation:!1};"undefined"!=typeof window&&(window.zeeProfile=E,window.location.href.indexOf("_mstppipeline")>=0&&(console.log("Configuring for MSTP camera pipeline (if supported)"),E.preferMediaStreamTrackProcessorCamera=!0),window.location.href.indexOf("_imagebitmappipeline")>=0&&(console.log("Configuring for ImageBitmap camera pipeline (if supported)"),E.preferImageBitmapCamera=!0));let A=new v.UAParser,T=(A.getOS().name||"unknown").toLowerCase(),R=(A.getEngine().name||"unknown").toLowerCase();function x(e){E.forceWindowOrientation=!0;let t=e.split(".");if(t.length>=2){const e=parseInt(t[0]),r=parseInt(t[1]);(e<11||11===e&&r<3)&&(E.blacklisted=!0),(e<12||12===e&&r<2)&&(E.videoElementInDOM=!0),(12===e&&r>=2||e>=13)&&(E.showGyroPermissionsWarningIfNecessary=!0),e>=13&&(E.showSafariPermissionsResetIfNecessary=!0),(e>=12&&r>1||e>=13)&&navigator.mediaDevices&&navigator.mediaDevices.getSupportedConstraints&&navigator.mediaDevices.getSupportedConstraints().frameRate&&(E.requestHighFrameRate=!0,e<14&&(E.videoHeight=360,E.dataHeight=180)),16===e&&r>=4&&(E.ios164CameraSelection=!0),e>=17&&(E.relyOnConstraintsForCameraSelection=!0)}}function k(e,t,r){let a=e.createShader(t);if(!a)throw new Error("Unable to create shader");e.shaderSource(a,r),e.compileShader(a);let n=e.getShaderInfoLog(a);if(n&&n.trim().length>0)throw new Error("Shader compile error: "+n);return a}"webkit"===R&&"ios"!==T&&(E.deviceMotionMutliplier=1,"undefined"!=typeof window&&void 0!==window.orientation&&x("15.0")),"webkit"===R&&"ios"===T&&(E.deviceMotionMutliplier=1,x(A.getOS().version||"15.0"));class L{constructor(e){this._gl=e,this._isPaused=!0,this._hadFrames=!1,this._isUserFacing=!1,this._cameraToScreenRotation=0,this._isUploadFrame=!0,this._computedTransformRotation=-1,this._computedFrontCameraRotation=!1,this._cameraUvTransform=b.Ue(),this._framebufferWidth=0,this._framebufferHeight=0,this._framebufferId=null,this._renderTexture=null,this._isWebGL2=!1,this._isWebGL2=e.getParameter(e.VERSION).indexOf("WebGL 2")>=0,this._isWebGL2||(this._instancedArraysExtension=this._gl.getExtension("ANGLE_instanced_arrays"))}resetGLContext(){this._framebufferId=null,this._renderTexture=null,this._vertexBuffer=void 0,this._indexBuffer=void 0,this._greyscaleShader=void 0}destroy(){this.resetGLContext()}uploadFrame(e,t,r,a){let n=this._gl;const i=w.get(n);i.push();const o=n.isEnabled(n.SCISSOR_TEST),s=n.isEnabled(n.DEPTH_TEST),_=n.isEnabled(n.BLEND),c=n.isEnabled(n.CULL_FACE),f=n.isEnabled(n.STENCIL_TEST),u=n.getParameter(n.ACTIVE_TEXTURE),l=n.getParameter(n.UNPACK_FLIP_Y_WEBGL),p=n.getParameter(n.CURRENT_PROGRAM);n.activeTexture(n.TEXTURE0);const d=n.getParameter(n.TEXTURE_BINDING_2D),h=n.getParameter(n.FRAMEBUFFER_BINDING),m=n.getParameter(n.ARRAY_BUFFER_BINDING),b=n.getParameter(n.ELEMENT_ARRAY_BUFFER_BINDING);n.disable(n.SCISSOR_TEST),n.disable(n.DEPTH_TEST),n.disable(n.BLEND),n.disable(n.CULL_FACE),n.disable(n.STENCIL_TEST),n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,!1),n.bindTexture(n.TEXTURE_2D,e);const g=n.RGBA,y=n.RGBA,v=n.UNSIGNED_BYTE;n.texImage2D(n.TEXTURE_2D,0,g,y,v,t);let A=0,T=0;"undefined"!=typeof HTMLVideoElement&&t instanceof HTMLVideoElement?(A=t.videoWidth,T=t.videoHeight):(A=t.width,T=t.height),T>A&&(T=[A,A=T][0]),this._updateTransforms(r,a);let R=this._getFramebuffer(n,E.dataWidth/4,E.dataHeight),x=this._getVertexBuffer(n),k=this._getIndexBuffer(n),L=this._getGreyscaleShader(n);const F=n.getVertexAttrib(L.aVertexPositionLoc,n.VERTEX_ATTRIB_ARRAY_SIZE),z=n.getVertexAttrib(L.aVertexPositionLoc,n.VERTEX_ATTRIB_ARRAY_TYPE),M=n.getVertexAttrib(L.aVertexPositionLoc,n.VERTEX_ATTRIB_ARRAY_NORMALIZED),I=n.getVertexAttrib(L.aVertexPositionLoc,n.VERTEX_ATTRIB_ARRAY_STRIDE),O=n.getVertexAttribOffset(L.aVertexPositionLoc,n.VERTEX_ATTRIB_ARRAY_POINTER),P=n.getVertexAttrib(L.aVertexPositionLoc,n.VERTEX_ATTRIB_ARRAY_ENABLED),S=n.getVertexAttrib(L.aVertexPositionLoc,n.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING),B=n.getVertexAttrib(L.aTextureCoordLoc,n.VERTEX_ATTRIB_ARRAY_SIZE),C=n.getVertexAttrib(L.aTextureCoordLoc,n.VERTEX_ATTRIB_ARRAY_TYPE),D=n.getVertexAttrib(L.aTextureCoordLoc,n.VERTEX_ATTRIB_ARRAY_NORMALIZED),U=n.getVertexAttrib(L.aTextureCoordLoc,n.VERTEX_ATTRIB_ARRAY_STRIDE),V=n.getVertexAttribOffset(L.aTextureCoordLoc,n.VERTEX_ATTRIB_ARRAY_POINTER),N=n.getVertexAttrib(L.aTextureCoordLoc,n.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING),G=n.getVertexAttrib(L.aTextureCoordLoc,n.VERTEX_ATTRIB_ARRAY_ENABLED);let W=0,H=0;this._isWebGL2?(W=n.getVertexAttrib(L.aVertexPositionLoc,n.VERTEX_ATTRIB_ARRAY_DIVISOR),H=n.getVertexAttrib(L.aTextureCoordLoc,n.VERTEX_ATTRIB_ARRAY_DIVISOR),n.vertexAttribDivisor(L.aVertexPositionLoc,0),n.vertexAttribDivisor(L.aTextureCoordLoc,0)):this._instancedArraysExtension&&(W=n.getVertexAttrib(L.aVertexPositionLoc,this._instancedArraysExtension.VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE),H=n.getVertexAttrib(L.aTextureCoordLoc,this._instancedArraysExtension.VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE),this._instancedArraysExtension.vertexAttribDivisorANGLE(L.aVertexPositionLoc,0),this._instancedArraysExtension.vertexAttribDivisorANGLE(L.aTextureCoordLoc,0)),n.bindFramebuffer(n.FRAMEBUFFER,R),n.viewport(0,0,this._framebufferWidth,this._framebufferHeight),n.clear(n.COLOR_BUFFER_BIT),n.bindBuffer(n.ARRAY_BUFFER,x),n.vertexAttribPointer(L.aVertexPositionLoc,2,n.FLOAT,!1,16,0),n.enableVertexAttribArray(L.aVertexPositionLoc),n.vertexAttribPointer(L.aTextureCoordLoc,2,n.FLOAT,!1,16,8),n.enableVertexAttribArray(L.aTextureCoordLoc),n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,k),n.useProgram(L.program),n.uniform1f(L.uTexWidthLoc,E.dataWidth),n.uniformMatrix4fv(L.uUvTransformLoc,!1,this._cameraUvTransform),n.activeTexture(n.TEXTURE0),n.bindTexture(n.TEXTURE_2D,e),n.uniform1i(L.uSamplerLoc,0),n.drawElements(n.TRIANGLES,6,n.UNSIGNED_SHORT,0),n.bindBuffer(n.ARRAY_BUFFER,S),n.vertexAttribPointer(L.aVertexPositionLoc,F,z,M,I,O),n.bindBuffer(n.ARRAY_BUFFER,N),n.vertexAttribPointer(L.aTextureCoordLoc,B,C,D,U,V),n.bindBuffer(n.ARRAY_BUFFER,m),n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,b),P||n.disableVertexAttribArray(L.aVertexPositionLoc),G||n.disableVertexAttribArray(L.aTextureCoordLoc),this._isWebGL2?(n.vertexAttribDivisor(L.aVertexPositionLoc,W),n.vertexAttribDivisor(L.aTextureCoordLoc,H)):this._instancedArraysExtension&&(this._instancedArraysExtension.vertexAttribDivisorANGLE(L.aVertexPositionLoc,W),this._instancedArraysExtension.vertexAttribDivisorANGLE(L.aTextureCoordLoc,H)),n.bindFramebuffer(n.FRAMEBUFFER,h),n.useProgram(p),n.bindTexture(n.TEXTURE_2D,d),n.activeTexture(u),n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,l),i.pop(),_&&n.enable(n.BLEND),c&&n.enable(n.CULL_FACE),s&&n.enable(n.DEPTH_TEST),o&&n.enable(n.SCISSOR_TEST),f&&n.enable(n.STENCIL_TEST)}readFrame(e,t){let r=this._gl,a=new Uint8Array(t);const n=r.getParameter(r.FRAMEBUFFER_BINDING);let i=this._getFramebuffer(r,E.dataWidth/4,E.dataHeight);return r.bindFramebuffer(r.FRAMEBUFFER,i),r.readPixels(0,0,this._framebufferWidth,this._framebufferHeight,r.RGBA,r.UNSIGNED_BYTE,a),r.bindFramebuffer(r.FRAMEBUFFER,n),{uvTransform:this._cameraUvTransform,data:t,texture:e,dataWidth:E.dataWidth,dataHeight:E.dataHeight,userFacing:this._computedFrontCameraRotation}}_updateTransforms(e,t){e==this._computedTransformRotation&&t==this._computedFrontCameraRotation||(this._computedTransformRotation=e,this._computedFrontCameraRotation=t,this._cameraUvTransform=this._getCameraUvTransform())}_getCameraUvTransform(){switch(this._computedTransformRotation){case 270:return new Float32Array([0,1,0,0,-1,0,0,0,0,0,1,0,1,0,0,1]);case 180:return new Float32Array([-1,0,0,0,0,-1,0,0,0,0,1,0,1,1,0,1]);case 90:return new Float32Array([0,-1,0,0,1,0,0,0,0,0,1,0,0,1,0,1])}return new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}_getFramebuffer(e,t,r){if(this._framebufferWidth===t&&this._framebufferHeight===r&&this._framebufferId)return this._framebufferId;if(this._framebufferId&&(e.deleteFramebuffer(this._framebufferId),this._framebufferId=null),this._renderTexture&&(e.deleteTexture(this._renderTexture),this._renderTexture=null),this._framebufferId=e.createFramebuffer(),!this._framebufferId)throw new Error("Unable to create framebuffer");if(e.bindFramebuffer(e.FRAMEBUFFER,this._framebufferId),this._renderTexture=e.createTexture(),!this._renderTexture)throw new Error("Unable to create render texture");e.activeTexture(e.TEXTURE0);const a=e.getParameter(e.TEXTURE_BINDING_2D);e.bindTexture(e.TEXTURE_2D,this._renderTexture),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,t,r,0,e.RGBA,e.UNSIGNED_BYTE,null),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texParameterf(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,this._renderTexture,0);let n=e.checkFramebufferStatus(e.FRAMEBUFFER);if(n!==e.FRAMEBUFFER_COMPLETE)throw new Error("Framebuffer not complete: "+n.toString());return this._framebufferWidth=t,this._framebufferHeight=r,e.bindTexture(e.TEXTURE_2D,a),e.bindFramebuffer(e.FRAMEBUFFER,null),this._framebufferId}_getVertexBuffer(e){if(this._vertexBuffer)return this._vertexBuffer;if(this._vertexBuffer=e.createBuffer(),!this._vertexBuffer)throw new Error("Unable to create vertex buffer");e.bindBuffer(e.ARRAY_BUFFER,this._vertexBuffer);let t=new Float32Array([-1,-1,0,0,-1,1,0,1,1,1,1,1,1,-1,1,0]);return e.bufferData(e.ARRAY_BUFFER,t,e.STATIC_DRAW),this._vertexBuffer}_getIndexBuffer(e){if(this._indexBuffer)return this._indexBuffer;if(this._indexBuffer=e.createBuffer(),!this._indexBuffer)throw new Error("Unable to create index buffer");e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,this._indexBuffer);let t=new Uint16Array([0,1,2,0,2,3]);return e.bufferData(e.ELEMENT_ARRAY_BUFFER,t,e.STATIC_DRAW),this._indexBuffer}_getGreyscaleShader(e){if(this._greyscaleShader)return this._greyscaleShader;let t=e.createProgram();if(!t)throw new Error("Unable to create program");let r=k(e,e.VERTEX_SHADER,O),a=k(e,e.FRAGMENT_SHADER,P);e.attachShader(t,r),e.attachShader(t,a),function(e,t){e.linkProgram(t);let r=e.getProgramInfoLog(t);if(r&&r.trim().length>0)throw new Error("Unable to link: "+r)}(e,t);let n=e.getUniformLocation(t,"uTexWidth");if(!n)throw new Error("Unable to get uniform location uTexWidth");let i=e.getUniformLocation(t,"uUvTransform");if(!i)throw new Error("Unable to get uniform location uUvTransform");let o=e.getUniformLocation(t,"uSampler");if(!o)throw new Error("Unable to get uniform location uSampler");return this._greyscaleShader={program:t,aVertexPositionLoc:e.getAttribLocation(t,"aVertexPosition"),aTextureCoordLoc:e.getAttribLocation(t,"aTextureCoord"),uTexWidthLoc:n,uUvTransformLoc:i,uSamplerLoc:o},this._greyscaleShader}}let F,z,M,I,O="\n attribute vec4 aVertexPosition;\n attribute vec2 aTextureCoord;\n\n varying highp vec2 vTextureCoord1;\n varying highp vec2 vTextureCoord2;\n varying highp vec2 vTextureCoord3;\n varying highp vec2 vTextureCoord4;\n\n uniform float uTexWidth;\n\tuniform mat4 uUvTransform;\n\n void main(void) {\n highp vec2 offset1 = vec2(1.5 / uTexWidth, 0);\n highp vec2 offset2 = vec2(0.5 / uTexWidth, 0);\n\n gl_Position = aVertexPosition;\n vTextureCoord1 = (uUvTransform * vec4(aTextureCoord - offset1, 0, 1)).xy;\n vTextureCoord2 = (uUvTransform * vec4(aTextureCoord - offset2, 0, 1)).xy;\n vTextureCoord3 = (uUvTransform * vec4(aTextureCoord + offset2, 0, 1)).xy;\n vTextureCoord4 = (uUvTransform * vec4(aTextureCoord + offset1, 0, 1)).xy;\n }\n",P="\n varying highp vec2 vTextureCoord1;\n varying highp vec2 vTextureCoord2;\n varying highp vec2 vTextureCoord3;\n varying highp vec2 vTextureCoord4;\n\n uniform sampler2D uSampler;\n\n const lowp vec3 colorWeights = vec3(77.0 / 256.0, 150.0 / 256.0, 29.0 / 256.0);\n\n void main(void) {\n lowp vec4 outpx;\n\n outpx.r = dot(colorWeights, texture2D(uSampler, vTextureCoord1).xyz);\n outpx.g = dot(colorWeights, texture2D(uSampler, vTextureCoord2).xyz);\n outpx.b = dot(colorWeights, texture2D(uSampler, vTextureCoord3).xyz);\n outpx.a = dot(colorWeights, texture2D(uSampler, vTextureCoord4).xyz);\n\n gl_FragColor = outpx;\n }\n";var S=function(e,t,r,a){return new(r||(r=Promise))((function(n,i){function o(e){try{_(a.next(e))}catch(e){i(e)}}function s(e){try{_(a.throw(e))}catch(e){i(e)}}function _(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,s)}_((a=a.apply(e,t||[])).next())}))};let B=new class{constructor(){this.onOutgoingMessage=new c,this.onIncomingMessage=new f,this._outgoingMessages=[]}postIncomingMessage(e){this.onIncomingMessage.emit(e)}postOutgoingMessage(e,t){this._outgoingMessages.push({msg:e,transferables:t}),this.onOutgoingMessage.emit()}getOutgoingMessages(){let e=this._outgoingMessages;return this._outgoingMessages=[],e}},C=0;function D(e){return S(this,void 0,void 0,(function*(){let t=i({locateFile:(t,r)=>t.endsWith("zappar-cv.wasm")?e:r+t,onRuntimeInitialized:()=>{let e=function(e){let t=e.cwrap("zappar_log_level","number",[]),r=e.cwrap("zappar_log_level_set",null,["number"]),a=e.cwrap("zappar_analytics_project_id_set",null,["string","string"]),n=e.cwrap("zappar_pipeline_create","number",[]),i=e.cwrap("zappar_pipeline_destroy",null,["number"]),o=e.cwrap("zappar_pipeline_frame_update",null,["number"]),s=e.cwrap("zappar_pipeline_frame_number","number",["number"]),_=e.cwrap("zappar_pipeline_camera_model","number",["number"]),c=e.cwrap("zappar_pipeline_camera_frame_user_data","number",["number"]),f=e.cwrap("zappar_pipeline_camera_frame_submit",null,["number","number","number","number","number","number","number","number","number"]),u=e.cwrap("zappar_pipeline_camera_frame_submit_raw_pointer",null,["number","number","number","number","number","number","number","number","number","number","number"]),l=e.cwrap("zappar_pipeline_camera_frame_camera_attitude","number",["number"]),p=e.cwrap("zappar_pipeline_camera_frame_device_attitude","number",["number"]),d=e.cwrap("zappar_pipeline_motion_accelerometer_submit",null,["number","number","number","number","number"]),h=e.cwrap("zappar_pipeline_motion_rotation_rate_submit",null,["number","number","number","number","number"]),m=e.cwrap("zappar_pipeline_motion_attitude_submit",null,["number","number","number","number","number"]),b=e.cwrap("zappar_pipeline_motion_attitude_matrix_submit",null,["number","number"]),g=e.cwrap("zappar_camera_source_create","number",["number","string"]),w=e.cwrap("zappar_camera_source_destroy",null,["number"]),y=e.cwrap("zappar_sequence_source_create","number",["number"]),v=e.cwrap("zappar_sequence_source_destroy",null,["number"]),E=e.cwrap("zappar_image_tracker_create","number",["number"]),A=e.cwrap("zappar_image_tracker_destroy",null,["number"]),T=e.cwrap("zappar_image_tracker_target_load_from_memory",null,["number","number","number"]),R=e.cwrap("zappar_image_tracker_target_loaded_version","number",["number"]),x=e.cwrap("zappar_image_tracker_enabled","number",["number"]),k=e.cwrap("zappar_image_tracker_enabled_set",null,["number","number"]),L=e.cwrap("zappar_image_tracker_anchor_count","number",["number"]),F=e.cwrap("zappar_image_tracker_anchor_id","string",["number","number"]),z=e.cwrap("zappar_image_tracker_anchor_pose_raw","number",["number","number"]),M=e.cwrap("zappar_face_tracker_create","number",["number"]),I=e.cwrap("zappar_face_tracker_destroy",null,["number"]),O=e.cwrap("zappar_face_tracker_model_load_from_memory",null,["number","number","number"]),P=e.cwrap("zappar_face_tracker_model_loaded_version","number",["number"]),S=e.cwrap("zappar_face_tracker_enabled_set",null,["number","number"]),B=e.cwrap("zappar_face_tracker_enabled","number",["number"]),C=e.cwrap("zappar_face_tracker_max_faces_set",null,["number","number"]),D=e.cwrap("zappar_face_tracker_max_faces","number",["number"]),U=e.cwrap("zappar_face_tracker_anchor_count","number",["number"]),V=e.cwrap("zappar_face_tracker_anchor_id","string",["number","number"]),N=e.cwrap("zappar_face_tracker_anchor_pose_raw","number",["number","number"]),G=e.cwrap("zappar_face_tracker_anchor_identity_coefficients","number",["number","number"]),W=e.cwrap("zappar_face_tracker_anchor_expression_coefficients","number",["number","number"]),H=e.cwrap("zappar_face_mesh_create","number",[]),q=e.cwrap("zappar_face_mesh_destroy",null,["number"]),Y=e.cwrap("zappar_face_landmark_create","number",["number"]),X=e.cwrap("zappar_face_landmark_destroy",null,["number"]),Z=e.cwrap("zappar_barcode_finder_create","number",["number"]),j=e.cwrap("zappar_barcode_finder_destroy",null,["number"]),K=e.cwrap("zappar_barcode_finder_enabled_set",null,["number","number"]),J=e.cwrap("zappar_barcode_finder_enabled","number",["number"]),$=e.cwrap("zappar_barcode_finder_found_number","number",["number"]),Q=e.cwrap("zappar_barcode_finder_found_text","string",["number","number"]),ee=e.cwrap("zappar_barcode_finder_found_format","number",["number","number"]),te=e.cwrap("zappar_barcode_finder_formats","number",["number"]),re=e.cwrap("zappar_barcode_finder_formats_set",null,["number","number"]),ae=e.cwrap("zappar_instant_world_tracker_create","number",["number"]),ne=e.cwrap("zappar_instant_world_tracker_destroy",null,["number"]),ie=e.cwrap("zappar_instant_world_tracker_enabled_set",null,["number","number"]),oe=e.cwrap("zappar_instant_world_tracker_enabled","number",["number"]),se=e.cwrap("zappar_instant_world_tracker_anchor_pose_raw","number",["number"]),_e=e.cwrap("zappar_instant_world_tracker_anchor_pose_set_from_camera_offset_raw",null,["number","number","number","number","number"]),ce=32,fe=e._malloc(ce),ue=(e._malloc(64),new Map),le=(t,r)=>{let a=ue.get(t);return(!a||a[0]<r)&&(a&&e._free(a[1]),a=[r,e._malloc(r)],ue.set(t,a)),a[1]};return{log_level:()=>t(),log_level_set:e=>r(e),analytics_project_id_set:(e,t)=>a(e,t),pipeline_create:()=>n(),pipeline_destroy:()=>{i()},pipeline_frame_update:e=>o(e),pipeline_frame_number:e=>s(e),pipeline_camera_model:t=>{let r=_(t),a=new Float32Array(6);return a.set(e.HEAPF32.subarray(r/4,6+r/4)),r=a,r},pipeline_camera_frame_user_data:e=>c(e),pipeline_camera_frame_submit:(t,r,a,n,i,o,s,_)=>{ce<r.byteLength&&(e._free(fe),ce=r.byteLength,fe=e._malloc(ce));let c=fe,u=r.byteLength;e.HEAPU8.set(new Uint8Array(r),fe);let l=a,p=n,d=i,h=le(4,o.byteLength);e.HEAPF32.set(o,h/4);let m=le(5,s.byteLength);return e.HEAPF32.set(s,m/4),f(t,c,u,l,p,d,h,m,_?1:0)},pipeline_camera_frame_submit_raw_pointer:(t,r,a,n,i,o,s,_,c,f,l)=>{let p=r,d=a,h=n,m=i,b=o,g=s,w=le(6,_.byteLength);e.HEAPF32.set(_,w/4);let y=c,v=le(8,f.byteLength);return e.HEAPF32.set(f,v/4),u(t,p,d,h,m,b,g,w,y,v,l?1:0)},pipeline_camera_frame_camera_attitude:t=>{let r=l(t),a=new Float32Array(16);return a.set(e.HEAPF32.subarray(r/4,16+r/4)),r=a,r},pipeline_camera_frame_device_attitude:t=>{let r=p(t),a=new Float32Array(16);return a.set(e.HEAPF32.subarray(r/4,16+r/4)),r=a,r},pipeline_motion_accelerometer_submit:(e,t,r,a,n)=>d(e,t,r,a,n),pipeline_motion_rotation_rate_submit:(e,t,r,a,n)=>h(e,t,r,a,n),pipeline_motion_attitude_submit:(e,t,r,a,n)=>m(e,t,r,a,n),pipeline_motion_attitude_matrix_submit:(t,r)=>{let a=le(0,r.byteLength);return e.HEAPF32.set(r,a/4),b(t,a)},camera_source_create:(e,t)=>g(e,t),camera_source_destroy:()=>{w()},sequence_source_create:e=>y(e),sequence_source_destroy:()=>{v()},image_tracker_create:e=>E(e),image_tracker_destroy:()=>{A()},image_tracker_target_load_from_memory:(t,r)=>{ce<r.byteLength&&(e._free(fe),ce=r.byteLength,fe=e._malloc(ce));let a=fe,n=r.byteLength;return e.HEAPU8.set(new Uint8Array(r),fe),T(t,a,n)},image_tracker_target_loaded_version:e=>R(e),image_tracker_enabled:e=>{let t=x(e);return t=1===t,t},image_tracker_enabled_set:(e,t)=>k(e,t?1:0),image_tracker_anchor_count:e=>L(e),image_tracker_anchor_id:(e,t)=>F(e,t),image_tracker_anchor_pose_raw:(t,r)=>{let a=z(t,r),n=new Float32Array(16);return n.set(e.HEAPF32.subarray(a/4,16+a/4)),a=n,a},face_tracker_create:e=>M(e),face_tracker_destroy:()=>{I()},face_tracker_model_load_from_memory:(t,r)=>{ce<r.byteLength&&(e._free(fe),ce=r.byteLength,fe=e._malloc(ce));let a=fe,n=r.byteLength;return e.HEAPU8.set(new Uint8Array(r),fe),O(t,a,n)},face_tracker_model_loaded_version:e=>P(e),face_tracker_enabled_set:(e,t)=>S(e,t?1:0),face_tracker_enabled:e=>{let t=B(e);return t=1===t,t},face_tracker_max_faces_set:(e,t)=>C(e,t),face_tracker_max_faces:e=>D(e),face_tracker_anchor_count:e=>U(e),face_tracker_anchor_id:(e,t)=>V(e,t),face_tracker_anchor_pose_raw:(t,r)=>{let a=N(t,r),n=new Float32Array(16);return n.set(e.HEAPF32.subarray(a/4,16+a/4)),a=n,a},face_tracker_anchor_identity_coefficients:(t,r)=>{let a=G(t,r),n=new Float32Array(50);return n.set(e.HEAPF32.subarray(a/4,50+a/4)),a=n,a},face_tracker_anchor_expression_coefficients:(t,r)=>{let a=W(t,r),n=new Float32Array(29);return n.set(e.HEAPF32.subarray(a/4,29+a/4)),a=n,a},face_mesh_create:()=>H(),face_mesh_destroy:()=>{q()},face_landmark_create:e=>Y(e),face_landmark_destroy:()=>{X()},barcode_finder_create:e=>Z(e),barcode_finder_destroy:()=>{j()},barcode_finder_enabled_set:(e,t)=>K(e,t?1:0),barcode_finder_enabled:e=>{let t=J(e);return t=1===t,t},barcode_finder_found_number:e=>$(e),barcode_finder_found_text:(e,t)=>Q(e,t),barcode_finder_found_format:(e,t)=>ee(e,t),barcode_finder_formats:e=>te(e),barcode_finder_formats_set:(e,t)=>re(e,t),instant_world_tracker_create:e=>ae(e),instant_world_tracker_destroy:()=>{ne()},instant_world_tracker_enabled_set:(e,t)=>ie(e,t?1:0),instant_world_tracker_enabled:e=>{let t=oe(e);return t=1===t,t},instant_world_tracker_anchor_pose_raw:t=>{let r=se(t),a=new Float32Array(16);return a.set(e.HEAPF32.subarray(r/4,16+r/4)),r=a,r},instant_world_tracker_anchor_pose_set_from_camera_offset_raw:(e,t,r,a,n)=>_e(e,t,r,a,n)}}(t),r=new _(e,((e,t)=>{B.postOutgoingMessage({p:e,t:"zappar",d:t},[t])}));B.postOutgoingMessage("loaded",[]),B.onIncomingMessage.bind((a=>{var n;switch(a.t){case"zappar":r.processBuffer(a.d),B.postOutgoingMessage({t:"buf",d:a.d},[a.d]);break;case"buf":null===(n=r.serializersByPipelineId.get(a.p))||void 0===n||n.bufferReturn(a.d);break;case"cameraFrameC2S":{let t,n=a,i=r._pipeline_by_instance.get(n.p);i&&(e.pipeline_camera_frame_submit(i,n.d,n.width,n.height,n.token,n.c2d,n.cm,n.userFacing),e.pipeline_frame_update(i),t=e.pipeline_camera_frame_device_attitude(i),r.exploreState());let o={token:n.token,d:n.d,p:n.p,t:"cameraFrameRecycleS2C",att:t};B.postOutgoingMessage(o,[n.d]);break}case"streamC2S":{let n=a;!function(e,t,r,a,n,i,o){S(this,void 0,void 0,(function*(){const s=yield r.getReader();for(;;){let r=yield s.read();if(r.done)return void console.log("Stream done");let _=r.value,c=_.allocationSize();c>V&&(U>0&&e._free(U),U=e._malloc(c),V=c),yield _.copyTo(e.HEAPU8.subarray(U,U+V));let f=N;N++;const u=_.visibleRect.width,l=_.visibleRect.height;let p,d=u,h=l;switch(C){case 270:p=new Float32Array([0,1,0,0,-1,0,0,0,0,0,1,0,1,0,0,1]),d=l,h=u;break;case 180:p=new Float32Array([-1,0,0,0,0,-1,0,0,0,0,1,0,1,1,0,1]);break;case 90:p=new Float32Array([0,-1,0,0,1,0,0,0,0,0,1,0,0,1,0,1]),d=l,h=u;break;default:p=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}let m=_.clone();n?b.xJ(G,[-1,1,-1]):b.yR(G);let g=300*E.dataWidth/320;W[0]=g,W[1]=g,W[2]=.5*E.dataWidth,W[3]=.5*E.dataHeight;const w={token:f,d:m,p:a,t:"videoFrameS2C",userFacing:n,uvTransform:p,w:d,h,cameraToDevice:G,cameraModel:W,source:o};B.postOutgoingMessage(w,[w.d,w.uvTransform.buffer]);const y=i._pipeline_by_instance.get(a);y&&(t.pipeline_camera_frame_submit_raw_pointer(y,U,c,H(_.format),u,l,f,G,C,W,n),t.pipeline_frame_update(y),i.exploreState()),_.close()}}))}(t,e,n.s,n.p,n.userFacing,r,n.source);break}case"cameraToScreenC2S":C=a.r;break;case"imageBitmapC2S":!function(e,t,r,a){const[n,i]=function(){if(!M||!I){const e=new OffscreenCanvas(1,1);if(I=e.getContext("webgl"),!I)throw new Error("Unable to get offscreen GL context");M=new L(I)}return[M,I]}();if(z||(z=i.createTexture(),i.bindTexture(i.TEXTURE_2D,z),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,i.LINEAR)),!z)return;(!F||F.byteLength<E.dataWidth*E.dataHeight)&&(console.log("Generating pixel buffer",E.dataWidth*E.dataHeight),F=new ArrayBuffer(E.dataWidth*E.dataHeight)),n.uploadFrame(z,e.i,e.r,e.userFacing);let o=n.readFrame(z,F),s={t:"imageBitmapS2C",dataWidth:o.dataWidth,dataHeight:o.dataHeight,frame:e.i,userFacing:o.userFacing,uvTransform:o.uvTransform||b.Ue(),tokenId:e.tokenId,p:e.p};a.postOutgoingMessage(s,[e.i]);let _=r._pipeline_by_instance.get(e.p);_&&(t.pipeline_camera_frame_submit(_,F,o.dataWidth,o.dataHeight,e.tokenId,e.cameraToDevice,e.cameraModel,o.userFacing),t.pipeline_frame_update(_),r.exploreState())}(a,e,r,B)}}))}})}))}let U=0,V=0,N=1;const G=b.Ue(),W=new Float32Array([300,300,160,120,0,0]);function H(e){switch(e){case"I420":return h.FRAME_PIXEL_FORMAT_I420;case"I420A":return h.FRAME_PIXEL_FORMAT_I420A;case"I422":return h.FRAME_PIXEL_FORMAT_I422;case"I444":return h.FRAME_PIXEL_FORMAT_I444;case"NV12":return h.FRAME_PIXEL_FORMAT_NV12;case"RGBA":case"RGBX":return h.FRAME_PIXEL_FORMAT_RGBA;case"BGRA":case"BGRX":return h.FRAME_PIXEL_FORMAT_BGRA}return h.FRAME_PIXEL_FORMAT_Y}const q=self;B.onOutgoingMessage.bind((()=>{let e=B.getOutgoingMessages();for(let t of e)q.postMessage(t.msg,t.transferables)}));let Y=e=>{e&&e.data&&"wasm"===e.data.t&&(D(location.href.startsWith("blob")?e.data.url:new URL(r(751),r.b).toString()),q.removeEventListener("message",Y))};q.addEventListener("message",Y),q.addEventListener("message",(e=>{B.postIncomingMessage(e.data)}))},751:(e,t,r)=>{e.exports=r.p+"c85c7df8e3132b359723.wasm"}},a={};function n(e){var t=a[e];if(void 0!==t)return t.exports;var i=a[e]={exports:{}};return r[e].call(i.exports,i,i.exports,n),i.exports}return n.m=r,n.x=()=>{var e=n.O(void 0,[169],(()=>n(56)));return n.O(e)},n.amdO={},e=[],n.O=(t,r,a,i)=>{if(!r){var o=1/0;for(f=0;f<e.length;f++){for(var[r,a,i]=e[f],s=!0,_=0;_<r.length;_++)(!1&i||o>=i)&&Object.keys(n.O).every((e=>n.O[e](r[_])))?r.splice(_--,1):(s=!1,i<o&&(o=i));if(s){e.splice(f--,1);var c=a();void 0!==c&&(t=c)}}return t}i=i||0;for(var f=e.length;f>0&&e[f-1][2]>i;f--)e[f]=e[f-1];e[f]=[r,a,i]},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce(((t,r)=>(n.f[r](e,t),t)),[])),n.u=e=>e+".zappar-cv.js",n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e;n.g.importScripts&&(e=n.g.location+"");var t=n.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName("script");r.length&&(e=r[r.length-1].src)}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=e})(),(()=>{n.b=self.location+"";var e={56:1};n.f.i=(t,r)=>{e[t]||importScripts(n.p+n.u(t))};var t=self.webpackChunkZCV=self.webpackChunkZCV||[],r=t.push.bind(t);t.push=t=>{var[a,i,o]=t;for(var s in i)n.o(i,s)&&(n.m[s]=i[s]);for(o&&o(n);a.length;)e[a.pop()]=1;r(t)}})(),t=n.x,n.x=()=>n.e(169).then(t),n.x()})()}));