@inappstory/js-sdk 3.9.0 → 3.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.esm.mjs +150 -217
- package/dist/index.esm.mjs.map +1 -1
- package/dist/index.umd.js +1 -1
- package/package.json +2 -2
- package/plugins/banners/index.esm.mjs +1 -1
- package/plugins/dotLottie/iasDotLottiePlugin.umd.js +1 -1
- package/plugins/videoOnDemand/iasVideoOnDemandPlugin.umd.js +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as e from"react/jsx-runtime";import*as t from"react";import*as r from"mobx-react-lite";import*as n from"classnames";import*as i from"mobx";import*as a from"uuid";import*as s from"react-dom/client";import*as o from"@inappstory/slide-api";var l={371:(e,t,r)=>{r.d(t,{A:()=>a});var n=r(935),i=r.n(n)()((function(e){return e[1]}));i.push([e.id,".bnr---mqC-{width:100%;height:100%;position:relative;backface-visibility:hidden;transform:translateZ(0);clip-path:inset(0 round var(--ias-banner-border-radius, 0px))}.bnr-slides--Oc1j-{position:relative;width:100%;height:100%;display:block}",""]),i.locals={bnr:"bnr---mqC-","bnr-slides":"bnr-slides--Oc1j-"};const a=i},243:(e,t,r)=>{r.d(t,{A:()=>a});var n=r(935),i=r.n(n)()((function(e){return e[1]}));i.push([e.id,".bnr-place--GbC1J{width:100%;height:100%;position:relative;border-radius:var(--ias-bnr-place-border-radius, 0px)}.bnr-slider__slider_visible--LrMXv{border:solid 1px green}",""]),i.locals={"bnr-place":"bnr-place--GbC1J","bnr-slider__slider_visible":"bnr-slider__slider_visible--LrMXv"};const a=i},883:(e,t,r)=>{r.d(t,{A:()=>a});var n=r(935),i=r.n(n)()((function(e){return e[1]}));i.push([e.id,".bnr-place--Dj\\+2-{width:100%;height:100%;display:flex;flex-direction:column;position:relative}",""]),i.locals={"bnr-place":"bnr-place--Dj+2-"};const a=i},713:(e,t,r)=>{r.d(t,{A:()=>a});var n=r(935),i=r.n(n)()((function(e){return e[1]}));i.push([e.id,".bnr-place--1RkrK{width:100%;height:100%;position:relative}",""]),i.locals={"bnr-place":"bnr-place--1RkrK"};const a=i},41:(e,t,r)=>{r.d(t,{A:()=>a});var n=r(935),i=r.n(n)()((function(e){return e[1]}));i.push([e.id,".slider--ggy2P{width:100%;height:100%;overflow:hidden;position:relative;justify-content:center;user-select:none;border-radius:inherit}.slider__track--JSOcI{display:flex;transition:transform .3s ease;width:100%;height:100%;will-change:transform}.slider__slide--oGmUT{width:100%;flex-shrink:0;position:relative;display:flex}.slider--vertical--qUwAP .slider__track--JSOcI{flex-direction:column}.slider--vertical--qUwAP .slider__slide--oGmUT{justify-content:center}",""]),i.locals={slider:"slider--ggy2P",slider__track:"slider__track--JSOcI",slider__slide:"slider__slide--oGmUT","slider--vertical":"slider--vertical--qUwAP"};const a=i},379:(e,t,r)=>{r.d(t,{A:()=>a});var n=r(935),i=r.n(n)()((function(e){return e[1]}));i.push([e.id,".slider__controls-btn--HubN5{position:absolute;top:50%;z-index:1;width:1.5rem;height:1.5rem;transform:translate3d(0, -50%, 0);transition:all .2s ease-in-out;cursor:pointer;padding:0;background-color:rgba(0,0,0,0);color:#0c62f3;border:0;outline:0}.slider__controls-btn--start--uVL4-{left:1.5rem}.slider__controls-btn--end--fV\\+p9{right:1.5rem}.slider__controls--CjPin.slider__controls--vertical--5wOuK .slider__controls-btn--HubN5{top:auto;left:50%;transform:translate3d(-50%, 0, 0)}.slider__controls--CjPin.slider__controls--vertical--5wOuK .slider__controls-btn--start--uVL4-{top:0;transform:rotate(90deg)}.slider__controls--CjPin.slider__controls--vertical--5wOuK .slider__controls-btn--end--fV\\+p9{bottom:0;transform:rotate(90deg)}.slider__controls--CjPin:not(.slider__controls--vertical--5wOuK) .slider__controls-btn--start--uVL4-.slider__controls-btn--dir--rtl--ICofD{left:auto;right:0;transform:translate3d(0, -50%, 0) rotate(180deg)}.slider__controls--CjPin:not(.slider__controls--vertical--5wOuK) .slider__controls-btn--end--fV\\+p9.slider__controls-btn--dir--rtl--ICofD{left:0;right:auto;transform:translate3d(0, -50%, 0) rotate(180deg)}.slider__controls-btn--HubN5{transition:opacity .3s ease-in-out}.slider__controls-btn--disabled--m1P4q{opacity:0;pointer-events:none}",""]),i.locals={"slider__controls-btn":"slider__controls-btn--HubN5","slider__controls-btn--start":"slider__controls-btn--start--uVL4-","slider__controls-btn--end":"slider__controls-btn--end--fV+p9",slider__controls:"slider__controls--CjPin","slider__controls--vertical":"slider__controls--vertical--5wOuK","slider__controls-btn--dir--rtl":"slider__controls-btn--dir--rtl--ICofD","slider__controls-btn--disabled":"slider__controls-btn--disabled--m1P4q"};const a=i},55:(e,t,r)=>{r.d(t,{A:()=>a});var n=r(935),i=r.n(n)()((function(e){return e[1]}));i.push([e.id,".slider-bullets--XDc5n{position:absolute;z-index:2;bottom:1.5rem;left:50%;display:inline-flex;list-style:none;transform:translate3d(-50%, 0, 0)}.slider-bullets__bullet--83aBh{background-color:var(--ias-banners-pagination-inactive-color, hsla(0, 0%, 100%, 0.5));width:var(--ias-banners-pagination-width, 0.5rem);height:var(--ias-banners-pagination-height, 0.5rem);padding:0;border-radius:50%;border:.25rem solid rgba(0,0,0,0);cursor:pointer;line-height:0;box-shadow:0 .25em .5em 0 rgba(0,0,0,.1);margin:0 .25em;transition:transform 100ms ease-in;transform:scale(0.8)}.slider-bullets__bullet--active--RDBez{background-color:#0c62f3;transform:scale(1)}.slider-bullets--XDc5n.slider-bullets--vertical--QuatQ{transform:translate3d(0, -50%, 0);left:auto;bottom:auto;right:1.5rem;top:50%;display:flex;flex-direction:column}.slider-bullets--XDc5n.slider-bullets--vertical--QuatQ .slider-bullets__bullet--83aBh{margin:.25em 0}",""]),i.locals={"slider-bullets":"slider-bullets--XDc5n","slider-bullets__bullet":"slider-bullets__bullet--83aBh","slider-bullets__bullet--active":"slider-bullets__bullet--active--RDBez","slider-bullets--vertical":"slider-bullets--vertical--QuatQ"};const a=i},126:(e,t,r)=>{r.d(t,{A:()=>a});var n=r(935),i=r.n(n)()((function(e){return e[1]}));i.push([e.id,".loader--4uMcs{position:absolute;z-index:10001;top:0;bottom:0;left:0;right:0;display:flex;justify-content:center;align-items:center;background:var(--loader-background, black)}.loader--4uMcs .loader__refresh-btn--5nwxY{color:#fff;cursor:pointer;position:absolute;left:50%;top:50%;transform:translate3d(-50%, -50%, 0);pointer-events:auto;padding:20px;width:32px;height:32px;box-sizing:content-box}.loader--4uMcs .loader__spinner--NRm8E{-ms-flex-negative:0;flex-shrink:0;display:inline-block;width:32px;height:32px;border-radius:50%;border:solid 2px var(--loaderBackgroundColor, white);border-color:var(--loaderBackgroundAccentColor, transparent) var(--loaderBackgroundColor, white) var(--loaderBackgroundColor, white) var(--loaderBackgroundColor, white);-webkit-animation:loading-spinner--LnXd0 .6s infinite linear;animation:loading-spinner--LnXd0 .6s infinite linear}@keyframes loading-spinner--LnXd0{from{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}",""]),i.locals={loader:"loader--4uMcs","loader__refresh-btn":"loader__refresh-btn--5nwxY",loader__spinner:"loader__spinner--NRm8E","loading-spinner":"loading-spinner--LnXd0"};const a=i},81:(e,t,r)=>{r.d(t,{A:()=>a});var n=r(935),i=r.n(n)()((function(e){return e[1]}));i.push([e.id,".icon--5RBkn{width:2rem;height:2rem}",""]),i.locals={icon:"icon--5RBkn"};const a=i},935:e=>{e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var r=e(t);return t[2]?"@media ".concat(t[2]," {").concat(r,"}"):r})).join("")},t.i=function(e,r,n){"string"==typeof e&&(e=[[null,e,""]]);var i={};if(n)for(var a=0;a<this.length;a++){var s=this[a][0];null!=s&&(i[s]=!0)}for(var o=0;o<e.length;o++){var l=[].concat(e[o]);n&&i[l[0]]||(r&&(l[2]?l[2]="".concat(r," and ").concat(l[2]):l[2]=r),t.push(l))}},t}},46:e=>{var t,r="object"==typeof Reflect?Reflect:null,n=r&&"function"==typeof r.apply?r.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};t=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var i=Number.isNaN||function(e){return e!=e};function a(){a.init.call(this)}e.exports=a,e.exports.once=function(e,t){return new Promise((function(r,n){function i(r){e.removeListener(t,a),n(r)}function a(){"function"==typeof e.removeListener&&e.removeListener("error",i),r([].slice.call(arguments))}f(e,t,a,{once:!0}),"error"!==t&&function(e,t,r){"function"==typeof e.on&&f(e,"error",t,{once:!0})}(e,i)}))},a.EventEmitter=a,a.prototype._events=void 0,a.prototype._eventsCount=0,a.prototype._maxListeners=void 0;var s=10;function o(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function l(e){return void 0===e._maxListeners?a.defaultMaxListeners:e._maxListeners}function c(e,t,r,n){var i,a,s,c;if(o(r),void 0===(a=e._events)?(a=e._events=Object.create(null),e._eventsCount=0):(void 0!==a.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),a=e._events),s=a[t]),void 0===s)s=a[t]=r,++e._eventsCount;else if("function"==typeof s?s=a[t]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(i=l(e))>0&&s.length>i&&!s.warned){s.warned=!0;var d=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");d.name="MaxListenersExceededWarning",d.emitter=e,d.type=t,d.count=s.length,c=d,console&&console.warn&&console.warn(c)}return e}function d(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function h(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=d.bind(n);return i.listener=r,n.wrapFn=i,i}function u(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(i):b(i,i.length)}function p(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function b(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}function f(e,t,r,n){if("function"==typeof e.on)n.once?e.once(t,r):e.on(t,r);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function i(a){n.once&&e.removeEventListener(t,i),r(a)}))}}Object.defineProperty(a,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");s=e}}),a.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},a.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},a.prototype.getMaxListeners=function(){return l(this)},a.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var i="error"===e,a=this._events;if(void 0!==a)i=i&&void 0===a.error;else if(!i)return!1;if(i){var s;if(t.length>0&&(s=t[0]),s instanceof Error)throw s;var o=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw o.context=s,o}var l=a[e];if(void 0===l)return!1;if("function"==typeof l)n(l,this,t);else{var c=l.length,d=b(l,c);for(r=0;r<c;++r)n(d[r],this,t)}return!0},a.prototype.addListener=function(e,t){return c(this,e,t,!1)},a.prototype.on=a.prototype.addListener,a.prototype.prependListener=function(e,t){return c(this,e,t,!0)},a.prototype.once=function(e,t){return o(t),this.on(e,h(this,e,t)),this},a.prototype.prependOnceListener=function(e,t){return o(t),this.prependListener(e,h(this,e,t)),this},a.prototype.removeListener=function(e,t){var r,n,i,a,s;if(o(t),void 0===(n=this._events))return this;if(void 0===(r=n[e]))return this;if(r===t||r.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(i=-1,a=r.length-1;a>=0;a--)if(r[a]===t||r[a].listener===t){s=r[a].listener,i=a;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,i),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,s||t)}return this},a.prototype.off=a.prototype.removeListener,a.prototype.removeAllListeners=function(e){var t,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var i,a=Object.keys(r);for(n=0;n<a.length;++n)"removeListener"!==(i=a[n])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},a.prototype.listeners=function(e){return u(this,e,!0)},a.prototype.rawListeners=function(e){return u(this,e,!1)},a.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):p.call(e,t)},a.prototype.listenerCount=p,a.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},591:(e,t,r)=>{var n,i=function(){var e={};return function(t){if(void 0===e[t]){var r=document.querySelector(t);if(window.HTMLIFrameElement&&r instanceof window.HTMLIFrameElement)try{r=r.contentDocument.head}catch(e){r=null}e[t]=r}return e[t]}}(),a=[];function s(e){for(var t=-1,r=0;r<a.length;r++)if(a[r].identifier===e){t=r;break}return t}function o(e,t){for(var r={},n=[],i=0;i<e.length;i++){var o=e[i],l=t.base?o[0]+t.base:o[0],c=r[l]||0,d="".concat(l," ").concat(c);r[l]=c+1;var h=s(d),u={css:o[1],media:o[2],sourceMap:o[3]};-1!==h?(a[h].references++,a[h].updater(u)):a.push({identifier:d,updater:f(u,t),references:1}),n.push(d)}return n}function l(e){var t=document.createElement("style"),n=e.attributes||{};if(void 0===n.nonce){var a=r.nc;a&&(n.nonce=a)}if(Object.keys(n).forEach((function(e){t.setAttribute(e,n[e])})),"function"==typeof e.insert)e.insert(t);else{var s=i(e.insert||"head");if(!s)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");s.appendChild(t)}return t}var c,d=(c=[],function(e,t){return c[e]=t,c.filter(Boolean).join("\n")});function h(e,t,r,n){var i=r?"":n.media?"@media ".concat(n.media," {").concat(n.css,"}"):n.css;if(e.styleSheet)e.styleSheet.cssText=d(t,i);else{var a=document.createTextNode(i),s=e.childNodes;s[t]&&e.removeChild(s[t]),s.length?e.insertBefore(a,s[t]):e.appendChild(a)}}function u(e,t,r){var n=r.css,i=r.media,a=r.sourceMap;if(i?e.setAttribute("media",i):e.removeAttribute("media"),a&&"undefined"!=typeof btoa&&(n+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(a))))," */")),e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}var p=null,b=0;function f(e,t){var r,n,i;if(t.singleton){var a=b++;r=p||(p=l(t)),n=h.bind(null,r,a,!1),i=h.bind(null,r,a,!0)}else r=l(t),n=u.bind(null,r,t),i=function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(r)};return n(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;n(e=t)}else i()}}e.exports=function(e,t){(t=t||{}).singleton||"boolean"==typeof t.singleton||(t.singleton=(void 0===n&&(n=Boolean(window&&document&&document.all&&!window.atob)),n));var r=o(e=e||[],t);return function(e){if(e=e||[],"[object Array]"===Object.prototype.toString.call(e)){for(var n=0;n<r.length;n++){var i=s(r[n]);a[i].references--}for(var l=o(e,t),c=0;c<r.length;c++){var d=s(r[c]);0===a[d].references&&(a[d].updater(),a.splice(d,1))}r=l}}}},968:(e,t,r)=>{const n=document.querySelector("[nonce]");n&&(r.nc=n.nonce||n.getAttribute("nonce"))}},c={};function d(e){var t=c[e];if(void 0!==t)return t.exports;var r=c[e]={id:e,exports:{}};return l[e](r,r.exports,d),r.exports}d.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return d.d(t,{a:t}),t},d.d=(e,t)=>{for(var r in t)d.o(t,r)&&!d.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},d.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),d.nc=void 0;var h={};(()=>{d.d(h,{AF:()=>Le,M6:()=>ze,RE:()=>Le,Sr:()=>Be,YL:()=>lr,Ay:()=>cr}),d(968);const l=(e=>{var t={};return d.d(t,e),t})({jsx:()=>e.jsx,jsxs:()=>e.jsxs}),c=(e=>{var t={};return d.d(t,e),t})({forwardRef:()=>t.forwardRef,useEffect:()=>t.useEffect,useLayoutEffect:()=>t.useLayoutEffect,useRef:()=>t.useRef,useState:()=>t.useState}),u=(e=>{var t={};return d.d(t,e),t})({observer:()=>r.observer});var p=d(591),b=d.n(p),f=d(371);b()(f.A,{insert:"head",singleton:!1});const m=f.A.locals||{};var v=d(126);b()(v.A,{insert:"head",singleton:!1});const g=v.A.locals||{};var y=d(81);b()(y.A,{insert:"head",singleton:!1});const w=y.A.locals||{},_=(e=>{var t={};return d.d(t,e),t})({default:()=>n.default}),P=({onClick:e,className:t})=>(0,l.jsx)("div",{className:(0,_.default)(w.icon,t),onClick:e,children:(0,l.jsx)("svg",{viewBox:"0 0 24 24",children:(0,l.jsx)("path",{fill:"currentColor",d:"M17.65,6.35C16.2,4.9 14.21,4 12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20C15.73,20 18.84,17.45 19.73,14H17.65C16.83,16.33 14.61,18 12,18A6,6 0 0,1 6,12A6,6 0 0,1 12,6C13.66,6 15.14,6.69 16.22,7.78L13,11H20V4L17.65,6.35Z"})})}),S=(0,u.observer)((e=>{const t=e.needShowErrorScreen,r=e.needShowLoaderScreen;return r||t?(0,l.jsx)("div",{className:(0,_.default)(g.loader),style:Object.assign({"--loader-background":e.background,"--loaderBackgroundColor":e.color},e.style),onClick:e=>{e.preventDefault()},children:t?(0,l.jsx)(P,{className:g["loader__refresh-btn"],onClick:t=>{t.stopPropagation(),e.onReload()}}):r&&(0,l.jsx)("div",{className:g.loader__spinner})}):null})),T=()=>null!==d.nc&&void 0!==d.nc?d.nc:"";class x extends HTMLElement{constructor(){super(...arguments),Object.defineProperty(this,"styleElement",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"banner",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"mountPoint",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"handleClick",{enumerable:!0,configurable:!0,writable:!0,value:e=>{var t;this.shadowRoot&&"true"===this.shadowRoot.host.getAttribute("allow-click")&&(null===(t=this.banner)||void 0===t||t.activeSlide.onClick({event:e,currentTarget:this.shadowRoot.host}))}})}setStyle(e){var t;this.styleElement&&this.styleElement.parentNode&&this.styleElement.parentNode.removeChild(this.styleElement);const r=document.createElement("style");r.textContent=e,r.setAttribute("nonce",T()),this.styleElement=r,null===(t=this.shadowRoot)||void 0===t||t.prepend(r)}async init(e){this.mountPoint&&(this.banner=e,this.mountPoint.addEventListener("click",this.handleClick),await this.banner.attachRoot(this.mountPoint))}destroy(){var e,t;null===(e=this.banner)||void 0===e||e.detachRoot(),null===(t=this.mountPoint)||void 0===t||t.removeEventListener("click",this.handleClick)}connectedCallback(){if(this.shadowRoot)return;const e=this.attachShadow({mode:"open"});this.mountPoint=document.createElement("div"),this.mountPoint.style.height="100%",this.mountPoint.style.width="100%",e.appendChild(this.mountPoint)}disconnectedCallback(){}}function E(e){const t=e.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*[\d.]+)?\)$/i);if(t){const[e,r,n,i]=t.map(Number);return(299*r+587*n+114*i)/1e3>128}if(e.startsWith("#")){const t=e.slice(1);let r,n,i;if(3===t.length)r=parseInt(t[0]+t[0],16),n=parseInt(t[1]+t[1],16),i=parseInt(t[2]+t[2],16);else{if(6!==t.length)return!1;r=parseInt(t.slice(0,2),16),n=parseInt(t.slice(2,4),16),i=parseInt(t.slice(4,6),16)}return(299*r+587*n+114*i)/1e3>128}return!0}customElements.get("bnr-slides-container")||customElements.define("bnr-slides-container",x);const O=(0,u.observer)((0,c.forwardRef)(((e,t)=>{var{banner:r,direction:n="row"}=e,i=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r}(e,["banner","direction"]);const a=(0,c.useRef)(null),s=r.canBeShown;(0,c.useLayoutEffect)((()=>{a.current&&a.current.setStyle(r.context.style)}),[r.context.style]),(0,c.useLayoutEffect)((()=>{if(!a.current)return;const e=a.current;return e.init(r),()=>{e.destroy()}}),[r]),(0,c.useEffect)((()=>{if(i.isActive&&s)return r.start(),()=>{r.stop()}}),[r,i.isActive,s]);const o="row"===n?{height:`${Math.ceil(r.width/r.contentRatio)}px`}:{width:`${Math.ceil(r.height*r.contentRatio)}px`};return(0,l.jsxs)("div",{className:(0,_.default)(m.bnr,"ias-bnr",i.className),ref:t,style:Object.assign(Object.assign({},o),{background:r.appearance.background,"--ias-banner-border-radius":`${i.clientAppearance.borderRadius}px`}),children:[(0,l.jsx)("bnr-slides-container",{style:{opacity:s?1:0},class:m["bnr-slides"],ref:a,"allow-click":i.allowClick.toString(),dir:r.dir}),(0,l.jsx)(S,{needShowErrorScreen:r.needShowErrorScreen,needShowLoaderScreen:r.needShowLoaderScreen,onReload:async()=>{r.activeSlide.restart()},background:r.appearance.background,color:E(r.appearance.background)?"black":"white"})]})})));var j=d(243);b()(j.A,{insert:"head",singleton:!1});const I=j.A.locals||{};var L=d(55);b()(L.A,{insert:"head",singleton:!1});const C=L.A.locals||{},k=e=>{const[t,r]=(0,c.useState)(-1);return(0,c.useEffect)((()=>{e.activeIndex===t&&r(-1)}),[e.activeIndex,t]),e.totalPages>1&&(0,l.jsx)("div",{dir:e.langDirection,className:(0,_.default)(C["slider-bullets"],{[C["slider-bullets--vertical"]]:"column"===e.direction},"ias-bnr-bullets"),children:Array.from({length:e.totalPages}).map(((t,n)=>(0,l.jsx)("div",{className:(0,_.default)("ias-bnr__bullet",C["slider-bullets__bullet"],{[C["slider-bullets__bullet--active"]]:n===e.activeIndex,"ias-bnr__bullet--active":n===e.activeIndex}),onClick:()=>(t=>{r(t),e.onClick(t)})(n)},n)))})};var A=d(41);b()(A.A,{insert:"head",singleton:!1});const B=A.A.locals||{};var M=d(379);b()(M.A,{insert:"head",singleton:!1});const R=M.A.locals||{},D=e=>(0,l.jsxs)("div",{className:(0,_.default)(R.slider__controls,{[R["slider__controls--vertical"]]:"column"===e.direction}),children:[(0,l.jsx)("button",{onClick:e.onPrevClick,className:(0,_.default)("ias-bnr__controls-btn","ias-bnr__controls-btn--prev","ias-bnr__controls-btn--start",R["slider__controls-btn"],R["slider__controls-btn--start"],{[R["slider__controls-btn--disabled"]]:e.prevDisabled,[R["slider__controls-btn--dir--rtl"]]:"rtl"===e.langDirection,"ias-bnr__controls-btn--disabled":e.prevDisabled}),children:(0,l.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",children:(0,l.jsx)("path",{d:"M0 12l10.975 11 2.848-2.828-6.176-6.176H24v-3.992H7.646l6.176-6.176L10.975 1 0 12z",fill:"currentColor"})})}),(0,l.jsx)("button",{onClick:e.onNextClick,className:(0,_.default)("ias-bnr__controls-btn","ias-bnr__controls-btn--next","ias-bnr__controls-btn--end",R["slider__controls-btn"],R["slider__controls-btn--end"],{[R["slider__controls-btn--disabled"]]:e.nextDisabled,[R["slider__controls-btn--dir--rtl"]]:"rtl"===e.langDirection,"ias-bnr__controls-btn--disabled":e.nextDisabled}),children:(0,l.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",children:(0,l.jsx)("path",{d:"M13.025 1l-2.847 2.828 6.176 6.176h-16.354v3.992h16.354l-6.176 6.176 2.847 2.828 10.975-11z",fill:"currentColor"})})})]});class N{constructor(e){Object.defineProperty(this,"slider",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_enabled",{enumerable:!0,configurable:!0,writable:!0,value:!1})}get enabled(){return this._enabled}update(){const e=this.slider.options.loop&&this.canUseLoop();this._enabled?e||(this._enabled=!1,this.destroy()):e&&(this._enabled=!0)}applyLoopFix({targetIndex:e,direction:t}){if(!this.enabled)return!1;const r="next"===t||!t,n="prev"!==t&&t?[]:this.getPrependSlidesIndexes(e),i=r?this.getAppendSlidesIndexes(e):[];return this.moveSlides(n,i),this.adjustPosition(n,i),n.length>0||i.length>0}destroy(){this.resetSlidesOrder()}resetSlidesOrder(){const e=[];this.slider.slides.forEach((t=>{const r=+t.dataset.index;e[r]=t})),e.forEach((e=>{this.slider.track.append(e)}))}canUseLoop(){return!(this.slider.slides.length<this.slider.options.slidesPerView+1&&(console.warn("IAS Banners Loop Warning: The number of slides is not enough for loop mode, it will be disabled or not function properly. You need to add more slides (or make duplicates) or lower the values of slidesPerView parameters"),1))}getPrependSlidesIndexes(e){const t=this.slider.track.children,r=[];if(e<1)for(let n=0;n<1-e;n++){const e=t.length-n-1;r.push(e)}return r}getAppendSlidesIndexes(e){const t=[];if(e+this.slider.options.slidesPerView>this.slider.slides.length-1){const r=Math.max(e-(this.slider.slides.length-2),1);for(let e=0;e<r;e++){const r=e;t.push(r)}}return t}moveSlides(e,t){const r=this.slider.track,n=this.slider.slides.slice();e.forEach((e=>{r.prepend(n[e])})),t.forEach((e=>{r.append(n[e])}))}adjustPosition(e,t){e.length>0?this.slider.slideTo(this.slider.activeIndex+e.length,0):t.length>0&&this.slider.slideTo(this.slider.activeIndex-t.length,0)}}var z;!function(e){e.TouchStart="touchStart",e.TouchMove="touchMove",e.TouchEnd="touchEnd",e.ReachStart="reachStart",e.ReachEnd="reachEnd",e.ActiveIndexChange="activeIndexChange",e.RealIndexChnage="realIndexChange",e.TransitionStart="transitionStart",e.TransitionEnd="transitionend",e.Resize="resize",e.SlidesUpdated="slidesUpdated",e.AutoplayTimeLeft="autoplayTimeLeft",e.AutoplayTimerTick="autoplayTimerTick"}(z||(z={}));class W{constructor(e,t){Object.defineProperty(this,"slider",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"loopModule",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"startPosition",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"startTranslate",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"isTouched",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_isMoved",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_enabled",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"startDirection",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"onTouchStart",{enumerable:!0,configurable:!0,writable:!0,value:e=>{if(this.slider.animating||!this._enabled)return;e.stopPropagation();const{startPosition:t,startTranslate:r}=this.getTouchStartState(e);this.startPosition=t,this.startTranslate=r,this.isTouched=!0,this.setGrabCursor(!1),this.slider.autoplay.pause()}}),Object.defineProperty(this,"onTouchMove",{enumerable:!0,configurable:!0,writable:!0,value:e=>{if(!this.isTouched)return;e.stopPropagation();const t=this.getTouchDiff(e);if(!(Math.abs(t)>20||this._isMoved))return;this.setGrabCursor(!0),this._isMoved||(this.slider.emit(z.TouchStart),this.slider.autoplay.pause(),this.slider.lockActiveIndex(),this.startDirection=this.getSwipeDirection(t)),this._isMoved=!0;const r="next"===this.startDirection?20:-20;this.slider.emit(z.TouchMove);let n=this.startTranslate+t+r;this.applyLoopFix(n),n=this.startTranslate+t+r,this.setTranslate(n)}}),Object.defineProperty(this,"onTouchEnd",{enumerable:!0,configurable:!0,writable:!0,value:()=>{this.isTouched&&(this.slider.unlockActiveIndex(),this.updateActiveIndex(),this.unsetGrabCursor(),this.isTouched=!1,this._isMoved=!1,this.slider.emit(z.TouchEnd),this.slider.autoplay.resume())}}),this.slider.track.addEventListener("mousedown",this.onTouchStart,{passive:!0}),document.addEventListener("mousemove",this.onTouchMove,{passive:!0}),document.addEventListener("mouseup",this.onTouchEnd),this.slider.track.addEventListener("touchstart",this.onTouchStart,{passive:!0}),document.addEventListener("touchmove",this.onTouchMove,{passive:!0}),document.addEventListener("touchend",this.onTouchEnd)}get isMoved(){return this._isMoved}enable(){this._enabled=!0}disable(){this._enabled=!1}enableHorizontalSwipeGesture(){this._enabled=!0}disableHorizontalSwipeGesture(){this._enabled=!1}enableVerticalSwipeGesture(){this._enabled=!0}disableVerticalSwipeGesture(){this._enabled=!1}destroy(){this.slider.track.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd),this.slider.track.removeEventListener("mousedown",this.onTouchStart),document.removeEventListener("mousemove",this.onTouchMove),document.removeEventListener("mouseup",this.onTouchEnd)}getTouchStartState(e){let t=0,r=0;return"row"===this.slider.options.direction?(t=e instanceof MouseEvent?e.pageX:e.touches[0].clientX,r=this.slider.currentTranslateX):(t=e instanceof MouseEvent?e.pageY:e.touches[0].clientY,r=this.slider.currentTranslateY),{startPosition:t,startTranslate:r}}getTouchDiff(e){let t=0;return"row"===this.slider.options.direction?(t=(e instanceof MouseEvent?e.pageX:e.touches[0].clientX)-this.startPosition,t*=1):(t=(e instanceof MouseEvent?e.pageY:e.touches[0].clientY)-this.startPosition,t*=1),t}setTranslate(e){e=this.applyEdgeResistance(e),this.slider.setTranslate(e)}applyLoopFix(e){if(!this.loopModule.enabled)return;e=this.slider.langDirSign*-e;const t=this.slider.langDirSign*(this.slider.slideSize+this.slider.options.spaceBetween),r=this.slider.getMinTranslate(),n=Math.abs(this.slider.getSlideOffset(this.slider.slides.length-this.slider.options.slidesPerView));e<r?this.loopModule.applyLoopFix({targetIndex:0,direction:"prev"})&&(this.startTranslate-=t):e>n&&this.loopModule.applyLoopFix({targetIndex:this.slider.slides.length-this.slider.options.slidesPerView,direction:"next"})&&(this.startTranslate+=t)}updateActiveIndex(){if(!this.slider.slides.length)return;const{currentTranslate:e,options:t}=this.slider,r=this.slider.slideSize+t.spaceBetween;let n=this.slider.langDirSign*-Math.round(e/r);const i=this.slider.totalPages-1;n=Math.min(i,Math.max(0,n)),this.slider.slideTo(n)}setGrabCursor(e){this.slider.track.style.cursor="move",this.slider.track.style.cursor=e?"grabbing":"grab"}unsetGrabCursor(){this.slider.track.style.cursor=""}getResistanceCoeff(e){const t=Math.min(Math.abs(e)/(.5*this.slider.slideSize),1);return.3+.7*Math.exp(3*-t)}applyEdgeResistance(e){if(this.loopModule.enabled)return e;const t=this.slider.langDirSign,r=-t*e,n=this.slider.getMinTranslate(),i=this.slider.getMaxTranslate();let a=r;if(a>i){const e=a-i;a=i+e*this.getResistanceCoeff(e)}else if(a<n){const e=n-a;a=n-e*this.getResistanceCoeff(e)}return-t*a}getSwipeDirection(e){return this.slider.langDirSign*e>0?"prev":"next"}}var F,V=d(46);!function(e){e.Start="start",e.Stop="stop",e.Pause="pause",e.Resume="resume",e.Progress="progress",e.Complete="complete"}(F||(F={}));class U extends V.EventEmitter{constructor(){super(...arguments),Object.defineProperty(this,"timerId",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"currentProgress",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"progressBeforePause",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"timerPaused",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"timeout",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"isCompleted",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"enabled",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"rafId",{enumerable:!0,configurable:!0,writable:!0,value:0})}get started(){return!this.isCompleted}get paused(){return this.timerPaused}setTimer(e){0!==e?(this.timerId=setTimeout((()=>this.complete({})),e),this.currentProgress=0,this.runTimerTicks(e)):this.forceEnd()}start(e){this.timerPaused||(this.stop(),this.progressBeforePause=0,this.timeout=e,this.enabled&&(this.isCompleted=!1,this.emit(F.Start),this.setTimer(e)))}restart(){this.stop(),this.start(this.timeout)}stop(){this.isCompleted||(this.clearTimer(),this.emit(F.Stop),this.isCompleted=!0,this.timerPaused=!1)}pause(){this.isCompleted||(this.timerPaused=!0,this.clearTimer(),this.progressBeforePause=this.currentProgress,this.emit(F.Pause))}resume(){if(!this.timerPaused)return;this.timerPaused=!1;const e=1-this.progressBeforePause,t=this.timeout*e;this.setTimer(t),this.emit(F.Resume)}forceEnd(){this.complete({forceEnd:!0})}disable(){this.enabled=!1,this.stop()}enable(){this.enabled=!0,this.start(this.timeout)}complete({forceEnd:e=!1}){this.isCompleted=!0,this.progressBeforePause=0,this.clearTimer(),this.emit(F.Complete,{forceEnd:e})}clearTimer(){cancelAnimationFrame(this.rafId),null!==this.timerId&&(clearTimeout(this.timerId),this.timerId=null)}updateProgress(e){const t=1-this.progressBeforePause;this.currentProgress=this.progressBeforePause+e*t;const r=100*this.currentProgress;this.emit(F.Progress,{percents:r,totalTime:this.timeout,currentTime:this.currentProgress*this.timeout})}runTimerTicks(e){const t=performance.now(),r=n=>{let i=(n-t)/e;i>1&&(i=1);const a=i;this.updateProgress(a),i<1&&(this.rafId=requestAnimationFrame(r))};this.rafId=requestAnimationFrame(r)}}class q{constructor(e,t){Object.defineProperty(this,"slider",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"loopModule",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"timer",{enumerable:!0,configurable:!0,writable:!0,value:new U}),Object.defineProperty(this,"delay",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"handleTimerComplete",{enumerable:!0,configurable:!0,writable:!0,value:({forceEnd:e})=>{e||this.slider.emit(z.AutoplayTimeLeft)}}),Object.defineProperty(this,"handleTimerProgress",{enumerable:!0,configurable:!0,writable:!0,value:e=>{this.slider.emit(z.AutoplayTimerTick,{currentTime:e.currentTime,totalTime:e.totalTime,percents:e.percents})}}),this.timer.on(F.Complete,this.handleTimerComplete),this.timer.on(F.Progress,this.handleTimerProgress)}get paused(){return this.timer.paused}start(){this.slider.options.autoplay&&(this.stop(),this.timer.start(this.delay))}stop(){this.timer.stop()}pause(){this.slider.options.autoplay&&this.timer.pause()}resume(){this.slider.options.autoplay&&this.timer.resume()}setDelay(e){this.delay=e}destroy(){this.timer.off(F.Complete,this.handleTimerComplete),this.timer.off(F.Progress,this.handleTimerProgress),this.stop()}}class H extends V.EventEmitter{constructor(e,t={}){super(),Object.defineProperty(this,"track",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"container",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"options",{enumerable:!0,configurable:!0,writable:!0,value:{autoplay:!1,speed:300,delay:3e3,loop:!1,slidesPerView:1,spaceBetween:0,initialSlide:0,updateOnWindowResize:!0,direction:"row",langDirection:"ltr",allowTouchMove:!0}}),Object.defineProperty(this,"isAnimating",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_activeIndex",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_realIndex",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_currentTranslateX",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_currentTranslateY",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_reachEnd",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"_reachStart",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"loopModule",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"touchModule",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_slideWidth",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_slideHeight",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"autoplay",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_activeIndexLocked",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"handleResize",{enumerable:!0,configurable:!0,writable:!0,value:()=>{this.updateSize(),this.emit(z.Resize)}}),this.track=e,this.container=e.parentElement,this.loopModule=new N(this),this.touchModule=new W(this,this.loopModule),this.autoplay=new q(this,this.loopModule),this.options.updateOnWindowResize&&window.addEventListener("resize",this.handleResize),this.collectSlides(),this.update(t)}get langDirSign(){return"column"===this.options.direction||"ltr"===this.options.langDirection?1:-1}get activeIndex(){return this._activeIndex}get realIndex(){return this._realIndex}get reachEnd(){return this._reachEnd}get reachStart(){return this._reachStart}get slidesEl(){return this.track}get slides(){return Array.from(this.track.children)}get allSlides(){return this.slides}get animating(){return this.isAnimating}get currentTranslateX(){return this._currentTranslateX}get currentTranslateY(){return this._currentTranslateY}get currentTranslate(){return"row"===this.options.direction?this._currentTranslateX:this._currentTranslateY}get isMoved(){return this.touchModule.isMoved}get slideWidth(){return this._slideWidth}get slideHeight(){return this._slideHeight}get slideSize(){return"row"===this.options.direction?this.slideWidth:this.slideHeight}get totalPages(){return this.loopModule.enabled?this.slides.length:Math.max(this.slides.length-this.options.slidesPerView+1,1)}async slideToLoop(e,t=this.options.speed){if(!this.loopModule.enabled)return this.slideTo(e,t);if(this.isAnimating)return;const r=this.getPhysicalIndexByRealIndex(e),n=this.slides.length-r<this.options.slidesPerView,i=r-this._activeIndex-1<this.options.slidesPerView?"next":"prev";if(n){const e="next"===i?r+1:r-this.slides.length+1;this.loopModule.applyLoopFix({targetIndex:e,direction:i})}const a=this.getPhysicalIndexByRealIndex(e);requestAnimationFrame((()=>this.slideTo(a)))}async slideTo(e,t=this.options.speed){e=this.clamp(e,0,this.totalPages-1),this.isAnimating||(this.isAnimating=!0,await this.performTranslateToSlide(e,t),this._activeIndexLocked||this.updateIndexes(e),this.isAnimating=!1)}lockActiveIndex(){this._activeIndexLocked=!0}unlockActiveIndex(){this._activeIndexLocked=!1}toNextSlide(){this.isAnimating||(this.loopModule.enabled?this.toNextSlideByLoop():this.slideTo(this.normalizeIndex(this._realIndex+1)))}toPrevSlide(){this.isAnimating||(this.loopModule.enabled?this.toPrevSlideByLoop():this.slideTo(this.normalizeIndex(this._realIndex-1)))}update(e){this.options=this.normalizeOptions(Object.assign(Object.assign({},this.options),e)),this.setupTrackStyles(),this.updateSize(),this.loopModule.update(),this.testAttraction(),this.options.allowTouchMove?this.touchModule.enable():this.touchModule.disable()}destroy(){window.removeEventListener("resize",this.handleResize),this.autoplay.destroy(),this.touchModule.destroy(),this.track.removeAttribute("style"),this._activeIndex=0,this._activeIndexLocked=!1,this.isAnimating=!1}isSlideVisible(e){const t=this.getPhysicalIndexByRealIndex(e);return t>=this._activeIndex&&t<this._activeIndex+this.options.slidesPerView}getVisibleSlideIndexes(){return this.slides.slice(this._activeIndex,this._activeIndex+this.options.slidesPerView).map((e=>+e.dataset.index))}getPhysicalIndexByRealIndex(e){const t=this.normalizeIndex(e);return this.slides.findIndex((e=>e.dataset.index===t.toString()))}getMinTranslate(){return 0}getMaxTranslate(){return Math.abs(this.getSlideOffset(this.totalPages-1))}setTranslate(e){"row"===this.options.direction?(this.track.style.transform=`translate3d(${e}px, 0px, 0px)`,this._currentTranslateX=e,this._currentTranslateY=0):(this.track.style.transform=`translate3d(0px, ${e}px, 0px)`,this._currentTranslateX=0,this._currentTranslateY=e),this.testAttraction()}enableHorizontalSwipeGesture(){this.touchModule.enableHorizontalSwipeGesture()}disableHorizontalSwipeGesture(){this.touchModule.disableHorizontalSwipeGesture()}getSlideOffset(e){return this.slides.length?-e*(("row"===this.options.direction?this.slides[0].clientWidth:this.slides[0].clientHeight)+this.options.spaceBetween):0}updateSize(){const e=this.slideWidth,t=this.slideHeight;"row"===this.options.direction?this.calculateSlideWidths():this.calculateSlideHeight(),e===this.slideWidth&&t===this.slideHeight||this.emit(z.SlidesUpdated),this.slideTo(this._activeIndex,0)}getTrackWidth(){return this.track.clientWidth-this.options.spaceBetween*(this.options.slidesPerView-1)}getTrackHeight(){return this.track.clientHeight-this.options.spaceBetween*(this.options.slidesPerView-1)}toNextSlideByLoop(){this.isAnimating||(this.loopModule.applyLoopFix({targetIndex:this._activeIndex,direction:"next"}),requestAnimationFrame((()=>this.slideTo(this._activeIndex+1))))}toPrevSlideByLoop(){this.isAnimating||(this.loopModule.applyLoopFix({targetIndex:this._activeIndex,direction:"prev"}),requestAnimationFrame((()=>this.slideTo(this._activeIndex-1))))}updateIndexes(e){if(!this.slides.length)return;const t=+this.slides[e].dataset.index,r=this._realIndex,n=this._activeIndex;this._realIndex=t,this._activeIndex=e,r!==t&&this.emit(z.RealIndexChnage,t),n!==e&&this.emit(z.ActiveIndexChange,e)}setupTrackStyles(){Object.assign(this.track.style,{display:"flex",transition:`transform ${this.options.speed}ms ease`,gap:`${this.options.spaceBetween}px`})}collectSlides(){this.slides.forEach(((e,t)=>{e.dataset.index=t.toString()}))}calculateSlideWidths(){this._slideWidth=Math.ceil(this.getTrackWidth()/this.options.slidesPerView),this.slides.forEach((e=>{e.style.width=`${this._slideWidth}px`,e.style.height=""}))}calculateSlideHeight(){this._slideHeight=Math.ceil(this.getTrackHeight()/this.options.slidesPerView),this.slides.forEach((e=>{e.style.height=`${this._slideHeight}px`,e.style.width=""}))}translateSlidesTrack(e,t){this.track.style.transitionDuration=`${t}ms`,this.setTranslate(this.langDirSign*this.getSlideOffset(e))}async performTranslateToSlide(e,t){if(0===t)this.translateSlidesTrack(e,0);else{if(this._activeIndex===e&&!this.touchModule.isMoved)return;this.translateSlidesTrack(e,t),this.emit(z.TransitionStart),await this.waitTransitionEnd(),this.emit(z.TransitionEnd)}}waitTransitionEnd(){return new Promise((e=>{this.track.addEventListener("transitionend",(t=>{"transform"===t.propertyName&&(this.track.style.transitionDuration="0ms",e())}),{once:!0})}))}testAttraction(){const e=this.getMinTranslate(),t=this.getMaxTranslate();let r=!this.loopModule.enabled&&this.langDirSign*this.currentTranslate>=e,n=!this.loopModule.enabled&&this.langDirSign*-this.currentTranslate>=t;this.options.slidesPerView===this.slides.length&&(r=!0,n=!0),r!==this._reachStart&&(this._reachStart=r,this.emit(z.ReachStart,r)),n!==this._reachEnd&&(this._reachEnd=n,this.emit(z.ReachEnd,n))}normalizeOptions(e){var t,r,n,i,a,s,o,l,c,d,h;return{autoplay:null!==(t=e.autoplay)&&void 0!==t?t:this.options.autoplay,speed:null!==(r=e.speed)&&void 0!==r?r:this.options.speed,delay:null!==(n=e.delay)&&void 0!==n?n:this.options.delay,loop:null!==(i=e.loop)&&void 0!==i?i:this.options.loop,slidesPerView:Math.max(Math.min(this.track.children.length,null!==(a=e.slidesPerView)&&void 0!==a?a:this.options.slidesPerView),0),spaceBetween:null!==(s=e.spaceBetween)&&void 0!==s?s:this.options.spaceBetween,initialSlide:null!==(o=e.initialSlide)&&void 0!==o?o:this.options.initialSlide,updateOnWindowResize:null!==(l=e.updateOnWindowResize)&&void 0!==l?l:this.options.updateOnWindowResize,direction:null!==(c=e.direction)&&void 0!==c?c:this.options.direction,allowTouchMove:null!==(d=e.allowTouchMove)&&void 0!==d?d:this.options.allowTouchMove,langDirection:null!==(h=e.langDirection)&&void 0!==h?h:this.options.langDirection}}normalizeIndex(e){const t=this.slides.length;return(e%t+t)%t}clamp(e,t,r){return Math.max(t,Math.min(e,r))}}const $=(0,u.observer)((e=>{const[t,r]=(0,c.useState)(null),n=(0,c.useRef)(null);return(0,c.useEffect)((()=>{if(!n.current||!e.slidesCount)return;const t=new H(n.current,{autoplay:e.autoplay,speed:e.speed,loop:e.loop,slidesPerView:e.slidesPerView,spaceBetween:e.spaceBetween,allowTouchMove:e.allowTouchMove,direction:e.direction,langDirection:e.langDirection});return e.onInit(t),r(t),()=>{null==t||t.destroy()}}),[e.slidesCount]),(0,c.useEffect)((()=>{t&&t.update({autoplay:e.autoplay,speed:e.speed,loop:e.loop,slidesPerView:e.slidesPerView,spaceBetween:e.spaceBetween,allowTouchMove:e.allowTouchMove,direction:e.direction,langDirection:e.langDirection})}),[t,e.autoplay,e.speed,e.loop,e.langDirection,e.slidesPerView,e.spaceBetween,e.slidesCount,e.allowTouchMove,e.direction]),(0,l.jsxs)("div",{className:(0,_.default)("ias-bnr-slider",B.slider,{[B["slider--vertical"]]:"column"===e.direction}),children:[(0,l.jsx)("div",{dir:e.langDirection,ref:n,className:(0,_.default)("ias-bnr-slider__track",B.slider__track),children:e.children}),t&&e.pagination.enabled&&(0,l.jsx)(k,{direction:e.direction,langDirection:e.langDirection,totalPages:t.totalPages,activeIndex:t.realIndex,onClick:r=>{e.loop?t.slideToLoop(r):t.slideTo(r)}}),t&&e.navigation.enabled&&(0,l.jsx)(D,{direction:e.direction,langDirection:e.langDirection,onPrevClick:()=>{t.toPrevSlide()},onNextClick:()=>{t.toNextSlide()},nextDisabled:t.reachEnd,prevDisabled:t.reachStart})]})})),G=e=>(0,l.jsx)("div",{className:(0,_.default)(B.slider__slide,e.className),style:e.style,children:e.children});class X{constructor(e){Object.defineProperty(this,"slider",{enumerable:!0,configurable:!0,writable:!0,value:e})}isPaused(){return this.slider.autoplay.paused}resume(){this.slider.autoplay.resume()}pause(){this.slider.autoplay.pause()}start(){this.slider.autoplay.start()}setDelay(e){this.slider.autoplay.setDelay(e)}stop(){this.slider.autoplay.stop()}}class Y{constructor(e){Object.defineProperty(this,"slider",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"autoplay",{enumerable:!0,configurable:!0,writable:!0,value:new X(this.slider)})}getTotalPages(){return this.slider.totalPages}getActiveIndex(){return this.slider.realIndex}toNextSlide(){this.slider.isMoved||this.slider.toNextSlide()}toPrevSlide(){this.slider.isMoved||this.slider.toPrevSlide()}slideTo(e,t){this.slider.isMoved||this.slider.slideToLoop(e,t)}enableHorizontalSwipeGesture(){this.slider.enableHorizontalSwipeGesture()}disableHorizontalSwipeGesture(){this.slider.disableHorizontalSwipeGesture()}updateSize(){this.slider.updateSize()}}const Q=(e=>{var t={};return d.d(t,e),t})({action:()=>i.action,computed:()=>i.computed,observable:()=>i.observable,reaction:()=>i.reaction});var K=function(e,t,r){for(var n=arguments.length>2,i=0;i<t.length;i++)r=n?t[i].call(e,r):t[i].call(e);return n?r:void 0};let J=(()=>{var e,t;let r,n=[],i=[];return e=class{get _context(){return function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)}(this,t,"f")}set _context(e){!function(e,t,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");"a"===n?i.call(e,r):i?i.value=r:t.set(e,r)}(this,t,e,"f")}constructor(e){t.set(this,K(this,n,void 0)),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:K(this,i)}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"displayFrom",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"displayTo",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"appearance",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"slides",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_wasShown",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_frequencyLimit",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_openTime",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_isOnceOpened",{enumerable:!0,configurable:!0,writable:!0,value:!1}),this.id=e.id,this.name=e.name,this.displayFrom=e.displayFrom,this.displayTo=e.displayTo,this.slides=e.slides,this._context=e.context,this.appearance=e.appearance}get context(){return this._context}get withinDisplayTimeRange(){const e=Math.trunc(Date.now()/1e3);return(!this.displayFrom||e>=this.displayFrom)&&(!this.displayTo||e<=this.displayTo)}get wasShown(){return this._wasShown}get frequencyLimitTimeExceeded(){return null===this._frequencyLimit?this._isOnceOpened:0!==this._frequencyLimit&&Math.trunc(this.timeSinceLastShow/1e3)<=this._frequencyLimit}get timeSinceLastShow(){return Date.now()-this._openTime}get openTime(){return this._openTime}updatePlaceholders(e){for(const t of this.slides)t.updatePlaceholders(e)}markWasShown(){this._wasShown=!0}markAsOpened(){this._openTime=Date.now(),this._isOnceOpened=!0}},t=new WeakMap,(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;r=[Q.observable],function(e,t,r,n,i,a){function s(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var o,l=n.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?n.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,n.name):{}),u=!1,p=r.length-1;p>=0;p--){var b={};for(var f in n)b[f]="access"===f?{}:n[f];for(var f in n.access)b.access[f]=n.access[f];b.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(s(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],b);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(o=s(m.get))&&(h.get=o),(o=s(m.set))&&(h.set=o),(o=s(m.init))&&i.unshift(o)}else(o=s(m))&&("field"===l?i.unshift(o):h[c]=o)}d&&Object.defineProperty(d,n.name,h),u=!0}(e,null,r,{kind:"accessor",name:"_context",static:!1,private:!1,access:{has:e=>"_context"in e,get:e=>e._context,set:(e,t)=>{e._context=t}},metadata:t},n,i),t&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),e})();class Z{constructor(e){var t;Object.defineProperty(this,"contentRatio",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"background",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.contentRatio=null!==(t=e.content_ratio)&&void 0!==t?t:1,this.background=this.mapBackgroundDtoToModel(e.background)}mapBackgroundDtoToModel(e){if(!e||0===e.alpha)return"transparent";if("solid"in e)return this.applyAlphaToColor(e.solid,e.alpha);if("linear_gradient"in e){const{angle:t,color_step_list:r}=e.linear_gradient;return`linear-gradient(${t}deg, ${r.map((t=>`${this.applyAlphaToColor(t.color,e.alpha)} ${t.position}%`)).join(", ")})`}return"transparent"}applyAlphaToColor(e,t){if(e.startsWith("#")){const r=e.slice(1),n=3===r.length;return`rgba(${parseInt(n?r[0]+r[0]:r.slice(0,2),16)}, ${parseInt(n?r[1]+r[1]:r.slice(2,4),16)}, ${parseInt(n?r[2]+r[2]:r.slice(4,6),16)}, ${t})`}return e}}class ee{constructor(e,t){Object.defineProperty(this,"widgetsData",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"style",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.style=t.style,this.widgetsData=this.mapBannerContextDto(e,t)}mapBannerContextDto(e,t){var r;const n={},i=null!==(r=t.widgetsData)&&void 0!==r?r:{};for(const t in i)Array.isArray(i[t])||(n[t]=i[t][e]);return n}updateNarrativeSavedData(e){this.widgetsData._narrative_saved_data=e}}function te(e,t,r){return String(e).replace(new RegExp(function(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(t),"g"),(()=>r))}var re=function(e,t,r){for(var n=arguments.length>2,i=0;i<t.length;i++)r=n?t[i].call(e,r):t[i].call(e);return n?r:void 0};let ne=(()=>{var e,t;let r,n=[],i=[];return e=class{get _html(){return function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)}(this,t,"f")}set _html(e){!function(e,t,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");"a"===n?i.call(e,r):i?i.value=r:t.set(e,r)}(this,t,e,"f")}get html(){return this._html}get payload(){return this._payload}constructor(e){t.set(this,re(this,n,void 0)),Object.defineProperty(this,"_payload",{enumerable:!0,configurable:!0,writable:!0,value:re(this,i)}),this._html=this.replaceSlideNonce(e.html),this._payload=e.payload}updatePlaceholders(e){let t=this._html;for(const r of e)t=te(t,`%${r.key}%`,r.value);this._html=t}replaceSlideNonce(e){var t;return te(e,"{{nonce}}",null!==(t=T())&&void 0!==t?t:"")}},t=new WeakMap,(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;r=[Q.observable],function(e,t,r,n,i,a){function s(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var o,l=n.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?n.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,n.name):{}),u=!1,p=r.length-1;p>=0;p--){var b={};for(var f in n)b[f]="access"===f?{}:n[f];for(var f in n.access)b.access[f]=n.access[f];b.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(s(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],b);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(o=s(m.get))&&(h.get=o),(o=s(m.set))&&(h.set=o),(o=s(m.init))&&i.unshift(o)}else(o=s(m))&&("field"===l?i.unshift(o):h[c]=o)}d&&Object.defineProperty(d,n.name,h),u=!0}(e,null,r,{kind:"accessor",name:"_html",static:!1,private:!1,access:{has:e=>"_html"in e,get:e=>e._html,set:(e,t)=>{e._html=t}},metadata:t},n,i),t&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),e})();var ie=function(e,t,r){for(var n=arguments.length>2,i=0;i<t.length;i++)r=n?t[i].call(e,r):t[i].call(e);return n?r:void 0};let ae=(()=>{var e,t;let r,n=[],i=[];return e=class{get _banners(){return function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)}(this,t,"f")}set _banners(e){!function(e,t,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");"a"===n?i.call(e,r):i?i.value=r:t.set(e,r)}(this,t,e,"f")}constructor(e){Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"style",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),t.set(this,ie(this,n,[])),ie(this,i),this.id=e.id,this._banners=e.banners,this.style=e.style,this.updatePlaceholders(e.placeholders)}get banners(){return this._banners}updatePlaceholders(e){for(const t of this._banners)t.updatePlaceholders(e)}},t=new WeakMap,(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;r=[Q.observable],function(e,t,r,n,i,a){function s(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var o,l=n.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?n.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,n.name):{}),u=!1,p=r.length-1;p>=0;p--){var b={};for(var f in n)b[f]="access"===f?{}:n[f];for(var f in n.access)b.access[f]=n.access[f];b.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(s(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],b);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(o=s(m.get))&&(h.get=o),(o=s(m.set))&&(h.set=o),(o=s(m.init))&&i.unshift(o)}else(o=s(m))&&("field"===l?i.unshift(o):h[c]=o)}d&&Object.defineProperty(d,n.name,h),u=!0}(e,null,r,{kind:"accessor",name:"_banners",static:!1,private:!1,access:{has:e=>"_banners"in e,get:e=>e._banners,set:(e,t)=>{e._banners=t}},metadata:t},n,i),t&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),e})();const se=(e,t)=>{if("number"==typeof e)return e;if("string"==typeof e){const t=parseFloat(e);if(!isNaN(t))return t}return t};var oe=function(e,t,r,n,i,a){function s(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var o,l=n.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?n.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,n.name):{}),u=!1,p=r.length-1;p>=0;p--){var b={};for(var f in n)b[f]="access"===f?{}:n[f];for(var f in n.access)b.access[f]=n.access[f];b.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(s(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],b);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(o=s(m.get))&&(h.get=o),(o=s(m.set))&&(h.set=o),(o=s(m.init))&&i.unshift(o)}else(o=s(m))&&("field"===l?i.unshift(o):h[c]=o)}d&&Object.defineProperty(d,n.name,h),u=!0},le=function(e,t,r){for(var n=arguments.length>2,i=0;i<t.length;i++)r=n?t[i].call(e,r):t[i].call(e);return n?r:void 0},ce=function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)},de=function(e,t,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(e,r):i?i.value=r:t.set(e,r),r};let he=(()=>{var e,t;let r,n=[],i=[];return e=class{get borderRadius(){return ce(this,t,"f")}set borderRadius(e){de(this,t,e,"f")}update(e){this.borderRadius=se(null==e?void 0:e.borderRadius,this.borderRadius)}constructor(){t.set(this,le(this,n,12)),le(this,i)}},t=new WeakMap,(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;r=[Q.observable],oe(e,null,r,{kind:"accessor",name:"borderRadius",static:!1,private:!1,access:{has:e=>"borderRadius"in e,get:e=>e.borderRadius,set:(e,t)=>{e.borderRadius=t}},metadata:t},n,i),t&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),e})(),ue=(()=>{var e,t,r,n,i,a,s,o,l,c;let d,h,u,p,b,f,m,v,g,y=[],w=[],_=[],P=[],S=[],T=[],x=[],E=[],O=[],j=[],I=[],L=[],C=[],k=[],A=[],B=[],M=[],R=[];return e=class{get loop(){return ce(this,t,"f")}set loop(e){de(this,t,e,"f")}get gap(){return ce(this,r,"f")}set gap(e){de(this,r,e,"f")}get autoplay(){return ce(this,n,"f")}set autoplay(e){de(this,n,e,"f")}get animationSpeed(){return ce(this,i,"f")}set animationSpeed(e){de(this,i,e,"f")}get slidesPerView(){return ce(this,a,"f")}set slidesPerView(e){de(this,a,e,"f")}get navigation(){return ce(this,s,"f")}set navigation(e){de(this,s,e,"f")}get pagination(){return ce(this,o,"f")}set pagination(e){de(this,o,e,"f")}get direction(){return ce(this,l,"f")}set direction(e){de(this,l,e,"f")}get allowTouchMove(){return ce(this,c,"f")}set allowTouchMove(e){de(this,c,e,"f")}constructor(e){t.set(this,le(this,y,!0)),r.set(this,(le(this,w),le(this,_,16))),n.set(this,(le(this,P),le(this,S,!0))),i.set(this,(le(this,T),le(this,x,300))),a.set(this,(le(this,E),le(this,O,1))),s.set(this,(le(this,j),le(this,I,{enabled:!0}))),o.set(this,(le(this,L),le(this,C,{enabled:!0}))),l.set(this,(le(this,k),le(this,A,"row"))),c.set(this,(le(this,B),le(this,M,!0))),Object.defineProperty(this,"banner",{enumerable:!0,configurable:!0,writable:!0,value:(le(this,R),new he)}),e&&this.update(e)}update(e){var t,r,n,i,a,s,o,l;this.loop=null!==(t=null==e?void 0:e.loop)&&void 0!==t?t:this.loop,this.gap=se(null==e?void 0:e.gap,this.gap),this.autoplay=null!==(r=null==e?void 0:e.autoplay)&&void 0!==r?r:this.autoplay,this.animationSpeed=se(null==e?void 0:e.animationSpeed,this.animationSpeed),this.slidesPerView=Math.max(se(null==e?void 0:e.slidesPerView,this.slidesPerView),0),this.navigation={enabled:null!==(i=null===(n=null==e?void 0:e.navigation)||void 0===n?void 0:n.enabled)&&void 0!==i?i:this.navigation.enabled},this.pagination={enabled:null!==(s=null===(a=null==e?void 0:e.pagination)||void 0===a?void 0:a.enabled)&&void 0!==s?s:this.pagination.enabled},this.direction=null!==(o=e.direction)&&void 0!==o?o:this.direction,this.allowTouchMove=null!==(l=e.allowTouchMove)&&void 0!==l?l:this.allowTouchMove,this.banner.update(e.banner)}},t=new WeakMap,r=new WeakMap,n=new WeakMap,i=new WeakMap,a=new WeakMap,s=new WeakMap,o=new WeakMap,l=new WeakMap,c=new WeakMap,(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;d=[Q.observable],h=[Q.observable],u=[Q.observable],p=[Q.observable],b=[Q.observable],f=[Q.observable],m=[Q.observable],v=[Q.observable],g=[Q.observable],oe(e,null,d,{kind:"accessor",name:"loop",static:!1,private:!1,access:{has:e=>"loop"in e,get:e=>e.loop,set:(e,t)=>{e.loop=t}},metadata:t},y,w),oe(e,null,h,{kind:"accessor",name:"gap",static:!1,private:!1,access:{has:e=>"gap"in e,get:e=>e.gap,set:(e,t)=>{e.gap=t}},metadata:t},_,P),oe(e,null,u,{kind:"accessor",name:"autoplay",static:!1,private:!1,access:{has:e=>"autoplay"in e,get:e=>e.autoplay,set:(e,t)=>{e.autoplay=t}},metadata:t},S,T),oe(e,null,p,{kind:"accessor",name:"animationSpeed",static:!1,private:!1,access:{has:e=>"animationSpeed"in e,get:e=>e.animationSpeed,set:(e,t)=>{e.animationSpeed=t}},metadata:t},x,E),oe(e,null,b,{kind:"accessor",name:"slidesPerView",static:!1,private:!1,access:{has:e=>"slidesPerView"in e,get:e=>e.slidesPerView,set:(e,t)=>{e.slidesPerView=t}},metadata:t},O,j),oe(e,null,f,{kind:"accessor",name:"navigation",static:!1,private:!1,access:{has:e=>"navigation"in e,get:e=>e.navigation,set:(e,t)=>{e.navigation=t}},metadata:t},I,L),oe(e,null,m,{kind:"accessor",name:"pagination",static:!1,private:!1,access:{has:e=>"pagination"in e,get:e=>e.pagination,set:(e,t)=>{e.pagination=t}},metadata:t},C,k),oe(e,null,v,{kind:"accessor",name:"direction",static:!1,private:!1,access:{has:e=>"direction"in e,get:e=>e.direction,set:(e,t)=>{e.direction=t}},metadata:t},A,B),oe(e,null,g,{kind:"accessor",name:"allowTouchMove",static:!1,private:!1,access:{has:e=>"allowTouchMove"in e,get:e=>e.allowTouchMove,set:(e,t)=>{e.allowTouchMove=t}},metadata:t},M,R),t&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),e})();const pe=(e=>{var t={};return d.d(t,e),t})({v4:()=>a.v4});class be{constructor(e){Object.defineProperty(this,"payload",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"eventId",{enumerable:!0,configurable:!0,writable:!0,value:(0,pe.v4)()})}get type(){return"view"}toQueryParams(){return{ei:this.eventId,ii:this.payload.iterationId,si:this.payload.slideIndex,st:this.payload.slideTotal}}}class fe{constructor(e){Object.defineProperty(this,"payload",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"eventId",{enumerable:!0,configurable:!0,writable:!0,value:(0,pe.v4)()})}get type(){return this.payload.type}toQueryParams(){return Object.assign({ei:this.eventId,ii:this.payload.iterationId,si:this.payload.slideIndex,st:this.payload.slideTotal,d:this.payload.durationMs},this.payload.widgetPayload)}}class me{constructor(){Object.defineProperty(this,"autoplay",{enumerable:!0,configurable:!0,writable:!0,value:{isPaused:function(){return!1},resume:function(){},pause:function(){},start:function(){},stop:function(){},setDelay:function(){}}})}updateSize(){}enableHorizontalSwipeGesture(){}disableHorizontalSwipeGesture(){}getTotalPages(){return 1}getActiveIndex(){return 0}toNextSlide(){}toPrevSlide(){}slideTo(e,t){}}var ve,ge=function(e,t,r,n,i,a){function s(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var o,l=n.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?n.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,n.name):{}),u=!1,p=r.length-1;p>=0;p--){var b={};for(var f in n)b[f]="access"===f?{}:n[f];for(var f in n.access)b.access[f]=n.access[f];b.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(s(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],b);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(o=s(m.get))&&(h.get=o),(o=s(m.set))&&(h.set=o),(o=s(m.init))&&i.unshift(o)}else(o=s(m))&&("field"===l?i.unshift(o):h[c]=o)}d&&Object.defineProperty(d,n.name,h),u=!0},ye=function(e,t,r){for(var n=arguments.length>2,i=0;i<t.length;i++)r=n?t[i].call(e,r):t[i].call(e);return n?r:void 0},we=function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)},_e=function(e,t,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(e,r):i?i.value=r:t.set(e,r),r};!function(e){e.LoadStart="loadStart",e.LoadEnd="loadEnd",e.LoadError="loadError",e.ActiveIndexChange="activeIndexChange",e.AutoplayTimeLeft="autoplayTimeLeft",e.AutoplayTimerTick="autoplayTimerTick",e.ShowBanner="showBanner",e.ShowBannerFailed="showBannerFailed",e.BannerWidget="bannerWidget"}(ve||(ve={}));let Pe=(()=>{var e,t,r,n,i,a;let s,o,l,c,d,h=V.EventEmitter,u=[],p=[],b=[],f=[],m=[],v=[],g=[],y=[],w=[],_=[];return e=class extends h{get _banners(){return we(this,t,"f")}set _banners(e){_e(this,t,e,"f")}get _bannerPlace(){return we(this,r,"f")}set _bannerPlace(e){_e(this,r,e,"f")}get _isLoading(){return we(this,n,"f")}set _isLoading(e){_e(this,n,e,"f")}get _isLoaded(){return we(this,i,"f")}set _isLoaded(e){_e(this,i,e,"f")}get _error(){return we(this,a,"f")}set _error(e){_e(this,a,e,"f")}constructor(e,s,o,l,c){super(),Object.defineProperty(this,"placeId",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"ctx",{enumerable:!0,configurable:!0,writable:!0,value:s}),Object.defineProperty(this,"bannerStatisticService",{enumerable:!0,configurable:!0,writable:!0,value:o}),Object.defineProperty(this,"bannerStore",{enumerable:!0,configurable:!0,writable:!0,value:l}),Object.defineProperty(this,"bannerViewModelFactory",{enumerable:!0,configurable:!0,writable:!0,value:c}),t.set(this,ye(this,u,[])),r.set(this,(ye(this,p),ye(this,b,null))),n.set(this,(ye(this,f),ye(this,m,!1))),i.set(this,(ye(this,v),ye(this,g,!1))),a.set(this,(ye(this,y),ye(this,w,null))),Object.defineProperty(this,"appearance",{enumerable:!0,configurable:!0,writable:!0,value:(ye(this,_),new ue)}),Object.defineProperty(this,"sliderController",{enumerable:!0,configurable:!0,writable:!0,value:new me}),this.ctx.addBannerPlace(this)}get dir(){return this.ctx.getConfig().dir}get id(){return this.placeId}get banners(){return this._banners}get contentRatio(){const e=this._banners.map((e=>e.contentRatio));return this.median(e)}get isLoaded(){return this._isLoaded}get isLoading(){return this._isLoading}get error(){return this._error}get slider(){return this.sliderController}get activeIndex(){return this.sliderController.getActiveIndex()}get activeBanner(){return this._banners[this.activeIndex]}get paginationBullets(){return this.sliderController.getTotalPages()}refreshSizes(){this._banners.forEach((e=>e.refreshSizes()))}setSliderController(e){this.sliderController=e}updateAppearance(e){this.appearance.update(e)}resume(){for(const e of this._banners)e.resumeByUser();this.appearance.autoplay&&this.slider.autoplay.resume()}pause(){for(const e of this._banners)e.pauseByUser();this.appearance.autoplay&&this.slider.autoplay.pause()}async reload(){this.bannerStore.removeBannerPlaceById(this.id),await Promise.all(this._banners.map((e=>e.destroy()))),this._banners=[],await this.fetchBanners()}destroy(){this.sliderController=new me;for(const e of this._banners)e.destroy();this._banners=[],this.ctx.removeBannerPlace(this)}notifyTimerEnd(){var e;null===(e=this.activeBanner)||void 0===e||e.notifyTimerEnd()}showNext(){this.sliderController.toNextSlide()}showPrevious(){this.sliderController.toPrevSlide()}showByIndex(e,t){this.sliderController.slideTo(e,t)}async updateUserData(e){return this.bannerStore.updateBannerUserData(this.id,e)}async fetchBanners(){try{return(await this.ctx.getConfig()).anonymous?(console.warn("[IAS]: You can't fetch banners in anonymous access mode"),[]):this._isLoading?[]:(this._isLoading=!0,this._isLoaded=!1,this._error=null,this.emit(ve.LoadStart),this._bannerPlace=await this.bannerStore.getBannerPlaceById({placeId:this.placeId}),this._banners=this.filterBannersByTimeRange(this._bannerPlace.banners).map((e=>this.bannerViewModelFactory.create(this,e))),await Promise.allSettled(this._banners.map((e=>e.waitInit()))),this._isLoaded=!0,this._banners)}catch(e){throw this.emit(ve.LoadError,e),this._error=e,e}finally{this.emit(ve.LoadEnd,{banners:this._banners.slice()}),this._isLoading=!1}}filterBannersByTimeRange(e){return e.filter((e=>e.withinDisplayTimeRange))}median(e){const t=[...e].sort(((e,t)=>e-t)),r=Math.floor(t.length/2);return t.length%2==0?(t[r-1]+t[r])/2:t[r]}},t=new WeakMap,r=new WeakMap,n=new WeakMap,i=new WeakMap,a=new WeakMap,(()=>{var t;const r="function"==typeof Symbol&&Symbol.metadata?Object.create(null!==(t=h[Symbol.metadata])&&void 0!==t?t:null):void 0;s=[Q.observable],o=[Q.observable],l=[Q.observable],c=[Q.observable],d=[Q.observable],ge(e,null,s,{kind:"accessor",name:"_banners",static:!1,private:!1,access:{has:e=>"_banners"in e,get:e=>e._banners,set:(e,t)=>{e._banners=t}},metadata:r},u,p),ge(e,null,o,{kind:"accessor",name:"_bannerPlace",static:!1,private:!1,access:{has:e=>"_bannerPlace"in e,get:e=>e._bannerPlace,set:(e,t)=>{e._bannerPlace=t}},metadata:r},b,f),ge(e,null,l,{kind:"accessor",name:"_isLoading",static:!1,private:!1,access:{has:e=>"_isLoading"in e,get:e=>e._isLoading,set:(e,t)=>{e._isLoading=t}},metadata:r},m,v),ge(e,null,c,{kind:"accessor",name:"_isLoaded",static:!1,private:!1,access:{has:e=>"_isLoaded"in e,get:e=>e._isLoaded,set:(e,t)=>{e._isLoaded=t}},metadata:r},g,y),ge(e,null,d,{kind:"accessor",name:"_error",static:!1,private:!1,access:{has:e=>"_error"in e,get:e=>e._error,set:(e,t)=>{e._error=t}},metadata:r},w,_),r&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:r})})(),e})();const Se=e=>((0,c.useEffect)((()=>(e.onLoadStart&&e.bannerPlace.on(ve.LoadStart,e.onLoadStart),e.onLoadEnd&&e.bannerPlace.on(ve.LoadEnd,e.onLoadEnd),e.onLoadError&&e.bannerPlace.on(ve.LoadError,e.onLoadError),e.onActiveIndexChange&&e.bannerPlace.on(ve.ActiveIndexChange,e.onActiveIndexChange),e.onAutoplayTimeLeft&&e.bannerPlace.on(ve.AutoplayTimeLeft,e.onAutoplayTimeLeft),e.onAutoplayTimerTick&&e.bannerPlace.on(ve.AutoplayTimerTick,e.onAutoplayTimerTick),e.onShowBanner&&e.bannerPlace.on(ve.ShowBanner,e.onShowBanner),e.onShowBannerFailed&&e.bannerPlace.on(ve.ShowBannerFailed,e.onShowBannerFailed),e.onBannerWidget&&e.bannerPlace.on(ve.BannerWidget,e.onBannerWidget),()=>{e.onLoadStart&&e.bannerPlace.off(ve.LoadStart,e.onLoadStart),e.onLoadEnd&&e.bannerPlace.off(ve.LoadEnd,e.onLoadEnd),e.onLoadError&&e.bannerPlace.off(ve.LoadError,e.onLoadError),e.onActiveIndexChange&&e.bannerPlace.off(ve.ActiveIndexChange,e.onActiveIndexChange),e.onAutoplayTimeLeft&&e.bannerPlace.off(ve.AutoplayTimeLeft,e.onAutoplayTimeLeft),e.onAutoplayTimerTick&&e.bannerPlace.off(ve.AutoplayTimerTick,e.onAutoplayTimerTick),e.onShowBanner&&e.bannerPlace.off(ve.ShowBanner,e.onShowBanner),e.onShowBannerFailed&&e.bannerPlace.off(ve.ShowBannerFailed,e.onShowBannerFailed),e.onBannerWidget&&e.bannerPlace.off(ve.BannerWidget,e.onBannerWidget)})),[e.bannerPlace,e.onLoadStart,e.onLoadError,e.onLoadEnd,e.onActiveIndexChange,e.onAutoplayTimeLeft,e.onAutoplayTimerTick,e.onShowBanner,e.onShowBannerFailed,e.onBannerWidget]),(0,c.useEffect)((()=>{(async e=>{try{await e.fetchBanners()}catch(e){console.error(e)}})(e.bannerPlace)}),[e.bannerPlace]),e.bannerPlace.banners),Te=e=>{(0,c.useEffect)((()=>{e.appearance&&e.bannerPlace.updateAppearance(e.appearance)}),[e.bannerPlace,JSON.stringify(e.appearance)])},xe=({bannerPlace:e,bannerPlaceRef:t})=>{const[r,n]=(0,c.useState)(!1),[i,a]=(0,c.useState)(null),s=(0,c.useRef)();return(0,c.useEffect)((()=>{if(e.banners.length)return(async(e=5e3)=>new Promise(((r,n)=>{s.current=setTimeout((()=>{n(new Error("[IAS]: Unable to calculate banner place width. Check if you are using ad blockers such as AdBlock, uBlock Origin, etc."))}),e);const i=()=>{if(t.current&&t.current.clientWidth>0)return clearTimeout(s.current),void r();requestAnimationFrame(i)};requestAnimationFrame(i)})))().then((()=>{n(!0)})).catch((e=>{a(e),console.error(e)})),()=>{clearTimeout(s.current),n(!1)}}),[e.isLoaded,e.banners.length]),{canBeShown:r,error:i}},Ee=(0,u.observer)((e=>{const t=(0,c.useRef)(null),r=Se(e);Te(e);const{realIndex:n,allowClick:i,slider:a,isAnimating:s,setSlider:o,isMoved:d}=(e=>{const t=(0,c.useRef)(null),[r,n]=(0,c.useState)(!1),[i,a]=(0,c.useState)(!1),[s,o]=(0,c.useState)(!1),[l,d]=(0,c.useState)(!0),[h,u]=(0,c.useState)(null),[p,b]=(0,c.useState)(0),[f,m]=(0,c.useState)(0),[v,g]=(0,c.useState)(!0),[y,w]=(0,c.useState)(!0),_=()=>{clearTimeout(t.current),d(!1),o(!0),((e,t)=>{e.getVisibleSlideIndexes().map((e=>t.banners[e])).forEach((e=>e.pause()))})(h,e)},P=()=>{t.current=setTimeout((()=>d(!0)),100),o(!1),((e,t)=>{t.banners.forEach((e=>e.resume()))})(0,e)},S=()=>{a(!0),d(!1)},T=()=>{a(!1),d(!0)},x=t=>{m(t),e.emit(ve.ActiveIndexChange,t)},E=e=>{b(e)},O=()=>{h&&g(h.reachStart)},j=()=>{h&&w(h.reachEnd)},I=()=>{},L=()=>{e.refreshSizes(),requestAnimationFrame((()=>{e.refreshSizes(),n((e=>!e))}))},C=()=>{e.emit(ve.AutoplayTimeLeft),e.notifyTimerEnd()},k=t=>{e.emit(ve.AutoplayTimerTick,Object.assign(Object.assign({},t),{bannerIndex:e.activeIndex}))};return(0,c.useEffect)((()=>{if(!h)return;const t=new Y(h);e.setSliderController(t)}),[e,h]),(0,c.useEffect)((()=>{h&&e&&e.banners[h.realIndex].markAsOpened()}),[e,h]),(0,c.useEffect)((()=>{if(h)return h.on(z.TouchStart,_),h.on(z.TouchEnd,P),h.on(z.TransitionStart,S),h.on(z.TransitionEnd,T),h.on(z.RealIndexChnage,x),h.on(z.ActiveIndexChange,E),h.on(z.ReachStart,O),h.on(z.ReachEnd,j),h.on(z.Resize,I),h.on(z.SlidesUpdated,L),h.on(z.AutoplayTimeLeft,C),h.on(z.AutoplayTimerTick,k),O(),j(),()=>{h.off(z.TouchStart,_),h.off(z.TouchEnd,P),h.off(z.TransitionStart,S),h.off(z.TransitionEnd,T),h.off(z.RealIndexChnage,x),h.off(z.ActiveIndexChange,E),h.off(z.ReachStart,O),h.off(z.ReachEnd,j),h.off(z.Resize,I),h.off(z.SlidesUpdated,L),h.off(z.AutoplayTimeLeft,C),h.off(z.AutoplayTimerTick,k)}}),[e,h]),{reachStart:v,reachEnd:y,activeIndex:p,realIndex:f,isMoved:s,isAnimating:i,slider:h,setSlider:u,allowClick:l}})(e.bannerPlace),{error:h,canBeShown:u}=xe({bannerPlace:e.bannerPlace,bannerPlaceRef:t});(0,c.useEffect)((()=>{a&&u&&(a.updateSize(),e.bannerPlace.refreshSizes(),requestAnimationFrame((()=>{e.bannerPlace.refreshSizes()})))}),[e.bannerPlace,u]);const p=e.bannerPlace.appearance;return!e.bannerPlace.banners.length||h?null:(0,l.jsx)("div",{className:(0,_.default)(I["bnr-place"],e.className),style:Object.assign(Object.assign({},e.style),{"--ias-bnr-place-border-radius":`${p.banner.borderRadius}px`}),ref:t,children:(0,l.jsx)($,{onInit:o,autoplay:p.autoplay,speed:p.animationSpeed,loop:p.loop,slidesPerView:p.slidesPerView,spaceBetween:p.gap,slidesCount:r.length,navigation:p.navigation,pagination:p.pagination,direction:p.direction,allowTouchMove:p.allowTouchMove,langDirection:e.bannerPlace.dir,children:r.map(((e,t)=>{const r=Boolean(null==a?void 0:a.isSlideVisible(t))&&u;return(0,l.jsx)(G,{children:(0,l.jsx)(O,{index:t,isActive:r,canBeInited:r,banner:e,className:I["bnr-slider__slide"],allowClick:i,clientAppearance:p.banner,direction:p.direction})},e.id)}))})})})),Oe=(e=>{var t={};return d.d(t,e),t})({createRoot:()=>s.createRoot});class je{constructor(e,t,r){Object.defineProperty(this,"mountPoint",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"bannerPlace",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"root",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"rootElement",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.rootElement=document.createElement("div"),this.rootElement.style.width="100%",this.rootElement.style.height="100%",e.appendChild(this.rootElement),this.root=(0,Oe.createRoot)(this.rootElement)}get dir(){return this.bannerPlace.dir}get activeIndex(){return this.bannerPlace.activeIndex}get activeBanner(){return this.bannerPlace.activeBanner}get isLoaded(){return this.bannerPlace.isLoaded}get id(){return this.bannerPlace.id}get banners(){return this.bannerPlace.banners}get appearance(){return this.bannerPlace.appearance}get contentRatio(){return this.bannerPlace.contentRatio}get isLoading(){return this.bannerPlace.isLoading}get error(){return this.bannerPlace.error}get slider(){return this.bannerPlace.slider}get paginationBullets(){return this.bannerPlace.slider.getTotalPages()}refreshSizes(){}emit(e,...t){}setSliderController(e){this.bannerPlace.setSliderController(e)}updateAppearance(e){this.bannerPlace.updateAppearance(e)}resume(){this.bannerPlace.resume()}pause(){this.bannerPlace.pause()}reload(){return this.bannerPlace.reload()}destroy(){setTimeout((()=>{this.root.unmount()})),this.mountPoint.removeChild(this.rootElement),this.bannerPlace.destroy()}fetchBanners(){return this.bannerPlace.fetchBanners()}updateUserData(e){return Promise.resolve()}notifyTimerEnd(){this.bannerPlace.notifyTimerEnd()}showNext(){this.bannerPlace.showNext()}showPrevious(){this.bannerPlace.showPrevious()}showByIndex(e,t){this.bannerPlace.showByIndex(e,t)}on(e,t){return this.bannerPlace.on(e,t),this}once(e,t){return this.bannerPlace.once(e,t),this}off(e,t){return this.bannerPlace.off(e,t),this}render(){var e;this.root.render((0,l.jsx)(Ee,{appearance:null===(e=this.params)||void 0===e?void 0:e.appearance,bannerPlace:this.bannerPlace}))}}class Ie extends je{render(){var e;this.root.render((0,l.jsx)(Ne,{appearance:null===(e=this.params)||void 0===e?void 0:e.appearance,bannerPlace:this.bannerPlace}))}}const Le=e=>{const[t,r]=(0,c.useState)(null);return(0,c.useEffect)((()=>{var t;const n=sr().createBannerPlace(e.placeId);return r(n),null===(t=e.onReady)||void 0===t||t.call(e,n),()=>{n.destroy()}}),[e.placeId]),t?(0,l.jsx)(Ee,Object.assign({bannerPlace:t},e)):null};var Ce=d(713);b()(Ce.A,{insert:"head",singleton:!1});const ke=Ce.A.locals||{},Ae=(0,u.observer)((e=>{const t=Se(e),r=(0,c.useRef)(null),{error:n,canBeShown:i}=xe({bannerPlace:e.bannerPlace,bannerPlaceRef:r}),a=t[0];return(0,c.useEffect)((()=>{i&&(e.bannerPlace.refreshSizes(),requestAnimationFrame((()=>{e.bannerPlace.refreshSizes()})))}),[e.bannerPlace,i]),e.bannerPlace.error||n?null:(0,l.jsx)("div",{className:ke["bnr-place"],ref:r,children:a&&i&&!e.bannerPlace.isLoading?(0,l.jsx)(O,{index:0,isActive:!0,canBeInited:!0,banner:a,allowClick:!0,clientAppearance:e.bannerPlace.appearance.banner}):(0,l.jsx)(S,{needShowErrorScreen:!1,needShowLoaderScreen:!0,onReload:()=>{}})})})),Be=e=>{const[t,r]=(0,c.useState)(null);return(0,c.useEffect)((()=>{var t;const n=sr().createBannerPreviewPlace(e.bannerId);return r(n),null===(t=e.onReady)||void 0===t||t.call(e,n),()=>{n.destroy()}}),[e.bannerId]),t?(0,l.jsx)(Ae,Object.assign({bannerPlace:t},e)):null};var Me=d(883);b()(Me.A,{insert:"head",singleton:!1});const Re=Me.A.locals||{},De=({banner:e,index:t,clientAppearance:r,canBeShown:n})=>{const[i,a]=(0,c.useState)(!1),s=(0,c.useRef)(null);return(0,c.useEffect)((()=>{const e=new IntersectionObserver((e=>{e.forEach((e=>{e.intersectionRatio>=.5?a(!0):a(!1)}))}),{threshold:[0,.5,1]});return s.current&&e.observe(s.current),()=>{s.current&&e.unobserve(s.current)}}),[]),(0,l.jsx)(O,{index:t,isActive:i&&n,canBeInited:i&&n,banner:e,allowClick:!0,clientAppearance:r,direction:"row",ref:s},e.id)},Ne=(0,u.observer)((e=>{const t=(0,c.useRef)(null),r=Se(e);Te(e);const{error:n,canBeShown:i}=xe({bannerPlace:e.bannerPlace,bannerPlaceRef:t});(0,c.useEffect)((()=>{i&&(e.bannerPlace.refreshSizes(),requestAnimationFrame((()=>{e.bannerPlace.refreshSizes()})))}),[e.bannerPlace,i]);const a=e.bannerPlace.appearance;return!e.bannerPlace.banners.length||n?null:(0,l.jsx)("div",{className:(0,_.default)(Re["bnr-place"],e.className),style:Object.assign(Object.assign({},e.style),{gap:a.gap}),ref:t,children:r.map(((e,t)=>(0,l.jsx)(De,{banner:e,canBeShown:i,index:t,clientAppearance:a.banner},e.id)))})})),ze=e=>{const[t,r]=(0,c.useState)(null);return(0,c.useEffect)((()=>{var t;const n=sr().createBannerPlace(e.placeId);return r(n),null===(t=e.onReady)||void 0===t||t.call(e,n),()=>{n.destroy()}}),[e.placeId]),t?(0,l.jsx)(Ne,Object.assign({bannerPlace:t},e)):null};var We=function(e,t,r,n,i,a){function s(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var o,l=n.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?n.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,n.name):{}),u=!1,p=r.length-1;p>=0;p--){var b={};for(var f in n)b[f]="access"===f?{}:n[f];for(var f in n.access)b.access[f]=n.access[f];b.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(s(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],b);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(o=s(m.get))&&(h.get=o),(o=s(m.set))&&(h.set=o),(o=s(m.init))&&i.unshift(o)}else(o=s(m))&&("field"===l?i.unshift(o):h[c]=o)}d&&Object.defineProperty(d,n.name,h),u=!0},Fe=function(e,t,r){for(var n=arguments.length>2,i=0;i<t.length;i++)r=n?t[i].call(e,r):t[i].call(e);return n?r:void 0},Ve=function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)},Ue=function(e,t,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(e,r):i?i.value=r:t.set(e,r),r};let qe=(()=>{var e,t,r,n,i;let a,s,o,l,c=V.EventEmitter,d=[],h=[],u=[],p=[],b=[],f=[],m=[],v=[];return e=class extends c{get _banners(){return Ve(this,t,"f")}set _banners(e){Ue(this,t,e,"f")}get _isLoading(){return Ve(this,r,"f")}set _isLoading(e){Ue(this,r,e,"f")}get _isLoaded(){return Ve(this,n,"f")}set _isLoaded(e){Ue(this,n,e,"f")}get _error(){return Ve(this,i,"f")}set _error(e){Ue(this,i,e,"f")}constructor(e,a,s,o){super(),Object.defineProperty(this,"bannerId",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"ctx",{enumerable:!0,configurable:!0,writable:!0,value:a}),Object.defineProperty(this,"bannerStore",{enumerable:!0,configurable:!0,writable:!0,value:s}),Object.defineProperty(this,"bannerViewModelFactory",{enumerable:!0,configurable:!0,writable:!0,value:o}),t.set(this,Fe(this,d,[])),r.set(this,(Fe(this,h),Fe(this,u,!1))),n.set(this,(Fe(this,p),Fe(this,b,!1))),i.set(this,(Fe(this,f),Fe(this,m,null))),Object.defineProperty(this,"appearance",{enumerable:!0,configurable:!0,writable:!0,value:(Fe(this,v),new ue)}),this.ctx.addBannerPlace(this)}get dir(){return this.ctx.getConfig().dir}get activeIndex(){return 0}get activeBanner(){return this._banners[0]}get id(){return"__BANNER_PREVIEW__"}get slider(){return new me}get banners(){return this._banners}get isLoading(){return this._isLoading}get isLoaded(){return this._isLoaded}get contentRatio(){var e,t;return null!==(t=null===(e=this._banners[0])||void 0===e?void 0:e.contentRatio)&&void 0!==t?t:1}get paginationBullets(){return 1}get error(){return this._error}refreshSizes(){this._banners.forEach((e=>e.refreshSizes()))}setSliderController(e){}updateAppearance(e){this.appearance.update(e)}resume(){for(const e of this._banners)e.resume()}pause(){for(const e of this._banners)e.pause()}async reload(){this.bannerStore.removeBannerPlaceById(this.id),await Promise.all(this._banners.map((e=>e.destroy()))),this._banners=[],await this.fetchBanners()}destroy(){for(const e of this._banners)e.destroy();this._banners=[],this.ctx.removeBannerPlace(this)}async updateUserData(e){return this.bannerStore.updateBannerUserData(this.id,e)}notifyTimerEnd(){}showNext(){}showPrevious(){}showByIndex(e,t){}async fetchBanners(){try{if(this._isLoading)return[];this._error=null,this._isLoading=!0,this._isLoaded=!1,this.emit(ve.LoadStart);const e=await this.bannerStore.getBannerById(this.bannerId);return this._banners=[this.bannerViewModelFactory.create(this,e)],this._isLoaded=!0,this._banners}catch(e){throw this.emit(ve.LoadError,e),this._error=e,e}finally{this.emit(ve.LoadEnd),this._isLoading=!1}}},t=new WeakMap,r=new WeakMap,n=new WeakMap,i=new WeakMap,(()=>{var t;const r="function"==typeof Symbol&&Symbol.metadata?Object.create(null!==(t=c[Symbol.metadata])&&void 0!==t?t:null):void 0;a=[Q.observable],s=[Q.observable],o=[Q.observable],l=[Q.observable],We(e,null,a,{kind:"accessor",name:"_banners",static:!1,private:!1,access:{has:e=>"_banners"in e,get:e=>e._banners,set:(e,t)=>{e._banners=t}},metadata:r},d,h),We(e,null,s,{kind:"accessor",name:"_isLoading",static:!1,private:!1,access:{has:e=>"_isLoading"in e,get:e=>e._isLoading,set:(e,t)=>{e._isLoading=t}},metadata:r},u,p),We(e,null,o,{kind:"accessor",name:"_isLoaded",static:!1,private:!1,access:{has:e=>"_isLoaded"in e,get:e=>e._isLoaded,set:(e,t)=>{e._isLoaded=t}},metadata:r},b,f),We(e,null,l,{kind:"accessor",name:"_error",static:!1,private:!1,access:{has:e=>"_error"in e,get:e=>e._error,set:(e,t)=>{e._error=t}},metadata:r},m,v),r&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:r})})(),e})();class He{constructor(e){Object.defineProperty(this,"bannerStatisticApi",{enumerable:!0,configurable:!0,writable:!0,value:e})}async sendViewEvent(e,t){const r=new be(t);await this.bannerStatisticApi.sendViewEvent(e,r)}async sendWidgetEvent(e,t){const r=new fe(t);await this.bannerStatisticApi.sendWidgetEvent(e,r)}}class $e{constructor(){Object.defineProperty(this,"cache",{enumerable:!0,configurable:!0,writable:!0,value:{}})}set(e,t){this.cache[e]=t}clear(){this.cache={}}get(e){return this.cache[e]}}class Ge{constructor(e,t,r){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"bannerPlaceViewModel",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"banner",{enumerable:!0,configurable:!0,writable:!0,value:r})}async handle(e){try{const t=this.storyManager.gameReader;await t.openGame(e.gameInstanceId),this.bannerPlaceViewModel.pause(),t.once("close",(()=>{this.bannerPlaceViewModel.resume()}))}catch(e){console.error(e)}}}var Xe,Ye,Qe,Ke,Je,Ze,et,tt,rt,nt,it,at,st,ot,lt,ct,dt,ht,ut,pt;!function(e){e.LEFT="left",e.RIGHT="right",e.START="start",e.END="end"}(Xe||(Xe={})),Xe.END,function(e){e.Text="text",e.Link="link",e.Image="image"}(Ye||(Ye={})),function(e){e.DEFAULT="default",e.CUSTOM_CARD="customCard"}(Qe||(Qe={})),Qe.DEFAULT,Qe.DEFAULT,function(e){e.CENTER="center",e.LEFT="left",e.RIGHT="right",e.START="start",e.END="end"}(Ke||(Ke={})),function(e){e.CIRCLE="circle",e.QUAD="quad",e.RECTANGLE="rectangle"}(Je||(Je={})),function(e){e.LEFT="left",e.RIGHT="right",e.START="start",e.END="end",e.CENTER="center"}(Ze||(Ze={})),function(e){e.CARD_INSIDE_BOTTOM="cardInsideBottom",e.CARD_OUTSIDE_TOP="cardOutsideTop",e.CARD_OUTSIDE_BOTTOM="cardOutsideBottom"}(et||(et={})),function(e){e.Medium="medium",e.High="high"}(tt||(tt={})),function(e){e.COLUMN="vertical",e.ROW="horizontal"}(rt||(rt={})),function(e){e.START_LOADER="startLoad",e.END_LOADER="endLoad"}(nt||(nt={})),rt.ROW,Ze.START,et.CARD_INSIDE_BOTTOM,tt.High,Je.RECTANGLE,Ze.START,et.CARD_INSIDE_BOTTOM,tt.High,Je.CIRCLE,Ke.START,Ze.START,et.CARD_INSIDE_BOTTOM,tt.High,Je.CIRCLE,function(e){e.WidgetEvent="widgetEvent",e.ClickOnButton="clickOnButton"}(it||(it={})),function(e){e.STORY_LIST="storyList",e.STORY_READER="storyReader",e.GAME_READER="gameReader",e.STACK_STORY_LIST="stackStoryList",e.IAM_READER="iamReader",e.BANNERS="banners"}(at||(at={})),function(e){e.FLAT="flat",e.COVER="cover",e.CUBE="cube"}(st||(st={})),function(e){e.Classic="classic",e.Modern="modern"}(ot||(ot={})),st.FLAT,ot.Classic,function(e){e.STYLE_CIRCLE="circle",e.STYLE_QUAD="quad",e.STYLE_RECTANGLE="rectangle",e.SWIPE_CUBE="cube",e.SWIPE_FLAT="flat",e.SWIPE_COVER="cover",e.CLOSE_BUTTON_LEFT="left",e.CLOSE_BUTTON_RIGHT="right"}(lt||(lt={})),function(e){e.direct="direct",e.onboarding="onboarding",e.list="list",e.favorite="favorite"}(ct||(ct={})),function(e){e[e.default=0]="default",e[e.favorite=1]="favorite",e[e.stacked=2]="stacked"}(dt||(dt={})),function(e){e.LTR="ltr",e.RTL="rtl"}(ht||(ht={})),function(e){e.StoryList="storyList",e.StoryReader="storyReader",e.GameReader="gameReader",e.StackStoryList="stackStoryList",e.IamReader="iamReader",e.Banners="banners"}(ut||(ut={}));class bt{constructor(e,t){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"banner",{enumerable:!0,configurable:!0,writable:!0,value:t})}handle(e){try{const t=decodeURIComponent(e.linkTarget),r={src:ut.Banners,data:{id:this.banner.id,index:this.banner.activeSlideIndex,url:t,elementId:e.elementId}};this.storyManager.storyLinkClickHandler(r),this.storyManager.emit("clickOnButton",r)}catch(t){t instanceof URIError?console.error(`[Banners]: the URL <${e.linkTarget}> has an invalid format`):console.error(t)}}}class ft{constructor(e,t,r){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"bannerPlace",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"banner",{enumerable:!0,configurable:!0,writable:!0,value:r})}async handle(e){try{const t={src:ut.Banners,data:{id:this.banner.id,index:this.banner.activeSlideIndex,url:e.storyId.toString()}};this.storyManager.storyLinkClickHandler(t),this.storyManager.emit("clickOnButton",t),this.bannerPlace.pause(),await this.storyManager.storyReader.showStory(e.storyId),this.storyManager.storyReader.once("closeStoryReader",(()=>{this.bannerPlace.resume()}))}catch(e){console.error(e)}}}class mt{constructor(){Object.defineProperty(this,"textArea",{enumerable:!0,configurable:!0,writable:!0,value:null})}async copy(e){try{navigator.clipboard&&window.isSecureContext?await navigator.clipboard.writeText(e):this.copyLegacy(e)}catch(t){this.copyLegacy(e)}}isIOS(){return/ipad|iphone/i.test(navigator.userAgent)}createTextArea(e){this.textArea=document.createElement("textarea"),this.textArea.value=e,document.body.appendChild(this.textArea)}selectText(){if(this.textArea)if(this.isIOS()){const e=document.createRange();e.selectNodeContents(this.textArea);const t=window.getSelection();t&&(t.removeAllRanges(),t.addRange(e)),this.textArea.setSelectionRange(0,999999)}else this.textArea.select()}copyLegacy(e){this.createTextArea(e),this.selectText();try{document.execCommand("copy")}catch(e){console.error("Copy failed:",e)}this.textArea&&(document.body.removeChild(this.textArea),this.textArea=null)}}class vt{constructor(e){Object.defineProperty(this,"bannerPlace",{enumerable:!0,configurable:!0,writable:!0,value:e})}manageTimer(e,t){if(!this.bannerPlace.slider)return;const r=this.bannerPlace.slider.autoplay;switch(e){case"start":this.startTimer(r,t);break;case"pause":r.pause();break;case"stop":case"before_start":r.stop()}}startTimer(e,t){e.isPaused()?e.resume():(e.setDelay(t),e.start())}}class gt{constructor(e){Object.defineProperty(this,"payload",{enumerable:!0,configurable:!0,writable:!0,value:e})}}Object.defineProperty(gt,"name",{enumerable:!0,configurable:!0,writable:!0,value:"bannerWidget"});class yt{constructor(e){Object.defineProperty(this,"payload",{enumerable:!0,configurable:!0,writable:!0,value:e})}}Object.defineProperty(yt,"name",{enumerable:!0,configurable:!0,writable:!0,value:"showBanner"});class wt{constructor(e){Object.defineProperty(this,"payload",{enumerable:!0,configurable:!0,writable:!0,value:e})}}Object.defineProperty(wt,"name",{enumerable:!0,configurable:!0,writable:!0,value:"showBannerFailed"});class _t{constructor(e,t,r,n){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"bannerPlace",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"banner",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"bannerStatisticService",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"sessionNarrativeDataCache",{enumerable:!0,configurable:!0,writable:!0,value:new $e}),Object.defineProperty(this,"narrativeDataCache",{enumerable:!0,configurable:!0,writable:!0,value:new $e})}onWidgetRequirePauseUI(){this.banner.pause()}onWidgetRequireResumeUI(){this.banner.resume()}productCartUpdate(e){return Promise.reject({message:"Not implemented"})}productCartClicked(){}async productCartGetState(){return Promise.reject("Not implemented")}onEvent(e,t){}onCardLoadingStateChange(e){}updateCardServerDataLocally(e){this.banner.context.updateNarrativeSavedData(e)}async updateTimeline(e,t,r,n,i,a){"before_start"!==t&&(i?this.banner.showLoaderScreen():this.banner.activeSlide.inited&&this.banner.hideLoaderScreen(),a?this.banner.showErrorScreen():this.banner.hideErrorScreen()),new vt(this.bannerPlace).manageTimer(t,n)}clearNarrativeSessionDataCache(){this.sessionNarrativeDataCache.clear()}disableVerticalSwipeGesture(){}enableVerticalSwipeGesture(){}disableHorizontalSwipeGesture(){this.bannerPlace.slider.disableHorizontalSwipeGesture()}enableHorizontalSwipeGesture(){this.bannerPlace.slider.enableHorizontalSwipeGesture()}async getCardLocalData(){const e=this.narrativeDataCache.get(`banner_${this.banner.id}_data_${this.storyManager.rootStore.sessionStore.userId}`);return e?JSON.parse(e):{}}setCardLocalData(e,t){const r=JSON.stringify(e);this.narrativeDataCache.set(`banner_${this.banner.id}_data_${this.storyManager.rootStore.sessionStore.userId}`,r),this.banner.context.updateNarrativeSavedData(r),t&&this.banner.updateUserData(r).catch(console.error)}getCardServerData(e){var t;return null!==(t=this.banner.context.widgetsData._narrative_saved_data)&&void 0!==t?t:null}getSlideDuration(e,t){var r,n;return null!==(n=null===(r=this.banner.context.widgetsData._narrative_slides_duration)||void 0===r?void 0:r[t])&&void 0!==n?n:null}pauseUI(){this.banner.pause()}resumeUI(){this.banner.resume()}showCardTextInput(e,t){}setCardSessionValue(e,t){this.sessionNarrativeDataCache.set(e,t)}getCardSessionValue(e){return this.sessionNarrativeDataCache.get(e)}getWidgetsSharedData(e,t){const r=this.banner.context.widgetsData;switch(t){case"rangeSlider":return r._narrative_range_slider_data;case"poll":return r._narrative_poll_data;case"vote":return r._narrative_vote_data}return null}async sendApiRequest(e,t,r,n,i,a){var s,o,l;try{const a=await this.storyManager.httpClient.request({url:e,method:t,params:null!=r?r:{},headers:null!=n?n:{},data:null!=i?i:{}});return{status:a.status,headers:a.headers,data:a.data}}catch(e){if(e instanceof Error&&"IasNetworkError"===e.name)return{status:null!==(s=e.networkStatus)&&void 0!==s?s:400,headers:null===(o=e.response)||void 0===o?void 0:o.headers,data:null===(l=e.response)||void 0===l?void 0:l.data}}}share(e,t){}shareSlideScreenshot(e,t,r){}showLayer(e){this.banner.showLayerByIndex(e)}showCardSlide(e){this.bannerPlace.slider.slideTo(e)}cardShowNext(){this.bannerPlace.slider.toNextSlide()}showNextSlide(){this.bannerPlace.slider.toNextSlide()}sendStatisticEvent(e,t,r,n){this.bannerStatisticService.sendWidgetEvent(this.banner.id,{iterationId:this.banner.iterationId,type:e,slideIndex:this.banner.activeSlideIndex,slideTotal:this.banner.slides.length,durationMs:this.banner.durationMs,widgetPayload:t}),this.bannerPlace.emit(gt.name,new gt({id:this.banner.id,bannerPlace:this.bannerPlace.id,widgetEventName:e,widgetData:null!=r?r:{}}).payload),this.storyManager.emit("widgetEvent",{name:e,data:r})}async resetCard(e){this.updateCardServerDataLocally({}),this.setCardLocalData({},!0),this.showCardSlide(0),this.showLayer(0)}getCardFonts(){var e,t;return null!==(t=null===(e=this.storyManager.rootStore.sessionStore.session)||void 0===e?void 0:e.fontsResources)&&void 0!==t?t:[]}showToast(e){this.banner.showToast({content:e})}closeCard(e){}openStory(e,t){new ft(this.storyManager,this.bannerPlace,this.banner).handle({storyId:e,slideIndex:t})}openGame(e){new Ge(this.storyManager,this.bannerPlace,this.banner).handle({gameInstanceId:e})}writeToClipboard(e){(new mt).copy(e.textValue)}openUrl(e){"swipeUpItems"!==e.type&&new bt(this.storyManager,this.banner).handle({elementId:e.elementId,linkTarget:e.link.target})}}!function(e){e.Top="top",e.Bottom="bottom"}(pt||(pt={}));const Pt=pt.Bottom;class St{constructor(e){Object.defineProperty(this,"options",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"timeoutId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"duration",{enumerable:!0,configurable:!0,writable:!0,value:3e3}),Object.defineProperty(this,"content",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"position",{enumerable:!0,configurable:!0,writable:!0,value:Pt}),Object.defineProperty(this,"mountPoint",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"toastContainer",{enumerable:!0,configurable:!0,writable:!0,value:null}),this.initializeOptions(e),this.mountPoint=e.mountPoint}show(e){return this.content=e,this.destroy(),this.createAndShowToast(),!0}hide(){return!!this.toastContainer&&(clearTimeout(this.timeoutId),this.toastContainer.className+=" toast_fadeout",this.addAnimationEndListeners(this.toastContainer,(()=>{var e,t;null===(t=null===(e=this.toastContainer)||void 0===e?void 0:e.parentNode)||void 0===t||t.removeChild(this.toastContainer),this.toastContainer=null})),!0)}destroy(){var e;this.toastContainer&&(clearTimeout(this.timeoutId),null===(e=this.toastContainer.parentNode)||void 0===e||e.removeChild(this.toastContainer),this.toastContainer=null)}initializeOptions(e){if(e.duration&&(this.duration="string"==typeof e.duration?parseFloat(e.duration):e.duration),e.position){const t=e.position.toLowerCase();this.position="top"===t||"bottom"===t?t:Pt}}createAndShowToast(){const e=this.createToastContainer(),t=this.createToastElement(),r=this.createToastTextElement();t.appendChild(r),e.appendChild(t),this.mountPoint.appendChild(e),this.timeoutId=window.setTimeout((()=>this.hide()),this.duration),this.toastContainer=e}createToastContainer(){const e=document.createElement("div");return e.id="toast_container",e.className="toast_fadein",e.style.zIndex="1130",e}createToastElement(){const e=document.createElement("div");return e.id="toast",e}createToastTextElement(){const e=document.createElement("span");return e.innerHTML=this.content,e}addAnimationEndListeners(e,t){["animationend","webkitAnimationEnd","msAnimationEnd","oAnimationEnd"].forEach((r=>{e.addEventListener(r,t,{once:!0})}))}}const Tt=(e=>{var t={};return d.d(t,e),t})({SlideApi:()=>o.SlideApi});let xt;xt=function(){},new Error("timeout while waiting for mutex to become available"),new Error("mutex already locked");const Et=new Error("request for lock canceled");class Ot{constructor(e,t=Et){this._value=e,this._cancelError=t,this._queue=[],this._weightedWaiters=[]}acquire(e=1,t=0){if(e<=0)throw new Error(`invalid weight ${e}: must be positive`);return new Promise(((r,n)=>{const i={resolve:r,reject:n,weight:e,priority:t},a=jt(this._queue,(e=>t<=e.priority));-1===a&&e<=this._value?this._dispatchItem(i):this._queue.splice(a+1,0,i)}))}runExclusive(e){return function(e,t,r,n){return new(r||(r=Promise))((function(i,a){function s(e){try{l(n.next(e))}catch(e){a(e)}}function o(e){try{l(n.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,o)}l((n=n.apply(e,t||[])).next())}))}(this,arguments,void 0,(function*(e,t=1,r=0){const[n,i]=yield this.acquire(t,r);try{return yield e(n)}finally{i()}}))}waitForUnlock(e=1,t=0){if(e<=0)throw new Error(`invalid weight ${e}: must be positive`);return this._couldLockImmediately(e,t)?Promise.resolve():new Promise((r=>{this._weightedWaiters[e-1]||(this._weightedWaiters[e-1]=[]),function(e,t){const r=jt(e,(e=>t.priority<=e.priority));e.splice(r+1,0,t)}(this._weightedWaiters[e-1],{resolve:r,priority:t})}))}isLocked(){return this._value<=0}getValue(){return this._value}setValue(e){this._value=e,this._dispatchQueue()}release(e=1){if(e<=0)throw new Error(`invalid weight ${e}: must be positive`);this._value+=e,this._dispatchQueue()}cancel(){this._queue.forEach((e=>e.reject(this._cancelError))),this._queue=[]}_dispatchQueue(){for(this._drainUnlockWaiters();this._queue.length>0&&this._queue[0].weight<=this._value;)this._dispatchItem(this._queue.shift()),this._drainUnlockWaiters()}_dispatchItem(e){const t=this._value;this._value-=e.weight,e.resolve([t,this._newReleaser(e.weight)])}_newReleaser(e){let t=!1;return()=>{t||(t=!0,this.release(e))}}_drainUnlockWaiters(){if(0===this._queue.length)for(let e=this._value;e>0;e--){const t=this._weightedWaiters[e-1];t&&(t.forEach((e=>e.resolve())),this._weightedWaiters[e-1]=[])}else{const e=this._queue[0].priority;for(let t=this._value;t>0;t--){const r=this._weightedWaiters[t-1];if(!r)continue;const n=r.findIndex((t=>t.priority<=e));(-1===n?r:r.splice(0,n)).forEach((e=>e.resolve()))}}}_couldLockImmediately(e,t){return(0===this._queue.length||this._queue[0].priority<t)&&e<=this._value}}function jt(e,t){for(let r=e.length-1;r>=0;r--)if(t(e[r]))return r;return-1}class It{constructor(e){this._semaphore=new Ot(1,e)}acquire(){return function(e,t,r,n){return new(r||(r=Promise))((function(i,a){function s(e){try{l(n.next(e))}catch(e){a(e)}}function o(e){try{l(n.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,o)}l((n=n.apply(e,t||[])).next())}))}(this,arguments,void 0,(function*(e=0){const[,t]=yield this._semaphore.acquire(1,e);return t}))}runExclusive(e,t=0){return this._semaphore.runExclusive((()=>e()),1,t)}isLocked(){return this._semaphore.isLocked()}waitForUnlock(e=0){return this._semaphore.waitForUnlock(1,e)}release(){this._semaphore.isLocked()&&this._semaphore.release()}cancel(){return this._semaphore.cancel()}}class Lt{constructor(e,t,r){Object.defineProperty(this,"banner",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"bannerSlide",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"slideApi",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"mutex",{enumerable:!0,configurable:!0,writable:!0,value:new It}),Object.defineProperty(this,"_inited",{enumerable:!0,configurable:!0,writable:!0,value:!1})}get html(){return this.bannerSlide.html}get state(){return this.slideApi.state}get inited(){return this._inited}get payload(){return this.bannerSlide.payload}notifyTimerEnd(){this.slideApi.slideTimerEnd()}async init(){const e=await this.mutex.acquire();if(this._inited)return;let t=this.banner.needShowLoaderScreen,r=Date.now();const n=setTimeout((()=>{this.banner.showLoaderScreen(),t=!0,r=Date.now()}),500);try{this.banner.id,await this.slideApi.showSlide(this.html),this._inited=!0}catch(e){throw this.handleSlideError(e),e}finally{clearTimeout(n),await this.cleanupLoaderIfNeeded(Date.now()-r,t),e()}}async start(){const e=await this.mutex.acquire();try{this.banner.id,await this.slideApi.slideStart({muted:!0})}catch(e){throw this.handleSlideError(e),e}finally{e()}}async restart(){const e=await this.mutex.acquire();try{this.banner.hideErrorScreen(),this.banner.showLoaderScreen(),await this.slideApi.slideRestart({muted:!0})}catch(e){throw this.handleSlideError(e),e}finally{this.banner.hideLoaderScreen(),e()}}async resume(){const e=await this.mutex.acquire();try{this.banner.id,await this.slideApi.slideAppResume()}catch(e){this.handleSlideError(e)}finally{e()}}async pause(){const e=await this.mutex.acquire();try{this.banner.id,await this.slideApi.slideAppPause()}catch(e){this.handleSlideError(e)}finally{e()}}async pauseByUser(){const e=await this.mutex.acquire();try{this.banner.id,await this.slideApi.slideUserPause()}catch(e){this.handleSlideError(e)}finally{e()}}async resumeByUser(){const e=await this.mutex.acquire();try{this.banner.id,await this.slideApi.slideUserResume()}catch(e){this.handleSlideError(e)}finally{e()}}async stop(e){const t=await this.mutex.acquire();try{this.banner.id,await this.slideApi.slideStop(e)}catch(e){this.handleSlideError(e)}finally{t()}}refreshSizes(){this.slideApi.refreshSizes()}onClick({event:e,currentTarget:t}){if(e.target)try{e.preventDefault(),e.stopPropagation();const r=this.getNavigationDirection(e,t);this.slideApi.slideClickHandler(e.target,r>0?"forward":"backward")}catch(e){console.error(e)}}async destroy(){await this.stop({prepareForRestart:2})}showLayerByIndex(e){this.slideApi.showLayer(e)}handleSlideError(e){console.error(e),this.banner.showErrorScreen()}getNavigationDirection(e,t){const r=this.getClickPosition(e,t),n="ltr"===this.slideApi.layoutDirection?1:-1;return r>=.3?n:-n}getClickPosition(e,t){const r=t.getBoundingClientRect(),n=r.width;if(n<=0)return 0;let i;if(e instanceof MouseEvent)i=e.pageX-r.left;else{if(!(e.touches&&e.touches.length>0))return 0;i=e.touches[0].pageX-r.left}return Math.max(0,Math.min(1,i/n))}delay(e){return new Promise((t=>setTimeout(t,e)))}async cleanupLoaderIfNeeded(e,t){t&&(await this.delay(Math.max(500-e,0)),this.banner.hideLoaderScreen())}}class Ct{get html(){return""}get state(){return 0}async init(){}async start(){}async restart(){}async resume(){}async pause(){}async resumeByUser(){}async pauseByUser(){}async stop(e){}onClick({event:e,currentTarget:t}){}async destroy(){}showLayerByIndex(e){}refreshSizes(){}notifyTimerEnd(){}}var kt=function(e,t,r){for(var n=arguments.length>2,i=0;i<t.length;i++)r=n?t[i].call(e,r):t[i].call(e);return n?r:void 0},At=function(e,t,r,n,i,a){function s(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var o,l=n.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?n.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,n.name):{}),u=!1,p=r.length-1;p>=0;p--){var b={};for(var f in n)b[f]="access"===f?{}:n[f];for(var f in n.access)b.access[f]=n.access[f];b.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(s(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],b);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(o=s(m.get))&&(h.get=o),(o=s(m.set))&&(h.set=o),(o=s(m.init))&&i.unshift(o)}else(o=s(m))&&("field"===l?i.unshift(o):h[c]=o)}d&&Object.defineProperty(d,n.name,h),u=!0},Bt=function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)},Mt=function(e,t,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(e,r):i?i.value=r:t.set(e,r),r};let Rt=(()=>{var e,t,r,n,i,a,s,o;let l,c,d,h,u,p,b,f,m,v,g,y,w,_,P=[],S=[],x=[],E=[],O=[],j=[],I=[],L=[],C=[],k=[],A=[],B=[],M=[],R=[],D=[];return e=class{get _$root(){return Bt(this,t,"f")}set _$root(e){Mt(this,t,e,"f")}get _needShowErrorScreen(){return Bt(this,r,"f")}set _needShowErrorScreen(e){Mt(this,r,e,"f")}get _needShowLoaderScreen(){return Bt(this,n,"f")}set _needShowLoaderScreen(e){Mt(this,n,e,"f")}get _width(){return Bt(this,i,"f")}set _width(e){Mt(this,i,e,"f")}get _height(){return Bt(this,a,"f")}set _height(e){Mt(this,a,e,"f")}get _slides(){return Bt(this,s,"f")}set _slides(e){Mt(this,s,e,"f")}get isInited(){return Bt(this,o,"f")}set isInited(e){Mt(this,o,e,"f")}constructor(e,l,c,d,h){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:(kt(this,P),e)}),Object.defineProperty(this,"bannerPlace",{enumerable:!0,configurable:!0,writable:!0,value:l}),Object.defineProperty(this,"banner",{enumerable:!0,configurable:!0,writable:!0,value:c}),Object.defineProperty(this,"bannerStatisticService",{enumerable:!0,configurable:!0,writable:!0,value:d}),Object.defineProperty(this,"bannerStore",{enumerable:!0,configurable:!0,writable:!0,value:h}),t.set(this,kt(this,S,null)),r.set(this,(kt(this,x),kt(this,E,!1))),n.set(this,(kt(this,O),kt(this,j,!1))),i.set(this,(kt(this,I),kt(this,L,0))),a.set(this,(kt(this,C),kt(this,k,0))),s.set(this,(kt(this,A),kt(this,B,[]))),Object.defineProperty(this,"slideApi",{enumerable:!0,configurable:!0,writable:!0,value:(kt(this,M),null)}),Object.defineProperty(this,"slideApiImpl",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"locked",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"toast",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_iterationId",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_startTime",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_initPromise",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_initPromiseResolver",{enumerable:!0,configurable:!0,writable:!0,value:()=>{}}),o.set(this,kt(this,R,!1)),Object.defineProperty(this,"attachRoot",{enumerable:!0,configurable:!0,writable:!0,value:(kt(this,D),async e=>{this._$root||(this._$root=e,this.slideApi=this.createSlideApi(e),this._slides=[new Lt(this,this.banner.slides[0],this.slideApi)],await this.init())})}),Object.defineProperty(this,"handleVisibilityChange",{enumerable:!0,configurable:!0,writable:!0,value:()=>{this.locked||("hidden"===document.visibilityState&&this.pause(),"visible"===document.visibilityState&&this.resume())}}),this.slideApiImpl=new _t(this.storyManager,this.bannerPlace,this,this.bannerStatisticService),this._initPromise=new Promise((e=>{this._initPromiseResolver=e}))}get id(){return this.banner.id}get context(){return this.banner.context}get appearance(){return this.banner.appearance}get contentRatio(){return this.banner.appearance.contentRatio}get name(){return this.banner.name}get dir(){return this.storyManager.config.dir}get slides(){return this._slides}get activeSlideIndex(){return 0}get width(){return this._width}get height(){return this._height}get activeSlide(){var e;return null!==(e=this._slides[this.activeSlideIndex])&&void 0!==e?e:new Ct}get needShowErrorScreen(){return this._needShowErrorScreen}get needShowLoaderScreen(){return this._needShowLoaderScreen}get canBeShown(){return Boolean(this._$root)&&this.isInited}get iterationId(){return this._iterationId}get durationMs(){return Date.now()-this._startTime}async init(){this.isInited||(this.showLoaderScreen(),await this.activeSlide.init(),this._initPromiseResolver(),this.isInited=!0)}async start(){if(!this._$root)throw new Error(`[IAS]: Slide API mount point not found for banner with ID ${this.id}`);document.addEventListener("visibilitychange",this.handleVisibilityChange);try{await this.activeSlide.start(),this._startTime=Date.now(),this.markAsOpened(),this.emitShowBannerEvent()}catch(e){this.emitShowBannerFailedEvent(e)}}refreshSizes(){this.activeSlide.refreshSizes()}async restart(){try{await this.activeSlide.restart(),this._startTime=Date.now(),this.markAsOpened(),this.emitShowBannerEvent()}catch(e){this.emitShowBannerFailedEvent(e)}}async resume(){await this.activeSlide.resume()}async pause(){await this.activeSlide.pause()}async resumeByUser(){await this.activeSlide.resumeByUser()}async pauseByUser(){await this.activeSlide.pauseByUser()}async stop(){var e;this.slideApiImpl.clearNarrativeSessionDataCache(),document.removeEventListener("visibilitychange",this.handleVisibilityChange),null===(e=this.toast)||void 0===e||e.destroy(),await this.activeSlide.stop({prepareForRestart:1})}async destroy(){var e,t;document.removeEventListener("visibilitychange",this.handleVisibilityChange);const r=this.activeSlide;this._slides=[],this._$root=null,this.isInited=!1,await r.destroy(),null===(e=this.slideApi)||void 0===e||e.destroy(),null===(t=this.toast)||void 0===t||t.destroy()}showLayerByIndex(e){this.activeSlide.showLayerByIndex(e)}showToast(e){if(!this._$root)return;const t=this._$root;this.toast=new St(Object.assign({mountPoint:t},e)),this.toast.show(e.content)}detachRoot(){var e;this.isInited=!1,this._$root=null,this._slides.forEach((e=>e.destroy())),null===(e=this.slideApi)||void 0===e||e.destroy()}showErrorScreen(){this._needShowErrorScreen=!0}showLoaderScreen(){this._needShowLoaderScreen=!0}hideLoaderScreen(){this._needShowLoaderScreen=!1}hideErrorScreen(){this._needShowErrorScreen=!1}markAsOpened(){this._iterationId=(0,pe.v4)(),this.banner.markAsOpened(),this.markWasShown()}async waitInit(){await this._initPromise}notifyTimerEnd(){this.activeSlide.notifyTimerEnd()}async markWasShown(){!this.banner.wasShown&&this._iterationId&&(this.banner.markWasShown(),this.bannerStatisticService.sendViewEvent(this.id,{iterationId:this._iterationId,slideIndex:this.activeSlideIndex,slideTotal:this.banner.slides.length}))}async updateUserData(e){return this.bannerStore.updateBannerUserData(this.id,e)}createSlideApi(e){return new Tt.SlideApi(this.slideApiImpl,{root:e,slideRatio:this.banner.appearance.contentRatio,isFullscreen:!1,nonce:T(),viewport:window,userResizeHandler:e=>{this._width=e.viewportWidth,this._height=e.viewportHeight},VODPlayer:this.storyManager.globalProperties.$videoOnDemand,overlappingActionBarHeight:0,useSdkCacheForMultislideMode:!1})}emitShowBannerEvent(){this.bannerPlace.emit(yt.name,new yt({id:this.id,bannerPlace:this.bannerPlace.id,payload:this.activeSlide.payload}).payload)}emitShowBannerFailedEvent(e){this.bannerPlace.emit(wt.name,new wt({id:this.id,bannerPlace:this.bannerPlace.id,error:e,payload:this.activeSlide.payload}).payload)}},t=new WeakMap,r=new WeakMap,n=new WeakMap,i=new WeakMap,a=new WeakMap,s=new WeakMap,o=new WeakMap,(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;l=[Q.observable],c=[Q.observable],d=[Q.observable],h=[Q.observable],u=[Q.observable],p=[Q.observable],b=[Q.observable],f=[Q.computed],m=[Q.computed],v=[Q.computed],g=[Q.action],y=[Q.action],w=[Q.action],_=[Q.action],At(e,null,l,{kind:"accessor",name:"_$root",static:!1,private:!1,access:{has:e=>"_$root"in e,get:e=>e._$root,set:(e,t)=>{e._$root=t}},metadata:t},S,x),At(e,null,c,{kind:"accessor",name:"_needShowErrorScreen",static:!1,private:!1,access:{has:e=>"_needShowErrorScreen"in e,get:e=>e._needShowErrorScreen,set:(e,t)=>{e._needShowErrorScreen=t}},metadata:t},E,O),At(e,null,d,{kind:"accessor",name:"_needShowLoaderScreen",static:!1,private:!1,access:{has:e=>"_needShowLoaderScreen"in e,get:e=>e._needShowLoaderScreen,set:(e,t)=>{e._needShowLoaderScreen=t}},metadata:t},j,I),At(e,null,h,{kind:"accessor",name:"_width",static:!1,private:!1,access:{has:e=>"_width"in e,get:e=>e._width,set:(e,t)=>{e._width=t}},metadata:t},L,C),At(e,null,u,{kind:"accessor",name:"_height",static:!1,private:!1,access:{has:e=>"_height"in e,get:e=>e._height,set:(e,t)=>{e._height=t}},metadata:t},k,A),At(e,null,p,{kind:"accessor",name:"_slides",static:!1,private:!1,access:{has:e=>"_slides"in e,get:e=>e._slides,set:(e,t)=>{e._slides=t}},metadata:t},B,M),At(e,null,b,{kind:"accessor",name:"isInited",static:!1,private:!1,access:{has:e=>"isInited"in e,get:e=>e.isInited,set:(e,t)=>{e.isInited=t}},metadata:t},R,D),At(e,null,f,{kind:"getter",name:"activeSlide",static:!1,private:!1,access:{has:e=>"activeSlide"in e,get:e=>e.activeSlide},metadata:t},null,P),At(e,null,m,{kind:"getter",name:"needShowLoaderScreen",static:!1,private:!1,access:{has:e=>"needShowLoaderScreen"in e,get:e=>e.needShowLoaderScreen},metadata:t},null,P),At(e,null,v,{kind:"getter",name:"canBeShown",static:!1,private:!1,access:{has:e=>"canBeShown"in e,get:e=>e.canBeShown},metadata:t},null,P),At(e,null,g,{kind:"method",name:"showErrorScreen",static:!1,private:!1,access:{has:e=>"showErrorScreen"in e,get:e=>e.showErrorScreen},metadata:t},null,P),At(e,null,y,{kind:"method",name:"showLoaderScreen",static:!1,private:!1,access:{has:e=>"showLoaderScreen"in e,get:e=>e.showLoaderScreen},metadata:t},null,P),At(e,null,w,{kind:"method",name:"hideLoaderScreen",static:!1,private:!1,access:{has:e=>"hideLoaderScreen"in e,get:e=>e.hideLoaderScreen},metadata:t},null,P),At(e,null,_,{kind:"method",name:"hideErrorScreen",static:!1,private:!1,access:{has:e=>"hideErrorScreen"in e,get:e=>e.hideErrorScreen},metadata:t},null,P),t&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),e})();class Dt{constructor(e,t,r){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"bannerStore",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"bannerStatisticService",{enumerable:!0,configurable:!0,writable:!0,value:r})}create(e,t){return new Rt(this.storyManager,e,t,this.bannerStatisticService,this.bannerStore)}}function Nt(e,t){let r=null;return async function(...t){return r||(r=(async()=>{try{return await e.apply(this,t)}catch(e){throw e}finally{r=null}})(),r)}}class zt extends Error{constructor(e){super(`[IAS]: Banner with ID ${e} not found`),this.name="IasBannerNotFoundError"}}class Wt extends Error{constructor(e){super(`[IAS]: Banner slot with ID ${e} not found`),this.name="IasBannerPlaceNotFoundError"}}var Ft=function(e,t,r){for(var n=arguments.length>2,i=0;i<t.length;i++)r=n?t[i].call(e,r):t[i].call(e);return n?r:void 0},Vt=function(e,t,r,n,i,a){function s(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var o,l=n.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?n.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,n.name):{}),u=!1,p=r.length-1;p>=0;p--){var b={};for(var f in n)b[f]="access"===f?{}:n[f];for(var f in n.access)b.access[f]=n.access[f];b.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(s(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],b);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(o=s(m.get))&&(h.get=o),(o=s(m.set))&&(h.set=o),(o=s(m.init))&&i.unshift(o)}else(o=s(m))&&("field"===l?i.unshift(o):h[c]=o)}d&&Object.defineProperty(d,n.name,h),u=!0};let Ut=(()=>{var e;let t,r,n,i,a=[];return e=class{constructor(e){Object.defineProperty(this,"httpClient",{enumerable:!0,configurable:!0,writable:!0,value:(Ft(this,a),e)})}async fetchBannerPlaceById(e){const t=await this.httpClient.post(`banner/place/${e.placeId}`,{tags:e.tags.join(","),options:e.options},{params:{expand:"banners.slides"}});if(t.data)return t.data;throw new Wt(e.placeId)}async fetchBannerById(e){const t=await this.httpClient.get(`banner/${e}`,{params:{expand:"slides"}});if(t.data)return t.data;throw new zt(e)}async fetchContextWithStyles({needFetchStyles:e}){return(await this.httpClient.get("banner/context",{params:{fields:"widgetsData"+(e?",style":"")}})).data}async updateUserData(e,t){try{await this.httpClient.request({url:`banner/${e}/data`,method:"put",data:{data:t}})}catch(e){console.error(e)}}},(()=>{const s="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;t=[Nt],r=[Nt],n=[Nt],i=[Nt],Vt(e,null,t,{kind:"method",name:"fetchBannerPlaceById",static:!1,private:!1,access:{has:e=>"fetchBannerPlaceById"in e,get:e=>e.fetchBannerPlaceById},metadata:s},null,a),Vt(e,null,r,{kind:"method",name:"fetchBannerById",static:!1,private:!1,access:{has:e=>"fetchBannerById"in e,get:e=>e.fetchBannerById},metadata:s},null,a),Vt(e,null,n,{kind:"method",name:"fetchContextWithStyles",static:!1,private:!1,access:{has:e=>"fetchContextWithStyles"in e,get:e=>e.fetchContextWithStyles},metadata:s},null,a),Vt(e,null,i,{kind:"method",name:"updateUserData",static:!1,private:!1,access:{has:e=>"updateUserData"in e,get:e=>e.updateUserData},metadata:s},null,a),s&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:s})})(),e})();class qt{constructor(e,t){Object.defineProperty(this,"httpClient",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:t})}async sendShowBannerEvent(e){throw new Error("Method not implemented.")}async sendClickOnBannerEvent(e){throw new Error("Method not implemented.")}async sendBannerCTREvent(e){throw new Error("Method not implemented.")}async sendViewEvent(e,t){await this.sendStatisticsEvent(e,t)}async sendWidgetEvent(e,t){await this.sendStatisticsEvent(e,t)}async sendStatisticsEvent(e,t){try{if(this.storyManager.isStatisticsDisabled)return void console.log("[BANNER STATISTICS]",Object.assign({bannerId:e,type:t.type},t.toQueryParams()));await this.httpClient.post(`/banner/${e}/event/${t.type}`,{},{params:t.toQueryParams()})}catch(e){console.error(e)}}}var Ht;!function(e){e[e.Base=0]="Base",e[e.Dynamic=1]="Dynamic",e[e.Game=2]="Game",e[e.Story=3]="Story",e[e.IAM=4]="IAM"}(Ht||(Ht={}));var $t=function(e,t,r,n,i,a){function s(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var o,l=n.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?n.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,n.name):{}),u=!1,p=r.length-1;p>=0;p--){var b={};for(var f in n)b[f]="access"===f?{}:n[f];for(var f in n.access)b.access[f]=n.access[f];b.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(s(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],b);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(o=s(m.get))&&(h.get=o),(o=s(m.set))&&(h.set=o),(o=s(m.init))&&i.unshift(o)}else(o=s(m))&&("field"===l?i.unshift(o):h[c]=o)}d&&Object.defineProperty(d,n.name,h),u=!0};(()=>{var e;let t,r,n=[];e=class{async fetchBannerPlaceById(e){return{id:"default",appearance:{single_banner_aspect_ratio:2,banners_gap:16,corner_radius:16,loop:!0,autoplay:!0,autoplay_delay:1e3,animation_speed:300},banners:[]}}async fetchContext(){return{style:"",widgetsData:{}}}updateUserData(e,t){throw new Error("Method not implemented.")}fetchBannerById(e){throw new Error("Method not implemented.")}constructor(){!function(e,t,r){for(var n=arguments.length>2,i=0;i<t.length;i++)r=n?t[i].call(e,r):t[i].call(e)}(this,n)}},(()=>{const i="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;t=[Nt],r=[Nt],$t(e,null,t,{kind:"method",name:"fetchBannerPlaceById",static:!1,private:!1,access:{has:e=>"fetchBannerPlaceById"in e,get:e=>e.fetchBannerPlaceById},metadata:i},null,n),$t(e,null,r,{kind:"method",name:"fetchContext",static:!1,private:!1,access:{has:e=>"fetchContext"in e,get:e=>e.fetchContext},metadata:i},null,n),i&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:i})})()})();class Gt{constructor(e,t){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"bannerStore",{enumerable:!0,configurable:!0,writable:!0,value:t})}createBannerPlace(e,t){var r;const n=new qt(this.storyManager.httpClient,this.storyManager),i=new He(n),a=new Dt(this.storyManager,this.bannerStore,i);return new Pe(null!==(r=null==t?void 0:t.toString())&&void 0!==r?r:"default",e,i,this.bannerStore,a)}createBannerPreviewPlace(e,t){const r=new qt(this.storyManager.httpClient,this.storyManager),n=new He(r),i=new Dt(this.storyManager,this.bannerStore,n);return new qe(t.toString(),e,this.bannerStore,i)}}class Xt{static toDomain(e,t){return new J({id:e.id,name:e.name,slides:e.slides.map((e=>{var t;return new ne({html:e.html,duration:e.duration,payload:null===(t=e.event_payload)||void 0===t?void 0:t.payload})})),displayFrom:e.display_from,displayTo:e.display_to,appearance:new Z(e.appearance),context:new ee(e.id,t),frequencyLimit:e.frequency_limit})}}class Yt{static toDomain(e,t,r){const n=e.banners.map((e=>Xt.toDomain(e,t)));return new ae({id:e.id,banners:n,placeholders:r,style:t.style})}}var Qt=function(e,t,r){for(var n=arguments.length>2,i=0;i<t.length;i++)r=n?t[i].call(e,r):t[i].call(e);return n?r:void 0},Kt=function(e,t,r,n,i,a){function s(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var o,l=n.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?n.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,n.name):{}),u=!1,p=r.length-1;p>=0;p--){var b={};for(var f in n)b[f]="access"===f?{}:n[f];for(var f in n.access)b.access[f]=n.access[f];b.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(s(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],b);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(o=s(m.get))&&(h.get=o),(o=s(m.set))&&(h.set=o),(o=s(m.init))&&i.unshift(o)}else(o=s(m))&&("field"===l?i.unshift(o):h[c]=o)}d&&Object.defineProperty(d,n.name,h),u=!0},Jt=function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)},Zt=function(e,t,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(e,r):i?i.value=r:t.set(e,r),r};let er=(()=>{var e,t,r;let n,i,a,s,o=[],l=[],c=[],d=[],h=[];return e=class{get _bannerPlaces(){return Jt(this,t,"f")}set _bannerPlaces(e){Zt(this,t,e,"f")}get _banners(){return Jt(this,r,"f")}set _banners(e){Zt(this,r,e,"f")}constructor(e,n){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:(Qt(this,o),e)}),Object.defineProperty(this,"bannerApi",{enumerable:!0,configurable:!0,writable:!0,value:n}),t.set(this,Qt(this,l,Q.observable.map())),r.set(this,(Qt(this,c),Qt(this,d,Q.observable.map()))),Object.defineProperty(this,"bannerCSS",{enumerable:!0,configurable:!0,writable:!0,value:(Qt(this,h),"")}),(0,Q.reaction)((()=>e.rootStore.placeholderStore.placeholders),(e=>{for(const t of this._bannerPlaces.values())t.updatePlaceholders(e)}))}get bannerPlaces(){return Array.from(this._bannerPlaces.values())}async getBannerById(e){if(this._banners.has(e))return this._banners.get(e);const t=await this.fetchBannerContext(),r=await this.bannerApi.fetchBannerById(e);return this.addBanner(r,t)}async getBannerPlaceById(e){if(this._bannerPlaces.has(e.placeId))return this._bannerPlaces.get(e.placeId);const t=this.storyManager.config,r=await this.fetchBannerContext(),n=await this.bannerApi.fetchBannerPlaceById({placeId:e.placeId,tags:t.tags,options:t.options});return this.addBannerPlace(n,r)}clearCache(){this._bannerPlaces=Q.observable.map(),this._banners=Q.observable.map()}removeBannerPlaceById(e){this._bannerPlaces.delete(e)}async updateBannerUserData(e,t){if(!this.storyManager.isStatisticsDisabled)return this.bannerApi.updateUserData(e,t);console.log("[IAM]: update user data",{bannerId:e,payload:t})}async fetchBannerContext(){await this.storyManager.rootStore.sessionStore.open();const e=await this.bannerApi.fetchContextWithStyles({needFetchStyles:!this.bannerCSS});return this.bannerCSS&&(e.style=this.bannerCSS),e}addBannerPlace(e,t){const r=this.storyManager.rootStore.placeholderStore.placeholders,n=Yt.toDomain(e,t,r);return this._bannerPlaces.set(e.id,n),n}addBanner(e,t){const r=this.storyManager.rootStore.placeholderStore.placeholders,n=Xt.toDomain(e,t);return n.updatePlaceholders(r),this._banners.set(n.id,n),n}},t=new WeakMap,r=new WeakMap,(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;n=[Q.observable],i=[Q.observable],a=[Q.computed],s=[Nt],Kt(e,null,n,{kind:"accessor",name:"_bannerPlaces",static:!1,private:!1,access:{has:e=>"_bannerPlaces"in e,get:e=>e._bannerPlaces,set:(e,t)=>{e._bannerPlaces=t}},metadata:t},l,c),Kt(e,null,i,{kind:"accessor",name:"_banners",static:!1,private:!1,access:{has:e=>"_banners"in e,get:e=>e._banners,set:(e,t)=>{e._banners=t}},metadata:t},d,h),Kt(e,null,a,{kind:"getter",name:"bannerPlaces",static:!1,private:!1,access:{has:e=>"bannerPlaces"in e,get:e=>e.bannerPlaces},metadata:t},null,o),Kt(e,null,s,{kind:"method",name:"getBannerPlaceById",static:!1,private:!1,access:{has:e=>"getBannerPlaceById"in e,get:e=>e.getBannerPlaceById},metadata:t},null,o),t&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),e})();class tr{constructor(e){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"bannerStore",{enumerable:!0,configurable:!0,writable:!0,value:void 0});const t=new Ut(e.httpClient);this.bannerStore=new er(this.storyManager,t)}}class rr extends Error{constructor(){super("[IAS]: you must create an instance of BannersProvider"),this.name="IasBannersProviderReferenceError"}}class nr extends Error{constructor(e){super(`[IAS]: Mount point ${e} is not present in DOM at initialization time`),this.name="IasMountPointReferenceError"}}class ir extends je{render(){this.root.render((0,l.jsx)(Ae,{bannerPlace:this.bannerPlace}))}}class ar{constructor(e){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"bannerPlaces",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"bannerPlaceViewModelFactory",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"rootStore",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"reloadAllBanners",{enumerable:!0,configurable:!0,writable:!0,value:()=>{this.rootStore.bannerStore.clearCache(),this.bannerPlaces.forEach((e=>{e.reload().catch(console.error)}))}}),this.rootStore=new tr(e),this.bannerPlaceViewModelFactory=new Gt(e,this.rootStore.bannerStore),this.storyManager.on("requestSDKReload",this.reloadAllBanners)}getConfig(){return this.storyManager.config}addBannerPlace(e){this.bannerPlaces.push(e)}removeBannerPlace(e){const t=this.bannerPlaces.indexOf(e);-1!==t&&this.bannerPlaces.splice(t,1)}clear(){for(const e of this.bannerPlaces)e.destroy();this.bannerPlaces=[]}createBannerPlace(e){return this.bannerPlaceViewModelFactory.createBannerPlace(this,e)}createBannerPreviewPlace(e){return this.bannerPlaceViewModelFactory.createBannerPreviewPlace(this,e)}static create(e){return ar.instance||(ar.instance=new ar(e)),ar.instance}mountBannerPlace(e,t){return this.mountBannerCarousel(e,t)}mountBannerCarousel(e,t){const r=document.querySelector(e);if(!r)throw new nr(e);const n=this.createBannerPlace(null==t?void 0:t.placeId),i=new je(r,n,t);return i.render(),i}mountBannerList(e,t){const r=document.querySelector(e);if(!r)throw new nr(e);const n=this.createBannerPlace(null==t?void 0:t.placeId),i=new Ie(r,n,t);return i.render(),i}mountBannerPreviewPlace(e,t){const r=document.querySelector(e);if(!r)throw new nr(e);const n=this.createBannerPreviewPlace(t.bannerId),i=new ir(r,n);return i.render(),i}}const sr=()=>{if(!ar.instance)throw new rr;return ar.instance},or=ar;class lr{constructor(){Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ias-banners"})}install(e){const t=or.create(e.INTERNAL_API);e.HOST.prototype.banners=t}uninstall(){}}const cr=new lr})();var u=h.AF,p=h.M6,b=h.RE,f=h.Sr,m=h.YL,v=h.Ay;export{u as IasBannerCarousel,p as IasBannerList,b as IasBannerPlace,f as IasBannerPreview,m as IasBannersPlugin,v as default};
|
|
1
|
+
import{jsx as e,jsxs as t}from"react/jsx-runtime";import{forwardRef as r,useEffect as n,useLayoutEffect as i,useRef as a,useState as s}from"react";import{observer as o}from"mobx-react-lite";import{default as l}from"classnames";import{action as c,computed as d,observable as h,reaction as u}from"mobx";import{v4 as p}from"uuid";import{createRoot as b}from"react-dom/client";import{SlideApi as f}from"@inappstory/slide-api";var m={126(e,t,r){r.d(t,{A:()=>a});var n=r(935),i=r.n(n)()(function(e){return e[1]});i.push([e.id,".loader--4uMcs{position:absolute;z-index:10001;top:0;bottom:0;left:0;right:0;display:flex;justify-content:center;align-items:center;background:var(--loader-background, black)}.loader--4uMcs .loader__refresh-btn--5nwxY{color:#fff;cursor:pointer;position:absolute;left:50%;top:50%;transform:translate3d(-50%, -50%, 0);pointer-events:auto;padding:20px;width:32px;height:32px;box-sizing:content-box}.loader--4uMcs .loader__spinner--NRm8E{-ms-flex-negative:0;flex-shrink:0;display:inline-block;width:32px;height:32px;border-radius:50%;border:solid 2px var(--loaderBackgroundColor, white);border-color:var(--loaderBackgroundAccentColor, transparent) var(--loaderBackgroundColor, white) var(--loaderBackgroundColor, white) var(--loaderBackgroundColor, white);-webkit-animation:loading-spinner--LnXd0 .6s infinite linear;animation:loading-spinner--LnXd0 .6s infinite linear}@keyframes loading-spinner--LnXd0{from{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}",""]),i.locals={loader:"loader--4uMcs","loader__refresh-btn":"loader__refresh-btn--5nwxY",loader__spinner:"loader__spinner--NRm8E","loading-spinner":"loading-spinner--LnXd0"};const a=i},81(e,t,r){r.d(t,{A:()=>a});var n=r(935),i=r.n(n)()(function(e){return e[1]});i.push([e.id,".icon--5RBkn{width:2rem;height:2rem}",""]),i.locals={icon:"icon--5RBkn"};const a=i},371(e,t,r){r.d(t,{A:()=>a});var n=r(935),i=r.n(n)()(function(e){return e[1]});i.push([e.id,".bnr---mqC-{width:100%;height:100%;position:relative;backface-visibility:hidden;transform:translateZ(0);clip-path:inset(0 round var(--ias-banner-border-radius, 0px))}.bnr-slides--Oc1j-{position:relative;width:100%;height:100%;display:block}",""]),i.locals={bnr:"bnr---mqC-","bnr-slides":"bnr-slides--Oc1j-"};const a=i},243(e,t,r){r.d(t,{A:()=>a});var n=r(935),i=r.n(n)()(function(e){return e[1]});i.push([e.id,".bnr-place--GbC1J{width:100%;height:100%;position:relative;border-radius:var(--ias-bnr-place-border-radius, 0px)}.bnr-slider__slider_visible--LrMXv{border:solid 1px green}",""]),i.locals={"bnr-place":"bnr-place--GbC1J","bnr-slider__slider_visible":"bnr-slider__slider_visible--LrMXv"};const a=i},883(e,t,r){r.d(t,{A:()=>a});var n=r(935),i=r.n(n)()(function(e){return e[1]});i.push([e.id,".bnr-place--Dj\\+2-{width:100%;height:100%;display:flex;flex-direction:column;position:relative}",""]),i.locals={"bnr-place":"bnr-place--Dj+2-"};const a=i},713(e,t,r){r.d(t,{A:()=>a});var n=r(935),i=r.n(n)()(function(e){return e[1]});i.push([e.id,".bnr-place--1RkrK{width:100%;height:100%;position:relative}",""]),i.locals={"bnr-place":"bnr-place--1RkrK"};const a=i},41(e,t,r){r.d(t,{A:()=>a});var n=r(935),i=r.n(n)()(function(e){return e[1]});i.push([e.id,".slider--ggy2P{width:100%;height:100%;overflow:hidden;position:relative;justify-content:center;user-select:none;border-radius:inherit}.slider__track--JSOcI{display:flex;transition:transform .3s ease;width:100%;height:100%;will-change:transform}.slider__slide--oGmUT{width:100%;flex-shrink:0;position:relative;display:flex}.slider--vertical--qUwAP .slider__track--JSOcI{flex-direction:column}.slider--vertical--qUwAP .slider__slide--oGmUT{justify-content:center}",""]),i.locals={slider:"slider--ggy2P",slider__track:"slider__track--JSOcI",slider__slide:"slider__slide--oGmUT","slider--vertical":"slider--vertical--qUwAP"};const a=i},379(e,t,r){r.d(t,{A:()=>a});var n=r(935),i=r.n(n)()(function(e){return e[1]});i.push([e.id,".slider__controls-btn--HubN5{position:absolute;top:50%;z-index:1;width:1.5rem;height:1.5rem;transform:translate3d(0, -50%, 0);transition:all .2s ease-in-out;cursor:pointer;padding:0;background-color:rgba(0,0,0,0);color:#0c62f3;border:0;outline:0}.slider__controls-btn--start--uVL4-{left:1.5rem}.slider__controls-btn--end--fV\\+p9{right:1.5rem}.slider__controls--CjPin.slider__controls--vertical--5wOuK .slider__controls-btn--HubN5{top:auto;left:50%;transform:translate3d(-50%, 0, 0)}.slider__controls--CjPin.slider__controls--vertical--5wOuK .slider__controls-btn--start--uVL4-{top:0;transform:rotate(90deg)}.slider__controls--CjPin.slider__controls--vertical--5wOuK .slider__controls-btn--end--fV\\+p9{bottom:0;transform:rotate(90deg)}.slider__controls--CjPin:not(.slider__controls--vertical--5wOuK) .slider__controls-btn--start--uVL4-.slider__controls-btn--dir--rtl--ICofD{left:auto;right:0;transform:translate3d(0, -50%, 0) rotate(180deg)}.slider__controls--CjPin:not(.slider__controls--vertical--5wOuK) .slider__controls-btn--end--fV\\+p9.slider__controls-btn--dir--rtl--ICofD{left:0;right:auto;transform:translate3d(0, -50%, 0) rotate(180deg)}.slider__controls-btn--HubN5{transition:opacity .3s ease-in-out}.slider__controls-btn--disabled--m1P4q{opacity:0;pointer-events:none}",""]),i.locals={"slider__controls-btn":"slider__controls-btn--HubN5","slider__controls-btn--start":"slider__controls-btn--start--uVL4-","slider__controls-btn--end":"slider__controls-btn--end--fV+p9",slider__controls:"slider__controls--CjPin","slider__controls--vertical":"slider__controls--vertical--5wOuK","slider__controls-btn--dir--rtl":"slider__controls-btn--dir--rtl--ICofD","slider__controls-btn--disabled":"slider__controls-btn--disabled--m1P4q"};const a=i},55(e,t,r){r.d(t,{A:()=>a});var n=r(935),i=r.n(n)()(function(e){return e[1]});i.push([e.id,".slider-bullets--XDc5n{position:absolute;z-index:2;bottom:1.5rem;left:50%;display:inline-flex;list-style:none;transform:translate3d(-50%, 0, 0)}.slider-bullets__bullet--83aBh{background-color:var(--ias-banners-pagination-inactive-color, hsla(0, 0%, 100%, 0.5));width:var(--ias-banners-pagination-width, 0.5rem);height:var(--ias-banners-pagination-height, 0.5rem);padding:0;border-radius:50%;border:.25rem solid rgba(0,0,0,0);cursor:pointer;line-height:0;box-shadow:0 .25em .5em 0 rgba(0,0,0,.1);margin:0 .25em;transition:transform 100ms ease-in;transform:scale(0.8)}.slider-bullets__bullet--active--RDBez{background-color:#0c62f3;transform:scale(1)}.slider-bullets--XDc5n.slider-bullets--vertical--QuatQ{transform:translate3d(0, -50%, 0);left:auto;bottom:auto;right:1.5rem;top:50%;display:flex;flex-direction:column}.slider-bullets--XDc5n.slider-bullets--vertical--QuatQ .slider-bullets__bullet--83aBh{margin:.25em 0}",""]),i.locals={"slider-bullets":"slider-bullets--XDc5n","slider-bullets__bullet":"slider-bullets__bullet--83aBh","slider-bullets__bullet--active":"slider-bullets__bullet--active--RDBez","slider-bullets--vertical":"slider-bullets--vertical--QuatQ"};const a=i},935(e){e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var r=e(t);return t[2]?"@media ".concat(t[2]," {").concat(r,"}"):r}).join("")},t.i=function(e,r,n){"string"==typeof e&&(e=[[null,e,""]]);var i={};if(n)for(var a=0;a<this.length;a++){var s=this[a][0];null!=s&&(i[s]=!0)}for(var o=0;o<e.length;o++){var l=[].concat(e[o]);n&&i[l[0]]||(r&&(l[2]?l[2]="".concat(r," and ").concat(l[2]):l[2]=r),t.push(l))}},t}},46(e){var t,r="object"==typeof Reflect?Reflect:null,n=r&&"function"==typeof r.apply?r.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};t=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var i=Number.isNaN||function(e){return e!=e};function a(){a.init.call(this)}e.exports=a,e.exports.once=function(e,t){return new Promise(function(r,n){function i(r){e.removeListener(t,a),n(r)}function a(){"function"==typeof e.removeListener&&e.removeListener("error",i),r([].slice.call(arguments))}f(e,t,a,{once:!0}),"error"!==t&&function(e,t){"function"==typeof e.on&&f(e,"error",t,{once:!0})}(e,i)})},a.EventEmitter=a,a.prototype._events=void 0,a.prototype._eventsCount=0,a.prototype._maxListeners=void 0;var s=10;function o(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function l(e){return void 0===e._maxListeners?a.defaultMaxListeners:e._maxListeners}function c(e,t,r,n){var i,a,s,c;if(o(r),void 0===(a=e._events)?(a=e._events=Object.create(null),e._eventsCount=0):(void 0!==a.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),a=e._events),s=a[t]),void 0===s)s=a[t]=r,++e._eventsCount;else if("function"==typeof s?s=a[t]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(i=l(e))>0&&s.length>i&&!s.warned){s.warned=!0;var d=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");d.name="MaxListenersExceededWarning",d.emitter=e,d.type=t,d.count=s.length,c=d,console&&console.warn&&console.warn(c)}return e}function d(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function h(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=d.bind(n);return i.listener=r,n.wrapFn=i,i}function u(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(i):b(i,i.length)}function p(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function b(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}function f(e,t,r,n){if("function"==typeof e.on)n.once?e.once(t,r):e.on(t,r);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,function i(a){n.once&&e.removeEventListener(t,i),r(a)})}}Object.defineProperty(a,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");s=e}}),a.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},a.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},a.prototype.getMaxListeners=function(){return l(this)},a.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var i="error"===e,a=this._events;if(void 0!==a)i=i&&void 0===a.error;else if(!i)return!1;if(i){var s;if(t.length>0&&(s=t[0]),s instanceof Error)throw s;var o=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw o.context=s,o}var l=a[e];if(void 0===l)return!1;if("function"==typeof l)n(l,this,t);else{var c=l.length,d=b(l,c);for(r=0;r<c;++r)n(d[r],this,t)}return!0},a.prototype.addListener=function(e,t){return c(this,e,t,!1)},a.prototype.on=a.prototype.addListener,a.prototype.prependListener=function(e,t){return c(this,e,t,!0)},a.prototype.once=function(e,t){return o(t),this.on(e,h(this,e,t)),this},a.prototype.prependOnceListener=function(e,t){return o(t),this.prependListener(e,h(this,e,t)),this},a.prototype.removeListener=function(e,t){var r,n,i,a,s;if(o(t),void 0===(n=this._events))return this;if(void 0===(r=n[e]))return this;if(r===t||r.listener===t)0===--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(i=-1,a=r.length-1;a>=0;a--)if(r[a]===t||r[a].listener===t){s=r[a].listener,i=a;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,i),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,s||t)}return this},a.prototype.off=a.prototype.removeListener,a.prototype.removeAllListeners=function(e){var t,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0===--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var i,a=Object.keys(r);for(n=0;n<a.length;++n)"removeListener"!==(i=a[n])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},a.prototype.listeners=function(e){return u(this,e,!0)},a.prototype.rawListeners=function(e){return u(this,e,!1)},a.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):p.call(e,t)},a.prototype.listenerCount=p,a.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},591(e,t,r){var n,i=function(){var e={};return function(t){if(void 0===e[t]){var r=document.querySelector(t);if(window.HTMLIFrameElement&&r instanceof window.HTMLIFrameElement)try{r=r.contentDocument.head}catch(e){r=null}e[t]=r}return e[t]}}(),a=[];function s(e){for(var t=-1,r=0;r<a.length;r++)if(a[r].identifier===e){t=r;break}return t}function o(e,t){for(var r={},n=[],i=0;i<e.length;i++){var o=e[i],l=t.base?o[0]+t.base:o[0],c=r[l]||0,d="".concat(l," ").concat(c);r[l]=c+1;var h=s(d),u={css:o[1],media:o[2],sourceMap:o[3]};-1!==h?(a[h].references++,a[h].updater(u)):a.push({identifier:d,updater:f(u,t),references:1}),n.push(d)}return n}function l(e){var t=document.createElement("style"),n=e.attributes||{};if(void 0===n.nonce){var a=r.nc;a&&(n.nonce=a)}if(Object.keys(n).forEach(function(e){t.setAttribute(e,n[e])}),"function"==typeof e.insert)e.insert(t);else{var s=i(e.insert||"head");if(!s)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");s.appendChild(t)}return t}var c,d=(c=[],function(e,t){return c[e]=t,c.filter(Boolean).join("\n")});function h(e,t,r,n){var i=r?"":n.media?"@media ".concat(n.media," {").concat(n.css,"}"):n.css;if(e.styleSheet)e.styleSheet.cssText=d(t,i);else{var a=document.createTextNode(i),s=e.childNodes;s[t]&&e.removeChild(s[t]),s.length?e.insertBefore(a,s[t]):e.appendChild(a)}}function u(e,t,r){var n=r.css,i=r.media,a=r.sourceMap;if(i?e.setAttribute("media",i):e.removeAttribute("media"),a&&"undefined"!=typeof btoa&&(n+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(a))))," */")),e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}var p=null,b=0;function f(e,t){var r,n,i;if(t.singleton){var a=b++;r=p||(p=l(t)),n=h.bind(null,r,a,!1),i=h.bind(null,r,a,!0)}else r=l(t),n=u.bind(null,r,t),i=function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(r)};return n(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;n(e=t)}else i()}}e.exports=function(e,t){(t=t||{}).singleton||"boolean"==typeof t.singleton||(t.singleton=(void 0===n&&(n=Boolean(window&&document&&document.all&&!window.atob)),n));var r=o(e=e||[],t);return function(e){if(e=e||[],"[object Array]"===Object.prototype.toString.call(e)){for(var n=0;n<r.length;n++){var i=s(r[n]);a[i].references--}for(var l=o(e,t),c=0;c<r.length;c++){var d=s(r[c]);0===a[d].references&&(a[d].updater(),a.splice(d,1))}r=l}}}},968(e,t,r){const n=document.querySelector("[nonce]");n&&(r.nc=n.nonce||n.getAttribute("nonce"))}},v={};function g(e){var t=v[e];if(void 0!==t)return t.exports;var r=v[e]={id:e,exports:{}};return m[e](r,r.exports,g),r.exports}g.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return g.d(t,{a:t}),t},g.d=(e,t)=>{for(var r in t)g.o(t,r)&&!g.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},g.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),g.nc=void 0,g(968);var w=g(591),y=g.n(w),_=g(371);y()(_.A,{insert:"head",singleton:!1});const P=_.A.locals||{};var S=g(126);y()(S.A,{insert:"head",singleton:!1});const T=S.A.locals||{};var E=g(81);y()(E.A,{insert:"head",singleton:!1});const x=E.A.locals||{},O=({onClick:t,className:r})=>e("div",{className:l(x.icon,r),onClick:t,children:e("svg",{viewBox:"0 0 24 24",children:e("path",{fill:"currentColor",d:"M17.65,6.35C16.2,4.9 14.21,4 12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20C15.73,20 18.84,17.45 19.73,14H17.65C16.83,16.33 14.61,18 12,18A6,6 0 0,1 6,12A6,6 0 0,1 12,6C13.66,6 15.14,6.69 16.22,7.78L13,11H20V4L17.65,6.35Z"})})}),I=o(t=>{const r=t.needShowErrorScreen,n=t.needShowLoaderScreen;return n||r?e("div",{className:l(T.loader),style:Object.assign({"--loader-background":t.background,"--loaderBackgroundColor":t.color},t.style),onClick:e=>{e.preventDefault()},children:r?e(O,{className:T["loader__refresh-btn"],onClick:e=>{e.stopPropagation(),t.onReload()}}):n&&e("div",{className:T.loader__spinner})}):null}),C=()=>null!==g.nc&&void 0!==g.nc?g.nc:"";class L extends HTMLElement{constructor(){super(...arguments),Object.defineProperty(this,"styleElement",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"banner",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"mountPoint",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"handleClick",{enumerable:!0,configurable:!0,writable:!0,value:e=>{var t;this.shadowRoot&&"true"===this.shadowRoot.host.getAttribute("allow-click")&&(null===(t=this.banner)||void 0===t||t.activeSlide.onClick({event:e,currentTarget:this.shadowRoot.host}))}})}setStyle(e){var t;this.styleElement&&this.styleElement.parentNode&&this.styleElement.parentNode.removeChild(this.styleElement);const r=document.createElement("style");r.textContent=e,r.setAttribute("nonce",C()),this.styleElement=r,null===(t=this.shadowRoot)||void 0===t||t.prepend(r)}async init(e){this.mountPoint&&(this.banner=e,this.mountPoint.addEventListener("click",this.handleClick),await this.banner.attachRoot(this.mountPoint))}destroy(){var e,t;null===(e=this.banner)||void 0===e||e.detachRoot(),null===(t=this.mountPoint)||void 0===t||t.removeEventListener("click",this.handleClick)}connectedCallback(){if(this.shadowRoot)return;const e=this.attachShadow({mode:"open"});this.mountPoint=document.createElement("div"),this.mountPoint.style.height="100%",this.mountPoint.style.width="100%",e.appendChild(this.mountPoint)}disconnectedCallback(){}}function j(e){const t=e.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*[\d.]+)?\)$/i);if(t){const[e,r,n,i]=t.map(Number);return(299*r+587*n+114*i)/1e3>128}if(e.startsWith("#")){const t=e.slice(1);let r,n,i;if(3===t.length)r=parseInt(t[0]+t[0],16),n=parseInt(t[1]+t[1],16),i=parseInt(t[2]+t[2],16);else{if(6!==t.length)return!1;r=parseInt(t.slice(0,2),16),n=parseInt(t.slice(2,4),16),i=parseInt(t.slice(4,6),16)}return(299*r+587*n+114*i)/1e3>128}return!0}customElements.get("bnr-slides-container")||customElements.define("bnr-slides-container",L);const k=o(r((r,s)=>{var{banner:o,direction:c="row"}=r,d=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r}(r,["banner","direction"]);const h=a(null),u=o.canBeShown;i(()=>{h.current&&h.current.setStyle(o.context.style)},[o.context.style]),i(()=>{if(!h.current)return;const e=h.current;return e.init(o),()=>{e.destroy()}},[o]),n(()=>{if(d.isActive&&u)return o.start(),()=>{o.stop()}},[o,d.isActive,u]);const p="row"===c?{height:`${Math.ceil(o.width/o.contentRatio)}px`}:{width:`${Math.ceil(o.height*o.contentRatio)}px`};return t("div",{className:l(P.bnr,"ias-bnr",d.className),ref:s,style:Object.assign(Object.assign({},p),{background:o.appearance.background,"--ias-banner-border-radius":`${d.clientAppearance.borderRadius}px`}),children:[e("bnr-slides-container",{style:{opacity:u?1:0},class:P["bnr-slides"],ref:h,"allow-click":d.allowClick.toString(),dir:o.dir}),e(I,{needShowErrorScreen:o.needShowErrorScreen,needShowLoaderScreen:o.needShowLoaderScreen,onReload:async()=>{o.activeSlide.restart()},background:o.appearance.background,color:j(o.appearance.background)?"black":"white"})]})}));var B=g(243);y()(B.A,{insert:"head",singleton:!1});const A=B.A.locals||{};var M=g(55);y()(M.A,{insert:"head",singleton:!1});const R=M.A.locals||{},D=t=>{const[r,i]=s(-1);return n(()=>{t.activeIndex===r&&i(-1)},[t.activeIndex,r]),t.totalPages>1&&e("div",{dir:t.langDirection,className:l(R["slider-bullets"],{[R["slider-bullets--vertical"]]:"column"===t.direction},"ias-bnr-bullets"),children:Array.from({length:t.totalPages}).map((r,n)=>e("div",{className:l("ias-bnr__bullet",R["slider-bullets__bullet"],{[R["slider-bullets__bullet--active"]]:n===t.activeIndex,"ias-bnr__bullet--active":n===t.activeIndex}),onClick:()=>(e=>{i(e),t.onClick(e)})(n)},n))})};var N=g(41);y()(N.A,{insert:"head",singleton:!1});const z=N.A.locals||{};var W=g(379);y()(W.A,{insert:"head",singleton:!1});const F=W.A.locals||{},V=r=>t("div",{className:l(F.slider__controls,{[F["slider__controls--vertical"]]:"column"===r.direction}),children:[e("button",{onClick:r.onPrevClick,className:l("ias-bnr__controls-btn","ias-bnr__controls-btn--prev","ias-bnr__controls-btn--start",F["slider__controls-btn"],F["slider__controls-btn--start"],{[F["slider__controls-btn--disabled"]]:r.prevDisabled,[F["slider__controls-btn--dir--rtl"]]:"rtl"===r.langDirection,"ias-bnr__controls-btn--disabled":r.prevDisabled}),children:e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",children:e("path",{d:"M0 12l10.975 11 2.848-2.828-6.176-6.176H24v-3.992H7.646l6.176-6.176L10.975 1 0 12z",fill:"currentColor"})})}),e("button",{onClick:r.onNextClick,className:l("ias-bnr__controls-btn","ias-bnr__controls-btn--next","ias-bnr__controls-btn--end",F["slider__controls-btn"],F["slider__controls-btn--end"],{[F["slider__controls-btn--disabled"]]:r.nextDisabled,[F["slider__controls-btn--dir--rtl"]]:"rtl"===r.langDirection,"ias-bnr__controls-btn--disabled":r.nextDisabled}),children:e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",children:e("path",{d:"M13.025 1l-2.847 2.828 6.176 6.176h-16.354v3.992h16.354l-6.176 6.176 2.847 2.828 10.975-11z",fill:"currentColor"})})})]});class U{constructor(e){Object.defineProperty(this,"slider",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_enabled",{enumerable:!0,configurable:!0,writable:!0,value:!1})}get enabled(){return this._enabled}update(){const e=this.slider.options.loop&&this.canUseLoop();this._enabled?e||(this._enabled=!1,this.destroy()):e&&(this._enabled=!0)}applyLoopFix({targetIndex:e,direction:t}){if(!this.enabled)return!1;const r="next"===t||!t,n="prev"!==t&&t?[]:this.getPrependSlidesIndexes(e),i=r?this.getAppendSlidesIndexes(e):[];return this.moveSlides(n,i),this.adjustPosition(n,i),n.length>0||i.length>0}destroy(){this.resetSlidesOrder()}resetSlidesOrder(){const e=[];this.slider.slides.forEach(t=>{const r=+t.dataset.index;e[r]=t}),e.forEach(e=>{this.slider.track.append(e)})}canUseLoop(){return!(this.slider.slides.length<this.slider.options.slidesPerView+1&&(console.warn("IAS Banners Loop Warning: The number of slides is not enough for loop mode, it will be disabled or not function properly. You need to add more slides (or make duplicates) or lower the values of slidesPerView parameters"),1))}getPrependSlidesIndexes(e){const t=this.slider.track.children,r=[];if(e<1)for(let n=0;n<1-e;n++){const e=t.length-n-1;r.push(e)}return r}getAppendSlidesIndexes(e){const t=[];if(e+this.slider.options.slidesPerView>this.slider.slides.length-1){const r=Math.max(e-(this.slider.slides.length-2),1);for(let e=0;e<r;e++){const r=e;t.push(r)}}return t}moveSlides(e,t){const r=this.slider.track,n=this.slider.slides.slice();e.forEach(e=>{r.prepend(n[e])}),t.forEach(e=>{r.append(n[e])})}adjustPosition(e,t){e.length>0?this.slider.slideTo(this.slider.activeIndex+e.length,0):t.length>0&&this.slider.slideTo(this.slider.activeIndex-t.length,0)}}var q;!function(e){e.TouchStart="touchStart",e.TouchMove="touchMove",e.TouchEnd="touchEnd",e.ReachStart="reachStart",e.ReachEnd="reachEnd",e.ActiveIndexChange="activeIndexChange",e.RealIndexChnage="realIndexChange",e.TransitionStart="transitionStart",e.TransitionEnd="transitionend",e.Resize="resize",e.SlidesUpdated="slidesUpdated",e.AutoplayTimeLeft="autoplayTimeLeft",e.AutoplayTimerTick="autoplayTimerTick"}(q||(q={}));class H{constructor(e,t){Object.defineProperty(this,"slider",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"loopModule",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"startPosition",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"startTranslate",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"isTouched",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_isMoved",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_enabled",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"startDirection",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"onTouchStart",{enumerable:!0,configurable:!0,writable:!0,value:e=>{if(this.slider.animating||!this._enabled)return;e.stopPropagation();const{startPosition:t,startTranslate:r}=this.getTouchStartState(e);this.startPosition=t,this.startTranslate=r,this.isTouched=!0,this.setGrabCursor(!1),this.slider.autoplay.pause()}}),Object.defineProperty(this,"onTouchMove",{enumerable:!0,configurable:!0,writable:!0,value:e=>{if(!this.isTouched)return;e.stopPropagation();const t=this.getTouchDiff(e);if(!(Math.abs(t)>20||this._isMoved))return;this.setGrabCursor(!0),this._isMoved||(this.slider.emit(q.TouchStart),this.slider.autoplay.pause(),this.slider.lockActiveIndex(),this.startDirection=this.getSwipeDirection(t)),this._isMoved=!0;const r="next"===this.startDirection?20:-20;this.slider.emit(q.TouchMove);let n=this.startTranslate+t+r;this.applyLoopFix(n),n=this.startTranslate+t+r,this.setTranslate(n)}}),Object.defineProperty(this,"onTouchEnd",{enumerable:!0,configurable:!0,writable:!0,value:()=>{this.isTouched&&(this.slider.unlockActiveIndex(),this.updateActiveIndex(),this.unsetGrabCursor(),this.isTouched=!1,this._isMoved=!1,this.slider.emit(q.TouchEnd),this.slider.autoplay.resume())}}),this.slider.track.addEventListener("mousedown",this.onTouchStart,{passive:!0}),document.addEventListener("mousemove",this.onTouchMove,{passive:!0}),document.addEventListener("mouseup",this.onTouchEnd),this.slider.track.addEventListener("touchstart",this.onTouchStart,{passive:!0}),document.addEventListener("touchmove",this.onTouchMove,{passive:!0}),document.addEventListener("touchend",this.onTouchEnd)}get isMoved(){return this._isMoved}enable(){this._enabled=!0}disable(){this._enabled=!1}enableHorizontalSwipeGesture(){this._enabled=!0}disableHorizontalSwipeGesture(){this._enabled=!1}enableVerticalSwipeGesture(){this._enabled=!0}disableVerticalSwipeGesture(){this._enabled=!1}destroy(){this.slider.track.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd),this.slider.track.removeEventListener("mousedown",this.onTouchStart),document.removeEventListener("mousemove",this.onTouchMove),document.removeEventListener("mouseup",this.onTouchEnd)}getTouchStartState(e){let t=0,r=0;return"row"===this.slider.options.direction?(t=e instanceof MouseEvent?e.pageX:e.touches[0].clientX,r=this.slider.currentTranslateX):(t=e instanceof MouseEvent?e.pageY:e.touches[0].clientY,r=this.slider.currentTranslateY),{startPosition:t,startTranslate:r}}getTouchDiff(e){let t=0;return"row"===this.slider.options.direction?(t=(e instanceof MouseEvent?e.pageX:e.touches[0].clientX)-this.startPosition,t*=1):(t=(e instanceof MouseEvent?e.pageY:e.touches[0].clientY)-this.startPosition,t*=1),t}setTranslate(e){e=this.applyEdgeResistance(e),this.slider.setTranslate(e)}applyLoopFix(e){if(!this.loopModule.enabled)return;e=this.slider.langDirSign*-e;const t=this.slider.langDirSign*(this.slider.slideSize+this.slider.options.spaceBetween),r=this.slider.getMinTranslate(),n=Math.abs(this.slider.getSlideOffset(this.slider.slides.length-this.slider.options.slidesPerView));e<r?this.loopModule.applyLoopFix({targetIndex:0,direction:"prev"})&&(this.startTranslate-=t):e>n&&this.loopModule.applyLoopFix({targetIndex:this.slider.slides.length-this.slider.options.slidesPerView,direction:"next"})&&(this.startTranslate+=t)}updateActiveIndex(){if(!this.slider.slides.length)return;const{currentTranslate:e,options:t}=this.slider,r=this.slider.slideSize+t.spaceBetween;let n=this.slider.langDirSign*-Math.round(e/r);const i=this.slider.totalPages-1;n=Math.min(i,Math.max(0,n)),this.slider.slideTo(n)}setGrabCursor(e){this.slider.track.style.cursor="move",this.slider.track.style.cursor=e?"grabbing":"grab"}unsetGrabCursor(){this.slider.track.style.cursor=""}getResistanceCoeff(e){const t=Math.min(Math.abs(e)/(.5*this.slider.slideSize),1);return.3+.7*Math.exp(3*-t)}applyEdgeResistance(e){if(this.loopModule.enabled)return e;const t=this.slider.langDirSign,r=-t*e,n=this.slider.getMinTranslate(),i=this.slider.getMaxTranslate();let a=r;if(a>i){const e=a-i;a=i+e*this.getResistanceCoeff(e)}else if(a<n){const e=n-a;a=n-e*this.getResistanceCoeff(e)}return-t*a}getSwipeDirection(e){return this.slider.langDirSign*e>0?"prev":"next"}}var $,G=g(46);!function(e){e.Start="start",e.Stop="stop",e.Pause="pause",e.Resume="resume",e.Progress="progress",e.Complete="complete"}($||($={}));class X extends G.EventEmitter{constructor(){super(...arguments),Object.defineProperty(this,"timerId",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"currentProgress",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"progressBeforePause",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"timerPaused",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"timeout",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"isCompleted",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"enabled",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"rafId",{enumerable:!0,configurable:!0,writable:!0,value:0})}get started(){return!this.isCompleted}get paused(){return this.timerPaused}setTimer(e){0!==e?(this.timerId=setTimeout(()=>this.complete({}),e),this.currentProgress=0,this.runTimerTicks(e)):this.forceEnd()}start(e){this.timerPaused||(this.stop(),this.progressBeforePause=0,this.timeout=e,this.enabled&&(this.isCompleted=!1,this.emit($.Start),this.setTimer(e)))}restart(){this.stop(),this.start(this.timeout)}stop(){this.isCompleted||(this.clearTimer(),this.emit($.Stop),this.isCompleted=!0,this.timerPaused=!1)}pause(){this.isCompleted||(this.timerPaused=!0,this.clearTimer(),this.progressBeforePause=this.currentProgress,this.emit($.Pause))}resume(){if(!this.timerPaused)return;this.timerPaused=!1;const e=1-this.progressBeforePause,t=this.timeout*e;this.setTimer(t),this.emit($.Resume)}forceEnd(){this.complete({forceEnd:!0})}disable(){this.enabled=!1,this.stop()}enable(){this.enabled=!0,this.start(this.timeout)}complete({forceEnd:e=!1}){this.isCompleted=!0,this.progressBeforePause=0,this.clearTimer(),this.emit($.Complete,{forceEnd:e})}clearTimer(){cancelAnimationFrame(this.rafId),null!==this.timerId&&(clearTimeout(this.timerId),this.timerId=null)}updateProgress(e){const t=1-this.progressBeforePause;this.currentProgress=this.progressBeforePause+e*t;const r=100*this.currentProgress;this.emit($.Progress,{percents:r,totalTime:this.timeout,currentTime:this.currentProgress*this.timeout})}runTimerTicks(e){const t=performance.now(),r=n=>{let i=(n-t)/e;i>1&&(i=1);const a=i;this.updateProgress(a),i<1&&(this.rafId=requestAnimationFrame(r))};this.rafId=requestAnimationFrame(r)}}class Y{constructor(e,t){Object.defineProperty(this,"slider",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"loopModule",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"timer",{enumerable:!0,configurable:!0,writable:!0,value:new X}),Object.defineProperty(this,"delay",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"handleTimerComplete",{enumerable:!0,configurable:!0,writable:!0,value:({forceEnd:e})=>{e||this.slider.emit(q.AutoplayTimeLeft)}}),Object.defineProperty(this,"handleTimerProgress",{enumerable:!0,configurable:!0,writable:!0,value:e=>{this.slider.emit(q.AutoplayTimerTick,{currentTime:e.currentTime,totalTime:e.totalTime,percents:e.percents})}}),this.timer.on($.Complete,this.handleTimerComplete),this.timer.on($.Progress,this.handleTimerProgress)}get paused(){return this.timer.paused}start(){this.slider.options.autoplay&&(this.stop(),this.timer.start(this.delay))}stop(){this.timer.stop()}pause(){this.slider.options.autoplay&&this.timer.pause()}resume(){this.slider.options.autoplay&&this.timer.resume()}setDelay(e){this.delay=e}destroy(){this.timer.off($.Complete,this.handleTimerComplete),this.timer.off($.Progress,this.handleTimerProgress),this.stop()}}class Q extends G.EventEmitter{constructor(e,t={}){super(),Object.defineProperty(this,"track",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"container",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"options",{enumerable:!0,configurable:!0,writable:!0,value:{autoplay:!1,speed:300,delay:3e3,loop:!1,slidesPerView:1,spaceBetween:0,initialSlide:0,updateOnWindowResize:!0,direction:"row",langDirection:"ltr",allowTouchMove:!0}}),Object.defineProperty(this,"isAnimating",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_activeIndex",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_realIndex",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_currentTranslateX",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_currentTranslateY",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_reachEnd",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"_reachStart",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"loopModule",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"touchModule",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_slideWidth",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_slideHeight",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"autoplay",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_activeIndexLocked",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"handleResize",{enumerable:!0,configurable:!0,writable:!0,value:()=>{this.updateSize(),this.emit(q.Resize)}}),this.track=e,this.container=e.parentElement,this.loopModule=new U(this),this.touchModule=new H(this,this.loopModule),this.autoplay=new Y(this,this.loopModule),this.options.updateOnWindowResize&&window.addEventListener("resize",this.handleResize),this.collectSlides(),this.update(t)}get langDirSign(){return"column"===this.options.direction||"ltr"===this.options.langDirection?1:-1}get activeIndex(){return this._activeIndex}get realIndex(){return this._realIndex}get reachEnd(){return this._reachEnd}get reachStart(){return this._reachStart}get slidesEl(){return this.track}get slides(){return Array.from(this.track.children)}get allSlides(){return this.slides}get animating(){return this.isAnimating}get currentTranslateX(){return this._currentTranslateX}get currentTranslateY(){return this._currentTranslateY}get currentTranslate(){return"row"===this.options.direction?this._currentTranslateX:this._currentTranslateY}get isMoved(){return this.touchModule.isMoved}get slideWidth(){return this._slideWidth}get slideHeight(){return this._slideHeight}get slideSize(){return"row"===this.options.direction?this.slideWidth:this.slideHeight}get totalPages(){return this.loopModule.enabled?this.slides.length:Math.max(this.slides.length-this.options.slidesPerView+1,1)}async slideToLoop(e,t=this.options.speed){if(!this.loopModule.enabled)return this.slideTo(e,t);if(this.isAnimating)return;const r=this.getPhysicalIndexByRealIndex(e),n=this.slides.length-r<this.options.slidesPerView,i=r-this._activeIndex-1<this.options.slidesPerView?"next":"prev";if(n){const e="next"===i?r+1:r-this.slides.length+1;this.loopModule.applyLoopFix({targetIndex:e,direction:i})}const a=this.getPhysicalIndexByRealIndex(e);requestAnimationFrame(()=>this.slideTo(a))}async slideTo(e,t=this.options.speed){e=this.clamp(e,0,this.totalPages-1),this.isAnimating||(this.isAnimating=!0,await this.performTranslateToSlide(e,t),this._activeIndexLocked||this.updateIndexes(e),this.isAnimating=!1)}lockActiveIndex(){this._activeIndexLocked=!0}unlockActiveIndex(){this._activeIndexLocked=!1}toNextSlide(){this.isAnimating||(this.loopModule.enabled?this.toNextSlideByLoop():this.slideTo(this.normalizeIndex(this._realIndex+1)))}toPrevSlide(){this.isAnimating||(this.loopModule.enabled?this.toPrevSlideByLoop():this.slideTo(this.normalizeIndex(this._realIndex-1)))}update(e){this.options=this.normalizeOptions(Object.assign(Object.assign({},this.options),e)),this.setupTrackStyles(),this.updateSize(),this.loopModule.update(),this.testAttraction(),this.options.allowTouchMove?this.touchModule.enable():this.touchModule.disable()}destroy(){window.removeEventListener("resize",this.handleResize),this.autoplay.destroy(),this.touchModule.destroy(),this.track.removeAttribute("style"),this._activeIndex=0,this._activeIndexLocked=!1,this.isAnimating=!1}isSlideVisible(e){const t=this.getPhysicalIndexByRealIndex(e);return t>=this._activeIndex&&t<this._activeIndex+this.options.slidesPerView}getVisibleSlideIndexes(){return this.slides.slice(this._activeIndex,this._activeIndex+this.options.slidesPerView).map(e=>+e.dataset.index)}getPhysicalIndexByRealIndex(e){const t=this.normalizeIndex(e);return this.slides.findIndex(e=>e.dataset.index===t.toString())}getMinTranslate(){return 0}getMaxTranslate(){return Math.abs(this.getSlideOffset(this.totalPages-1))}setTranslate(e){"row"===this.options.direction?(this.track.style.transform=`translate3d(${e}px, 0px, 0px)`,this._currentTranslateX=e,this._currentTranslateY=0):(this.track.style.transform=`translate3d(0px, ${e}px, 0px)`,this._currentTranslateX=0,this._currentTranslateY=e),this.testAttraction()}enableHorizontalSwipeGesture(){this.touchModule.enableHorizontalSwipeGesture()}disableHorizontalSwipeGesture(){this.touchModule.disableHorizontalSwipeGesture()}getSlideOffset(e){return this.slides.length?-e*(("row"===this.options.direction?this.slides[0].clientWidth:this.slides[0].clientHeight)+this.options.spaceBetween):0}updateSize(){const e=this.slideWidth,t=this.slideHeight;"row"===this.options.direction?this.calculateSlideWidths():this.calculateSlideHeight(),e===this.slideWidth&&t===this.slideHeight||this.emit(q.SlidesUpdated),this.slideTo(this._activeIndex,0)}getTrackWidth(){return this.track.clientWidth-this.options.spaceBetween*(this.options.slidesPerView-1)}getTrackHeight(){return this.track.clientHeight-this.options.spaceBetween*(this.options.slidesPerView-1)}toNextSlideByLoop(){this.isAnimating||(this.loopModule.applyLoopFix({targetIndex:this._activeIndex,direction:"next"}),requestAnimationFrame(()=>this.slideTo(this._activeIndex+1)))}toPrevSlideByLoop(){this.isAnimating||(this.loopModule.applyLoopFix({targetIndex:this._activeIndex,direction:"prev"}),requestAnimationFrame(()=>this.slideTo(this._activeIndex-1)))}updateIndexes(e){if(!this.slides.length)return;const t=+this.slides[e].dataset.index,r=this._realIndex,n=this._activeIndex;this._realIndex=t,this._activeIndex=e,r!==t&&this.emit(q.RealIndexChnage,t),n!==e&&this.emit(q.ActiveIndexChange,e)}setupTrackStyles(){Object.assign(this.track.style,{display:"flex",transition:`transform ${this.options.speed}ms ease`,gap:`${this.options.spaceBetween}px`})}collectSlides(){this.slides.forEach((e,t)=>{e.dataset.index=t.toString()})}calculateSlideWidths(){this._slideWidth=Math.ceil(this.getTrackWidth()/this.options.slidesPerView),this.slides.forEach(e=>{e.style.width=`${this._slideWidth}px`,e.style.height=""})}calculateSlideHeight(){this._slideHeight=Math.ceil(this.getTrackHeight()/this.options.slidesPerView),this.slides.forEach(e=>{e.style.height=`${this._slideHeight}px`,e.style.width=""})}translateSlidesTrack(e,t){this.track.style.transitionDuration=`${t}ms`,this.setTranslate(this.langDirSign*this.getSlideOffset(e))}async performTranslateToSlide(e,t){if(0===t)this.translateSlidesTrack(e,0);else{if(this._activeIndex===e&&!this.touchModule.isMoved)return;this.translateSlidesTrack(e,t),this.emit(q.TransitionStart),await this.waitTransitionEnd(),this.emit(q.TransitionEnd)}}waitTransitionEnd(){return new Promise(e=>{this.track.addEventListener("transitionend",t=>{"transform"===t.propertyName&&(this.track.style.transitionDuration="0ms",e())},{once:!0})})}testAttraction(){const e=this.getMinTranslate(),t=this.getMaxTranslate();let r=!this.loopModule.enabled&&this.langDirSign*this.currentTranslate>=e,n=!this.loopModule.enabled&&this.langDirSign*-this.currentTranslate>=t;this.options.slidesPerView===this.slides.length&&(r=!0,n=!0),r!==this._reachStart&&(this._reachStart=r,this.emit(q.ReachStart,r)),n!==this._reachEnd&&(this._reachEnd=n,this.emit(q.ReachEnd,n))}normalizeOptions(e){var t,r,n,i,a,s,o,l,c,d,h;return{autoplay:null!==(t=e.autoplay)&&void 0!==t?t:this.options.autoplay,speed:null!==(r=e.speed)&&void 0!==r?r:this.options.speed,delay:null!==(n=e.delay)&&void 0!==n?n:this.options.delay,loop:null!==(i=e.loop)&&void 0!==i?i:this.options.loop,slidesPerView:Math.max(Math.min(this.track.children.length,null!==(a=e.slidesPerView)&&void 0!==a?a:this.options.slidesPerView),0),spaceBetween:null!==(s=e.spaceBetween)&&void 0!==s?s:this.options.spaceBetween,initialSlide:null!==(o=e.initialSlide)&&void 0!==o?o:this.options.initialSlide,updateOnWindowResize:null!==(l=e.updateOnWindowResize)&&void 0!==l?l:this.options.updateOnWindowResize,direction:null!==(c=e.direction)&&void 0!==c?c:this.options.direction,allowTouchMove:null!==(d=e.allowTouchMove)&&void 0!==d?d:this.options.allowTouchMove,langDirection:null!==(h=e.langDirection)&&void 0!==h?h:this.options.langDirection}}normalizeIndex(e){const t=this.slides.length;return(e%t+t)%t}clamp(e,t,r){return Math.max(t,Math.min(e,r))}}const K=o(r=>{const[i,o]=s(null),c=a(null);return n(()=>{if(!c.current||!r.slidesCount)return;const e=new Q(c.current,{autoplay:r.autoplay,speed:r.speed,loop:r.loop,slidesPerView:r.slidesPerView,spaceBetween:r.spaceBetween,allowTouchMove:r.allowTouchMove,direction:r.direction,langDirection:r.langDirection});return r.onInit(e),o(e),()=>{null==e||e.destroy()}},[r.slidesCount]),n(()=>{i&&i.update({autoplay:r.autoplay,speed:r.speed,loop:r.loop,slidesPerView:r.slidesPerView,spaceBetween:r.spaceBetween,allowTouchMove:r.allowTouchMove,direction:r.direction,langDirection:r.langDirection})},[i,r.autoplay,r.speed,r.loop,r.langDirection,r.slidesPerView,r.spaceBetween,r.slidesCount,r.allowTouchMove,r.direction]),t("div",{className:l("ias-bnr-slider",z.slider,{[z["slider--vertical"]]:"column"===r.direction}),children:[e("div",{dir:r.langDirection,ref:c,className:l("ias-bnr-slider__track",z.slider__track),children:r.children}),i&&r.pagination.enabled&&e(D,{direction:r.direction,langDirection:r.langDirection,totalPages:i.totalPages,activeIndex:i.realIndex,onClick:e=>{r.loop?i.slideToLoop(e):i.slideTo(e)}}),i&&r.navigation.enabled&&e(V,{direction:r.direction,langDirection:r.langDirection,onPrevClick:()=>{i.toPrevSlide()},onNextClick:()=>{i.toNextSlide()},nextDisabled:i.reachEnd,prevDisabled:i.reachStart})]})}),J=t=>e("div",{className:l(z.slider__slide,t.className),style:t.style,children:t.children});class Z{constructor(e){Object.defineProperty(this,"slider",{enumerable:!0,configurable:!0,writable:!0,value:e})}isPaused(){return this.slider.autoplay.paused}resume(){this.slider.autoplay.resume()}pause(){this.slider.autoplay.pause()}start(){this.slider.autoplay.start()}setDelay(e){this.slider.autoplay.setDelay(e)}stop(){this.slider.autoplay.stop()}}class ee{constructor(e){Object.defineProperty(this,"slider",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"autoplay",{enumerable:!0,configurable:!0,writable:!0,value:new Z(this.slider)})}getTotalPages(){return this.slider.totalPages}getActiveIndex(){return this.slider.realIndex}toNextSlide(){this.slider.isMoved||this.slider.toNextSlide()}toPrevSlide(){this.slider.isMoved||this.slider.toPrevSlide()}slideTo(e,t){this.slider.isMoved||this.slider.slideToLoop(e,t)}enableHorizontalSwipeGesture(){this.slider.enableHorizontalSwipeGesture()}disableHorizontalSwipeGesture(){this.slider.disableHorizontalSwipeGesture()}updateSize(){this.slider.updateSize()}}var te=function(e,t,r){for(var n=arguments.length>2,i=0;i<t.length;i++)r=n?t[i].call(e,r):t[i].call(e);return n?r:void 0};let re=(()=>{var e,t;let r,n=[],i=[];return e=class{get _context(){return function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)}(this,t,"f")}set _context(e){!function(e,t,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");"a"===n?i.call(e,r):i?i.value=r:t.set(e,r)}(this,t,e,"f")}constructor(e){t.set(this,te(this,n,void 0)),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:te(this,i)}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"displayFrom",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"displayTo",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"appearance",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"slides",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_wasShown",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_frequencyLimit",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_openTime",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_isOnceOpened",{enumerable:!0,configurable:!0,writable:!0,value:!1}),this.id=e.id,this.name=e.name,this.displayFrom=e.displayFrom,this.displayTo=e.displayTo,this.slides=e.slides,this._context=e.context,this.appearance=e.appearance}get context(){return this._context}get withinDisplayTimeRange(){const e=Math.trunc(Date.now()/1e3);return(!this.displayFrom||e>=this.displayFrom)&&(!this.displayTo||e<=this.displayTo)}get wasShown(){return this._wasShown}get frequencyLimitTimeExceeded(){return null===this._frequencyLimit?this._isOnceOpened:0!==this._frequencyLimit&&Math.trunc(this.timeSinceLastShow/1e3)<=this._frequencyLimit}get timeSinceLastShow(){return Date.now()-this._openTime}get openTime(){return this._openTime}updatePlaceholders(e){for(const t of this.slides)t.updatePlaceholders(e)}markWasShown(){this._wasShown=!0}markAsOpened(){this._openTime=Date.now(),this._isOnceOpened=!0}},t=new WeakMap,(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;r=[h],function(e,t,r,n,i,a){function s(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var o,l=n.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?n.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,n.name):{}),u=!1,p=r.length-1;p>=0;p--){var b={};for(var f in n)b[f]="access"===f?{}:n[f];for(var f in n.access)b.access[f]=n.access[f];b.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(s(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],b);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(o=s(m.get))&&(h.get=o),(o=s(m.set))&&(h.set=o),(o=s(m.init))&&i.unshift(o)}else(o=s(m))&&("field"===l?i.unshift(o):h[c]=o)}d&&Object.defineProperty(d,n.name,h),u=!0}(e,null,r,{kind:"accessor",name:"_context",static:!1,private:!1,access:{has:e=>"_context"in e,get:e=>e._context,set:(e,t)=>{e._context=t}},metadata:t},n,i),t&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),e})();class ne{constructor(e){var t;Object.defineProperty(this,"contentRatio",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"background",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.contentRatio=null!==(t=e.content_ratio)&&void 0!==t?t:1,this.background=this.mapBackgroundDtoToModel(e.background)}mapBackgroundDtoToModel(e){if(!e||0===e.alpha)return"transparent";if("solid"in e)return this.applyAlphaToColor(e.solid,e.alpha);if("linear_gradient"in e){const{angle:t,color_step_list:r}=e.linear_gradient;return`linear-gradient(${t}deg, ${r.map(t=>`${this.applyAlphaToColor(t.color,e.alpha)} ${t.position}%`).join(", ")})`}return"transparent"}applyAlphaToColor(e,t){if(e.startsWith("#")){const r=e.slice(1),n=3===r.length;return`rgba(${parseInt(n?r[0]+r[0]:r.slice(0,2),16)}, ${parseInt(n?r[1]+r[1]:r.slice(2,4),16)}, ${parseInt(n?r[2]+r[2]:r.slice(4,6),16)}, ${t})`}return e}}class ie{constructor(e,t){Object.defineProperty(this,"widgetsData",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"style",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.style=t.style,this.widgetsData=this.mapBannerContextDto(e,t)}mapBannerContextDto(e,t){var r;const n={},i=null!==(r=t.widgetsData)&&void 0!==r?r:{};for(const t in i)Array.isArray(i[t])||(n[t]=i[t][e]);return n}updateNarrativeSavedData(e){this.widgetsData._narrative_saved_data=e}}function ae(e,t,r){return String(e).replace(new RegExp(function(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(t),"g"),()=>r)}var se=function(e,t,r){for(var n=arguments.length>2,i=0;i<t.length;i++)r=n?t[i].call(e,r):t[i].call(e);return n?r:void 0};let oe=(()=>{var e,t;let r,n=[],i=[];return e=class{get _html(){return function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)}(this,t,"f")}set _html(e){!function(e,t,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");"a"===n?i.call(e,r):i?i.value=r:t.set(e,r)}(this,t,e,"f")}get html(){return this._html}get payload(){return this._payload}constructor(e){t.set(this,se(this,n,void 0)),Object.defineProperty(this,"_payload",{enumerable:!0,configurable:!0,writable:!0,value:se(this,i)}),this._html=this.replaceSlideNonce(e.html),this._payload=e.payload}updatePlaceholders(e){let t=this._html;for(const r of e)t=ae(t,`%${r.key}%`,r.value);this._html=t}replaceSlideNonce(e){var t;return ae(e,"{{nonce}}",null!==(t=C())&&void 0!==t?t:"")}},t=new WeakMap,(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;r=[h],function(e,t,r,n,i,a){function s(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var o,l=n.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?n.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,n.name):{}),u=!1,p=r.length-1;p>=0;p--){var b={};for(var f in n)b[f]="access"===f?{}:n[f];for(var f in n.access)b.access[f]=n.access[f];b.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(s(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],b);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(o=s(m.get))&&(h.get=o),(o=s(m.set))&&(h.set=o),(o=s(m.init))&&i.unshift(o)}else(o=s(m))&&("field"===l?i.unshift(o):h[c]=o)}d&&Object.defineProperty(d,n.name,h),u=!0}(e,null,r,{kind:"accessor",name:"_html",static:!1,private:!1,access:{has:e=>"_html"in e,get:e=>e._html,set:(e,t)=>{e._html=t}},metadata:t},n,i),t&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),e})();var le=function(e,t,r){for(var n=arguments.length>2,i=0;i<t.length;i++)r=n?t[i].call(e,r):t[i].call(e);return n?r:void 0};let ce=(()=>{var e,t;let r,n=[],i=[];return e=class{get _banners(){return function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)}(this,t,"f")}set _banners(e){!function(e,t,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");"a"===n?i.call(e,r):i?i.value=r:t.set(e,r)}(this,t,e,"f")}constructor(e){Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"style",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),t.set(this,le(this,n,[])),le(this,i),this.id=e.id,this._banners=e.banners,this.style=e.style,this.updatePlaceholders(e.placeholders)}get banners(){return this._banners}updatePlaceholders(e){for(const t of this._banners)t.updatePlaceholders(e)}},t=new WeakMap,(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;r=[h],function(e,t,r,n,i,a){function s(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var o,l=n.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?n.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,n.name):{}),u=!1,p=r.length-1;p>=0;p--){var b={};for(var f in n)b[f]="access"===f?{}:n[f];for(var f in n.access)b.access[f]=n.access[f];b.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(s(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],b);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(o=s(m.get))&&(h.get=o),(o=s(m.set))&&(h.set=o),(o=s(m.init))&&i.unshift(o)}else(o=s(m))&&("field"===l?i.unshift(o):h[c]=o)}d&&Object.defineProperty(d,n.name,h),u=!0}(e,null,r,{kind:"accessor",name:"_banners",static:!1,private:!1,access:{has:e=>"_banners"in e,get:e=>e._banners,set:(e,t)=>{e._banners=t}},metadata:t},n,i),t&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),e})();const de=(e,t)=>{if("number"==typeof e)return e;if("string"==typeof e){const t=parseFloat(e);if(!isNaN(t))return t}return t};var he=function(e,t,r,n,i,a){function s(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var o,l=n.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?n.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,n.name):{}),u=!1,p=r.length-1;p>=0;p--){var b={};for(var f in n)b[f]="access"===f?{}:n[f];for(var f in n.access)b.access[f]=n.access[f];b.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(s(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],b);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(o=s(m.get))&&(h.get=o),(o=s(m.set))&&(h.set=o),(o=s(m.init))&&i.unshift(o)}else(o=s(m))&&("field"===l?i.unshift(o):h[c]=o)}d&&Object.defineProperty(d,n.name,h),u=!0},ue=function(e,t,r){for(var n=arguments.length>2,i=0;i<t.length;i++)r=n?t[i].call(e,r):t[i].call(e);return n?r:void 0},pe=function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)},be=function(e,t,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(e,r):i?i.value=r:t.set(e,r),r};let fe=(()=>{var e,t;let r,n=[],i=[];return e=class{get borderRadius(){return pe(this,t,"f")}set borderRadius(e){be(this,t,e,"f")}update(e){this.borderRadius=de(null==e?void 0:e.borderRadius,this.borderRadius)}constructor(){t.set(this,ue(this,n,12)),ue(this,i)}},t=new WeakMap,(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;r=[h],he(e,null,r,{kind:"accessor",name:"borderRadius",static:!1,private:!1,access:{has:e=>"borderRadius"in e,get:e=>e.borderRadius,set:(e,t)=>{e.borderRadius=t}},metadata:t},n,i),t&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),e})(),me=(()=>{var e,t,r,n,i,a,s,o,l,c;let d,u,p,b,f,m,v,g,w,y=[],_=[],P=[],S=[],T=[],E=[],x=[],O=[],I=[],C=[],L=[],j=[],k=[],B=[],A=[],M=[],R=[],D=[];return e=class{get loop(){return pe(this,t,"f")}set loop(e){be(this,t,e,"f")}get gap(){return pe(this,r,"f")}set gap(e){be(this,r,e,"f")}get autoplay(){return pe(this,n,"f")}set autoplay(e){be(this,n,e,"f")}get animationSpeed(){return pe(this,i,"f")}set animationSpeed(e){be(this,i,e,"f")}get slidesPerView(){return pe(this,a,"f")}set slidesPerView(e){be(this,a,e,"f")}get navigation(){return pe(this,s,"f")}set navigation(e){be(this,s,e,"f")}get pagination(){return pe(this,o,"f")}set pagination(e){be(this,o,e,"f")}get direction(){return pe(this,l,"f")}set direction(e){be(this,l,e,"f")}get allowTouchMove(){return pe(this,c,"f")}set allowTouchMove(e){be(this,c,e,"f")}constructor(e){t.set(this,ue(this,y,!0)),r.set(this,(ue(this,_),ue(this,P,16))),n.set(this,(ue(this,S),ue(this,T,!0))),i.set(this,(ue(this,E),ue(this,x,300))),a.set(this,(ue(this,O),ue(this,I,1))),s.set(this,(ue(this,C),ue(this,L,{enabled:!0}))),o.set(this,(ue(this,j),ue(this,k,{enabled:!0}))),l.set(this,(ue(this,B),ue(this,A,"row"))),c.set(this,(ue(this,M),ue(this,R,!0))),Object.defineProperty(this,"banner",{enumerable:!0,configurable:!0,writable:!0,value:(ue(this,D),new fe)}),e&&this.update(e)}update(e){var t,r,n,i,a,s,o,l;this.loop=null!==(t=null==e?void 0:e.loop)&&void 0!==t?t:this.loop,this.gap=de(null==e?void 0:e.gap,this.gap),this.autoplay=null!==(r=null==e?void 0:e.autoplay)&&void 0!==r?r:this.autoplay,this.animationSpeed=de(null==e?void 0:e.animationSpeed,this.animationSpeed),this.slidesPerView=Math.max(de(null==e?void 0:e.slidesPerView,this.slidesPerView),0),this.navigation={enabled:null!==(i=null===(n=null==e?void 0:e.navigation)||void 0===n?void 0:n.enabled)&&void 0!==i?i:this.navigation.enabled},this.pagination={enabled:null!==(s=null===(a=null==e?void 0:e.pagination)||void 0===a?void 0:a.enabled)&&void 0!==s?s:this.pagination.enabled},this.direction=null!==(o=e.direction)&&void 0!==o?o:this.direction,this.allowTouchMove=null!==(l=e.allowTouchMove)&&void 0!==l?l:this.allowTouchMove,this.banner.update(e.banner)}},t=new WeakMap,r=new WeakMap,n=new WeakMap,i=new WeakMap,a=new WeakMap,s=new WeakMap,o=new WeakMap,l=new WeakMap,c=new WeakMap,(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;d=[h],u=[h],p=[h],b=[h],f=[h],m=[h],v=[h],g=[h],w=[h],he(e,null,d,{kind:"accessor",name:"loop",static:!1,private:!1,access:{has:e=>"loop"in e,get:e=>e.loop,set:(e,t)=>{e.loop=t}},metadata:t},y,_),he(e,null,u,{kind:"accessor",name:"gap",static:!1,private:!1,access:{has:e=>"gap"in e,get:e=>e.gap,set:(e,t)=>{e.gap=t}},metadata:t},P,S),he(e,null,p,{kind:"accessor",name:"autoplay",static:!1,private:!1,access:{has:e=>"autoplay"in e,get:e=>e.autoplay,set:(e,t)=>{e.autoplay=t}},metadata:t},T,E),he(e,null,b,{kind:"accessor",name:"animationSpeed",static:!1,private:!1,access:{has:e=>"animationSpeed"in e,get:e=>e.animationSpeed,set:(e,t)=>{e.animationSpeed=t}},metadata:t},x,O),he(e,null,f,{kind:"accessor",name:"slidesPerView",static:!1,private:!1,access:{has:e=>"slidesPerView"in e,get:e=>e.slidesPerView,set:(e,t)=>{e.slidesPerView=t}},metadata:t},I,C),he(e,null,m,{kind:"accessor",name:"navigation",static:!1,private:!1,access:{has:e=>"navigation"in e,get:e=>e.navigation,set:(e,t)=>{e.navigation=t}},metadata:t},L,j),he(e,null,v,{kind:"accessor",name:"pagination",static:!1,private:!1,access:{has:e=>"pagination"in e,get:e=>e.pagination,set:(e,t)=>{e.pagination=t}},metadata:t},k,B),he(e,null,g,{kind:"accessor",name:"direction",static:!1,private:!1,access:{has:e=>"direction"in e,get:e=>e.direction,set:(e,t)=>{e.direction=t}},metadata:t},A,M),he(e,null,w,{kind:"accessor",name:"allowTouchMove",static:!1,private:!1,access:{has:e=>"allowTouchMove"in e,get:e=>e.allowTouchMove,set:(e,t)=>{e.allowTouchMove=t}},metadata:t},R,D),t&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),e})();class ve{constructor(e){Object.defineProperty(this,"payload",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"eventId",{enumerable:!0,configurable:!0,writable:!0,value:p()})}get type(){return"view"}toQueryParams(){return{ei:this.eventId,ii:this.payload.iterationId,si:this.payload.slideIndex,st:this.payload.slideTotal}}}class ge{constructor(e){Object.defineProperty(this,"payload",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"eventId",{enumerable:!0,configurable:!0,writable:!0,value:p()})}get type(){return this.payload.type}toQueryParams(){return Object.assign({ei:this.eventId,ii:this.payload.iterationId,si:this.payload.slideIndex,st:this.payload.slideTotal,d:this.payload.durationMs},this.payload.widgetPayload)}}class we{constructor(){Object.defineProperty(this,"autoplay",{enumerable:!0,configurable:!0,writable:!0,value:{isPaused:function(){return!1},resume:function(){},pause:function(){},start:function(){},stop:function(){},setDelay:function(){}}})}updateSize(){}enableHorizontalSwipeGesture(){}disableHorizontalSwipeGesture(){}getTotalPages(){return 1}getActiveIndex(){return 0}toNextSlide(){}toPrevSlide(){}slideTo(e,t){}}var ye,_e=function(e,t,r,n,i,a){function s(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var o,l=n.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?n.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,n.name):{}),u=!1,p=r.length-1;p>=0;p--){var b={};for(var f in n)b[f]="access"===f?{}:n[f];for(var f in n.access)b.access[f]=n.access[f];b.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(s(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],b);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(o=s(m.get))&&(h.get=o),(o=s(m.set))&&(h.set=o),(o=s(m.init))&&i.unshift(o)}else(o=s(m))&&("field"===l?i.unshift(o):h[c]=o)}d&&Object.defineProperty(d,n.name,h),u=!0},Pe=function(e,t,r){for(var n=arguments.length>2,i=0;i<t.length;i++)r=n?t[i].call(e,r):t[i].call(e);return n?r:void 0},Se=function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)},Te=function(e,t,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(e,r):i?i.value=r:t.set(e,r),r};!function(e){e.LoadStart="loadStart",e.LoadEnd="loadEnd",e.LoadError="loadError",e.ActiveIndexChange="activeIndexChange",e.AutoplayTimeLeft="autoplayTimeLeft",e.AutoplayTimerTick="autoplayTimerTick",e.ShowBanner="showBanner",e.ShowBannerFailed="showBannerFailed",e.BannerWidget="bannerWidget"}(ye||(ye={}));let Ee=(()=>{var e,t,r,n,i,a;let s,o,l,c,d,u=G.EventEmitter,p=[],b=[],f=[],m=[],v=[],g=[],w=[],y=[],_=[],P=[];return e=class extends u{get _banners(){return Se(this,t,"f")}set _banners(e){Te(this,t,e,"f")}get _bannerPlace(){return Se(this,r,"f")}set _bannerPlace(e){Te(this,r,e,"f")}get _isLoading(){return Se(this,n,"f")}set _isLoading(e){Te(this,n,e,"f")}get _isLoaded(){return Se(this,i,"f")}set _isLoaded(e){Te(this,i,e,"f")}get _error(){return Se(this,a,"f")}set _error(e){Te(this,a,e,"f")}constructor(e,s,o,l,c){super(),Object.defineProperty(this,"placeId",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"ctx",{enumerable:!0,configurable:!0,writable:!0,value:s}),Object.defineProperty(this,"bannerStatisticService",{enumerable:!0,configurable:!0,writable:!0,value:o}),Object.defineProperty(this,"bannerStore",{enumerable:!0,configurable:!0,writable:!0,value:l}),Object.defineProperty(this,"bannerViewModelFactory",{enumerable:!0,configurable:!0,writable:!0,value:c}),t.set(this,Pe(this,p,[])),r.set(this,(Pe(this,b),Pe(this,f,null))),n.set(this,(Pe(this,m),Pe(this,v,!1))),i.set(this,(Pe(this,g),Pe(this,w,!1))),a.set(this,(Pe(this,y),Pe(this,_,null))),Object.defineProperty(this,"appearance",{enumerable:!0,configurable:!0,writable:!0,value:(Pe(this,P),new me)}),Object.defineProperty(this,"sliderController",{enumerable:!0,configurable:!0,writable:!0,value:new we}),this.ctx.addBannerPlace(this)}get dir(){return this.ctx.getConfig().dir}get id(){return this.placeId}get banners(){return this._banners}get contentRatio(){const e=this._banners.map(e=>e.contentRatio);return this.median(e)}get isLoaded(){return this._isLoaded}get isLoading(){return this._isLoading}get error(){return this._error}get slider(){return this.sliderController}get activeIndex(){return this.sliderController.getActiveIndex()}get activeBanner(){return this._banners[this.activeIndex]}get paginationBullets(){return this.sliderController.getTotalPages()}refreshSizes(){this._banners.forEach(e=>e.refreshSizes())}setSliderController(e){this.sliderController=e}updateAppearance(e){this.appearance.update(e)}resume(){for(const e of this._banners)e.resumeByUser();this.appearance.autoplay&&this.slider.autoplay.resume()}pause(){for(const e of this._banners)e.pauseByUser();this.appearance.autoplay&&this.slider.autoplay.pause()}async reload(){this.bannerStore.removeBannerPlaceById(this.id),await Promise.all(this._banners.map(e=>e.destroy())),this._banners=[],await this.fetchBanners()}destroy(){this.sliderController=new we;for(const e of this._banners)e.destroy();this._banners=[],this.ctx.removeBannerPlace(this)}notifyTimerEnd(){var e;null===(e=this.activeBanner)||void 0===e||e.notifyTimerEnd()}showNext(){this.sliderController.toNextSlide()}showPrevious(){this.sliderController.toPrevSlide()}showByIndex(e,t){this.sliderController.slideTo(e,t)}async updateUserData(e){return this.bannerStore.updateBannerUserData(this.id,e)}async fetchBanners(){try{return(await this.ctx.getConfig()).anonymous?(console.warn("[IAS]: You can't fetch banners in anonymous access mode"),[]):this._isLoading?[]:(this._isLoading=!0,this._isLoaded=!1,this._error=null,this.emit(ye.LoadStart),this._bannerPlace=await this.bannerStore.getBannerPlaceById({placeId:this.placeId}),this._banners=this.filterBannersByTimeRange(this._bannerPlace.banners).map(e=>this.bannerViewModelFactory.create(this,e)),await Promise.allSettled(this._banners.map(e=>e.waitInit())),this._isLoaded=!0,this._banners)}catch(e){throw this.emit(ye.LoadError,e),this._error=e,e}finally{this.emit(ye.LoadEnd,{banners:this._banners.slice()}),this._isLoading=!1}}filterBannersByTimeRange(e){return e.filter(e=>e.withinDisplayTimeRange)}median(e){const t=[...e].sort((e,t)=>e-t),r=Math.floor(t.length/2);return t.length%2==0?(t[r-1]+t[r])/2:t[r]}},t=new WeakMap,r=new WeakMap,n=new WeakMap,i=new WeakMap,a=new WeakMap,(()=>{var t;const r="function"==typeof Symbol&&Symbol.metadata?Object.create(null!==(t=u[Symbol.metadata])&&void 0!==t?t:null):void 0;s=[h],o=[h],l=[h],c=[h],d=[h],_e(e,null,s,{kind:"accessor",name:"_banners",static:!1,private:!1,access:{has:e=>"_banners"in e,get:e=>e._banners,set:(e,t)=>{e._banners=t}},metadata:r},p,b),_e(e,null,o,{kind:"accessor",name:"_bannerPlace",static:!1,private:!1,access:{has:e=>"_bannerPlace"in e,get:e=>e._bannerPlace,set:(e,t)=>{e._bannerPlace=t}},metadata:r},f,m),_e(e,null,l,{kind:"accessor",name:"_isLoading",static:!1,private:!1,access:{has:e=>"_isLoading"in e,get:e=>e._isLoading,set:(e,t)=>{e._isLoading=t}},metadata:r},v,g),_e(e,null,c,{kind:"accessor",name:"_isLoaded",static:!1,private:!1,access:{has:e=>"_isLoaded"in e,get:e=>e._isLoaded,set:(e,t)=>{e._isLoaded=t}},metadata:r},w,y),_e(e,null,d,{kind:"accessor",name:"_error",static:!1,private:!1,access:{has:e=>"_error"in e,get:e=>e._error,set:(e,t)=>{e._error=t}},metadata:r},_,P),r&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:r})})(),e})();const xe=e=>(n(()=>(e.onLoadStart&&e.bannerPlace.on(ye.LoadStart,e.onLoadStart),e.onLoadEnd&&e.bannerPlace.on(ye.LoadEnd,e.onLoadEnd),e.onLoadError&&e.bannerPlace.on(ye.LoadError,e.onLoadError),e.onActiveIndexChange&&e.bannerPlace.on(ye.ActiveIndexChange,e.onActiveIndexChange),e.onAutoplayTimeLeft&&e.bannerPlace.on(ye.AutoplayTimeLeft,e.onAutoplayTimeLeft),e.onAutoplayTimerTick&&e.bannerPlace.on(ye.AutoplayTimerTick,e.onAutoplayTimerTick),e.onShowBanner&&e.bannerPlace.on(ye.ShowBanner,e.onShowBanner),e.onShowBannerFailed&&e.bannerPlace.on(ye.ShowBannerFailed,e.onShowBannerFailed),e.onBannerWidget&&e.bannerPlace.on(ye.BannerWidget,e.onBannerWidget),()=>{e.onLoadStart&&e.bannerPlace.off(ye.LoadStart,e.onLoadStart),e.onLoadEnd&&e.bannerPlace.off(ye.LoadEnd,e.onLoadEnd),e.onLoadError&&e.bannerPlace.off(ye.LoadError,e.onLoadError),e.onActiveIndexChange&&e.bannerPlace.off(ye.ActiveIndexChange,e.onActiveIndexChange),e.onAutoplayTimeLeft&&e.bannerPlace.off(ye.AutoplayTimeLeft,e.onAutoplayTimeLeft),e.onAutoplayTimerTick&&e.bannerPlace.off(ye.AutoplayTimerTick,e.onAutoplayTimerTick),e.onShowBanner&&e.bannerPlace.off(ye.ShowBanner,e.onShowBanner),e.onShowBannerFailed&&e.bannerPlace.off(ye.ShowBannerFailed,e.onShowBannerFailed),e.onBannerWidget&&e.bannerPlace.off(ye.BannerWidget,e.onBannerWidget)}),[e.bannerPlace,e.onLoadStart,e.onLoadError,e.onLoadEnd,e.onActiveIndexChange,e.onAutoplayTimeLeft,e.onAutoplayTimerTick,e.onShowBanner,e.onShowBannerFailed,e.onBannerWidget]),n(()=>{(async e=>{try{await e.fetchBanners()}catch(e){console.error(e)}})(e.bannerPlace)},[e.bannerPlace]),e.bannerPlace.banners),Oe=e=>{n(()=>{e.appearance&&e.bannerPlace.updateAppearance(e.appearance)},[e.bannerPlace,JSON.stringify(e.appearance)])},Ie=({bannerPlace:e,bannerPlaceRef:t})=>{const[r,i]=s(!1),[o,l]=s(null),c=a();return n(()=>{if(e.banners.length)return(async(e=5e3)=>new Promise((r,n)=>{c.current=setTimeout(()=>{n(new Error("[IAS]: Unable to calculate banner place width. Check if you are using ad blockers such as AdBlock, uBlock Origin, etc."))},e);const i=()=>{if(t.current&&t.current.clientWidth>0)return clearTimeout(c.current),void r();requestAnimationFrame(i)};requestAnimationFrame(i)}))().then(()=>{i(!0)}).catch(e=>{l(e),console.error(e)}),()=>{clearTimeout(c.current),i(!1)}},[e.isLoaded,e.banners.length]),{canBeShown:r,error:o}},Ce=o(t=>{const r=a(null),i=xe(t);Oe(t);const{realIndex:o,allowClick:c,slider:d,isAnimating:h,setSlider:u,isMoved:p}=(e=>{const t=a(null),[r,i]=s(!1),[o,l]=s(!1),[c,d]=s(!1),[h,u]=s(!0),[p,b]=s(null),[f,m]=s(0),[v,g]=s(0),[w,y]=s(!0),[_,P]=s(!0),S=()=>{clearTimeout(t.current),u(!1),d(!0),((e,t)=>{e.getVisibleSlideIndexes().map(e=>t.banners[e]).forEach(e=>e.pause())})(p,e)},T=()=>{t.current=setTimeout(()=>u(!0),100),d(!1),((e,t)=>{t.banners.forEach(e=>e.resume())})(0,e)},E=()=>{l(!0),u(!1)},x=()=>{l(!1),u(!0)},O=t=>{g(t),e.emit(ye.ActiveIndexChange,t)},I=e=>{m(e)},C=()=>{p&&y(p.reachStart)},L=()=>{p&&P(p.reachEnd)},j=()=>{},k=()=>{e.refreshSizes(),requestAnimationFrame(()=>{e.refreshSizes(),i(e=>!e)})},B=()=>{e.emit(ye.AutoplayTimeLeft),e.notifyTimerEnd()},A=t=>{e.emit(ye.AutoplayTimerTick,Object.assign(Object.assign({},t),{bannerIndex:e.activeIndex}))};return n(()=>{if(!p)return;const t=new ee(p);e.setSliderController(t)},[e,p]),n(()=>{p&&e&&e.banners[p.realIndex].markAsOpened()},[e,p]),n(()=>{if(p)return p.on(q.TouchStart,S),p.on(q.TouchEnd,T),p.on(q.TransitionStart,E),p.on(q.TransitionEnd,x),p.on(q.RealIndexChnage,O),p.on(q.ActiveIndexChange,I),p.on(q.ReachStart,C),p.on(q.ReachEnd,L),p.on(q.Resize,j),p.on(q.SlidesUpdated,k),p.on(q.AutoplayTimeLeft,B),p.on(q.AutoplayTimerTick,A),C(),L(),()=>{p.off(q.TouchStart,S),p.off(q.TouchEnd,T),p.off(q.TransitionStart,E),p.off(q.TransitionEnd,x),p.off(q.RealIndexChnage,O),p.off(q.ActiveIndexChange,I),p.off(q.ReachStart,C),p.off(q.ReachEnd,L),p.off(q.Resize,j),p.off(q.SlidesUpdated,k),p.off(q.AutoplayTimeLeft,B),p.off(q.AutoplayTimerTick,A)}},[e,p]),{reachStart:w,reachEnd:_,activeIndex:f,realIndex:v,isMoved:c,isAnimating:o,slider:p,setSlider:b,allowClick:h}})(t.bannerPlace),{error:b,canBeShown:f}=Ie({bannerPlace:t.bannerPlace,bannerPlaceRef:r});n(()=>{d&&f&&(d.updateSize(),t.bannerPlace.refreshSizes(),requestAnimationFrame(()=>{t.bannerPlace.refreshSizes()}))},[t.bannerPlace,f]);const m=t.bannerPlace.appearance;return!t.bannerPlace.banners.length||b?null:e("div",{className:l(A["bnr-place"],t.className),style:Object.assign(Object.assign({},t.style),{"--ias-bnr-place-border-radius":`${m.banner.borderRadius}px`}),ref:r,children:e(K,{onInit:u,autoplay:m.autoplay,speed:m.animationSpeed,loop:m.loop,slidesPerView:m.slidesPerView,spaceBetween:m.gap,slidesCount:i.length,navigation:m.navigation,pagination:m.pagination,direction:m.direction,allowTouchMove:m.allowTouchMove,langDirection:t.bannerPlace.dir,children:i.map((t,r)=>{const n=Boolean(null==d?void 0:d.isSlideVisible(r))&&f;return e(J,{children:e(k,{index:r,isActive:n,canBeInited:n,banner:t,className:A["bnr-slider__slide"],allowClick:c,clientAppearance:m.banner,direction:m.direction})},t.id)})})})});class Le{constructor(e,t,r){Object.defineProperty(this,"mountPoint",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"bannerPlace",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"root",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"rootElement",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.rootElement=document.createElement("div"),this.rootElement.style.width="100%",this.rootElement.style.height="100%",e.appendChild(this.rootElement),this.root=b(this.rootElement)}get dir(){return this.bannerPlace.dir}get activeIndex(){return this.bannerPlace.activeIndex}get activeBanner(){return this.bannerPlace.activeBanner}get isLoaded(){return this.bannerPlace.isLoaded}get id(){return this.bannerPlace.id}get banners(){return this.bannerPlace.banners}get appearance(){return this.bannerPlace.appearance}get contentRatio(){return this.bannerPlace.contentRatio}get isLoading(){return this.bannerPlace.isLoading}get error(){return this.bannerPlace.error}get slider(){return this.bannerPlace.slider}get paginationBullets(){return this.bannerPlace.slider.getTotalPages()}refreshSizes(){}emit(e,...t){}setSliderController(e){this.bannerPlace.setSliderController(e)}updateAppearance(e){this.bannerPlace.updateAppearance(e)}resume(){this.bannerPlace.resume()}pause(){this.bannerPlace.pause()}reload(){return this.bannerPlace.reload()}destroy(){setTimeout(()=>{this.root.unmount()}),this.mountPoint.removeChild(this.rootElement),this.bannerPlace.destroy()}fetchBanners(){return this.bannerPlace.fetchBanners()}updateUserData(e){return Promise.resolve()}notifyTimerEnd(){this.bannerPlace.notifyTimerEnd()}showNext(){this.bannerPlace.showNext()}showPrevious(){this.bannerPlace.showPrevious()}showByIndex(e,t){this.bannerPlace.showByIndex(e,t)}on(e,t){return this.bannerPlace.on(e,t),this}once(e,t){return this.bannerPlace.once(e,t),this}off(e,t){return this.bannerPlace.off(e,t),this}render(){var t;this.root.render(e(Ce,{appearance:null===(t=this.params)||void 0===t?void 0:t.appearance,bannerPlace:this.bannerPlace}))}}class je extends Le{render(){var t;this.root.render(e(We,{appearance:null===(t=this.params)||void 0===t?void 0:t.appearance,bannerPlace:this.bannerPlace}))}}const ke=t=>{const[r,i]=s(null);return n(()=>{var e;const r=or().createBannerPlace(t.placeId);return i(r),null===(e=t.onReady)||void 0===e||e.call(t,r),()=>{r.destroy()}},[t.placeId]),r?e(Ce,Object.assign({bannerPlace:r},t)):null};var Be=g(713);y()(Be.A,{insert:"head",singleton:!1});const Ae=Be.A.locals||{},Me=o(t=>{const r=xe(t),i=a(null),{error:s,canBeShown:o}=Ie({bannerPlace:t.bannerPlace,bannerPlaceRef:i}),l=r[0],c=!0;return n(()=>{o&&(t.bannerPlace.refreshSizes(),requestAnimationFrame(()=>{t.bannerPlace.refreshSizes()}))},[t.bannerPlace,o]),t.bannerPlace.error||s?null:e("div",{className:Ae["bnr-place"],ref:i,children:l&&o&&!t.bannerPlace.isLoading?e(k,{index:0,isActive:c,canBeInited:c,banner:l,allowClick:!0,clientAppearance:t.bannerPlace.appearance.banner}):e(I,{needShowErrorScreen:!1,needShowLoaderScreen:!0,onReload:()=>{}})})}),Re=t=>{const[r,i]=s(null);return n(()=>{var e;const r=or().createBannerPreviewPlace(t.bannerId);return i(r),null===(e=t.onReady)||void 0===e||e.call(t,r),()=>{r.destroy()}},[t.bannerId]),r?e(Me,Object.assign({bannerPlace:r},t)):null};var De=g(883);y()(De.A,{insert:"head",singleton:!1});const Ne=De.A.locals||{},ze=({banner:t,index:r,clientAppearance:i,canBeShown:o})=>{const[l,c]=s(!1),d=a(null);return n(()=>{const e=new IntersectionObserver(e=>{e.forEach(e=>{e.intersectionRatio>=.5?c(!0):c(!1)})},{threshold:[0,.5,1]});return d.current&&e.observe(d.current),()=>{d.current&&e.unobserve(d.current)}},[]),e(k,{index:r,isActive:l&&o,canBeInited:l&&o,banner:t,allowClick:!0,clientAppearance:i,direction:"row",ref:d},t.id)},We=o(t=>{const r=a(null),i=xe(t);Oe(t);const{error:s,canBeShown:o}=Ie({bannerPlace:t.bannerPlace,bannerPlaceRef:r});n(()=>{o&&(t.bannerPlace.refreshSizes(),requestAnimationFrame(()=>{t.bannerPlace.refreshSizes()}))},[t.bannerPlace,o]);const c=t.bannerPlace.appearance;return!t.bannerPlace.banners.length||s?null:e("div",{className:l(Ne["bnr-place"],t.className),style:Object.assign(Object.assign({},t.style),{gap:c.gap}),ref:r,children:i.map((t,r)=>e(ze,{banner:t,canBeShown:o,index:r,clientAppearance:c.banner},t.id))})}),Fe=t=>{const[r,i]=s(null);return n(()=>{var e;const r=or().createBannerPlace(t.placeId);return i(r),null===(e=t.onReady)||void 0===e||e.call(t,r),()=>{r.destroy()}},[t.placeId]),r?e(We,Object.assign({bannerPlace:r},t)):null};var Ve=function(e,t,r,n,i,a){function s(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var o,l=n.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?n.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,n.name):{}),u=!1,p=r.length-1;p>=0;p--){var b={};for(var f in n)b[f]="access"===f?{}:n[f];for(var f in n.access)b.access[f]=n.access[f];b.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(s(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],b);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(o=s(m.get))&&(h.get=o),(o=s(m.set))&&(h.set=o),(o=s(m.init))&&i.unshift(o)}else(o=s(m))&&("field"===l?i.unshift(o):h[c]=o)}d&&Object.defineProperty(d,n.name,h),u=!0},Ue=function(e,t,r){for(var n=arguments.length>2,i=0;i<t.length;i++)r=n?t[i].call(e,r):t[i].call(e);return n?r:void 0},qe=function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)},He=function(e,t,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(e,r):i?i.value=r:t.set(e,r),r};let $e=(()=>{var e,t,r,n,i;let a,s,o,l,c=G.EventEmitter,d=[],u=[],p=[],b=[],f=[],m=[],v=[],g=[];return e=class extends c{get _banners(){return qe(this,t,"f")}set _banners(e){He(this,t,e,"f")}get _isLoading(){return qe(this,r,"f")}set _isLoading(e){He(this,r,e,"f")}get _isLoaded(){return qe(this,n,"f")}set _isLoaded(e){He(this,n,e,"f")}get _error(){return qe(this,i,"f")}set _error(e){He(this,i,e,"f")}constructor(e,a,s,o){super(),Object.defineProperty(this,"bannerId",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"ctx",{enumerable:!0,configurable:!0,writable:!0,value:a}),Object.defineProperty(this,"bannerStore",{enumerable:!0,configurable:!0,writable:!0,value:s}),Object.defineProperty(this,"bannerViewModelFactory",{enumerable:!0,configurable:!0,writable:!0,value:o}),t.set(this,Ue(this,d,[])),r.set(this,(Ue(this,u),Ue(this,p,!1))),n.set(this,(Ue(this,b),Ue(this,f,!1))),i.set(this,(Ue(this,m),Ue(this,v,null))),Object.defineProperty(this,"appearance",{enumerable:!0,configurable:!0,writable:!0,value:(Ue(this,g),new me)}),this.ctx.addBannerPlace(this)}get dir(){return this.ctx.getConfig().dir}get activeIndex(){return 0}get activeBanner(){return this._banners[0]}get id(){return"__BANNER_PREVIEW__"}get slider(){return new we}get banners(){return this._banners}get isLoading(){return this._isLoading}get isLoaded(){return this._isLoaded}get contentRatio(){var e,t;return null!==(t=null===(e=this._banners[0])||void 0===e?void 0:e.contentRatio)&&void 0!==t?t:1}get paginationBullets(){return 1}get error(){return this._error}refreshSizes(){this._banners.forEach(e=>e.refreshSizes())}setSliderController(e){}updateAppearance(e){this.appearance.update(e)}resume(){for(const e of this._banners)e.resume()}pause(){for(const e of this._banners)e.pause()}async reload(){this.bannerStore.removeBannerPlaceById(this.id),await Promise.all(this._banners.map(e=>e.destroy())),this._banners=[],await this.fetchBanners()}destroy(){for(const e of this._banners)e.destroy();this._banners=[],this.ctx.removeBannerPlace(this)}async updateUserData(e){return this.bannerStore.updateBannerUserData(this.id,e)}notifyTimerEnd(){}showNext(){}showPrevious(){}showByIndex(e,t){}async fetchBanners(){try{if(this._isLoading)return[];this._error=null,this._isLoading=!0,this._isLoaded=!1,this.emit(ye.LoadStart);const e=await this.bannerStore.getBannerById(this.bannerId);return this._banners=[this.bannerViewModelFactory.create(this,e)],this._isLoaded=!0,this._banners}catch(e){throw this.emit(ye.LoadError,e),this._error=e,e}finally{this.emit(ye.LoadEnd),this._isLoading=!1}}},t=new WeakMap,r=new WeakMap,n=new WeakMap,i=new WeakMap,(()=>{var t;const r="function"==typeof Symbol&&Symbol.metadata?Object.create(null!==(t=c[Symbol.metadata])&&void 0!==t?t:null):void 0;a=[h],s=[h],o=[h],l=[h],Ve(e,null,a,{kind:"accessor",name:"_banners",static:!1,private:!1,access:{has:e=>"_banners"in e,get:e=>e._banners,set:(e,t)=>{e._banners=t}},metadata:r},d,u),Ve(e,null,s,{kind:"accessor",name:"_isLoading",static:!1,private:!1,access:{has:e=>"_isLoading"in e,get:e=>e._isLoading,set:(e,t)=>{e._isLoading=t}},metadata:r},p,b),Ve(e,null,o,{kind:"accessor",name:"_isLoaded",static:!1,private:!1,access:{has:e=>"_isLoaded"in e,get:e=>e._isLoaded,set:(e,t)=>{e._isLoaded=t}},metadata:r},f,m),Ve(e,null,l,{kind:"accessor",name:"_error",static:!1,private:!1,access:{has:e=>"_error"in e,get:e=>e._error,set:(e,t)=>{e._error=t}},metadata:r},v,g),r&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:r})})(),e})();class Ge{constructor(e){Object.defineProperty(this,"bannerStatisticApi",{enumerable:!0,configurable:!0,writable:!0,value:e})}async sendViewEvent(e,t){const r=new ve(t);await this.bannerStatisticApi.sendViewEvent(e,r)}async sendWidgetEvent(e,t){const r=new ge(t);await this.bannerStatisticApi.sendWidgetEvent(e,r)}}class Xe{constructor(){Object.defineProperty(this,"cache",{enumerable:!0,configurable:!0,writable:!0,value:{}})}set(e,t){this.cache[e]=t}clear(){this.cache={}}get(e){return this.cache[e]}}class Ye{constructor(e,t,r){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"bannerPlaceViewModel",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"banner",{enumerable:!0,configurable:!0,writable:!0,value:r})}async handle(e){try{const t=this.storyManager.gameReader;await t.openGame(e.gameInstanceId),this.bannerPlaceViewModel.pause(),t.once("close",()=>{this.bannerPlaceViewModel.resume()})}catch(e){console.error(e)}}}var Qe,Ke,Je,Ze,et,tt,rt,nt,it,at,st,ot,lt,ct,dt,ht,ut,pt,bt,ft;!function(e){e.LEFT="left",e.RIGHT="right",e.START="start",e.END="end"}(Qe||(Qe={})),Qe.END,function(e){e.Text="text",e.Link="link",e.Image="image"}(Ke||(Ke={})),function(e){e.DEFAULT="default",e.CUSTOM_CARD="customCard"}(Je||(Je={})),Je.DEFAULT,Je.DEFAULT,function(e){e.CENTER="center",e.LEFT="left",e.RIGHT="right",e.START="start",e.END="end"}(Ze||(Ze={})),function(e){e.CIRCLE="circle",e.QUAD="quad",e.RECTANGLE="rectangle"}(et||(et={})),function(e){e.LEFT="left",e.RIGHT="right",e.START="start",e.END="end",e.CENTER="center"}(tt||(tt={})),function(e){e.CARD_INSIDE_BOTTOM="cardInsideBottom",e.CARD_OUTSIDE_TOP="cardOutsideTop",e.CARD_OUTSIDE_BOTTOM="cardOutsideBottom"}(rt||(rt={})),function(e){e.Medium="medium",e.High="high"}(nt||(nt={})),function(e){e.COLUMN="vertical",e.ROW="horizontal"}(it||(it={})),function(e){e.START_LOADER="startLoad",e.END_LOADER="endLoad"}(at||(at={})),it.ROW,tt.START,rt.CARD_INSIDE_BOTTOM,nt.High,et.RECTANGLE,tt.START,rt.CARD_INSIDE_BOTTOM,nt.High,et.CIRCLE,Ze.START,tt.START,rt.CARD_INSIDE_BOTTOM,nt.High,et.CIRCLE,function(e){e.WidgetEvent="widgetEvent",e.ClickOnButton="clickOnButton"}(st||(st={})),function(e){e.STORY_LIST="storyList",e.STORY_READER="storyReader",e.GAME_READER="gameReader",e.STACK_STORY_LIST="stackStoryList",e.IAM_READER="iamReader",e.BANNERS="banners"}(ot||(ot={})),function(e){e.FLAT="flat",e.COVER="cover",e.CUBE="cube"}(lt||(lt={})),function(e){e.Classic="classic",e.Modern="modern"}(ct||(ct={})),lt.FLAT,ct.Classic,function(e){e.STYLE_CIRCLE="circle",e.STYLE_QUAD="quad",e.STYLE_RECTANGLE="rectangle",e.SWIPE_CUBE="cube",e.SWIPE_FLAT="flat",e.SWIPE_COVER="cover",e.CLOSE_BUTTON_LEFT="left",e.CLOSE_BUTTON_RIGHT="right"}(dt||(dt={})),function(e){e.direct="direct",e.onboarding="onboarding",e.list="list",e.favorite="favorite"}(ht||(ht={})),function(e){e[e.default=0]="default",e[e.favorite=1]="favorite",e[e.stacked=2]="stacked"}(ut||(ut={})),function(e){e.LTR="ltr",e.RTL="rtl"}(pt||(pt={})),function(e){e.StoryList="storyList",e.StoryReader="storyReader",e.GameReader="gameReader",e.StackStoryList="stackStoryList",e.IamReader="iamReader",e.Banners="banners"}(bt||(bt={}));class mt{constructor(e,t){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"banner",{enumerable:!0,configurable:!0,writable:!0,value:t})}handle(e){try{const t=decodeURIComponent(e.linkTarget),r={src:bt.Banners,data:{id:this.banner.id,index:this.banner.activeSlideIndex,url:t,elementId:e.elementId}};this.storyManager.storyLinkClickHandler(r),this.storyManager.emit("clickOnButton",r)}catch(t){t instanceof URIError?console.error(`[Banners]: the URL <${e.linkTarget}> has an invalid format`):console.error(t)}}}class vt{constructor(e,t,r){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"bannerPlace",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"banner",{enumerable:!0,configurable:!0,writable:!0,value:r})}async handle(e){try{const t={src:bt.Banners,data:{id:this.banner.id,index:this.banner.activeSlideIndex,url:e.storyId.toString()}};this.storyManager.storyLinkClickHandler(t),this.storyManager.emit("clickOnButton",t),this.bannerPlace.pause(),await this.storyManager.storyReader.showStory(e.storyId),this.storyManager.storyReader.once("closeStoryReader",()=>{this.bannerPlace.resume()})}catch(e){console.error(e)}}}class gt{constructor(){Object.defineProperty(this,"textArea",{enumerable:!0,configurable:!0,writable:!0,value:null})}async copy(e){try{navigator.clipboard&&window.isSecureContext?await navigator.clipboard.writeText(e):this.copyLegacy(e)}catch(t){this.copyLegacy(e)}}isIOS(){return/ipad|iphone/i.test(navigator.userAgent)}createTextArea(e){this.textArea=document.createElement("textarea"),this.textArea.value=e,document.body.appendChild(this.textArea)}selectText(){if(this.textArea)if(this.isIOS()){const e=document.createRange();e.selectNodeContents(this.textArea);const t=window.getSelection();t&&(t.removeAllRanges(),t.addRange(e)),this.textArea.setSelectionRange(0,999999)}else this.textArea.select()}copyLegacy(e){this.createTextArea(e),this.selectText();try{document.execCommand("copy")}catch(e){console.error("Copy failed:",e)}this.textArea&&(document.body.removeChild(this.textArea),this.textArea=null)}}class wt{constructor(e){Object.defineProperty(this,"bannerPlace",{enumerable:!0,configurable:!0,writable:!0,value:e})}manageTimer(e,t){if(!this.bannerPlace.slider)return;const r=this.bannerPlace.slider.autoplay;switch(e){case"start":this.startTimer(r,t);break;case"pause":r.pause();break;case"stop":case"before_start":r.stop()}}startTimer(e,t){e.isPaused()?e.resume():(e.setDelay(t),e.start())}}class yt{constructor(e){Object.defineProperty(this,"payload",{enumerable:!0,configurable:!0,writable:!0,value:e})}}Object.defineProperty(yt,"name",{enumerable:!0,configurable:!0,writable:!0,value:"bannerWidget"});class _t{constructor(e){Object.defineProperty(this,"payload",{enumerable:!0,configurable:!0,writable:!0,value:e})}}Object.defineProperty(_t,"name",{enumerable:!0,configurable:!0,writable:!0,value:"showBanner"});class Pt{constructor(e){Object.defineProperty(this,"payload",{enumerable:!0,configurable:!0,writable:!0,value:e})}}Object.defineProperty(Pt,"name",{enumerable:!0,configurable:!0,writable:!0,value:"showBannerFailed"});class St{constructor(e,t,r,n){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"bannerPlace",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"banner",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"bannerStatisticService",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"sessionNarrativeDataCache",{enumerable:!0,configurable:!0,writable:!0,value:new Xe}),Object.defineProperty(this,"narrativeDataCache",{enumerable:!0,configurable:!0,writable:!0,value:new Xe})}onWidgetRequirePauseUI(){this.banner.pause()}onWidgetRequireResumeUI(){this.banner.resume()}productCartUpdate(e){return Promise.reject({message:"Not implemented"})}productCartClicked(){}async productCartGetState(){return Promise.reject("Not implemented")}onEvent(e,t){}onCardLoadingStateChange(e){}updateCardServerDataLocally(e){this.banner.context.updateNarrativeSavedData(e)}async updateTimeline(e,t,r,n,i,a){"before_start"!==t&&(i?this.banner.showLoaderScreen():this.banner.activeSlide.inited&&this.banner.hideLoaderScreen(),a?this.banner.showErrorScreen():this.banner.hideErrorScreen()),new wt(this.bannerPlace).manageTimer(t,n)}clearNarrativeSessionDataCache(){this.sessionNarrativeDataCache.clear()}disableVerticalSwipeGesture(){}enableVerticalSwipeGesture(){}disableHorizontalSwipeGesture(){this.bannerPlace.slider.disableHorizontalSwipeGesture()}enableHorizontalSwipeGesture(){this.bannerPlace.slider.enableHorizontalSwipeGesture()}async getCardLocalData(){const e=this.narrativeDataCache.get(`banner_${this.banner.id}_data_${this.storyManager.rootStore.sessionStore.userId}`);return e?JSON.parse(e):{}}setCardLocalData(e,t){const r=JSON.stringify(e);this.narrativeDataCache.set(`banner_${this.banner.id}_data_${this.storyManager.rootStore.sessionStore.userId}`,r),this.banner.context.updateNarrativeSavedData(r),t&&this.banner.updateUserData(r).catch(console.error)}getCardServerData(e){var t;return null!==(t=this.banner.context.widgetsData._narrative_saved_data)&&void 0!==t?t:null}getSlideDuration(e,t){var r,n;return null!==(n=null===(r=this.banner.context.widgetsData._narrative_slides_duration)||void 0===r?void 0:r[t])&&void 0!==n?n:null}pauseUI(){this.banner.pause()}resumeUI(){this.banner.resume()}showCardTextInput(e,t){}setCardSessionValue(e,t){this.sessionNarrativeDataCache.set(e,t)}getCardSessionValue(e){return this.sessionNarrativeDataCache.get(e)}getWidgetsSharedData(e,t){const r=this.banner.context.widgetsData;switch(t){case"rangeSlider":return r._narrative_range_slider_data;case"poll":return r._narrative_poll_data;case"vote":return r._narrative_vote_data}return null}async sendApiRequest(e,t,r,n,i,a){var s,o,l;try{const a=await this.storyManager.httpClient.request({url:e,method:t,params:null!=r?r:{},headers:null!=n?n:{},data:null!=i?i:{}});return{status:a.status,headers:a.headers,data:a.data}}catch(e){if(e instanceof Error&&"IasNetworkError"===e.name)return{status:null!==(s=e.networkStatus)&&void 0!==s?s:400,headers:null===(o=e.response)||void 0===o?void 0:o.headers,data:null===(l=e.response)||void 0===l?void 0:l.data}}}share(e,t){}shareSlideScreenshot(e,t,r){}showLayer(e){this.banner.showLayerByIndex(e)}showCardSlide(e){this.bannerPlace.slider.slideTo(e)}cardShowNext(){this.bannerPlace.slider.toNextSlide()}showNextSlide(){this.bannerPlace.slider.toNextSlide()}sendStatisticEvent(e,t,r,n){this.bannerStatisticService.sendWidgetEvent(this.banner.id,{iterationId:this.banner.iterationId,type:e,slideIndex:this.banner.activeSlideIndex,slideTotal:this.banner.slides.length,durationMs:this.banner.durationMs,widgetPayload:t}),this.bannerPlace.emit(yt.name,new yt({id:this.banner.id,bannerPlace:this.bannerPlace.id,widgetEventName:e,widgetData:null!=r?r:{}}).payload),this.storyManager.emit("widgetEvent",{name:e,data:r})}async resetCard(e){this.updateCardServerDataLocally({}),this.setCardLocalData({},!0),this.showCardSlide(0),this.showLayer(0)}getCardFonts(){var e,t;return null!==(t=null===(e=this.storyManager.rootStore.sessionStore.session)||void 0===e?void 0:e.fontsResources)&&void 0!==t?t:[]}showToast(e){this.banner.showToast({content:e})}closeCard(e){}openStory(e,t){new vt(this.storyManager,this.bannerPlace,this.banner).handle({storyId:e,slideIndex:t})}openGame(e){new Ye(this.storyManager,this.bannerPlace,this.banner).handle({gameInstanceId:e})}writeToClipboard(e){(new gt).copy(e.textValue)}openUrl(e){"swipeUpItems"!==e.type&&new mt(this.storyManager,this.banner).handle({elementId:e.elementId,linkTarget:e.link.target})}}!function(e){e.Top="top",e.Bottom="bottom"}(ft||(ft={}));const Tt=ft.Bottom;class Et{constructor(e){Object.defineProperty(this,"options",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"timeoutId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"duration",{enumerable:!0,configurable:!0,writable:!0,value:3e3}),Object.defineProperty(this,"content",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"position",{enumerable:!0,configurable:!0,writable:!0,value:Tt}),Object.defineProperty(this,"mountPoint",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"toastContainer",{enumerable:!0,configurable:!0,writable:!0,value:null}),this.initializeOptions(e),this.mountPoint=e.mountPoint}show(e){return this.content=e,this.destroy(),this.createAndShowToast(),!0}hide(){return!!this.toastContainer&&(clearTimeout(this.timeoutId),this.toastContainer.className+=" toast_fadeout",this.addAnimationEndListeners(this.toastContainer,()=>{var e,t;null===(t=null===(e=this.toastContainer)||void 0===e?void 0:e.parentNode)||void 0===t||t.removeChild(this.toastContainer),this.toastContainer=null}),!0)}destroy(){var e;this.toastContainer&&(clearTimeout(this.timeoutId),null===(e=this.toastContainer.parentNode)||void 0===e||e.removeChild(this.toastContainer),this.toastContainer=null)}initializeOptions(e){if(e.duration&&(this.duration="string"==typeof e.duration?parseFloat(e.duration):e.duration),e.position){const t=e.position.toLowerCase();this.position="top"===t||"bottom"===t?t:Tt}}createAndShowToast(){const e=this.createToastContainer(),t=this.createToastElement(),r=this.createToastTextElement();t.appendChild(r),e.appendChild(t),this.mountPoint.appendChild(e),this.timeoutId=window.setTimeout(()=>this.hide(),this.duration),this.toastContainer=e}createToastContainer(){const e=document.createElement("div");return e.id="toast_container",e.className="toast_fadein",e.style.zIndex="1130",e}createToastElement(){const e=document.createElement("div");return e.id="toast",e}createToastTextElement(){const e=document.createElement("span");return e.innerHTML=this.content,e}addAnimationEndListeners(e,t){["animationend","webkitAnimationEnd","msAnimationEnd","oAnimationEnd"].forEach(r=>{e.addEventListener(r,t,{once:!0})})}}let xt;xt=function(){},new Error("timeout while waiting for mutex to become available"),new Error("mutex already locked");const Ot=new Error("request for lock canceled");class It{constructor(e,t=Ot){this._value=e,this._cancelError=t,this._queue=[],this._weightedWaiters=[]}acquire(e=1,t=0){if(e<=0)throw new Error(`invalid weight ${e}: must be positive`);return new Promise((r,n)=>{const i={resolve:r,reject:n,weight:e,priority:t},a=Ct(this._queue,e=>t<=e.priority);-1===a&&e<=this._value?this._dispatchItem(i):this._queue.splice(a+1,0,i)})}runExclusive(e){return function(e,t,r,n){return new(r||(r=Promise))(function(i,a){function s(e){try{l(n.next(e))}catch(e){a(e)}}function o(e){try{l(n.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(s,o)}l((n=n.apply(e,t||[])).next())})}(this,arguments,void 0,function*(e,t=1,r=0){const[n,i]=yield this.acquire(t,r);try{return yield e(n)}finally{i()}})}waitForUnlock(e=1,t=0){if(e<=0)throw new Error(`invalid weight ${e}: must be positive`);return this._couldLockImmediately(e,t)?Promise.resolve():new Promise(r=>{this._weightedWaiters[e-1]||(this._weightedWaiters[e-1]=[]),function(e,t){const r=Ct(e,e=>t.priority<=e.priority);e.splice(r+1,0,t)}(this._weightedWaiters[e-1],{resolve:r,priority:t})})}isLocked(){return this._value<=0}getValue(){return this._value}setValue(e){this._value=e,this._dispatchQueue()}release(e=1){if(e<=0)throw new Error(`invalid weight ${e}: must be positive`);this._value+=e,this._dispatchQueue()}cancel(){this._queue.forEach(e=>e.reject(this._cancelError)),this._queue=[]}_dispatchQueue(){for(this._drainUnlockWaiters();this._queue.length>0&&this._queue[0].weight<=this._value;)this._dispatchItem(this._queue.shift()),this._drainUnlockWaiters()}_dispatchItem(e){const t=this._value;this._value-=e.weight,e.resolve([t,this._newReleaser(e.weight)])}_newReleaser(e){let t=!1;return()=>{t||(t=!0,this.release(e))}}_drainUnlockWaiters(){if(0===this._queue.length)for(let e=this._value;e>0;e--){const t=this._weightedWaiters[e-1];t&&(t.forEach(e=>e.resolve()),this._weightedWaiters[e-1]=[])}else{const e=this._queue[0].priority;for(let t=this._value;t>0;t--){const r=this._weightedWaiters[t-1];if(!r)continue;const n=r.findIndex(t=>t.priority<=e);(-1===n?r:r.splice(0,n)).forEach(e=>e.resolve())}}}_couldLockImmediately(e,t){return(0===this._queue.length||this._queue[0].priority<t)&&e<=this._value}}function Ct(e,t){for(let r=e.length-1;r>=0;r--)if(t(e[r]))return r;return-1}class Lt{constructor(e){this._semaphore=new It(1,e)}acquire(){return function(e,t,r,n){return new(r||(r=Promise))(function(i,a){function s(e){try{l(n.next(e))}catch(e){a(e)}}function o(e){try{l(n.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(s,o)}l((n=n.apply(e,t||[])).next())})}(this,arguments,void 0,function*(e=0){const[,t]=yield this._semaphore.acquire(1,e);return t})}runExclusive(e,t=0){return this._semaphore.runExclusive(()=>e(),1,t)}isLocked(){return this._semaphore.isLocked()}waitForUnlock(e=0){return this._semaphore.waitForUnlock(1,e)}release(){this._semaphore.isLocked()&&this._semaphore.release()}cancel(){return this._semaphore.cancel()}}class jt{constructor(e,t,r){Object.defineProperty(this,"banner",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"bannerSlide",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"slideApi",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"mutex",{enumerable:!0,configurable:!0,writable:!0,value:new Lt}),Object.defineProperty(this,"_inited",{enumerable:!0,configurable:!0,writable:!0,value:!1})}get html(){return this.bannerSlide.html}get state(){return this.slideApi.state}get inited(){return this._inited}get payload(){return this.bannerSlide.payload}notifyTimerEnd(){this.slideApi.slideTimerEnd()}async init(){const e=await this.mutex.acquire();if(this._inited)return;let t=this.banner.needShowLoaderScreen,r=Date.now();const n=setTimeout(()=>{this.banner.showLoaderScreen(),t=!0,r=Date.now()},500);try{this.banner.id,await this.slideApi.showSlide(this.html),this._inited=!0}catch(e){throw this.handleSlideError(e),e}finally{clearTimeout(n),await this.cleanupLoaderIfNeeded(Date.now()-r,t),e()}}async start(){const e=await this.mutex.acquire();try{this.banner.id,await this.slideApi.slideStart({muted:!0})}catch(e){throw this.handleSlideError(e),e}finally{e()}}async restart(){const e=await this.mutex.acquire();try{this.banner.hideErrorScreen(),this.banner.showLoaderScreen(),await this.slideApi.slideRestart({muted:!0})}catch(e){throw this.handleSlideError(e),e}finally{this.banner.hideLoaderScreen(),e()}}async resume(){const e=await this.mutex.acquire();try{this.banner.id,await this.slideApi.slideAppResume()}catch(e){this.handleSlideError(e)}finally{e()}}async pause(){const e=await this.mutex.acquire();try{this.banner.id,await this.slideApi.slideAppPause()}catch(e){this.handleSlideError(e)}finally{e()}}async pauseByUser(){const e=await this.mutex.acquire();try{this.banner.id,await this.slideApi.slideUserPause()}catch(e){this.handleSlideError(e)}finally{e()}}async resumeByUser(){const e=await this.mutex.acquire();try{this.banner.id,await this.slideApi.slideUserResume()}catch(e){this.handleSlideError(e)}finally{e()}}async stop(e){const t=await this.mutex.acquire();try{this.banner.id,await this.slideApi.slideStop(e)}catch(e){this.handleSlideError(e)}finally{t()}}refreshSizes(){this.slideApi.refreshSizes()}onClick({event:e,currentTarget:t}){if(e.target)try{e.preventDefault(),e.stopPropagation();const r=this.getNavigationDirection(e,t);this.slideApi.slideClickHandler(e.target,r>0?"forward":"backward")}catch(e){console.error(e)}}async destroy(){await this.stop({prepareForRestart:2})}showLayerByIndex(e){this.slideApi.showLayer(e)}handleSlideError(e){console.error(e),this.banner.showErrorScreen()}getNavigationDirection(e,t){const r=this.getClickPosition(e,t),n="ltr"===this.slideApi.layoutDirection?1:-1;return r>=.3?n:-n}getClickPosition(e,t){const r=t.getBoundingClientRect(),n=r.width;if(n<=0)return 0;let i;if(e instanceof MouseEvent)i=e.pageX-r.left;else{if(!(e.touches&&e.touches.length>0))return 0;i=e.touches[0].pageX-r.left}return Math.max(0,Math.min(1,i/n))}delay(e){return new Promise(t=>setTimeout(t,e))}async cleanupLoaderIfNeeded(e,t){t&&(await this.delay(Math.max(500-e,0)),this.banner.hideLoaderScreen())}}class kt{get html(){return""}get state(){return 0}async init(){}async start(){}async restart(){}async resume(){}async pause(){}async resumeByUser(){}async pauseByUser(){}async stop(e){}onClick({event:e,currentTarget:t}){}async destroy(){}showLayerByIndex(e){}refreshSizes(){}notifyTimerEnd(){}}var Bt=function(e,t,r){for(var n=arguments.length>2,i=0;i<t.length;i++)r=n?t[i].call(e,r):t[i].call(e);return n?r:void 0},At=function(e,t,r,n,i,a){function s(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var o,l=n.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?n.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,n.name):{}),u=!1,p=r.length-1;p>=0;p--){var b={};for(var f in n)b[f]="access"===f?{}:n[f];for(var f in n.access)b.access[f]=n.access[f];b.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(s(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],b);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(o=s(m.get))&&(h.get=o),(o=s(m.set))&&(h.set=o),(o=s(m.init))&&i.unshift(o)}else(o=s(m))&&("field"===l?i.unshift(o):h[c]=o)}d&&Object.defineProperty(d,n.name,h),u=!0},Mt=function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)},Rt=function(e,t,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(e,r):i?i.value=r:t.set(e,r),r};let Dt=(()=>{var e,t,r,n,i,a,s,o;let l,u,b,m,v,g,w,y,_,P,S,T,E,x,O=[],I=[],L=[],j=[],k=[],B=[],A=[],M=[],R=[],D=[],N=[],z=[],W=[],F=[],V=[];return e=class{get _$root(){return Mt(this,t,"f")}set _$root(e){Rt(this,t,e,"f")}get _needShowErrorScreen(){return Mt(this,r,"f")}set _needShowErrorScreen(e){Rt(this,r,e,"f")}get _needShowLoaderScreen(){return Mt(this,n,"f")}set _needShowLoaderScreen(e){Rt(this,n,e,"f")}get _width(){return Mt(this,i,"f")}set _width(e){Rt(this,i,e,"f")}get _height(){return Mt(this,a,"f")}set _height(e){Rt(this,a,e,"f")}get _slides(){return Mt(this,s,"f")}set _slides(e){Rt(this,s,e,"f")}get isInited(){return Mt(this,o,"f")}set isInited(e){Rt(this,o,e,"f")}constructor(e,l,c,d,h){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:(Bt(this,O),e)}),Object.defineProperty(this,"bannerPlace",{enumerable:!0,configurable:!0,writable:!0,value:l}),Object.defineProperty(this,"banner",{enumerable:!0,configurable:!0,writable:!0,value:c}),Object.defineProperty(this,"bannerStatisticService",{enumerable:!0,configurable:!0,writable:!0,value:d}),Object.defineProperty(this,"bannerStore",{enumerable:!0,configurable:!0,writable:!0,value:h}),t.set(this,Bt(this,I,null)),r.set(this,(Bt(this,L),Bt(this,j,!1))),n.set(this,(Bt(this,k),Bt(this,B,!1))),i.set(this,(Bt(this,A),Bt(this,M,0))),a.set(this,(Bt(this,R),Bt(this,D,0))),s.set(this,(Bt(this,N),Bt(this,z,[]))),Object.defineProperty(this,"slideApi",{enumerable:!0,configurable:!0,writable:!0,value:(Bt(this,W),null)}),Object.defineProperty(this,"slideApiImpl",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"locked",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"toast",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_iterationId",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_startTime",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_initPromise",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_initPromiseResolver",{enumerable:!0,configurable:!0,writable:!0,value:()=>{}}),o.set(this,Bt(this,F,!1)),Object.defineProperty(this,"attachRoot",{enumerable:!0,configurable:!0,writable:!0,value:(Bt(this,V),async e=>{this._$root||(this._$root=e,this.slideApi=this.createSlideApi(e),this._slides=[new jt(this,this.banner.slides[0],this.slideApi)],await this.init())})}),Object.defineProperty(this,"handleVisibilityChange",{enumerable:!0,configurable:!0,writable:!0,value:()=>{this.locked||("hidden"===document.visibilityState&&this.pause(),"visible"===document.visibilityState&&this.resume())}}),this.slideApiImpl=new St(this.storyManager,this.bannerPlace,this,this.bannerStatisticService),this._initPromise=new Promise(e=>{this._initPromiseResolver=e})}get id(){return this.banner.id}get context(){return this.banner.context}get appearance(){return this.banner.appearance}get contentRatio(){return this.banner.appearance.contentRatio}get name(){return this.banner.name}get dir(){return this.storyManager.config.dir}get slides(){return this._slides}get activeSlideIndex(){return 0}get width(){return this._width}get height(){return this._height}get activeSlide(){var e;return null!==(e=this._slides[this.activeSlideIndex])&&void 0!==e?e:new kt}get needShowErrorScreen(){return this._needShowErrorScreen}get needShowLoaderScreen(){return this._needShowLoaderScreen}get canBeShown(){return Boolean(this._$root)&&this.isInited}get iterationId(){return this._iterationId}get durationMs(){return Date.now()-this._startTime}async init(){this.isInited||(this.showLoaderScreen(),await this.activeSlide.init(),this._initPromiseResolver(),this.isInited=!0)}async start(){if(!this._$root)throw new Error(`[IAS]: Slide API mount point not found for banner with ID ${this.id}`);document.addEventListener("visibilitychange",this.handleVisibilityChange);try{await this.activeSlide.start(),this._startTime=Date.now(),this.markAsOpened(),this.emitShowBannerEvent()}catch(e){this.emitShowBannerFailedEvent(e)}}refreshSizes(){this.activeSlide.refreshSizes()}async restart(){try{await this.activeSlide.restart(),this._startTime=Date.now(),this.markAsOpened(),this.emitShowBannerEvent()}catch(e){this.emitShowBannerFailedEvent(e)}}async resume(){await this.activeSlide.resume()}async pause(){await this.activeSlide.pause()}async resumeByUser(){await this.activeSlide.resumeByUser()}async pauseByUser(){await this.activeSlide.pauseByUser()}async stop(){var e;this.slideApiImpl.clearNarrativeSessionDataCache(),document.removeEventListener("visibilitychange",this.handleVisibilityChange),null===(e=this.toast)||void 0===e||e.destroy(),await this.activeSlide.stop({prepareForRestart:1})}async destroy(){var e,t;document.removeEventListener("visibilitychange",this.handleVisibilityChange);const r=this.activeSlide;this._slides=[],this._$root=null,this.isInited=!1,await r.destroy(),null===(e=this.slideApi)||void 0===e||e.destroy(),null===(t=this.toast)||void 0===t||t.destroy()}showLayerByIndex(e){this.activeSlide.showLayerByIndex(e)}showToast(e){if(!this._$root)return;const t=this._$root;this.toast=new Et(Object.assign({mountPoint:t},e)),this.toast.show(e.content)}detachRoot(){var e;this.isInited=!1,this._$root=null,this._slides.forEach(e=>e.destroy()),null===(e=this.slideApi)||void 0===e||e.destroy()}showErrorScreen(){this._needShowErrorScreen=!0}showLoaderScreen(){this._needShowLoaderScreen=!0}hideLoaderScreen(){this._needShowLoaderScreen=!1}hideErrorScreen(){this._needShowErrorScreen=!1}markAsOpened(){this._iterationId=p(),this.banner.markAsOpened(),this.markWasShown()}async waitInit(){await this._initPromise}notifyTimerEnd(){this.activeSlide.notifyTimerEnd()}async markWasShown(){!this.banner.wasShown&&this._iterationId&&(this.banner.markWasShown(),this.bannerStatisticService.sendViewEvent(this.id,{iterationId:this._iterationId,slideIndex:this.activeSlideIndex,slideTotal:this.banner.slides.length}))}async updateUserData(e){return this.bannerStore.updateBannerUserData(this.id,e)}createSlideApi(e){return new f(this.slideApiImpl,{root:e,slideRatio:this.banner.appearance.contentRatio,isFullscreen:!1,nonce:C(),viewport:window,userResizeHandler:e=>{this._width=e.viewportWidth,this._height=e.viewportHeight},VODPlayer:this.storyManager.globalProperties.$videoOnDemand,overlappingActionBarHeight:0,useSdkCacheForMultislideMode:!1})}emitShowBannerEvent(){this.bannerPlace.emit(_t.name,new _t({id:this.id,bannerPlace:this.bannerPlace.id,payload:this.activeSlide.payload}).payload)}emitShowBannerFailedEvent(e){this.bannerPlace.emit(Pt.name,new Pt({id:this.id,bannerPlace:this.bannerPlace.id,error:e,payload:this.activeSlide.payload}).payload)}},t=new WeakMap,r=new WeakMap,n=new WeakMap,i=new WeakMap,a=new WeakMap,s=new WeakMap,o=new WeakMap,(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;l=[h],u=[h],b=[h],m=[h],v=[h],g=[h],w=[h],y=[d],_=[d],P=[d],S=[c],T=[c],E=[c],x=[c],At(e,null,l,{kind:"accessor",name:"_$root",static:!1,private:!1,access:{has:e=>"_$root"in e,get:e=>e._$root,set:(e,t)=>{e._$root=t}},metadata:t},I,L),At(e,null,u,{kind:"accessor",name:"_needShowErrorScreen",static:!1,private:!1,access:{has:e=>"_needShowErrorScreen"in e,get:e=>e._needShowErrorScreen,set:(e,t)=>{e._needShowErrorScreen=t}},metadata:t},j,k),At(e,null,b,{kind:"accessor",name:"_needShowLoaderScreen",static:!1,private:!1,access:{has:e=>"_needShowLoaderScreen"in e,get:e=>e._needShowLoaderScreen,set:(e,t)=>{e._needShowLoaderScreen=t}},metadata:t},B,A),At(e,null,m,{kind:"accessor",name:"_width",static:!1,private:!1,access:{has:e=>"_width"in e,get:e=>e._width,set:(e,t)=>{e._width=t}},metadata:t},M,R),At(e,null,v,{kind:"accessor",name:"_height",static:!1,private:!1,access:{has:e=>"_height"in e,get:e=>e._height,set:(e,t)=>{e._height=t}},metadata:t},D,N),At(e,null,g,{kind:"accessor",name:"_slides",static:!1,private:!1,access:{has:e=>"_slides"in e,get:e=>e._slides,set:(e,t)=>{e._slides=t}},metadata:t},z,W),At(e,null,w,{kind:"accessor",name:"isInited",static:!1,private:!1,access:{has:e=>"isInited"in e,get:e=>e.isInited,set:(e,t)=>{e.isInited=t}},metadata:t},F,V),At(e,null,y,{kind:"getter",name:"activeSlide",static:!1,private:!1,access:{has:e=>"activeSlide"in e,get:e=>e.activeSlide},metadata:t},null,O),At(e,null,_,{kind:"getter",name:"needShowLoaderScreen",static:!1,private:!1,access:{has:e=>"needShowLoaderScreen"in e,get:e=>e.needShowLoaderScreen},metadata:t},null,O),At(e,null,P,{kind:"getter",name:"canBeShown",static:!1,private:!1,access:{has:e=>"canBeShown"in e,get:e=>e.canBeShown},metadata:t},null,O),At(e,null,S,{kind:"method",name:"showErrorScreen",static:!1,private:!1,access:{has:e=>"showErrorScreen"in e,get:e=>e.showErrorScreen},metadata:t},null,O),At(e,null,T,{kind:"method",name:"showLoaderScreen",static:!1,private:!1,access:{has:e=>"showLoaderScreen"in e,get:e=>e.showLoaderScreen},metadata:t},null,O),At(e,null,E,{kind:"method",name:"hideLoaderScreen",static:!1,private:!1,access:{has:e=>"hideLoaderScreen"in e,get:e=>e.hideLoaderScreen},metadata:t},null,O),At(e,null,x,{kind:"method",name:"hideErrorScreen",static:!1,private:!1,access:{has:e=>"hideErrorScreen"in e,get:e=>e.hideErrorScreen},metadata:t},null,O),t&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),e})();class Nt{constructor(e,t,r){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"bannerStore",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"bannerStatisticService",{enumerable:!0,configurable:!0,writable:!0,value:r})}create(e,t){return new Dt(this.storyManager,e,t,this.bannerStatisticService,this.bannerStore)}}function zt(e,t){let r=null;return async function(...t){return r||(r=(async()=>{try{return await e.apply(this,t)}catch(e){throw e}finally{r=null}})(),r)}}class Wt extends Error{constructor(e){super(`[IAS]: Banner with ID ${e} not found`),this.name="IasBannerNotFoundError"}}class Ft extends Error{constructor(e){super(`[IAS]: Banner slot with ID ${e} not found`),this.name="IasBannerPlaceNotFoundError"}}var Vt=function(e,t,r){for(var n=arguments.length>2,i=0;i<t.length;i++)r=n?t[i].call(e,r):t[i].call(e);return n?r:void 0},Ut=function(e,t,r,n,i,a){function s(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var o,l=n.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?n.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,n.name):{}),u=!1,p=r.length-1;p>=0;p--){var b={};for(var f in n)b[f]="access"===f?{}:n[f];for(var f in n.access)b.access[f]=n.access[f];b.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(s(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],b);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(o=s(m.get))&&(h.get=o),(o=s(m.set))&&(h.set=o),(o=s(m.init))&&i.unshift(o)}else(o=s(m))&&("field"===l?i.unshift(o):h[c]=o)}d&&Object.defineProperty(d,n.name,h),u=!0};let qt=(()=>{var e;let t,r,n,i,a=[];return e=class{constructor(e){Object.defineProperty(this,"httpClient",{enumerable:!0,configurable:!0,writable:!0,value:(Vt(this,a),e)})}async fetchBannerPlaceById(e){const t=await this.httpClient.post(`banner/place/${e.placeId}`,{tags:e.tags.join(","),options:e.options},{params:{expand:"banners.slides"}});if(t.data)return t.data;throw new Ft(e.placeId)}async fetchBannerById(e){const t=await this.httpClient.get(`banner/${e}`,{params:{expand:"slides"}});if(t.data)return t.data;throw new Wt(e)}async fetchContextWithStyles({needFetchStyles:e,bannerIds:t}){return(await this.httpClient.get("banner/context",{params:{fields:"widgetsData"+(e?",style":""),id:t.join()}})).data}async updateUserData(e,t){try{await this.httpClient.request({url:`banner/${e}/data`,method:"put",data:{data:t}})}catch(e){console.error(e)}}},(()=>{const s="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;t=[zt],r=[zt],n=[zt],i=[zt],Ut(e,null,t,{kind:"method",name:"fetchBannerPlaceById",static:!1,private:!1,access:{has:e=>"fetchBannerPlaceById"in e,get:e=>e.fetchBannerPlaceById},metadata:s},null,a),Ut(e,null,r,{kind:"method",name:"fetchBannerById",static:!1,private:!1,access:{has:e=>"fetchBannerById"in e,get:e=>e.fetchBannerById},metadata:s},null,a),Ut(e,null,n,{kind:"method",name:"fetchContextWithStyles",static:!1,private:!1,access:{has:e=>"fetchContextWithStyles"in e,get:e=>e.fetchContextWithStyles},metadata:s},null,a),Ut(e,null,i,{kind:"method",name:"updateUserData",static:!1,private:!1,access:{has:e=>"updateUserData"in e,get:e=>e.updateUserData},metadata:s},null,a),s&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:s})})(),e})();class Ht{constructor(e,t){Object.defineProperty(this,"httpClient",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:t})}async sendShowBannerEvent(e){throw new Error("Method not implemented.")}async sendClickOnBannerEvent(e){throw new Error("Method not implemented.")}async sendBannerCTREvent(e){throw new Error("Method not implemented.")}async sendViewEvent(e,t){await this.sendStatisticsEvent(e,t)}async sendWidgetEvent(e,t){await this.sendStatisticsEvent(e,t)}async sendStatisticsEvent(e,t){try{if(this.storyManager.isStatisticsDisabled)return void console.log("[BANNER STATISTICS]",Object.assign({bannerId:e,type:t.type},t.toQueryParams()));await this.httpClient.post(`/banner/${e}/event/${t.type}`,{},{params:t.toQueryParams()})}catch(e){console.error(e)}}}var $t;!function(e){e[e.Base=0]="Base",e[e.Dynamic=1]="Dynamic",e[e.Game=2]="Game",e[e.Story=3]="Story",e[e.IAM=4]="IAM"}($t||($t={}));var Gt=function(e,t,r,n,i,a){function s(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var o,l=n.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?n.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,n.name):{}),u=!1,p=r.length-1;p>=0;p--){var b={};for(var f in n)b[f]="access"===f?{}:n[f];for(var f in n.access)b.access[f]=n.access[f];b.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(s(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],b);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(o=s(m.get))&&(h.get=o),(o=s(m.set))&&(h.set=o),(o=s(m.init))&&i.unshift(o)}else(o=s(m))&&("field"===l?i.unshift(o):h[c]=o)}d&&Object.defineProperty(d,n.name,h),u=!0};(()=>{var e;let t,r,n=[];e=class{async fetchBannerPlaceById(e){return{id:"default",appearance:{single_banner_aspect_ratio:2,banners_gap:16,corner_radius:16,loop:!0,autoplay:!0,autoplay_delay:1e3,animation_speed:300},banners:[]}}async fetchContext(){return{style:"",widgetsData:{}}}updateUserData(e,t){throw new Error("Method not implemented.")}fetchBannerById(e){throw new Error("Method not implemented.")}constructor(){!function(e,t,r){for(var n=arguments.length>2,i=0;i<t.length;i++)r=n?t[i].call(e,r):t[i].call(e)}(this,n)}},(()=>{const i="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;t=[zt],r=[zt],Gt(e,null,t,{kind:"method",name:"fetchBannerPlaceById",static:!1,private:!1,access:{has:e=>"fetchBannerPlaceById"in e,get:e=>e.fetchBannerPlaceById},metadata:i},null,n),Gt(e,null,r,{kind:"method",name:"fetchContext",static:!1,private:!1,access:{has:e=>"fetchContext"in e,get:e=>e.fetchContext},metadata:i},null,n),i&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:i})})()})();class Xt{constructor(e,t){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"bannerStore",{enumerable:!0,configurable:!0,writable:!0,value:t})}createBannerPlace(e,t){var r;const n=new Ht(this.storyManager.httpClient,this.storyManager),i=new Ge(n),a=new Nt(this.storyManager,this.bannerStore,i);return new Ee(null!==(r=null==t?void 0:t.toString())&&void 0!==r?r:"default",e,i,this.bannerStore,a)}createBannerPreviewPlace(e,t){const r=new Ht(this.storyManager.httpClient,this.storyManager),n=new Ge(r),i=new Nt(this.storyManager,this.bannerStore,n);return new $e(t.toString(),e,this.bannerStore,i)}}class Yt{static toDomain(e,t){return new re({id:e.id,name:e.name,slides:e.slides.map(e=>{var t;return new oe({html:e.html,duration:e.duration,payload:null===(t=e.event_payload)||void 0===t?void 0:t.payload})}),displayFrom:e.display_from,displayTo:e.display_to,appearance:new ne(e.appearance),context:new ie(e.id,t),frequencyLimit:e.frequency_limit})}}class Qt{static toDomain(e,t,r){const n=e.banners.map(e=>Yt.toDomain(e,t));return new ce({id:e.id,banners:n,placeholders:r,style:t.style})}}var Kt=function(e,t,r){for(var n=arguments.length>2,i=0;i<t.length;i++)r=n?t[i].call(e,r):t[i].call(e);return n?r:void 0},Jt=function(e,t,r,n,i,a){function s(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var o,l=n.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?n.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,n.name):{}),u=!1,p=r.length-1;p>=0;p--){var b={};for(var f in n)b[f]="access"===f?{}:n[f];for(var f in n.access)b.access[f]=n.access[f];b.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(s(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],b);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(o=s(m.get))&&(h.get=o),(o=s(m.set))&&(h.set=o),(o=s(m.init))&&i.unshift(o)}else(o=s(m))&&("field"===l?i.unshift(o):h[c]=o)}d&&Object.defineProperty(d,n.name,h),u=!0},Zt=function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)},er=function(e,t,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(e,r):i?i.value=r:t.set(e,r),r};let tr=(()=>{var e,t,r;let n,i,a,s,o=[],l=[],c=[],p=[],b=[];return e=class{get _bannerPlaces(){return Zt(this,t,"f")}set _bannerPlaces(e){er(this,t,e,"f")}get _banners(){return Zt(this,r,"f")}set _banners(e){er(this,r,e,"f")}constructor(e,n){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:(Kt(this,o),e)}),Object.defineProperty(this,"bannerApi",{enumerable:!0,configurable:!0,writable:!0,value:n}),t.set(this,Kt(this,l,h.map())),r.set(this,(Kt(this,c),Kt(this,p,h.map()))),Object.defineProperty(this,"bannerCSS",{enumerable:!0,configurable:!0,writable:!0,value:(Kt(this,b),"")}),u(()=>e.rootStore.placeholderStore.placeholders,e=>{for(const t of this._bannerPlaces.values())t.updatePlaceholders(e)})}get bannerPlaces(){return Array.from(this._bannerPlaces.values())}async getBannerById(e){if(this._banners.has(e))return this._banners.get(e);await this.storyManager.rootStore.sessionStore.open();const t=await this.fetchBannerContext({bannerIds:[e]}),r=await this.bannerApi.fetchBannerById(e);return this.addBanner(r,t)}async getBannerPlaceById(e){if(this._bannerPlaces.has(e.placeId))return this._bannerPlaces.get(e.placeId);const t=this.storyManager.config;await this.storyManager.rootStore.sessionStore.open();const r=await this.bannerApi.fetchBannerPlaceById({placeId:e.placeId,tags:t.tags,options:t.options}),n=await this.fetchBannerContext({bannerIds:r.banners.map(e=>e.id)});return this.addBannerPlace(r,n)}clearCache(){this._bannerPlaces=h.map(),this._banners=h.map()}removeBannerPlaceById(e){this._bannerPlaces.delete(e)}async updateBannerUserData(e,t){if(!this.storyManager.isStatisticsDisabled)return this.bannerApi.updateUserData(e,t);console.log("[IAM]: update user data",{bannerId:e,payload:t})}async fetchBannerContext({bannerIds:e}){const t=await this.bannerApi.fetchContextWithStyles({needFetchStyles:!this.bannerCSS,bannerIds:e});return this.bannerCSS&&(t.style=this.bannerCSS),t}addBannerPlace(e,t){const r=this.storyManager.rootStore.placeholderStore.placeholders,n=Qt.toDomain(e,t,r);return this._bannerPlaces.set(e.id,n),n}addBanner(e,t){const r=this.storyManager.rootStore.placeholderStore.placeholders,n=Yt.toDomain(e,t);return n.updatePlaceholders(r),this._banners.set(n.id,n),n}},t=new WeakMap,r=new WeakMap,(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;n=[h],i=[h],a=[d],s=[zt],Jt(e,null,n,{kind:"accessor",name:"_bannerPlaces",static:!1,private:!1,access:{has:e=>"_bannerPlaces"in e,get:e=>e._bannerPlaces,set:(e,t)=>{e._bannerPlaces=t}},metadata:t},l,c),Jt(e,null,i,{kind:"accessor",name:"_banners",static:!1,private:!1,access:{has:e=>"_banners"in e,get:e=>e._banners,set:(e,t)=>{e._banners=t}},metadata:t},p,b),Jt(e,null,a,{kind:"getter",name:"bannerPlaces",static:!1,private:!1,access:{has:e=>"bannerPlaces"in e,get:e=>e.bannerPlaces},metadata:t},null,o),Jt(e,null,s,{kind:"method",name:"getBannerPlaceById",static:!1,private:!1,access:{has:e=>"getBannerPlaceById"in e,get:e=>e.getBannerPlaceById},metadata:t},null,o),t&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),e})();class rr{constructor(e){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"bannerStore",{enumerable:!0,configurable:!0,writable:!0,value:void 0});const t=new qt(e.httpClient);this.bannerStore=new tr(this.storyManager,t)}}class nr extends Error{constructor(){super("[IAS]: you must create an instance of BannersProvider"),this.name="IasBannersProviderReferenceError"}}class ir extends Error{constructor(e){super(`[IAS]: Mount point ${e} is not present in DOM at initialization time`),this.name="IasMountPointReferenceError"}}class ar extends Le{render(){this.root.render(e(Me,{bannerPlace:this.bannerPlace}))}}class sr{constructor(e){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"bannerPlaces",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"bannerPlaceViewModelFactory",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"rootStore",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"reloadAllBanners",{enumerable:!0,configurable:!0,writable:!0,value:()=>{this.rootStore.bannerStore.clearCache(),this.bannerPlaces.forEach(e=>{e.reload().catch(console.error)})}}),this.rootStore=new rr(e),this.bannerPlaceViewModelFactory=new Xt(e,this.rootStore.bannerStore),this.storyManager.on("requestSDKReload",this.reloadAllBanners)}getConfig(){return this.storyManager.config}addBannerPlace(e){this.bannerPlaces.push(e)}removeBannerPlace(e){const t=this.bannerPlaces.indexOf(e);-1!==t&&this.bannerPlaces.splice(t,1)}clear(){for(const e of this.bannerPlaces)e.destroy();this.bannerPlaces=[]}createBannerPlace(e){return this.bannerPlaceViewModelFactory.createBannerPlace(this,e)}createBannerPreviewPlace(e){return this.bannerPlaceViewModelFactory.createBannerPreviewPlace(this,e)}static create(e){return sr.instance||(sr.instance=new sr(e)),sr.instance}mountBannerPlace(e,t){return this.mountBannerCarousel(e,t)}mountBannerCarousel(e,t){const r=document.querySelector(e);if(!r)throw new ir(e);const n=this.createBannerPlace(null==t?void 0:t.placeId),i=new Le(r,n,t);return i.render(),i}mountBannerList(e,t){const r=document.querySelector(e);if(!r)throw new ir(e);const n=this.createBannerPlace(null==t?void 0:t.placeId),i=new je(r,n,t);return i.render(),i}mountBannerPreviewPlace(e,t){const r=document.querySelector(e);if(!r)throw new ir(e);const n=this.createBannerPreviewPlace(t.bannerId),i=new ar(r,n);return i.render(),i}}const or=()=>{if(!sr.instance)throw new nr;return sr.instance},lr=sr;class cr{constructor(){Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ias-banners"})}install(e){const t=lr.create(e.INTERNAL_API);e.HOST.prototype.banners=t}uninstall(){}}const dr=new cr;export{ke as IasBannerCarousel,Fe as IasBannerList,ke as IasBannerPlace,Re as IasBannerPreview,cr as IasBannersPlugin,dr as default};
|