@zappar/zappar-cv 2.1.3 → 2.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.1.4] - 2023-07-06
4
+
5
+ - Whitelisted `*.ngrok-free.app` domain.
6
+
7
+ ## [2.1.3] - 2023-06-23
8
+
9
+ ### Fixed
10
+
11
+ - Performance issues when using curved tracking.
12
+
3
13
  ## [2.0.2] - 2023-05-04
4
14
 
5
15
  ### Fixed
@@ -76,6 +86,7 @@
76
86
  ## [0.3.10] - 2021-09-17
77
87
 
78
88
  ### Added
89
+
79
90
  - loaded() function which returns true once the library is fully loaded and available for use
80
91
 
81
92
  ### Changed
package/README.md CHANGED
@@ -18,8 +18,8 @@ npm i @zappar/zappar-cv
18
18
 
19
19
  You can use our CDN from within your HTML:
20
20
  ```
21
- <script src="https://libs.zappar.com/zappar-cv/2.1.3/zappar-cv.js"></script>
21
+ <script src="https://libs.zappar.com/zappar-cv/2.1.5/zappar-cv.js"></script>
22
22
  ```
23
23
 
24
24
  Or you can download and host our standalone JavaScript bundle:
25
- [https://libs.zappar.com/zappar-cv/2.1.3/zappar-cv.zip](https://libs.zappar.com/zappar-cv/2.1.3/zappar-cv.zip)
25
+ [https://libs.zappar.com/zappar-cv/2.1.5/zappar-cv.zip](https://libs.zappar.com/zappar-cv/2.1.5/zappar-cv.zip)
package/lib/native.js CHANGED
@@ -42,7 +42,7 @@ export function initialize(opts) {
42
42
  });
43
43
  const uid = getUID();
44
44
  let hasPersistedUID = false;
45
- if (window.location.hostname.toLowerCase().indexOf(".zappar.io") > 0 || window.location.hostname.toLowerCase().indexOf(".webar.run") > 0) {
45
+ if (window.location.hostname.toLowerCase().indexOf(".zappar.io") > 0 || window.location.hostname.toLowerCase().indexOf(".webar.run") > 0 || window.location.hostname.toLowerCase().indexOf(".arweb.app") > 0) {
46
46
  let pathParts = window.location.pathname.split("/");
47
47
  if (pathParts.length > 1 && pathParts[1].length > 0)
48
48
  c.impl.analytics_project_id_set(".wiz" + pathParts[1], uid);
package/lib/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const VERSION = "2.1.3";
1
+ export declare const VERSION = "2.1.5";
package/lib/version.js CHANGED
@@ -1 +1 @@
1
- export const VERSION = "2.1.3";
1
+ export const VERSION = "2.1.5";
package/lib/zappar-cv.js CHANGED
@@ -104,16 +104,16 @@ f).Cc}catch(g){return"undefined"!==typeof V&&g instanceof N||x(g),-g.vc}},J:func
104
104
  a+b.release);za("#1",a+b.version);za("wasm32",a+b.machine);return 0}catch(c){return"undefined"!==typeof V&&c instanceof N||x(c),-c.vc}},D:function(a){try{a=E(a);var b=T(a,{parent:!0}).node,c=bb(a),d=ob(b,c);a:{try{var f=ob(b,c)}catch(p){var g=p.vc;break a}var k=xb(b,"wx");g=k?k:16384===(f.mode&61440)?31:0}if(g)throw new N(g);if(!b.qc.Wc)throw new N(63);if(d.Kc)throw new N(10);try{R.willDeletePath&&R.willDeletePath(a)}catch(p){n("FS.trackingDelegate['willDeletePath']('"+a+"') threw an exception: "+
105
105
  p.message)}b.qc.Wc(b,c);var q=wb(d.parent.id,d.name);if(Q[q]===d)Q[q]=d.Fc;else for(var r=Q[q];r;){if(r.Fc===d){r.Fc=d.Fc;break}r=r.Fc}try{if(R.onDeletePath)R.onDeletePath(a)}catch(p){n("FS.trackingDelegate['onDeletePath']('"+a+"') threw an exception: "+p.message)}return 0}catch(p){return"undefined"!==typeof V&&p instanceof N||x(p),-p.vc}},L:function(a){delete Oc[a-1]},c:function(){x()},h:Ua,P:function(a,b){return a-b},R:function(){self.postMessage({t:"gfx"})},t:function(){var a=(new URL(location.origin)).hostname;
106
106
  0===a.length&&(a=(new URL(location.href.replace("blob:",""))).hostname);if(/^(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(a))0===a.indexOf("10.")&&(a="10.*"),0===a.indexOf("192.168.")&&(a="192.168.*"),0===a.indexOf("172.")&&(a="172.*"),0===a.indexOf("127.")&&(a="127.*");else{var b=new RegExp("("+String.fromCharCode(92)+".ngrok"+String.fromCharCode(92)+".io)$","i");b.test(a)&&(a="*.ngrok.io");
107
- b=new RegExp("("+String.fromCharCode(92)+".arweb"+String.fromCharCode(92)+".app)$","i");b.test(a)&&(a="*.arweb.app")}b=wa(a)+1;var c=ya(b);z(a,A,c,b+1);return c},s:function(){self.postMessage({t:"licerr"})},l:function(a,b,c){function d(){I.get(a)(b)}0<=c?wc(d,c):Lc(d)},x:function(){return 2147483648},N:Nc,v:function(a,b,c){A.copyWithin(a,b,b+c)},w:function(a){var b=A.length;if(2147483648<a)return!1;for(var c=1;4>=c;c*=2){var d=b*(1+.2/c);d=Math.min(d,a+100663296);d=Math.max(a,d);0<d%65536&&(d+=65536-
108
- d%65536);a:{try{la.grow(Math.min(2147483648,d)-Aa.byteLength+65535>>>16);Ea();var f=1;break a}catch(g){}f=void 0}if(f)return!0}return!1},M:function(a,b,c,d,f){function g(B){Qc(B,k,p,t,r)}function k(B,O){Sc(B,O.response,function(L){X(function(){u?I.get(u)(L):b&&b(L)})},function(L){X(function(){u?I.get(u)(L):b&&b(L)})})}function q(B){Qc(B,w,p,t,r)}function r(B){X(function(){S?I.get(S)(B):f&&f(B)})}function p(B){X(function(){y?I.get(y)(B):c&&c(B)})}function t(B){X(function(){J?I.get(J)(B):d&&d(B)})}
109
- function w(B){X(function(){u?I.get(u)(B):b&&b(B)})}var C=a+112,h=E(C),u=H[C+36>>2],y=H[C+40>>2],J=H[C+44>>2],S=H[C+48>>2],W=H[C+52>>2],Xa=!!(W&4),v=!!(W&32);W=!!(W&16);if("EM_IDB_STORE"===h)h=H[C+84>>2],Sc(a,A.slice(h,h+H[C+88>>2]),w,p);else if("EM_IDB_DELETE"===h)Uc(a,w,p);else if(W){if(v)return 0;Qc(a,Xa?k:w,p,t,r)}else Tc(a,w,v?p:Xa?g:q);return a},A:function(a,b){try{var c=0;Wc().forEach(function(d,f){var g=b+c;G[a+4*f>>2]=g;za(d,g);c+=d.length+1});return 0}catch(d){return"undefined"!==typeof V&&
110
- d instanceof N||x(d),d.vc}},B:function(a,b){try{var c=Wc();G[a>>2]=c.length;var d=0;c.forEach(function(f){d+=f.length+1});G[b>>2]=d;return 0}catch(f){return"undefined"!==typeof V&&f instanceof N||x(f),f.vc}},O:function(a){hc(a)},g:function(a){try{var b=Wb(a);if(null===b.Cc)throw new N(8);b.Dc&&(b.Dc=null);try{b.sc.close&&b.sc.close(b)}catch(c){throw c;}finally{rb[b.Cc]=null}b.Cc=null;return 0}catch(c){return"undefined"!==typeof V&&c instanceof N||x(c),c.vc}},F:function(a,b,c,d){try{a:{for(var f=Wb(a),
111
- g=a=0;g<c;g++){var k=G[b+(8*g+4)>>2],q=f,r=G[b+8*g>>2],p=k,t=void 0,w=D;if(0>p||0>t)throw new N(28);if(null===q.Cc)throw new N(8);if(1===(q.flags&2097155))throw new N(8);if(16384===(q.node.mode&61440))throw new N(31);if(!q.sc.read)throw new N(28);var C="undefined"!==typeof t;if(!C)t=q.position;else if(!q.seekable)throw new N(70);var h=q.sc.read(q,w,r,p,t);C||(q.position+=h);var u=h;if(0>u){var y=-1;break a}a+=u;if(u<k)break}y=a}G[d>>2]=y;return 0}catch(J){return"undefined"!==typeof V&&J instanceof
112
- N||x(J),J.vc}},u:function(a,b,c,d,f){try{var g=Wb(a);a=4294967296*c+(b>>>0);if(-9007199254740992>=a||9007199254740992<=a)return-61;Nb(g,a,d);M=[g.position>>>0,(K=g.position,1<=+Math.abs(K)?0<K?(Math.min(+Math.floor(K/4294967296),4294967295)|0)>>>0:~~+Math.ceil((K-+(~~K>>>0))/4294967296)>>>0:0)];G[f>>2]=M[0];G[f+4>>2]=M[1];g.Dc&&0===a&&0===d&&(g.Dc=null);return 0}catch(k){return"undefined"!==typeof V&&k instanceof N||x(k),k.vc}},k:function(a,b,c,d){try{a:{for(var f=Wb(a),g=a=0;g<c;g++){var k=f,q=G[b+
113
- 8*g>>2],r=G[b+(8*g+4)>>2],p=void 0,t=D;if(0>r||0>p)throw new N(28);if(null===k.Cc)throw new N(8);if(0===(k.flags&2097155))throw new N(8);if(16384===(k.node.mode&61440))throw new N(31);if(!k.sc.write)throw new N(28);k.seekable&&k.flags&1024&&Nb(k,0,2);var w="undefined"!==typeof p;if(!w)p=k.position;else if(!k.seekable)throw new N(70);var C=k.sc.write(k,t,q,r,p,void 0);w||(k.position+=C);try{if(k.path&&R.onWriteToFile)R.onWriteToFile(k.path)}catch(y){n("FS.trackingDelegate['onWriteToFile']('"+k.path+
114
- "') threw an exception: "+y.message)}var h=C;if(0>h){var u=-1;break a}a+=h}u=a}G[d>>2]=u;return 0}catch(y){return"undefined"!==typeof V&&y instanceof N||x(y),y.vc}},f:function(a){var b=Date.now();G[a>>2]=b/1E3|0;G[a+4>>2]=b%1E3*1E3|0;return 0},m:function(a,b){Bc.bindTexture(a,bd[b])},o:function(a,b){for(var c=0;c<a;c++){var d=Bc.createTexture(),f=d&&cd(bd);d?(d.name=f,bd[f]=d):fd||(fd=1282);G[b+4*c>>2]=f}},i:function(a,b,c,d,f,g,k,q,r){var p=Bc,t=p.texImage2D;if(r){var w=q-5120;w=1==w?A:4==w?G:6==
115
- w?Ca:5==w||28922==w?H:F;var C=31-Math.clz32(w.BYTES_PER_ELEMENT);r=w.subarray(r>>C,r+f*(d*({5:3,6:4,8:2,29502:3,29504:4}[k-6402]||1)*(1<<C)+4-1&-4)>>C)}else r=null;t.call(p,a,b,c,d,f,g,k,q,r)},j:function(a,b,c){Bc.texParameteri(a,b,c)},r:gd,q:function(a,b){hd();a=new Date(1E3*G[a>>2]);G[b>>2]=a.getSeconds();G[b+4>>2]=a.getMinutes();G[b+8>>2]=a.getHours();G[b+12>>2]=a.getDate();G[b+16>>2]=a.getMonth();G[b+20>>2]=a.getFullYear()-1900;G[b+24>>2]=a.getDay();var c=new Date(a.getFullYear(),0,1);G[b+28>>
116
- 2]=(a.getTime()-c.getTime())/864E5|0;G[b+36>>2]=-(60*a.getTimezoneOffset());var d=(new Date(a.getFullYear(),6,1)).getTimezoneOffset();c=c.getTimezoneOffset();a=(d!=c&&a.getTimezoneOffset()==Math.min(c,d))|0;G[b+32>>2]=a;a=G[ld()+(a?4:0)>>2];G[b+40>>2]=a;return b},Q:function(){return 6},y:function(){return 28},z:function(a,b,c,d){return rd(a,b,c,d)},d:function(a){var b=Date.now()/1E3|0;a&&(G[a>>2]=b);return b}},Z=function(){function a(c){e.asm=c.exports;la=e.asm.S;Ea();I=e.asm.X;Ga.unshift(e.asm.T);
107
+ b=new RegExp("("+String.fromCharCode(92)+".ngrok-free"+String.fromCharCode(92)+".app)$","i");b.test(a)&&(a="*.ngrok.io");b=new RegExp("("+String.fromCharCode(92)+".arweb"+String.fromCharCode(92)+".app)$","i");b.test(a)&&(a="*.arweb.app")}b=wa(a)+1;var c=ya(b);z(a,A,c,b+1);return c},s:function(){self.postMessage({t:"licerr"})},l:function(a,b,c){function d(){I.get(a)(b)}0<=c?wc(d,c):Lc(d)},x:function(){return 2147483648},N:Nc,v:function(a,b,c){A.copyWithin(a,b,b+c)},w:function(a){var b=A.length;if(2147483648<
108
+ a)return!1;for(var c=1;4>=c;c*=2){var d=b*(1+.2/c);d=Math.min(d,a+100663296);d=Math.max(a,d);0<d%65536&&(d+=65536-d%65536);a:{try{la.grow(Math.min(2147483648,d)-Aa.byteLength+65535>>>16);Ea();var f=1;break a}catch(g){}f=void 0}if(f)return!0}return!1},M:function(a,b,c,d,f){function g(B){Qc(B,k,p,t,r)}function k(B,O){Sc(B,O.response,function(L){X(function(){u?I.get(u)(L):b&&b(L)})},function(L){X(function(){u?I.get(u)(L):b&&b(L)})})}function q(B){Qc(B,w,p,t,r)}function r(B){X(function(){S?I.get(S)(B):
109
+ f&&f(B)})}function p(B){X(function(){y?I.get(y)(B):c&&c(B)})}function t(B){X(function(){J?I.get(J)(B):d&&d(B)})}function w(B){X(function(){u?I.get(u)(B):b&&b(B)})}var C=a+112,h=E(C),u=H[C+36>>2],y=H[C+40>>2],J=H[C+44>>2],S=H[C+48>>2],W=H[C+52>>2],Xa=!!(W&4),v=!!(W&32);W=!!(W&16);if("EM_IDB_STORE"===h)h=H[C+84>>2],Sc(a,A.slice(h,h+H[C+88>>2]),w,p);else if("EM_IDB_DELETE"===h)Uc(a,w,p);else if(W){if(v)return 0;Qc(a,Xa?k:w,p,t,r)}else Tc(a,w,v?p:Xa?g:q);return a},A:function(a,b){try{var c=0;Wc().forEach(function(d,
110
+ f){var g=b+c;G[a+4*f>>2]=g;za(d,g);c+=d.length+1});return 0}catch(d){return"undefined"!==typeof V&&d instanceof N||x(d),d.vc}},B:function(a,b){try{var c=Wc();G[a>>2]=c.length;var d=0;c.forEach(function(f){d+=f.length+1});G[b>>2]=d;return 0}catch(f){return"undefined"!==typeof V&&f instanceof N||x(f),f.vc}},O:function(a){hc(a)},g:function(a){try{var b=Wb(a);if(null===b.Cc)throw new N(8);b.Dc&&(b.Dc=null);try{b.sc.close&&b.sc.close(b)}catch(c){throw c;}finally{rb[b.Cc]=null}b.Cc=null;return 0}catch(c){return"undefined"!==
111
+ typeof V&&c instanceof N||x(c),c.vc}},F:function(a,b,c,d){try{a:{for(var f=Wb(a),g=a=0;g<c;g++){var k=G[b+(8*g+4)>>2],q=f,r=G[b+8*g>>2],p=k,t=void 0,w=D;if(0>p||0>t)throw new N(28);if(null===q.Cc)throw new N(8);if(1===(q.flags&2097155))throw new N(8);if(16384===(q.node.mode&61440))throw new N(31);if(!q.sc.read)throw new N(28);var C="undefined"!==typeof t;if(!C)t=q.position;else if(!q.seekable)throw new N(70);var h=q.sc.read(q,w,r,p,t);C||(q.position+=h);var u=h;if(0>u){var y=-1;break a}a+=u;if(u<
112
+ k)break}y=a}G[d>>2]=y;return 0}catch(J){return"undefined"!==typeof V&&J instanceof N||x(J),J.vc}},u:function(a,b,c,d,f){try{var g=Wb(a);a=4294967296*c+(b>>>0);if(-9007199254740992>=a||9007199254740992<=a)return-61;Nb(g,a,d);M=[g.position>>>0,(K=g.position,1<=+Math.abs(K)?0<K?(Math.min(+Math.floor(K/4294967296),4294967295)|0)>>>0:~~+Math.ceil((K-+(~~K>>>0))/4294967296)>>>0:0)];G[f>>2]=M[0];G[f+4>>2]=M[1];g.Dc&&0===a&&0===d&&(g.Dc=null);return 0}catch(k){return"undefined"!==typeof V&&k instanceof N||
113
+ x(k),k.vc}},k:function(a,b,c,d){try{a:{for(var f=Wb(a),g=a=0;g<c;g++){var k=f,q=G[b+8*g>>2],r=G[b+(8*g+4)>>2],p=void 0,t=D;if(0>r||0>p)throw new N(28);if(null===k.Cc)throw new N(8);if(0===(k.flags&2097155))throw new N(8);if(16384===(k.node.mode&61440))throw new N(31);if(!k.sc.write)throw new N(28);k.seekable&&k.flags&1024&&Nb(k,0,2);var w="undefined"!==typeof p;if(!w)p=k.position;else if(!k.seekable)throw new N(70);var C=k.sc.write(k,t,q,r,p,void 0);w||(k.position+=C);try{if(k.path&&R.onWriteToFile)R.onWriteToFile(k.path)}catch(y){n("FS.trackingDelegate['onWriteToFile']('"+
114
+ k.path+"') threw an exception: "+y.message)}var h=C;if(0>h){var u=-1;break a}a+=h}u=a}G[d>>2]=u;return 0}catch(y){return"undefined"!==typeof V&&y instanceof N||x(y),y.vc}},f:function(a){var b=Date.now();G[a>>2]=b/1E3|0;G[a+4>>2]=b%1E3*1E3|0;return 0},m:function(a,b){Bc.bindTexture(a,bd[b])},o:function(a,b){for(var c=0;c<a;c++){var d=Bc.createTexture(),f=d&&cd(bd);d?(d.name=f,bd[f]=d):fd||(fd=1282);G[b+4*c>>2]=f}},i:function(a,b,c,d,f,g,k,q,r){var p=Bc,t=p.texImage2D;if(r){var w=q-5120;w=1==w?A:4==
115
+ w?G:6==w?Ca:5==w||28922==w?H:F;var C=31-Math.clz32(w.BYTES_PER_ELEMENT);r=w.subarray(r>>C,r+f*(d*({5:3,6:4,8:2,29502:3,29504:4}[k-6402]||1)*(1<<C)+4-1&-4)>>C)}else r=null;t.call(p,a,b,c,d,f,g,k,q,r)},j:function(a,b,c){Bc.texParameteri(a,b,c)},r:gd,q:function(a,b){hd();a=new Date(1E3*G[a>>2]);G[b>>2]=a.getSeconds();G[b+4>>2]=a.getMinutes();G[b+8>>2]=a.getHours();G[b+12>>2]=a.getDate();G[b+16>>2]=a.getMonth();G[b+20>>2]=a.getFullYear()-1900;G[b+24>>2]=a.getDay();var c=new Date(a.getFullYear(),0,1);
116
+ G[b+28>>2]=(a.getTime()-c.getTime())/864E5|0;G[b+36>>2]=-(60*a.getTimezoneOffset());var d=(new Date(a.getFullYear(),6,1)).getTimezoneOffset();c=c.getTimezoneOffset();a=(d!=c&&a.getTimezoneOffset()==Math.min(c,d))|0;G[b+32>>2]=a;a=G[ld()+(a?4:0)>>2];G[b+40>>2]=a;return b},Q:function(){return 6},y:function(){return 28},z:function(a,b,c,d){return rd(a,b,c,d)},d:function(a){var b=Date.now()/1E3|0;a&&(G[a>>2]=b);return b}},Z=function(){function a(c){e.asm=c.exports;la=e.asm.S;Ea();I=e.asm.X;Ga.unshift(e.asm.T);
117
117
  Oa()}var b={a:sd};Na();if(e.instantiateWasm)try{return e.instantiateWasm(b,a)}catch(c){return n("Module.instantiateWasm callback failed with error: "+c),!1}b=Ra(b);a(b[0]);return e.asm}();e.___wasm_call_ctors=Z.T;e._zappar_has_initialized=Z.U;e._zappar_invert=Z.V;e._zappar_loaded=Z.W;e._zappar_pipeline_create=Z.Y;e._zappar_pipeline_destroy=Z.Z;e._zappar_pipeline_camera_frame_submit=Z._;e._zappar_pipeline_camera_frame_submit_raw_pointer=Z.$;e._zappar_pipeline_frame_update=Z.aa;
