Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@candulabs/eventing

Package Overview
Dependencies
Maintainers
4
Versions
241
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@candulabs/eventing - npm Package Compare versions

Comparing version 0.8.22 to 0.8.23

32

CHANGELOG.md

@@ -6,2 +6,34 @@ # Change Log

## [0.8.23](https://github.com/candulabs/candu-sdk/tree/master/packages/candu-eventing/compare/v0.8.23-alpha.2...v0.8.23) (2022-01-06)
**Note:** Version bump only for package @candulabs/eventing
## 0.8.23-alpha.2 (2022-01-05)
**Note:** Version bump only for package @candulabs/eventing
## 0.8.23-alpha.1 (2021-12-16)
**Note:** Version bump only for package @candulabs/eventing
## 0.8.23-alpha.0 (2021-12-14)
**Note:** Version bump only for package @candulabs/eventing
## [0.8.22](https://github.com/candulabs/candu-sdk/tree/master/packages/candu-eventing/compare/v0.8.22-alpha.1...v0.8.22) (2021-12-13)

@@ -8,0 +40,0 @@

2

dist/index.cjs.js

@@ -1,1 +0,1 @@

"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};for(var n,t=(function(e){var n="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(n){var t=new Uint8Array(16);e.exports=function(){return n(t),t}}else{var r=new Array(16);e.exports=function(){for(var e,n=0;n<16;n++)0==(3&n)&&(e=4294967296*Math.random()),r[n]=e>>>((3&n)<<3)&255;return r}}}(n={exports:{}},n.exports),n.exports),r=[],o=0;o<256;++o)r[o]=(o+256).toString(16).substr(1);var i=function(e,n){var t=n||0,o=r;return[o[e[t++]],o[e[t++]],o[e[t++]],o[e[t++]],"-",o[e[t++]],o[e[t++]],"-",o[e[t++]],o[e[t++]],"-",o[e[t++]],o[e[t++]],"-",o[e[t++]],o[e[t++]],o[e[t++]],o[e[t++]],o[e[t++]],o[e[t++]]].join("")};var a=function(e,n,r){var o=n&&r||0;"string"==typeof e&&(n="binary"===e?new Array(16):null,e=null);var a=(e=e||{}).random||(e.rng||t)();if(a[6]=15&a[6]|64,a[8]=63&a[8]|128,n)for(var u=0;u<16;++u)n[o+u]=a[u];return n||i(a)};var u,c;!function(e){e.UserGenerated="UserGenerated",e.SDK="SDK"}(u||(u={})),function(e){e.Identify="Identify",e.Group="Group",e.Track="Track",e.Page="Page",e.Screen="Screen"}(c||(c={}));var s,f,l={name:"JsClient",version:"0.8.22"},d={fetch:null,document:void 0,navigator:{language:"",userAgent:""},location:{pathname:"",href:"",search:""},screen:{height:0,width:0},Intl:{DateTimeFormat:function(){return{resolvedOptions:function(){return{timeZone:""}}}}}},v=function(){try{return"undefined"!=typeof window&&window.localStorage}catch(e){return null}},p=function(e){return function(){if(v()){var n=window.localStorage.getItem(e);if(n)try{return JSON.parse(n)}catch(e){return null}}}},g=function(e){return function(n){v()&&null!=n&&window.localStorage.setItem(e,JSON.stringify(n))}},m={events:{append:function(e){var n=p("candu:events")()||[];g("candu:events")(function(){try{return n.push(e),n}catch(n){return[e]}}())},get:p("candu:events"),clear:function(){return g("candu:events")([])}},anonymousId:{getOrCreate:(s="candu:anonymous_id",f=function(){var e=a();return g("candu:anonymous_id")(e),e},function(){return p(s)()||f()}),set:g("candu:anonymous_id")}},y=function(){return(y=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e}).apply(this,arguments)};var h=function(e){var n=typeof e;return null!=e&&("object"==n||"function"==n)},b="object"==typeof e&&e&&e.Object===Object&&e,w="object"==typeof self&&self&&self.Object===Object&&self,O=b||w||Function("return this")(),T=function(){return O.Date.now()},S=O.Symbol,I=Object.prototype,j=I.hasOwnProperty,x=I.toString,N=S?S.toStringTag:void 0;var k=function(e){var n=j.call(e,N),t=e[N];try{e[N]=void 0;var r=!0}catch(e){}var o=x.call(e);return r&&(n?e[N]=t:delete e[N]),o},_=Object.prototype.toString;var E=function(e){return _.call(e)},D=S?S.toStringTag:void 0;var A=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":D&&D in Object(e)?k(e):E(e)};var C=function(e){return null!=e&&"object"==typeof e};var P=function(e){return"symbol"==typeof e||C(e)&&"[object Symbol]"==A(e)},M=/^\s+|\s+$/g,q=/^[-+]0x[0-9a-f]+$/i,F=/^0b[01]+$/i,J=/^0o[0-7]+$/i,V=parseInt;var G=function(e){if("number"==typeof e)return e;if(P(e))return NaN;if(h(e)){var n="function"==typeof e.valueOf?e.valueOf():e;e=h(n)?n+"":n}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(M,"");var t=F.test(e);return t||J.test(e)?V(e.slice(2),t?2:8):q.test(e)?NaN:+e},R=Math.max,U=Math.min;var $=function(e,n,t){var r,o,i,a,u,c,s=0,f=!1,l=!1,d=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function v(n){var t=r,i=o;return r=o=void 0,s=n,a=e.apply(i,t)}function p(e){return s=e,u=setTimeout(m,n),f?v(e):a}function g(e){var t=e-c;return void 0===c||t>=n||t<0||l&&e-s>=i}function m(){var e=T();if(g(e))return y(e);u=setTimeout(m,function(e){var t=n-(e-c);return l?U(t,i-(e-s)):t}(e))}function y(e){return u=void 0,d&&r?v(e):(r=o=void 0,a)}function b(){var e=T(),t=g(e);if(r=arguments,o=this,c=e,t){if(void 0===u)return p(c);if(l)return clearTimeout(u),u=setTimeout(m,n),v(c)}return void 0===u&&(u=setTimeout(m,n)),a}return n=G(n)||0,h(t)&&(f=!!t.leading,i=(l="maxWait"in t)?R(G(t.maxWait)||0,n):i,d="trailing"in t?!!t.trailing:d),b.cancel=function(){void 0!==u&&clearTimeout(u),s=0,r=c=o=u=void 0},b.flush=function(){return void 0===u?a:y(T())},b};var K,W,Z=function(e,n,t){var r=!0,o=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return h(t)&&(r="leading"in t?!!t.leading:r,o="trailing"in t?!!t.trailing:o),$(e,n,{leading:r,maxWait:n,trailing:o})},z=function(){return"undefined"!=typeof window?window:d},X=function(){return{path:z().location.pathname,url:z().location.href,title:document.title,search:z().location.search,referrer:document.referrer}},B=function(e,n){return void 0===n&&(n={}),{id:a(),type:e,eventName:n.eventName,pageName:n.pageName,screenName:n.screenName,properties:n.properties,traits:n.traits}},H=function(e,n,t){void 0===t&&(t={});var r=function(r){return o=function(e,n,t,r){return void 0===r&&(r={}),{clientToken:e,anonymousId:m.anonymousId.getOrCreate(),userId:n&&n.toString(),context:(o=r.source,i=r.sdk,a=r.contextAdapter,void 0===a&&(a=function(e){return e}),a({sdk:i,source:o,locale:z().navigator.language,screen:z().screen&&{height:z().screen.height,width:z().screen.width},page:z().document&&X(),userAgent:z().navigator.userAgent,library:l,timezone:z().Intl&&z().Intl.DateTimeFormat().resolvedOptions().timeZone})),sentAt:new Date(Date.now()).toISOString(),events:t,signature:r.hmac};var o,i,a}(e,n,r,t),z().fetch?fetch(""+(i&&i+"/api/batchEvent"||"https://api.candu.ai/api/batchEvent"),{method:"POST",mode:"no-cors",headers:{"Content-Type":"text/plain"},body:JSON.stringify(o)}):null;var o,i},o=function(){var e=m.events.get()||[];e.length<1||(m.events.clear(),r(e))},i=Z((function(){return o()}),1e3,{leading:!1});return{addEvent:function(e,n,t){void 0===t&&(t={}),m.events.append(B(n,t)),i()},flush:o,submitEvent:function(e,n,t){return void 0===t&&(t={}),r([B(n,t)])}}},L=0,Q=0;var Y=function(e,n,r){var o=n&&r||0,a=n||[],u=(e=e||{}).node||K,c=void 0!==e.clockseq?e.clockseq:W;if(null==u||null==c){var s=t();null==u&&(u=K=[1|s[0],s[1],s[2],s[3],s[4],s[5]]),null==c&&(c=W=16383&(s[6]<<8|s[7]))}var f=void 0!==e.msecs?e.msecs:(new Date).getTime(),l=void 0!==e.nsecs?e.nsecs:Q+1,d=f-L+(l-Q)/1e4;if(d<0&&void 0===e.clockseq&&(c=c+1&16383),(d<0||f>L)&&void 0===e.nsecs&&(l=0),l>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");L=f,Q=l,W=c;var v=(1e4*(268435455&(f+=122192928e5))+l)%4294967296;a[o++]=v>>>24&255,a[o++]=v>>>16&255,a[o++]=v>>>8&255,a[o++]=255&v;var p=f/4294967296*1e4&268435455;a[o++]=p>>>8&255,a[o++]=255&p,a[o++]=p>>>24&15|16,a[o++]=p>>>16&255,a[o++]=c>>>8|128,a[o++]=255&c;for(var g=0;g<6;++g)a[o+g]=u[g];return n||i(a)},ee=a;ee.v1=Y,ee.v4=a;var ne=ee,te=function(e){var n=function(e){var n=e.clientToken,t=e.errorMsg,r=e.errorData,o=e.userId,i=void 0===o?m.anonymousId.getOrCreate():o,a=e.functionName,u=(new Date).getTime(),c=(new Date).toISOString(),s=ne.v4();return{url:"https://sentry.io/api/5589365/store/",request:{method:"POST",headers:{"Content-Type":"application/json","X-Sentry-Auth":"Sentry sentry_version=7,sentry_timestamp="+u+",sentry_key=bf02871777614ec786d84577da9afc6c,sentry_client=sentry-javascript/1.0"},body:JSON.stringify({event_id:s,transaction:a,timestamp:c,platform:"javascript",level:"error",logger:"@candulabs/eventing",server_name:z().location.href,release:"0.8.22",modules:{"@candulabs/eventing":"0.8.22","@candulabs/core":"0.8.22","@candulabs/js-sdk":"0.8.22"},user:{userId:i,clientToken:n,ip_address:"{{auto}}"},tags:{userId:i,clientToken:n,sdkVersion:"0.8.22"},exception:{values:[{type:"SDK Error",value:t,module:"__builtins__"}]},extra:y(y(y({},r),X()),{userAgent:z().navigator.userAgent,locale:z().navigator.language,timezone:z().Intl&&z().Intl.DateTimeFormat().resolvedOptions().timeZone})})}}}(e),t=n.url,r=n.request;fetch(t,r)},re={identify:function(){return null},page:function(){return null},screen:function(){return null},track:function(){return null},error:function(){return null}},oe=m.anonymousId.getOrCreate;exports.eventingFactory=function(e,n,t){void 0===t&&(t={});var r=function(r,o,i){void 0===o&&(o={}),te({userId:n,errorMsg:r,clientToken:e,functionName:i,errorData:y(y({},o),t)})};if(t.disableTracking)return y(y({},re),{error:r});var o=H(e,n,t);return o.flush(),{identify:function(e,n){return o.submitEvent(e,c.Identify,{traits:n})},page:function(e,t){return o.addEvent(n,c.Page,{pageName:e,properties:t})},screen:function(e,t){return o.addEvent(n,c.Screen,{screenName:e,properties:t})},track:function(e,t){return o.addEvent(n,c.Track,{eventName:e,properties:t})},error:r}},exports.getAnonymousId=oe,exports.noOpEventing=re;
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};for(var n,t=(function(e){var n="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(n){var t=new Uint8Array(16);e.exports=function(){return n(t),t}}else{var r=new Array(16);e.exports=function(){for(var e,n=0;n<16;n++)0==(3&n)&&(e=4294967296*Math.random()),r[n]=e>>>((3&n)<<3)&255;return r}}}(n={exports:{}},n.exports),n.exports),r=[],o=0;o<256;++o)r[o]=(o+256).toString(16).substr(1);var i=function(e,n){var t=n||0,o=r;return[o[e[t++]],o[e[t++]],o[e[t++]],o[e[t++]],"-",o[e[t++]],o[e[t++]],"-",o[e[t++]],o[e[t++]],"-",o[e[t++]],o[e[t++]],"-",o[e[t++]],o[e[t++]],o[e[t++]],o[e[t++]],o[e[t++]],o[e[t++]]].join("")};var a=function(e,n,r){var o=n&&r||0;"string"==typeof e&&(n="binary"===e?new Array(16):null,e=null);var a=(e=e||{}).random||(e.rng||t)();if(a[6]=15&a[6]|64,a[8]=63&a[8]|128,n)for(var u=0;u<16;++u)n[o+u]=a[u];return n||i(a)};var u,c;!function(e){e.UserGenerated="UserGenerated",e.SDK="SDK"}(u||(u={})),function(e){e.Identify="Identify",e.Group="Group",e.Track="Track",e.Page="Page",e.Screen="Screen"}(c||(c={}));var s,f,l={name:"JsClient",version:"0.8.23"},d={fetch:null,document:void 0,navigator:{language:"",userAgent:""},location:{pathname:"",href:"",search:""},screen:{height:0,width:0},Intl:{DateTimeFormat:function(){return{resolvedOptions:function(){return{timeZone:""}}}}}},v=function(){try{return"undefined"!=typeof window&&window.localStorage}catch(e){return null}},p=function(e){return function(){if(v()){var n=window.localStorage.getItem(e);if(n)try{return JSON.parse(n)}catch(e){return null}}}},g=function(e){return function(n){v()&&null!=n&&window.localStorage.setItem(e,JSON.stringify(n))}},m={events:{append:function(e){var n=p("candu:events")()||[];g("candu:events")(function(){try{return n.push(e),n}catch(n){return[e]}}())},get:p("candu:events"),clear:function(){return g("candu:events")([])}},anonymousId:{getOrCreate:(s="candu:anonymous_id",f=function(){var e=a();return g("candu:anonymous_id")(e),e},function(){return p(s)()||f()}),set:g("candu:anonymous_id")}},y=function(){return(y=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e}).apply(this,arguments)};var h=function(e){var n=typeof e;return null!=e&&("object"==n||"function"==n)},b="object"==typeof e&&e&&e.Object===Object&&e,w="object"==typeof self&&self&&self.Object===Object&&self,O=b||w||Function("return this")(),T=function(){return O.Date.now()},S=O.Symbol,I=Object.prototype,j=I.hasOwnProperty,x=I.toString,N=S?S.toStringTag:void 0;var k=function(e){var n=j.call(e,N),t=e[N];try{e[N]=void 0;var r=!0}catch(e){}var o=x.call(e);return r&&(n?e[N]=t:delete e[N]),o},_=Object.prototype.toString;var E=function(e){return _.call(e)},D=S?S.toStringTag:void 0;var A=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":D&&D in Object(e)?k(e):E(e)};var C=function(e){return null!=e&&"object"==typeof e};var P=function(e){return"symbol"==typeof e||C(e)&&"[object Symbol]"==A(e)},M=/^\s+|\s+$/g,q=/^[-+]0x[0-9a-f]+$/i,F=/^0b[01]+$/i,J=/^0o[0-7]+$/i,V=parseInt;var G=function(e){if("number"==typeof e)return e;if(P(e))return NaN;if(h(e)){var n="function"==typeof e.valueOf?e.valueOf():e;e=h(n)?n+"":n}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(M,"");var t=F.test(e);return t||J.test(e)?V(e.slice(2),t?2:8):q.test(e)?NaN:+e},R=Math.max,U=Math.min;var $=function(e,n,t){var r,o,i,a,u,c,s=0,f=!1,l=!1,d=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function v(n){var t=r,i=o;return r=o=void 0,s=n,a=e.apply(i,t)}function p(e){return s=e,u=setTimeout(m,n),f?v(e):a}function g(e){var t=e-c;return void 0===c||t>=n||t<0||l&&e-s>=i}function m(){var e=T();if(g(e))return y(e);u=setTimeout(m,function(e){var t=n-(e-c);return l?U(t,i-(e-s)):t}(e))}function y(e){return u=void 0,d&&r?v(e):(r=o=void 0,a)}function b(){var e=T(),t=g(e);if(r=arguments,o=this,c=e,t){if(void 0===u)return p(c);if(l)return clearTimeout(u),u=setTimeout(m,n),v(c)}return void 0===u&&(u=setTimeout(m,n)),a}return n=G(n)||0,h(t)&&(f=!!t.leading,i=(l="maxWait"in t)?R(G(t.maxWait)||0,n):i,d="trailing"in t?!!t.trailing:d),b.cancel=function(){void 0!==u&&clearTimeout(u),s=0,r=c=o=u=void 0},b.flush=function(){return void 0===u?a:y(T())},b};var K,W,Z=function(e,n,t){var r=!0,o=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return h(t)&&(r="leading"in t?!!t.leading:r,o="trailing"in t?!!t.trailing:o),$(e,n,{leading:r,maxWait:n,trailing:o})},z=function(){return"undefined"!=typeof window?window:d},X=function(){return{path:z().location.pathname,url:z().location.href,title:document.title,search:z().location.search,referrer:document.referrer}},B=function(e,n){return void 0===n&&(n={}),{id:a(),type:e,eventName:n.eventName,pageName:n.pageName,screenName:n.screenName,properties:n.properties,traits:n.traits}},H=function(e,n,t){void 0===t&&(t={});var r=function(r){return o=function(e,n,t,r){return void 0===r&&(r={}),{clientToken:e,anonymousId:m.anonymousId.getOrCreate(),userId:n&&n.toString(),context:(o=r.source,i=r.sdk,a=r.contextAdapter,void 0===a&&(a=function(e){return e}),a({sdk:i,source:o,locale:z().navigator.language,screen:z().screen&&{height:z().screen.height,width:z().screen.width},page:z().document&&X(),userAgent:z().navigator.userAgent,library:l,timezone:z().Intl&&z().Intl.DateTimeFormat().resolvedOptions().timeZone})),sentAt:new Date(Date.now()).toISOString(),events:t,signature:r.hmac};var o,i,a}(e,n,r,t),z().fetch?fetch(""+(i&&i+"/api/batchEvent"||"https://api.candu.ai/api/batchEvent"),{method:"POST",mode:"no-cors",headers:{"Content-Type":"text/plain"},body:JSON.stringify(o)}):null;var o,i},o=function(){var e=m.events.get()||[];e.length<1||(m.events.clear(),r(e))},i=Z((function(){return o()}),1e3,{leading:!1});return{addEvent:function(e,n,t){void 0===t&&(t={}),m.events.append(B(n,t)),i()},flush:o,submitEvent:function(e,n,t){return void 0===t&&(t={}),r([B(n,t)])}}},L=0,Q=0;var Y=function(e,n,r){var o=n&&r||0,a=n||[],u=(e=e||{}).node||K,c=void 0!==e.clockseq?e.clockseq:W;if(null==u||null==c){var s=t();null==u&&(u=K=[1|s[0],s[1],s[2],s[3],s[4],s[5]]),null==c&&(c=W=16383&(s[6]<<8|s[7]))}var f=void 0!==e.msecs?e.msecs:(new Date).getTime(),l=void 0!==e.nsecs?e.nsecs:Q+1,d=f-L+(l-Q)/1e4;if(d<0&&void 0===e.clockseq&&(c=c+1&16383),(d<0||f>L)&&void 0===e.nsecs&&(l=0),l>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");L=f,Q=l,W=c;var v=(1e4*(268435455&(f+=122192928e5))+l)%4294967296;a[o++]=v>>>24&255,a[o++]=v>>>16&255,a[o++]=v>>>8&255,a[o++]=255&v;var p=f/4294967296*1e4&268435455;a[o++]=p>>>8&255,a[o++]=255&p,a[o++]=p>>>24&15|16,a[o++]=p>>>16&255,a[o++]=c>>>8|128,a[o++]=255&c;for(var g=0;g<6;++g)a[o+g]=u[g];return n||i(a)},ee=a;ee.v1=Y,ee.v4=a;var ne=ee,te=function(e){var n=function(e){var n=e.clientToken,t=e.errorMsg,r=e.errorData,o=e.userId,i=void 0===o?m.anonymousId.getOrCreate():o,a=e.functionName,u=(new Date).getTime(),c=(new Date).toISOString(),s=ne.v4();return{url:"https://sentry.io/api/5589365/store/",request:{method:"POST",headers:{"Content-Type":"application/json","X-Sentry-Auth":"Sentry sentry_version=7,sentry_timestamp="+u+",sentry_key=bf02871777614ec786d84577da9afc6c,sentry_client=sentry-javascript/1.0"},body:JSON.stringify({event_id:s,transaction:a,timestamp:c,platform:"javascript",level:"error",logger:"@candulabs/eventing",server_name:z().location.href,release:"0.8.23",modules:{"@candulabs/eventing":"0.8.23","@candulabs/core":"0.8.23","@candulabs/js-sdk":"0.8.23"},user:{userId:i,clientToken:n,ip_address:"{{auto}}"},tags:{userId:i,clientToken:n,sdkVersion:"0.8.23"},exception:{values:[{type:"SDK Error",value:t,module:"__builtins__"}]},extra:y(y(y({},r),X()),{userAgent:z().navigator.userAgent,locale:z().navigator.language,timezone:z().Intl&&z().Intl.DateTimeFormat().resolvedOptions().timeZone})})}}}(e),t=n.url,r=n.request;fetch(t,r)},re={identify:function(){return null},page:function(){return null},screen:function(){return null},track:function(){return null},error:function(){return null}},oe=m.anonymousId.getOrCreate;exports.eventingFactory=function(e,n,t){void 0===t&&(t={});var r=function(r,o,i){void 0===o&&(o={}),te({userId:n,errorMsg:r,clientToken:e,functionName:i,errorData:y(y({},o),t)})};if(t.disableTracking)return y(y({},re),{error:r});var o=H(e,n,t);return o.flush(),{identify:function(e,n){return o.submitEvent(e,c.Identify,{traits:n})},page:function(e,t){return o.addEvent(n,c.Page,{pageName:e,properties:t})},screen:function(e,t){return o.addEvent(n,c.Screen,{screenName:e,properties:t})},track:function(e,t){return o.addEvent(n,c.Track,{eventName:e,properties:t})},error:r}},exports.getAnonymousId=oe,exports.noOpEventing=re;

@@ -1,1 +0,1 @@

var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};for(var n,t=(function(e){var n="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(n){var t=new Uint8Array(16);e.exports=function(){return n(t),t}}else{var r=new Array(16);e.exports=function(){for(var e,n=0;n<16;n++)0==(3&n)&&(e=4294967296*Math.random()),r[n]=e>>>((3&n)<<3)&255;return r}}}(n={exports:{}},n.exports),n.exports),r=[],o=0;o<256;++o)r[o]=(o+256).toString(16).substr(1);var i=function(e,n){var t=n||0,o=r;return[o[e[t++]],o[e[t++]],o[e[t++]],o[e[t++]],"-",o[e[t++]],o[e[t++]],"-",o[e[t++]],o[e[t++]],"-",o[e[t++]],o[e[t++]],"-",o[e[t++]],o[e[t++]],o[e[t++]],o[e[t++]],o[e[t++]],o[e[t++]]].join("")};var a=function(e,n,r){var o=n&&r||0;"string"==typeof e&&(n="binary"===e?new Array(16):null,e=null);var a=(e=e||{}).random||(e.rng||t)();if(a[6]=15&a[6]|64,a[8]=63&a[8]|128,n)for(var u=0;u<16;++u)n[o+u]=a[u];return n||i(a)};var u,c;!function(e){e.UserGenerated="UserGenerated",e.SDK="SDK"}(u||(u={})),function(e){e.Identify="Identify",e.Group="Group",e.Track="Track",e.Page="Page",e.Screen="Screen"}(c||(c={}));var s,f,l={name:"JsClient",version:"0.8.22"},d={fetch:null,document:void 0,navigator:{language:"",userAgent:""},location:{pathname:"",href:"",search:""},screen:{height:0,width:0},Intl:{DateTimeFormat:function(){return{resolvedOptions:function(){return{timeZone:""}}}}}},v=function(){try{return"undefined"!=typeof window&&window.localStorage}catch(e){return null}},p=function(e){return function(){if(v()){var n=window.localStorage.getItem(e);if(n)try{return JSON.parse(n)}catch(e){return null}}}},g=function(e){return function(n){v()&&null!=n&&window.localStorage.setItem(e,JSON.stringify(n))}},m={events:{append:function(e){var n=p("candu:events")()||[];g("candu:events")(function(){try{return n.push(e),n}catch(n){return[e]}}())},get:p("candu:events"),clear:function(){return g("candu:events")([])}},anonymousId:{getOrCreate:(s="candu:anonymous_id",f=function(){var e=a();return g("candu:anonymous_id")(e),e},function(){return p(s)()||f()}),set:g("candu:anonymous_id")}},y=function(){return(y=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e}).apply(this,arguments)};var h=function(e){var n=typeof e;return null!=e&&("object"==n||"function"==n)},b="object"==typeof e&&e&&e.Object===Object&&e,w="object"==typeof self&&self&&self.Object===Object&&self,T=b||w||Function("return this")(),S=function(){return T.Date.now()},O=T.Symbol,I=Object.prototype,j=I.hasOwnProperty,N=I.toString,k=O?O.toStringTag:void 0;var x=function(e){var n=j.call(e,k),t=e[k];try{e[k]=void 0;var r=!0}catch(e){}var o=N.call(e);return r&&(n?e[k]=t:delete e[k]),o},D=Object.prototype.toString;var E=function(e){return D.call(e)},_=O?O.toStringTag:void 0;var C=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":_&&_ in Object(e)?x(e):E(e)};var A=function(e){return null!=e&&"object"==typeof e};var P=function(e){return"symbol"==typeof e||A(e)&&"[object Symbol]"==C(e)},M=/^\s+|\s+$/g,q=/^[-+]0x[0-9a-f]+$/i,J=/^0b[01]+$/i,V=/^0o[0-7]+$/i,F=parseInt;var G=function(e){if("number"==typeof e)return e;if(P(e))return NaN;if(h(e)){var n="function"==typeof e.valueOf?e.valueOf():e;e=h(n)?n+"":n}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(M,"");var t=J.test(e);return t||V.test(e)?F(e.slice(2),t?2:8):q.test(e)?NaN:+e},R=Math.max,U=Math.min;var $=function(e,n,t){var r,o,i,a,u,c,s=0,f=!1,l=!1,d=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function v(n){var t=r,i=o;return r=o=void 0,s=n,a=e.apply(i,t)}function p(e){return s=e,u=setTimeout(m,n),f?v(e):a}function g(e){var t=e-c;return void 0===c||t>=n||t<0||l&&e-s>=i}function m(){var e=S();if(g(e))return y(e);u=setTimeout(m,function(e){var t=n-(e-c);return l?U(t,i-(e-s)):t}(e))}function y(e){return u=void 0,d&&r?v(e):(r=o=void 0,a)}function b(){var e=S(),t=g(e);if(r=arguments,o=this,c=e,t){if(void 0===u)return p(c);if(l)return clearTimeout(u),u=setTimeout(m,n),v(c)}return void 0===u&&(u=setTimeout(m,n)),a}return n=G(n)||0,h(t)&&(f=!!t.leading,i=(l="maxWait"in t)?R(G(t.maxWait)||0,n):i,d="trailing"in t?!!t.trailing:d),b.cancel=function(){void 0!==u&&clearTimeout(u),s=0,r=c=o=u=void 0},b.flush=function(){return void 0===u?a:y(S())},b};var K,W,Z=function(e,n,t){var r=!0,o=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return h(t)&&(r="leading"in t?!!t.leading:r,o="trailing"in t?!!t.trailing:o),$(e,n,{leading:r,maxWait:n,trailing:o})},z=function(){return"undefined"!=typeof window?window:d},X=function(){return{path:z().location.pathname,url:z().location.href,title:document.title,search:z().location.search,referrer:document.referrer}},B=function(e,n){return void 0===n&&(n={}),{id:a(),type:e,eventName:n.eventName,pageName:n.pageName,screenName:n.screenName,properties:n.properties,traits:n.traits}},H=function(e,n,t){void 0===t&&(t={});var r=function(r){return o=function(e,n,t,r){return void 0===r&&(r={}),{clientToken:e,anonymousId:m.anonymousId.getOrCreate(),userId:n&&n.toString(),context:(o=r.source,i=r.sdk,a=r.contextAdapter,void 0===a&&(a=function(e){return e}),a({sdk:i,source:o,locale:z().navigator.language,screen:z().screen&&{height:z().screen.height,width:z().screen.width},page:z().document&&X(),userAgent:z().navigator.userAgent,library:l,timezone:z().Intl&&z().Intl.DateTimeFormat().resolvedOptions().timeZone})),sentAt:new Date(Date.now()).toISOString(),events:t,signature:r.hmac};var o,i,a}(e,n,r,t),z().fetch?fetch(""+(i&&i+"/api/batchEvent"||"https://api.candu.ai/api/batchEvent"),{method:"POST",mode:"no-cors",headers:{"Content-Type":"text/plain"},body:JSON.stringify(o)}):null;var o,i},o=function(){var e=m.events.get()||[];e.length<1||(m.events.clear(),r(e))},i=Z((function(){return o()}),1e3,{leading:!1});return{addEvent:function(e,n,t){void 0===t&&(t={}),m.events.append(B(n,t)),i()},flush:o,submitEvent:function(e,n,t){return void 0===t&&(t={}),r([B(n,t)])}}},L=0,Q=0;var Y=function(e,n,r){var o=n&&r||0,a=n||[],u=(e=e||{}).node||K,c=void 0!==e.clockseq?e.clockseq:W;if(null==u||null==c){var s=t();null==u&&(u=K=[1|s[0],s[1],s[2],s[3],s[4],s[5]]),null==c&&(c=W=16383&(s[6]<<8|s[7]))}var f=void 0!==e.msecs?e.msecs:(new Date).getTime(),l=void 0!==e.nsecs?e.nsecs:Q+1,d=f-L+(l-Q)/1e4;if(d<0&&void 0===e.clockseq&&(c=c+1&16383),(d<0||f>L)&&void 0===e.nsecs&&(l=0),l>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");L=f,Q=l,W=c;var v=(1e4*(268435455&(f+=122192928e5))+l)%4294967296;a[o++]=v>>>24&255,a[o++]=v>>>16&255,a[o++]=v>>>8&255,a[o++]=255&v;var p=f/4294967296*1e4&268435455;a[o++]=p>>>8&255,a[o++]=255&p,a[o++]=p>>>24&15|16,a[o++]=p>>>16&255,a[o++]=c>>>8|128,a[o++]=255&c;for(var g=0;g<6;++g)a[o+g]=u[g];return n||i(a)},ee=a;ee.v1=Y,ee.v4=a;var ne=ee,te=function(e){var n=function(e){var n=e.clientToken,t=e.errorMsg,r=e.errorData,o=e.userId,i=void 0===o?m.anonymousId.getOrCreate():o,a=e.functionName,u=(new Date).getTime(),c=(new Date).toISOString(),s=ne.v4();return{url:"https://sentry.io/api/5589365/store/",request:{method:"POST",headers:{"Content-Type":"application/json","X-Sentry-Auth":"Sentry sentry_version=7,sentry_timestamp="+u+",sentry_key=bf02871777614ec786d84577da9afc6c,sentry_client=sentry-javascript/1.0"},body:JSON.stringify({event_id:s,transaction:a,timestamp:c,platform:"javascript",level:"error",logger:"@candulabs/eventing",server_name:z().location.href,release:"0.8.22",modules:{"@candulabs/eventing":"0.8.22","@candulabs/core":"0.8.22","@candulabs/js-sdk":"0.8.22"},user:{userId:i,clientToken:n,ip_address:"{{auto}}"},tags:{userId:i,clientToken:n,sdkVersion:"0.8.22"},exception:{values:[{type:"SDK Error",value:t,module:"__builtins__"}]},extra:y(y(y({},r),X()),{userAgent:z().navigator.userAgent,locale:z().navigator.language,timezone:z().Intl&&z().Intl.DateTimeFormat().resolvedOptions().timeZone})})}}}(e),t=n.url,r=n.request;fetch(t,r)},re={identify:function(){return null},page:function(){return null},screen:function(){return null},track:function(){return null},error:function(){return null}},oe=function(e,n,t){void 0===t&&(t={});var r=function(r,o,i){void 0===o&&(o={}),te({userId:n,errorMsg:r,clientToken:e,functionName:i,errorData:y(y({},o),t)})};if(t.disableTracking)return y(y({},re),{error:r});var o=H(e,n,t);return o.flush(),{identify:function(e,n){return o.submitEvent(e,c.Identify,{traits:n})},page:function(e,t){return o.addEvent(n,c.Page,{pageName:e,properties:t})},screen:function(e,t){return o.addEvent(n,c.Screen,{screenName:e,properties:t})},track:function(e,t){return o.addEvent(n,c.Track,{eventName:e,properties:t})},error:r}},ie=m.anonymousId.getOrCreate;export{oe as eventingFactory,ie as getAnonymousId,re as noOpEventing};
var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};for(var n,t=(function(e){var n="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(n){var t=new Uint8Array(16);e.exports=function(){return n(t),t}}else{var r=new Array(16);e.exports=function(){for(var e,n=0;n<16;n++)0==(3&n)&&(e=4294967296*Math.random()),r[n]=e>>>((3&n)<<3)&255;return r}}}(n={exports:{}},n.exports),n.exports),r=[],o=0;o<256;++o)r[o]=(o+256).toString(16).substr(1);var i=function(e,n){var t=n||0,o=r;return[o[e[t++]],o[e[t++]],o[e[t++]],o[e[t++]],"-",o[e[t++]],o[e[t++]],"-",o[e[t++]],o[e[t++]],"-",o[e[t++]],o[e[t++]],"-",o[e[t++]],o[e[t++]],o[e[t++]],o[e[t++]],o[e[t++]],o[e[t++]]].join("")};var a=function(e,n,r){var o=n&&r||0;"string"==typeof e&&(n="binary"===e?new Array(16):null,e=null);var a=(e=e||{}).random||(e.rng||t)();if(a[6]=15&a[6]|64,a[8]=63&a[8]|128,n)for(var u=0;u<16;++u)n[o+u]=a[u];return n||i(a)};var u,c;!function(e){e.UserGenerated="UserGenerated",e.SDK="SDK"}(u||(u={})),function(e){e.Identify="Identify",e.Group="Group",e.Track="Track",e.Page="Page",e.Screen="Screen"}(c||(c={}));var s,f,l={name:"JsClient",version:"0.8.23"},d={fetch:null,document:void 0,navigator:{language:"",userAgent:""},location:{pathname:"",href:"",search:""},screen:{height:0,width:0},Intl:{DateTimeFormat:function(){return{resolvedOptions:function(){return{timeZone:""}}}}}},v=function(){try{return"undefined"!=typeof window&&window.localStorage}catch(e){return null}},p=function(e){return function(){if(v()){var n=window.localStorage.getItem(e);if(n)try{return JSON.parse(n)}catch(e){return null}}}},g=function(e){return function(n){v()&&null!=n&&window.localStorage.setItem(e,JSON.stringify(n))}},m={events:{append:function(e){var n=p("candu:events")()||[];g("candu:events")(function(){try{return n.push(e),n}catch(n){return[e]}}())},get:p("candu:events"),clear:function(){return g("candu:events")([])}},anonymousId:{getOrCreate:(s="candu:anonymous_id",f=function(){var e=a();return g("candu:anonymous_id")(e),e},function(){return p(s)()||f()}),set:g("candu:anonymous_id")}},y=function(){return(y=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e}).apply(this,arguments)};var h=function(e){var n=typeof e;return null!=e&&("object"==n||"function"==n)},b="object"==typeof e&&e&&e.Object===Object&&e,w="object"==typeof self&&self&&self.Object===Object&&self,T=b||w||Function("return this")(),S=function(){return T.Date.now()},O=T.Symbol,I=Object.prototype,j=I.hasOwnProperty,N=I.toString,k=O?O.toStringTag:void 0;var x=function(e){var n=j.call(e,k),t=e[k];try{e[k]=void 0;var r=!0}catch(e){}var o=N.call(e);return r&&(n?e[k]=t:delete e[k]),o},D=Object.prototype.toString;var E=function(e){return D.call(e)},_=O?O.toStringTag:void 0;var C=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":_&&_ in Object(e)?x(e):E(e)};var A=function(e){return null!=e&&"object"==typeof e};var P=function(e){return"symbol"==typeof e||A(e)&&"[object Symbol]"==C(e)},M=/^\s+|\s+$/g,q=/^[-+]0x[0-9a-f]+$/i,J=/^0b[01]+$/i,V=/^0o[0-7]+$/i,F=parseInt;var G=function(e){if("number"==typeof e)return e;if(P(e))return NaN;if(h(e)){var n="function"==typeof e.valueOf?e.valueOf():e;e=h(n)?n+"":n}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(M,"");var t=J.test(e);return t||V.test(e)?F(e.slice(2),t?2:8):q.test(e)?NaN:+e},R=Math.max,U=Math.min;var $=function(e,n,t){var r,o,i,a,u,c,s=0,f=!1,l=!1,d=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function v(n){var t=r,i=o;return r=o=void 0,s=n,a=e.apply(i,t)}function p(e){return s=e,u=setTimeout(m,n),f?v(e):a}function g(e){var t=e-c;return void 0===c||t>=n||t<0||l&&e-s>=i}function m(){var e=S();if(g(e))return y(e);u=setTimeout(m,function(e){var t=n-(e-c);return l?U(t,i-(e-s)):t}(e))}function y(e){return u=void 0,d&&r?v(e):(r=o=void 0,a)}function b(){var e=S(),t=g(e);if(r=arguments,o=this,c=e,t){if(void 0===u)return p(c);if(l)return clearTimeout(u),u=setTimeout(m,n),v(c)}return void 0===u&&(u=setTimeout(m,n)),a}return n=G(n)||0,h(t)&&(f=!!t.leading,i=(l="maxWait"in t)?R(G(t.maxWait)||0,n):i,d="trailing"in t?!!t.trailing:d),b.cancel=function(){void 0!==u&&clearTimeout(u),s=0,r=c=o=u=void 0},b.flush=function(){return void 0===u?a:y(S())},b};var K,W,Z=function(e,n,t){var r=!0,o=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return h(t)&&(r="leading"in t?!!t.leading:r,o="trailing"in t?!!t.trailing:o),$(e,n,{leading:r,maxWait:n,trailing:o})},z=function(){return"undefined"!=typeof window?window:d},X=function(){return{path:z().location.pathname,url:z().location.href,title:document.title,search:z().location.search,referrer:document.referrer}},B=function(e,n){return void 0===n&&(n={}),{id:a(),type:e,eventName:n.eventName,pageName:n.pageName,screenName:n.screenName,properties:n.properties,traits:n.traits}},H=function(e,n,t){void 0===t&&(t={});var r=function(r){return o=function(e,n,t,r){return void 0===r&&(r={}),{clientToken:e,anonymousId:m.anonymousId.getOrCreate(),userId:n&&n.toString(),context:(o=r.source,i=r.sdk,a=r.contextAdapter,void 0===a&&(a=function(e){return e}),a({sdk:i,source:o,locale:z().navigator.language,screen:z().screen&&{height:z().screen.height,width:z().screen.width},page:z().document&&X(),userAgent:z().navigator.userAgent,library:l,timezone:z().Intl&&z().Intl.DateTimeFormat().resolvedOptions().timeZone})),sentAt:new Date(Date.now()).toISOString(),events:t,signature:r.hmac};var o,i,a}(e,n,r,t),z().fetch?fetch(""+(i&&i+"/api/batchEvent"||"https://api.candu.ai/api/batchEvent"),{method:"POST",mode:"no-cors",headers:{"Content-Type":"text/plain"},body:JSON.stringify(o)}):null;var o,i},o=function(){var e=m.events.get()||[];e.length<1||(m.events.clear(),r(e))},i=Z((function(){return o()}),1e3,{leading:!1});return{addEvent:function(e,n,t){void 0===t&&(t={}),m.events.append(B(n,t)),i()},flush:o,submitEvent:function(e,n,t){return void 0===t&&(t={}),r([B(n,t)])}}},L=0,Q=0;var Y=function(e,n,r){var o=n&&r||0,a=n||[],u=(e=e||{}).node||K,c=void 0!==e.clockseq?e.clockseq:W;if(null==u||null==c){var s=t();null==u&&(u=K=[1|s[0],s[1],s[2],s[3],s[4],s[5]]),null==c&&(c=W=16383&(s[6]<<8|s[7]))}var f=void 0!==e.msecs?e.msecs:(new Date).getTime(),l=void 0!==e.nsecs?e.nsecs:Q+1,d=f-L+(l-Q)/1e4;if(d<0&&void 0===e.clockseq&&(c=c+1&16383),(d<0||f>L)&&void 0===e.nsecs&&(l=0),l>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");L=f,Q=l,W=c;var v=(1e4*(268435455&(f+=122192928e5))+l)%4294967296;a[o++]=v>>>24&255,a[o++]=v>>>16&255,a[o++]=v>>>8&255,a[o++]=255&v;var p=f/4294967296*1e4&268435455;a[o++]=p>>>8&255,a[o++]=255&p,a[o++]=p>>>24&15|16,a[o++]=p>>>16&255,a[o++]=c>>>8|128,a[o++]=255&c;for(var g=0;g<6;++g)a[o+g]=u[g];return n||i(a)},ee=a;ee.v1=Y,ee.v4=a;var ne=ee,te=function(e){var n=function(e){var n=e.clientToken,t=e.errorMsg,r=e.errorData,o=e.userId,i=void 0===o?m.anonymousId.getOrCreate():o,a=e.functionName,u=(new Date).getTime(),c=(new Date).toISOString(),s=ne.v4();return{url:"https://sentry.io/api/5589365/store/",request:{method:"POST",headers:{"Content-Type":"application/json","X-Sentry-Auth":"Sentry sentry_version=7,sentry_timestamp="+u+",sentry_key=bf02871777614ec786d84577da9afc6c,sentry_client=sentry-javascript/1.0"},body:JSON.stringify({event_id:s,transaction:a,timestamp:c,platform:"javascript",level:"error",logger:"@candulabs/eventing",server_name:z().location.href,release:"0.8.23",modules:{"@candulabs/eventing":"0.8.23","@candulabs/core":"0.8.23","@candulabs/js-sdk":"0.8.23"},user:{userId:i,clientToken:n,ip_address:"{{auto}}"},tags:{userId:i,clientToken:n,sdkVersion:"0.8.23"},exception:{values:[{type:"SDK Error",value:t,module:"__builtins__"}]},extra:y(y(y({},r),X()),{userAgent:z().navigator.userAgent,locale:z().navigator.language,timezone:z().Intl&&z().Intl.DateTimeFormat().resolvedOptions().timeZone})})}}}(e),t=n.url,r=n.request;fetch(t,r)},re={identify:function(){return null},page:function(){return null},screen:function(){return null},track:function(){return null},error:function(){return null}},oe=function(e,n,t){void 0===t&&(t={});var r=function(r,o,i){void 0===o&&(o={}),te({userId:n,errorMsg:r,clientToken:e,functionName:i,errorData:y(y({},o),t)})};if(t.disableTracking)return y(y({},re),{error:r});var o=H(e,n,t);return o.flush(),{identify:function(e,n){return o.submitEvent(e,c.Identify,{traits:n})},page:function(e,t){return o.addEvent(n,c.Page,{pageName:e,properties:t})},screen:function(e,t){return o.addEvent(n,c.Screen,{screenName:e,properties:t})},track:function(e,t){return o.addEvent(n,c.Track,{eventName:e,properties:t})},error:r}},ie=m.anonymousId.getOrCreate;export{oe as eventingFactory,ie as getAnonymousId,re as noOpEventing};

@@ -1,1 +0,1 @@

!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((e="undefined"!=typeof globalThis?globalThis:e||self)["@candulabs/eventing"]={})}(this,(function(e){"use strict";var n="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};for(var t=function(e){var n={exports:{}};return e(n,n.exports),n.exports}((function(e){var n="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(n){var t=new Uint8Array(16);e.exports=function(){return n(t),t}}else{var r=new Array(16);e.exports=function(){for(var e,n=0;n<16;n++)0==(3&n)&&(e=4294967296*Math.random()),r[n]=e>>>((3&n)<<3)&255;return r}}})),r=[],o=0;o<256;++o)r[o]=(o+256).toString(16).substr(1);var i=function(e,n){var t=n||0,o=r;return[o[e[t++]],o[e[t++]],o[e[t++]],o[e[t++]],"-",o[e[t++]],o[e[t++]],"-",o[e[t++]],o[e[t++]],"-",o[e[t++]],o[e[t++]],"-",o[e[t++]],o[e[t++]],o[e[t++]],o[e[t++]],o[e[t++]],o[e[t++]]].join("")};var a=function(e,n,r){var o=n&&r||0;"string"==typeof e&&(n="binary"===e?new Array(16):null,e=null);var a=(e=e||{}).random||(e.rng||t)();if(a[6]=15&a[6]|64,a[8]=63&a[8]|128,n)for(var u=0;u<16;++u)n[o+u]=a[u];return n||i(a)};var u,c;!function(e){e.UserGenerated="UserGenerated",e.SDK="SDK"}(u||(u={})),function(e){e.Identify="Identify",e.Group="Group",e.Track="Track",e.Page="Page",e.Screen="Screen"}(c||(c={}));var s,f,l="/api/batchEvent",d={name:"JsClient",version:"0.8.22"},v="candu:anonymous_id",p="candu:events",g={fetch:null,document:void 0,navigator:{language:"",userAgent:""},location:{pathname:"",href:"",search:""},screen:{height:0,width:0},Intl:{DateTimeFormat:function(){return{resolvedOptions:function(){return{timeZone:""}}}}}},y=function(){try{return"undefined"!=typeof window&&window.localStorage}catch(e){return null}},m=function(e){return function(){if(y()){var n=window.localStorage.getItem(e);if(n)try{return JSON.parse(n)}catch(e){return null}}}},h=function(e){return function(n){y()&&null!=n&&window.localStorage.setItem(e,JSON.stringify(n))}},b={events:{append:function(e){var n=m(p)()||[];h(p)(function(){try{return n.push(e),n}catch(n){return[e]}}())},get:m(p),clear:function(){return h(p)([])}},anonymousId:{getOrCreate:(s=v,f=function(){var e=a();return h(v)(e),e},function(){return m(s)()||f()}),set:h(v)}},w=function(){return(w=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e}).apply(this,arguments)};var T=function(e){var n=typeof e;return null!=e&&("object"==n||"function"==n)},O="object"==typeof n&&n&&n.Object===Object&&n,S="object"==typeof self&&self&&self.Object===Object&&self,I=O||S||Function("return this")(),j=function(){return I.Date.now()},x=I.Symbol,N=Object.prototype,k=N.hasOwnProperty,E=N.toString,D=x?x.toStringTag:void 0;var _=function(e){var n=k.call(e,D),t=e[D];try{e[D]=void 0;var r=!0}catch(e){}var o=E.call(e);return r&&(n?e[D]=t:delete e[D]),o},A=Object.prototype.toString;var C=function(e){return A.call(e)},P=x?x.toStringTag:void 0;var M=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":P&&P in Object(e)?_(e):C(e)};var q=function(e){return null!=e&&"object"==typeof e};var F=function(e){return"symbol"==typeof e||q(e)&&"[object Symbol]"==M(e)},J=/^\s+|\s+$/g,V=/^[-+]0x[0-9a-f]+$/i,G=/^0b[01]+$/i,R=/^0o[0-7]+$/i,U=parseInt;var $=function(e){if("number"==typeof e)return e;if(F(e))return NaN;if(T(e)){var n="function"==typeof e.valueOf?e.valueOf():e;e=T(n)?n+"":n}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(J,"");var t=G.test(e);return t||R.test(e)?U(e.slice(2),t?2:8):V.test(e)?NaN:+e},K=Math.max,W=Math.min;var Z=function(e,n,t){var r,o,i,a,u,c,s=0,f=!1,l=!1,d=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function v(n){var t=r,i=o;return r=o=void 0,s=n,a=e.apply(i,t)}function p(e){return s=e,u=setTimeout(y,n),f?v(e):a}function g(e){var t=e-c;return void 0===c||t>=n||t<0||l&&e-s>=i}function y(){var e=j();if(g(e))return m(e);u=setTimeout(y,function(e){var t=n-(e-c);return l?W(t,i-(e-s)):t}(e))}function m(e){return u=void 0,d&&r?v(e):(r=o=void 0,a)}function h(){var e=j(),t=g(e);if(r=arguments,o=this,c=e,t){if(void 0===u)return p(c);if(l)return clearTimeout(u),u=setTimeout(y,n),v(c)}return void 0===u&&(u=setTimeout(y,n)),a}return n=$(n)||0,T(t)&&(f=!!t.leading,i=(l="maxWait"in t)?K($(t.maxWait)||0,n):i,d="trailing"in t?!!t.trailing:d),h.cancel=function(){void 0!==u&&clearTimeout(u),s=0,r=c=o=u=void 0},h.flush=function(){return void 0===u?a:m(j())},h};var z,X,B=function(e,n,t){var r=!0,o=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return T(t)&&(r="leading"in t?!!t.leading:r,o="trailing"in t?!!t.trailing:o),Z(e,n,{leading:r,maxWait:n,trailing:o})},H=function(){return"undefined"!=typeof window?window:g},L=function(){return{path:H().location.pathname,url:H().location.href,title:document.title,search:H().location.search,referrer:document.referrer}},Q=function(e,n){return void 0===n&&(n={}),{id:a(),type:e,eventName:n.eventName,pageName:n.pageName,screenName:n.screenName,properties:n.properties,traits:n.traits}},Y=function(e,n,t){void 0===t&&(t={});var r=function(r){return o=function(e,n,t,r){return void 0===r&&(r={}),{clientToken:e,anonymousId:b.anonymousId.getOrCreate(),userId:n&&n.toString(),context:(o=r.source,i=r.sdk,a=r.contextAdapter,void 0===a&&(a=function(e){return e}),a({sdk:i,source:o,locale:H().navigator.language,screen:H().screen&&{height:H().screen.height,width:H().screen.width},page:H().document&&L(),userAgent:H().navigator.userAgent,library:d,timezone:H().Intl&&H().Intl.DateTimeFormat().resolvedOptions().timeZone})),sentAt:new Date(Date.now()).toISOString(),events:t,signature:r.hmac};var o,i,a}(e,n,r,t),H().fetch?fetch(""+(i&&""+i+l||"https://api.candu.ai/api/batchEvent"),{method:"POST",mode:"no-cors",headers:{"Content-Type":"text/plain"},body:JSON.stringify(o)}):null;var o,i},o=function(){var e=b.events.get()||[];e.length<1||(b.events.clear(),r(e))},i=B((function(){return o()}),1e3,{leading:!1});return{addEvent:function(e,n,t){void 0===t&&(t={}),b.events.append(Q(n,t)),i()},flush:o,submitEvent:function(e,n,t){return void 0===t&&(t={}),r([Q(n,t)])}}},ee=0,ne=0;var te=function(e,n,r){var o=n&&r||0,a=n||[],u=(e=e||{}).node||z,c=void 0!==e.clockseq?e.clockseq:X;if(null==u||null==c){var s=t();null==u&&(u=z=[1|s[0],s[1],s[2],s[3],s[4],s[5]]),null==c&&(c=X=16383&(s[6]<<8|s[7]))}var f=void 0!==e.msecs?e.msecs:(new Date).getTime(),l=void 0!==e.nsecs?e.nsecs:ne+1,d=f-ee+(l-ne)/1e4;if(d<0&&void 0===e.clockseq&&(c=c+1&16383),(d<0||f>ee)&&void 0===e.nsecs&&(l=0),l>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");ee=f,ne=l,X=c;var v=(1e4*(268435455&(f+=122192928e5))+l)%4294967296;a[o++]=v>>>24&255,a[o++]=v>>>16&255,a[o++]=v>>>8&255,a[o++]=255&v;var p=f/4294967296*1e4&268435455;a[o++]=p>>>8&255,a[o++]=255&p,a[o++]=p>>>24&15|16,a[o++]=p>>>16&255,a[o++]=c>>>8|128,a[o++]=255&c;for(var g=0;g<6;++g)a[o+g]=u[g];return n||i(a)},re=a;re.v1=te,re.v4=a;var oe=re,ie="0.8.22",ae=function(e){var n=function(e){var n=e.clientToken,t=e.errorMsg,r=e.errorData,o=e.userId,i=void 0===o?b.anonymousId.getOrCreate():o,a=e.functionName,u=(new Date).getTime(),c=(new Date).toISOString(),s=oe.v4();return{url:"https://sentry.io/api/5589365/store/",request:{method:"POST",headers:{"Content-Type":"application/json","X-Sentry-Auth":"Sentry sentry_version=7,sentry_timestamp="+u+",sentry_key=bf02871777614ec786d84577da9afc6c,sentry_client=sentry-javascript/1.0"},body:JSON.stringify({event_id:s,transaction:a,timestamp:c,platform:"javascript",level:"error",logger:"@candulabs/eventing",server_name:H().location.href,release:ie,modules:{"@candulabs/eventing":"0.8.22","@candulabs/core":ie,"@candulabs/js-sdk":"0.8.22"},user:{userId:i,clientToken:n,ip_address:"{{auto}}"},tags:{userId:i,clientToken:n,sdkVersion:ie},exception:{values:[{type:"SDK Error",value:t,module:"__builtins__"}]},extra:w(w(w({},r),L()),{userAgent:H().navigator.userAgent,locale:H().navigator.language,timezone:H().Intl&&H().Intl.DateTimeFormat().resolvedOptions().timeZone})})}}}(e),t=n.url,r=n.request;fetch(t,r)},ue={identify:function(){return null},page:function(){return null},screen:function(){return null},track:function(){return null},error:function(){return null}},ce=b.anonymousId.getOrCreate;e.eventingFactory=function(e,n,t){void 0===t&&(t={});var r=function(r,o,i){void 0===o&&(o={}),ae({userId:n,errorMsg:r,clientToken:e,functionName:i,errorData:w(w({},o),t)})};if(t.disableTracking)return w(w({},ue),{error:r});var o=Y(e,n,t);return o.flush(),{identify:function(e,n){return o.submitEvent(e,c.Identify,{traits:n})},page:function(e,t){return o.addEvent(n,c.Page,{pageName:e,properties:t})},screen:function(e,t){return o.addEvent(n,c.Screen,{screenName:e,properties:t})},track:function(e,t){return o.addEvent(n,c.Track,{eventName:e,properties:t})},error:r}},e.getAnonymousId=ce,e.noOpEventing=ue,Object.defineProperty(e,"__esModule",{value:!0})}));
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((e="undefined"!=typeof globalThis?globalThis:e||self)["@candulabs/eventing"]={})}(this,(function(e){"use strict";var n="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};for(var t=function(e){var n={exports:{}};return e(n,n.exports),n.exports}((function(e){var n="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(n){var t=new Uint8Array(16);e.exports=function(){return n(t),t}}else{var r=new Array(16);e.exports=function(){for(var e,n=0;n<16;n++)0==(3&n)&&(e=4294967296*Math.random()),r[n]=e>>>((3&n)<<3)&255;return r}}})),r=[],o=0;o<256;++o)r[o]=(o+256).toString(16).substr(1);var i=function(e,n){var t=n||0,o=r;return[o[e[t++]],o[e[t++]],o[e[t++]],o[e[t++]],"-",o[e[t++]],o[e[t++]],"-",o[e[t++]],o[e[t++]],"-",o[e[t++]],o[e[t++]],"-",o[e[t++]],o[e[t++]],o[e[t++]],o[e[t++]],o[e[t++]],o[e[t++]]].join("")};var a=function(e,n,r){var o=n&&r||0;"string"==typeof e&&(n="binary"===e?new Array(16):null,e=null);var a=(e=e||{}).random||(e.rng||t)();if(a[6]=15&a[6]|64,a[8]=63&a[8]|128,n)for(var u=0;u<16;++u)n[o+u]=a[u];return n||i(a)};var u,c;!function(e){e.UserGenerated="UserGenerated",e.SDK="SDK"}(u||(u={})),function(e){e.Identify="Identify",e.Group="Group",e.Track="Track",e.Page="Page",e.Screen="Screen"}(c||(c={}));var s,f,l="/api/batchEvent",d={name:"JsClient",version:"0.8.23"},v="candu:anonymous_id",p="candu:events",g={fetch:null,document:void 0,navigator:{language:"",userAgent:""},location:{pathname:"",href:"",search:""},screen:{height:0,width:0},Intl:{DateTimeFormat:function(){return{resolvedOptions:function(){return{timeZone:""}}}}}},y=function(){try{return"undefined"!=typeof window&&window.localStorage}catch(e){return null}},m=function(e){return function(){if(y()){var n=window.localStorage.getItem(e);if(n)try{return JSON.parse(n)}catch(e){return null}}}},h=function(e){return function(n){y()&&null!=n&&window.localStorage.setItem(e,JSON.stringify(n))}},b={events:{append:function(e){var n=m(p)()||[];h(p)(function(){try{return n.push(e),n}catch(n){return[e]}}())},get:m(p),clear:function(){return h(p)([])}},anonymousId:{getOrCreate:(s=v,f=function(){var e=a();return h(v)(e),e},function(){return m(s)()||f()}),set:h(v)}},w=function(){return(w=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e}).apply(this,arguments)};var T=function(e){var n=typeof e;return null!=e&&("object"==n||"function"==n)},O="object"==typeof n&&n&&n.Object===Object&&n,S="object"==typeof self&&self&&self.Object===Object&&self,I=O||S||Function("return this")(),j=function(){return I.Date.now()},x=I.Symbol,N=Object.prototype,k=N.hasOwnProperty,E=N.toString,D=x?x.toStringTag:void 0;var _=function(e){var n=k.call(e,D),t=e[D];try{e[D]=void 0;var r=!0}catch(e){}var o=E.call(e);return r&&(n?e[D]=t:delete e[D]),o},A=Object.prototype.toString;var C=function(e){return A.call(e)},P=x?x.toStringTag:void 0;var M=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":P&&P in Object(e)?_(e):C(e)};var q=function(e){return null!=e&&"object"==typeof e};var F=function(e){return"symbol"==typeof e||q(e)&&"[object Symbol]"==M(e)},J=/^\s+|\s+$/g,V=/^[-+]0x[0-9a-f]+$/i,G=/^0b[01]+$/i,R=/^0o[0-7]+$/i,U=parseInt;var $=function(e){if("number"==typeof e)return e;if(F(e))return NaN;if(T(e)){var n="function"==typeof e.valueOf?e.valueOf():e;e=T(n)?n+"":n}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(J,"");var t=G.test(e);return t||R.test(e)?U(e.slice(2),t?2:8):V.test(e)?NaN:+e},K=Math.max,W=Math.min;var Z=function(e,n,t){var r,o,i,a,u,c,s=0,f=!1,l=!1,d=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function v(n){var t=r,i=o;return r=o=void 0,s=n,a=e.apply(i,t)}function p(e){return s=e,u=setTimeout(y,n),f?v(e):a}function g(e){var t=e-c;return void 0===c||t>=n||t<0||l&&e-s>=i}function y(){var e=j();if(g(e))return m(e);u=setTimeout(y,function(e){var t=n-(e-c);return l?W(t,i-(e-s)):t}(e))}function m(e){return u=void 0,d&&r?v(e):(r=o=void 0,a)}function h(){var e=j(),t=g(e);if(r=arguments,o=this,c=e,t){if(void 0===u)return p(c);if(l)return clearTimeout(u),u=setTimeout(y,n),v(c)}return void 0===u&&(u=setTimeout(y,n)),a}return n=$(n)||0,T(t)&&(f=!!t.leading,i=(l="maxWait"in t)?K($(t.maxWait)||0,n):i,d="trailing"in t?!!t.trailing:d),h.cancel=function(){void 0!==u&&clearTimeout(u),s=0,r=c=o=u=void 0},h.flush=function(){return void 0===u?a:m(j())},h};var z,X,B=function(e,n,t){var r=!0,o=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return T(t)&&(r="leading"in t?!!t.leading:r,o="trailing"in t?!!t.trailing:o),Z(e,n,{leading:r,maxWait:n,trailing:o})},H=function(){return"undefined"!=typeof window?window:g},L=function(){return{path:H().location.pathname,url:H().location.href,title:document.title,search:H().location.search,referrer:document.referrer}},Q=function(e,n){return void 0===n&&(n={}),{id:a(),type:e,eventName:n.eventName,pageName:n.pageName,screenName:n.screenName,properties:n.properties,traits:n.traits}},Y=function(e,n,t){void 0===t&&(t={});var r=function(r){return o=function(e,n,t,r){return void 0===r&&(r={}),{clientToken:e,anonymousId:b.anonymousId.getOrCreate(),userId:n&&n.toString(),context:(o=r.source,i=r.sdk,a=r.contextAdapter,void 0===a&&(a=function(e){return e}),a({sdk:i,source:o,locale:H().navigator.language,screen:H().screen&&{height:H().screen.height,width:H().screen.width},page:H().document&&L(),userAgent:H().navigator.userAgent,library:d,timezone:H().Intl&&H().Intl.DateTimeFormat().resolvedOptions().timeZone})),sentAt:new Date(Date.now()).toISOString(),events:t,signature:r.hmac};var o,i,a}(e,n,r,t),H().fetch?fetch(""+(i&&""+i+l||"https://api.candu.ai/api/batchEvent"),{method:"POST",mode:"no-cors",headers:{"Content-Type":"text/plain"},body:JSON.stringify(o)}):null;var o,i},o=function(){var e=b.events.get()||[];e.length<1||(b.events.clear(),r(e))},i=B((function(){return o()}),1e3,{leading:!1});return{addEvent:function(e,n,t){void 0===t&&(t={}),b.events.append(Q(n,t)),i()},flush:o,submitEvent:function(e,n,t){return void 0===t&&(t={}),r([Q(n,t)])}}},ee=0,ne=0;var te=function(e,n,r){var o=n&&r||0,a=n||[],u=(e=e||{}).node||z,c=void 0!==e.clockseq?e.clockseq:X;if(null==u||null==c){var s=t();null==u&&(u=z=[1|s[0],s[1],s[2],s[3],s[4],s[5]]),null==c&&(c=X=16383&(s[6]<<8|s[7]))}var f=void 0!==e.msecs?e.msecs:(new Date).getTime(),l=void 0!==e.nsecs?e.nsecs:ne+1,d=f-ee+(l-ne)/1e4;if(d<0&&void 0===e.clockseq&&(c=c+1&16383),(d<0||f>ee)&&void 0===e.nsecs&&(l=0),l>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");ee=f,ne=l,X=c;var v=(1e4*(268435455&(f+=122192928e5))+l)%4294967296;a[o++]=v>>>24&255,a[o++]=v>>>16&255,a[o++]=v>>>8&255,a[o++]=255&v;var p=f/4294967296*1e4&268435455;a[o++]=p>>>8&255,a[o++]=255&p,a[o++]=p>>>24&15|16,a[o++]=p>>>16&255,a[o++]=c>>>8|128,a[o++]=255&c;for(var g=0;g<6;++g)a[o+g]=u[g];return n||i(a)},re=a;re.v1=te,re.v4=a;var oe=re,ie="0.8.23",ae=function(e){var n=function(e){var n=e.clientToken,t=e.errorMsg,r=e.errorData,o=e.userId,i=void 0===o?b.anonymousId.getOrCreate():o,a=e.functionName,u=(new Date).getTime(),c=(new Date).toISOString(),s=oe.v4();return{url:"https://sentry.io/api/5589365/store/",request:{method:"POST",headers:{"Content-Type":"application/json","X-Sentry-Auth":"Sentry sentry_version=7,sentry_timestamp="+u+",sentry_key=bf02871777614ec786d84577da9afc6c,sentry_client=sentry-javascript/1.0"},body:JSON.stringify({event_id:s,transaction:a,timestamp:c,platform:"javascript",level:"error",logger:"@candulabs/eventing",server_name:H().location.href,release:ie,modules:{"@candulabs/eventing":"0.8.23","@candulabs/core":ie,"@candulabs/js-sdk":"0.8.23"},user:{userId:i,clientToken:n,ip_address:"{{auto}}"},tags:{userId:i,clientToken:n,sdkVersion:ie},exception:{values:[{type:"SDK Error",value:t,module:"__builtins__"}]},extra:w(w(w({},r),L()),{userAgent:H().navigator.userAgent,locale:H().navigator.language,timezone:H().Intl&&H().Intl.DateTimeFormat().resolvedOptions().timeZone})})}}}(e),t=n.url,r=n.request;fetch(t,r)},ue={identify:function(){return null},page:function(){return null},screen:function(){return null},track:function(){return null},error:function(){return null}},ce=b.anonymousId.getOrCreate;e.eventingFactory=function(e,n,t){void 0===t&&(t={});var r=function(r,o,i){void 0===o&&(o={}),ae({userId:n,errorMsg:r,clientToken:e,functionName:i,errorData:w(w({},o),t)})};if(t.disableTracking)return w(w({},ue),{error:r});var o=Y(e,n,t);return o.flush(),{identify:function(e,n){return o.submitEvent(e,c.Identify,{traits:n})},page:function(e,t){return o.addEvent(n,c.Page,{pageName:e,properties:t})},screen:function(e,t){return o.addEvent(n,c.Screen,{screenName:e,properties:t})},track:function(e,t){return o.addEvent(n,c.Track,{eventName:e,properties:t})},error:r}},e.getAnonymousId=ce,e.noOpEventing=ue,Object.defineProperty(e,"__esModule",{value:!0})}));

@@ -12,3 +12,3 @@ {

},
"version": "0.8.22",
"version": "0.8.23",
"main": "dist/index.js",

@@ -35,3 +35,3 @@ "module": "dist/index.es.js",

},
"gitHead": "d99948ca0dd9a19a6ec1e080877fd5c2563df995"
"gitHead": "77536b791812e3e4a243278f49af55f4f2d3ff3b"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc