(()=>{"use strict";var e={186:function(e,t,i){var n=this&&this.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[i]}})}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)"default"!==i&&Object.hasOwnProperty.call(e,i)&&n(t,e,i);return s(t,e),t},r=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(s,a){function r(e){try{d(n.next(e))}catch(e){a(e)}}function o(e){try{d(n.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,o)}d((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.SasAd=void 0;const o=i(42),d=i(7322),l=i(1740),c=i(5162),h=a(i(1715)),u=i(6594),p=i(1740),f=i(3089);class g extends d.Global{constructor(e,t=!1){super(t),this.c=e,this.closed=!1,this.iCustomScriptExecuted=!1,this.animationSpeed={none:0,slow:2,medium:1.4,fast:.7},this.buttonSize={small:1,normal:1.5,big:2},this.lastClicked=0,this.ifrContainer=null,this.isRenderPixaSent=!1,this.isImpressionCounted=!1,this.realIframeId="",this.creativeDomain="creatives.sascdn.com",this.macroEvents=["complete","firstQuartile","midpoint","start","thirdQuartile","viewcount"],this.dsaObject=null,this.isCreativeInSafeFrame=!!this.c.creative.safeFrame&&this.c.creative.type===p.ECreativeType.Agency;let i=document.getElementById(e.tagId);if(!i){const e=window.sas.currentScript||document.currentScript;i=document.createElement("div"),i.id=this.c.tagId,e?e.insertAdjacentElement("afterend",i):document.body.appendChild(i)}i.appendChild(document.createComment("TagID")),this.adAttrValue=`ad-${this.c.insertionId}`,this.c.filePath&&(this.closeButtonUrl=this.c.filePath+"images/close-retina.png",this.expandButtonUrl=this.c.filePath+"images/expand.svg"),this.viewability=new c.Viewability,this.impressionsOnePx=new c.Viewability;let n=this.c.statisticTracking.rtbCreativeId;"0"===n&&(n=void 0);let s=this.c.statisticTracking.rtbDealId;if("0"===s&&(s=void 0),this.updateDebugData({"Creative ID":n||this.c.creative.id||null,"Deal ID":s,"Insertion ID":this.c.insertionId}),this.c.dsa)try{this.dsaObject=JSON.parse(this.c.dsa),this.isObjectEmpty(this.dsaObject)&&(this.dsaObject=null)}catch(e){this.log("DSA json parsing error")}}updateDebugData(e){var t,i,n;null===(n=null===(i=null===(t=window.sas)||void 0===t?void 0:t.debugMode)||void 0===i?void 0:i.addBanner)||void 0===n||n.call(i,{adSlot:document.getElementById(this.c.tagId),adInfo:e})}calculateDimensions(e,t,i,n){const s=this.getRatio(e,t),a=this.getParentWidth(i);let r=a;n&&(-1!==n.indexOf("px!")?r=Number(n.replace("px!","")):(r=-1!==n.indexOf("%")?Math.round(Number(n.replace("%",""))/100*a):Number(n.replace("px","")),r>a&&(r=a)));const o=Math.round(r/s);return this.log(`calculateDimensions, input: ${e}, ${t}, output: ${r}, ${o}`),{height:o,width:r}}whichTransitionEvent(){const e=this.d.createElement("fakeelement"),t={transition:"transitionend",OTransition:"oTransitionEnd",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"};for(const i in t)if(void 0!==e.style[i])return t[i]}addImage(e,t=!0){let i="";return""!==e.url&&(""!==e.oryginalClickUrl&&t&&(i+=``),i+=``,""!==e.oryginalClickUrl&&(i+="")),i}addCreative(e,t,i=!1,n="",s=!0,a,r,o=!1,d=!0){var l,c;this.log("addCreative",e,t,i,n,s,o,d);let h=e.agencyCode;n&&!this.iCustomScriptExecuted&&(h+=n,this.iCustomScriptExecuted=!0);const f=0!==e.width||o?e.width:"100%",g=0!==e.height||o?e.height:"100%",m=this.c.tagId;if(e.type===p.ECreativeType.Agency){let n,s=this.w,o=this.d;const l=(null==s?void 0:s.$sf)&&!s.$sf.host;if(h=`\n \n ${h}\n `,e.safeFrame&&!l)if(this.realIframeId=t.id===this.c.tagId?`${t.id}_sf`:t.id,s.$sf)this.addSafeFrame(t.id,f,g,h,s,o,a,r);else{const e=document.createElement("script");e.onload=()=>this.addSafeFrame(t.id,f,g,h,s,o,a,r),e.src="//ced-ns.sascdn.com/safeframe/safeframe-api/base_host.js",o.head.appendChild(e)}else this.realIframeId=`${m}_iframe`,n=this.addElement("iframe",t,{src:"about:blank",width:f,height:g,frameBorder:"0",allow:"autoplay;fullscreen;",scrolling:"no",style:"display:block;margin:0",id:this.realIframeId}),s=n.contentWindow||n,o=n.contentWindow.document,o.open("text/html","replace"),o.write(`\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t