-
Notifications
You must be signed in to change notification settings - Fork 2
/
cookie-consent.js
37 lines (37 loc) · 17.8 KB
/
cookie-consent.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
parcelRequire=function(e,r,t,n){var i,o="function"==typeof parcelRequire&&parcelRequire,u="function"==typeof require&&require;function f(t,n){if(!r[t]){if(!e[t]){var i="function"==typeof parcelRequire&&parcelRequire;if(!n&&i)return i(t,!0);if(o)return o(t,!0);if(u&&"string"==typeof t)return u(t);var c=new Error("Cannot find module '"+t+"'");throw c.code="MODULE_NOT_FOUND",c}p.resolve=function(r){return e[t][1][r]||r},p.cache={};var l=r[t]=new f.Module(t);e[t][0].call(l.exports,p,l,l.exports,this)}return r[t].exports;function p(e){return f(p.resolve(e))}}f.isParcelRequire=!0,f.Module=function(e){this.id=e,this.bundle=f,this.exports={}},f.modules=e,f.cache=r,f.parent=o,f.register=function(r,t){e[r]=[function(e,r){r.exports=t},{}]};for(var c=0;c<t.length;c++)try{f(t[c])}catch(e){i||(i=e)}if(t.length){var l=f(t[t.length-1]);"object"==typeof exports&&"undefined"!=typeof module?module.exports=l:"function"==typeof define&&define.amd?define(function(){return l}):n&&(this[n]=l)}if(parcelRequire=f,i)throw i;return f}({"iJA9":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.DEFAULT_INFO_ICON_CLR=exports.DEFAULT_REJECT_BTN_TEXT_CLR=exports.DEFAULT_REJECT_BTN_CLR=exports.DEFAULT_ACCEPT_BTN_TEXT_CLR=exports.DEFAULT_ACCEPT_BTN_CLR=exports.DEFAULT_MSG_CLR=exports.DEFAULT_BAR_CLR=exports.DEFAULT_INFO_LINK=exports.DEFAULT_TRACKING_DOMAINS=exports.DEFAULT_REJECT_BTN_TEXT=exports.DEFAULT_ACCEPT_BTN_TEXT=exports.DEFAULT_DIALOG_MSG=exports.STORAGE_NAME_IS_COOKIE_CONSENT=exports.TYPE_ATTRIBUTE=void 0;var o="javascript/blocked";exports.TYPE_ATTRIBUTE=o;var e="SJ_IS_COOKIE_CONSENT";exports.STORAGE_NAME_IS_COOKIE_CONSENT=e;var _="We uses cookies to provide necessary site functionality and improve your experience. By browsing our website, you consent to our use of cookies.";exports.DEFAULT_DIALOG_MSG=_;var T="Accept";exports.DEFAULT_ACCEPT_BTN_TEXT=T;var r="Reject";exports.DEFAULT_REJECT_BTN_TEXT=r;var t=["googletagmanager.com","google-analytics.com","googlesyndication.com","facebook.net","convertkit.com","securepubads.g.doubleclick.net","pinterest.com","intercom.com","mxpnl.com","maps.googleapis.com","hotjar.com","ads-twitter.com","twitter.com","instagram.com","youtube.com","linkedin.com","vimeo.com","addthis.com","sharethis.com","slideshare.net"];exports.DEFAULT_TRACKING_DOMAINS=t;var E="https://www.sprucejoy.com/docs/cookie/";exports.DEFAULT_INFO_LINK=E;var s="#000c14";exports.DEFAULT_BAR_CLR=s;var A="#f2f2f2";exports.DEFAULT_MSG_CLR=A;var c="#f2f2f2";exports.DEFAULT_ACCEPT_BTN_CLR=c;var p="#000c14";exports.DEFAULT_ACCEPT_BTN_TEXT_CLR=p;var C="transparent";exports.DEFAULT_REJECT_BTN_CLR=C;var L="#f2f2f2";exports.DEFAULT_REJECT_BTN_TEXT_CLR=L;var a="#f2f2f2";exports.DEFAULT_INFO_ICON_CLR=a;
},{}],"ixeg":[function(require,module,exports) {
function e(e,o){(null==o||o>e.length)&&(o=e.length);for(var l=0,r=new Array(o);l<o;l++)r[l]=e[l];return r}module.exports=e,module.exports.default=module.exports,module.exports.__esModule=!0;
},{}],"fk2o":[function(require,module,exports) {
var r=require("./arrayLikeToArray.js");function e(e){if(Array.isArray(e))return r(e)}module.exports=e,module.exports.default=module.exports,module.exports.__esModule=!0;
},{"./arrayLikeToArray.js":"ixeg"}],"rp83":[function(require,module,exports) {
function e(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}module.exports=e,module.exports.default=module.exports,module.exports.__esModule=!0;
},{}],"IOZJ":[function(require,module,exports) {
var r=require("./arrayLikeToArray.js");function e(e,t){if(e){if("string"==typeof e)return r(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);return"Object"===o&&e.constructor&&(o=e.constructor.name),"Map"===o||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?r(e,t):void 0}}module.exports=e,module.exports.default=module.exports,module.exports.__esModule=!0;
},{"./arrayLikeToArray.js":"ixeg"}],"v5FO":[function(require,module,exports) {
function e(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}module.exports=e,module.exports.default=module.exports,module.exports.__esModule=!0;
},{}],"YtCi":[function(require,module,exports) {
var e=require("./arrayWithoutHoles.js"),r=require("./iterableToArray.js"),o=require("./unsupportedIterableToArray.js"),u=require("./nonIterableSpread.js");function t(t){return e(t)||r(t)||o(t)||u()}module.exports=t,module.exports.default=module.exports,module.exports.__esModule=!0;
},{"./arrayWithoutHoles.js":"fk2o","./iterableToArray.js":"rp83","./unsupportedIterableToArray.js":"IOZJ","./nonIterableSpread.js":"v5FO"}],"MwO6":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.willBeUnblocked=exports.isOnBlacklist=exports.patterns=void 0;var t=r(require("@babel/runtime/helpers/toConsumableArray")),e=require("./constants");function r(t){return t&&t.__esModule?t:{default:t}}var n={blacklist:Array.isArray(window.__SJ_TRACKING_DOMAINS__)?[].concat((0,t.default)(e.DEFAULT_TRACKING_DOMAINS),(0,t.default)(window.__SJ_TRACKING_DOMAINS__.filter(function(t){return t}))):e.DEFAULT_TRACKING_DOMAINS,whitelist:[]};function i(t,e){var r;try{r=t.test(e)}catch(n){r=e.includes(t)}finally{return r}}exports.patterns=n;var s=function(t,r){return t&&(!r||r!==e.TYPE_ATTRIBUTE)&&n.blacklist.some(function(e){return i(e,t)})&&n.whitelist.every(function(e){return!i(e,t)})};exports.isOnBlacklist=s;var l=function(t){var e=t.getAttribute("src");return n.blacklist.every(function(t){return!i(t,e)})||n.whitelist.some(function(t){return i(t,e)})};exports.willBeUnblocked=l;
},{"@babel/runtime/helpers/toConsumableArray":"YtCi","./constants":"iJA9"}],"FOZT":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.removeElement=t,exports.push=o,exports.hashCode=a,exports.local=void 0;var e=r(require("@babel/runtime/helpers/toConsumableArray"));function r(e){return e&&e.__esModule?e:{default:e}}function t(e){"function"==typeof e.remove?e.remove():e.parentNode&&"function"==typeof e.parentNode.removeChild&&e.parentNode.removeChild(e)}function o(r){for(var t=arguments.length,o=new Array(t>1?t-1:0),n=1;n<t;n++)o[n-1]=arguments[n];o.forEach(function(t){Array.isArray(t)?r.push.apply(r,(0,e.default)(t)):r.push(t)})}var n={set:function(e,r){localStorage.setItem(e,JSON.stringify(r))},get:function(e){var r=localStorage.getItem(e);return JSON.parse(r)},del:function(e){localStorage.removeItem(e)}};function a(e){var r,t=0;if(0===e.length)return t;for(r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r),t|=0;return t}exports.local=n;
},{"@babel/runtime/helpers/toConsumableArray":"YtCi"}],"H8LY":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=i,exports.observer=exports.backupScripts=void 0;var e=require("./constants"),t=require("./patterns"),r=require("./utils"),s={blacklisted:[]};exports.backupScripts=s;var o=new MutationObserver(function(o){for(var i=0;i<o.length;i++)for(var n=o[i].addedNodes,u=function(o){var i=n[o];if(1===i.nodeType&&"SCRIPT"===i.tagName){var u=i.src,c=i.type;if((0,t.isOnBlacklist)(u,c)){s.blacklisted.push([i,i.type]),i.type=e.TYPE_ATTRIBUTE;i.addEventListener("beforescriptexecute",function t(r){i.getAttribute("type")===e.TYPE_ATTRIBUTE&&r.preventDefault(),i.removeEventListener("beforescriptexecute",t)}),(0,r.removeElement)(i)}}},c=0;c<n.length;c++)u(c)});function i(){o.observe(document.documentElement,{childList:!0,subtree:!0})}exports.observer=o;
},{"./constants":"iJA9","./patterns":"MwO6","./utils":"FOZT"}],"uiXq":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=require("./constants"),t=require("./patterns"),r=document.createElement,c={src:Object.getOwnPropertyDescriptor(HTMLScriptElement.prototype,"src"),type:Object.getOwnPropertyDescriptor(HTMLScriptElement.prototype,"type")};function n(){document.createElement=function(){for(var n=arguments.length,s=new Array(n),o=0;o<n;o++)s[o]=arguments[o];var i=r.bind(document).apply(void 0,s);if("script"!==s[0].toLowerCase())return i;try{Object.defineProperties(i,{src:{get:function(){return c.src.get.call(this)},set:function(r){(0,t.isOnBlacklist)(r,i.type)&&c.type.set.call(this,e.TYPE_ATTRIBUTE),c.src.set.call(this,r)}},type:{set:function(r){var n=(0,t.isOnBlacklist)(i.src,i.type)?e.TYPE_ATTRIBUTE:r;c.type.set.call(this,n)}}}),i.setAttribute=function(e,t){"type"===e||"src"===e?i[e]=t:HTMLScriptElement.prototype.setAttribute.call(i,e,t)}}catch(p){console.warn("SpruceJoy Subscribe: unable to prevent script execution for script src ",i.src,".\n",'A likely cause would be because you are using a third-party browser extension that monkey patches the "document.createElement" function.')}return i}}var s=n;exports.default=s;
},{"./constants":"iJA9","./patterns":"MwO6"}],"e7Sb":[function(require,module,exports) {
function e(e){if(Array.isArray(e))return e}module.exports=e,module.exports.default=module.exports,module.exports.__esModule=!0;
},{}],"nyVk":[function(require,module,exports) {
function e(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var o=[],r=!0,l=!1,n=void 0;try{for(var u,d=e[Symbol.iterator]();!(r=(u=d.next()).done)&&(o.push(u.value),!t||o.length!==t);r=!0);}catch(i){l=!0,n=i}finally{try{r||null==d.return||d.return()}finally{if(l)throw n}}return o}}module.exports=e,module.exports.default=module.exports,module.exports.__esModule=!0;
},{}],"yJnk":[function(require,module,exports) {
function e(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}module.exports=e,module.exports.default=module.exports,module.exports.__esModule=!0;
},{}],"xw6J":[function(require,module,exports) {
var e=require("./arrayWithHoles.js"),r=require("./iterableToArrayLimit.js"),o=require("./unsupportedIterableToArray.js"),t=require("./nonIterableRest.js");function u(u,s){return e(u)||r(u,s)||o(u,s)||t()}module.exports=u,module.exports.default=module.exports,module.exports.__esModule=!0;
},{"./arrayWithHoles.js":"e7Sb","./iterableToArrayLimit.js":"nyVk","./unsupportedIterableToArray.js":"IOZJ","./nonIterableRest.js":"yJnk"}],"ZXWT":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.unblock=void 0;var t=a(require("@babel/runtime/helpers/slicedToArray")),e=a(require("@babel/runtime/helpers/toConsumableArray")),r=require("./constants"),n=require("./observer"),i=require("./patterns");function a(t){return t&&t.__esModule?t:{default:t}}var l=new RegExp("[|\\{}()[\\]^$+*?.]","g"),s=function(){for(var a=arguments.length,s=new Array(a),c=0;c<a;c++)s[c]=arguments[c];s.length<1?(i.patterns.blacklist=[],i.patterns.whitelist=[]):(i.patterns.blacklist&&(i.patterns.blacklist=i.patterns.blacklist.filter(function(t){return s.every(function(e){return"string"==typeof e?!t.test(e):e instanceof RegExp?t.toString()!==e.toString():void 0})})),i.patterns.whitelist&&(i.patterns.whitelist=[].concat((0,e.default)(i.patterns.whitelist),(0,e.default)(s.map(function(t){if("string"==typeof t){var e=".*"+t.replace(l,"\\$&")+".*";if(i.patterns.whitelist.every(function(t){return t.toString()!==e.toString()}))return new RegExp(e)}else if(t instanceof RegExp&&i.patterns.whitelist.every(function(e){return e.toString()!==t.toString()}))return t;return null}).filter(Boolean)))));for(var o=document.querySelectorAll('script[type="'.concat(r.TYPE_ATTRIBUTE,'"]')),p=0;p<o.length;p++){var u=o[p];(0,i.willBeUnblocked)(u)&&(n.backupScripts.blacklisted.push([u,"application/javascript"]),u.parentElement.removeChild(u))}var f=0;(0,e.default)(n.backupScripts.blacklisted).forEach(function(e,r){var a=(0,t.default)(e,2),l=a[0],s=a[1];if((0,i.willBeUnblocked)(l)){var c=document.createElement("script");for(var o in c.setAttribute("src",l.src),c.setAttribute("type",s||"application/javascript"),l)o.startsWith("on")&&(c[o]=l[o]);document.head.appendChild(c),n.backupScripts.blacklisted.splice(r-f,1),f++}}),i.patterns.blacklist&&i.patterns.blacklist.length<1&&n.observer.disconnect()};exports.unblock=s;
},{"@babel/runtime/helpers/slicedToArray":"xw6J","@babel/runtime/helpers/toConsumableArray":"YtCi","./constants":"iJA9","./observer":"H8LY","./patterns":"MwO6"}],"HRwc":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.open=_;var n=require("./constants"),t=require("./utils"),o=require("./unblock"),e=(0,t.hashCode)(location.hostname),c="sj-dialog-".concat(e);function a(){var t="\n .".concat(c," {\n position: fixed;\n right: 0;\n bottom: 0;\n left: 0;\n display: flex;\n width: 100%;\n background: ").concat(window.__SJ_BAR_CLR__||n.DEFAULT_BAR_CLR,";\n z-index: 2147483647;\n }\n \n .").concat(c," .additional-info-").concat(e," {\n position: absolute;\n top: 4px;\n right: 4px;\n display: inline-flex;\n }\n \n .").concat(c," .dialog-body-").concat(e," {\n margin: 0 auto;\n padding: 16px;\n position: relative;\n display: flex;\n justify-content: space-between;\n align-items: center;\n max-width: 992px;\n width: auto;\n flex-grow: 1;\n }\n \n .").concat(c," .dialog-msg-").concat(e," {\n max-width: 668px;\n font-family: Rubik;\n font-style: normal;\n font-weight: normal;\n font-size: 14px;\n line-height: 17px;\n color: ").concat(window.__SJ_MSG_CLR__||n.DEFAULT_MSG_CLR,";\n }\n \n .").concat(c," .dialog-actions-").concat(e," {\n display: flex;\n justify-content: space-between;\n align-items: center;\n }\n \n .").concat(c," .dialog-actions-").concat(e," .button-").concat(e,":not(:last-child) {\n margin-right: 12px;\n }\n \n .").concat(c," .dialog-actions-").concat(e," .button-").concat(e," {\n -webkit-font-smoothing: antialiased;\n -moz-appearance: none;\n -webkit-appearance: none;\n box-sizing: border-box;\n margin: 0;\n padding: 4px 20px;\n position: relative;\n display: inline-flex;\n justify-content: center;\n align-items: center;\n vertical-align: top;\n height: 30px;\n font-family: Noto Sans;\n font-style: normal;\n font-weight: normal;\n font-size: 17px;\n line-height: 22px;\n letter-spacing: -0.408px;\n color: ").concat(window.__SJ_ACCEPT_BTN_TEXT_CLR__||n.DEFAULT_ACCEPT_BTN_TEXT_CLR,";\n text-align: center;\n text-size-adjust: 100%;\n white-space: nowrap;\n border: 1px solid transparent;\n border-radius: 5px;\n box-shadow: none;\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n cursor: pointer;\n background: ").concat(window.__SJ_ACCEPT_BTN_CLR__||n.DEFAULT_ACCEPT_BTN_CLR,";\n }\n \n .").concat(c," .dialog-actions-").concat(e," .button-").concat(e,".is-text-").concat(e," {\n color: ").concat(window.__SJ_REJECT_BTN_TEXT_CLR__||n.DEFAULT_REJECT_BTN_TEXT_CLR,";\n background: ").concat(window.__SJ_REJECT_BTN_CLR__||n.DEFAULT_REJECT_BTN_CLR,";\n text-decoration-line: underline;\n }\n \n .").concat(c," .dialog-actions-").concat(e," .button-").concat(e,":focus,\n .").concat(c," .dialog-actions-").concat(e," .button-").concat(e,":active {\n outline: 0;\n }\n \n @media only screen and (max-width: 767px) {\n .").concat(c," .dialog-body-").concat(e," {\n display: block;\n }\n .").concat(c," .dialog-msg-").concat(e," {\n margin-bottom: 16px;\n }\n }\n "),o=document.head||document.getElementsByTagName("head")[0],a=document.createElement("style");a.styleSheet?a.styleSheet.cssText=t:a.appendChild(document.createTextNode(t)),o.appendChild(a)}function i(){var t=window.__SJ_MESSAGE__||n.DEFAULT_DIALOG_MSG,o=window.__SJ_ACCEPT_BTN_TEXT__||n.DEFAULT_ACCEPT_BTN_TEXT,a=window.__SJ_REJECT_BTN_TEXT__||n.DEFAULT_REJECT_BTN_TEXT,i='\n <div class="'.concat(c,'">\n <a class="additional-info-').concat(e,'" href="').concat(n.DEFAULT_INFO_LINK,'" target="_blank">\n <svg style="width:12px;height:12px;" viewBox="0 0 24 24">\n <path fill="').concat(window.__SJ_INFO_ICON_CLR__||n.DEFAULT_INFO_ICON_CLR,'" d="M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M11,17H13V11H11V17Z" />\n </svg>\n </a>\n <div class="dialog-body-').concat(e,'">\n <div class="dialog-msg-').concat(e,'">').concat(t,'</div>\n <div class="dialog-actions-').concat(e,'">\n <button class="accept-btn button-').concat(e,'">').concat(o,'</button>\n <button class="reject-btn button-').concat(e," is-text-").concat(e,'">').concat(a,"</button>\n </div>\n </div>\n </div>\n "),_=document.createElement("div");_.id=c,_.innerHTML=i,document.body.appendChild(_)}function _(){a(),i();var e=document.querySelector("#".concat(c," .accept-btn")),_=document.querySelector("#".concat(c," .reject-btn"));e.addEventListener("click",function(){t.local.set(n.STORAGE_NAME_IS_COOKIE_CONSENT,1),d(),(0,o.unblock)()}),_.addEventListener("click",function(){d()})}function d(){var n=document.getElementById(c);(0,t.removeElement)(n)}
},{"./constants":"iJA9","./utils":"FOZT","./unblock":"ZXWT"}],"Focm":[function(require,module,exports) {
"use strict";var e=o(require("./observer")),r=o(require("./proxy")),t=require("./constants"),u=require("./utils"),n=require("./dialog");function o(e){return e&&e.__esModule?e:{default:e}}var i=u.local.get(t.STORAGE_NAME_IS_COOKIE_CONSENT);i||((0,e.default)(),(0,r.default)(),document.addEventListener("DOMContentLoaded",function(e){(0,n.open)()}));
},{"./observer":"H8LY","./proxy":"uiXq","./constants":"iJA9","./utils":"FOZT","./dialog":"HRwc"}]},{},["Focm"], null)