From 6f94b6eeecbb83c59254c68d59be69a916458c39 Mon Sep 17 00:00:00 2001 From: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 3 Sep 2024 12:38:10 +0000 Subject: [PATCH] chore: release v1.6.0-beta.4 --- dist/amp-client.min.js | 2 +- dist/amp-client.standalone.min.js | 2 +- package-lock.json | 4 ++-- package.json | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/dist/amp-client.min.js b/dist/amp-client.min.js index dc5b803..e6f7697 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,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),h=n(9881);t.exports=function(t,e,n,m,w,g,S){var E=d(t,n),j=d(e,n),T=S.get(j);if(T)r(t,n,T);else{var O=g?g(E,j,n+"",t,e,S):void 0,k=void 0===O;if(k){var P=l(j),_=!P&&f(j),A=!P&&!_&&b(j);O=j,P||_||A?l(E)?O=E:s(E)?O=a(E):_?(k=!1,O=o(j,!0)):A?(k=!1,O=i(j,!0)):O=[]:v(j)||c(j)?(O=E,c(E)?O=h(E):y(E)&&!p(E)||(O=u(j))):k=!1}k&&(S.set(j,O),w(O,j,m,g,S),S.delete(j)),r(t,n,O)}}},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,h=/[()=,{}\[\]\/\s]/,m=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/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,O=r({},e.imports,E.imports,a),k=s(O),P=i(O,k),_=0,A=e.interpolate||w,N="__p += '",R=RegExp((e.escape||w).source+"|"+A.source+"|"+(A===f?m: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 x=S.call(e,"variable")&&e.variable;if(x){if(h.test(x))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("+(x||"obj")+") {\n"+(x?"":"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 M=o((function(){return Function(k,I+"return "+N).apply(void 0,P)}));if(M.source=N,c(M))throw M;return M}},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:()=>gc});var t={};n.r(t),n.d(t,{exclude:()=>G,extract:()=>F,parse:()=>L,parseUrl:()=>z,pick:()=>H,stringify:()=>U,stringifyUrl:()=>$});const e=JSON.parse('{"i8":"1.6.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 %>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 <% var loading; if(loading = banner.options.evaluate(\'loading\', 0)) { %>loading="<%- loading %>"<% } %>\n <% var fetchPriority; if(fetchPriority = banner.options.evaluate(\'fetchpriority\', 0)) { %>fetchpriority="<%- fetchPriority %>"<% } %>>\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 x(t){if("string"!=typeof t||1!==t.length)throw new TypeError("arrayFormatSeparator must be single character string")}function M(t,e){return e.encode?e.strict?R(t):encodeURIComponent(t):t}function C(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 L(t,e){x((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&&C(n,t).includes(t.arrayFormatSeparator);n=i?C(n,t):n;const a=o||i?n.split(t.arrayFormatSeparator).map((e=>C(e,t))):null===n?n:C(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?C(n,t):n);const i=null===n?[]:n.split(t.arrayFormatSeparator).map((e=>C(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:C(a,e),n(C(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 U(t,e){if(!t)return"";x((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,[M(e,t),"[",o,"]"].join("")]:[...n,[M(e,t),"[",M(o,t),"]=",M(r,t)].join("")]};case"bracket":return e=>(n,r)=>void 0===r||t.skipNull&&null===r||t.skipEmptyString&&""===r?n:null===r?[...n,[M(e,t),"[]"].join("")]:[...n,[M(e,t),"[]=",M(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,[M(e,t),":list="].join("")]:[...n,[M(e,t),":list=",M(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?[[M(n,t),e,M(o,t)].join("")]:[[r,M(o,t)].join(t.arrayFormatSeparator)])}default:return e=>(n,r)=>void 0===r||t.skipNull&&null===r||t.skipEmptyString&&""===r?n:null===r?[...n,M(e,t)]:[...n,[M(e,t),"=",M(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?M(n,e):Array.isArray(o)?0===o.length&&"bracket-separator"===e.arrayFormat?M(n,e)+"[]":o.reduce(r(n),[]).join("&"):M(n,e)+"="+M(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:L(F(t),e),...e&&e.parseFragmentIdentifier&&r?{fragmentIdentifier:C(r,e)}:{}}}function $(t,e){e={encode:!0,strict:!0,[I]:!0,...e};const n=W(t.url).split("?")[0]||"";let r=U({...L(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 V=t;function q(t){return q="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},q(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(V.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,Ot,{writable:!0,value:void 0}),dt(this,kt,{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}}),mt(this,gt,e),mt(this,St,n),mt(this,Et,r),mt(this,jt,{}),mt(this,Tt,o),mt(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,jt);if(t in r)throw new Error('Position "'+t+'" already exists.');r[t]={},n&&this.addPositionResources(t,ht(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=ht(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 ht(this,gt)}},{key:"endpoint",get:function(){return ht(this,St)}},{key:"locale",get:function(){return ht(this,Et)}},{key:"parameters",get:function(){var t=ht(this,kt).call(this,ht(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 ht(this,Ot)}}],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;e]+)>/g,(function(t,e){var n=i[e];return"$"+(Array.isArray(n)?n.join("$"):n)})))}if("function"==typeof o){var a=this;return t[Symbol.replace].call(this,n,(function(){var t=arguments;return"object"!=ce(t[t.length-1])&&(t=[].slice.call(t)).push(r(t,a)),o.apply(this,t)}))}return t[Symbol.replace].call(this,n,o)},le.apply(this,arguments)}function se(t,e){return se=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},se(t,e)}var fe=le(/^(?:(\d+)\x2D(\d+):|(\d+):|<(\d+):|<=(\d+):|>(\d+):|>=(\d+):)?([^:\s]+)$/,{INTERVAL_FROM:1,INTERVAL_TO:2,EQ:3,LT:4,LTE:5,GT:6,GTE:7,VALUE:8}),pe={};function ye(t,e){var n=function(t){if(t in pe)return pe[t];for(var e=t.split(",").map((function(t){return t.trim()})),n=[],r=0;r=this.from&&t<=this.to}};break;case void 0!==o.groups.EQ:i={eq:parseInt(o.groups.EQ),matches:function(t){return t===this.eq}};break;case void 0!==o.groups.LT:i={lt:parseInt(o.groups.LT),matches:function(t){return tthis.gt}};break;case void 0!==o.groups.GTE:i={gte:parseInt(o.groups.GTE),matches:function(t){return t>=this.gte}};break;default:i={matches:function(){return!0}}}i&&(i.matches=i.matches.bind(i),i.value=o.groups.VALUE,n.push(i))}}var a={rules:n,cache:{}};return a.evaluate=function(t){Number.isInteger(t)||(t=parseInt(t));var e="i_".concat(t);if(e in this.cache)return this.cache[e];for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:void 0;return this.options[t]||e}},{key:"evaluate",value:function(t,e){return void 0===this.options[t]?null:ye(this.options[t],e)}},{key:"override",value:function(t){this.options=de(de({},this.options),Se(this,Ee,Te).call(this,de({},t)))}}],n&&me(e.prototype,n),r&&me(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Te(t){if("loading-offset"in t){var e=t["loading-offset"],n="loading"in t?t.loading:"loading"in this.options?this.options.loading:null,r=null!==n?">=".concat(e,":").concat(n):null,o='AMP deprecation warning: The banner option "loading-offset" is deprecated and will be removed in some future release.';null!==r&&(o+=' Instead of options {"loading": "'.concat(n,'", "loading-offset": "').concat(e,'"} use an expression based option {"loading": "').concat(r,'"}.')),console.warn(o),delete t["loading-offset"],null!==r&&(t.loading=r)}return t}function Oe(t){return Oe="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},Oe(t)}function ke(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."));Ae(this,Me,t),Ae(this,Ce,e.toString()),_e(this,De)[t]=(_e(this,De)[t]||0)+1,this._eventBus.dispatch(oe.ON_BANNER_STATE_CHANGED,this)}},{key:"getCurrenBreakpoint",value:function(t){return null}},{key:"overrideOptions",value:function(t){_e(this,xe).override(t)}},{key:"redrawIfNeeded",value:function(){}},{key:"isManaged",value:function(){return!1}},{key:"isExternal",value:function(){return!1}},{key:"isEmbed",value:function(){return!1}}],n&&ke(e.prototype,n),r&&ke(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Be(t){return Be="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},Be(t)}function Fe(t,e){for(var n=0;n=c&&(null===i||ic))&&(o=u,i=c,tn(t,cn)[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&&(tn(this,cn).min=a[u-1]),"min"===n&&u+1 in a&&(tn(this,cn).max=a[u+1]),en(this,un,null!==o?o:r)}},{key:"needRedraw",value:function(){if(null===tn(this,un))return!0;var t=tn(this,rn).width;return null!==tn(this,cn).min&&ttn(this,cn).max}}])&&Qe(e.prototype,n),r&&Qe(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function fn(t,e){for(var n in t)e(t[n],n)}function pn(t){return pn="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},pn(t)}function yn(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 vn(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 vn(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 vn(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)&&xn(e.prototype,n),r&&xn(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Cn(t){return Cn="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},Cn(t)}function Dn(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 Wn(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 Wn(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 Wn(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),$n(Un(c=o.call(this,n,r,a,u,s)),or),$n(Un(c),rr),Hn(Un(c),Jn,{writable:!0,value:void 0}),Hn(Un(c),Qn,{writable:!0,value:void 0}),Hn(Un(c),Xn,{writable:!0,value:[]}),Hn(Un(c),Zn,{writable:!0,value:void 0}),Hn(Un(c),tr,{writable:!0,value:!1}),Hn(Un(c),er,{writable:!0,value:null}),Hn(Un(c),nr,{writable:!0,value:[]}),Yn(Un(c),Jn,t),Yn(Un(c),Qn,e),Yn(Un(c),Zn,l),l)qn(Un(c),Xn).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 qn(this,Xn)}},{key:"rawResources",get:function(){return qn(this,Zn)}},{key:"data",get:function(){return console.warn("Usage of deprecated property `ManagedBanner.data`. Please use property `positionData` for accessing information about a position."),new Rn(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!==qn(this,er))return qn(this,er);if(!qn(this,nr).length)throw new Error("Banner's data is empty.");var t=null,e=this.positionData,n=function(t){return Le.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=qn(this,nr).reduce((function(t,e){return t.score>=e.score?t:e}))).fingerprint=n(t);break;case e.isRandom():(t=Mn.randomByWeights(qn(this,nr),"score")).fingerprint=n(t);break;case e.isMultiple():var r,o=Dn(t=qn(this,nr).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 Yn(this,er,t),t}},{key:"setResponseData",value:function(t){if(qn(this,tr))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}}),"options"in t&&this.overrideOptions(t.options);var e=[];for(var n in t.banners||[])e.push(new jn(t.banners[n],t.breakpoint_type,qn(this,Jn)));Yn(this,nr,e),Yn(this,tr,!0),Vn(this,rr,ar).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(){Vn(this,or,ur).call(this)&&Vn(this,rr,ar).call(this,"Banner was successfully redrawn.")}}])&&Bn(e.prototype,n),r&&Bn(e,r),Object.defineProperty(e,"prototype",{writable:!1}),i}(We);function ar(t){try{this.html=qn(this,Qn).render(this)}catch(t){return void this.setState(this.STATE.ERROR,"Render error: "+t.message)}this.setState(this.STATE.RENDERED,t)}function ur(){var t=this.bannerData;for(var e in Array.isArray(t)||(t=[t]),t)if(t[e].needRedraw())return!0;return!1}function cr(t){return cr="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},cr(t)}function lr(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 sr(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 sr(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 sr(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 br(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),Wr(this,Lr,{writable:!0,value:void 0}),Br(this,Lr,e-1)}var e,n,r;return e=t,(n=[{key:"getNextIdentifier",value:function(){var t,e;return Br(this,Lr,(t=function(t,e){return e.get?e.get.call(t):e.value}(e=this,Fr(e,Lr,"get")),++t))}}])&&Dr(e.prototype,n),r&&Dr(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function zr(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 $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){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 Gr(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 Gr(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 Gr(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),qr(this,Qr,{writable:!0,value:void 0}),qr(this,Xr,{writable:!0,value:void 0}),qr(this,Zr,{writable:!0,value:void 0}),qr(this,to,{writable:!0,value:void 0}),qr(this,eo,{writable:!0,value:[]}),Kr(this,Qr,e),Kr(this,Xr,n),Kr(this,Zr,r),Kr(this,to,new Ur),this.STATE=ee}var e,n,r;return e=t,n=[{key:"addExternalBanner",value:function(t){(t=zr(t)).setAttribute("data-amp-attached","");var e=new _r(Yr(this,Xr),Yr(this,Qr),Yr(this,to).getNextIdentifier(),t);return Yr(this,eo).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===Yr(this,Zr))throw new Error("Unable to add managed banner, renderer is not provided.");(t=zr(t)).setAttribute("data-amp-attached","");var o=new ir(Yr(this,Xr),Yr(this,Zr),Yr(this,Qr),Yr(this,to).getNextIdentifier(),t,e,n,r);return Yr(this,eo).push(o),o}},{key:"addEmbedBanner",value:function(t,e,n){(t=zr(t)).setAttribute("data-amp-attached","");var r=new Mr(Yr(this,Qr),Yr(this,to).getNextIdentifier(),t,e,n);return Yr(this,eo).push(r),r}},{key:"removeBanner",value:function(t){var e=Yr(this,eo).length;return Kr(this,eo,Yr(this,eo).filter((function(e){return e!==t}))),e!==Yr(this,eo).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 Yr(this,eo).filter((function(t){return t instanceof We&&t.state===e&&!(t instanceof ir&&!r||t instanceof _r&&!i||t instanceof Mr&&!u)}))}},{key:"getBannerByFingerprint",value:function(t){var e,n=t instanceof Le?t.value:t,r=Hr(Yr(this,eo));try{for(r.s();!(e=r.n()).done;){var o=e.value;if(!(o instanceof Mr)){var i,a=Hr(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=Hr(Yr(this,eo));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&&Vr(e.prototype,n),r&&Vr(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function ro(t){return ro="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},ro(t)}function oo(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 po(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_"+bo(this,wo).getNextIdentifier();return bo(this,go)[t]=bo(this,go)[t]||{},bo(this,go)[t][i]={callback:e,scope:r,priority:o},t in bo(this,So)&&delete bo(this,So)[t],function(){t in bo(n,go)&&i in bo(n,go)[t]&&delete bo(n,go)[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 Go(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=Ho(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(zo(zo({},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 h=.99<=f.intersectionRatio;l[p]=!(p in l)||!l[p].isFullyIntersecting&&h?{fingerprintArgs:b,fingerprintMetadata:v,isFullyIntersecting:h}:l[p]}}}}}catch(t){s.e(t)}finally{s.f()}for(var m=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 Qo(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 Si(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(bi.BANNER_LOADED)&&t.subscribe(oe.ON_BANNER_STATE_CHANGED,(function(t){if(!t.isEmbed()&&ee.RENDERED===t.state&&1===t.stateCounter){var e,o=gi(t.fingerprints);try{for(o.s();!(e=o.n()).done;){var i=e.value;n.send(bi.BANNER_LOADED,r(i,t))}}catch(t){o.e(t)}finally{o.f()}}})),n.isEventEnabled(bi.BANNER_DISPLAYED)&&t.subscribe(oe.ON_BANNER_FIRST_TIME_SEEN,(function(t){var e=t.fingerprint,o=t.banner;n.send(bi.BANNER_DISPLAYED,r(e,o))})),n.isEventEnabled(bi.BANNER_FULLY_DISPLAYED)&&t.subscribe(oe.ON_BANNER_FIRST_TIME_FULLY_SEEN,(function(t){var e=t.fingerprint,o=t.banner;n.send(bi.BANNER_FULLY_DISPLAYED,r(e,o))})),n.isEventEnabled(bi.BANNER_CLICKED)&&t.subscribe(oe.ON_BANNER_LINK_CLICKED,(function(t){var e=t.fingerprint,o=t.banner,i=t.target;n.send(bi.BANNER_CLICKED,mi(mi({},r(e,o)),{},{link:i.href||""}))}))}}}}])&&Ei(e.prototype,n),r&&Ei(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}(),xi=!1;const Mi=function(t,e){if(!("plausible"in window)||"function"!=typeof window.plausible)return!xi&&console.warn("Unable to send metrics to Plausible because the function plausible() does not occur in the window."),void(xi=!0);Object.keys(e).forEach((function(t){return null===e[t]&&delete e[t]})),window.plausible(t,{props:e})};var Ci=!1;const Di=function(t,e){if(!("gtag"in window)||"function"!=typeof window.gtag)return!Ci&&console.warn("Unable to send metrics to Google Analytics because the function gtag() does not occur in the window."),void(Ci=!0);Object.keys(e).forEach((function(t){return null===e[t]&&delete e[t]})),window.gtag("event",t,e)};function Wi(t){return Wi="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},Wi(t)}function Bi(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 Fi(t,e,n){return(e=function(t){var e=function(t,e){if("object"!==Wi(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!==Wi(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Wi(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Li=!1;const Ui=function(t,e){if(!("dataLayer"in window))return!Li&&console.warn("Unable to send metrics to GTM because the dataLayer does not occur in the window."),void(Li=!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 Gi(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 fa(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 $a(t,e){if(t){if("string"==typeof t)return Ha(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)?Ha(t,e):void 0}}function Ha(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"!==h(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(h(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(h(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)),Ka(this,Za,new Eo),Ka(this,tu,new Ft(n.method,n.url,n.version,n.channel)),Ka(this,eu,new Xt(n.url,n.version,n.channel)),Ka(this,ru,new no(Ya(this,Za),lo.fromCurrentWindow(),new Fo(n.template))),Ka(this,ou,new fi(Ya(this,ru),Ya(this,Za),n.interaction)),Ka(this,iu,Zi.createFromReceivers(n.metrics.receiver,n.metrics.disabledEvents)),Ka(this,au,new Ii(Ya(this,iu),Ya(this,Za),n.channel)),Ka(this,uu,new Ma({origin:n.url,connectionData:{extendedConfig:{interaction:n.interaction}},bannerManager:Ya(this,ru),metricsSender:Ya(this,iu)})),this.setLocale(n.locale),Ya(this,tu).origin=n.origin,n.resources)Ya(this,tu).addDefaultResource(a,n.resources[a]),Ya(this,eu).addDefaultResource(a,n.resources[a]);window.addEventListener("resize",(function(){var t,e=za(Ya(i,ru).getBannersByState({state:Ya(i,ru).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()}})),Ya(this,uu).listen(),Ya(this,au).attach(),Ya(this,ou).start()}var e,n,r;return e=t,n=[{key:"version",get:function(){return Ya(this,Qa)}},{key:"on",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return Ya(this,Za).subscribe(t,e,n)}},{key:"setLocale",value:function(t){Ya(this,tu).locale=t,Ya(this,eu).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.");Ka(this,nu,t)}},{key:"getGateway",value:function(){return null===Ya(this,nu)&&this.setGateway(new tt),Ya(this,nu)}},{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=zr(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,cu,su).call(this,t,e,n,r),a=Ya(this,ru).addEmbedBanner(i,e,r);return Ya(this,uu).connectBanner(a),t.insertAdjacentElement("afterend",i),t.remove(),a}return Ya(this,ru).addManagedBanner(t,e,n,r)}},{key:"attachBanners",value:function(){var t,e=za((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=Ya(this,ru).addExternalBanner(n);else{var i=pr.parseResources(n),a=pr.parseOptions(n),u=n.dataset.ampMode||"managed";o=this.createBanner(n,r,i,a,u)}Ya(this,Za).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=Ya(this,ru).getBannersByState({state:Ya(this,ru).STATE.NEW,managed:!0,external:!1,embed:!1});if(e.length){var n,r=Ya(this,tu).create(),o=za(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()}Ya(this,Za).dispatch(this.EVENTS.ON_BEFORE_FETCH),this.getGateway().fetch(r,(function(n){var r,o=n.data,i=za(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):("options"in u&&a.overrideOptions(u.options),t.createBanner(a.element,a.position,a.rawResources,a.options.options,u.mode),Ya(t,ru).removeBanner(a))}else a.setState(Ya(t,ru).STATE.NOT_FOUND,"Banner not found in fetched response.")}}catch(t){i.e(t)}finally{i.f()}Ya(t,Za).dispatch(t.EVENTS.ON_FETCH_SUCCESS,n)}),(function(n){var r,o=za(e);try{for(o.s();!(r=o.n()).done;)r.value.setState(Ya(t,ru).STATE.ERROR,"Request on api failed.")}catch(t){o.e(t)}finally{o.f()}Ya(t,Za).dispatch(t.EVENTS.ON_FETCH_ERROR,n)}))}}}],n&&Ga(e.prototype,n),r&&Ga(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function su(t,e,n,r){var o=document.createElement("iframe"),i="cv=".concat(encodeURIComponent(this.version.semver)),a=new je(r),u=t.dataset.ampEmbedSrc||Ya(this,eu).create(e,n,a.options);u+=-1===u.indexOf("?")?"?".concat(i):"&".concat(i),Ua(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=u,o.setAttribute("allowtransparency","true");var c=a.evaluate("loading",0),l=a.evaluate("fetchpriority",0);return null!==c&&(o.loading=c),null!==l&&o.setAttribute("fetchpriority",l),o}function fu(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 pu(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 pu(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 pu(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 du(t){return du="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},du(t)}function hu(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 mu(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 mu(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 mu(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 Vu(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 Xu(this,oc).subscribe(t,e,n)}},{key:"attachBanner",value:function(){if(Xu(this,sc))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=Xu(this,ic).addExternalBanner(t);Zu(this,sc,!0),window.self!==window.top&&e.delegateResponsiveBehaviour(),Xu(this,oc).dispatch(this.EVENTS.ON_BANNER_ATTACHED,e)}else console.warn("No banner not found in the embed client.")}}],n&&qu(e.prototype,n),r&&qu(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function bc(t,e){Xu(this,ac).sendToParent("metrics",{eventName:t,eventArgs:e})}function dc(){var t,e=Gu(Xu(this,ic).getBannersByState({state:ee.RENDERED}));try{for(e.s();!(t=e.n()).done;){t.value.redrawIfNeeded()}}catch(t){e.e(t)}finally{e.f()}}function hc(t){return hc="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},hc(t)}function mc(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};return new lu(new p(wc,"standard@".concat(wc)),t)}},{key:"createEmbed",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new vc(new p(wc,"embed@".concat(wc)),t)}},{key:"version",get:function(){return wc}}],(n=null)&&mc(e.prototype,n),r&&mc(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),h=n(9881);t.exports=function(t,e,n,m,w,g,S){var E=d(t,n),j=d(e,n),T=S.get(j);if(T)r(t,n,T);else{var O=g?g(E,j,n+"",t,e,S):void 0,k=void 0===O;if(k){var P=l(j),_=!P&&f(j),A=!P&&!_&&b(j);O=j,P||_||A?l(E)?O=E:s(E)?O=a(E):_?(k=!1,O=o(j,!0)):A?(k=!1,O=i(j,!0)):O=[]:v(j)||c(j)?(O=E,c(E)?O=h(E):y(E)&&!p(E)||(O=u(j))):k=!1}k&&(S.set(j,O),w(O,j,m,g,S),S.delete(j)),r(t,n,O)}}},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,h=/[()=,{}\[\]\/\s]/,m=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/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,O=r({},e.imports,E.imports,a),k=s(O),P=i(O,k),_=0,A=e.interpolate||w,N="__p += '",R=RegExp((e.escape||w).source+"|"+A.source+"|"+(A===f?m: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 x=S.call(e,"variable")&&e.variable;if(x){if(h.test(x))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("+(x||"obj")+") {\n"+(x?"":"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 M=o((function(){return Function(k,I+"return "+N).apply(void 0,P)}));if(M.source=N,c(M))throw M;return M}},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:()=>gc});var t={};n.r(t),n.d(t,{exclude:()=>G,extract:()=>F,parse:()=>L,parseUrl:()=>z,pick:()=>H,stringify:()=>U,stringifyUrl:()=>$});const e=JSON.parse('{"i8":"1.6.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 <% var loading; if(loading = banner.options.evaluate(\'loading\', 0)) { %>loading="<%- loading %>"<% } %>\n <% var fetchPriority; if(fetchPriority = banner.options.evaluate(\'fetchpriority\', 0)) { %>fetchpriority="<%- fetchPriority %>"<% } %>>\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 x(t){if("string"!=typeof t||1!==t.length)throw new TypeError("arrayFormatSeparator must be single character string")}function M(t,e){return e.encode?e.strict?R(t):encodeURIComponent(t):t}function C(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 L(t,e){x((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&&C(n,t).includes(t.arrayFormatSeparator);n=i?C(n,t):n;const a=o||i?n.split(t.arrayFormatSeparator).map((e=>C(e,t))):null===n?n:C(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?C(n,t):n);const i=null===n?[]:n.split(t.arrayFormatSeparator).map((e=>C(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:C(a,e),n(C(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 U(t,e){if(!t)return"";x((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,[M(e,t),"[",o,"]"].join("")]:[...n,[M(e,t),"[",M(o,t),"]=",M(r,t)].join("")]};case"bracket":return e=>(n,r)=>void 0===r||t.skipNull&&null===r||t.skipEmptyString&&""===r?n:null===r?[...n,[M(e,t),"[]"].join("")]:[...n,[M(e,t),"[]=",M(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,[M(e,t),":list="].join("")]:[...n,[M(e,t),":list=",M(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?[[M(n,t),e,M(o,t)].join("")]:[[r,M(o,t)].join(t.arrayFormatSeparator)])}default:return e=>(n,r)=>void 0===r||t.skipNull&&null===r||t.skipEmptyString&&""===r?n:null===r?[...n,M(e,t)]:[...n,[M(e,t),"=",M(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?M(n,e):Array.isArray(o)?0===o.length&&"bracket-separator"===e.arrayFormat?M(n,e)+"[]":o.reduce(r(n),[]).join("&"):M(n,e)+"="+M(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:L(F(t),e),...e&&e.parseFragmentIdentifier&&r?{fragmentIdentifier:C(r,e)}:{}}}function $(t,e){e={encode:!0,strict:!0,[I]:!0,...e};const n=W(t.url).split("?")[0]||"";let r=U({...L(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 V=t;function q(t){return q="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},q(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(V.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,Ot,{writable:!0,value:void 0}),dt(this,kt,{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}}),mt(this,gt,e),mt(this,St,n),mt(this,Et,r),mt(this,jt,{}),mt(this,Tt,o),mt(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,jt);if(t in r)throw new Error('Position "'+t+'" already exists.');r[t]={},n&&this.addPositionResources(t,ht(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=ht(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 ht(this,gt)}},{key:"endpoint",get:function(){return ht(this,St)}},{key:"locale",get:function(){return ht(this,Et)}},{key:"parameters",get:function(){var t=ht(this,kt).call(this,ht(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 ht(this,Ot)}}],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;e]+)>/g,(function(t,e){var n=i[e];return"$"+(Array.isArray(n)?n.join("$"):n)})))}if("function"==typeof o){var a=this;return t[Symbol.replace].call(this,n,(function(){var t=arguments;return"object"!=ce(t[t.length-1])&&(t=[].slice.call(t)).push(r(t,a)),o.apply(this,t)}))}return t[Symbol.replace].call(this,n,o)},le.apply(this,arguments)}function se(t,e){return se=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},se(t,e)}var fe=le(/^(?:(\d+)\x2D(\d+):|(\d+):|<(\d+):|<=(\d+):|>(\d+):|>=(\d+):)?([^:\s]+)$/,{INTERVAL_FROM:1,INTERVAL_TO:2,EQ:3,LT:4,LTE:5,GT:6,GTE:7,VALUE:8}),pe={};function ye(t,e){var n=function(t){if(t in pe)return pe[t];for(var e=t.split(",").map((function(t){return t.trim()})),n=[],r=0;r=this.from&&t<=this.to}};break;case void 0!==o.groups.EQ:i={eq:parseInt(o.groups.EQ),matches:function(t){return t===this.eq}};break;case void 0!==o.groups.LT:i={lt:parseInt(o.groups.LT),matches:function(t){return tthis.gt}};break;case void 0!==o.groups.GTE:i={gte:parseInt(o.groups.GTE),matches:function(t){return t>=this.gte}};break;default:i={matches:function(){return!0}}}i&&(i.matches=i.matches.bind(i),i.value=o.groups.VALUE,n.push(i))}}var a={rules:n,cache:{}};return a.evaluate=function(t){Number.isInteger(t)||(t=parseInt(t));var e="i_".concat(t);if(e in this.cache)return this.cache[e];for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:void 0;return this.options[t]||e}},{key:"evaluate",value:function(t,e){return void 0===this.options[t]?null:ye(this.options[t],e)}},{key:"override",value:function(t){this.options=de(de({},this.options),Se(this,Ee,Te).call(this,de({},t)))}}],n&&me(e.prototype,n),r&&me(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Te(t){if("loading-offset"in t){var e=t["loading-offset"],n="loading"in t?t.loading:"loading"in this.options?this.options.loading:null,r=null!==n?">=".concat(e,":").concat(n):null,o='AMP deprecation warning: The banner option "loading-offset" is deprecated and will be removed in some future release.';null!==r&&(o+=' Instead of options {"loading": "'.concat(n,'", "loading-offset": "').concat(e,'"} use an expression based option {"loading": "').concat(r,'"}.')),console.warn(o),delete t["loading-offset"],null!==r&&(t.loading=r)}return t}function Oe(t){return Oe="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},Oe(t)}function ke(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."));Ae(this,Me,t),Ae(this,Ce,e.toString()),_e(this,De)[t]=(_e(this,De)[t]||0)+1,this._eventBus.dispatch(oe.ON_BANNER_STATE_CHANGED,this)}},{key:"getCurrenBreakpoint",value:function(t){return null}},{key:"overrideOptions",value:function(t){_e(this,xe).override(t)}},{key:"redrawIfNeeded",value:function(){}},{key:"isManaged",value:function(){return!1}},{key:"isExternal",value:function(){return!1}},{key:"isEmbed",value:function(){return!1}}],n&&ke(e.prototype,n),r&&ke(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Be(t){return Be="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},Be(t)}function Fe(t,e){for(var n=0;n=c&&(null===i||ic))&&(o=u,i=c,tn(t,cn)[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&&(tn(this,cn).min=a[u-1]),"min"===n&&u+1 in a&&(tn(this,cn).max=a[u+1]),en(this,un,null!==o?o:r)}},{key:"needRedraw",value:function(){if(null===tn(this,un))return!0;var t=tn(this,rn).width;return null!==tn(this,cn).min&&ttn(this,cn).max}}])&&Qe(e.prototype,n),r&&Qe(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function fn(t,e){for(var n in t)e(t[n],n)}function pn(t){return pn="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},pn(t)}function yn(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 vn(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 vn(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 vn(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)&&xn(e.prototype,n),r&&xn(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Cn(t){return Cn="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},Cn(t)}function Dn(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 Wn(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 Wn(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 Wn(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),$n(Un(c=o.call(this,n,r,a,u,s)),or),$n(Un(c),rr),Hn(Un(c),Jn,{writable:!0,value:void 0}),Hn(Un(c),Qn,{writable:!0,value:void 0}),Hn(Un(c),Xn,{writable:!0,value:[]}),Hn(Un(c),Zn,{writable:!0,value:void 0}),Hn(Un(c),tr,{writable:!0,value:!1}),Hn(Un(c),er,{writable:!0,value:null}),Hn(Un(c),nr,{writable:!0,value:[]}),Yn(Un(c),Jn,t),Yn(Un(c),Qn,e),Yn(Un(c),Zn,l),l)qn(Un(c),Xn).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 qn(this,Xn)}},{key:"rawResources",get:function(){return qn(this,Zn)}},{key:"data",get:function(){return console.warn("Usage of deprecated property `ManagedBanner.data`. Please use property `positionData` for accessing information about a position."),new Rn(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!==qn(this,er))return qn(this,er);if(!qn(this,nr).length)throw new Error("Banner's data is empty.");var t=null,e=this.positionData,n=function(t){return Le.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=qn(this,nr).reduce((function(t,e){return t.score>=e.score?t:e}))).fingerprint=n(t);break;case e.isRandom():(t=Mn.randomByWeights(qn(this,nr),"score")).fingerprint=n(t);break;case e.isMultiple():var r,o=Dn(t=qn(this,nr).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 Yn(this,er,t),t}},{key:"setResponseData",value:function(t){if(qn(this,tr))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}}),"options"in t&&this.overrideOptions(t.options);var e=[];for(var n in t.banners||[])e.push(new jn(t.banners[n],t.breakpoint_type,qn(this,Jn)));Yn(this,nr,e),Yn(this,tr,!0),Vn(this,rr,ar).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(){Vn(this,or,ur).call(this)&&Vn(this,rr,ar).call(this,"Banner was successfully redrawn.")}}])&&Bn(e.prototype,n),r&&Bn(e,r),Object.defineProperty(e,"prototype",{writable:!1}),i}(We);function ar(t){try{this.html=qn(this,Qn).render(this)}catch(t){return void this.setState(this.STATE.ERROR,"Render error: "+t.message)}this.setState(this.STATE.RENDERED,t)}function ur(){var t=this.bannerData;for(var e in Array.isArray(t)||(t=[t]),t)if(t[e].needRedraw())return!0;return!1}function cr(t){return cr="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},cr(t)}function lr(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 sr(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 sr(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 sr(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 br(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),Wr(this,Lr,{writable:!0,value:void 0}),Br(this,Lr,e-1)}var e,n,r;return e=t,(n=[{key:"getNextIdentifier",value:function(){var t,e;return Br(this,Lr,(t=function(t,e){return e.get?e.get.call(t):e.value}(e=this,Fr(e,Lr,"get")),++t))}}])&&Dr(e.prototype,n),r&&Dr(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function zr(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 $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){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 Gr(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 Gr(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 Gr(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),qr(this,Qr,{writable:!0,value:void 0}),qr(this,Xr,{writable:!0,value:void 0}),qr(this,Zr,{writable:!0,value:void 0}),qr(this,to,{writable:!0,value:void 0}),qr(this,eo,{writable:!0,value:[]}),Kr(this,Qr,e),Kr(this,Xr,n),Kr(this,Zr,r),Kr(this,to,new Ur),this.STATE=ee}var e,n,r;return e=t,n=[{key:"addExternalBanner",value:function(t){(t=zr(t)).setAttribute("data-amp-attached","");var e=new _r(Yr(this,Xr),Yr(this,Qr),Yr(this,to).getNextIdentifier(),t);return Yr(this,eo).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===Yr(this,Zr))throw new Error("Unable to add managed banner, renderer is not provided.");(t=zr(t)).setAttribute("data-amp-attached","");var o=new ir(Yr(this,Xr),Yr(this,Zr),Yr(this,Qr),Yr(this,to).getNextIdentifier(),t,e,n,r);return Yr(this,eo).push(o),o}},{key:"addEmbedBanner",value:function(t,e,n){(t=zr(t)).setAttribute("data-amp-attached","");var r=new Mr(Yr(this,Qr),Yr(this,to).getNextIdentifier(),t,e,n);return Yr(this,eo).push(r),r}},{key:"removeBanner",value:function(t){var e=Yr(this,eo).length;return Kr(this,eo,Yr(this,eo).filter((function(e){return e!==t}))),e!==Yr(this,eo).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 Yr(this,eo).filter((function(t){return t instanceof We&&t.state===e&&!(t instanceof ir&&!r||t instanceof _r&&!i||t instanceof Mr&&!u)}))}},{key:"getBannerByFingerprint",value:function(t){var e,n=t instanceof Le?t.value:t,r=Hr(Yr(this,eo));try{for(r.s();!(e=r.n()).done;){var o=e.value;if(!(o instanceof Mr)){var i,a=Hr(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=Hr(Yr(this,eo));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&&Vr(e.prototype,n),r&&Vr(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function ro(t){return ro="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},ro(t)}function oo(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 po(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_"+bo(this,wo).getNextIdentifier();return bo(this,go)[t]=bo(this,go)[t]||{},bo(this,go)[t][i]={callback:e,scope:r,priority:o},t in bo(this,So)&&delete bo(this,So)[t],function(){t in bo(n,go)&&i in bo(n,go)[t]&&delete bo(n,go)[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 Go(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=Ho(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(zo(zo({},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 h=.99<=f.intersectionRatio;l[p]=!(p in l)||!l[p].isFullyIntersecting&&h?{fingerprintArgs:b,fingerprintMetadata:v,isFullyIntersecting:h}:l[p]}}}}}catch(t){s.e(t)}finally{s.f()}for(var m=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 Qo(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 Si(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(bi.BANNER_LOADED)&&t.subscribe(oe.ON_BANNER_STATE_CHANGED,(function(t){if(!t.isEmbed()&&ee.RENDERED===t.state&&1===t.stateCounter){var e,o=gi(t.fingerprints);try{for(o.s();!(e=o.n()).done;){var i=e.value;n.send(bi.BANNER_LOADED,r(i,t))}}catch(t){o.e(t)}finally{o.f()}}})),n.isEventEnabled(bi.BANNER_DISPLAYED)&&t.subscribe(oe.ON_BANNER_FIRST_TIME_SEEN,(function(t){var e=t.fingerprint,o=t.banner;n.send(bi.BANNER_DISPLAYED,r(e,o))})),n.isEventEnabled(bi.BANNER_FULLY_DISPLAYED)&&t.subscribe(oe.ON_BANNER_FIRST_TIME_FULLY_SEEN,(function(t){var e=t.fingerprint,o=t.banner;n.send(bi.BANNER_FULLY_DISPLAYED,r(e,o))})),n.isEventEnabled(bi.BANNER_CLICKED)&&t.subscribe(oe.ON_BANNER_LINK_CLICKED,(function(t){var e=t.fingerprint,o=t.banner,i=t.target;n.send(bi.BANNER_CLICKED,mi(mi({},r(e,o)),{},{link:i.href||""}))}))}}}}])&&Ei(e.prototype,n),r&&Ei(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}(),xi=!1;const Mi=function(t,e){if(!("plausible"in window)||"function"!=typeof window.plausible)return!xi&&console.warn("Unable to send metrics to Plausible because the function plausible() does not occur in the window."),void(xi=!0);Object.keys(e).forEach((function(t){return null===e[t]&&delete e[t]})),window.plausible(t,{props:e})};var Ci=!1;const Di=function(t,e){if(!("gtag"in window)||"function"!=typeof window.gtag)return!Ci&&console.warn("Unable to send metrics to Google Analytics because the function gtag() does not occur in the window."),void(Ci=!0);Object.keys(e).forEach((function(t){return null===e[t]&&delete e[t]})),window.gtag("event",t,e)};function Wi(t){return Wi="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},Wi(t)}function Bi(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 Fi(t,e,n){return(e=function(t){var e=function(t,e){if("object"!==Wi(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!==Wi(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Wi(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Li=!1;const Ui=function(t,e){if(!("dataLayer"in window))return!Li&&console.warn("Unable to send metrics to GTM because the dataLayer does not occur in the window."),void(Li=!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 Gi(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 fa(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 $a(t,e){if(t){if("string"==typeof t)return Ha(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)?Ha(t,e):void 0}}function Ha(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"!==h(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(h(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(h(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)),Ka(this,Za,new Eo),Ka(this,tu,new Ft(n.method,n.url,n.version,n.channel)),Ka(this,eu,new Xt(n.url,n.version,n.channel)),Ka(this,ru,new no(Ya(this,Za),lo.fromCurrentWindow(),new Fo(n.template))),Ka(this,ou,new fi(Ya(this,ru),Ya(this,Za),n.interaction)),Ka(this,iu,Zi.createFromReceivers(n.metrics.receiver,n.metrics.disabledEvents)),Ka(this,au,new Ii(Ya(this,iu),Ya(this,Za),n.channel)),Ka(this,uu,new Ma({origin:n.url,connectionData:{extendedConfig:{interaction:n.interaction}},bannerManager:Ya(this,ru),metricsSender:Ya(this,iu)})),this.setLocale(n.locale),Ya(this,tu).origin=n.origin,n.resources)Ya(this,tu).addDefaultResource(a,n.resources[a]),Ya(this,eu).addDefaultResource(a,n.resources[a]);window.addEventListener("resize",(function(){var t,e=za(Ya(i,ru).getBannersByState({state:Ya(i,ru).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()}})),Ya(this,uu).listen(),Ya(this,au).attach(),Ya(this,ou).start()}var e,n,r;return e=t,n=[{key:"version",get:function(){return Ya(this,Qa)}},{key:"on",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return Ya(this,Za).subscribe(t,e,n)}},{key:"setLocale",value:function(t){Ya(this,tu).locale=t,Ya(this,eu).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.");Ka(this,nu,t)}},{key:"getGateway",value:function(){return null===Ya(this,nu)&&this.setGateway(new tt),Ya(this,nu)}},{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=zr(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,cu,su).call(this,t,e,n,r),a=Ya(this,ru).addEmbedBanner(i,e,r);return Ya(this,uu).connectBanner(a),t.insertAdjacentElement("afterend",i),t.remove(),a}return Ya(this,ru).addManagedBanner(t,e,n,r)}},{key:"attachBanners",value:function(){var t,e=za((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=Ya(this,ru).addExternalBanner(n);else{var i=pr.parseResources(n),a=pr.parseOptions(n),u=n.dataset.ampMode||"managed";o=this.createBanner(n,r,i,a,u)}Ya(this,Za).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=Ya(this,ru).getBannersByState({state:Ya(this,ru).STATE.NEW,managed:!0,external:!1,embed:!1});if(e.length){var n,r=Ya(this,tu).create(),o=za(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()}Ya(this,Za).dispatch(this.EVENTS.ON_BEFORE_FETCH),this.getGateway().fetch(r,(function(n){var r,o=n.data,i=za(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):("options"in u&&a.overrideOptions(u.options),t.createBanner(a.element,a.position,a.rawResources,a.options.options,u.mode),Ya(t,ru).removeBanner(a))}else a.setState(Ya(t,ru).STATE.NOT_FOUND,"Banner not found in fetched response.")}}catch(t){i.e(t)}finally{i.f()}Ya(t,Za).dispatch(t.EVENTS.ON_FETCH_SUCCESS,n)}),(function(n){var r,o=za(e);try{for(o.s();!(r=o.n()).done;)r.value.setState(Ya(t,ru).STATE.ERROR,"Request on api failed.")}catch(t){o.e(t)}finally{o.f()}Ya(t,Za).dispatch(t.EVENTS.ON_FETCH_ERROR,n)}))}}}],n&&Ga(e.prototype,n),r&&Ga(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function su(t,e,n,r){var o=document.createElement("iframe"),i="cv=".concat(encodeURIComponent(this.version.semver)),a=new je(r),u=t.dataset.ampEmbedSrc||Ya(this,eu).create(e,n,a.options);u+=-1===u.indexOf("?")?"?".concat(i):"&".concat(i),Ua(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=u,o.setAttribute("allowtransparency","true");var c=a.evaluate("loading",0),l=a.evaluate("fetchpriority",0);return null!==c&&(o.loading=c),null!==l&&o.setAttribute("fetchpriority",l),o}function fu(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 pu(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 pu(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 pu(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 du(t){return du="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},du(t)}function hu(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 mu(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 mu(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 mu(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 Vu(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 Xu(this,oc).subscribe(t,e,n)}},{key:"attachBanner",value:function(){if(Xu(this,sc))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=Xu(this,ic).addExternalBanner(t);Zu(this,sc,!0),window.self!==window.top&&e.delegateResponsiveBehaviour(),Xu(this,oc).dispatch(this.EVENTS.ON_BANNER_ATTACHED,e)}else console.warn("No banner not found in the embed client.")}}],n&&qu(e.prototype,n),r&&qu(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function bc(t,e){Xu(this,ac).sendToParent("metrics",{eventName:t,eventArgs:e})}function dc(){var t,e=Gu(Xu(this,ic).getBannersByState({state:ee.RENDERED}));try{for(e.s();!(t=e.n()).done;){t.value.redrawIfNeeded()}}catch(t){e.e(t)}finally{e.f()}}function hc(t){return hc="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},hc(t)}function mc(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};return new lu(new p(wc,"standard@".concat(wc)),t)}},{key:"createEmbed",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new vc(new p(wc,"embed@".concat(wc)),t)}},{key:"version",get:function(){return wc}}],(n=null)&&mc(e.prototype,n),r&&mc(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 db80de3..062024e 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:()=>Sc});var n={};t.r(n),t.d(n,{exclude:()=>V,extract:()=>L,parse:()=>U,parseUrl:()=>$,pick:()=>G,stringify:()=>z,stringifyUrl:()=>H});const r=JSON.parse('{"i8":"1.6.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 %>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 <% var loading; if(loading = banner.options.evaluate(\'loading\', 0)) { %>loading="<%- loading %>"<% } %>\n <% var fetchPriority; if(fetchPriority = banner.options.evaluate(\'fetchpriority\', 0)) { %>fetchpriority="<%- fetchPriority %>"<% } %>>\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=[],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 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()}`)),M=Symbol("encodeFragmentIdentifier");function C(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 L(t){const e=(t=x(t)).indexOf("?");return-1===e?"":t.slice(e+1)}function U(t,e){C((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]=A(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"";C((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]=A(t,"#");return void 0===n&&(n=t),{url:n?.split("?")?.[0]??"",query:U(L(t),e),...e&&e.parseFragmentIdentifier&&r?{fragmentIdentifier:W(r,e)}:{}}}function H(t,e){e={encode:!0,strict:!0,[M]:!0,...e};const n=x(t.url).split("?")[0]||"";let r=z({...U(L(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[M]?r.hash:`#${t.fragmentIdentifier}`}return`${n}${r}${o}`}function G(t,e,n){n={parseFragmentIdentifier:!0,[M]:!1,...n};const{url:r,query:o,fragmentIdentifier:i}=$(t,n);return H({url:r,query:N(o,e),fragmentIdentifier:i},n)}function V(t,e,n){return G(t,Array.isArray(e)?t=>!e.includes(t):(t,n)=>!e(t,n),n)}const q=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(q.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)}}])&&Q(e.prototype,n),r&&Q(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),ht(this,St,{writable:!0,value:void 0}),ht(this,Et,{writable:!0,value:void 0}),ht(this,Tt,{writable:!0,value:void 0}),ht(this,jt,{writable:!0,value:void 0}),ht(this,kt,{writable:!0,value:void 0}),ht(this,Ot,{writable:!0,value:void 0}),ht(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,jt,{}),wt(this,kt,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=mt(this,jt);if(t in r)throw new Error('Position "'+t+'" already exists.');r[t]={},n&&this.addPositionResources(t,mt(this,kt)),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=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,St)}},{key:"endpoint",get:function(){return mt(this,Et)}},{key:"locale",get:function(){return mt(this,Tt)}},{key:"parameters",get:function(){var t=mt(this,Pt).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,Ot)}}],n&&vt(e.prototype,n),r&&vt(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();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;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;e]+)>/g,(function(t,e){var n=i[e];return"$"+(Array.isArray(n)?n.join("$"):n)})))}if("function"==typeof o){var a=this;return t[Symbol.replace].call(this,n,(function(){var t=arguments;return"object"!=le(t[t.length-1])&&(t=[].slice.call(t)).push(r(t,a)),o.apply(this,t)}))}return t[Symbol.replace].call(this,n,o)},se.apply(this,arguments)}function fe(t,e){return fe=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},fe(t,e)}var pe=se(/^(?:(\d+)\x2D(\d+):|(\d+):|<(\d+):|<=(\d+):|>(\d+):|>=(\d+):)?([^:\s]+)$/,{INTERVAL_FROM:1,INTERVAL_TO:2,EQ:3,LT:4,LTE:5,GT:6,GTE:7,VALUE:8}),ye={};function be(t,e){var n=function(t){if(t in ye)return ye[t];for(var e=t.split(",").map((function(t){return t.trim()})),n=[],r=0;r=this.from&&t<=this.to}};break;case void 0!==o.groups.EQ:i={eq:parseInt(o.groups.EQ),matches:function(t){return t===this.eq}};break;case void 0!==o.groups.LT:i={lt:parseInt(o.groups.LT),matches:function(t){return tthis.gt}};break;case void 0!==o.groups.GTE:i={gte:parseInt(o.groups.GTE),matches:function(t){return t>=this.gte}};break;default:i={matches:function(){return!0}}}i&&(i.matches=i.matches.bind(i),i.value=o.groups.VALUE,n.push(i))}}var a={rules:n,cache:{}};return a.evaluate=function(t){Number.isInteger(t)||(t=parseInt(t));var e="i_".concat(t);if(e in this.cache)return this.cache[e];for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:void 0;return this.options[t]||e}},{key:"evaluate",value:function(t,e){return void 0===this.options[t]?null:be(this.options[t],e)}},{key:"override",value:function(t){this.options=he(he({},this.options),Ee(this,Te,ke).call(this,he({},t)))}}],n&&we(e.prototype,n),r&&we(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function ke(t){if("loading-offset"in t){var e=t["loading-offset"],n="loading"in t?t.loading:"loading"in this.options?this.options.loading:null,r=null!==n?">=".concat(e,":").concat(n):null,o='AMP deprecation warning: The banner option "loading-offset" is deprecated and will be removed in some future release.';null!==r&&(o+=' Instead of options {"loading": "'.concat(n,'", "loading-offset": "').concat(e,'"} use an expression based option {"loading": "').concat(r,'"}.')),console.warn(o),delete t["loading-offset"],null!==r&&(t.loading=r)}return t}function Oe(t){return Oe="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},Oe(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."));Re(this,De,t),Re(this,We,e.toString()),Ne(this,Be)[t]=(Ne(this,Be)[t]||0)+1,this._eventBus.dispatch(ie.ON_BANNER_STATE_CHANGED,this)}},{key:"getCurrenBreakpoint",value:function(t){return null}},{key:"overrideOptions",value:function(t){Ne(this,Ce).override(t)}},{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 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 Le(t,e){for(var n=0;n=c&&(null===i||ic))&&(o=u,i=c,en(t,ln)[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&&(en(this,ln).min=a[u-1]),"min"===n&&u+1 in a&&(en(this,ln).max=a[u+1]),nn(this,cn,null!==o?o:r)}},{key:"needRedraw",value:function(){if(null===en(this,cn))return!0;var t=en(this,on).width;return null!==en(this,ln).min&&ten(this,ln).max}}])&&Xe(e.prototype,n),r&&Xe(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function pn(t,e){for(var n in t)e(t[n],n)}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 bn(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 dn(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 dn(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 dn(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)&&Cn(e.prototype,n),r&&Cn(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Wn(t){return Wn="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},Wn(t)}function Bn(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);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),Hn(zn(c=o.call(this,n,r,a,u,s)),ir),Hn(zn(c),or),Gn(zn(c),Qn,{writable:!0,value:void 0}),Gn(zn(c),Xn,{writable:!0,value:void 0}),Gn(zn(c),Zn,{writable:!0,value:[]}),Gn(zn(c),tr,{writable:!0,value:void 0}),Gn(zn(c),er,{writable:!0,value:!1}),Gn(zn(c),nr,{writable:!0,value:null}),Gn(zn(c),rr,{writable:!0,value:[]}),Kn(zn(c),Qn,t),Kn(zn(c),Xn,e),Kn(zn(c),tr,l),l)Yn(zn(c),Zn).push(new yt(f,l[f]));return c}return e=i,(n=[{key:"html",set:function(t){this.element.innerHTML=t}},{key:"resources",get:function(){return Yn(this,Zn)}},{key:"rawResources",get:function(){return Yn(this,tr)}},{key:"data",get:function(){return console.warn("Usage of deprecated property `ManagedBanner.data`. Please use property `positionData` for accessing information about a position."),new In(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!==Yn(this,nr))return Yn(this,nr);if(!Yn(this,rr).length)throw new Error("Banner's data is empty.");var t=null,e=this.positionData,n=function(t){return Ue.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=Yn(this,rr).reduce((function(t,e){return t.score>=e.score?t:e}))).fingerprint=n(t);break;case e.isRandom():(t=Dn.randomByWeights(Yn(this,rr),"score")).fingerprint=n(t);break;case e.isMultiple():var r,o=Bn(t=Yn(this,rr).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 Kn(this,nr,t),t}},{key:"setResponseData",value:function(t){if(Yn(this,er))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,dimensions:t.dimensions||{width:null,height:null}}),"options"in t&&this.overrideOptions(t.options);var e=[];for(var n in t.banners||[])e.push(new jn(t.banners[n],t.breakpoint_type,Yn(this,Qn)));Kn(this,rr,e),Kn(this,er,!0),qn(this,or,ur).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(){qn(this,ir,cr).call(this)&&qn(this,or,ur).call(this,"Banner was successfully redrawn.")}}])&&Fn(e.prototype,n),r&&Fn(e,r),Object.defineProperty(e,"prototype",{writable:!1}),i}(xe);function ur(t){try{this.html=Yn(this,Xn).render(this)}catch(t){return void this.setState(this.STATE.ERROR,"Render error: "+t.message)}this.setState(this.STATE.RENDERED,t)}function cr(){var t=this.bannerData;for(var e in Array.isArray(t)||(t=[t]),t)if(t[e].needRedraw())return!0;return!1}function lr(t){return lr="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},lr(t)}function sr(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 fr(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 fr(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 fr(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 vr(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),xr(this,Ur,{writable:!0,value:void 0}),Fr(this,Ur,e-1)}var e,n,r;return e=t,(n=[{key:"getNextIdentifier",value:function(){var t,e;return Fr(this,Ur,(t=function(t,e){return e.get?e.get.call(t):e.value}(e=this,Lr(e,Ur,"get")),++t))}}])&&Br(e.prototype,n),r&&Br(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 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){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 Vr(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 Vr(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 Vr(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),Yr(this,Xr,{writable:!0,value:void 0}),Yr(this,Zr,{writable:!0,value:void 0}),Yr(this,to,{writable:!0,value:void 0}),Yr(this,eo,{writable:!0,value:void 0}),Yr(this,no,{writable:!0,value:[]}),Jr(this,Xr,e),Jr(this,Zr,n),Jr(this,to,r),Jr(this,eo,new zr),this.STATE=ne}var e,n,r;return e=t,n=[{key:"addExternalBanner",value:function(t){(t=$r(t)).setAttribute("data-amp-attached","");var e=new Nr(Kr(this,Zr),Kr(this,Xr),Kr(this,eo).getNextIdentifier(),t);return Kr(this,no).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===Kr(this,to))throw new Error("Unable to add managed banner, renderer is not provided.");(t=$r(t)).setAttribute("data-amp-attached","");var o=new ar(Kr(this,Zr),Kr(this,to),Kr(this,Xr),Kr(this,eo).getNextIdentifier(),t,e,n,r);return Kr(this,no).push(o),o}},{key:"addEmbedBanner",value:function(t,e,n){(t=$r(t)).setAttribute("data-amp-attached","");var r=new Dr(Kr(this,Xr),Kr(this,eo).getNextIdentifier(),t,e,n);return Kr(this,no).push(r),r}},{key:"removeBanner",value:function(t){var e=Kr(this,no).length;return Jr(this,no,Kr(this,no).filter((function(e){return e!==t}))),e!==Kr(this,no).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 Kr(this,no).filter((function(t){return t instanceof xe&&t.state===e&&!(t instanceof ar&&!r||t instanceof Nr&&!i||t instanceof Dr&&!u)}))}},{key:"getBannerByFingerprint",value:function(t){var e,n=t instanceof Ue?t.value:t,r=Gr(Kr(this,no));try{for(r.s();!(e=r.n()).done;){var o=e.value;if(!(o instanceof Dr)){var i,a=Gr(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=Gr(Kr(this,no));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&&qr(e.prototype,n),r&&qr(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function oo(t){return oo="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},oo(t)}function io(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 yo(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_"+ho(this,go).getNextIdentifier();return ho(this,So)[t]=ho(this,So)[t]||{},ho(this,So)[t][i]={callback:e,scope:r,priority:o},t in ho(this,Eo)&&delete ho(this,Eo)[t],function(){t in ho(n,So)&&i in ho(n,So)[t]&&delete ho(n,So)[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 Vo(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=Go(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 b=n[p];if(b){var d={fingerprint:b.fingerprint,element:f.target,banner:y};if(a.push($o($o({},d),{},{entry:f})),!b.alreadySeen){var v=f.intersectionRatio>=c(f.target);u[p]=!(p in u)||!u[p].isIntersecting&&v?{fingerprintArgs:d,fingerprintMetadata:b,isIntersecting:v}:u[p]}if(!b.alreadyFullySeen){var h=.99<=f.intersectionRatio;l[p]=!(p in l)||!l[p].isFullyIntersecting&&h?{fingerprintArgs:d,fingerprintMetadata:b,isFullyIntersecting:h}:l[p]}}}}}catch(t){s.e(t)}finally{s.f()}for(var m=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 Ei(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(vi.BANNER_LOADED)&&t.subscribe(ie.ON_BANNER_STATE_CHANGED,(function(t){if(!t.isEmbed()&&ne.RENDERED===t.state&&1===t.stateCounter){var e,o=Si(t.fingerprints);try{for(o.s();!(e=o.n()).done;){var i=e.value;n.send(vi.BANNER_LOADED,r(i,t))}}catch(t){o.e(t)}finally{o.f()}}})),n.isEventEnabled(vi.BANNER_DISPLAYED)&&t.subscribe(ie.ON_BANNER_FIRST_TIME_SEEN,(function(t){var e=t.fingerprint,o=t.banner;n.send(vi.BANNER_DISPLAYED,r(e,o))})),n.isEventEnabled(vi.BANNER_FULLY_DISPLAYED)&&t.subscribe(ie.ON_BANNER_FIRST_TIME_FULLY_SEEN,(function(t){var e=t.fingerprint,o=t.banner;n.send(vi.BANNER_FULLY_DISPLAYED,r(e,o))})),n.isEventEnabled(vi.BANNER_CLICKED)&&t.subscribe(ie.ON_BANNER_LINK_CLICKED,(function(t){var e=t.fingerprint,o=t.banner,i=t.target;n.send(vi.BANNER_CLICKED,wi(wi({},r(e,o)),{},{link:i.href||""}))}))}}}}])&&Ti(e.prototype,n),r&&Ti(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}(),Ci=!1;const Di=function(t,e){if(!("plausible"in window)||"function"!=typeof window.plausible)return!Ci&&console.warn("Unable to send metrics to Plausible because the function plausible() does not occur in the window."),void(Ci=!0);Object.keys(e).forEach((function(t){return null===e[t]&&delete e[t]})),window.plausible(t,{props:e})};var Wi=!1;const Bi=function(t,e){if(!("gtag"in window)||"function"!=typeof window.gtag)return!Wi&&console.warn("Unable to send metrics to Google Analytics because the function gtag() does not occur in the window."),void(Wi=!0);Object.keys(e).forEach((function(t){return null===e[t]&&delete e[t]})),window.gtag("event",t,e)};function xi(t){return xi="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},xi(t)}function Fi(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 Li(t,e,n){return(e=function(t){var e=function(t,e){if("object"!==xi(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!==xi(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===xi(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Ui=!1;const zi=function(t,e){if(!("dataLayer"in window))return!Ui&&console.warn("Unable to send metrics to GTM because the dataLayer does not occur in the window."),void(Ui=!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 Vi(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 pa(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 Ha(t,e){if(t){if("string"==typeof t)return Ga(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)?Ga(t,e):void 0}}function Ga(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"!==h(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(h(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(h(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)),Ja(this,tu,new To),Ja(this,eu,new Lt(n.method,n.url,n.version,n.channel)),Ja(this,nu,new Zt(n.url,n.version,n.channel)),Ja(this,ou,new ro(Ka(this,tu),so.fromCurrentWindow(),new Lo(n.template))),Ja(this,iu,new pi(Ka(this,ou),Ka(this,tu),n.interaction)),Ja(this,au,ta.createFromReceivers(n.metrics.receiver,n.metrics.disabledEvents)),Ja(this,uu,new Mi(Ka(this,au),Ka(this,tu),n.channel)),Ja(this,cu,new Da({origin:n.url,connectionData:{extendedConfig:{interaction:n.interaction}},bannerManager:Ka(this,ou),metricsSender:Ka(this,au)})),this.setLocale(n.locale),Ka(this,eu).origin=n.origin,n.resources)Ka(this,eu).addDefaultResource(a,n.resources[a]),Ka(this,nu).addDefaultResource(a,n.resources[a]);window.addEventListener("resize",(function(){var t,e=$a(Ka(i,ou).getBannersByState({state:Ka(i,ou).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()}})),Ka(this,cu).listen(),Ka(this,uu).attach(),Ka(this,iu).start()}var e,n,r;return e=t,n=[{key:"version",get:function(){return Ka(this,Xa)}},{key:"on",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return Ka(this,tu).subscribe(t,e,n)}},{key:"setLocale",value:function(t){Ka(this,eu).locale=t,Ka(this,nu).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.");Ja(this,ru,t)}},{key:"getGateway",value:function(){return null===Ka(this,ru)&&this.setGateway(new et),Ka(this,ru)}},{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,lu,fu).call(this,t,e,n,r),a=Ka(this,ou).addEmbedBanner(i,e,r);return Ka(this,cu).connectBanner(a),t.insertAdjacentElement("afterend",i),t.remove(),a}return Ka(this,ou).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=Ka(this,ou).addExternalBanner(n);else{var i=yr.parseResources(n),a=yr.parseOptions(n),u=n.dataset.ampMode||"managed";o=this.createBanner(n,r,i,a,u)}Ka(this,tu).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=Ka(this,ou).getBannersByState({state:Ka(this,ou).STATE.NEW,managed:!0,external:!1,embed:!1});if(e.length){var n,r=Ka(this,eu).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()}Ka(this,tu).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):("options"in u&&a.overrideOptions(u.options),t.createBanner(a.element,a.position,a.rawResources,a.options.options,u.mode),Ka(t,ou).removeBanner(a))}else a.setState(Ka(t,ou).STATE.NOT_FOUND,"Banner not found in fetched response.")}}catch(t){i.e(t)}finally{i.f()}Ka(t,tu).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(Ka(t,ou).STATE.ERROR,"Request on api failed.")}catch(t){o.e(t)}finally{o.f()}Ka(t,tu).dispatch(t.EVENTS.ON_FETCH_ERROR,n)}))}}}],n&&Va(e.prototype,n),r&&Va(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function fu(t,e,n,r){var o=document.createElement("iframe"),i="cv=".concat(encodeURIComponent(this.version.semver)),a=new je(r),u=t.dataset.ampEmbedSrc||Ka(this,nu).create(e,n,a.options);u+=-1===u.indexOf("?")?"?".concat(i):"&".concat(i),za(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=u,o.setAttribute("allowtransparency","true");var c=a.evaluate("loading",0),l=a.evaluate("fetchpriority",0);return null!==c&&(o.loading=c),null!==l&&o.setAttribute("fetchpriority",l),o}function pu(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 yu(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 yu(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 yu(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 hu(t){return hu="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},hu(t)}function mu(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 wu(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 wu(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 wu(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 qu(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 Zu(this,ic).subscribe(t,e,n)}},{key:"attachBanner",value:function(){if(Zu(this,fc))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=Zu(this,ac).addExternalBanner(t);tc(this,fc,!0),window.self!==window.top&&e.delegateResponsiveBehaviour(),Zu(this,ic).dispatch(this.EVENTS.ON_BANNER_ATTACHED,e)}else console.warn("No banner not found in the embed client.")}}],n&&Yu(e.prototype,n),r&&Yu(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function vc(t,e){Zu(this,uc).sendToParent("metrics",{eventName:t,eventArgs:e})}function hc(){var t,e=Vu(Zu(this,ac).getBannersByState({state:ne.RENDERED}));try{for(e.s();!(t=e.n()).done;){t.value.redrawIfNeeded()}}catch(t){e.e(t)}finally{e.f()}}function mc(t){return mc="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},mc(t)}function wc(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};return new su(new p(gc,"standard@".concat(gc)),t)}},{key:"createEmbed",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new dc(new p(gc,"embed@".concat(gc)),t)}},{key:"version",get:function(){return gc}}],(n=null)&&wc(e.prototype,n),r&&wc(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:()=>Sc});var n={};t.r(n),t.d(n,{exclude:()=>V,extract:()=>L,parse:()=>U,parseUrl:()=>$,pick:()=>G,stringify:()=>z,stringifyUrl:()=>H});const r=JSON.parse('{"i8":"1.6.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 <% var loading; if(loading = banner.options.evaluate(\'loading\', 0)) { %>loading="<%- loading %>"<% } %>\n <% var fetchPriority; if(fetchPriority = banner.options.evaluate(\'fetchpriority\', 0)) { %>fetchpriority="<%- fetchPriority %>"<% } %>>\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=[],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 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()}`)),M=Symbol("encodeFragmentIdentifier");function C(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 L(t){const e=(t=x(t)).indexOf("?");return-1===e?"":t.slice(e+1)}function U(t,e){C((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]=A(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"";C((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]=A(t,"#");return void 0===n&&(n=t),{url:n?.split("?")?.[0]??"",query:U(L(t),e),...e&&e.parseFragmentIdentifier&&r?{fragmentIdentifier:W(r,e)}:{}}}function H(t,e){e={encode:!0,strict:!0,[M]:!0,...e};const n=x(t.url).split("?")[0]||"";let r=z({...U(L(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[M]?r.hash:`#${t.fragmentIdentifier}`}return`${n}${r}${o}`}function G(t,e,n){n={parseFragmentIdentifier:!0,[M]:!1,...n};const{url:r,query:o,fragmentIdentifier:i}=$(t,n);return H({url:r,query:N(o,e),fragmentIdentifier:i},n)}function V(t,e,n){return G(t,Array.isArray(e)?t=>!e.includes(t):(t,n)=>!e(t,n),n)}const q=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(q.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)}}])&&Q(e.prototype,n),r&&Q(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),ht(this,St,{writable:!0,value:void 0}),ht(this,Et,{writable:!0,value:void 0}),ht(this,Tt,{writable:!0,value:void 0}),ht(this,jt,{writable:!0,value:void 0}),ht(this,kt,{writable:!0,value:void 0}),ht(this,Ot,{writable:!0,value:void 0}),ht(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,jt,{}),wt(this,kt,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=mt(this,jt);if(t in r)throw new Error('Position "'+t+'" already exists.');r[t]={},n&&this.addPositionResources(t,mt(this,kt)),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=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,St)}},{key:"endpoint",get:function(){return mt(this,Et)}},{key:"locale",get:function(){return mt(this,Tt)}},{key:"parameters",get:function(){var t=mt(this,Pt).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,Ot)}}],n&&vt(e.prototype,n),r&&vt(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();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;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;e]+)>/g,(function(t,e){var n=i[e];return"$"+(Array.isArray(n)?n.join("$"):n)})))}if("function"==typeof o){var a=this;return t[Symbol.replace].call(this,n,(function(){var t=arguments;return"object"!=le(t[t.length-1])&&(t=[].slice.call(t)).push(r(t,a)),o.apply(this,t)}))}return t[Symbol.replace].call(this,n,o)},se.apply(this,arguments)}function fe(t,e){return fe=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},fe(t,e)}var pe=se(/^(?:(\d+)\x2D(\d+):|(\d+):|<(\d+):|<=(\d+):|>(\d+):|>=(\d+):)?([^:\s]+)$/,{INTERVAL_FROM:1,INTERVAL_TO:2,EQ:3,LT:4,LTE:5,GT:6,GTE:7,VALUE:8}),ye={};function be(t,e){var n=function(t){if(t in ye)return ye[t];for(var e=t.split(",").map((function(t){return t.trim()})),n=[],r=0;r=this.from&&t<=this.to}};break;case void 0!==o.groups.EQ:i={eq:parseInt(o.groups.EQ),matches:function(t){return t===this.eq}};break;case void 0!==o.groups.LT:i={lt:parseInt(o.groups.LT),matches:function(t){return tthis.gt}};break;case void 0!==o.groups.GTE:i={gte:parseInt(o.groups.GTE),matches:function(t){return t>=this.gte}};break;default:i={matches:function(){return!0}}}i&&(i.matches=i.matches.bind(i),i.value=o.groups.VALUE,n.push(i))}}var a={rules:n,cache:{}};return a.evaluate=function(t){Number.isInteger(t)||(t=parseInt(t));var e="i_".concat(t);if(e in this.cache)return this.cache[e];for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:void 0;return this.options[t]||e}},{key:"evaluate",value:function(t,e){return void 0===this.options[t]?null:be(this.options[t],e)}},{key:"override",value:function(t){this.options=he(he({},this.options),Ee(this,Te,ke).call(this,he({},t)))}}],n&&we(e.prototype,n),r&&we(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function ke(t){if("loading-offset"in t){var e=t["loading-offset"],n="loading"in t?t.loading:"loading"in this.options?this.options.loading:null,r=null!==n?">=".concat(e,":").concat(n):null,o='AMP deprecation warning: The banner option "loading-offset" is deprecated and will be removed in some future release.';null!==r&&(o+=' Instead of options {"loading": "'.concat(n,'", "loading-offset": "').concat(e,'"} use an expression based option {"loading": "').concat(r,'"}.')),console.warn(o),delete t["loading-offset"],null!==r&&(t.loading=r)}return t}function Oe(t){return Oe="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},Oe(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."));Re(this,De,t),Re(this,We,e.toString()),Ne(this,Be)[t]=(Ne(this,Be)[t]||0)+1,this._eventBus.dispatch(ie.ON_BANNER_STATE_CHANGED,this)}},{key:"getCurrenBreakpoint",value:function(t){return null}},{key:"overrideOptions",value:function(t){Ne(this,Ce).override(t)}},{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 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 Le(t,e){for(var n=0;n=c&&(null===i||ic))&&(o=u,i=c,en(t,ln)[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&&(en(this,ln).min=a[u-1]),"min"===n&&u+1 in a&&(en(this,ln).max=a[u+1]),nn(this,cn,null!==o?o:r)}},{key:"needRedraw",value:function(){if(null===en(this,cn))return!0;var t=en(this,on).width;return null!==en(this,ln).min&&ten(this,ln).max}}])&&Xe(e.prototype,n),r&&Xe(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function pn(t,e){for(var n in t)e(t[n],n)}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 bn(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 dn(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 dn(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 dn(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)&&Cn(e.prototype,n),r&&Cn(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Wn(t){return Wn="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},Wn(t)}function Bn(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);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),Hn(zn(c=o.call(this,n,r,a,u,s)),ir),Hn(zn(c),or),Gn(zn(c),Qn,{writable:!0,value:void 0}),Gn(zn(c),Xn,{writable:!0,value:void 0}),Gn(zn(c),Zn,{writable:!0,value:[]}),Gn(zn(c),tr,{writable:!0,value:void 0}),Gn(zn(c),er,{writable:!0,value:!1}),Gn(zn(c),nr,{writable:!0,value:null}),Gn(zn(c),rr,{writable:!0,value:[]}),Kn(zn(c),Qn,t),Kn(zn(c),Xn,e),Kn(zn(c),tr,l),l)Yn(zn(c),Zn).push(new yt(f,l[f]));return c}return e=i,(n=[{key:"html",set:function(t){this.element.innerHTML=t}},{key:"resources",get:function(){return Yn(this,Zn)}},{key:"rawResources",get:function(){return Yn(this,tr)}},{key:"data",get:function(){return console.warn("Usage of deprecated property `ManagedBanner.data`. Please use property `positionData` for accessing information about a position."),new In(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!==Yn(this,nr))return Yn(this,nr);if(!Yn(this,rr).length)throw new Error("Banner's data is empty.");var t=null,e=this.positionData,n=function(t){return Ue.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=Yn(this,rr).reduce((function(t,e){return t.score>=e.score?t:e}))).fingerprint=n(t);break;case e.isRandom():(t=Dn.randomByWeights(Yn(this,rr),"score")).fingerprint=n(t);break;case e.isMultiple():var r,o=Bn(t=Yn(this,rr).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 Kn(this,nr,t),t}},{key:"setResponseData",value:function(t){if(Yn(this,er))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,dimensions:t.dimensions||{width:null,height:null}}),"options"in t&&this.overrideOptions(t.options);var e=[];for(var n in t.banners||[])e.push(new jn(t.banners[n],t.breakpoint_type,Yn(this,Qn)));Kn(this,rr,e),Kn(this,er,!0),qn(this,or,ur).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(){qn(this,ir,cr).call(this)&&qn(this,or,ur).call(this,"Banner was successfully redrawn.")}}])&&Fn(e.prototype,n),r&&Fn(e,r),Object.defineProperty(e,"prototype",{writable:!1}),i}(xe);function ur(t){try{this.html=Yn(this,Xn).render(this)}catch(t){return void this.setState(this.STATE.ERROR,"Render error: "+t.message)}this.setState(this.STATE.RENDERED,t)}function cr(){var t=this.bannerData;for(var e in Array.isArray(t)||(t=[t]),t)if(t[e].needRedraw())return!0;return!1}function lr(t){return lr="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},lr(t)}function sr(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 fr(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 fr(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 fr(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 vr(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),xr(this,Ur,{writable:!0,value:void 0}),Fr(this,Ur,e-1)}var e,n,r;return e=t,(n=[{key:"getNextIdentifier",value:function(){var t,e;return Fr(this,Ur,(t=function(t,e){return e.get?e.get.call(t):e.value}(e=this,Lr(e,Ur,"get")),++t))}}])&&Br(e.prototype,n),r&&Br(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 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){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 Vr(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 Vr(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 Vr(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),Yr(this,Xr,{writable:!0,value:void 0}),Yr(this,Zr,{writable:!0,value:void 0}),Yr(this,to,{writable:!0,value:void 0}),Yr(this,eo,{writable:!0,value:void 0}),Yr(this,no,{writable:!0,value:[]}),Jr(this,Xr,e),Jr(this,Zr,n),Jr(this,to,r),Jr(this,eo,new zr),this.STATE=ne}var e,n,r;return e=t,n=[{key:"addExternalBanner",value:function(t){(t=$r(t)).setAttribute("data-amp-attached","");var e=new Nr(Kr(this,Zr),Kr(this,Xr),Kr(this,eo).getNextIdentifier(),t);return Kr(this,no).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===Kr(this,to))throw new Error("Unable to add managed banner, renderer is not provided.");(t=$r(t)).setAttribute("data-amp-attached","");var o=new ar(Kr(this,Zr),Kr(this,to),Kr(this,Xr),Kr(this,eo).getNextIdentifier(),t,e,n,r);return Kr(this,no).push(o),o}},{key:"addEmbedBanner",value:function(t,e,n){(t=$r(t)).setAttribute("data-amp-attached","");var r=new Dr(Kr(this,Xr),Kr(this,eo).getNextIdentifier(),t,e,n);return Kr(this,no).push(r),r}},{key:"removeBanner",value:function(t){var e=Kr(this,no).length;return Jr(this,no,Kr(this,no).filter((function(e){return e!==t}))),e!==Kr(this,no).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 Kr(this,no).filter((function(t){return t instanceof xe&&t.state===e&&!(t instanceof ar&&!r||t instanceof Nr&&!i||t instanceof Dr&&!u)}))}},{key:"getBannerByFingerprint",value:function(t){var e,n=t instanceof Ue?t.value:t,r=Gr(Kr(this,no));try{for(r.s();!(e=r.n()).done;){var o=e.value;if(!(o instanceof Dr)){var i,a=Gr(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=Gr(Kr(this,no));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&&qr(e.prototype,n),r&&qr(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function oo(t){return oo="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},oo(t)}function io(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 yo(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_"+ho(this,go).getNextIdentifier();return ho(this,So)[t]=ho(this,So)[t]||{},ho(this,So)[t][i]={callback:e,scope:r,priority:o},t in ho(this,Eo)&&delete ho(this,Eo)[t],function(){t in ho(n,So)&&i in ho(n,So)[t]&&delete ho(n,So)[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 Vo(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=Go(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 b=n[p];if(b){var d={fingerprint:b.fingerprint,element:f.target,banner:y};if(a.push($o($o({},d),{},{entry:f})),!b.alreadySeen){var v=f.intersectionRatio>=c(f.target);u[p]=!(p in u)||!u[p].isIntersecting&&v?{fingerprintArgs:d,fingerprintMetadata:b,isIntersecting:v}:u[p]}if(!b.alreadyFullySeen){var h=.99<=f.intersectionRatio;l[p]=!(p in l)||!l[p].isFullyIntersecting&&h?{fingerprintArgs:d,fingerprintMetadata:b,isFullyIntersecting:h}:l[p]}}}}}catch(t){s.e(t)}finally{s.f()}for(var m=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 Ei(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(vi.BANNER_LOADED)&&t.subscribe(ie.ON_BANNER_STATE_CHANGED,(function(t){if(!t.isEmbed()&&ne.RENDERED===t.state&&1===t.stateCounter){var e,o=Si(t.fingerprints);try{for(o.s();!(e=o.n()).done;){var i=e.value;n.send(vi.BANNER_LOADED,r(i,t))}}catch(t){o.e(t)}finally{o.f()}}})),n.isEventEnabled(vi.BANNER_DISPLAYED)&&t.subscribe(ie.ON_BANNER_FIRST_TIME_SEEN,(function(t){var e=t.fingerprint,o=t.banner;n.send(vi.BANNER_DISPLAYED,r(e,o))})),n.isEventEnabled(vi.BANNER_FULLY_DISPLAYED)&&t.subscribe(ie.ON_BANNER_FIRST_TIME_FULLY_SEEN,(function(t){var e=t.fingerprint,o=t.banner;n.send(vi.BANNER_FULLY_DISPLAYED,r(e,o))})),n.isEventEnabled(vi.BANNER_CLICKED)&&t.subscribe(ie.ON_BANNER_LINK_CLICKED,(function(t){var e=t.fingerprint,o=t.banner,i=t.target;n.send(vi.BANNER_CLICKED,wi(wi({},r(e,o)),{},{link:i.href||""}))}))}}}}])&&Ti(e.prototype,n),r&&Ti(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}(),Ci=!1;const Di=function(t,e){if(!("plausible"in window)||"function"!=typeof window.plausible)return!Ci&&console.warn("Unable to send metrics to Plausible because the function plausible() does not occur in the window."),void(Ci=!0);Object.keys(e).forEach((function(t){return null===e[t]&&delete e[t]})),window.plausible(t,{props:e})};var Wi=!1;const Bi=function(t,e){if(!("gtag"in window)||"function"!=typeof window.gtag)return!Wi&&console.warn("Unable to send metrics to Google Analytics because the function gtag() does not occur in the window."),void(Wi=!0);Object.keys(e).forEach((function(t){return null===e[t]&&delete e[t]})),window.gtag("event",t,e)};function xi(t){return xi="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},xi(t)}function Fi(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 Li(t,e,n){return(e=function(t){var e=function(t,e){if("object"!==xi(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!==xi(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===xi(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Ui=!1;const zi=function(t,e){if(!("dataLayer"in window))return!Ui&&console.warn("Unable to send metrics to GTM because the dataLayer does not occur in the window."),void(Ui=!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 Vi(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 pa(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 Ha(t,e){if(t){if("string"==typeof t)return Ga(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)?Ga(t,e):void 0}}function Ga(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"!==h(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(h(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(h(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)),Ja(this,tu,new To),Ja(this,eu,new Lt(n.method,n.url,n.version,n.channel)),Ja(this,nu,new Zt(n.url,n.version,n.channel)),Ja(this,ou,new ro(Ka(this,tu),so.fromCurrentWindow(),new Lo(n.template))),Ja(this,iu,new pi(Ka(this,ou),Ka(this,tu),n.interaction)),Ja(this,au,ta.createFromReceivers(n.metrics.receiver,n.metrics.disabledEvents)),Ja(this,uu,new Mi(Ka(this,au),Ka(this,tu),n.channel)),Ja(this,cu,new Da({origin:n.url,connectionData:{extendedConfig:{interaction:n.interaction}},bannerManager:Ka(this,ou),metricsSender:Ka(this,au)})),this.setLocale(n.locale),Ka(this,eu).origin=n.origin,n.resources)Ka(this,eu).addDefaultResource(a,n.resources[a]),Ka(this,nu).addDefaultResource(a,n.resources[a]);window.addEventListener("resize",(function(){var t,e=$a(Ka(i,ou).getBannersByState({state:Ka(i,ou).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()}})),Ka(this,cu).listen(),Ka(this,uu).attach(),Ka(this,iu).start()}var e,n,r;return e=t,n=[{key:"version",get:function(){return Ka(this,Xa)}},{key:"on",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return Ka(this,tu).subscribe(t,e,n)}},{key:"setLocale",value:function(t){Ka(this,eu).locale=t,Ka(this,nu).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.");Ja(this,ru,t)}},{key:"getGateway",value:function(){return null===Ka(this,ru)&&this.setGateway(new et),Ka(this,ru)}},{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,lu,fu).call(this,t,e,n,r),a=Ka(this,ou).addEmbedBanner(i,e,r);return Ka(this,cu).connectBanner(a),t.insertAdjacentElement("afterend",i),t.remove(),a}return Ka(this,ou).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=Ka(this,ou).addExternalBanner(n);else{var i=yr.parseResources(n),a=yr.parseOptions(n),u=n.dataset.ampMode||"managed";o=this.createBanner(n,r,i,a,u)}Ka(this,tu).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=Ka(this,ou).getBannersByState({state:Ka(this,ou).STATE.NEW,managed:!0,external:!1,embed:!1});if(e.length){var n,r=Ka(this,eu).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()}Ka(this,tu).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):("options"in u&&a.overrideOptions(u.options),t.createBanner(a.element,a.position,a.rawResources,a.options.options,u.mode),Ka(t,ou).removeBanner(a))}else a.setState(Ka(t,ou).STATE.NOT_FOUND,"Banner not found in fetched response.")}}catch(t){i.e(t)}finally{i.f()}Ka(t,tu).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(Ka(t,ou).STATE.ERROR,"Request on api failed.")}catch(t){o.e(t)}finally{o.f()}Ka(t,tu).dispatch(t.EVENTS.ON_FETCH_ERROR,n)}))}}}],n&&Va(e.prototype,n),r&&Va(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function fu(t,e,n,r){var o=document.createElement("iframe"),i="cv=".concat(encodeURIComponent(this.version.semver)),a=new je(r),u=t.dataset.ampEmbedSrc||Ka(this,nu).create(e,n,a.options);u+=-1===u.indexOf("?")?"?".concat(i):"&".concat(i),za(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=u,o.setAttribute("allowtransparency","true");var c=a.evaluate("loading",0),l=a.evaluate("fetchpriority",0);return null!==c&&(o.loading=c),null!==l&&o.setAttribute("fetchpriority",l),o}function pu(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 yu(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 yu(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 yu(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 hu(t){return hu="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},hu(t)}function mu(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 wu(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 wu(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 wu(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 qu(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 Zu(this,ic).subscribe(t,e,n)}},{key:"attachBanner",value:function(){if(Zu(this,fc))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=Zu(this,ac).addExternalBanner(t);tc(this,fc,!0),window.self!==window.top&&e.delegateResponsiveBehaviour(),Zu(this,ic).dispatch(this.EVENTS.ON_BANNER_ATTACHED,e)}else console.warn("No banner not found in the embed client.")}}],n&&Yu(e.prototype,n),r&&Yu(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function vc(t,e){Zu(this,uc).sendToParent("metrics",{eventName:t,eventArgs:e})}function hc(){var t,e=Vu(Zu(this,ac).getBannersByState({state:ne.RENDERED}));try{for(e.s();!(t=e.n()).done;){t.value.redrawIfNeeded()}}catch(t){e.e(t)}finally{e.f()}}function mc(t){return mc="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},mc(t)}function wc(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};return new su(new p(gc,"standard@".concat(gc)),t)}},{key:"createEmbed",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new dc(new p(gc,"embed@".concat(gc)),t)}},{key:"version",get:function(){return gc}}],(n=null)&&wc(e.prototype,n),r&&wc(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 ab554ff..08113a4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@68publishers/amp-client", - "version": "1.6.0-beta.3", + "version": "1.6.0-beta.4", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@68publishers/amp-client", - "version": "1.6.0-beta.3", + "version": "1.6.0-beta.4", "license": "ISC", "dependencies": { "lodash": "^4.17.21", diff --git a/package.json b/package.json index d1455db..5811efe 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@68publishers/amp-client", - "version": "1.6.0-beta.3", + "version": "1.6.0-beta.4", "description": "JS Client for 68publishers/amp", "homepage": "http://www.68publishers.io/", "main": "index.mjs",