@zappar/zappar-cv 0.4.0-beta.4 → 2.0.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (100) hide show
  1. package/CHANGELOG.md +91 -34
  2. package/README.md +2 -2
  3. package/lib/additional.d.ts +2 -1
  4. package/lib/additional.js +1 -2
  5. package/lib/camera-source-map.d.ts +10 -0
  6. package/lib/camera-source-map.js +32 -0
  7. package/lib/camera-source.d.ts +2 -5
  8. package/lib/camera-source.js +18 -32
  9. package/lib/cameramodel.js +18 -23
  10. package/lib/compatibility.js +2 -4
  11. package/lib/deserializer.js +1 -5
  12. package/lib/direct.js +12 -16
  13. package/lib/drawcamera.js +27 -31
  14. package/lib/drawface.js +5 -9
  15. package/lib/drawfaceproject.js +5 -9
  16. package/lib/drawplane.js +6 -11
  17. package/lib/event.js +5 -13
  18. package/lib/facelandmark.d.ts +1 -2
  19. package/lib/facelandmark.js +11 -18
  20. package/lib/facelandmarkdata.js +1 -4
  21. package/lib/facelandmarkinterface.js +1 -2
  22. package/lib/facemesh.js +10 -17
  23. package/lib/gen/zappar-client.js +11 -25
  24. package/lib/gen/zappar-cwrap.js +38 -33
  25. package/lib/gen/zappar-native.d.ts +11 -1
  26. package/lib/gen/zappar-native.js +20 -11
  27. package/lib/gen/zappar-server.js +6 -14
  28. package/lib/gen/zappar.d.ts +12 -0
  29. package/lib/gen/zappar.js +5 -11
  30. package/lib/gfx.d.ts +1 -0
  31. package/lib/gfx.js +1 -0
  32. package/lib/gl-state-manager.d.ts +9 -0
  33. package/lib/gl-state-manager.js +31 -0
  34. package/lib/html-element-source.d.ts +3 -20
  35. package/lib/html-element-source.js +39 -287
  36. package/lib/image-process-gl.d.ts +37 -0
  37. package/lib/image-process-gl.js +306 -0
  38. package/lib/imagebitmap-camera-source.d.ts +36 -0
  39. package/lib/imagebitmap-camera-source.js +273 -0
  40. package/lib/imagetracker.d.ts +28 -0
  41. package/lib/imagetracker.js +115 -0
  42. package/lib/index-standalone.d.ts +3 -0
  43. package/lib/index-standalone.js +5 -0
  44. package/lib/index.d.ts +2 -1
  45. package/lib/index.js +6 -27
  46. package/lib/landmarkdatagenerate.js +25 -30
  47. package/lib/loglevel.js +9 -16
  48. package/lib/messages.js +4 -8
  49. package/lib/mstp-camera-source.d.ts +29 -0
  50. package/lib/mstp-camera-source.js +226 -0
  51. package/lib/native.d.ts +2 -1
  52. package/lib/native.js +229 -130
  53. package/lib/options.d.ts +3 -0
  54. package/lib/options.js +1 -0
  55. package/lib/permission.js +13 -27
  56. package/lib/pipeline.d.ts +14 -5
  57. package/lib/pipeline.js +125 -61
  58. package/lib/profile.d.ts +2 -0
  59. package/lib/profile.js +59 -53
  60. package/lib/riff-reader.d.ts +18 -0
  61. package/lib/riff-reader.js +52 -0
  62. package/lib/sequencerecorder.d.ts +1 -0
  63. package/lib/sequencerecorder.js +17 -11
  64. package/lib/sequencesource.d.ts +7 -1
  65. package/lib/sequencesource.js +102 -64
  66. package/lib/serializer.js +1 -5
  67. package/lib/shader.js +2 -7
  68. package/lib/source.d.ts +6 -4
  69. package/lib/source.js +1 -5
  70. package/lib/version.d.ts +1 -1
  71. package/lib/version.js +1 -4
  72. package/lib/worker-client.d.ts +1 -1
  73. package/lib/worker-client.js +9 -26
  74. package/lib/worker-imagebitmap.d.ts +5 -0
  75. package/lib/worker-imagebitmap.js +59 -0
  76. package/lib/worker-server.d.ts +0 -5
  77. package/lib/worker-server.js +133 -41
  78. package/lib/worker.js +6 -10
  79. package/lib/workerinterface.d.ts +47 -1
  80. package/lib/workerinterface.js +1 -2
  81. package/lib/zcv.js +117 -135
  82. package/lib/zcv.wasm +0 -0
  83. package/package.json +33 -32
  84. package/umd/169.zappar-cv.js +1 -0
  85. package/umd/{482727c0e7dd40d73f5aae47f238ad61.zbin → 482727c0e7dd40d73f5a.zbin} +0 -0
  86. package/umd/6a8309f88f836a752c68.wasm +0 -0
  87. package/umd/752.zappar-cv.js +1 -0
  88. package/umd/{b4f46e148a3b3b5aef90717d8d60e3fc.zbin → b4f46e148a3b3b5aef90.zbin} +0 -0
  89. package/umd/{f7b62a3a53b5c9b3222ba8dc53cb8b11.zbin → f7b62a3a53b5c9b3222b.zbin} +0 -0
  90. package/umd/zappar-cv.js +1 -9
  91. package/umd/zappar-cv.worker.js +1 -1
  92. package/lib/bundleworker-mainthread.d.ts +0 -2
  93. package/lib/bundleworker-mainthread.js +0 -36
  94. package/lib/bundleworker-worker.d.ts +0 -6
  95. package/lib/bundleworker-worker.js +0 -34
  96. package/lib/zcv-slam.js +0 -16
  97. package/lib/zcv-slam.wasm +0 -0
  98. package/umd/1ec038c18c27f4adf35917a8175401f0.wasm +0 -0
  99. package/umd/9c0b0dcf514b48c05541.bundleworker.js +0 -1
  100. package/umd/d115e485cffe500afc4f7c1272ea8f62.wasm +0 -0
package/lib/zcv.wasm CHANGED
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zappar/zappar-cv",
3
- "version": "0.4.0-beta.4",
3
+ "version": "2.0.0-beta.0",
4
4
  "description": "Zappar's core computer vision library, supporting image, face and world tracking.",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -10,8 +10,8 @@
10
10
  "build-module": "tsc",
11
11
  "test-module": "jest puppeteer/module",
12
12
  "test-standalone": "jest puppeteer/standalone",
13
- "tests": "webpack --config=webpack.tests.config.js --mode=development && webpack-dev-server --config=webpack.tests.config.js",
14
- "webpack-puppeteer": "webpack --config=webpack.config.puppeteer.js --mode=development && webpack-dev-server --config=webpack.config.puppeteer.js",
13
+ "tests": "webpack --config=webpack.tests.config.js --mode=development && webpack serve --mode=development --config=webpack.tests.config.js",
14
+ "webpack-puppeteer": "webpack --config=webpack.config.puppeteer.js --mode=development && webpack serve --config=webpack.config.puppeteer.js",
15
15
  "standalone-test-serve": "concurrently 'zapworks serve --port 7010 umd' 'zapworks serve --port 7011 puppeteer-standalone-dist' || true",
16
16
  "standalone-test-serve2": "zapworks serve --port 7011 puppeteer-standalone-dist"
17
17
  },
@@ -25,36 +25,37 @@
25
25
  "upkg": "umd/zappar-cv.js",
26
26
  "license": "Proprietary",
27
27
  "devDependencies": {
28
- "@types/expect-puppeteer": "^4.4.5",
29
- "@types/jest-environment-puppeteer": "^4.4.1",
30
- "@types/node": "^14.14.7",
31
- "@types/pixelmatch": "^5.2.2",
32
- "@types/pngjs": "^6.0.0",
33
- "@types/puppeteer": "^5.4.3",
34
- "@zappar/zapworks-cli": "^0.6.17",
35
- "concurrently": "^5.3.0",
36
- "dat.gui": "^0.7.7",
37
- "html-webpack-plugin": "^4.5.0",
38
- "jest": "^26.6.3",
39
- "jest-puppeteer": "^4.4.0",
40
- "jsdoc": "^3.6.7",
41
- "pixelmatch": "^5.2.1",
42
- "pngjs": "^6.0.0",
43
- "puppeteer": "^7.1.0",
44
- "ts-jest": "^26.5.1",
45
- "ts-loader": "^8.0.11",
46
- "ts-node": "^9.1.1",
47
- "typescript": "^4.0.5",
48
- "webpack": "^4.41.5",
49
- "webpack-cli": "^3.3.10",
50
- "webpack-dev-server": "^3.11.0"
28
+ "@types/dom-mediacapture-transform": "0.1.1",
29
+ "@types/dom-webcodecs": "0.1.2",
30
+ "@types/expect-puppeteer": "4.4.5",
31
+ "@types/jest-environment-puppeteer": "4.4.1",
32
+ "@types/node": "14.14.7",
33
+ "@types/offscreencanvas": "2019.6.4",
34
+ "@types/pixelmatch": "5.2.2",
35
+ "@types/pngjs": "6.0.0",
36
+ "@types/puppeteer": "5.4.3",
37
+ "@types/ua-parser-js": "0.7.33",
38
+ "@zappar/zapworks-cli": "0.6.17",
39
+ "concurrently": "5.3.0",
40
+ "dat.gui": "0.7.7",
41
+ "html-webpack-plugin": "5.5.0",
42
+ "jest": "26.6.3",
43
+ "jest-puppeteer": "6.0.2",
44
+ "jsdoc": "3.6.7",
45
+ "pixelmatch": "5.2.1",
46
+ "pngjs": "6.0.0",
47
+ "puppeteer": "7.1.0",
48
+ "ts-jest": "26.5.1",
49
+ "ts-loader": "9.2.6",
50
+ "ts-node": "9.1.1",
51
+ "typescript": "4.0.5",
52
+ "webpack": "5.68.0",
53
+ "webpack-cli": "4.9.2",
54
+ "webpack-dev-server": "^4.7.3",
55
+ "worker-loader": "^3.0.8"
51
56
  },
52
57
  "dependencies": {
53
- "@types/gl-matrix": "^2.4.5",
54
- "@types/ua-parser-js": "^0.7.33",
55
- "file-loader": "^6.2.0",
56
- "gl-matrix": "3.1.0",
57
- "ua-parser-js": "^0.7.28",
58
- "worker-loader": "^3.0.5"
58
+ "gl-matrix": "3.4.3",
59
+ "ua-parser-js": "0.7.30"
59
60
  }
60
61
  }
