@hhgtech/hhg-components 1.22.32 → 1.22.33

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.
@@ -0,0 +1 @@
1
+ "use strict";var e=require("./tslib.es6-0065074f.js"),t=require("react"),n=require("./cookieHelper-54048238.js");function r(e){var t=(new TextEncoder).encode(e.trim().toLowerCase());return crypto.subtle.digest("SHA-256",t).then((function(e){return Array.from(new Uint8Array(e)).map((function(e){return e.toString(16).padStart(2,"0")})).join("")}))}exports.useFbDataLayer=function(i){t.useEffect((function(){return(null==i?void 0:i.id)&&e.__awaiter(void 0,void 0,void 0,(function(){var t,o,a,l,u,c,s,f,d,p,g,h,m,b;return e.__generator(this,(function(e){switch(e.label){case 0:return[4,fetch("https://api.ipify.org").then((function(e){return e.text()}))];case 1:return(t=e.sent())?[3,3]:[4,fetch("https://icanhazip.com").then((function(e){return e.text()}))];case 2:t=e.sent(),e.label=3;case 3:return[4,Promise.all([i.email?r(i.email):null,i.phone?r(i.phone):null,i.birthday?r(i.birthday.split("-").join("")):null,i.gender?"m":"f",i.city_name?r(i.city_name).then((function(e){return e.replace(/\s/g,"")})):null,i.name?r(i.name):null])];case 4:return o=e.sent(),a=o[0],l=o[1],u=o[2],c=o[3],s=o[4],f=o[5],d={fbc:n.getCookie("_fbc")||"",fbp:n.getCookie("_fbp")||""},p={user_id:i.id},f&&(p.fn=f),a&&(d.em=a,p.em=a),l&&(d.ph=l,p.ph=l),u&&(d.db=u,p.db=u),c&&(d.ge=c,p.ge=c),s&&(d.ct=s,p.ct=s),null===(h=null===(g=window.localStorage)||void 0===g?void 0:g.setItem)||void 0===h||h.call(g,"fbDataLayer_userInfo",JSON.stringify(p)),null===(b=null===(m=window.localStorage)||void 0===m?void 0:m.setItem)||void 0===b||b.call(m,"fbClientIp",JSON.stringify({client_ip_address:(null==t?void 0:t.replace("\n",""))||"",client_user_agent:navigator.userAgent||""})),[2]}}))})),function(){}}),[i])};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hhgtech/hhg-components",
3
- "version": "1.22.32",
3
+ "version": "1.22.33",
4
4
  "main": "build/index.js",
5
5
  "module": "build/esm/index.js",
6
6
  "files": [
@@ -1 +0,0 @@
1
- import{d as e,e as n}from"./tslib.es6-c7fb770c.js";import{useEffect as t}from"react";import{g as r}from"./cookieHelper-8dd17c53.js";function i(e){var n=(new TextEncoder).encode(e.trim().toLowerCase());return crypto.subtle.digest("SHA-256",n).then((function(e){return Array.from(new Uint8Array(e)).map((function(e){return e.toString(16).padStart(2,"0")})).join("")}))}var a=function(a){t((function(){return(null==a?void 0:a.id)&&e(void 0,void 0,void 0,(function(){var e,t,o,c,l,u,s,d,f,p,m,h;return n(this,(function(n){switch(n.label){case 0:return[4,fetch("https://api.ipify.org").then((function(e){return e.text()}))];case 1:return(e=n.sent())?[3,3]:[4,fetch("https://icanhazip.com").then((function(e){return e.text()}))];case 2:e=n.sent(),n.label=3;case 3:return[4,Promise.all([a.email?i(a.email):null,a.phone?i(a.phone):null,a.birthday?a.birthday.split("-").join(""):null,a.gender?"m":"f",a.city_name?i(a.city_name).then((function(e){return e.replace(/\s/g,"")})):null,a.name?i(a.name):null])];case 4:return t=n.sent(),o=t[0],c=t[1],l=t[2],u=t[3],s=t[4],d=t[5],f={fbc:r("_fbc")||"",fbp:r("_fbp")||"",client_ip_address:(null==e?void 0:e.replace("\n",""))||"",client_user_agent:navigator.userAgent||""},p={user_id:a.id,client_ip_address:(null==e?void 0:e.replace("\n",""))||"",client_user_agent:navigator.userAgent||""},d&&(p.fn=d),o&&(f.em=o,p.em=o),c&&(f.ph=c,p.ph=c),l&&(f.db=l,p.db=l),u&&(f.ge=u,p.ge=u),s&&(f.ct=s,p.ct=s),null===(h=null===(m=window.localStorage)||void 0===m?void 0:m.setItem)||void 0===h||h.call(m,"fbDataLayer_userInfo",JSON.stringify(p)),[2]}}))})),function(){}}),[a])};export{a as u};
@@ -1 +0,0 @@
1
- "use strict";var e=require("./tslib.es6-0065074f.js"),t=require("react"),n=require("./cookieHelper-54048238.js");function r(e){var t=(new TextEncoder).encode(e.trim().toLowerCase());return crypto.subtle.digest("SHA-256",t).then((function(e){return Array.from(new Uint8Array(e)).map((function(e){return e.toString(16).padStart(2,"0")})).join("")}))}exports.useFbDataLayer=function(i){t.useEffect((function(){return(null==i?void 0:i.id)&&e.__awaiter(void 0,void 0,void 0,(function(){var t,a,o,u,c,l,s,f,d,p,g,_;return e.__generator(this,(function(e){switch(e.label){case 0:return[4,fetch("https://api.ipify.org").then((function(e){return e.text()}))];case 1:return(t=e.sent())?[3,3]:[4,fetch("https://icanhazip.com").then((function(e){return e.text()}))];case 2:t=e.sent(),e.label=3;case 3:return[4,Promise.all([i.email?r(i.email):null,i.phone?r(i.phone):null,i.birthday?i.birthday.split("-").join(""):null,i.gender?"m":"f",i.city_name?r(i.city_name).then((function(e){return e.replace(/\s/g,"")})):null,i.name?r(i.name):null])];case 4:return a=e.sent(),o=a[0],u=a[1],c=a[2],l=a[3],s=a[4],f=a[5],d={fbc:n.getCookie("_fbc")||"",fbp:n.getCookie("_fbp")||"",client_ip_address:(null==t?void 0:t.replace("\n",""))||"",client_user_agent:navigator.userAgent||""},p={user_id:i.id,client_ip_address:(null==t?void 0:t.replace("\n",""))||"",client_user_agent:navigator.userAgent||""},f&&(p.fn=f),o&&(d.em=o,p.em=o),u&&(d.ph=u,p.ph=u),c&&(d.db=c,p.db=c),l&&(d.ge=l,p.ge=l),s&&(d.ct=s,p.ct=s),null===(_=null===(g=window.localStorage)||void 0===g?void 0:g.setItem)||void 0===_||_.call(g,"fbDataLayer_userInfo",JSON.stringify(p)),[2]}}))})),function(){}}),[i])};