jsPerf.app is an online JavaScript performance benchmark test runner & jsperf.com mirror. It is a complete rewrite in homage to the once excellent jsperf.com now with hopefully a more modern & maintainable codebase.
jsperf.com URLs are mirrored at the same path, e.g:
https://jsperf.com/negative-modulo/2
Can be accessed at:
https://jsperf.app/negative-modulo/2
<script type="not/js" id="cc">
try{!function(){function t(t,e,o){var r=void 0;if(!t){var s=(e||"Assertion failed").split("%s"),a=s.shift(),u=a,l=[];for(n(l,a),a=2;a<arguments.length;a++){var h=arguments[a];h&&h.tagName&&(r=h);var c=s.shift();l.push(h),n(l,c.trim()),u+=i(h)+c}throw s=Error(u),s.fromAssert=!0,s.associatedElement=r,s.messageArray=l,s}return t}function e(t,e,i){for(var n in t)if(t[n]==e)return t[n];throw Error("Unknown "+(i||"enum")+' value: "'+e+'"')}function i(t){return t instanceof Element?t.tagName.toLowerCase()+(t.id?"#"+t.id:""):t}function n(t,e){""!=e&&t.push(e)}function o(t){var e=document.createElement("a");return e.href=t,t={href:e.href,protocol:e.protocol,host:e.host,hostname:e.hostname,port:"0"==e.port?"":e.port,pathname:e.pathname,search:e.search,hash:e.hash},t.origin=e.origin&&"null"!=e.origin?e.origin:l(t),ze.assert(t.origin,"Origin must exist"),t}function r(t,e,i){return t=o(t),e=encodeURIComponent(e)+"="+encodeURIComponent(i),t.origin+t.pathname+(t.search?t.search+"&"+e:"?"+e)+t.hash}function s(t,e){return Object.keys(e).reduce(function(t,i){return r(t,i,e[i])},t)}function a(t,e){var i=o(t);return ze.assert("https:"==i.protocol||/^(\/\/)/.test(t)||"localhost"==i.hostname||i.hostname.lastIndexOf(".localhost")==i.hostname.length-10,'%s source must start with "https://" or "//" or be relative and served from either https or from localhost. Invalid value: %s',e,t),t}function u(t){var e=Object.create(null);if(!t)return e;(0==t.indexOf("?")||0==t.indexOf("#"))&&(t=t.substr(1)),t=t.split("&");for(var i=0;i<t.length;i++){var n=t[i],o=n.indexOf("="),r=void 0,s=void 0;-1!=o?(r=decodeURIComponent(n.substring(0,o)).trim(),s=decodeURIComponent(n.substring(o+1)).trim()):(r=decodeURIComponent(n).trim(),s=""),r&&(e[r]=s)}return e}function l(t){return"data:"!=t.protocol&&t.host?t.protocol+"//"+t.host:t.href}function h(t){var e=t.indexOf("#");return-1==e?t:t.substring(0,e)}function c(t,e,i){var n=_(t),o=n[e];return o||(o=n[e]={}),o.obj||(ze.assert(i,"Factory not given and service missing %s",e),o.obj=i(t),o.resolve&&o.resolve(o.obj)),o.obj}function p(t,e,i){return Promise.resolve().then(function(){return d(t,e,i)})}function d(t,e,i){if(ze.assert(f(t,i),"Service %s was requested to be provided through %s, but %s is not loaded in the current page. To fix this problem load the JavaScript file for %s in this page.",e,i,i,i),t=_(t),i=t[e])return i.promise||(i.promise=Promise.resolve(i.obj)),i.promise;var n=void 0;return i=new Promise(function(t){n=t}),t[e]={obj:null,promise:i,resolve:n},i}function f(t,e){return ze.assert(t.ampExtendedElements,"win.ampExtendedElements not created yet"),!!t.ampExtendedElements[e]}function m(t,e){t.ampExtendedElements||(t.ampExtendedElements={}),t.ampExtendedElements[e]=!0}function _(t){var e=t.services;return e||(e=t.services={}),e}function g(t,e){t.services&&(t.services[e]=null)}function y(t){return Qe.getService(t,"viewer")}function v(){return $e?$e:$e=w()}function b(t){$e=t}function w(){var t=("localhost"==location.hostname||location.ancestorOrigins&&location.ancestorOrigins[0]&&0==location.ancestorOrigins[0].indexOf("http://localhost:"))&&!!document.querySelector('script[src*="/dist/"],script[src*="/base/"]'),e=qe.parseQueryString(location.hash).development,e=void 0!=e?"1"==e:!!document.querySelector("script[development]");return{localDev:t,development:e,minified:"production"==Ue.env.NODE_ENV,test:window.AMP_TEST}}function S(t){t.parentElement&&t.parentElement.removeChild(t)}function E(t){for(;t.firstChild;)t.removeChild(t.firstChild)}function T(t,e){for(var i=e.ownerDocument.createDocumentFragment(),n=t.firstChild;n;n=n.nextSibling)i.appendChild(n.cloneNode(!0));e.appendChild(i)}function A(t,e){for(var i=t;i;i=i.parentElement)if(e(i))return i;return null}function C(t,e){return e=e.toUpperCase(),A(t,function(t){return t.tagName==e})}function L(t,e){var i=t.getElementsByTagName(e);return 0<i.length?i[0]:null}function O(t,e){for(var i=t.children,n=0;n<i.length;n++)if(e(i[n]))return i[n];return null}function I(t,e,i){return O(t,function(t){return!t.hasAttribute(e)||void 0!==i&&t.getAttribute(e)!=i?!1:!0})}function k(t,e){return e=e.toUpperCase(),O(t,function(t){return t.tagName==e})}function P(t,e,i){return M(t).registerTemplate_(e,i)}function M(t){return Qe.getService(t,"templates",function(){return new si(t)})}function x(t,e){var i=t.document.cookie;if(!i)return null;for(var i=i.split(";"),n=0;n<i.length;n++){var o=i[n].trim(),r=o.indexOf("=");if(-1!=r&&decodeURIComponent(o.substring(0,r).trim())==e)return decodeURIComponent(o.substring(r+1).trim())}return null}function R(t,e,i,n){t.document.cookie=encodeURIComponent(e)+"="+encodeURIComponent(i)+"; path=/; expires="+new Date(n).toUTCString()}function D(t,e){return-1!=F(t).indexOf(e)}function V(t,e,i){var n=F(t),o=-1!=n.indexOf(e);return i=void 0!==i?i:!o,i!=o&&(i?n.push(e):n.splice(n.indexOf(e),1),N(t,n)),i}function F(t){return(t=ai.getCookie(t,pi))?t.split(/\s*,\s*/g):[]}function N(t,e){ai.setCookie(t,pi,e.join(","),ui.timer.now()+fi)}function H(t){return t.charAt(0).toUpperCase()+t.slice(1)}function U(t,e){for(var i=0;i<gi.length;i++){var n=gi[i]+e;if(void 0!==t[n])return n}return""}function B(t,e,i){var n=_i[e];if(!n||i){if(n=e,void 0===t[e]){var o=H(e),o=U(t,o);void 0!==t[o]&&(n=o)}i||(_i[e]=n)}return n}function z(t,e,i,n,o){(e=B(t.style,e,o))&&(t.style[e]=n?i+n:i)}function q(t,e,i){return(e=B(t.style,e,i))?t.style[e]:void 0}function W(t,e){for(var i in e)z(t,i,e[i])}function j(t,e){void 0===e&&(e="none"==t.style.display),t.style.display=e?"":"none"}function Y(t){return t+"px"}function Q(t){return"string"==typeof t?"translateX("+t+")":"translateX("+Y(t)+")"}function G(t,e){return"number"==typeof t&&(t=Y(t)),void 0===e?"translate("+t+")":("number"==typeof e&&(e=Y(e)),"translate("+t+","+e+")")}function X(t){return"scale("+t+")"}function $(t){return"loading"!=t.readyState}function K(t,e){var i=$(t);if(i)e();else{var n=function(){"loading"!=t.readyState&&(i||(i=!0,e()),t.removeEventListener("readystatechange",n))};t.addEventListener("readystatechange",n)}}function Z(t){return new Promise(function(e){K(t,e)})}function J(t){return new wi(t)}function tt(t){return Qe.getService(t,"documentState",function(){return J(t)})}function et(t,e,i,n){var o=t.createElement("style");o.textContent=e,e=null,n?o.setAttribute("amp-runtime",""):e=t.querySelector("style[amp-runtime]"),nt(t.head,o,e);var r=function(){for(var e=t.styleSheets,i=0;i<e.length;i++)if(e[i].ownerNode==o)return!0;return!1};if(r())i();else var s=setInterval(function(){r()&&(clearInterval(s),i())},4)}function it(t){var e=void 0,i=function(){t.body&&(mi.setStyles(t.body,{opacity:1,visibility:"visible",animation:"none"}),clearInterval(e))},e=setInterval(i,4);i()}function nt(t,e,i){i?i.nextSibling?t.insertBefore(e,i.nextSibling):t.appendChild(e):t.insertBefore(e,t.firstChild)}function ot(t){return Qe.getService(t,"vsync")}function rt(t){return Qe.getElementService(t,"cid","amp-analytics")}function st(t,e,i,n){var o=n||!1;return t.addEventListener(e,i,o),function(){t.removeEventListener(e,i,o)}}function at(t,e,i,n){var o=n||!1,r=void 0,s=function(t){i(t),r()},r=function(){t.removeEventListener(e,s,o)};return t.addEventListener(e,s,o),r}function ut(t,e,i,n){var o=void 0,r=new Promise(function(n,r){o=at(t,e,n,i)});return ct(r,o,n)}function lt(t){return t.complete||"complete"==t.readyState}function ht(t,e){var i=void 0,n=void 0,o=new Promise(function(e,o){lt(t)?e(t):(i="AUDIO"===t.tagName||"VIDEO"===t.tagName?at(t,"loadstart",function(){return e(t)}):at(t,"load",function(){return e(t)}),n=at(t,"error",o))});return ct(o,function(){i&&i(),n&&n()},e)}function ct(t,e,i){var n=void 0,n=void 0===i?t:ui.timer.timeoutPromise(i||0,t);return e?n.then(function(t){return e(),t},function(t){throw e(),t}):n}function pt(t){return Qe.getService(t,"viewport")}function dt(t){return Qe.getService(t,"documentInfo",function(){return{canonicalUrl:qe.parseUrl(ze.assert(t.document.querySelector("link[rel=canonical]"),"AMP files are required to have a <link rel=canonical> tag.").href).href,pageViewId:ft(t)}})}function ft(t){return String(Math.floor(1e4*t.Math.random()))}function mt(t){return Qe.getElementService(t,"userNotificationManager","amp-user-notification")}function _t(t){return Qe.getService(t,"url-replace",function(){return new Pi(t)})}function gt(t){return t.replace(/-([a-z])/g,function(t,e){return e.toUpperCase()})}function yt(t,e,i){i=i||1;for(var n={matches:void 0},o=0;i>o&&(n.matches=0,t=t.replace(/\${([^}]*)}/g,function(t){return function(i,n){return t.matches++,e(n)}}(n)),n.matches);n={matches:n.matches},o++);return t}function vt(t){for(var e in Ri)if(Ri[e]==t)return Ri[e]}function bt(t){return"-amp-layout-"+t}function wt(t){return t==Ri.FIXED||t==Ri.FIXED_HEIGHT||t==Ri.RESPONSIVE||t==Ri.FILL}function St(t){return(t="string"==typeof t?t:t.tagName)&&0==t.toLowerCase().indexOf("i-")}function Et(t){return"number"==typeof t?t+"px":t&&/^\d+(\.\d+)?(px|em|rem|vh|vw|vmin|vmax)?$/.test(t)?/^\d+(\.\d+)?$/.test(t)?t+"px":t:void 0}function Tt(t){return ze.assert(/^\d+(\.\d+)?(px|em|rem|vh|vw|vmin|vmax)$/.test(t),"Invalid length value: %s",t),t}function At(t){return Tt(t),ze.assert(t.match(/[a-z]+/i),"Failed to read units from %s",t)[0]}function Ct(t){return parseFloat(t)}function Lt(t){return t=t.toUpperCase(),void 0!==Di[t]}function Ot(t){if(t=t.toUpperCase(),ze.assert(void 0!==Di[t]),!Di[t]){var e=t.replace(/^AMP\-/,""),e=document.createElement(e);e.controls=!0,e.style.position="absolute",e.style.visibility="hidden",document.body.appendChild(e),Di[t]={width:(e.offsetWidth||1)+"px",height:(e.offsetHeight||1)+"px"},document.body.removeChild(e)}return Di[t]}function It(t){return Vi[t.toUpperCase()]||!1}function kt(t){t=t.match(/\s*([^\s]*)(\s+(-?(\d+(\.(\d+)?)?|\.\d+)[a-zA-Z]))?(\s*,)?/g),ze.assert(0<t.length,"srcset has to have at least one source");var e=[];return t.forEach(function(t){t=t.trim(),","==t.substr(-1)&&(t=t.substr(0,t.length-1).trim());var i=t.split(/\s+/,2);if(0!=i.length&&(1!=i.length||i[0])&&(2!=i.length||i[0]||i[1]))if(t=i[0].trim(),1==i.length||2==i.length&&!i[1])e.push({url:t,dpr:1});else{var i=i[1].trim().toLowerCase(),n=i.substring(i.length-1);"w"==n?e.push({url:t,width:parseFloat(i)}):"x"==n&&e.push({url:t,dpr:parseFloat(i)})}}),new Ni(e)}function Pt(t,e,i,n){return{left:t,top:e,width:i,height:n,bottom:e+n,right:t+i}}function Mt(t){return{left:t.left,top:t.top,width:t.width,height:t.height,bottom:t.top+t.height,right:t.left+t.width}}function xt(t,e){return t.top<=e.bottom&&e.top<=t.bottom&&t.left<=e.right&&e.left<=t.right}function Rt(t,e){var i=Math.max(t.left,e.left),n=Math.min(t.left+t.width,e.left+e.width);if(n>=i){var o=Math.max(t.top,e.top),r=Math.min(t.top+t.height,e.top+e.height);if(r>=o)return Pt(i,o,n-i,r-o)}return null}function Dt(t,e,i){return{top:t.top-t.height*i,bottom:t.bottom+t.height*i,left:t.left-t.width*e,right:t.right+t.width*e,width:t.width*(1+2*e),height:t.height*(1+2*i)}}function Vt(t,e,i){return 0==e&&0==i?t:Pt(t.left+e,t.top+i,t.width,t.height)}function Ft(t){return Qe.getService(t,"platform",function(){return new qi(t)})}function Nt(t){return Qe.getService(t,"preconnect",function(){return new Gi(t)})}function Ht(t,e,i){var n=e.getAttribute("width"),o=e.getAttribute("height"),r=i||e.getAttribute("type");return ze.assert(r,"Attribute type required for <amp-ad>: %s",e),i={},Wt(e,i),i.width=xi.getLengthNumeral(n),i.height=xi.getLengthNumeral(o),n=e.getLayoutBox(),i.initialWindowWidth=n.width,i.initialWindowHeight=n.height,i.type=r,n=Li.documentInfoFor(t),o=t.location.href,"about:srcdoc"==o&&(o=t.parent.location.href),i._context={referrer:t.document.referrer,canonicalUrl:n.canonicalUrl,pageViewId:n.pageViewId,location:{href:o},mode:Xe.getMode()},(t=e.getAttribute("src"))&&(i.src=t),i}function Ut(t,e,i){return e=Ht(t,e,i),i=document.createElement("iframe"),$i[e.type]||($i[e.type]=0),i.name="frame_"+e.type+"_"+$i[e.type]++,t=Yt(t)+"#"+JSON.stringify(e),i.src=t,i.ampLocation=qe.parseUrl(t),i.width=e.width,i.height=e.height,i.style.border="none",i.setAttribute("scrolling","no"),i.onload=function(){this.readyState="complete"},i}function Bt(t,e,i){var n=t.ownerDocument.defaultView,o=t.ampLocation.origin,r=function(n){n.origin==o&&n.source==t.contentWindow&&n.data&&"amp-3p"==n.data.sentinel&&n.data.type==e&&i(n.data)};return n.addEventListener("message",r),function(){n.removeEventListener("message",r)}}function zt(t,e,i){var n=Bt(t,e,function(t){return n(),i(t)});return n}function qt(t,e,i){i.type=e,i.sentinel="amp-3p",t.contentWindow.postMessage(i,t.ampLocation.origin)}function Wt(t,e){for(var i=0;i<t.attributes.length;i++){var n=t.attributes[i];0==n.name.indexOf("data-")&&(e[Mi.dashToCamelCase(n.name.substr(5))]=n.value)}if(i=t.getAttribute("json")){n=void 0;try{n=JSON.parse(i)}catch(o){ze.assert(!1,"Error parsing JSON in json attribute in element %s",t)}for(var r in n)e[r]=n[r]}}function jt(t){var e=Yt(t);t=ji.preconnectFor(t),t.prefetch(e),t.prefetch("https://3p.ampproject.net/$internalRuntimeVersion$/f.js")}function Yt(t){return Qe.getService(window,"bootstrapBaseUrl",function(){return Gt(t)||Qt(t)})}function Qt(t){var e="https://3p.ampproject.net/$internalRuntimeVersion$/frame.html";return Xe.getMode().localDev&&(e="http://ads.localhost:"+t.location.port+"/dist.3p/current"+(Xe.getMode().minified?"-min/frame":"/frame.max")+".html"),e}function Gt(t){var e=t.document.querySelector('meta[name="amp-3p-iframe-src"]');if(!e)return null;var i=qe.assertHttpsUrl(e.getAttribute("content"),e);return ze.assert(-1==i.indexOf("?"),"3p iframe url must not include query string %s in element %s.",i,e),ze.assert(qe.parseUrl(i).origin!=qe.parseUrl(t.location.href).origin,"3p iframe url must not be on the same origin as the current document %s in element %s.",i,e),i+"?$internalRuntimeVersion$"}function Xt(t){t=t.split(","),ze.assert(0<t.length,"sizes has to have at least one size");var e=[];return t.forEach(function(t){if(t=t.replace(/\s+/g," ").trim(),0!=t.length){var i=void 0,n=void 0,n=t.lastIndexOf(" ");-1!=n?(i=t.substring(0,n).trim(),n=t.substring(n+1).trim()):(n=t,i=void 0),e.push({mediaQuery:i,size:xi.assertLength(n)})}}),new as(e)}function $t(t){var e=0;return function(i){var n=Math.pow(t||2,e++),o=.3*n*Math.random();.5<Math.random()&&(o*=-1),setTimeout(i,Math.round(1e3*(n+o)))}}function Kt(t,e){if(window.console&&!t.reported){t.reported=!0;var i=e||t.associatedElement;i&&(i.classList.add("-amp-error"),Xe.getMode().development&&(i.classList.add("-amp-element-error"),i.setAttribute("error-message",t.message))),t.messageArray?(console.error||console.log).apply(console,t.messageArray):(i?(console.error||console.log).call(console,i.tagName+"#"+i.id,t.message):(console.error||console.log).call(console,t.message),"production"!=Ue.env.NODE_ENV&&(console.error||console.log).call(console,t.stack)),i&&i.dispatchCustomEvent&&i.dispatchCustomEvent("amp:error",t.message),Jt(void 0,void 0,void 0,void 0,t)}}function Zt(t){t.onerror=Jt}function Jt(t,e,i,n,o){this&&this.document&&Si.makeBodyVisible(this.document);var r=Xe.getMode();if(!(r.isLocalDev||r.development||r.test)){var s=te(t,e,i,n,o);hs(function(){(new Image).src=s})}}function te(t,e,i,n,o){return t=o&&o.message?o.message:t,/_reported_/.test(t)?void 0:(t||(t="Unknown error"),t="https://amp-error-reporting.appspot.com/r?v="+encodeURIComponent("$internalRuntimeVersion$")+"&m="+encodeURIComponent(t),o?(t+="&a="+(o.fromAssert?1:0)+"&el="+encodeURIComponent(o&&o.associatedElement?o.associatedElement.tagName:"u")+"&s="+encodeURIComponent(o.stack||""),o.message+=" _reported_"):t+="&f="+encodeURIComponent(e)+"&l="+encodeURIComponent(i)+"&c="+encodeURIComponent(n||""),t.substr(0,2e3))}function ee(t){return Qe.getService(t,"input",function(){return new ms(t)})}function ie(t){return t=t.toLowerCase(),"amp-ad"==t?2:"amp-pixel"==t?1:0}function ne(t){return void 0!==t.length?t:[t]}function oe(t){return Qe.getService(t,"resources",function(){return new Ps(t)})}function re(){var t=document.createElement("div");t.classList.add("-amp-loader");for(var e=0;3>e;e++){var i=document.createElement("div");i.classList.add("-amp-loader-dot"),t.appendChild(i)}return t}function se(t,e,i){if(js[e])for(ze.assert(js[e]==Us,"Expected "+e+" to be an ElementStub."),t=0;t<Ns.stubbedElements.length;t++){var n=Ns.stubbedElements[t].element;if(n.tagName.toLowerCase()==e)try{n.upgrade(i)}catch(o){ls.reportError(o,this)}}else ce(t,e,i)}function ae(t){t.ampExtendedElements={};for(var e=t.document.querySelectorAll("[custom-element]"),i=0;i<e.length;i++){var n=e[i].getAttribute("custom-element");t.ampExtendedElements[n]=!0,js[n]||ce(t,n,Us)}}function ue(t){var e=t.getAttribute("layout"),i=t.getAttribute("width"),n=t.getAttribute("height"),o=t.getAttribute("sizes"),r=e?xi.parseLayout(e):null;ze.assert(void 0!==r,"Unknown layout: %s",e);var s=i&&"auto"!=i?xi.parseLength(i):i;ze.assert(void 0!==s,"Invalid width value: %s",i);var a=n?xi.parseLength(n):null;ze.assert(void 0!==a,"Invalid height value: %s",n);var u=e=void 0,l=void 0;return r&&r!=xi.Layout.FIXED&&r!=xi.Layout.FIXED_HEIGHT||s&&a||!xi.hasNaturalDimensions(t.tagName)?(e=s,u=a):(u=xi.getNaturalDimensions(t.tagName),e=s||r==xi.Layout.FIXED_HEIGHT?s:u.width,u=a||u.height),l=r?r:e||u?!u||e&&"auto"!=e?u&&e&&o?xi.Layout.RESPONSIVE:xi.Layout.FIXED:xi.Layout.FIXED_HEIGHT:xi.Layout.CONTAINER,l!=xi.Layout.FIXED&&l!=xi.Layout.FIXED_HEIGHT&&l!=xi.Layout.RESPONSIVE||ze.assert(u,"Expected height to be available: %s",n),l==xi.Layout.FIXED_HEIGHT&&ze.assert(!e||"auto"==e,'Expected width to be either absent or equal "auto" for fixed-height layout: %s',i),l!=xi.Layout.FIXED&&l!=xi.Layout.RESPONSIVE||ze.assert(e&&"auto"!=e,'Expected width to be available and not equal to "auto": %s',i),l==xi.Layout.RESPONSIVE&&ze.assert(xi.getLengthUnits(e)==xi.getLengthUnits(u),"Length units should be the same for width and height: %s, %s",i,n),t.classList.add(xi.getLayoutClass(l)),xi.isLayoutSizeDefined(l)&&t.classList.add("-amp-layout-size-defined"),l==xi.Layout.NODISPLAY?t.style.display="none":l==xi.Layout.FIXED?(t.style.width=e,t.style.height=u):l==xi.Layout.FIXED_HEIGHT?t.style.height=u:l==xi.Layout.RESPONSIVE&&(i=t.ownerDocument.createElement("i-amp-sizer"),i.style.display="block",i.style.paddingTop=xi.getLengthNumeral(u)/xi.getLengthNumeral(e)*100+"%",t.insertBefore(i,t.firstChild),t.sizerElement_=i),l}function le(t){return xi.isInternalElement(t)||t.tagName&&(t.hasAttribute("placeholder")||t.hasAttribute("fallback")||t.hasAttribute("overflow"))?!0:!1}function he(t,e,i){return e=t.Object.create(t.HTMLElement.prototype),e.createdCallback=function(){this.classList.add("-amp-element"),this.built_=!1,this.classList.add("-amp-notbuilt"),this.classList.add("amp-notbuilt"),this.readyState="loading",this.everAttached=!1,this.resources_=ys.resourcesFor(t),this.layout_=xi.Layout.NODISPLAY,this.layoutWidth_=-1,this.layoutCount_=0,this.isInViewport_=!1,this.loadingElement_=this.loadingContainer_=this.sizerElement_=null,this.implementation_=new i(this),this.implementation_.createdCallback(),this.actionQueue_=[]},e.assertNotTemplate_=function(){ze.assert(!this.isInTemplate_,"Must never be called in template")},e.isUpgraded=function(){return!(this.implementation_ instanceof Us)},e.upgrade=function(t){if(!this.isInTemplate_){if(this.implementation_=new t(this),this.classList.remove("amp-unresolved"),this.classList.remove("-amp-unresolved"),this.implementation_.createdCallback(),this.layout_!=xi.Layout.NODISPLAY&&!this.implementation_.isLayoutSupported(this.layout_))throw Error("Layout not supported: "+this.layout_);this.implementation_.layout_=this.layout_,this.implementation_.layoutWidth_=this.layoutWidth_,this.everAttached&&(this.implementation_.firstAttachedCallback(),this.dispatchCustomEvent("amp:attached")),this.resources_.upgraded(this)}},e.isBuilt=function(){return this.built_},e.build=function(t){if(this.assertNotTemplate_(),this.isBuilt())return!0;if(ze.assert(this.isUpgraded(),"Cannot build unupgraded element"),!t&&!this.implementation_.isReadyToBuild())return!1;try{this.implementation_.buildCallback(),this.preconnect(!1),this.built_=!0,this.classList.remove("-amp-notbuilt"),this.classList.remove("amp-notbuilt")}catch(e){throw ls.reportError(e,this),e}return this.built_&&this.isInViewport_&&this.updateInViewport_(!0),this.actionQueue_&&(0<this.actionQueue_.length?ui.timer.delay(this.dequeueActions_.bind(this),1):this.actionQueue_=null),!0},e.preconnect=function(t){this.implementation_.preconnectCallback(t)},e.getVsync_=function(){return Ei.vsyncFor(this.ownerDocument.defaultView)},e.updateLayoutBox=function(t){if(this.layoutWidth_=t.width,this.isUpgraded()&&(this.implementation_.layoutWidth_=this.layoutWidth_),this.implementation_.onLayoutMeasure(),this.isLoadingEnabled_())if(this.isInViewport_)this.toggleLoading_(!0);else if(t.top<Ws&&0<=t.top){var e=this;this.getVsync_().mutate(function(){e.prepareLoading_()})}},e.applySizesAndMediaQuery=function(){if(this.assertNotTemplate_(),void 0===this.mediaQuery_&&(this.mediaQuery_=this.getAttribute("media")||null),this.mediaQuery_&&this.classList.toggle("-amp-hidden-by-media-query",!this.ownerDocument.defaultView.matchMedia(this.mediaQuery_).matches),void 0===this.sizeList_){var t=this.getAttribute("sizes");this.sizeList_=t?ss.parseSizeList(t):null}this.sizeList_&&(this.style.width=xi.assertLength(this.sizeList_.select(this.ownerDocument.defaultView)))},e.changeHeight=function(t){this.sizerElement_&&(this.sizerElement_.style.paddingTop="0"),this.style.height=t+"px"},e.attachedCallback=function(){if(Ys||(this.isInTemplate_=!!ei.closestByTag(this,"template")),!this.isInTemplate_){if(!this.everAttached){this.everAttached=!0;try{this.firstAttachedCallback_()}catch(t){ls.reportError(t,this)}}this.resources_.add(this)}},e.detachedCallback=function(){this.isInTemplate_||this.resources_.remove(this)},e.firstAttachedCallback_=function(){this.isUpgraded()||(this.classList.add("amp-unresolved"),this.classList.add("-amp-unresolved"));try{if(this.layout_=ue(this),this.layout_!=xi.Layout.NODISPLAY&&!this.implementation_.isLayoutSupported(this.layout_))throw Error("Layout not supported for: "+this.layout_);this.implementation_.layout_=this.layout_,this.implementation_.firstAttachedCallback()}catch(t){throw ls.reportError(t,this),t}this.isUpgraded()?this.dispatchCustomEvent("amp:attached"):this.dispatchCustomEvent("amp:stubbed")},e.dispatchCustomEvent=function(t,e){var i=e||{},n=this.ownerDocument.defaultView.document.createEvent("Event");n.data=i,n.initEvent(t,!0,!0),this.dispatchEvent(n)},e.prerenderAllowed=function(){return this.implementation_.prerenderAllowed()},e.renderOutsideViewport=function(){return this.implementation_.renderOutsideViewport()},e.getLayoutBox=function(){return this.resources_.getResourceForElement(this).getLayoutBox()},e.isRelayoutNeeded=function(){return this.implementation_.isRelayoutNeeded()},e.layoutCallback=function(){var t=this;this.assertNotTemplate_(),ze.assert(this.isUpgraded()&&this.isBuilt(),"Must be upgraded and built to receive viewport events"),this.dispatchCustomEvent("amp:load:start");var e=this.implementation_.layoutCallback();return this.preconnect(!0),this.classList.add("-amp-layout"),e.then(function(){t.readyState="complete",t.layoutCount_++,t.toggleLoading_(!1,!0),1==t.layoutCount_&&t.implementation_.firstLayoutCompleted()},function(e){return t.toggleLoading_(!1,!0),Promise.reject(e)})},e.viewportCallback=function(t){if(this.assertNotTemplate_(),this.isInViewport_=t,0==this.layoutCount_)if(t){var e=this;ui.timer.delay(function(){0==e.layoutCount_&&e.isInViewport_&&e.toggleLoading_(!0)},100)}else this.toggleLoading_(!1);this.isUpgraded()&&this.isBuilt()&&this.updateInViewport_(t)},e.updateInViewport_=function(t){this.implementation_.inViewport_=t,this.implementation_.viewportCallback(t)},e.documentInactiveCallback=function(){return this.assertNotTemplate_(),this.isBuilt()&&this.isUpgraded()?this.implementation_.documentInactiveCallback():!1},e.enqueAction=function(t){this.assertNotTemplate_(),this.isBuilt()?this.executionAction_(t,!1):ze.assert(this.actionQueue_).push(t)},e.dequeueActions_=function(){var t=this;if(this.actionQueue_){var e=ze.assert(this.actionQueue_);this.actionQueue_=null,e.forEach(function(e){t.executionAction_(e,!0)})}},e.executionAction_=function(t,e){try{this.implementation_.executeAction(t,e)}catch(i){Ke.log.error(zs,"Action execution failed:",t,i)}},e.getRealChildNodes=function(){for(var t=[],e=this.firstChild;e;e=e.nextSibling)le(e)||t.push(e);return t},e.getRealChildren=function(){for(var t=[],e=0;e<this.children.length;e++){var i=this.children[e];le(i)||t.push(i)}return t},e.getPlaceholder=function(){return ei.childElementByAttr(this,"placeholder")},e.togglePlaceholder=function(t){this.assertNotTemplate_();var e=this.getPlaceholder();e&&e.classList.toggle("amp-hidden",!t)},e.getFallback=function(){return ei.childElementByAttr(this,"fallback")},e.toggleFallback=function(t){this.assertNotTemplate_(),this.classList.toggle("amp-notsupported",t)},e.isLoadingEnabled_=function(){return void 0===this.loadingDisabled_&&(this.loadingDisabled_=this.hasAttribute("noloading")),this.loadingDisabled_||!xi.isLoadingAllowed(this.tagName)||this.layoutWidth_<qs||0<this.layoutCount_||le(this)||!xi.isLayoutSizeDefined(this.layout_)?!1:!0},e.prepareLoading_=function(){if(!this.loadingContainer_){var t=document.createElement("div");t.classList.add("-amp-loading-container"),t.classList.add("-amp-fill-content"),t.classList.add("amp-hidden");var e=Ds.createLoaderElement();t.appendChild(e),this.appendChild(t),this.loadingContainer_=t,this.loadingElement_=e}},e.toggleLoading_=function(t,e){var i=this;this.assertNotTemplate_(),((this.loadingState_=t)||this.loadingContainer_)&&(t&&!this.isLoadingEnabled_()?this.loadingState_=!1:this.getVsync_().mutate(function(){var t=i.loadingState_;if(t&&!i.isLoadingEnabled_()&&(t=!1),t&&i.prepareLoading_(),i.loadingContainer_&&(i.loadingContainer_.classList.toggle("amp-hidden",!t),i.loadingElement_.classList.toggle("amp-active",t),!t&&e)){var n=i.loadingContainer_;i.loadingContainer_=null,i.loadingElement_=null,i.resources_.deferMutate(i,function(){ei.removeElement(n)})}}))},e.getOverflowElement=function(){return void 0===this.overflowElement_&&(this.overflowElement_=ei.childElementByAttr(this,"overflow"))&&(this.overflowElement_.hasAttribute("tabindex")||this.overflowElement_.setAttribute("tabindex","0"),this.overflowElement_.hasAttribute("role")||this.overflowElement_.setAttribute("role","button")),this.overflowElement_},e.overflowCallback=function(t,e){if(t||this.overflowElement_){var i=this.getOverflowElement();if(i)if(i.classList.toggle("amp-visible",t),t){var n=this;this.overflowElement_.onclick=function(){n.resources_.changeHeight(n,e),n.getVsync_().mutate(function(){n.overflowCallback(!1,e)})}}else this.overflowElement_.onclick=null;else t&&Ke.log.warn(zs,"Cannot resize element and overlfow is not available",this)}},e}function ce(t,e,i){js[e]=i,t.document.registerElement(e,{prototype:he(t,e,i)})}function pe(t,e,i){Bs.upgradeOrRegisterElement(t,e,i)}function de(t,e){var i,n=qe.parseQueryString(t);for(i in n)e[i]=n[i]}function fe(t){return Qe.getService(t,"viewer",function(){return new Js(t)})}function me(t){return Qe.getService(t,"vsync",function(){return new ia(t,Gs.installViewerService(t))})}function _e(t){var e=Object.create(null);if(!t)return e;t=t.split(",");for(var i=0;i<t.length;i++){var n=t[i].split("="),o=n[0].trim(),n=n[1],n=(n||"").trim();o&&(e[o]=n)}return e}function ge(t){var e,i="";for(e in t)0<i.length&&(i+=","),i=t[e]?i+(e+"="+t[e]):i+e;return i}function ye(t,e){var i,n=_e(t),o=!1;for(i in e)n[i]!==e[i]&&(o=!0,void 0!==e[i]?n[i]=e[i]:delete n[i]);return o?ge(n):t}function ve(t){var e=Gs.installViewerService(t),i=void 0,i="virtual"==e.getViewportType()?new la(t,e):"natural-ios-embed"==e.getViewportType()?new ua(t):new aa(t);return new ra(t,i,e)}function be(t){return Qe.getService(t,"viewport",function(){return ve(t)})}function we(t){return Qe.getService(t,"action",function(){return new _a(t)})}function Se(t){var e={};return e[va]=t,e}function Ee(t){var e=Gs.installViewerService(t),i=void 0,i=e.isOvertakeHistory()?new Ea(e):new Sa(t);return new ba(i)}function Te(t){Qe.getService(t,"history",function(){return Ee(t)})}function Ae(t){Gs.installViewerService(t),na.installViewportService(t),ga.installHistoryService(t),ta.installVsyncService(t),ha.installActionService(t)}function Ce(t){return Qe.getService(t,"performance",function(){return new La(t)})}function Le(t){if(!t.AMP_TAG){t.AMP_TAG=!0;var e=t.AMP||[];t.AMP={win:t},t.AMP.registerElement=function(e,i,n){var o=function(){Qs.registerExtendedElement(t,e,i),Ia.push({name:e,implementationClass:i})};n?Si.installStyles(t.document,n,o):o()},t.AMP.BaseElement=Fs,t.AMP.BaseTemplate=ri,t.AMP.registerTemplate=function(e,i){ii.registerExtendedTemplate(t,e,i)},t.AMP.assert=ze.assert,Ta.installCoreServices(t);var i=Ge.viewerFor(t);for(t.AMP.viewer=i,Xe.getMode().development&&(t.AMP.toggleRuntime=i.toggleRuntime.bind(i),t.AMP.resources=ys.resourcesFor(t),t.AMP.isExperimentOn=ci.isExperimentOn.bind(null,t),t.AMP.toggleExperiment=ci.toggleExperiment.bind(null,t)),i=Ci.viewportFor(t),t.AMP.viewport={},t.AMP.viewport.getScrollLeft=i.getScrollLeft.bind(i),t.AMP.viewport.getScrollWidth=i.getScrollWidth.bind(i),t.AMP.viewport.getWidth=i.getWidth.bind(i),t.AMP.push=function(i){e.push(i),i(t.AMP)},t.AMP.setTickFunction=function(e,i){Aa.performanceFor(t).setTickFunction(e,i)},i=0;i<e.length;i++){var n=e[i];try{n(t.AMP)}catch(o){ui.timer.delay(function(){throw o},1)}}}}function Oe(t){for(var e=0;e<Ia.length;e++){var i=Ia[e];Bs.registerElement(t,i.name,i.implementationClass)}}function Ie(t){var e=function(t){Fs.apply(this,arguments)};Be.inherits(e,Fs),e.prototype.isLayoutSupported=function(t){return xi.isLayoutSizeDefined(t)},e.prototype.layoutCallback=function(){var t=this.element.getAttribute("width"),e=this.element.getAttribute("height"),i=document.createElement("video");return i.play?(this.element.getAttribute("src")&&qe.assertHttpsUrl(this.element.getAttribute("src"),this.element),this.propagateAttributes("src controls autoplay muted loop poster".split(" "),i),i.width=xi.getLengthNumeral(t),i.height=xi.getLengthNumeral(e),this.applyFillContent(i,!0),this.getRealChildNodes().forEach(function(t){t.getAttribute&&t.getAttribute("src")&&qe.assertHttpsUrl(t.getAttribute("src"),t),i.appendChild(t)}),this.element.appendChild(i),this.video_=i,mi.setStyles(i,{visibility:"hidden"}),Ai.loadPromise(i).then(function(){mi.setStyles(i,{visibility:""})})):(this.toggleFallback(!0),Promise.resolve())},e.prototype.documentInactiveCallback=function(){return this.video_&&this.video_.pause(),!1},Bs.registerElement(t,"amp-video",e)}function ke(t){if(Xe.getMode().development){var e=t.location.href;if(0!=e.indexOf("about:")){var i=document.createElement("script");i.src="https://cdn.ampproject.org/v0/validator.js",i.onload=function(){t.document.head.removeChild(i),amp.validator.validateUrlAndLog(e,t.document)},t.document.head.appendChild(i)}}}function Pe(t){xe(t)}function Me(t){xe(t).cleanup()}function xe(t){return Qe.getService(t,"clickhandler",function(){return new xa(t)})}function Re(t,e){if(!t.defaultPrevented){var i=ei.closestByTag(t.target,"A");if(i){var n=null,o=t.currentTarget.ownerDocument,n=qe.parseUrl(i.href);n.hash&&(i=qe.parseUrl(o.location.href),""+n.origin+n.pathname+n.search==""+i.origin+i.pathname+i.search&&(t.preventDefault(),i=n.hash.slice(1),(n=o.getElementById(i))||(n=o.querySelector("a[name="+i+"]")),n?e.scrollIntoView(n):Ke.log.warn("documentElement","failed to find element with id="+i+" or a[name="+i+"]")))}}}function De(t){"0"==Ge.viewerFor(t).getParam("p2r")&&zi.platformFor(t).isChrome()&&new Da(t.document,Ci.viewportFor(t))}function Ve(t){var e=function(t){Fs.apply(this,arguments)};Be.inherits(e,Fs),e.prototype.isLayoutSupported=function(t){return t==xi.Layout.FIXED},e.prototype.buildCallback=function(){this.element.style.width="",this.element.style.height="",this.element.setAttribute("aria-hidden","true");
},e.prototype.layoutCallback=function(){var t=this,e=this.element.getAttribute("src");return Ii.urlReplacementsFor(this.getWin()).expand(this.assertSource(e)).then(function(e){var i=new Image;i.src=e,i.width=1,i.height=1,t.element.style.width=0,t.element.appendChild(i)})},e.prototype.assertSource=function(t){return ze.assert(/^(https\:\/\/|\/\/)/i.test(t),'The <amp-pixel> src attribute must start with "https://" or "//". Invalid value: '+t),t},Bs.registerElement(t,"amp-pixel",e)}function Fe(t,e,i){e.x=e.left,e.y=e.top;var n=Bi.moveLayoutRect(i,-1*e.x,-1*e.y);return ze.assert(0<=n.width&&0<=n.height,"Negative dimensions in ad."),n.x=n.left,n.y=n.top,i=Bi.rectIntersection(e,i)||Bi.layoutRectLtwh(0,0,0,0),i.x=i.left,i.y=i.top,{time:t,rootBounds:e,boundingClientRect:n,intersectionRect:i}}function Ne(t){var e=0,i=function(t){Fs.apply(this,arguments)};Be.inherits(i,Fs),i.prototype.renderOutsideViewport=function(){return this.getViewport().hasScrolled()?e>0?!1:!0:!1},i.prototype.isLayoutSupported=function(t){return xi.isLayoutSizeDefined(t)},i.prototype.isReadyToBuild=function(){return!1},i.prototype.buildCallback=function(){this.iframe_=null,this.placeholder_=this.getPlaceholder(),this.fallback_=this.getFallback(),this.isInFixedContainer_=!1,this.unlistenViewportChanges_=this.iframeLayoutBox_=null,this.shouldSendIntersectionChanges_=!1},i.prototype.preconnectCallback=function(t){Xi.prefetchBootstrap(this.getWin());var e=this.element.getAttribute("type"),i=We.adPrefetch[e],e=We.adPreconnect[e];if("string"==typeof i)this.preconnect.prefetch(i);else if(i){var n=this;i.forEach(function(t){n.preconnect.prefetch(t)})}if("string"==typeof e)this.preconnect.url(e,t);else if(e){var o=this;e.forEach(function(e){o.preconnect.url(e,t)})}(i=this.element.getAttribute("src"))&&this.preconnect.url(i)},i.prototype.onLayoutMeasure=function(){this.isInFixedContainer_=this.isPositionFixed(),this.measureIframeLayoutBox_(),this.sendAdIntersection_()},i.prototype.measureIframeLayoutBox_=function(){this.iframe_&&(this.iframeLayoutBox_=this.getViewport().getLayoutRect(this.iframe_))},i.prototype.isPositionFixed=function(){var t=this.element,e=t.ownerDocument.body;do{if(Ha[t.tagName])break;if("fixed"==this.getWin().getComputedStyle(t).position)return!0;t=t.parentNode}while(t.getAttribute&&t!=e);return!1},i.prototype.layoutCallback=function(){if(e++,ui.timer.delay(function(){e--},1e3),ze.assert(!this.isInFixedContainer_,"<amp-ad> is not allowed to be placed in elements with position:fixed: %s",this.element),!this.iframe_){var t=this;this.iframe_=Xi.getIframe(this.element.ownerDocument.defaultView,this.element),this.applyFillContent(this.iframe_),this.element.appendChild(this.iframe_),Xi.listenOnce(this.iframe_,"no-content",function(){t.noContentHandler_()}),Xi.listenOnce(this.iframe_,"entity-id",function(e){t.element.setAttribute("creative-id",e.id)}),Xi.listen(this.iframe_,"send-intersections",function(){t.startSendingIntersectionChanges_()})}return Ai.loadPromise(this.iframe_)},i.prototype.viewportCallback=function(t){if(this.sendAdIntersection_(),t){t=this.sendAdIntersection_.bind(this);var e=this.getViewport().onScroll(t),i=this.getViewport().onChanged(t);this.unlistenViewportChanges_=function(){e(),i()}}else this.unlistenViewportChanges_&&(this.unlistenViewportChanges_(),this.unlistenViewportChanges_=null)},i.prototype.startSendingIntersectionChanges_=function(){var t=this;this.shouldSendIntersectionChanges_=!0,this.getVsync().measure(function(){t.iframeLayoutBox_||t.measureIframeLayoutBox_(),t.sendAdIntersection_()})},i.prototype.sendAdIntersection_=function(){if(this.shouldSendIntersectionChanges_&&this.iframeLayoutBox_){var t=this.getViewport().getRect(),t=Fa.getIntersectionChangeEntry(ui.timer.now(),t,this.iframeLayoutBox_);Xi.postMessage(this.iframe_,"intersection",{changes:[t]})}},i.prototype.noContentHandler_=function(){var t=this;if(!this.fallback_){var e=this;this.attemptChangeHeight(0,function(){e.element.style.display="none"})}this.deferMutate(function(){t.fallback_&&t.toggleFallback(!0),t.element.removeChild(t.iframe_)})},Bs.registerElement(t,"amp-ad",i)}function He(t){var e=function(t){Fs.apply(this,arguments)};Be.inherits(e,Fs),e.prototype.isLayoutSupported=function(t){return xi.isLayoutSizeDefined(t)},e.prototype.buildCallback=function(){this.img_=new Image,this.element.id&&this.img_.setAttribute("amp-img-id",this.element.id),this.propagateAttributes(["alt"],this.img_),this.applyFillContent(this.img_,!0),this.img_.width=xi.getLengthNumeral(this.element.getAttribute("width")),this.img_.height=xi.getLengthNumeral(this.element.getAttribute("height")),this.element.appendChild(this.img_),this.srcset_=Fi.parseSrcset(this.element.getAttribute("srcset")||this.element.getAttribute("src"))},e.prototype.prerenderAllowed=function(){return!0},e.prototype.isRelayoutNeeded=function(){return!0},e.prototype.layoutCallback=function(){return this.updateImageSrc_()},e.prototype.updateImageSrc_=function(){if(0>=this.getLayoutWidth())return Promise.resolve();var t=this.srcset_.select(this.getLayoutWidth(),this.getDpr()).url;return t==this.img_.getAttribute("src")?Promise.resolve():(this.img_.setAttribute("src",t),Ai.loadPromise(this.img_))},Bs.registerElement(t,"amp-img",e)}var Ue={env:{}},Be={scope:{},getGlobal:function(t){return"undefined"!=typeof window&&window===t?t:"undefined"!=typeof global?global:t}};Be.global=Be.getGlobal(this),Be.initSymbol=function(){Be.global.Symbol||(Be.global.Symbol=Be.Symbol),Be.initSymbol=function(){}},Be.symbolCounter_=0,Be.Symbol=function(t){return"jscomp_symbol_"+t+Be.symbolCounter_++},Be.initSymbolIterator=function(){Be.initSymbol(),Be.global.Symbol.iterator||(Be.global.Symbol.iterator=Be.global.Symbol("iterator")),Be.initSymbolIterator=function(){}},Be.makeIterator=function(t){if(Be.initSymbolIterator(),t[Be.global.Symbol.iterator])return t[Be.global.Symbol.iterator]();if(!(t instanceof Array||"string"==typeof t||t instanceof String))throw new TypeError(t+" is not iterable");var e=0;return{next:function(){return e==t.length?{done:!0}:{done:!1,value:t[e++]}}}},Be.arrayFromIterator=function(t){for(var e,i=[];!(e=t.next()).done;)i.push(e.value);return i},Be.arrayFromIterable=function(t){return t instanceof Array?t:Be.arrayFromIterator(Be.makeIterator(t))},Be.arrayFromArguments=function(t){for(var e=[],i=0;i<t.length;i++)e.push(t[i]);return e},Be.inherits=function(t,e){function i(){}i.prototype=e.prototype,t.prototype=new i,t.prototype.constructor=t;for(var n in e)if(Be.global.Object.defineProperties){var o=Be.global.Object.getOwnPropertyDescriptor(e,n);void 0!==o&&Be.global.Object.defineProperty(t,n,o)}else t[n]=e[n]};var ze={};ze.assert=t,ze.assertEnumValue=e;var qe={};qe.parseUrl=o,qe.addParamToUrl=r,qe.addParamsToUrl=s,qe.assertHttpsUrl=a,qe.parseQueryString=u,qe.getOrigin=l,qe.removeFragment=h;var We={},je={doubleclick:"https://www.googletagservices.com/tag/js/gpt.js",a9:"https://c.amazon-adsystem.com/aax2/assoc.js",adsense:"https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"},Ye={adreactor:"https://adserver.adreactor.com",adsense:"https://googleads.g.doubleclick.net",doubleclick:["https://partner.googleadservices.com","https://securepubads.g.doubleclick.net","https://tpc.googlesyndication.com"]};We.adPrefetch=je,We.adPreconnect=Ye;var Qe={};Qe.getService=c,Qe.getElementService=p,Qe.markElementScheduledForTesting=m,Qe.resetServiceForTesting=g;var Ge={};Ge.viewerFor=y;var Xe={},$e=null;Xe.getMode=v,Xe.setModeForTesting=b;var Ke={},Ze=(new Date).getTime(),Je=function(t){this.win=t.AMP_TEST?t.parent:t,this.isEnabled_=this.shouldBeEnabled_()};Je.prototype.shouldBeEnabled_=function(){if(!this.win.console||!this.win.console.log)return!1;if(this.win.ENABLE_LOG)return!0;var t=this.win.location.hash.match(/log=(\d)/),t=t&&t[1];return Xe.getMode().localDev&&"0"!=t||this.win.location.hash&&"1"==t?!0:!1},Je.prototype.msg_=function(t,e,i){if(this.isEnabled_){var n=this.win.console.log;"ERROR"==e?n=this.win.console.error||n:"INFO"==e?n=this.win.console.info||n:"WARN"==e&&(n=this.win.console.warn||n),i.unshift((new Date).getTime()-Ze,"["+t+"]"),n.apply(this.win.console,i)}},Je.prototype.fine=function(t,e){this.isEnabled_&&this.msg_(t,"FINE",Array.prototype.slice.call(arguments,1))},Je.prototype.info=function(t,e){this.isEnabled_&&this.msg_(t,"INFO",Array.prototype.slice.call(arguments,1))},Je.prototype.warn=function(t,e){this.isEnabled_&&this.msg_(t,"WARN",Array.prototype.slice.call(arguments,1))},Je.prototype.error=function(t,e){this.isEnabled_&&this.msg_(t,"ERROR",Array.prototype.slice.call(arguments,1))};var ti=new Je(window);Ke.Log=Je,Ke.log=ti;var ei={};ei.removeElement=S,ei.removeChildren=E,ei.copyChildren=T,ei.closest=A,ei.closestByTag=C,ei.elementByTag=L,ei.childElement=O,ei.childElementByAttr=I,ei.childElementByTag=k;var ii={},ni="__AMP_IMPL_",oi="__AMP_WAIT_",ri=function(t){this.element=t,this.compileCallback()};ri.prototype.getWin=function(){return this.element.ownerDocument.defaultView},ri.prototype.compileCallback=function(){},ri.prototype.render=function(t){throw Error("Not implemented")},ri.prototype.unwrap=function(t){for(var e=null,i=t.firstChild;null!=i;i=i.nextSibling)if(3==i.nodeType){if(i.textContent.trim()){e=null;break}}else if(8!=i.nodeType)if(1==i.nodeType){if(e){e=null;break}e=i}else e=null;return e||t};var si=function(t){this.win_=t,this.templateClassMap_={},this.templateClassResolvers_={}};si.prototype.renderTemplate=function(t,e){return this.getImplementation_(t).then(function(t){return t.render(e)})},si.prototype.renderTemplateArray=function(t,e){return 0==e.length?Promise.resolve([]):this.getImplementation_(t).then(function(t){return e.map(function(e){return t.render(e)})})},si.prototype.findAndRenderTemplate=function(t,e){return this.renderTemplate(this.findTemplate_(t),e)},si.prototype.findAndRenderTemplateArray=function(t,e){return this.renderTemplateArray(this.findTemplate_(t),e)},si.prototype.findTemplate_=function(t){var e=null,e=(e=t.getAttribute("template"))?t.ownerDocument.getElementById(e):ei.childElementByTag(t,"template");return ze.assert(e,"Template not found for %s",t),ze.assert("TEMPLATE"==e.tagName,'Template element must be a "template" tag %s',e),e},si.prototype.getImplementation_=function(t){var e=t[ni];if(e)return Promise.resolve(e);var e=ze.assert(t.getAttribute("type"),"Type must be specified: %s",t),i=t[oi];return i?i:(i=this.waitForTemplateClass_(t,e).then(function(e){return e=t[ni]=new e(t),delete t[oi],e}),t[oi]=i)},si.prototype.waitForTemplateClass_=function(t,e){if(this.templateClassMap_[e])return this.templateClassMap_[e];this.checkTemplateDeclared_(t,e);var i=void 0,n=new Promise(function(t,e){i=t});return this.templateClassMap_[e]=n,this.templateClassResolvers_[e]=i,n},si.prototype.checkTemplateDeclared_=function(t,e){if(!this.declaredTemplates_){this.declaredTemplates_=this.win_.Object.create(null);for(var i=this.win_.document.querySelectorAll("script[custom-template]"),n=0;n<i.length;n++)this.declaredTemplates_[i[n].getAttribute("custom-template")]=!0}ze.assert(this.declaredTemplates_[e],"Template must be declared for %s as <script custom-template=%s>",t,e)},si.prototype.registerTemplate_=function(t,e){if(this.templateClassMap_[t]){var i=this.templateClassResolvers_[t];ze.assert(i,"Duplicate template type: %s",t),delete this.templateClassResolvers_[t],i(e)}else this.templateClassMap_[t]=Promise.resolve(e)},ii.BaseTemplate=ri,ii.Templates=si,ii.registerExtendedTemplate=P,ii.templatesFor=M;var ai={};ai.getCookie=x,ai.setCookie=R;var ui={},li=function(t){this.win=t,this.resolved_=Promise.resolve(),this.taskCount_=0,this.canceled_={},this.startTime_=this.now()};li.prototype.now=function(){return Number(new Date)},li.prototype.timeSinceStart=function(){return this.now()-this.startTime_},li.prototype.delay=function(t,e){if(!e){var i=this,n="p"+this.taskCount_++;return this.resolved_.then(function(){i.canceled_[n]?delete i.canceled_[n]:t()}),n}return this.win.setTimeout(t,e)},li.prototype.cancel=function(t){"string"==typeof t?this.canceled_[t]=!0:this.win.clearTimeout(t)},li.prototype.promise=function(t,e){var i=this,n=null;return new Promise(function(o,r){n=i.delay(function(){n=-1,o(e)},t),-1==n&&r(Error("Failed to schedule timer."))})["catch"](function(t){return-1!=n&&i.cancel(n),Promise.reject(t)})},li.prototype.timeoutPromise=function(t,e){var i=this,n=null,o=new Promise(function(e,o){n=i.delay(function(){n=-1,o("timeout")},t),-1==n&&o(Error("Failed to schedule timer."))})["catch"](function(t){return-1!=n&&i.cancel(n),Promise.reject(t)});return e?new Promise(function(t,i){o.then(t,i),e.then(t,i)}):o};var hi=new li(window);ui.Timer=li,ui.timer=hi;var ci={},pi="AMP_EXP",di=180,fi=864e5*di;ci.isExperimentOn=D,ci.toggleExperiment=V;var mi={},_i=Object.create(null),gi="Webkit webkit Moz moz ms O o".split(" ");mi.camelCaseToTitleCase=H,mi.getVendorJsPropertyName=B,mi.setStyle=z,mi.getStyle=q,mi.setStyles=W,mi.toggle=j,mi.px=Y,mi.translateX=Q,mi.translate=G,mi.scale=X;var yi={},vi=function(){this.handlers_=[]};vi.prototype.add=function(t){var e=this;return this.handlers_.push(t),function(){e.remove(t)}},vi.prototype.remove=function(t){for(var e=0;e<this.handlers_.length;e++)if(t==this.handlers_[e]){this.handlers_.splice(e,1);break}},vi.prototype.fire=function(t){this.handlers_.forEach(function(e){e(t)})},vi.prototype.getHandlerCount=function(){return this.handlers_.length},yi.Observable=vi;var bi={},wi=function(t){this.win=t,this.document_=t.document,this.hiddenProp_=mi.getVendorJsPropertyName(this.document_,"hidden",!0),void 0===this.document_[this.hiddenProp_]&&(this.hiddenProp_=null),this.visibilityStateProp_=mi.getVendorJsPropertyName(this.document_,"visibilityState",!0),void 0===this.document_[this.visibilityStateProp_]&&(this.visibilityStateProp_=null),this.visibilityObservable_=new vi,this.visibilityChangeEvent_=null,this.hiddenProp_&&(this.visibilityChangeEvent_="visibilitychange",t=this.hiddenProp_.indexOf("Hidden"),-1!=t&&(this.visibilityChangeEvent_=this.hiddenProp_.substring(0,t)+"Visibilitychange")),this.boundOnVisibilityChanged_=this.onVisibilityChanged_.bind(this),this.visibilityChangeEvent_&&this.document_.addEventListener(this.visibilityChangeEvent_,this.boundOnVisibilityChanged_)};wi.prototype.cleanup_=function(){this.visibilityChangeEvent_&&this.document_.removeEventListener(this.visibilityChangeEvent_,this.boundOnVisibilityChanged_)},wi.prototype.isReady=function(){return $(this.document_)},wi.prototype.onReady=function(t){return K(this.document_,t)},wi.prototype.isHidden=function(){return this.hiddenProp_?this.document_[this.hiddenProp_]:!1},wi.prototype.getVisibilityState=function(){return this.visibilityStateProp_?this.document_[this.visibilityStateProp_]:this.isHidden()?"hidden":"visible"},wi.prototype.onVisibilityChanged=function(t){return this.visibilityObservable_.add(t)},wi.prototype.onVisibilityChanged_=function(){this.visibilityObservable_.fire()},bi.isDocumentReady=$,bi.onDocumentReady=K,bi.whenDocumentReady=Z,bi.DocumentState=wi,bi.documentStateFor=tt;var Si={};Si.installStyles=et,Si.makeBodyVisible=it;var Ei={};Ei.vsyncFor=ot;var Ti={};Ti.cidFor=rt;var Ai={};Ai.listen=st,Ai.listenOnce=at,Ai.listenOncePromise=ut,Ai.isLoaded=lt,Ai.loadPromise=ht;var Ci={};Ci.viewportFor=pt;var Li={};Li.documentInfoFor=dt;var Oi={};Oi.userNotificationManagerFor=mt;var Ii={},ki="UrlReplacements",Pi=function(t){var e=this;this.win_=t,this.replacements_=this.win_.Object.create(null),this.set_("RANDOM",function(){return Math.random()}),this.set_("CANONICAL_URL",function(){return Li.documentInfoFor(e.win_).canonicalUrl}),this.set_("CANONICAL_HOST",function(){var t=qe.parseUrl(Li.documentInfoFor(e.win_).canonicalUrl);return t&&t.hostname}),this.set_("CANONICAL_PATH",function(){var t=qe.parseUrl(Li.documentInfoFor(e.win_).canonicalUrl);return t&&t.pathname}),this.set_("DOCUMENT_REFERRER",function(){return e.win_.document.referrer}),this.set_("TITLE",function(){return e.win_.document.title}),this.set_("AMPDOC_URL",function(){return qe.removeFragment(e.win_.location.href)}),this.set_("AMPDOC_HOST",function(){var t=qe.parseUrl(e.win_.location.href);return t&&t.hostname}),this.set_("PAGE_VIEW_ID",function(){return Li.documentInfoFor(e.win_).pageViewId}),this.set_("CLIENT_ID",function(t,i){var n=Promise.resolve();return i&&(n=Oi.userNotificationManagerFor(e.win_).then(function(t){return t.get(i)})),Ti.cidFor(e.win_).then(function(e){return e.get(t,n)})}),this.set_("TIMESTAMP",function(){return(new Date).getTime()}),this.set_("TIMEZONE",function(){return(new Date).getTimezoneOffset()}),this.set_("SCROLL_TOP",function(){return Ei.vsyncFor(e.win_).measurePromise(function(){return Ci.viewportFor(e.win_).getScrollTop()})}),this.set_("SCROLL_LEFT",function(){return Ei.vsyncFor(e.win_).measurePromise(function(){return Ci.viewportFor(e.win_).getScrollLeft()})}),this.set_("SCROLL_HEIGHT",function(){return Ei.vsyncFor(e.win_).measurePromise(function(){return Ci.viewportFor(e.win_).getScrollHeight()})}),this.set_("SCREEN_WIDTH",function(){return e.win_.screen.width}),this.set_("SCREEN_HEIGHT",function(){return e.win_.screen.height})};Pi.prototype.set_=function(t,e){return this.replacements_[t]=e,this.replacementExpr_=void 0,this},Pi.prototype.expand=function(t,e){var i=this,n=this.getExpr_(e),o=void 0,r=function(t){return t||0===t||(t=""),encodeURIComponent(t)};return t=t.replace(n,function(n,s,a){var u=[];if("string"==typeof a&&(u=a.split(",")),(a=0==u.length&&e&&s in e?e[s]:i.replacements_[s].apply(i.replacements_,u))&&a.then){var l=a.then(function(e){t=t.replace(n,r(e))},function(t){Ke.log.error(ki,"Failed to expand: "+s,t)});return o=o?o.then(function(){return l}):l,n}return r(a)}),o&&(o=o.then(function(){return t})),o||Promise.resolve(t)},Pi.prototype.getExpr_=function(t){if((t=t?Object.keys(t):null)&&0<t.length){var e=Object.keys(this.replacements_);return t.forEach(function(t){void 0===e[t]&&e.push(t)}),this.buildExpr_(e)}return this.replacementExpr_||(this.replacementExpr_=this.buildExpr_(Object.keys(this.replacements_))),this.replacementExpr_},Pi.prototype.buildExpr_=function(t){return t=t.join("|"),new RegExp("\\$?("+t+")(?:\\(([0-9a-zA-Z-_,]+)\\))?","g")},Ii.urlReplacementsFor=_t;var Mi={};Mi.dashToCamelCase=gt,Mi.expandTemplate=yt;var xi={},Ri={NODISPLAY:"nodisplay",FIXED:"fixed",FIXED_HEIGHT:"fixed-height",RESPONSIVE:"responsive",CONTAINER:"container",FILL:"fill"},Di={"AMP-PIXEL":{width:"1px",height:"1px"},"AMP-ANALYTICS":{width:"1px",height:"1px"},"AMP-AUDIO":null},Vi={"AMP-ANIM":!0,"AMP-BRIGHTCOVE":!0,"AMP-IFRAME":!0,"AMP-IMG":!0,"AMP-INSTAGRAM":!0,"AMP-LIST":!0,"AMP-PINTEREST":!0,"AMP-VIDEO":!0};xi.Layout=Ri,xi.naturalDimensions_=Di,xi.LOADING_ELEMENTS_=Vi,xi.parseLayout=vt,xi.getLayoutClass=bt,xi.isLayoutSizeDefined=wt,xi.isInternalElement=St,xi.parseLength=Et,xi.assertLength=Tt,xi.getLengthUnits=At,xi.getLengthNumeral=Ct,xi.hasNaturalDimensions=Lt,xi.getNaturalDimensions=Ot,xi.isLoadingAllowed=It;var Fi={},Ni=function(t){ze.assert(0<t.length,"Srcset must have at least one source"),this.sources_=t;var e=!1,i=!1;this.sources_.forEach(function(t){ze.assert((t.width||t.dpr)&&(!t.width||!t.dpr),"Either dpr or width must be specified"),e=e||!!t.width,i=i||!!t.dpr}),ze.assert(!e||!i,"Srcset cannot have both width and dpr sources"),e?this.sources_.sort(function(t,e){return ze.assert(t.width!=e.width,"Duplicate width: %s",t.width),e.width-t.width}):this.sources_.sort(function(t,e){return ze.assert(t.dpr!=e.dpr,"Duplicate dpr: %s",t.dpr),e.dpr-t.dpr}),this.widthBased_=e,this.dprBased_=i};Ni.prototype.select=function(t,e){ze.assert(t,"width=%s",t),ze.assert(e,"dpr=%s",e);var i=-1;return this.widthBased_?i=this.selectByWidth_(t,e):this.dprBased_&&(i=this.selectByDpr_(t,e)),-1!=i?this.sources_[i]:this.getLast()},Ni.prototype.selectByWidth_=function(t,e){for(var i=-1,n=1e6,o=1e6,r=0;r<this.sources_.length;r++){var s=this.sources_[r],a=void 0,a=s.width?s.width/e:n/2,n=Math.min(n,a),s=Math.abs((a-t)/t-.2);o>s&&(o=s,i=r)}return i},Ni.prototype.selectByDpr_=function(t,e){for(var i=-1,n=1e6,o=0;o<this.sources_.length;o++){var r=Math.abs((this.sources_[o].dpr||1)-e);n>r&&(n=r,i=o)}return i},Ni.prototype.getLast=function(){return this.sources_[this.sources_.length-1]},Fi.parseSrcset=kt,Fi.Srcset=Ni;var Hi={},Ui=function(t,e){this.handler_=t,this.defaultDelay_=e||0,this.scheduled_=-1,this.nextTime_=0,this.running_=!1};Ui.prototype.isPending=function(){return-1!=this.scheduled_},Ui.prototype.schedule=function(t){t=t||this.defaultDelay_,this.running_&&10>t&&(t=10);var e=ui.timer.now()+t;if(-1==this.scheduled_||-10>e-this.nextTime_){var i=this;return-1!=this.scheduled_&&ui.timer.cancel(this.scheduled_),this.nextTime_=e,this.scheduled_=ui.timer.delay(function(){i.scheduled_=-1,i.nextTime_=0,i.running_=!0,i.handler_(),i.running_=!1},t),!0}return!1},Ui.prototype.cancel=function(){-1!=this.scheduled_&&(ui.timer.cancel(this.scheduled_),this.scheduled_=-1)},Hi.Pass=Ui;var Bi={};Bi.layoutRectLtwh=Pt,Bi.layoutRectFromDomRect=Mt,Bi.layoutRectsOverlap=xt,Bi.rectIntersection=Rt,Bi.expandLayoutRect=Dt,Bi.moveLayoutRect=Vt;var zi={},qi=function(t){this.win=t};qi.prototype.isIos=function(){return/iPhone|iPad|iPod/i.test(this.win.navigator.userAgent)},qi.prototype.isSafari=function(){return/Safari/i.test(this.win.navigator.userAgent)&&!this.isChrome()},qi.prototype.isChrome=function(){return/Chrome|CriOS/i.test(this.win.navigator.userAgent)};var Wi=Ft(window);zi.Platform=qi,zi.platformFor=Ft,zi.platform=Wi;var ji={},Yi=18e4,Qi=1e4,Gi=function(t){this.head_=t.document.head,this.origins_={},this.urls_={},this.platform_=zi.platformFor(t),this.origins_[qe.parseUrl(t.location.href).origin]=!0};Gi.prototype.url=function(t,e){if(this.isInterestingUrl_(t)){var i=qe.parseUrl(t).origin,n=ui.timer.now(),o=this.origins_[i];if(o&&o>n)e&&(this.origins_[i]=n+Yi);else{this.origins_[i]=n+(e?Yi:Qi);var r=document.createElement("link");r.setAttribute("rel","dns-prefetch"),r.setAttribute("href",i);var s=document.createElement("link");s.setAttribute("rel","preconnect"),s.setAttribute("href",i),this.head_.appendChild(r),this.head_.appendChild(s),ui.timer.delay(function(){r.parentNode&&r.parentNode.removeChild(r),s.parentNode&&s.parentNode.removeChild(s)},1e4),this.preconnectPolyfill_(i)}}},Gi.prototype.prefetch=function(t){if(this.isInterestingUrl_(t)&&!this.urls_[t]){this.urls_[t]=!0,this.url(t,!0);var e=document.createElement("link");e.setAttribute("rel","prefetch"),e.setAttribute("href",t),this.head_.appendChild(e)}},Gi.prototype.isInterestingUrl_=function(t){return 0==t.indexOf("https:")||0==t.indexOf("http:")?!0:!1},Gi.prototype.preconnectPolyfill_=function(t){if(this.platform_.isSafari()){this.origins_[t]=ui.timer.now()+Yi;var e=new XMLHttpRequest;e.open("HEAD",t+"/amp_preconnect_polyfill?"+Math.random(),!0),e.send()}},ji.preconnectFor=Nt;var Xi={},$i={};Xi.getIframe=Ut,Xi.listen=Bt,Xi.listenOnce=zt,Xi.postMessage=qt,Xi.addDataAndJsonAttributes_=Wt,Xi.prefetchBootstrap=jt,Xi.getBootstrapBaseUrl=Yt;var Ki={},Zi="body{margin:0!important;-webkit-text-size-adjust:100%;-moz-text-size-adjust:100%;-ms-text-size-adjust:100%;text-size-adjust:100%}.-amp-element{display:inline-block}.-amp-layout-fixed{display:inline-block;position:relative}.-amp-layout-container,.-amp-layout-fixed-height,.-amp-layout-responsive{display:block;position:relative}.-amp-layout-fill{display:block;position:absolute;top:0;left:0;bottom:0;right:0}.-amp-layout-fill,.-amp-layout-size-defined{overflow:hidden!important}i-amp-sizer{display:block!important}.-amp-fill-content{display:block;width:100%;height:100%;margin:auto}.-amp-layout-size-defined .-amp-fill-content{position:absolute;top:0;left:0;bottom:0;right:0}.-amp-replaced-content{padding:0!important;border:none!important}.-amp-unresolved{position:relative;overflow:hidden!important}.-amp-notbuilt{position:relative;overflow:hidden!important;color:transparent!important}.-amp-notbuilt>*{display:none}.-amp-ghost{visibility:hidden!important}.-amp-element>[placeholder]{display:block}.-amp-element>[placeholder].amp-hidden,.-amp-element>[placeholder].hidden{visibility:hidden}.-amp-element:not(.amp-notsupported)>[fallback]{display:none}.-amp-layout-size-defined>[fallback],.-amp-layout-size-defined>[placeholder]{position:absolute!important;top:0!important;left:0!important;right:0!important;bottom:0!important;z-index:1!important}.-amp-notbuilt>[placeholder]{display:block!important}.-amp-hidden-by-media-query{display:none}.-amp-element-error{background:red!important;color:#fff!important;position:relative!important}.-amp-element-error:before{content:attr(error-message)}i-amp-scroll-container{position:absolute;top:0;left:0;right:0;bottom:0;overflow:auto}.-amp-loading-container{display:block!important;z-index:1}.-amp-notbuilt>.-amp-loading-container{display:block!important}.-amp-loading-container.amp-hidden{visibility:hidden}.-amp-loader{position:absolute;display:block;height:10px;top:50%;left:50%;-webkit-transform:translateX(-50%) translateY(-50%);transform:translateX(-50%) translateY(-50%);-webkit-transform-origin:50% 50%;transform-origin:50% 50%;white-space:nowrap}.-amp-loader.amp-active .-amp-loader-dot{-webkit-animation:a 2s infinite;animation:a 2s infinite}.-amp-loader-dot{position:relative;display:inline-block;height:10px;width:10px;margin:2px;border-radius:100%;background-color:rgba(0,0,0,.3);box-shadow:2px 2px 2px 1px rgba(0,0,0,.2);will-change:transform}.-amp-loader .-amp-loader-dot:nth-child(1){-webkit-animation-delay:0s;animation-delay:0s}.-amp-loader .-amp-loader-dot:nth-child(2){-webkit-animation-delay:.1s;animation-delay:.1s}.-amp-loader .-amp-loader-dot:nth-child(3){-webkit-animation-delay:.2s;animation-delay:.2s}@-webkit-keyframes a{0%,to{-webkit-transform:scale(.7);transform:scale(.7);background-color:rgba(0,0,0,.3)}50%{-webkit-transform:scale(.8);transform:scale(.8);background-color:rgba(0,0,0,.5)}}@keyframes a{0%,to{-webkit-transform:scale(.7);transform:scale(.7);background-color:rgba(0,0,0,.3)}50%{-webkit-transform:scale(.8);transform:scale(.8);background-color:rgba(0,0,0,.5)}}.-amp-element>[overflow]{cursor:pointer;z-index:2;visibility:hidden}.-amp-element>[overflow].amp-visible{visibility:visible}template{display:none!important}amp-pixel{position:absolute!important;top:0!important;width:1px!important;height:1px!important;overflow:hidden!important;visibility:hidden}amp-ad iframe{border:0!important;margin:0!important;padding:0!important}amp-instagram{padding:48px 8px!important}amp-analytics{position:absolute!important;top:0!important;width:1px!important;height:1px!important;overflow:hidden!important;visibility:hidden}[amp-access][amp-access-hide]{display:none}\n/*# sourceURL=/css/amp.css*/";Ki.cssText=Zi;!function(t,e,i,n){function o(t,e){for(var i=0,n=t.length;n>i;i++)p(t[i],e)}function r(t){return function(e){z(e)&&(p(e,t),o(e.querySelectorAll(A),t))}}function s(t){var e=t.getAttribute("is");t=t.nodeName.toUpperCase();var i=L.call(E,e?"="+e.toUpperCase():"<"+t);return e&&i>-1&&!(-1<A.indexOf(t+'[is="'+e+'"]'))?-1:i}function a(t){var e=t.currentTarget,i=t.attrChange,n=t.attrName,o=t.target;!tt||o&&o!==e||!e.attributeChangedCallback||"style"===n||e.attributeChangedCallback(n,i===t.ADDITION?null:t.prevValue,i===t.REMOVAL?null:t.newValue)}function u(t){var e=r(t);return function(t){d.push(e,t.target)}}function l(t){if(J&&(J=!1,t.currentTarget.removeEventListener("DOMContentLoaded",l)),o((t.target||e).querySelectorAll(A),"detached"===t.detail?"detached":"attached"),B)for(var i=0,n=q.length;n>i;i++)t=q[i],C.contains(t)||(q.splice(i,1),p(t,"detached"))}function h(t,e){j.call(this,t,e),f.call(this,{target:this})}function c(t,e){N(t,e),g?g.observe(t,G):(Z&&(t.setAttribute=h,t[b]=_(t),t.addEventListener("DOMSubtreeModified",f)),t.addEventListener("DOMAttrModified",a)),t.createdCallback&&tt&&(t.created=!0,t.createdCallback(),t.created=!1)}function p(t,e){var i,n=s(t);n>-1&&(y(t,T[n]),n=0,"attached"!==e||t.attached?"detached"!==e||t.detached||(t.attached=!1,t.detached=!0,n=1):(t.detached=!1,t.attached=!0,n=1,B&&0>L.call(q,t)&&q.push(t)),n&&(i=t[e+"Callback"])&&i.call(t))}if(!(n in e)){var d,f,m,_,g,y,v,b="__"+n+(1e5*Math.random()>>0),w=/^[A-Z][A-Z0-9]*(?:-[A-Z0-9]+)+$/,S="ANNOTATION-XML COLOR-PROFILE FONT-FACE FONT-FACE-SRC FONT-FACE-URI FONT-FACE-FORMAT FONT-FACE-NAME MISSING-GLYPH".split(" "),E=[],T=[],A="",C=e.documentElement,L=E.indexOf||function(t){for(var e=this.length;e--&&this[e]!==t;);return e},O=i.prototype,I=O.hasOwnProperty,k=O.isPrototypeOf,P=i.defineProperty,M=i.getOwnPropertyDescriptor,x=i.getOwnPropertyNames,R=i.getPrototypeOf,D=i.setPrototypeOf,V=!!i.__proto__,F=i.create||function et(t){return t?(et.prototype=t,new et):this},N=D||(V?function(t,e){return t.__proto__=e,t}:x&&M?function(){return function(t,e){do for(var i=t,n=e,o=void 0,r=x(n),s=0,a=r.length;a>s;s++)o=r[s],I.call(i,o)||P(i,o,M(n,o));while((e=R(e))&&!k.call(e,t));return t}}():function(t,e){for(var i in e)t[i]=e[i];return t}),H=t.MutationObserver||t.WebKitMutationObserver,U=(t.HTMLElement||t.Element||t.Node).prototype,B=!k.call(U,C),z=B?function(t){return 1===t.nodeType}:function(t){return k.call(U,t)},q=B&&[],W=U.cloneNode,j=U.setAttribute,Y=U.removeAttribute,Q=e.createElement,G=H&&{attributes:!0,characterData:!0,attributeOldValue:!0},X=H||function(t){Z=!1,C.removeEventListener("DOMAttrModified",X)},$=t.requestAnimationFrame||t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||t.msRequestAnimationFrame||function(t){setTimeout(t,10)},K=!1,Z=!0,J=!0,tt=!0;D||V?(y=function(t,e){k.call(e,t)||c(t,e)},v=c):v=y=function(t,e){t[b]||(t[b]=i(!0),c(t,e))},B?(Z=!1,function(){var t=M(U,"addEventListener"),e=t.value,i=function(t){var e=new CustomEvent("DOMAttrModified",{bubbles:!0});e.attrName=t,e.prevValue=this.getAttribute(t),e.newValue=null,e.REMOVAL=e.attrChange=2,Y.call(this,t),this.dispatchEvent(e)},n=function(t,e){var i=this.hasAttribute(t),n=i&&this.getAttribute(t),o=new CustomEvent("DOMAttrModified",{bubbles:!0});j.call(this,t,e),o.attrName=t,o.prevValue=i?n:null,o.newValue=e,i?o.MODIFICATION=o.attrChange=1:o.ADDITION=o.attrChange=0,this.dispatchEvent(o)},o=function(t){var e=t.currentTarget,i=e[b];t=t.propertyName;var n;i.hasOwnProperty(t)&&(i=i[t],n=new CustomEvent("DOMAttrModified",{bubbles:!0}),n.attrName=i.name,n.prevValue=i.value||null,n.newValue=i.value=e[t]||null,null==n.prevValue?n.ADDITION=n.attrChange=0:n.MODIFICATION=n.attrChange=1,e.dispatchEvent(n))};t.value=function(t,r,s){"DOMAttrModified"===t&&this.attributeChangedCallback&&this.setAttribute!==n&&(this[b]={className:{name:"class",value:this.className}},this.setAttribute=n,this.removeAttribute=i,e.call(this,"propertychange",o)),e.call(this,t,r,s)},P(U,"addEventListener",t)}()):H||(C.addEventListener("DOMAttrModified",X),C.setAttribute(b,1),C.removeAttribute(b),Z&&(f=function(t){var e,i;if(this===t.target){t=this[b],this[b]=e=_(this);for(i in e){if(!(i in t))return m(0,this,i,t[i],e[i],"ADDITION");if(e[i]!==t[i])return m(1,this,i,t[i],e[i],"MODIFICATION")}for(i in t)if(!(i in e))return m(2,this,i,t[i],e[i],"REMOVAL")}},m=function(t,e,i,n,o,r){e={attrChange:t,currentTarget:e,attrName:i,prevValue:n,newValue:o},e[r]=t,a(e)},_=function(t){for(var e,i={},n=t.attributes,o=0,r=n.length;r>o;o++)t=n[o],e=t.name,"setAttribute"!==e&&(i[e]=t.value);return i})),e[n]=function(t,i){if(n=t.toUpperCase(),K||(K=!0,H?(g=function(t,e){function i(t,e){for(var i=0,n=t.length;n>i;e(t[i++]));}return new H(function(n){for(var o,r,s=0,a=n.length;a>s;s++)o=n[s],"childList"===o.type?(i(o.addedNodes,t),i(o.removedNodes,e)):(r=o.target,tt&&r.attributeChangedCallback&&"style"!==o.attributeName&&r.attributeChangedCallback(o.attributeName,o.oldValue,r.getAttribute(o.attributeName)))})}(r("attached"),r("detached")),g.observe(e,{childList:!0,subtree:!0})):(d=[],$(function m(){for(;d.length;)d.shift().call(null,d.shift());$(m)}),e.addEventListener("DOMNodeInserted",u("attached")),e.addEventListener("DOMNodeRemoved",u("detached"))),e.addEventListener("DOMContentLoaded",l),e.addEventListener("readystatechange",l),e.createElement=function(t,i){var n=Q.apply(e,arguments),o=""+t,r=L.call(E,(i?"=":"<")+(i||o).toUpperCase()),s=r>-1;
return i&&(n.setAttribute("is",i=i.toLowerCase()),s&&(o=o.toUpperCase(),s=-1<A.indexOf(o+'[is="'+i+'"]'))),tt=!e.createElement.innerHTMLHelper,s&&v(n,T[r]),n},U.cloneNode=function(t){var e=W.call(this,!!t),i=s(e);if(i>-1&&v(e,T[i]),t){t=e.querySelectorAll(A);for(var n,i=0,o=t.length;o>i;i++)n=t[i],v(n,T[s(n)])}return e}),-2<L.call(E,"="+n)+L.call(E,"<"+n))throw Error("A "+t+" type is already registered");if(!w.test(n)||-1<L.call(S,n))throw Error("The type "+t+" is invalid");var n,a=function(){return c?e.createElement(p,n):e.createElement(p)},h=i||O,c=I.call(h,"extends"),p=c?i["extends"].toUpperCase():n,f=E.push((c?"=":"<")+n)-1;return A=A.concat(A.length?",":"",c?p+'[is="'+t.toLowerCase()+'"]':p),a.prototype=T[f]=I.call(h,"prototype")?h.prototype:F(U),o(e.querySelectorAll(A),"attached"),a}}}(window,document,Object,"registerElement");var Ji,tn=Object,en={create:tn.create,getProto:tn.getPrototypeOf,isEnum:{}.propertyIsEnumerable,getDesc:tn.getOwnPropertyDescriptor,setDesc:tn.defineProperty,setDescs:tn.defineProperties,getKeys:tn.keys,getNames:tn.getOwnPropertyNames,getSymbols:tn.getOwnPropertySymbols,each:[].forEach},nn=function(t,e,i){if(!(t instanceof e))throw TypeError(i+": use the 'new' operator!");return t},on="undefined",rn=Ji=typeof window!=on&&window.Math==Math?window:typeof self!=on&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=rn);var sn,an=0,un=Math.random(),ln=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++an+un).toString(36))},hn=function(t){try{return!!t()}catch(e){return!0}},cn=!hn(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}),pn=Object.is||function(t,e){return t===e?0!==t||1/t===1/e:t!=t&&e!=e},dn=sn={version:"1.2.1"};"number"==typeof __e&&(__e=dn);var fn=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t},mn=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},_n=en,gn=mn,yn=cn?function(t,e,i){return _n.setDesc(t,e,gn(1,i))}:function(t,e,i){return t[e]=i,t},vn=Ji,bn="__core-js_shared__",wn=vn[bn]||(vn[bn]={}),Sn=function(t){return wn[t]||(wn[t]={})},En=Sn("wks"),Tn=Ji.Symbol,An=function(t){return En[t]||(En[t]=Tn&&Tn[t]||(Tn||ln)("Symbol."+t))},Cn={}.hasOwnProperty,Ln=function(t,e){return Cn.call(t,e)},On=Ln,In=yn,kn=An("toStringTag"),Pn=function(t,e,i){t&&!On(t=i?t:t.prototype,kn)&&In(t,kn,e)},Mn=function(t){return"object"==typeof t?null!==t:"function"==typeof t},xn=fn,Rn=function(t,e,i){if(xn(t),void 0===e)return t;switch(i){case 1:return function(i){return t.call(e,i)};case 2:return function(i,n){return t.call(e,i,n)};case 3:return function(i,n,o){return t.call(e,i,n,o)}}return function(){return t.apply(e,arguments)}},Dn=Mn,Vn=function(t){if(!Dn(t))throw TypeError(t+" is not an object!");return t},Fn=en.getDesc,Nn=Mn,Hn=Vn,Un=function(t,e){if(Hn(t),!Nn(e)&&null!==e)throw TypeError(e+": can't set as prototype!")},Bn={set:Object.setPrototypeOf||("__proto__"in{}?function(t,e,i){try{i=Rn(Function.call,Fn(Object.prototype,"__proto__").set,2),i(t,[]),e=!(t instanceof Array)}catch(n){e=!0}return function(t,n){return Un(t,n),e?t.__proto__=n:i(t,n),t}}({},!1):void 0),check:Un},zn=An("iterator"),qn=!1;try{var Wn=[7][zn]();Wn["return"]=function(){qn=!0},Array.from(Wn,function(){throw 2})}catch(jn){}var Yn,Qn,Gn,Xn=function(t){if(!qn)return!1;var e=!1;try{var i=[7],n=i[zn]();n.next=function(){e=!0},i[zn]=function(){return n},t(i)}catch(o){}return e},$n=!1,Kn=en,Zn=An("species"),Jn=function(t){!cn||Zn in t||Kn.setDesc(t,Zn,{configurable:!0,get:function(){return this}})},to={}.toString,eo=function(t){return to.call(t).slice(8,-1)},io=eo,no=An("toStringTag"),oo="Arguments"==io(function(){return arguments}()),ro=function(t){var e,i,n;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(i=(e=Object(t))[no])?i:oo?io(e):"Object"==(n=io(e))&&"function"==typeof e.callee?"Arguments":n},so=function(t,e,i){var n=void 0===i;switch(e.length){case 0:return n?t():t.call(i);case 1:return n?t(e[0]):t.call(i,e[0]);case 2:return n?t(e[0],e[1]):t.call(i,e[0],e[1]);case 3:return n?t(e[0],e[1],e[2]):t.call(i,e[0],e[1],e[2]);case 4:return n?t(e[0],e[1],e[2],e[3]):t.call(i,e[0],e[1],e[2],e[3])}return t.apply(i,e)},ao=Mn,uo=Ji.document,lo=ao(uo)&&ao(uo.createElement),ho=function(t){return lo?uo.createElement(t):{}},co=Ji.document&&document.documentElement,po=Rn,fo=so,mo=co,_o=ho,go=Ji,yo=go.process,vo=go.setImmediate,bo=go.clearImmediate,wo=go.MessageChannel,So=0,Eo={},To="onreadystatechange",Ao=function(){var t=+this;if(Eo.hasOwnProperty(t)){var e=Eo[t];delete Eo[t],e()}},Co=function(t){Ao.call(t.data)};vo&&bo||(vo=function(t){for(var e=[],i=1;arguments.length>i;)e.push(arguments[i++]);return Eo[++So]=function(){fo("function"==typeof t?t:Function(t),e)},Yn(So),So},bo=function(t){delete Eo[t]},"process"==eo(yo)?Yn=function(t){yo.nextTick(po(Ao,t,1))}:wo?(Qn=new wo,Gn=Qn.port2,Qn.port1.onmessage=Co,Yn=po(Gn.postMessage,Gn,1)):go.addEventListener&&"function"==typeof postMessage&&!go.importScripts?(Yn=function(t){go.postMessage(t+"","*")},go.addEventListener("message",Co,!1)):Yn=To in _o("script")?function(t){mo.appendChild(_o("script"))[To]=function(){mo.removeChild(this),Ao.call(t)}}:function(t){setTimeout(po(Ao,t,1),0)});var Lo,Oo,Io,ko={set:vo,clear:bo},Po=Ji,Mo=ko.set,xo=Po.MutationObserver||Po.WebKitMutationObserver,Ro=Po.process,Do="process"==eo(Ro),Vo=function(){var t,e;for(Do&&(t=Ro.domain)&&(Ro.domain=null,t.exit());Lo;)(e=Lo.domain)&&e.enter(),Lo.fn.call(),e&&e.exit(),Lo=Lo.next;Oo=void 0,t&&t.enter()};if(Do)Io=function(){Ro.nextTick(Vo)};else if(xo){var Fo=1,No=document.createTextNode("");new xo(Vo).observe(No,{characterData:!0}),Io=function(){No.data=Fo=-Fo}}else Io=function(){Mo.call(Po,Vo)};var Ho,Uo=function(t){t={fn:t,next:void 0,domain:Do&&Ro.domain},Oo&&(Oo.next=t),Lo||(Lo=t,Io()),Oo=t},Bo=Ji,zo=yn,qo=ln("src"),Wo="toString",jo=Function[Wo],Yo=(""+jo).split(Wo);sn.inspectSource=function(t){return jo.call(t)},(Ho=function(t,e,i,n){"function"==typeof i&&(zo(i,qo,t[e]?""+t[e]:Yo.join(String(e))),"name"in i||(i.name=e)),t===Bo?t[e]=i:(n||delete t[e],zo(t,e,i))})(Function.prototype,Wo,function(){return"function"==typeof this&&this[qo]||jo.call(this)});var Qo=Ho,Go=function(t,e){for(var i in e)Qo(t,i,e[i]);return t},Xo=Ji,$o=sn,Ko=yn,Zo=Ho,Jo="prototype",tr=function(t,e){return function(){return t.apply(e,arguments)}},er=function(t,e,i){var n,o,r;o=t&er.G;var s=t&er.P,a=o?Xo:t&er.S?Xo[e]||(Xo[e]={}):(Xo[e]||{})[Jo],u=o?$o:$o[e]||($o[e]={});o&&(i=e);for(n in i)e=!(t&er.F)&&a&&n in a,o=(e?a:i)[n],r=t&er.B&&e?tr(o,Xo):s&&"function"==typeof o?tr(Function.call,o):o,a&&!e&&Zo(a,n,o),Ko(u,n,r),s&&((u[Jo]||(u[Jo]={}))[n]=o)};Xo.core=$o,er.F=1,er.G=2,er.S=4,er.P=8,er.B=16,er.W=32;var ir,nr=er,or=Vn,rr=function(t,e,i,n){try{return n?e(or(i)[0],i[1]):e(i)}catch(o){throw e=t["return"],void 0!==e&&or(e.call(t)),o}},sr=Math.ceil,ar=Math.floor,ur=function(t){return isNaN(t=+t)?0:(t>0?ar:sr)(t)},lr=ur,hr=Math.min,cr=function(t){return t>0?hr(lr(t),9007199254740991):0},pr={},dr=ro,fr=An("iterator"),mr=pr,_r=sn.getIteratorMethod=function(t){return void 0!=t?t[fr]||t["@@iterator"]||mr[dr(t)]:void 0},gr=pr,yr=An("iterator"),vr=function(t){return(gr.Array||Array.prototype[yr])===t},br=Rn,wr=rr,Sr=vr,Er=Vn,Tr=cr,Ar=_r,Cr=function(t,e,i,n){var o=Ar(t);i=br(i,n,e?2:1),n=0;var r;if("function"!=typeof o)throw TypeError(t+" is not iterable!");if(Sr(o))for(o=Tr(t.length);o>n;n++)e?i(Er(r=t[n])[0],r[1]):i(t[n]);else for(t=o.call(t);!(r=t.next()).done;)wr(t,i,r.value,e)},Lr=en,Or=$n,Ir=Ji,kr=Rn,Pr=ro,Mr=nr,xr=Mn,Rr=Vn,Dr=fn,Vr=nn,Fr=Cr,Nr=Bn.set,Hr=pn,Ur=Jn,Br=An("species"),zr=ln("record"),qr=Uo,Wr="Promise",jr=Ir.process,Yr="process"==Pr(jr),Qr=Ir[Wr],Gr=function(t){var e=new Qr(function(){});return t&&(e.constructor=Object),Qr.resolve(e)===e},Xr=function(){function t(e){return e=new Qr(e),Nr(e,t.prototype),e}var e=!1;try{if(e=Qr&&Qr.resolve&&Gr(),Nr(t,Qr),t.prototype=Lr.create(Qr.prototype,{constructor:{value:t}}),t.resolve(5).then(function(){})instanceof t||(e=!1),e&&cn){var i=!1;Qr.resolve(Lr.setDesc({},"then",{get:function(){i=!0}})),e=i}}catch(n){e=!1}return e}(),$r=function(t){return xr(t)&&(Xr?"Promise"==Pr(t):zr in t)},Kr=function(t,e){return Or&&t===Qr&&e===ir?!0:Hr(t,e)},Zr=function(t){var e=Rr(t)[Br];return void 0!=e?e:t},Jr=function(t){var e;return xr(t)&&"function"==typeof(e=t.then)?e:!1},ts=function(t,e){if(!t.n){t.n=!0;var i=t.c;qr(function(){for(var n=t.v,o=1==t.s,r=0,s=function(e){var i,r,s=o?e.ok:e.fail;try{s?(o||(t.h=!0),i=!0===s?n:s(n),i===e.P?e.rej(TypeError("Promise-chain cycle")):(r=Jr(i))?r.call(i,e.res,e.rej):e.res(i)):e.rej(n)}catch(a){e.rej(a)}};i.length>r;)s(i[r++]);i.length=0,t.n=!1,e&&setTimeout(function(){var e,i,o=t.p;es(o)&&(Yr?jr.emit("unhandledRejection",n,o):(e=Ir.onunhandledrejection)?e({promise:o,reason:n}):(i=Ir.console)&&i.error&&i.error("Unhandled promise rejection",n)),t.a=void 0},1)})}},es=function(t){var e=t[zr];t=e.a||e.c;var i=0;if(e.h)return!1;for(;t.length>i;)if(e=t[i++],e.fail||!es(e.P))return!1;return!0},is=function(t){var e=this;e.d||(e.d=!0,e=e.r||e,e.v=t,e.s=2,e.a=e.c.slice(),ts(e,!0))},ns=function(t){var e,i=this;if(!i.d){i.d=!0,i=i.r||i;try{(e=Jr(t))?qr(function(){var n={r:i,d:!1};try{e.call(t,kr(ns,n,1),kr(is,n,1))}catch(o){is.call(n,o)}}):(i.v=t,i.s=1,ts(i,!1))}catch(n){is.call({r:i,d:!1},n)}}};Xr||(Qr=function(t){Dr(t);var e={p:Vr(this,Qr,Wr),c:[],a:void 0,s:0,d:!1,v:void 0,h:!1,n:!1};this[zr]=e;try{t(kr(ns,e,1),kr(is,e,1))}catch(i){is.call(e,i)}},Go(Qr.prototype,{then:function(t,e){var i=Rr(Rr(this).constructor)[Br],n={ok:"function"==typeof t?t:!0,fail:"function"==typeof e?e:!1},i=n.P=new(void 0!=i?i:Qr)(function(t,e){n.res=t,n.rej=e});Dr(n.res),Dr(n.rej);var o=this[zr];return o.c.push(n),o.a&&o.a.push(n),o.s&&ts(o,!1),i},"catch":function(t){return this.then(void 0,t)}})),Mr(Mr.G+Mr.W+Mr.F*!Xr,{Promise:Qr}),Pn(Qr,Wr),Ur(Qr),Ur(ir=sn[Wr]),Mr(Mr.S+Mr.F*!Xr,Wr,{reject:function(t){return new this(function(e,i){i(t)})}}),Mr(Mr.S+Mr.F*(!Xr||Gr(!0)),Wr,{resolve:function(t){return $r(t)&&Kr(t.constructor,this)?t:new this(function(e){e(t)})}}),Mr(Mr.S+Mr.F*!(Xr&&Xn(function(t){Qr.all(t)["catch"](function(){})})),Wr,{all:function(t){var e=Zr(this),i=[];return new e(function(n,o){Fr(t,!1,i.push,i);var r=i.length,s=Array(r);r?Lr.each.call(i,function(t,i){e.resolve(t).then(function(t){s[i]=t,--r||n(s)},o)}):n(s)})},race:function(t){var e=Zr(this);return new e(function(i,n){Fr(t,!1,function(t){e.resolve(t).then(i,n)})})}});var os=Math.sign||function(t){return 0==(t=+t)||t!=t?t:0>t?-1:1},rs=nr;rs(rs.S,"Math",{sign:os});var ss={},as=function(t){ze.assert(0<t.length,"SizeList must have at least one option"),this.sizes_=t;for(var e=0;e<t.length;e++){var i=t[e];e<t.length-1?ze.assert(i.mediaQuery,"All options except for the last must have a media condition"):ze.assert(!i.mediaQuery,"The last option must not have a media condition")}};as.prototype.select=function(t){for(var e=0;e<this.sizes_.length-1;e++){var i=this.sizes_[e];if(t.matchMedia(i.mediaQuery).matches)return i.size}return this.getLast()},as.prototype.getLast=function(){return this.sizes_[this.sizes_.length-1].size},ss.parseSizeList=Xt,ss.SizeList=as;var us={};us.exponentialBackoff=$t;var ls={},hs=us.exponentialBackoff(1.5);ls.reportError=Kt,ls.installErrorReporting=Zt,ls.getErrorReportUrl=te;var cs={},ps="Input",ds=3,fs=300,ms=function(t){this.win=t,this.boundOnKeyDown_=this.onKeyDown_.bind(this),this.boundOnMouseDown_=this.onMouseDown_.bind(this),this.boundOnMouseMove_=this.onMouseMove_.bind(this),this.boundMouseCanceled_=this.mouseCanceled_.bind(this),this.boundMouseConfirmed_=this.mouseConfirmed_.bind(this),this.hasTouch_="ontouchstart"in t||void 0!==t.navigator.maxTouchPoints&&0<t.navigator.maxTouchPoints||void 0!==t.DocumentTouch,Ke.log.fine(ps,"touch detected:",this.hasTouch_),this.keyboardActive_=!1,this.win.document.addEventListener("keydown",this.boundOnKeyDown_),this.win.document.addEventListener("mousedown",this.boundOnMouseDown_),this.hasMouse_=!0,this.mouseConfirmAttemptCount_=0,this.touchDetectedObservable_=new vi,this.mouseDetectedObservable_=new vi,this.keyboardStateObservable_=new vi,this.hasTouch_&&(this.hasMouse_=!this.hasTouch_,Ai.listenOnce(t.document,"mousemove",this.boundOnMouseMove_))};ms.prototype.cleanup_=function(){this.win.document.removeEventListener("keydown",this.boundOnKeyDown_),this.win.document.removeEventListener("mousedown",this.boundOnMouseDown_)},ms.prototype.isTouchDetected=function(){return this.hasTouch_},ms.prototype.onTouchDetected=function(t,e){return e&&t(this.isTouchDetected()),this.touchDetectedObservable_.add(t)},ms.prototype.isMouseDetected=function(){return this.hasMouse_},ms.prototype.onMouseDetected=function(t,e){return e&&t(this.isMouseDetected()),this.mouseDetectedObservable_.add(t)},ms.prototype.isKeyboardActive=function(){return this.keyboardActive_},ms.prototype.onKeyboardStateChanged=function(t,e){return e&&t(this.isKeyboardActive()),this.keyboardStateObservable_.add(t)},ms.prototype.onKeyDown_=function(t){this.keyboardActive_||t.defaultPrevented||(t=t.target,t&&("INPUT"==t.tagName||"TEXTAREA"==t.tagName||"SELECT"==t.tagName||"OPTION"==t.tagName||t.hasAttribute("contenteditable")))||(this.keyboardActive_=!0,this.keyboardStateObservable_.fire(!0),Ke.log.fine(ps,"keyboard activated"))},ms.prototype.onMouseDown_=function(){this.keyboardActive_&&(this.keyboardActive_=!1,this.keyboardStateObservable_.fire(!1),Ke.log.fine(ps,"keyboard deactivated"))},ms.prototype.onMouseMove_=function(){return Ai.listenOncePromise(this.win.document,"click",!1,fs).then(this.boundMouseCanceled_,this.boundMouseConfirmed_)},ms.prototype.mouseConfirmed_=function(){this.hasMouse_=!0,this.mouseDetectedObservable_.fire(!0),Ke.log.fine(ps,"mouse detected")},ms.prototype.mouseCanceled_=function(){this.mouseConfirmAttemptCount_++,this.mouseConfirmAttemptCount_<=ds?Ai.listenOnce(this.win.document,"mousemove",this.boundOnMouseMove_):Ke.log.fine(ps,"mouse detection failed")},cs.Input=ms,cs.inputFor=ee;var _s={},gs=function(t,e){var i=this;this.win=t,this.purgeTimeout_=e,this.history_=[],this.observeFocus_=new vi,this.captureFocus_=function(t){t.target&&i.pushFocus_(t.target)},this.captureBlur_=function(t){ui.timer.delay(function(){i.pushFocus_(i.win.document.activeElement)},500)},this.win.document.addEventListener("focus",this.captureFocus_,!0),this.win.addEventListener("blur",this.captureBlur_)};gs.prototype.cleanup_=function(){this.win.document.removeEventListener("focus",this.captureFocus_,!0),this.win.removeEventListener("blur",this.captureBlur_)},gs.prototype.onFocus=function(t){return this.observeFocus_.add(t)},gs.prototype.pushFocus_=function(t){var e=ui.timer.now();0==this.history_.length||this.history_[this.history_.length-1].el!=t?this.history_.push({el:t,time:e}):this.history_[this.history_.length-1].time=e,this.purgeBefore(e-this.purgeTimeout_),this.observeFocus_.fire(t)},gs.prototype.getLast=function(){return 0==this.history_.length?null:this.history_[this.history_.length-1].el},gs.prototype.purgeBefore=function(t){for(var e=this.history_.length-1,i=0;i<this.history_.length;i++)if(this.history_[i].time>=t){e=i-1;break}-1!=e&&this.history_.splice(0,e+1)},gs.prototype.hasDescendantsOf=function(t){this.win.document.activeElement&&this.pushFocus_(this.win.document.activeElement);for(var e=0;e<this.history_.length;e++)if(t.contains(this.history_[e].el))return!0;return!1},_s.FocusHistory=gs;var ys={},vs="Resources",bs="__AMP__RESOURCE",ws="__AMP__OWNER",Ss="L",Es=0,Ts="P",As=2,Cs=10,Ls=1e3,Os=1e3,Is=500,ks=6e4,Ps=function(t){var e=this;this.win=t,this.viewer_=Ge.viewerFor(t),this.isRuntimeOn_=this.viewer_.isRuntimeOn(),this.maxDpr_=this.win.devicePixelRatio||1,this.resourceIdCounter_=0,this.resources_=[],this.visible_=this.viewer_.isVisible(),this.prerenderSize_=this.viewer_.getPrerenderSize(),this.documentReady_=!1,this.relayoutAll_=this.firstPassAfterDocumentReady_=!0,this.relayoutTop_=-1,this.forceBuild_=!1,this.lastVelocity_=this.lastScrollTime_=0,this.pass_=new Ui(function(){return e.doPass_()}),this.exec_=new xs,this.queue_=new xs,this.requestsChangeHeight_=[],this.deferredMutates_=[],this.scrollHeight_=0,this.viewport_=Ci.viewportFor(this.win),this.vsync_=Ei.vsyncFor(this.win),this.docState_=bi.documentStateFor(this.win),this.activeHistory_=new gs(this.win,ks),this.vsyncScheduled_=!1,this.viewport_.onChanged(function(t){e.lastScrollTime_=ui.timer.now(),e.lastVelocity_=t.velocity,e.relayoutAll_=e.relayoutAll_||t.relayoutAll,e.schedulePass()}),this.viewport_.onScroll(function(){e.lastScrollTime_=ui.timer.now()}),this.viewer_.onVisibilityChanged(function(){e.schedulePass()}),this.viewer_.onRuntimeState(function(t){Ke.log.fine(vs,"Runtime state:",t),e.isRuntimeOn_=t,e.schedulePass(1)}),this.activeHistory_.onFocus(function(t){e.checkPendingChangeHeight_(t)}),this.docState_.onReady(function(){e.documentReady_=!0,e.forceBuild_=!0,e.relayoutAll_=!0,e.schedulePass(),e.monitorInput_()}),this.schedulePass()};Ps.prototype.get=function(){return this.resources_.slice(0)},Ps.prototype.monitorInput_=function(){var t=this,e=cs.inputFor(this.win);e.onTouchDetected(function(e){t.toggleInputClass_("amp-mode-touch",e)},!0),e.onMouseDetected(function(e){t.toggleInputClass_("amp-mode-mouse",e)},!0),e.onKeyboardStateChanged(function(e){t.toggleInputClass_("amp-mode-keyboard-active",e)},!0)},Ps.prototype.toggleInputClass_=function(t,e){var i=this;this.vsync_.mutate(function(){i.win.document.body.classList.toggle(t,e)})},Ps.prototype.updateScrollHeight_=function(){if(this.win.document.body){var t=this.win.document.body.scrollHeight;t!=this.scrollHeight_&&(this.scrollHeight_=t,this.viewer_.postDocumentResized(this.viewport_.getSize().width,t))}},Ps.prototype.getMaxDpr=function(){return this.maxDpr_},Ps.prototype.getDpr=function(){return this.maxDpr_},Ps.prototype.getResourceForElement=function(t){return ze.assert(t[bs],"Missing resource prop on %s",t)},Ps.prototype.add=function(t){var e=new Ms(++this.resourceIdCounter_,t,this);t.id||(t.id="AMP_"+e.getId()),t[bs]=e,this.resources_.push(e),this.isRuntimeOn_&&(e.build(this.forceBuild_),this.schedulePass()),Ke.log.fine(vs,"element added:",e.debugid)},Ps.prototype.remove=function(t){var e=(t=this.getResourceForElement(t))?this.resources_.indexOf(t):-1;-1!=e&&this.resources_.splice(e,1),Ke.log.fine(vs,"element removed:",t.debugid)},Ps.prototype.upgraded=function(t){t=this.getResourceForElement(t),this.isRuntimeOn_?(t.build(this.forceBuild_),this.schedulePass()):t.onUpgraded_&&t.onUpgraded_(),Ke.log.fine(vs,"element upgraded:",t.debugid)},Ps.prototype.setOwner=function(t,e){ze.assert(e.contains(t),"Owner must contain the element"),t[ws]=e},Ps.prototype.scheduleLayout=function(t,e){this.scheduleLayoutOrPreloadForSubresources_(this.getResourceForElement(t),!0,ne(e))},Ps.prototype.schedulePreload=function(t,e){this.scheduleLayoutOrPreloadForSubresources_(this.getResourceForElement(t),!1,ne(e))},Ps.prototype.updateInViewport=function(t,e,i){this.updateInViewportForSubresources_(this.getResourceForElement(t),ne(e),i)},Ps.prototype.changeHeight=function(t,e,i){this.scheduleChangeHeight_(this.getResourceForElement(t),e,!0,i)},Ps.prototype.attemptChangeHeight=function(t,e,i){this.scheduleChangeHeight_(this.getResourceForElement(t),e,!1,i)},Ps.prototype.deferMutate=function(t,e){this.scheduleDeferredMutate_(this.getResourceForElement(t),e),this.schedulePassVsync()},Ps.prototype.schedulePass=function(t){this.pass_.schedule(t)},Ps.prototype.schedulePassVsync=function(){var t=this;this.vsyncScheduled_||(this.vsyncScheduled_=!0,this.vsync_.mutate(function(){return t.doPass_()}))},Ps.prototype.doPass_=function(){if(this.isRuntimeOn_){var t=this.visible_;this.visible_=this.viewer_.isVisible(),this.prerenderSize_=this.viewer_.getPrerenderSize(),this.documentReady_&&this.firstPassAfterDocumentReady_&&(this.firstPassAfterDocumentReady_=!1,this.viewer_.postDocumentReady(this.viewport_.getSize().width,this.win.document.body.scrollHeight),this.updateScrollHeight_());var e=this.viewport_.getSize(),i=ui.timer.now();Ke.log.fine(vs,"PASS: at "+i+", visible=",this.visible_,", forceBuild=",this.forceBuild_,", relayoutAll=",this.relayoutAll_,", relayoutTop=",this.relayoutTop_,", viewportSize=",e.width,e.height,", prerenderSize=",this.prerenderSize_),this.pass_.cancel(),this.vsyncScheduled_=!1,t&&!this.visible_?(Ke.log.fine(vs,"document become inactive"),this.documentBecameInactive_()):0<e.height&&0<e.width&&(this.hasMutateWork_()&&this.mutateWork_(),this.discoverWork_(),t=this.work_(),this.hasMutateWork_()&&(t=Math.min(t,Is)),this.visible_?(Ke.log.fine(vs,"next pass:",t),this.schedulePass(t),this.updateScrollHeight_()):Ke.log.fine(vs,"document is not visible: no scheduling"))}else Ke.log.fine(vs,"runtime is off")},Ps.prototype.hasMutateWork_=function(){return 0<this.deferredMutates_.length||0<this.requestsChangeHeight_.length},Ps.prototype.mutateWork_=function(){var t=ui.timer.now(),e=this.viewport_.getRect(),i=e.height/10,n=e.height/4,t=.01>Math.abs(this.lastVelocity_)&&t-this.lastScrollTime_>Is||t-this.lastScrollTime_>2*Is;if(0<this.deferredMutates_.length){Ke.log.fine(vs,"deferred mutates:",this.deferredMutates_.length);var o=this.deferredMutates_;this.deferredMutates_=[];for(var r=0;r<o.length;r++)o[r]()}if(0<this.requestsChangeHeight_.length){Ke.log.fine(vs,"change height requests:",this.requestsChangeHeight_.length),o=this.requestsChangeHeight_,this.requestsChangeHeight_=[];for(var r=-1,s=[],a=0;a<o.length;a++){var u=o[a],l=u.resource,h=u.resource.getLayoutBox();if(h.height!=u.newHeight){var c=!1;u.force||!this.visible_?c=!0:this.activeHistory_.hasDescendantsOf(l.element)?c=!0:h.bottom>=e.bottom-n?c=!0:h.bottom<=e.top+i?t?(c=!1,s.push(u)):this.requestsChangeHeight_.push(u):u.newHeight<h.height?c=!1:u.resource.overflowCallback(!0,u.newHeight),c&&(0<=h.top&&(r=-1==r?h.top:Math.min(r,h.top)),u.resource.changeHeight(u.newHeight,u.callback),0<u.newHeight&&u.resource.overflowCallback(!1,u.newHeight))}}if(-1!=r&&(this.relayoutTop_=r),0<s.length){var p=this;this.vsync_.run({measure:function(t){t.scrollHeight=p.viewport_.getScrollHeight(),t.scrollTop=p.viewport_.getScrollTop()},mutate:function(t){var e=-1;s.forEach(function(t){var i=t.resource.getLayoutBox();e=-1==e?i.top:Math.min(e,i.top),t.resource.changeHeight(t.newHeight)}),-1!=e&&(p.relayoutTop_=e);var i=p.viewport_.getScrollHeight();i>t.scrollHeight&&p.viewport_.setScrollTop(t.scrollTop+(i-t.scrollHeight))}})}}},Ps.prototype.checkPendingChangeHeight_=function(t){if(t=ei.closest(t,function(t){return t[bs]})){t=this.getResourceForElement(t);var e=t.getPendingChangeHeight();void 0!==e&&this.scheduleChangeHeight_(t,e,!0)}},Ps.prototype.discoverWork_=function(){var t=ui.timer.now(),e=this.relayoutAll_;this.relayoutAll_=!1;var i=this.relayoutTop_;this.relayoutTop_=-1;for(var n=0,o=0;o<this.resources_.length;o++){var r=this.resources_[o];r.getState()==Rs.NOT_BUILT&&r.build(this.forceBuild_),(r.getState()==Rs.NOT_LAID_OUT||e)&&(r.applySizesAndMediaQuery(),n++)}if(n>0||e||-1!=i)for(n=0;n<this.resources_.length;n++)o=this.resources_[n],o.getState()==Rs.NOT_BUILT||o.hasOwner()||(e||o.getState()==Rs.NOT_LAID_OUT||-1!=i&&o.getLayoutBox().bottom>=i)&&o.measure();if(e=this.viewport_.getRect(),i=void 0,i=this.visible_?Bi.expandLayoutRect(e,.25,2):0<this.prerenderSize_?Bi.expandLayoutRect(e,0,this.prerenderSize_-1):null,e=this.visible_?Bi.expandLayoutRect(e,.25,.25):e,i)for(n=0;n<this.resources_.length;n++)o=this.resources_[n],o.getState()!=Rs.READY_FOR_LAYOUT||o.hasOwner()||o.isDisplayed()&&o.overlaps(i)&&this.scheduleLayoutOrPreload_(o,!0);for(i=0;i<this.resources_.length;i++)n=this.resources_[i],n.hasOwner()||(o=this.visible_&&n.isDisplayed()&&n.overlaps(e),n.isInViewport()!=o&&n.setInViewport(o));if(this.visible_&&0==this.exec_.getSize()&&0==this.queue_.getSize()&&t>this.exec_.getLastDequeueTime()+5e3)for(e=t=0;e<this.resources_.length&&(i=this.resources_[e],!(i.getState()==Rs.READY_FOR_LAYOUT&&!i.hasOwner()&&i.isDisplayed()&&(Ke.log.fine(vs,"idle layout:",i.debugid),this.scheduleLayoutOrPreload_(i,!1),t++,t>=4)));e++);},Ps.prototype.documentBecameInactive_=function(){for(var t=0;t<this.resources_.length;t++)this.resources_[t].documentBecameInactive()},Ps.prototype.work_=function(){var t=ui.timer.now(),e=this.calcTaskScore_.bind(this,this.viewport_.getRect(),Math.sign(this.lastVelocity_)),i=-1,n=this.queue_.peek(e);if(n)do{if(i=this.calcTaskTimeout_(n),Ke.log.fine(vs,"peek from queue:",n.id,"sched at",n.scheduleTime,"score",e(n),"timeout",i),i>16)break;this.queue_.dequeue(n),(i=this.exec_.getTaskById(n.id))?i.promise.then(this.reschedule_.bind(this,n),this.reschedule_.bind(this,n)):(n.promise=n.callback(this.visible_),n.startTime=t,Ke.log.fine(vs,"exec:",n.id,"at",n.startTime),this.exec_.enqueue(n),n.promise.then(this.taskComplete_.bind(this,n,!0),this.taskComplete_.bind(this,n,!1))["catch"](ls.reportError)),n=this.queue_.peek(e),i=-1}while(n);return Ke.log.fine(vs,"queue size:",this.queue_.getSize()),Ke.log.fine(vs,"exec size:",this.exec_.getSize()),i>=0?i:(t=2*(t-this.exec_.getLastDequeueTime()),t=Math.max(Math.min(3e4,t),5e3))},Ps.prototype.calcTaskScore_=function(t,e,i){var n=i.resource.getLayoutBox();return t=Math.floor((n.top-t.top)/t.height),0!=t&&Math.sign(t)!=(e||1)&&(t*=2),t=Math.abs(t),i.priority*Cs+t},Ps.prototype.calcTaskTimeout_=function(t){if(0==this.exec_.getSize())return 0;var e=ui.timer.now(),i=0;return this.exec_.forEach(function(n){i=Math.max(i,Math.max((t.priority-n.priority)*Ls,0)-(e-n.startTime))}),i},Ps.prototype.reschedule_=function(t){this.queue_.getTaskById(t.id)||this.queue_.enqueue(t)},Ps.prototype.taskComplete_=function(t,e,i){return this.exec_.dequeue(t),this.schedulePass(Os),e?void 0:(Ke.log.error(vs,"task failed:",t.id,t.resource.debugid,i),Promise.reject(i))},Ps.prototype.scheduleChangeHeight_=function(t,e,i,n){if(t.resetPendingChangeHeight(),t.getLayoutBox().height!=e){for(var o=null,r=0;r<this.requestsChangeHeight_.length;r++)if(this.requestsChangeHeight_[r].resource==t){o=this.requestsChangeHeight_[r];break}o?(o.newHeight=e,o.force=i||o.force,o.callback=n):this.requestsChangeHeight_.push({resource:t,newHeight:e,force:i,callback:n}),this.schedulePassVsync()}},Ps.prototype.scheduleDeferredMutate_=function(t,e){this.deferredMutates_.push(e)},Ps.prototype.scheduleLayoutOrPreload_=function(t,e,i){ze.assert(t.getState()!=Rs.NOT_BUILT&&t.isDisplayed(),"Not ready for layout: %s (%s)",t.debugid,t.getState()),(this.visible_||t.prerenderAllowed())&&(t.isInViewport()||t.renderOutsideViewport())&&(e?this.schedule_(t,Ss,Es,i||0,t.startLayout.bind(t)):this.schedule_(t,Ts,As,i||0,t.startLayout.bind(t)))},Ps.prototype.scheduleLayoutOrPreloadForSubresources_=function(t,e,i){var n=[];if(this.discoverResourcesForArray_(t,i,function(t){t.getState()!=Rs.NOT_BUILT&&n.push(t)}),0<n.length){var o=this;n.forEach(function(i){i.measure(),i.getState()==Rs.READY_FOR_LAYOUT&&i.isDisplayed()&&o.scheduleLayoutOrPreload_(i,e,t.getPriority())})}},Ps.prototype.schedule_=function(t,e,i,n,o){e=t.debugid+"#"+e,t={id:e,resource:t,priority:Math.max(t.getPriority(),n)+i,callback:o,scheduleTime:ui.timer.now()},Ke.log.fine(vs,"schedule:",t.id,"at",t.scheduleTime),i=this.queue_.getTaskById(e),(!i||t.priority<i.priority)&&(i&&this.queue_.dequeue(i),this.queue_.enqueue(t),this.schedulePass(this.calcTaskTimeout_(t))),t.resource.layoutScheduled()},Ps.prototype.updateInViewportForSubresources_=function(t,e,i){var n=t.isInViewport()&&i;this.discoverResourcesForArray_(t,e,function(t){t.setInViewport(n)})},Ps.prototype.discoverResourcesForArray_=function(t,e,i){var n=this;e.forEach(function(e){ze.assert(t.element.contains(e)),n.discoverResourcesForElement_(e,i)})},Ps.prototype.discoverResourcesForElement_=function(t,e){if(t.classList.contains("-amp-element"))e(this.getResourceForElement(t));else for(var i=t.getElementsByClassName("-amp-element"),n=[],o=0;o<i.length;o++){for(var r=i[o],s=!1,a=0;a<n.length;a++)if(n[a].contains(r)){s=!0;break}s||(n.push(r),e(this.getResourceForElement(r)))}};var Ms=function(t,e,i){this.id_=t,this.element=e,this.debugid=e.tagName.toLowerCase()+"#"+t,this.resources_=i,this.blacklisted_=!1,this.owner_=void 0,this.priority_=ie(e.tagName),this.state_=e.isBuilt()?Rs.NOT_LAID_OUT:Rs.NOT_BUILT,this.layoutCount_=0,this.layoutBox_=Bi.layoutRectLtwh(-1e4,-1e4,0,0),this.isInViewport_=!1};Ms.prototype.getId=function(){return this.id_},Ms.prototype.getOwner=function(){if(void 0===this.owner_){for(var t=this.element;t;t=t.parentElement)if(t[ws]){this.owner_=t[ws];break}void 0===this.owner_&&(this.owner_=null)}return this.owner_},Ms.prototype.hasOwner=function(){return!!this.getOwner()},Ms.prototype.getPriority=function(){return this.priority_},Ms.prototype.getState=function(){return this.state_},Ms.prototype.build=function(t){if(this.blacklisted_||!this.element.isUpgraded())return!1;var e=void 0;try{e=this.element.build(t)}catch(i){Ke.log.error(vs,"failed to build:",this.debugid,i),e=!1,this.blacklisted_=!0}return e?(this.state_=Rs.NOT_LAID_OUT,!0):!1},Ms.prototype.applySizesAndMediaQuery=function(){this.element.applySizesAndMediaQuery()},Ms.prototype.changeHeight=function(t,e){this.element.changeHeight(t),this.state_!=Rs.NOT_BUILT&&(this.state_=Rs.NOT_LAID_OUT),e&&e()},Ms.prototype.overflowCallback=function(t,e){t&&(this.pendingChangeHeight_=e),this.element.overflowCallback(t,e)},Ms.prototype.resetPendingChangeHeight=function(){this.pendingChangeHeight_=void 0},Ms.prototype.getPendingChangeHeight=function(){return this.pendingChangeHeight_},Ms.prototype.measure=function(){if(ze.assert(this.element.isUpgraded(),"Must be upgraded to measure: %s",this.debugid),this.state_!=Rs.NOT_BUILT){var t=this.resources_.viewport_.getLayoutRect(this.element);(this.state_==Rs.NOT_LAID_OUT||this.layoutBox_.top!=t.top||this.layoutBox_.width!=t.width||this.layoutBox_.height!=t.height)&&(this.state_==Rs.NOT_LAID_OUT||this.element.isRelayoutNeeded())&&(this.state_=Rs.READY_FOR_LAYOUT),this.layoutBox_=t,this.element.updateLayoutBox(t)}},Ms.prototype.getLayoutBox=function(){return this.layoutBox_},Ms.prototype.isDisplayed=function(){return 0<this.layoutBox_.height&&0<this.layoutBox_.width},Ms.prototype.overlaps=function(t){return Bi.layoutRectsOverlap(this.layoutBox_,t)},Ms.prototype.prerenderAllowed=function(){return this.element.prerenderAllowed()},Ms.prototype.renderOutsideViewport=function(){return this.element.renderOutsideViewport()},Ms.prototype.layoutScheduled=function(){this.state_=Rs.LAYOUT_SCHEDULED},Ms.prototype.startLayout=function(t){var e=this;if(this.layoutPromise_)return this.layoutPromise_;if(this.state_==Rs.LAYOUT_COMPLETE)return Promise.resolve();if(this.state_==Rs.LAYOUT_FAILED)return Promise.reject("already failed");if(ze.assert(this.state_!=Rs.NOT_BUILT,"Not ready to start layout: %s (%s)",this.debugid,this.state_),!t&&!this.prerenderAllowed())return Ke.log.fine(vs,"layout canceled due to non pre-renderable element:",this.debugid,this.state_),this.state_=Rs.READY_FOR_LAYOUT,Promise.resolve();if(!this.renderOutsideViewport()&&!this.isInViewport())return Ke.log.fine(vs,"layout canceled due to element not being in viewport:",this.debugid,this.state_),this.state_=Rs.READY_FOR_LAYOUT,Promise.resolve();if(this.measure(),!this.isDisplayed())return Ke.log.fine(vs,"layout canceled due to element loosing display:",this.debugid,this.state_),Promise.resolve();if(0<this.layoutCount_&&!this.element.isRelayoutNeeded())return Ke.log.fine(vs,"layout canceled since it wasn't requested:",this.debugid,this.state_),this.state_=Rs.LAYOUT_COMPLETE,Promise.resolve();Ke.log.fine(vs,"start layout:",this.debugid,"count:",this.layoutCount_),this.layoutCount_++,this.state_=Rs.LAYOUT_SCHEDULED,t=void 0;try{t=this.element.layoutCallback()}catch(i){return Promise.reject(i)}return this.layoutPromise_=t.then(function(){return e.layoutComplete_(!0)},function(t){return e.layoutComplete_(!1,t)})},Ms.prototype.layoutComplete_=function(t,e){return this.layoutPromise_=null,this.state_=t?Rs.LAYOUT_COMPLETE:Rs.LAYOUT_FAILED,t?void Ke.log.fine(vs,"layout complete:",this.debugid):(Ke.log.fine(vs,"loading failed:",this.debugid,e),
Promise.reject(e))},Ms.prototype.isInViewport=function(){return this.isInViewport_},Ms.prototype.setInViewport=function(t){t!=this.isInViewport_&&(Ke.log.fine(vs,"inViewport:",this.debugid,t),this.isInViewport_=t,this.element.viewportCallback(t))},Ms.prototype.documentBecameInactive=function(){this.state_!=Rs.NOT_BUILT&&(this.isInViewport()&&this.setInViewport(!1),this.element.documentInactiveCallback()&&(this.state_=Rs.NOT_LAID_OUT))},Ms.prototype.forceAll=function(){var t=this;ze.assert(!this.resources_.isRuntimeOn_);var e=Promise.resolve();if(this.state_==Rs.NOT_BUILT){var i=this;if(!this.element.isUpgraded())var n=this,e=e.then(function(){return new Promise(function(t){n.onUpgraded_=t})});e=e.then(function(){i.onUpgraded_=void 0,i.build(!0)})}return e.then(function(){if(t.applySizesAndMediaQuery(),t.measure(),t.layoutPromise_)return t.layoutPromise_;if(t.state_==Rs.LAYOUT_COMPLETE||t.state_==Rs.LAYOUT_FAILED||0<t.layoutCount_||!t.isDisplayed())return Promise.resolve();t.layoutCount_++;try{return t.element.layoutCallback()}catch(e){return Promise.reject(e)}})};var xs=function(){this.tasks_=[],this.taskIdMap_={},this.lastDequeueTime_=this.lastEnqueueTime_=0};xs.prototype.getSize=function(){return this.tasks_.length},xs.prototype.getLastEnqueueTime=function(){return this.lastEnqueueTime_},xs.prototype.getLastDequeueTime=function(){return this.lastDequeueTime_},xs.prototype.getTaskById=function(t){return this.taskIdMap_[t]||null},xs.prototype.enqueue=function(t){ze.assert(!this.taskIdMap_[t.id],"Task already enqueued: %s",t.id),this.tasks_.push(t),this.taskIdMap_[t.id]=t,this.lastEnqueueTime_=ui.timer.now()},xs.prototype.dequeue=function(t){var e=this.taskIdMap_[t.id];return e?(this.tasks_.splice(this.tasks_.indexOf(e),1),delete this.taskIdMap_[t.id],this.lastDequeueTime_=ui.timer.now(),!0):!1},xs.prototype.peek=function(t){for(var e=1e6,i=null,n=0;n<this.tasks_.length;n++){var o=this.tasks_[n],r=t(o);e>r&&(e=r,i=o)}return i},xs.prototype.forEach=function(t){this.tasks_.forEach(t)};var Rs={NOT_BUILT:0,NOT_LAID_OUT:1,READY_FOR_LAYOUT:2,LAYOUT_SCHEDULED:3,LAYOUT_COMPLETE:4,LAYOUT_FAILED:5};ys.getElementPriority=ie,ys.Resources=Ps,ys.Resource=Ms,ys.TaskQueue_=xs,ys.ResourceState_=Rs,ys.resourcesFor=oe;var Ds={};Ds.createLoaderElement=re;var Vs={},Fs=function(t){this.element=t,this.layout_=xi.Layout.NODISPLAY,this.layoutWidth_=-1,this.inViewport_=!1,this.actionMap_=this.getWin().Object.create(null),this.preconnect=ji.preconnectFor(this.getWin()),this.resources_=ys.resourcesFor(this.getWin())};Fs.prototype.getLayout=function(){return this.layout_},Fs.prototype.getWin=function(){return this.element.ownerDocument.defaultView},Fs.prototype.getVsync=function(){return Ei.vsyncFor(this.getWin())},Fs.prototype.getLayoutWidth=function(){return this.layoutWidth_},Fs.prototype.isLayoutSupported=function(t){return t==xi.Layout.NODISPLAY},Fs.prototype.isInViewport=function(){return this.inViewport_},Fs.prototype.createdCallback=function(){},Fs.prototype.firstAttachedCallback=function(){},Fs.prototype.isReadyToBuild=function(){return!0},Fs.prototype.buildCallback=function(){},Fs.prototype.preconnectCallback=function(){},Fs.prototype.setAsOwner=function(t){this.resources_.setOwner(t,this.element)},Fs.prototype.prerenderAllowed=function(){return!1},Fs.prototype.renderOutsideViewport=function(){return!0},Fs.prototype.isRelayoutNeeded=function(){return!1},Fs.prototype.layoutCallback=function(){return Promise.resolve()},Fs.prototype.firstLayoutCompleted=function(){this.togglePlaceholder(!1)},Fs.prototype.viewportCallback=function(t){},Fs.prototype.documentInactiveCallback=function(){return!1},Fs.prototype.activate=function(t){},Fs.prototype.registerAction=function(t,e){this.actionMap_[t]=e},Fs.prototype.executeAction=function(t,e){if("activate"==t.method)this.activate(t);else{var i=this.actionMap_[t.method];if(!i)throw Error("Method not found: "+t.method);i(t)}},Fs.prototype.getMaxDpr=function(){return this.resources_.getMaxDpr()},Fs.prototype.getDpr=function(){return this.resources_.getDpr()},Fs.prototype.propagateAttributes=function(t,e){for(var i=0;i<t.length;i++){var n=t[i];this.element.hasAttribute(n)&&e.setAttribute(n,this.element.getAttribute(n))}},Fs.prototype.getPlaceholder=function(){return this.element.getPlaceholder()},Fs.prototype.togglePlaceholder=function(t){this.element.togglePlaceholder(t)},Fs.prototype.getFallback=function(){return this.element.getFallback()},Fs.prototype.toggleFallback=function(t){this.element.toggleFallback(t)},Fs.prototype.getOverflowElement=function(){return this.element.getOverflowElement()},Fs.prototype.getRealChildNodes=function(){return this.element.getRealChildNodes()},Fs.prototype.getRealChildren=function(){return this.element.getRealChildren()},Fs.prototype.applyFillContent=function(t,e){t.classList.add("-amp-fill-content"),e&&t.classList.add("-amp-replaced-content")},Fs.prototype.getViewport=function(){return Ci.viewportFor(this.getWin())},Fs.prototype.scheduleLayout=function(t){this.resources_.scheduleLayout(this.element,t)},Fs.prototype.schedulePreload=function(t){this.resources_.schedulePreload(this.element,t)},Fs.prototype.updateInViewport=function(t,e){this.resources_.updateInViewport(this.element,t,e)},Fs.prototype.changeHeight=function(t,e){this.resources_.changeHeight(this.element,t,e)},Fs.prototype.attemptChangeHeight=function(t,e){this.resources_.attemptChangeHeight(this.element,t,e)},Fs.prototype.deferMutate=function(t){this.resources_.deferMutate(this.element,t)},Fs.prototype.requestFullOverlay=function(){Ge.viewerFor(this.getWin()).requestFullOverlay()},Fs.prototype.cancelFullOverlay=function(){Ge.viewerFor(this.getWin()).cancelFullOverlay()},Fs.prototype.onLayoutMeasure=function(){},Vs.BaseElement=Fs;var Ns={},Hs=[],Us=function(t){Fs.call(this,t),Hs.push(this)};Be.inherits(Us,Fs),Us.prototype.isLayoutSupported=function(t){return!0},Ns.stubbedElements=Hs,Ns.ElementStub=Us;var Bs={},zs="CustomElement",qs=100,Ws=1e3,js={},Ys="content"in document.createElement("template");Bs.upgradeOrRegisterElement=se,Bs.stubElements=ae,Bs.applyLayout_=ue,Bs.createAmpElementProto=he,Bs.registerElement=ce;var Qs={};Qs.registerExtendedElement=pe;var Gs={},Xs="Viewer",$s="__AMP__",Ks={NATURAL:"natural",VIRTUAL:"virtual",NATURAL_IOS_EMBED:"natural-ios-embed"},Zs={VISIBLE:"visible",HIDDEN:"hidden"},Js=function(t){var e=this;this.win=t,this.isEmbedded_=this.win.parent&&this.win.parent!=this.win,this.docState_=bi.documentStateFor(window),this.isRuntimeOn_=!0,this.overtakeHistory_=!1,this.visibilityState_=Zs.VISIBLE,this.prerenderSize_=1,this.viewportType_=Ks.NATURAL,this.paddingTop_=this.scrollTop_=this.viewportHeight_=this.viewportWidth_=0,this.runtimeOnObservable_=new vi,this.visibilityObservable_=new vi,this.viewportObservable_=new vi,this.historyPoppedObservable_=new vi,this.messageDeliverer_=null,this.messageQueue_=[],this.params_={},this.whenVisibleResolve_=null,this.whenVisiblePromise_=new Promise(function(t){e.whenVisibleResolve_=t}),this.win.name&&0==this.win.name.indexOf($s)&&de(this.win.name.substring($s.length),this.params_),this.win.location.hash&&de(this.win.location.hash,this.params_),Ke.log.fine(Xs,"Viewer params:",this.params_),this.isRuntimeOn_=!parseInt(this.params_.off,10),Ke.log.fine(Xs,"- runtimeOn:",this.isRuntimeOn_),this.overtakeHistory_=parseInt(this.params_.history,10)||this.overtakeHistory_,Ke.log.fine(Xs,"- history:",this.overtakeHistory_),this.visibilityState_=this.params_.visibilityState||this.visibilityState_,Ke.log.fine(Xs,"- visibilityState:",this.visibilityState_),this.prerenderSize_=parseInt(this.params_.prerenderSize,10)||this.prerenderSize_,Ke.log.fine(Xs,"- prerenderSize:",this.prerenderSize_),this.viewportType_=this.params_.viewportType||this.viewportType_,this.viewportType_==Ks.NATURAL&&this.isEmbedded_&&zi.platform.isIos()&&(this.viewportType_=Ks.NATURAL_IOS_EMBED),Ke.log.fine(Xs,"- viewportType:",this.viewportType_),this.viewportWidth_=parseInt(this.params_.width,10)||this.viewportWidth_,Ke.log.fine(Xs,"- viewportWidth:",this.viewportWidth_),this.viewportHeight_=parseInt(this.params_.height,10)||this.viewportHeight_,Ke.log.fine(Xs,"- viewportHeight:",this.viewportHeight_),this.scrollTop_=parseInt(this.params_.scrollTop,10)||this.scrollTop_,Ke.log.fine(Xs,"- scrollTop:",this.scrollTop_),this.paddingTop_=parseInt(this.params_.paddingTop,10)||this.paddingTop_,Ke.log.fine(Xs,"- padding-top:",this.paddingTop_),this.docState_.onVisibilityChanged(this.onVisibilityChange_.bind(this)),this.isEmbedded_&&(t=qe.removeFragment(this.win.location.href),t!=this.win.location.href&&this.win.history.replaceState&&(this.win.history.replaceState({},"",t),Ke.log.fine(Xs,"replace url:"+this.win.location.href))),this.onVisibilityChange_()};Js.prototype.onVisibilityChange_=function(){this.isVisible()&&this.whenVisibleResolve_(),this.visibilityObservable_.fire()},Js.prototype.getParam=function(t){return this.params_[t]},Js.prototype.isEmbedded=function(){return this.isEmbedded_},Js.prototype.isRuntimeOn=function(){return this.isRuntimeOn_},Js.prototype.toggleRuntime=function(){this.isRuntimeOn_=!this.isRuntimeOn_,Ke.log.fine(Xs,"Runtime state:",this.isRuntimeOn_),this.runtimeOnObservable_.fire(this.isRuntimeOn_)},Js.prototype.onRuntimeState=function(t){return this.runtimeOnObservable_.add(t)},Js.prototype.isOvertakeHistory=function(){return this.overtakeHistory_},Js.prototype.getVisibilityState=function(){return this.visibilityState_},Js.prototype.isVisible=function(){return this.visibilityState_==Zs.VISIBLE&&!this.docState_.isHidden()},Js.prototype.whenVisible=function(){return this.whenVisiblePromise_},Js.prototype.getPrerenderSize=function(){return this.prerenderSize_},Js.prototype.getViewportType=function(){return this.viewportType_},Js.prototype.getViewportWidth=function(){return this.viewportWidth_},Js.prototype.getViewportHeight=function(){return this.viewportHeight_},Js.prototype.getScrollTop=function(){return this.scrollTop_},Js.prototype.getPaddingTop=function(){return this.paddingTop_},Js.prototype.onVisibilityChanged=function(t){return this.visibilityObservable_.add(t)},Js.prototype.onViewportEvent=function(t){return this.viewportObservable_.add(t)},Js.prototype.onHistoryPoppedEvent=function(t){return this.historyPoppedObservable_.add(t)},Js.prototype.postDocumentReady=function(t,e){this.sendMessage_("documentLoaded",{width:t,height:e},!1)},Js.prototype.postDocumentResized=function(t,e){this.sendMessage_("documentResized",{width:t,height:e},!1)},Js.prototype.requestFullOverlay=function(){return this.sendMessage_("requestFullOverlay",{},!0)},Js.prototype.cancelFullOverlay=function(){return this.sendMessage_("cancelFullOverlay",{},!0)},Js.prototype.postPushHistory=function(t){return this.sendMessage_("pushHistory",{stackIndex:t},!0)},Js.prototype.postPopHistory=function(t){return this.sendMessage_("popHistory",{stackIndex:t},!0)},Js.prototype.getBaseCid=function(){return this.sendMessage_("cid",void 0,!0)},Js.prototype.receiveMessage=function(t,e,i){if("viewport"==t)void 0!==e.width&&(this.viewportWidth_=e.width),void 0!==e.height&&(this.viewportHeight_=e.height),void 0!==e.paddingTop&&(this.paddingTop_=e.paddingTop),void 0!==e.scrollTop&&(this.scrollTop_=e.scrollTop),this.viewportObservable_.fire();else{if("historyPopped"==t)return this.historyPoppedObservable_.fire({newStackIndex:e.newStackIndex}),Promise.resolve();if("visibilitychange"==t)return void 0!==e.state&&(this.visibilityState_=e.state),void 0!==e.prerenderSize&&(this.prerenderSize_=e.prerenderSize),Ke.log.fine(Xs,"visibilitychange event:",this.visibilityState_,this.prerenderSize_),this.onVisibilityChange_(),Promise.resolve();Ke.log.fine(Xs,"unknown message:",t)}},Js.prototype.setMessageDeliverer=function(t){if(ze.assert(!this.messageDeliverer_,"message deliverer can only be set once"),this.messageDeliverer_=t,0<this.messageQueue_.length){var e=this;t=this.messageQueue_.slice(0),this.messageQueue_=[],t.forEach(function(t){e.messageDeliverer_(t.eventType,t.data,!1)})}},Js.prototype.sendMessage_=function(t,e,i){if(this.messageDeliverer_)return this.messageDeliverer_(t,e,i);for(var n=null,o=0;o<this.messageQueue_.length;o++)if(this.messageQueue_[o].eventType==t){n=this.messageQueue_[o];break}return n?n.data=e:this.messageQueue_.push({eventType:t,data:e}),i?Promise.resolve():void 0};Gs.ViewportType=Ks,Gs.VisibilityState=Zs,Gs.Viewer=Js,Gs.parseParams_=de,Gs.installViewerService=fe;var ta={},ea=16,ia=function(t,e){var i=this;this.win=t,this.viewer_=e,this.raf_=this.getRaf_(),this.tasks_=[],this.states_=[],this.scheduled_=!1,this.boundRunScheduledTasks_=this.runScheduledTasks_.bind(this),this.pass_=new Ui(this.boundRunScheduledTasks_,ea),this.viewer_.onVisibilityChanged(function(){i.scheduled_&&i.forceSchedule_()})};ia.prototype.run=function(t,e){this.tasks_.push(t),this.states_.push(e||{}),this.schedule_()},ia.prototype.createTask=function(t){var e=this;return function(i){e.run(t,i)}},ia.prototype.mutate=function(t){this.run({mutate:t})},ia.prototype.mutatePromise=function(t){var e=this;return new Promise(function(i){e.mutate(function(){t(),i()})})},ia.prototype.measure=function(t){this.run({measure:t})},ia.prototype.measurePromise=function(t){var e=this;return new Promise(function(i){e.measure(function(){i(t())})})},ia.prototype.canAnimate=function(){return this.viewer_.isVisible()},ia.prototype.runAnim=function(t,e){return this.canAnimate()?(this.run(t,e),!0):(Ke.log.warn("Vsync","Did not schedule a vsync request, because document was invisible"),!1)},ia.prototype.createAnimTask=function(t){var e=this;return function(i){return e.runAnim(t,i)}},ia.prototype.runAnimMutateSeries=function(t,e){var i=this;return this.canAnimate()?new Promise(function(n,o){var r=ui.timer.now(),s=0,a=i.createAnimTask({mutate:function(i){var u=ui.timer.now()-r;t(u,u-s,i)?e&&u>e?o("timeout"):(s=u,a(i)):n()}});a({})}):Promise.reject()},ia.prototype.schedule_=function(){this.scheduled_||(this.scheduled_=!0,this.forceSchedule_())},ia.prototype.forceSchedule_=function(){this.canAnimate()?this.raf_(this.boundRunScheduledTasks_):this.pass_.schedule()},ia.prototype.runScheduledTasks_=function(){this.scheduled_=!1;var t=this.tasks_,e=this.states_;this.tasks_=[],this.states_=[];for(var i=0;i<t.length;i++)t[i].measure&&t[i].measure(e[i]);for(i=0;i<t.length;i++)t[i].mutate&&t[i].mutate(e[i])},ia.prototype.getRaf_=function(){var t=this,e=this.win.requestAnimationFrame||this.win.webkitRequestAnimationFrame;if(e)return e.bind(this.win);var i=0;return function(e){var n=(new Date).getTime(),o=Math.max(0,ea-(n-i));i=n+o,t.win.setTimeout(e,o)}},ta.Vsync=ia,ta.installVsyncService=me;var na={},oa="Viewport",ra=function(t,e,i){var n=this;this.win_=t,this.binding_=e,this.viewer_=i,this.scrollLeft_=this.lastMeasureScrollTop_=this.scrollTop_=this.size_=null,this.paddingTop_=i.getPaddingTop(),this.scrollMeasureTime_=0,this.vsync_=ta.installVsyncService(t),this.scrollTracking_=!1,this.scrollCount_=0,this.changeObservable_=new vi,this.scrollObservable_=new vi,this.originalViewportMetaString_=this.viewportMeta_=void 0,this.boundThrottledScroll_=this.throttledScroll_.bind(this),this.viewer_.onViewportEvent(function(){n.binding_.updateViewerViewport(n.viewer_);var t=n.viewer_.getPaddingTop();t!=n.paddingTop_&&(n.paddingTop_=t,n.binding_.updatePaddingTop(n.paddingTop_))}),this.binding_.updateViewerViewport(this.viewer_),this.binding_.updatePaddingTop(this.paddingTop_),this.binding_.onScroll(this.scroll_.bind(this)),this.binding_.onResize(this.resize_.bind(this))};ra.prototype.cleanup_=function(){this.binding_.cleanup_()},ra.prototype.getPaddingTop=function(){return this.paddingTop_},ra.prototype.getTop=function(){return this.getScrollTop()},ra.prototype.getScrollTop=function(){return null==this.scrollTop_&&(this.scrollTop_=this.binding_.getScrollTop()),this.scrollTop_},ra.prototype.getScrollLeft=function(){return null==this.scrollLeft_&&(this.scrollLeft_=this.binding_.getScrollLeft()),this.scrollLeft_},ra.prototype.setScrollTop=function(t){this.scrollTop_=null,this.binding_.setScrollTop(t)},ra.prototype.getSize=function(){return this.size_?this.size_:this.size_=this.binding_.getSize()},ra.prototype.getWidth=function(){return this.getSize().width},ra.prototype.getScrollWidth=function(){return this.binding_.getScrollWidth()},ra.prototype.getScrollHeight=function(){return this.binding_.getScrollHeight()},ra.prototype.getRect=function(){var t=this.getScrollTop(),e=this.getScrollLeft(),i=this.getSize();return Bi.layoutRectLtwh(e,t,i.width,i.height)},ra.prototype.getLayoutRect=function(t){return this.binding_.getLayoutRect(t)},ra.prototype.scrollIntoView=function(t){t=this.binding_.getLayoutRect(t).top,this.binding_.setScrollTop(Math.max(0,t-this.paddingTop_))},ra.prototype.onChanged=function(t){return this.changeObservable_.add(t)},ra.prototype.onScroll=function(t){return this.scrollObservable_.add(t)},ra.prototype.resetTouchZoom=function(){var t=this.win_.innerHeight,e=this.win_.document.documentElement.clientHeight;if((!t||!e||t!==e)&&this.disableTouchZoom()){var i=this;ui.timer.delay(function(){i.restoreOriginalTouchZoom()},50)}},ra.prototype.disableTouchZoom=function(){var t=this.getViewportMeta_();return t?(t=ye(t.content,{"maximum-scale":"1","user-scalable":"no"}),this.setViewportMetaString_(t)):!1},ra.prototype.restoreOriginalTouchZoom=function(){return void 0!==this.originalViewportMetaString_?this.setViewportMetaString_(this.originalViewportMetaString_):!1},ra.prototype.hasScrolled=function(){return 0<this.scrollCount_},ra.prototype.setViewportMetaString_=function(t){var e=this.getViewportMeta_();return e&&e.content!=t?(Ke.log.fine(oa,"changed viewport meta to:",t),e.content=t,!0):!1},ra.prototype.getViewportMeta_=function(){return this.viewer_.isEmbedded()?null:(void 0===this.viewportMeta_&&(this.viewportMeta_=this.win_.document.querySelector("meta[name=viewport]"))&&(this.originalViewportMetaString_=this.viewportMeta_.content),this.viewportMeta_)},ra.prototype.changed_=function(t,e){var i=this.getSize(),n=this.getScrollTop();Ke.log.fine(oa,"changed event:","relayoutAll=",t,"top=",n,"bottom=",n+i.height,"velocity=",e),this.changeObservable_.fire({relayoutAll:t,top:n,width:i.width,height:i.height,velocity:e})},ra.prototype.scroll_=function(){this.scrollCount_++,this.scrollLeft_=this.binding_.getScrollLeft();var t=this.binding_.getScrollTop();if(!(0>t)){if(this.scrollTop_=t,!this.scrollTracking_){var e=this;this.scrollTracking_=!0;var i=ui.timer.now();ui.timer.delay(function(){return e.vsync_.measure(e.throttledScroll_.bind(e,i,t))},36)}this.scrollObservable_.fire()}},ra.prototype.throttledScroll_=function(t,e){this.scrollTracking_=!1;var i=this.scrollTop_=this.binding_.getScrollTop(),n=ui.timer.now(),o=0;if(n!=t&&(o=(i-e)/(n-t)),Ke.log.fine(oa,"scroll: scrollTop="+i+"; velocity="+o),.03>Math.abs(o))this.changed_(!1,o);else{var r=this;ui.timer.delay(function(){return r.vsync_.measure(r.throttledScroll_.bind(r,n,i))},20)}},ra.prototype.resize_=function(){var t=this.size_;this.size_=null;var e=this.getSize();this.changed_(!t||t.width!=e.width,0)};var sa=function(){};sa.prototype.onScroll=function(t){},sa.prototype.onResize=function(t){},sa.prototype.updateViewerViewport=function(t){},sa.prototype.updatePaddingTop=function(t){},sa.prototype.getSize=function(){},sa.prototype.getScrollTop=function(){},sa.prototype.setScrollTop=function(t){},sa.prototype.getScrollLeft=function(){},sa.prototype.getScrollWidth=function(){},sa.prototype.getScrollHeight=function(){},sa.prototype.getLayoutRect=function(t){},sa.prototype.cleanup_=function(){};var aa=function(t){var e=this;this.win=t,this.scrollObservable_=new vi,this.resizeObservable_=new vi,this.win.addEventListener("scroll",function(){return e.scrollObservable_.fire()}),this.win.addEventListener("resize",function(){return e.resizeObservable_.fire()}),Ke.log.fine(oa,"initialized natural viewport")};aa.prototype.cleanup_=function(){},aa.prototype.onScroll=function(t){this.scrollObservable_.add(t)},aa.prototype.onResize=function(t){this.resizeObservable_.add(t)},aa.prototype.updateViewerViewport=function(t){},aa.prototype.updatePaddingTop=function(t){this.win.document.documentElement.style.paddingTop=mi.px(t)},aa.prototype.getSize=function(){if(zi.platform.isIos()&&!zi.platform.isChrome()){var t=this.win.innerWidth,e=this.win.innerHeight;if(t&&e)return{width:t,height:e}}return t=this.win.document.documentElement,{width:t.clientWidth,height:t.clientHeight}},aa.prototype.getScrollTop=function(){return this.getScrollingElement_().scrollTop||this.win.pageYOffset},aa.prototype.getScrollLeft=function(){return this.getScrollingElement_().scrollLeft||this.win.pageXOffset},aa.prototype.getScrollWidth=function(){return this.getScrollingElement_().scrollWidth},aa.prototype.getScrollHeight=function(){return this.getScrollingElement_().scrollHeight},aa.prototype.getLayoutRect=function(t){var e=this.getScrollTop(),i=this.getScrollLeft();return t=t.getBoundingClientRect(),Bi.layoutRectLtwh(Math.round(t.left+i),Math.round(t.top+e),Math.round(t.width),Math.round(t.height))},aa.prototype.setScrollTop=function(t){this.getScrollingElement_().scrollTop=t},aa.prototype.getScrollingElement_=function(){var t=this.win.document;return t.scrollingElement?t.scrollingElement:t.body?t.body:t.documentElement};var ua=function(t){var e=this;this.win=t,this.scrollWidth_=0,this.scrollMoveEl_=this.scrollPosEl_=null,this.pos_={x:0,y:0},this.scrollObservable_=new vi,this.resizeObservable_=new vi,bi.onDocumentReady(this.win.document,function(){ui.timer.delay(function(){e.setup_()},0)}),this.win.addEventListener("resize",function(){return e.resizeObservable_.fire()}),Ke.log.fine(oa,"initialized natural viewport for iOS embeds")};ua.prototype.setup_=function(){var t=this.win.document.documentElement,e=this.win.document.body;this.scrollWidth_=e.scrollWidth||0,mi.setStyles(t,{overflow:"auto",webkitOverflowScrolling:"touch"}),mi.setStyles(e,{overflow:"auto",webkitOverflowScrolling:"touch",position:"absolute",top:0,left:0,right:0,bottom:0}),this.scrollPosEl_=this.win.document.createElement("div"),this.scrollPosEl_.id="-amp-scrollpos",mi.setStyles(this.scrollPosEl_,{position:"absolute",top:0,left:0,width:0,height:0,visibility:"hidden"}),e.appendChild(this.scrollPosEl_),this.scrollMoveEl_=this.win.document.createElement("div"),this.scrollMoveEl_.id="-amp-scrollmove",mi.setStyles(this.scrollMoveEl_,{position:"absolute",top:0,left:0,width:0,height:0,visibility:"hidden"}),e.appendChild(this.scrollMoveEl_),this.endPosEl_=this.win.document.createElement("div"),this.endPosEl_.id="-amp-endpos",mi.setStyles(this.endPosEl_,{width:0,height:0,visibility:"hidden"}),e.appendChild(this.endPosEl_),e.addEventListener("scroll",this.onScrolled_.bind(this))},ua.prototype.updateViewerViewport=function(t){},ua.prototype.updatePaddingTop=function(t){var e=this;bi.onDocumentReady(this.win.document,function(){e.win.document.body.style.paddingTop=mi.px(t)})},ua.prototype.cleanup_=function(){},ua.prototype.onScroll=function(t){this.scrollObservable_.add(t)},ua.prototype.onResize=function(t){this.resizeObservable_.add(t)},ua.prototype.getSize=function(){return{width:this.win.innerWidth,height:this.win.innerHeight}},ua.prototype.getScrollTop=function(){return Math.round(this.pos_.y)},ua.prototype.getScrollLeft=function(){return Math.round(this.pos_.x)},ua.prototype.getScrollWidth=function(){return Math.max(this.scrollWidth_,this.win.innerWidth)},ua.prototype.getScrollHeight=function(){return this.endPosEl_?Math.round(this.endPosEl_.getBoundingClientRect().top-this.scrollPosEl_.getBoundingClientRect().top):0},ua.prototype.getLayoutRect=function(t){return t=t.getBoundingClientRect(),Bi.layoutRectLtwh(Math.round(t.left+this.pos_.x),Math.round(t.top+this.pos_.y),Math.round(t.width),Math.round(t.height))},ua.prototype.setScrollTop=function(t){this.setScrollPos_(t||1)},ua.prototype.onScrolled_=function(t){this.scrollPosEl_&&(this.adjustScrollPos_(t),t=this.scrollPosEl_.getBoundingClientRect(),this.pos_.x!=-t.left||this.pos_.y!=-t.top)&&(this.pos_.x=-t.left,this.pos_.y=-t.top,this.scrollObservable_.fire())},ua.prototype.setScrollPos_=function(t){this.scrollMoveEl_&&(mi.setStyle(this.scrollMoveEl_,"transform","translateY("+t+"px)"),this.scrollMoveEl_.scrollIntoView(!0))},ua.prototype.adjustScrollPos_=function(t){this.scrollPosEl_&&this.scrollMoveEl_&&0==-this.scrollPosEl_.getBoundingClientRect().top&&(this.setScrollPos_(1),t&&t.preventDefault())};var la=function(t,e){this.win=t,this.width_=e.getViewportWidth(),this.height_=e.getViewportHeight(),this.scrollTop_=e.getScrollTop(),this.scrollObservable_=new vi,this.resizeObservable_=new vi,Ke.log.fine(oa,"initialized virtual viewport")};la.prototype.cleanup_=function(){},la.prototype.updateViewerViewport=function(t){t.getScrollTop()!=this.scrollTop_&&(this.scrollTop_=t.getScrollTop(),this.scrollObservable_.fire()),(t.getViewportWidth()!=this.width_||t.getViewportHeight()!=this.height_)&&(this.width_=t.getViewportWidth(),this.height_=t.getViewportHeight(),this.resizeObservable_.fire())},la.prototype.updatePaddingTop=function(t){this.win.document.documentElement.style.paddingTop=mi.px(t)},la.prototype.onScroll=function(t){this.scrollObservable_.add(t)},la.prototype.onResize=function(t){this.resizeObservable_.add(t)},la.prototype.getSize=function(){return{width:this.width_,height:this.height_}},la.prototype.getScrollTop=function(){return this.scrollTop_},la.prototype.getScrollLeft=function(){return 0},la.prototype.getScrollWidth=function(){return this.win.document.documentElement.scrollWidth},la.prototype.getScrollHeight=function(){return this.win.document.documentElement.scrollHeight},la.prototype.getLayoutRect=function(t){return t=t.getBoundingClientRect(),Bi.layoutRectLtwh(Math.round(t.left),Math.round(t.top),Math.round(t.width),Math.round(t.height))},la.prototype.setScrollTop=function(t){},na.Viewport=ra,na.ViewportBindingNatural_=aa,na.ViewportBindingNaturalIosEmbed_=ua,na.ViewportBindingVirtual_=la,na.parseViewportMeta=_e,na.stringifyViewportMeta=ge,na.updateViewportMetaString=ye,na.installViewportService=be;var ha={},ca="Action",pa="__AMP_ACTION_MAP__"+Math.random(),da="__AMP_ACTION_QUEUE__",fa="activate",ma=function(t,e,i,n){this.target=t,this.method=e,this.source=i,this.event=n},_a=function(t){this.win=t,this.globalMethodHandlers_={},this.vsync_=Ei.vsyncFor(this.win),this.addEvent("tap")};_a.prototype.addEvent=function(t){if("tap"==t){var e=this;this.win.document.addEventListener("click",function(t){t.defaultPrevented||e.trigger(t.target,"tap",t)})}},_a.prototype.addGlobalMethodHandler=function(t,e){this.globalMethodHandlers_[t]=e},_a.prototype.trigger=function(t,e,i){this.action_(t,e,i)},_a.prototype.execute=function(t,e,i,n){this.invoke_(t,e,i,n,null)},_a.prototype.installActionHandler=function(t,e){var i=t.tagName+"#"+t.id;ze.assert(t.id&&"amp-"==t.id.substring(0,4),"AMP element is expected: %s",i);var n=t[da];n&&ze.assert("[object Array]"==Object.prototype.toString.call(n),"Expected queue to be an array: %s",i),t[da]={push:e},n&&ui.timer.delay(function(){n.forEach(function(t){try{e(t)}catch(i){Ke.log.error(ca,"Action execution failed:",t,i)}})},1)},_a.prototype.action_=function(t,e,i){(t=this.findAction_(t,e))&&((e=document.getElementById(t.actionInfo.target))?this.invoke_(e,t.actionInfo.method,t.node,i,t.actionInfo):this.actionInfoError_("target not found",t.actionInfo,e))},_a.prototype.actionInfoError_=function(t,e,i){throw Error("Action Error: "+t+(e?" in ["+e.str+"]":"")+(i?" on ["+i+"]":""))},_a.prototype.invoke_=function(t,e,i,n,o){e=new ma(t,e,i,n),this.globalMethodHandlers_[e.method]?this.globalMethodHandlers_[e.method](e):"amp-"==t.tagName.toLowerCase().substring(0,4)?t.enqueAction?t.enqueAction(e):this.actionInfoError_('Unrecognized AMP element "'+t.tagName.toLowerCase()+'". Did you forget to include it via <script custom-element>?',o,t):t.id&&"amp-"==t.id.substring(0,4)?(t[da]||(t[da]=[]),t[da].push(e)):this.actionInfoError_("Target must be an AMP element or have an AMP ID",o,t)},_a.prototype.findAction_=function(t,e){for(var i=t,n=null;i;){if(n=this.matchActionInfo_(i,e))return{node:i,actionInfo:n};i=i.parentElement}return null},_a.prototype.matchActionInfo_=function(t,e){var i=this.getActionMap_(t);return i?i[e]||null:null},_a.prototype.getActionMap_=function(t){var e=t[pa];return void 0===e&&(e=null,t.hasAttribute("on")&&(e=this.parseActionMap_(t.getAttribute("on"))),t[pa]=e),e},_a.prototype.parseActionMap_=function(t){var e=null;if((t=t.split(";"))&&0<t.length)for(var i=0;i<t.length;i++){var n=this.parseAction_(t[i]);n&&(e||(e={}),e[n.event]=n)}return e},_a.prototype.parseAction_=function(t){if(t=t.trim(),!t)return null;var e=t.indexOf(":"),i=t.indexOf(".",e+1),n=(-1!=e?t.substring(0,e):"").toLowerCase().trim()||null,e=t.substring(e+1,-1!=i?i:t.length).trim(),i=(-1!=i?t.substring(i+1):"").trim()||fa;return n&&e?{event:n,target:e,method:i,str:t}:(Ke.log.error(ca,"invalid action definition: "+t),null)},ha.ActionService=_a,ha.installActionService=we;var ga={},ya="History",va="AMP.History",ba=function(t){this.binding_=t,this.stackIndex_=0,this.stackOnPop_=[],this.queue_=[],this.binding_.setOnStackIndexUpdated(this.onStackIndexUpdated_.bind(this))};ba.prototype.cleanup_=function(){this.binding_.cleanup_()},ba.prototype.push=function(t){var e=this;return this.enque_(function(){return e.binding_.push().then(function(i){return e.onStackIndexUpdated_(i),t&&(e.stackOnPop_[i]=t),i})})},ba.prototype.pop=function(t){var e=this;return this.enque_(function(){return e.binding_.pop(t).then(function(t){e.onStackIndexUpdated_(t)})})},ba.prototype.onStackIndexUpdated_=function(t){this.stackIndex_=t,this.doPop_()},ba.prototype.doPop_=function(){if(!(this.stackIndex_>=this.stackOnPop_.length-1)){for(var t=[],e=this.stackOnPop_.length-1;e>this.stackIndex_;e--)this.stackOnPop_[e]&&(t.push(this.stackOnPop_[e]),this.stackOnPop_[e]=void 0);if(this.stackOnPop_.splice(this.stackIndex_+1),0<t.length)for(e=0;e<t.length;e++)ui.timer.delay(t[e],1)}},ba.prototype.enque_=function(t){var e=void 0,i=void 0,n=new Promise(function(t,n){e=t,i=n});return this.queue_.push({callback:t,resolve:e,reject:i}),1==this.queue_.length&&this.deque_(),n},ba.prototype.deque_=function(){var t=this;if(0!=this.queue_.length){var e=this.queue_[0],i=void 0;try{i=e.callback()}catch(n){i=Promise.reject(n)}i.then(function(t){e.resolve(t)},function(t){Ke.log.error(ya,"failed to execute a task:",t),e.reject(t)}).then(function(){t.queue_.splice(0,1),t.deque_()})}};var wa=function(){};wa.prototype.cleanup_=function(){},wa.prototype.setOnStackIndexUpdated=function(t){},wa.prototype.push=function(){},wa.prototype.pop=function(t){};var Sa=function(t){var e=this;this.win=t,t=this.win.history,this.startIndex_=t.length-1,t.state&&void 0!==t.state[va]&&(this.startIndex_=Math.min(t.state[va],this.startIndex_)),this.stackIndex_=this.startIndex_,this.onStackIndexUpdated_=null,this.supportsState_="state"in t,this.unsupportedState_=Se(this.stackIndex_);var i,n=void 0;if(t.pushState&&t.replaceState){var o=this;this.origPushState_=t.pushState.bind(t),this.origReplaceState_=t.replaceState.bind(t),n=function(t,e,i){o.unsupportedState_=t,o.origPushState_(t,e,i)},i=function(t,e,i){o.unsupportedState_=t,void 0!==i?o.origReplaceState_(t,e,i):o.origReplaceState_(t,e)}}else{var r=this,n=function(t,e,i){r.unsupportedState_=t};i=function(t,e,i){r.unsupportedState_=t}}this.pushState_=n,this.replaceState_=i;try{this.replaceState_(Se(this.stackIndex_))}catch(s){Ke.log.error(ya,"Initial replaceState failed: "+s.message)}t.pushState=this.historyPushState_.bind(this),t.replaceState=this.historyReplaceState_.bind(this);var a=new Ui(this.onHistoryEvent_.bind(this),50);this.popstateHandler_=function(t){Ke.log.fine(ya,"popstate event: "+e.win.history.length+", "+JSON.stringify(t.state)),a.schedule()},this.hashchangeHandler_=function(){Ke.log.fine(ya,"hashchange event: "+e.win.history.length+", "+e.win.location.hash),a.schedule()},this.win.addEventListener("popstate",this.popstateHandler_),this.win.addEventListener("hashchange",this.hashchangeHandler_);
};Sa.prototype.cleanup_=function(){this.origPushState_&&(this.win.history.pushState=this.origPushState_),this.origReplaceState_&&(this.win.history.replaceState=this.origReplaceState_),this.win.removeEventListener("popstate",this.popstateHandler_),this.win.removeEventListener("hashchange",this.hashchangeHandler_)},Sa.prototype.setOnStackIndexUpdated=function(t){this.onStackIndexUpdated_=t},Sa.prototype.push=function(){var t=this;return this.whenReady_(function(){return t.historyPushState_(),Promise.resolve(t.stackIndex_)})},Sa.prototype.pop=function(t){var e=this;return t=Math.max(t,this.startIndex_),this.whenReady_(function(){return e.back_(e.stackIndex_-t+1)})},Sa.prototype.backTo=function(t){var e=this;return t=Math.max(t,this.startIndex_),this.whenReady_(function(){return e.back_(e.stackIndex_-t)})},Sa.prototype.onHistoryEvent_=function(){var t=this.getState_();Ke.log.fine(ya,"history event: "+this.win.history.length+", "+JSON.stringify(t));var e=t?t[va]:void 0,i=this.stackIndex_,n=this.waitingState_;this.waitingState_=void 0,i>this.win.history.length-2&&(i=this.win.history.length-2,this.updateStackIndex_(i)),i=void 0==e?i+1:e<this.win.history.length?e:this.win.history.length-1,t||(t={}),t[va]=i,this.replaceState_(t,void 0,void 0),i!=this.stackIndex_&&this.updateStackIndex_(i),i<this.startIndex_&&(this.startIndex_=i),n&&n.resolve()},Sa.prototype.getState_=function(){return this.supportsState_?this.win.history.state:this.unsupportedState_},Sa.prototype.assertReady_=function(){ze.assert(!this.waitingState_,"The history must not be in the waiting state")},Sa.prototype.whenReady_=function(t){return this.waitingState_?this.waitingState_.promise.then(t,t):t()},Sa.prototype.wait_=function(){this.assertReady_();var t=void 0,e=void 0,i=ui.timer.timeoutPromise(500,new Promise(function(i,n){t=i,e=n}));return this.waitingState_={promise:i,resolve:t,reject:e},i},Sa.prototype.back_=function(t){var e=this;if(this.assertReady_(),0>=t)return Promise.resolve(this.stackIndex_);this.unsupportedState_=Se(this.stackIndex_-t);var i=this.wait_();return this.win.history.go(-t),i.then(function(){return Promise.resolve(e.stackIndex_)})},Sa.prototype.historyPushState_=function(t,e,i){this.assertReady_(),t||(t={});var n=this.stackIndex_+1;t[va]=n,this.pushState_(t,e,i),n!=this.win.history.length-1&&(n=this.win.history.length-1,t[va]=n,this.replaceState_(t)),this.updateStackIndex_(n)},Sa.prototype.historyReplaceState_=function(t,e,i){this.assertReady_(),t||(t={});var n=Math.min(this.stackIndex_,this.win.history.length-1);t[va]=n,this.replaceState_(t,e,i),this.updateStackIndex_(n)},Sa.prototype.updateStackIndex_=function(t){this.assertReady_(),t=Math.min(t,this.win.history.length-1),this.stackIndex_!=t&&(Ke.log.fine(ya,"stack index changed: "+this.stackIndex_+" -> "+t),this.stackIndex_=t,this.onStackIndexUpdated_)&&this.onStackIndexUpdated_(t)};var Ea=function(t){this.viewer_=t,this.stackIndex_=0,this.onStackIndexUpdated_=null,this.unlistenOnHistoryPopped_=this.viewer_.onHistoryPoppedEvent(this.onHistoryPopped_.bind(this))};Ea.prototype.cleanup_=function(){this.unlistenOnHistoryPopped_()},Ea.prototype.setOnStackIndexUpdated=function(t){this.onStackIndexUpdated_=t},Ea.prototype.push=function(){return this.updateStackIndex_(this.stackIndex_+1),this.viewer_.postPushHistory(this.stackIndex_),Promise.resolve(this.stackIndex_)},Ea.prototype.pop=function(t){return t>this.stackIndex_?Promise.resolve(this.stackIndex_):(this.viewer_.postPopHistory(t),this.updateStackIndex_(t-1),Promise.resolve(this.stackIndex_))},Ea.prototype.onHistoryPopped_=function(t){this.updateStackIndex_(t.newStackIndex)},Ea.prototype.updateStackIndex_=function(t){this.stackIndex_!=t&&(Ke.log.fine(ya,"stack index changed: "+this.stackIndex_+" -> "+t),this.stackIndex_=t,this.onStackIndexUpdated_)&&this.onStackIndexUpdated_(t)},ga.History=ba,ga.HistoryBindingNatural_=Sa,ga.HistoryBindingVirtual_=Ea,ga.installHistoryService=Te;var Ta={};Ta.installCoreServices=Ae;var Aa={},Ca=50,La=function(t){this.win=t,this.events_=[]};La.prototype.tick=function(t,e,i){this.tick_?this.tick_(t,e,i):this.queueTick_(t,e,i)},La.prototype.flush=function(){this.flush_&&this.flush_()},La.prototype.queueTick_=function(t,e,i){void 0==i&&(i=ui.timer.now()),this.events_.length>=Ca&&this.events_.shift(),this.events_.push({label:t,opt_from:e,opt_value:i})},La.prototype.flushQueuedTicks_=function(){var t=this;this.tick_&&(this.events_.forEach(function(e){t.tick_(e.label,e.opt_from,e.opt_value)}),this.events_.length=0)},La.prototype.setTickFunction=function(t,e){this.tick_=t,this.flush_=e,this.flushQueuedTicks_(),this.flush()},Aa.Performance=La,Aa.performanceFor=Ce;var Oa={},Ia=[];Oa.adopt=Le,Oa.registerForUnitTest=Oe;var ka={};ka.installVideo=Ie;var Pa={};Pa.maybeValidate=ke;var Ma={},xa=function(t){this.win=t,this.viewport_=Ci.viewportFor(t),this.boundHandle_=this.handle_.bind(this),this.win.document.documentElement.addEventListener("click",this.boundHandle_)};xa.prototype.cleanup=function(){this.win.document.documentElement.removeEventListener("click",this.boundHandle_)},xa.prototype.handle_=function(t){Re(t,this.viewport_)},Ma.installGlobalClickListener=Pe,Ma.uninstallGlobalClickListener=Me,Ma.ClickHandler=xa,Ma.onDocumentElementClick_=Re;var Ra={},Da=function(t,e){this.doc_=t,this.viewport_=e,this.tracking_=!1,this.startPos_=0,this.boundTouchStart_=this.onTouchStart_.bind(this),this.boundTouchMove_=this.onTouchMove_.bind(this),this.boundTouchEnd_=this.onTouchEnd_.bind(this),this.boundTouchCancel_=this.onTouchCancel_.bind(this),this.doc_.addEventListener("touchstart",this.boundTouchStart_,!0)};Da.prototype.cleanup=function(){this.stopTracking_(),this.doc_.removeEventListener("touchstart",this.boundTouchStart_,!0)},Da.prototype.onTouchStart_=function(t){this.tracking_||!t.touches||1!=t.touches.length||0<this.viewport_.getTop()||this.startTracking_(t.touches[0].clientY)},Da.prototype.startTracking_=function(t){this.tracking_=!0,this.startPos_=t,this.doc_.addEventListener("touchmove",this.boundTouchMove_,!0),this.doc_.addEventListener("touchend",this.boundTouchEnd_,!0),this.doc_.addEventListener("touchcancel",this.boundTouchCancel_,!0)},Da.prototype.stopTracking_=function(){this.tracking_=!1,this.startPos_=0,this.doc_.removeEventListener("touchmove",this.boundTouchMove_,!0),this.doc_.removeEventListener("touchend",this.boundTouchEnd_,!0),this.doc_.removeEventListener("touchcancel",this.boundTouchCancel_,!0)},Da.prototype.onTouchMove_=function(t){if(this.tracking_){var e=t.touches[0].clientY-this.startPos_;e>0&&t.preventDefault(),0!=e&&this.stopTracking_()}},Da.prototype.onTouchEnd_=function(t){this.stopTracking_()},Da.prototype.onTouchCancel_=function(t){this.stopTracking_()},Ra.installPullToRefreshBlocker=De,Ra.PullToRefreshBlocker=Da;var Va={};Va.installPixel=Ve;var Fa={};Fa.getIntersectionChangeEntry=Fe;var Na={},Ha={"AMP-LIGHTBOX":!0};Na.installAd=Ne;var Ua={};Ua.installImg=He;try{ls.installErrorReporting(window);var Ba=Aa.performanceFor(window);Ba.tick("is"),Si.installStyles(document,Ki.cssText,function(){try{Ta.installCoreServices(window),ii.templatesFor(window),Ua.installImg(window),Na.installAd(window),Va.installPixel(window),ka.installVideo(window),Oa.adopt(window),Bs.stubElements(window),Ra.installPullToRefreshBlocker(window),Ma.installGlobalClickListener(window),Pa.maybeValidate(window)}finally{Si.makeBodyVisible(document),Ba.tick("e_is"),Ba.flush()}},!0)}catch(jn){throw Si.makeBodyVisible(document),jn}window.console&&(console.info||console.log).call(console,"Powered by AMP ⚡ HTML – Version $internalRuntimeVersion$"),document.documentElement.setAttribute("amp-version","$internalRuntimeVersion$")}()}catch(e){throw setTimeout(function(){document.body.style.opacity=1},1e3),e}
</script>
<script type="not/js" id="browserify">
try{!function t(e,i,n){function r(s,a){if(!i[s]){if(!e[s]){var l="function"==typeof require&&require;if(!a&&l)return l(s,!0);if(o)return o(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var c=i[s]={exports:{}};e[s][0].call(c.exports,function(t){var i=e[s][1][t];return r(i?i:t)},c,c.exports,t,e,i,n)}return i[s].exports}for(var o="function"==typeof require&&require,s=0;s<n.length;s++)r(n[s]);return r}({1:[function(t,e,i){i.__esModule=!0;var n={doubleclick:"https://www.googletagservices.com/tag/js/gpt.js",a9:"https://c.amazon-adsystem.com/aax2/assoc.js",adsense:"https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"};i.adPrefetch=n;var r={adreactor:"https://adserver.adreactor.com",adsense:"https://googleads.g.doubleclick.net",doubleclick:["https://partner.googleadservices.com","https://securepubads.g.doubleclick.net","https://tpc.googlesyndication.com"]};i.adPreconnect=r},{}],2:[function(t,e,i){i.__esModule=!0;var n="body{margin:0!important;-webkit-text-size-adjust:100%;-moz-text-size-adjust:100%;-ms-text-size-adjust:100%;text-size-adjust:100%}.-amp-element{display:inline-block}.-amp-layout-fixed{display:inline-block;position:relative}.-amp-layout-container,.-amp-layout-fixed-height,.-amp-layout-responsive{display:block;position:relative}.-amp-layout-fill{display:block;position:absolute;top:0;left:0;bottom:0;right:0}.-amp-layout-fill,.-amp-layout-size-defined{overflow:hidden!important}i-amp-sizer{display:block!important}.-amp-fill-content{display:block;width:100%;height:100%;margin:auto}.-amp-layout-size-defined .-amp-fill-content{position:absolute;top:0;left:0;bottom:0;right:0}.-amp-replaced-content{padding:0!important;border:none!important}.-amp-unresolved{position:relative;overflow:hidden!important}.-amp-notbuilt{position:relative;overflow:hidden!important;color:transparent!important}.-amp-notbuilt>*{display:none}.-amp-ghost{visibility:hidden!important}.-amp-element>[placeholder]{display:block}.-amp-element>[placeholder].amp-hidden,.-amp-element>[placeholder].hidden{visibility:hidden}.-amp-element:not(.amp-notsupported)>[fallback]{display:none}.-amp-layout-size-defined>[fallback],.-amp-layout-size-defined>[placeholder]{position:absolute!important;top:0!important;left:0!important;right:0!important;bottom:0!important;z-index:1!important}.-amp-notbuilt>[placeholder]{display:block!important}.-amp-hidden-by-media-query{display:none}.-amp-element-error{background:red!important;color:#fff!important;position:relative!important}.-amp-element-error:before{content:attr(error-message)}i-amp-scroll-container{position:absolute;top:0;left:0;right:0;bottom:0;overflow:auto}.-amp-loading-container{display:block!important;z-index:1}.-amp-notbuilt>.-amp-loading-container{display:block!important}.-amp-loading-container.amp-hidden{visibility:hidden}.-amp-loader{position:absolute;display:block;height:10px;top:50%;left:50%;-webkit-transform:translateX(-50%) translateY(-50%);transform:translateX(-50%) translateY(-50%);-webkit-transform-origin:50% 50%;transform-origin:50% 50%;white-space:nowrap}.-amp-loader.amp-active .-amp-loader-dot{-webkit-animation:a 2s infinite;animation:a 2s infinite}.-amp-loader-dot{position:relative;display:inline-block;height:10px;width:10px;margin:2px;border-radius:100%;background-color:rgba(0,0,0,.3);box-shadow:2px 2px 2px 1px rgba(0,0,0,.2);will-change:transform}.-amp-loader .-amp-loader-dot:nth-child(1){-webkit-animation-delay:0s;animation-delay:0s}.-amp-loader .-amp-loader-dot:nth-child(2){-webkit-animation-delay:.1s;animation-delay:.1s}.-amp-loader .-amp-loader-dot:nth-child(3){-webkit-animation-delay:.2s;animation-delay:.2s}@-webkit-keyframes a{0%,to{-webkit-transform:scale(.7);transform:scale(.7);background-color:rgba(0,0,0,.3)}50%{-webkit-transform:scale(.8);transform:scale(.8);background-color:rgba(0,0,0,.5)}}@keyframes a{0%,to{-webkit-transform:scale(.7);transform:scale(.7);background-color:rgba(0,0,0,.3)}50%{-webkit-transform:scale(.8);transform:scale(.8);background-color:rgba(0,0,0,.5)}}.-amp-element>[overflow]{cursor:pointer;z-index:2;visibility:hidden}.-amp-element>[overflow].amp-visible{visibility:visible}template{display:none!important}amp-pixel{position:absolute!important;top:0!important;width:1px!important;height:1px!important;overflow:hidden!important;visibility:hidden}amp-ad iframe{border:0!important;margin:0!important;padding:0!important}amp-instagram{padding:48px 8px!important}amp-analytics{position:absolute!important;top:0!important;width:1px!important;height:1px!important;overflow:hidden!important;visibility:hidden}[amp-access][amp-access-hide]{display:none}\n/*# sourceURL=/css/amp.css*/";i.cssText=n},{}],3:[function(t,e,i){function n(t){var e=0,i=function(t){function i(){babelHelpers.classCallCheck(this,i),t.apply(this,arguments)}return babelHelpers.inherits(i,t),i.prototype.renderOutsideViewport=function(){return this.getViewport().hasScrolled()?e>0?!1:!0:!1},i.prototype.isLayoutSupported=function(t){return a.isLayoutSizeDefined(t)},i.prototype.isReadyToBuild=function(){return!1},i.prototype.buildCallback=function(){this.iframe_=null,this.placeholder_=this.getPlaceholder(),this.fallback_=this.getFallback(),this.isInFixedContainer_=!1,this.iframeLayoutBox_=null,this.unlistenViewportChanges_=null,this.shouldSendIntersectionChanges_=!1},i.prototype.preconnectCallback=function(t){var e=this;c.prefetchBootstrap(this.getWin());var i=this.element.getAttribute("type"),n=h.adPrefetch[i],r=h.adPreconnect[i];"string"==typeof n?this.preconnect.prefetch(n):n&&n.forEach(function(t){e.preconnect.prefetch(t)}),"string"==typeof r?this.preconnect.url(r,t):r&&r.forEach(function(i){e.preconnect.url(i,t)});var o=this.element.getAttribute("src");o&&this.preconnect.url(o)},i.prototype.onLayoutMeasure=function(){this.isInFixedContainer_=this.isPositionFixed(),this.measureIframeLayoutBox_(),this.sendAdIntersection_()},i.prototype.measureIframeLayoutBox_=function(){this.iframe_&&(this.iframeLayoutBox_=this.getViewport().getLayoutRect(this.iframe_))},i.prototype.isPositionFixed=function(){var t=this.element,e=t.ownerDocument.body;do{if(d[t.tagName])return!1;if("fixed"==this.getWin().getComputedStyle(t).position)return!0;t=t.parentNode}while(t.getAttribute&&t!=e);return!1},i.prototype.layoutCallback=function(){var t=this;return e++,p.timer.delay(function(){e--},1e3),o.assert(!this.isInFixedContainer_,"<amp-ad> is not allowed to be placed in elements with position:fixed: %s",this.element),this.iframe_||(this.iframe_=c.getIframe(this.element.ownerDocument.defaultView,this.element),this.applyFillContent(this.iframe_),this.element.appendChild(this.iframe_),c.listenOnce(this.iframe_,"no-content",function(){t.noContentHandler_()}),c.listenOnce(this.iframe_,"entity-id",function(e){t.element.setAttribute("creative-id",e.id)}),c.listen(this.iframe_,"send-intersections",function(){t.startSendingIntersectionChanges_()})),l.loadPromise(this.iframe_)},i.prototype.viewportCallback=function(t){var e=this;this.sendAdIntersection_(),t?!function(){var t=e.sendAdIntersection_.bind(e),i=e.getViewport().onScroll(t),n=e.getViewport().onChanged(t);e.unlistenViewportChanges_=function(){i(),n()}}():this.unlistenViewportChanges_&&(this.unlistenViewportChanges_(),this.unlistenViewportChanges_=null)},i.prototype.startSendingIntersectionChanges_=function(){var t=this;this.shouldSendIntersectionChanges_=!0,this.getVsync().measure(function(){t.iframeLayoutBox_||t.measureIframeLayoutBox_(),t.sendAdIntersection_()})},i.prototype.sendAdIntersection_=function(){if(this.shouldSendIntersectionChanges_&&this.iframeLayoutBox_){var t=this.getViewport().getRect(),e=s.getIntersectionChangeEntry(p.timer.now(),t,this.iframeLayoutBox_);c.postMessage(this.iframe_,"intersection",{changes:[e]})}},i.prototype.noContentHandler_=function(){var t=this;this.fallback_||this.attemptChangeHeight(0,function(){t.element.style.display="none"}),this.deferMutate(function(){t.fallback_&&t.toggleFallback(!0),t.element.removeChild(t.iframe_)})},i}(r.BaseElement);u.registerElement(t,"amp-ad",i)}i.__esModule=!0,i.installAd=n;var r=t("../src/base-element"),o=t("../src/asserts"),s=t("../src/intersection-observer"),a=t("../src/layout"),l=t("../src/event-helper"),u=t("../src/custom-element"),c=t("../src/3p-frame"),h=t("../ads/_prefetch"),p=t("../src/timer"),d={"AMP-LIGHTBOX":!0}},{"../ads/_prefetch":1,"../src/3p-frame":51,"../src/asserts":55,"../src/base-element":56,"../src/custom-element":60,"../src/event-helper":67,"../src/intersection-observer":73,"../src/layout":75,"../src/timer":101}],4:[function(t,e,i){function n(t){var e=function(t){function e(){babelHelpers.classCallCheck(this,e),t.apply(this,arguments)}return babelHelpers.inherits(e,t),e.prototype.isLayoutSupported=function(t){return o.isLayoutSizeDefined(t)},e.prototype.buildCallback=function(){this.img_=new Image,this.element.id&&this.img_.setAttribute("amp-img-id",this.element.id),this.propagateAttributes(["alt"],this.img_),this.applyFillContent(this.img_,!0),this.img_.width=o.getLengthNumeral(this.element.getAttribute("width")),this.img_.height=o.getLengthNumeral(this.element.getAttribute("height")),this.element.appendChild(this.img_),this.srcset_=a.parseSrcset(this.element.getAttribute("srcset")||this.element.getAttribute("src"))},e.prototype.prerenderAllowed=function(){return!0},e.prototype.isRelayoutNeeded=function(){return!0},e.prototype.layoutCallback=function(){return this.updateImageSrc_()},e.prototype.updateImageSrc_=function(){if(this.getLayoutWidth()<=0)return Promise.resolve();var t=this.srcset_.select(this.getLayoutWidth(),this.getDpr()).url;return t==this.img_.getAttribute("src")?Promise.resolve():(this.img_.setAttribute("src",t),s.loadPromise(this.img_))},e}(r.BaseElement);l.registerElement(t,"amp-img",e)}i.__esModule=!0,i.installImg=n;var r=t("../src/base-element"),o=t("../src/layout"),s=t("../src/event-helper"),a=t("../src/srcset"),l=t("../src/custom-element")},{"../src/base-element":56,"../src/custom-element":60,"../src/event-helper":67,"../src/layout":75,"../src/srcset":96}],5:[function(t,e,i){function n(t){var e=function(t){function e(){babelHelpers.classCallCheck(this,e),t.apply(this,arguments)}return babelHelpers.inherits(e,t),e.prototype.isLayoutSupported=function(t){return t==o.Layout.FIXED},e.prototype.buildCallback=function(){this.element.style.width="",this.element.style.height="",this.element.setAttribute("aria-hidden","true")},e.prototype.layoutCallback=function(){var t=this,e=this.element.getAttribute("src");return s.urlReplacementsFor(this.getWin()).expand(this.assertSource(e)).then(function(e){var i=new Image;i.src=e,i.width=1,i.height=1,t.element.style.width=0,t.element.appendChild(i)})},e.prototype.assertSource=function(t){return a.assert(/^(https\:\/\/|\/\/)/i.test(t),'The <amp-pixel> src attribute must start with "https://" or "//". Invalid value: '+t),t},e}(r.BaseElement);l.registerElement(t,"amp-pixel",e)}i.__esModule=!0,i.installPixel=n;var r=t("../src/base-element"),o=t("../src/layout"),s=t("../src/url-replacements"),a=t("../src/asserts"),l=t("../src/custom-element")},{"../src/asserts":55,"../src/base-element":56,"../src/custom-element":60,"../src/layout":75,"../src/url-replacements":102}],6:[function(t,e,i){function n(t){var e=function(t){function e(){babelHelpers.classCallCheck(this,e),t.apply(this,arguments)}return babelHelpers.inherits(e,t),e.prototype.isLayoutSupported=function(t){return s.isLayoutSizeDefined(t)},e.prototype.layoutCallback=function(){var t=this.element.getAttribute("width"),e=this.element.getAttribute("height"),i=document.createElement("video");return i.play?(this.element.getAttribute("src")&&o.assertHttpsUrl(this.element.getAttribute("src"),this.element),this.propagateAttributes(["src","controls","autoplay","muted","loop","poster"],i),i.width=s.getLengthNumeral(t),i.height=s.getLengthNumeral(e),this.applyFillContent(i,!0),this.getRealChildNodes().forEach(function(t){t.getAttribute&&t.getAttribute("src")&&o.assertHttpsUrl(t.getAttribute("src"),t),i.appendChild(t)}),this.element.appendChild(i),this.video_=i,u.setStyles(i,{visibility:"hidden"}),a.loadPromise(i).then(function(){u.setStyles(i,{visibility:""})})):(this.toggleFallback(!0),Promise.resolve())},e.prototype.documentInactiveCallback=function(){return this.video_&&this.video_.pause(),!1},e}(r.BaseElement);l.registerElement(t,"amp-video",e)}i.__esModule=!0,i.installVideo=n;var r=t("../src/base-element"),o=t("../src/url"),s=t("../src/layout"),a=t("../src/event-helper"),l=t("../src/custom-element"),u=t("../src/style")},{"../src/base-element":56,"../src/custom-element":60,"../src/event-helper":67,"../src/layout":75,"../src/style":98,"../src/url":103}],7:[function(t,e,i){function n(){c=!1,a.length?u=a.concat(u):h=-1,u.length&&r()}function r(){if(!c){var t=setTimeout(n);c=!0;for(var e=u.length;e;){for(a=u,u=[];++h<e;)a&&a[h].run();h=-1,e=u.length}a=null,c=!1,clearTimeout(t)}}function o(t,e){this.fun=t,this.array=e}function s(){}var a,l=e.exports={},u=[],c=!1,h=-1;l.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var i=1;i<arguments.length;i++)e[i-1]=arguments[i];u.push(new o(t,e)),1!==u.length||c||setTimeout(r,0)},o.prototype.run=function(){this.fun.apply(null,this.array)},l.title="browser",l.browser=!0,l.env={},l.argv=[],l.version="",l.versions={},l.on=s,l.addListener=s,l.once=s,l.off=s,l.removeListener=s,l.removeAllListeners=s,l.emit=s,l.binding=function(t){throw new Error("process.binding is not supported")},l.cwd=function(){return"/"},l.chdir=function(t){throw new Error("process.chdir is not supported")},l.umask=function(){return 0}},{}],8:[function(t,e,i){e.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},{}],9:[function(t,e,i){var n=t("./$.is-object");e.exports=function(t){if(!n(t))throw TypeError(t+" is not an object!");return t}},{"./$.is-object":24}],10:[function(t,e,i){var n=t("./$.cof"),r=t("./$.wks")("toStringTag"),o="Arguments"==n(function(){return arguments}());e.exports=function(t){var e,i,s;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(i=(e=Object(t))[r])?i:o?n(e):"Object"==(s=n(e))&&"function"==typeof e.callee?"Arguments":s}},{"./$.cof":11,"./$.wks":46}],11:[function(t,e,i){var n={}.toString;e.exports=function(t){return n.call(t).slice(8,-1)}},{}],12:[function(t,e,i){var n=e.exports={version:"1.2.1"};"number"==typeof __e&&(__e=n)},{}],13:[function(t,e,i){var n=t("./$.a-function");e.exports=function(t,e,i){if(n(t),void 0===e)return t;switch(i){case 1:return function(i){return t.call(e,i)};case 2:return function(i,n){return t.call(e,i,n)};case 3:return function(i,n,r){return t.call(e,i,n,r)}}return function(){return t.apply(e,arguments)}}},{"./$.a-function":8}],14:[function(t,e,i){var n=t("./$.global"),r=t("./$.core"),o=t("./$.hide"),s=t("./$.redef"),a="prototype",l=function(t,e){return function(){return t.apply(e,arguments)}},u=function(t,e,i){var c,h,p,d,f=t&u.G,m=t&u.P,_=f?n:t&u.S?n[e]||(n[e]={}):(n[e]||{})[a],v=f?r:r[e]||(r[e]={});f&&(i=e);for(c in i)h=!(t&u.F)&&_&&c in _,p=(h?_:i)[c],d=t&u.B&&h?l(p,n):m&&"function"==typeof p?l(Function.call,p):p,_&&!h&&s(_,c,p),v[c]!=p&&o(v,c,d),m&&((v[a]||(v[a]={}))[c]=p)};n.core=r,u.F=1,u.G=2,u.S=4,u.P=8,u.B=16,u.W=32,e.exports=u},{"./$.core":12,"./$.global":18,"./$.hide":20,"./$.redef":33}],15:[function(t,e,i){var n=t("./$.is-object"),r=t("./$.global").document,o=n(r)&&n(r.createElement);e.exports=function(t){return o?r.createElement(t):{}}},{"./$.global":18,"./$.is-object":24}],16:[function(t,e,i){e.exports=function(t){try{return!!t()}catch(e){return!0}}},{}],17:[function(t,e,i){var n=t("./$.ctx"),r=t("./$.iter-call"),o=t("./$.is-array-iter"),s=t("./$.an-object"),a=t("./$.to-length"),l=t("./core.get-iterator-method");e.exports=function(t,e,i,u){var c,h,p,d=l(t),f=n(i,u,e?2:1),m=0;if("function"!=typeof d)throw TypeError(t+" is not iterable!");if(o(d))for(c=a(t.length);c>m;m++)e?f(s(h=t[m])[0],h[1]):f(t[m]);else for(p=d.call(t);!(h=p.next()).done;)r(p,f,h.value,e)}},{"./$.an-object":9,"./$.ctx":13,"./$.is-array-iter":23,"./$.iter-call":25,"./$.to-length":44,"./core.get-iterator-method":47}],18:[function(t,e,i){var n="undefined",r=e.exports=typeof window!=n&&window.Math==Math?window:typeof self!=n&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=r)},{}],19:[function(t,e,i){var n={}.hasOwnProperty;e.exports=function(t,e){return n.call(t,e)}},{}],20:[function(t,e,i){var n=t("./$"),r=t("./$.property-desc");e.exports=t("./$.support-desc")?function(t,e,i){return n.setDesc(t,e,r(1,i))}:function(t,e,i){return t[e]=i,t}},{"./$":28,"./$.property-desc":32,"./$.support-desc":40}],21:[function(t,e,i){e.exports=t("./$.global").document&&document.documentElement},{"./$.global":18}],22:[function(t,e,i){e.exports=function(t,e,i){var n=void 0===i;switch(e.length){case 0:return n?t():t.call(i);case 1:return n?t(e[0]):t.call(i,e[0]);case 2:return n?t(e[0],e[1]):t.call(i,e[0],e[1]);case 3:return n?t(e[0],e[1],e[2]):t.call(i,e[0],e[1],e[2]);case 4:return n?t(e[0],e[1],e[2],e[3]):t.call(i,e[0],e[1],e[2],e[3])}return t.apply(i,e)}},{}],23:[function(t,e,i){var n=t("./$.iterators"),r=t("./$.wks")("iterator");e.exports=function(t){return(n.Array||Array.prototype[r])===t}},{"./$.iterators":27,"./$.wks":46}],24:[function(t,e,i){e.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},{}],25:[function(t,e,i){var n=t("./$.an-object");e.exports=function(t,e,i,r){try{return r?e(n(i)[0],i[1]):e(i)}catch(o){var s=t["return"];throw void 0!==s&&n(s.call(t)),o}}},{"./$.an-object":9}],26:[function(t,e,i){var n=t("./$.wks")("iterator"),r=!1;try{var o=[7][n]();o["return"]=function(){r=!0},Array.from(o,function(){throw 2})}catch(s){}e.exports=function(t){if(!r)return!1;var e=!1;try{var i=[7],o=i[n]();o.next=function(){e=!0},i[n]=function(){return o},t(i)}catch(s){}return e}},{"./$.wks":46}],27:[function(t,e,i){e.exports={}},{}],28:[function(t,e,i){var n=Object;e.exports={create:n.create,getProto:n.getPrototypeOf,isEnum:{}.propertyIsEnumerable,getDesc:n.getOwnPropertyDescriptor,setDesc:n.defineProperty,setDescs:n.defineProperties,getKeys:n.keys,getNames:n.getOwnPropertyNames,getSymbols:n.getOwnPropertySymbols,each:[].forEach}},{}],29:[function(t,e,i){e.exports=!1},{}],30:[function(t,e,i){var n,r,o,s=t("./$.global"),a=t("./$.task").set,l=s.MutationObserver||s.WebKitMutationObserver,u=s.process,c="process"==t("./$.cof")(u),h=function(){var t,e;for(c&&(t=u.domain)&&(u.domain=null,t.exit());n;)e=n.domain,e&&e.enter(),n.fn.call(),e&&e.exit(),n=n.next;r=void 0,t&&t.enter()};if(c)o=function(){u.nextTick(h)};else if(l){var p=1,d=document.createTextNode("");new l(h).observe(d,{characterData:!0}),o=function(){d.data=p=-p}}else o=function(){a.call(s,h)};e.exports=function(t){var e={fn:t,next:void 0,domain:c&&u.domain};r&&(r.next=e),n||(n=e,o()),r=e}},{"./$.cof":11,"./$.global":18,"./$.task":42}],31:[function(t,e,i){var n=t("./$.redef");e.exports=function(t,e){for(var i in e)n(t,i,e[i]);return t}},{"./$.redef":33}],32:[function(t,e,i){e.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},{}],33:[function(t,e,i){var n=t("./$.global"),r=t("./$.hide"),o=t("./$.uid")("src"),s="toString",a=Function[s],l=(""+a).split(s);t("./$.core").inspectSource=function(t){return a.call(t)},(e.exports=function(t,e,i,s){"function"==typeof i&&(r(i,o,t[e]?""+t[e]:l.join(String(e))),"name"in i||(i.name=e)),t===n?t[e]=i:(s||delete t[e],r(t,e,i))})(Function.prototype,s,function(){return"function"==typeof this&&this[o]||a.call(this)})},{"./$.core":12,"./$.global":18,"./$.hide":20,"./$.uid":45}],34:[function(t,e,i){e.exports=Object.is||function(t,e){return t===e?0!==t||1/t===1/e:t!=t&&e!=e}},{}],35:[function(t,e,i){var n=t("./$").getDesc,r=t("./$.is-object"),o=t("./$.an-object"),s=function(t,e){if(o(t),!r(e)&&null!==e)throw TypeError(e+": can't set as prototype!")};e.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(e,i,r){try{r=t("./$.ctx")(Function.call,n(Object.prototype,"__proto__").set,2),r(e,[]),i=!(e instanceof Array)}catch(o){i=!0}return function(t,e){return s(t,e),i?t.__proto__=e:r(t,e),t}}({},!1):void 0),check:s}},{"./$":28,"./$.an-object":9,"./$.ctx":13,"./$.is-object":24}],36:[function(t,e,i){var n=t("./$.global"),r="__core-js_shared__",o=n[r]||(n[r]={});e.exports=function(t){return o[t]||(o[t]={})}},{"./$.global":18}],37:[function(t,e,i){e.exports=Math.sign||function(t){return 0==(t=+t)||t!=t?t:0>t?-1:1}},{}],38:[function(t,e,i){"use strict";var n=t("./$"),r=t("./$.wks")("species");e.exports=function(e){!t("./$.support-desc")||r in e||n.setDesc(e,r,{configurable:!0,get:function(){return this}})}},{"./$":28,"./$.support-desc":40,"./$.wks":46}],39:[function(t,e,i){e.exports=function(t,e,i){if(!(t instanceof e))throw TypeError(i+": use the 'new' operator!");return t}},{}],40:[function(t,e,i){e.exports=!t("./$.fails")(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},{"./$.fails":16}],41:[function(t,e,i){var n=t("./$.has"),r=t("./$.hide"),o=t("./$.wks")("toStringTag");e.exports=function(t,e,i){t&&!n(t=i?t:t.prototype,o)&&r(t,o,e)}},{"./$.has":19,"./$.hide":20,"./$.wks":46}],42:[function(t,e,i){"use strict";var n,r,o,s=t("./$.ctx"),a=t("./$.invoke"),l=t("./$.html"),u=t("./$.dom-create"),c=t("./$.global"),h=c.process,p=c.setImmediate,d=c.clearImmediate,f=c.MessageChannel,m=0,_={},v="onreadystatechange",g=function(){var t=+this;if(_.hasOwnProperty(t)){var e=_[t];delete _[t],e()}},y=function(t){g.call(t.data)};p&&d||(p=function(t){for(var e=[],i=1;arguments.length>i;)e.push(arguments[i++]);return _[++m]=function(){a("function"==typeof t?t:Function(t),e)},n(m),m},d=function(t){delete _[t]},"process"==t("./$.cof")(h)?n=function(t){h.nextTick(s(g,t,1))}:f?(r=new f,o=r.port2,r.port1.onmessage=y,n=s(o.postMessage,o,1)):c.addEventListener&&"function"==typeof postMessage&&!c.importScripts?(n=function(t){c.postMessage(t+"","*")},c.addEventListener("message",y,!1)):n=v in u("script")?function(t){l.appendChild(u("script"))[v]=function(){l.removeChild(this),g.call(t)}}:function(t){setTimeout(s(g,t,1),0)}),e.exports={set:p,clear:d}},{"./$.cof":11,"./$.ctx":13,"./$.dom-create":15,"./$.global":18,"./$.html":21,"./$.invoke":22}],43:[function(t,e,i){var n=Math.ceil,r=Math.floor;e.exports=function(t){return isNaN(t=+t)?0:(t>0?r:n)(t)}},{}],44:[function(t,e,i){var n=t("./$.to-integer"),r=Math.min;e.exports=function(t){return t>0?r(n(t),9007199254740991):0}},{"./$.to-integer":43}],45:[function(t,e,i){var n=0,r=Math.random();e.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++n+r).toString(36))}},{}],46:[function(t,e,i){var n=t("./$.shared")("wks"),r=t("./$.global").Symbol;e.exports=function(e){return n[e]||(n[e]=r&&r[e]||(r||t("./$.uid"))("Symbol."+e))}},{"./$.global":18,"./$.shared":36,"./$.uid":45}],47:[function(t,e,i){var n=t("./$.classof"),r=t("./$.wks")("iterator"),o=t("./$.iterators");e.exports=t("./$.core").getIteratorMethod=function(t){return void 0!=t?t[r]||t["@@iterator"]||o[n(t)]:void 0}},{"./$.classof":10,"./$.core":12,"./$.iterators":27,"./$.wks":46}],48:[function(t,e,i){var n=t("./$.def");n(n.S,"Math",{sign:t("./$.sign")})},{"./$.def":14,"./$.sign":37}],49:[function(t,e,i){"use strict";var n,r=t("./$"),o=t("./$.library"),s=t("./$.global"),a=t("./$.ctx"),l=t("./$.classof"),u=t("./$.def"),c=t("./$.is-object"),h=t("./$.an-object"),p=t("./$.a-function"),d=t("./$.strict-new"),f=t("./$.for-of"),m=t("./$.set-proto").set,_=t("./$.same"),v=t("./$.species"),g=t("./$.wks")("species"),y=t("./$.uid")("record"),b=t("./$.microtask"),w="Promise",E=s.process,S="process"==l(E),C=s[w],T=function(t){var e=new C(function(){});return t&&(e.constructor=Object),C.resolve(e)===e},k=function(){function e(t){var i=new C(t);return m(i,e.prototype),i}var i=!1;try{if(i=C&&C.resolve&&T(),m(e,C),e.prototype=r.create(C.prototype,{constructor:{value:e}}),e.resolve(5).then(function(){})instanceof e||(i=!1),i&&t("./$.support-desc")){var n=!1;C.resolve(r.setDesc({},"then",{get:function(){n=!0}})),i=n}}catch(o){i=!1}return i}(),O=function(t){return c(t)&&(k?"Promise"==l(t):y in t)},L=function(t,e){return o&&t===C&&e===n?!0:_(t,e)},A=function(t){var e=h(t)[g];return void 0!=e?e:t},x=function(t){var e;return c(t)&&"function"==typeof(e=t.then)?e:!1},M=function(t,e){if(!t.n){t.n=!0;var i=t.c;b(function(){for(var n=t.v,r=1==t.s,o=0,a=function(e){var i,o,s=r?e.ok:e.fail;try{s?(r||(t.h=!0),i=s===!0?n:s(n),i===e.P?e.rej(TypeError("Promise-chain cycle")):(o=x(i))?o.call(i,e.res,e.rej):e.res(i)):e.rej(n)}catch(a){e.rej(a)}};i.length>o;)a(i[o++]);i.length=0,t.n=!1,e&&setTimeout(function(){var e,i,r=t.p;P(r)&&(S?E.emit("unhandledRejection",n,r):(e=s.onunhandledrejection)?e({promise:r,reason:n}):(i=s.console)&&i.error&&i.error("Unhandled promise rejection",n)),t.a=void 0},1)})}},P=function(t){var e,i=t[y],n=i.a||i.c,r=0;if(i.h)return!1;for(;n.length>r;)if(e=n[r++],e.fail||!P(e.P))return!1;return!0},I=function(t){var e=this;e.d||(e.d=!0,e=e.r||e,e.v=t,e.s=2,e.a=e.c.slice(),M(e,!0))},R=function(t){var e,i=this;if(!i.d){i.d=!0,i=i.r||i;try{(e=x(t))?b(function(){var n={r:i,d:!1};try{e.call(t,a(R,n,1),a(I,n,1))}catch(r){I.call(n,r)}}):(i.v=t,i.s=1,M(i,!1))}catch(n){I.call({r:i,d:!1},n)}}};k||(C=function(t){p(t);var e={p:d(this,C,w),c:[],a:void 0,s:0,d:!1,v:void 0,h:!1,n:!1};this[y]=e;try{t(a(R,e,1),a(I,e,1))}catch(i){I.call(e,i)}},t("./$.mix")(C.prototype,{then:function(t,e){var i=h(h(this).constructor)[g],n={ok:"function"==typeof t?t:!0,fail:"function"==typeof e?e:!1},r=n.P=new(void 0!=i?i:C)(function(t,e){n.res=t,n.rej=e});p(n.res),p(n.rej);var o=this[y];return o.c.push(n),o.a&&o.a.push(n),o.s&&M(o,!1),r},"catch":function(t){return this.then(void 0,t)}})),u(u.G+u.W+u.F*!k,{Promise:C}),t("./$.tag")(C,w),v(C),v(n=t("./$.core")[w]),u(u.S+u.F*!k,w,{reject:function(t){return new this(function(e,i){i(t)})}}),u(u.S+u.F*(!k||T(!0)),w,{resolve:function(t){return O(t)&&L(t.constructor,this)?t:new this(function(e){e(t)})}}),u(u.S+u.F*!(k&&t("./$.iter-detect")(function(t){C.all(t)["catch"](function(){})})),w,{all:function(t){var e=A(this),i=[];return new e(function(n,o){f(t,!1,i.push,i);var s=i.length,a=Array(s);s?r.each.call(i,function(t,i){e.resolve(t).then(function(t){a[i]=t,--s||n(a)},o)}):n(a)})},race:function(t){var e=A(this);return new e(function(i,n){f(t,!1,function(t){e.resolve(t).then(i,n)})})}})},{"./$":28,"./$.a-function":8,"./$.an-object":9,"./$.classof":10,"./$.core":12,"./$.ctx":13,"./$.def":14,"./$.for-of":17,"./$.global":18,"./$.is-object":24,"./$.iter-detect":26,"./$.library":29,"./$.microtask":30,"./$.mix":31,"./$.same":34,"./$.set-proto":35,"./$.species":38,"./$.strict-new":39,"./$.support-desc":40,"./$.tag":41,"./$.uid":45,"./$.wks":46}],50:[function(t,e,i){/*!
Copyright (C) 2014-2015 by WebReflection
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
!function(t,e,i,n){"use strict";function r(t,e){for(var i=0,n=t.length;n>i;i++)m(t[i],e)}function o(t){for(var e,i=0,n=t.length;n>i;i++)e=t[i],E(e,F[a(e)])}function s(t){return function(e){it(e)&&(m(e,t),r(e.querySelectorAll(N),t))}}function a(t){var e=t.getAttribute("is"),i=t.nodeName.toUpperCase(),n=U.call(V,e?R+e.toUpperCase():I+i);return e&&n>-1&&!l(i,e)?-1:n}function l(t,e){return-1<N.indexOf(t+'[is="'+e+'"]')}function u(t){var e=t.currentTarget,i=t.attrChange,n=t.attrName,r=t.target;!ft||r&&r!==e||!e.attributeChangedCallback||"style"===n||e.attributeChangedCallback(n,i===t[O]?null:t.prevValue,i===t[A]?null:t.newValue)}function c(t){var e=s(t);return function(t){_.push(e,t.target)}}function h(t){dt&&(dt=!1,t.currentTarget.removeEventListener(M,h)),r((t.target||e).querySelectorAll(N),t.detail===T?T:C),et&&f()}function p(t,e){var i=this;ot.call(i,t,e),v.call(i,{target:i})}function d(t,e){Z(t,e),b?b.observe(t,lt):(pt&&(t.setAttribute=p,t[S]=y(t),t.addEventListener(P,v)),t.addEventListener(x,u)),t.createdCallback&&ft&&(t.created=!0,t.createdCallback(),t.created=!1)}function f(){for(var t,e=0,i=nt.length;i>e;e++)t=nt[e],$.contains(t)||(nt.splice(e,1),m(t,T))}function m(t,e){var i,n=a(t);n>-1&&(w(t,F[n]),n=0,e!==C||t[C]?e!==T||t[T]||(t[C]=!1,t[T]=!0,n=1):(t[T]=!1,t[C]=!0,n=1,et&&U.call(nt,t)<0&&nt.push(t)),n&&(i=t[e+"Callback"])&&i.call(t))}if(!(n in e)){var _,v,g,y,b,w,E,S="__"+n+(1e5*Math.random()>>0),C="attached",T="detached",k="extends",O="ADDITION",L="MODIFICATION",A="REMOVAL",x="DOMAttrModified",M="DOMContentLoaded",P="DOMSubtreeModified",I="<",R="=",H=/^[A-Z][A-Z0-9]*(?:-[A-Z0-9]+)+$/,D=["ANNOTATION-XML","COLOR-PROFILE","FONT-FACE","FONT-FACE-SRC","FONT-FACE-URI","FONT-FACE-FORMAT","FONT-FACE-NAME","MISSING-GLYPH"],V=[],F=[],N="",$=e.documentElement,U=V.indexOf||function(t){for(var e=this.length;e--&&this[e]!==t;);return e},B=i.prototype,z=B.hasOwnProperty,j=B.isPrototypeOf,q=i.defineProperty,W=i.getOwnPropertyDescriptor,Y=i.getOwnPropertyNames,Q=i.getPrototypeOf,G=i.setPrototypeOf,X=!!i.__proto__,K=i.create||function mt(t){return t?(mt.prototype=t,new mt):this},Z=G||(X?function(t,e){return t.__proto__=e,t}:Y&&W?function(){function t(t,e){for(var i,n=Y(e),r=0,o=n.length;o>r;r++)i=n[r],z.call(t,i)||q(t,i,W(e,i))}return function(e,i){do t(e,i);while((i=Q(i))&&!j.call(i,e));return e}}():function(t,e){for(var i in e)t[i]=e[i];return t}),J=t.MutationObserver||t.WebKitMutationObserver,tt=(t.HTMLElement||t.Element||t.Node).prototype,et=!j.call(tt,$),it=et?function(t){return 1===t.nodeType}:function(t){return j.call(tt,t)},nt=et&&[],rt=tt.cloneNode,ot=tt.setAttribute,st=tt.removeAttribute,at=e.createElement,lt=J&&{attributes:!0,characterData:!0,attributeOldValue:!0},ut=J||function(t){pt=!1,$.removeEventListener(x,ut)},ct=t.requestAnimationFrame||t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||t.msRequestAnimationFrame||function(t){setTimeout(t,10)},ht=!1,pt=!0,dt=!0,ft=!0;G||X?(w=function(t,e){j.call(e,t)||d(t,e)},E=d):(w=function(t,e){t[S]||(t[S]=i(!0),d(t,e))},E=w),et?(pt=!1,function(){var t=W(tt,"addEventListener"),e=t.value,i=function(t){var e=new CustomEvent(x,{bubbles:!0});e.attrName=t,e.prevValue=this.getAttribute(t),e.newValue=null,e[A]=e.attrChange=2,st.call(this,t),this.dispatchEvent(e)},n=function(t,e){var i=this.hasAttribute(t),n=i&&this.getAttribute(t),r=new CustomEvent(x,{bubbles:!0});ot.call(this,t,e),r.attrName=t,r.prevValue=i?n:null,r.newValue=e,i?r[L]=r.attrChange=1:r[O]=r.attrChange=0,this.dispatchEvent(r)},r=function(t){var e,i=t.currentTarget,n=i[S],r=t.propertyName;n.hasOwnProperty(r)&&(n=n[r],e=new CustomEvent(x,{bubbles:!0}),e.attrName=n.name,e.prevValue=n.value||null,e.newValue=n.value=i[r]||null,null==e.prevValue?e[O]=e.attrChange=0:e[L]=e.attrChange=1,i.dispatchEvent(e))};t.value=function(t,o,s){t===x&&this.attributeChangedCallback&&this.setAttribute!==n&&(this[S]={className:{name:"class",value:this.className}},this.setAttribute=n,this.removeAttribute=i,e.call(this,"propertychange",r)),e.call(this,t,o,s)},q(tt,"addEventListener",t)}()):J||($.addEventListener(x,ut),$.setAttribute(S,1),$.removeAttribute(S),pt&&(v=function(t){var e,i,n,r=this;if(r===t.target){e=r[S],r[S]=i=y(r);for(n in i){if(!(n in e))return g(0,r,n,e[n],i[n],O);if(i[n]!==e[n])return g(1,r,n,e[n],i[n],L)}for(n in e)if(!(n in i))return g(2,r,n,e[n],i[n],A)}},g=function(t,e,i,n,r,o){var s={attrChange:t,currentTarget:e,attrName:i,prevValue:n,newValue:r};s[o]=t,u(s)},y=function(t){for(var e,i,n={},r=t.attributes,o=0,s=r.length;s>o;o++)e=r[o],i=e.name,"setAttribute"!==i&&(n[i]=e.value);return n})),e[n]=function(t,i){if(n=t.toUpperCase(),ht||(ht=!0,J?(b=function(t,e){function i(t,e){for(var i=0,n=t.length;n>i;e(t[i++]));}return new J(function(n){for(var r,o,s=0,a=n.length;a>s;s++)r=n[s],"childList"===r.type?(i(r.addedNodes,t),i(r.removedNodes,e)):(o=r.target,ft&&o.attributeChangedCallback&&"style"!==r.attributeName&&o.attributeChangedCallback(r.attributeName,r.oldValue,o.getAttribute(r.attributeName)))})}(s(C),s(T)),b.observe(e,{childList:!0,subtree:!0})):(_=[],ct(function v(){for(;_.length;)_.shift().call(null,_.shift());ct(v)}),e.addEventListener("DOMNodeInserted",c(C)),e.addEventListener("DOMNodeRemoved",c(T))),e.addEventListener(M,h),e.addEventListener("readystatechange",h),e.createElement=function(t,i){var n=at.apply(e,arguments),r=""+t,o=U.call(V,(i?R:I)+(i||r).toUpperCase()),s=o>-1;return i&&(n.setAttribute("is",i=i.toLowerCase()),s&&(s=l(r.toUpperCase(),i))),ft=!e.createElement.innerHTMLHelper,s&&E(n,F[o]),n},tt.cloneNode=function(t){var e=rt.call(this,!!t),i=a(e);return i>-1&&E(e,F[i]),t&&o(e.querySelectorAll(N)),e}),-2<U.call(V,R+n)+U.call(V,I+n))throw new Error("A "+t+" type is already registered");if(!H.test(n)||-1<U.call(D,n))throw new Error("The type "+t+" is invalid");var n,u=function(){return d?e.createElement(f,n):e.createElement(f)},p=i||B,d=z.call(p,k),f=d?i[k].toUpperCase():n,m=V.push((d?R:I)+n)-1;return N=N.concat(N.length?",":"",d?f+'[is="'+t.toLowerCase()+'"]':f),u.prototype=F[m]=z.call(p,"prototype")?p.prototype:K(tt),r(e.querySelectorAll(N),C),u}}}(window,document,Object,"registerElement")},{}],51:[function(t,e,i){function n(t,e,i){var n=e.getAttribute("width"),r=e.getAttribute("height"),o=i||e.getAttribute("type");d.assert(o,"Attribute type required for <amp-ad>: %s",e);var s={};l(e,s),s.width=f.getLengthNumeral(n),s.height=f.getLengthNumeral(r);var a=e.getLayoutBox();s.initialWindowWidth=a.width,s.initialWindowHeight=a.height,s.type=o;var u=_.documentInfoFor(t),c=t.location.href;"about:srcdoc"==c&&(c=t.parent.location.href),s._context={referrer:t.document.referrer,canonicalUrl:u.canonicalUrl,pageViewId:u.pageViewId,location:{href:c},mode:v.getMode()};var h=e.getAttribute("src");return h&&(s.src=h),s}function r(t,e,i){var r=n(t,e,i),o=document.createElement("iframe");w[r.type]||(w[r.type]=0),o.name="frame_"+r.type+"_"+w[r.type]++;var s=c(t)+"#"+JSON.stringify(r);return o.src=s,o.ampLocation=b.parseUrl(s),o.width=r.width,o.height=r.height,o.style.border="none",o.setAttribute("scrolling","no"),o.onload=function(){this.readyState="complete"},o}function o(t,e,i){var n=t.ownerDocument.defaultView,r=t.ampLocation.origin,o=function(n){n.origin==r&&n.source==t.contentWindow&&n.data&&"amp-3p"==n.data.sentinel&&n.data.type==e&&i(n.data)};return n.addEventListener("message",o),function(){n.removeEventListener("message",o)}}function s(t,e,i){var n=o(t,e,function(t){return n(),i(t)});return n}function a(t,e,i){i.type=e,i.sentinel="amp-3p",t.contentWindow.postMessage(i,t.ampLocation.origin)}function l(t,e){for(var i=0;i<t.attributes.length;i++){var n=t.attributes[i];0==n.name.indexOf("data-")&&(e[y.dashToCamelCase(n.name.substr(5))]=n.value)}var r=t.getAttribute("json");if(r){var o=void 0;try{o=JSON.parse(r)}catch(s){d.assert(!1,"Error parsing JSON in json attribute in element %s",t)}for(var a in o)e[a]=o[a]}}function u(t){var e=c(t),i=g.preconnectFor(t);i.prefetch(e),i.prefetch("https://3p.ampproject.net/1452640483698-canary/f.js")}function c(t){return m.getService(window,"bootstrapBaseUrl",function(){return p(t)||h(t)})}function h(t){var e="https://3p.ampproject.net/1452640483698-canary/frame.html";return v.getMode().localDev&&(e="http://ads.localhost:"+t.location.port+"/dist.3p/current"+(v.getMode().minified?"-min/frame":"/frame.max")+".html"),e}function p(t){var e=t.document.querySelector('meta[name="amp-3p-iframe-src"]');if(!e)return null;var i=b.assertHttpsUrl(e.getAttribute("content"),e);return d.assert(-1==i.indexOf("?"),"3p iframe url must not include query string %s in element %s.",i,e),d.assert(b.parseUrl(i).origin!=b.parseUrl(t.location.href).origin,"3p iframe url must not be on the same origin as the current document %s in element %s.",i,e),i+"?1452640483698-canary"}i.__esModule=!0,i.getIframe=r,i.listen=o,i.listenOnce=s,i.postMessage=a,i.addDataAndJsonAttributes_=l,i.prefetchBootstrap=u,i.getBootstrapBaseUrl=c;var d=t("./asserts"),f=t("../src/layout"),m=t("./service"),_=t("./document-info"),v=t("./mode"),g=t("./preconnect"),y=t("./string"),b=t("./url"),w={}},{"../src/layout":75,"./asserts":55,"./document-info":62,"./mode":78,"./preconnect":84,"./service":88,"./string":97,"./url":103}],52:[function(t,e,i){t("../third_party/babel/custom-babel-helpers"),t("./amp")},{"../third_party/babel/custom-babel-helpers":109,"./amp":54}],53:[function(t,e,i){function n(t){a.installViewerService(t),l.installViewportService(t),o.installHistoryService(t),u.installVsyncService(t),r.installActionService(t),s.installResourcesService(t)}i.__esModule=!0,i.installCoreServices=n;var r=t("./service/action-impl"),o=t("./service/history-impl"),s=t("./service/resources-impl"),a=t("./service/viewer-impl"),l=t("./service/viewport-impl"),u=t("./service/vsync-impl")},{"./service/action-impl":89,"./service/history-impl":90,"./service/resources-impl":91,"./service/viewer-impl":92,"./service/viewport-impl":93,"./service/vsync-impl":94}],54:[function(t,e,i){t("./polyfills");var n=t("./pull-to-refresh"),r=t("./performance"),o=t("./template"),s=t("./amp-core-service"),a=t("../builtins/amp-ad"),l=t("./document-click"),u=t("../builtins/amp-img"),c=t("../builtins/amp-video"),h=t("../builtins/amp-pixel"),p=t("./styles"),d=t("./error"),f=t("./custom-element"),m=t("./runtime"),_=t("../build/css"),v=t("./validator-integration");try{!function(){d.installErrorReporting(window);var t=r.performanceFor(window);t.tick("is"),p.installStyles(document,_.cssText,function(){try{s.installCoreServices(window),o.templatesFor(window),u.installImg(window),a.installAd(window),h.installPixel(window),c.installVideo(window),m.adopt(window),f.stubElements(window),n.installPullToRefreshBlocker(window),l.installGlobalClickListener(window),v.maybeValidate(window)}finally{p.makeBodyVisible(document),t.tick("e_is"),t.flush()}},!0)}()}catch(g){throw p.makeBodyVisible(document),g}window.console&&(console.info||console.log).call(console,"Powered by AMP ⚡ HTML – Version 1452640483698-canary"),document.documentElement.setAttribute("amp-version","1452640483698-canary")},{"../build/css":2,"../builtins/amp-ad":3,"../builtins/amp-img":4,"../builtins/amp-pixel":5,"../builtins/amp-video":6,"./amp-core-service":53,"./custom-element":60,"./document-click":61,"./error":66,"./performance":81,"./polyfills":83,"./pull-to-refresh":85,"./runtime":87,"./styles":99,"./template":100,"./validator-integration":105}],55:[function(t,e,i){function n(t,e,i){var n=void 0;if(!t){e=e||"Assertion failed";var r=e.split("%s"),a=r.shift(),l=a,u=[];s(u,a);for(var c=2;c<arguments.length;c++){var h=arguments[c];h&&h.tagName&&(n=h);var p=r.shift();u.push(h),s(u,p.trim()),l+=o(h)+p}var d=new Error(l);throw d.fromAssert=!0,d.associatedElement=n,d.messageArray=u,d}return t}function r(t,e,i){for(var n in t)if(t[n]==e)return t[n];throw new Error("Unknown "+(i||"enum")+' value: "'+e+'"')}function o(t){return t instanceof Element?t.tagName.toLowerCase()+(t.id?"#"+t.id:""):t}function s(t,e){""!=e&&t.push(e)}i.__esModule=!0,i.assert=n,i.assertEnumValue=r},{}],56:[function(t,e,i){i.__esModule=!0;var n=t("./layout"),r=t("./preconnect"),o=t("./resources"),s=t("./viewer"),a=t("./viewport"),l=t("./vsync"),u=function(){function t(e){babelHelpers.classCallCheck(this,t),this.element=e,this.layout_=n.Layout.NODISPLAY,this.layoutWidth_=-1,this.inViewport_=!1,this.actionMap_=this.getWin().Object.create(null),this.preconnect=r.preconnectFor(this.getWin()),this.resources_=o.resourcesFor(this.getWin())}return t.prototype.getLayout=function(){return this.layout_},t.prototype.getWin=function(){return this.element.ownerDocument.defaultView},t.prototype.getVsync=function(){return l.vsyncFor(this.getWin())},t.prototype.getLayoutWidth=function(){return this.layoutWidth_},t.prototype.isLayoutSupported=function(t){return t==n.Layout.NODISPLAY},t.prototype.isInViewport=function(){return this.inViewport_},t.prototype.createdCallback=function(){},t.prototype.firstAttachedCallback=function(){},t.prototype.isReadyToBuild=function(){return!0},t.prototype.buildCallback=function(){},t.prototype.preconnectCallback=function(){},t.prototype.setAsOwner=function(t){this.resources_.setOwner(t,this.element)},t.prototype.prerenderAllowed=function(){return!1},t.prototype.renderOutsideViewport=function(){return!0},t.prototype.isRelayoutNeeded=function(){return!1},t.prototype.layoutCallback=function(){return Promise.resolve()},t.prototype.firstLayoutCompleted=function(){this.togglePlaceholder(!1)},t.prototype.viewportCallback=function(t){},t.prototype.documentInactiveCallback=function(){return!1},t.prototype.activate=function(t){},t.prototype.registerAction=function(t,e){this.actionMap_[t]=e},t.prototype.executeAction=function(t,e){if("activate"==t.method)this.activate(t);else{var i=this.actionMap_[t.method];if(!i)throw new Error("Method not found: "+t.method);i(t)}},t.prototype.getMaxDpr=function(){return this.resources_.getMaxDpr()},t.prototype.getDpr=function(){return this.resources_.getDpr()},t.prototype.propagateAttributes=function(t,e){for(var i=0;i<t.length;i++){var n=t[i];this.element.hasAttribute(n)&&e.setAttribute(n,this.element.getAttribute(n))}},t.prototype.getPlaceholder=function(){return this.element.getPlaceholder()},t.prototype.togglePlaceholder=function(t){this.element.togglePlaceholder(t)},t.prototype.getFallback=function(){return this.element.getFallback()},t.prototype.toggleFallback=function(t){this.element.toggleFallback(t)},t.prototype.getOverflowElement=function(){return this.element.getOverflowElement()},t.prototype.getRealChildNodes=function(){return this.element.getRealChildNodes()},t.prototype.getRealChildren=function(){return this.element.getRealChildren()},t.prototype.applyFillContent=function(t,e){t.classList.add("-amp-fill-content"),e&&t.classList.add("-amp-replaced-content")},t.prototype.getViewport=function(){return a.viewportFor(this.getWin())},t.prototype.scheduleLayout=function(t){this.resources_.scheduleLayout(this.element,t)},t.prototype.schedulePreload=function(t){this.resources_.schedulePreload(this.element,t)},t.prototype.updateInViewport=function(t,e){this.resources_.updateInViewport(this.element,t,e)},t.prototype.changeHeight=function(t,e){this.resources_.changeHeight(this.element,t,e)},t.prototype.attemptChangeHeight=function(t,e){this.resources_.attemptChangeHeight(this.element,t,e)},t.prototype.deferMutate=function(t){this.resources_.deferMutate(this.element,t)},t.prototype.requestFullOverlay=function(){s.viewerFor(this.getWin()).requestFullOverlay()},t.prototype.cancelFullOverlay=function(){s.viewerFor(this.getWin()).cancelFullOverlay()},t.prototype.onLayoutMeasure=function(){},t}();i.BaseElement=u},{"./layout":75,"./preconnect":84,"./resources":86,"./viewer":106,"./viewport":107,"./vsync":108}],57:[function(t,e,i){function n(t){return r.getElementService(t,"cid","amp-analytics")}i.__esModule=!0,i.cidFor=n;var r=t("./service")},{"./service":88}],58:[function(t,e,i){function n(t,e){var i=t.document.cookie;if(!i)return null;for(var n=i.split(";"),r=0;r<n.length;r++){var o=n[r].trim(),s=o.indexOf("=");if(-1!=s&&decodeURIComponent(o.substring(0,s).trim())==e)return decodeURIComponent(o.substring(s+1).trim())}return null}function r(t,e,i,n){t.document.cookie=encodeURIComponent(e)+"="+encodeURIComponent(i)+"; path=/; expires="+new Date(n).toUTCString()}i.__esModule=!0,i.getCookie=n,i.setCookie=r},{}],59:[function(t,e,i){t("core-js/modules/es6.math.sign"),t("core-js/modules/es6.promise"),e.exports=t("core-js/modules/$.core")},{"core-js/modules/$.core":12,"core-js/modules/es6.math.sign":48,"core-js/modules/es6.promise":49}],60:[function(t,e,i){function n(t,e,i){if(!C[e])return void l(t,e,i);h.assert(C[e]==c.ElementStub,"Expected "+e+" to be an ElementStub.");for(var n=0;n<c.stubbedElements.length;n++){var r=c.stubbedElements[n],o=r.element;if(o.tagName.toLowerCase()==e)try{o.upgrade(i)}catch(s){m.reportError(s,this)}}}function r(t){t.ampExtendedElements={};for(var e=t.document.querySelectorAll("[custom-element]"),i=0;i<e.length;i++){var n=e[i].getAttribute("custom-element");t.ampExtendedElements[n]=!0,C[n]||l(t,n,c.ElementStub)}}function o(t){var e=t.getAttribute("layout"),i=t.getAttribute("width"),n=t.getAttribute("height"),r=t.getAttribute("sizes"),o=e?u.parseLayout(e):null;h.assert(void 0!==o,"Unknown layout: %s",e);var s=i&&"auto"!=i?u.parseLength(i):i;h.assert(void 0!==s,"Invalid width value: %s",i);var a=n?u.parseLength(n):null;h.assert(void 0!==a,"Invalid height value: %s",n);var l=void 0,c=void 0,p=void 0;if(o&&o!=u.Layout.FIXED&&o!=u.Layout.FIXED_HEIGHT||s&&a||!u.hasNaturalDimensions(t.tagName))l=s,c=a;else{var d=u.getNaturalDimensions(t.tagName);l=s||o==u.Layout.FIXED_HEIGHT?s:d.width,c=a||d.height}if(p=o?o:l||c?!c||l&&"auto"!=l?c&&l&&r?u.Layout.RESPONSIVE:u.Layout.FIXED:u.Layout.FIXED_HEIGHT:u.Layout.CONTAINER,(p==u.Layout.FIXED||p==u.Layout.FIXED_HEIGHT||p==u.Layout.RESPONSIVE)&&h.assert(c,"Expected height to be available: %s",n),p==u.Layout.FIXED_HEIGHT&&h.assert(!l||"auto"==l,'Expected width to be either absent or equal "auto" for fixed-height layout: %s',i),(p==u.Layout.FIXED||p==u.Layout.RESPONSIVE)&&h.assert(l&&"auto"!=l,'Expected width to be available and not equal to "auto": %s',i),p==u.Layout.RESPONSIVE&&h.assert(u.getLengthUnits(l)==u.getLengthUnits(c),"Length units should be the same for width and height: %s, %s",i,n),t.classList.add(u.getLayoutClass(p)),u.isLayoutSizeDefined(p)&&t.classList.add("-amp-layout-size-defined"),p==u.Layout.NODISPLAY)t.style.display="none";else if(p==u.Layout.FIXED)t.style.width=l,t.style.height=c;else if(p==u.Layout.FIXED_HEIGHT)t.style.height=c;else if(p==u.Layout.RESPONSIVE){var f=t.ownerDocument.createElement("i-amp-sizer");f.style.display="block",f.style.paddingTop=u.getLengthNumeral(c)/u.getLengthNumeral(l)*100+"%",t.insertBefore(f,t.firstChild),t.sizerElement_=f}else p==u.Layout.FILL||p==u.Layout.CONTAINER;return p}function s(t){return u.isInternalElement(t)?!0:t.tagName&&(t.hasAttribute("placeholder")||t.hasAttribute("fallback")||t.hasAttribute("overflow"))?!0:!1}function a(t,e,i){var n=t.Object.create(t.HTMLElement.prototype);return n.createdCallback=function(){this.classList.add("-amp-element"),this.built_=!1,this.classList.add("-amp-notbuilt"),this.classList.add("amp-notbuilt"),this.readyState="loading",this.everAttached=!1,this.resources_=_.resourcesFor(t),this.layout_=u.Layout.NODISPLAY,this.layoutWidth_=-1,this.layoutCount_=0,this.isInViewport_=!1,this.mediaQuery_,this.sizeList_,this.sizerElement_=null,this.loadingDisabled_,this.loadingState_,this.loadingContainer_=null,this.loadingElement_=null,this.overflowElement_,this.implementation_=new i(this),this.implementation_.createdCallback(),this.actionQueue_=[],this.isInTemplate_},n.assertNotTemplate_=function(){h.assert(!this.isInTemplate_,"Must never be called in template")},n.isUpgraded=function(){return!(this.implementation_ instanceof c.ElementStub)},n.upgrade=function(t){if(!this.isInTemplate_){if(this.implementation_=new t(this),this.classList.remove("amp-unresolved"),this.classList.remove("-amp-unresolved"),this.implementation_.createdCallback(),this.layout_!=u.Layout.NODISPLAY&&!this.implementation_.isLayoutSupported(this.layout_))throw new Error("Layout not supported: "+this.layout_);this.implementation_.layout_=this.layout_,this.implementation_.layoutWidth_=this.layoutWidth_,this.everAttached&&(this.implementation_.firstAttachedCallback(),this.dispatchCustomEvent("amp:attached")),this.resources_.upgraded(this)}},n.isBuilt=function(){return this.built_},n.build=function(t){if(this.assertNotTemplate_(),this.isBuilt())return!0;if(h.assert(this.isUpgraded(),"Cannot build unupgraded element"),!t&&!this.implementation_.isReadyToBuild())return!1;try{this.implementation_.buildCallback(),this.preconnect(!1),this.built_=!0,this.classList.remove("-amp-notbuilt"),this.classList.remove("amp-notbuilt")}catch(e){throw m.reportError(e,this),e}return this.built_&&this.isInViewport_&&this.updateInViewport_(!0),this.actionQueue_&&(this.actionQueue_.length>0?v.timer.delay(this.dequeueActions_.bind(this),1):this.actionQueue_=null),!0},n.preconnect=function(t){this.implementation_.preconnectCallback(t)},n.getVsync_=function(){return g.vsyncFor(this.ownerDocument.defaultView)},n.updateLayoutBox=function(t){var e=this;this.layoutWidth_=t.width,this.isUpgraded()&&(this.implementation_.layoutWidth_=this.layoutWidth_),this.implementation_.onLayoutMeasure(),this.isLoadingEnabled_()&&(this.isInViewport_?this.toggleLoading_(!0):t.top<S&&t.top>=0&&this.getVsync_().mutate(function(){e.prepareLoading_()}))},n.applySizesAndMediaQuery=function(){if(this.assertNotTemplate_(),void 0===this.mediaQuery_&&(this.mediaQuery_=this.getAttribute("media")||null),this.mediaQuery_&&this.classList.toggle("-amp-hidden-by-media-query",!this.ownerDocument.defaultView.matchMedia(this.mediaQuery_).matches),void 0===this.sizeList_){var t=this.getAttribute("sizes");this.sizeList_=t?f.parseSizeList(t):null}this.sizeList_&&(this.style.width=u.assertLength(this.sizeList_.select(this.ownerDocument.defaultView)))},n.changeHeight=function(t){this.sizerElement_&&(this.sizerElement_.style.paddingTop="0"),this.style.height=t+"px"},n.attachedCallback=function(){if(T||(this.isInTemplate_=!!b.closestByTag(this,"template")),!this.isInTemplate_){if(!this.everAttached){this.everAttached=!0;try{this.firstAttachedCallback_()}catch(t){m.reportError(t,this)}}this.resources_.add(this)}},n.detachedCallback=function(){this.isInTemplate_||this.resources_.remove(this)},n.firstAttachedCallback_=function(){this.isUpgraded()||(this.classList.add("amp-unresolved"),this.classList.add("-amp-unresolved"));try{if(this.layout_=o(this),this.layout_!=u.Layout.NODISPLAY&&!this.implementation_.isLayoutSupported(this.layout_))throw new Error("Layout not supported for: "+this.layout_);this.implementation_.layout_=this.layout_,this.implementation_.firstAttachedCallback()}catch(t){throw m.reportError(t,this),t}this.isUpgraded()?this.dispatchCustomEvent("amp:attached"):this.dispatchCustomEvent("amp:stubbed")},n.dispatchCustomEvent=function(t,e){var i=e||{},n=this.ownerDocument.defaultView,r=n.document.createEvent("Event");r.data=i,r.initEvent(t,!0,!0),this.dispatchEvent(r)},n.prerenderAllowed=function(){return this.implementation_.prerenderAllowed()},n.renderOutsideViewport=function(){return this.implementation_.renderOutsideViewport()},n.getLayoutBox=function(){return this.resources_.getResourceForElement(this).getLayoutBox()},n.isRelayoutNeeded=function(){return this.implementation_.isRelayoutNeeded()},n.layoutCallback=function(){var t=this;this.assertNotTemplate_(),h.assert(this.isUpgraded()&&this.isBuilt(),"Must be upgraded and built to receive viewport events"),this.dispatchCustomEvent("amp:load:start");var e=this.implementation_.layoutCallback();return this.preconnect(!0),this.classList.add("-amp-layout"),e.then(function(){t.readyState="complete",t.layoutCount_++,t.toggleLoading_(!1,!0),1==t.layoutCount_&&t.implementation_.firstLayoutCompleted()},function(e){return t.toggleLoading_(!1,!0),Promise.reject(e)})},n.viewportCallback=function(t){var e=this;this.assertNotTemplate_(),this.isInViewport_=t,0==this.layoutCount_&&(t?v.timer.delay(function(){0==e.layoutCount_&&e.isInViewport_&&e.toggleLoading_(!0)},100):this.toggleLoading_(!1)),this.isUpgraded()&&this.isBuilt()&&this.updateInViewport_(t)},n.updateInViewport_=function(t){this.implementation_.inViewport_=t,this.implementation_.viewportCallback(t)},n.documentInactiveCallback=function(){return this.assertNotTemplate_(),this.isBuilt()&&this.isUpgraded()?this.implementation_.documentInactiveCallback():!1},n.enqueAction=function(t){this.assertNotTemplate_(),this.isBuilt()?this.executionAction_(t,!1):h.assert(this.actionQueue_).push(t)},n.dequeueActions_=function(){var t=this;if(this.actionQueue_){var e=h.assert(this.actionQueue_);this.actionQueue_=null,e.forEach(function(e){t.executionAction_(e,!0)})}},n.executionAction_=function(t,e){try{this.implementation_.executeAction(t,e)}catch(i){d.log.error(w,"Action execution failed:",t,i)}},n.getRealChildNodes=function(){for(var t=[],e=this.firstChild;e;e=e.nextSibling)s(e)||t.push(e);return t},n.getRealChildren=function(){for(var t=[],e=0;e<this.children.length;e++){var i=this.children[e];s(i)||t.push(i)}return t},n.getPlaceholder=function(){return b.childElementByAttr(this,"placeholder")},n.togglePlaceholder=function(t){this.assertNotTemplate_();var e=this.getPlaceholder();e&&e.classList.toggle("amp-hidden",!t)},n.getFallback=function(){return b.childElementByAttr(this,"fallback")},n.toggleFallback=function(t){this.assertNotTemplate_(),this.classList.toggle("amp-notsupported",t)},n.isLoadingEnabled_=function(){return void 0===this.loadingDisabled_&&(this.loadingDisabled_=this.hasAttribute("noloading")),this.loadingDisabled_||!u.isLoadingAllowed(this.tagName)||this.layoutWidth_<E||this.layoutCount_>0||s(this)||!u.isLayoutSizeDefined(this.layout_)?!1:!0},n.prepareLoading_=function(){if(!this.loadingContainer_){var t=document.createElement("div");t.classList.add("-amp-loading-container"),t.classList.add("-amp-fill-content"),t.classList.add("amp-hidden");var e=p.createLoaderElement();t.appendChild(e),this.appendChild(t),this.loadingContainer_=t,this.loadingElement_=e}},n.toggleLoading_=function(t,e){var i=this;return this.assertNotTemplate_(),this.loadingState_=t,t||this.loadingContainer_?t&&!this.isLoadingEnabled_()?void(this.loadingState_=!1):void this.getVsync_().mutate(function(){var t=i.loadingState_;t&&!i.isLoadingEnabled_()&&(t=!1),t&&i.prepareLoading_(),i.loadingContainer_&&(i.loadingContainer_.classList.toggle("amp-hidden",!t),i.loadingElement_.classList.toggle("amp-active",t),!t&&e&&!function(){var t=i.loadingContainer_;i.loadingContainer_=null,i.loadingElement_=null,i.resources_.deferMutate(i,function(){b.removeElement(t)})}())}):void 0},n.getOverflowElement=function(){return void 0===this.overflowElement_&&(this.overflowElement_=b.childElementByAttr(this,"overflow"),this.overflowElement_&&(this.overflowElement_.hasAttribute("tabindex")||this.overflowElement_.setAttribute("tabindex","0"),this.overflowElement_.hasAttribute("role")||this.overflowElement_.setAttribute("role","button"))),this.overflowElement_},n.overflowCallback=function(t,e){var i=this;if(t||this.overflowElement_){var n=this.getOverflowElement();if(!n)return void(t&&d.log.warn(w,"Cannot resize element and overlfow is not available",this));n.classList.toggle("amp-visible",t),t?this.overflowElement_.onclick=function(){i.resources_.changeHeight(i,e),i.getVsync_().mutate(function(){i.overflowCallback(!1,e)})}:this.overflowElement_.onclick=null}},n}function l(t,e,i){C[e]=i,t.document.registerElement(e,{prototype:a(t,e,i)})}i.__esModule=!0,i.upgradeOrRegisterElement=n,i.stubElements=r,i.applyLayout_=o,i.createAmpElementProto=a,i.registerElement=l;var u=t("./layout"),c=t("./element-stub"),h=t("./asserts"),p=t("../src/loader"),d=t("./log"),f=t("./size-list"),m=t("./error"),_=t("./resources"),v=t("./timer"),g=t("./vsync"),y=t("./dom"),b=babelHelpers.interopRequireWildcard(y),w="CustomElement",E=100,S=1e3,C={},T="content"in document.createElement("template")},{"../src/loader":76,"./asserts":55,"./dom":64,"./element-stub":65,"./error":66,"./layout":75,"./log":77,"./resources":86,"./size-list":95,"./timer":101,"./vsync":108}],61:[function(t,e,i){function n(t){o(t)}function r(t){o(t).cleanup()}function o(t){return l.getService(t,"clickhandler",function(){return new p(t)})}function s(t,e){if(!t.defaultPrevented){var i=a.closestByTag(t.target,"A");if(i){var n=null,r=t.currentTarget,o=r.ownerDocument,s=c.parseUrl(i.href);if(s.hash){var l=c.parseUrl(o.location.href),h=""+s.origin+s.pathname+s.search,p=""+l.origin+l.pathname+l.search;if(h==p){t.preventDefault();var d=s.hash.slice(1);n=o.getElementById(d),n||(n=o.querySelector("a[name="+d+"]")),n?e.scrollIntoView(n):u.log.warn("documentElement","failed to find element with id="+d+" or a[name="+d+"]")}}}}}i.__esModule=!0,i.installGlobalClickListener=n,i.uninstallGlobalClickListener=r,i.onDocumentElementClick_=s;var a=t("./dom"),l=t("./service"),u=t("./log"),c=t("./url"),h=t("./viewport"),p=function(){function t(e){babelHelpers.classCallCheck(this,t),this.win=e,this.viewport_=h.viewportFor(e),this.boundHandle_=this.handle_.bind(this),this.win.document.documentElement.addEventListener("click",this.boundHandle_)}return t.prototype.cleanup=function(){this.win.document.documentElement.removeEventListener("click",this.boundHandle_)},t.prototype.handle_=function(t){s(t,this.viewport_)},t}();i.ClickHandler=p},{"./dom":64,"./log":77,"./service":88,"./url":103,"./viewport":107}],62:[function(t,e,i){function n(t){return o.getService(t,"documentInfo",function(){return{canonicalUrl:a.parseUrl(s.assert(t.document.querySelector("link[rel=canonical]"),"AMP files are required to have a <link rel=canonical> tag.").href).href,pageViewId:r(t)}})}function r(t){return String(Math.floor(1e4*t.Math.random()))}i.__esModule=!0,i.documentInfoFor=n;var o=t("./service"),s=t("./asserts"),a=t("./url")},{"./asserts":55,"./service":88,"./url":103}],63:[function(t,e,i){function n(t){return"loading"!=t.readyState}function r(t,e){var i=n(t);i?e():!function(){var n=function(){"loading"!=t.readyState&&(i||(i=!0,e()),t.removeEventListener("readystatechange",n))};t.addEventListener("readystatechange",n)}()}function o(t){return new Promise(function(e){r(t,e)})}function s(t){return new h(t)}function a(t){return u.getService(t,"documentState",function(){return s(t)})}i.__esModule=!0,i.isDocumentReady=n,i.onDocumentReady=r,i.whenDocumentReady=o,i.documentStateFor=a;var l=t("./observable"),u=t("./service"),c=t("./style"),h=function(){function t(e){if(babelHelpers.classCallCheck(this,t),this.win=e,this.document_=e.document,this.hiddenProp_=c.getVendorJsPropertyName(this.document_,"hidden",!0),void 0===this.document_[this.hiddenProp_]&&(this.hiddenProp_=null),this.visibilityStateProp_=c.getVendorJsPropertyName(this.document_,"visibilityState",!0),void 0===this.document_[this.visibilityStateProp_]&&(this.visibilityStateProp_=null),this.visibilityObservable_=new l.Observable,this.visibilityChangeEvent_=null,this.hiddenProp_){this.visibilityChangeEvent_="visibilitychange";var i=this.hiddenProp_.indexOf("Hidden");-1!=i&&(this.visibilityChangeEvent_=this.hiddenProp_.substring(0,i)+"Visibilitychange")}this.boundOnVisibilityChanged_=this.onVisibilityChanged_.bind(this),this.visibilityChangeEvent_&&this.document_.addEventListener(this.visibilityChangeEvent_,this.boundOnVisibilityChanged_)}return t.prototype.cleanup_=function(){this.visibilityChangeEvent_&&this.document_.removeEventListener(this.visibilityChangeEvent_,this.boundOnVisibilityChanged_)},t.prototype.isReady=function(){return n(this.document_)},t.prototype.onReady=function(t){return r(this.document_,t)},t.prototype.isHidden=function(){return this.hiddenProp_?this.document_[this.hiddenProp_]:!1},t.prototype.getVisibilityState=function(){return this.visibilityStateProp_?this.document_[this.visibilityStateProp_]:this.isHidden()?"hidden":"visible"},t.prototype.onVisibilityChanged=function(t){
return this.visibilityObservable_.add(t)},t.prototype.onVisibilityChanged_=function(){this.visibilityObservable_.fire()},t}();i.DocumentState=h},{"./observable":79,"./service":88,"./style":98}],64:[function(t,e,i){function n(t){t.parentElement&&t.parentElement.removeChild(t)}function r(t){for(;t.firstChild;)t.removeChild(t.firstChild)}function o(t,e){for(var i=e.ownerDocument.createDocumentFragment(),n=t.firstChild;n;n=n.nextSibling)i.appendChild(n.cloneNode(!0));e.appendChild(i)}function s(t,e){for(var i=t;i;i=i.parentElement)if(e(i))return i;return null}function a(t,e){return e=e.toUpperCase(),s(t,function(t){return t.tagName==e})}function l(t,e){var i=t.getElementsByTagName(e);return i.length>0?i[0]:null}function u(t,e){for(var i=t.children,n=0;n<i.length;n++)if(e(i[n]))return i[n];return null}function c(t,e,i){return u(t,function(t){return t.hasAttribute(e)?void 0!==i&&t.getAttribute(e)!=i?!1:!0:!1})}function h(t,e){return e=e.toUpperCase(),u(t,function(t){return t.tagName==e})}i.__esModule=!0,i.removeElement=n,i.removeChildren=r,i.copyChildren=o,i.closest=s,i.closestByTag=a,i.elementByTag=l,i.childElement=u,i.childElementByAttr=c,i.childElementByTag=h},{}],65:[function(t,e,i){i.__esModule=!0;var n=t("./base-element"),r=[];i.stubbedElements=r;var o=function(t){function e(i){babelHelpers.classCallCheck(this,e),t.call(this,i),r.push(this)}return babelHelpers.inherits(e,t),e.prototype.isLayoutSupported=function(t){return!0},e}(n.BaseElement);i.ElementStub=o},{"./base-element":56}],66:[function(t,e,i){(function(e){function n(t,i){if(window.console&&!t.reported){t.reported=!0;var n=i||t.associatedElement;n&&(n.classList.add("-amp-error"),a.getMode().development&&(n.classList.add("-amp-element-error"),n.setAttribute("error-message",t.message))),t.messageArray?(console.error||console.log).apply(console,t.messageArray):(n?(console.error||console.log).call(console,n.tagName+"#"+n.id,t.message):(console.error||console.log).call(console,t.message),"production"!=e.env.NODE_ENV&&(console.error||console.log).call(console,t.stack)),n&&n.dispatchCustomEvent&&n.dispatchCustomEvent("amp:error",t.message),o(void 0,void 0,void 0,void 0,t)}}function r(t){t.onerror=o}function o(t,e,i,n,r){this&&this.document&&u.makeBodyVisible(this.document);var o=a.getMode();if(!(o.isLocalDev||o.development||o.test)){var l=s(t,e,i,n,r);c(function(){(new Image).src=l})}}function s(t,e,i,n,r){if(t=r&&r.message?r.message:t,!/_reported_/.test(t)){t||(t="Unknown error");var o="https://amp-error-reporting.appspot.com/r?v="+encodeURIComponent("1452640483698-canary")+"&m="+encodeURIComponent(t);if(r){var s=r&&r.associatedElement?r.associatedElement.tagName:"u";o+="&a="+(r.fromAssert?1:0)+"&el="+encodeURIComponent(s)+"&s="+encodeURIComponent(r.stack||""),r.message+=" _reported_"}else o+="&f="+encodeURIComponent(e)+"&l="+encodeURIComponent(i)+"&c="+encodeURIComponent(n||"");return o.substr(0,2e3)}}i.__esModule=!0,i.reportError=n,i.installErrorReporting=r,i.getErrorReportUrl=s;var a=t("./mode"),l=t("./exponential-backoff"),u=t("./styles"),c=l.exponentialBackoff(1.5)}).call(this,t("_process"))},{"./exponential-backoff":69,"./mode":78,"./styles":99,_process:7}],67:[function(t,e,i){function n(t,e,i,n){var r=n||!1;return t.addEventListener(e,i,r),function(){t.removeEventListener(e,i,r)}}function r(t,e,i,n){var r=n||!1,o=void 0,s=function(t){i(t),o()};return o=function(){t.removeEventListener(e,s,r)},t.addEventListener(e,s,r),o}function o(t,e,i,n){var o=void 0,s=new Promise(function(n,s){o=r(t,e,n,i)});return l(s,o,n)}function s(t){return t.complete||"complete"==t.readyState}function a(t,e){var i=void 0,n=void 0,o=new Promise(function(e,o){s(t)?e(t):(i="AUDIO"===t.tagName||"VIDEO"===t.tagName?r(t,"loadstart",function(){return e(t)}):r(t,"load",function(){return e(t)}),n=r(t,"error",o))});return l(o,function(){i&&i(),n&&n()},e)}function l(t,e,i){var n=void 0;return n=void 0===i?t:u.timer.timeoutPromise(i||0,t),e?n.then(function(t){return e(),t},function(t){throw e(),t}):n}i.__esModule=!0,i.listen=n,i.listenOnce=r,i.listenOncePromise=o,i.isLoaded=s,i.loadPromise=a;var u=t("./timer")},{"./timer":101}],68:[function(t,e,i){function n(t,e){return-1!=o(t).indexOf(e)}function r(t,e,i){var n=o(t),r=-1!=n.indexOf(e),a=void 0!==i?i:!r;return a!=r&&(a?n.push(e):n.splice(n.indexOf(e),1),s(t,n)),a}function o(t){var e=a.getCookie(t,u);return e?e.split(/\s*,\s*/g):[]}function s(t,e){a.setCookie(t,u,e.join(","),l.timer.now()+h)}i.__esModule=!0,i.isExperimentOn=n,i.toggleExperiment=r;var a=t("./cookies"),l=t("./timer"),u="AMP_EXP",c=180,h=24*c*60*60*1e3},{"./cookies":58,"./timer":101}],69:[function(t,e,i){function n(t){var e=0;return function(i){var n=Math.pow(t||2,e++),r=.3*n*Math.random();Math.random()>.5&&(r*=-1),n+=r,setTimeout(i,Math.round(1e3*n))}}i.__esModule=!0,i.exponentialBackoff=n},{}],70:[function(t,e,i){function n(t,e,i){r.upgradeOrRegisterElement(t,e,i)}i.__esModule=!0,i.registerExtendedElement=n;var r=t("./custom-element")},{"./custom-element":60}],71:[function(t,e,i){i.__esModule=!0;var n=t("./observable"),r=t("./timer"),o=function(){function t(e,i){var o=this;babelHelpers.classCallCheck(this,t),this.win=e,this.purgeTimeout_=i,this.history_=[],this.observeFocus_=new n.Observable,this.captureFocus_=function(t){t.target&&o.pushFocus_(t.target)},this.captureBlur_=function(t){r.timer.delay(function(){o.pushFocus_(o.win.document.activeElement)},500)},this.win.document.addEventListener("focus",this.captureFocus_,!0),this.win.addEventListener("blur",this.captureBlur_)}return t.prototype.cleanup_=function(){this.win.document.removeEventListener("focus",this.captureFocus_,!0),this.win.removeEventListener("blur",this.captureBlur_)},t.prototype.onFocus=function(t){return this.observeFocus_.add(t)},t.prototype.pushFocus_=function(t){var e=r.timer.now();0==this.history_.length||this.history_[this.history_.length-1].el!=t?this.history_.push({el:t,time:e}):this.history_[this.history_.length-1].time=e,this.purgeBefore(e-this.purgeTimeout_),this.observeFocus_.fire(t)},t.prototype.getLast=function(){return 0==this.history_.length?null:this.history_[this.history_.length-1].el},t.prototype.purgeBefore=function(t){for(var e=this.history_.length-1,i=0;i<this.history_.length;i++)if(this.history_[i].time>=t){e=i-1;break}-1!=e&&this.history_.splice(0,e+1)},t.prototype.hasDescendantsOf=function(t){this.win.document.activeElement&&this.pushFocus_(this.win.document.activeElement);for(var e=0;e<this.history_.length;e++)if(t.contains(this.history_[e].el))return!0;return!1},t}();i.FocusHistory=o},{"./observable":79,"./timer":101}],72:[function(t,e,i){function n(t){return o.getService(t,"input",function(){return new h(t)})}i.__esModule=!0,i.inputFor=n;var r=t("./observable"),o=t("./service"),s=t("./log"),a=t("./event-helper"),l="Input",u=3,c=300,h=function(){function t(e){babelHelpers.classCallCheck(this,t),this.win=e,this.boundOnKeyDown_=this.onKeyDown_.bind(this),this.boundOnMouseDown_=this.onMouseDown_.bind(this),this.boundOnMouseMove_=this.onMouseMove_.bind(this),this.boundMouseCanceled_=this.mouseCanceled_.bind(this),this.boundMouseConfirmed_=this.mouseConfirmed_.bind(this),this.hasTouch_="ontouchstart"in e||void 0!==e.navigator.maxTouchPoints&&e.navigator.maxTouchPoints>0||void 0!==e.DocumentTouch,s.log.fine(l,"touch detected:",this.hasTouch_),this.keyboardActive_=!1,this.win.document.addEventListener("keydown",this.boundOnKeyDown_),this.win.document.addEventListener("mousedown",this.boundOnMouseDown_),this.hasMouse_=!0,this.mouseConfirmAttemptCount_=0,this.touchDetectedObservable_=new r.Observable,this.mouseDetectedObservable_=new r.Observable,this.keyboardStateObservable_=new r.Observable,this.hasTouch_&&(this.hasMouse_=!this.hasTouch_,a.listenOnce(e.document,"mousemove",this.boundOnMouseMove_))}return t.prototype.cleanup_=function(){this.win.document.removeEventListener("keydown",this.boundOnKeyDown_),this.win.document.removeEventListener("mousedown",this.boundOnMouseDown_)},t.prototype.isTouchDetected=function(){return this.hasTouch_},t.prototype.onTouchDetected=function(t,e){return e&&t(this.isTouchDetected()),this.touchDetectedObservable_.add(t)},t.prototype.isMouseDetected=function(){return this.hasMouse_},t.prototype.onMouseDetected=function(t,e){return e&&t(this.isMouseDetected()),this.mouseDetectedObservable_.add(t)},t.prototype.isKeyboardActive=function(){return this.keyboardActive_},t.prototype.onKeyboardStateChanged=function(t,e){return e&&t(this.isKeyboardActive()),this.keyboardStateObservable_.add(t)},t.prototype.onKeyDown_=function(t){if(!this.keyboardActive_&&!t.defaultPrevented){var e=t.target;(!e||"INPUT"!=e.tagName&&"TEXTAREA"!=e.tagName&&"SELECT"!=e.tagName&&"OPTION"!=e.tagName&&!e.hasAttribute("contenteditable"))&&(this.keyboardActive_=!0,this.keyboardStateObservable_.fire(!0),s.log.fine(l,"keyboard activated"))}},t.prototype.onMouseDown_=function(){this.keyboardActive_&&(this.keyboardActive_=!1,this.keyboardStateObservable_.fire(!1),s.log.fine(l,"keyboard deactivated"))},t.prototype.onMouseMove_=function(){return a.listenOncePromise(this.win.document,"click",!1,c).then(this.boundMouseCanceled_,this.boundMouseConfirmed_)},t.prototype.mouseConfirmed_=function(){this.hasMouse_=!0,this.mouseDetectedObservable_.fire(!0),s.log.fine(l,"mouse detected")},t.prototype.mouseCanceled_=function(){this.mouseConfirmAttemptCount_++,this.mouseConfirmAttemptCount_<=u?a.listenOnce(this.win.document,"mousemove",this.boundOnMouseMove_):s.log.fine(l,"mouse detection failed")},t}();i.Input=h},{"./event-helper":67,"./log":77,"./observable":79,"./service":88}],73:[function(t,e,i){function n(t,e,i){e.x=e.left,e.y=e.top;var n=o.moveLayoutRect(i,-1*e.x,-1*e.y);r.assert(n.width>=0&&n.height>=0,"Negative dimensions in ad."),n.x=n.left,n.y=n.top;var s=o.rectIntersection(e,i)||o.layoutRectLtwh(0,0,0,0);return s.x=s.left,s.y=s.top,{time:t,rootBounds:e,boundingClientRect:n,intersectionRect:s}}i.__esModule=!0,i.getIntersectionChangeEntry=n;var r=t("./asserts"),o=t("./layout-rect")},{"./asserts":55,"./layout-rect":74}],74:[function(t,e,i){function n(t,e,i,n){return{left:t,top:e,width:i,height:n,bottom:e+n,right:t+i}}function r(t){return{left:t.left,top:t.top,width:t.width,height:t.height,bottom:t.top+t.height,right:t.left+t.width}}function o(t,e){return t.top<=e.bottom&&e.top<=t.bottom&&t.left<=e.right&&e.left<=t.right}function s(t,e){var i=Math.max(t.left,e.left),r=Math.min(t.left+t.width,e.left+e.width);if(r>=i){var o=Math.max(t.top,e.top),s=Math.min(t.top+t.height,e.top+e.height);if(s>=o)return n(i,o,r-i,s-o)}return null}function a(t,e,i){return{top:t.top-t.height*i,bottom:t.bottom+t.height*i,left:t.left-t.width*e,right:t.right+t.width*e,width:t.width*(1+2*e),height:t.height*(1+2*i)}}function l(t,e,i){return 0==e&&0==i?t:n(t.left+e,t.top+i,t.width,t.height)}i.__esModule=!0,i.layoutRectLtwh=n,i.layoutRectFromDomRect=r,i.layoutRectsOverlap=o,i.rectIntersection=s,i.expandLayoutRect=a,i.moveLayoutRect=l},{}],75:[function(t,e,i){function n(t){for(var e in m)if(m[e]==t)return m[e]}function r(t){return"-amp-layout-"+t}function o(t){return t==m.FIXED||t==m.FIXED_HEIGHT||t==m.RESPONSIVE||t==m.FILL}function s(t){var e="string"==typeof t?t:t.tagName;return e&&0==e.toLowerCase().indexOf("i-")}function a(t){if("number"==typeof t)return t+"px";if(t&&/^\d+(\.\d+)?(px|em|rem|vh|vw|vmin|vmax)?$/.test(t))return/^\d+(\.\d+)?$/.test(t)?t+"px":t}function l(t){return f.assert(/^\d+(\.\d+)?(px|em|rem|vh|vw|vmin|vmax)$/.test(t),"Invalid length value: %s",t),t}function u(t){l(t);var e=f.assert(t.match(/[a-z]+/i),"Failed to read units from %s",t);return e[0]}function c(t){return parseFloat(t)}function h(t){return t=t.toUpperCase(),void 0!==_[t]}function p(t){if(t=t.toUpperCase(),f.assert(void 0!==_[t]),!_[t]){var e=t.replace(/^AMP\-/,""),i=document.createElement(e);i.controls=!0,i.style.position="absolute",i.style.visibility="hidden",document.body.appendChild(i),_[t]={width:(i.offsetWidth||1)+"px",height:(i.offsetHeight||1)+"px"},document.body.removeChild