diff --git a/dist/amp-client.min.js b/dist/amp-client.min.js index 800faa3..670be7a 100644 --- a/dist/amp-client.min.js +++ b/dist/amp-client.min.js @@ -1 +1 @@ -var AMPClientFactory;(()=>{var t={6384:(t,e,n)=>{var r=n(7040),o=n(4125),i=n(2117),a=n(7518),u=n(4705);function c(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e{var r=n(5639).Uint8Array;t.exports=r},6874:t=>{t.exports=function(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}},9932:t=>{t.exports=function(t,e){for(var n=-1,r=null==t?0:t.length,o=Array(r);++n{var r=n(9465),o=n(7813);t.exports=function(t,e,n){(void 0!==n&&!o(t[e],n)||void 0===n&&!(e in t))&&r(t,e,n)}},4865:(t,e,n)=>{var r=n(9465),o=n(7813),i=Object.prototype.hasOwnProperty;t.exports=function(t,e,n){var a=t[e];i.call(t,e)&&o(a,n)&&(void 0!==n||e in t)||r(t,e,n)}},8470:(t,e,n)=>{var r=n(7813);t.exports=function(t,e){for(var n=t.length;n--;)if(r(t[n][0],e))return n;return-1}},9465:(t,e,n)=>{var r=n(8777);t.exports=function(t,e,n){"__proto__"==e&&r?r(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}},3118:(t,e,n)=>{var r=n(3218),o=Object.create,i=function(){function t(){}return function(e){if(!r(e))return{};if(o)return o(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();t.exports=i},8483:(t,e,n)=>{var r=n(5063)();t.exports=r},4239:t=>{var e=Object.prototype.toString;t.exports=function(t){return e.call(t)}},2980:(t,e,n)=>{var r=n(6384),o=n(6556),i=n(8483),a=n(9783),u=n(3218),c=n(1704),l=n(6390);t.exports=function t(e,n,f,s,p){e!==n&&i(n,(function(i,c){if(p||(p=new r),u(i))a(e,n,c,f,t,s,p);else{var y=s?s(l(e,c),i,c+"",e,n,p):void 0;void 0===y&&(y=i),o(e,c,y)}}),c)}},9783:(t,e,n)=>{var r=n(6556),o=n(4626),i=n(7133),a=n(278),u=n(8517),c=n(5694),l=n(1469),f=n(9246),s=n(4144),p=n(3560),y=n(3218),v=n(8630),b=n(6719),d=n(6390),m=n(9881);t.exports=function(t,e,n,h,w,g,S){var E=d(t,n),j=d(e,n),T=S.get(j);if(T)r(t,n,T);else{var k=g?g(E,j,n+"",t,e,S):void 0,O=void 0===k;if(O){var P=l(j),_=!P&&s(j),A=!P&&!_&&b(j);k=j,P||_||A?l(E)?k=E:f(E)?k=a(E):_?(O=!1,k=o(j,!0)):A?(O=!1,k=i(j,!0)):k=[]:v(j)||c(j)?(k=E,c(E)?k=m(E):y(E)&&!p(E)||(k=u(j))):O=!1}O&&(S.set(j,k),w(k,j,h,g,S),S.delete(j)),r(t,n,k)}}},8674:t=>{t.exports=function(t){return function(e){return null==t?void 0:t[e]}}},5976:(t,e,n)=>{var r=n(6557),o=n(5357),i=n(61);t.exports=function(t,e){return i(o(t,e,r),t+"")}},7415:(t,e,n)=>{var r=n(9932);t.exports=function(t,e){return r(e,(function(e){return t[e]}))}},4318:(t,e,n)=>{var r=n(1149);t.exports=function(t){var e=new t.constructor(t.byteLength);return new r(e).set(new r(t)),e}},4626:(t,e,n)=>{t=n.nmd(t);var r=n(5639),o=e&&!e.nodeType&&e,i=o&&t&&!t.nodeType&&t,a=i&&i.exports===o?r.Buffer:void 0,u=a?a.allocUnsafe:void 0;t.exports=function(t,e){if(e)return t.slice();var n=t.length,r=u?u(n):new t.constructor(n);return t.copy(r),r}},7133:(t,e,n)=>{var r=n(4318);t.exports=function(t,e){var n=e?r(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}},278:t=>{t.exports=function(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n{var r=n(4865),o=n(9465);t.exports=function(t,e,n,i){var a=!n;n||(n={});for(var u=-1,c=e.length;++u{var r=n(5976),o=n(6612);t.exports=function(t){return r((function(e,n){var r=-1,i=n.length,a=i>1?n[i-1]:void 0,u=i>2?n[2]:void 0;for(a=t.length>3&&"function"==typeof a?(i--,a):void 0,u&&o(n[0],n[1],u)&&(a=i<3?void 0:a,i=1),e=Object(e);++r{t.exports=function(t){return function(e,n,r){for(var o=-1,i=Object(e),a=r(e),u=a.length;u--;){var c=a[t?u:++o];if(!1===n(i[c],c,i))break}return e}}},3833:(t,e,n)=>{var r=n(7813),o=Object.prototype,i=o.hasOwnProperty;t.exports=function(t,e,n,a){return void 0===t||r(t,o[n])&&!i.call(a,n)?e:t}},8777:(t,e,n)=>{var r=n(852),o=function(){try{var t=r(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();t.exports=o},9464:(t,e,n)=>{var r=n(8674)({"&":"&","<":"<",">":">",'"':""","'":"'"});t.exports=r},1994:t=>{var e={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"};t.exports=function(t){return"\\"+e[t]}},1957:(t,e,n)=>{var r="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g;t.exports=r},852:t=>{t.exports=function(t,e){return null==t?void 0:t[e]}},5924:(t,e,n)=>{var r=n(5569)(Object.getPrototypeOf,Object);t.exports=r},8517:(t,e,n)=>{var r=n(3118),o=n(5924),i=n(5726);t.exports=function(t){return"function"!=typeof t.constructor||i(t)?{}:r(o(t))}},6612:t=>{t.exports=function(){return!1}},5726:t=>{t.exports=function(){return!1}},7040:t=>{t.exports=function(){this.__data__=[],this.size=0}},4125:(t,e,n)=>{var r=n(8470),o=Array.prototype.splice;t.exports=function(t){var e=this.__data__,n=r(e,t);return!(n<0)&&(n==e.length-1?e.pop():o.call(e,n,1),--this.size,!0)}},2117:(t,e,n)=>{var r=n(8470);t.exports=function(t){var e=this.__data__,n=r(e,t);return n<0?void 0:e[n][1]}},7518:(t,e,n)=>{var r=n(8470);t.exports=function(t){return r(this.__data__,t)>-1}},4705:(t,e,n)=>{var r=n(8470);t.exports=function(t,e){var n=this.__data__,o=r(n,t);return o<0?(++this.size,n.push([t,e])):n[o][1]=e,this}},5569:t=>{t.exports=function(t,e){return function(n){return t(e(n))}}},5357:(t,e,n)=>{var r=n(6874),o=Math.max;t.exports=function(t,e,n){return e=o(void 0===e?t.length-1:e,0),function(){for(var i=arguments,a=-1,u=o(i.length-e,0),c=Array(u);++a{t.exports=/<%-([\s\S]+?)%>/g},6051:t=>{t.exports=/<%([\s\S]+?)%>/g},5712:t=>{t.exports=/<%=([\s\S]+?)%>/g},5639:(t,e,n)=>{var r=n(1957),o="object"==typeof self&&self&&self.Object===Object&&self,i=r||o||Function("return this")();t.exports=i},6390:t=>{t.exports=function(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}},61:t=>{t.exports=function(t){return t}},9018:(t,e,n)=>{var r=n(8363),o=n(1463),i=n(1704),a=o((function(t,e,n,o){r(e,i(e),t,o)}));t.exports=a},9591:(t,e,n)=>{var r=n(6874),o=n(5976),i=n(4647),a=o((function(t,e){try{return r(t,void 0,e)}catch(t){return i(t)?t:new Error(t)}}));t.exports=a},7813:t=>{t.exports=function(t,e){return t===e||t!=t&&e!=e}},7187:(t,e,n)=>{var r=n(9464),o=n(9833),i=/[&<>"']/g,a=RegExp(i.source);t.exports=function(t){return(t=o(t))&&a.test(t)?t.replace(i,r):t}},6557:t=>{t.exports=function(t){return t}},5694:t=>{t.exports=function(){return!1}},1469:t=>{var e=Array.isArray;t.exports=e},8612:(t,e,n)=>{var r=n(3560),o=n(1780);t.exports=function(t){return null!=t&&o(t.length)&&!r(t)}},9246:(t,e,n)=>{var r=n(8612),o=n(7005);t.exports=function(t){return o(t)&&r(t)}},4144:t=>{t.exports=function(){return!1}},4647:(t,e,n)=>{var r=n(4239),o=n(7005),i=n(8630);t.exports=function(t){if(!o(t))return!1;var e=r(t);return"[object Error]"==e||"[object DOMException]"==e||"string"==typeof t.message&&"string"==typeof t.name&&!i(t)}},3560:(t,e,n)=>{var r=n(4239),o=n(3218);t.exports=function(t){if(!o(t))return!1;var e=r(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}},1780:t=>{t.exports=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}},3218:t=>{t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},7005:t=>{t.exports=function(t){return null!=t&&"object"==typeof t}},8630:(t,e,n)=>{var r=n(4239),o=n(5924),i=n(7005),a=Function.prototype,u=Object.prototype,c=a.toString,l=u.hasOwnProperty,f=c.call(Object);t.exports=function(t){if(!i(t)||"[object Object]"!=r(t))return!1;var e=o(t);if(null===e)return!0;var n=l.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&c.call(n)==f}},6719:t=>{t.exports=function(){return!1}},3674:(t,e,n)=>{var r=n(5569)(Object.keys,Object);t.exports=r},1704:t=>{t.exports=function(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e}},2492:(t,e,n)=>{var r=n(2980),o=n(1463)((function(t,e,n){r(t,e,n)}));t.exports=o},1106:(t,e,n)=>{var r=n(9018),o=n(9591),i=n(7415),a=n(3833),u=n(1994),c=n(4647),l=n(6612),f=n(3674),s=n(5712),p=n(5835),y=n(9833),v=/\b__p \+= '';/g,b=/\b(__p \+=) '' \+/g,d=/(__e\(.*?\)|\b__t\)) \+\n'';/g,m=/[()=,{}\[\]\/\s]/,h=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,w=/($^)/,g=/['\n\r\u2028\u2029\\]/g,S=Object.prototype.hasOwnProperty;t.exports=function(t,e,n){var E=p.imports._.templateSettings||p;n&&l(t,e,n)&&(e=void 0),t=y(t),e=r({},e,E,a);var j,T,k=r({},e.imports,E.imports,a),O=f(k),P=i(k,O),_=0,A=e.interpolate||w,N="__p += '",R=RegExp((e.escape||w).source+"|"+A.source+"|"+(A===s?h:w).source+"|"+(e.evaluate||w).source+"|$","g"),I=S.call(e,"sourceURL")?"//# sourceURL="+(e.sourceURL+"").replace(/\s/g," ")+"\n":"";t.replace(R,(function(e,n,r,o,i,a){return r||(r=o),N+=t.slice(_,a).replace(g,u),n&&(j=!0,N+="' +\n__e("+n+") +\n'"),i&&(T=!0,N+="';\n"+i+";\n__p += '"),r&&(N+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),_=a+e.length,e})),N+="';\n";var M=S.call(e,"variable")&&e.variable;if(M){if(m.test(M))throw new Error("Invalid `variable` option passed into `_.template`")}else N="with (obj) {\n"+N+"\n}\n";N=(T?N.replace(v,""):N).replace(b,"$1").replace(d,"$1;"),N="function("+(M||"obj")+") {\n"+(M?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(j?", __e = _.escape":"")+(T?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+N+"return __p\n}";var C=o((function(){return Function(O,I+"return "+N).apply(void 0,P)}));if(C.source=N,c(C))throw C;return C}},5835:(t,e,n)=>{var r=n(7187),o={escape:n(9865),evaluate:n(6051),interpolate:n(5712),variable:"",imports:{_:{escape:r}}};t.exports=o},9881:(t,e,n)=>{var r=n(8363),o=n(1704);t.exports=function(t){return r(t,o(t))}},9833:t=>{t.exports=function(t){return t}}},e={};function n(r){var o=e[r];if(void 0!==o)return o.exports;var i=e[r]={id:r,loaded:!1,exports:{}};return t[r](i,i.exports,n),i.loaded=!0,i.exports}n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.nmd=t=>(t.paths=[],t.children||(t.children=[]),t);var r={};(()=>{"use strict";n.d(r,{default:()=>ac});var t={};n.r(t),n.d(t,{exclude:()=>G,extract:()=>F,parse:()=>U,parseUrl:()=>z,pick:()=>H,stringify:()=>L,stringifyUrl:()=>$});const e=JSON.parse('{"i8":"1.5.0-beta.3"}');function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}function i(t,e){for(var n=0;n\n\n <% if(\'img\' === data.content.type) { %>\n target="<%- data.content.target %>"<% } %>>\n \n <% (data.content.sources || []).forEach(function(source) { %>\n \n <% }); %>\n <%- data.content.alt %>title="<%- data.content.title %>"<% } %>\n <% if(banner.options.has(\'loading\')) { %>loading="<%- banner.options.get(\'loading\') %>"<% } %>>\n \n \n <% } else if (\'html\' === data.content.type) { %>\n
\n <%= data.content.html %>\n
\n <% } %>\n\n \n',random:'\n \n',multiple:'\n \n'};function b(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,u=[],c=!0,l=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=i.call(n)).done)&&(u.push(r.value),u.length!==e);c=!0);}catch(t){l=!0,o=t}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw o}}return u}}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return d(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return d(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function d(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);nnull==t,R=t=>encodeURIComponent(t).replace(/[!'()*]/g,(t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`)),I=Symbol("encodeFragmentIdentifier");function M(t){if("string"!=typeof t||1!==t.length)throw new TypeError("arrayFormatSeparator must be single character string")}function C(t,e){return e.encode?e.strict?R(t):encodeURIComponent(t):t}function x(t,e){return e.decode?P(t):t}function W(t){return Array.isArray(t)?t.sort():"object"==typeof t?W(Object.keys(t)).sort(((t,e)=>Number(t)-Number(e))).map((e=>t[e])):t}function D(t){const e=t.indexOf("#");return-1!==e&&(t=t.slice(0,e)),t}function B(t,e){return e.parseNumbers&&!Number.isNaN(Number(t))&&"string"==typeof t&&""!==t.trim()?t=Number(t):!e.parseBooleans||null===t||"true"!==t.toLowerCase()&&"false"!==t.toLowerCase()||(t="true"===t.toLowerCase()),t}function F(t){const e=(t=D(t)).indexOf("?");return-1===e?"":t.slice(e+1)}function U(t,e){M((e={decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1,...e}).arrayFormatSeparator);const n=function(t){let e;switch(t.arrayFormat){case"index":return(t,n,r)=>{e=/\[(\d*)]$/.exec(t),t=t.replace(/\[\d*]$/,""),e?(void 0===r[t]&&(r[t]={}),r[t][e[1]]=n):r[t]=n};case"bracket":return(t,n,r)=>{e=/(\[])$/.exec(t),t=t.replace(/\[]$/,""),e?void 0!==r[t]?r[t]=[...r[t],n]:r[t]=[n]:r[t]=n};case"colon-list-separator":return(t,n,r)=>{e=/(:list)$/.exec(t),t=t.replace(/:list$/,""),e?void 0!==r[t]?r[t]=[...r[t],n]:r[t]=[n]:r[t]=n};case"comma":case"separator":return(e,n,r)=>{const o="string"==typeof n&&n.includes(t.arrayFormatSeparator),i="string"==typeof n&&!o&&x(n,t).includes(t.arrayFormatSeparator);n=i?x(n,t):n;const a=o||i?n.split(t.arrayFormatSeparator).map((e=>x(e,t))):null===n?n:x(n,t);r[e]=a};case"bracket-separator":return(e,n,r)=>{const o=/(\[])$/.test(e);if(e=e.replace(/\[]$/,""),!o)return void(r[e]=n?x(n,t):n);const i=null===n?[]:n.split(t.arrayFormatSeparator).map((e=>x(e,t)));void 0!==r[e]?r[e]=[...r[e],...i]:r[e]=i};default:return(t,e,n)=>{void 0!==n[t]?n[t]=[...[n[t]].flat(),e]:n[t]=e}}}(e),r=Object.create(null);if("string"!=typeof t)return r;if(!(t=t.trim().replace(/^[?#&]/,"")))return r;for(const o of t.split("&")){if(""===o)continue;const t=e.decode?o.replace(/\+/g," "):o;let[i,a]=_(t,"=");void 0===i&&(i=t),a=void 0===a?null:["comma","separator","bracket-separator"].includes(e.arrayFormat)?a:x(a,e),n(x(i,e),a,r)}for(const[t,n]of Object.entries(r))if("object"==typeof n&&null!==n)for(const[t,r]of Object.entries(n))n[t]=B(r,e);else r[t]=B(n,e);return!1===e.sort?r:(!0===e.sort?Object.keys(r).sort():Object.keys(r).sort(e.sort)).reduce(((t,e)=>{const n=r[e];return Boolean(n)&&"object"==typeof n&&!Array.isArray(n)?t[e]=W(n):t[e]=n,t}),Object.create(null))}function L(t,e){if(!t)return"";M((e={encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:",",...e}).arrayFormatSeparator);const n=n=>e.skipNull&&N(t[n])||e.skipEmptyString&&""===t[n],r=function(t){switch(t.arrayFormat){case"index":return e=>(n,r)=>{const o=n.length;return void 0===r||t.skipNull&&null===r||t.skipEmptyString&&""===r?n:null===r?[...n,[C(e,t),"[",o,"]"].join("")]:[...n,[C(e,t),"[",C(o,t),"]=",C(r,t)].join("")]};case"bracket":return e=>(n,r)=>void 0===r||t.skipNull&&null===r||t.skipEmptyString&&""===r?n:null===r?[...n,[C(e,t),"[]"].join("")]:[...n,[C(e,t),"[]=",C(r,t)].join("")];case"colon-list-separator":return e=>(n,r)=>void 0===r||t.skipNull&&null===r||t.skipEmptyString&&""===r?n:null===r?[...n,[C(e,t),":list="].join("")]:[...n,[C(e,t),":list=",C(r,t)].join("")];case"comma":case"separator":case"bracket-separator":{const e="bracket-separator"===t.arrayFormat?"[]=":"=";return n=>(r,o)=>void 0===o||t.skipNull&&null===o||t.skipEmptyString&&""===o?r:(o=null===o?"":o,0===r.length?[[C(n,t),e,C(o,t)].join("")]:[[r,C(o,t)].join(t.arrayFormatSeparator)])}default:return e=>(n,r)=>void 0===r||t.skipNull&&null===r||t.skipEmptyString&&""===r?n:null===r?[...n,C(e,t)]:[...n,[C(e,t),"=",C(r,t)].join("")]}}(e),o={};for(const[e,r]of Object.entries(t))n(e)||(o[e]=r);const i=Object.keys(o);return!1!==e.sort&&i.sort(e.sort),i.map((n=>{const o=t[n];return void 0===o?"":null===o?C(n,e):Array.isArray(o)?0===o.length&&"bracket-separator"===e.arrayFormat?C(n,e)+"[]":o.reduce(r(n),[]).join("&"):C(n,e)+"="+C(o,e)})).filter((t=>t.length>0)).join("&")}function z(t,e){e={decode:!0,...e};let[n,r]=_(t,"#");return void 0===n&&(n=t),{url:n?.split("?")?.[0]??"",query:U(F(t),e),...e&&e.parseFragmentIdentifier&&r?{fragmentIdentifier:x(r,e)}:{}}}function $(t,e){e={encode:!0,strict:!0,[I]:!0,...e};const n=D(t.url).split("?")[0]||"";let r=L({...U(F(t.url),{sort:!1}),...t.query},e);r&&(r=`?${r}`);let o=function(t){let e="";const n=t.indexOf("#");return-1!==n&&(e=t.slice(n)),e}(t.url);if(t.fragmentIdentifier){const r=new URL(n);r.hash=t.fragmentIdentifier,o=e[I]?r.hash:`#${t.fragmentIdentifier}`}return`${n}${r}${o}`}function H(t,e,n){n={parseFragmentIdentifier:!0,[I]:!1,...n};const{url:r,query:o,fragmentIdentifier:i}=z(t,n);return $({url:r,query:A(o,e),fragmentIdentifier:i},n)}function G(t,e,n){return H(t,Array.isArray(e)?t=>!e.includes(t):(t,n)=>!e(t,n),n)}const q=t;function V(t){return V="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},V(t)}function Y(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return K(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return K(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function K(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);nr.status?e(t):n(t)},r.onerror=function(){n({status:"error",data:{code:r.status,error:r.statusText||"unknown"}})};var o=t.endpoint;"GET"===t.method&&(o+="?".concat(q.stringify(t.parameters))),r.open(t.method,o,!0),r.overrideMimeType("application/json"),r.setRequestHeader("Accept","application/json");var i,a=Y(t.headers);try{for(a.s();!(i=a.n()).done;){var u=i.value;r.setRequestHeader(u.name,u.value)}}catch(t){a.e(t)}finally{a.f()}r.send("POST"===t.method?JSON.stringify(t.parameters):null)}}])&&J(e.prototype,n),r&&J(e,r),Object.defineProperty(e,"prototype",{writable:!1}),i}(S);function et(t){return et="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},et(t)}function nt(t,e){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:null,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),dt(this,gt,{writable:!0,value:void 0}),dt(this,St,{writable:!0,value:void 0}),dt(this,Et,{writable:!0,value:void 0}),dt(this,jt,{writable:!0,value:void 0}),dt(this,Tt,{writable:!0,value:void 0}),dt(this,kt,{writable:!0,value:void 0}),dt(this,Ot,{writable:!0,value:function(t){var e={};for(var n in t)for(var r in e[n]={},t[n]){var o=t[n][r].value.filter((function(t){return""!==t}));o.length&&(e[n][r]=o)}return e}}),ht(this,gt,e),ht(this,St,n),ht(this,Et,r),ht(this,jt,{}),ht(this,Tt,o),ht(this,kt,i)}var e,n,r;return e=t,n=[{key:"addPosition",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=mt(this,jt);if(t in r)throw new Error('Position "'+t+'" already exists.');r[t]={},n&&this.addPositionResources(t,mt(this,Tt)),this.addPositionResources(t,e)}},{key:"addPositionResources",value:function(t,e){for(var n in e)this.addPositionResource(t,e[n])}},{key:"addPositionResource",value:function(t,e){if(!(e instanceof pt))throw new TypeError("Argument resource must be instance of Resource class.");var n=mt(this,jt);if(!(t in n))throw new Error('Missing position "'+t+'".');var r=n[t];e.name in r?r[e.name]=r[e.name].withValues(e.value):r[e.name]=e}},{key:"method",get:function(){return mt(this,gt)}},{key:"endpoint",get:function(){return mt(this,St)}},{key:"locale",get:function(){return mt(this,Et)}},{key:"parameters",get:function(){var t=mt(this,Ot).call(this,mt(this,jt)),e={query:"GET"===this.method?JSON.stringify(t):t};return null!==this.locale&&(e.locale=this.locale),e}},{key:"headers",get:function(){return mt(this,kt)}}],n&&bt(e.prototype,n),r&&bt(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function _t(t){return _t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_t(t)}function At(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};for(var o in"1"!==(r["omit-default-resources"]||"0").toString()?e=function(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:void 0;return this.options[t]||e}}],n&&le(e.prototype,n),r&&le(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function se(t){return se="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},se(t)}function pe(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:"";if(-1===this.STATE.STATES.indexOf(t))throw new TypeError("".concat(t," is not valid state."));be(this,ge,t),be(this,Se,e.toString()),ve(this,Ee)[t]=(ve(this,Ee)[t]||0)+1,this._eventBus.dispatch(oe.ON_BANNER_STATE_CHANGED,this)}},{key:"getCurrenBreakpoint",value:function(t){return null}},{key:"redrawIfNeeded",value:function(){}},{key:"isManaged",value:function(){return!1}},{key:"isExternal",value:function(){return!1}},{key:"isEmbed",value:function(){return!1}}],n&&pe(e.prototype,n),r&&pe(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Te(t){return Te="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Te(t)}function ke(t,e){for(var n=0;n=c&&(null===i||ic))&&(o=u,i=c,Ue(t,Ve)[n]=c)):r=u})),null===o&&null===r)throw new Error("Unable to resolve content, no contents found.");a.sort((function(t,e){return t-e})),"min"===n?a.unshift(null):a.push(null);var u=a.indexOf(i);return"max"===n&&u-1 in a&&(Ue(this,Ve).min=a[u-1]),"min"===n&&u+1 in a&&(Ue(this,Ve).max=a[u+1]),Le(this,qe,null!==o?o:r)}},{key:"needRedraw",value:function(){if(null===Ue(this,qe))return!0;var t=Ue(this,$e).width;return null!==Ue(this,Ve).min&&tUe(this,Ve).max}}])&&De(e.prototype,n),r&&De(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Je(t,e){for(var n in t)e(t[n],n)}function Xe(t){return Xe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Xe(t)}function Qe(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return Ze(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ze(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Ze(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n1&&void 0!==arguments[1]?arguments[1]:"weight",n={},r=0,o=0;o0;)u-=n[a],a++;return t[--a]?t[a]:t[0]}}],(n=null)&&wn(e.prototype,n),r&&wn(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Sn(t){return Sn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Sn(t)}function En(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return jn(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return jn(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function jn(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n6&&void 0!==arguments[6]?arguments[6]:{},f=arguments.length>7&&void 0!==arguments[7]?arguments[7]:{};for(var s in function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),An(Pn(c=o.call(this,n,r,a,u,f)),Hn),An(Pn(c),$n),Nn(Pn(c),Wn,{writable:!0,value:void 0}),Nn(Pn(c),Dn,{writable:!0,value:void 0}),Nn(Pn(c),Bn,{writable:!0,value:[]}),Nn(Pn(c),Fn,{writable:!0,value:void 0}),Nn(Pn(c),Un,{writable:!0,value:!1}),Nn(Pn(c),Ln,{writable:!0,value:null}),Nn(Pn(c),zn,{writable:!0,value:[]}),Cn(Pn(c),Wn,t),Cn(Pn(c),Dn,e),Cn(Pn(c),Fn,l),l)Mn(Pn(c),Bn).push(new pt(s,l[s]));return c}return e=i,(n=[{key:"html",set:function(t){this.element.innerHTML=t}},{key:"resources",get:function(){return Mn(this,Bn)}},{key:"rawResources",get:function(){return Mn(this,Fn)}},{key:"data",get:function(){return console.warn("Usage of deprecated property `ManagedBanner.data`. Please use property `positionData` for accessing information about a position."),new mn(this)}},{key:"fingerprints",get:function(){var t;try{t=this.bannerData}catch(t){return[]}return this.positionData.isMultiple()||(t=[t]),t.map((function(t){return t.fingerprint}))}},{key:"bannerData",get:function(){if(null!==Mn(this,Ln))return Mn(this,Ln);if(!Mn(this,zn).length)throw new Error("Banner's data is empty.");var t=null,e=this.positionData,n=function(t){return Oe.createFromProperties({bannerId:t.id,bannerName:t.name,positionId:e.id,positionCode:e.code,positionName:e.name,campaignId:t.campaignId,campaignCode:t.campaignCode,campaignName:t.campaignName})};switch(!0){case e.isSingle():(t=Mn(this,zn).reduce((function(t,e){return t.score>=e.score?t:e}))).fingerprint=n(t);break;case e.isRandom():(t=gn.randomByWeights(Mn(this,zn),"score")).fingerprint=n(t);break;case e.isMultiple():var r,o=En(t=Mn(this,zn).sort((function(t,e){return e.score-t.score})));try{for(o.s();!(r=o.n()).done;){var i=r.value;i.fingerprint=n(i)}}catch(t){o.e(t)}finally{o.f()}break;default:throw new Error("Invalid display type ".concat(this.displayType,"."))}if(null===t)throw new Error("Banner's data is empty.");return Cn(this,Ln,t),t}},{key:"setResponseData",value:function(t){if(Mn(this,Un))throw new Error("Data for banner on position ".concat(this.position," is already set."));this._positionData=new ue({id:t.position_id||null,code:this._positionData.code,name:t.position_name||null,rotationSeconds:t.rotation_seconds,displayType:t.display_type,breakpointType:t.breakpoint_type});var e=[];for(var n in t.banners||[])e.push(new ln(t.banners[n],t.breakpoint_type,Mn(this,Wn)));Cn(this,zn,e),Cn(this,Un,!0),In(this,$n,qn).call(this,"Banner was successfully rendered.")}},{key:"getCurrenBreakpoint",value:function(t){var e=this.bannerData,n=(e=(Array.isArray(e)?e:[e]).find((function(e){return e.id===t})))&&e.content?e.content.breakpoint:null;return null===n?null:parseInt(n)}},{key:"isManaged",value:function(){return!0}},{key:"redrawIfNeeded",value:function(){In(this,Hn,Vn).call(this)&&In(this,$n,qn).call(this,"Banner was successfully redrawn.")}}])&&Tn(e.prototype,n),r&&Tn(e,r),Object.defineProperty(e,"prototype",{writable:!1}),i}(je);function qn(t){try{this.html=Mn(this,Dn).render(this)}catch(t){return void this.setState(this.STATE.ERROR,"Render error: "+t.message)}this.setState(this.STATE.RENDERED,t)}function Vn(){var t=this.bannerData;for(var e in Array.isArray(t)||(t=[t]),t)if(t[e].needRedraw())return!0;return!1}function Yn(t){return Yn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Yn(t)}function Kn(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return Jn(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Jn(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Jn(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function er(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&void 0!==arguments[0]?arguments[0]:1;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),jr(this,Or,{writable:!0,value:void 0}),Tr(this,Or,e-1)}var e,n,r;return e=t,(n=[{key:"getNextIdentifier",value:function(){var t,e;return Tr(this,Or,(t=function(t,e){return e.get?e.get.call(t):e.value}(e=this,kr(e,Or,"get")),++t))}}])&&Er(e.prototype,n),r&&Er(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function _r(t){if(t instanceof HTMLElement)return t;if("string"!=typeof t)throw new TypeError("Element must be instance of HTMLElement or String");var e;if(!((e="#"===t.charAt(0)?document.getElementById(t.slice(1)):document.querySelector(t))instanceof HTMLElement))throw new TypeError("Selector "+t+" is invalid.");return e}function Ar(t){return Ar="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ar(t)}function Nr(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return Rr(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Rr(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Rr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n2&&void 0!==arguments[2]?arguments[2]:null;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Mr(this,Dr,{writable:!0,value:void 0}),Mr(this,Br,{writable:!0,value:void 0}),Mr(this,Fr,{writable:!0,value:void 0}),Mr(this,Ur,{writable:!0,value:void 0}),Mr(this,Lr,{writable:!0,value:[]}),xr(this,Dr,e),xr(this,Br,n),xr(this,Fr,r),xr(this,Ur,new Pr),this.STATE=ee}var e,n,r;return e=t,n=[{key:"addExternalBanner",value:function(t){(t=_r(t)).setAttribute("data-amp-attached","");var e=new vr(Cr(this,Br),Cr(this,Dr),Cr(this,Ur).getNextIdentifier(),t);return Cr(this,Lr).push(e),e}},{key:"addManagedBanner",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(null===Cr(this,Fr))throw new Error("Unable to add managed banner, renderer is not provided.");(t=_r(t)).setAttribute("data-amp-attached","");var o=new Gn(Cr(this,Br),Cr(this,Fr),Cr(this,Dr),Cr(this,Ur).getNextIdentifier(),t,e,n,r);return Cr(this,Lr).push(o),o}},{key:"addEmbedBanner",value:function(t,e,n){(t=_r(t)).setAttribute("data-amp-attached","");var r=new gr(Cr(this,Dr),Cr(this,Ur).getNextIdentifier(),t,e,n);return Cr(this,Lr).push(r),r}},{key:"removeBanner",value:function(t){var e=Cr(this,Lr).length;return xr(this,Lr,Cr(this,Lr).filter((function(e){return e!==t}))),e!==Cr(this,Lr).length}},{key:"getBannersByState",value:function(t){var e=t.state,n=t.managed,r=void 0===n||n,o=t.external,i=void 0===o||o,a=t.embed,u=void 0===a||a;return Cr(this,Lr).filter((function(t){return t instanceof je&&t.state===e&&!(t instanceof Gn&&!r||t instanceof vr&&!i||t instanceof gr&&!u)}))}},{key:"getBannerByFingerprint",value:function(t){var e,n=t instanceof Oe?t.value:t,r=Nr(Cr(this,Lr));try{for(r.s();!(e=r.n()).done;){var o=e.value;if(!(o instanceof gr)){var i,a=Nr(o.fingerprints);try{for(a.s();!(i=a.n()).done;)if(i.value.value===n)return o}catch(t){a.e(t)}finally{a.f()}}}}catch(t){r.e(t)}finally{r.f()}return null}},{key:"getBannerByUid",value:function(t){var e,n=Nr(Cr(this,Lr));try{for(n.s();!(e=n.n()).done;){var r=e.value;if(r.uid===t)return r}}catch(t){n.e(t)}finally{n.f()}return null}}],n&&Ir(e.prototype,n),r&&Ir(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function $r(t){return $r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$r(t)}function Hr(t,e){for(var n=0;n=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Qr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n2&&void 0!==arguments[2]?arguments[2]:null,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;if("function"!=typeof e)throw new TypeError("Listener must be of type function.");var i="idx_"+eo(this,oo).getNextIdentifier();return eo(this,io)[t]=eo(this,io)[t]||{},eo(this,io)[t][i]={callback:e,scope:r,priority:o},t in eo(this,ao)&&delete eo(this,ao)[t],function(){t in eo(n,io)&&i in eo(n,io)[t]&&delete eo(n,io)[t][i]}}},{key:"dispatch",value:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;re.priority?-1:t.priority=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Ro(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=u.pixels)return u.ratio}}catch(t){i.e(t)}finally{i.f()}return r};return new IntersectionObserver((function(r){var o,a=[],u={},l={},f=No(r);try{for(f.s();!(o=f.n()).done;){var s=o.value,p=s.target.dataset.ampBannerFingerprint,y=t.getBannerByFingerprint(p);if(y){var v=n[p];if(v){var b={fingerprint:v.fingerprint,element:s.target,banner:y};if(a.push(_o(_o({},b),{},{entry:s})),!v.alreadySeen){var d=s.intersectionRatio>=c(s.target);u[p]=!(p in u)||!u[p].isIntersecting&&d?{fingerprintArgs:b,fingerprintMetadata:v,isIntersecting:d}:u[p]}if(!v.alreadyFullySeen){var m=.99<=s.intersectionRatio;l[p]=!(p in l)||!l[p].isFullyIntersecting&&m?{fingerprintArgs:b,fingerprintMetadata:v,isFullyIntersecting:m}:l[p]}}}}}catch(t){f.e(t)}finally{f.f()}for(var h=function(){var t=g[w],n=t.fingerprintArgs,r=t.fingerprintMetadata,o=t.isIntersecting;o&&!r.alreadySeen&&null===r.firstTimeSeenTimeoutId?r.firstTimeSeenTimeoutId=setTimeout((function(){r.alreadySeen=!0,e.dispatch(oe.ON_BANNER_FIRST_TIME_SEEN,n)}),i):o||null===r.firstTimeSeenTimeoutId||(clearTimeout(r.firstTimeSeenTimeoutId),r.firstTimeSeenTimeoutId=null)},w=0,g=Object.values(u);w=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Do(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function ui(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=":"<=").concat(r),{channel_code:e,banner_id:t.bannerId,banner_name:t.bannerName,position_id:t.positionId,position_code:t.positionCode,position_name:t.positionName,campaign_id:t.campaignId,campaign_code:t.campaignCode,campaign_name:t.campaignName,breakpoint:r}};n.isEventEnabled(ei.BANNER_LOADED)&&t.subscribe(oe.ON_BANNER_STATE_CHANGED,(function(t){if(!t.isEmbed()&&ee.RENDERED===t.state&&1===t.stateCounter){var e,o=ai(t.fingerprints);try{for(o.s();!(e=o.n()).done;){var i=e.value;n.send(ei.BANNER_LOADED,r(i,t))}}catch(t){o.e(t)}finally{o.f()}}})),n.isEventEnabled(ei.BANNER_DISPLAYED)&&t.subscribe(oe.ON_BANNER_FIRST_TIME_SEEN,(function(t){var e=t.fingerprint,o=t.banner;n.send(ei.BANNER_DISPLAYED,r(e,o))})),n.isEventEnabled(ei.BANNER_FULLY_DISPLAYED)&&t.subscribe(oe.ON_BANNER_FIRST_TIME_FULLY_SEEN,(function(t){var e=t.fingerprint,o=t.banner;n.send(ei.BANNER_FULLY_DISPLAYED,r(e,o))})),n.isEventEnabled(ei.BANNER_CLICKED)&&t.subscribe(oe.ON_BANNER_LINK_CLICKED,(function(t){var e=t.fingerprint,o=t.banner,i=t.target;n.send(ei.BANNER_CLICKED,oi(oi({},r(e,o)),{},{link:i.href||""}))}))}}}}])&&ci(e.prototype,n),r&&ci(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}(),wi=!1;const gi=function(t,e){if(!("plausible"in window)||"function"!=typeof window.plausible)return!wi&&console.warn("Unable to send metrics to Plausible because the function plausible() does not occur in the window."),void(wi=!0);Object.keys(e).forEach((function(t){return null===e[t]&&delete e[t]})),window.plausible(t,{props:e})};var Si=!1;const Ei=function(t,e){if(!("gtag"in window)||"function"!=typeof window.gtag)return!Si&&console.warn("Unable to send metrics to Google Analytics because the function gtag() does not occur in the window."),void(Si=!0);Object.keys(e).forEach((function(t){return null===e[t]&&delete e[t]})),window.gtag("event",t,e)};function ji(t){return ji="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ji(t)}function Ti(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function ki(t,e,n){return(e=function(t){var e=function(t,e){if("object"!==ji(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!==ji(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===ji(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Oi=!1;const Pi=function(t,e){if(!("dataLayer"in window))return!Oi&&console.warn("Unable to send metrics to GTM because the dataLayer does not occur in the window."),void(Oi=!0);Object.keys(e).forEach((function(t){return null===e[t]&&delete e[t]})),window.dataLayer.push(function(t){for(var e=1;e=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Ri(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n3&&void 0!==arguments[3]?arguments[3]:"*";t.postMessage({message:e,data:n},r)}},{key:"listen",value:function(){var t=this;window.addEventListener("message",(function(e){if(!(0<$i(t,qi).length&&-1===$i(t,qi).indexOf(e.origin)||"object"!==Ui(e.data))&&"message"in e.data&&"data"in e.data){var n=e.data,r=n.message,o={data:n.data,origin:e.origin};t._beforeDispatch(r,o)&&$i(t,Vi).dispatch(r,o)}}),!1)}},{key:"_beforeDispatch",value:function(){return!0}}],n&&Li(e.prototype,n),r&&Li(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Ki(t){return Ki="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ki(t)}function Ji(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return Xi(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Xi(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Xi(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Aa(t,e){if(t){if("string"==typeof t)return Na(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Na(t,e):void 0}}function Na(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);ne.interaction.defaultIntersectionRatio||1s||1e.interaction.firstTimeSeenTimeout)throw new Error('The option "interaction.firstTimeSeenTimeout" must be a int with a minimum value of 500, "'.concat(e.interaction.firstTimeSeenTimeout,'" passed.'));if("object"!==m(e.metrics))throw new Error('The option "metrics" must be an object of the format { receiver: null|string|function|array, disabledEvents: array }, '.concat(e.metrics," passed."));if(null!==e.metrics.receiver&&-1===["string","function"].indexOf(m(e.metrics.receiver))&&!Array.isArray(e.metrics.receiver))throw new Error('The option "metrics.receiver" must be a null or a string or a function or an array of strings|functions, "'.concat(e.metrics.receiver,'" passed.'));if(Array.isArray(e.metrics.receiver)){for(var p in e.metrics.receiver)if(-1===["string","function"].indexOf(m(e.metrics.receiver[p])))throw new Error('The option "metrics.receiver.'.concat(p,'" must be a string or a function, "').concat(e.metrics.receiver[p],'" passed.'))}else e.metrics.receiver=null!==e.metrics.receiver?[e.metrics.receiver]:[];if(!Array.isArray(e.metrics.disabledEvents))throw new Error('The option "metrics.disabledEvents" must an array of strings (event names), "'.concat(e.metrics.disabledEvents,'" passed.'));for(var d in e.metrics.disabledEvents)if("string"!=typeof e.metrics.disabledEvents[d])throw new Error('The option "metrics.disabledEvents.'.concat(d,'" must be a string, "').concat(e.metrics.disabledEvents[d],'" passed.'));return e}(n)),xa(this,Fa,new uo),xa(this,Ua,new Ft(n.method,n.url,n.version,n.channel)),xa(this,La,new Qt(n.url,n.version,n.channel)),xa(this,$a,new zr(Ca(this,Fa),Kr.fromCurrentWindow(),new ko(n.template))),xa(this,Ha,new Xo(Ca(this,$a),Ca(this,Fa),n.interaction)),xa(this,Ga,Fi.createFromReceivers(n.metrics.receiver,n.metrics.disabledEvents)),xa(this,qa,new hi(Ca(this,Ga),Ca(this,Fa),n.channel)),xa(this,Va,new ga({origin:n.url,connectionData:{extendedConfig:{interaction:n.interaction}},bannerManager:Ca(this,$a),metricsSender:Ca(this,Ga)})),this.setLocale(n.locale),Ca(this,Ua).origin=n.origin,n.resources)Ca(this,Ua).addDefaultResource(a,n.resources[a]),Ca(this,La).addDefaultResource(a,n.resources[a]);window.addEventListener("resize",(function(){var t,e=_a(Ca(i,$a).getBannersByState({state:Ca(i,$a).STATE.RENDERED,managed:!0,external:!0,embed:!1}));try{for(e.s();!(t=e.n()).done;){t.value.redrawIfNeeded()}}catch(t){e.e(t)}finally{e.f()}})),Ca(this,Va).listen(),Ca(this,qa).attach(),Ca(this,Ha).start()}var e,n,r;return e=t,n=[{key:"version",get:function(){return Ca(this,Da)}},{key:"on",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return Ca(this,Fa).subscribe(t,e,n)}},{key:"setLocale",value:function(t){Ca(this,Ua).locale=t,Ca(this,La).locale=t}},{key:"setGateway",value:function(t){if(!function(t){return t instanceof S}(t))throw new TypeError("Argument gateway mut be instance of AbstractGateway.");xa(this,za,t)}},{key:"getGateway",value:function(){return null===Ca(this,za)&&this.setGateway(new tt),Ca(this,za)}},{key:"createBanner",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"managed";if(t=_r(t),"embed"===o){var i=function(t,e,n){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return n}(this,Ya,Ja).call(this,t,e,n,r),a=Ca(this,$a).addEmbedBanner(i,e,r);return Ca(this,Va).connectBanner(a),t.insertAdjacentElement("afterend",i),t.remove(),a}return Ca(this,$a).addManagedBanner(t,e,n,r)}},{key:"attachBanners",value:function(){var t,e=_a((arguments.length>0&&void 0!==arguments[0]?arguments[0]:document).querySelectorAll("[data-amp-banner]:not([data-amp-attached])"));try{for(e.s();!(t=e.n()).done;){var n=t.value,r=n.dataset.ampBanner;if(r){var o=void 0;if("ampBannerExternal"in n.dataset)o=Ca(this,$a).addExternalBanner(n);else{var i=Qn.parseResources(n),a=Qn.parseOptions(n),u=n.dataset.ampMode||"managed";o=this.createBanner(n,r,i,a,u)}Ca(this,Fa).dispatch(this.EVENTS.ON_BANNER_ATTACHED,o)}else console.warn("Unable to attach a banner to the element ",n,' because the attribute "data-amp-banner" has an empty value.')}}catch(t){e.e(t)}finally{e.f()}}},{key:"fetch",value:function(){var t=this,e=Ca(this,$a).getBannersByState({state:Ca(this,$a).STATE.NEW,managed:!0,external:!1,embed:!1});if(e.length){var n,r=Ca(this,Ua).create(),o=_a(e);try{for(o.s();!(n=o.n()).done;){var i=n.value;r.addPosition(i.position,i.resources,"1"!==i.options.get("omit-default-resources","0").toString())}}catch(t){o.e(t)}finally{o.f()}Ca(this,Fa).dispatch(this.EVENTS.ON_BEFORE_FETCH),this.getGateway().fetch(r,(function(n){var r,o=n.data,i=_a(e);try{for(i.s();!(r=i.n()).done;){var a=r.value;if(a.position in o&&"banners"in o[a.position]&&Object.values(o[a.position].banners).length){var u=o[a.position];Array.isArray(u.banners)||(u.banners=Object.values(u.banners)),"embed"!==u.mode?a.setResponseData(u):(t.createBanner(a.element,a.position,a.rawResources,a.options.options,u.mode),Ca(t,$a).removeBanner(a))}else a.setState(Ca(t,$a).STATE.NOT_FOUND,"Banner not found in fetched response.")}}catch(t){i.e(t)}finally{i.f()}Ca(t,Fa).dispatch(t.EVENTS.ON_FETCH_SUCCESS,n)}),(function(n){var r,o=_a(e);try{for(o.s();!(r=o.n()).done;)r.value.setState(Ca(t,$a).STATE.ERROR,"Request on api failed.")}catch(t){o.e(t)}finally{o.f()}Ca(t,Fa).dispatch(t.EVENTS.ON_FETCH_ERROR,n)}))}}}],n&&Ra(e.prototype,n),r&&Ra(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Ja(t,e,n,r){var o=document.createElement("iframe"),i="cv=".concat(encodeURIComponent(this.version.semver)),a=t.dataset.ampEmbedSrc||Ca(this,La).create(e,n,r);return a+=-1===a.indexOf("?")?"?".concat(i):"&".concat(i),Pa(t.attributes).map((function(t){var e=t.name,n=t.value;o.setAttribute(e,n)})),o.width="100%",o.height="100%",o.allowFullscreen=!0,o.scrolling="no",o.style.border="none",o.style.overflow="hidden",o.style.background="transparent",o.style.visibility="hidden",o.src=a,o.setAttribute("allowtransparency","true"),"lazy"===r.loading&&(o.loading="lazy"),o}function Xa(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,u=[],c=!0,l=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=i.call(n)).done)&&(u.push(r.value),u.length!==e);c=!0);}catch(t){l=!0,o=t}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw o}}return u}}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return Qa(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Qa(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Qa(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);ne.interaction.defaultIntersectionRatio||1a||1e.interaction.firstTimeSeenTimeout)throw new Error('The option "interaction.firstTimeSeenTimeout" must be a int with a minimum value of 500, "'.concat(e.interaction.firstTimeSeenTimeout,'" passed.'));return e}function nu(t){return nu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},nu(t)}function ru(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return ou(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ou(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function ou(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Iu(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n2&&void 0!==arguments[2]?arguments[2]:null;return Bu(this,Hu).subscribe(t,e,n)}},{key:"attachBanner",value:function(){if(Bu(this,Ju))throw new Error("Method attachBanner() should be called only once.");var t=document.querySelector("[data-amp-banner]:not([data-amp-attached])");if(t){var e=Bu(this,Gu).addExternalBanner(t);Fu(this,Ju,!0),window.self!==window.top&&e.delegateResponsiveBehaviour(),Bu(this,Hu).dispatch(this.EVENTS.ON_BANNER_ATTACHED,e)}else console.warn("No banner not found in the embed client.")}}],n&&Mu(e.prototype,n),r&&Mu(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function ec(t,e){Bu(this,qu).sendToParent("metrics",{eventName:t,eventArgs:e})}function nc(){var t,e=Ru(Bu(this,Gu).getBannersByState({state:ee.RENDERED}));try{for(e.s();!(t=e.n()).done;){t.value.redrawIfNeeded()}}catch(t){e.e(t)}finally{e.f()}}function rc(t){return rc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},rc(t)}function oc(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};return new Ka(new p(ic,"standard@".concat(ic)),t)}},{key:"createEmbed",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new tc(new p(ic,"embed@".concat(ic)),t)}},{key:"version",get:function(){return ic}}],(n=null)&&oc(e.prototype,n),r&&oc(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}()})(),AMPClientFactory=r.default})(); \ No newline at end of file +var AMPClientFactory;(()=>{var t={6384:(t,e,n)=>{var r=n(7040),o=n(4125),i=n(2117),a=n(7518),u=n(4705);function c(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e{var r=n(5639).Uint8Array;t.exports=r},6874:t=>{t.exports=function(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}},9932:t=>{t.exports=function(t,e){for(var n=-1,r=null==t?0:t.length,o=Array(r);++n{var r=n(9465),o=n(7813);t.exports=function(t,e,n){(void 0!==n&&!o(t[e],n)||void 0===n&&!(e in t))&&r(t,e,n)}},4865:(t,e,n)=>{var r=n(9465),o=n(7813),i=Object.prototype.hasOwnProperty;t.exports=function(t,e,n){var a=t[e];i.call(t,e)&&o(a,n)&&(void 0!==n||e in t)||r(t,e,n)}},8470:(t,e,n)=>{var r=n(7813);t.exports=function(t,e){for(var n=t.length;n--;)if(r(t[n][0],e))return n;return-1}},9465:(t,e,n)=>{var r=n(8777);t.exports=function(t,e,n){"__proto__"==e&&r?r(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}},3118:(t,e,n)=>{var r=n(3218),o=Object.create,i=function(){function t(){}return function(e){if(!r(e))return{};if(o)return o(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();t.exports=i},8483:(t,e,n)=>{var r=n(5063)();t.exports=r},4239:t=>{var e=Object.prototype.toString;t.exports=function(t){return e.call(t)}},2980:(t,e,n)=>{var r=n(6384),o=n(6556),i=n(8483),a=n(9783),u=n(3218),c=n(1704),l=n(6390);t.exports=function t(e,n,s,f,p){e!==n&&i(n,(function(i,c){if(p||(p=new r),u(i))a(e,n,c,s,t,f,p);else{var y=f?f(l(e,c),i,c+"",e,n,p):void 0;void 0===y&&(y=i),o(e,c,y)}}),c)}},9783:(t,e,n)=>{var r=n(6556),o=n(4626),i=n(7133),a=n(278),u=n(8517),c=n(5694),l=n(1469),s=n(9246),f=n(4144),p=n(3560),y=n(3218),v=n(8630),b=n(6719),d=n(6390),m=n(9881);t.exports=function(t,e,n,h,w,g,S){var E=d(t,n),j=d(e,n),T=S.get(j);if(T)r(t,n,T);else{var k=g?g(E,j,n+"",t,e,S):void 0,O=void 0===k;if(O){var P=l(j),_=!P&&f(j),A=!P&&!_&&b(j);k=j,P||_||A?l(E)?k=E:s(E)?k=a(E):_?(O=!1,k=o(j,!0)):A?(O=!1,k=i(j,!0)):k=[]:v(j)||c(j)?(k=E,c(E)?k=m(E):y(E)&&!p(E)||(k=u(j))):O=!1}O&&(S.set(j,k),w(k,j,h,g,S),S.delete(j)),r(t,n,k)}}},8674:t=>{t.exports=function(t){return function(e){return null==t?void 0:t[e]}}},5976:(t,e,n)=>{var r=n(6557),o=n(5357),i=n(61);t.exports=function(t,e){return i(o(t,e,r),t+"")}},7415:(t,e,n)=>{var r=n(9932);t.exports=function(t,e){return r(e,(function(e){return t[e]}))}},4318:(t,e,n)=>{var r=n(1149);t.exports=function(t){var e=new t.constructor(t.byteLength);return new r(e).set(new r(t)),e}},4626:(t,e,n)=>{t=n.nmd(t);var r=n(5639),o=e&&!e.nodeType&&e,i=o&&t&&!t.nodeType&&t,a=i&&i.exports===o?r.Buffer:void 0,u=a?a.allocUnsafe:void 0;t.exports=function(t,e){if(e)return t.slice();var n=t.length,r=u?u(n):new t.constructor(n);return t.copy(r),r}},7133:(t,e,n)=>{var r=n(4318);t.exports=function(t,e){var n=e?r(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}},278:t=>{t.exports=function(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n{var r=n(4865),o=n(9465);t.exports=function(t,e,n,i){var a=!n;n||(n={});for(var u=-1,c=e.length;++u{var r=n(5976),o=n(6612);t.exports=function(t){return r((function(e,n){var r=-1,i=n.length,a=i>1?n[i-1]:void 0,u=i>2?n[2]:void 0;for(a=t.length>3&&"function"==typeof a?(i--,a):void 0,u&&o(n[0],n[1],u)&&(a=i<3?void 0:a,i=1),e=Object(e);++r{t.exports=function(t){return function(e,n,r){for(var o=-1,i=Object(e),a=r(e),u=a.length;u--;){var c=a[t?u:++o];if(!1===n(i[c],c,i))break}return e}}},3833:(t,e,n)=>{var r=n(7813),o=Object.prototype,i=o.hasOwnProperty;t.exports=function(t,e,n,a){return void 0===t||r(t,o[n])&&!i.call(a,n)?e:t}},8777:(t,e,n)=>{var r=n(852),o=function(){try{var t=r(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();t.exports=o},9464:(t,e,n)=>{var r=n(8674)({"&":"&","<":"<",">":">",'"':""","'":"'"});t.exports=r},1994:t=>{var e={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"};t.exports=function(t){return"\\"+e[t]}},1957:(t,e,n)=>{var r="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g;t.exports=r},852:t=>{t.exports=function(t,e){return null==t?void 0:t[e]}},5924:(t,e,n)=>{var r=n(5569)(Object.getPrototypeOf,Object);t.exports=r},8517:(t,e,n)=>{var r=n(3118),o=n(5924),i=n(5726);t.exports=function(t){return"function"!=typeof t.constructor||i(t)?{}:r(o(t))}},6612:t=>{t.exports=function(){return!1}},5726:t=>{t.exports=function(){return!1}},7040:t=>{t.exports=function(){this.__data__=[],this.size=0}},4125:(t,e,n)=>{var r=n(8470),o=Array.prototype.splice;t.exports=function(t){var e=this.__data__,n=r(e,t);return!(n<0)&&(n==e.length-1?e.pop():o.call(e,n,1),--this.size,!0)}},2117:(t,e,n)=>{var r=n(8470);t.exports=function(t){var e=this.__data__,n=r(e,t);return n<0?void 0:e[n][1]}},7518:(t,e,n)=>{var r=n(8470);t.exports=function(t){return r(this.__data__,t)>-1}},4705:(t,e,n)=>{var r=n(8470);t.exports=function(t,e){var n=this.__data__,o=r(n,t);return o<0?(++this.size,n.push([t,e])):n[o][1]=e,this}},5569:t=>{t.exports=function(t,e){return function(n){return t(e(n))}}},5357:(t,e,n)=>{var r=n(6874),o=Math.max;t.exports=function(t,e,n){return e=o(void 0===e?t.length-1:e,0),function(){for(var i=arguments,a=-1,u=o(i.length-e,0),c=Array(u);++a{t.exports=/<%-([\s\S]+?)%>/g},6051:t=>{t.exports=/<%([\s\S]+?)%>/g},5712:t=>{t.exports=/<%=([\s\S]+?)%>/g},5639:(t,e,n)=>{var r=n(1957),o="object"==typeof self&&self&&self.Object===Object&&self,i=r||o||Function("return this")();t.exports=i},6390:t=>{t.exports=function(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}},61:t=>{t.exports=function(t){return t}},9018:(t,e,n)=>{var r=n(8363),o=n(1463),i=n(1704),a=o((function(t,e,n,o){r(e,i(e),t,o)}));t.exports=a},9591:(t,e,n)=>{var r=n(6874),o=n(5976),i=n(4647),a=o((function(t,e){try{return r(t,void 0,e)}catch(t){return i(t)?t:new Error(t)}}));t.exports=a},7813:t=>{t.exports=function(t,e){return t===e||t!=t&&e!=e}},7187:(t,e,n)=>{var r=n(9464),o=n(9833),i=/[&<>"']/g,a=RegExp(i.source);t.exports=function(t){return(t=o(t))&&a.test(t)?t.replace(i,r):t}},6557:t=>{t.exports=function(t){return t}},5694:t=>{t.exports=function(){return!1}},1469:t=>{var e=Array.isArray;t.exports=e},8612:(t,e,n)=>{var r=n(3560),o=n(1780);t.exports=function(t){return null!=t&&o(t.length)&&!r(t)}},9246:(t,e,n)=>{var r=n(8612),o=n(7005);t.exports=function(t){return o(t)&&r(t)}},4144:t=>{t.exports=function(){return!1}},4647:(t,e,n)=>{var r=n(4239),o=n(7005),i=n(8630);t.exports=function(t){if(!o(t))return!1;var e=r(t);return"[object Error]"==e||"[object DOMException]"==e||"string"==typeof t.message&&"string"==typeof t.name&&!i(t)}},3560:(t,e,n)=>{var r=n(4239),o=n(3218);t.exports=function(t){if(!o(t))return!1;var e=r(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}},1780:t=>{t.exports=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}},3218:t=>{t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},7005:t=>{t.exports=function(t){return null!=t&&"object"==typeof t}},8630:(t,e,n)=>{var r=n(4239),o=n(5924),i=n(7005),a=Function.prototype,u=Object.prototype,c=a.toString,l=u.hasOwnProperty,s=c.call(Object);t.exports=function(t){if(!i(t)||"[object Object]"!=r(t))return!1;var e=o(t);if(null===e)return!0;var n=l.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&c.call(n)==s}},6719:t=>{t.exports=function(){return!1}},3674:(t,e,n)=>{var r=n(5569)(Object.keys,Object);t.exports=r},1704:t=>{t.exports=function(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e}},2492:(t,e,n)=>{var r=n(2980),o=n(1463)((function(t,e,n){r(t,e,n)}));t.exports=o},1106:(t,e,n)=>{var r=n(9018),o=n(9591),i=n(7415),a=n(3833),u=n(1994),c=n(4647),l=n(6612),s=n(3674),f=n(5712),p=n(5835),y=n(9833),v=/\b__p \+= '';/g,b=/\b(__p \+=) '' \+/g,d=/(__e\(.*?\)|\b__t\)) \+\n'';/g,m=/[()=,{}\[\]\/\s]/,h=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,w=/($^)/,g=/['\n\r\u2028\u2029\\]/g,S=Object.prototype.hasOwnProperty;t.exports=function(t,e,n){var E=p.imports._.templateSettings||p;n&&l(t,e,n)&&(e=void 0),t=y(t),e=r({},e,E,a);var j,T,k=r({},e.imports,E.imports,a),O=s(k),P=i(k,O),_=0,A=e.interpolate||w,N="__p += '",R=RegExp((e.escape||w).source+"|"+A.source+"|"+(A===f?h:w).source+"|"+(e.evaluate||w).source+"|$","g"),I=S.call(e,"sourceURL")?"//# sourceURL="+(e.sourceURL+"").replace(/\s/g," ")+"\n":"";t.replace(R,(function(e,n,r,o,i,a){return r||(r=o),N+=t.slice(_,a).replace(g,u),n&&(j=!0,N+="' +\n__e("+n+") +\n'"),i&&(T=!0,N+="';\n"+i+";\n__p += '"),r&&(N+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),_=a+e.length,e})),N+="';\n";var M=S.call(e,"variable")&&e.variable;if(M){if(m.test(M))throw new Error("Invalid `variable` option passed into `_.template`")}else N="with (obj) {\n"+N+"\n}\n";N=(T?N.replace(v,""):N).replace(b,"$1").replace(d,"$1;"),N="function("+(M||"obj")+") {\n"+(M?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(j?", __e = _.escape":"")+(T?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+N+"return __p\n}";var C=o((function(){return Function(O,I+"return "+N).apply(void 0,P)}));if(C.source=N,c(C))throw C;return C}},5835:(t,e,n)=>{var r=n(7187),o={escape:n(9865),evaluate:n(6051),interpolate:n(5712),variable:"",imports:{_:{escape:r}}};t.exports=o},9881:(t,e,n)=>{var r=n(8363),o=n(1704);t.exports=function(t){return r(t,o(t))}},9833:t=>{t.exports=function(t){return t}}},e={};function n(r){var o=e[r];if(void 0!==o)return o.exports;var i=e[r]={id:r,loaded:!1,exports:{}};return t[r](i,i.exports,n),i.loaded=!0,i.exports}n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.nmd=t=>(t.paths=[],t.children||(t.children=[]),t);var r={};(()=>{"use strict";n.d(r,{default:()=>ac});var t={};n.r(t),n.d(t,{exclude:()=>G,extract:()=>F,parse:()=>U,parseUrl:()=>z,pick:()=>H,stringify:()=>L,stringifyUrl:()=>$});const e=JSON.parse('{"i8":"1.5.0-beta.4"}');function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}function i(t,e){for(var n=0;n\n\n <% if(\'img\' === data.content.type) { %>\n target="<%- data.content.target %>"<% } %>>\n \n <% (data.content.sources || []).forEach(function(source) { %>\n \n <% }); %>\n <%- data.content.alt %>width="<%- banner.positionData.dimensions.width %>"<% } %>\n <% if(null !== banner.positionData.dimensions.height) { %>height="<%- banner.positionData.dimensions.height %>"<% } %>\n <% if(\'\' !== data.content.title) { %>title="<%- data.content.title %>"<% } %>\n <% if(banner.options.has(\'loading\')) { %>loading="<%- banner.options.get(\'loading\') %>"<% } %>>\n \n \n <% } else if (\'html\' === data.content.type) { %>\n
\n <%= data.content.html %>\n
\n <% } %>\n\n \n',random:'\n \n',multiple:'\n \n'};function b(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,u=[],c=!0,l=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=i.call(n)).done)&&(u.push(r.value),u.length!==e);c=!0);}catch(t){l=!0,o=t}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw o}}return u}}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return d(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return d(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function d(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);nnull==t,R=t=>encodeURIComponent(t).replace(/[!'()*]/g,(t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`)),I=Symbol("encodeFragmentIdentifier");function M(t){if("string"!=typeof t||1!==t.length)throw new TypeError("arrayFormatSeparator must be single character string")}function C(t,e){return e.encode?e.strict?R(t):encodeURIComponent(t):t}function x(t,e){return e.decode?P(t):t}function D(t){return Array.isArray(t)?t.sort():"object"==typeof t?D(Object.keys(t)).sort(((t,e)=>Number(t)-Number(e))).map((e=>t[e])):t}function W(t){const e=t.indexOf("#");return-1!==e&&(t=t.slice(0,e)),t}function B(t,e){return e.parseNumbers&&!Number.isNaN(Number(t))&&"string"==typeof t&&""!==t.trim()?t=Number(t):!e.parseBooleans||null===t||"true"!==t.toLowerCase()&&"false"!==t.toLowerCase()||(t="true"===t.toLowerCase()),t}function F(t){const e=(t=W(t)).indexOf("?");return-1===e?"":t.slice(e+1)}function U(t,e){M((e={decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1,...e}).arrayFormatSeparator);const n=function(t){let e;switch(t.arrayFormat){case"index":return(t,n,r)=>{e=/\[(\d*)]$/.exec(t),t=t.replace(/\[\d*]$/,""),e?(void 0===r[t]&&(r[t]={}),r[t][e[1]]=n):r[t]=n};case"bracket":return(t,n,r)=>{e=/(\[])$/.exec(t),t=t.replace(/\[]$/,""),e?void 0!==r[t]?r[t]=[...r[t],n]:r[t]=[n]:r[t]=n};case"colon-list-separator":return(t,n,r)=>{e=/(:list)$/.exec(t),t=t.replace(/:list$/,""),e?void 0!==r[t]?r[t]=[...r[t],n]:r[t]=[n]:r[t]=n};case"comma":case"separator":return(e,n,r)=>{const o="string"==typeof n&&n.includes(t.arrayFormatSeparator),i="string"==typeof n&&!o&&x(n,t).includes(t.arrayFormatSeparator);n=i?x(n,t):n;const a=o||i?n.split(t.arrayFormatSeparator).map((e=>x(e,t))):null===n?n:x(n,t);r[e]=a};case"bracket-separator":return(e,n,r)=>{const o=/(\[])$/.test(e);if(e=e.replace(/\[]$/,""),!o)return void(r[e]=n?x(n,t):n);const i=null===n?[]:n.split(t.arrayFormatSeparator).map((e=>x(e,t)));void 0!==r[e]?r[e]=[...r[e],...i]:r[e]=i};default:return(t,e,n)=>{void 0!==n[t]?n[t]=[...[n[t]].flat(),e]:n[t]=e}}}(e),r=Object.create(null);if("string"!=typeof t)return r;if(!(t=t.trim().replace(/^[?#&]/,"")))return r;for(const o of t.split("&")){if(""===o)continue;const t=e.decode?o.replace(/\+/g," "):o;let[i,a]=_(t,"=");void 0===i&&(i=t),a=void 0===a?null:["comma","separator","bracket-separator"].includes(e.arrayFormat)?a:x(a,e),n(x(i,e),a,r)}for(const[t,n]of Object.entries(r))if("object"==typeof n&&null!==n)for(const[t,r]of Object.entries(n))n[t]=B(r,e);else r[t]=B(n,e);return!1===e.sort?r:(!0===e.sort?Object.keys(r).sort():Object.keys(r).sort(e.sort)).reduce(((t,e)=>{const n=r[e];return Boolean(n)&&"object"==typeof n&&!Array.isArray(n)?t[e]=D(n):t[e]=n,t}),Object.create(null))}function L(t,e){if(!t)return"";M((e={encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:",",...e}).arrayFormatSeparator);const n=n=>e.skipNull&&N(t[n])||e.skipEmptyString&&""===t[n],r=function(t){switch(t.arrayFormat){case"index":return e=>(n,r)=>{const o=n.length;return void 0===r||t.skipNull&&null===r||t.skipEmptyString&&""===r?n:null===r?[...n,[C(e,t),"[",o,"]"].join("")]:[...n,[C(e,t),"[",C(o,t),"]=",C(r,t)].join("")]};case"bracket":return e=>(n,r)=>void 0===r||t.skipNull&&null===r||t.skipEmptyString&&""===r?n:null===r?[...n,[C(e,t),"[]"].join("")]:[...n,[C(e,t),"[]=",C(r,t)].join("")];case"colon-list-separator":return e=>(n,r)=>void 0===r||t.skipNull&&null===r||t.skipEmptyString&&""===r?n:null===r?[...n,[C(e,t),":list="].join("")]:[...n,[C(e,t),":list=",C(r,t)].join("")];case"comma":case"separator":case"bracket-separator":{const e="bracket-separator"===t.arrayFormat?"[]=":"=";return n=>(r,o)=>void 0===o||t.skipNull&&null===o||t.skipEmptyString&&""===o?r:(o=null===o?"":o,0===r.length?[[C(n,t),e,C(o,t)].join("")]:[[r,C(o,t)].join(t.arrayFormatSeparator)])}default:return e=>(n,r)=>void 0===r||t.skipNull&&null===r||t.skipEmptyString&&""===r?n:null===r?[...n,C(e,t)]:[...n,[C(e,t),"=",C(r,t)].join("")]}}(e),o={};for(const[e,r]of Object.entries(t))n(e)||(o[e]=r);const i=Object.keys(o);return!1!==e.sort&&i.sort(e.sort),i.map((n=>{const o=t[n];return void 0===o?"":null===o?C(n,e):Array.isArray(o)?0===o.length&&"bracket-separator"===e.arrayFormat?C(n,e)+"[]":o.reduce(r(n),[]).join("&"):C(n,e)+"="+C(o,e)})).filter((t=>t.length>0)).join("&")}function z(t,e){e={decode:!0,...e};let[n,r]=_(t,"#");return void 0===n&&(n=t),{url:n?.split("?")?.[0]??"",query:U(F(t),e),...e&&e.parseFragmentIdentifier&&r?{fragmentIdentifier:x(r,e)}:{}}}function $(t,e){e={encode:!0,strict:!0,[I]:!0,...e};const n=W(t.url).split("?")[0]||"";let r=L({...U(F(t.url),{sort:!1}),...t.query},e);r&&(r=`?${r}`);let o=function(t){let e="";const n=t.indexOf("#");return-1!==n&&(e=t.slice(n)),e}(t.url);if(t.fragmentIdentifier){const r=new URL(n);r.hash=t.fragmentIdentifier,o=e[I]?r.hash:`#${t.fragmentIdentifier}`}return`${n}${r}${o}`}function H(t,e,n){n={parseFragmentIdentifier:!0,[I]:!1,...n};const{url:r,query:o,fragmentIdentifier:i}=z(t,n);return $({url:r,query:A(o,e),fragmentIdentifier:i},n)}function G(t,e,n){return H(t,Array.isArray(e)?t=>!e.includes(t):(t,n)=>!e(t,n),n)}const q=t;function V(t){return V="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},V(t)}function Y(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return K(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return K(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function K(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);nr.status?e(t):n(t)},r.onerror=function(){n({status:"error",data:{code:r.status,error:r.statusText||"unknown"}})};var o=t.endpoint;"GET"===t.method&&(o+="?".concat(q.stringify(t.parameters))),r.open(t.method,o,!0),r.overrideMimeType("application/json"),r.setRequestHeader("Accept","application/json");var i,a=Y(t.headers);try{for(a.s();!(i=a.n()).done;){var u=i.value;r.setRequestHeader(u.name,u.value)}}catch(t){a.e(t)}finally{a.f()}r.send("POST"===t.method?JSON.stringify(t.parameters):null)}}])&&J(e.prototype,n),r&&J(e,r),Object.defineProperty(e,"prototype",{writable:!1}),i}(S);function et(t){return et="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},et(t)}function nt(t,e){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:null,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),dt(this,gt,{writable:!0,value:void 0}),dt(this,St,{writable:!0,value:void 0}),dt(this,Et,{writable:!0,value:void 0}),dt(this,jt,{writable:!0,value:void 0}),dt(this,Tt,{writable:!0,value:void 0}),dt(this,kt,{writable:!0,value:void 0}),dt(this,Ot,{writable:!0,value:function(t){var e={};for(var n in t)for(var r in e[n]={},t[n]){var o=t[n][r].value.filter((function(t){return""!==t}));o.length&&(e[n][r]=o)}return e}}),ht(this,gt,e),ht(this,St,n),ht(this,Et,r),ht(this,jt,{}),ht(this,Tt,o),ht(this,kt,i)}var e,n,r;return e=t,n=[{key:"addPosition",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=mt(this,jt);if(t in r)throw new Error('Position "'+t+'" already exists.');r[t]={},n&&this.addPositionResources(t,mt(this,Tt)),this.addPositionResources(t,e)}},{key:"addPositionResources",value:function(t,e){for(var n in e)this.addPositionResource(t,e[n])}},{key:"addPositionResource",value:function(t,e){if(!(e instanceof pt))throw new TypeError("Argument resource must be instance of Resource class.");var n=mt(this,jt);if(!(t in n))throw new Error('Missing position "'+t+'".');var r=n[t];e.name in r?r[e.name]=r[e.name].withValues(e.value):r[e.name]=e}},{key:"method",get:function(){return mt(this,gt)}},{key:"endpoint",get:function(){return mt(this,St)}},{key:"locale",get:function(){return mt(this,Et)}},{key:"parameters",get:function(){var t=mt(this,Ot).call(this,mt(this,jt)),e={query:"GET"===this.method?JSON.stringify(t):t};return null!==this.locale&&(e.locale=this.locale),e}},{key:"headers",get:function(){return mt(this,kt)}}],n&&bt(e.prototype,n),r&&bt(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function _t(t){return _t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_t(t)}function At(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};for(var o in"1"!==(r["omit-default-resources"]||"0").toString()?e=function(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:void 0;return this.options[t]||e}}],n&&le(e.prototype,n),r&&le(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function fe(t){return fe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},fe(t)}function pe(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:"";if(-1===this.STATE.STATES.indexOf(t))throw new TypeError("".concat(t," is not valid state."));be(this,ge,t),be(this,Se,e.toString()),ve(this,Ee)[t]=(ve(this,Ee)[t]||0)+1,this._eventBus.dispatch(oe.ON_BANNER_STATE_CHANGED,this)}},{key:"getCurrenBreakpoint",value:function(t){return null}},{key:"redrawIfNeeded",value:function(){}},{key:"isManaged",value:function(){return!1}},{key:"isExternal",value:function(){return!1}},{key:"isEmbed",value:function(){return!1}}],n&&pe(e.prototype,n),r&&pe(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Te(t){return Te="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Te(t)}function ke(t,e){for(var n=0;n=c&&(null===i||ic))&&(o=u,i=c,Ue(t,Ve)[n]=c)):r=u})),null===o&&null===r)throw new Error("Unable to resolve content, no contents found.");a.sort((function(t,e){return t-e})),"min"===n?a.unshift(null):a.push(null);var u=a.indexOf(i);return"max"===n&&u-1 in a&&(Ue(this,Ve).min=a[u-1]),"min"===n&&u+1 in a&&(Ue(this,Ve).max=a[u+1]),Le(this,qe,null!==o?o:r)}},{key:"needRedraw",value:function(){if(null===Ue(this,qe))return!0;var t=Ue(this,$e).width;return null!==Ue(this,Ve).min&&tUe(this,Ve).max}}])&&We(e.prototype,n),r&&We(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Je(t,e){for(var n in t)e(t[n],n)}function Xe(t){return Xe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Xe(t)}function Qe(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return Ze(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ze(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Ze(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n1&&void 0!==arguments[1]?arguments[1]:"weight",n={},r=0,o=0;o0;)u-=n[a],a++;return t[--a]?t[a]:t[0]}}],(n=null)&&wn(e.prototype,n),r&&wn(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Sn(t){return Sn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Sn(t)}function En(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return jn(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return jn(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function jn(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n6&&void 0!==arguments[6]?arguments[6]:{},s=arguments.length>7&&void 0!==arguments[7]?arguments[7]:{};for(var f in function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),An(Pn(c=o.call(this,n,r,a,u,s)),Hn),An(Pn(c),$n),Nn(Pn(c),Dn,{writable:!0,value:void 0}),Nn(Pn(c),Wn,{writable:!0,value:void 0}),Nn(Pn(c),Bn,{writable:!0,value:[]}),Nn(Pn(c),Fn,{writable:!0,value:void 0}),Nn(Pn(c),Un,{writable:!0,value:!1}),Nn(Pn(c),Ln,{writable:!0,value:null}),Nn(Pn(c),zn,{writable:!0,value:[]}),Cn(Pn(c),Dn,t),Cn(Pn(c),Wn,e),Cn(Pn(c),Fn,l),l)Mn(Pn(c),Bn).push(new pt(f,l[f]));return c}return e=i,(n=[{key:"html",set:function(t){this.element.innerHTML=t}},{key:"resources",get:function(){return Mn(this,Bn)}},{key:"rawResources",get:function(){return Mn(this,Fn)}},{key:"data",get:function(){return console.warn("Usage of deprecated property `ManagedBanner.data`. Please use property `positionData` for accessing information about a position."),new mn(this)}},{key:"fingerprints",get:function(){var t;try{t=this.bannerData}catch(t){return[]}return this.positionData.isMultiple()||(t=[t]),t.map((function(t){return t.fingerprint}))}},{key:"bannerData",get:function(){if(null!==Mn(this,Ln))return Mn(this,Ln);if(!Mn(this,zn).length)throw new Error("Banner's data is empty.");var t=null,e=this.positionData,n=function(t){return Oe.createFromProperties({bannerId:t.id,bannerName:t.name,positionId:e.id,positionCode:e.code,positionName:e.name,campaignId:t.campaignId,campaignCode:t.campaignCode,campaignName:t.campaignName})};switch(!0){case e.isSingle():(t=Mn(this,zn).reduce((function(t,e){return t.score>=e.score?t:e}))).fingerprint=n(t);break;case e.isRandom():(t=gn.randomByWeights(Mn(this,zn),"score")).fingerprint=n(t);break;case e.isMultiple():var r,o=En(t=Mn(this,zn).sort((function(t,e){return e.score-t.score})));try{for(o.s();!(r=o.n()).done;){var i=r.value;i.fingerprint=n(i)}}catch(t){o.e(t)}finally{o.f()}break;default:throw new Error("Invalid display type ".concat(this.displayType,"."))}if(null===t)throw new Error("Banner's data is empty.");return Cn(this,Ln,t),t}},{key:"setResponseData",value:function(t){if(Mn(this,Un))throw new Error("Data for banner on position ".concat(this.position," is already set."));this._positionData=new ue({id:t.position_id||null,code:this._positionData.code,name:t.position_name||null,rotationSeconds:t.rotation_seconds,displayType:t.display_type,breakpointType:t.breakpoint_type,dimensions:t.dimensions||{width:null,height:null}});var e=[];for(var n in t.banners||[])e.push(new ln(t.banners[n],t.breakpoint_type,Mn(this,Dn)));Cn(this,zn,e),Cn(this,Un,!0),In(this,$n,qn).call(this,"Banner was successfully rendered.")}},{key:"getCurrenBreakpoint",value:function(t){var e=this.bannerData,n=(e=(Array.isArray(e)?e:[e]).find((function(e){return e.id===t})))&&e.content?e.content.breakpoint:null;return null===n?null:parseInt(n)}},{key:"isManaged",value:function(){return!0}},{key:"redrawIfNeeded",value:function(){In(this,Hn,Vn).call(this)&&In(this,$n,qn).call(this,"Banner was successfully redrawn.")}}])&&Tn(e.prototype,n),r&&Tn(e,r),Object.defineProperty(e,"prototype",{writable:!1}),i}(je);function qn(t){try{this.html=Mn(this,Wn).render(this)}catch(t){return void this.setState(this.STATE.ERROR,"Render error: "+t.message)}this.setState(this.STATE.RENDERED,t)}function Vn(){var t=this.bannerData;for(var e in Array.isArray(t)||(t=[t]),t)if(t[e].needRedraw())return!0;return!1}function Yn(t){return Yn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Yn(t)}function Kn(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return Jn(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Jn(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Jn(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function er(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&void 0!==arguments[0]?arguments[0]:1;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),jr(this,Or,{writable:!0,value:void 0}),Tr(this,Or,e-1)}var e,n,r;return e=t,(n=[{key:"getNextIdentifier",value:function(){var t,e;return Tr(this,Or,(t=function(t,e){return e.get?e.get.call(t):e.value}(e=this,kr(e,Or,"get")),++t))}}])&&Er(e.prototype,n),r&&Er(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function _r(t){if(t instanceof HTMLElement)return t;if("string"!=typeof t)throw new TypeError("Element must be instance of HTMLElement or String");var e;if(!((e="#"===t.charAt(0)?document.getElementById(t.slice(1)):document.querySelector(t))instanceof HTMLElement))throw new TypeError("Selector "+t+" is invalid.");return e}function Ar(t){return Ar="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ar(t)}function Nr(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return Rr(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Rr(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Rr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n2&&void 0!==arguments[2]?arguments[2]:null;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Mr(this,Wr,{writable:!0,value:void 0}),Mr(this,Br,{writable:!0,value:void 0}),Mr(this,Fr,{writable:!0,value:void 0}),Mr(this,Ur,{writable:!0,value:void 0}),Mr(this,Lr,{writable:!0,value:[]}),xr(this,Wr,e),xr(this,Br,n),xr(this,Fr,r),xr(this,Ur,new Pr),this.STATE=ee}var e,n,r;return e=t,n=[{key:"addExternalBanner",value:function(t){(t=_r(t)).setAttribute("data-amp-attached","");var e=new vr(Cr(this,Br),Cr(this,Wr),Cr(this,Ur).getNextIdentifier(),t);return Cr(this,Lr).push(e),e}},{key:"addManagedBanner",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(null===Cr(this,Fr))throw new Error("Unable to add managed banner, renderer is not provided.");(t=_r(t)).setAttribute("data-amp-attached","");var o=new Gn(Cr(this,Br),Cr(this,Fr),Cr(this,Wr),Cr(this,Ur).getNextIdentifier(),t,e,n,r);return Cr(this,Lr).push(o),o}},{key:"addEmbedBanner",value:function(t,e,n){(t=_r(t)).setAttribute("data-amp-attached","");var r=new gr(Cr(this,Wr),Cr(this,Ur).getNextIdentifier(),t,e,n);return Cr(this,Lr).push(r),r}},{key:"removeBanner",value:function(t){var e=Cr(this,Lr).length;return xr(this,Lr,Cr(this,Lr).filter((function(e){return e!==t}))),e!==Cr(this,Lr).length}},{key:"getBannersByState",value:function(t){var e=t.state,n=t.managed,r=void 0===n||n,o=t.external,i=void 0===o||o,a=t.embed,u=void 0===a||a;return Cr(this,Lr).filter((function(t){return t instanceof je&&t.state===e&&!(t instanceof Gn&&!r||t instanceof vr&&!i||t instanceof gr&&!u)}))}},{key:"getBannerByFingerprint",value:function(t){var e,n=t instanceof Oe?t.value:t,r=Nr(Cr(this,Lr));try{for(r.s();!(e=r.n()).done;){var o=e.value;if(!(o instanceof gr)){var i,a=Nr(o.fingerprints);try{for(a.s();!(i=a.n()).done;)if(i.value.value===n)return o}catch(t){a.e(t)}finally{a.f()}}}}catch(t){r.e(t)}finally{r.f()}return null}},{key:"getBannerByUid",value:function(t){var e,n=Nr(Cr(this,Lr));try{for(n.s();!(e=n.n()).done;){var r=e.value;if(r.uid===t)return r}}catch(t){n.e(t)}finally{n.f()}return null}}],n&&Ir(e.prototype,n),r&&Ir(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function $r(t){return $r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$r(t)}function Hr(t,e){for(var n=0;n=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Qr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n2&&void 0!==arguments[2]?arguments[2]:null,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;if("function"!=typeof e)throw new TypeError("Listener must be of type function.");var i="idx_"+eo(this,oo).getNextIdentifier();return eo(this,io)[t]=eo(this,io)[t]||{},eo(this,io)[t][i]={callback:e,scope:r,priority:o},t in eo(this,ao)&&delete eo(this,ao)[t],function(){t in eo(n,io)&&i in eo(n,io)[t]&&delete eo(n,io)[t][i]}}},{key:"dispatch",value:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;re.priority?-1:t.priority=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Ro(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=u.pixels)return u.ratio}}catch(t){i.e(t)}finally{i.f()}return r};return new IntersectionObserver((function(r){var o,a=[],u={},l={},s=No(r);try{for(s.s();!(o=s.n()).done;){var f=o.value,p=f.target.dataset.ampBannerFingerprint,y=t.getBannerByFingerprint(p);if(y){var v=n[p];if(v){var b={fingerprint:v.fingerprint,element:f.target,banner:y};if(a.push(_o(_o({},b),{},{entry:f})),!v.alreadySeen){var d=f.intersectionRatio>=c(f.target);u[p]=!(p in u)||!u[p].isIntersecting&&d?{fingerprintArgs:b,fingerprintMetadata:v,isIntersecting:d}:u[p]}if(!v.alreadyFullySeen){var m=.99<=f.intersectionRatio;l[p]=!(p in l)||!l[p].isFullyIntersecting&&m?{fingerprintArgs:b,fingerprintMetadata:v,isFullyIntersecting:m}:l[p]}}}}}catch(t){s.e(t)}finally{s.f()}for(var h=function(){var t=g[w],n=t.fingerprintArgs,r=t.fingerprintMetadata,o=t.isIntersecting;o&&!r.alreadySeen&&null===r.firstTimeSeenTimeoutId?r.firstTimeSeenTimeoutId=setTimeout((function(){r.alreadySeen=!0,e.dispatch(oe.ON_BANNER_FIRST_TIME_SEEN,n)}),i):o||null===r.firstTimeSeenTimeoutId||(clearTimeout(r.firstTimeSeenTimeoutId),r.firstTimeSeenTimeoutId=null)},w=0,g=Object.values(u);w=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Wo(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function ui(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=":"<=").concat(r),{channel_code:e,banner_id:t.bannerId,banner_name:t.bannerName,position_id:t.positionId,position_code:t.positionCode,position_name:t.positionName,campaign_id:t.campaignId,campaign_code:t.campaignCode,campaign_name:t.campaignName,breakpoint:r}};n.isEventEnabled(ei.BANNER_LOADED)&&t.subscribe(oe.ON_BANNER_STATE_CHANGED,(function(t){if(!t.isEmbed()&&ee.RENDERED===t.state&&1===t.stateCounter){var e,o=ai(t.fingerprints);try{for(o.s();!(e=o.n()).done;){var i=e.value;n.send(ei.BANNER_LOADED,r(i,t))}}catch(t){o.e(t)}finally{o.f()}}})),n.isEventEnabled(ei.BANNER_DISPLAYED)&&t.subscribe(oe.ON_BANNER_FIRST_TIME_SEEN,(function(t){var e=t.fingerprint,o=t.banner;n.send(ei.BANNER_DISPLAYED,r(e,o))})),n.isEventEnabled(ei.BANNER_FULLY_DISPLAYED)&&t.subscribe(oe.ON_BANNER_FIRST_TIME_FULLY_SEEN,(function(t){var e=t.fingerprint,o=t.banner;n.send(ei.BANNER_FULLY_DISPLAYED,r(e,o))})),n.isEventEnabled(ei.BANNER_CLICKED)&&t.subscribe(oe.ON_BANNER_LINK_CLICKED,(function(t){var e=t.fingerprint,o=t.banner,i=t.target;n.send(ei.BANNER_CLICKED,oi(oi({},r(e,o)),{},{link:i.href||""}))}))}}}}])&&ci(e.prototype,n),r&&ci(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}(),wi=!1;const gi=function(t,e){if(!("plausible"in window)||"function"!=typeof window.plausible)return!wi&&console.warn("Unable to send metrics to Plausible because the function plausible() does not occur in the window."),void(wi=!0);Object.keys(e).forEach((function(t){return null===e[t]&&delete e[t]})),window.plausible(t,{props:e})};var Si=!1;const Ei=function(t,e){if(!("gtag"in window)||"function"!=typeof window.gtag)return!Si&&console.warn("Unable to send metrics to Google Analytics because the function gtag() does not occur in the window."),void(Si=!0);Object.keys(e).forEach((function(t){return null===e[t]&&delete e[t]})),window.gtag("event",t,e)};function ji(t){return ji="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ji(t)}function Ti(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function ki(t,e,n){return(e=function(t){var e=function(t,e){if("object"!==ji(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!==ji(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===ji(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Oi=!1;const Pi=function(t,e){if(!("dataLayer"in window))return!Oi&&console.warn("Unable to send metrics to GTM because the dataLayer does not occur in the window."),void(Oi=!0);Object.keys(e).forEach((function(t){return null===e[t]&&delete e[t]})),window.dataLayer.push(function(t){for(var e=1;e=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Ri(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n3&&void 0!==arguments[3]?arguments[3]:"*";t.postMessage({message:e,data:n},r)}},{key:"listen",value:function(){var t=this;window.addEventListener("message",(function(e){if(!(0<$i(t,qi).length&&-1===$i(t,qi).indexOf(e.origin)||"object"!==Ui(e.data))&&"message"in e.data&&"data"in e.data){var n=e.data,r=n.message,o={data:n.data,origin:e.origin};t._beforeDispatch(r,o)&&$i(t,Vi).dispatch(r,o)}}),!1)}},{key:"_beforeDispatch",value:function(){return!0}}],n&&Li(e.prototype,n),r&&Li(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Ki(t){return Ki="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ki(t)}function Ji(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return Xi(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Xi(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Xi(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Aa(t,e){if(t){if("string"==typeof t)return Na(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Na(t,e):void 0}}function Na(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);ne.interaction.defaultIntersectionRatio||1f||1e.interaction.firstTimeSeenTimeout)throw new Error('The option "interaction.firstTimeSeenTimeout" must be a int with a minimum value of 500, "'.concat(e.interaction.firstTimeSeenTimeout,'" passed.'));if("object"!==m(e.metrics))throw new Error('The option "metrics" must be an object of the format { receiver: null|string|function|array, disabledEvents: array }, '.concat(e.metrics," passed."));if(null!==e.metrics.receiver&&-1===["string","function"].indexOf(m(e.metrics.receiver))&&!Array.isArray(e.metrics.receiver))throw new Error('The option "metrics.receiver" must be a null or a string or a function or an array of strings|functions, "'.concat(e.metrics.receiver,'" passed.'));if(Array.isArray(e.metrics.receiver)){for(var p in e.metrics.receiver)if(-1===["string","function"].indexOf(m(e.metrics.receiver[p])))throw new Error('The option "metrics.receiver.'.concat(p,'" must be a string or a function, "').concat(e.metrics.receiver[p],'" passed.'))}else e.metrics.receiver=null!==e.metrics.receiver?[e.metrics.receiver]:[];if(!Array.isArray(e.metrics.disabledEvents))throw new Error('The option "metrics.disabledEvents" must an array of strings (event names), "'.concat(e.metrics.disabledEvents,'" passed.'));for(var d in e.metrics.disabledEvents)if("string"!=typeof e.metrics.disabledEvents[d])throw new Error('The option "metrics.disabledEvents.'.concat(d,'" must be a string, "').concat(e.metrics.disabledEvents[d],'" passed.'));return e}(n)),xa(this,Fa,new uo),xa(this,Ua,new Ft(n.method,n.url,n.version,n.channel)),xa(this,La,new Qt(n.url,n.version,n.channel)),xa(this,$a,new zr(Ca(this,Fa),Kr.fromCurrentWindow(),new ko(n.template))),xa(this,Ha,new Xo(Ca(this,$a),Ca(this,Fa),n.interaction)),xa(this,Ga,Fi.createFromReceivers(n.metrics.receiver,n.metrics.disabledEvents)),xa(this,qa,new hi(Ca(this,Ga),Ca(this,Fa),n.channel)),xa(this,Va,new ga({origin:n.url,connectionData:{extendedConfig:{interaction:n.interaction}},bannerManager:Ca(this,$a),metricsSender:Ca(this,Ga)})),this.setLocale(n.locale),Ca(this,Ua).origin=n.origin,n.resources)Ca(this,Ua).addDefaultResource(a,n.resources[a]),Ca(this,La).addDefaultResource(a,n.resources[a]);window.addEventListener("resize",(function(){var t,e=_a(Ca(i,$a).getBannersByState({state:Ca(i,$a).STATE.RENDERED,managed:!0,external:!0,embed:!1}));try{for(e.s();!(t=e.n()).done;){t.value.redrawIfNeeded()}}catch(t){e.e(t)}finally{e.f()}})),Ca(this,Va).listen(),Ca(this,qa).attach(),Ca(this,Ha).start()}var e,n,r;return e=t,n=[{key:"version",get:function(){return Ca(this,Wa)}},{key:"on",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return Ca(this,Fa).subscribe(t,e,n)}},{key:"setLocale",value:function(t){Ca(this,Ua).locale=t,Ca(this,La).locale=t}},{key:"setGateway",value:function(t){if(!function(t){return t instanceof S}(t))throw new TypeError("Argument gateway mut be instance of AbstractGateway.");xa(this,za,t)}},{key:"getGateway",value:function(){return null===Ca(this,za)&&this.setGateway(new tt),Ca(this,za)}},{key:"createBanner",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"managed";if(t=_r(t),"embed"===o){var i=function(t,e,n){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return n}(this,Ya,Ja).call(this,t,e,n,r),a=Ca(this,$a).addEmbedBanner(i,e,r);return Ca(this,Va).connectBanner(a),t.insertAdjacentElement("afterend",i),t.remove(),a}return Ca(this,$a).addManagedBanner(t,e,n,r)}},{key:"attachBanners",value:function(){var t,e=_a((arguments.length>0&&void 0!==arguments[0]?arguments[0]:document).querySelectorAll("[data-amp-banner]:not([data-amp-attached])"));try{for(e.s();!(t=e.n()).done;){var n=t.value,r=n.dataset.ampBanner;if(r){var o=void 0;if("ampBannerExternal"in n.dataset)o=Ca(this,$a).addExternalBanner(n);else{var i=Qn.parseResources(n),a=Qn.parseOptions(n),u=n.dataset.ampMode||"managed";o=this.createBanner(n,r,i,a,u)}Ca(this,Fa).dispatch(this.EVENTS.ON_BANNER_ATTACHED,o)}else console.warn("Unable to attach a banner to the element ",n,' because the attribute "data-amp-banner" has an empty value.')}}catch(t){e.e(t)}finally{e.f()}}},{key:"fetch",value:function(){var t=this,e=Ca(this,$a).getBannersByState({state:Ca(this,$a).STATE.NEW,managed:!0,external:!1,embed:!1});if(e.length){var n,r=Ca(this,Ua).create(),o=_a(e);try{for(o.s();!(n=o.n()).done;){var i=n.value;r.addPosition(i.position,i.resources,"1"!==i.options.get("omit-default-resources","0").toString())}}catch(t){o.e(t)}finally{o.f()}Ca(this,Fa).dispatch(this.EVENTS.ON_BEFORE_FETCH),this.getGateway().fetch(r,(function(n){var r,o=n.data,i=_a(e);try{for(i.s();!(r=i.n()).done;){var a=r.value;if(a.position in o&&"banners"in o[a.position]&&Object.values(o[a.position].banners).length){var u=o[a.position];Array.isArray(u.banners)||(u.banners=Object.values(u.banners)),"embed"!==u.mode?a.setResponseData(u):(t.createBanner(a.element,a.position,a.rawResources,a.options.options,u.mode),Ca(t,$a).removeBanner(a))}else a.setState(Ca(t,$a).STATE.NOT_FOUND,"Banner not found in fetched response.")}}catch(t){i.e(t)}finally{i.f()}Ca(t,Fa).dispatch(t.EVENTS.ON_FETCH_SUCCESS,n)}),(function(n){var r,o=_a(e);try{for(o.s();!(r=o.n()).done;)r.value.setState(Ca(t,$a).STATE.ERROR,"Request on api failed.")}catch(t){o.e(t)}finally{o.f()}Ca(t,Fa).dispatch(t.EVENTS.ON_FETCH_ERROR,n)}))}}}],n&&Ra(e.prototype,n),r&&Ra(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Ja(t,e,n,r){var o=document.createElement("iframe"),i="cv=".concat(encodeURIComponent(this.version.semver)),a=t.dataset.ampEmbedSrc||Ca(this,La).create(e,n,r);return a+=-1===a.indexOf("?")?"?".concat(i):"&".concat(i),Pa(t.attributes).map((function(t){var e=t.name,n=t.value;o.setAttribute(e,n)})),o.width="100%",o.height="100%",o.allowFullscreen=!0,o.scrolling="no",o.style.border="none",o.style.overflow="hidden",o.style.background="transparent",o.style.visibility="hidden",o.src=a,o.setAttribute("allowtransparency","true"),"lazy"===r.loading&&(o.loading="lazy"),o}function Xa(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,u=[],c=!0,l=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=i.call(n)).done)&&(u.push(r.value),u.length!==e);c=!0);}catch(t){l=!0,o=t}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw o}}return u}}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return Qa(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Qa(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Qa(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);ne.interaction.defaultIntersectionRatio||1a||1e.interaction.firstTimeSeenTimeout)throw new Error('The option "interaction.firstTimeSeenTimeout" must be a int with a minimum value of 500, "'.concat(e.interaction.firstTimeSeenTimeout,'" passed.'));return e}function nu(t){return nu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},nu(t)}function ru(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return ou(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ou(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function ou(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Iu(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n2&&void 0!==arguments[2]?arguments[2]:null;return Bu(this,Hu).subscribe(t,e,n)}},{key:"attachBanner",value:function(){if(Bu(this,Ju))throw new Error("Method attachBanner() should be called only once.");var t=document.querySelector("[data-amp-banner]:not([data-amp-attached])");if(t){var e=Bu(this,Gu).addExternalBanner(t);Fu(this,Ju,!0),window.self!==window.top&&e.delegateResponsiveBehaviour(),Bu(this,Hu).dispatch(this.EVENTS.ON_BANNER_ATTACHED,e)}else console.warn("No banner not found in the embed client.")}}],n&&Mu(e.prototype,n),r&&Mu(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function ec(t,e){Bu(this,qu).sendToParent("metrics",{eventName:t,eventArgs:e})}function nc(){var t,e=Ru(Bu(this,Gu).getBannersByState({state:ee.RENDERED}));try{for(e.s();!(t=e.n()).done;){t.value.redrawIfNeeded()}}catch(t){e.e(t)}finally{e.f()}}function rc(t){return rc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},rc(t)}function oc(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};return new Ka(new p(ic,"standard@".concat(ic)),t)}},{key:"createEmbed",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new tc(new p(ic,"embed@".concat(ic)),t)}},{key:"version",get:function(){return ic}}],(n=null)&&oc(e.prototype,n),r&&oc(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}()})(),AMPClientFactory=r.default})(); \ No newline at end of file diff --git a/dist/amp-client.standalone.min.js b/dist/amp-client.standalone.min.js index c2d682a..3cdfabd 100644 --- a/dist/amp-client.standalone.min.js +++ b/dist/amp-client.standalone.min.js @@ -1 +1 @@ -var AMPClientFactory;(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.d(e,{default:()=>uc});var n={};t.r(n),t.d(n,{exclude:()=>q,extract:()=>U,parse:()=>L,parseUrl:()=>$,pick:()=>G,stringify:()=>z,stringifyUrl:()=>H});const r=JSON.parse('{"i8":"1.5.0-beta.3"}');function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}function i(t,e){for(var n=0;n\n\n <% if(\'img\' === data.content.type) { %>\n target="<%- data.content.target %>"<% } %>>\n \n <% (data.content.sources || []).forEach(function(source) { %>\n \n <% }); %>\n <%- data.content.alt %>title="<%- data.content.title %>"<% } %>\n <% if(banner.options.has(\'loading\')) { %>loading="<%- banner.options.get(\'loading\') %>"<% } %>>\n \n \n <% } else if (\'html\' === data.content.type) { %>\n
\n <%= data.content.html %>\n
\n <% } %>\n\n \n',random:'\n \n',multiple:'\n \n'};function v(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,u=[],c=!0,l=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=i.call(n)).done)&&(u.push(r.value),u.length!==e);c=!0);}catch(t){l=!0,o=t}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw o}}return u}}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return d(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return d(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function d(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);nnull==t,I=t=>encodeURIComponent(t).replace(/[!'()*]/g,(t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`)),C=Symbol("encodeFragmentIdentifier");function M(t){if("string"!=typeof t||1!==t.length)throw new TypeError("arrayFormatSeparator must be single character string")}function W(t,e){return e.encode?e.strict?I(t):encodeURIComponent(t):t}function D(t,e){return e.decode?P(t):t}function B(t){return Array.isArray(t)?t.sort():"object"==typeof t?B(Object.keys(t)).sort(((t,e)=>Number(t)-Number(e))).map((e=>t[e])):t}function x(t){const e=t.indexOf("#");return-1!==e&&(t=t.slice(0,e)),t}function F(t,e){return e.parseNumbers&&!Number.isNaN(Number(t))&&"string"==typeof t&&""!==t.trim()?t=Number(t):!e.parseBooleans||null===t||"true"!==t.toLowerCase()&&"false"!==t.toLowerCase()||(t="true"===t.toLowerCase()),t}function U(t){const e=(t=x(t)).indexOf("?");return-1===e?"":t.slice(e+1)}function L(t,e){M((e={decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1,...e}).arrayFormatSeparator);const n=function(t){let e;switch(t.arrayFormat){case"index":return(t,n,r)=>{e=/\[(\d*)]$/.exec(t),t=t.replace(/\[\d*]$/,""),e?(void 0===r[t]&&(r[t]={}),r[t][e[1]]=n):r[t]=n};case"bracket":return(t,n,r)=>{e=/(\[])$/.exec(t),t=t.replace(/\[]$/,""),e?void 0!==r[t]?r[t]=[...r[t],n]:r[t]=[n]:r[t]=n};case"colon-list-separator":return(t,n,r)=>{e=/(:list)$/.exec(t),t=t.replace(/:list$/,""),e?void 0!==r[t]?r[t]=[...r[t],n]:r[t]=[n]:r[t]=n};case"comma":case"separator":return(e,n,r)=>{const o="string"==typeof n&&n.includes(t.arrayFormatSeparator),i="string"==typeof n&&!o&&D(n,t).includes(t.arrayFormatSeparator);n=i?D(n,t):n;const a=o||i?n.split(t.arrayFormatSeparator).map((e=>D(e,t))):null===n?n:D(n,t);r[e]=a};case"bracket-separator":return(e,n,r)=>{const o=/(\[])$/.test(e);if(e=e.replace(/\[]$/,""),!o)return void(r[e]=n?D(n,t):n);const i=null===n?[]:n.split(t.arrayFormatSeparator).map((e=>D(e,t)));void 0!==r[e]?r[e]=[...r[e],...i]:r[e]=i};default:return(t,e,n)=>{void 0!==n[t]?n[t]=[...[n[t]].flat(),e]:n[t]=e}}}(e),r=Object.create(null);if("string"!=typeof t)return r;if(!(t=t.trim().replace(/^[?#&]/,"")))return r;for(const o of t.split("&")){if(""===o)continue;const t=e.decode?o.replace(/\+/g," "):o;let[i,a]=N(t,"=");void 0===i&&(i=t),a=void 0===a?null:["comma","separator","bracket-separator"].includes(e.arrayFormat)?a:D(a,e),n(D(i,e),a,r)}for(const[t,n]of Object.entries(r))if("object"==typeof n&&null!==n)for(const[t,r]of Object.entries(n))n[t]=F(r,e);else r[t]=F(n,e);return!1===e.sort?r:(!0===e.sort?Object.keys(r).sort():Object.keys(r).sort(e.sort)).reduce(((t,e)=>{const n=r[e];return Boolean(n)&&"object"==typeof n&&!Array.isArray(n)?t[e]=B(n):t[e]=n,t}),Object.create(null))}function z(t,e){if(!t)return"";M((e={encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:",",...e}).arrayFormatSeparator);const n=n=>e.skipNull&&R(t[n])||e.skipEmptyString&&""===t[n],r=function(t){switch(t.arrayFormat){case"index":return e=>(n,r)=>{const o=n.length;return void 0===r||t.skipNull&&null===r||t.skipEmptyString&&""===r?n:null===r?[...n,[W(e,t),"[",o,"]"].join("")]:[...n,[W(e,t),"[",W(o,t),"]=",W(r,t)].join("")]};case"bracket":return e=>(n,r)=>void 0===r||t.skipNull&&null===r||t.skipEmptyString&&""===r?n:null===r?[...n,[W(e,t),"[]"].join("")]:[...n,[W(e,t),"[]=",W(r,t)].join("")];case"colon-list-separator":return e=>(n,r)=>void 0===r||t.skipNull&&null===r||t.skipEmptyString&&""===r?n:null===r?[...n,[W(e,t),":list="].join("")]:[...n,[W(e,t),":list=",W(r,t)].join("")];case"comma":case"separator":case"bracket-separator":{const e="bracket-separator"===t.arrayFormat?"[]=":"=";return n=>(r,o)=>void 0===o||t.skipNull&&null===o||t.skipEmptyString&&""===o?r:(o=null===o?"":o,0===r.length?[[W(n,t),e,W(o,t)].join("")]:[[r,W(o,t)].join(t.arrayFormatSeparator)])}default:return e=>(n,r)=>void 0===r||t.skipNull&&null===r||t.skipEmptyString&&""===r?n:null===r?[...n,W(e,t)]:[...n,[W(e,t),"=",W(r,t)].join("")]}}(e),o={};for(const[e,r]of Object.entries(t))n(e)||(o[e]=r);const i=Object.keys(o);return!1!==e.sort&&i.sort(e.sort),i.map((n=>{const o=t[n];return void 0===o?"":null===o?W(n,e):Array.isArray(o)?0===o.length&&"bracket-separator"===e.arrayFormat?W(n,e)+"[]":o.reduce(r(n),[]).join("&"):W(n,e)+"="+W(o,e)})).filter((t=>t.length>0)).join("&")}function $(t,e){e={decode:!0,...e};let[n,r]=N(t,"#");return void 0===n&&(n=t),{url:n?.split("?")?.[0]??"",query:L(U(t),e),...e&&e.parseFragmentIdentifier&&r?{fragmentIdentifier:D(r,e)}:{}}}function H(t,e){e={encode:!0,strict:!0,[C]:!0,...e};const n=x(t.url).split("?")[0]||"";let r=z({...L(U(t.url),{sort:!1}),...t.query},e);r&&(r=`?${r}`);let o=function(t){let e="";const n=t.indexOf("#");return-1!==n&&(e=t.slice(n)),e}(t.url);if(t.fragmentIdentifier){const r=new URL(n);r.hash=t.fragmentIdentifier,o=e[C]?r.hash:`#${t.fragmentIdentifier}`}return`${n}${r}${o}`}function G(t,e,n){n={parseFragmentIdentifier:!0,[C]:!1,...n};const{url:r,query:o,fragmentIdentifier:i}=$(t,n);return H({url:r,query:A(o,e),fragmentIdentifier:i},n)}function q(t,e,n){return G(t,Array.isArray(e)?t=>!e.includes(t):(t,n)=>!e(t,n),n)}const V=n;function Y(t){return Y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Y(t)}function K(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return J(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return J(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function J(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);nr.status?e(t):n(t)},r.onerror=function(){n({status:"error",data:{code:r.status,error:r.statusText||"unknown"}})};var o=t.endpoint;"GET"===t.method&&(o+="?".concat(V.stringify(t.parameters))),r.open(t.method,o,!0),r.overrideMimeType("application/json"),r.setRequestHeader("Accept","application/json");var i,a=K(t.headers);try{for(a.s();!(i=a.n()).done;){var u=i.value;r.setRequestHeader(u.name,u.value)}}catch(t){a.e(t)}finally{a.f()}r.send("POST"===t.method?JSON.stringify(t.parameters):null)}}])&&X(e.prototype,n),r&&X(e,r),Object.defineProperty(e,"prototype",{writable:!1}),i}(S);function nt(t){return nt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},nt(t)}function rt(t,e){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:null,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),mt(this,St,{writable:!0,value:void 0}),mt(this,Et,{writable:!0,value:void 0}),mt(this,Tt,{writable:!0,value:void 0}),mt(this,kt,{writable:!0,value:void 0}),mt(this,jt,{writable:!0,value:void 0}),mt(this,Ot,{writable:!0,value:void 0}),mt(this,Pt,{writable:!0,value:function(t){var e={};for(var n in t)for(var r in e[n]={},t[n]){var o=t[n][r].value.filter((function(t){return""!==t}));o.length&&(e[n][r]=o)}return e}}),wt(this,St,e),wt(this,Et,n),wt(this,Tt,r),wt(this,kt,{}),wt(this,jt,o),wt(this,Ot,i)}var e,n,r;return e=t,n=[{key:"addPosition",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=ht(this,kt);if(t in r)throw new Error('Position "'+t+'" already exists.');r[t]={},n&&this.addPositionResources(t,ht(this,jt)),this.addPositionResources(t,e)}},{key:"addPositionResources",value:function(t,e){for(var n in e)this.addPositionResource(t,e[n])}},{key:"addPositionResource",value:function(t,e){if(!(e instanceof yt))throw new TypeError("Argument resource must be instance of Resource class.");var n=ht(this,kt);if(!(t in n))throw new Error('Missing position "'+t+'".');var r=n[t];e.name in r?r[e.name]=r[e.name].withValues(e.value):r[e.name]=e}},{key:"method",get:function(){return ht(this,St)}},{key:"endpoint",get:function(){return ht(this,Et)}},{key:"locale",get:function(){return ht(this,Tt)}},{key:"parameters",get:function(){var t=ht(this,Pt).call(this,ht(this,kt)),e={query:"GET"===this.method?JSON.stringify(t):t};return null!==this.locale&&(e.locale=this.locale),e}},{key:"headers",get:function(){return ht(this,Ot)}}],n&&dt(e.prototype,n),r&&dt(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function At(t){return At="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},At(t)}function Rt(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};for(var o in"1"!==(r["omit-default-resources"]||"0").toString()?e=function(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:void 0;return this.options[t]||e}}],n&&fe(e.prototype,n),r&&fe(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function pe(t){return pe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},pe(t)}function ye(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:"";if(-1===this.STATE.STATES.indexOf(t))throw new TypeError("".concat(t," is not valid state."));de(this,Se,t),de(this,Ee,e.toString()),ve(this,Te)[t]=(ve(this,Te)[t]||0)+1,this._eventBus.dispatch(ie.ON_BANNER_STATE_CHANGED,this)}},{key:"getCurrenBreakpoint",value:function(t){return null}},{key:"redrawIfNeeded",value:function(){}},{key:"isManaged",value:function(){return!1}},{key:"isExternal",value:function(){return!1}},{key:"isEmbed",value:function(){return!1}}],n&&ye(e.prototype,n),r&&ye(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function je(t){return je="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},je(t)}function Oe(t,e){for(var n=0;n=c&&(null===i||ic))&&(o=u,i=c,Le(t,Ye)[n]=c)):r=u})),null===o&&null===r)throw new Error("Unable to resolve content, no contents found.");a.sort((function(t,e){return t-e})),"min"===n?a.unshift(null):a.push(null);var u=a.indexOf(i);return"max"===n&&u-1 in a&&(Le(this,Ye).min=a[u-1]),"min"===n&&u+1 in a&&(Le(this,Ye).max=a[u+1]),ze(this,Ve,null!==o?o:r)}},{key:"needRedraw",value:function(){if(null===Le(this,Ve))return!0;var t=Le(this,He).width;return null!==Le(this,Ye).min&&tLe(this,Ye).max}}])&&xe(e.prototype,n),r&&xe(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Xe(t,e){for(var n in t)e(t[n],n)}function Qe(t){return Qe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Qe(t)}function Ze(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return tn(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return tn(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function tn(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n1&&void 0!==arguments[1]?arguments[1]:"weight",n={},r=0,o=0;o0;)u-=n[a],a++;return t[--a]?t[a]:t[0]}}],(n=null)&&gn(e.prototype,n),r&&gn(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function En(t){return En="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},En(t)}function Tn(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return kn(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return kn(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function kn(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n6&&void 0!==arguments[6]?arguments[6]:{},f=arguments.length>7&&void 0!==arguments[7]?arguments[7]:{};for(var s in function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),Rn(Nn(c=o.call(this,n,r,a,u,f)),Gn),Rn(Nn(c),Hn),_n(Nn(c),Bn,{writable:!0,value:void 0}),_n(Nn(c),xn,{writable:!0,value:void 0}),_n(Nn(c),Fn,{writable:!0,value:[]}),_n(Nn(c),Un,{writable:!0,value:void 0}),_n(Nn(c),Ln,{writable:!0,value:!1}),_n(Nn(c),zn,{writable:!0,value:null}),_n(Nn(c),$n,{writable:!0,value:[]}),Wn(Nn(c),Bn,t),Wn(Nn(c),xn,e),Wn(Nn(c),Un,l),l)Mn(Nn(c),Fn).push(new yt(s,l[s]));return c}return e=i,(n=[{key:"html",set:function(t){this.element.innerHTML=t}},{key:"resources",get:function(){return Mn(this,Fn)}},{key:"rawResources",get:function(){return Mn(this,Un)}},{key:"data",get:function(){return console.warn("Usage of deprecated property `ManagedBanner.data`. Please use property `positionData` for accessing information about a position."),new hn(this)}},{key:"fingerprints",get:function(){var t;try{t=this.bannerData}catch(t){return[]}return this.positionData.isMultiple()||(t=[t]),t.map((function(t){return t.fingerprint}))}},{key:"bannerData",get:function(){if(null!==Mn(this,zn))return Mn(this,zn);if(!Mn(this,$n).length)throw new Error("Banner's data is empty.");var t=null,e=this.positionData,n=function(t){return Pe.createFromProperties({bannerId:t.id,bannerName:t.name,positionId:e.id,positionCode:e.code,positionName:e.name,campaignId:t.campaignId,campaignCode:t.campaignCode,campaignName:t.campaignName})};switch(!0){case e.isSingle():(t=Mn(this,$n).reduce((function(t,e){return t.score>=e.score?t:e}))).fingerprint=n(t);break;case e.isRandom():(t=Sn.randomByWeights(Mn(this,$n),"score")).fingerprint=n(t);break;case e.isMultiple():var r,o=Tn(t=Mn(this,$n).sort((function(t,e){return e.score-t.score})));try{for(o.s();!(r=o.n()).done;){var i=r.value;i.fingerprint=n(i)}}catch(t){o.e(t)}finally{o.f()}break;default:throw new Error("Invalid display type ".concat(this.displayType,"."))}if(null===t)throw new Error("Banner's data is empty.");return Wn(this,zn,t),t}},{key:"setResponseData",value:function(t){if(Mn(this,Ln))throw new Error("Data for banner on position ".concat(this.position," is already set."));this._positionData=new ce({id:t.position_id||null,code:this._positionData.code,name:t.position_name||null,rotationSeconds:t.rotation_seconds,displayType:t.display_type,breakpointType:t.breakpoint_type});var e=[];for(var n in t.banners||[])e.push(new fn(t.banners[n],t.breakpoint_type,Mn(this,Bn)));Wn(this,$n,e),Wn(this,Ln,!0),Cn(this,Hn,Vn).call(this,"Banner was successfully rendered.")}},{key:"getCurrenBreakpoint",value:function(t){var e=this.bannerData,n=(e=(Array.isArray(e)?e:[e]).find((function(e){return e.id===t})))&&e.content?e.content.breakpoint:null;return null===n?null:parseInt(n)}},{key:"isManaged",value:function(){return!0}},{key:"redrawIfNeeded",value:function(){Cn(this,Gn,Yn).call(this)&&Cn(this,Hn,Vn).call(this,"Banner was successfully redrawn.")}}])&&jn(e.prototype,n),r&&jn(e,r),Object.defineProperty(e,"prototype",{writable:!1}),i}(ke);function Vn(t){try{this.html=Mn(this,xn).render(this)}catch(t){return void this.setState(this.STATE.ERROR,"Render error: "+t.message)}this.setState(this.STATE.RENDERED,t)}function Yn(){var t=this.bannerData;for(var e in Array.isArray(t)||(t=[t]),t)if(t[e].needRedraw())return!0;return!1}function Kn(t){return Kn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Kn(t)}function Jn(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return Xn(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Xn(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Xn(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function nr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&void 0!==arguments[0]?arguments[0]:1;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),kr(this,Pr,{writable:!0,value:void 0}),jr(this,Pr,e-1)}var e,n,r;return e=t,(n=[{key:"getNextIdentifier",value:function(){var t,e;return jr(this,Pr,(t=function(t,e){return e.get?e.get.call(t):e.value}(e=this,Or(e,Pr,"get")),++t))}}])&&Tr(e.prototype,n),r&&Tr(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Ar(t){if(t instanceof HTMLElement)return t;if("string"!=typeof t)throw new TypeError("Element must be instance of HTMLElement or String");var e;if(!((e="#"===t.charAt(0)?document.getElementById(t.slice(1)):document.querySelector(t))instanceof HTMLElement))throw new TypeError("Selector "+t+" is invalid.");return e}function Rr(t){return Rr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Rr(t)}function _r(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return Ir(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ir(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Ir(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n2&&void 0!==arguments[2]?arguments[2]:null;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Mr(this,xr,{writable:!0,value:void 0}),Mr(this,Fr,{writable:!0,value:void 0}),Mr(this,Ur,{writable:!0,value:void 0}),Mr(this,Lr,{writable:!0,value:void 0}),Mr(this,zr,{writable:!0,value:[]}),Dr(this,xr,e),Dr(this,Fr,n),Dr(this,Ur,r),Dr(this,Lr,new Nr),this.STATE=ne}var e,n,r;return e=t,n=[{key:"addExternalBanner",value:function(t){(t=Ar(t)).setAttribute("data-amp-attached","");var e=new vr(Wr(this,Fr),Wr(this,xr),Wr(this,Lr).getNextIdentifier(),t);return Wr(this,zr).push(e),e}},{key:"addManagedBanner",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(null===Wr(this,Ur))throw new Error("Unable to add managed banner, renderer is not provided.");(t=Ar(t)).setAttribute("data-amp-attached","");var o=new qn(Wr(this,Fr),Wr(this,Ur),Wr(this,xr),Wr(this,Lr).getNextIdentifier(),t,e,n,r);return Wr(this,zr).push(o),o}},{key:"addEmbedBanner",value:function(t,e,n){(t=Ar(t)).setAttribute("data-amp-attached","");var r=new Sr(Wr(this,xr),Wr(this,Lr).getNextIdentifier(),t,e,n);return Wr(this,zr).push(r),r}},{key:"removeBanner",value:function(t){var e=Wr(this,zr).length;return Dr(this,zr,Wr(this,zr).filter((function(e){return e!==t}))),e!==Wr(this,zr).length}},{key:"getBannersByState",value:function(t){var e=t.state,n=t.managed,r=void 0===n||n,o=t.external,i=void 0===o||o,a=t.embed,u=void 0===a||a;return Wr(this,zr).filter((function(t){return t instanceof ke&&t.state===e&&!(t instanceof qn&&!r||t instanceof vr&&!i||t instanceof Sr&&!u)}))}},{key:"getBannerByFingerprint",value:function(t){var e,n=t instanceof Pe?t.value:t,r=_r(Wr(this,zr));try{for(r.s();!(e=r.n()).done;){var o=e.value;if(!(o instanceof Sr)){var i,a=_r(o.fingerprints);try{for(a.s();!(i=a.n()).done;)if(i.value.value===n)return o}catch(t){a.e(t)}finally{a.f()}}}}catch(t){r.e(t)}finally{r.f()}return null}},{key:"getBannerByUid",value:function(t){var e,n=_r(Wr(this,zr));try{for(n.s();!(e=n.n()).done;){var r=e.value;if(r.uid===t)return r}}catch(t){n.e(t)}finally{n.f()}return null}}],n&&Cr(e.prototype,n),r&&Cr(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Hr(t){return Hr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Hr(t)}function Gr(t,e){for(var n=0;n=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Zr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n2&&void 0!==arguments[2]?arguments[2]:null,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;if("function"!=typeof e)throw new TypeError("Listener must be of type function.");var i="idx_"+no(this,io).getNextIdentifier();return no(this,ao)[t]=no(this,ao)[t]||{},no(this,ao)[t][i]={callback:e,scope:r,priority:o},t in no(this,uo)&&delete no(this,uo)[t],function(){t in no(n,ao)&&i in no(n,ao)[t]&&delete no(n,ao)[t][i]}}},{key:"dispatch",value:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;re.priority?-1:t.priority=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Io(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=u.pixels)return u.ratio}}catch(t){i.e(t)}finally{i.f()}return r};return new IntersectionObserver((function(r){var o,a=[],u={},l={},f=_o(r);try{for(f.s();!(o=f.n()).done;){var s=o.value,p=s.target.dataset.ampBannerFingerprint,y=t.getBannerByFingerprint(p);if(y){var b=n[p];if(b){var v={fingerprint:b.fingerprint,element:s.target,banner:y};if(a.push(Ao(Ao({},v),{},{entry:s})),!b.alreadySeen){var d=s.intersectionRatio>=c(s.target);u[p]=!(p in u)||!u[p].isIntersecting&&d?{fingerprintArgs:v,fingerprintMetadata:b,isIntersecting:d}:u[p]}if(!b.alreadyFullySeen){var m=.99<=s.intersectionRatio;l[p]=!(p in l)||!l[p].isFullyIntersecting&&m?{fingerprintArgs:v,fingerprintMetadata:b,isFullyIntersecting:m}:l[p]}}}}}catch(t){f.e(t)}finally{f.f()}for(var h=function(){var t=g[w],n=t.fingerprintArgs,r=t.fingerprintMetadata,o=t.isIntersecting;o&&!r.alreadySeen&&null===r.firstTimeSeenTimeoutId?r.firstTimeSeenTimeoutId=setTimeout((function(){r.alreadySeen=!0,e.dispatch(ie.ON_BANNER_FIRST_TIME_SEEN,n)}),i):o||null===r.firstTimeSeenTimeoutId||(clearTimeout(r.firstTimeSeenTimeoutId),r.firstTimeSeenTimeoutId=null)},w=0,g=Object.values(u);w=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function xo(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function ci(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=":"<=").concat(r),{channel_code:e,banner_id:t.bannerId,banner_name:t.bannerName,position_id:t.positionId,position_code:t.positionCode,position_name:t.positionName,campaign_id:t.campaignId,campaign_code:t.campaignCode,campaign_name:t.campaignName,breakpoint:r}};n.isEventEnabled(ni.BANNER_LOADED)&&t.subscribe(ie.ON_BANNER_STATE_CHANGED,(function(t){if(!t.isEmbed()&&ne.RENDERED===t.state&&1===t.stateCounter){var e,o=ui(t.fingerprints);try{for(o.s();!(e=o.n()).done;){var i=e.value;n.send(ni.BANNER_LOADED,r(i,t))}}catch(t){o.e(t)}finally{o.f()}}})),n.isEventEnabled(ni.BANNER_DISPLAYED)&&t.subscribe(ie.ON_BANNER_FIRST_TIME_SEEN,(function(t){var e=t.fingerprint,o=t.banner;n.send(ni.BANNER_DISPLAYED,r(e,o))})),n.isEventEnabled(ni.BANNER_FULLY_DISPLAYED)&&t.subscribe(ie.ON_BANNER_FIRST_TIME_FULLY_SEEN,(function(t){var e=t.fingerprint,o=t.banner;n.send(ni.BANNER_FULLY_DISPLAYED,r(e,o))})),n.isEventEnabled(ni.BANNER_CLICKED)&&t.subscribe(ie.ON_BANNER_LINK_CLICKED,(function(t){var e=t.fingerprint,o=t.banner,i=t.target;n.send(ni.BANNER_CLICKED,ii(ii({},r(e,o)),{},{link:i.href||""}))}))}}}}])&&li(e.prototype,n),r&&li(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}(),gi=!1;const Si=function(t,e){if(!("plausible"in window)||"function"!=typeof window.plausible)return!gi&&console.warn("Unable to send metrics to Plausible because the function plausible() does not occur in the window."),void(gi=!0);Object.keys(e).forEach((function(t){return null===e[t]&&delete e[t]})),window.plausible(t,{props:e})};var Ei=!1;const Ti=function(t,e){if(!("gtag"in window)||"function"!=typeof window.gtag)return!Ei&&console.warn("Unable to send metrics to Google Analytics because the function gtag() does not occur in the window."),void(Ei=!0);Object.keys(e).forEach((function(t){return null===e[t]&&delete e[t]})),window.gtag("event",t,e)};function ki(t){return ki="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ki(t)}function ji(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Oi(t,e,n){return(e=function(t){var e=function(t,e){if("object"!==ki(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!==ki(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===ki(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Pi=!1;const Ni=function(t,e){if(!("dataLayer"in window))return!Pi&&console.warn("Unable to send metrics to GTM because the dataLayer does not occur in the window."),void(Pi=!0);Object.keys(e).forEach((function(t){return null===e[t]&&delete e[t]})),window.dataLayer.push(function(t){for(var e=1;e=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Ii(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n3&&void 0!==arguments[3]?arguments[3]:"*";t.postMessage({message:e,data:n},r)}},{key:"listen",value:function(){var t=this;window.addEventListener("message",(function(e){if(!(0=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Qi(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Ra(t,e){if(t){if("string"==typeof t)return _a(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_a(t,e):void 0}}function _a(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);ne.interaction.defaultIntersectionRatio||1s||1e.interaction.firstTimeSeenTimeout)throw new Error('The option "interaction.firstTimeSeenTimeout" must be a int with a minimum value of 500, "'.concat(e.interaction.firstTimeSeenTimeout,'" passed.'));if("object"!==m(e.metrics))throw new Error('The option "metrics" must be an object of the format { receiver: null|string|function|array, disabledEvents: array }, '.concat(e.metrics," passed."));if(null!==e.metrics.receiver&&-1===["string","function"].indexOf(m(e.metrics.receiver))&&!Array.isArray(e.metrics.receiver))throw new Error('The option "metrics.receiver" must be a null or a string or a function or an array of strings|functions, "'.concat(e.metrics.receiver,'" passed.'));if(Array.isArray(e.metrics.receiver)){for(var p in e.metrics.receiver)if(-1===["string","function"].indexOf(m(e.metrics.receiver[p])))throw new Error('The option "metrics.receiver.'.concat(p,'" must be a string or a function, "').concat(e.metrics.receiver[p],'" passed.'))}else e.metrics.receiver=null!==e.metrics.receiver?[e.metrics.receiver]:[];if(!Array.isArray(e.metrics.disabledEvents))throw new Error('The option "metrics.disabledEvents" must an array of strings (event names), "'.concat(e.metrics.disabledEvents,'" passed.'));for(var d in e.metrics.disabledEvents)if("string"!=typeof e.metrics.disabledEvents[d])throw new Error('The option "metrics.disabledEvents.'.concat(d,'" must be a string, "').concat(e.metrics.disabledEvents[d],'" passed.'));return e}(n)),Da(this,Ua,new co),Da(this,La,new Ut(n.method,n.url,n.version,n.channel)),Da(this,za,new Zt(n.url,n.version,n.channel)),Da(this,Ha,new $r(Wa(this,Ua),Jr.fromCurrentWindow(),new Oo(n.template))),Da(this,Ga,new Qo(Wa(this,Ha),Wa(this,Ua),n.interaction)),Da(this,qa,Ui.createFromReceivers(n.metrics.receiver,n.metrics.disabledEvents)),Da(this,Va,new wi(Wa(this,qa),Wa(this,Ua),n.channel)),Da(this,Ya,new Sa({origin:n.url,connectionData:{extendedConfig:{interaction:n.interaction}},bannerManager:Wa(this,Ha),metricsSender:Wa(this,qa)})),this.setLocale(n.locale),Wa(this,La).origin=n.origin,n.resources)Wa(this,La).addDefaultResource(a,n.resources[a]),Wa(this,za).addDefaultResource(a,n.resources[a]);window.addEventListener("resize",(function(){var t,e=Aa(Wa(i,Ha).getBannersByState({state:Wa(i,Ha).STATE.RENDERED,managed:!0,external:!0,embed:!1}));try{for(e.s();!(t=e.n()).done;){t.value.redrawIfNeeded()}}catch(t){e.e(t)}finally{e.f()}})),Wa(this,Ya).listen(),Wa(this,Va).attach(),Wa(this,Ga).start()}var e,n,r;return e=t,n=[{key:"version",get:function(){return Wa(this,xa)}},{key:"on",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return Wa(this,Ua).subscribe(t,e,n)}},{key:"setLocale",value:function(t){Wa(this,La).locale=t,Wa(this,za).locale=t}},{key:"setGateway",value:function(t){if(!function(t){return t instanceof S}(t))throw new TypeError("Argument gateway mut be instance of AbstractGateway.");Da(this,$a,t)}},{key:"getGateway",value:function(){return null===Wa(this,$a)&&this.setGateway(new et),Wa(this,$a)}},{key:"createBanner",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"managed";if(t=Ar(t),"embed"===o){var i=function(t,e,n){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return n}(this,Ka,Xa).call(this,t,e,n,r),a=Wa(this,Ha).addEmbedBanner(i,e,r);return Wa(this,Ya).connectBanner(a),t.insertAdjacentElement("afterend",i),t.remove(),a}return Wa(this,Ha).addManagedBanner(t,e,n,r)}},{key:"attachBanners",value:function(){var t,e=Aa((arguments.length>0&&void 0!==arguments[0]?arguments[0]:document).querySelectorAll("[data-amp-banner]:not([data-amp-attached])"));try{for(e.s();!(t=e.n()).done;){var n=t.value,r=n.dataset.ampBanner;if(r){var o=void 0;if("ampBannerExternal"in n.dataset)o=Wa(this,Ha).addExternalBanner(n);else{var i=Zn.parseResources(n),a=Zn.parseOptions(n),u=n.dataset.ampMode||"managed";o=this.createBanner(n,r,i,a,u)}Wa(this,Ua).dispatch(this.EVENTS.ON_BANNER_ATTACHED,o)}else console.warn("Unable to attach a banner to the element ",n,' because the attribute "data-amp-banner" has an empty value.')}}catch(t){e.e(t)}finally{e.f()}}},{key:"fetch",value:function(){var t=this,e=Wa(this,Ha).getBannersByState({state:Wa(this,Ha).STATE.NEW,managed:!0,external:!1,embed:!1});if(e.length){var n,r=Wa(this,La).create(),o=Aa(e);try{for(o.s();!(n=o.n()).done;){var i=n.value;r.addPosition(i.position,i.resources,"1"!==i.options.get("omit-default-resources","0").toString())}}catch(t){o.e(t)}finally{o.f()}Wa(this,Ua).dispatch(this.EVENTS.ON_BEFORE_FETCH),this.getGateway().fetch(r,(function(n){var r,o=n.data,i=Aa(e);try{for(i.s();!(r=i.n()).done;){var a=r.value;if(a.position in o&&"banners"in o[a.position]&&Object.values(o[a.position].banners).length){var u=o[a.position];Array.isArray(u.banners)||(u.banners=Object.values(u.banners)),"embed"!==u.mode?a.setResponseData(u):(t.createBanner(a.element,a.position,a.rawResources,a.options.options,u.mode),Wa(t,Ha).removeBanner(a))}else a.setState(Wa(t,Ha).STATE.NOT_FOUND,"Banner not found in fetched response.")}}catch(t){i.e(t)}finally{i.f()}Wa(t,Ua).dispatch(t.EVENTS.ON_FETCH_SUCCESS,n)}),(function(n){var r,o=Aa(e);try{for(o.s();!(r=o.n()).done;)r.value.setState(Wa(t,Ha).STATE.ERROR,"Request on api failed.")}catch(t){o.e(t)}finally{o.f()}Wa(t,Ua).dispatch(t.EVENTS.ON_FETCH_ERROR,n)}))}}}],n&&Ia(e.prototype,n),r&&Ia(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Xa(t,e,n,r){var o=document.createElement("iframe"),i="cv=".concat(encodeURIComponent(this.version.semver)),a=t.dataset.ampEmbedSrc||Wa(this,za).create(e,n,r);return a+=-1===a.indexOf("?")?"?".concat(i):"&".concat(i),Na(t.attributes).map((function(t){var e=t.name,n=t.value;o.setAttribute(e,n)})),o.width="100%",o.height="100%",o.allowFullscreen=!0,o.scrolling="no",o.style.border="none",o.style.overflow="hidden",o.style.background="transparent",o.style.visibility="hidden",o.src=a,o.setAttribute("allowtransparency","true"),"lazy"===r.loading&&(o.loading="lazy"),o}function Qa(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,u=[],c=!0,l=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=i.call(n)).done)&&(u.push(r.value),u.length!==e);c=!0);}catch(t){l=!0,o=t}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw o}}return u}}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return Za(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Za(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Za(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);ne.interaction.defaultIntersectionRatio||1a||1e.interaction.firstTimeSeenTimeout)throw new Error('The option "interaction.firstTimeSeenTimeout" must be a int with a minimum value of 500, "'.concat(e.interaction.firstTimeSeenTimeout,'" passed.'));return e}function ru(t){return ru="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ru(t)}function ou(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return iu(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return iu(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function iu(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Cu(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n2&&void 0!==arguments[2]?arguments[2]:null;return Fu(this,Gu).subscribe(t,e,n)}},{key:"attachBanner",value:function(){if(Fu(this,Xu))throw new Error("Method attachBanner() should be called only once.");var t=document.querySelector("[data-amp-banner]:not([data-amp-attached])");if(t){var e=Fu(this,qu).addExternalBanner(t);Uu(this,Xu,!0),window.self!==window.top&&e.delegateResponsiveBehaviour(),Fu(this,Gu).dispatch(this.EVENTS.ON_BANNER_ATTACHED,e)}else console.warn("No banner not found in the embed client.")}}],n&&Mu(e.prototype,n),r&&Mu(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function nc(t,e){Fu(this,Vu).sendToParent("metrics",{eventName:t,eventArgs:e})}function rc(){var t,e=Iu(Fu(this,qu).getBannersByState({state:ne.RENDERED}));try{for(e.s();!(t=e.n()).done;){t.value.redrawIfNeeded()}}catch(t){e.e(t)}finally{e.f()}}function oc(t){return oc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},oc(t)}function ic(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};return new Ja(new p(ac,"standard@".concat(ac)),t)}},{key:"createEmbed",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new ec(new p(ac,"embed@".concat(ac)),t)}},{key:"version",get:function(){return ac}}],(n=null)&&ic(e.prototype,n),r&&ic(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();AMPClientFactory=e.default})(); \ No newline at end of file +var AMPClientFactory;(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.d(e,{default:()=>ul});var n={};t.r(n),t.d(n,{exclude:()=>q,extract:()=>U,parse:()=>L,parseUrl:()=>$,pick:()=>G,stringify:()=>z,stringifyUrl:()=>H});const r=JSON.parse('{"i8":"1.5.0-beta.4"}');function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}function i(t,e){for(var n=0;n\n\n <% if(\'img\' === data.content.type) { %>\n target="<%- data.content.target %>"<% } %>>\n \n <% (data.content.sources || []).forEach(function(source) { %>\n \n <% }); %>\n <%- data.content.alt %>width="<%- banner.positionData.dimensions.width %>"<% } %>\n <% if(null !== banner.positionData.dimensions.height) { %>height="<%- banner.positionData.dimensions.height %>"<% } %>\n <% if(\'\' !== data.content.title) { %>title="<%- data.content.title %>"<% } %>\n <% if(banner.options.has(\'loading\')) { %>loading="<%- banner.options.get(\'loading\') %>"<% } %>>\n \n \n <% } else if (\'html\' === data.content.type) { %>\n
\n <%= data.content.html %>\n
\n <% } %>\n\n \n',random:'\n \n',multiple:'\n \n'};function d(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,u=[],l=!0,c=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(u.push(r.value),u.length!==e);l=!0);}catch(t){c=!0,o=t}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return u}}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return v(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return v(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function v(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);nnull==t,I=t=>encodeURIComponent(t).replace(/[!'()*]/g,(t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`)),C=Symbol("encodeFragmentIdentifier");function M(t){if("string"!=typeof t||1!==t.length)throw new TypeError("arrayFormatSeparator must be single character string")}function D(t,e){return e.encode?e.strict?I(t):encodeURIComponent(t):t}function W(t,e){return e.decode?P(t):t}function B(t){return Array.isArray(t)?t.sort():"object"==typeof t?B(Object.keys(t)).sort(((t,e)=>Number(t)-Number(e))).map((e=>t[e])):t}function x(t){const e=t.indexOf("#");return-1!==e&&(t=t.slice(0,e)),t}function F(t,e){return e.parseNumbers&&!Number.isNaN(Number(t))&&"string"==typeof t&&""!==t.trim()?t=Number(t):!e.parseBooleans||null===t||"true"!==t.toLowerCase()&&"false"!==t.toLowerCase()||(t="true"===t.toLowerCase()),t}function U(t){const e=(t=x(t)).indexOf("?");return-1===e?"":t.slice(e+1)}function L(t,e){M((e={decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1,...e}).arrayFormatSeparator);const n=function(t){let e;switch(t.arrayFormat){case"index":return(t,n,r)=>{e=/\[(\d*)]$/.exec(t),t=t.replace(/\[\d*]$/,""),e?(void 0===r[t]&&(r[t]={}),r[t][e[1]]=n):r[t]=n};case"bracket":return(t,n,r)=>{e=/(\[])$/.exec(t),t=t.replace(/\[]$/,""),e?void 0!==r[t]?r[t]=[...r[t],n]:r[t]=[n]:r[t]=n};case"colon-list-separator":return(t,n,r)=>{e=/(:list)$/.exec(t),t=t.replace(/:list$/,""),e?void 0!==r[t]?r[t]=[...r[t],n]:r[t]=[n]:r[t]=n};case"comma":case"separator":return(e,n,r)=>{const o="string"==typeof n&&n.includes(t.arrayFormatSeparator),i="string"==typeof n&&!o&&W(n,t).includes(t.arrayFormatSeparator);n=i?W(n,t):n;const a=o||i?n.split(t.arrayFormatSeparator).map((e=>W(e,t))):null===n?n:W(n,t);r[e]=a};case"bracket-separator":return(e,n,r)=>{const o=/(\[])$/.test(e);if(e=e.replace(/\[]$/,""),!o)return void(r[e]=n?W(n,t):n);const i=null===n?[]:n.split(t.arrayFormatSeparator).map((e=>W(e,t)));void 0!==r[e]?r[e]=[...r[e],...i]:r[e]=i};default:return(t,e,n)=>{void 0!==n[t]?n[t]=[...[n[t]].flat(),e]:n[t]=e}}}(e),r=Object.create(null);if("string"!=typeof t)return r;if(!(t=t.trim().replace(/^[?#&]/,"")))return r;for(const o of t.split("&")){if(""===o)continue;const t=e.decode?o.replace(/\+/g," "):o;let[i,a]=N(t,"=");void 0===i&&(i=t),a=void 0===a?null:["comma","separator","bracket-separator"].includes(e.arrayFormat)?a:W(a,e),n(W(i,e),a,r)}for(const[t,n]of Object.entries(r))if("object"==typeof n&&null!==n)for(const[t,r]of Object.entries(n))n[t]=F(r,e);else r[t]=F(n,e);return!1===e.sort?r:(!0===e.sort?Object.keys(r).sort():Object.keys(r).sort(e.sort)).reduce(((t,e)=>{const n=r[e];return Boolean(n)&&"object"==typeof n&&!Array.isArray(n)?t[e]=B(n):t[e]=n,t}),Object.create(null))}function z(t,e){if(!t)return"";M((e={encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:",",...e}).arrayFormatSeparator);const n=n=>e.skipNull&&R(t[n])||e.skipEmptyString&&""===t[n],r=function(t){switch(t.arrayFormat){case"index":return e=>(n,r)=>{const o=n.length;return void 0===r||t.skipNull&&null===r||t.skipEmptyString&&""===r?n:null===r?[...n,[D(e,t),"[",o,"]"].join("")]:[...n,[D(e,t),"[",D(o,t),"]=",D(r,t)].join("")]};case"bracket":return e=>(n,r)=>void 0===r||t.skipNull&&null===r||t.skipEmptyString&&""===r?n:null===r?[...n,[D(e,t),"[]"].join("")]:[...n,[D(e,t),"[]=",D(r,t)].join("")];case"colon-list-separator":return e=>(n,r)=>void 0===r||t.skipNull&&null===r||t.skipEmptyString&&""===r?n:null===r?[...n,[D(e,t),":list="].join("")]:[...n,[D(e,t),":list=",D(r,t)].join("")];case"comma":case"separator":case"bracket-separator":{const e="bracket-separator"===t.arrayFormat?"[]=":"=";return n=>(r,o)=>void 0===o||t.skipNull&&null===o||t.skipEmptyString&&""===o?r:(o=null===o?"":o,0===r.length?[[D(n,t),e,D(o,t)].join("")]:[[r,D(o,t)].join(t.arrayFormatSeparator)])}default:return e=>(n,r)=>void 0===r||t.skipNull&&null===r||t.skipEmptyString&&""===r?n:null===r?[...n,D(e,t)]:[...n,[D(e,t),"=",D(r,t)].join("")]}}(e),o={};for(const[e,r]of Object.entries(t))n(e)||(o[e]=r);const i=Object.keys(o);return!1!==e.sort&&i.sort(e.sort),i.map((n=>{const o=t[n];return void 0===o?"":null===o?D(n,e):Array.isArray(o)?0===o.length&&"bracket-separator"===e.arrayFormat?D(n,e)+"[]":o.reduce(r(n),[]).join("&"):D(n,e)+"="+D(o,e)})).filter((t=>t.length>0)).join("&")}function $(t,e){e={decode:!0,...e};let[n,r]=N(t,"#");return void 0===n&&(n=t),{url:n?.split("?")?.[0]??"",query:L(U(t),e),...e&&e.parseFragmentIdentifier&&r?{fragmentIdentifier:W(r,e)}:{}}}function H(t,e){e={encode:!0,strict:!0,[C]:!0,...e};const n=x(t.url).split("?")[0]||"";let r=z({...L(U(t.url),{sort:!1}),...t.query},e);r&&(r=`?${r}`);let o=function(t){let e="";const n=t.indexOf("#");return-1!==n&&(e=t.slice(n)),e}(t.url);if(t.fragmentIdentifier){const r=new URL(n);r.hash=t.fragmentIdentifier,o=e[C]?r.hash:`#${t.fragmentIdentifier}`}return`${n}${r}${o}`}function G(t,e,n){n={parseFragmentIdentifier:!0,[C]:!1,...n};const{url:r,query:o,fragmentIdentifier:i}=$(t,n);return H({url:r,query:A(o,e),fragmentIdentifier:i},n)}function q(t,e,n){return G(t,Array.isArray(e)?t=>!e.includes(t):(t,n)=>!e(t,n),n)}const V=n;function Y(t){return Y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Y(t)}function K(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return J(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return J(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function J(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);nr.status?e(t):n(t)},r.onerror=function(){n({status:"error",data:{code:r.status,error:r.statusText||"unknown"}})};var o=t.endpoint;"GET"===t.method&&(o+="?".concat(V.stringify(t.parameters))),r.open(t.method,o,!0),r.overrideMimeType("application/json"),r.setRequestHeader("Accept","application/json");var i,a=K(t.headers);try{for(a.s();!(i=a.n()).done;){var u=i.value;r.setRequestHeader(u.name,u.value)}}catch(t){a.e(t)}finally{a.f()}r.send("POST"===t.method?JSON.stringify(t.parameters):null)}}])&&X(e.prototype,n),r&&X(e,r),Object.defineProperty(e,"prototype",{writable:!1}),i}(S);function nt(t){return nt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},nt(t)}function rt(t,e){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:null,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),mt(this,St,{writable:!0,value:void 0}),mt(this,Et,{writable:!0,value:void 0}),mt(this,Tt,{writable:!0,value:void 0}),mt(this,kt,{writable:!0,value:void 0}),mt(this,jt,{writable:!0,value:void 0}),mt(this,Ot,{writable:!0,value:void 0}),mt(this,Pt,{writable:!0,value:function(t){var e={};for(var n in t)for(var r in e[n]={},t[n]){var o=t[n][r].value.filter((function(t){return""!==t}));o.length&&(e[n][r]=o)}return e}}),wt(this,St,e),wt(this,Et,n),wt(this,Tt,r),wt(this,kt,{}),wt(this,jt,o),wt(this,Ot,i)}var e,n,r;return e=t,n=[{key:"addPosition",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=ht(this,kt);if(t in r)throw new Error('Position "'+t+'" already exists.');r[t]={},n&&this.addPositionResources(t,ht(this,jt)),this.addPositionResources(t,e)}},{key:"addPositionResources",value:function(t,e){for(var n in e)this.addPositionResource(t,e[n])}},{key:"addPositionResource",value:function(t,e){if(!(e instanceof yt))throw new TypeError("Argument resource must be instance of Resource class.");var n=ht(this,kt);if(!(t in n))throw new Error('Missing position "'+t+'".');var r=n[t];e.name in r?r[e.name]=r[e.name].withValues(e.value):r[e.name]=e}},{key:"method",get:function(){return ht(this,St)}},{key:"endpoint",get:function(){return ht(this,Et)}},{key:"locale",get:function(){return ht(this,Tt)}},{key:"parameters",get:function(){var t=ht(this,Pt).call(this,ht(this,kt)),e={query:"GET"===this.method?JSON.stringify(t):t};return null!==this.locale&&(e.locale=this.locale),e}},{key:"headers",get:function(){return ht(this,Ot)}}],n&&vt(e.prototype,n),r&&vt(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function At(t){return At="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},At(t)}function Rt(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};for(var o in"1"!==(r["omit-default-resources"]||"0").toString()?e=function(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:void 0;return this.options[t]||e}}],n&&fe(e.prototype,n),r&&fe(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function pe(t){return pe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},pe(t)}function ye(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:"";if(-1===this.STATE.STATES.indexOf(t))throw new TypeError("".concat(t," is not valid state."));ve(this,Se,t),ve(this,Ee,e.toString()),de(this,Te)[t]=(de(this,Te)[t]||0)+1,this._eventBus.dispatch(ie.ON_BANNER_STATE_CHANGED,this)}},{key:"getCurrenBreakpoint",value:function(t){return null}},{key:"redrawIfNeeded",value:function(){}},{key:"isManaged",value:function(){return!1}},{key:"isExternal",value:function(){return!1}},{key:"isEmbed",value:function(){return!1}}],n&&ye(e.prototype,n),r&&ye(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function je(t){return je="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},je(t)}function Oe(t,e){for(var n=0;n=l&&(null===i||il))&&(o=u,i=l,Le(t,Ye)[n]=l)):r=u})),null===o&&null===r)throw new Error("Unable to resolve content, no contents found.");a.sort((function(t,e){return t-e})),"min"===n?a.unshift(null):a.push(null);var u=a.indexOf(i);return"max"===n&&u-1 in a&&(Le(this,Ye).min=a[u-1]),"min"===n&&u+1 in a&&(Le(this,Ye).max=a[u+1]),ze(this,Ve,null!==o?o:r)}},{key:"needRedraw",value:function(){if(null===Le(this,Ve))return!0;var t=Le(this,He).width;return null!==Le(this,Ye).min&&tLe(this,Ye).max}}])&&xe(e.prototype,n),r&&xe(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Xe(t,e){for(var n in t)e(t[n],n)}function Qe(t){return Qe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Qe(t)}function Ze(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return tn(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return tn(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function tn(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n1&&void 0!==arguments[1]?arguments[1]:"weight",n={},r=0,o=0;o0;)u-=n[a],a++;return t[--a]?t[a]:t[0]}}],(n=null)&&gn(e.prototype,n),r&&gn(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function En(t){return En="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},En(t)}function Tn(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return kn(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return kn(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function kn(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n6&&void 0!==arguments[6]?arguments[6]:{},f=arguments.length>7&&void 0!==arguments[7]?arguments[7]:{};for(var s in function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),Rn(Nn(l=o.call(this,n,r,a,u,f)),Gn),Rn(Nn(l),Hn),_n(Nn(l),Bn,{writable:!0,value:void 0}),_n(Nn(l),xn,{writable:!0,value:void 0}),_n(Nn(l),Fn,{writable:!0,value:[]}),_n(Nn(l),Un,{writable:!0,value:void 0}),_n(Nn(l),Ln,{writable:!0,value:!1}),_n(Nn(l),zn,{writable:!0,value:null}),_n(Nn(l),$n,{writable:!0,value:[]}),Dn(Nn(l),Bn,t),Dn(Nn(l),xn,e),Dn(Nn(l),Un,c),c)Mn(Nn(l),Fn).push(new yt(s,c[s]));return l}return e=i,(n=[{key:"html",set:function(t){this.element.innerHTML=t}},{key:"resources",get:function(){return Mn(this,Fn)}},{key:"rawResources",get:function(){return Mn(this,Un)}},{key:"data",get:function(){return console.warn("Usage of deprecated property `ManagedBanner.data`. Please use property `positionData` for accessing information about a position."),new hn(this)}},{key:"fingerprints",get:function(){var t;try{t=this.bannerData}catch(t){return[]}return this.positionData.isMultiple()||(t=[t]),t.map((function(t){return t.fingerprint}))}},{key:"bannerData",get:function(){if(null!==Mn(this,zn))return Mn(this,zn);if(!Mn(this,$n).length)throw new Error("Banner's data is empty.");var t=null,e=this.positionData,n=function(t){return Pe.createFromProperties({bannerId:t.id,bannerName:t.name,positionId:e.id,positionCode:e.code,positionName:e.name,campaignId:t.campaignId,campaignCode:t.campaignCode,campaignName:t.campaignName})};switch(!0){case e.isSingle():(t=Mn(this,$n).reduce((function(t,e){return t.score>=e.score?t:e}))).fingerprint=n(t);break;case e.isRandom():(t=Sn.randomByWeights(Mn(this,$n),"score")).fingerprint=n(t);break;case e.isMultiple():var r,o=Tn(t=Mn(this,$n).sort((function(t,e){return e.score-t.score})));try{for(o.s();!(r=o.n()).done;){var i=r.value;i.fingerprint=n(i)}}catch(t){o.e(t)}finally{o.f()}break;default:throw new Error("Invalid display type ".concat(this.displayType,"."))}if(null===t)throw new Error("Banner's data is empty.");return Dn(this,zn,t),t}},{key:"setResponseData",value:function(t){if(Mn(this,Ln))throw new Error("Data for banner on position ".concat(this.position," is already set."));this._positionData=new le({id:t.position_id||null,code:this._positionData.code,name:t.position_name||null,rotationSeconds:t.rotation_seconds,displayType:t.display_type,breakpointType:t.breakpoint_type,dimensions:t.dimensions||{width:null,height:null}});var e=[];for(var n in t.banners||[])e.push(new fn(t.banners[n],t.breakpoint_type,Mn(this,Bn)));Dn(this,$n,e),Dn(this,Ln,!0),Cn(this,Hn,Vn).call(this,"Banner was successfully rendered.")}},{key:"getCurrenBreakpoint",value:function(t){var e=this.bannerData,n=(e=(Array.isArray(e)?e:[e]).find((function(e){return e.id===t})))&&e.content?e.content.breakpoint:null;return null===n?null:parseInt(n)}},{key:"isManaged",value:function(){return!0}},{key:"redrawIfNeeded",value:function(){Cn(this,Gn,Yn).call(this)&&Cn(this,Hn,Vn).call(this,"Banner was successfully redrawn.")}}])&&jn(e.prototype,n),r&&jn(e,r),Object.defineProperty(e,"prototype",{writable:!1}),i}(ke);function Vn(t){try{this.html=Mn(this,xn).render(this)}catch(t){return void this.setState(this.STATE.ERROR,"Render error: "+t.message)}this.setState(this.STATE.RENDERED,t)}function Yn(){var t=this.bannerData;for(var e in Array.isArray(t)||(t=[t]),t)if(t[e].needRedraw())return!0;return!1}function Kn(t){return Kn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Kn(t)}function Jn(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return Xn(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Xn(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Xn(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function nr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&void 0!==arguments[0]?arguments[0]:1;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),kr(this,Pr,{writable:!0,value:void 0}),jr(this,Pr,e-1)}var e,n,r;return e=t,(n=[{key:"getNextIdentifier",value:function(){var t,e;return jr(this,Pr,(t=function(t,e){return e.get?e.get.call(t):e.value}(e=this,Or(e,Pr,"get")),++t))}}])&&Tr(e.prototype,n),r&&Tr(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Ar(t){if(t instanceof HTMLElement)return t;if("string"!=typeof t)throw new TypeError("Element must be instance of HTMLElement or String");var e;if(!((e="#"===t.charAt(0)?document.getElementById(t.slice(1)):document.querySelector(t))instanceof HTMLElement))throw new TypeError("Selector "+t+" is invalid.");return e}function Rr(t){return Rr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Rr(t)}function _r(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return Ir(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ir(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Ir(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n2&&void 0!==arguments[2]?arguments[2]:null;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Mr(this,xr,{writable:!0,value:void 0}),Mr(this,Fr,{writable:!0,value:void 0}),Mr(this,Ur,{writable:!0,value:void 0}),Mr(this,Lr,{writable:!0,value:void 0}),Mr(this,zr,{writable:!0,value:[]}),Wr(this,xr,e),Wr(this,Fr,n),Wr(this,Ur,r),Wr(this,Lr,new Nr),this.STATE=ne}var e,n,r;return e=t,n=[{key:"addExternalBanner",value:function(t){(t=Ar(t)).setAttribute("data-amp-attached","");var e=new dr(Dr(this,Fr),Dr(this,xr),Dr(this,Lr).getNextIdentifier(),t);return Dr(this,zr).push(e),e}},{key:"addManagedBanner",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(null===Dr(this,Ur))throw new Error("Unable to add managed banner, renderer is not provided.");(t=Ar(t)).setAttribute("data-amp-attached","");var o=new qn(Dr(this,Fr),Dr(this,Ur),Dr(this,xr),Dr(this,Lr).getNextIdentifier(),t,e,n,r);return Dr(this,zr).push(o),o}},{key:"addEmbedBanner",value:function(t,e,n){(t=Ar(t)).setAttribute("data-amp-attached","");var r=new Sr(Dr(this,xr),Dr(this,Lr).getNextIdentifier(),t,e,n);return Dr(this,zr).push(r),r}},{key:"removeBanner",value:function(t){var e=Dr(this,zr).length;return Wr(this,zr,Dr(this,zr).filter((function(e){return e!==t}))),e!==Dr(this,zr).length}},{key:"getBannersByState",value:function(t){var e=t.state,n=t.managed,r=void 0===n||n,o=t.external,i=void 0===o||o,a=t.embed,u=void 0===a||a;return Dr(this,zr).filter((function(t){return t instanceof ke&&t.state===e&&!(t instanceof qn&&!r||t instanceof dr&&!i||t instanceof Sr&&!u)}))}},{key:"getBannerByFingerprint",value:function(t){var e,n=t instanceof Pe?t.value:t,r=_r(Dr(this,zr));try{for(r.s();!(e=r.n()).done;){var o=e.value;if(!(o instanceof Sr)){var i,a=_r(o.fingerprints);try{for(a.s();!(i=a.n()).done;)if(i.value.value===n)return o}catch(t){a.e(t)}finally{a.f()}}}}catch(t){r.e(t)}finally{r.f()}return null}},{key:"getBannerByUid",value:function(t){var e,n=_r(Dr(this,zr));try{for(n.s();!(e=n.n()).done;){var r=e.value;if(r.uid===t)return r}}catch(t){n.e(t)}finally{n.f()}return null}}],n&&Cr(e.prototype,n),r&&Cr(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Hr(t){return Hr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Hr(t)}function Gr(t,e){for(var n=0;n=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Zr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n2&&void 0!==arguments[2]?arguments[2]:null,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;if("function"!=typeof e)throw new TypeError("Listener must be of type function.");var i="idx_"+no(this,io).getNextIdentifier();return no(this,ao)[t]=no(this,ao)[t]||{},no(this,ao)[t][i]={callback:e,scope:r,priority:o},t in no(this,uo)&&delete no(this,uo)[t],function(){t in no(n,ao)&&i in no(n,ao)[t]&&delete no(n,ao)[t][i]}}},{key:"dispatch",value:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;re.priority?-1:t.priority=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Io(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=u.pixels)return u.ratio}}catch(t){i.e(t)}finally{i.f()}return r};return new IntersectionObserver((function(r){var o,a=[],u={},c={},f=_o(r);try{for(f.s();!(o=f.n()).done;){var s=o.value,p=s.target.dataset.ampBannerFingerprint,y=t.getBannerByFingerprint(p);if(y){var b=n[p];if(b){var d={fingerprint:b.fingerprint,element:s.target,banner:y};if(a.push(Ao(Ao({},d),{},{entry:s})),!b.alreadySeen){var v=s.intersectionRatio>=l(s.target);u[p]=!(p in u)||!u[p].isIntersecting&&v?{fingerprintArgs:d,fingerprintMetadata:b,isIntersecting:v}:u[p]}if(!b.alreadyFullySeen){var m=.99<=s.intersectionRatio;c[p]=!(p in c)||!c[p].isFullyIntersecting&&m?{fingerprintArgs:d,fingerprintMetadata:b,isFullyIntersecting:m}:c[p]}}}}}catch(t){f.e(t)}finally{f.f()}for(var h=function(){var t=g[w],n=t.fingerprintArgs,r=t.fingerprintMetadata,o=t.isIntersecting;o&&!r.alreadySeen&&null===r.firstTimeSeenTimeoutId?r.firstTimeSeenTimeoutId=setTimeout((function(){r.alreadySeen=!0,e.dispatch(ie.ON_BANNER_FIRST_TIME_SEEN,n)}),i):o||null===r.firstTimeSeenTimeoutId||(clearTimeout(r.firstTimeSeenTimeoutId),r.firstTimeSeenTimeoutId=null)},w=0,g=Object.values(u);w=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function xo(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function li(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=":"<=").concat(r),{channel_code:e,banner_id:t.bannerId,banner_name:t.bannerName,position_id:t.positionId,position_code:t.positionCode,position_name:t.positionName,campaign_id:t.campaignId,campaign_code:t.campaignCode,campaign_name:t.campaignName,breakpoint:r}};n.isEventEnabled(ni.BANNER_LOADED)&&t.subscribe(ie.ON_BANNER_STATE_CHANGED,(function(t){if(!t.isEmbed()&&ne.RENDERED===t.state&&1===t.stateCounter){var e,o=ui(t.fingerprints);try{for(o.s();!(e=o.n()).done;){var i=e.value;n.send(ni.BANNER_LOADED,r(i,t))}}catch(t){o.e(t)}finally{o.f()}}})),n.isEventEnabled(ni.BANNER_DISPLAYED)&&t.subscribe(ie.ON_BANNER_FIRST_TIME_SEEN,(function(t){var e=t.fingerprint,o=t.banner;n.send(ni.BANNER_DISPLAYED,r(e,o))})),n.isEventEnabled(ni.BANNER_FULLY_DISPLAYED)&&t.subscribe(ie.ON_BANNER_FIRST_TIME_FULLY_SEEN,(function(t){var e=t.fingerprint,o=t.banner;n.send(ni.BANNER_FULLY_DISPLAYED,r(e,o))})),n.isEventEnabled(ni.BANNER_CLICKED)&&t.subscribe(ie.ON_BANNER_LINK_CLICKED,(function(t){var e=t.fingerprint,o=t.banner,i=t.target;n.send(ni.BANNER_CLICKED,ii(ii({},r(e,o)),{},{link:i.href||""}))}))}}}}])&&ci(e.prototype,n),r&&ci(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}(),gi=!1;const Si=function(t,e){if(!("plausible"in window)||"function"!=typeof window.plausible)return!gi&&console.warn("Unable to send metrics to Plausible because the function plausible() does not occur in the window."),void(gi=!0);Object.keys(e).forEach((function(t){return null===e[t]&&delete e[t]})),window.plausible(t,{props:e})};var Ei=!1;const Ti=function(t,e){if(!("gtag"in window)||"function"!=typeof window.gtag)return!Ei&&console.warn("Unable to send metrics to Google Analytics because the function gtag() does not occur in the window."),void(Ei=!0);Object.keys(e).forEach((function(t){return null===e[t]&&delete e[t]})),window.gtag("event",t,e)};function ki(t){return ki="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ki(t)}function ji(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Oi(t,e,n){return(e=function(t){var e=function(t,e){if("object"!==ki(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!==ki(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===ki(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Pi=!1;const Ni=function(t,e){if(!("dataLayer"in window))return!Pi&&console.warn("Unable to send metrics to GTM because the dataLayer does not occur in the window."),void(Pi=!0);Object.keys(e).forEach((function(t){return null===e[t]&&delete e[t]})),window.dataLayer.push(function(t){for(var e=1;e=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Ii(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n3&&void 0!==arguments[3]?arguments[3]:"*";t.postMessage({message:e,data:n},r)}},{key:"listen",value:function(){var t=this;window.addEventListener("message",(function(e){if(!(0=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Qi(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Ra(t,e){if(t){if("string"==typeof t)return _a(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_a(t,e):void 0}}function _a(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);ne.interaction.defaultIntersectionRatio||1s||1e.interaction.firstTimeSeenTimeout)throw new Error('The option "interaction.firstTimeSeenTimeout" must be a int with a minimum value of 500, "'.concat(e.interaction.firstTimeSeenTimeout,'" passed.'));if("object"!==m(e.metrics))throw new Error('The option "metrics" must be an object of the format { receiver: null|string|function|array, disabledEvents: array }, '.concat(e.metrics," passed."));if(null!==e.metrics.receiver&&-1===["string","function"].indexOf(m(e.metrics.receiver))&&!Array.isArray(e.metrics.receiver))throw new Error('The option "metrics.receiver" must be a null or a string or a function or an array of strings|functions, "'.concat(e.metrics.receiver,'" passed.'));if(Array.isArray(e.metrics.receiver)){for(var p in e.metrics.receiver)if(-1===["string","function"].indexOf(m(e.metrics.receiver[p])))throw new Error('The option "metrics.receiver.'.concat(p,'" must be a string or a function, "').concat(e.metrics.receiver[p],'" passed.'))}else e.metrics.receiver=null!==e.metrics.receiver?[e.metrics.receiver]:[];if(!Array.isArray(e.metrics.disabledEvents))throw new Error('The option "metrics.disabledEvents" must an array of strings (event names), "'.concat(e.metrics.disabledEvents,'" passed.'));for(var v in e.metrics.disabledEvents)if("string"!=typeof e.metrics.disabledEvents[v])throw new Error('The option "metrics.disabledEvents.'.concat(v,'" must be a string, "').concat(e.metrics.disabledEvents[v],'" passed.'));return e}(n)),Wa(this,Ua,new lo),Wa(this,La,new Ut(n.method,n.url,n.version,n.channel)),Wa(this,za,new Zt(n.url,n.version,n.channel)),Wa(this,Ha,new $r(Da(this,Ua),Jr.fromCurrentWindow(),new Oo(n.template))),Wa(this,Ga,new Qo(Da(this,Ha),Da(this,Ua),n.interaction)),Wa(this,qa,Ui.createFromReceivers(n.metrics.receiver,n.metrics.disabledEvents)),Wa(this,Va,new wi(Da(this,qa),Da(this,Ua),n.channel)),Wa(this,Ya,new Sa({origin:n.url,connectionData:{extendedConfig:{interaction:n.interaction}},bannerManager:Da(this,Ha),metricsSender:Da(this,qa)})),this.setLocale(n.locale),Da(this,La).origin=n.origin,n.resources)Da(this,La).addDefaultResource(a,n.resources[a]),Da(this,za).addDefaultResource(a,n.resources[a]);window.addEventListener("resize",(function(){var t,e=Aa(Da(i,Ha).getBannersByState({state:Da(i,Ha).STATE.RENDERED,managed:!0,external:!0,embed:!1}));try{for(e.s();!(t=e.n()).done;){t.value.redrawIfNeeded()}}catch(t){e.e(t)}finally{e.f()}})),Da(this,Ya).listen(),Da(this,Va).attach(),Da(this,Ga).start()}var e,n,r;return e=t,n=[{key:"version",get:function(){return Da(this,xa)}},{key:"on",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return Da(this,Ua).subscribe(t,e,n)}},{key:"setLocale",value:function(t){Da(this,La).locale=t,Da(this,za).locale=t}},{key:"setGateway",value:function(t){if(!function(t){return t instanceof S}(t))throw new TypeError("Argument gateway mut be instance of AbstractGateway.");Wa(this,$a,t)}},{key:"getGateway",value:function(){return null===Da(this,$a)&&this.setGateway(new et),Da(this,$a)}},{key:"createBanner",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"managed";if(t=Ar(t),"embed"===o){var i=function(t,e,n){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return n}(this,Ka,Xa).call(this,t,e,n,r),a=Da(this,Ha).addEmbedBanner(i,e,r);return Da(this,Ya).connectBanner(a),t.insertAdjacentElement("afterend",i),t.remove(),a}return Da(this,Ha).addManagedBanner(t,e,n,r)}},{key:"attachBanners",value:function(){var t,e=Aa((arguments.length>0&&void 0!==arguments[0]?arguments[0]:document).querySelectorAll("[data-amp-banner]:not([data-amp-attached])"));try{for(e.s();!(t=e.n()).done;){var n=t.value,r=n.dataset.ampBanner;if(r){var o=void 0;if("ampBannerExternal"in n.dataset)o=Da(this,Ha).addExternalBanner(n);else{var i=Zn.parseResources(n),a=Zn.parseOptions(n),u=n.dataset.ampMode||"managed";o=this.createBanner(n,r,i,a,u)}Da(this,Ua).dispatch(this.EVENTS.ON_BANNER_ATTACHED,o)}else console.warn("Unable to attach a banner to the element ",n,' because the attribute "data-amp-banner" has an empty value.')}}catch(t){e.e(t)}finally{e.f()}}},{key:"fetch",value:function(){var t=this,e=Da(this,Ha).getBannersByState({state:Da(this,Ha).STATE.NEW,managed:!0,external:!1,embed:!1});if(e.length){var n,r=Da(this,La).create(),o=Aa(e);try{for(o.s();!(n=o.n()).done;){var i=n.value;r.addPosition(i.position,i.resources,"1"!==i.options.get("omit-default-resources","0").toString())}}catch(t){o.e(t)}finally{o.f()}Da(this,Ua).dispatch(this.EVENTS.ON_BEFORE_FETCH),this.getGateway().fetch(r,(function(n){var r,o=n.data,i=Aa(e);try{for(i.s();!(r=i.n()).done;){var a=r.value;if(a.position in o&&"banners"in o[a.position]&&Object.values(o[a.position].banners).length){var u=o[a.position];Array.isArray(u.banners)||(u.banners=Object.values(u.banners)),"embed"!==u.mode?a.setResponseData(u):(t.createBanner(a.element,a.position,a.rawResources,a.options.options,u.mode),Da(t,Ha).removeBanner(a))}else a.setState(Da(t,Ha).STATE.NOT_FOUND,"Banner not found in fetched response.")}}catch(t){i.e(t)}finally{i.f()}Da(t,Ua).dispatch(t.EVENTS.ON_FETCH_SUCCESS,n)}),(function(n){var r,o=Aa(e);try{for(o.s();!(r=o.n()).done;)r.value.setState(Da(t,Ha).STATE.ERROR,"Request on api failed.")}catch(t){o.e(t)}finally{o.f()}Da(t,Ua).dispatch(t.EVENTS.ON_FETCH_ERROR,n)}))}}}],n&&Ia(e.prototype,n),r&&Ia(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Xa(t,e,n,r){var o=document.createElement("iframe"),i="cv=".concat(encodeURIComponent(this.version.semver)),a=t.dataset.ampEmbedSrc||Da(this,za).create(e,n,r);return a+=-1===a.indexOf("?")?"?".concat(i):"&".concat(i),Na(t.attributes).map((function(t){var e=t.name,n=t.value;o.setAttribute(e,n)})),o.width="100%",o.height="100%",o.allowFullscreen=!0,o.scrolling="no",o.style.border="none",o.style.overflow="hidden",o.style.background="transparent",o.style.visibility="hidden",o.src=a,o.setAttribute("allowtransparency","true"),"lazy"===r.loading&&(o.loading="lazy"),o}function Qa(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,u=[],l=!0,c=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(u.push(r.value),u.length!==e);l=!0);}catch(t){c=!0,o=t}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return u}}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return Za(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Za(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Za(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);ne.interaction.defaultIntersectionRatio||1a||1e.interaction.firstTimeSeenTimeout)throw new Error('The option "interaction.firstTimeSeenTimeout" must be a int with a minimum value of 500, "'.concat(e.interaction.firstTimeSeenTimeout,'" passed.'));return e}function ru(t){return ru="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ru(t)}function ou(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return iu(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return iu(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function iu(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Cu(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n2&&void 0!==arguments[2]?arguments[2]:null;return Fu(this,Gu).subscribe(t,e,n)}},{key:"attachBanner",value:function(){if(Fu(this,Xu))throw new Error("Method attachBanner() should be called only once.");var t=document.querySelector("[data-amp-banner]:not([data-amp-attached])");if(t){var e=Fu(this,qu).addExternalBanner(t);Uu(this,Xu,!0),window.self!==window.top&&e.delegateResponsiveBehaviour(),Fu(this,Gu).dispatch(this.EVENTS.ON_BANNER_ATTACHED,e)}else console.warn("No banner not found in the embed client.")}}],n&&Mu(e.prototype,n),r&&Mu(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function nl(t,e){Fu(this,Vu).sendToParent("metrics",{eventName:t,eventArgs:e})}function rl(){var t,e=Iu(Fu(this,qu).getBannersByState({state:ne.RENDERED}));try{for(e.s();!(t=e.n()).done;){t.value.redrawIfNeeded()}}catch(t){e.e(t)}finally{e.f()}}function ol(t){return ol="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ol(t)}function il(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};return new Ja(new p(al,"standard@".concat(al)),t)}},{key:"createEmbed",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new el(new p(al,"embed@".concat(al)),t)}},{key:"version",get:function(){return al}}],(n=null)&&il(e.prototype,n),r&&il(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();AMPClientFactory=e.default})(); \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 5400062..28f5810 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@68publishers/amp-client", - "version": "1.5.0-beta.3", + "version": "1.5.0-beta.4", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@68publishers/amp-client", - "version": "1.5.0-beta.3", + "version": "1.5.0-beta.4", "license": "ISC", "dependencies": { "lodash": "^4.17.21", diff --git a/package.json b/package.json index b8bf346..ad9f56a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@68publishers/amp-client", - "version": "1.5.0-beta.3", + "version": "1.5.0-beta.4", "description": "JS Client for 68publishers/amp", "homepage": "http://www.68publishers.io/", "main": "index.mjs",