(function(){/*

 Copyright The Closure Library Authors.
 SPDX-License-Identifier: Apache-2.0
*/
'use strict';var g,k=function(a){a=["object"==typeof globalThis&&globalThis,a,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global];for(var b=0;b<a.length;++b){var c=a[b];if(c&&c.Math==Math)return c}throw Error("Cannot find global object");},m=k(this),n="function"==typeof Object.create?Object.create:function(a){var b=function(){};b.prototype=a;return new b},p;
if("function"==typeof Object.setPrototypeOf)p=Object.setPrototypeOf;else{var q;a:{var r={a:!0},t={};try{t.__proto__=r;q=t.a;break a}catch(a){}q=!1}p=q?function(a,b){a.__proto__=b;if(a.__proto__!==b)throw new TypeError(a+" is not extensible");return a}:null}var u=p,v=this||self,w=function(a,b){a=a.split(".");var c=v;a[0]in c||"undefined"==typeof c.execScript||c.execScript("var "+a[0]);for(var d;a.length&&(d=a.shift());)a.length||void 0===b?c=c[d]&&c[d]!==Object.prototype[d]?c[d]:c[d]={}:c[d]=b};var x=function(a,b,c){c=void 0===c?null:c;var d=document.createEvent("CustomEvent");d.initCustomEvent(a,!0,!0,c);b.dispatchEvent(d)},y=function(a,b,c){var d=function(e){a.removeEventListener(b,d);c(e)};a.addEventListener(b,d)};var z="center top bottom left right transparent".split(" ");var A=["-ms-","-moz-","-webkit-",""],B=function(a,b){var c=void 0===c?!1:c;for(var d,e,f=0;f<A.length;f++)d=A[f]+"transition-duration",e=(c?A[f]:"")+b,a.style.setProperty(d,e)},C=function(a){var b=document,c=b.getElementsByTagName("head")[0];if(!c){var d=b.getElementsByTagName("body")[0];c=b.createElement("head");d.parentNode.insertBefore(c,d)}b=b.createElement("style");b.textContent=a;c.appendChild(b);return b};var D=function(a){for(var b=0;b<z.length;b++)a.classList.remove(z[b])},E=function(a,b){var c=function(){a.removeEventListener("webkitTransitionEnd",c);a.removeEventListener("transitionend",c);b()};a.addEventListener("webkitTransitionEnd",c);a.addEventListener("transitionend",c)},F=function(a,b,c,d){c="transform: matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,"+c+","+d+",0,1);";return a+"."+b+"{-webkit-"+c+"-moz-"+c+"-ms-"+c+c+"}"},G=function(a,b,c){a=(a&&"#")+a+".gwd-pagedeck > .gwd-page";return F(a,"center",0,
0)+F(a,"top",0,c)+F(a,"bottom",0,-c)+F(a,"left",b,0)+F(a,"right",-b,0)},H=function(a,b,c,d,e,f,h){d=void 0===d?"none":d;this.h=a;this.i=b;this.G=c;this.m="none"==d?0:void 0===e?1E3:e;this.o=void 0===f?"linear":f;this.u=[];if(this.m){a=d;h=void 0===h?"top":h;if(this.h){this.h.classList.add("gwd-page");this.h.classList.add("center");b="center";if("push"==a)switch(h){case "top":b="top";break;case "bottom":b="bottom";break;case "left":b="left";break;case "right":b="right"}this.u.push(b);"fade"==a&&this.u.push("transparent")}b=
"center";if("none"!=a&&"fade"!=a)switch(h){case "top":b="bottom";break;case "bottom":b="top";break;case "left":b="right";break;case "right":b="left"}this.i.classList.add(b);this.i.classList.add("gwd-page");"fade"==a&&this.i.classList.add("transparent")}};
H.prototype.start=function(){if(this.m){E(this.i,this.R.bind(this));this.h&&(B(this.h,this.m+"ms"),this.h.classList.add(this.o));B(this.i,this.m+"ms");this.i.classList.add(this.o);var a=this.i;a.setAttribute("gwd-reflow",a.offsetWidth);if(this.h)for(a=0;a<this.u.length;a++)this.h.classList.add(this.u[a]);D(this.i)}else this.G()};H.prototype.R=function(){this.h&&(D(this.h),B(this.h,0),this.h.classList.remove(this.o));B(this.i,0);this.i.classList.remove(this.o);this.G()};Object.freeze&&Object.freeze([]);var I=function(a,b){var c=v.performance;a={label:a,type:9,value:c&&c.now&&c.timing?Math.floor(c.now()+c.timing.navigationStart):Date.now()};b=b.google_js_reporting_queue=b.google_js_reporting_queue||[];2048>b.length&&b.push(a)};var J={},L=!1,M=!1;J.O=function(a){L||(L=!0,I("11",a))};J.F=function(a){M||(M=!0,I("12",a))};J.P=function(a,b,c){var d=b;d=void 0===d?v:d;if(d=(d=d.performance)&&d.now?d.now():null)a={label:a,type:void 0===c?0:c,value:d},b=b.google_js_reporting_queue=b.google_js_reporting_queue||[],2048>b.length&&b.push(a)};J.reset=function(a){M=L=!1;(a.google_js_reporting_queue=a.google_js_reporting_queue||[]).length=0};w("gwd.rumUtil",J);w("gwd.rumUtil.logContentLoading",J.O);
w("gwd.rumUtil.logContentRendered",J.F);w("gwd.rumUtil.logTimingEvent",J.P);w("gwd.rumUtil.reset",J.reset);var N=function(){var a=HTMLElement.call(this)||this;y(window,"WebComponentsReady",a.N.bind(a));a.C=a.s.bind(a,"shake");a.D=a.s.bind(a,"tilt");a.B=a.s.bind(a,"rotatetoportrait");a.A=a.s.bind(a,"rotatetolandscape");a.g=[];a.H=a.M.bind(a);a.K=a.L.bind(a);a.I=null;a.l=null;a.j=-1;a.v=!1;return a},O=HTMLElement;N.prototype=n(O.prototype);N.prototype.constructor=N;
if(u)u(N,O);else for(var P in O)if("prototype"!=P)if(Object.defineProperties){var Q=Object.getOwnPropertyDescriptor(O,P);Q&&Object.defineProperty(N,P,Q)}else N[P]=O[P];N.prototype.connectedCallback=function(){this.addEventListener("pageload",this.H,!1);document.body.addEventListener("shake",this.C,!0);document.body.addEventListener("tilt",this.D,!0);document.body.addEventListener("rotatetoportrait",this.B,!0);document.body.addEventListener("rotatetolandscape",this.A,!0)};
N.prototype.disconnectedCallback=function(){this.removeEventListener("pageload",this.H,!1);document.body&&(document.body.removeEventListener("shake",this.C,!0),document.body.removeEventListener("tilt",this.D,!0),document.body.removeEventListener("rotatetoportrait",this.B,!0),document.body.removeEventListener("rotatetolandscape",this.A,!0))};
N.prototype.N=function(){this.classList.add("gwd-pagedeck");this.I||(this.I=C(G(this.id,this.offsetWidth,this.offsetHeight)));this.g=Array.prototype.slice.call(this.querySelectorAll("gwd-page"));this.g.forEach(function(a){a.classList.add("gwd-page")});for(x("pagesregistered",this,{pages:this.g.slice()});this.firstChild;)this.removeChild(this.firstChild);-1==this.j&&void 0!==this.J&&this.goToPage(this.J)};
var S=function(a,b,c,d,e,f){if(!(a.j==b||0>b||b>a.g.length-1||a.l)){var h=a.g[a.j],l=a.g[b];a.j=b;a.l=new H(h,l,a.K,c,d,e,f);var K=l.gwdLoad&&!l.gwdIsLoaded();a.v=K;y(l,"attached",function(){l.gwdActivate();K?l.gwdLoad():R(a)});a.appendChild(l)}};N.prototype.M=function(a){this.v&&a.target.parentNode==this&&(R(this),this.v=!1)};var R=function(a){(0,J.F)(window);a.l.start();x("pagetransitionstart",a)};g=N.prototype;
g.L=function(){if(this.l){var a=this.l.h,b=this.l.i;this.l=null;x("pagetransitionend",this,{outgoingPage:a?a:null,incomingPage:b});a&&a.gwdDeactivate();b.gwdPresent()}};g.findPageIndexByAttributeValue=function(a,b){for(var c=this.g.length,d,e=0;e<c;e++)if(d=this.g[e],"boolean"==typeof b){if(d.hasAttribute(a))return e}else if(d.getAttribute(a)==b)return e;return-1};g.goToNextPage=function(a,b,c,d,e){var f=this.j,h=f+1;h>=this.g.length&&(h=a?0:f);S(this,h,b,c,d,e)};
g.goToPreviousPage=function(a,b,c,d,e){var f=this.j,h=this.g.length,l=f-1;0>l&&(l=a?h-1:f);S(this,l,b,c,d,e)};g.goToPage=function(a,b,c,d,e){this.g.length?(a="number"==typeof a?a:this.findPageIndexByAttributeValue("id",a),0<=a&&S(this,a,b,c,d,e)):this.J=a};g.getPages=function(){return this.g};g.getPage=function(a){if("number"!=typeof a){if(!a)return null;a=this.findPageIndexByAttributeValue("id",a)}return 0>a||a>this.g.length-1?null:this.g[a]};g.getCurrentPage=function(){return this.getPage(this.j)};
g.getDefaultPage=function(){var a=this.getAttribute("default-page");return a?this.getPage(this.findPageIndexByAttributeValue("id",a)):this.getPage(0)};g.getOrientationSpecificPage=function(a,b){b=this.getPage(b);var c=b.getAttribute("alt-orientation-page");if(!c)return b;var d=b.isPortrait();a=1==a;c=this.getPage(c);return a==d?b:c};g.s=function(a,b){if(b.target==document.body){var c=this.getPage(this.j);x(a,c,b.detail)}};
g.getElementById=function(a){for(var b=this.g.length,c=0;c<b;c++){var d=this.g[c].querySelector("#"+a);if(d)return d}return null};g.getElementsBySelector=function(a){for(var b=this.g.length,c=[],d=0;d<b;d++){var e=this.g[d].querySelectorAll(a);e&&(c=c.concat(Array.prototype.slice.call(e)))}return c};m.Object.defineProperties(N.prototype,{currentIndex:{configurable:!0,enumerable:!0,get:function(){return 0<=this.j?this.j:void 0}}});customElements.define("gwd-pagedeck",N);}).call(this);