118
118
  e._zappar_pipeline_camera_frame_user_data=Z.ba;e._zappar_pipeline_camera_model=Z.ca;e._zappar_pipeline_frame_number=Z.da;e._zappar_pipeline_motion_accelerometer_submit=Z.ea;e._zappar_pipeline_motion_rotation_rate_submit=Z.fa;e._zappar_pipeline_motion_attitude_submit=Z.ga;e._zappar_pipeline_motion_attitude_matrix_submit=Z.ha;e._zappar_pipeline_camera_frame_user_facing=Z.ia;e._zappar_pipeline_camera_frame_texture_matrix=Z.ja;e._zappar_pipeline_camera_pose_with_attitude=Z.ka;
119
119
  e._zappar_pipeline_camera_pose_with_origin=Z.la;e._zappar_pipeline_camera_frame_camera_attitude=Z.ma;e._zappar_pipeline_camera_frame_device_attitude=Z.na;e._zappar_pipeline_camera_frame_texture_gl=Z.oa;e._zappar_pipeline_camera_frame_upload_gl=Z.pa;e._zappar_pipeline_sequence_record_start=Z.qa;e._zappar_pipeline_sequence_record_stop=Z.ra;e._zappar_pipeline_sequence_record_clear=Z.sa;e._zappar_pipeline_sequence_record_device_attitude_matrices_set=Z.ta;e._zappar_pipeline_sequence_record_data_size=Z.ua;
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zappar/zappar-cv",
3
- "version": "2.1.3",
3
+ "version": "2.1.5",
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",