mod-build 4.0.90 → 4.0.91

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/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 4.0.91
4
+
5
+ - Cleaned up `vwo` related code as we have discontinued using `vwo`
6
+
3
7
  ## 4.0.90
4
8
 
5
9
  - Expose the site config `domain` on the client as `window.siteDomain` via `globalFunctions()`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mod-build",
3
- "version": "4.0.90",
3
+ "version": "4.0.91",
4
4
  "description": "Share components for S3 sites.",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -1,7 +1,5 @@
1
1
  <script>
2
2
  {{ fileInclude 'node_modules/mod-build/src/scripts/vendor/heap-tracking.js' }}
3
3
 
4
- {{ fileInclude 'node_modules/mod-build/src/scripts/vendor/heap-vwo.js' }}
5
-
6
4
  {{ fileInclude 'node_modules/mod-build/src/scripts/vendor/heap-addeventproperties-identify.js' }}
7
5
  </script>
@@ -1,29 +0,0 @@
1
- var _vis_opt_queue = window._vis_opt_queue || [],
2
- _vis_counter = 0;
3
- _vis_opt_queue.push(function() {
4
- try {
5
- if (!_vis_counter) {
6
- window._vis_data = {};
7
- var _vis_combination, _vis_id, _vis_l = 0;
8
- for (; _vis_l < _vwo_exp_ids.length; _vis_l++) {
9
- _vis_id = _vwo_exp_ids[_vis_l];
10
- if (_vwo_exp[_vis_id].ready) {
11
- _vis_combination = _vis_opt_readCookie('_vis_opt_exp_' + _vis_id + '_combi');
12
- if (typeof(_vwo_exp[_vis_id].combination_chosen) != "undefined")
13
- _vis_combination = _vwo_exp[_vis_id].combination_chosen;
14
- if (typeof(_vwo_exp[_vis_id].comb_n[_vis_combination]) != "undefined") {
15
- window._vis_data['VWO-Test-ID-' + _vis_id] = _vwo_exp[_vis_id].comb_n[_vis_combination];
16
- _vis_counter++;
17
- }
18
- }
19
- }
20
- // Use the _vis_data object created above to fetch the data,
21
- // key of the object is the Test ID and the value is Variation Name
22
- if (_vis_counter) {
23
- if (window.Modalytics && window.heap && window.heap.appid) {
24
- heap.addUserProperties(window._vis_data);
25
- }
26
- }
27
- }
28
- } catch (err) {};
29
- });
@@ -1,8 +0,0 @@
1
- window._vwo_code || (function() {
2
- var account_id=37264,
3
- version=2.1,
4
- settings_tolerance=2000,
5
- hide_element='body',
6
- hide_element_style = 'opacity:0 !important;filter:alpha(opacity=0) !important;background:none !important;transition:none !important;',
7
- /* DO NOT EDIT BELOW THIS LINE */
8
- f=false,w=window,d=document,v=d.querySelector('#vwoCode'),cK='_vwo_'+account_id+'_settings',cc={};try{var c=JSON.parse(localStorage.getItem('_vwo_'+account_id+'_config'));cc=c&&typeof c==='object'?c:{}}catch(e){}var stT=cc.stT==='session'?w.sessionStorage:w.localStorage;code={nonce:v&&v.nonce,use_existing_jquery:function(){return typeof use_existing_jquery!=='undefined'?use_existing_jquery:undefined},library_tolerance:function(){return typeof library_tolerance!=='undefined'?library_tolerance:undefined},settings_tolerance:function(){return cc.sT||settings_tolerance},hide_element_style:function(){return'{'+(cc.hES||hide_element_style)+'}'},hide_element:function(){if(performance.getEntriesByName('first-contentful-paint')[0]){return''}return typeof cc.hE==='string'?cc.hE:hide_element},getVersion:function(){return version},finish:function(e){if(!f){f=true;var t=d.getElementById('_vis_opt_path_hides');if(t)t.parentNode.removeChild(t);if(e)(new Image).src='https://dev.visualwebsiteoptimizer.com/ee.gif?a='+account_id+e}},finished:function(){return f},addScript:function(e){var t=d.createElement('script');t.type='text/javascript';if(e.src){t.src=e.src}else{t.text=e.text}v&&t.setAttribute('nonce',v.nonce);d.getElementsByTagName('head')[0].appendChild(t)},load:function(e,t){var n=this.getSettings(),i=d.createElement('script'),r=this;t=t||{};if(n){i.textContent=n;d.getElementsByTagName('head')[0].appendChild(i);if(!w.VWO||VWO.caE){stT.removeItem(cK);r.load(e)}}else{var o=new XMLHttpRequest;o.open('GET',e,true);o.withCredentials=!t.dSC;o.responseType=t.responseType||'text';o.onload=function(){if(t.onloadCb){return t.onloadCb(o,e)}if(o.status===200||o.status===304){_vwo_code.addScript({text:o.responseText})}else{_vwo_code.finish('&e=loading_failure:'+e)}};o.onerror=function(){if(t.onerrorCb){return t.onerrorCb(e)}_vwo_code.finish('&e=loading_failure:'+e)};o.send()}},getSettings:function(){try{var e=stT.getItem(cK);if(!e){return}e=JSON.parse(e);if(Date.now()>e.e){stT.removeItem(cK);return}return e.s}catch(e){return}},init:function(){if(d.URL.indexOf('__vwo_disable__')>-1)return;var e=this.settings_tolerance();w._vwo_settings_timer=setTimeout(function(){_vwo_code.finish();stT.removeItem(cK)},e);var t;if(this.hide_element()!=='body'){t=d.createElement('style');var n=this.hide_element(),i=n?n+this.hide_element_style():'',r=d.getElementsByTagName('head')[0];t.setAttribute('id','_vis_opt_path_hides');v&&t.setAttribute('nonce',v.nonce);t.setAttribute('type','text/css');if(t.styleSheet)t.styleSheet.cssText=i;else t.appendChild(d.createTextNode(i));r.appendChild(t)}else{t=d.getElementsByTagName('head')[0];var i=d.createElement('div');i.style.cssText='z-index: 2147483647 !important;position: fixed !important;left: 0 !important;top: 0 !important;width: 100% !important;height: 100% !important;background: white !important;display: block !important;';i.setAttribute('id','_vis_opt_path_hides');i.classList.add('_vis_hide_layer');t.parentNode.insertBefore(i,t.nextSibling)}var o=window._vis_opt_url||d.URL,s='https://dev.visualwebsiteoptimizer.com/j.php?a='+account_id+'&u='+encodeURIComponent(o)+'&vn='+version;if(w.location.search.indexOf('_vwo_xhr')!==-1){this.addScript({src:s})}else{this.load(s+'&x=true')}}};w._vwo_code=code;code.init();})();
@@ -1,70 +0,0 @@
1
- <script>
2
- window.VWO = window.VWO || [];
3
- window.VWO.push(['onEventReceive', 'vA', function (data) {
4
- var experimentId = data[1];
5
- var variationId = data[2];
6
- var variationName = _vwo_exp[experimentId].comb_n[variationId];
7
- if (typeof(_vwo_exp[experimentId].comb_n[variationId]) !== 'undefined' && ['VISUAL_AB', 'VISUAL', 'SPLIT_URL','SURVEY'].indexOf(_vwo_exp[experimentId].type) > -1) {
8
- window._vwo_campaignData = {
9
- [experimentId]: {
10
- n: variationName
11
- }
12
- }
13
- if (window.Modalytics && typeof window.Modalytics.initHeapVwo === 'function' && !window.heapVwoinited) {
14
- window.Modalytics.initHeapVwo();
15
- }
16
- if (variationId != 1) {
17
- // Control is assigned variation ID 1 - variations receive incremented IDs starting from 2
18
- const adjustedVariationId = variationId - 1;
19
- const vwoTestAttrValue = `${experimentId}-${adjustedVariationId}`;
20
- document.body.setAttribute('data-vwo-test', vwoTestAttrValue);
21
- }
22
- }
23
- }]);
24
-
25
- {{ fileInclude 'node_modules/mod-build/src/scripts/vendor/visual-website-optimizer.js' }}
26
-
27
- (function(VWO_HARD_TIMEOUT) {
28
- window._vwo_evq = window._vwo_evq || [];
29
- var queue = window._vwo_evq;
30
- for (var i = 0; i < queue.length; i++) {
31
- if (queue[i][0] === 'rD') {
32
- window.willRedirectionOccur = true;
33
- break;
34
- }
35
- }
36
- var _vwoOldPush = window._vwo_evq.push;
37
- window._vwo_evq.push = function() {
38
- var eventData = arguments[0],
39
- willRedirectionOccur;
40
- if (eventData[0] === 'rD') {
41
- willRedirectionOccur = eventData[1];
42
- // It will be set to true if a redirection is going to be done by VWO.
43
- window.willRedirectionOccurByVWO = willRedirectionOccur;
44
- }
45
- _vwoOldPush.apply(window._vwo_evq, [].slice.call(arguments));
46
- };
47
- var hardLimitTimedout = false;
48
-
49
- function tryNonVWOTracking() {
50
- if ((window._vwo_code && (window._vwo_code.finished() || window._vwo_code.libExecuted)) || hardLimitTimedout) {
51
- if (!window.willRedirectionOccurByVWO) {
52
- clearTimeout(hardLimitTimer);
53
- try {
54
- // flag to call Modalytics.initHeapVwo() method in site level js
55
- window.initHeapVwo = true;
56
- } catch (e) {}
57
- return;
58
- }
59
- }
60
- setTimeout(function() {
61
- tryNonVWOTracking()
62
- }, 500)
63
- }
64
-
65
- var hardLimitTimer = setTimeout(function() {
66
- hardLimitTimedout = true;
67
- }, VWO_HARD_TIMEOUT);
68
- tryNonVWOTracking();
69
- })(5000 /*MAXIMUM TIME IN SECONDS IN WHICH CODE WILL EXECUTE ANYWAY*/ );
70
- </script>