1function d(i){return i.indexOf("smartbanner:")!==-1&&i.split(":")[1].length>0}function g(i){let t=i.split("-");return t.map(function(e,n){n>0&&(t[n]=e.charAt(0).toUpperCase()+e.substring(1))}),t.join("")}class h{parse(){let t=document.getElementsByTagName("meta"),e={};return Array.apply(null,t).forEach(function(n){let r=null,a=n.getAttribute("name"),p=n.getAttribute("content");a&&p&&d(a)&&p.length>0&&(r=a.split(":")[1],r.indexOf("-")!==-1&&(r=g(r)),e[r]=p)}),e}}class o{static platform(){let t=window.navigator.maxTouchPoints,e=window.navigator.userAgent;if(/Android/i.test(e))return"android";if(!window.MSStream&&!/X11|Linux|Windows/i.test(e)&&t&&t>0||/iPhone|iPad|iPod/i.test(e))return"ios"}static userAgentMatchesRegex(t){return new RegExp(t).test(window.navigator.userAgent)}static jQueryMobilePage(){return typeof globalThis.$<"u"&&globalThis.$.mobile!=="undefined"&&document.querySelector(".ui-page")!==null}static wrapperElement(){let t=o.jQueryMobilePage()?".ui-page":"html";return document.querySelectorAll(t)}}class l{static getCookieExpiresString(t){const e=new Date;return`expires=${new Date(e.getTime()+t).toGMTString()};`}static bake(t,e){document.cookie=`smartbanner_exited=1; ${t?l.getCookieExpiresString(t):""} path=${e}`}static unbake(){document.cookie="smartbanner_exited=; expires=Thu, 01 Jan 1970 00:00:01 GMT;"}static get baked(){return document.cookie.replace(/(?:(?:^|.*;\s*)smartbanner_exited\s*=\s*([^;]*).*$)|^.*$/,"$1")==="1"}}const b="android,ios",f="Close",m="View";let s={originalTop:"data-smartbanner-original-top",originalMarginTop:"data-smartbanner-original-margin-top"};function _(i,t){t.exit(),i.preventDefault()}function x(i,t){t.clickout()}function u(i){this.positioningDisabled||c(i.data.height)}function v(i){document.querySelector(".js_smartbanner__exit").addEventListener("click",n=>_(n,i)),document.querySelector(".js_smartbanner__button").addEventListener("click",n=>x(n,i)),o.jQueryMobilePage()&&$(document).on("pagebeforeshow",i,u)}function A(){o.jQueryMobilePage()&&$(document).off("pagebeforeshow",u)}function c(i){let t=o.wrapperElement();for(let e=0,n=t.length,r;e<n;e++)if(r=t[e],o.jQueryMobilePage()){if(r.getAttribute(s.originalTop))continue;let a=parseFloat(getComputedStyle(r).top);r.setAttribute(s.originalTop,isNaN(a)?0:a),r.style.top=i+"px"}else{if(r.getAttribute(s.originalMarginTop))continue;let a=parseFloat(getComputedStyle(r).marginTop);r.setAttribute(s.originalMarginTop,isNaN(a)?0:a),r.style.marginTop=i+"px"}}function T(){let i=o.wrapperElement();for(let t=0,e=i.length,n;t<e;t++)n=i[t],o.jQueryMobilePage()&&n.getAttribute(s.originalTop)?n.style.top=n.getAttribute(s.originalTop)+"px":n.getAttribute(s.originalMarginTop)&&(n.style.marginTop=n.getAttribute(s.originalMarginTop)+"px")}class w{constructor(){let t=new h;this.options=t.parse(),this.platform=o.platform();let e=new Event("smartbanner.init");document.dispatchEvent(e)}get originalTop(){let t=o.wrapperElement()[0];return parseFloat(t.getAttribute(s.originalTop))}get originalTopMargin(){let t=o.wrapperElement()[0];return parseFloat(t.getAttribute(s.originalMarginTop))}get priceSuffix(){return this.platform==="ios"&&this.options.priceSuffixApple?this.options.priceSuffixApple:this.platform==="android"&&this.options.priceSuffixGoogle?this.options.priceSuffixGoogle:""}get price(){return this.options.price&&this.options.price!==""?this.options.price:""}get icon(){return this.platform==="android"?this.options.iconGoogle:this.options.iconApple}get buttonUrl(){return this.platform==="android"?this.options.buttonUrlGoogle:this.platform==="ios"?this.options.buttonUrlApple:"#"}get closeLabel(){return this.options.closeLabel!==void 0?this.options.closeLabel:f}get buttonLabel(){let t=this.options.button;return this.platform==="android"&&this.options.buttonGoogle?t=this.options.buttonGoogle:this.platform==="ios"&&this.options.buttonApple&&(t=this.options.buttonApple),t||m}get html(){return`<div class="smartbanner smartbanner--${this.options.customDesignModifier?this.options.customDesignModifier:this.platform} js_smartbanner"> 2 <a href="#" class="smartbanner__exit js_smartbanner__exit" title="${this.closeLabel}" rel="nofollow"></a> 3 <div class="smartbanner__icon" style="background-image: url(${this.icon});"></div> 4 <div class="smartbanner__info"> 5 <div> 6 <div class="smartbanner__info__title">${this.options.title}</div> 7 <div class="smartbanner__info__author">${this.options.author}</div> 8 <div class="smartbanner__info__price">${this.price}${this.priceSuffix}</div> 9 </div> 10 </div> 11 <a href="${this.buttonUrl}" target="_blank" class="smartbanner__button js_smartbanner__button" rel="noopener" aria-label="${this.buttonLabel}"><span class="smartbanner__button__label">${this.buttonLabel}</span></a> 12 </div>`}get height(){try{return document.querySelector(".js_smartbanner").offsetHeight}catch{return 0}}get platformEnabled(){return(this.options.enabledPlatforms||b).replace(/\s+/g,"").split(",").indexOf(this.platform)!==-1}get positioningDisabled(){return this.options.disablePositioning==="true"}get apiEnabled(){return this.options.api==="true"||this.options.api==="yes"}get userAgentExcluded(){return this.options.excludeUserAgentRegex?o.userAgentMatchesRegex(this.options.excludeUserAgentRegex):!1}get userAgentIncluded(){return this.options.includeUserAgentRegex?o.userAgentMatchesRegex(this.options.includeUserAgentRegex):!1}get hideTtl(){return this.options.hideTtl?parseInt(this.options.hideTtl):!1}get hidePath(){return this.options.hidePath?this.options.hidePath:"/"}publish(){if(Object.keys(this.options).length===0)throw new Error("No options detected. Please consult documentation.");
vendor: 636 bytes, line 12
12if(l.baked||this.userAgentExcluded||!(this.platformEnabled||this.userAgentIncluded))return!1;let t=document.createElement("div");document.querySelector("body").prepend(t),t.outerHTML=this.html;let e=new Event("smartbanner.view");document.dispatchEvent(e),this.positioningDisabled||c(this.height),v(this)}exit(){A(),this.positioningDisabled||T();let t=document.querySelector(".js_smartbanner");document.querySelector("body").removeChild(t);let e=new Event("smartbanner.exit");document.dispatchEvent(e),l.bake(this.hideTtl,this.hidePath)}clickout(){let t=new Event("smartbanner.clickout");document.dispatchEvent(t)}}export{w as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.