@@ -0,0 +1 @@
1
+ (self.webpackChunkZCV=self.webpackChunkZCV||[]).push([[169],{685:(i,e,o)=>{"use strict";o.d(e,{WT:()=>r});var r="undefined"!=typeof Float32Array?Float32Array:Array;Math.random,Math.PI,Math.hypot||(Math.hypot=function(){for(var i=0,e=arguments.length;e--;)i+=arguments[e]*arguments[e];return Math.sqrt(i)})},975:(i,e,o)=>{"use strict";o.d(e,{Ue:()=>a,yR:()=>n,xJ:()=>t});var r=o(685);function a(){var i=new r.WT(16);return r.WT!=Float32Array&&(i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[11]=0,i[12]=0,i[13]=0,i[14]=0),i[0]=1,i[5]=1,i[10]=1,i[15]=1,i}function n(i){return i[0]=1,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=1,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=1,i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,i}function t(i,e){return i[0]=e[0],i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=e[1],i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=e[2],i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,i}},238:function(i,e,o){var r;!function(a,n){"use strict";var t="function",s="undefined",b="object",w="string",l="model",d="name",u="type",c="vendor",p="version",m="architecture",f="console",h="mobile",v="tablet",g="smarttv",x="wearable",k="embedded",y="Amazon",_="Apple",T="ASUS",S="BlackBerry",q="Google",A="Huawei",C="LG",z="Microsoft",N="Motorola",O="Samsung",E="Sony",M="Xiaomi",U="Zebra",j="Facebook",B=function(i){var e={};for(var o in i)e[i[o].toUpperCase()]=i[o];return e},R=function(i,e){return typeof i===w&&-1!==V(e).indexOf(V(i))},V=function(i){return i.toLowerCase()},F=function(i,e){if(typeof i===w)return i=i.replace(/^\s\s*/,"").replace(/\s\s*$/,""),typeof e===s?i:i.substring(0,255)},P=function(i,e){for(var o,r,a,s,w,l,d=0;d<e.length&&!w;){var u=e[d],c=e[d+1];for(o=r=0;o<u.length&&!w;)if(w=u[o++].exec(i))for(a=0;a<c.length;a++)l=w[++r],typeof(s=c[a])===b&&s.length>0?2==s.length?typeof s[1]==t?this[s[0]]=s[1].call(this,l):this[s[0]]=s[1]:3==s.length?typeof s[1]!==t||s[1].exec&&s[1].test?this[s[0]]=l?l.replace(s[1],s[2]):n:this[s[0]]=l?s[1].call(this,l,s[2]):n:4==s.length&&(this[s[0]]=l?s[3].call(this,l.replace(s[1],s[2])):n):this[s]=l||n;d+=2}},W=function(i,e){for(var o in e)if(typeof e[o]===b&&e[o].length>0){for(var r=0;r<e[o].length;r++)if(R(e[o][r],i))return"?"===o?n:o}else if(R(e[o],i))return"?"===o?n:o;return i},I={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},D={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[p,[d,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[p,[d,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[d,p],[/opios[\/ ]+([\w\.]+)/i],[p,[d,"Opera Mini"]],[/\bopr\/([\w\.]+)/i],[p,[d,"Opera"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,/(ba?idubrowser)[\/ ]?([\w\.]+)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale|qqbrowserlite|qq)\/([-\w\.]+)/i,/(weibo)__([\d\.]+)/i],[d,p],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[p,[d,"UCBrowser"]],[/\bqbcore\/([\w\.]+)/i],[p,[d,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[p,[d,"WeChat"]],[/konqueror\/([\w\.]+)/i],[p,[d,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[p,[d,"IE"]],[/yabrowser\/([\w\.]+)/i],[p,[d,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[d,/(.+)/,"$1 Secure Browser"],p],[/\bfocus\/([\w\.]+)/i],[p,[d,"Firefox Focus"]],[/\bopt\/([\w\.]+)/i],[p,[d,"Opera Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[p,[d,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[p,[d,"Dolphin"]],[/coast\/([\w\.]+)/i],[p,[d,"Opera Coast"]],[/miuibrowser\/([\w\.]+)/i],[p,[d,"MIUI Browser"]],[/fxios\/([-\w\.]+)/i],[p,[d,"Firefox"]],[/\bqihu|(qi?ho?o?|360)browser/i],[[d,"360 Browser"]],[/(oculus|samsung|sailfish)browser\/([\w\.]+)/i],[[d,/(.+)/,"$1 Browser"],p],[/(comodo_dragon)\/([\w\.]+)/i],[[d,/_/g," "],p],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[d,p],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i],[d],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[d,j],p],[/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[d,p],[/\bgsa\/([\w\.]+) .*safari\//i],[p,[d,"GSA"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[p,[d,"Chrome Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[d,"Chrome WebView"],p],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[p,[d,"Android Browser"]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[d,p],[/version\/([\w\.]+) .*mobile\/\w+ (safari)/i],[p,[d,"Mobile Safari"]],[/version\/([\w\.]+) .*(mobile ?safari|safari)/i],[p,d],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[d,[p,W,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[d,p],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[d,"Netscape"],p],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[p,[d,"Firefox Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[d,p]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[m,"amd64"]],[/(ia32(?=;))/i],[[m,V]],[/((?:i[346]|x)86)[;\)]/i],[[m,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[m,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[m,"armhf"]],[/windows (ce|mobile); ppc;/i],[[m,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[m,/ower/,"",V]],[/(sun4\w)[;\)]/i],[[m,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[m,V]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[pt]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[l,[c,O],[u,v]],[/\b((?:s[cgp]h|gt|sm)-\w+|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[l,[c,O],[u,h]],[/\((ip(?:hone|od)[\w ]*);/i],[l,[c,_],[u,h]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[l,[c,_],[u,v]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[l,[c,A],[u,v]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}-[atu]?[ln][01259x][012359][an]?)\b(?!.+d\/s)/i],[l,[c,A],[u,h]],[/\b(poco[\w ]+)(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[l,/_/g," "],[c,M],[u,h]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[l,/_/g," "],[c,M],[u,v]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007)\b/i],[l,[c,"OPPO"],[u,h]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[l,[c,"Vivo"],[u,h]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[l,[c,"Realme"],[u,h]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[l,[c,N],[u,h]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[l,[c,N],[u,v]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[l,[c,C],[u,v]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[l,[c,C],[u,h]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[l,[c,"Lenovo"],[u,v]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[l,/_/g," "],[c,"Nokia"],[u,h]],[/(pixel c)\b/i],[l,[c,q],[u,v]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[l,[c,q],[u,h]],[/droid.+ ([c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[l,[c,E],[u,h]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[l,"Xperia Tablet"],[c,E],[u,v]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[l,[c,"OnePlus"],[u,h]],[/(alexa)webm/i,/(kf[a-z]{2}wi)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[l,[c,y],[u,v]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[l,/(.+)/g,"Fire Phone $1"],[c,y],[u,h]],[/(playbook);[-\w\),; ]+(rim)/i],[l,c,[u,v]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[l,[c,S],[u,h]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[l,[c,T],[u,v]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[l,[c,T],[u,h]],[/(nexus 9)/i],[l,[c,"HTC"],[u,v]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic|sony)[-_ ]?([-\w]*)/i],[c,[l,/_/g," "],[u,h]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[l,[c,"Acer"],[u,v]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[l,[c,"Meizu"],[u,h]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[l,[c,"Sharp"],[u,h]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[c,l,[u,h]],[/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[c,l,[u,v]],[/(surface duo)/i],[l,[c,z],[u,v]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[l,[c,"Fairphone"],[u,h]],[/(u304aa)/i],[l,[c,"AT&T"],[u,h]],[/\bsie-(\w*)/i],[l,[c,"Siemens"],[u,h]],[/\b(rct\w+) b/i],[l,[c,"RCA"],[u,v]],[/\b(venue[\d ]{2,7}) b/i],[l,[c,"Dell"],[u,v]],[/\b(q(?:mv|ta)\w+) b/i],[l,[c,"Verizon"],[u,v]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[l,[c,"Barnes & Noble"],[u,v]],[/\b(tm\d{3}\w+) b/i],[l,[c,"NuVision"],[u,v]],[/\b(k88) b/i],[l,[c,"ZTE"],[u,v]],[/\b(nx\d{3}j) b/i],[l,[c,"ZTE"],[u,h]],[/\b(gen\d{3}) b.+49h/i],[l,[c,"Swiss"],[u,h]],[/\b(zur\d{3}) b/i],[l,[c,"Swiss"],[u,v]],[/\b((zeki)?tb.*\b) b/i],[l,[c,"Zeki"],[u,v]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[c,"Dragon Touch"],l,[u,v]],[/\b(ns-?\w{0,9}) b/i],[l,[c,"Insignia"],[u,v]],[/\b((nxa|next)-?\w{0,9}) b/i],[l,[c,"NextBook"],[u,v]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[c,"Voice"],l,[u,h]],[/\b(lvtel\-)?(v1[12]) b/i],[[c,"LvTel"],l,[u,h]],[/\b(ph-1) /i],[l,[c,"Essential"],[u,h]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[l,[c,"Envizen"],[u,v]],[/\b(trio[-\w\. ]+) b/i],[l,[c,"MachSpeed"],[u,v]],[/\btu_(1491) b/i],[l,[c,"Rotor"],[u,v]],[/(shield[\w ]+) b/i],[l,[c,"Nvidia"],[u,v]],[/(sprint) (\w+)/i],[c,l,[u,h]],[/(kin\.[onetw]{3})/i],[[l,/\./g," "],[c,z],[u,h]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[l,[c,U],[u,v]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[l,[c,U],[u,h]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[c,l,[u,f]],[/droid.+; (shield) bui/i],[l,[c,"Nvidia"],[u,f]],[/(playstation [345portablevi]+)/i],[l,[c,E],[u,f]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[l,[c,z],[u,f]],[/smart-tv.+(samsung)/i],[c,[u,g]],[/hbbtv.+maple;(\d+)/i],[[l,/^/,"SmartTV"],[c,O],[u,g]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[c,C],[u,g]],[/(apple) ?tv/i],[c,[l,"Apple TV"],[u,g]],[/crkey/i],[[l,"Chromecast"],[c,q],[u,g]],[/droid.+aft(\w)( bui|\))/i],[l,[c,y],[u,g]],[/\(dtv[\);].+(aquos)/i],[l,[c,"Sharp"],[u,g]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w ]*; *(\w[^;]*);([^;]*)/i],[[c,F],[l,F],[u,g]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[u,g]],[/((pebble))app/i],[c,l,[u,x]],[/droid.+; (glass) \d/i],[l,[c,q],[u,x]],[/droid.+; (wt63?0{2,3})\)/i],[l,[c,U],[u,x]],[/(quest( 2)?)/i],[l,[c,j],[u,x]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[c,[u,k]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[l,[u,h]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[l,[u,v]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[u,v]],[/(phone|mobile(?:[;\/]| safari)|pda(?=.+windows ce))/i],[[u,h]],[/(android[-\w\. ]{0,9});.+buil/i],[l,[c,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[p,[d,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[p,[d,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i],[d,p],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[p,d]],os:[[/microsoft (windows) (vista|xp)/i],[d,p],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[d,[p,W,I]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[d,"Windows"],[p,W,I]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/cfnetwork\/.+darwin/i],[[p,/_/g,"."],[d,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[d,"Mac OS"],[p,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86)/i],[p,d],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[d,p],[/\(bb(10);/i],[p,[d,S]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[p,[d,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[p,[d,"Firefox OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[p,[d,"webOS"]],[/crkey\/([\d\.]+)/i],[p,[d,"Chromecast"]],[/(cros) [\w]+ ([\w\.]+\w)/i],[[d,"Chromium OS"],p],[/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[d,p],[/(sunos) ?([\w\.\d]*)/i],[[d,"Solaris"],p],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux)/i,/(unix) ?([\w\.]*)/i],[d,p]]},Z=function(i,e){if(typeof i===b&&(e=i,i=n),!(this instanceof Z))return new Z(i,e).getResult();var o=i||(typeof a!==s&&a.navigator&&a.navigator.userAgent?a.navigator.userAgent:""),r=e?function(i,e){var o={};for(var r in i)e[r]&&e[r].length%2==0?o[r]=e[r].concat(i[r]):o[r]=i[r];return o}(D,e):D;return this.getBrowser=function(){var i,e={};return e.name=n,e.version=n,P.call(e,o,r.browser),e.major=typeof(i=e.version)===w?i.replace(/[^\d\.]/g,"").split(".")[0]:n,e},this.getCPU=function(){var i={};return i.architecture=n,P.call(i,o,r.cpu),i},this.getDevice=function(){var i={};return i.vendor=n,i.model=n,i.type=n,P.call(i,o,r.device),i},this.getEngine=function(){var i={};return i.name=n,i.version=n,P.call(i,o,r.engine),i},this.getOS=function(){var i={};return i.name=n,i.version=n,P.call(i,o,r.os),i},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return o},this.setUA=function(i){return o=typeof i===w&&i.length>255?F(i,255):i,this},this.setUA(o),this};Z.VERSION="0.7.30",Z.BROWSER=B([d,p,"major"]),Z.CPU=B([m]),Z.DEVICE=B([l,c,u,f,h,g,v,x,k]),Z.ENGINE=Z.OS=B([d,p]),typeof e!==s?(i.exports&&(e=i.exports=Z),e.UAParser=Z):o.amdO?(r=function(){return Z}.call(e,o,e,i))===n||(i.exports=r):typeof a!==s&&(a.UAParser=Z);var G=typeof a!==s&&(a.jQuery||a.Zepto);if(G&&!G.ua){var L=new Z;G.ua=L.getResult(),G.ua.get=function(){return L.getUA()},G.ua.set=function(i){L.setUA(i);var e=L.getResult();for(var o in e)G.ua[o]=e[o]}}}("object"==typeof window?window:this)}}]);
Binary file
@@ -0,0 +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={752:(e,t,r)=>{var a,n=(a="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0,function(e){var t;e=e||{},t||(t=void 0!==e?e:{});var r,n,i=Object.assign;t.ready=new Promise((function(e,t){r=e,n=t}));var o,s=i({},t),_="./this.program",c=(e,t)=>{throw t},f="";f=self.location.href,a&&(f=a),f=0!==f.indexOf("blob:")?f.substr(0,f.replace(/[?#].*/,"").lastIndexOf("/")+1):"",o=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);i(t,s),s=null,t.thisProgram&&(_=t.thisProgram),t.quit&&(c=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,r,a,n){var i={string:function(e){var t=0;if(null!=e&&0!==e){var r=1+(e.length<<2);t=br(r),I(e,E,t,r)}return t},array:function(e){var t=br(e.length);return v.set(e,t),t}};e=t["_"+e];var o,s=[],_=0;if(n)for(var c=0;c<n.length;c++){var f=i[a[c]];f?(0===_&&(_=hr()),s[c]=f(n[c])):s[c]=n[c]}return o=a=e.apply(null,s),0!==_&&mr(_),"string"===r?z(o):"boolean"===r?!!o:o}var y,v,E,A,R,T,k,x,F,L="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&&L)return L.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 z(e,t){return e?M(E,e,t):""}function I(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 P(e){var t=O(e)+1,r=cr(t);return r&&I(e,v,r,t),r}function B(){var e=m.buffer;y=e,t.HEAP8=v=new Int8Array(e),t.HEAP16=A=new Int16Array(e),t.HEAP32=T=new Int32Array(e),t.HEAPU8=E=new Uint8Array(e),t.HEAPU16=R=new Uint16Array(e),t.HEAPU32=k=new Uint32Array(e),t.HEAPF32=x=new Float32Array(e),t.HEAPF64=F=new Float64Array(e)}var S,D=[],U=[],C=[],V=!1;function N(){var e=t.preRun.shift();D.unshift(e)}var H,W=0,G=null,X=null;function Y(){W++,t.monitorRunDependencies&&t.monitorRunDependencies(W)}function q(){if(W--,t.monitorRunDependencies&&t.monitorRunDependencies(W),0==W&&(null!==G&&(clearInterval(G),G=null),X)){var e=X;X=null,e()}}function j(e){throw t.onAbort&&t.onAbort(e),d(e="Aborted("+e+")"),g=!0,b=1,e=new WebAssembly.RuntimeError(e+". Build with -s ASSERTIONS=1 for more info."),n(e),e}if(t.preloadedImages={},t.preloadedAudios={},!(H="zcv.wasm").startsWith("data:application/octet-stream;base64,")){var $=H;H=t.locateFile?t.locateFile($,f):f+$}var Z,K,J={506024:function(){if(self.crypto&&self.crypto.getRandomValues){var e=new Uint32Array(1);return self.crypto.getRandomValues(e),e[0]}return 9007199254740991*Math.random()},506200:function(e,t){self.respond_ba_request(E.subarray(e,e+t))},506262:function(e,t){self.send_ba_request(E.subarray(e,e+t))}};function Q(e){for(;0<e.length;){var r=e.shift();if("function"==typeof r)r(t);else{var a=r.dd;"number"==typeof a?void 0===r.xc?re(a)():re(a)(r.xc):a(void 0===r.xc?null:r.xc)}}}var ee,te=[];function re(e){var t=te[e];return t||(e>=te.length&&(te.length=e+1),te[e]=t=S.get(e)),t}function ae(e){e instanceof gr||"unwind"==e||c(1,e)}function ne(e,t){if(0===e)e=Date.now();else{if(1!==e&&4!==e)return T[ur()>>2]=28,-1;e=ee()}return T[t>>2]=e/1e3|0,T[t+4>>2]=e%1e3*1e6|0,0}function ie(e){this.qc=e-16,this.vd=function(e){T[this.qc+4>>2]=e},this.sd=function(e){T[this.qc+8>>2]=e},this.td=function(){T[this.qc>>2]=0},this.rd=function(){v[this.qc+12>>0]=0},this.ud=function(){v[this.qc+13>>0]=0},this.gd=function(e,t){this.vd(e),this.sd(t),this.td(),this.rd(),this.ud()}}function oe(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 se(e){var t="/"===e.charAt(0),r="/"===e.substr(-1);return(e=oe(e.split("/").filter((function(e){return!!e})),!t).join("/"))||t||(e="."),e&&r&&(e+="/"),(t?"/":"")+e}function _e(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 ce(e){if("/"===e)return"/";var t=(e=(e=se(e)).replace(/\/$/,"")).lastIndexOf("/");return-1===t?e:e.substr(t+1)}function fe(){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=oe(e.split("/").filter((function(e){return!!e})),!t).join("/"))||"."}ee=()=>performance.now();var ue=[];function le(e,t){ue[e]={input:[],ec:[],pc:t},Se(e,pe)}var pe={open:function(e){var t=ue[e.node.uc];if(!t)throw new Ae(43);e.dc=t,e.seekable=!1},close:function(e){e.dc.pc.flush(e.dc)},flush:function(e){e.dc.pc.flush(e.dc)},read:function(e,t,r,a){if(!e.dc||!e.dc.pc.Qc)throw new Ae(60);for(var n=0,i=0;i<a;i++){try{var o=e.dc.pc.Qc(e.dc)}catch(e){throw new Ae(29)}if(void 0===o&&0===n)throw new Ae(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.dc||!e.dc.pc.Jc)throw new Ae(60);try{for(var n=0;n<a;n++)e.dc.pc.Jc(e.dc,t[r+n])}catch(e){throw new Ae(29)}return a&&(e.node.timestamp=Date.now()),n}},de={Qc: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=ir(t,!0)}return e.input.shift()},Jc:function(e,t){null===t||10===t?(p(M(e.ec,0)),e.ec=[]):0!=t&&e.ec.push(t)},flush:function(e){e.ec&&0<e.ec.length&&(p(M(e.ec,0)),e.ec=[])}},he={Jc:function(e,t){null===t||10===t?(d(M(e.ec,0)),e.ec=[]):0!=t&&e.ec.push(t)},flush:function(e){e.ec&&0<e.ec.length&&(d(M(e.ec,0)),e.ec=[])}},me={jc:null,lc:function(){return me.createNode(null,"/",16895,0)},createNode:function(e,t,r,a){if(24576==(61440&r)||4096==(61440&r))throw new Ae(63);return me.jc||(me.jc={dir:{node:{ic:me.$b.ic,kc:me.$b.kc,sc:me.$b.sc,yc:me.$b.yc,Wc:me.$b.Wc,Dc:me.$b.Dc,Xc:me.$b.Xc,Vc:me.$b.Vc,zc:me.$b.zc},stream:{nc:me.bc.nc}},file:{node:{ic:me.$b.ic,kc:me.$b.kc},stream:{nc:me.bc.nc,read:me.bc.read,write:me.bc.write,Lc:me.bc.Lc,Rc:me.bc.Rc,Tc:me.bc.Tc}},link:{node:{ic:me.$b.ic,kc:me.$b.kc,vc:me.$b.vc},stream:{}},Mc:{node:{ic:me.$b.ic,kc:me.$b.kc},stream:Be}}),16384==(61440&(r=Le(e,t,r,a)).mode)?(r.$b=me.jc.dir.node,r.bc=me.jc.dir.stream,r.ac={}):32768==(61440&r.mode)?(r.$b=me.jc.file.node,r.bc=me.jc.file.stream,r.cc=0,r.ac=null):40960==(61440&r.mode)?(r.$b=me.jc.link.node,r.bc=me.jc.link.stream):8192==(61440&r.mode)&&(r.$b=me.jc.Mc.node,r.bc=me.jc.Mc.stream),r.timestamp=Date.now(),e&&(e.ac[t]=r,e.timestamp=r.timestamp),r},Id:function(e){return e.ac?e.ac.subarray?e.ac.subarray(0,e.cc):new Uint8Array(e.ac):new Uint8Array(0)},Nc:function(e,t){var r=e.ac?e.ac.length:0;r>=t||(t=Math.max(t,r*(1048576>r?2:1.125)>>>0),0!=r&&(t=Math.max(t,256)),r=e.ac,e.ac=new Uint8Array(t),0<e.cc&&e.ac.set(r.subarray(0,e.cc),0))},pd:function(e,t){if(e.cc!=t)if(0==t)e.ac=null,e.cc=0;else{var r=e.ac;e.ac=new Uint8Array(t),r&&e.ac.set(r.subarray(0,Math.min(t,e.cc))),e.cc=t}},$b:{ic:function(e){var t={};return t.bd=8192==(61440&e.mode)?e.id:1,t.Ic=e.id,t.mode=e.mode,t.nd=1,t.uid=0,t.ed=0,t.uc=e.uc,16384==(61440&e.mode)?t.size=4096:32768==(61440&e.mode)?t.size=e.cc:40960==(61440&e.mode)?t.size=e.link.length:t.size=0,t.Yc=new Date(e.timestamp),t.md=new Date(e.timestamp),t.ad=new Date(e.timestamp),t.Zc=4096,t.$c=Math.ceil(t.size/t.Zc),t},kc:function(e,t){void 0!==t.mode&&(e.mode=t.mode),void 0!==t.timestamp&&(e.timestamp=t.timestamp),void 0!==t.size&&me.pd(e,t.size)},sc:function(){throw Re[44]},yc:function(e,t,r,a){return me.createNode(e,t,r,a)},Wc:function(e,t,r){if(16384==(61440&e.mode)){try{var a=Fe(t,r)}catch(e){}if(a)for(var n in a.ac)throw new Ae(55)}delete e.parent.ac[e.name],e.parent.timestamp=Date.now(),e.name=r,t.ac[r]=e,t.timestamp=e.parent.timestamp,e.parent=t},Dc:function(e,t){delete e.ac[t],e.timestamp=Date.now()},Xc:function(e,t){var r,a=Fe(e,t);for(r in a.ac)throw new Ae(55);delete e.ac[t],e.timestamp=Date.now()},Vc:function(e){var t,r=[".",".."];for(t in e.ac)e.ac.hasOwnProperty(t)&&r.push(t);return r},zc:function(e,t,r){return(e=me.createNode(e,t,41471,0)).link=r,e},vc:function(e){if(40960!=(61440&e.mode))throw new Ae(28);return e.link}},bc:{read:function(e,t,r,a,n){var i=e.node.ac;if(n>=e.node.cc)return 0;if(8<(e=Math.min(e.node.cc-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===v.buffer&&(i=!1),!a)return 0;if((e=e.node).timestamp=Date.now(),t.subarray&&(!e.ac||e.ac.subarray)){if(i)return e.ac=t.subarray(r,r+a),e.cc=a;if(0===e.cc&&0===n)return e.ac=t.slice(r,r+a),e.cc=a;if(n+a<=e.cc)return e.ac.set(t.subarray(r,r+a),n),a}if(me.Nc(e,n+a),e.ac.subarray&&t.subarray)e.ac.set(t.subarray(r,r+a),n);else for(i=0;i<a;i++)e.ac[n+i]=t[r+i];return e.cc=Math.max(e.cc,n+a),a},nc:function(e,t,r){if(1===r?t+=e.position:2===r&&32768==(61440&e.node.mode)&&(t+=e.node.cc),0>t)throw new Ae(28);return t},Lc:function(e,t,r){me.Nc(e.node,t+r),e.node.cc=Math.max(e.node.cc,t+r)},Rc:function(e,t,r,a,n,i){if(0!==t)throw new Ae(28);if(32768!=(61440&e.node.mode))throw new Ae(43);if(e=e.node.ac,2&i||e.buffer!==y){if((0<a||a+r<e.length)&&(e=e.subarray?e.subarray(a,a+r):Array.prototype.slice.call(e,a,a+r)),a=!0,j(),!(r=void 0))throw new Ae(48);v.set(e,r)}else a=!1,r=e.byteOffset;return{qc:r,Ed:a}},Tc:function(e,t,r,a,n){if(32768!=(61440&e.node.mode))throw new Ae(43);return 2&n||me.bc.write(e,t,0,a,r,!1),0}}},be=null,ge={},we=[],ye=1,ve=null,Ee=!0,Ae=null,Re={};function Te(e,t){if(t=t||{},!(e=fe("/",e)))return{path:"",node:null};var r,a={Oc:!0,Kc:0};for(r in a)void 0===t[r]&&(t[r]=a[r]);if(8<t.Kc)throw new Ae(32);e=oe(e.split("/").filter((function(e){return!!e})),!1);var n=be;for(a="/",r=0;r<e.length;r++){var i=r===e.length-1;if(i&&t.parent)break;if(n=Fe(n,e[r]),a=se(a+"/"+e[r]),n.tc&&(!i||i&&t.Oc)&&(n=n.tc.root),!i||t.Gc)for(i=0;40960==(61440&n.mode);)if(n=He(a),n=Te(a=fe(_e(a),n),{Kc:t.Kc}).node,40<i++)throw new Ae(32)}return{path:a,node:n}}function ke(e){for(var t;;){if(e===e.parent)return e=e.lc.Sc,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)%ve.length}function Fe(e,t){var r;if(r=(r=Ie(e,"x"))?r:e.$b.sc?0:2)throw new Ae(r,e);for(r=ve[xe(e.id,t)];r;r=r.oc){var a=r.name;if(r.parent.id===e.id&&a===t)return r}return e.$b.sc(e,t)}function Le(e,t,r,a){return t=xe((e=new nr(e,t,r,a)).parent.id,e.name),e.oc=ve[t],ve[t]=e}var Me={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 Ie(e,t){return Ee?0:!t.includes("r")||292&e.mode?t.includes("w")&&!(146&e.mode)||t.includes("x")&&!(73&e.mode)?2:0:2}function Oe(e,t){try{return Fe(e,t),20}catch(e){}return Ie(e,"wx")}var Pe,Be={open:function(e){e.bc=ge[e.node.uc].bc,e.bc.open&&e.bc.open(e)},nc:function(){throw new Ae(70)}};function Se(e,t){ge[e]={bc:t}}function De(e,t){var r="/"===t,a=!t;if(r&&be)throw new Ae(10);if(!r&&!a){var n=Te(t,{Oc:!1});if(t=n.path,(n=n.node).tc)throw new Ae(10);if(16384!=(61440&n.mode))throw new Ae(54)}t={type:e,Md:{},Sc:t,ld:[]},(e=e.lc(t)).lc=t,t.root=e,r?be=e:n&&(n.tc=t,n.lc&&n.lc.ld.push(t))}function Ue(e,t,r){var a=Te(e,{parent:!0}).node;if(!(e=ce(e))||"."===e||".."===e)throw new Ae(28);var n=Oe(a,e);if(n)throw new Ae(n);if(!a.$b.yc)throw new Ae(63);return a.$b.yc(a,e,t,r)}function Ce(e){return Ue(e,16895,0)}function Ve(e,t,r){void 0===r&&(r=t,t=438),Ue(e,8192|t,r)}function Ne(e,t){if(!fe(e))throw new Ae(44);var r=Te(t,{parent:!0}).node;if(!r)throw new Ae(44);var a=Oe(r,t=ce(t));if(a)throw new Ae(a);if(!r.$b.zc)throw new Ae(63);r.$b.zc(r,t,e)}function He(e){if(!(e=Te(e).node))throw new Ae(44);if(!e.$b.vc)throw new Ae(28);return fe(ke(e.parent),e.$b.vc(e))}function We(e,t){if(!(e=Te(e,{Gc:!t}).node))throw new Ae(44);if(!e.$b.ic)throw new Ae(63);return e.$b.ic(e)}function Ge(e){return We(e,!0)}function Xe(e,r,a,n){if(""===e)throw new Ae(44);if("string"==typeof r){var i=Me[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=se(e);try{o=Te(e,{Gc:!(131072&r)}).node}catch(e){}}if(i=!1,64&r)if(o){if(128&r)throw new Ae(20)}else o=Ue(e,a,0),i=!0;if(!o)throw new Ae(44);if(8192==(61440&o.mode)&&(r&=-513),65536&r&&16384!=(61440&o.mode))throw new Ae(54);if(!i&&(a=o?40960==(61440&o.mode)?32:16384==(61440&o.mode)&&("r"!==ze(r)||512&r)?31:Ie(o,ze(r)):44))throw new Ae(a);if(512&r){if(!(a="string"==typeof(a=o)?Te(a,{Gc:!0}).node:a).$b.kc)throw new Ae(63);if(16384==(61440&a.mode))throw new Ae(31);if(32768!=(61440&a.mode))throw new Ae(28);if(i=Ie(a,"w"))throw new Ae(i);a.$b.kc(a,{size:0,timestamp:Date.now()})}return r&=-131713,(n=function(e,t){Ze||((Ze=function(){}).prototype={});var r,a=new Ze;for(r in e)a[r]=e[r];return e=a,t=function(e){for(e=e||0;e<=4096;e++)if(!we[e])return e;throw new Ae(33)}(t),e.mc=t,we[t]=e}({node:o,path:ke(o),id:o.id,flags:r,mode:o.mode,seekable:!0,position:0,bc:o.bc,$b:o.$b,Ad:[],error:!1},n)).bc.open&&n.bc.open(n),!t.logReadFiles||1&r||(Ke||(Ke={}),e in Ke||(Ke[e]=1)),n}function Ye(e,t,r){if(null===e.mc)throw new Ae(8);if(!e.seekable||!e.bc.nc)throw new Ae(70);if(0!=r&&1!=r&&2!=r)throw new Ae(28);e.position=e.bc.nc(e,t,r),e.Ad=[]}function qe(){Ae||((Ae=function(e,t){this.node=t,this.qd=function(e){this.hc=e},this.qd(e),this.message="FS error"}).prototype=Error(),Ae.prototype.constructor=Ae,[44].forEach((function(e){Re[e]=new Ae(e),Re[e].stack="<generic error, no stack>"})))}function je(e,t,r){e=se("/dev/"+e);var a=function(e,t){var r=0;return e&&(r|=365),t&&(r|=146),r}(!!t,!!r);$e||($e=64);var n=$e++<<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 Ae(29)}if(void 0===s&&0===i)throw new Ae(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 Ae(29)}return n&&(e.node.timestamp=Date.now()),i}}),Ve(e,a,n)}var $e,Ze,Ke,Je={};function Qe(e,t,r){try{var a=e(t)}catch(e){if(e&&e.node&&se(t)!==se(ke(e.node)))return-54;throw e}return T[r>>2]=a.bd,T[r+4>>2]=0,T[r+8>>2]=a.Ic,T[r+12>>2]=a.mode,T[r+16>>2]=a.nd,T[r+20>>2]=a.uid,T[r+24>>2]=a.ed,T[r+28>>2]=a.uc,T[r+32>>2]=0,K=[a.size>>>0,(Z=a.size,1<=+Math.abs(Z)?0<Z?(0|Math.min(+Math.floor(Z/4294967296),4294967295))>>>0:~~+Math.ceil((Z-+(~~Z>>>0))/4294967296)>>>0:0)],T[r+40>>2]=K[0],T[r+44>>2]=K[1],T[r+48>>2]=4096,T[r+52>>2]=a.$c,T[r+56>>2]=a.Yc.getTime()/1e3|0,T[r+60>>2]=0,T[r+64>>2]=a.md.getTime()/1e3|0,T[r+68>>2]=0,T[r+72>>2]=a.ad.getTime()/1e3|0,T[r+76>>2]=0,K=[a.Ic>>>0,(Z=a.Ic,1<=+Math.abs(Z)?0<Z?(0|Math.min(+Math.floor(Z/4294967296),4294967295))>>>0:~~+Math.ceil((Z-+(~~Z>>>0))/4294967296)>>>0:0)],T[r+80>>2]=K[0],T[r+84>>2]=K[1],0}var et=void 0;function tt(){return T[(et+=4)-4>>2]}function rt(e){if(!(e=we[e]))throw new Ae(8);return e}var at=[];function nt(e,t){if(!V&&!g)if(t)e();else try{e()}catch(e){ae(e)}}function it(e,t){setTimeout((function(){nt(e)}),t)}var ot,st,_t,ct=!1,ft=null,ut=0,lt=null,pt=0,dt=0,ht=0,mt=[],bt={},gt=!1,wt=!1,yt=[];function vt(e,r,a,n){if(r&&t.Fc&&e==t.canvas)return t.Fc;var i;if(r){var o={antialias:!1,alpha:!1,kd:1};if(n)for(var s in n)o[s]=n[s];if(void 0!==Kt&&(i=function(e,t){e.Pc||(e.Pc=e.getContext,e.getContext=function(t,r){return"webgl"==t==(r=e.Pc(t,r))instanceof WebGLRenderingContext?r:null});var r=e.getContext("webgl",t);return r?function(e,t){var r=qt(Yt),a={Jd:r,attributes:t,version:t.kd,Ec:e};return e.canvas&&(e.canvas.Dd=a),Yt[r]=a,(void 0===t.cd||t.cd)&&function(e){if(e||(e=$t),!e.hd){e.hd=!0;var t=e.Ec;!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.Gd=t.getExtension("EXT_disjoint_timer_query"),t.Kd=t.getExtension("WEBGL_multi_draw"),(t.getSupportedExtensions()||[]).forEach((function(e){e.includes("lose_context")||e.includes("debug")||t.getExtension(e)}))}}(a),r}(r,t):0}(e,o)))var _=Yt[i].Ec}else _=e.getContext("2d");return _?(a&&(r||void 0===er||j("cannot set in module if GLctx is used, but we are a non-GL context that would replace it"),t.Fc=_,r&&($t=Yt[i],t.Fc=er=$t&&$t.Ec),t.Od=r,yt.forEach((function(e){e()})),function(){function e(){wt=document.pointerLockElement===t.canvas||document.mozPointerLockElement===t.canvas||document.webkitPointerLockElement===t.canvas||document.msPointerLockElement===t.canvas}if(t.preloadPlugins||(t.preloadPlugins=[]),!It){It=!0;try{Ot=!0}catch(e){Ot=!1,p("warning: no blob constructor, cannot create blobs with mimetypes")}Pt="undefined"!=typeof MozBlobBuilder?MozBlobBuilder:"undefined"!=typeof WebKitBlobBuilder?WebKitBlobBuilder:Ot?null:p("warning: no BlobBuilder"),Bt="undefined"!=typeof window?window.URL?window.URL:window.webkitURL:void 0,t.Uc||void 0!==Bt||(p("warning: Browser does not support creating object URLs. Built-in browser image decoding will not be available."),t.Uc=!0),t.preloadPlugins.push({canHandle:function(e){return!t.Uc&&/\.(jpg|jpeg|png|bmp)$/i.test(e)},handle:function(e,r,a,n){var i=null;if(Ot)try{(i=new Blob([e],{type:Ft(r)})).size!==e.length&&(i=new Blob([new Uint8Array(e).buffer],{type:Ft(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 Pt).append(new Uint8Array(e).buffer),i=i.getBlob());var o=Bt.createObjectURL(i),s=new Image;s.onload=()=>{s.complete||j("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,Bt.revokeObjectURL(o),a&&a(e)},s.onerror=()=>{p("Image "+o+" could not be decoded"),n&&n()},s.src=o}}),t.preloadPlugins.push({canHandle:function(e){return!t.Ld&&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(!Ot)return o();try{var _=new Blob([e],{type:Ft(r)})}catch(e){return o()}_=Bt.createObjectURL(_);var c=new Audio;c.addEventListener("canplaythrough",(function(){i(c)}),!1),c.onerror=function(){if(!s){p("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=_,it((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){!wt&&t.canvas.requestPointerLock&&(t.canvas.requestPointerLock(),e.preventDefault())}),!1))}}()),_):null}var Et=!1,At=void 0,Rt=void 0;function Tt(){return!!gt&&((document.exitFullscreen||document.cancelFullScreen||document.mozCancelFullScreen||document.msExitFullscreen||document.webkitCancelFullScreen||function(){}).apply(document,[]),!0)}var kt=0;function xt(e){if("function"==typeof requestAnimationFrame)requestAnimationFrame(e);else{var t=Date.now();if(0===kt)kt=t+1e3/60;else for(;t+2>=kt;)kt+=1e3/60;setTimeout(e,Math.max(kt-t,0))}}function Ft(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 Lt=[];function Mt(){var e=t.canvas;Lt.forEach((function(t){t(e.width,e.height)}))}function zt(e,r,a){r&&a?(e.Bd=r,e.fd=a):(r=e.Bd,a=e.fd);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)}Rt?(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"))))}var It,Ot,Pt,Bt,St,Dt=[];function Ut(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=cr(a),E.set(new Uint8Array(y.response),r)),k[e+12>>2]=r,Ut(e+16,a)}var o=k[e+8>>2];if(o){var s=z(o),_=e+112,c=z(_);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?z(p):void 0,d=d?z(d):void 0;var w=h?z(h):void 0,y=new XMLHttpRequest;if(y.withCredentials=l,y.open(c,s,!f,p,d),f||(y.timeout=u),y.Cd=s,y.responseType="arraybuffer",h&&y.overrideMimeType(w),o)for(;(c=k[o>>2])&&(s=k[o+4>>2]);)o+=8,c=z(c),s=z(s),y.setRequestHeader(c,s);Dt.push(y),k[e+0>>2]=Dt.length,o=m&&_?E.slice(m,m+_):null,y.onload=function(a){i(b&&!g);var n=y.response?y.response.byteLength:0;Ut(e+24,0),n&&Ut(e+32,n),R[e+40>>1]=y.readyState,R[e+42>>1]=y.status,y.statusText&&I(y.statusText,E,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;Ut(e+24,0),Ut(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=cr(r),E.set(new Uint8Array(y.response),n)),k[e+12>>2]=n,Ut(e+16,r),Ut(e+24,t.loaded-r),Ut(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&&I(y.statusText,E,e+44,64),a&&a(e,y,t),n&&_r(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 Vt(e,t,r,a){var n=St;if(n){var i=k[e+112+64>>2];i||(i=k[e+8>>2]);var o=z(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,I("OK",E,e+44,64),r(e,0,o)},s.onerror=function(t){R[e+40>>1]=4,R[e+42>>1]=413,I("Payload Too Large",E,e+44,64),a(e,0,t)}}catch(t){a(e,0,t)}}else a(e,0,"IndexedDB not available!")}var Nt,Ht={};function Wt(){if(!Nt){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",_:_||"./this.program"};for(e in Ht)void 0===Ht[e]?delete t[e]:t[e]=Ht[e];var r=[];for(e in t)r.push(e+"="+t[e]);Nt=r}return Nt}var Gt=1,Xt=[],Yt=[];function qt(e){for(var t=Gt++,r=e.length;r<t;r++)e[r]=null;return t}var jt,$t,Zt,Kt={};function Jt(e){return 0==e%4&&(0!=e%100||0==e%400)}function Qt(e,t){for(var r=0,a=0;a<=t;r+=e[a++]);return r}var er,tr=[31,29,31,30,31,30,31,31,30,31,30,31],rr=[31,28,31,30,31,30,31,31,30,31,30,31];function ar(e,t){for(e=new Date(e.getTime());0<t;){var r=e.getMonth(),a=(Jt(e.getFullYear())?tr:rr)[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 nr(e,t,r,a){e||(e=this),this.parent=e,this.lc=e.lc,this.tc=null,this.id=ye++,this.name=t,this.mode=r,this.$b={},this.bc={},this.uc=a}function ir(e,t){var r=Array(O(e)+1);return e=I(e,r,0,r.length),t&&(r.length=e),r}Object.defineProperties(nr.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}}}),qe(),ve=Array(4096),De(me,"/"),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}}),Ve("/dev/null",259),le(1280,de),le(1536,he),Ve("/dev/tty",1280),Ve("/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")}}();je("random",e),je("urandom",e),Ce("/dev/shm"),Ce("/dev/shm/tmp")}(),function(){Ce("/proc");var e=Ce("/proc/self");Ce("/proc/self/fd"),De({lc:function(){var t=Le(e,"fd",16895,73);return t.$b={sc:function(e,t){var r=we[+t];if(!r)throw new Ae(8);return(e={parent:null,lc:{Sc:"fake"},$b:{vc:function(){return r.path}}}).parent=e}},t}},"/proc/self/fd")}(),t.requestFullscreen=function(e,r){!function(e,r){function a(){gt=!1;var e=n.parentNode;(document.fullscreenElement||document.mozFullScreenElement||document.msFullscreenElement||document.webkitFullscreenElement||document.webkitCurrentFullScreenElement)===e?(n.exitFullscreen=Tt,At&&n.requestPointerLock(),gt=!0,Rt?("undefined"!=typeof SDL&&(T[SDL.screen>>2]=8388608|k[SDL.screen>>2]),zt(t.canvas),Mt()):zt(n)):(e.parentNode.insertBefore(n,e),e.parentNode.removeChild(e),Rt?("undefined"!=typeof SDL&&(T[SDL.screen>>2]=-8388609&k[SDL.screen>>2]),zt(t.canvas),Mt()):zt(n)),t.onFullScreen&&t.onFullScreen(gt),t.onFullscreen&&t.onFullscreen(gt)}void 0===(At=e)&&(At=!0),void 0===(Rt=r)&&(Rt=!1);var n=t.canvas;Et||(Et=!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){xt(e)},t.setCanvasSize=function(e,r,a){zt(t.canvas,e,r),a||Mt()},t.pauseMainLoop=function(){ft=null,ut++},t.resumeMainLoop=function(){ut++;var e=pt,r=dt,a=lt;lt=null,function(e){function r(){if(a<ut){if(!h)try{yr(b)}catch(e){ae(e)}return!1}return!0}!lt||j("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."),lt=e;var a=ut;ct=!1,st=function(){if(!g)if(0<mt.length){var a=Date.now(),n=mt.shift();if(n.dd(n.xc),_t){var i=_t,o=0==i%1?i-1:Math.floor(i);_t=n.Fd?o:(8*i+(o+.5))/9}p('main loop blocker "'+n.name+'" took '+(Date.now()-a)+" ms"),t.setStatus&&(a=t.statusMessage||"Please wait...",i=bt.Hd,(n=_t)?n<i?t.setStatus(a+" ("+(i-n)+"/"+i+")"):t.setStatus(a):t.setStatus("")),r()&&setTimeout(st,0)}else r()&&(ht=ht+1|0,1==pt&&1<dt&&0!=ht%dt?ft():(0==pt&&(ot=ee()),g||t.preMainLoop&&!1===t.preMainLoop()||(nt(e),t.postMainLoop&&t.postMainLoop()),r()&&("object"==typeof SDL&&SDL.audio&&SDL.audio.od&&SDL.audio.od(),ft())))}}(a),function(e,r){if(pt=e,dt=r,lt)if(ct||(ct=!0),0==e)ft=function(){var e=0|Math.max(0,ot+r-ee());setTimeout(st,e)};else if(1==e)ft=function(){xt(st)};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"})}}ft=function(){setImmediate(st)}}}(e,r),ft()},t.getUserMedia=function(){window.getUserMedia||(window.getUserMedia=navigator.getUserMedia||navigator.mozGetUserMedia),window.getUserMedia(void 0)},t.createContext=function(e,t,r,a){return vt(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,q()}(e.target.result)},r.onerror=function(e){t()}}(0,(function(){St=!1,q()})),"undefined"!=typeof ENVIRONMENT_IS_FETCH_WORKER&&ENVIRONMENT_IS_FETCH_WORKER||Y();var or={y:function(e,t){return ne(e,t)},a:function(e){return cr(e+16)+16},b:function(e,t,r){throw new ie(e).gd(t,r),e},k:function(e,t,r){et=r;try{var a=rt(e);switch(t){case 0:var n=tt();return 0>n?-28:Xe(a.path,a.flags,0,n).mc;case 1:case 2:case 6:case 7:return 0;case 3:return a.flags;case 4:return n=tt(),a.flags|=n,0;case 5:return n=tt(),A[n+0>>1]=2,0;case 16:case 8:default:return-28;case 9:return T[ur()>>2]=28,-1}}catch(e){if(void 0===Je||!(e instanceof Ae))throw e;return-e.hc}},E:function(e,t,r){et=r;try{var a=rt(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.dc?0:-59;case 21519:if(!a.dc)return-59;var n=tt();return T[n>>2]=0;case 21520:return a.dc?-28:-59;case 21531:if(e=n=tt(),!a.bc.jd)throw new Ae(59);return a.bc.jd(a,t,e);default:j("bad ioctl syscall "+t)}}catch(e){if(void 0===Je||!(e instanceof Ae))throw e;return-e.hc}},B:function(e,t){try{return Qe(Ge,e=z(e),t)}catch(e){if(void 0===Je||!(e instanceof Ae))throw e;return-e.hc}},o:function(e,t,r){et=r;try{return Xe(z(e),t,r?tt():0).mc}catch(e){if(void 0===Je||!(e instanceof Ae))throw e;return-e.hc}},C:function(e,t){try{return Qe(We,e=z(e),t)}catch(e){if(void 0===Je||!(e instanceof Ae))throw e;return-e.hc}},w:function(e,t){try{return Ne(e=z(e),t=z(t)),0}catch(e){if(void 0===Je||!(e instanceof Ae))throw e;return-e.hc}},x:function(e){try{var t=Te(e=z(e),{parent:!0}).node;if(!t)throw new Ae(44);var r=ce(e),a=Fe(t,r);e:{try{var n=Fe(t,r)}catch(e){var i=e.hc;break e}i=Ie(t,"wx")||(16384==(61440&n.mode)?31:0)}if(i)throw new Ae(i);if(!t.$b.Dc)throw new Ae(63);if(a.tc)throw new Ae(10);t.$b.Dc(t,r);var o=xe(a.parent.id,a.name);if(ve[o]===a)ve[o]=a.oc;else for(var s=ve[o];s;){if(s.oc===a){s.oc=a.oc;break}s=s.oc}return 0}catch(e){if(void 0===Je||!(e instanceof Ae))throw e;return-e.hc}},F:function(e){delete Dt[e-1]},c:function(){j("")},J:ne,K:function(){self.postMessage({t:"gfx"})},q: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)+".arweb"+String.fromCharCode(92)+".app)$","i")).test(e)&&(e="*.arweb.app")}t=O(e)+1;var r=cr(t);return I(e,E,r,t+1),r},L:function(){self.postMessage({t:"licerr"})},f:function(e,t,r){var a;for(at.length=0,r>>=2;a=E[t++];)(a=105>a)&&1&r&&r++,at.push(a?F[r++>>1]:T[r]),++r;return J[e].apply(null,at)},l:function(e,t,r){function a(){re(e)(t)}0<=r?it(a,r):function(e){xt((function(){nt(e)}))}(a)},v:function(){return 2147483648},H:function(){return!1},s:function(e,t,r){E.copyWithin(e,t,t+r)},t:function(e){var t=E.length;if(2147483648<(e>>>=0))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)-y.byteLength+65535>>>16),B();var n=1;break e}catch(e){}n=void 0}if(n)return!0}return!1},G:function(e,t,r,a,n){function i(e,r){Vt(e,r.response,(function(e){nt((function(){l?re(l)(e):t&&t(e)}),y)}),(function(e){nt((function(){l?re(l)(e):t&&t(e)}),y)}))}function o(e){nt((function(){h?re(h)(e):n&&n(e)}),y)}function s(e){nt((function(){p?re(p)(e):r&&r(e)}),y)}function _(e){nt((function(){d?re(d)(e):a&&a(e)}),y)}function c(e){nt((function(){l?re(l)(e):t&&t(e)}),y)}var f=e+112,u=z(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),w=!!(16&m),y=!!(64&m);if("EM_IDB_STORE"===u)u=k[f+84>>2],Vt(e,E.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=z(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,Ut(e+16,0),Ut(e+24,0),Ut(e+32,0),R[e+40>>1]=4,R[e+42>>1]=200,I("OK",E,e+44,64),t(e,0,r)},i.onerror=function(t){R[e+40>>1]=4,R[e+42>>1]=404,I("Not Found",E,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(w){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=z(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=cr(n);E.set(new Uint8Array(a),i),k[e+12>>2]=i,Ut(e+16,n),Ut(e+24,0),Ut(e+32,n),R[e+40>>1]=4,R[e+42>>1]=200,I("OK",E,e+44,64),t(e,0,a)}else R[e+40>>1]=4,R[e+42>>1]=404,I("Not Found",E,e+44,64),r(e,0,"no data")},i.onerror=function(t){R[e+40>>1]=4,R[e+42>>1]=404,I("Not Found",E,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},z:function(e,t){var r=0;return Wt().forEach((function(a,n){var i=t+r;for(n=T[e+4*n>>2]=i,i=0;i<a.length;++i)v[n++>>0]=a.charCodeAt(i);v[n>>0]=0,r+=a.length+1})),0},A:function(e,t){var r=Wt();T[e>>2]=r.length;var a=0;return r.forEach((function(e){a+=e.length+1})),T[t>>2]=a,0},I:function(e){yr(e)},j:function(e){try{var t=rt(e);if(null===t.mc)throw new Ae(8);t.Hc&&(t.Hc=null);try{t.bc.close&&t.bc.close(t)}catch(e){throw e}finally{we[t.mc]=null}return t.mc=null,0}catch(e){if(void 0===Je||!(e instanceof Ae))throw e;return e.hc}},D:function(e,t,r,a){try{e:{for(var n=rt(e),i=e=0;i<r;i++){var o=T[t+(8*i+4)>>2],s=n,_=T[t+8*i>>2],c=o,f=void 0,u=v;if(0>c||0>f)throw new Ae(28);if(null===s.mc)throw new Ae(8);if(1==(2097155&s.flags))throw new Ae(8);if(16384==(61440&s.node.mode))throw new Ae(31);if(!s.bc.read)throw new Ae(28);var l=void 0!==f;if(l){if(!s.seekable)throw new Ae(70)}else f=s.position;var p=s.bc.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 T[a>>2]=h,0}catch(e){if(void 0===Je||!(e instanceof Ae))throw e;return e.hc}},r:function(e,t,r,a,n){try{var i=rt(e);return-9007199254740992>=(e=4294967296*r+(t>>>0))||9007199254740992<=e?-61:(Ye(i,e,a),K=[i.position>>>0,(Z=i.position,1<=+Math.abs(Z)?0<Z?(0|Math.min(+Math.floor(Z/4294967296),4294967295))>>>0:~~+Math.ceil((Z-+(~~Z>>>0))/4294967296)>>>0:0)],T[n>>2]=K[0],T[n+4>>2]=K[1],i.Hc&&0===e&&0===a&&(i.Hc=null),0)}catch(e){if(void 0===Je||!(e instanceof Ae))throw e;return e.hc}},i:function(e,t,r,a){try{e:{for(var n=rt(e),i=e=0;i<r;i++){var o=n,s=T[t+8*i>>2],_=T[t+(8*i+4)>>2],c=void 0,f=v;if(0>_||0>c)throw new Ae(28);if(null===o.mc)throw new Ae(8);if(0==(2097155&o.flags))throw new Ae(8);if(16384==(61440&o.node.mode))throw new Ae(31);if(!o.bc.write)throw new Ae(28);o.seekable&&1024&o.flags&&Ye(o,0,2);var u=void 0!==c;if(u){if(!o.seekable)throw new Ae(70)}else c=o.position;var l=o.bc.write(o,f,s,_,c,void 0);u||(o.position+=l);var p=l;if(0>p){var d=-1;break e}e+=p}d=e}return T[a>>2]=d,0}catch(e){if(void 0===Je||!(e instanceof Ae))throw e;return e.hc}},e:function(e){var t=Date.now();return T[e>>2]=t/1e3|0,T[e+4>>2]=t%1e3*1e3|0,0},m:function(e,t){er.bindTexture(e,Xt[t])},n:function(e,t){for(var r=0;r<e;r++){var a=er.createTexture(),n=a&&qt(Xt);a?(a.name=n,Xt[n]=a):jt||(jt=1282),T[t+4*r>>2]=n}},g:function(e,t,r,a,n,i,o,s,_){var c=er,f=c.texImage2D;if(_){var u=s-5120;u=1==u?E:4==u?T:6==u?x: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,_)},h:function(e,t,r){er.texParameteri(e,t,r)},p:function(e,t){Zt||(Zt=!0,function(){function e(e){return(e=e.toTimeString().match(/\(([A-Za-z ]+)\)$/))?e[1]:"GMT"}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);T[dr()>>2]=60*i,T[pr()>>2]=Number(t!=n),r=e(r),a=e(a),r=P(r),a=P(a),n<t?(T[lr()>>2]=r,T[lr()+4>>2]=a):(T[lr()>>2]=a,T[lr()+4>>2]=r)}()),e=new Date(1e3*T[e>>2]),T[t>>2]=e.getSeconds(),T[t+4>>2]=e.getMinutes(),T[t+8>>2]=e.getHours(),T[t+12>>2]=e.getDate(),T[t+16>>2]=e.getMonth(),T[t+20>>2]=e.getFullYear()-1900,T[t+24>>2]=e.getDay();var r=new Date(e.getFullYear(),0,1);T[t+28>>2]=(e.getTime()-r.getTime())/864e5|0,T[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)),T[t+32>>2]=e,e=T[lr()+(e?4:0)>>2],T[t+40>>2]=e,t},u: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=ar(new Date(e.fc+1900,0,1),e.Cc);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=T[a+40>>2];for(var f in a={yd:T[a>>2],xd:T[a+4>>2],Ac:T[a+8>>2],wc:T[a+12>>2],rc:T[a+16>>2],fc:T[a+20>>2],Bc:T[a+24>>2],Cc:T[a+28>>2],Nd:T[a+32>>2],wd:T[a+36>>2],zd:c?z(c):""},r=z(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.Bc].substring(0,3)},"%A":function(e){return u[e.Bc]},"%b":function(e){return l[e.rc].substring(0,3)},"%B":function(e){return l[e.rc]},"%C":function(e){return i((e.fc+1900)/100|0,2)},"%d":function(e){return i(e.wc,2)},"%e":function(e){return n(e.wc,2," ")},"%g":function(e){return _(e).toString().substring(2)},"%G":function(e){return _(e)},"%H":function(e){return i(e.Ac,2)},"%I":function(e){return 0==(e=e.Ac)?e=12:12<e&&(e-=12),i(e,2)},"%j":function(e){return i(e.wc+Qt(Jt(e.fc+1900)?tr:rr,e.rc-1),3)},"%m":function(e){return i(e.rc+1,2)},"%M":function(e){return i(e.xd,2)},"%n":function(){return"\n"},"%p":function(e){return 0<=e.Ac&&12>e.Ac?"AM":"PM"},"%S":function(e){return i(e.yd,2)},"%t":function(){return"\t"},"%u":function(e){return e.Bc||7},"%U":function(e){var t=new Date(e.fc+1900,0,1),r=0===t.getDay()?t:ar(t,7-t.getDay());return 0>o(r,e=new Date(e.fc+1900,e.rc,e.wc))?i(Math.ceil((31-r.getDate()+(Qt(Jt(e.getFullYear())?tr:rr,e.getMonth()-1)-31)+e.getDate())/7),2):0===o(r,t)?"01":"00"},"%V":function(e){var t=new Date(e.fc+1901,0,4),r=s(new Date(e.fc+1900,0,4));t=s(t);var a=ar(new Date(e.fc+1900,0,1),e.Cc);return 0>o(a,r)?"53":0>=o(t,a)?"01":i(Math.ceil((r.getFullYear()<e.fc+1900?e.Cc+32-r.getDate():e.Cc+1-r.getDate())/7),2)},"%w":function(e){return e.Bc},"%W":function(e){var t=new Date(e.fc,0,1),r=1===t.getDay()?t:ar(t,0===t.getDay()?1:7-t.getDay()+1);return 0>o(r,e=new Date(e.fc+1900,e.rc,e.wc))?i(Math.ceil((31-r.getDate()+(Qt(Jt(e.getFullYear())?tr:rr,e.getMonth()-1)-31)+e.getDate())/7),2):0===o(r,t)?"01":"00"},"%y":function(e){return(e.fc+1900).toString().substring(2)},"%Y":function(e){return e.fc+1900},"%z":function(e){var t=0<=(e=e.wd);return e=Math.abs(e)/60,(t?"+":"-")+String("0000"+(e/60*100+e%60)).slice(-4)},"%Z":function(e){return e.zd},"%%":function(){return"%"}})r.includes(f)&&(r=r.replace(new RegExp(f,"g"),c[f](a)));return(f=ir(r,!1)).length>t?0:(v.set(f,e),f.length-1)}(e,t,r,a)},d:function(e){var t=Date.now()/1e3|0;return e&&(T[e>>2]=t),t}},sr=function(){function e(e){t.asm=e.exports,m=t.asm.M,B(),S=t.asm.R,U.unshift(t.asm.N),q()}var r={a:or};if(Y(),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=H;try{e:{try{if(t==H&&l){var r=new Uint8Array(l);break e}if(o){r=o(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),(e.includes("imported Memory")||e.includes("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=sr.N,t._zappar_has_initialized=sr.O,t._zappar_invert=sr.P,t._zappar_loaded=sr.Q,t._zappar_pipeline_create=sr.S,t._zappar_pipeline_destroy=sr.T,t._zappar_pipeline_camera_frame_submit=sr.U,t._zappar_pipeline_camera_frame_submit_raw_pointer=sr.V,t._zappar_pipeline_frame_update=sr.W,t._zappar_pipeline_camera_frame_user_data=sr.X,t._zappar_pipeline_camera_model=sr.Y,t._zappar_pipeline_frame_number=sr.Z,t._zappar_pipeline_motion_accelerometer_submit=sr._,t._zappar_pipeline_motion_rotation_rate_submit=sr.$,t._zappar_pipeline_motion_attitude_submit=sr.aa,t._zappar_pipeline_motion_attitude_matrix_submit=sr.ba,t._zappar_pipeline_camera_frame_user_facing=sr.ca,t._zappar_pipeline_camera_frame_texture_matrix=sr.da,t._zappar_pipeline_camera_pose_with_attitude=sr.ea,t._zappar_pipeline_camera_pose_with_origin=sr.fa,t._zappar_pipeline_camera_frame_camera_attitude=sr.ga,t._zappar_pipeline_camera_frame_device_attitude=sr.ha,t._zappar_pipeline_camera_frame_texture_gl=sr.ia,t._zappar_pipeline_camera_frame_upload_gl=sr.ja,t._zappar_pipeline_sequence_record_start=sr.ka,t._zappar_pipeline_sequence_record_stop=sr.la,t._zappar_pipeline_sequence_record_clear=sr.ma,t._zappar_pipeline_sequence_record_device_attitude_matrices_set=sr.na,t._zappar_pipeline_sequence_record_data_size=sr.oa,t._zappar_pipeline_sequence_record_data=sr.pa,t._zappar_pipeline_process_gl=sr.qa,t._zappar_pipeline_camera_pose_default=sr.ra,t._zappar_instant_world_tracker_create=sr.sa,t._zappar_instant_world_tracker_destroy=sr.ta,t._zappar_instant_world_tracker_anchor_pose_set_from_camera_offset_raw=sr.ua,t._zappar_instant_world_tracker_anchor_pose_raw=sr.va,t._zappar_instant_world_tracker_enabled_set=sr.wa,t._zappar_instant_world_tracker_enabled=sr.xa,t._zappar_image_tracker_create=sr.ya,t._zappar_image_tracker_destroy=sr.za,t._zappar_image_tracker_target_load_from_memory=sr.Aa,t.__Z42zappar_image_tracker_target_load_from_fileP23zappar_image_tracker_tiPKc=sr.Ba;var _r=t._free=sr.Ca;t._zappar_image_tracker_anchor_count=sr.Da,t._zappar_image_tracker_anchor_id=sr.Ea,t._zappar_image_tracker_anchor_pose_raw=sr.Fa,t._zappar_image_tracker_enabled_set=sr.Ga,t._zappar_image_tracker_enabled=sr.Ha,t._zappar_image_tracker_target_loaded_version=sr.Ia,t.__Z33zappar_image_tracker_target_countP23zappar_image_tracker_ti=sr.Ja,t.__Z46zappar_image_tracker_target_preview_compressedP23zappar_image_tracker_tii=sr.Ka,t.__Z51zappar_image_tracker_target_preview_compressed_sizeP23zappar_image_tracker_tii=sr.La,t.__Z55zappar_image_tracker_target_preview_compressed_mimetypeP23zappar_image_tracker_tii=sr.Ma,t.__Z40zappar_image_tracker_target_preview_rgbaP23zappar_image_tracker_tii=sr.Na,t.__Z45zappar_image_tracker_target_preview_rgba_sizeP23zappar_image_tracker_tii=sr.Oa,t.__Z46zappar_image_tracker_target_preview_rgba_widthP23zappar_image_tracker_tii=sr.Pa,t.__Z47zappar_image_tracker_target_preview_rgba_heightP23zappar_image_tracker_tii=sr.Qa,t.__Z38zappar_image_tracker_target_radius_topP23zappar_image_tracker_tii=sr.Ra,t.__Z41zappar_image_tracker_target_radius_bottomP23zappar_image_tracker_tii=sr.Sa,t.__Z39zappar_image_tracker_target_side_lengthP23zappar_image_tracker_tii=sr.Ta,t.__Z49zappar_image_tracker_target_physical_scale_factorP23zappar_image_tracker_tii=sr.Ua,t._zappar_face_tracker_create=sr.Va,t._zappar_face_tracker_destroy=sr.Wa,t._zappar_face_tracker_model_load_from_memory=sr.Xa,t._zappar_face_tracker_anchor_count=sr.Ya,t._zappar_face_tracker_anchor_id=sr.Za,t._zappar_face_tracker_anchor_pose_raw=sr._a,t._zappar_face_tracker_anchor_identity_coefficients=sr.$a,t._zappar_face_tracker_anchor_expression_coefficients=sr.ab,t._zappar_face_tracker_enabled_set=sr.bb,t._zappar_face_tracker_enabled=sr.cb,t._zappar_face_tracker_max_faces_set=sr.db,t._zappar_face_tracker_max_faces=sr.eb,t._zappar_face_tracker_model_loaded_version=sr.fb,t._zappar_face_landmark_create=sr.gb,t._zappar_face_landmark_destroy=sr.hb,t.__Z27zappar_face_landmark_updateP23zappar_face_landmark_tiPKfS2_i=sr.ib,t._zappar_face_landmark_anchor_pose=sr.jb,t._zappar_barcode_finder_create=sr.kb,t._zappar_barcode_finder_destroy=sr.lb,t._zappar_barcode_finder_found_number=sr.mb,t._zappar_barcode_finder_found_text=sr.nb,t._zappar_barcode_finder_enabled_set=sr.ob,t._zappar_barcode_finder_enabled=sr.pb,t._zappar_barcode_finder_found_format=sr.qb,t._zappar_barcode_finder_formats=sr.rb,t._zappar_barcode_finder_formats_set=sr.sb;var cr=t._malloc=sr.tb;t._zappar_face_mesh_create=sr.ub,t._zappar_face_mesh_destroy=sr.vb,t.__Z33zappar_face_mesh_load_from_memoryP19zappar_face_mesh_tiPKciiiii=sr.wb,t.__Z29zappar_face_mesh_indices_sizeP19zappar_face_mesh_ti=sr.xb,t.__Z25zappar_face_mesh_uvs_sizeP19zappar_face_mesh_ti=sr.yb,t.__Z30zappar_face_mesh_vertices_sizeP19zappar_face_mesh_ti=sr.zb,t.__Z31zappar_face_mesh_loaded_versionP19zappar_face_mesh_ti=sr.Ab,t.__Z25zappar_face_mesh_verticesP19zappar_face_mesh_ti=sr.Bb,t.__Z20zappar_face_mesh_uvsP19zappar_face_mesh_ti=sr.Cb,t.__Z24zappar_face_mesh_indicesP19zappar_face_mesh_ti=sr.Db,t.__Z23zappar_face_mesh_updateP19zappar_face_mesh_tiPKfS2_i=sr.Eb,t.__Z29zappar_face_mesh_normals_sizeP19zappar_face_mesh_ti=sr.Fb,t.__Z24zappar_face_mesh_normalsP19zappar_face_mesh_ti=sr.Gb,t._zappar_camera_source_create=sr.Hb,t._zappar_camera_source_destroy=sr.Ib,t._zappar_camera_source_start=sr.Jb,t._zappar_camera_source_pause=sr.Kb,t._zappar_camera_default_device_id=sr.Lb,t._zappar_sequence_source_create=sr.Mb,t.__Z28zappar_sequence_source_startP25zappar_sequence_source_ti=sr.Nb,t.__Z39zappar_sequence_source_load_from_memoryP25zappar_sequence_source_tiPKci=sr.Ob,t.__Z28zappar_sequence_source_pauseP25zappar_sequence_source_ti=sr.Pb,t._zappar_sequence_source_destroy=sr.Qb,t._zappar_log_level_set=sr.Rb,t._zappar_log_level=sr.Sb,t._zappar_analytics_project_id_set=sr.Tb;var fr,ur=t.___errno_location=sr.Ub,lr=t.__get_tzname=sr.Vb,pr=t.__get_daylight=sr.Wb,dr=t.__get_timezone=sr.Xb,hr=t.stackSave=sr.Yb,mr=t.stackRestore=sr.Zb,br=t.stackAlloc=sr._b;function gr(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}function wr(){function e(){if(!fr&&(fr=!0,t.calledRun=!0,!g)){if(t.noFSInit||Pe||(Pe=!0,qe(),t.stdin=t.stdin,t.stdout=t.stdout,t.stderr=t.stderr,t.stdin?je("stdin",t.stdin):Ne("/dev/tty","/dev/stdin"),t.stdout?je("stdout",null,t.stdout):Ne("/dev/tty","/dev/stdout"),t.stderr?je("stderr",null,t.stderr):Ne("/dev/tty1","/dev/stderr"),Xe("/dev/stdin",0),Xe("/dev/stdout",1),Xe("/dev/stderr",1)),Ee=!1,Q(U),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();C.unshift(e)}Q(C)}}if(!(0<W)){if(t.preRun)for("function"==typeof t.preRun&&(t.preRun=[t.preRun]);t.preRun.length;)N();Q(D),0<W||(t.setStatus?(t.setStatus("Running..."),setTimeout((function(){setTimeout((function(){t.setStatus("")}),1),e()}),1)):e())}}function yr(e){b=e,h||(V=!0),b=e,h||(t.onExit&&t.onExit(e),g=!0),c(e,new gr(e))}if(t.cwrap=function(e,r,a,n){var i=(a=a||[]).every((function(e){return"number"===e}));return"string"!==r&&i&&!n?t["_"+e]:function(){return w(e,r,a,arguments)}},t.setValue=function(e,t,r){switch("*"===(r=r||"i8").charAt(r.length-1)&&(r="i32"),r){case"i1":case"i8":v[e>>0]=t;break;case"i16":A[e>>1]=t;break;case"i32":T[e>>2]=t;break;case"i64":K=[t>>>0,(Z=t,1<=+Math.abs(Z)?0<Z?(0|Math.min(+Math.floor(Z/4294967296),4294967295))>>>0:~~+Math.ceil((Z-+(~~Z>>>0))/4294967296)>>>0:0)],T[e>>2]=K[0],T[e+4>>2]=K[1];break;case"float":x[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 v[e>>0];case"i16":return A[e>>1];case"i32":case"i64":return T[e>>2];case"float":return x[e>>2];case"double":return Number(F[e>>3]);default:j("invalid type for getValue: "+t)}return null},t.UTF8ToString=z,X=function e(){fr||wr(),fr||(X=e)},t.run=wr,t.preInit)for("function"==typeof t.preInit&&(t.preInit=[t.preInit]);0<t.preInit.length;)t.preInit.pop()();return wr(),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());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=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={}));const b=new Map;class g{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=b.get(e);return t||(t=new g(e),b.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 w,y=r(238);!function(e){e[e.OBJECT_URL=0]="OBJECT_URL",e[e.SRC_OBJECT=1]="SRC_OBJECT"}(w||(w={}));let v={deviceMotionMutliplier:-1,blacklisted:!1,showGyroPermissionsWarningIfNecessary:!1,showSafariPermissionsResetIfNecessary:!1,requestHighFrameRate:!1,videoWidth:640,videoHeight:480,dataWidth:320,dataHeight:240,videoElementInDOM:!1,preferMediaStreamTrackProcessorCamera:!1,preferImageBitmapCamera:!1};"undefined"!=typeof window&&(window.zeeProfile=v,window.location.href.indexOf("_mstppipeline")>=0&&(console.log("Configuring for MSTP camera pipeline (if supported)"),v.preferMediaStreamTrackProcessorCamera=!0),window.location.href.indexOf("_imagebitmappipeline")>=0&&(console.log("Configuring for ImageBitmap camera pipeline (if supported)"),v.preferImageBitmapCamera=!0));let E=new y.UAParser,A=(E.getOS().name||"unknown").toLowerCase(),R=(E.getEngine().name||"unknown").toLowerCase();function T(e){let t=e.split(".");if(t.length>=2){const e=parseInt(t[0]),r=parseInt(t[1]);(e<11||11===e&&r<3)&&(v.blacklisted=!0),(e<12||12===e&&r<2)&&(v.videoElementInDOM=!0),(12===e&&r>=2||e>=13)&&(v.showGyroPermissionsWarningIfNecessary=!0),e>=13&&(v.showSafariPermissionsResetIfNecessary=!0),(e>=12&&r>1||e>=13)&&navigator.mediaDevices&&navigator.mediaDevices.getSupportedConstraints&&navigator.mediaDevices.getSupportedConstraints().frameRate&&(v.requestHighFrameRate=!0,e<14&&(v.videoHeight=360,v.dataHeight=180))}}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"!==A&&(v.deviceMotionMutliplier=1,"undefined"!=typeof window&&void 0!==window.orientation&&T("15.0")),"webkit"===R&&"ios"===A&&(v.deviceMotionMutliplier=1,T(E.getOS().version||"15.0"));class x{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=m.Ue(),this._framebufferWidth=0,this._framebufferHeight=0,this._framebufferId=null,this._renderTexture=null}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=g.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.getParameter(n.ACTIVE_TEXTURE),u=n.getParameter(n.UNPACK_FLIP_Y_WEBGL),l=n.getParameter(n.CURRENT_PROGRAM);n.activeTexture(n.TEXTURE0);const p=n.getParameter(n.TEXTURE_BINDING_2D),d=n.getParameter(n.FRAMEBUFFER_BINDING),h=n.getParameter(n.ARRAY_BUFFER_BINDING),m=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.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,!1),n.bindTexture(n.TEXTURE_2D,e);const b=n.RGBA,w=n.RGBA,y=n.UNSIGNED_BYTE;n.texImage2D(n.TEXTURE_2D,0,b,w,y,t);let E=0,A=0;"undefined"!=typeof HTMLVideoElement&&t instanceof HTMLVideoElement?(E=t.videoWidth,A=t.videoHeight):(E=t.width,A=t.height),A>E&&(A=[E,E=A][0]),this._updateTransforms(r,a);let R=this._getFramebuffer(n,v.dataWidth/4,v.dataHeight),T=this._getVertexBuffer(n),k=this._getIndexBuffer(n),x=this._getGreyscaleShader(n);const F=n.getVertexAttrib(x.aVertexPositionLoc,n.VERTEX_ATTRIB_ARRAY_SIZE),L=n.getVertexAttrib(x.aVertexPositionLoc,n.VERTEX_ATTRIB_ARRAY_TYPE),M=n.getVertexAttrib(x.aVertexPositionLoc,n.VERTEX_ATTRIB_ARRAY_NORMALIZED),z=n.getVertexAttrib(x.aVertexPositionLoc,n.VERTEX_ATTRIB_ARRAY_STRIDE),I=n.getVertexAttribOffset(x.aVertexPositionLoc,n.VERTEX_ATTRIB_ARRAY_POINTER),O=n.getVertexAttrib(x.aVertexPositionLoc,n.VERTEX_ATTRIB_ARRAY_ENABLED),P=n.getVertexAttrib(x.aVertexPositionLoc,n.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING),B=n.getVertexAttrib(x.aTextureCoordLoc,n.VERTEX_ATTRIB_ARRAY_SIZE),S=n.getVertexAttrib(x.aTextureCoordLoc,n.VERTEX_ATTRIB_ARRAY_TYPE),D=n.getVertexAttrib(x.aTextureCoordLoc,n.VERTEX_ATTRIB_ARRAY_NORMALIZED),U=n.getVertexAttrib(x.aTextureCoordLoc,n.VERTEX_ATTRIB_ARRAY_STRIDE),C=n.getVertexAttribOffset(x.aTextureCoordLoc,n.VERTEX_ATTRIB_ARRAY_POINTER),V=n.getVertexAttrib(x.aTextureCoordLoc,n.VERTEX_ATTRIB_ARRAY_ENABLED),N=n.getVertexAttrib(x.aTextureCoordLoc,n.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING);n.bindFramebuffer(n.FRAMEBUFFER,R),n.viewport(0,0,this._framebufferWidth,this._framebufferHeight),n.clear(n.COLOR_BUFFER_BIT),n.bindBuffer(n.ARRAY_BUFFER,T),n.vertexAttribPointer(x.aVertexPositionLoc,2,n.FLOAT,!1,16,0),n.enableVertexAttribArray(x.aVertexPositionLoc),n.vertexAttribPointer(x.aTextureCoordLoc,2,n.FLOAT,!1,16,8),n.enableVertexAttribArray(x.aTextureCoordLoc),n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,k),n.useProgram(x.program),n.uniform1f(x.uTexWidthLoc,v.dataWidth),n.uniformMatrix4fv(x.uUvTransformLoc,!1,this._cameraUvTransform),n.activeTexture(n.TEXTURE0),n.bindTexture(n.TEXTURE_2D,e),n.uniform1i(x.uSamplerLoc,0),n.drawElements(n.TRIANGLES,6,n.UNSIGNED_SHORT,0),n.bindBuffer(n.ARRAY_BUFFER,P),n.vertexAttribPointer(x.aVertexPositionLoc,F,L,M,z,I),n.bindBuffer(n.ARRAY_BUFFER,N),n.vertexAttribPointer(x.aTextureCoordLoc,B,S,D,U,C),n.bindBuffer(n.ARRAY_BUFFER,h),n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,m),O||n.disableVertexAttribArray(x.aVertexPositionLoc),V||n.disableVertexAttribArray(x.aTextureCoordLoc),n.bindFramebuffer(n.FRAMEBUFFER,d),n.useProgram(l),n.bindTexture(n.TEXTURE_2D,p),n.activeTexture(f),n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,u),i.pop(),_&&n.enable(n.BLEND),c&&n.enable(n.CULL_FACE),s&&n.enable(n.DEPTH_TEST),o&&n.enable(n.SCISSOR_TEST)}readFrame(e,t){let r=this._gl,a=new Uint8Array(t);const n=r.getParameter(r.FRAMEBUFFER_BINDING);let i=this._getFramebuffer(r,v.dataWidth/4,v.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:v.dataWidth,dataHeight:v.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,I),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,L,M,z,I="\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 P=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}},S=0;function D(e){return P(this,void 0,void 0,(function*(){let t=i({locateFile:(t,r)=>t.endsWith("zcv.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"]),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"]),R=e.cwrap("zappar_image_tracker_target_load_from_memory",null,["number","number","number"]),T=e.cwrap("zappar_image_tracker_target_loaded_version","number",["number"]),k=e.cwrap("zappar_image_tracker_enabled","number",["number"]),x=e.cwrap("zappar_image_tracker_enabled_set",null,["number","number"]),F=e.cwrap("zappar_image_tracker_anchor_count","number",["number"]),L=e.cwrap("zappar_image_tracker_anchor_id","string",["number","number"]),M=e.cwrap("zappar_image_tracker_anchor_pose_raw","number",["number","number"]),z=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"]),B=e.cwrap("zappar_face_tracker_enabled_set",null,["number","number"]),S=e.cwrap("zappar_face_tracker_enabled","number",["number"]),D=e.cwrap("zappar_face_tracker_max_faces_set",null,["number","number"]),U=e.cwrap("zappar_face_tracker_max_faces","number",["number"]),C=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"]),H=e.cwrap("zappar_face_tracker_anchor_identity_coefficients","number",["number","number"]),W=e.cwrap("zappar_face_tracker_anchor_expression_coefficients","number",["number","number"]),G=e.cwrap("zappar_face_mesh_create","number",[]),X=e.cwrap("zappar_face_mesh_destroy",null,["number"]),Y=e.cwrap("zappar_face_landmark_create","number",["number"]),q=e.cwrap("zappar_face_landmark_destroy",null,["number"]),j=e.cwrap("zappar_barcode_finder_create","number",["number"]),$=e.cwrap("zappar_barcode_finder_destroy",null,["number"]),Z=e.cwrap("zappar_barcode_finder_enabled_set",null,["number","number"]),K=e.cwrap("zappar_barcode_finder_enabled","number",["number"]),J=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=>a(e),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),R(t,a,n)},image_tracker_target_loaded_version:e=>T(e),image_tracker_enabled:e=>{let t=k(e);return t=1===t,t},image_tracker_enabled_set:(e,t)=>x(e,t?1:0),image_tracker_anchor_count:e=>F(e),image_tracker_anchor_id:(e,t)=>L(e,t),image_tracker_anchor_pose_raw:(t,r)=>{let a=M(t,r),n=new Float32Array(16);return n.set(e.HEAPF32.subarray(a/4,16+a/4)),a=n,a},face_tracker_create:e=>z(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)=>B(e,t?1:0),face_tracker_enabled:e=>{let t=S(e);return t=1===t,t},face_tracker_max_faces_set:(e,t)=>D(e,t),face_tracker_max_faces:e=>U(e),face_tracker_anchor_count:e=>C(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=H(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:()=>G(),face_mesh_destroy:()=>{X()},face_landmark_create:e=>Y(e),face_landmark_destroy:()=>{q()},barcode_finder_create:e=>j(e),barcode_finder_destroy:()=>{$()},barcode_finder_enabled_set:(e,t)=>Z(e,t?1:0),barcode_finder_enabled:e=>{let t=K(e);return t=1===t,t},barcode_finder_found_number:e=>J(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){P(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>C&&(U>0&&e._free(U),U=e._malloc(c),C=c),yield _.copyTo(e.HEAPU8.subarray(U,U+C));let f=V;V++;const u=_.visibleRect.width,l=_.visibleRect.height;let p,d=u,h=l;switch(S){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 b=_.clone();n?m.xJ(N,[-1,1,-1]):m.yR(N);let g=300*v.dataWidth/320;H[0]=g,H[1]=g,H[2]=.5*v.dataWidth,H[3]=.5*v.dataHeight;const w={token:f,d:b,p:a,t:"videoFrameS2C",userFacing:n,uvTransform:p,w:d,h,cameraToDevice:N,cameraModel:H,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,W(_.format),u,l,f,N,S,H,n),t.pipeline_frame_update(y),i.exploreState()),_.close()}}))}(t,e,n.s,n.p,n.userFacing,r,n.source);break}case"cameraToScreenC2S":S=a.r;break;case"imageBitmapC2S":!function(e,t,r,a){const[n,i]=function(){if(!M||!z){const e=new OffscreenCanvas(1,1);if(z=e.getContext("webgl"),!z)throw new Error("Unable to get offscreen GL context");M=new x(z)}return[M,z]}();if(L||(L=i.createTexture(),i.bindTexture(i.TEXTURE_2D,L),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)),!L)return;(!F||F.byteLength<v.dataWidth*v.dataHeight)&&(console.log("Generating pixel buffer",v.dataWidth*v.dataHeight),F=new ArrayBuffer(v.dataWidth*v.dataHeight)),n.uploadFrame(L,e.i,e.r,e.userFacing);let o=n.readFrame(L,F),s={t:"imageBitmapS2C",dataWidth:o.dataWidth,dataHeight:o.dataHeight,frame:e.i,userFacing:o.userFacing,uvTransform:o.uvTransform||m.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,C=0,V=1;const N=m.Ue(),H=new Float32Array([300,300,160,120,0,0]);function W(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 G=self;B.onOutgoingMessage.bind((()=>{let e=B.getOutgoingMessages();for(let t of e)G.postMessage(t.msg,t.transferables)}));let X=e=>{e&&e.data&&"wasm"===e.data.t&&(D(location.href.startsWith("blob")?e.data.url:new URL(r(394),r.b).toString()),G.removeEventListener("message",X))};G.addEventListener("message",X),G.addEventListener("message",(e=>{B.postIncomingMessage(e.data)}))},394:(e,t,r)=>{e.exports=r.p+"6a8309f88f836a752c68.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(752)));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={752: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()})()}));