/*! * smartbanner.js v1.9.0 * Copyright © 2017 Ain Tohvri, contributors. Licensed under GPL-3.0. */ (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o1&&arguments[1]!==undefined?arguments[1]:null;document.cookie="smartbanner_exited=1; "+(hideTtl?Bakery.getCookieExpiresString(hideTtl):"")+" "+(hidePath?Bakery.getPathString(hidePath):"")}},{key:"unbake",value:function unbake(){document.cookie="smartbanner_exited=; expires=Thu, 01 Jan 1970 00:00:01 GMT;"}},{key:"baked",get:function get(){var value=document.cookie.replace(/(?:(?:^|.*;\s*)smartbanner_exited\s*\=\s*([^;]*).*$)|^.*$/,"$1");return value==="1"}}]);return Bakery}();exports.default=Bakery},{}],2:[function(require,module,exports){(function(global){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i0}function convertToCamelCase(name){var parts=name.split("-");parts.map(function(part,index){if(index>0){parts[index]=part.charAt(0).toUpperCase()+part.substring(1)}});return parts.join("")}var OptionParser=function(){function OptionParser(){_classCallCheck(this,OptionParser)}_createClass(OptionParser,[{key:"parse",value:function parse(){var metas=document.getElementsByTagName("meta");var options={};var optionName=null;Array.from(metas).forEach(function(meta){var name=meta.getAttribute("name");var content=meta.getAttribute("content");if(name&&content&&valid(name)&&content.length>0){optionName=name.split(":")[1];if(Array.from(optionName).includes("-")){optionName=convertToCamelCase(optionName)}options[optionName]=content}});return options}}]);return OptionParser}();exports.default=OptionParser},{"./polyfills/array/from.js":5,"./polyfills/array/includes.js":6}],5:[function(require,module,exports){"use strict";if(!Array.from){Array.from=function(){var toStr=Object.prototype.toString;var isCallable=function isCallable(fn){return typeof fn==="function"||toStr.call(fn)==="[object Function]"};var toInteger=function toInteger(value){var number=Number(value);if(isNaN(number)){return 0}if(number===0||!isFinite(number)){return number}return(number>0?1:-1)*Math.floor(Math.abs(number))};var maxSafeInteger=Math.pow(2,53)-1;var toLength=function toLength(value){var len=toInteger(value);return Math.min(Math.max(len,0),maxSafeInteger)};return function from(arrayLike){var C=this;var items=Object(arrayLike);if(arrayLike==null){throw new TypeError("Array.from requires an array-like object - not null or undefined")}var mapFn=arguments.length>1?arguments[1]:void undefined;var T;if(typeof mapFn!=="undefined"){if(!isCallable(mapFn)){throw new TypeError("Array.from: when provided, the second argument must be a function")}if(arguments.length>2){T=arguments[2]}}var len=toLength(items.length);var A=isCallable(C)?Object(new C(len)):new Array(len);var k=0;var kValue;while(k=0){k=n}else{k=len+n;if(k<0){k=0}}var currentElement;while(k\n \n
\n
\n
\n
'+this.options.title+'
\n
'+this.options.author+'
\n
'+this.options.price+this.priceSuffix+'
\n
\n
\n '+this.options.button+"\n "}},{key:"height",get:function get(){var height=document.querySelector(".js_smartbanner").offsetHeight;return height!==undefined?height:0}},{key:"platformEnabled",get:function get(){var enabledPlatforms=this.options.enabledPlatforms||DEFAULT_PLATFORMS;return enabledPlatforms&&enabledPlatforms.replace(/\s+/g,"").split(",").indexOf(this.platform)!==-1}},{key:"positioningDisabled",get:function get(){return this.options.disablePositioning==="true"}},{key:"userAgentExcluded",get:function get(){if(!this.options.excludeUserAgentRegex){return false}return _detector2.default.userAgentMatchesRegex(this.options.excludeUserAgentRegex)}},{key:"userAgentIncluded",get:function get(){if(!this.options.includeUserAgentRegex){return false}return _detector2.default.userAgentMatchesRegex(this.options.includeUserAgentRegex)}},{key:"hideTtl",get:function get(){return this.options.hideTtl?parseInt(this.options.hideTtl):false}}]);return SmartBanner}();exports.default=SmartBanner},{"./bakery.js":1,"./detector.js":2,"./optionparser.js":4}]},{},[3]);