!function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(i,r,function(t){return e[t]}.bind(null,r));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){"use strict";function i(e,t){for(var n=0;n>>0;if(0===n)return-1;var i=0;if(arguments.length>0&&((i=Number(arguments[1]))!=i?i=0:0!==i&&i!==1/0&&i!==-1/0&&(i=(i>0||-1)*Math.floor(Math.abs(i)))),i>=n)return-1;for(var r=i>=0?i:Math.max(n-Math.abs(i),0);r0&&(r=e.gradColors[0].c,i="solid"):(i="solid",r="#fff")),"true"===String(e.useBorder)&&(t.border="1px solid ".concat(e.borderColor)),t["background-image"]="",i){case"none":break;case"image":t=function(e,t){var n,i,r=b(t);for(var o in e["background-image"]="url(".concat(r,")"),e["--retina-src"]=r,t)switch(o){case"scaleMode":case"verticalAlign":case"horizontalAlign":switch(t.verticalAlign){case"top":n="0";break;case"middle":n="50%";break;case"bottom":n="100%"}switch(t.horizontalAlign){case"left":i="0";break;case"center":i="50%";break;case"right":i="100%"}e["background-position"]="".concat(i," ").concat(n);break;case"contentOffsetX":"tile"===t.scaleMode&&(e["background-position-x"]="".concat(t[o],"%"));break;case"contentOffsetY":"tile"===t.scaleMode&&(e["background-position-y"]="".concat(t[o],"%"))}return e}(t,e=function(e){return e&&e.type&&"image"===e.type&&e.tile&&(e.scaleMode="tile",e.contentScale=100,e.contentOffsetX=50,e.contentOffsetY=50,delete e.tile),e}(e));break;case"solid":if(r&&r.includes("rgba")){var l=s();l>-1&&l<9&&(r=a(o(r),!1))}t["background-color"]=r;break;case"rgrad":case"lgrad":for(var c=e.gradColors,u=[],d=0;d0)(e=t["background-image"]=[]).push("-webkit-".concat(f,"-gradient(").concat(h,", ").concat(p,")")),e.push("-moz-".concat(f,"-gradient(").concat(h,", ").concat(p,")")),e.push("-o-".concat(f,"-gradient(").concat(h,", ").concat(p,")")),e.push("-ms-".concat(f,"-gradient(").concat(h,", ").concat(p,")"));t.filter="progid:DXImageTransform.Microsoft.gradient( startColorstr='".concat(c[0].c,"', endColorstr='").concat(c[c.length-1].c,"',GradientType=0 )")}return t}function b(e){if(window.bannerConfig.hqImages&&e.hqUrl&&e.source!==window.bannerConfig.watermark.source)return e.hqUrl;if(e.localUrl){var t=void 0!==window.bannerConfig.imgLocalPath?window.bannerConfig.imgLocalPath:"media/";return"".concat(t).concat(e.localUrl)}return e.url&&e.url.includes("//")?e.url:e.url?window.bannerConfig.photosUrl+e.url:null}function g(e,t){switch(t){case"aspect":e.backgroundSize="".concat(window.bannerConfig.watermark.size,"px, contain");break;case"stretch":e.backgroundSize="".concat(window.bannerConfig.watermark.size,"px, 100% 100%"),e.backgroundRepeat="repeat, no-repeat";break;case"mask":e.backgroundSize="".concat(window.bannerConfig.watermark.size,"px, auto"),e.backgroundRepeat="repeat, no-repeat";break;case"crop":e.backgroundSize="".concat(window.bannerConfig.watermark.size,"px,\n cover"),e.backgroundRepeat="repeat, no-repeat";break;default:e.backgroundSize="".concat(window.bannerConfig.watermark.size,"px, ").concat(e.backgroundSize||"cover")}}function v(e,t){for(var n in t)e.style[n]=t[n]}function m(e){return JSON.parse(JSON.stringify(e))}function w(e){return e&&0!==String(e).length?e.includes("://")?e:"http://".concat(e):""}function k(e,t){var n=window.innerWidth/e,i=window.innerHeight/t;return{proportion:Math.min(n,i)}}function S(e,t,n){return e.substring(t,t+n)}function C(e){return e.replace(/([A-Z])/g,(function(e){return"-".concat(e.toLowerCase())}))}var O=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),window.assetsCache={},this.fontTypes={CUSTOM:"custom",BANNERSNACK:"bannersnack",CREATOPY:"creatopy",GOOGLE:"google"},this.loadedSlides={},this.imagesToLoad=[],this.fontsToLoad=[],this.gFontsToLoad=[],this.videosToLoad=[],this.audiosToLoad=[],this.getFontUrl=function(e){if(e.localUrl){var t=void 0!==window.bannerConfig.fontLocalPath?window.bannerConfig.fontLocalPath:"fonts/";return window.bannerConfig.embedUrl&&(t=window.bannerConfig.embedUrl+t),"".concat(t).concat(e.localUrl)}switch(e.fontFamily=this.unquoted(e.fontFamily),e.fontType){case this.fontTypes.BANNERSNACK:case this.fontTypes.CREATOPY:return e.fontUrl?e.fontUrl.includes("//")?e.fontUrl:"//".concat(e.fontUrl):"";case this.fontTypes.CUSTOM:return e.fontUrl?"//".concat(e.fontFaceUrl?e.fontUrl:"".concat(e.fontUrl,".ttf")):"";case this.fontTypes.GOOGLE:var n="".concat(e.fontFamily.split(" ").join("+"),":").concat(parseInt(e.fontWeight));return"italic"===e.fontStyle&&(n+="i"),n;default:return""}},this.loadGFonts=function(){var e=this,t=this,n=this.gFontsToLoad.concat();if(n.length){var i=function(){for(var i=0;i-1&&e.gFontsToLoad.splice(r,1)}t.resolveIfAssetsLoaded()},r="https://fonts.googleapis.com/css?family=".concat(n.join("|"));this.bannerConfig.preview&&(r+="&subset=cyrillic,cyrillic-ext,greek,greek-ext,latin,latin-ext,vietnamese");var o=window.document.createElement("link");o.setAttribute("rel","stylesheet"),o.setAttribute("type","text/css"),o.setAttribute("href",r),o.addEventListener("load",i),o.addEventListener("error",i),window.document.head.appendChild(o)}},this.addFontToDOM=function(e){var t,n,i,r=this,o="ttf";e.fontType||(e.fontType=this.fontTypes.GOOGLE);var a=this.getFontUrl(e);if(a&&!window.assetsCache[a]){switch(e.fontType!==this.fontTypes.GOOGLE&&this.fontsToLoad.push(a),t=function(){r.fontsToLoad.pop(),r.resolveIfAssetsLoaded()},e.fontType){case this.fontTypes.GOOGLE:this.gFontsToLoad.push(a);break;case this.fontTypes.BANNERSNACK:case this.fontTypes.CREATOPY:case this.fontTypes.CUSTOM:if(this.relPreloadSupported()&&(o=a.substr(a.lastIndexOf(".")+1),(i=window.document.createElement("link")).setAttribute("rel","preload"),i.setAttribute("type","font/".concat(o)),i.setAttribute("as","font"),i.setAttribute("href",a),"file:"!==window.location.protocol&&i.setAttribute("crossorigin","anonymous"),i.addEventListener("load",t),i.addEventListener("error",t),window.document.head.appendChild(i)),e.fontFamily){var s="".concat("@font-face {\nfont-family: '").concat(e.fontPrefix||"").concat(e.fontFamily.replace(/'/g,"\\'"),"';\n")+"font-style: ".concat(e.fontStyle,";\n")+"font-weight: ".concat(e.fontWeight,";\n")+"src: url(".concat(a,");\n")+"}\n";(n=window.document.createElement("style")).appendChild(window.document.createTextNode(s)),this.relPreloadSupported()||(n.addEventListener("load",t),n.addEventListener("error",t)),window.document.head.appendChild(n)}}window.assetsCache[a]=!0}},this.unquoted=function(e){return"string"==typeof e?e.replace(/(^")|("$)/g,""):e},this.relPreloadSupported=function(){return function(e,t){if(!e||!e.supports)return!1;try{return e.supports(t)}catch(e){return!1}}(window.document.createElement("link").relList,"preload")},this.getSlideId=function(e){return e.displayData?e.displayData.properties.id:e.properties.id},this.getSlideLoaded=function(e){var t=this.getSlideId(e);return!!this.loadedSlides[t]&&this.loadedSlides[t]},this.setSlideLoaded=function(e){var t=this.getSlideId(e);this.loadedSlides[t]=!0},this.resolveIfAssetsLoaded=function(e){var t=0===this.imagesToLoad.length&&0===this.videosToLoad.length&&0===this.audiosToLoad.length;(t&&0===this.fontsToLoad.length&&0===this.gFontsToLoad.length||t&&!0===e)&&(window.loadAssetsTimer&&clearTimeout(window.loadAssetsTimer),this.currentSlide?this.setSlideLoaded(this.currentSlide):this.setAllSlidesLoaded(),"function"==typeof this.callback&&this.callback())},this.preloadMedia=function(e,t,n,i){var r=this,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"image";if(!e)throw new Error("No media url");var a=this,s=e;n&&(s+=n);var l=window.bannerConfig.pdf;if(!window.assetsCache[s]||l){var c=new Image;"video"===o?(c=window.document.createElement("video"),this.videosToLoad.push(c)):"audio"===o?(c=new Audio,this.audiosToLoad.push(c)):this.imagesToLoad.push(c);var u=function(){"video"===o?a.videosToLoad.pop():"audio"===o?a.audiosToLoad.pop():a.imagesToLoad.pop(),a.resolveIfAssetsLoaded()},d=function(){l&&!["audio","video"].includes(o)?a.preloadResizedImageForPdf(e,c,t,window.bannerConfig.hqImages,u):u()},p=["audio","video"].includes(o)?"loadedmetadata":"load";c.addEventListener(p,d),c.addEventListener("error",(function(){u(),c.removeEventListener(p,d),r.src="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs="})),this.bannerConfig.preview&&i&&!t.resourceKey?this.setColorGroups(e,c,i):c.src=e,window.assetsCache[s]=c}},this.preloadElementAssets=function(e){var t;if("layer"===e.type)switch(e.layerType){case"shape":e.properties.backgroundColor&&"image"===e.properties.backgroundColor.type&&(t=b(e.properties.backgroundColor))&&this.preloadMedia(t,e.properties);break;case"image":if(this.bannerConfig.hqImages&&e.properties.hqUrl&&e.properties.source!==window.bannerConfig.watermark.source)t=e.properties.hqUrl;else if(e.properties.localUrl){var n=void 0!==window.bannerConfig.imgLocalPath?window.bannerConfig.imgLocalPath:"media/";t="".concat(n).concat(e.properties.localUrl),window.bannerConfig.embedUrl&&(t=this.bannerConfig.embedUrl+t)}else t=e.properties.url&&e.properties.url.includes("//")?e.properties.url:this.bannerConfig.photosUrl+e.properties.url;t&&this.preloadMedia(t,e.properties);break;case"svg":if(e.properties.localUrl){var i=void 0!==window.bannerConfig.imgLocalPath?window.bannerConfig.imgLocalPath:"media/";t="".concat(i).concat(e.properties.localUrl)}else t=e.properties.url?e.properties.url.includes("//")?e.properties.url:"".concat(window.bannerConfig.photosUrl).concat(e.properties.url):null;t&&this.preloadMedia(t,e.properties,e.properties.id,e.properties.colorGroups);break;case"text":var r=e.properties.config;if(r){var o=this;r.forEach((function(e){var t=e.children,n=e.style;n&&n.fontFamily&&(n.fontFamily||(n.fontFamily="Open Sans"),o.addFontToDOM(n)),t&&t.forEach((function(e){var t=e.style;t&&(t.fontFamily?(!t.fontType||t.fontType===o.fontTypes.GOOGLE||t.fontUrl||t.localUrl)&&o.addFontToDOM(t):t.fontWeight&&(t.fontFamily=n.fontFamily,t.fontType=n.fontType,t.fontPrefix=n.fontPrefix||null,o.addFontToDOM(t)))}))}))}else this.addFontToDOM(e.properties);break;case"button":e.properties.localUrl||this.addFontToDOM(e.properties.labelStyle);break;case"video":case"audio":if(e.properties.localUrl){var a=void 0!==window.bannerConfig.imgLocalPath?window.bannerConfig.imgLocalPath:"media/";t="".concat(a).concat(e.properties.localUrl),window.bannerConfig.embedUrl&&(t=window.bannerConfig.embedUrl+t)}else t=e.properties.url&&e.properties.url.includes("//")?e.properties.url:this.bannerConfig.photosUrl+e.properties.url;t&&this.preloadMedia(t,e.properties,e.properties.id,null,e.layerType)}else if("slide"===e.type)for(var s=0;s0&&c=0&&l>0&&c0&&void 0!==arguments[0]?arguments[0]:"clickTag",t=window.location.search.substring(1),n=t.split("".concat(e,"="));if(!n[1])return"";var i=n[1].replace(/&.+$/,"");try{i=decodeURIComponent(i)}catch(e){return""}var r=i.match(/(http(s)?:\/\/.)?(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,8}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/g);return null==r?"":i},ne=function(e){var t="2x",n=e.lastIndexOf(".");return e.lastIndexOf("/")>n?e+t:(-1===n&&(n=e.length),[e.slice(0,n),t,e.slice(n)].join(""))};function ie(e){return(ie="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function re(e,t){for(var n=0;n=0||String(a).indexOf("clickTag")>=0)&&(c=window[a],u=a),c&&c.indexOf("bsClickTAG")>=0&&(c=null),window.bsClickFunc(c,e.target,u),!1}if(-1!==l||0===String(a).indexOf("clickTag")){var d=-1!==l?a.substr(l):a;(a="function"==typeof window[d]?window[d]():window[d])||-1===l||(a=te())}else if(n.hash||!window.bannerConfig.pdf){if(!a&&!1===window.goToURLWithoutBSURL)return!1;var p=te()||window.clickTag;p&&(a=void 0===window.clickTag&&p!==a&&-1===p.indexOf(a)&&p.indexOf(-1===encodeURIComponent(a))?p+encodeURIComponent(a):p,window.urlTarget&&(s=window.urlTarget))}a=w(a),window.bsOpenURL(a,s)}return!0})),!0}},{key:"createElement",value:function(e,t,n,i,r){var o=r||window.document.createElement(e);return o.setAttribute("class",t),!1!==n&&(i||this.container)&&(i||this.container).appendChild(o),E(o),o}},{key:"setStyle",value:function(e,t,n){n||(n="");var i={x:"left",y:"top",labelOffsetX:"margin-left",labelOffsetY:"margin-top",lineHeight:"line-height"};for(var r in t=t.split(","))if(t.hasOwnProperty(r)){var o=i[t[r]]||t[r],a=this.properties[t[r]];if("width"===o||"height"===o){var s=this.properties.scale||1;e.style[o]=a*s+n}else e.style[o]="left"===o||"right"===o?Math.round(a)+n:a+n}return this}},{key:"getContainer",value:function(){return this.container}},{key:"show",value:function(){return this.container.style.display="",this}},{key:"hide",value:function(){return this.container.style.display="none",this}},{key:"hasClass",value:function(e,t){return!!e&&new RegExp("(\\s|^)".concat(t,"(\\s|$)")).test(e.className)}},{key:"removeClass",value:function(e,t){return this.hasClass(e,t)&&(e.className=e.className.replace(new RegExp("(\\s|^)".concat(t,"(\\s|$)"))," ").replace(/^\s+|\s+$/g,"")),this}},{key:"addClass",value:function(e,t){return e?(this.hasClass(e,t)||(e.className+=(e.className?" ":"")+t),this):this}},{key:"toggleClass",value:function(e,t){return e?(this.hasClass(e,t)?this.removeClass(e,t):this.addClass(e,t),this):this}},{key:"applyBackground",value:function(e,t,n){var i=y(t);for(var r in i)switch(r){default:e.style[r]=i[r];break;case"background-image":if("lgrad"===t.type||"rgrad"===t.type)for(var o=0;o1?window.bannerConfig.watermark.watermarkX2:window.bannerConfig.watermark.watermarkX1,i[r]="url(".concat(a,"), ").concat(i[r])}e.style[r]=i[r]}break;case"background":for(var s=0;s1?window.bannerConfig.watermark.watermarkX2:window.bannerConfig.watermark.watermarkX1,e.style.setProperty(r,"url(".concat(l,', url("').concat(ne(i[r]),'")'))}e.style.setProperty(r,'url("'.concat(ne(i[r]),'")'))}}t&&t.type&&"image"===t.type&&("userCrop"!==t.scaleMode&&function(e,t){if(!e||!t)return d(e,"background"),!1;var n=["background","background-crop","background-stretch","background-mask","background-aspect","background-tile"],i="".concat(n[0],"-").concat(t.toLowerCase());for(var r in n)p(e,n[r]);d(e,n[0]),d(e,i)}(e,t.scaleMode),function(e,t){var n=!1,i=b(t);for(var r in t)switch(r){case"scaleMode":case"verticalAlign":case"horizontalAlign":case"contentScale":n=!0}if(n){e.style.backgroundSize="";var o=t.originalWidth;if(o)"tile"===t.scaleMode&&(e.style.backgroundSize=o?"".concat(t.contentScale*o/100,"px"):"".concat(t.contentScale,"%"),e.style.visibility="visible");else{var a=new Image;a.onload=function(){o!==a.width&&(o=a.width),e.style.backgroundSize="","tile"===t.scaleMode&&(e.style.backgroundSize=o?"".concat(t.contentScale*o/100,"px"):"".concat(t.contentScale,"%"),e.style.visibility="visible")},a.src=i}t.source===window.bannerConfig.watermark.source&&window.bannerConfig.watermark.show&&g(e.style,t.scaleMode)}}(e,t))}},{key:"applyBoxShadow",value:function(e,t){v(e,h(t))}},{key:"applyFilters",value:function(e,t,n,i){v(e,function(e,t,n){var i={"-webkit-filter":"",filter:""};return!e||!0!==e.useAdjustColor&&"true"!==e.useAdjustColor||(i.filter+="brightness(".concat((parseInt(e.brightness)+100)/100,") "),i.filter+="contrast(".concat((parseInt(e.contrast)+100)/100,") "),i.filter+="saturate(".concat((parseInt(e.saturate)+100)/100,") "),i.filter+="hue-rotate(".concat(e.hue,"deg)")),!t||!0!==t.useBlur&&"true"!==t.useBlur||(i.filter+="blur(".concat(t.pixels,"px)")),!n||!0!==n.useShadow&&"true"!==n.useShadow||(i.filter+="drop-shadow(".concat(n.hShadow,"px ").concat(n.vShadow,"px ").concat(n.blur,"px ").concat(n.color,")")),i["-webkit-filter"]=i.filter,i}(t,n,i))}},{key:"getFlipString",value:function(e){if(!e)return"";var t="both"===e||"vertical"===e?"-1":"1";return"scale(".concat("both"===e||"horizontal"===e?"-1":"1",", ").concat(t,")")}},{key:"getBRadius",value:function(){var e=this.properties,t=e.border||{},n=0;return"rectangle"===e.type&&(void 0!==t.radius?n=t.radius:void 0!==e.bradius&&(n=e.bradius)),n}},{key:"getBorderString",value:function(e){var t=e||this.properties.border||{};return void 0===t.weight||void 0===t.color?"":"".concat(t.weight,"px solid ").concat(t.color)}},{key:"getAnimationEl",value:function(){return this.container}},{key:"setBuildMidAnimation",value:function(){var e=this,t=this.getAnimationEl(),n=this.displayData.properties,i=n.buildIn,r=n.buildMid;function o(){e.isHover=!0,J.animate(t,r,"buildMid")}function a(){e.isHover=!1}function s(){e.isHover||e.reset()}var l=1!==e.slide.banner.properties.loopCount,c=n.buildOut,u="none"===c.type,d=r.delay,p=r.duration;function f(){c&&!u&&(r.onAnimationEnd=function(){e.setBuildOutAnimation()})}if(!e.properties.showOnAllSlides){var h=e.slide.displayData.properties.duration,y=e.slide.displayData.properties.stopSlide,b="none"!==i.type?i.delay+i.duration:0,g=r&&"none"!==r.type?r.delay+r.duration:0,v=b+g+c.delay+c.duration;("instant"===c.type&&v>h||c&&!y&&b>h)&&(c=null),l&&r&&"none"!==r.type&&b+g>h&&(r.duration=parseFloat((h-b-r.delay).toFixed(1)))}"hover"!==r.startEnd?(J.animate(t,r,"buildMid"),e.buildTimeouts.push(D((function(){(l&&p===r.duration||!l)&&(r.delay=0,r.duration=0,f(),J.animate(t,r,"buildMid")),r.delay=d,r.duration=p}),1e3*(r.delay+r.duration)))):(e.isHover=!1,c&&!u&&(r.onAnimationEnd=null),D((function(){r.delay=0,t.addEventListener("mouseenter",o),t.addEventListener("animationiteration",s),t.addEventListener("mouseleave",a),D((function(){t.removeEventListener("mouseenter",o),t.removeEventListener("animationiteration",s),t.removeEventListener("mouseleave",a),(l&&p===r.duration||!l&&c&&!u)&&(r.delay=0,r.duration=0,f(),J.animate(t,r,"buildMid")),r.delay=d,r.duration=p}),1e3*r.duration)}),1e3*r.delay))}},{key:"setBuildOutAnimation",value:function(){var e=this.getAnimationEl(),t=this.displayData.properties.buildOut,n=this;n.buildTimeouts.push(D((function(){n.trigger("buildOutStart")}),1e3*t.delay)),J.animate(e,t,"buildOut"),n.buildTimeouts.push(D((function(){n.trigger("buildOutEnd"),e.style.display="none"}),1e3*(t.duration+t.delay)))}},{key:"playAnimation",value:function(e){var t=this,n=this.getAnimationEl(),i=this.displayData.properties,r=i.buildIn,o=i.buildMid,a=i.buildOut;if(e=e||0,!this.properties.showOnAllSlides){var s=this.slide.displayData.properties.duration,l=this.slide.displayData.properties.stopSlide,c="none"!==r.type?r.delay+r.duration:0,u=c+(o&&"none"!==o.type?o.delay+o.duration:0)+a.delay+a.duration;("instant"===a.type&&u>s||a&&!l&&c>s)&&(a=null)}r&&"none"!==r.type?(0===r.alphaOffset&&(n.style.pointerEvents="none"),this.buildTimeouts.push(D((function(){n.style.pointerEvents="auto",t.trigger("buildInStart")}),1e3*r.delay)),"instant"===r.type&&r.delay>0&&(n.style.display="none",this.buildTimeouts.push(D((function(){n.style.display=""}),1e3*(r.delay+e)))),r.onAnimationEnd=function(){o&&"none"!==o.type?t.setBuildMidAnimation():a&&"none"!==a.type&&t.setBuildOutAnimation()},J.animate(n,r,"buildIn",e),this.buildTimeouts.push(D((function(){t.trigger("buildInEnd")}),1e3*(r.duration+r.delay+e)))):o&&"none"!==o.type?t.setBuildMidAnimation():a&&"none"!==a.type&&t.setBuildOutAnimation()}},{key:"transform",value:function(e,t){t||(t=this.container),t.style["-webkit-transform"]=e,t.style["-o-transform"]=e,t.style["-ms-transform"]=e,t.style["-moz-transform"]=e,t.style.transform=e}},{key:"webkitTransform",value:function(e,t){t||(t=this.container),t.style["-webkit-transform"]=e}},{key:"createActionProperties",value:function(e){var t=e||this.properties&&this.properties.actions&&this.properties.actions[0];if(!t)return!1;var n="";return"gotoURL"===t.type&&(n=t.url),{event:t.event,slideOrUrl:"gotoSlide"===t.type?t.slide:n,type:t.type,target:t.target,useHandCursor:t.useHandCursor}}},{key:"applyExtraPropertiesForGradients",value:function(e){if(this.properties.backgroundColor&&"string"!=typeof this.properties.backgroundColor){var t=this.properties.backgroundColor.type,n=this.properties.border?this.properties.border.weight:0;if("lgrad"===t||"rgrad"===t){var i="-".concat(n,"px"),r="calc(100% + ".concat(2*n,"px)");v(e,{backgroundPosition:"".concat(i," ").concat(i),backgroundSize:"".concat(r," ").concat(r)})}}}},{key:"getCropBackgroundPosition",value:function(e){var t=e.cropData.x,n=e.cropData.y,i=e.width,r=e.height,o=e.border?e.border.weight:0,a=t-o,s=n-o;return"horizontal"!==e.flip&&"both"!==e.flip||(a=i-(t+e.cropData.width)-o),"vertical"!==e.flip&&"both"!==e.flip||(s=r-(n+e.cropData.height)-o),{x:a,y:s}}}])&&re(n.prototype,i),r&&re(n,r),t}(ee);function ce(e){return(ce="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ue(e,t){for(var n=0;n=t.length?this.banner.slides[0]:this.banner.slides[n+1]}},{key:"getPrevSlide",value:function(e){e||(e=this.banner.currentSlide);var t=this.banner.slides.indexOf(e);return t-1<0?this.banner.slides[this.banner.slides.length-1]:this.banner.slides[t-1]}},{key:"getFirstSlide",value:function(){return this.banner.slides[0]}},{key:"getLastSlide",value:function(){return this.banner.slides[this.banner.slides.length-1]}},{key:"playSlideAnimation",value:function(e){j(this._buildOutTimeout);var t,n,i=this.getAnimationEl(),r=this,o=this.displayData.properties,a=this.banner.lastSlide?this.banner.lastSlide.container:null,s=this.banner.slides.length,l=this.banner.properties.loopCount,c=this.banner.showOnlyOneSlide,u=0;for(t=0;t1?(this.addClass(this.container,"buildin"),u=parseFloat(e.duration)||0,a&&(a.style.display=""),"hide"!==e.crosstype?J.animate(i,e,"buildIn"):a&&(a.style.zIndex="2"),D((function(){r.removeClass(r.container,"buildin"),r.trigger("buildInEnd")}),1e3*e.duration)):this.trigger("buildInEnd");var d=!l||l===this.LOOP_COUNT_FOREVER,p=this.banner.loopsPlayed>=this.banner.properties.loopCount;if(!this.isLastSlide()||p||d||(this.banner.loopsPlayed+=1),o.stopSlide||c||!d&&p&&this.isLastSlide()||(this._buildOutTimeout=D((function(){r.buildOut()}),1e3*(u+o.duration))),!this.banner.noAnimation)for(t=0;t1&&void 0!==arguments[1]&&arguments[1];this._buildOutTimeout&&j(this._buildOutTimeout);var n=this.banner.slides.length,i=this.displayData.properties.transition,r=this,o=r.banner.currentSlide.displayData.properties.stopSlide;r.trigger("buildOutStart");var a=null;if(i&&"none"!==i.type&&n>1){if(r.addClass(r.container,"buildout"),"show"!==i.crosstype){var s=m(i);J.animate(this.getAnimationEl(),s,"buildOut")}a=D((function(){r.banner.currentSlide!==r&&(r.container.style.display="none"),r.removeClass(r.container,"buildout"),r.trigger("buildOutEnd")}),1e3*i.duration)}else r.trigger("buildOutEnd");e||(e=this.getNextSlide()),e===this&&a&&(j(a),r.removeClass(r.container,"buildout"),r.trigger("buildOutEnd")),o&&!t||e.play(m(i))}},{key:"getBuildOutTime",value:function(){var e=this.displayData.properties.transition;return e&&"none"!==e.type?1e3*e.duration:0}},{key:"getSlideByHashOrId",value:function(e){if(!e)return!1;for(var t=this.banner.slides,n=0;n1?window.bannerConfig.watermark.watermarkX2:window.bannerConfig.watermark.watermarkX1,this.displayContainer.style.backgroundImage="url(".concat(r,"), url(").concat(t,")"),g(this.displayContainer.style,n.scaleMode)):this.displayContainer.style.backgroundImage="url(".concat(t,")")),this.applyFilters(n.maskImage?this.transformContainer:this.displayContainer,n.adjustColor,n.blur,n.dropShadow),n.verticalAlign){case"top":o="0";break;case"middle":o="50%";break;case"bottom":o="100%"}switch(n.horizontalAlign){case"left":a="0";break;case"center":a="50%";break;case"right":a="100%"}if(this.displayContainer.style.backgroundPosition="".concat(a," ").concat(o),"tile"===n.scaleMode){var c=n.contentScale,u=n.originalWidth?n.originalWidth:n.oWidth;this.displayContainer.style.backgroundSize="".concat(c/100*u,"px"),this.displayContainer.style.backgroundPositionX="".concat(n.contentOffsetX,"%"),this.displayContainer.style.backgroundPositionY="".concat(n.contentOffsetY,"%"),i===window.bannerConfig.watermark.source&&window.bannerConfig.watermark.show&&(this.displayContainer.style.backgroundSize="".concat(window.bannerConfig.watermark.size,"px, ").concat(c/100*u,"px"))}else if("userCrop"===n.scaleMode&&n.cropData){var d=n.cropData.width,p=n.cropData.height,f=this.getCropBackgroundPosition(n);this.displayContainer.style.backgroundSize="".concat(d,"px ").concat(p,"px"),this.displayContainer.style.backgroundPositionX="".concat(f.x,"px"),this.displayContainer.style.backgroundPositionY="".concat(f.y,"px"),this.displayContainer.style.backgroundRepeat="no-repeat",i===window.bannerConfig.watermark.source&&window.bannerConfig.watermark.show&&(this.displayContainer.style.backgroundSize="".concat(window.bannerConfig.watermark.size,"px, ").concat(d,"px ").concat(p,"px"),this.displayContainer.style.backgroundRepeat="repeat, no-repeat")}this.transformContainer.style.height="100%",this.transformContainer.style.width="100%";var h=this.getFlipString(n.flip);return this.transform("translateZ(0) rotate(".concat(n.rotation,"deg) ").concat(h),this.transformContainer),this.reset(),n.maskImage&&(this.transformContainer.style.opacity=this.displayContainer.style.opacity,this.displayContainer.style.removeProperty("opacity"),window.bannerConfig.pdf&&(this.maskContainer.style.border="1px solid transparent"),this.maskContainer.style.width="100%",this.maskContainer.style.height="100%",v(this.maskContainer,function(e){if(!e)return{};var t='url("data:image/svg+xml;charset=UTF-8,'.concat(encodeURIComponent(e),'")');return{maskImage:t,WebkitMaskImage:t,maskRepeat:"no-repeat",WebkitMaskRepeat:"no-repeat",maskPosition:"center",WebkitMaskPosition:"center",maskSize:"100% 100%",WebkitMaskSize:"100% 100%",maskOrigin:"content-box",WebkitMaskOrigin:"content-box"}}(n.maskImage))),this.slide.banner.statsPresent&&this.slide.banner.stats.trackEvent(this.displayContainer,this),this.applyActions(this.createActionProperties(),this.displayContainer),le.prototype.init.call(this,e)}}])&&Pe(n.prototype,i),r&&Pe(n,r),t}(le);function Be(e){return(Be="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function De(e,t){for(var n=0;n>16,e>>8&255,255&e]}(parseInt(i,16)),"rgba(".concat(r[0],", ").concat(r[1],", ").concat(r[2],", ").concat(n,")"));return"border-color: ".concat(u," !important;")}},{key:"init",value:function(e){var t=e.properties;"string"==typeof t.backgroundColor&&(t.backgroundColor={type:"solid",scolor:t.backgroundColor});var n=t.border||{};if(t["border-radius"]=t.border&&t.border.radius?t.border.radius:t.borderRadius,this.properties=t,this.createMainContainers("element","bs-btn btn".concat(t.id)),t.localUrl&&t.localUrl.includes(".svg")){this.textContainer=this.createElement("div","bs-btn-label image-crop",!0,this.displayContainer);var i=void 0!==bannerConfig.imgLocalPath?bannerConfig.imgLocalPath:"media/";this.textContainer.style.backgroundImage="url(".concat(i).concat(t.localUrl,")"),this.textContainer.style.height="100%",this.applyFilters(this.textContainer,null,null,t.labelShadow),n.weight&&this.applyExtraPropertiesForGradients(this.displayContainer)}else{if(this.textContainer=this.createElement("label","bs-btn-label",!0,this.displayContainer),t.html?this.textContainer.innerHTML=t.html:this.textContainer.textContent=t.buttonLabel,this.textContainer.dir=t.labelStyle.textDirection||"ltr",t.buttonLabel.split("\n").length>1&&(t.labelStyle["white-space"]="pre-wrap",t.labelStyle["overflow-wrap"]="break-word"),this.setStyle(this.textContainer,"line-height,labelOffsetX,labelOffsetY","px"),("string"!=typeof t.labelStyle.fontSize||"string"==typeof t.labelStyle.fontSize&&!t.labelStyle.fontSize.includes("px"))&&(t.labelStyle.fontSize="".concat(t.labelStyle.fontSize,"px")),("string"!=typeof t.labelStyle.letterSpacing||"string"==typeof t.labelStyle.letterSpacing&&!t.labelStyle.letterSpacing.includes("px"))&&(t.labelStyle.letterSpacing="".concat(t.labelStyle.letterSpacing,"px")),"string"==typeof t.labelStyle.fontFamily&&!t.labelStyle.fontFamily.includes('"')){var o='"'.concat(t.labelStyle.fontPrefix||"").concat(t.labelStyle.fontFamily,'"');t.labelStyle.fontFamily=o}v(this.textContainer,t.labelStyle),v(this.textContainer,f(t.labelShadow)),n.weight&&this.applyExtraPropertiesForGradients(this.displayContainer)}v(this.displayContainer,h(t.dropShadow)),this.displayContainer.style.border=this.getBorderString(),this.applyBackground(this.displayContainer,t.backgroundColor);var a=".bs-btn.btn".concat(t.id),s="bs-btn".concat(t.id),l=this.getBackgroundHoverCss(this.getHoverBackgroundColor()),c=this.getBorderColorHoverCss(n.color);!function(e,t){var n,i=window.document.getElementsByTagName("head")[0],o=window.document.getElementById("eautils-css");if(null==o&&((o=window.document.createElement("style")).type="text/css",o.id="eautils-css",i.appendChild(o)),void 0!==r.cssStyle[t]){r.rawCssStyle="",r.cssStyle[t].css=e;for(var a=0;a3&&void 0!==arguments[3]?arguments[3]:{},r=e.properties.feed,o=(r=void 0===r?{}:r).background,a=i.embedUrl;if(o){var s="".concat(a).concat(e.properties.backgroundColor.backupUrl);n||(e.properties.backgroundColor.localUrl="",e.properties.backgroundColor.backupUrl="",s=t[o]),e.properties.backgroundColor.type="image",e.properties.backgroundColor.url=s,e.properties.backgroundColor.hqUrl=s}},ct=function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},r=i.embedUrl,o=e.layerType,a=e.properties,s=a.elementCategory,l=a.feed,c=a.lockedProperties,u=void 0===c?[]:c;if(l)for(var d=0,p=Object.entries(l);d0?n[0]:{style:i},o=b.split(/\r\n|\n\r|\n|\r/),a=0,s=o.map((function(e){var n=e.length,i=ot({},t,{offset:a,length:n,children:[ot({},r,{offset:a,length:n})]});return a+=n,i}));return e.properties.text=b,e.properties.config=s,"break"}();if("break"===v)break;case tt:if(u.includes(rt))break;e.properties.config[0].style.color=b}break;case Qe:switch(h){case nt:var m=b;e.properties.localUrl="",e.properties.backupUrl="",e.properties.hqUrl=m,e.properties.url=m}break;case Ke:switch(h){case et:if(u.includes(it))break;e.properties.buttonLabel=b,e.properties.html=b;break;case nt:e.properties.actions[0]=ot({},e.properties.actions[0],{url:b,event:"click",target:null,type:"gotoURL",slide:null,useHandCursor:!0})}break;case $e:switch(h){case tt:if(u.includes(rt))break;[Je.SHAPES,Je.ICONS,Je.LINES].includes(s)&&(e.properties.colorGroups[0]=b)}}}catch(e){}}},ut=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";if(t||n){var r=Array.isArray(t)?t[Math.floor(Math.random()*t.length)]:t;lt(e.banner,r,n,i),e.banner.elements.forEach((function(e){e.type===Ze?ct(e,r,n):e.elements.forEach((function(e){return ct(e,r,n)}))}))}};String.prototype.includes||(String.prototype.includes=function(e,t){return"number"!=typeof t&&(t=0),!(t+e.length>this.length)&&-1!==this.indexOf(e,t)}),Array.prototype.includes||Object.defineProperty(Array.prototype,"includes",{value:function(e,t){if(null==this)throw new TypeError('"this" is null or not defined');var n=Object(this),i=n.length>>>0;if(0===i)return!1;for(var r,o,a=0|t,s=Math.max(a>=0?a:i-Math.abs(a),0);s0&&void 0!==arguments[0]?arguments[0]:i;e.init(window.document.getElementById("bs"),t,n)}if(i){var s=new URLSearchParams(window.location.search),l=+s.get("feedRow"),c=s.get("targetId"),u=0;if(o&&!n.download&&(c||l)&&("TARGET_ID"!==c||"FEED_ROW"!==l&&Number.isInteger(l))){u=c&&"TARGET_ID"!==c?c:l<1?n.feedRow:l-1;var d=window.bannerConfig.feedUrl,p="".concat(d).concat(o,"_rows/").concat(u,"?t=").concat((new Date).getTime());fetch(p,{timeout:1e4}).then((function(e){return e.json().then((function(e){return e&&ut(i,e),a()})).catch((function(){ut(i,!1,!0,n),a()}))})).catch((function(){ut(i,!1,!0,n),a()}))}else a()}})),e};window.BS_eaUtils=r,window.BS_eaUtils,window.BS_eff=J,window.BS_eff,window.BS_EventDispatcher=ee,window.BS_EventDispatcher,window.BS_BaseDisplay=le,window.BS_BaseDisplay,window.BS_BannerDisplay=ke,window.BS_BannerDisplay,window.BS_SlideDisplay=ye,window.BS_SlideDisplay,window.BS_EmbedCanvas=Te,window.BS_EmbedCanvas,window.BS_ImageDisplay=Ue,window.BS_ImageDisplay,window.BS_ButtonDisplay=Re,window.BS_ButtonDisplay,window.BS_TextDisplay=qe,window.BS_TextDisplay,window.BS_alpha=Ye,window.BS_alpha,window.BS_init=dt,window.BS_init;dt()}]);
//# sourceMappingURL=index.js.map