@commversion/libs 0.17.7 → 0.17.9
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/dist/lc-ga-tags.js +1 -1
- package/dist/lc-show-hide.js +1 -1
- package/package.json +1 -1
package/dist/lc-ga-tags.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var v=Object.defineProperty;var k=Object.getOwnPropertySymbols;var P=Object.prototype.hasOwnProperty,R=Object.prototype.propertyIsEnumerable;var w=(n,o,i)=>o in n?v(n,o,{enumerable:!0,configurable:!0,writable:!0,value:i}):n[o]=i,D=(n,o)=>{for(var i in o||(o={}))P.call(o,i)&&w(n,i,o[i]);if(k)for(var i of k(o))R.call(o,i)&&w(n,i,o[i]);return n};(function(){"use strict";const n=()=>{const{LiveChatWidget:o}=window;if(typeof window.gaGlobal=="undefined")return;function i(s){const c=document.cookie.match(new RegExp("(^| )"+s+"=([^;]+)"));return c?c[2]:""}function h(){var p;const c=(o.get("customer_data")||{}).sessionVariables||{},f=c.gclid||"";let _=c.dclid||"",G=c.fbc||"",L=c.fbp||"";const a=new URLSearchParams(window.location.search);let l=a.get("gclid"),d=a.get("dclid"),F=a.get("ttclid"),I=a.get("li_fat_id");const C=i("_fbc"),S=i("_fbp"),g=i("_gcl_dc"),V=i("li_fat_id"),x=i("_ttp"),u=t=>t&&t!=="null"?t:"",b=t=>u(localStorage.getItem(t)),e=typeof analytics!="undefined"&&analytics.user?(p=analytics.user)==null?void 0:p.call(analytics):null,T=u(e==null?void 0:e.anonymousId())||b("ajs_anonymous_id"),W=u(e==null?void 0:e.id())||b("ajs_user_id");let m="";const r=document.cookie.split(";").map(t=>t.trim()).find(t=>t.startsWith("bid_"));if(r){const t=r.indexOf("=");t!==-1&&(m=r.substring(t+1))}if(!l||l==="null"){const t=document.cookie.split(";").find(j=>/^\s*_gcl_aw/.test(j));(t&&!f||!f)&&(l=t?t.split(/[=.]/).pop():null)}return(!d||d==="null")&&(g&&!_||!_)&&(d=g),{gclid:(l!==null?l:f)||"",dclid:d||_||"",fbc:G||C||"",fbp:L||S||"",ttclid:F||x||"",li_fat_id:I||V||"",segment_anonymous_id:T||"",segment_user_id:W||"",sitecore_browser_id:m||""}}const y=h();o.call("update_session_variables",D({ga_session:window.gaGlobal.vid,ga_session_id:document.cookie.split(";").filter(s=>/^\s*_ga_/.test(s))},y))};window.LiveChatWidget.on("ready",n)})();
|
package/dist/lc-show-hide.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(){"use strict";const s=e=>({rule:o,value:n})=>{const{href:t}=e.location;if(o==="contains")return t.includes(n);if(o==="equals")return t===n;throw new Error(`Wrong rule: ${o}: ${n}`)},
|
|
1
|
+
(function(){"use strict";const s=e=>({rule:o,value:n})=>{const{href:t}=e.location;if(o==="contains")return t.includes(n);if(o==="equals")return t===n;throw new Error(`Wrong rule: ${o}: ${n}`)},d=(e,o)=>!e.some(s(o)),c=(e,o)=>e.some(s(o)),h=e=>{const o=new RegExp(e),{pathname:n}=window.location;return!o.test(n)},l=(e,o)=>{const n=new RegExp(e),{pathname:t}=o.location;return n.test(t)},u=["browsing"],a=e=>e.show&&e.hide?{predicateFn:()=>console.error("Cannot set both show and hide configuration. Please choose one.")}:typeof e.show=="string"?{predicateFn:h,pluginConfiguration:e.show}:typeof e.show=="object"?{predicateFn:d,pluginConfiguration:e.show}:typeof e.hide=="string"?{predicateFn:l,pluginConfiguration:e.hide}:typeof e.hide=="object"?{predicateFn:c,pluginConfiguration:e.hide}:{predicateFn:()=>console.error("No configuration for show/hide script.")},w=e=>({customerData:o})=>{const{LiveChatWidget:n}=window,{predicateFn:t,pluginConfiguration:i}=a(e);if(t(i,window)&&u.includes(o.status)){n.call("hide");const r=document.getElementById("chat-overlay-container");r&&(r.style.display="none")}};window.commversion=window.commversion||{},window.LiveChatWidget.on("ready",w(window.commversion))})();
|