@commversion/libs 0.3.1 → 0.4.0-pre.1

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/README.md CHANGED
@@ -32,6 +32,8 @@ All scripts are available under the `scripts/` directory.
32
32
  - lc-input-errors
33
33
  - lc-show-hide
34
34
  - schedule-event
35
+ - lc-geoblocking
36
+ - lc-utm-params
35
37
 
36
38
  ## Release new versions
37
39
 
@@ -0,0 +1 @@
1
+ var p=Object.defineProperty,y=Object.defineProperties;var I=Object.getOwnPropertyDescriptors;var d=Object.getOwnPropertySymbols;var f=Object.prototype.hasOwnProperty,h=Object.prototype.propertyIsEnumerable;var u=(n,t,o)=>t in n?p(n,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):n[t]=o,w=(n,t)=>{for(var o in t||(t={}))f.call(t,o)&&u(n,o,t[o]);if(d)for(var o of d(t))h.call(t,o)&&u(n,o,t[o]);return n},m=(n,t)=>y(n,I(t));var l=(n,t,o)=>new Promise((a,r)=>{var i=c=>{try{s(o.next(c))}catch(x){r(x)}},e=c=>{try{s(o.throw(c))}catch(x){r(x)}},s=c=>c.done?a(c.value):Promise.resolve(c.value).then(i,e);s((o=o.apply(n,t)).next())});(function(){"use strict";const n="https://commversion-public-functions.vercel.app/api/geolocation",t=(i,e)=>l(this,null,function*(){const s=`${e}?visitor=${i}`;return yield fetch(s).then(x=>x.json()).catch(()=>({}))}),o=x=>l(this,[x],function*({allowedCountries:i,disallowedCountries:e,visitor:s,geolocationAPI:c=n}){const{LiveChatWidget:g}=window,{country:v}=yield t(s,c);if(i&&!i.includes(v)){g.call("destroy");return}if(e&&e.includes(v)){g.call("destroy");return}}),a=()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(i){const e=Math.random()*16|0;return(i=="x"?e:e&3|8).toString(16)}),r=()=>{var e,s,c;const i=(s=(e=window.localStorage)==null?void 0:e.getItem("cv-geoblock-visitorid"))!=null?s:a();return(c=window.localStorage)==null||c.setItem("cv-geoblock-visitorid",i),i};window.commversion=window.commversion||{},o(m(w({},window.commversion),{visitor:r()}))})();
@@ -0,0 +1 @@
1
+ var d=Object.defineProperty,l=Object.defineProperties;var h=Object.getOwnPropertyDescriptors;var s=Object.getOwnPropertySymbols;var v=Object.prototype.hasOwnProperty,P=Object.prototype.propertyIsEnumerable;var i=(n,t,a)=>t in n?d(n,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):n[t]=a,c=(n,t)=>{for(var a in t||(t={}))v.call(t,a)&&i(n,a,t[a]);if(s)for(var a of s(t))P.call(t,a)&&i(n,a,t[a]);return n},m=(n,t)=>l(n,h(t));(function(){"use strict";const n=a=>{const e=new URL(a);return Array.from(new URLSearchParams(e.search)).filter(([r])=>r.startsWith("utm_")).reduce((r,[w,u])=>m(c({},r),{[w]:u}),{})},t=a=>e=>{const{LiveChatWidget:o}=window,r=n(window.location.href);o.call("update_session_variables",r)};window.commversion=window.commversion||{},window.LiveChatWidget.on("ready",t())})();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@commversion/libs",
3
- "version": "0.3.1",
3
+ "version": "0.4.0-pre.1",
4
4
  "author": "Marios Antonoudiou <mariosant@sent.com>",
5
5
  "license": "UNLICENSED",
6
6
  "scripts": {
@@ -8,6 +8,10 @@
8
8
  "test": "wtr ./scripts/**/*.test.js --node-resolve",
9
9
  "prepack": "concurrently npm:build:*",
10
10
  "release": "release-it",
11
+ "dev:lc-geoblocking": "vite serve scripts/lc-geoblocking/src/",
12
+ "build:lc-geoblocking": "vite build -c scripts/lc-geoblocking/vite.config.js",
13
+ "dev:lc-utm-params": "vite serve scripts/lc-utm-params/src/",
14
+ "build:lc-utm-params": "vite build -c scripts/lc-utm-params/vite.config.js",
11
15
  "dev:lc-show-hide": "vite serve scripts/lc-show-hide/src/",
12
16
  "build:lc-show-hide": "vite build -c scripts/lc-show-hide/vite.config.js",
13
17
  "dev:schedule-event": "vite serve scripts/schedule-event/src/",
@@ -30,7 +34,7 @@
30
34
  "concurrently": "^6.5.0",
31
35
  "hygen": "^6.1.0",
32
36
  "prettier": "^2.5.0",
33
- "release-it": "^14.11.8",
37
+ "release-it": "^14.12",
34
38
  "rimraf": "^3.0.2",
35
39
  "sinon": "^12.0.1",
36
40
  "vite": "^2.7.3"