; (self.AMP=self.AMP||[]).push({m:0,v:"2305252018001",n:"amp-lightbox",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[s++]}}}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,s=function(){var t=this;this.promise=new Promise((function(i,n){t.resolve=i,t.reject=n}))};function o(t,i){return(o=Object.setPrototypeOf||function(t,i){return t.__proto__=i,t})(t,i)}function h(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&&o(t,i)}function e(t){return(e=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function u(t){return(u="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 a(t,i){if(i&&("object"===u(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){var i=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}}();return function(){var n,r=e(t);if(i){var s=e(this).constructor;n=Reflect.construct(r,arguments,s)}else n=r.apply(this,arguments);return a(this,n)}}var c=Array.isArray,l=Object.prototype,v=l.hasOwnProperty;function d(t){var i=Object.create(null);return t&&Object.assign(i,t),i}function m(t,i){return v.call(t,i)}function p(t,i,n,r,s,o,h,e,u,a,f){return t}function b(t){return(t.ownerDocument||t).defaultView}function y(t){try{t.focus()}catch(t){}}function g(t){var i=Object.getOwnPropertyDescriptor(t,"message");if(null!=i&&i.writable)return t;var n=t.message,r=t.stack,s=new Error(n);for(var o in t)s[o]=t[o];return s.stack=r,s}function w(t){for(var i,r=null,s="",o=n(arguments,!0);!(i=o()).done;){var h=i.value;h instanceof Error&&!r?r=g(h):(s&&(s+=" "),s+=h)}return r?s&&(r.message=s+": "+r.message):r=new Error(s),r}function x(t){var i,n;null===(i=(n=self).__AMP_REPORT_ERROR)||void 0===i||i.call(n,t)}function S(t){var i=w.apply(null,arguments);setTimeout((function(){throw x(i),i}))}function k(t){try{for(var i=arguments.length,n=new Array(i>1?i-1:0),r=1;r1?i-1:0),r=1;r1&&void 0!==arguments[1]?arguments[1]:"";try{return decodeURIComponent(t)}catch(t){return i}}function U(t){var i=(t||self).location;return function(t){var i,n=d();if(!t)return n;for(;i=H.exec(t);){var r=B(i[1],i[1]),s=i[2]?B(i[2].replace(/\+/g," "),i[2]):"";n[r]=s}return n}(i.originalHash||i.hash)}var W="";function G(t){var i=t||self;return i.__AMP_MODE?i.__AMP_MODE:i.__AMP_MODE=function(t){return{localDev:!1,development:V(t,U(t)),esm:!1,test:!1,rtvVersion:N(t),ssrReady:!1}}(i)}function N(t){var i;return W||(W=(null===(i=t.AMP_CONFIG)||void 0===i?void 0:i.v)||"01".concat("2305252018001")),W}function V(t,i){var n=i||U(t);return["1","actions","amp","amp4ads","amp4email"].includes(n.development)||!!t.AMP_DEV_MODE}self.__AMP_LOG=self.__AMP_LOG||{user:null,dev:null,userForEmbed:null};var F=self.__AMP_LOG;function Z(t,i){throw new Error("failed to call initLogConstructor")}function $(t){return F.user||(F.user=q()),function(t,i){return i&&i.ownerDocument.defaultView!=t}(F.user.win,t)?F.userForEmbed||(F.userForEmbed=q()):F.user}function q(t){return Z()}function J(){return F.dev||(F.dev=Z())}function K(t,i,n,r,s,o,h,e,u,a,f){return t}function Q(t,i){return rt(t=function(t){return t.__AMP_TOP||(t.__AMP_TOP=t)}(t),i)}function tt(t,i){return rt(nt(it(t)),i)}function it(t){return t.nodeType?(i=b(t),Q(i,"ampdoc")).getAmpDoc(t):t;var i}function nt(t){var i=it(t);return i.isSingleDoc()?i.win:i}function rt(t,i){K(st(t,i));var n=function(t){var i=t.__AMP_SERVICES;return i||(i=t.__AMP_SERVICES={}),i}(t)[i];return n.obj||(K(n.ctor),K(n.context),n.obj=new n.ctor(n.context),K(n.obj),n.context=null,n.resolve&&n.resolve(n.obj)),n.obj}function st(t,i){var n=t.__AMP_SERVICES&&t.__AMP_SERVICES[i];return!(!n||!n.ctor)}var ot,ht=function(t){return tt(t,"owners")},et=function(t){return rt(t,"timer")},ut=function(){function t(t,i){var n=this,r=t.win;if(this.t=r,this.Mr=i,this.yC=null,this.ds=null,this.gC=-1,this.wC=null,"function"==typeof r.CloseWatcher)try{this.yC=new r.CloseWatcher}catch(t){J().error("CloseWatcherImpl","CloseWatcher failed:",t)}this.yC?this.yC.onclose=function(){i(),n.destroy()}:(this.ds=tt(t,"history"),this.ds.push((function(){return i()})).then((function(t){n.gC=t})),this.wC=this.xC.bind(this),r.document.documentElement.addEventListener("keydown",this.wC))}var i=t.prototype;return i.signalClosed=function(){this.yC?this.yC.signalClosed():this.Mr&&((0,this.Mr)(),this.destroy())},i.destroy=function(){this.Mr=null,this.yC?(this.yC.destroy(),this.yC=null):-1!=this.gC&&(K(this.ds).pop(this.gC),this.gC=-1,this.ds=null,this.t.document.documentElement.removeEventListener("keydown",this.wC))},i.xC=function(t){"Escape"==t.key&&(t.preventDefault(),this.signalClosed())},t}();function at(t){if(void 0!==ot)return ot;ot=!1;try{var i={get passive(){return ot=!0,!1}};t.addEventListener("test-options",null,i),t.removeEventListener("test-options",null,i)}catch(t){}return ot}var ft=function(){function t(){this.Tt=null}var i=t.prototype;return i.add=function(t){var i=this;return this.Tt||(this.Tt=[]),this.Tt.push(t),function(){i.remove(t)}},i.remove=function(t){var i,n,r;this.Tt&&(n=t,-1!=(r=(i=this.Tt).indexOf(n))&&i.splice(r,1))},i.removeAll=function(){this.Tt&&(this.Tt.length=0)},i.fire=function(t){if(this.Tt)for(var i,r=n(this.Tt.slice(),!0);!(i=r()).done;)(0,i.value)(t)},i.getHandlerCount=function(){var t,i;return null!==(t=null===(i=this.Tt)||void 0===i?void 0:i.length)&&void 0!==t?t:0},t}(),ct=function(){function t(t,i,n){var r=this;this.Ir=et(t),this.Mr=i,this.Sr=n||0,this.kr=-1,this._r=0,this.Rr=!1,this.Nr=function(){r.Cr()}}var i=t.prototype;return i.isPending=function(){return-1!=this.kr},i.schedule=function(t){var i=t||this.Sr;this.Rr&&i<10&&(i=10);var n=Date.now()+i;return(!this.isPending()||n-this._r<-10)&&(this.cancel(),this._r=n,this.kr=this.Ir.delay(this.Nr,i),!0)},i.Cr=function(){this.kr=-1,this._r=0,this.Rr=!0,this.Mr(),this.Rr=!1},i.cancel=function(){this.isPending()&&(this.Ir.cancel(this.kr),this.kr=-1)},t}(),lt="__AMP_Gestures",vt=function(t,i,n,r){this.type=t,this.data=i,this.time=n,this.event=r},dt=function(){function t(t){var i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.zl=t,this.GM=[],this.Lv=[],this.Kt=[],this.BM=[],this.FM=null;var r=t.ownerDocument.defaultView,s=at(r);this.WM=i||s,this.XM=n,this.qM=!1,this.Cr=new ct(b(t),this.ad.bind(this)),this.ZM=new ft,this.$M=Object.create(null),this.KM=this.zp.bind(this),this.JM=this._p.bind(this),this.QM=this.qp.bind(this),this.tI=this.Yv.bind(this),this.zl.addEventListener("touchstart",this.KM,!!s&&{passive:!0}),this.zl.addEventListener("touchend",this.JM),this.zl.addEventListener("touchmove",this.QM,!!s&&{passive:!0}),this.zl.addEventListener("touchcancel",this.tI),this.iI=!1}t.get=function(i){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],s=i[lt];return s||(s=new t(i,n,r),i[lt]=s),s};var i=t.prototype;return i.cleanup=function(){this.zl.removeEventListener("touchstart",this.KM),this.zl.removeEventListener("touchend",this.JM),this.zl.removeEventListener("touchmove",this.QM),this.zl.removeEventListener("touchcancel",this.tI),delete this.zl[lt],this.Cr.cancel()},i.onGesture=function(t,i){var n=new t(this),r=n.getType(),s=this.$M[r];return s||(this.GM.push(n),s=new ft,this.$M[r]=s),s.add(i)},i.removeGesture=function(t){var i=new t(this).getType(),n=this.$M[i];if(n){n.removeAll();var r=function(t,n){for(var r=0;r=n){i=!0;break}i?(t.stopPropagation(),this.WM||t.preventDefault()):this.XM&&t.stopPropagation(),this.iI&&(this.iI=!1,this.ad())},i.ad=function(){for(var t=Date.now(),i=-1,n=0;nthis.Kt[i])&&(i=n):this.BM[n]&&this.BM[n]1)||!(!i||1!=i.length)&&(this.ih=Date.now(),this.lI=i[0].clientX,this.mI=i[0].clientY,!0)},r.onTouchMove=function(t){var i=t.touches;if(i&&i.length>=1){var n=i[0],r=n.clientX,s=n.clientY;if(this.fI=r,this.pI=s,this.FM)this.wI(!1,!1,t);else{var o=Math.abs(r-this.lI),h=Math.abs(s-this.mI);if(this.hI&&this.cI)(o>=8||h>=8)&&this.signalReady(-10);else if(this.hI){if(o>=8&&o>h)this.signalReady(-10);else if(h>=8)return!1}else{if(!this.cI)return!1;if(h>=8&&h>o)this.signalReady(-10);else if(o>=8)return!1}}return!0}return!1},r.onTouchEnd=function(t){var i=t.touches;i&&0==i.length&&this.kI(t)},r.acceptStart=function(){this.FM=!0,this.dI=this.lI,this.vI=this.mI,this.gI=this.ih,this.lI=this.fI,this.mI=this.pI,this.wI(!0,!1,null)},r.acceptCancel=function(){this.FM=!1},r.wI=function(t,i,n){this.yI=Date.now();var r=this.yI-this.gI;if(!i&&r>4||i&&r>16){var s=pt(this.fI-this.dI,r,this.bI),o=pt(this.pI-this.vI,r,this.xI);(!i||r>32||0!=s||0!=o)&&(this.bI=Math.abs(s)>1e-4?s:0,this.xI=Math.abs(o)>1e-4?o:0),this.dI=this.fI,this.vI=this.pI,this.gI=this.yI}this.signalEmit({first:t,last:i,time:this.yI,deltaX:this.fI-this.lI,deltaY:this.pI-this.mI,startX:this.lI,startY:this.mI,lastX:this.fI,lastY:this.pI,velocityX:this.bI,velocityY:this.xI},n)},r.kI=function(t){this.FM&&(this.FM=!1,this.wI(!1,!0,t),this.signalEnd())},n}(mt));function yt(t){return t.classList.contains("i-amphtml-fie")||!!function(t,i){return t.closest?t.closest(".i-amphtml-fie"):function(t,i,n){var r;for(r=t;r&&void 0!==r;r=r.parentElement)if(i(r))return r;return null}(t,(function(t){return function(t,i){var n=t.matches||t.webkitMatchesSelector||t.mozMatchesSelector||t.msMatchesSelector||t.oMatchesSelector;return!!n&&n.call(t,".i-amphtml-fie")}(t)}))}(t)}new Set(["c","v","a","ad"]);var gt=['
Ad
'],wt="amp-lightbox",xt={"fade-in":{openStyle:{"opacity":1},closedStyle:{"opacity":0},durationSeconds:.1},"fly-in-bottom":{openStyle:{"transform":"translate(0, 0)"},closedStyle:{"transform":"translate(0, 100%)"},durationSeconds:.2},"fly-in-top":{openStyle:{"transform":"translate(0, 0)"},closedStyle:{"transform":"translate(0, -100%)"},durationSeconds:.2}};function St(t){return(n=(i=t).ownerDocument||i,O&&O.ownerDocument===n||(O=n.createElement("div")),C)(gt);var i,n}var kt=function(t){h(n,t);var i=f(n);function n(t){var n;(n=i.call(this,t)).pr=null,n.rj=null,n.Wc=n.win.document,n.Gr=null,n.SC=null,n.kC=!1,n.OC=null,n.jC=null,n.AC=null,n.MC=null,n.EC=!1,n.DC=0,n.CC=0,n.RC=null,n.zC=(t.getAttribute("animate-in")||"fade-in").toLowerCase(),n.IC=null,n.PC=null,n.TC=null;var r=Q(n.win,"platform");return n.YC=r.isIos(),n.LC=function(t,i,n){var r=0,s=0,o=null;function h(){r=0;var n,e=500-(t.Date.now()-s);e>0?r=t.setTimeout(h,e):(n=o,o=null,i.apply(null,n))}return function(){s=t.Date.now();for(var i=arguments.length,n=new Array(i),e=0;e1&&void 0!==arguments[1])||arguments[1],!0,M)}(this.element,!1),ht(this.element).schedulePause(this.element,this.rj),this.kC=!1,this.fD("lightboxClose",t),this.MC&&y(this.MC)},o.nY=function(){return"inabox"==G(this.win).runtime||yt(this.element)},o.rY=function(){return!!this.element.contains(document.activeElement)},o.GC=function(){this.rY()||this.close(3)},o.$C=function(){this.rY()||(this.PC=this.sY(),this.PC||(this.TC=this.oY(),this.element.insertBefore(this.TC,this.element.firstChild),this.PC=this.TC),y(this.PC))},o.sY=function(){if(this.PC)return this.PC;if(this.IC)return this.IC;for(var t=this.element,i=t.querySelectorAll("[on]"),n=0;n=t-u&&h<=t+u&&i(o)}},o.uY=function(){return this.pr||(this.pr={width:this.element.clientWidth,height:this.element.clientHeight}),this.pr},o.XC=function(){var t=this.element,i=this.win;yt(t)&&Ot(i,i.document.body)},o.fD=function(t,i){var n=function(t,i,n,r){var s={detail:n};if(Object.assign(s,void 0),"function"==typeof t.CustomEvent)return new t.CustomEvent(i,s);var o=t.document.createEvent("CustomEvent");return o.initCustomEvent(i,!!s.bubbles,!!s.cancelable,n),o}(this.win,"".concat(wt,".").concat(t),{});this.Gr.trigger(this.element,t,n,i)},n}(t.BaseElement);function Ot(t,i){var n,r={},s=function(t){return Q(t,"ampdoc")}(t).getAmpDoc(i);(n=s,tt(n,"mutator")).measureMutateElement(i,(function(){r.alreadyTransparent="rgba(0, 0, 0, 0)"==function(t,i){return t.getComputedStyle(i)||z}(t,i)["background-color"]}),(function(){r.alreadyTransparent||$().warn(wt,"The background of the element has been forced to transparent. If you need to set background, use an intermediate container."),T(i,{background:"transparent"})}))}"inabox"==G().runtime&&Ot(window,K(document.body)),t.registerElement(wt,kt,'amp-lightbox{display:none;position:fixed!important;z-index:1000;top:0!important;left:0!important;bottom:0!important;right:0!important}amp-lightbox[scrollable]{overflow-y:auto!important;overflow-x:hidden!important}amp-lightbox i-amphtml-ad-close-header{height:60px!important;display:block!important;visibility:visible!important;opacity:0;position:fixed!important;top:0!important;left:0!important;right:0!important;z-index:1000!important;display:-ms-flexbox!important;display:flex!important;-ms-flex-align:center!important;align-items:center!important;-ms-flex-pack:right!important;justify-content:right!important;transition:opacity 0.1s ease-in}[animate-in=fly-in-bottom]>i-amphtml-ad-close-header,[animate-in=fly-in-top]>i-amphtml-ad-close-header{transition-delay:0.2s}amp-lightbox .amp-ad-close-header{opacity:1!important;box-sizing:border-box;padding:5px;line-height:40px;background-color:#000;color:#fff;font-family:Helvetica,sans-serif;font-size:12px;cursor:pointer}amp-lightbox .amp-ad-close-header>:first-child{margin-left:auto!important;pointer-events:none!important}amp-lightbox .amp-ad-close-button{display:block!important;background:url(\'data:image/svg+xml;charset=utf-8,\') no-repeat;background-position:50%;width:40px;height:40px;pointer-events:none!important;border-radius:40px;margin-left:5px}amp-lightbox .amp-ad-close-header:active>.amp-ad-close-button{background-color:hsla(0,0%,100%,0.3)}\n/*# sourceURL=/extensions/amp-lightbox/0.1/amp-lightbox.css*/')}(); /*! https://mths.be/cssescape v1.5.1 by @mathias | MIT license */}}); //# sourceMappingURL=amp-lightbox-0.1.js.map