;
(self.AMP=self.AMP||[]).push({m:0,v:"2410292120000",n:"amp-list",ev:"0.1",l:!0,f:function(t,i){!function(){function i(t,i){(null==i||i>t.length)&&(i=t.length);for(var n=0,r=new Array(i);n=t.length?{done:!0}:{done:!1,value:t[e++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r;function e(){return r||(r=Promise.resolve(void 0))}var o=function(){var t=this;this.promise=new Promise((function(i,n){t.resolve=i,t.reject=n}))};function a(t){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function s(t,i){return(s=Object.setPrototypeOf||function(t,i){return t.__proto__=i,t})(t,i)}function u(t){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function l(t,i){if(i&&("object"===a(i)||"function"==typeof i))return i;if(void 0!==i)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function f(t){return t?Array.prototype.slice.call(t):[]}var h=Array.isArray,c=Object.prototype,m=c.hasOwnProperty,d=c.toString;function v(t){var i=Object.create(null);return t&&Object.assign(i,t),i}function p(t,i){return m.call(t,i)}function b(t,i){if("."==i)return t;for(var r,e=t,o=n(i.split("."),!0);!(r=o()).done;){var s=r.value;if(!(s&&e&&void 0!==e[s]&&"object"==a(e)&&p(e,s))){e=void 0;break}e=e[s]}return e}function g(t,i,n,r,e,o,a,s,u,l,f){return t}var y,w="amp:dom-update";function x(t){return void 0!==y?y:y=function(t){try{var i=t.ownerDocument,n=i.createElement("div"),r=i.createElement("div");return n.appendChild(r),n.querySelector(":scope div")===r}catch(t){return!1}}(t)}function O(t,i){return t.replace(/^|,/g,"$&".concat(i," "))}function j(t,i){var n=t.classList,r="i-amphtml-scoped";n.add(r);var e=O(i,".".concat(r)),o=t.querySelectorAll(e);return n.remove(r),o}function S(t,i){if(x(t))return t.querySelector(O(i,":scope"));var n=j(t,i)[0];return void 0===n?null:n}function R(t,i){return g(/^[\w-]+$/.test(i)),S(t,"> [".concat(i,"]"))}function E(t){for(;t.firstChild;)t.removeChild(t.firstChild)}function k(t){try{t.focus()}catch(t){}}var I,T={NODISPLAY:"nodisplay",FIXED:"fixed",FIXED_HEIGHT:"fixed-height",RESPONSIVE:"responsive",CONTAINER:"container",FILL:"fill",FLEX_ITEM:"flex-item",FLUID:"fluid",INTRINSIC:"intrinsic"},P=["Webkit","webkit","Moz","moz","ms","O","o"];function U(t){var i=t.replace(/[A-Z]/g,(function(t){return"-"+t.toLowerCase()}));return P.some((function(t){return i.startsWith(t+"-")}))?"-".concat(i):i}function A(t,i,n){if(i.startsWith("--"))return i;I||(I=v());var r=I[i];if(!r||n){if(r=i,void 0===t[i]){var e=function(t){return t.charAt(0).toUpperCase()+t.slice(1)}(i),o=function(t,i){for(var n=0;n
1&&void 0!==arguments[1]?arguments[1]:"";try{return decodeURIComponent(t)}catch(t){return i}}function X(t){var i,n=v();if(!t)return n;for(;i=G.exec(t);){var r=H(i[1],i[1]),e=i[2]?H(i[2].replace(/\+/g," "),i[2]):"";n[r]=e}return n}self.__AMP_LOG=self.__AMP_LOG||{user:null,dev:null,userForEmbed:null};var J=self.__AMP_LOG;function D(t,i){throw new Error("failed to call initLogConstructor")}function q(t){return J.user||(J.user=B()),function(t,i){return i&&i.ownerDocument.defaultView!=t}(J.user.win,t)?J.userForEmbed||(J.userForEmbed=B()):J.user}function B(t){return D()}function $(){return J.dev||(J.dev=D())}function V(t,i,n,r,e,o,a,s,u,l,f){return t}function Y(t,i,n,r,e,o,a,s,u,l,f){return q().assert(t,i,n,r,e,o,a,s,u,l,f)}function W(t,i){return nt(t=function(t){return t.__AMP_TOP||(t.__AMP_TOP=t)}(t),i)}function Z(t,i){return nt(it(tt(t)),i)}function K(t,i){var n=it(tt(t));return ot(n,i)?nt(n,i):null}function Q(t,i){return rt(it(t),i)}function tt(t){return t.nodeType?(n=t,i=(n.ownerDocument||n).defaultView,W(i,"ampdoc")).getAmpDoc(t):t;var i,n}function it(t){var i=tt(t);return i.isSingleDoc()?i.win:i}function nt(t,i){V(ot(t,i));var n=et(t)[i];return n.obj||(V(n.ctor),V(n.context),n.obj=new n.ctor(n.context),V(n.obj),n.context=null,n.resolve&&n.resolve(n.obj)),n.obj}function rt(t,i){var n=et(t)[i];return n?n.promise?n.promise:(nt(t,i),n.promise=Promise.resolve(n.obj)):null}function et(t){var i=t.__AMP_SERVICES;return i||(i=t.__AMP_SERVICES={}),i}function ot(t,i){var n=t.__AMP_SERVICES&&t.__AMP_SERVICES[i];return!(!n||!n.ctor)}var at="__AMP__EXPERIMENT_TOGGLES",st=function(){function t(t){this.zt=t,this.It=0,this.Ct=0,this.Ot=v()}var i=t.prototype;return i.has=function(t){return!!this.Ot[t]},i.get=function(t){var i=this.Ot[t];if(i)return i.access=++this.Ct,i.payload},i.put=function(t,i){this.has(t)||this.It++,this.Ot[t]={payload:i,access:this.Ct},this.qt()},i.qt=function(){if(!(this.It<=this.zt)){var t,i=this.Ot,n=this.Ct+1;for(var r in i){var e=i[r].access;e=0&&i.indexOf(n,r)==r);var i,n,r}function wt(t,i){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"source";return Y(null!=t,"%s %s must be available",i,n),Y(yt(t)||/^\/\//.test(t),'%s %s must start with "https://" or "//" or be relative and served from either https or from localhost. Invalid value: %s',i,n,t),t}function xt(t){return t.startsWith("amp-script:")}function Ot(t){return bt(function(t){if(!function(t){return dt.cdnProxyRegex.test(pt(t).origin)}(t=pt(t)))return t.href;var i=t.pathname.split("/"),n=i[1];Y(vt.has(n),"Unknown path prefix in url %s",t.href);var r=i[2],e="s"==r?"https://"+decodeURIComponent(i[3]):"http://"+decodeURIComponent(r);return Y(e.indexOf(".")>0,"Expected a . in origin %s",e),i.splice(1,"s"==r?3:2),e+i.join("/")+function(t,i){if(!t||"?"==t)return"";var n=new RegExp("[?&]".concat("(amp_(js[^&=]*|gsa|r|kit)|usqp)","\\b[^&]*"),"g"),r=t.replace(n,"").replace(/^[?&]/,"");return r?"?"+r:""}(t.search)+(t.hash||"")}(t)).origin}var jt="i-amphtml-key",St="i-amphtml-ignore",Rt={"AMP-IMG":["src","srcset","layout","width","height"]};Object.freeze({"input":{"type":/(?:image|button)/i}}),Object.freeze({"input":{"type":/(?:button|file|image|password)/i}});var Et,kt=Object.freeze(["form","formaction","formmethod","formtarget","formnovalidate","formenctype"]);function It(t,i,n,r){var e={detail:n};if(Object.assign(e,r),"function"==typeof t.CustomEvent)return new t.CustomEvent(i,e);var o=t.document.createEvent("CustomEvent");return o.initCustomEvent(i,!!e.bubbles,!!e.cancelable,n),o}function Tt(t,i,n,r){return function(t,i,n,r){var e=t,o=n,a=function(t){try{return o(t)}catch(t){var i,n;throw null===(i=(n=self).__AMP_REPORT_ERROR)||void 0===i||i.call(n,t),t}},s=function(){if(void 0!==Et)return Et;Et=!1;try{var t={get capture(){return Et=!0,!1}};self.addEventListener("test-options",null,t),self.removeEventListener("test-options",null,t)}catch(t){}return Et}(),u=!(null==r||!r.capture);return e.addEventListener(i,a,s?r:u),function(){null==e||e.removeEventListener(i,a,s?r:u),o=null,e=null,a=null}}(t,i,n,r)}function Pt(t){return!!t&&"function"==typeof t.getFormData}Object.freeze({"input":kt,"textarea":kt,"select":kt}),Object.freeze({"amp-anim":["controls"],"form":["name"]});var Ut=["GET","POST"],At=[h,function(t){return"[object Object]"===d.call(t)}];function Nt(t,i){var n=z({},i);if(Pt(i.body)){var r=i.body;n.headers["Content-Type"]="multipart/form-data;charset=utf-8",n.body=function(t){for(var i=[],n=t.next();!n.done;n=t.next())i.push(n.value);return i}(r.entries())}return{input:t,init:n}}Ct.KEY="data-key",Ct.IGNORE="data-ignore",Ct.CHECKSUM="data-checksum";var Lt,Mt="_set-dom-mounted",_t=null;function Ct(t,i){_t=[],function(t,i){if(!t)throw new Error("set-dom: You must provide a valid node to update.")}(t&&t.nodeType),9===t.nodeType&&(t=t.documentElement),11===i.nodeType?zt(t,i):Ft(t,i),t[Mt]||(t[Mt]=!0,Jt(t));var n=_t;return _t=null,n}function Ft(t,i){if(t.nodeType===i.nodeType)if(1===t.nodeType){if(e=i,(o=Xt(r=t)&&Xt(e))&&_t.push(r,e),o||Ht(r)===Ht(e)||r.isEqualNode(e))return;if(zt(t,i),t.nodeName===i.nodeName)!function(t,i){var n,r,e,o,a;for(n=t.length;n--;)o=(r=t[n]).namespaceURI,a=r.localName,(e=i.getNamedItemNS(o,a))||t.removeNamedItemNS(o,a);for(n=i.length;n--;)o=(r=i[n]).namespaceURI,a=r.localName,(e=t.getNamedItemNS(o,a))?e.value!==r.value&&(e.value=r.value):(i.removeNamedItemNS(o,a),t.setNamedItemNS(r))}(t.attributes,i.attributes);else{for(var n=i.cloneNode();t.firstChild;)n.appendChild(t.firstChild);t.parentNode.replaceChild(n,t)}}else t.nodeValue!==i.nodeValue&&(t.nodeValue=i.nodeValue);else t.parentNode.replaceChild(i,Dt(t)),Jt(i);var r,e,o}function zt(t,i){for(var n,r,e,o,a,s,u=t.firstChild,l=i.firstChild,f=0;u;)f++,r=Gt(n=u),u=u.nextSibling,r&&(s||(s={}),s[r]=n);for(u=t.firstChild;l;)f--,e=l,l=l.nextSibling,s&&(o=Gt(e))&&(a=s[o])?(delete s[o],a!==u?t.insertBefore(a,u):u=u.nextSibling,Ft(a,e)):u?(n=u,u=u.nextSibling,Gt(n)?(t.insertBefore(e,n),Jt(e)):Ft(n,e)):(t.appendChild(e),Jt(e));for(r in s)f--,t.removeChild(Dt(s[r]));for(;--f>=0;)t.removeChild(Dt(t.lastChild))}function Gt(t){if(1===t.nodeType){var i=t.getAttribute(Ct.KEY)||t.id;return i?"_set-dom-"+i:void 0}}function Ht(t){return t.getAttribute(Ct.CHECKSUM)||NaN}function Xt(t){return null!=t.getAttribute(Ct.IGNORE)}function Jt(t){return qt(t,"mount")}function Dt(t){return qt(t,"dismount")}function qt(t,i){if(Gt(t)){var n=document.createEvent("Event"),r={value:t};n.initEvent(i,!1,!1),Object.defineProperty(n,"target",r),Object.defineProperty(n,"srcElement",r),t.dispatchEvent(n)}for(var e=t.firstChild;e;)e=qt(e,i).nextSibling;return t}function Bt(t){var i=t.ownerDocument||t;return Lt&&Lt.ownerDocument===i||(Lt=i.createElement("div")),$t}function $t(t){return function(t,i){if(g(1===i.length),g(Array.isArray(i)||p(i,"raw")),self.trustedTypes&&self.trustedTypes.createPolicy){var n=self.trustedTypes.createPolicy("static-template#createNode",{createHTML:function(t){return i[0]}});t.innerHTML=n.createHTML("ignored")}else t.innerHTML=i[0];var r=t.firstElementChild;return g(r),g(!r.nextElementSibling),t.removeChild(r),r}(Lt,t)}var Vt=[''],Yt=[""],Wt=['Unable to Load More
'],Zt=function(){function t(t){this.aJ=t,this.sJ=null,this.uJ=null,this.lJ=null,this.fJ=null,this.hJ=null,this.cJ=null}var i=t.prototype;return i.initializeLoadMore=function(){this.mJ(),this.dJ(),this.vJ(),this.pJ()},i.mJ=function(){this.sJ=R(this.aJ,"load-more-button"),this.sJ?this.sJ.classList.add("amp-visible"):this.sJ=Bt(this.aJ)(Vt),this.aJ.appendChild(this.sJ),M(this.sJ,{visibility:"hidden"})},i.dJ=function(){this.lJ=R(this.aJ,"load-more-loading"),this.lJ||(this.lJ=Bt(this.aJ)(Yt)),this.aJ.appendChild(this.lJ)},i.getLoadMoreButton=function(){return this.sJ||this.mJ(),this.sJ},i.getLoadMoreLoadingElement=function(){return this.lJ||this.dJ(),this.lJ},i.getLoadMoreButtonClickable=function(){if(!this.uJ){var t=this.getLoadMoreButton();this.uJ=R(t,"load-more-clickable")||t}return this.uJ},i.vJ=function(){this.fJ=R(this.aJ,"load-more-failed"),this.fJ||(this.fJ=Bt(this.aJ)(Wt)),this.aJ.appendChild(this.fJ)},i.getLoadMoreFailedElement=function(){return this.fJ||this.vJ(),this.fJ},i.getLoadMoreFailedClickable=function(){if(!this.hJ){var t=this.getLoadMoreFailedElement();this.hJ=R(t,"load-more-clickable")||t}return this.hJ},i.pJ=function(){this.cJ||(this.cJ=R(this.aJ,"load-more-end"),this.cJ&&this.aJ.appendChild(this.cJ))},i.getLoadMoreEndElement=function(){return this.cJ},i.setLoadMoreEnded=function(){this.getLoadMoreFailedElement().classList.toggle("amp-visible",!1),this.getLoadMoreButton().classList.toggle("amp-visible",!1),this.getLoadMoreLoadingElement().classList.toggle("amp-visible",!1);var t=this.getLoadMoreEndElement();t&&t.classList.toggle("amp-visible",!0)},i.toggleLoadMoreLoading=function(t){t&&this.getLoadMoreFailedElement().classList.toggle("amp-visible",!1);var i=this.getLoadMoreEndElement();i&&i.classList.toggle("amp-visible",!1),this.getLoadMoreButton().classList.toggle("amp-visible",!t),this.getLoadMoreLoadingElement().classList.toggle("amp-visible",t)},i.setLoadMoreFailed=function(){var t=this.getLoadMoreFailedElement(),i=this.getLoadMoreButton();(t||i)&&(t.classList.toggle("amp-visible",!0),i.classList.toggle("amp-visible",!1),this.getLoadMoreLoadingElement().classList.toggle("amp-visible",!1))},i.hideAllLoadMoreElements=function(){this.getLoadMoreButton().classList.toggle("amp-visible",!1),this.getLoadMoreLoadingElement().classList.toggle("amp-visible",!1),this.getLoadMoreFailedElement().classList.toggle("amp-visible",!1),this.getLoadMoreEndElement()&&this.getLoadMoreEndElement().classList.toggle("amp-visible",!1)},t}();function Kt(t,i){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.expr,e=void 0===r?".":r,o=n.refresh,a=void 0!==o&&o,s=n.url,u=void 0===s?i.getAttribute("src"):s,l=n.urlReplacement,f=void 0===l?0:l,h=n.xssiPrefix,c=void 0===h?void 0:h;wt(u,i);var m=ht(t.win);return Qt(i,u,f,a).then((function(t){return m.fetchJson(t.xhrUrl,t.fetchOpt)})).then((function(i){return mt(t.win).xssiJson(i,c)})).then((function(t){if(null==t)throw new Error("Response is undefined.");return b(t,e||".")})).catch((function(t){throw q().createError("failed fetching JSON data",t)}))}function Qt(t,i,n,r){var e=function(t){return K(t,"url-replace")}(t);return(n>=1?e.expandUrlAsync(i):Promise.resolve(i)).then((function(i){if(1===n){var o=e.collectDisallowedVarsSync(t);if(o.length>0)throw q().createError("URL variable substitutions in CORS fetches from dynamic URLs (e.g. via amp-bind) require opt-in. "+'Please add data-amp-replace="'.concat(o.join(" "),'" to the ')+"<".concat(t.tagName,"> element. See https://bit.ly/amp-var-subs."))}var a={};return t.hasAttribute("credentials")&&(a.credentials=t.getAttribute("credentials")),r&&(a.cache="reload"),{"xhrUrl":i,"fetchOpt":a}}))}var ti=function(){function t(t,i,n){var r=this;this.Xo=nt(t,"timer"),this.Jo=i,this.Qo=n||0,this.Zo=-1,this.rs=0,this.es=!1,this.us=function(){r.os()}}var i=t.prototype;return i.isPending=function(){return-1!=this.Zo},i.schedule=function(t){var i=t||this.Qo;this.es&&i<10&&(i=10);var n=Date.now()+i;return(!this.isPending()||n-this.rs<-10)&&(this.cancel(),this.rs=n,this.Zo=this.Xo.delay(this.us,i),!0)},i.os=function(){this.Zo=-1,this.rs=0,this.es=!0,this.Jo(),this.es=!1},i.cancel=function(){this.isPending()&&(this.Xo.cancel(this.Zo),this.Zo=-1)},t}(),ii=function(){function t(t,i,n){this.yh=i,this.Kj=n,this.bJ=t}var i=t.prototype;return i.isEnabled=function(){var t=this.yh.getAmpDoc();return!(!t.isSingleDoc()||!t.getRootNode().documentElement.hasAttribute("allow-viewer-render-template"))&&this.yh.hasCapability("viewerRenderTemplate")},i.assertTrustedViewer=function(t){return this.yh.isTrustedViewer().then((function(i){Y(i,"Refused to attempt SSR in untrusted viewer: ",t)}))},i.ssr=function(t,i){var n,r=this,e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return e||(n=this.Kj.maybeFindTemplate(t)),this.assertTrustedViewer(t).then((function(){return r.yh.sendMessageAwaitResponse("viewerRenderTemplate",r.gJ(i,n,e,o))}))},i.applySsrOrCsrTemplate=function(t,i){var n,r=this;return this.isEnabled()?(Y("string"==typeof i.html,"Skipping template rendering due to failed fetch"),n=this.assertTrustedViewer(t).then((function(){return r.Kj.findAndSetHtmlForTemplate(t,i.html)}))):n=h(i)?this.Kj.findAndRenderTemplateArray(t,i):this.Kj.findAndRenderTemplate(t,i),n},i.gJ=function(t,i,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},e={"type":this.bJ},o="successTemplate",a=n&&n[o]?n[o]:i;a&&(e[o]={"type":"amp-mustache","payload":a.innerHTML});var s="errorTemplate",u=n&&n[s]?n[s]:null;u&&(e[s]={"type":"amp-mustache","payload":u.innerHTML}),r&&Object.assign(e,r);var l={"originalRequest":Nt(t.xhrUrl,t.fetchOpt),"ampComponent":e};return l},t}(),ni="amp-list",ri="amp-state:",ei=function(t){!function(t,i){if("function"!=typeof i&&null!==i)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(i&&i.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),i&&s(t,i)}(m,t);var i,r,c=(i=m,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,n=u(i);if(r){var e=u(this).constructor;t=Reflect.construct(n,arguments,e)}else t=n.apply(this,arguments);return l(this,t)});function m(t){var i;return(i=c.call(this,t)).pg=null,i.Th=null,i.yJ=!1,i.wJ=new ti(i.win,(function(){return i.xJ()})),i.OJ=null,i.jJ=null,i.Kj=null,i.SJ=!1,i.RJ=!1,i.EJ=null,i.kJ=null,i.IJ=null,i.TJ=!1,i.PJ=null,i.UJ=null,i.AJ=!1,i.NJ=null,i.registerAction("refresh",(function(){if(i.SJ)return i.LJ(),i.MJ({refresh:!0})})),i.registerAction("changeToLayoutContainer",(function(){return i._J()})),i.CJ=null,i.Es=null,i.MH=null,i}var d=m.prototype;return d.isLayoutSupported=function(t){if(t===T.CONTAINER){var i=this.element.ownerDocument,r=i&&function(t){return function(t,i){var n=i.documentElement;return["⚡4email","amp4email"].some((function(t){return n.hasAttribute(t)}))}(0,t)}(i),e=this.getPlaceholder()||this.element.hasAttribute("diffable");return r?(e||q().warn(ni,"amp-list[layout=container] should have a placeholder to establish an initial size. See https://go.amp.dev/c/amp-list/#placeholder-and-fallback. %s",this.element),this.RJ=!0):(Y(("amp-list-layout-container",o=function(t){var i,r,e,o,a;if(t[at])return t[at];t[at]=v();var s=t[at];g(s);var u,l=z(z({},null!==(i=t.AMP_CONFIG)&&void 0!==i?i:{}),null!==(r=t.AMP_EXP)&&void 0!==r?r:(u=(null===(e=t.__AMP_EXP)||void 0===e?void 0:e.textContent)||"{}",JSON.parse(u)));for(var f in l){var c=l[f];"number"==typeof c&&c>=0&&c<=1&&(s[f]=Math.random() div":"> div[role=list]";return t+=":not([placeholder]):not([fallback]):not([fetch-error])",S(this.element,t)},d.XJ=function(){var t=this;return this.mutateElement((function(){t.JJ().initializeLoadMore();var i=t.getOverflowElement();i&&_(i,!1),t.element.warnOnMissingOverflow=!1})).then((function(){t.DJ(),Tt(t.JJ().getLoadMoreFailedClickable(),"click",(function(){return t.qJ(!0,!0)})),Tt(t.JJ().getLoadMoreButtonClickable(),"click",(function(){return t.qJ(!1,!0)}))}))},d.HJ=function(){if(!this.TJ)return this.GJ(this.pg);this.BJ(this.pg)},d.JJ=function(){return this.PJ||(this.PJ=new Zt(this.element)),this.PJ},d.DJ=function(){var t,i,n=this;return this.measureMutateElement((function(){t=n.JJ().getLoadMoreButton().offsetHeight,i=n.element.offsetHeight}),(function(){var r;M(n.pg,{"max-height":"calc(100% - ".concat((r=t,"".concat(r,"px")),")")}),n.element.applySize(i+t)}))},d.$J=function(t){return t.startsWith(ri)},d.VJ=function(t){var i=this;return ct(this.element).then((function(n){Y(n,'"amp-state:" URLs require amp-bind to be installed.'),Y(!i.CJ.isEnabled(),'[amp-list]: "amp-state" URIs cannot be used in SSR mode.');var r=t.slice(ri.length);return n.getStateAsync(r).catch((function(t){var i=r.split(".")[0];throw q().error(ni,"'amp-state' element with id '".concat(i,"' was not found.")),t}))})).then((function(i){return Y(void 0!==i,"[amp-list] No data was found at provided uri: ".concat(t)),i}))},d.YJ=function(t){var i=this;return e().then((function(){return Y(!i.CJ.isEnabled(),'[amp-list]: "amp-script" URIs cannot be used in SSR mode.'),(n=i.element,ut(n,"amp-script","amp-script")).then((function(i){return i.fetch(t)}));var n})).then((function(i){return Y("object"===a(i),"[amp-list] ".concat(t," must return json, but instead returned: ").concat(a(i))),i}))},d.mutatedAttributesCallback=function(t){var i=this;$().info(ni,"mutate:",this.element,t);var n=t.src;void 0!==n&&("string"==typeof n?this.SJ&&(this.LJ(),this.MJ()):"object"===a(n)?function(t){i.element.setAttribute("src",""),Y(!i.CJ.isEnabled(),'[amp-list] "[src]" may not be bound in SSR mode.');var n=h(t)?t:[t];i.LJ(!1),i.Kz(n,!1)}(n):this.user().error(ni,'Unexpected "src" type: '+n)),t["is-layout-container"]&&this._J()},d.zJ=function(){var t,i=this.win.document.createElement("div");return this.WJ(i,"list"),this.TJ||this.RJ||((t=i).classList.add("i-amphtml-fill-content"),t.classList.add("i-amphtml-replaced-content")),i},d.ZJ=function(t,i){var n=this;t.forEach((function(t){t.hasAttribute("role")||n.WJ(t,"listitem"),i.appendChild(t)}))},d.WJ=function(t,i){this.element.hasAttribute("single-item")||t.setAttribute("role",i)},d.KJ=function(t){(t||this.yJ)&&(this.toggleFallback(t),this.yJ=t)},d.LJ=function(){var t=this,i=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(i&&this.element.hasAttribute("reset-on-refresh")||"always"===this.element.getAttribute("reset-on-refresh")){var n=function(){t.togglePlaceholder(!0);var i=t.element.hasAttribute("reset-on-refresh");if(t.toggleLoading(!0,i),t.KJ(!1),t.IJ){var n=f(t.pg.children);t.IJ.rescan([],n,{"fast":!0,"update":!1})}t.MH.scheduleUnlayout(t.element,t.pg),E(t.pg)};if(!this.TJ&&this.RJ)return void this.QJ(n);this.mutateElement((function(){n(),t.TJ&&t.JJ().hideAllLoadMoreElements()}))}},d.I$=function(t){var i=this.element.getAttribute("items")||"items",n=t;return"."!=i&&(n=b(t,i)),Y(void 0!==n,'Response must contain an array or object at "%s". %s',i,this.element),this.element.hasAttribute("single-item")&&(h(n)?q().warn(ni,'Expected response to contain a non-array Object due to "single-item" attribute.',this.element):n=[n]),n=q().assertArray(n),this.element.hasAttribute("max-items")&&(n=this.T$(n)),n},d.U$=function(t){var i=t?It(this.win,"".concat(ni,".error"),{"response":t.response}):null;this.Es.trigger(this.element,"fetch-error",i,1)},d.MJ=function(){var t=this,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=i.append,r=void 0!==n&&n,o=i.refresh,a=void 0!==o&&o,s=this.element.getAttribute("src");return s?(this.CJ.isEnabled()?this.N$(a):(this.$J(s)?this.VJ(s):xt(s)?this.YJ(s):this.L$(a)).then((function(i){if(s===t.element.getAttribute("src")){var n=t.I$(i);return t.TJ&&t.C$(i),t.Kz(n,r,i).then((function(){return t.F$()}))}}))).catch((function(i){if(r)throw i;throw t.U$(i),t.z$(),i})):e()},d.T$=function(t){var i=parseInt(this.element.getAttribute("max-items"),10);return i=300)throw q().createError("Failed fetching JSON data (".concat(n.G$(i),")")+": HTTP error",e)}return Y("string"==typeof t.html,"Failed fetching JSON data: XHR Failed fetching "+"(".concat(n.G$(i),"): Expected response with ")+"format {html: }. Received: ",t),i.fetchOpt.responseType="application/json",t}),(function(t){throw q().createError("Failed fetching JSON data: XHR Failed fetching "+"(".concat(n.G$(i),")"),t)})).then((function(t){if(r===n.element.getAttribute("src"))return n.Kz(t,!1)}))},d.G$=function(t){var i,n=(i=this.element,K(i,"url")).parse(t.xhrUrl);return"".concat(n.origin,"/...")},d.Kz=function(t,i,n){var r=new o,e=r.promise,a=r.reject,s=r.resolve;return this.OJ||this.wJ.schedule(),this.OJ={data:t,resolver:s,rejecter:a,append:i,payload:n},this.jJ&&i&&(this.OJ.payload=n||{}),e},d.xJ=function(){var t=this,i=this.OJ;q().fine(ni,"Rendering list",this.element,"with data",i.data),V(i&&i.data);var n=function(){t.OJ!==i?t.wJ.schedule(1):(t.jJ=t.OJ.data,t.OJ=null)},r=this.CJ.isEnabled(),e=this.CJ.applySsrOrCsrTemplate(this.element,i.data).then((function(n){return t.H$(n,i.append)})).then((function(n){return t.Di(n,i.append)}));if(!r){var o=i.payload;e=e.then((function(){return t.J$(o)}))}e.then((function(){n(),i.resolver()}),(function(){n(),i.rejecter()}))},d.J$=function(t){if(this.TJ){var i=[];return i.push(this.q$(this.JJ().getLoadMoreButton(),t)),i.push(this.q$(this.JJ().getLoadMoreEndElement(),t)),Promise.all(i)}return e()},d.q$=function(t,i){var n=this;return t&&this.Kj.hasTemplate(t)?this.Kj.findAndRenderTemplate(t,i).then((function(i){return n.mutateElement((function(){E(t),t.appendChild(i)}))})):e()},d.H$=function(t,i){var n=this,r=h(t)?t:[t],e=this.element.getAttribute("binding");if("no"===e)return Promise.resolve(r);if(!r.some((function(t){return t.hasAttribute("i-amphtml-binding")||!!t.querySelector("[i-amphtml-binding]")})))return Promise.resolve(r);e||q().warn(ni,'Missing "binding" attribute. Using binding="refresh" is recommended for performance.');var o=function(t){var e=i?[]:[n.pg];return t.rescan(r,e,{"fast":!0,"update":!0}).then((function(){return r}),(function(){return r}))};return e&&e.startsWith("refresh")?this.IJ&&this.IJ.signals().get("FIRST_MUTATE")?o(this.IJ):(this.element.hasAttribute("diffable")||this.B$(r,[]),Promise.resolve(r)):ct(this.element).then((function(t){return t?o(t):Promise.resolve(r)}))},d.B$=function(t,i){var n=this.element.getAttribute("binding");n&&n.startsWith("refresh")&&ct(this.element).then((function(r){if(r){var e="refresh-evaluate"==n&&"evaluate";r.rescan(t,i,{"fast":!0,"update":e})}}))},d.Di=function(t){var i=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=this.pg,e=function(){i.$$(),i.element.hasAttribute("diffable")?(i.V$(r,t),i.B$([r],[r])):(n||(i.MH.scheduleUnlayout(i.element,r),E(r)),i.ZJ(t,r)),i.element.closest("amp-story-page-attachment")&&i.pg.querySelectorAll("amp-img").forEach((function(t){t.getImpl().then((function(t){return t.layoutCallback()}))}));var e=It(i.win,w,null,{bubbles:!0});return i.pg.dispatchEvent(e),i.element.getResources().getResourceForElement(i.element).resetPendingChangeSize(),i.HJ()};return!this.TJ&&this.RJ?this.QJ((function(){(e()||Promise.resolve(!0)).then((function(t){return t?i.Y$():null}))})):this.mutateElement(e)},d.V$=function(t,i){var n=this.zJ();this.ZJ(i,n),this.kJ&&this.W$(t);for(var r=Ct(t,n),e=0;ei.element.offsetHeight)||i.attemptChangeHeight(n).then((function(){return!0}),(function(){return!1}))})):Promise.resolve(!0)},d.BJ=function(t){var i=this.UJ?this.JJ().getLoadMoreButton():this.JJ().getLoadMoreEndElement();this.K$(i,t)},d.K$=function(t,i){var n=this;this.element.getAttribute("layout")!=T.CONTAINER&&this.measureElement((function(){var r=i.scrollHeight,e=n.element.offsetHeight,o=t?t.offsetHeight:0;r+o>e&&n.attemptChangeHeight(r+o).then((function(){n.AJ=!1,"auto"===n.element.getAttribute("load-more")&&n.Q$(),M(n.pg,{"max-height":""})})).catch((function(){n.AJ=!0,n.DJ()}))}))},d.dZ=function(t){var i=function(t){if("nodisplay"===(i=t)||"fixed"===i||"fixed-height"===i||"responsive"===i||"container"===i||"fill"===i||"flex-item"===i||"fluid"===i||"intrinsic"===i)return t;var i}(t),n=function(t){return"i-amphtml-layout-"+t}(V(i));this.element.classList.remove(n,"i-amphtml-layout-size-defined"),[T.FIXED,T.FLEX_ITEM,T.FLUID,T.INTRINSIC,T.RESPONSIVE].includes(i)?M(this.element,{width:"",height:""}):i==T.FIXED_HEIGHT&&M(this.element,{height:""}),this.element.applySize()},d._J=function(){var t=this;if(this.RJ)return q().warn(ni,"[is-layout-container] and changeToLayoutContainer are ineffective when an amp-list initially sets layout=container",this.element),e();var i=this.element.getAttribute("i-amphtml-layout");return i==T.CONTAINER?e():this.mutateElement((function(){t.dZ(i),t.pg.classList.remove("i-amphtml-fill-content","i-amphtml-replaced-content");var n=t.getOverflowElement();n&&_(n,!1),t.element.setAttribute("layout","container"),t.element.setAttribute("i-amphtml-layout","container"),t.element.classList.add("i-amphtml-layout-container")}))},d.F$=function(){return this.TJ?this.pZ():e()},d.pZ=function(){var t=this;return this.UJ?("auto"===this.element.getAttribute("load-more")&&this.bZ(),this.mutateElement((function(){t.JJ().toggleLoadMoreLoading(!1),M(t.JJ().getLoadMoreButton(),{visibility:""})}))):this.mutateElement((function(){return t.JJ().setLoadMoreEnded()}))},d.qJ=function(){var t=this,i=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this.UJ)this.element.setAttribute("src",this.UJ),this.UJ=null;else if(!i)return e();var r=this.pg,o=this.gZ(r);return this.mutateElement((function(){t.JJ().toggleLoadMoreLoading(!0)})),this.MJ({append:!0}).then((function(){return t.mutateElement((function(){t.UJ?(t.JJ().toggleLoadMoreLoading(!1),o&&n&&k(o)):t.JJ().setLoadMoreEnded()}))})).then((function(){t.BJ(t.pg)})).catch((function(i){t.U$(i),t.yZ()}))},d.yZ=function(){var t=this;this.mutateElement((function(){return t.JJ().setLoadMoreFailed()})).then((function(){t.K$(t.JJ().getLoadMoreFailedElement(),t.pg)}))},d.Cs=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return Kt(this.getAmpDoc(),this.element,{expr:".",urlReplacement:this.mL(),refresh:t,xssiPrefix:this.element.getAttribute("xssi-prefix")||void 0})},d.bZ=function(){var t=this;this.NJ||(this.NJ=this.Th.onChanged((function(){return t.Q$()})))},d.Q$=function(){var t=this;if(!this.AJ){var i=this.pg.lastChild||this.pg;this.Th.getClientRectAsync(i).then((function(i){var n=t.Th.getHeight();if(i.bottom>0&&3*n>i.bottom)return t.qJ()}))}},d.L$=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this.Cs(t)},d.mL=function(){var t=this.element.getAttribute("src"),i=1;return t!=this.EJ&&Ot(t)!=Ot(this.getAmpDoc().win.location)||(i=2),i},d.$$=function(){this.element.classList.remove("i-amphtml-list-fetch-error"),this.toggleLoading(!1),this.getFallback()&&this.KJ(!1),this.togglePlaceholder(!1)},d.z$=function(){this.element.classList.add("i-amphtml-list-fetch-error"),R(this.element,"fetch-error")&&this.GJ(this.element),this.toggleLoading(!1),this.getFallback()&&(this.KJ(!0),this.togglePlaceholder(!1))},d.gZ=function(t){var i,n,r=(n='button, a[href], input, select, textarea, [tabindex]:not([tabindex="-1"]), audio[controls], video[controls], [contenteditable]:not([contenteditable="false"])',x(i=t)?i.querySelectorAll(O(n,":scope")):j(i,n));return r?r[r.length-1]:null},m}(t.BaseElement);t.registerElement(ni,ei,'amp-list.i-amphtml-list-fetch-error [fetch-error],amp-list[load-more] [load-more-button].amp-visible,amp-list[load-more] [load-more-end].amp-visible,amp-list[load-more] [load-more-failed].amp-visible,amp-list[load-more] [load-more-loading].amp-visible{display:block}amp-list[load-more] [load-more-button].i-amphtml-default-ui,amp-list[load-more] [load-more-failed].i-amphtml-default-ui,amp-list[load-more] [load-more-loading].i-amphtml-default-ui{height:80px;padding:12px 0px;box-sizing:border-box}.i-amphtml-list-load-more-button,amp-list[load-more] [load-more-button].i-amphtml-default-ui,amp-list[load-more] [load-more-failed].i-amphtml-default-ui,amp-list[load-more] [load-more-loading].i-amphtml-default-ui{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-weight:700;font-size:14px;text-transform:uppercase;letter-spacing:.1em;color:#333;text-align:center}amp-list[load-more] [load-more-loading].i-amphtml-default-ui .i-amphtml-list-load-more-spinner{display:inline-block;width:40px;height:40px;margin:8px 0px;background-image:url(\'data:image/svg+xml;charset=utf-8,\');animation:amp-list-load-more-spinner 1000ms linear infinite}@keyframes amp-list-load-more-spinner{0%{transform:rotate(0deg)}to{transform:rotate(360deg)}}.i-amphtml-list-load-more-button{border:none;display:inline-block;background-color:rgba(51,51,51,.75);color:#fff;margin:4px 0px;padding:0px 32px;box-sizing:border-box;height:48px;border-radius:24px}[load-more] div[role=list]{overflow-y:hidden}.i-amphtml-list-load-more-button,.i-amphtml-list-load-more-button label,.i-amphtml-list-load-more-icon{cursor:pointer}.i-amphtml-list-load-more-button:hover{background-color:#333}.i-amphtml-list-load-more-button.i-amphtml-list-load-more-button-small{margin:0px;padding:4px 16px;height:32px}.i-amphtml-list-load-more-button label{display:inline-block;vertical-align:middle;line-height:24px}amp-list[load-more] [load-more-failed].i-amphtml-default-ui .i-amphtml-list-load-more-message{line-height:24px}amp-list[load-more] [load-more-failed].i-amphtml-default-ui .i-amphtml-list-load-more-icon{height:24px;width:24px;display:inline-block;vertical-align:middle;background-image:url(\'data:image/svg+xml;charset=utf-8,\')}\n/*# sourceURL=/extensions/amp-list/0.1/amp-list.css*/')}();
/*! https://mths.be/cssescape v1.5.1 by @mathias | MIT license */}});
//# sourceMappingURL=amp-list-0.1.js.map