amp-base-carousel-0.1.js 33.0 KB
;
(self.AMP=self.AMP||[]).push({m:0,v:"2402231941000",n:"amp-base-carousel",ev:"0.1",l:!0,f:function(t,i){!function(){var i;function n(t,i){return(n=Object.setPrototypeOf||function(t,i){return t.__proto__=i,t})(t,i)}function s(t){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,i){if(i&&("object"===r(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 e(t){return t?Array.prototype.slice.call(t):[]}Array.isArray;var a,h=Object.prototype,u=h.hasOwnProperty;function l(t,i,n,s,r,o,e,a,h,u,l){return t}function c(t,i){return t.replace(/^|,/g,"$&".concat(i," "))}h.toString;var f,m=!0,v=!0;function p(t,i){for(var n=t.length,s=0;s<n;s++)i(t[s],s)}function d(t,i,n){var s=t.hasAttribute(i),r=void 0!==n?n:!s;return r!==s&&(r?t.setAttribute(i,""):t.removeAttribute(i)),r}function b(t){var i=t.ownerDocument||t;return f&&f.ownerDocument===i||(f=i.createElement("div")),w}function w(t){return function(t,i){if(l(1===i.length),l(Array.isArray(i)||(s=i,u.call(s,"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 s,r=t.firstElementChild;return l(r),l(!r.nextElementSibling),t.removeChild(r),r}(f,t)}function x(t,i,n){var s=0,r=0,o=null;function e(){s=0;var a,h=n-(t.Date.now()-r);h>0?s=t.setTimeout(e,h):(a=o,o=null,i.apply(null,a))}return function(){r=t.Date.now();for(var i=arguments.length,a=new Array(i),h=0;h<i;h++)a[h]=arguments[h];o=a,s||(s=t.setTimeout(e,n))}}self.__AMP_LOG=self.__AMP_LOG||{user:null,dev:null,userForEmbed:null};var g=self.__AMP_LOG;function y(t,i,n,s,r,o,e,a,h,u,l){return t}function k(t,i){return z(t=function(t){return t.__AMP_TOP||(t.__AMP_TOP=t)}(t),i)}function M(t){return t.nodeType?(n=t,i=(n.ownerDocument||n).defaultView,k(i,"ampdoc")).getAmpDoc(t):t;var i,n}function S(t){var i=M(t);return i.isSingleDoc()?i.win:i}function z(t,i){y(N(t,i));var n=function(t){var i=t.__AMP_SERVICES;return i||(i=t.__AMP_SERVICES={}),i}(t)[i];return n.obj||(y(n.ctor),y(n.context),n.obj=new n.ctor(n.context),y(n.obj),n.context=null,n.resolve&&n.resolve(n.obj)),n.obj}function N(t,i){var n=t.__AMP_SERVICES&&t.__AMP_SERVICES[i];return!(!n||!n.ctor)}var j,E=function(t){return function(t,i){return z(S(M(t)),"owners")}(t)};function O(t,i,n,s){var r=t,o=n,e=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}},a=function(){if(void 0!==j)return j;j=!1;try{var t={get capture(){return j=!0,!1}};self.addEventListener("test-options",null,t),self.removeEventListener("test-options",null,t)}catch(t){}return j}(),h=!(null==s||!s.capture);return r.addEventListener(i,e,a?s:h),function(){null==r||r.removeEventListener(i,e,a?s:h),o=null,r=null,e=null}}function R(t,i,n,s){var r={detail:n};if(Object.assign(r,s),"function"==typeof t.CustomEvent)return new t.CustomEvent(i,r);var o=t.document.createEvent("CustomEvent");return o.initCustomEvent(i,!!r.bubbles,!!r.cancelable,n),o}function A(t,i,n,s){return O(t,i,n,s)}function L(t){return t.detail}function C(t,i,n,s){var r=n,o=O(t,i,(function(t){try{r(t)}finally{r=null,o()}}),s);return o}var I,_=["Webkit","webkit","Moz","moz","ms","O","o"];function P(t){var i=t.replace(/[A-Z]/g,(function(t){return"-"+t.toLowerCase()}));return _.some((function(t){return i.startsWith(t+"-")}))?"-".concat(i):i}function B(t,i,n){if(U(i))return i;I||(I=Object.create(null));var s=I[i];if(!s||n){if(s=i,void 0===t[i]){var r=function(t){return t.charAt(0).toUpperCase()+t.slice(1)}(i),o=function(t,i){for(var n=0;n<_.length;n++){var s=_[n]+i;if(void 0!==t[s])return s}return""}(t,r);void 0!==t[o]&&(s=o)}n||(I[i]=s)}return s}function T(t,i){var n=t.style;for(var s in i)n.setProperty(P(B(n,s)),String(i[s]),"important")}function W(t,i,n,s,r){var o=B(t.style,i,r);if(o){var e=s?n+s:n;t.style.setProperty(P(o),e)}}function U(t){return t.startsWith("--")}function Z(t,i){return t>0&&i>0?t%i:(t%i+i)%i}function H(t,i,n){return l(i<=n),Math.min(Math.max(t,i),n)}var V="amp-carousel:indexchange",$="amp-carousel:scrollstart",D="amp-carousel:scrollpositionchange",F=function(){function t(t){var i=this,n=t.advanceable,s=t.element,r=t.scrollContainer,o=t.win;this.t=o,this.h9=r,this.f9=n,this.m9=0,this.p9=!1,this.v9=1,this.d9=1e3,this.g9=!1,this.y9=!1,this.b9=null,this.x9=Number.POSITIVE_INFINITY,this.Ki=s.getAmpDoc(),this.w9(this.d9),this.h9.addEventListener("scroll",(function(){return i.k9()}),!0),A(this.h9,"touchstart",(function(){return i.j9()}),{capture:!0,passive:!0}),A(s,V,(function(t){i.M9(t)}))}var i=t.prototype;return i.stop=function(){this.y9=!0},i.pause=function(){this.g9=!0},i.resume=function(){this.g9=!1,this.O9()},i.updateAutoAdvance=function(t){this.p9=t,this.O9()},i.updateAutoAdvanceCount=function(t){this.v9=t,this.O9()},i.updateAutoAdvanceInterval=function(t){this.d9=Math.max(t,1e3),this.w9(this.d9),this.O9()},i.updateMaxAdvances=function(t){this.x9=t},i.w9=function(t){var i=this,n=x(this.t,(function(){n==i.b9&&i.S9()}),t);this.b9=n},i.j9=function(){var t=this;this.pause(),C(window,"touchend",(function(){t.resume()}),{capture:!0,passive:!0})},i.N9=function(){return this.p9&&this.Ki.isVisible()&&!this.g9&&!this.y9&&this.m9<this.x9},i.k9=function(){this.O9()},i.M9=function(t){var i=L(t).actionSource;i&&4!==i&&this.stop()},i.S9=function(){this.N9()&&(this.f9.advance(this.v9,{actionSource:4,allowWrap:!0}),this.m9+=this.v9)},i.O9=function(){this.N9()&&this.b9()},t}(),Q=function(){function t(t){var i=this,n=t.element,s=t.runMutate,r=t.scrollContainer,o=t.stoppable,e=t.win;this.t=e,this.h9=r,this.E9=s,this.z9=[],this.A9=1,this.I9=!1,this.R9=!1,this.es=0,n.addEventListener("focus",(function(){o.stop()}),!0),n.addEventListener(V,(function(t){i._9(t)}))}var i=t.prototype;return i.updateMixedLength=function(t){this.I9=t},i.updateUi=function(){var t=this;this.R9||(this.R9=!0,this.E9((function(){t.R9=!1,t.C9(),t.T9()})))},i.updateSlides=function(t){this.z9=t,this.updateUi()},i.updateVisibleCount=function(t){this.A9=t,this.updateUi()},i.P9=function(){return this.I9||this.A9>=2},i.C9=function(){this.P9()?(this.h9.removeAttribute("aria-live"),this.h9.setAttribute("role","list"),this.z9.forEach((function(t){t.setAttribute("role","listitem")}))):(this.h9.setAttribute("aria-live","polite"),this.h9.removeAttribute("role"),this.z9.forEach((function(t){t.removeAttribute("role")})))},i.T9=function(){var t=this;this.z9.forEach((function(i,n){var s=!t.P9()&&n!==t.es;i.setAttribute("aria-hidden",s)}))},i._9=function(t){var i=this,n=L(t).index;this.es=n,this.E9((function(){i.T9()}))},t}(),X="start";function q(t,i){var n=i.getBoundingClientRect(),s=n.bottom,r=n.height,o=n.left,e=n.right,a=n.top,h=n.width;return{start:0==t?o:a,end:0==t?e:s,length:0==t?h:r}}function G(t,i){var n=q(t,i),s=n.end;return(n.start+s)/2}function J(t,i){return q(t,i).start}function K(t,i,n){return i==X?J(t,n):G(t,n)}function Y(t,i,n){W(i,0==t?"width":"height","".concat(n,"px"))}function tt(t,i,n){var s=q(t,i),r=s.end;return s.start<=n&&n<r}function it(t,i,n,s){return(K(t,i,s)-K(t,i,n))/q(t,s).length}function nt(t,i,n){!function(t,i,n){0==t?i.scrollLeft=n:i.scrollTop=n}(t,i,function(t,i){return 0==t?i.scrollLeft:i.scrollTop}(t,i)+n)}var st="i-amphtml-carousel-spacer";function rt(t,i){var n=function(t,i,n){var s=B(t.style,"scrollBehavior",void 0);if(s)return U(s)?t.style.getPropertyValue(s):t.style[s]}(t);W(t,"scrollBehavior","auto"),i(),W(t,"scrollBehavior",n)}function ot(t){return t.reduce((function(t,i){return t+i}),0)}var et=function(){function t(t){var i=this,n=t.element,s=t.initialIndex,r=t.runMutate,o=t.scrollContainer,e=t.win;this.t=e,this.E9=r,this.el=n,this.h9=o,this.p9=new F({win:e,element:n,scrollContainer:o,advanceable:this}),this.B9=new Q({win:e,element:n,scrollContainer:o,runMutate:r,stoppable:this.p9}),this.L9=x(e,(function(){return i.U9()}),200),this.W9=1,this.G9=Number.POSITIVE_INFINITY,this.I9=!1,this.z9=[],this.X9=!0,this.R9=!1,this.F9=[],this.H9=[],this.V9=[],this.Z9=[],this.D9=!1,this.J9=!1,this.Q9=0,this.q9=null,this.K9=NaN,this.Y9=!1,this.t7=!1,this.i7=void 0,this.n7=X,this.r7=0,this.s7=!0,this.e7=!0,this.TG=s||0,this.kd=!1,this.o7=!0,this.a7=1,this.A9=1,this.h9.addEventListener("scroll",(function(){return i.k9()}),!0),this.h9.addEventListener("scrollend",(function(){return i.l7()}),!0),A(this.h9,"touchstart",(function(){return i.j9()}),{capture:!0,passive:!0}),A(this.h9,"wheel",(function(){return i.h7()}),{capture:!0,passive:!0})}var i=t.prototype;return i.next=function(t){this.advance(this.W9,{actionSource:t})},i.prev=function(t){this.advance(-this.W9,{actionSource:t})},i.advance=function(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=this.TG,r=this.q9,o=this.z9,e=n.actionSource,a=n.allowWrap,h=void 0!==a&&a,u=null!==r?r:s,l=u+t,c=o.length-1,f=0===u,m=u===c,v=l<0,p=l>c,d=t>0&&this.u7(u)&&this.u7(l);i=this.isLooping()?Z(l,c+1):h?d?0:v&&f||p&&!m?c:v&&!f||p&&m?0:l:d?u:H(l,0,c),this.goToSlide(i,{actionSource:e})},i.pauseLayout=function(){this.D9=!0,this.p9.pause()},i.resumeLayout=function(){this.D9=!1,this.updateUi(),this.p9.resume()},i.getCurrentIndex=function(){return this.TG},i.getVisibleCount=function(){return this.A9},i.isLooping=function(){return this.kd&&this.z9.length/this.A9>=3},i.goToSlide=function(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=i.actionSource,s=i.smoothScroll,r=void 0===s||s;t<0||t>this.z9.length-1||isNaN(t)||t!==this.TG&&(this.Y9||this.c7()||(this.J9=!1,this.q9=t,this.i7=n,this.f7(this.z9[t],{smoothScroll:r})))},i.updateAdvanceCount=function(t){this.W9=t},i.updateAlignment=function(t){this.n7="start"===t?X:"center",this.updateUi()},i.updateAutoAdvance=function(t){this.p9.updateAutoAdvance(t)},i.updateAutoAdvanceCount=function(t){this.p9.updateAutoAdvanceCount(t)},i.updateAutoAdvanceInterval=function(t){this.p9.updateAutoAdvanceInterval(t)},i.updateAutoAdvanceLoops=function(t){this.G9=t,this.updateUi()},i.updateForwards=function(t){this.s7=t,this.updateUi()},i.updateHideScrollbar=function(t){this.e7=t,this.updateUi()},i.updateHorizontal=function(t){this.r7=t?0:1,this.updateUi()},i.updateLoop=function(t){this.kd=t,this.updateUi()},i.updateMixedLength=function(t){this.I9=t,this.B9.updateMixedLength(t),this.updateUi()},i.updateSlides=function(t){var i=t.length;if(i)this.z9=t,this.TG=this.isLooping()?Z(this.TG,i):H(this.TG,0,i-1)||0,this.B9.updateSlides(t),this.updateUi();else{var n=this.el.tagName.toUpperCase();(g.dev||(g.dev=function(t,i){throw new Error("failed to call initLogConstructor")}())).warn(n,"No slides were found.")}},i.updateSnap=function(t){this.o7=t,this.updateUi()},i.updateSnapBy=function(t){this.a7=Math.max(1,t),this.updateUi()},i.updateUserScrollable=function(t){this.X9=t,this.updateUi()},i.updateUi=function(){var t=this;this.R9||this.D9||(this.R9=!0,this.E9((function(){t.R9=!1,t.h9.setAttribute("mixed-length",t.I9),t.h9.setAttribute("user-scrollable",t.X9),t.h9.setAttribute("hide-scrollbar",t.e7),t.h9.setAttribute("horizontal",0===t.r7),t.h9.setAttribute("loop",t.isLooping()),t.h9.setAttribute("snap",t.o7),T(t.h9,{"--visible-count":t.A9}),t.z9.length&&(t.p9.updateMaxAdvances(t.G9*t.z9.length-1),t.m7(),t.p7(),t.v7(),t.U9(!0))})))},i.updateVisibleCount=function(t){this.A9=Math.max(1,t),this.B9.updateVisibleCount(t),this.updateUi()},i.d7=function(t,i){this.K9!==t&&(this.K9=t,this.el.dispatchEvent(R(this.t,V,{"index":t,"total":this.z9.length,"actionSource":i,"slides":this.z9},{bubbles:!0})))},i.g7=function(t,i){this.TG=t,this.Q9=i,this.el.dispatchEvent(R(this.t,"amp-carousel:offsetchange",{"index":t,"total":this.z9.length,"offset":this.s7?-i:i,"slides":this.z9},{bubbles:!0}))},i.notifyScrollStart=function(){this.el.dispatchEvent(R(this.t,$,null))},i.y7=function(){this.el.dispatchEvent(R(this.t,D,null))},i.j9=function(){var t=this;this.Y9=!0,this.i7=3,this.q9=null,this.J9=!1,C(window,"touchend",(function(){t.Y9=!1,t.L9()}),{capture:!0,passive:!0})},i.h7=function(){this.i7=2,this.q9=null,this.J9=!1},i.k9=function(){this.J9?this.J9=!1:(this.t7=!0,this.b7(),this.notifyScrollStart(),this.L9())},i.l7=function(){null===this.q9&&this.U9()},i.c7=function(){return this.t7&&(3===this.i7||2===this.i7)},i.x7=function(t,i,n){var s=i*n*(this.s7?1:-1);!function(t,i,n){var s=0==t?n:0,r=0==t?0:n;W(i,"transform","translate(".concat(s,"px, ").concat(r,"px)")),T(i,{"--content-transform":"translate(".concat(s,"px, ").concat(r,"px)")})}(this.r7,t,s),t._revolutions=i},i.w7=function(t){var i=this;this.z9.forEach((function(n){i.x7(n,0,t)}))},i.k7=function(){var t=this;return this.z9.map((function(i){return q(t.r7,i).length}))},i.isAtEnd=function(){return!this.isLooping()&&this.j7()},i.isAtStart=function(){return!this.isLooping()&&this.M7()},i.j7=function(){var t=this.h9,i=t.getBoundingClientRect().width*(this.s7?1:-1),n=this.s7?Math.ceil(i):Math.floor(i),s=t.scrollLeft+n,r=t.scrollWidth;return this.s7?s>=r:s<=-r},i.M7=function(){var t=this.h9.scrollLeft;return this.s7?t<=0:t>=0},i.O7=function(t){for(var i=[],n=0;n<t;n++){var s=document.createElement("div");s.className=st,i.push(s)}return i},i.m7=function(){var t=this,i=this.r7,n=this.z9,s=this.k7(),r=ot(s),o=this.isLooping()?n.length:0;this.F9.forEach((function(i){t.h9.removeChild(i)})),this.F9=this.O7(o),this.F9.forEach((function(r,o){Y(i,r,s[o]),t.h9.insertBefore(r,n[0])})),this.H9.forEach((function(i){t.h9.removeChild(i)})),this.H9=this.O7(o),this.H9.forEach((function(n,o){Y(i,n,s[o]),t.x7(n,-1,r),t.h9.appendChild(n)})),this.V9.forEach((function(i){t.h9.removeChild(i)})),this.V9=this.O7(o),this.V9.forEach((function(n,o){Y(i,n,s[o]),t.x7(n,-1,r),t.h9.appendChild(n)})),this.Z9=this.F9.concat(this.H9,this.V9)},i.p7=function(){var t=this,i=this.z9.length,n=this.n7===X,s=1===Z(this.A9,2),r=n||s?"0%":"50%";p(this.h9.children,(function(n,s){var o=Z(s,i),e=0===Z(o,t.a7);!n.classList.contains(st)&&t.isLooping()||function(t,i){for(var n in i)W(t,n,i[n])}(n,{"scroll-snap-align":e?t.n7:"none","scroll-snap-coordinate":e?r:"none"})}))},i.v7=function(){var t=this.V9,i=this.F9,n=this.TG,s=this.z9,r=Math.max(0,s.length-n-1),o=Math.max(0,n-1);i.forEach((function(t,o){var e,a,h,u=(e=n,a=o,h=i.length,(e===a?h:Z(e-a,h))>s.length-1);t.hidden=u||o<s.length-r})),t.forEach((function(i,r){var e,a,h,u=(e=n,a=r,h=t.length,(e===a?h:Z(a-e,h))>s.length-1);i.hidden=u||r>o}))},i.b7=function(){var t=this,i=this.n7,n=this.Z9,s=this.r7,r=this.TG,o=this.h9,e=this.z9,a=ot(this.k7()),h=!!n.length,u=h?n:e,l=function(t,i,n,s,r){var o=K(t,i,n);if(tt(t,s[r],o))return r;for(var e=1;e<=s.length/2;e++){var a=Z(r+e,s.length),h=Z(r-e,s.length);if(tt(t,s[a],o))return a;if(tt(t,s[h],o))return h}}(s,i,o,u,h?r+e.length:r);if(void 0!==l){var c=u[l],f=l%e.length,m=it(s,i,o,c);this.g7(f,m),f!==r&&this.E9((function(){t.S7(a)}))}},i.U9=function(){var t=this,i=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=this.i7;if(!this.Y9&&(this.i7=void 0,this.t7=!1,this.E9((function(){t.y7()})),this.K9!==this.TG||null!==this.q9||i)){null!==this.q9&&(this.TG=this.q9,this.q9=null,this.Q9=0);var s=ot(this.k7());this.E9((function(){t.d7(t.TG,n),t.g7(t.TG,t.Q9),t.w7(s),t.v7(),t.S7(s),t.N7()}))}},i.N7=function(){var t=this.n7,i=this.r7,n=this.Q9,s=this.TG,r=this.h9,o=this.z9[s],e=(it(i,t,r,o)-n)*q(i,o).length;e&&(this.J9=!0,rt(r,(function(){nt(i,r,e)})))},i.f7=function(t,i){var n=this;(i.smoothScroll?function(t,i){return i()}:rt)(this.h9,(function(){!function(t,i,n,s){var r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,o=i==X,e=q(t,s).length,a=o?J(t,s):G(t,s),h=o?J(t,n):G(t,n);nt(t,n,a-h-r*e)}(n.r7,n.n7,n.h9,t)}))},i.E7=function(t,i,n){for(var s=this.TG,r=this.K9,o=this.z9,e=o[s]._revolutions||0,a=n?1:-1,h=1;h<=i;h++){var u=Z(s+h*a,o.length);if(u===r&&s!==r)break;var l=o[u],c=u>s!==n?e+a:e;this.x7(l,c,t)}},i.S7=function(t){if(this.isLooping()){var i=this.n7,n=this.z9,s=this.A9,r=i===X?s-1:0,o=(n.length-1-r)/2,e=(n.length-1+r)/2;this.E7(t,Math.round(o),!1),this.E7(t,Math.round(e),!0)}},i.u7=function(t){var i=this.n7,n=this.z9,s=this.A9,r=i===X?s:s/2;return t>=n.length-r},t}(),at="__AMP_CAROUSEL_NEAR_VIEWPORT",ht="__AMP_CAROUSEL_IN_VIEWPORT",ut=function(){function t(t){var i=t.ampElement,n=t.intersectionElement,s=t.intersectionThreshold,r=void 0===s?.01:s,o=t.nearbyMarginInPercent,e=void 0===o?100:o,a=t.viewportIntersectionThreshold,h=void 0===a?r:a,u=t.viewportIntersectionCallback,l=void 0===u?function(){}:u;this.z7=i,this.BL=E(i.element),this.A7=n,this.I7=r,this.R7=e,this._7=h,this.C7=l,this.T7=!1,this.xZ=[],this.P7=null,this.B7=null,this.hv=null,this.L7=!1}var i=t.prototype;return i.setQueueChanges=function(t){this.T7=t},i.U7=function(t,i){i?this.BL.scheduleLayout(this.z7.element,t):this.BL.scheduleUnlayout(this.z7.element,t)},i.W7=function(t,i){this.C7(t,i)},i.Gc=function(){var t=this;if(!(this.P7&&this.B7&&this.hv)){var i=this.z7.win;this.P7=new i.IntersectionObserver((function(i){return t.G7(i)}),{root:this.A7,rootMargin:"".concat(this.R7,"%"),threshold:this.I7}),this.B7=new i.IntersectionObserver((function(i){return t.X7(i)}),{root:this.A7,rootMargin:"".concat(this.R7+10,"%"),threshold:this.I7}),this.hv=new i.IntersectionObserver((function(i){return t.F7(i)}),{root:this.A7,rootMargin:"0%",threshold:this._7})}},i.G7=function(t){t.filter((function(t){return t.isIntersecting})).forEach((function(t){t.target[at]=0})),this.T7||this.H7()},i.X7=function(t){t.filter((function(t){return!t.isIntersecting})).forEach((function(t){t.target[at]=1})),this.T7||this.V7()},i.F7=function(t){t.forEach((function(t){var i=t.isIntersecting;t.target[ht]=i?0:1})),this.T7||this.Z7()},i.flushChanges=function(){this.H7(),this.V7(),this.Z7()},i.H7=function(){for(var t=0;t<this.xZ.length;t++){var i=this.xZ[t];0==i[at]&&(this.U7(i,!0),i[at]=null)}},i.V7=function(){for(var t=0;t<this.xZ.length;t++){var i=this.xZ[t];1==i[at]&&(this.U7(i,!1),i[at]=null)}},i.Z7=function(){for(var t=0;t<this.xZ.length;t++){var i=this.xZ[t];0==i[ht]?(this.U7(i,!0),this.W7(i,!0)):1==i[ht]&&this.W7(i,!1),i[ht]=null}},i.D7=function(t){if("IntersectionObserver"in this.z7.win){if(this.Gc(),!t)return this.P7.disconnect(),this.B7.disconnect(),void this.hv.disconnect();for(var i=0;i<this.xZ.length;i++)this.P7.observe(this.xZ[i]),this.B7.observe(this.xZ[i]),this.hv.observe(this.xZ[i])}},i.updateChildren=function(t){if(this.xZ=t,"IntersectionObserver"in this.z7.win){for(var i=0;i<this.xZ.length;i++)this.BL.setOwner(this.xZ[i],this.z7.element);this.D7(!1),this.D7(this.L7)}},i.wasLaidOut=function(){this.L7=!0,this.D7(this.L7)},i.wasUnlaidOut=function(){this.L7=!1,this.D7(this.L7);for(var t=0;t<this.xZ.length;t++)this.U7(this.xZ[t],!1),this.W7(this.xZ[t],!1)},t}();function lt(t){return t.split(",").map((function(t){var i=/[a-z0-9.]+$/.exec(t);if(i){var n=i.index,s=t.slice(n),r=t.slice(0,n).trim();return{mediaQueryList:window.matchMedia(r),value:s}}})).filter(Boolean)}function ct(t){for(var i=0;i<t.length;i++){var n=t[i],s=n.mediaQueryList,r=n.value;if(s.matches)return r}return""}var ft=function(){function t(t){this.gq=t,this.J7={},this.Q7={}}var i=t.prototype;return i.updateAttribute=function(t,i){var n=this;if(this.gq[t]){var s=this.Q7[t];s&&this.q7(s,null);var r=lt(i),o=function(){n.K7(t,ct(r))};this.q7(r,o),o(),this.Q7[t]=r}},i.K7=function(t,i){if(this.J7[t]!==i){var n=this.gq[t];n&&n(i),this.J7[t]=i}},i.q7=function(t,i){t.forEach((function(t){t.mediaQueryList.onchange=i}))},t}(),mt=["<div class=i-amphtml-carousel-content><div class=i-amphtml-carousel-scroll tabindex=-1></div><div class=i-amphtml-base-carousel-arrows><div class=i-amphtml-base-carousel-arrow-prev-slot></div><div class=i-amphtml-base-carousel-arrow-next-slot></div></div></div>"],vt=['<button class=i-amphtml-base-carousel-arrow aria-label="Next item in carousel"><div class=i-amphtml-base-carousel-arrow-frosting></div><div class=i-amphtml-base-carousel-arrow-backdrop></div><div class=i-amphtml-base-carousel-arrow-background></div><svg class=i-amphtml-base-carousel-arrow-icon viewBox="0 0 24 24"><path d="M10,7.4 L14.6,12 L10,16.6" fill=none stroke-width=2px stroke-linejoin=round stroke-linecap=round></path></svg></button>'],pt=['<button class=i-amphtml-base-carousel-arrow aria-label="Previous item in carousel"><div class=i-amphtml-base-carousel-arrow-frosting></div><div class=i-amphtml-base-carousel-arrow-backdrop></div><div class=i-amphtml-base-carousel-arrow-background></div><svg class=i-amphtml-base-carousel-arrow-icon viewBox="0 0 24 24"><path d="M14,7.4 L9.4,12 L14,16.6" fill=none stroke-width=2px stroke-linejoin=round stroke-linecap=round></path></svg></button>'],dt=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&&n(t,i)}(f,t);var r,h,u=(r=f,h=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,i=s(r);if(h){var n=s(this).constructor;t=Reflect.construct(i,arguments,n)}else t=i.apply(this,arguments);return o(this,t)});function f(t){var i,n;return(i=u.call(this,t)).Y7=i.ttt(),i.qZ=(n=i.win,k(n,"platform")).isIos(),i.h9=null,i.n9=null,i.z9=[],i.itt=null,i.ntt=null,i.ftt=!1,i.Ye=null,i.mtt=null,i.Cd=2,i}f.prerenderAllowed=function(){return!0};var w=f.prototype;return w.ttt=function(){var t=this;return new ft({"advance-count":function(i){t.n9.updateAdvanceCount(Number(i)||0)},"auto-advance":function(i){t.n9.updateAutoAdvance("true"===i)},"auto-advance-count":function(i){t.n9.updateAutoAdvanceCount(Number(i)||0)},"auto-advance-interval":function(i){t.n9.updateAutoAdvanceInterval(Number(i)||0)},"auto-advance-loops":function(i){t.n9.updateAutoAdvanceLoops(Number(i)||0)},"controls":function(i){t.tst(i)},"dir":function(i){t.n9.updateForwards("rtl"!=i)},"horizontal":function(i){t.n9.updateHorizontal("true"===i)},"loop":function(i){t.n9.updateLoop("true"===i||""===i)},"mixed-length":function(i){t.n9.updateMixedLength("true"===i)},"slide":function(i){t.n9.goToSlide(Number(i))},"snap":function(i){t.n9.updateSnap("true"===i)},"snap-align":function(i){t.n9.updateAlignment(i)},"snap-by":function(i){t.n9.updateSnapBy(Number(i)||0)},"visible-count":function(i){t.n9.updateVisibleCount(Number(i)||0)}})},w.isLayoutSupported=function(t){return function(t){return"fixed"==t||"fixed-height"==t||"responsive"==t||"fill"==t||"flex-item"==t||"fluid"==t||"intrinsic"==t}(t)},w.buildCallback=function(){var t,i,n,s=this;this.Ye=(t=this.element,i="action",N(n=S(M(t)),i)?z(n,i):null),this.Ntt(),this.n9=new et({win:this.win,element:this.element,scrollContainer:this.h9,initialIndex:this.Ett(),runMutate:function(t){return s.mutateElement(t)}}),e(this.element.attributes).forEach((function(t){s.ztt(t.name,t.value)})),this.n9.updateSlides(this.z9),this.Att(),this.jtt(),this.uA(),this.Itt()},w.isRelayoutNeeded=function(){return!0},w.pauseCallback=function(){this.n9.pauseLayout()},w.resumeCallback=function(){this.n9.resumeLayout()},w.layoutCallback=function(){return this.n9.updateUi(),this.mtt.wasLaidOut(),i||(i=Promise.resolve(void 0))},w.unlayoutCallback=function(){return this.mtt.wasUnlaidOut(),!0},w.mutatedAttributesCallback=function(t){for(var i in t)this.ztt(i,String(t[i]))},w.getSlides=function(){return this.z9},w.goToSlide=function(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=i.actionSource,s=i.smoothScroll,r=void 0!==s&&s;this.n9.goToSlide(t,{smoothScroll:r,actionSource:n})},w.interactionNext=function(){this.n9.next(0)},w.interactionPrev=function(){this.n9.prev(0)},w.Ntt=function(){var t,i,n=this,s=this.element;e(s.children).forEach((function(s){var r=s.getAttribute("slot");"prev-arrow"===r?t=s:"next-arrow"===r?i=s:"I-AMPHTML-SIZER"!==s.tagName&&n.z9.push(s)})),s.appendChild(this.Rtt()),this.h9=s.querySelector(".i-amphtml-carousel-scroll"),this.ntt=this.element.querySelector(".i-amphtml-base-carousel-arrow-prev-slot"),this.itt=this.element.querySelector(".i-amphtml-base-carousel-arrow-next-slot"),this.z9.forEach((function(t){t.classList.add("i-amphtml-carousel-slotted"),n.h9.appendChild(t)})),this.ntt.appendChild(t||this._tt()),this.itt.appendChild(i||this.Ctt())},w.Rtt=function(){return b(this.element)(mt)},w.Ctt=function(){return b(this.element)(vt)},w._tt=function(){return b(this.element)(pt)},w.Mtt=function(t){return t>=2?0:1},w.Att=function(){var t=this,i=E(this.element);this.mtt=new ut({ampElement:this,intersectionElement:this.h9,nearbyMarginInPercent:this.qZ?200:100,viewportIntersectionCallback:function(n,s){s?i.scheduleResume(t.element,n):i.schedulePause(t.element,n)}}),this.mtt.setQueueChanges(this.qZ);var n=this.z9.map((function(t){return"amp-inline-gallery-slide"===t.localName?e((i=t,n="> :not([slot])",(void 0!==a?a:a=function(t){try{var i=t.ownerDocument,n=i.createElement("div"),s=i.createElement("div");return n.appendChild(s),n.querySelector(":scope div")===s}catch(t){return!1}}(i))?i.querySelectorAll(c(n,":scope")):function(t,i){var n=t.classList,s="i-amphtml-scoped";n.add(s);var r=c("> :not([slot])",".".concat(s)),o=t.querySelectorAll(r);return n.remove(s),o}(i))):t;var i,n})).reduce((function(t,i){return t.concat(i)}),[]);this.mtt.updateChildren(n)},w.jtt=function(){var t=this;this.registerAction("prev",(function(i){var n=i.trust;t.n9.prev(t.Mtt(n))}),1),this.registerAction("next",(function(i){var n=i.trust;t.n9.next(t.Mtt(n))}),1),this.registerAction("goToSlide",(function(i){var n,s=i.args,r=i.trust;t.n9.goToSlide(Number(null!==(n=s.index)&&void 0!==n?n:-1),{actionSource:t.Mtt(r)})}),1)},w.uA=function(){var t=this;this.element.addEventListener(V,(function(i){t._9(i)})),this.element.addEventListener($,(function(){t.Ott()})),this.element.addEventListener(D,(function(){t.Stt()})),this.element.addEventListener("goToSlide",(function(i){var n=L(i);t.n9.goToSlide(n.index)})),this.element.addEventListener("keydown",(function(i){t.ist(i)})),this.ntt.addEventListener("click",(function(i){i.target!=i.currentTarget&&t.n9.prev(0)})),this.itt.addEventListener("click",(function(i){i.target!=i.currentTarget&&t.n9.next(0)}))},w.nst=function(){return 1===this.Cd||0!==this.Cd&&this.ftt},w.tst=function(t){switch(t){case"always":this.Cd=0;break;case"never":this.Cd=1;break;default:this.Cd=2}this.Itt()},w.Itt=function(){var t=this,i=this.n9.getCurrentIndex(),n=this.n9.isLooping(),s=this.n9.getVisibleCount(),r=this.n9.isAtEnd(),o=this.n9.isAtStart();p(this.ntt.children,(function(t){d(t,"disabled",!n&&0===i||o)})),p(this.itt.children,(function(o){d(o,"disabled",!n&&i>=t.z9.length-s||r)})),d(this.element,"i-amphtml-base-carousel-hide-buttons",this.nst())},w.Ott=function(){this.mtt.setQueueChanges(this.qZ)},w.Stt=function(){this.mtt.flushChanges(),this.mtt.setQueueChanges(!1),this.Itt()},w.ist=function(t){var i="ArrowRight"===t.key,n="ArrowLeft"===t.key;if(i||n){var s,r="rtl"==((s=y(this.element.ownerDocument)).body.getAttribute("dir")||s.documentElement.getAttribute("dir")||"ltr");i&&!r||n&&r?this.n9.next():this.n9.prev(),t.preventDefault()}},w.Ett=function(){var t=this.element.getAttribute("slide")||"0";return Number(ct(lt(t)))},w.Ltt=function(t){return 2===t||3===t||0===t},w._9=function(t){var i=L(t),n=i.index,s=i.actionSource,r={"index":n},o="slideChange",e=this.Ltt(s)?3:1,a=R(this.win,"slidescroll.".concat(o),r);this.Ye.trigger(this.element,o,a,e),function(t,i,n,s){var r=n||{};l(t.ownerDocument);var o=new MessageEvent("slideChange",{data:r,bubbles:m,cancelable:v});t.dispatchEvent(o)}(this.element,0,r),this.ftt=this.ftt||3===s,this.Itt()},w.ztt=function(t,i){this.Y7.updateAttribute(t,i)},w.goCallback=function(t){1===t?this.interactionNext():this.interactionPrev()},f}(t.BaseElement);t.registerElement("amp-base-carousel",dt,".i-amphtml-carousel-content{position:absolute;top:0;left:0;bottom:0;right:0}.i-amphtml-carousel-scroll{display:-ms-flexbox;display:flex;width:100%;height:100%;-ms-flex-align:center;align-items:center;outline:none;scroll-behavior:smooth;-webkit-overflow-scrolling:touch!important;--visible-count:1}.i-amphtml-carousel-scroll[hide-scrollbar=true]{scrollbar-width:none}.i-amphtml-carousel-scroll[hide-scrollbar=true]::-webkit-scrollbar{display:none;box-sizing:content-box!important}.i-amphtml-carousel-scroll[horizontal=true]{-ms-flex-direction:row;flex-direction:row;scroll-snap-type-x:mandatory;scroll-snap-type:x mandatory;padding-bottom:20px!important;overflow-y:hidden}.i-amphtml-carousel-scroll[horizontal=false]{-ms-flex-direction:column;flex-direction:column;scroll-snap-type-y:mandatory;scroll-snap-type:y mandatory;padding-right:20px!important;overflow-x:hidden}.i-amphtml-carousel-scroll[snap=false]{scroll-snap-type:none}.i-amphtml-carousel-scroll[user-scrollable=false]{overflow:hidden}.i-amphtml-carousel-spacer{visibility:hidden;z-index:-1}.i-amphtml-carousel-slotted,.i-amphtml-carousel-spacer{box-sizing:border-box!important;margin:0!important;-ms-flex-negative:0!important;flex-shrink:0!important;width:100%;height:100%;scroll-snap-stop:always}.i-amphtml-carousel-scroll[horizontal=true][mixed-length=false]>.i-amphtml-carousel-slotted,.i-amphtml-carousel-scroll[horizontal=true][mixed-length=false]>.i-amphtml-carousel-spacer{width:calc(100%/var(--visible-count))!important;min-width:auto!important;max-width:none!important}.i-amphtml-carousel-scroll[horizontal=false][mixed-length=false]>.i-amphtml-carousel-slotted,.i-amphtml-carousel-scroll[horizontal=false][mixed-length=false]>.i-amphtml-carousel-spacer{height:calc(100%/var(--visible-count))!important;min-height:auto!important;max-height:none!important}.i-amphtml-carousel-scroll[horizontal=true][snap=true][mixed-length=true]>.i-amphtml-carousel-slotted,.i-amphtml-carousel-scroll[horizontal=true][snap=true][mixed-length=true]>.i-amphtml-carousel-spacer{max-width:100%!important}.i-amphtml-carousel-scroll[horizontal=false][snap=true][mixed-length=true]>.i-amphtml-carousel-slotted,.i-amphtml-carousel-scroll[horizontal=false][snap=true][mixed-length=true]>.i-amphtml-carousel-spacer{max-height:100%!important}.i-amphtml-carousel-scroll>.i-amphtml-carousel-slotted{will-change:transform}amp-base-carousel{display:block;overflow:hidden}.i-amphtml-base-carousel-arrows{position:absolute;top:0;bottom:0;left:0;right:0;z-index:1;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:justify;justify-content:space-between;pointer-events:none}.i-amphtml-base-carousel-arrow-next-slot,.i-amphtml-base-carousel-arrow-prev-slot{position:relative;z-index:1;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.i-amphtml-base-carousel-arrow-next-slot>*,.i-amphtml-base-carousel-arrow-prev-slot>*{pointer-events:all}amp-base-carousel[dir=rtl] .i-amphtml-base-carousel-arrow-next-slot,amp-base-carousel[dir=rtl] .i-amphtml-base-carousel-arrow-prev-slot{transform:scaleX(-1)}amp-base-carousel .i-amphtml-carousel-scroll[loop=false]+.i-amphtml-base-carousel-arrows>.i-amphtml-base-carousel-arrow-next-slot>[disabled],amp-base-carousel .i-amphtml-carousel-scroll[loop=false]+.i-amphtml-base-carousel-arrows>.i-amphtml-base-carousel-arrow-prev-slot>[disabled],amp-base-carousel[i-amphtml-base-carousel-hide-buttons] .i-amphtml-base-carousel-arrow-next-slot>*,amp-base-carousel[i-amphtml-base-carousel-hide-buttons] .i-amphtml-base-carousel-arrow-prev-slot>*{opacity:0;pointer-events:none}.i-amphtml-base-carousel-arrow-backdrop,.i-amphtml-base-carousel-arrow-background,.i-amphtml-base-carousel-arrow-frosting{position:absolute;top:0;left:0;width:100%;height:100%;border-radius:50%}.i-amphtml-base-carousel-arrow-frosting{-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px)}.i-amphtml-base-carousel-arrow-backdrop{-webkit-backdrop-filter:blur(12px) invert(1) grayscale(0.6) brightness(0.8);backdrop-filter:blur(12px) invert(1) grayscale(0.6) brightness(0.8);opacity:0.5}.i-amphtml-base-carousel-arrow-background{background-color:rgba(0,0,0,.3);box-shadow:inset 0 0 0px 1px rgba(0,0,0,.08),0 1px 4px 1px rgba(0,0,0,.2);transition:background-color 200ms}@media (hover:hover){.i-amphtml-base-carousel-arrow:hover .i-amphtml-base-carousel-arrow-background{background-color:hsla(0,0%,100%,.8)}}.i-amphtml-base-carousel-arrow:active .i-amphtml-base-carousel-arrow-background{background-color:#fff;transition-duration:0ms}.i-amphtml-base-carousel-arrow{position:relative;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;width:36px;height:36px;padding:0;margin:12px;background-color:transparent;border:none;outline:none;stroke:#fff;transition:stroke 200ms}@media (hover:hover){.i-amphtml-base-carousel-arrow:hover{stroke:#222}}.i-amphtml-base-carousel-arrow:active{stroke:#222;transition-duration:0ms}.i-amphtml-base-carousel-arrow-icon{position:relative;z-index:1;width:24px;height:24px}.i-amphtml-base-carousel-arrow-background,.i-amphtml-base-carousel-arrow-icon{transform:translateZ(1px)}amp-base-carousel .i-amphtml-carousel-slotted>.i-amphtml-replaced-content{-o-object-fit:contain;object-fit:contain}\n/*# sourceURL=/extensions/amp-base-carousel/0.1/amp-base-carousel.css*/")}();
/*! https://mths.be/cssescape v1.5.1 by @mathias | MIT license */}});
//# sourceMappingURL=amp-base-carousel-0.1.js.map