ba-js-rt 2.0.0 → 2.0.2
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/lib/rt.js +1 -1
- package/package.json +5 -3
package/lib/rt.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var BA=window.BA||{};function
|
|
1
|
+
var BA=window.BA||{};function e(e,n,o,t,c,a){var r,i=new Date;i.setTime(i.getTime()),o&&(r=864e5*o);var s=new Date(i.getTime()+r);document.cookie="".concat(e,"=").concat(escape(n)).concat(r?";expires=".concat(s.toGMTString()):"").concat(t?";path=".concat(t):"").concat(c?";domain=".concat(c):"").concat(a?";secure":"")}function n(e){for(var n=document.cookie.split(";"),o="",t="",c="",a=0;a<n.length;a+=1){if((o=n[a].split("="))[0].replace(/^\s+|\s+$/g,"")===e)return o.length>1&&(c=unescape(o[1].replace(/^\s+|\s+$/g,""))),c;o=null}return null}function o(){var e=BA.measurementIds,n=BA.gaId,o=BA.gaAnonymiseIp;return e?{accounts:{measurementIds:e}}:n?{accounts:{hotel:{name:"hotel",trackingId:n,anonymizeIp:o}}}:void 0}!function(){var n,o,t,c=(n="",top.location&&(n=top.location.href),o="unset",(t=n.match(/[&?]r=([^&]*)/))&&t.length>1&&(o=escape(t[1])),o);if(c&&"null"!==c&&"unset"!==c&&""!==c){var a=function(){for(var e=0,n=document.domain,o=n.split("."),t="_gd".concat(new Date().getTime());e<o.length-1&&-1===document.cookie.indexOf("".concat(t,"=").concat(t));)e+=1,n=o.slice(-1-e).join("."),document.cookie="".concat(t,"=").concat(t,";domain=").concat(n,";");return document.cookie="".concat(t,"=;expires=Thu, 01 Jan 1970 00:00:01 GMT;domain=").concat(n,";"),n}(window.location.hostname);e("r",escape(c),0,"/",a),e("ra",escape(c),365,"/",a)}}();var t=new Promise(function(e,t){var c="https://unpkg.com/ba-js-tracker@gtag",a=document.createElement("script");a.src=c,document.head.appendChild(a),a.addEventListener("load",function(){var t={},c=o();if(c){var a=BA.gaConsent,r=BA.gaWaitForConsent,i=BA.gdpr,s=BA.showBanner;("no"===i||"no"===s||!("boolean"!=typeof r||r)||+n("cookie-consent")&a)&&(t={GoogleAnalytics:c})}var d=window.baJsTracker.default({trackers:t}),l=BA.hotel_id,u=BA.hotelId,g=BA.guide_id,f=BA.guideId,p=BA.hotel_group_id,m=BA.userLanguage,h=function e(n){return Object.keys(n).forEach(function(o){var t,c=n[o],a=void 0===c?"undefined":c&&"undefined"!=typeof Symbol&&c.constructor===Symbol?"symbol":typeof c;"object"===a?(e(c),Object.keys(c).length||delete n[o]):"undefined"===a&&delete n[o]}),n}({context:{hotel:{hotelId:l||u,guideId:g||f,cgGroupId:p,cookiePolicyUrl:BA.cookiePolicyUrl},userLanguage:m,client:"CookieBanner"}});return d.event=d.event.bind(null,h),e(d)}),a.addEventListener("error",function(){t(Error("".concat(c," failed to load.")))})});t.then(function(e){var t=o();if(t&&!e.getTrackers().find(function(e){return"GoogleAnalytics"===e}))var c=setInterval(function(){+n("cookie-consent")&BA.gaConsent&&(clearInterval(c),e.addTrackers({GoogleAnalytics:t}),e.event({event:{type:"pageView",whitelist:["GoogleAnalytics"]}}).catch(function(e){console.error(e)}))},250)}).catch(function(e){console.error(e)}),BA.baJsTracker=t;
|
package/package.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ba-js-rt",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.2",
|
|
4
4
|
"scripts": {
|
|
5
|
-
"
|
|
5
|
+
"clean": "rimraf lib",
|
|
6
|
+
"build": "yarn clean && swc ./src -d lib",
|
|
6
7
|
"lint": "eslint --ext js src --fix",
|
|
7
8
|
"prepublishOnly": "yarn build",
|
|
8
9
|
"prepare": "husky install"
|
|
@@ -21,7 +22,8 @@
|
|
|
21
22
|
"eslint-plugin-prettier": "^4.2.1",
|
|
22
23
|
"husky": ">=6",
|
|
23
24
|
"lint-staged": ">=10",
|
|
24
|
-
"prettier": "^2.7.1"
|
|
25
|
+
"prettier": "^2.7.1",
|
|
26
|
+
"rimraf": "^3.0.2"
|
|
25
27
|
},
|
|
26
28
|
"lint-staged": {
|
|
27
29
|
"*.js": "eslint --cache --fix"
|