-
Notifications
You must be signed in to change notification settings - Fork 2k
/
toolkit.min.js
6 lines (6 loc) · 128 KB
/
toolkit.min.js
1
2
3
4
5
6
function PointerGestureEvent(e,t){var n=t||{},r=document.createEvent("Event"),i={bubbles:!0,cancelable:!0};return Object.keys(i).forEach(function(e){e in n&&(i[e]=n[e])}),r.initEvent(e,i.bubbles,i.cancelable),Object.keys(n).forEach(function(e){r[e]=t[e]}),r.preventTap=this.preventTap,r}if(window.Platform=window.Platform||{},window.logFlags=window.logFlags||{},function(e){var t=e.flags||{};location.search.slice(1).split("&").forEach(function(e){e=e.split("="),e[0]&&(t[e[0]]=e[1]||!0)}),t.shadow=(t.shadowdom||t.shadow||t.polyfill||!HTMLElement.prototype.webkitCreateShadowRoot)&&"polyfill",e.flags=t}(Platform),"polyfill"===Platform.flags.shadow){var SideTable;"undefined"!=typeof WeakMap&&0>navigator.userAgent.indexOf("Firefox/")?SideTable=WeakMap:function(){var e=Object.defineProperty,t=Object.hasOwnProperty,n=(new Date).getTime()%1e9;SideTable=function(){this.name="__st"+(1e9*Math.random()>>>0)+(n++ +"__")},SideTable.prototype={set:function(t,n){e(t,this.name,{value:n,writable:!0})},get:function(e){return t.call(e,this.name)?e[this.name]:void 0},"delete":function(e){this.set(e,void 0)}}}();var ShadowDOMPolyfill={};(function(e){"use strict";function t(e){if(!e)throw Error("Assertion failed")}function n(e,t){return Object.getOwnPropertyNames(t).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function r(e,t){return Object.getOwnPropertyNames(t).forEach(function(n){switch(n){case"arguments":case"caller":case"length":case"name":case"prototype":case"toString":return}Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function i(e){var t=e.__proto__||Object.getPrototypeOf(e),n=w.get(t);if(n)return n;var r=i(t),o=d(r);return l(t,o,e),o}function o(e,t){s(e,t,!0)}function a(e,t){s(t,e,!1)}function s(e,t,n){Object.getOwnPropertyNames(e).forEach(function(r){if(!(r in t)){T&&e.__lookupGetter__(r);var i;try{i=Object.getOwnPropertyDescriptor(e,r)}catch(o){i=S}var a,s;if(n&&"function"==typeof i.value)return t[r]=function(){return this.impl[r].apply(this.impl,arguments)},void 0;a=function(){return this.impl[r]},(i.writable||i.set)&&(s=function(e){this.impl[r]=e}),Object.defineProperty(t,r,{get:a,set:s,configurable:i.configurable,enumerable:i.enumerable})}})}function c(e,t,n){var i=e.prototype;l(i,t,n),r(t,e)}function l(e,n,r){var i=n.prototype;t(void 0===w.get(e)),w.set(e,n),o(e,i),r&&a(i,r)}function u(e,t){return w.get(t.prototype)===e}function h(e){var t=Object.getPrototypeOf(e),n=i(t),r=d(n);return l(t,r,e),r}function d(e){function t(t){e.call(this,t)}return t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t}function p(e){if(null===e)return null;t(e instanceof C||e instanceof M||e instanceof P||e instanceof O);var n=y.get(e);if(!n){var r=i(e);n=new r(e),y.set(e,n)}return n}function f(e){return null===e?null:(t(e instanceof E.EventTarget||e instanceof E.Event||e instanceof E.DOMImplementation),e.impl)}function v(e,n){null!==n&&(t(e instanceof C||e instanceof M),t(void 0===n||n instanceof E.Node),y.set(e,n))}function m(e,t,n){Object.defineProperty(e.prototype,t,{get:n,configurable:!0,enumerable:!0})}function g(e,t){m(e,t,function(){return p(this.impl[t])})}function b(e,t){e.forEach(function(e){t.forEach(function(t){e.prototype[t]=function(){var e=p(this);return e[t].apply(e,arguments)}})})}var y=new SideTable,w=new SideTable,E=Object.create(null);Object.getOwnPropertyNames(window);var T=/Firefox/.test(navigator.userAgent),S={get:function(){},set:function(){},configurable:!0,enumerable:!0},O=DOMImplementation,M=Event,C=Node,P=Window;e.assert=t,e.defineGetter=m,e.defineWrapGetter=g,e.forwardMethodsToWrapper=b,e.isWrapperFor=u,e.mixin=n,e.registerObject=h,e.registerWrapper=c,e.rewrap=v,e.unwrap=f,e.wrap=p,e.wrappers=E})(this.ShadowDOMPolyfill),function(e){"use strict";function t(e){return e instanceof H.ShadowRoot}function n(e){var t=e.localName;return"content"===t||"shadow"===t}function r(e){return!!e.shadowRoot}function i(e){var t;return e.parentNode||(t=e.defaultView)&&x(t)||null}function o(o,a,s){if(s.length)return s.shift();if(t(o))return o.insertionParent||e.getHostForShadowRoot(o);var c=e.eventParentsTable.get(o);if(c){for(var l=1;c.length>l;l++)s[l-1]=c[l];return c[0]}if(a&&n(o)){var u=o.parentNode;if(u&&r(u))for(var h=e.getShadowTrees(u),d=a.insertionParent,l=0;h.length>l;l++)if(h[l].contains(d))return d}return i(o)}function a(e){for(var r=[],i=e,a=[],c=[];i;){var l=null;if(n(i)){l=s(r);var u=r[r.length-1]||i;r.push(u)}else r.length||r.push(i);var h=r[r.length-1];a.push({target:h,currentTarget:i}),t(i)&&r.pop(),i=o(i,l,c)}return a}function s(e){for(var t=e.length-1;t>=0;t--)if(!n(e[t]))return e[t];return null}function c(r,i){for(var a=[];r;){for(var c=[],u=i,d=void 0;u;){var p=null;if(c.length){if(n(u)&&(p=s(c),l(d))){var f=c[c.length-1];c.push(f)}}else c.push(u);if(h(u,r))return c[c.length-1];t(u)&&c.pop(),d=u,u=o(u,p,a)}r=t(r)?e.getHostForShadowRoot(r):r.parentNode}}function l(e){return e.insertionParent}function u(e){for(var t;t=e.parentNode;)e=t;return e}function h(e,t){return u(e)===u(t)}function d(e){switch(e){case"DOMAttrModified":case"DOMAttributeNameChanged":case"DOMCharacterDataModified":case"DOMElementNameChanged":case"DOMNodeInserted":case"DOMNodeInsertedIntoDocument":case"DOMNodeRemoved":case"DOMNodeRemovedFromDocument":case"DOMSubtreeModified":return!0}return!1}function p(t){if(!R.get(t)){R.set(t,!0),d(t.type)||e.renderAllPending();var n=x(t.target),r=x(t);return f(r,n)}}function f(e,t){var n=a(t);return"load"===e.type&&2===n.length&&n[0].target instanceof H.Document&&n.shift(),v(e,n)&&m(e,n)&&g(e,n),B.set(e,w.NONE),F.set(e,null),e.defaultPrevented}function v(e,t){for(var n,r=t.length-1;r>0;r--){var i=t[r].target,o=t[r].currentTarget;if(i!==o&&(n=w.CAPTURING_PHASE,!b(t[r],e,n)))return!1}return!0}function m(e,t){var n=w.AT_TARGET;return b(t[0],e,n)}function g(e,t){for(var n,r=e.bubbles,i=1;t.length>i;i++){var o=t[i].target,a=t[i].currentTarget;if(o===a)n=w.AT_TARGET;else{if(!r||W.get(e))continue;n=w.BUBBLING_PHASE}if(!b(t[i],e,n))return}}function b(e,t,n){var r=e.target,i=e.currentTarget,o=j.get(i);if(!o)return!0;if("relatedTarget"in t){var a=D(t),s=x(a.relatedTarget),l=c(i,s);if(l===r)return!0;U.set(t,l)}B.set(t,n);var u=t.type,h=!1;I.set(t,r),F.set(t,i);for(var d=0;o.length>d;d++){var p=o[d];if(p.removed)h=!0;else if(!(p.type!==u||!p.capture&&n===w.CAPTURING_PHASE||p.capture&&n===w.BUBBLING_PHASE))try{if("function"==typeof p.handler?p.handler.call(i,t):p.handler.handleEvent(t),W.get(t))return!1}catch(f){window.onerror?window.onerror(f.message):console.error(f)}}if(h){var v=o.slice();o.length=0;for(var d=0;v.length>d;d++)v[d].removed||o.push(v[d])}return!V.get(t)}function y(e,t,n){this.type=e,this.handler=t,this.capture=Boolean(n)}function w(e,t){return e instanceof q?(this.impl=e,void 0):x(O(q,"Event",e,t))}function E(e){return e&&e.relatedTarget?Object.create(e,{relatedTarget:{value:D(e.relatedTarget)}}):e}function T(e,t,n){var r=window[e],i=function(t,n){return t instanceof r?(this.impl=t,void 0):x(O(r,e,t,n))};return i.prototype=Object.create(t.prototype),n&&L(i.prototype,n),r&&A(r,i,document.createEvent(e)),i}function S(e,t){return function(){arguments[t]=D(arguments[t]);var n=D(this);n[e].apply(n,arguments)}}function O(e,t,n,r){if(Z)return new e(n,E(r));var i=D(document.createEvent(t)),o=J[t],a=[n];return Object.keys(o).forEach(function(e){var t=null!=r&&e in r?r[e]:o[e];"relatedTarget"===e&&(t=D(t)),a.push(t)}),i["init"+t].apply(i,a),i}function M(e){return"function"==typeof e?!0:e&&e.handleEvent}function C(e){this.impl=e}function P(t){return t instanceof H.ShadowRoot&&(t=e.getHostForShadowRoot(t)),D(t)}function _(e){N(e,nt)}function k(t,n,r,i){e.renderAllPending();for(var o=x(rt.call(n.impl,r,i)),s=a(o,this),c=0;s.length>c;c++){var l=s[c];if(l.currentTarget===t)return l.target}return null}var N=e.forwardMethodsToWrapper,L=e.mixin,A=e.registerWrapper,D=e.unwrap,x=e.wrap,H=e.wrappers;new SideTable;var j=new SideTable,R=new SideTable,I=new SideTable,F=new SideTable,U=new SideTable,B=new SideTable,V=new SideTable,W=new SideTable;y.prototype={equals:function(e){return this.handler===e.handler&&this.type===e.type&&this.capture===e.capture},get removed(){return null===this.handler},remove:function(){this.handler=null}};var q=window.Event;w.prototype={get target(){return I.get(this)},get currentTarget(){return F.get(this)},get eventPhase(){return B.get(this)},stopPropagation:function(){V.set(this,!0)},stopImmediatePropagation:function(){V.set(this,!0),W.set(this,!0)}},A(q,w,document.createEvent("Event"));var Y=T("UIEvent",w),G=T("CustomEvent",w),X={get relatedTarget(){return U.get(this)||x(D(this).relatedTarget)}},z=L({initMouseEvent:S("initMouseEvent",14)},X),K=L({initFocusEvent:S("initFocusEvent",5)},X),$=T("MouseEvent",Y,z),Q=T("FocusEvent",Y,K),J=Object.create(null),Z=function(){try{new window.MouseEvent("click")}catch(e){return!1}return!0}();if(!Z){var et=function(e,t,n){if(n){var r=J[n];t=L(L({},r),t)}J[e]=t};et("Event",{bubbles:!1,cancelable:!1}),et("CustomEvent",{detail:null},"Event"),et("UIEvent",{view:null,detail:0},"Event"),et("MouseEvent",{screenX:0,screenY:0,clientX:0,clientY:0,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,button:0,relatedTarget:null},"UIEvent"),et("FocusEvent",{relatedTarget:null},"UIEvent")}var tt=window.EventTarget,nt=["addEventListener","removeEventListener","dispatchEvent"];[Element,Window,Document].forEach(function(e){var t=e.prototype;nt.forEach(function(e){Object.defineProperty(t,e+"_",{value:t[e]})})}),C.prototype={addEventListener:function(e,t,n){if(M(t)){var r=new y(e,t,n),i=j.get(this);if(i){for(var o=0;i.length>o;o++)if(r.equals(i[o]))return}else i=[],j.set(this,i);i.push(r);var a=P(this);a.addEventListener_(e,p,!0)}},removeEventListener:function(e,t,n){n=Boolean(n);var r=j.get(this);if(r){for(var i=0,o=!1,a=0;r.length>a;a++)r[a].type===e&&r[a].capture===n&&(i++,r[a].handler===t&&(o=!0,r[a].remove()));if(o&&1===i){var s=P(this);s.removeEventListener_(e,p,!0)}}},dispatchEvent:function(e){var t=P(this);return t.dispatchEvent_(D(e))}},tt&&A(tt,C);var rt=document.elementFromPoint;e.adjustRelatedTarget=c,e.elementFromPoint=k,e.wrapEventTargetMethods=_,e.wrappers.CustomEvent=G,e.wrappers.Event=w,e.wrappers.EventTarget=C,e.wrappers.FocusEvent=Q,e.wrappers.MouseEvent=$,e.wrappers.UIEvent=Y}(this.ShadowDOMPolyfill),function(e){"use strict";function t(e,t){Object.defineProperty(e,t,{enumerable:!1})}function n(){this.length=0,t(this,"length")}function r(e){if(null==e)return e;for(var t=new n,r=0,i=e.length;i>r;r++)t[r]=o(e[r]);return t.length=i,t}function i(e,t){e.prototype[t]=function(){return r(this.impl[t].apply(this.impl,arguments))}}var o=e.wrap;n.prototype={item:function(e){return this[e]}},t(n.prototype,"item"),e.wrappers.NodeList=n,e.addWrapNodeListMethod=i,e.wrapNodeList=r}(this.ShadowDOMPolyfill),function(e){"use strict";function t(e){l(e instanceof o)}function n(e,t,n,r){if(e.nodeType!==o.DOCUMENT_FRAGMENT_NODE)return e.parentNode&&e.parentNode.removeChild(e),e.parentNode_=t,e.previousSibling_=n,e.nextSibling_=r,n&&(n.nextSibling_=e),r&&(r.previousSibling_=e),[e];for(var i,a=[];i=e.firstChild;)e.removeChild(i),a.push(i),i.parentNode_=t;for(var s=0;a.length>s;s++)a[s].previousSibling_=a[s-1]||n,a[s].nextSibling_=a[s+1]||r;return n&&(n.nextSibling_=a[0]),r&&(r.previousSibling_=a[a.length-1]),a}function r(e){if(1===e.length)return d(e[0]);for(var t=d(document.createDocumentFragment()),n=0;e.length>n;n++)t.appendChild(d(e[n]));return t}function i(e){for(var t=e.firstChild;t;){l(t.parentNode===e);var n=t.nextSibling,r=d(t);t.previousSibling_=t.nextSibling_=t.parentNode_=null;var i=r.parentNode;i&&b.call(i,r),t=n}e.firstChild_=e.lastChild_=null}function o(e){l(e instanceof f),a.call(this,e),this.parentNode_=void 0,this.firstChild_=void 0,this.lastChild_=void 0,this.nextSibling_=void 0,this.previousSibling_=void 0}var a=e.wrappers.EventTarget,s=e.wrappers.NodeList,c=e.defineWrapGetter,l=e.assert,u=e.mixin,h=e.registerWrapper,d=e.unwrap,p=e.wrap,f=window.Node,v=f.prototype.appendChild,m=f.prototype.insertBefore,g=f.prototype.replaceChild,b=f.prototype.removeChild;o.prototype=Object.create(a.prototype),u(o.prototype,{appendChild:function(e){t(e),this.invalidateShadowRenderer();var i=this.lastChild,o=null,a=n(e,this,i,o);return this.lastChild_=a[a.length-1],i||(this.firstChild_=a[0]),v.call(this.impl,r(a)),e},insertBefore:function(e,i){if(!i)return this.appendChild(e);t(e),t(i),l(i.parentNode===this),this.invalidateShadowRenderer();var o=i.previousSibling,a=i,s=n(e,this,o,a);this.firstChild===i&&(this.firstChild_=s[0]);var c=d(i),u=c.parentNode;return u&&m.call(u,r(s),c),e},removeChild:function(e){if(t(e),e.parentNode!==this)throw Error("NotFoundError");this.invalidateShadowRenderer(),this.firstChild===e&&(this.firstChild_=e.nextSibling),this.lastChild===e&&(this.lastChild_=e.previousSibling),e.previousSibling&&(e.previousSibling.nextSibling_=e.nextSibling),e.nextSibling&&(e.nextSibling.previousSibling_=e.previousSibling),e.previousSibling_=e.nextSibling_=e.parentNode_=null;var n=d(e),r=n.parentNode;return r&&b.call(r,n),e},replaceChild:function(e,i){if(t(e),t(i),i.parentNode!==this)throw Error("NotFoundError");this.invalidateShadowRenderer();var o=i.previousSibling,a=i.nextSibling;a===e&&(a=e.nextSibling);var s=n(e,this,o,a);this.firstChild===i&&(this.firstChild_=s[0]),this.lastChild===i&&(this.lastChild_=s[s.length-1]),i.previousSibling_=null,i.nextSibling_=null,i.parentNode_=null;var c=d(i);return c.parentNode&&g.call(c.parentNode,r(s),c),i},hasChildNodes:function(){return null===this.firstChild},get parentNode(){return void 0!==this.parentNode_?this.parentNode_:p(this.impl.parentNode)},get firstChild(){return void 0!==this.firstChild_?this.firstChild_:p(this.impl.firstChild)},get lastChild(){return void 0!==this.lastChild_?this.lastChild_:p(this.impl.lastChild)},get nextSibling(){return void 0!==this.nextSibling_?this.nextSibling_:p(this.impl.nextSibling)},get previousSibling(){return void 0!==this.previousSibling_?this.previousSibling_:p(this.impl.previousSibling)},get parentElement(){for(var e=this.parentNode;e&&e.nodeType!==o.ELEMENT_NODE;)e=e.parentNode;return e},get textContent(){for(var e="",t=this.firstChild;t;t=t.nextSibling)e+=t.textContent;return e},set textContent(e){if(i(this),this.invalidateShadowRenderer(),""!==e){var t=this.impl.ownerDocument.createTextNode(e);this.appendChild(t)}},get childNodes(){for(var e=new s,t=0,n=this.firstChild;n;n=n.nextSibling)e[t++]=n;return e.length=t,e},cloneNode:function(e){if(!this.invalidateShadowRenderer())return p(this.impl.cloneNode(e));var t=p(this.impl.cloneNode(!1));if(e)for(var n=this.firstChild;n;n=n.nextSibling)t.appendChild(n.cloneNode(!0));return t},contains:function(e){if(e===this)return!0;var t=e.parentNode;return t?this.contains(t):!1}}),c(o,"ownerDocument"),h(f,o,document.createDocumentFragment()),delete o.prototype.querySelector,delete o.prototype.querySelectorAll,o.prototype=u(Object.create(a.prototype),o.prototype),e.wrappers.Node=o}(this.ShadowDOMPolyfill),function(e){"use strict";function t(e,n){for(var r,i=e.firstElementChild;i;){if(i.matches(n))return i;if(r=t(i,n))return r;i=i.nextElementSibling}return null}function n(e,t,r){for(var i=e.firstElementChild;i;)i.matches(t)&&(r[r.length++]=i),n(i,t,r),i=i.nextElementSibling;return r}var r={querySelector:function(e){return t(this,e)},querySelectorAll:function(e){return n(this,e,new NodeList)}},i={getElementsByTagName:function(e){return this.querySelectorAll(e)},getElementsByClassName:function(e){return this.querySelectorAll("."+e)},getElementsByTagNameNS:function(e,t){if("*"===e)return this.getElementsByTagName(t);for(var n=new NodeList,r=this.getElementsByTagName(t),i=0,o=0;r.length>i;i++)r[i].namespaceURI===e&&(n[o++]=r[i]);return n.length=o,n}};e.GetElementsByInterface=i,e.SelectorsInterface=r}(this.ShadowDOMPolyfill),function(e){"use strict";function t(e){for(;e&&e.nodeType!==Node.ELEMENT_NODE;)e=e.nextSibling;return e}function n(e){for(;e&&e.nodeType!==Node.ELEMENT_NODE;)e=e.previousSibling;return e}var r=e.wrappers.NodeList;e.mixin,e.wrap,e.wrapNodeList;var i={get firstElementChild(){return t(this.firstChild)},get lastElementChild(){return n(this.lastChild)},get childElementCount(){for(var e=0,t=this.firstElementChild;t;t=t.nextElementSibling)e++;return e},get children(){for(var e=new r,t=0,n=this.firstElementChild;n;n=n.nextElementSibling)e[t++]=n;return e.length=t,e}},o={get nextElementSibling(){return t(this.nextSibling)},get previousElementSibling(){return n(this.nextSibling)}};e.ChildNodeInterface=o,e.ParentNodeInterface=i}(this.ShadowDOMPolyfill),function(e){"use strict";function t(e){r.call(this,e)}var n=e.ChildNodeInterface,r=e.wrappers.Node,i=e.mixin,o=e.registerWrapper,a=window.CharacterData;t.prototype=Object.create(r.prototype),i(t.prototype,{get textContent(){return this.data},set textContent(e){this.data=e}}),i(t.prototype,n),o(a,t,document.createTextNode("")),e.wrappers.CharacterData=t}(this.ShadowDOMPolyfill),function(e){"use strict";function t(e){i.call(this,e)}var n=e.ChildNodeInterface,r=e.GetElementsByInterface,i=e.wrappers.Node,o=e.ParentNodeInterface,a=e.SelectorsInterface;e.addWrapNodeListMethod;var s=e.mixin,c=e.registerWrapper,l=e.wrappers,u=new SideTable,h=window.Element,d=h.prototype.matches||h.prototype.mozMatchesSelector||h.prototype.msMatchesSelector||h.prototype.webkitMatchesSelector;t.prototype=Object.create(i.prototype),s(t.prototype,{createShadowRoot:function(){var t=new l.ShadowRoot(this);return u.set(this,t),e.getRendererForHost(this),this.invalidateShadowRenderer(!0),t},get shadowRoot(){return u.get(this)||null},setAttribute:function(e,t){this.impl.setAttribute(e,t),this.invalidateShadowRenderer()},matches:function(e){return d.call(this.impl,e)}}),s(t.prototype,n),s(t.prototype,r),s(t.prototype,o),s(t.prototype,a),c(h,t),e.wrappers.Element=t}(this.ShadowDOMPolyfill),function(e){"use strict";function t(e){switch(e){case"&":return"&";case"<":return"<";case'"':return"""}}function n(e){return e.replace(v,t)}function r(e){switch(e.nodeType){case Node.ELEMENT_NODE:for(var t,r=e.tagName.toLowerCase(),o="<"+r,a=e.attributes,s=0;t=a[s];s++)o+=" "+t.name+'="'+n(t.value)+'"';return o+=">",m[r]?o:o+i(e)+"</"+r+">";case Node.TEXT_NODE:return n(e.nodeValue);case Node.COMMENT_NODE:return"<!--"+n(e.nodeValue)+"-->";default:throw console.error(e),Error("not implemented")}}function i(e){for(var t="",n=e.firstChild;n;n=n.nextSibling)t+=r(n);return t}function o(e,t,n){var r=n||"div";e.textContent="";var i=p(e.ownerDocument.createElement(r));i.innerHTML=t;for(var o;o=i.firstChild;)e.appendChild(f(o))}function a(e){l.call(this,e)}function s(t){u(a,t,function(){return e.renderAllPending(),this.impl[t]})}function c(t){Object.defineProperty(a.prototype,t,{value:function(){return e.renderAllPending(),this.impl[t].apply(this.impl,arguments)},configurable:!0,enumerable:!0})}var l=e.wrappers.Element,u=e.defineGetter,h=e.mixin,d=e.registerWrapper,p=e.unwrap,f=e.wrap,v=/&|<|"/g,m={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},g=window.HTMLElement;a.prototype=Object.create(l.prototype),h(a.prototype,{get innerHTML(){return i(this)},set innerHTML(e){o(this,e,this.tagName)},get outerHTML(){return r(this)},set outerHTML(e){if(this.invalidateShadowRenderer())throw Error("not implemented");this.impl.outerHTML=e}}),["clientHeight","clientLeft","clientTop","clientWidth","offsetHeight","offsetLeft","offsetTop","offsetWidth","scrollHeight","scrollLeft","scrollTop","scrollWidth"].forEach(s),["getBoundingClientRect","getClientRects","scrollIntoView"].forEach(c),d(g,a,document.createElement("b")),e.wrappers.HTMLElement=a,e.getInnerHTML=i,e.setInnerHTML=o}(this.ShadowDOMPolyfill),function(e){"use strict";function t(e){n.call(this,e)}var n=e.wrappers.HTMLElement,r=e.mixin,i=e.registerWrapper,o=window.HTMLContentElement;t.prototype=Object.create(n.prototype),r(t.prototype,{get select(){return this.getAttribute("select")},set select(e){this.setAttribute("select",e)},setAttribute:function(e,t){n.prototype.setAttribute.call(this,e,t),"select"===(e+"").toLowerCase()&&this.invalidateShadowRenderer(!0)}}),o&&i(o,t),e.wrappers.HTMLContentElement=t}(this.ShadowDOMPolyfill),function(e){"use strict";function t(e){n.call(this,e),this.olderShadowRoot_=null}var n=e.wrappers.HTMLElement,r=e.mixin,i=e.registerWrapper,o=window.HTMLShadowElement;t.prototype=Object.create(n.prototype),r(t.prototype,{get olderShadowRoot(){return this.olderShadowRoot_},invalidateShadowRenderer:function(){n.prototype.invalidateShadowRenderer.call(this,!0)}}),o&&i(o,t),e.wrappers.HTMLShadowElement=t}(this.ShadowDOMPolyfill),function(e){"use strict";function t(e){if(!e.defaultView)return e;var t=h.get(e);if(!t){for(t=e.implementation.createHTMLDocument("");t.lastChild;)t.removeChild(t.lastChild);h.set(e,t)}return t}function n(e){for(var n,r=t(e.ownerDocument),i=r.createDocumentFragment();n=e.firstChild;)i.appendChild(n);return i}function r(e){i.call(this,e)}var i=e.wrappers.HTMLElement,o=e.getInnerHTML,a=e.mixin,s=e.registerWrapper,c=e.setInnerHTML,l=e.wrap,u=new SideTable,h=new SideTable,d=window.HTMLTemplateElement;r.prototype=Object.create(i.prototype),a(r.prototype,{get content(){if(d)return l(this.impl.content);var e=u.get(this);return e||(e=n(this),u.set(this,e)),e},get innerHTML(){return o(this.content)},set innerHTML(e){c(this.content,e),this.invalidateShadowRenderer()}}),d&&s(d,r),e.wrappers.HTMLTemplateElement=r}(this.ShadowDOMPolyfill),function(e){"use strict";function t(e){switch(e.localName){case"content":return new n(e);case"shadow":return new i(e);case"template":return new o(e)}r.call(this,e)}var n=e.wrappers.HTMLContentElement,r=e.wrappers.HTMLElement,i=e.wrappers.HTMLShadowElement,o=e.wrappers.HTMLTemplateElement;e.mixin;var a=e.registerWrapper,s=window.HTMLUnknownElement;t.prototype=Object.create(r.prototype),a(s,t),e.wrappers.HTMLUnknownElement=t}(this.ShadowDOMPolyfill),function(e){"use strict";var t=e.GetElementsByInterface,n=e.ParentNodeInterface,r=e.SelectorsInterface,i=e.mixin,o=e.registerObject,a=o(document.createDocumentFragment());i(a.prototype,n),i(a.prototype,r),i(a.prototype,t);var s=o(document.createTextNode("")),c=o(document.createComment(""));e.wrappers.Comment=c,e.wrappers.DocumentFragment=a,e.wrappers.Text=s}(this.ShadowDOMPolyfill),function(e){"use strict";function t(t){var r=c(t.impl.ownerDocument.createDocumentFragment());n.call(this,r),a(r,this);var i=t.shadowRoot;e.nextOlderShadowTreeTable.set(this,i),l.set(this,t)}var n=e.wrappers.DocumentFragment,r=e.elementFromPoint,i=e.getInnerHTML,o=e.mixin,a=e.rewrap,s=e.setInnerHTML,c=e.unwrap,l=new SideTable;t.prototype=Object.create(n.prototype),o(t.prototype,{get innerHTML(){return i(this)},set innerHTML(e){s(this,e),this.invalidateShadowRenderer()},invalidateShadowRenderer:function(){return l.get(this).invalidateShadowRenderer()},elementFromPoint:function(e,t){return r(this,this.ownerDocument,e,t)},getElementById:function(e){return this.querySelector("#"+e)}}),e.wrappers.ShadowRoot=t,e.getHostForShadowRoot=function(e){return l.get(e)}}(this.ShadowDOMPolyfill),function(e){"use strict";function t(e){e.previousSibling_=e.previousSibling,e.nextSibling_=e.nextSibling,e.parentNode_=e.parentNode}function n(e){e.firstChild_=e.firstChild,e.lastChild_=e.lastChild}function r(e){L(e instanceof N);for(var r=e.firstChild;r;r=r.nextSibling)t(r);n(e)}function i(e){var t=D(e);r(e),t.textContent=""}function o(e,n){var i=D(e),o=D(n);o.nodeType===N.DOCUMENT_FRAGMENT_NODE?r(n):(s(n),t(n)),e.lastChild_=e.lastChild,e.lastChild===e.firstChild&&(e.firstChild_=e.firstChild);var a=x(i.lastChild);a&&(a.nextSibling_=a.nextSibling),i.appendChild(o)}function a(e,n){var r=D(e),i=D(n);t(n),n.previousSibling&&(n.previousSibling.nextSibling_=n),n.nextSibling&&(n.nextSibling.previousSibling_=n),e.lastChild===n&&(e.lastChild_=n),e.firstChild===n&&(e.firstChild_=n),r.removeChild(i)}function s(e){var t=D(e),n=t.parentNode;n&&a(x(n),e)}function c(e,t){u(t).push(e),R.set(e,t);var n=j.get(e);n||j.set(e,n=[]),n.push(t)}function l(e){H.set(e,[])}function u(e){return H.get(e)}function h(e){for(var t=[],n=0,r=e.firstChild;r;r=r.nextSibling)t[n++]=r;return t}function d(e,t,n){for(var r=h(e),i=0;r.length>i;i++){var o=r[i];if(t(o)){if(n(o)===!1)return}else d(o,t,n)}}function p(e,t){var n=!1;return d(e,w,function(e){l(e);for(var r=0;t.length>r;r++){var i=t[r];void 0!==i&&v(i,e)&&(c(i,e),t[r]=void 0,n=!0)}}),n?t.filter(function(e){return void 0!==e}):t}function f(e,t){for(var n=0;t.length>n;n++)if(t[n]in e)return t[n]}function v(e,t){var n=t.getAttribute("select");if(!n)return!0;if(n=n.trim(),!n)return!0;if(e.nodeType!==N.ELEMENT_NODE)return!1;if(!B.test(n))return!1;if(":"===n[0]&&!V.test(n))return!1;try{return e.matches(n)}catch(r){return!1}}function m(){_=null,q.forEach(function(e){e.render()}),q=[]}function g(e){this.host=e,this.dirty=!1,this.associateNode(e)}function b(e){var t=F.get(e);return t||(t=new g(e),F.set(e,t)),t}function y(e){return"content"===e.localName}function w(e){return"content"===e.localName}function E(e){return"shadow"===e.localName}function T(e){return"shadow"===e.localName}function S(e){return!!e.shadowRoot}function O(e){return I.get(e)}function M(e){for(var t=[],n=e.shadowRoot;n;n=I.get(n))t.push(n);return t}function C(e,t){R.set(e,t)}function P(e){new g(e).render()}var _,k=e.wrappers.HTMLContentElement,N=e.wrappers.Node,L=e.assert,A=e.mixin,D=e.unwrap,x=e.wrap,H=new SideTable,j=new SideTable,R=new SideTable,I=new SideTable,F=new SideTable,U=new SideTable,B=/^[*.:#[a-zA-Z_|]/,V=RegExp("^:("+["link","visited","target","enabled","disabled","checked","indeterminate","nth-child","nth-last-child","nth-of-type","nth-last-of-type","first-child","last-child","first-of-type","last-of-type","only-of-type"].join("|")+")"),W=f(window,["requestAnimationFrame","mozRequestAnimationFrame","webkitRequestAnimationFrame","setTimeout"]),q=[];g.prototype={render:function(){if(this.dirty){var e=this.host;this.treeComposition();var t=e.shadowRoot;if(t){this.removeAllChildNodes(this.host);var n=h(t);n.forEach(function(n){this.renderNode(e,t,n,!1)},this),this.dirty=!1}}},invalidate:function(){if(!this.dirty){if(this.dirty=!0,q.push(this),_)return;_=window[W](m,0)}},renderNode:function(e,t,n,r){if(S(n)){this.appendChild(e,n);var i=b(n);i.dirty=!0,i.render()}else y(n)?this.renderInsertionPoint(e,t,n,r):E(n)?this.renderShadowInsertionPoint(e,t,n):this.renderAsAnyDomTree(e,t,n,r)},renderAsAnyDomTree:function(e,t,n,r){if(this.appendChild(e,n),S(n))P(n);else{var i=n,o=h(i);o.forEach(function(e){this.renderNode(i,t,e,r)},this)}},renderInsertionPoint:function(e,t,n,r){var i=u(n);i.length?(this.removeAllChildNodes(n),i.forEach(function(n){y(n)&&r?this.renderInsertionPoint(e,t,n,r):this.renderAsAnyDomTree(e,t,n,r)},this)):this.renderFallbackContent(e,n),this.remove(n)},renderShadowInsertionPoint:function(e,t,n){var r=O(t);if(r){R.set(r,n),n.olderShadowRoot_=r,this.remove(n);var i=h(r);i.forEach(function(t){this.renderNode(e,r,t,!0)},this)}else this.renderFallbackContent(e,n)},renderFallbackContent:function(e,t){var n=h(t);n.forEach(function(t){this.appendChild(e,t)},this)},treeComposition:function(){var e=this.host,t=e.shadowRoot,n=[],r=h(e);r.forEach(function(e){if(y(e)){var t=u(e);t&&t.length||(t=h(e)),n.push.apply(n,t)}else n.push(e)});for(var i,o;t;){if(i=void 0,d(t,T,function(e){return i=e,!1}),o=i,n=p(t,n),o){var a=O(t);if(a){t=a,C(t,o);continue}break}break}},appendChild:function(e,t){o(e,t),this.associateNode(t)},remove:function(e){s(e),this.associateNode(e)},removeAllChildNodes:function(e){i(e)},associateNode:function(e){U.set(e,this)}},N.prototype.invalidateShadowRenderer=function(e){var t=U.get(this);if(!t)return!1;var n;return(e||this.shadowRoot||(n=this.parentNode)&&(n.shadowRoot||n instanceof ShadowRoot))&&t.invalidate(),!0},k.prototype.getDistributedNodes=function(){return m(),u(this)},A(N.prototype,{get insertionParent(){return R.get(this)||null}}),e.eventParentsTable=j,e.getRendererForHost=b,e.getShadowTrees=M,e.nextOlderShadowTreeTable=I,e.renderAllPending=m,e.visual={removeAllChildNodes:i,appendChild:o,removeChild:a}}(this.ShadowDOMPolyfill),function(e){"use strict";function t(e){s.call(this,e)}function n(e){var n=document[e];t.prototype[e]=function(){return m(n.apply(this.impl,arguments))}}function r(e){this.impl=e}function i(e,t){var n=document.implementation[t];e.prototype[t]=function(){return m(n.apply(this.impl,arguments))}}function o(e,t){var n=document.implementation[t];e.prototype[t]=function(){return n.apply(this.impl,arguments)}}var a=e.GetElementsByInterface,s=e.wrappers.Node,c=e.ParentNodeInterface,l=e.SelectorsInterface,u=e.defineWrapGetter,h=e.elementFromPoint,d=e.forwardMethodsToWrapper,p=e.mixin,f=e.registerWrapper,v=e.unwrap,m=e.wrap,g=e.wrapEventTargetMethods;e.wrapNodeList;var b=new SideTable;t.prototype=Object.create(s.prototype),u(t,"documentElement"),u(t,"body"),u(t,"head"),["getElementById","createElement","createElementNS","createTextNode","createDocumentFragment","createEvent","createEventNS"].forEach(n);var y=document.adoptNode,w=document.write;p(t.prototype,{adoptNode:function(e){return y.call(this.impl,v(e)),e},elementFromPoint:function(e,t){return h(this,this,e,t)},write:function(e){for(var t=this.querySelectorAll("*"),n=t[t.length-1];n.nextSibling;)n=n.nextSibling;var r=n.parentNode;r.lastChild_=void 0,n.nextSibling_=void 0,w.call(this.impl,e)}}),d([window.HTMLBodyElement,window.HTMLDocument||window.Document,window.HTMLHeadElement],["appendChild","getElementsByClassName","getElementsByTagName","getElementsByTagNameNS","insertBefore","querySelector","querySelectorAll","removeChild","replaceChild"]),d([window.HTMLDocument||window.Document],["adoptNode","createDocumentFragment","createElement","createElementNS","createEvent","createEventNS","createTextNode","elementFromPoint","getElementById","write"]),p(t.prototype,a),p(t.prototype,c),p(t.prototype,l),p(t.prototype,{get implementation(){var e=b.get(this);return e?e:(e=new r(v(this).implementation),b.set(this,e),e)}}),f(window.Document,t,document.implementation.createHTMLDocument("")),window.HTMLDocument&&f(window.HTMLDocument,t),g([window.HTMLBodyElement,window.HTMLDocument||window.Document,window.HTMLHeadElement]),i(r,"createDocumentType"),i(r,"createDocument"),i(r,"createHTMLDocument"),o(r,"hasFeature"),f(window.DOMImplementation,r),d([window.DOMImplementation],["createDocumentType","createDocument","createHTMLDocument","hasFeature"]),e.wrappers.Document=t,e.wrappers.DOMImplementation=r}(this.ShadowDOMPolyfill),function(e){"use strict";function t(e){n.call(this,e)}var n=e.wrappers.EventTarget,r=e.mixin,i=e.registerWrapper,o=e.unwrap,a=e.wrap,s=window.Window;t.prototype=Object.create(n.prototype);var c=window.getComputedStyle;s.prototype.getComputedStyle=function(e,t){return c.call(this||window,o(e),t)},["addEventListener","removeEventListener","dispatchEvent"].forEach(function(e){s.prototype[e]=function(){var t=a(this||window);return t[e].apply(t,arguments)}}),r(t.prototype,{getComputedStyle:function(e,t){return c.call(o(this),o(e),t)}}),i(s,t),e.wrappers.Window=t}(this.ShadowDOMPolyfill),function(e){"use strict";function t(e){this.impl=e}function n(e){return new t(e)}function r(e){return e.map(n)}function i(e){var t=this;this.impl=new h(function(n){e.call(t,r(n),t)})}var o=e.defineGetter,a=e.defineWrapGetter,s=e.registerWrapper,c=e.unwrap;e.wrap;var l=e.wrapNodeList,u=e.wrappers,h=window.MutationObserver||window.WebKitMutationObserver;if(h){var d=window.MutationRecord;t.prototype={get addedNodes(){return l(this.impl.addedNodes)},get removedNodes(){return l(this.impl.removedNodes)}},["target","previousSibling","nextSibling"].forEach(function(e){a(t,e)}),["type","attributeName","attributeNamespace","oldValue"].forEach(function(e){o(t,e,function(){return this.impl[e]})}),d&&s(d,t),window.Node,i.prototype={observe:function(e,t){e instanceof u.Node&&(e=c(e)),this.impl.observe(e,t)},disconnect:function(){this.impl.disconnect()
},takeRecords:function(){return r(this.impl.takeRecords())}},e.wrappers.MutationObserver=i,e.wrappers.MutationRecord=t}}(this.ShadowDOMPolyfill),function(e){"use strict";function t(e){var t=n[e],r=window[t];if(r){var i=document.createElement(e),o=i.constructor;window[t]=o}}e.isWrapperFor,Object.getOwnPropertyNames(e.wrappers).forEach(function(t){window[t]=e.wrappers[t]});var n={a:"HTMLAnchorElement",applet:"HTMLAppletElement",area:"HTMLAreaElement",audio:"HTMLAudioElement",br:"HTMLBRElement",base:"HTMLBaseElement",body:"HTMLBodyElement",button:"HTMLButtonElement",canvas:"HTMLCanvasElement",dl:"HTMLDListElement",datalist:"HTMLDataListElement",dir:"HTMLDirectoryElement",div:"HTMLDivElement",embed:"HTMLEmbedElement",fieldset:"HTMLFieldSetElement",font:"HTMLFontElement",form:"HTMLFormElement",frame:"HTMLFrameElement",frameset:"HTMLFrameSetElement",hr:"HTMLHRElement",head:"HTMLHeadElement",h1:"HTMLHeadingElement",html:"HTMLHtmlElement",iframe:"HTMLIFrameElement",input:"HTMLInputElement",li:"HTMLLIElement",label:"HTMLLabelElement",legend:"HTMLLegendElement",link:"HTMLLinkElement",map:"HTMLMapElement",menu:"HTMLMenuElement",menuitem:"HTMLMenuItemElement",meta:"HTMLMetaElement",meter:"HTMLMeterElement",del:"HTMLModElement",ol:"HTMLOListElement",object:"HTMLObjectElement",optgroup:"HTMLOptGroupElement",option:"HTMLOptionElement",output:"HTMLOutputElement",p:"HTMLParagraphElement",param:"HTMLParamElement",pre:"HTMLPreElement",progress:"HTMLProgressElement",q:"HTMLQuoteElement",script:"HTMLScriptElement",select:"HTMLSelectElement",source:"HTMLSourceElement",span:"HTMLSpanElement",style:"HTMLStyleElement",caption:"HTMLTableCaptionElement",col:"HTMLTableColElement",table:"HTMLTableElement",tr:"HTMLTableRowElement",thead:"HTMLTableSectionElement",tbody:"HTMLTableSectionElement",textarea:"HTMLTextAreaElement",title:"HTMLTitleElement",ul:"HTMLUListElement",video:"HTMLVideoElement"};Object.keys(n).forEach(t),e.knownElements=n}(this.ShadowDOMPolyfill),function(){window.wrap=function(e){return e.impl?e:ShadowDOMPolyfill.wrap(e)},window.unwrap=function(e){return e.impl?ShadowDOMPolyfill.unwrap(e):e},Object.defineProperties(HTMLElement.prototype,{webkitShadowRoot:{get:function(){return this.shadowRoot}}}),HTMLElement.prototype.webkitCreateShadowRoot=HTMLElement.prototype.createShadowRoot}()}else(function(){window.templateContent=window.templateContent||function(e){return e.content},window.wrap=window.unwrap=function(e){return e},window.createShadowRoot=function(e){return e.webkitCreateShadowRoot()},window.templateContent=function(e){if(window.HTMLTemplateElement&&HTMLTemplateElement.bootstrap&&HTMLTemplateElement.bootstrap(e),!e.content&&!e._content){for(var t=document.createDocumentFragment();e.firstChild;)t.appendChild(e.firstChild);e._content=t}return e.content||e._content}})();Function.prototype.bind||(Function.prototype.bind=function(e){var t=this,n=Array.prototype.slice.call(arguments,1);return function(){var r=n.slice();return r.push.apply(r,arguments),t.apply(e,r)}}),function(){"use strict";var e=DOMTokenList.prototype.add,t=DOMTokenList.prototype.remove;DOMTokenList.prototype.add=function(){for(var t=0;arguments.length>t;t++)e.call(this,arguments[t])},DOMTokenList.prototype.remove=function(){for(var e=0;arguments.length>e;e++)t.call(this,arguments[e])},DOMTokenList.prototype.toggle=function(e,t){1==arguments.length&&(t=!this.contains(e)),t?this.add(e):this.remove(e)},window.requestAnimationFrame||(window.requestAnimationFrame=function(){return window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(e){return window.setTimeout(e,1e3/60)}}()),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(){return window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||function(e){clearTimeout(e)}}())}(),window.templateContent=window.templateContent||function(e){return e.content},function(e){e=e||(window.Inspector={});var t;window.sinspect=function(e,r){t||(t=window.open("","ShadowDOM Inspector",null,!0),t.document.write(n),t.api={shadowize:shadowize}),o(e||wrap(document.body),r)};var n=["<!DOCTYPE html>","<html>"," <head>"," <title>ShadowDOM Inspector</title>"," <style>"," body {"," }"," pre {",' font: 9pt "Courier New", monospace;'," line-height: 1.5em;"," }"," tag {"," color: purple;"," }"," ul {"," margin: 0;"," padding: 0;"," list-style: none;"," }"," li {"," display: inline-block;"," background-color: #f1f1f1;"," padding: 4px 6px;"," border-radius: 4px;"," margin-right: 4px;"," }"," </style>"," </head>"," <body>",' <ul id="crumbs">'," </ul>",' <div id="tree"></div>'," </body>","</html>"].join("\n"),r=[],i=function(){var e=t.document,n=e.querySelector("#crumbs");n.textContent="";for(var i,a=0;i=r[a];a++){var s=e.createElement("a");s.href="#",s.textContent=i.localName,s.idx=a,s.onclick=function(e){for(var t;r.length>this.idx;)t=r.pop();o(t.shadow||t,t),e.preventDefault()},n.appendChild(e.createElement("li")).appendChild(s)}},o=function(e,n){var o=t.document;u=[];var a=n||e;r.push(a),i(),o.body.querySelector("#tree").innerHTML="<pre>"+l(e,e.childNodes)+"</pre>"},a=Array.prototype.forEach.call.bind(Array.prototype.forEach),s={STYLE:1,SCRIPT:1,"#comment":1,TEMPLATE:1},c=function(e){return s[e.nodeName]},l=function(e,t,n){if(c(e))return"";var r=n||"";if(e.localName||11==e.nodeType){var i=e.localName||"shadow-root",o=r+h(e);"content"==i&&(t=e.getDistributedNodes()),o+="<br/>";var s=r+" ";a(t,function(e){o+=l(e,e.childNodes,s)}),o+=r,{br:1}[i]||(o+="<tag></"+i+"></tag>",o+="<br/>")}else{var u=e.textContent.trim();o=u?r+'"'+u+'"'+"<br/>":""}return o},u=[],h=function(e){var t="<tag><",n=e.localName||"shadow-root";return e.webkitShadowRoot||e.shadowRoot?(t+=' <button idx="'+u.length+'" onclick="api.shadowize.call(this)">'+n+"</button>",u.push(e)):t+=n||"shadow-root",e.attributes&&a(e.attributes,function(e){t+=" "+e.name+(e.value?'="'+e.value+'"':"")}),t+="></tag>"};shadowize=function(){var e=Number(this.attributes.idx.value),t=u[e];t?o(t.webkitShadowRoot||t.shadowRoot,t):(console.log("bad shadowize node"),console.dir(this))},e.output=l}(window.Inspector),function(e){"use strict";function t(e){return+e===e>>>0}function n(e){return+e}function r(e){return e===Object(e)}function i(e,t){return e===t?0!==e||1/e===1/t:A(e)&&A(t)?!0:e!==e&&t!==t}function o(){function e(e){var t=n.get(e);return t||(t=Object.create(null),n.set(e,t)),t}function t(e){if(null===e)return"$0";var t,n;switch(typeof e){case"undefined":return"$1";case"boolean":return"$"+(e+2);case"object":case"function":return n=r.get(e),n||(n="$"+a++,r.set(e,n)),n;case"number":t=i;break;case"string":t=o}return n=t[e],n||(n="$"+a++,t[e]=n),n}if(!Map.prototype.forEach||!Set.prototype.forEach){var n=new WeakMap,r=new WeakMap,i=Object.create(null),o=Object.create(null),a=4,s=Map.prototype.set,c=Map.prototype.delete,l=Set.prototype.add,u=Set.prototype.delete;Map.prototype.set=function(n,r){var i=t(n),o=e(this);return o[i]=n,s.call(this,n,r)},Map.prototype.delete=function(n){var r=t(n),i=e(this);return delete i[r],c.call(this,n)},Map.prototype.forEach=function(t,n){var r=e(this);for(var i in r){var o=r[i],a=this.get(o);t.call(n||this,a,o,this)}},Set.prototype.add=function(n){var r=t(n),i=e(this);return i[r]=n,l.call(this,n)},Set.prototype.delete=function(n){var r=t(n),i=e(this);return delete i[r],u.call(this,n)},Set.prototype.forEach=function(t,n){var r=e(this);for(var i in r){var o=r[i];t.call(n||this,o,o,this)}},Map.getValueSet=function(e){var t=new Set;return e.forEach(function(e){t.add(e)}),t}}}function a(e){function t(){this.values_=[],this.keys_=[]}function n(){this.keys_=[]}t.prototype={get:function(e){return this.values_[this.keys_.indexOf(e)]},set:function(e,t){var n=this.keys_.indexOf(e);0>n&&(n=this.keys_.length),this.keys_[n]=e,this.values_[n]=t},has:function(e){return this.keys_.indexOf(e)>=0},"delete":function(e){var t=this.keys_.indexOf(e);return 0>t?!1:(this.keys_.splice(t,1),this.values_.splice(t,1),!0)},forEach:function(e,t){for(var n=0;this.keys_.length>n;n++)e.call(t||this,this.values_[n],this.keys_[n],this)},get size(){return this.keys_.length}},n.prototype={add:function(e){0>this.keys_.indexOf(e)&&this.keys_.push(e)},has:function(e){return this.keys_.indexOf(e)>=0},"delete":function(e){var t=this.keys_.indexOf(e);return 0>t?!1:(this.keys_.splice(t,1),!0)},forEach:function(e,t){for(var n=0;this.keys_.length>n;n++)e.call(t||this,this.keys_[n],this.keys_[n],this)},get size(){return this.keys_.length}},t.getValueSet=function(e){var t=new n;return t.keys_=e.values_.slice(),t},e.Map=t,e.Set=n}function s(e){return"string"!=typeof e?!1:(e=e.replace(/\s/g,""),""==e?!0:"."==e[0]?!1:j.test(e))}function c(e){return""==e.trim()?this:t(e)?(this.push(e+""),this):(e.split(/\./).filter(function(e){return e}).forEach(function(e){this.push(e)},this),void 0)}function l(e){var t,n=!0,i=!1,o=!1,a=!1,l={objectObservers:new Map,getObjectObserver:function(e){return this.objectObservers.get(e)},getOrCreateObjectObserver:function(e){var t=this.objectObservers.get(e);return t||(t=new E(this,e),this.objectObservers.set(e,t)),t},removeObjectObserver:function(e){this.objectObservers.delete(e)},addPathTracker:function(e,t){this.getOrCreateObjectObserver(e).addPathTracker(t)},removePathTracker:function(e,t){this.getObjectObserver(e).removePathTracker(t)},connect:function(){this.objectObservers.forEach(function(e){e.connect()})},disconnect:function(){this.objectObservers.forEach(function(e){e.disconnect()})},internalCallback:function(e){if(!e||!e.length)return console.error("Object.observe callback called with no records"),void 0;try{o||(this.activeObservers=new Set);for(var t,n,r=0;e.length>r;r++){var i=e[r];if(t!==i.object){if(t=i.object,n=this.getObjectObserver(t),!n){t=void 0;continue}this.activeObservers.add(n)}n.addChangeRecord(i)}if(o)return;o=!0,this.deliverSummaries(),o=!1}catch(a){console.error(a)}},dirtyCheck:function(){var e=0;do try{e++,this.activeObservers=Map.getValueSet(this.objectObservers),this.deliverSummaries()}catch(t){console.error(t)}while(a&&R>e)},deliverSummaries:function(){return t=[],this.activeObservers.forEach(function(e){e.checkPathValues()}),this.activeObservers.forEach(function(e){e.checkObjectsAndArrays()}),this.activeObservers.forEach(function(e){var n=e.produceSummary();e.reset(),n&&t.push(n)}),this.activeObservers=void 0,t.length||(t=void 0),i||!t?(a=!1,void 0):(e(t),t=void 0,a=!0,void 0)}};if(l.callback=l.internalCallback.bind(l),L){var u={};Object.observe(u,l.callback),Object.unobserve(u,l.callback)}this.observeObject=function(e){if(!r(e))throw Error("Invalid attempt to observe non-object: "+e);l.getOrCreateObjectObserver(e).observeObject()},this.unobserveObject=function(e){if(!r(e))throw Error("Invalid attempt to unobserve non-object: "+e);var t=l.getObjectObserver(e);t&&t.unobserveObject()},this.observeArray=function(e){if(!Array.isArray(e))throw Error("Invalid attempt to observe non-array: "+e);l.getOrCreateObjectObserver(e).observeArray()},this.unobserveArray=function(e){if(Array.isArray(e)){var t=l.getObjectObserver(e);t&&t.unobserveArray()}},this.observePath=function(e,t){if(!s(t))return void 0;var n=new c(t);if(!n.length)return e;if(!r(e))return void 0;var i=l.getOrCreateObjectObserver(e).observePath(n);return i.value},this.unobservePath=function(e,t){if(s(t)){var n=new c(t);if(n.length&&r(e)){var i=l.getObjectObserver(e);i&&i.unobservePath(n)}}},this.deliver=function(){if(!n)throw Error("Disconnected");L?Object.deliverChangeRecords(l.callback):l.dirtyCheck()},this.disconnect=function(){if(n&&(i=!0,this.deliver(),i=!1,l.disconnect(),n=!1,t)){var e=t;return t=void 0,e}},this.connect=function(){n||(l.connect(),n=!0)}}function u(e){var t="",n="obj",r=e.length;t+="if (obj";for(var i=0;r-1>i;i++){var o='["'+e[i]+'"]';n+=o,t+=" && "+n}return t+=") ",n+='["'+e[r-1]+'"]',t+="return "+n+"; else return undefined;",Function("obj",t)}function h(e,t){var n=""+t;return I[n]||(I[n]=u(t)),I[n](e)}function d(e,t){var n;return t.walkPropertiesFrom(e,function(e,r,i){i===t.length&&(n=r)}),n}function p(e,t,n){var i=!1;return t.walkPropertiesFrom(e,function(e,o,a){r(o)&&a==t.length-1&&(i=!0,o[e]=n)}),i}function f(e){for(var t in e)return!1;return!0}function v(e){return f(e.added)&&f(e.removed)&&f(e.changed)}function m(e,t){var n={},r={},i={};for(var o in t){var a=e[o];(void 0===a||a!==t[o])&&(o in e?a!==t[o]&&(i[o]=a):r[o]=void 0)}for(var o in e)o in t||(n[o]=e[o]);return Array.isArray(e)&&e.length!==t.length&&(i.length=e.length),{added:n,removed:r,changed:i}}function g(e,t){var n=t||(Array.isArray(e)?[]:{});for(var r in e)n[r]=e[r];return Array.isArray(e)&&(n.length=e.length),n}function b(e){this.object=e,this.changed=!1,this.diff=void 0,this.oldValues=void 0,this.reset(!0)}function y(e){this.array=e,this.changed=!1,this.splices=void 0,this.reset(!0)}function w(e,t,n,r){this.object=e,this.path=t,this.pathString=n,this.observed=t.length>1?Array(t.length-2):void 0,this.changed=!1,this.oldValue=void 0,this.internal=r,this.reset(!0)}function E(e,t){this.internal=e,this.object=t,this.objectTracker=void 0,this.arrayTracker=void 0,this.pathTrackers=void 0,this.pathTrackerMap=void 0,this.changeRecords=void 0,this.dirtyPathTrackers=void 0,this.connect()}function T(e,t,n){for(var r={},i={},o=0;t.length>o;o++){var a=t[o];W[a.type]?(a.name in n||(n[a.name]=a.oldValue),"updated"!=a.type&&("new"!=a.type?a.name in r?(delete r[a.name],delete n[a.name]):i[a.name]=!0:a.name in i?delete i[a.name]:r[a.name]=!0)):(console.error("Unknown changeRecord type: "+a.type),console.error(a))}for(var s in r)r[s]=e[s];for(var s in i)i[s]=void 0;var c={};for(var s in n)if(!(s in r||s in i)){var l=e[s];n[s]!==l&&(c[s]=l)}return{added:r,removed:i,changed:c}}function S(e,t,n,r,i,o){for(var a=o-i+1,s=n-t+1,c=Array(a),l=0;a>l;l++)c[l]=Array(s),c[l][0]=l;for(var u=0;s>u;u++)c[0][u]=u;for(var l=1;a>l;l++)for(var u=1;s>u;u++)if(r[i+l-1]===e[t+u-1])c[l][u]=c[l-1][u-1];else{var h=c[l-1][u]+1,d=c[l][u-1]+1;c[l][u]=d>h?h:d}return c}function O(e){for(var t=e.length-1,n=e[0].length-1,r=e[t][n],i=[];t>0||n>0;)if(0!=t)if(0!=n){var o,a=e[t-1][n-1],s=e[t-1][n],c=e[t][n-1];o=c>s?a>s?s:a:a>c?c:a,o==a?(a==r?i.push(q):(i.push(Y),r=a),t--,n--):o==s?(i.push(X),t--,r=s):(i.push(G),n--,r=c)}else i.push(X),t--;else i.push(G),n--;return i.reverse(),i}function M(e,t,n){for(var r=0;n>r;r++)if(e[r]!==t[r])return r;return n}function C(e,t,n){for(var r=e.length,i=t.length,o=0;n>o&&e[--r]===t[--i];)o++;return o}function P(e,t,n,r,i,o){function a(e,t,n){return{index:e,removed:t,addedCount:n}}var s=0,c=0,l=Math.min(n-t,o-i);if(0==t&&0==i&&(s=M(e,r,l)),n==e.length&&o==r.length&&(c=C(e,r,l-s)),t+=s,i+=s,n-=c,o-=c,0==n-t&&0==o-i)return[];if(t==n){for(var u=a(t,[],0);o>i;)u.removed.push(r[i++]);return[u]}if(i==o)return[a(t,[],n-t)];for(var h=O(S(e,t,n,r,i,o)),u=void 0,d=[],p=t,f=i,v=0;h.length>v;v++)switch(h[v]){case q:u&&(d.push(u),u=void 0),p++,f++;break;case Y:u||(u=a(p,[],0)),u.addedCount++,p++,u.removed.push(r[f]),f++;break;case G:u||(u=a(p,[],0)),u.addedCount++,p++;break;case X:u||(u=a(p,[],0)),u.removed.push(r[f]),f++}return u&&d.push(u),d}function _(e,t,r){function i(t,r){Object.keys(t).forEach(function(t){var i=n(t);if(!(D(i)||0>i||i>=a)){var c=r[i];e.length>i?s[i]=c:o.removed[i-e.length]=r[i]}})}var o,a="length"in r?n(r.length):e.length;e.length>a?o={index:a,removed:[],addedCount:e.length-a}:a>e.length&&(o={index:e.length,removed:Array(a-e.length),addedCount:0});var s=[];i(t.added,r),i(t.removed,r),i(t.changed,r);var c,l=[];for(var u in s){if(u=n(u),c){if(c.index+c.removed.length==u){c.removed.push(s[u]);continue}c.addedCount=Math.min(e.length,c.index+c.removed.length)-c.index,l.push(c),c=void 0}c={index:u,removed:[s[u]]}}return c?(c.addedCount=Math.min(e.length,c.index+c.removed.length)-c.index,o?c.index+c.removed.length==o.index?(c.addedCount=c.addedCount+o.addedCount,c.removed=c.removed.concat(o.removed),l.push(c)):(l.push(c),l.push(o)):l.push(c)):o&&l.push(o),l}function k(e,t,n){var r=[];return _(e,t,n).forEach(function(t){r=r.concat(P(e,t.index,t.index+t.addedCount,t.removed,0,t.removed.length))}),r}function N(){function e(e){var n=t.get(e.object);n&&(n.object&&(e.added||e.removed||e.changed)&&n.object.forEach(function(t){try{t(e.added,e.removed,e.changed,e.getOldValue,e.object)}catch(n){console.log("Exception thrown during callback: "+n),l._errorThrownDuringCallback=!0}}),n.array&&e.splices&&n.array.forEach(function(t){try{t(e.splices,e.object)}catch(n){console.log("Exception thrown during callback: "+n),l._errorThrownDuringCallback=!0}}),n.path&&e.pathChanged&&Object.keys(n.path).forEach(function(t){e.pathChanged.hasOwnProperty(t)&&n.path[t].forEach(function(n){try{n(e.pathChanged[t],e.getOldValue(t),e.object,t)}catch(r){console.log("Exception thrown during callback: "+r),l._errorThrownDuringCallback=!0}})}))}var t="function"==typeof WeakMap?new WeakMap:new Map,n=new l(function(t){t.forEach(e)});this.observeObject=function(e,r){var i=t.get(e);i||(i={},t.set(e,i)),i.object||(i.object=new Set,n.observeObject(e)),i.object.add(r)},this.unobserveObject=function(e,r){var i=t.get(e);i&&i.object&&(i.object.delete(r),i.object.size||(n.unobserveObject(e),i.object=void 0),i.object||i.array||i.path||t.delete(e))},this.observeArray=function(e,r){if(!Array.isArray(e))throw Error("Invalid attempt to observe non-array: "+arr);var i=t.get(e);i||(i={},t.set(e,i)),i.array||(i.array=new Set,n.observeArray(e)),i.array.add(r)},this.unobserveArray=function(e,r){if(Array.isArray(e)){var i=t.get(e);i&&i.array&&(i.array.delete(r),i.array.size||(n.unobserveArray(e),i.array=void 0),i.object||i.array||i.path||t.delete(e))}},this.observePath=function(e,i,o){if(!s(i))return void 0;if(""==i.trim())return e;if(!r(e))return void 0;var a=t.get(e);a||(a={},t.set(e,a)),a.path||(a.path={});var c,u=a.path[i];return u?c=l.getValueAtPath(e,i):(u=new Set,a.path[i]=u,c=n.observePath(e,i)),u.add(o),c},this.unobservePath=function(e,i,o){if(s(i)&&r(e)){var a=t.get(e);if(a&&a.path){var c=a.path[i];c&&(c.delete(o),c.size||(n.unobservePath(e,i),delete a.path[i]),Object.keys(a.path).length||(a.path=void 0),a.object||a.array||a.path||t.delete(e))}}},this.deliver=n.deliver.bind(n)}var L="function"==typeof Object.observe,A=e.Number.isNaN||function D(t){return"number"==typeof t&&e.isNaN(t)},x="__proto__"in{}?function(e){return e}:function(e){var t=e.__proto__;if(!t)return e;var n=Object.create(t);return Object.getOwnPropertyNames(e).forEach(function(t){Object.defineProperty(n,t,Object.getOwnPropertyDescriptor(e,t))}),n};"function"==typeof Map&&"function"==typeof Set&&"function"==typeof WeakMap?o():a(e);var H="[$a-z0-9_]+[$a-z0-9_\\d]*",j=RegExp("^(?:#?"+H+")?"+"(?:"+"(?:\\."+H+")"+")*"+"$","i");c.prototype=x({__proto__:[],toString:function(){return this.join(".")},walkPropertiesFrom:function(e,t,n){for(var r,i=0;this.length+1>i;i++)r=this[i],t.call(n,r,e,i),e=i==this.length||null===e||void 0===e?void 0:e[r]}});var R=1e3,I={};l.getValueAtPath=function(e,t){if(!s(t))return void 0;var n=new c(t);return n.length?r(e)?F?h(e,n):d(e,n):void 0:e},l.setValueAtPath=function(e,t,n){if(s(t)){var i=new c(t);i.length&&r(e)&&p(e,i,n)}},l.applySplices=function(e,t,n){n.forEach(function(n){for(var r=[n.index,n.removed.length],i=n.index;n.index+n.addedCount>i;)r.push(t[i]),i++;Array.prototype.splice.apply(e,r)})},b.prototype={check:function(e){var t,n;if(L){if(!e)return!1;n={},t=T(this.object,e,n)}else n=this.oldObject,t=m(this.object,this.oldObject);return v(t)?!1:(this.diff=t,this.oldValues=n,this.changed=!0,!0)},summarize:function(e,t){e.added=this.changed?this.diff.added:{},e.removed=this.changed?this.diff.removed:{},e.changed=this.changed?this.diff.changed:{},g(this.oldValues,t)},reset:function(e){L||!e&&!this.diff||(this.oldObject=g(this.object)),this.changed=!1,this.diff=void 0,this.oldValues=void 0}},y.prototype={check:function(e){var t;if(L){if(!e)return!1;var n={},r=T(this.array,e,n);t=k(this.array,r,n)}else t=P(this.array,0,this.array.length,this.oldArray,0,this.oldArray.length);return t.length?(this.splices=t,this.changed=!0,!0):!1},summarize:function(e){e.splices=this.splices?this.splices:[]},reset:function(e){L||!e&&!this.splices||(this.oldArray=this.array.slice()),this.changed=!1,this.splices=void 0}};var F=!1;try{var U=Function("","return true;");F=U()}catch(B){}var V;V=L?function(e){var t;return this.path.walkPropertiesFrom(this.object,function(e,n,i){if(i===this.path.length)return t=n,void 0;if(0!==i){var o=this.observed[i-1];if(n!==o){if(void 0!==o){this.observed[i-1]=o=void 0;for(var a=!1,s=0;this.observed.length>s;s++)if(this.observed[s]===o){a=!0;break}a||this.internal.removePathTracker(o,this)}r(n)&&(this.observed[i-1]=o=n,this.internal.addPathTracker(o,this))}}},this),this.valueMaybeChanged(t,e)}:F?function(e){return this.checkFunc||(this.checkFunc=u(this.path)),this.valueMaybeChanged(this.checkFunc(this.object),e)}:function(e){var t=d(this.object,this.path);return this.valueMaybeChanged(t,e)},w.prototype={check:V,valueMaybeChanged:function(e,t){return t?this.value=e:this.changed?(this.value=e,i(this.value,this.oldValue)&&(this.changed=!1,this.oldValue=void 0)):i(this.value,e)||(this.oldValue=this.value,this.value=e,this.changed=!0),this.changed},summarize:function(e,t){e.pathChanged[this.pathString]=this.value,t[this.pathString]=this.oldValue},reset:function(e){e&&this.check(!0),this.oldValue=void 0,this.changed=!1},destroy:function(){this.object=void 0,this.reset(!0)}},E.prototype={observeObject:function(){this.objectTracker=this.objectTracker||new b(this.object)},unobserveObject:function(){this.objectTracker=void 0,this.destroyIfEmpty()},observeArray:function(){this.arrayTracker=this.arrayTracker||new y(this.object)},unobserveArray:function(){this.arrayTracker=void 0,this.destroyIfEmpty()},addPathTracker:function(e,t){this.pathTrackers||(this.pathTrackers=[],this.pathTrackerMap={}),t&&(this.pathTrackerMap[t]=e),this.pathTrackers.push(e)},removePathTracker:function(e){this.pathTrackers&&(this.pathTrackers.splice(this.pathTrackers.indexOf(e),1),this.pathTrackers.length||(this.pathTrackers=void 0),this.destroyIfEmpty())},observePath:function(e){var t,n=""+e;return this.pathTrackers&&this.pathTrackerMap&&(t=this.pathTrackerMap[n]),t?t.check():(t=new w(this.object,e,n,this.internal),this.addPathTracker(t,n)),t},unobservePath:function(e){if(this.pathTrackerMap){var t=""+e,n=this.pathTrackerMap[t];n&&(n.destroy(),delete this.pathTrackerMap[t],Object.keys(this.pathTrackerMap).length||(this.pathTrackerMap=void 0),this.pathTrackers.splice(this.pathTrackers.indexOf(n),1),this.pathTrackers.length||(this.pathTrackers=void 0),this.destroyIfEmpty())}},connect:function(){L&&Object.observe(this.object,this.internal.callback),this.reset(!0)},disconnect:function(){L&&Object.unobserve(this.object,this.internal.callback)},destroyIfEmpty:function(){this.objectTracker||this.arrayTracker||this.pathTrackers||(this.internal.removeObjectObserver(this.object),this.destroy())},destroy:function(){this.disconnect(),this.internal=void 0},addChangeRecord:function(e){this.changeRecords||(this.changeRecords=[]),this.changeRecords.push(e)},checkPathValues:function(){if(this.internal&&this.pathTrackers)for(var e=0;this.pathTrackers.length>e;e++){var t=this.pathTrackers[e];if(t.check()){var n=this.object===t.object,r=n?this:this.internal.getOrCreateObjectObserver(t.object);r.addDirtyPath(t),n||this.internal.activeObservers.add(r)}}},checkObjectsAndArrays:function(){this.internal&&(this.objectTracker&&this.objectTracker.check(this.changeRecords),this.arrayTracker&&this.arrayTracker.check(this.changeRecords))},addDirtyPath:function(e){this.dirtyPathTrackers||(this.dirtyPathTrackers=new Set),this.dirtyPathTrackers.add(e)},produceSummary:function(){if(this.objectTracker&&this.objectTracker.changed||this.arrayTracker&&this.arrayTracker.changed||this.dirtyPathTrackers){var e,t={object:this.object};(this.objectTracker||this.pathTrackerMap)&&(e={},t.getOldValue=function(t){return e[t]}),this.pathTrackerMap&&(t.pathChanged={});var n=!1;return this.objectTracker&&(this.objectTracker.summarize(t,e),n=n||this.objectTracker.changed),this.arrayTracker&&(this.arrayTracker.summarize(t),n=n||this.arrayTracker.changed),this.dirtyPathTrackers&&this.dirtyPathTrackers.forEach(function(r){r.changed&&(r.summarize(t,e),n=!0)}),n?t:void 0}},reset:function(e){this.objectTracker&&this.objectTracker.reset(e),this.arrayTracker&&this.arrayTracker.reset(e);var t=e?this.pathTrackers:this.dirtyPathTrackers;t&&t.forEach(function(t){t.reset(e)}),this.changeRecords=void 0,this.dirtyPathTrackers=void 0}};var W={"new":!0,updated:!0,deleted:!0},q=0,Y=1,G=2,X=3;e.ChangeSummary=l,e.ChangeSummary.CallbackRouter=N}(this);var createObject="__proto__"in{}?function(e){return e}:function(e){var t=e.__proto__;if(!t)return e;var n=Object.create(t);return Object.getOwnPropertyNames(e).forEach(function(t){Object.defineProperty(n,t,Object.getOwnPropertyDescriptor(e,t))}),n};"function"!=typeof document.contains&&(Document.prototype.contains=function(e){return e===this||e.parentNode===this?!0:this.documentElement.contains(e)});var SideTable;if("undefined"!=typeof WeakMap&&0>navigator.userAgent.indexOf("Firefox/")?SideTable=WeakMap:function(){var e=Object.defineProperty,t=Object.hasOwnProperty,n=(new Date).getTime()%1e9;SideTable=function(){this.name="__st"+(1e9*Math.random()>>>0)+(n++ +"__")},SideTable.prototype={set:function(t,n){e(t,this.name,{value:n,writable:!0})},get:function(e){return t.call(e,this.name)?e[this.name]:void 0},"delete":function(e){this.set(e,void 0)}}}(),this.Model=function(){var e=new ChangeSummary.CallbackRouter;return{notifyChanges:function(){e.deliver()},getValueAtPath:ChangeSummary.getValueAtPath,setValueAtPath:ChangeSummary.setValueAtPath,observeObject:e.observeObject.bind(e),unobserveObject:e.unobserveObject.bind(e),observeArray:e.observeArray.bind(e),unobserveArray:e.unobserveArray.bind(e),observePath:e.observePath.bind(e),unobservePath:e.unobservePath.bind(e)}}(),function(e){"use strict";function t(e){if(!e)throw Error("Assertion failed")}function n(e){return e.ownerDocument.contains(e)}function r(e,t,n){console.error("Unhandled binding to Node: ",this,e,t,n)}function i(){}function o(){}function a(e,t,n){this.model=e,this.path=t,this.changed=n,this.changed(Model.observePath(this.model,this.path,this.changed))}function s(e){return function(t){e.data=(void 0===t?"":t)+""}}function c(e,t,n){if("textContent"!==e)return Node.prototype.bind.call(this,e,t,n);this.unbind("textContent");var r=new a(t,n,s(this));Q.set(this,r)}function l(e){if("textContent"!=e)return Node.prototype.unbind.call(this,e);var t=Q.get(this);t&&(t.dispose(),Q.delete(this))}function u(){this.unbind("textContent"),Node.prototype.unbindAll.call(this)}function h(e,t,n){return n?function(n){n?e.setAttribute(t,""):e.removeAttribute(t)}:function(n){e.setAttribute(t,(void 0===n?"":n)+"")}}function d(){this.bindingMap=Object.create(null)}function p(e,t,n){var r=J.get(this);r||(r=new d,J.set(this,r)),r.add(this,e,t,n)}function f(e){var t=J.get(this);t&&t.remove(e)}function v(){var e=J.get(this);e&&(J.delete(this),e.removeAll(),Node.prototype.unbindAll.call(this))}function m(e){switch(e.type){case"checkbox":return"click";case"radio":case"select-multiple":case"select-one":return"change";default:return"input"}}function g(e,t,n,r){this.element=e,this.valueProperty=t,this.boundValueChanged=this.valueChanged.bind(this),this.boundUpdateBinding=this.updateBinding.bind(this),this.binding=new a(n,r,this.boundValueChanged),this.element.addEventListener(m(this.element),this.boundUpdateBinding,!0)}function b(e,t,n){g.call(this,e,"value",t,n)}function y(e){if(!n(e))return[];if(e.form)return $(e.form.elements,function(t){return t!=e&&"INPUT"==t.tagName&&"radio"==t.type&&t.name==e.name});var t=e.ownerDocument.querySelectorAll('input[type="radio"][name="'+e.name+'"]');return $(t,function(t){return t!=e&&!t.form})}function w(e,t,n){g.call(this,e,"checked",t,n)}function E(e,t,n){switch(e){case"value":this.unbind("value"),this.removeAttribute("value"),Z.set(this,new b(this,t,n));break;case"checked":this.unbind("checked"),this.removeAttribute("checked"),et.set(this,new w(this,t,n));break;default:return Element.prototype.bind.call(this,e,t,n)}}function T(e){switch(e){case"value":var t=Z.get(this);t&&(t.unbind(),Z.delete(this));break;case"checked":var n=et.get(this);n&&(n.unbind(),et.delete(this));break;default:return Element.prototype.unbind.call(this,e)}}function S(){this.unbind("value"),this.unbind("checked"),Element.prototype.unbindAll.call(this)}function O(e){return st[e.tagName]&&e.hasAttribute("template")}function M(e){return"TEMPLATE"==e.tagName||O(e)}function C(e){return ct&&"TEMPLATE"==e.tagName}function P(e,t){var n=e.querySelectorAll(lt);M(e)&&t(e),K(n,t)}function _(e){function t(e){HTMLTemplateElement.decorate(e)||_(e.content)}P(e,t)}function k(e,t){Object.getOwnPropertyNames(t).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}function N(e){if(!e.defaultView)return e;var t=pt.get(e);if(!t){for(t=e.implementation.createHTMLDocument("");t.lastChild;)t.removeChild(t.lastChild);pt.set(e,t)}return t}function L(e){for(var t=e.cloneNode(!1),n=e.attributes,r=n.length;r-->0;){var i=n[r];at[i.name]?t.removeAttribute(i.name):e.removeAttribute(i.name)}return t}function A(e){var t=e.content;if(O(e)){for(var n,r=L(e);n=e.firstChild;)r.appendChild(n);t.appendChild(r)}else for(var n;n=e.firstChild;)t.appendChild(n)}function D(e){"TEMPLATE"===e.tagName?ct||(ht?e.__proto__=HTMLTemplateElement.prototype:k(e,HTMLTemplateElement.prototype)):(k(e,HTMLTemplateElement.prototype),Object.defineProperty(e,"content",mt))}function x(e){var t=e.ref;return t?t.content:e.content}function H(e,t){this.type=e,this.value=t}function j(e){for(var t=[],n=e.length,r=0,i=0;n>i;){if(r=e.indexOf("{{",i),0>r){t.push(new H(bt,e.slice(i)));break}if(r>0&&r>i&&t.push(new H(bt,e.slice(i,r))),i=r+2,r=e.indexOf("}}",i),0>r){var o=e.slice(i-2),a=t[t.length-1];a&&a.type==bt?a.value+=o:t.push(new H(bt,o));break}var s=e.slice(i,r).trim();t.push(new H(yt,s)),i=r+2}return t}function R(e,t,n,r,i){var o,a=i&&i[ot];a&&"function"==typeof a&&(o=a(n,r,t,e),o&&(n=o,r="value")),e.bind(t,n,r)}function I(e,t,n,r,i){var o=j(t);if(o.length&&(1!=o.length||o[0].type!=bt)){if(1==o.length&&o[0].type==yt)return R(e,n,r,o[0].value,i),void 0;for(var a=new X,s=0;o.length>s;s++){var c=o[s];c.type==yt&&R(a,s,r,c.value,i)}a.combinator=function(e){for(var t="",n=0;o.length>n;n++){var r=o[n];if(r.type===bt)t+=r.value;else{var i=e[n];void 0!==i&&(t+=i)}}return t},e.bind(n,a,"value")}}function F(e,n,r){t(e);for(var i={},o=0;e.attributes.length>o;o++){var a=e.attributes[o];i[a.name]=a.value}M(e)&&(""===i[tt]&&(i[tt]="{{}}"),""===i[nt]&&(i[nt]="{{}}")),Object.keys(i).forEach(function(t){I(e,i[t],t,n,r)})}function U(e,n,r){t(e),e.nodeType===Node.ELEMENT_NODE?F(e,n,r):e.nodeType===Node.TEXT_NODE&&I(e,e.data,"textContent",n,r);for(var i=e.firstChild;i;i=i.nextSibling)U(i,n,r)}function B(e){e.unbindAll();for(var t=e.firstChild;t;t=t.nextSibling)B(t)}function V(e,t){var n=e.cloneNode(!1);M(n)&&(HTMLTemplateElement.decorate(n,e),t&&!n.hasAttribute(it)&&n.setAttribute(it,t));for(var r=e.firstChild;r;r=r.nextSibling)n.appendChild(V(r,t));return n}function W(e,t){if(G(t),M(t)){var n=Et.get(t);n&&(n.abandon(),Et.delete(t))}e.removeChild(t),B(t)}function q(e,t,n){this.firstNode=e,this.lastNode=t,this.model=n}function Y(e,t){if(e.firstChild)for(var n=new q(e.firstChild,e.lastChild,t),r=n.firstNode;r;)wt.set(r,n),r=r.nextSibling}function G(e){wt.delete(e)}function X(e){this.bindings={},this.values={},this.value=void 0,this.size=0,this.combinator_=e,this.boundResolve=this.resolve.bind(this),this.disposed=!1}function z(e){this.templateElement_=e,this.terminators=[],this.iteratedValue=void 0,this.observing=!1,this.boundHandleSplices=this.handleSplices.bind(this),this.inputs=new X(this.resolveInputs.bind(this)),this.valueBinding=new a(this.inputs,"value",this.valueChanged.bind(this))
}var K=Array.prototype.forEach.call.bind(Array.prototype.forEach),$=Array.prototype.filter.call.bind(Array.prototype.filter);Node.prototype.bind=r,Node.prototype.unbind=i,Node.prototype.unbindAll=o;var Q=new SideTable("textContentBinding");a.prototype={dispose:function(){Model.unobservePath(this.model,this.path,this.changed)},set value(e){Model.setValueAtPath(this.model,this.path,e)}},Text.prototype.bind=c,Text.prototype.unbind=l,Text.prototype.unbindAll=u;var J=new SideTable("attributeBindings");d.prototype={add:function(e,t,n,r){e.removeAttribute(t);var i="?"==t[t.length-1];i&&(t=t.slice(0,-1)),this.remove(t);var o=new a(n,r,h(e,t,i));this.bindingMap[t]=o},remove:function(e){var t=this.bindingMap[e];t&&(t.dispose(),delete this.bindingMap[e])},removeAll:function(){Object.keys(this.bindingMap).forEach(function(e){this.remove(e)},this)}},Element.prototype.bind=p,Element.prototype.unbind=f,Element.prototype.unbindAll=v;var Z=new SideTable("valueBinding"),et=new SideTable("checkedBinding");g.prototype={valueChanged:function(e){this.element[this.valueProperty]=this.produceElementValue(e)},updateBinding:function(){this.binding.value=this.element[this.valueProperty],this.postUpdateBinding&&this.postUpdateBinding(),Model.notifyChanges()},unbind:function(){this.binding.dispose(),this.element.removeEventListener(m(this.element),this.boundUpdateBinding,!0)}},b.prototype=createObject({__proto__:g.prototype,produceElementValue:function(e){return(null==e?"":e)+""}}),w.prototype=createObject({__proto__:g.prototype,produceElementValue:function(e){return Boolean(e)},postUpdateBinding:function(){"INPUT"===this.element.tagName&&"radio"===this.element.type&&y(this.element).forEach(function(e){var t=et.get(e);t&&(t.binding.value=!1)})}}),HTMLInputElement.prototype.bind=E,HTMLInputElement.prototype.unbind=T,HTMLInputElement.prototype.unbindAll=S;var tt="bind",nt="repeat",rt="if",it="syntax",ot="getBinding",at={template:!0,repeat:!0,bind:!0,ref:!0},st={THEAD:!0,TBODY:!0,TFOOT:!0,TH:!0,TR:!0,TD:!0,COLGROUP:!0,COL:!0,CAPTION:!0,OPTION:!0},ct="undefined"!=typeof HTMLTemplateElement,lt="template, "+Object.keys(st).map(function(e){return e.toLowerCase()+"[template]"}).join(", "),ut=function(){function e(e){r.indexOf(e)>=0||n.indexOf(e)>=0||(n.push(e),o==i.value&&(i.value=!i.value))}function t(){for(o=i.value,r=n,n=[];r.length;){var e=r.shift();e()}}var n=[],r=[],i={value:0},o=i.value;return Model.observePath(i,"value",t),e}();document.addEventListener("DOMContentLoaded",function(){_(document),Model.notifyChanges()},!1),ct||(e.HTMLTemplateElement=function(){throw TypeError("Illegal constructor")});var ht="__proto__"in{},dt=new SideTable("templateContents"),pt=new SideTable("templateContentsOwner"),ft=new SideTable("templateInstanceRef");HTMLTemplateElement.decorate=function(e,t){if(e.templateIsDecorated_)return!1;if(e.templateIsDecorated_=!0,D(e),!C(e)){var n=N(e.ownerDocument);dt.set(e,n.createDocumentFragment())}return t?(ft.set(e,t),!0):(C(e)?_(e.content):A(e),!0)},HTMLTemplateElement.bootstrap=_;var vt=e.HTMLUnknownElement||HTMLElement,mt={get:function(){return dt.get(this)},enumerable:!0,configurable:!0};ct||(HTMLTemplateElement.prototype=Object.create(vt.prototype),Object.defineProperty(HTMLTemplateElement.prototype,"content",mt));var gt=new SideTable("templateModel");k(HTMLTemplateElement.prototype,{bind:function(e,t,n){switch(e){case tt:case nt:case rt:var r=Et.get(this);r||(r=new z(this),Et.set(this,r)),r.inputs.bind(e,t,n||"");break;default:return Element.prototype.bind.call(this,e,t,n)}},unbind:function(e,t,n){switch(e){case tt:case nt:case rt:var r=Et.get(this);if(!r)break;r.inputs.unbind(e);break;default:return Element.prototype.unbind.call(this,e,t,n)}},unbindAll:function(){this.unbind(tt),this.unbind(nt),this.unbind(rt),Element.prototype.unbindAll.call(this)},createInstance:function(){var e=x(this),t=this.getAttribute(it),n=V(e,t);return"function"==typeof HTMLTemplateElement.__instanceCreated&&HTMLTemplateElement.__instanceCreated(n),n},get model(){return gt.get(this)},set model(e){gt.set(this,e),U(this,e)},get ref(){var e,t=this.getAttribute("ref");return t&&(e=this.ownerDocument.getElementById(t)),e||(e=ft.get(this)),e||null}});var bt=0,yt=1,wt=new SideTable("templateInstance");Object.defineProperty(Node.prototype,"templateInstance",{get:function(){var e=wt.get(this);return e?e:this.parentNode?this.parentNode.templateInstance:void 0}}),X.prototype={set combinator(e){this.combinator_=e,this.scheduleResolve()},bind:function(e,t,n){this.unbind(e),this.size++,this.bindings[e]=new a(t,n,function(t){this.values[e]=t,this.scheduleResolve()}.bind(this))},unbind:function(e,t){this.bindings[e]&&(this.size--,this.bindings[e].dispose(),delete this.bindings[e],delete this.values[e],t||this.scheduleResolve())},scheduleResolve:function(){ut(this.boundResolve)},resolve:function(){if(!this.disposed){if(!this.combinator_)throw Error("CompoundBinding attempted to resolve without a combinator");this.value=this.combinator_(this.values)}},dispose:function(){Object.keys(this.bindings).forEach(function(e){this.unbind(e,!0)},this),this.disposed=!0,this.value=void 0}},z.prototype={resolveInputs:function(e){return rt in e&&!e[rt]?void 0:nt in e?e[nt]:tt in e?[e[tt]]:void 0},valueChanged:function(e){this.clear(),Array.isArray(e)&&(this.iteratedValue=e,Model.observeArray(this.iteratedValue,this.boundHandleSplices),this.observing=!0,this.handleSplices([{index:0,addedCount:this.iteratedValue.length,removed:[]}]))},getTerminatorAt:function(e){if(-1==e)return this.templateElement_;var t=this.terminators[e];if(t.nodeType!==Node.ELEMENT_NODE)return t;var n=Et.get(t);return n?n.getTerminatorAt(n.terminators.length-1):t},insertInstanceAt:function(e,t){var n=this.getTerminatorAt(e-1),r=t.lastChild||n;this.terminators.splice(e,0,r);var i=this.templateElement_.parentNode;i.insertBefore(t,n.nextSibling)},removeInstanceAt:function(e){var t=this.getTerminatorAt(e-1),n=this.getTerminatorAt(e);this.terminators.splice(e,1);for(var r=this.templateElement_.parentNode;n!==t;){var i=n;n=i.previousSibling,W(r,i)}},removeAllInstances:function(){if(this.terminators.length){var e=this.templateElement_,t=this.getTerminatorAt(this.terminators.length-1);this.terminators.length=0;for(var n=this.templateElement_.parentNode;t!==e;){var r=t;t=r.previousSibling,W(n,r)}}},clear:function(){this.unobserve(),this.removeAllInstances(),this.iteratedValue=void 0},getInstanceModel:function(e){return e},getInstanceFragment:function(){return this.templateElement_.createInstance()},handleSplices:function(e){var t=this.templateElement_.getAttribute(it),n=HTMLTemplateElement.syntax[t];e.forEach(function(e){e.removed.forEach(function(){this.removeInstanceAt(e.index)},this);for(var t=e.index;e.index+e.addedCount>t;t++){var r=this.getInstanceModel(this.iteratedValue[t],n),i=this.getInstanceFragment(n);U(i,r,n),Y(i,r),this.insertInstanceAt(t,i)}},this)},unobserve:function(){this.observing&&(Model.unobserveArray(this.iteratedValue,this.boundHandleSplices),this.observing=!1)},abandon:function(){this.unobserve(),this.valueBinding.dispose(),this.inputs.dispose()}};var Et=new SideTable("templateIterator");e.CompoundBinding=X,Object.defineProperty(HTMLTemplateElement,it,{value:{},enumerable:!0}),HTMLTemplateElement.forAllTemplatesFrom_=P,HTMLTemplateElement.bindAllMustachesFrom_=U}(this),function(e){document.write("<style>template {display: none;} /* injected by platform.js */</style>"),HTMLTemplateElement.__instanceCreated=function(e){document.adoptNode(e),CustomElements.upgradeAll(e)},window.dirtyCheck=function(){logFlags.data&&console.group("Model.dirtyCheck()"),t(),logFlags.data&&console.groupEnd()};var t=function(){Model.notifyChanges()},n=125;window.addEventListener("WebComponentsReady",function(){dirtyCheck(),setInterval(t,n)}),e.flush=dirtyCheck}(window.Platform),function(){function e(e){return n(e,o)}function t(e){return n(e,"stylesheet")}function n(e,t){return"link"===e.localName&&e.getAttribute("rel")===t}function r(e,t){var n=document.implementation.createHTMLDocument(o);n._URL=t;var r=n.createElement("base");return r.setAttribute("href",document.baseURI),n.head.appendChild(r),n.body.innerHTML=e,n}var i,o="import",a={documents:{},cache:{},preloadSelectors:["link[rel="+o+"]","script[src]","link[rel=stylesheet]"].join(","),load:function(e,t){i=new s(a.loaded,t),i.cache=a.cache,a.preload(e)},preload:function(t){var n=t.querySelectorAll(a.preloadSelectors);t===document&&(n=Array.prototype.filter.call(n,function(t){return e(t)})),i.addNodes(n)},loaded:function(n,i,o){if(e(i)){var s=a.documents[n];s||(s=r(o,n),c.resolvePathsInHTML(s),a.documents[n]=s,a.preload(s)),i.content=i.__resource=s}else i.__resource=o,t(i)&&c.resolvePathsInStylesheet(i)}},s=function(e,t){this.onload=e,this.oncomplete=t,this.inflight=0,this.pending={},this.cache={}};s.prototype={addNodes:function(e){this.inflight+=e.length,p(e,this.require,this),this.checkDone()},require:function(e){var t=c.nodeUrl(e);e.__nodeUrl=t,this.dedupe(t,e)||this.fetch(t,e)},dedupe:function(e,t){return this.pending[e]?(this.pending[e].push(t),!0):this.cache[e]?(this.onload(e,t,i.cache[e]),this.tail(),!0):(this.pending[e]=[t],!1)},fetch:function(e,t){d.load(e,function(n,r){this.receive(e,t,n,r)}.bind(this))},receive:function(e,t,n,r){n||(i.cache[e]=r),i.pending[e].forEach(function(t){n||this.onload(e,t,r),this.tail()},this),i.pending[e]=null},tail:function(){--this.inflight,this.checkDone()},checkDone:function(){this.inflight||this.oncomplete()}};var c={nodeUrl:function(e){return c.resolveUrl(c.getDocumentUrl(document),c.hrefOrSrc(e))},hrefOrSrc:function(e){return e.getAttribute("href")||e.getAttribute("src")},documentUrlFromNode:function(e){var t=c.getDocumentUrl(e.ownerDocument);return t=t.split("#")[0]},getDocumentUrl:function(e){return e&&(e._URL||e.impl&&e.impl._URL||e.URL)||""},resolveUrl:function(e,t,n){if(this.isAbsUrl(t))return t;var r=this.compressUrl(this.urlToPath(e)+t);return n&&(r=c.makeRelPath(c.getDocumentUrl(document),r)),r},isAbsUrl:function(e){return/(^data:)|(^http[s]?:)|(^\/)/.test(e)},urlToPath:function(e){var t=e.split("/");return t.pop(),t.push(""),t.join("/")},compressUrl:function(e){for(var t,n=e.split("/"),r=0;n.length>r;r++)t=n[r],".."===t&&(n.splice(r-1,2),r-=2);return n.join("/")},makeRelPath:function(e,t){var n,r;for(n=this.compressUrl(e).split("/"),r=this.compressUrl(t).split("/");n.length&&n[0]===r[0];)n.shift(),r.shift();for(var i=0,o=n.length-1;o>i;i++)r.unshift("..");var a=r.join("/");return a},resolvePathsInHTML:function(e){var t=c.documentUrlFromNode(e.body);window.HTMLTemplateElement&&HTMLTemplateElement.bootstrap&&HTMLTemplateElement.bootstrap(e);var n=e.body;c._resolvePathsInHTML(n,t)},_resolvePathsInHTML:function(e,t){if(c.resolveAttributes(e,t),c.resolveStyleElts(e,t),window.templateContent){var n=e.querySelectorAll("template");n&&p(n,function(e){c._resolvePathsInHTML(templateContent(e),t)})}},resolvePathsInStylesheet:function(e){var t=c.nodeUrl(e);e.__resource=c.resolveCssText(e.__resource,t)},resolveStyleElts:function(e,t){var n=e.querySelectorAll("style");n&&p(n,function(e){e.textContent=c.resolveCssText(e.textContent,t)})},resolveCssText:function(e,t){return e.replace(/url\([^)]*\)/g,function(e){var n=e.replace(/["']/g,"").slice(4,-1);return n=c.resolveUrl(t,n,!0),"url("+n+")"})},resolveAttributes:function(e,t){var n=e&&e.querySelectorAll(u);n&&p(n,function(e){this.resolveNodeAttributes(e,t)},this)},resolveNodeAttributes:function(e,t){l.forEach(function(n){var r=e.attributes[n];if(r&&r.value&&0>r.value.search(h)){var i=c.resolveUrl(t,r.value,!0);r.value=i}})}},l=["href","src","action"],u="["+l.join("],[")+"]",h="{{.*}}",d={async:!0,ok:function(e){return e.status>=200&&300>e.status||304===e.status},load:function(e,t,n){var r=new XMLHttpRequest;r.open("GET",e+"?"+Math.random(),d.async),r.addEventListener("readystatechange",function(){4===r.readyState&&t.call(n,!d.ok(r)&&r,r.response,e)}),r.send()}},p=Array.prototype.forEach.call.bind(Array.prototype.forEach);window.HTMLImports=a,window.HTMLImports.getDocumentUrl=c.getDocumentUrl,"function"!=typeof window.CustomEvent&&(window.CustomEvent=function(e){var t=document.createEvent("HTMLEvents");return t.initEvent(e,!0,!0),t}),window.addEventListener("load",function(){a.load(document,function(){var e=window.ShadowDOMPolyfill?ShadowDOMPolyfill.wrap(document):document;a.readyTime=(new Date).getTime(),e.body.dispatchEvent(new CustomEvent("HTMLImportsLoaded",{bubbles:!0}))})})}(),function(e){function t(e){y.push(e),b||(b=!0,v(n))}function n(){b=!1;var e=y;y=[],e.sort(function(e,t){return e.uid_-t.uid_});var t=!1;e.forEach(function(e){var n=e.takeRecords();r(e),n.length&&(e.callback_(n,e),t=!0)}),t&&n()}function r(e){e.nodes_.forEach(function(t){var n=f.get(t);n&&n.forEach(function(t){t.observer===e&&t.removeTransientObservers()})})}function i(e,t){for(var n=e;n;n=n.parentNode){var r=f.get(n);if(r)for(var i=0;r.length>i;i++){var o=r[i],a=o.options;if(n===e||a.subtree){var s=t(a);s&&o.enqueue(s)}}}}function o(e){this.callback_=e,this.nodes_=[],this.records_=[],this.uid_=++w}function a(e,t){this.type=e,this.target=t,this.addedNodes=[],this.removedNodes=[],this.previousSibling=null,this.nextSibling=null,this.attributeName=null,this.attributeNamespace=null,this.oldValue=null}function s(e){var t=new a(e.type,e.target);return t.addedNodes=e.addedNodes.slice(),t.removedNodes=e.removedNodes.slice(),t.previousSibling=e.previousSibling,t.nextSibling=e.nextSibling,t.attributeName=e.attributeName,t.attributeNamespace=e.attributeNamespace,t.oldValue=e.oldValue,t}function c(e,t){return E=new a(e,t)}function l(e){return T?T:(T=s(E),T.oldValue=e,T)}function u(){E=T=void 0}function h(e){return e===T||e===E}function d(e,t){return e===t?e:T&&h(e)?T:null}function p(e,t,n){this.observer=e,this.target=t,this.options=n,this.transientObservedNodes=[]}var f=new SideTable("registrations"),v=window.msSetImmediate;if(!v){var m=[],g=Math.random()+"";window.addEventListener("message",function(e){if(e.data===g){var t=m;m=[],t.forEach(function(e){e()})}}),v=function(e){m.push(e),window.postMessage(g,"*")}}var b=!1,y=[],w=0;o.prototype={observe:function(e,t){if(!t.childList&&!t.attributes&&!t.characterData||t.attributeOldValue&&!t.attributes||t.attributeFilter&&t.attributeFilter.length&&!t.attributes||t.characterDataOldValue&&!t.characterData)throw new SyntaxError;var n=f.get(e);n||f.set(e,n=[]);for(var r,i=0;n.length>i;i++)if(n[i].observer===this){r=n[i],r.removeListeners(),r.options=t;break}r||(r=new p(this,e,t),n.push(r),this.nodes_.push(e)),r.addListeners()},disconnect:function(){this.nodes_.forEach(function(e){for(var t=f.get(e),n=0;t.length>n;n++){var r=t[n];if(r.observer===this){r.removeListeners(),t.splice(n,1);break}}},this),this.records_=[]},takeRecords:function(){var e=this.records_;return this.records_=[],e}};var E,T;p.prototype={enqueue:function(e){var n=this.observer.records_,r=n.length;if(n.length>0){var i=n[r-1],o=d(i,e);if(o)return n[r-1]=o,void 0}else t(this.observer);n[r]=e},addListeners:function(){this.addListeners_(this.target)},addListeners_:function(e){var t=this.options;t.attributes&&e.addEventListener("DOMAttrModified",this,!0),t.characterData&&e.addEventListener("DOMCharacterDataModified",this,!0),t.childList&&e.addEventListener("DOMNodeInserted",this,!0),(t.childList||t.subtree)&&e.addEventListener("DOMNodeRemoved",this,!0)},removeListeners:function(){this.removeListeners_(this.target)},removeListeners_:function(e){var t=this.options;t.attributes&&e.removeEventListener("DOMAttrModified",this,!0),t.characterData&&e.removeEventListener("DOMCharacterDataModified",this,!0),t.childList&&e.removeEventListener("DOMNodeInserted",this,!0),(t.childList||t.subtree)&&e.removeEventListener("DOMNodeRemoved",this,!0)},addTransientObserver:function(e){if(e!==this.target){this.addListeners_(e),this.transientObservedNodes.push(e);var t=f.get(e);t||f.set(e,t=[]),t.push(this)}},removeTransientObservers:function(){var e=this.transientObservedNodes;this.transientObservedNodes=[],e.forEach(function(e){this.removeListeners_(e);for(var t=f.get(e),n=0;t.length>n;n++)if(t[n]===this){t.splice(n,1);break}},this)},handleEvent:function(e){switch(e.stopImmediatePropagation(),e.type){case"DOMAttrModified":var t=e.attrName,n=e.relatedNode.namespaceURI,r=e.target,o=new c("attributes",r);o.attributeName=t,o.attributeNamespace=n;var a=e.attrChange===MutationEvent.ADDITION?null:e.prevValue;i(r,function(e){return!e.attributes||e.attributeFilter&&e.attributeFilter.length&&-1===e.attributeFilter.indexOf(t)&&-1===e.attributeFilter.indexOf(n)?void 0:e.attributeOldValue?l(a):o});break;case"DOMCharacterDataModified":var r=e.target,o=c("characterData",r),a=e.prevValue;i(r,function(e){return e.characterData?e.characterDataOldValue?l(a):o:void 0});break;case"DOMNodeRemoved":this.addTransientObserver(e.target);case"DOMNodeInserted":var s,h,r=e.relatedNode,d=e.target;"DOMNodeInserted"===e.type?(s=[d],h=[]):(s=[],h=[d]);var p=d.previousSibling,f=d.nextSibling,o=c("childList",r);o.addedNodes=s,o.removedNodes=h,o.previousSibling=p,o.nextSibling=f,i(r,function(e){return e.childList?o:void 0})}u()}},e.JsMutationObserver=o}(this),!window.MutationObserver&&(window.MutationObserver=window.WebKitMutationObserver||window.JsMutationObserver,!MutationObserver))throw Error("no mutation observer support");(function(e){function t(t,o){var a=o||{};if(!t)throw Error("Name argument must not be empty");if(a.name=t,!a.prototype)throw Error("Options missing required prototype property");return a.lifecycle=a.lifecycle||{},a.ancestry=n(a.extends),r(a),i(a),a.prototype.setAttribute=u,a.prototype.removeAttribute=h,p(t,a),a.ctor=f(a),a.ctor.prototype=a.prototype,e.ready&&e.upgradeAll(document),a.ctor}function n(e){var t=w[e];return t?n(t.extends).concat([t]):[]}function r(e){for(var t,n=e.extends,r=0;t=e.ancestry[r];r++)n=t.is&&t.tag;e.tag=n||e.name,n&&(e.is=e.name)}function i(e){if(!Object.__proto__)if(e.is)var t=document.createElement(e.tag),n=Object.getPrototypeOf(t);else n=HTMLElement.prototype;e.native=n}function o(e){return a(E(e.tag),e)}function a(t,n){return n.is&&t.setAttribute("is",n.is),s(t,n),t.__upgraded__=!0,e.upgradeSubtree(t),l(t),t}function s(e,t){Object.__proto__?e.__proto__=t.prototype:(c(e,t.prototype,t.native),e.__proto__=t.prototype)}function c(e,t,n){for(var r={},i=t;i!==n&&i!==HTMLUnknownElement.prototype;){for(var o,a=Object.getOwnPropertyNames(i),s=0;o=a[s];s++)r[o]||(Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(i,o)),r[o]=1);i=Object.getPrototypeOf(i)}}function l(e){e.readyCallback&&e.readyCallback()}function u(e,t){d.call(this,e,t,b)}function h(e,t){d.call(this,e,t,y)}function d(e,t,n){var r=this.getAttribute(e);n.apply(this,arguments),this.attributeChangedCallback&&this.attributeChangedCallback(e,r)}function p(e,t){w[e]=t}function f(e){return function(){return o(e)}}function v(e){var t=w[e];return t?new t.ctor:E(e)}function m(e){if(!e.__upgraded__&&e.nodeType===Node.ELEMENT_NODE){var t=e.getAttribute("is")||e.localName,n=w[t];return n&&a(e,n)}}if(e||(e=window.CustomElements={flags:{}}),e.hasNative=document.register&&"native"===e.flags.register,e.hasNative){var g=function(){};document.upgradeElement=g,document.upgradeElements=g,document.watchDOM=g,e.bootInsertions=g}else{var b=HTMLElement.prototype.setAttribute,y=HTMLElement.prototype.removeAttribute,w={},E=document.createElement.bind(document);document.register=t,document.createElement=v,e.registry=w,e.upgrade=m}})(window.CustomElements),function(e){function t(e,n,r){var i=e.firstElementChild;if(!i)for(i=e.firstChild;i&&i.nodeType!==Node.ELEMENT_NODE;)i=i.nextSibling;for(;i;)n(i,r)!==!0&&t(i,n,r),i=i.nextElementSibling;return null}function n(e,r){t(e,function(e){return r(e)?!0:(e.webkitShadowRoot&&n(e.webkitShadowRoot,r),void 0)}),e.webkitShadowRoot&&n(e.webkitShadowRoot,r)}function r(e){return a(e)?(s(e),!0):(c(e),void 0)}function i(e){n(e,function(e){return r(e)?!0:void 0})}function o(e){return r(e)||i(e)}function a(t){if(!t.__upgraded__&&t.nodeType===Node.ELEMENT_NODE){var n=t.getAttribute("is")||t.localName,r=e.registry[n];if(r)return logFlags.dom&&console.group("upgrade:",t.localName),e.upgrade(t),logFlags.dom&&console.groupEnd(),!0}}function s(e){c(e),h(e)&&n(e,function(e){c(e)})}function c(e){(e.insertedCallback||e.__upgraded__&&logFlags.dom)&&h(e)&&(e.__inserted=(e.__inserted||0)+1,1>e.__inserted&&(e.__inserted=1),e.__inserted>1?logFlags.dom&&console.warn("inserted:",e.localName,"insert/remove count:",e.__inserted):e.insertedCallback&&(logFlags.dom&&console.log("inserted:",e.localName),e.insertedCallback()))}function l(e){u(e),n(e,function(e){u(e)})}function u(e){(e.removedCallback||e.__upgraded__&&logFlags.dom)&&(logFlags.dom&&console.log("removed:",e.localName),h(e)||(e.__inserted=(e.__inserted||0)-1,e.__inserted>0&&(e.__inserted=0),0>e.__inserted?logFlags.dom&&console.warn("removed:",e.localName,"insert/remove count:",e.__inserted):e.removedCallback&&e.removedCallback()))}function h(e){for(var t=e;t;){if(t==document)return!0;t=t.parentNode||t.host}}function d(e){e.webkitShadowRoot&&!e.webkitShadowRoot.__watched&&(logFlags.dom&&console.log("watching shadow-root for: ",e.localName),g(e.webkitShadowRoot),e.webkitShadowRoot.__watched=!0)}function p(e){d(e),n(e,function(){d(e)})}function f(e){switch(e.localName){case"style":case"script":case"template":case void 0:return!0}}function v(e){if(logFlags.dom){var t=e[0];if(t&&"childList"===t.type&&t.addedNodes&&t.addedNodes){for(var n=t.addedNodes[0];n&&n!==document&&!n.host;)n=n.parentNode;var r=n&&(n.URL||n._URL||n.host&&n.host.localName)||"";r=r.split("/?").shift().split("/").pop()}console.group("mutations (%d) [%s]",e.length,r||"")}e.forEach(function(e){"childList"===e.type&&(E(e.addedNodes,function(e){f(e)||o(e)}),E(e.removedNodes,function(e){f(e)||l(e)}))}),logFlags.dom&&console.groupEnd()}function m(){v(w.takeRecords())}function g(e){w.observe(e,{childList:!0,subtree:!0})}function b(e){g(e)}function y(e){logFlags.dom&&console.group("upgradeDocument: ",(e.URL||e._URL||"").split("/").pop()),o(e),logFlags.dom&&console.groupEnd()}var w=new MutationObserver(v),E=Array.prototype.forEach.call.bind(Array.prototype.forEach);e.watchShadow=d,e.watchAllShadows=p,e.upgradeAll=o,e.upgradeSubtree=i,e.observeDocument=b,e.upgradeDocument=y,e.takeRecords=m}(window.CustomElements),function(){function parseElementElement(e){var t={name:"","extends":null};takeAttributes(e,t);var n=HTMLElement.prototype;if(t.extends){var r=document.createElement(t.extends);n=r.__proto__||Object.getPrototypeOf(r)}t.prototype=Object.create(n),e.options=t;var i=e.querySelector("script,scripts");i&&executeComponentScript(i.textContent,e,t.name);var o=document.register(t.name,t);e.ctor=o;var a=e.getAttribute("constructor");a&&(window[a]=o)}function takeAttributes(e,t){for(var n in t){var r=e.attributes[n];r&&(t[n]=r.value)}}function executeComponentScript(inScript,inContext,inName){context=inContext;var owner=context.ownerDocument,url=owner._URL||owner.URL||owner.impl&&(owner.impl._URL||owner.impl.URL),match=url.match(/.*\/([^.]*)[.]?.*$/);if(match){var name=match[1];url+=name!=inName?":"+inName:""}var code="__componentScript('"+inName+"', function(){"+inScript+"});"+"\n//@ sourceURL="+url+"\n";eval(code)}function mixin(e){for(var t=e||{},n=1;arguments.length>n;n++){var r=arguments[n];try{for(var i in r)copyProperty(i,r,t)}catch(o){}}return t}function copyProperty(e,t,n){var r=getPropertyDescriptor(t,e);Object.defineProperty(n,e,r)}function getPropertyDescriptor(e,t){if(e){var n=Object.getOwnPropertyDescriptor(e,t);return n||getPropertyDescriptor(Object.getPrototypeOf(e),t)}}var HTMLElementElement=function(e){return e.register=HTMLElementElement.prototype.register,parseElementElement(e),e};HTMLElementElement.prototype={register:function(e){e&&(this.options.lifecycle=e.lifecycle,e.prototype&&mixin(this.options.prototype,e.prototype))}};var context;window.__componentScript=function(e,t){t.call(context)},window.HTMLElementElement=HTMLElementElement,window.mixin=mixin}(),function(){function e(e){return e.ownerDocument===document||e.ownerDocument.impl===document}function t(e){return"link"===e.localName&&e.getAttribute("rel")===r}function n(e){return e.parentNode&&"element"===e.parentNode.localName?!0:void 0}var r="import",i={selectors:["link[rel="+r+"]","link[rel=stylesheet]","script[src]","script","style","element"],map:{link:"parseLink",script:"parseScript",element:"parseElement",style:"parseStyle"},parse:function(e){if(!e.__parsed){e.__parsed=!0;var t=e.querySelectorAll(o.selectors);a(t,function(e){o[o.map[e.localName]](e)}),CustomElements.upgradeDocument(e),CustomElements.observeDocument(e)}},parseLink:function(r){t(r)?r.content&&o.parse(r.content):e(r)||!r.parentNode||n(r)||document.head.appendChild(r)},parseScript:function(t){if(!e(t)&&!n(t)){var r=t.__resource||t.textContent;r&&(r+="\n//@ sourceURL="+t.__nodeUrl+"\n",eval.call(window,r))}},parseStyle:function(t){e(t)||n(t)||document.querySelector("head").appendChild(t)},parseElement:function(e){new HTMLElementElement(e)}},o=i,a=Array.prototype.forEach.call.bind(Array.prototype.forEach);CustomElements.parser=i}(),function(){function e(){setTimeout(function(){CustomElements.parser.parse(document),CustomElements.ready=!0,CustomElements.readyTime=(new Date).getTime(),window.HTMLImports&&(CustomElements.elapsed=CustomElements.readyTime-HTMLImports.readyTime),document.body.dispatchEvent(new CustomEvent("WebComponentsReady",{bubbles:!0}))},0)}"function"!=typeof window.CustomEvent&&(window.CustomEvent=function(e){var t=document.createEvent("HTMLEvents");return t.initEvent(e,!0,!0),t}),window.HTMLImports?document.addEventListener("HTMLImportsLoaded",e):window.addEventListener("load",e)}(),function(){function e(){}if(document.write("<style>element {display: none;} /* injected by platform.js */</style>"),window.ShadowDOMPolyfill){CustomElements.watchShadow=e,CustomElements.watchAllShadows=e;var t=["upgradeAll","upgradeSubtree","observeDocument","upgradeDocument"],n={};t.forEach(function(e){n[e]=CustomElements[e]}),t.forEach(function(e){CustomElements[e]=function(t){return n[e](wrap(t))}})}}(),function(e){e=e||{};var t={shadow:function(e){return e?e.shadowRoot||e.webkitShadowRoot:void 0},canTarget:function(e){return e&&Boolean(e.elementFromPoint)},targetingShadow:function(e){var t=this.shadow(e);return this.canTarget(t)?t:void 0},searchRoot:function(e,t,n){if(e){var r,i,o,a=e.elementFromPoint(t,n);for(i=this.targetingShadow(a);i;){if(r=i.elementFromPoint(t,n)){var s=this.targetingShadow(r);return this.searchRoot(s,t,n)||r}o=i.querySelector("shadow"),i=o&&o.olderShadowRoot}return a}},findTarget:function(e){var t=e.clientX,n=e.clientY;return this.searchRoot(document,t,n)}};e.targetFinding=t,e.findTarget=t.findTarget.bind(t);var n={ANCESTOR:Node.DOCUMENT_POSITION_CONTAINS,DESCENDANT:Node.DOCUMENT_POSITION_CONTAINED_BY,compare:function(e,t){return e&&t?e.compareDocumentPosition(t):0},isAncestor:function(e,t){return Boolean(this.compare(e,t)&this.DESCENDANT)},isDescendant:function(e,t){return Boolean(this.compare(e,t)&this.ANCESTOR)}};e.bounds=n,e.isAncestor=n.isAncestor.bind(n),window.PointerEventsPolyfill=e}(window.PointerEventsPolyfill),function(){function e(e){return'[touch-action="'+e+'"]'}function t(e){return"{ -ms-touch-action: "+e+"; touch-action: "+e+"; }"}var n=[{rule:"none",selectors:["none","user"]},"pan-x","pan-y",{rule:"pan-x pan-y",selectors:["scroll","pan-x pan-y","pan-y pan-x"]}],r="";n.forEach(function(n){r+=n+""===n?e(n)+t(n):n.selectors.map(e)+t(n.rule)});var i=document.createElement("style");i.textContent=r;var o=document.querySelector("head");o.insertBefore(i,o.firstChild)}(),function(e){function t(e,t){var t=t||{},i=t.buttons;if(void 0===i)switch(t.which){case 1:i=1;break;case 2:i=4;break;case 3:i=2;break;default:i=0}var o;if(n)o=new MouseEvent(e,t);else{o=document.createEvent("MouseEvent");var a={bubbles:!1,cancelable:!1,view:null,detail:null,screenX:0,screenY:0,clientX:0,clientY:0,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,button:0,relatedTarget:null};Object.keys(a).forEach(function(e){e in t&&(a[e]=t[e])}),o.initMouseEvent(e,a.bubbles,a.cancelable,a.view,a.detail,a.screenX,a.screenY,a.clientX,a.clientY,a.ctrlKey,a.altKey,a.shiftKey,a.metaKey,a.button,a.relatedTarget)}r||Object.defineProperty(o,"buttons",{value:i,enumerable:!0});var s=0;return s=t.pressure?t.pressure:i?.5:0,Object.defineProperties(o,{pointerId:{value:t.pointerId||0,enumerable:!0},width:{value:t.width||0,enumerable:!0},height:{value:t.height||0,enumerable:!0},pressure:{value:s,enumerable:!0},tiltX:{value:t.tiltX||0,enumerable:!0},tiltY:{value:t.tiltY||0,enumerable:!0},pointerType:{value:t.pointerType||"",enumerable:!0},hwTimestamp:{value:t.hwTimestamp||0,enumerable:!0},isPrimary:{value:t.isPrimary||!1,enumerable:!0}}),o}var n=!1,r=!1;try{var i=new MouseEvent("click",{buttons:1});n=!0,r=void 0!==i.buttons}catch(o){}e.PointerEvent=t}(window),function(e){function t(){this.ids=[],this.pointers=[]}t.prototype={set:function(e,t){var n=this.ids.indexOf(e);n>-1?this.pointers[n]=t:(this.ids.push(e),this.pointers.push(t))},has:function(e){return this.ids.indexOf(e)>-1},"delete":function(e){var t=this.ids.indexOf(e);t>-1&&(this.ids.splice(t,1),this.pointers.splice(t,1))},get:function(e){var t=this.ids.indexOf(e);return this.pointers[t]},get size(){return this.pointers.length},clear:function(){this.ids.length=0,this.pointers.length=0}},e.PointerMap=t}(window.PointerEventsPolyfill),function(e){var t;if("undefined"!=typeof WeakMap&&0>navigator.userAgent.indexOf("Firefox/"))t=WeakMap;else{var n=Object.defineProperty,r=Object.hasOwnProperty,i=(new Date).getTime()%1e9;t=function(){this.name="__st"+(1e9*Math.random()>>>0)+(i++ +"__")},t.prototype={set:function(e,t){n(e,this.name,{value:t,writable:!0})},get:function(e){return r.call(e,this.name)?e[this.name]:void 0},"delete":function(e){this.set(e,void 0)}}}e.SideTable=t}(window.PointerEventsPolyfill),function(e){var t=e.isAncestor,n={targets:new e.SideTable,handledEvents:new e.SideTable,scrollType:new e.SideTable,pointermap:new e.PointerMap,events:[],eventMap:{},eventSources:{},registerSource:function(e,t){var n=t,r=n.events;r&&(this.events=this.events.concat(r),r.forEach(function(e){n[e]&&(this.eventMap[e]=n[e].bind(n))},this),this.eventSources[e]=n)},registerTarget:function(e,t){this.scrollType.set(e,t||"none"),this.listen(this.events,e,this.boundHandler)},unregisterTarget:function(e){this.scrollType.set(e,null),this.unlisten(this.events,e,this.boundHandler)},down:function(e){this.fireEvent("pointerdown",e)},move:function(e){this.fireEvent("pointermove",e)},up:function(e){this.fireEvent("pointerup",e)},enter:function(e){e.bubbles=!1,this.fireEvent("pointerenter",e)},leave:function(e){e.bubbles=!1,this.fireEvent("pointerleave",e)},over:function(e){e.bubbles=!0,this.fireEvent("pointerover",e)},out:function(e){e.bubbles=!0,this.fireEvent("pointerout",e)},cancel:function(e){this.fireEvent("pointercancel",e)},leaveOut:function(e){t(e.target,e.relatedTarget)||this.leave(e),this.out(e)},enterOver:function(e){t(e.target,e.relatedTarget)||this.enter(e),this.over(e)},eventHandler:function(e){if(!this.handledEvents.get(e)){var t=e.type,n=this.eventMap&&this.eventMap[t];n&&n(e),this.handledEvents.set(e,!0)}},listen:function(e,t,n){e.forEach(function(e){this.addEvent(e,n,!1,t)},this)},unlisten:function(e,t,n){e.forEach(function(e){this.removeEvent(e,n,!1,t)},this)},addEvent:function(e,t,n,r){r.addEventListener(e,t,n)},removeEvent:function(e,t,n,r){r.removeEventListener(e,t,n)},makeEvent:function(e,t){var n=new PointerEvent(e,t);return this.targets.set(n,this.targets.get(t)||t.target),n},fireEvent:function(e,t){var n=this.makeEvent(e,t);return this.dispatchEvent(n)},cloneEvent:function(e){var t={};for(var n in e)t[n]=e[n];return t},getTarget:function(e){return this.captureInfo&&this.captureInfo.id===e.pointerId?this.captureInfo.target:this.targets.get(e)},setCapture:function(e,t){this.captureInfo&&this.releaseCapture(this.captureInfo.id),this.captureInfo={id:e,target:t};
var n=new PointerEvent("gotpointercapture",{bubbles:!0});this.implicitRelease=this.releaseCapture.bind(this,e),document.addEventListener("pointerup",this.implicitRelease),document.addEventListener("pointercancel",this.implicitRelease),this.targets.set(n,t),this.asyncDispatchEvent(n)},releaseCapture:function(e){if(this.captureInfo&&this.captureInfo.id===e){var t=new PointerEvent("lostpointercapture",{bubbles:!0}),n=this.captureInfo.target;this.captureInfo=null,document.removeEventListener("pointerup",this.implicitRelease),document.removeEventListener("pointercancel",this.implicitRelease),this.targets.set(t,n),this.asyncDispatchEvent(t)}},dispatchEvent:function(e){var t=this.getTarget(e);return t?t.dispatchEvent(e):void 0},asyncDispatchEvent:function(e){setTimeout(this.dispatchEvent.bind(this,e),0)}};n.boundHandler=n.eventHandler.bind(n),e.dispatcher=n}(window.PointerEventsPolyfill),function(e){var t=e.dispatcher,n=Array.prototype.forEach.call.bind(Array.prototype.forEach),r=Array.prototype.map.call.bind(Array.prototype.map),i={ATTRIB:"touch-action",SELECTOR:"[touch-action]",EMITTER:/^none|user$/,XSCROLLER:"pan-x",YSCROLLER:"pan-y",SCROLLER:/^(?:pan-x pan-y)|(?:pan-y pan-x)|scroll$/,OBSERVER_INIT:{subtree:!0,childList:!0,attributes:!0,attributeFilter:["touch-action"]},watchSubtree:function(t){e.targetFinding.canTarget(t)&&s.observe(t,this.OBSERVER_INIT)},enableOnSubtree:function(e){var t=e||document;this.watchSubtree(e),t===document&&"complete"!==document.readyState?this.installOnLoad():this.installNewSubtree(t)},installNewSubtree:function(e){n(this.findElements(e),this.addElement,this)},findElements:function(e){var t=e||document;return t.querySelectorAll?t.querySelectorAll(this.SELECTOR):[]},touchActionToScrollType:function(e){var t=e;return this.EMITTER.exec(t)?"none":t===this.XSCROLLER?"X":t===this.YSCROLLER?"Y":this.SCROLLER.exec(t)?"XY":void 0},removeElement:function(n){t.unregisterTarget(n);var r=e.targetFinding.shadow(n);r&&t.unregisterTarget(r)},addElement:function(n){var r=n.getAttribute&&n.getAttribute(this.ATTRIB),i=this.touchActionToScrollType(r);if(i){t.registerTarget(n,i);var o=e.targetFinding.shadow(n);o&&t.registerTarget(o,i)}},elementChanged:function(e){this.removeElement(e),this.addElement(e)},concatLists:function(e,t){for(var n,r=0,i=t.length;i>r&&(n=t[r]);r++)e.push(n);return e},installOnLoad:function(){document.addEventListener("DOMContentLoaded",this.installNewSubtree.bind(this,document))},flattenMutationTree:function(e){var t=r(e,this.findElements,this);return t.push(e),t.reduce(this.concatLists,[])},mutationWatcher:function(e){e.forEach(this.mutationHandler,this)},mutationHandler:function(e){var t=e;if("childList"===t.type){var n=this.flattenMutationTree(t.addedNodes);n.forEach(this.addElement,this);var r=this.flattenMutationTree(t.removedNodes);r.forEach(this.removeElement,this)}else"attributes"===t.type&&this.elementChanged(t.target)}},o=i.mutationWatcher.bind(i);e.installer=i,e.register=i.enableOnSubtree.bind(i),e.setTouchAction=function(e,n){var r=this.touchActionToScrollType(n);r?t.registerTarget(e,r):t.unregisterTarget(e)}.bind(i);var a=window.MutationObserver||window.WebKitMutationObserver;if(a)var s=new a(o);else i.watchSubtree=function(){console.warn("PointerEventsPolyfill: MutationObservers not found, touch-action will not be dynamically detected")}}(window.PointerEventsPolyfill),function(e){var t=e.dispatcher,n=e.installer,r=e.findTarget,i=t.pointermap,o=Array.prototype.map.call.bind(Array.prototype.map),a=2500,s=25,c={events:["touchstart","touchmove","touchend","touchcancel"],POINTER_TYPE:"touch",firstTouch:null,isPrimaryTouch:function(e){return this.firstTouch===e.identifier},setPrimaryTouch:function(e){null===this.firstTouch&&(this.firstTouch=e.identifier,this.firstXY={X:e.clientX,Y:e.clientY},this.scrolling=!1)},removePrimaryTouch:function(e){this.isPrimaryTouch(e)&&(this.firstTouch=null,this.firstXY=null)},touchToPointer:function(e){var n=t.cloneEvent(e);return n.pointerId=e.identifier+2,n.target=r(n),n.bubbles=!0,n.cancelable=!0,n.button=0,n.buttons=1,n.isPrimary=this.isPrimaryTouch(e),n.pointerType=this.POINTER_TYPE,n},processTouches:function(e,t){var n=e.changedTouches,r=o(n,this.touchToPointer,this);r.forEach(t,this)},shouldScroll:function(e){if(this.firstXY){var n,r=t.scrollType.get(e.currentTarget);if("none"===r)n=!1;else if("XY"===r)n=!0;else{var i=e.changedTouches[0],o=r,a="Y"===r?"X":"Y",s=Math.abs(i["client"+o]-this.firstXY[o]),c=Math.abs(i["client"+a]-this.firstXY[a]);n=s>=c}return this.firstXY=null,n}},findTouch:function(e,t){for(var n,r=0,i=e.length;i>r&&(n=e[r]);r++)if(n.identifier===t)return!0},vacuumTouches:function(e){var t=e.touches;if(i.size>=t.length){var n=[];i.ids.forEach(function(e){if(1!==e&&!this.findTouch(t,e-2)){var r=i.get(e).out;n.push(this.touchToPointer(r))}},this),n.forEach(this.cancelOut,this)}},touchstart:function(e){this.vacuumTouches(e),this.setPrimaryTouch(e.changedTouches[0]),this.dedupSynthMouse(e),this.scrolling||this.processTouches(e,this.overDown)},overDown:function(e){i.set(e.pointerId,{target:e.target,out:e,outTarget:e.target}),t.over(e),t.down(e)},touchmove:function(e){this.scrolling||(this.shouldScroll(e)?(this.scrolling=!0,this.touchcancel(e)):(e.preventDefault(),this.processTouches(e,this.moveOverOut)))},moveOverOut:function(e){var n=e,r=i.get(n.pointerId),o=r.out,a=r.outTarget;t.move(n),o&&a!==n.target&&(o.relatedTarget=n.target,n.relatedTarget=a,o.target=a,t.leaveOut(o),t.enterOver(n)),r.out=n,r.outTarget=n.target},touchend:function(e){this.dedupSynthMouse(e),this.processTouches(e,this.upOut)},upOut:function(e){this.scrolling||(t.up(e),t.out(e)),this.cleanUpPointer(e)},touchcancel:function(e){this.processTouches(e,this.cancelOut)},cancelOut:function(e){t.cancel(e),t.out(e),this.cleanUpPointer(e)},cleanUpPointer:function(e){i.delete(e.pointerId),this.removePrimaryTouch(e)},dedupSynthMouse:function(e){var t=l.lastTouches,n=e.changedTouches[0];if(this.isPrimaryTouch(n)){var r={x:n.clientX,y:n.clientY};t.push(r);var i=function(e,t){var n=e.indexOf(t);n>-1&&e.splice(n,1)}.bind(null,t,r);setTimeout(i,a)}}},l={POINTER_ID:1,POINTER_TYPE:"mouse",events:["mousedown","mousemove","mouseup","mouseover","mouseout"],global:["mousedown","mouseup","mouseover","mouseout"],lastTouches:[],mouseHandler:t.eventHandler.bind(t),isEventSimulatedFromTouch:function(e){for(var t,n=this.lastTouches,r=e.clientX,i=e.clientY,o=0,a=n.length;a>o&&(t=n[o]);o++){var c=Math.abs(r-t.x),l=Math.abs(i-t.y);if(s>=c&&s>=l)return!0}},prepareEvent:function(e){var n=t.cloneEvent(e);return n.pointerId=this.POINTER_ID,n.isPrimary=!0,n.pointerType=this.POINTER_TYPE,n},mousedown:function(e){if(!this.isEventSimulatedFromTouch(e)){var n=i.has(this.POINTER_ID);if(n&&(this.cancel(e),n=!1),!n){var r=this.prepareEvent(e);i.set(this.POINTER_ID,e),t.down(r),t.listen(this.global,document,this.mouseHandler)}}},mousemove:function(e){if(!this.isEventSimulatedFromTouch(e)){var n=this.prepareEvent(e);t.move(n)}},mouseup:function(e){if(!this.isEventSimulatedFromTouch(e)){var n=i.get(this.POINTER_ID);if(n&&n.button===e.button){var r=this.prepareEvent(e);t.up(r),this.cleanupMouse()}}},mouseover:function(e){if(!this.isEventSimulatedFromTouch(e)){var n=this.prepareEvent(e);t.enterOver(n)}},mouseout:function(e){if(!this.isEventSimulatedFromTouch(e)){var n=this.prepareEvent(e);t.leaveOut(n)}},cancel:function(e){var n=this.prepareEvent(e);t.cancel(n),this.cleanupMouse()},cleanupMouse:function(){i.delete(this.POINTER_ID),t.unlisten(this.global,document,this.mouseHandler)}},u={events:["MSPointerDown","MSPointerMove","MSPointerUp","MSPointerOut","MSPointerOver","MSPointerCancel","MSGotPointerCapture","MSLostPointerCapture"],POINTER_TYPES:["","unavailable","touch","pen","mouse"],prepareEvent:function(e){var n=t.cloneEvent(e);return n.pointerType=this.POINTER_TYPES[e.pointerType],n},cleanup:function(e){i.delete(e)},MSPointerDown:function(e){i.set(e.pointerId,e);var n=this.prepareEvent(e);t.down(n)},MSPointerMove:function(e){var n=this.prepareEvent(e);t.move(n)},MSPointerUp:function(e){var n=this.prepareEvent(e);t.up(n),this.cleanup(e.pointerId)},MSPointerOut:function(e){var n=this.prepareEvent(e);t.leaveOut(n)},MSPointerOver:function(e){var n=this.prepareEvent(e);t.enterOver(n)},MSPointerCancel:function(e){var n=this.prepareEvent(e);t.cancel(n),this.cleanup(e.pointerId)},MSLostPointerCapture:function(e){var n=t.makeEvent("lostpointercapture",e);t.dispatchEvent(n)},MSGotPointerCapture:function(e){var n=t.makeEvent("gotpointercapture",e);t.dispatchEvent(n)}};if(void 0===window.navigator.pointerEnabled){if(window.navigator.msPointerEnabled){var h=window.navigator.msMaxTouchPoints;Object.defineProperty(window.navigator,"maxTouchPoints",{value:h,enumerable:!0}),t.registerSource("ms",u),t.registerTarget(document)}else t.registerSource("mouse",l),"ontouchstart"in window&&t.registerSource("touch",c),n.enableOnSubtree(document),t.listen(["mousemove"],document,t.boundHandler);Object.defineProperty(window.navigator,"pointerEnabled",{value:!0,enumerable:!0})}}(window.PointerEventsPolyfill),function(e){function t(e){if(!i.pointermap.has(e))throw Error("InvalidPointerId")}var n,r,i=e.dispatcher,o=window.navigator;o.msPointerEnabled?(n=function(e){t(e),this.msSetPointerCapture(e)},r=function(e){t(e),this.msReleasePointerCapture(e)}):(n=function(e){t(e),i.setCapture(e,this)},r=function(e){t(e),i.releaseCapture(e,this)}),Element.prototype.setPointerCapture||Object.defineProperties(Element.prototype,{setPointerCapture:{value:n},releasePointerCapture:{value:r}})}(window.PointerEventsPolyfill),PointerGestureEvent.prototype.preventTap=function(){this.tapPrevented=!0},function(e){e=e||{},e.utils={LCA:{find:function(e,t){if(e===t)return e;if(e.compareDocumentPosition){var n=e.compareDocumentPosition(t);if(n&Node.DOCUMENT_POSITION_CONTAINS)return t;if(n&Node.DOCUMENT_POSITION_CONTAINED_BY)return e}var r=this.depth(e),i=this.depth(t),o=r-i;for(o>0?e=this.walk(e,o):t=this.walk(t,-o);e&&t&&e!==t;)e=this.walk(e,1),t=this.walk(t,1);return e},walk:function(e,t){for(var n=0;t>n;n++)e=e.parentNode;return e},depth:function(e){for(var t=0;e;)t++,e=e.parentNode;return t}}},e.findLCA=function(t,n){return e.utils.LCA.find(t,n)},window.PointerGestures=e}(window.PointerGestures),function(e){var t;if("undefined"!=typeof WeakMap&&0>navigator.userAgent.indexOf("Firefox/"))t=WeakMap;else{var n=Object.defineProperty,r=Object.hasOwnProperty,i=(new Date).getTime()%1e9;t=function(){this.name="__st"+(1e9*Math.random()>>>0)+(i++ +"__")},t.prototype={set:function(e,t){n(e,this.name,{value:t,writable:!0})},get:function(e){return r.call(e,this.name)?e[this.name]:void 0},"delete":function(e){this.set(e,void 0)}}}e.SideTable=t}(window.PointerGestures),function(e){function t(){this.ids=[],this.pointers=[]}t.prototype={set:function(e,t){var n=this.ids.indexOf(e);n>-1?this.pointers[n]=t:(this.ids.push(e),this.pointers.push(t))},has:function(e){return this.ids.indexOf(e)>-1},"delete":function(e){var t=this.ids.indexOf(e);t>-1&&(this.ids.splice(t,1),this.pointers.splice(t,1))},get:function(e){var t=this.ids.indexOf(e);return this.pointers[t]},get size(){return this.pointers.length},clear:function(){this.ids.length=0,this.pointers.length=0}},window.Map&&(t=window.Map),e.PointerMap=t}(window.PointerGestures),function(e){var t={handledEvents:new e.SideTable,targets:new e.SideTable,handlers:{},recognizers:{},events:["pointerdown","pointermove","pointerup","pointerover","pointerout","pointercancel"],registerRecognizer:function(e,t){var n=t;this.recognizers[e]=n,this.events.forEach(function(e){if(n[e]){var t=n[e].bind(n);this.addHandler(e,t)}},this)},addHandler:function(e,t){var n=e;this.handlers[n]||(this.handlers[n]=[]),this.handlers[n].push(t)},registerTarget:function(e){this.listen(this.events,e)},unregisterTarget:function(e){this.unlisten(this.events,e)},eventHandler:function(e){if(!this.handledEvents.get(e)){var t,n=e.type;(t=this.handlers[n])&&this.makeQueue(t,e),this.handledEvents.set(e,!0)}},makeQueue:function(e,t){var n=this.cloneEvent(t);setTimeout(this.runQueue.bind(this,e,n),0)},runQueue:function(e,t){this.currentPointerId=t.pointerId;for(var n,r=0,i=e.length;i>r&&(n=e[r]);r++)n(t);this.currentPointerId=0},listen:function(e,t){e.forEach(function(e){this.addEvent(e,this.boundHandler,!1,t)},this)},unlisten:function(e){e.forEach(function(e){this.removeEvent(e,this.boundHandler,!1,inTarget)},this)},addEvent:function(e,t,n,r){r.addEventListener(e,t,n)},removeEvent:function(e,t,n,r){r.removeEventListener(e,t,n)},makeEvent:function(e,t){return new PointerGestureEvent(e,t)},cloneEvent:function(e){var t={};for(var n in e)t[n]=e[n];return t},dispatchEvent:function(e,t){var n=t||this.targets.get(e);n&&(n.dispatchEvent(e),e.tapPrevented&&this.preventTap(this.currentPointerId))},asyncDispatchEvent:function(e,t){var n=function(){this.dispatchEvent(e,t)}.bind(this);setTimeout(n,0)},preventTap:function(e){var t=this.recognizers.tap;t&&t.preventTap(e)}};t.boundHandler=t.eventHandler.bind(t),e.dispatcher=t,e.register=function(t){var n=window.PointerEventsPolyfill;n&&n.register(t),e.dispatcher.registerTarget(t)},t.registerTarget(document)}(window.PointerGestures),function(e){var t=e.dispatcher,n={HOLD_DELAY:200,WIGGLE_THRESHOLD:16,events:["pointerdown","pointermove","pointerup","pointercancel"],heldPointer:null,holdJob:null,pulse:function(){var e=Date.now()-this.heldPointer.timeStamp,t=this.held?"holdpulse":"hold";this.fireHold(t,e),this.held=!0},cancel:function(){clearInterval(this.holdJob),this.held&&this.fireHold("release"),this.held=!1,this.heldPointer=null,this.target=null,this.holdJob=null},pointerdown:function(e){e.isPrimary&&!this.heldPointer&&(this.heldPointer=e,this.target=e.target,this.holdJob=setInterval(this.pulse.bind(this),this.HOLD_DELAY))},pointerup:function(e){this.heldPointer&&this.heldPointer.pointerId===e.pointerId&&this.cancel()},pointercancel:function(){this.cancel()},pointermove:function(e){if(this.heldPointer&&this.heldPointer.pointerId===e.pointerId){var t=e.clientX-this.heldPointer.clientX,n=e.clientY-this.heldPointer.clientY;t*t+n*n>this.WIGGLE_THRESHOLD&&this.cancel()}},fireHold:function(e,n){var r={pointerType:this.heldPointer.pointerType};n&&(r.holdTime=n);var i=t.makeEvent(e,r);t.dispatchEvent(i,this.target),i.tapPrevented&&t.preventTap(this.heldPointer.pointerId)}};t.registerRecognizer("hold",n)}(window.PointerGestures),function(e){var t=e.dispatcher,n=new e.PointerMap,r={events:["pointerdown","pointermove","pointerup","pointercancel"],WIGGLE_THRESHOLD:4,clampDir:function(e){return e>0?1:-1},calcPositionDelta:function(e,t){var n=0,r=0;return e&&t&&(n=t.pageX-e.pageX,r=t.pageY-e.pageY),{x:n,y:r}},fireTrack:function(e,n,r){var i=r,o=this.calcPositionDelta(i.downEvent,n),a=this.calcPositionDelta(i.lastMoveEvent,n);a.x&&(i.xDirection=this.clampDir(a.x)),a.y&&(i.yDirection=this.clampDir(a.y));var s={dx:o.x,dy:o.y,ddx:a.x,ddy:a.y,clientX:n.clientX,clientY:n.clientY,pageX:n.pageX,pageY:n.pageY,screenX:n.screenX,screenY:n.screenY,xDirection:i.xDirection,yDirection:i.yDirection,trackInfo:i.trackInfo,pointerType:n.pointerType};"trackend"===e&&(s._releaseTarget=n.target);var c=t.makeEvent(e,s);i.lastMoveEvent=n,t.dispatchEvent(c,i.downTarget)},pointerdown:function(e){if(e.isPrimary&&1===e.buttons){var t={downEvent:e,downTarget:e.target,trackInfo:{},lastMoveEvent:null,xDirection:0,yDirection:0,tracking:!1};n.set(e.pointerId,t)}},pointermove:function(e){var t=n.get(e.pointerId);if(t)if(t.tracking)this.fireTrack("track",e,t);else{var r=this.calcPositionDelta(t.downEvent,e),i=r.x*r.x+r.y*r.y;i>this.WIGGLE_THRESHOLD&&(t.tracking=!0,this.fireTrack("trackstart",t.downEvent,t),this.fireTrack("track",e,t))}},pointerup:function(e){var t=n.get(e.pointerId);t&&(t.tracking&&this.fireTrack("trackend",e,t),n.delete(e.pointerId))},pointercancel:function(e){this.pointerup(e)}};t.registerRecognizer("track",r)}(window.PointerGestures),function(e){var t=e.dispatcher,n={MIN_VELOCITY:.5,MAX_QUEUE:4,moveQueue:[],target:null,pointerId:null,events:["pointerdown","pointermove","pointerup","pointercancel"],pointerdown:function(e){e.isPrimary&&!this.pointerId&&(this.pointerId=e.pointerId,this.target=e.target,this.addMove(e))},pointermove:function(e){e.pointerId===this.pointerId&&this.addMove(e)},pointerup:function(e){e.pointerId===this.pointerId&&this.fireFlick(e),this.cleanup()},pointercancel:function(){this.cleanup()},cleanup:function(){this.moveQueue=[],this.target=null,this.pointerId=null},addMove:function(e){this.moveQueue.length>=this.MAX_QUEUE&&this.moveQueue.shift(),this.moveQueue.push(e)},fireFlick:function(e){for(var n,r,i,o,a,s,c,l=e,u=this.moveQueue.length,h=0,d=0,p=0,f=0;u>f&&(c=this.moveQueue[f]);f++)n=l.timeStamp-c.timeStamp,r=l.clientX-c.clientX,i=l.clientY-c.clientY,o=r/n,a=i/n,s=Math.sqrt(o*o+a*a),s>p&&(h=o,d=a,p=s);var v=Math.abs(h)>Math.abs(d)?"x":"y",m=this.calcAngle(h,d);if(Math.abs(p)>=this.MIN_VELOCITY){var g=t.makeEvent("flick",{xVelocity:h,yVelocity:d,velocity:p,angle:m,majorAxis:v,pointerType:e.pointerType});t.dispatchEvent(g,this.target)}},calcAngle:function(e,t){return 180*Math.atan2(t,e)/Math.PI}};t.registerRecognizer("flick",n)}(window.PointerGestures),function(e){var t=e.dispatcher,n=new e.PointerMap,r={events:["pointerdown","pointermove","pointerup","pointercancel"],pointerdown:function(e){e.isPrimary&&!e.tapPrevented&&n.set(e.pointerId,{target:e.target,x:e.clientX,y:e.clientY})},pointermove:function(e){if(e.isPrimary){var t=n.get(e.pointerId);t&&e.tapPrevented&&n.delete(e.pointerId)}},pointerup:function(r){var i=n.get(r.pointerId);if(i&&!r.tapPrevented){var o=e.findLCA(i.target,r.target);if(o){var a=t.makeEvent("tap",{x:r.clientX,y:r.clientY,pointerType:r.pointerType});t.dispatchEvent(a,o)}}n.delete(r.pointerId)},pointercancel:function(e){n.delete(e.pointerId)},preventTap:function(e){n.delete(e)}};t.registerRecognizer("tap",r)}(window.PointerGestures),function(){var e=Array.prototype.forEach.call.bind(Array.prototype.forEach);window.forEach=e}(),function(){function e(e,n){1==arguments.length&&(n=e,e=null),n&&n.hasOwnProperty("constructor")||(n.constructor=function(){this.super()});var r=n.constructor,o=e&&e.prototype||Object.prototype;return r.prototype=t(o,n),"super"in r.prototype||(r.prototype.super=i),r}function t(e,t){return Object.create(e,n(t))}function n(e){var t={};for(var n in e)t[n]=r(e,n);return t}function r(e,t){return e&&Object.getOwnPropertyDescriptor(e,t)||r(Object.getPrototypeOf(e),t)}function i(e){var t=i.caller,n=t._nom;if(!n&&(n=t._nom=s.call(this,t),!n))return console.warn('called super() on a method not in "this"'),void 0;"_super"in t||a(t,n,Object.getPrototypeOf(this));var r=t._super;if(r){var o=r[n];return"_super"in o||a(o,n,r),o.apply(this,e||[])}}function o(e,t,n){for(var r=e;r&&(!r.hasOwnProperty(t)||r[t]==n);)r=Object.getPrototypeOf(r);return r}function a(e,t,n){e._super=o(n,t,e),e._super&&(e._super[t]._nom=t)}function s(e){for(var t in this){var n=r(this,t);if(n.value==e)return t}}window.$class=e,window.extend=t,window.$super=i}(),function(){function e(e,r){if(e!=window){if(!(e&&e instanceof HTMLElement))throw"First argument to Toolkit.register must be an HTMLElement";var i=mixin({},Toolkit.base,r);i.elementElement=e,Toolkit.addResolvePath(i,e),i.installTemplate=function(){this.super(),n.call(this,e)},i.readyCallback=t,Toolkit.parseHostEvents(e.attributes,i),Toolkit.publishAttributes(e,i),Toolkit.installSheets(e),Toolkit.shimStyling(e),e.register({prototype:i}),logFlags.comps&&console.log("Toolkit: element registered"+e.options.name)}}function t(){this.installTemplate(),i.call(this)}function n(e){var t=e.querySelector("template");if(t){var n=this.webkitCreateShadowRoot();return n.applyAuthorStyles=this.applyAuthorStyles,CustomElements.watchShadow(this),n.host=this,n.appendChild(t.createInstance()),PointerGestures.register(n),PointerEventsPolyfill.setTouchAction(n,this.getAttribute("touch-action")),r.call(this,n),n}}function r(e){CustomElements.takeRecords(),Toolkit.bindModel.call(this,e),Toolkit.marshalNodeReferences.call(this,e);var t=Toolkit.accumulateEvents(e);Toolkit.bindAccumulatedLocalEvents.call(this,e,t)}function i(){Toolkit.observeProperties.call(this),Toolkit.takeAttributes.call(this);var e=Toolkit.accumulateHostEvents.call(this);Toolkit.bindAccumulatedHostEvents.call(this,e),this.ready&&this.ready()}function o(e,t){for(var n=e;n&&n!=this;){var r=Array.prototype.indexOf.call(t,n);if(r>=0)return r;n=n.parentNode}}window.logFlags||{},window.Toolkit={register:e,findDistributedTarget:o,instanceReady:i}}(),function(e){var t=window.logFlags||{},n={"super":$super,isToolkitElement:!0,bind:function(){Toolkit.bind.apply(this,arguments)},unbind:function(){Toolkit.unbind.apply(this,arguments)},job:function(){return Toolkit.job.apply(this,arguments)},asyncMethod:function(e,t,n){var r=t&&t.length?t:[t];return window.setTimeout(function(){(this[e]||e).apply(this,r)}.bind(this),n||0)},dispatch:function(e,t){this[e]&&this[e].apply(this,t)},send:function(e,n,r){var i=r||this;t.events&&console.log("[%s]: sending [%s]",i.localName,e),i.dispatchEvent(new CustomEvent(e,{bubbles:!0,detail:n}))},asend:function(){this.asyncMethod("send",arguments)},classFollows:function(e,t,n){t&&t.classList.remove(n),e&&e.classList.add(n)}};e.base=n}(window.Toolkit),function(){function e(e,n,r,i){t.bind&&console.log("[%s]: bindProperties: [%s] to [%s].[%s]",r.localName||"object",i,e.localName,n);var o=PathObserver.getValueAtPath(r,i);(null==o||void 0===o)&&PathObserver.setValueAtPath(r,i,e[n]),Object.defineProperty(e,n,{get:function(){return PathObserver.getValueAtPath(r,i)},set:function(e){PathObserver.setValueAtPath(r,i,e)},configurable:!0,enumerable:!0})}var t=window.logFlags||{};Toolkit.bindProperties=e}(),function(){function e(e,t,n){var r=l.get(e);r||l.set(e,r={}),r[t.toLowerCase()]=n}function t(e,t){var n=l.get(e);n&&delete n[t.toLowerCase()]}function n(n){var r=n.prototype,i=r.bind,o=r.unbind;r.bind=function(t,n,r){i.apply(this,arguments),e(this,t,r)},r.unbind=function(e){o.apply(this,arguments),t(this,e)}}function r(e){return e&&l.get(e)||u}function i(e,t){return r(e)[t.toLowerCase()]}function o(e){c.bind&&console.group("[%s] bindModel",this.localName),HTMLTemplateElement.bindAllMustachesFrom_(e,this),c.bind&&console.groupEnd()}function a(t,n,r){var i=Toolkit.propertyForAttribute.call(this,t);i?(e(this,i,r),Toolkit.bindProperties(this,i,n,r)):HTMLElement.prototype.bind.apply(this,arguments)}function s(e){var n=Toolkit.propertyForAttribute.call(this,e);n?(t(this,e),Object.defineProperty(this,e,{value:this[e],enumerable:!0,writable:!0,configurable:!0})):HTMLElement.prototype.unbind.apply(this,arguments)}var c=window.logFlags||{},l=new SideTable;[Node,Element,Text,HTMLInputElement].forEach(n);var u={},h=/\{\{([^{}]*)}}/;Toolkit.bind=a,Toolkit.unbind=s,Toolkit.getBinding=i,Toolkit.bindModel=o,Toolkit.bindPattern=h}(),function(){function e(){forEach(this.attributes,function(e){var i=t.call(this,e.name);if(i){if(e.value.search(r)>=0)return;var o=this[i],a=n(e.value,o);a!==o&&(this[i]=a)}},this)}function t(e){var t=Object.keys(this[i]);return t[t.map(c).indexOf(e.toLowerCase())]}function n(e,t){var n=typeof t;if("string"===n)return e;switch(e){case"":return"boolean"===n?!0:"";case"true":return!0;case"false":return!1}if(t instanceof Date)return new Date(Date.parse(e)||Date.now());var r=parseFloat(e);return r+""===e?r:e}var r=Toolkit.bindPattern,i="__published",o="attributes",a="publish",s=function(e,t){var n={},r=e.getAttribute(o);if(r){var s=r.split(r.indexOf(",")>=0?",":" ");s.forEach(function(e){e=e.trim(),e&&(n[e]=null)})}var c=e.options.prototype;Object.keys(n).forEach(function(e){e in t||e in c||(t[e]=n[e])});var l=t[a];l&&(Object.keys(l).forEach(function(e){t[e]=l[e]}),n=mixin(n,l)),t[i]=mixin({},c[i],n)},c=String.prototype.toLowerCase.call.bind(String.prototype.toLowerCase);Toolkit.takeAttributes=e,Toolkit.publishAttributes=s,Toolkit.propertyForAttribute=t}(),Toolkit.marshalNodeReferences=function(e){var t=this.$=this.$||{};if(e){var n=e.querySelectorAll("[id]");forEach(n,function(e){t[e.id]=e})}},function(){function e(e,t,n){var r=n.bind(this);for(var i in t)c.events&&console.log('[%s] bindAccumulatedEvents: addEventListener("%s", listen)',e.localName||"root",i),e.addEventListener(i,r)}function t(t){e.call(this,this,t,i)}function n(t,n){e.call(this,t,n,r)}function r(e){if(!e.cancelBubble){e.on=l+e.type,c.events&&console.group("[%s]: listenLocal [%s]",this.localName,e.on);for(var t=e.target;t&&t!=this;){var n=w(t);if(n&&a.call(n,t,e))return;t=t.parentNode}c.events&&console.groupEnd()}}function i(e){e.cancelBubble||(c.events&&console.group("[%s]: listenHost [%s]",this.localName,e.type),s.call(this,this,e),c.events&&console.groupEnd())}function o(e){var t=T.get(e);return t||(t=[],T.set(e,t)),t}function a(e,t){if(e.attributes){var n=o(t);if(0>n.indexOf(e)){n.push(e);var r=e.getAttribute(t.on);r&&(c.events&&console.log("[%s] found handler name [%s]",this.localName,r),E(this,r,[t,t.detail,e]))}}return t.cancelBubble}function s(e,t){var n=S.call(e,t.type);return n&&(c.events&&console.log("[%s] found host handler name [%s]",e.localName,n),E(e,n,[t,t.detail,e])),t.cancelBubble}var c=window.logFlags||{},l="on-",u=function(e,t){t.eventDelegates=h(e)},h=function(e){var t={};if(e)for(var n,r=0;n=e[r];r++)n.name.slice(0,l.length)==l&&(t[n.name.slice(l.length)]=n.value);return t},d=function(e,t){var n=t||{};return p(e,n),m(e,n),g(e,n),n},p=function(e,t){var n=e.attributes;if(n)for(var r,i=0;r=n[i];i++)r.name.slice(0,l.length)===l&&v(r.name.slice(l.length),t)},f={webkitanimationstart:"webkitAnimationStart",webkitanimationend:"webkitAnimationEnd",webkittransitionend:"webkitTransitionEnd",domfocusout:"DOMFocusOut",domfocusin:"DOMFocusIn"},v=function(e,t){var n=f[e]||e;t[n]=1},m=function(e,t){for(var n,r=e.childNodes,i=0;n=r[i];i++)d(n,t)},g=function(e,t){if("template"==e.localName){var n=b(e);n&&m(n,t)}},b=function(e){return e.ref?e.ref.content:e.content},y=function(e){for(var t=e||{},n=this.__proto__;n&&n!==HTMLElement.prototype;){if(n.hasOwnProperty("eventDelegates"))for(var r in n.eventDelegates)v(r,t);n=n.__proto__}return t},w=function(e){for(var t=e;t.parentNode&&"shadow-root"!==t.localName;)t=t.parentNode;return t.host},E=function(e,t,n){e&&(c.events&&console.group("[%s] dispatch [%s]",e.localName,t),e.dispatch(t,n),c.events&&console.groupEnd())},T=new SideTable("handledList"),S=function(e){for(var t=this;t;){if(t.hasOwnProperty("eventDelegates")){var n=t.eventDelegates[e]||t.eventDelegates[e.toLowerCase()];if(n)return n}t=t.__proto__}};Toolkit.parseHostEvents=u,Toolkit.accumulateEvents=d,Toolkit.accumulateHostEvents=y,Toolkit.bindAccumulatedHostEvents=t,Toolkit.bindAccumulatedLocalEvents=n}(),function(){function e(){for(var e in this)t.call(this,e)}function t(e){n.call(this,e)&&(i.observe&&console.log("["+this.localName+"] watching ["+e+"]"),new PathObserver(this,e,function(t,n){i.data&&console.log("[%s#%s] watch: [%s] now [%s] was [%s]",this.localName,this.node.id||"",e,this[e],n),r.call(this,e,n)}.bind(this)))}function n(e){return"_"!=e[0]&&!(e in Object.prototype)&&Boolean(this[e+o])}function r(e,t){var n=e+o;this[n]&&this[n](t)}var i=window.logFlags||{},o="Changed";Toolkit.observeProperties=e}(),function(){function e(e){t(e),n(e)}function t(e){var t=e.querySelectorAll("[rel=stylesheet]"),n=e.querySelector("template");if(n)var r=templateContent(n);r&&f(t,function(e){if(!e.hasAttribute(p)){e.parentNode.removeChild(e);var t=o(e);t&&r.insertBefore(t,r.firstChild)}})}function n(e){var t=e.globalStyles||(e.globalStyles=c(e,"global"));a(t,l.head)}function r(e,t){var n=t.controllerStyles||(t.controllerStyles=c(t,"controller"));u.queue(function(){var t=i(e);t&&(Toolkit.shimPolyfillDirectives(n,e.localName),a(n,t))})}function i(e){for(var t=e;t.parentNode&&"shadow-root"!=t.localName;)t=t.parentNode;return t==l?l.head:t}function o(e){if(e.__resource){var t=l.createElement("style");return t.textContent=e.__resource,t}console.warn("Could not find content for stylesheet",e)}function a(e,t){e.forEach(function(e){t.appendChild(e.cloneNode(!0))})}function s(e,t){return d?d.call(e,t):void 0}function c(e,t){var n=[],r=e.querySelectorAll("[rel=stylesheet]"),i="["+p+"="+t+"]";Array.prototype.forEach.call(r,function(e){s(e,i)&&(e.parentNode.removeChild(e),n.push(o(e)))});var a=e.querySelectorAll("style");return Array.prototype.forEach.call(a,function(e){s(e,i)&&(e.parentNode.removeChild(e),n.push(e))}),n}window.logFlags||{};var l=window.ShadowDOMPolyfill?ShadowDOMPolyfill.wrap(document):document,u={list:[],queue:function(e){e&&u.list.push(e),u.queueFlush()},queueFlush:function(){u.flushing||(u.flushing=!0,requestAnimationFrame(u.flush))},flush:function(){u.list.forEach(function(e){e()}),u.list=[],u.flushing=!1}},h=HTMLElement.prototype,d=h.matches||h.matchesSelector||h.webkitMatchesSelector||h.mozMatchesSelector,p="toolkit-scope",f=Array.prototype.forEach.call.bind(Array.prototype.forEach);Toolkit.installSheets=e,Toolkit.installControllerStyles=r}(),function(){var e=Array.prototype.forEach.call.bind(Array.prototype.forEach),t=Array.prototype.concat.call.bind(Array.prototype.concat),n=Array.prototype.slice.call.bind(Array.prototype.slice),r={hostRuleRe:/@host[^{]*{(([^}]*?{[^{]*?}[\s\S]*?)+)}/gim,selectorRe:/([^{]*)({[\s\S]*?})/gim,hostFixableRe:/^[.\[:]/,cssCommentRe:/\/\*[^*]*\*+([^/*][^*]*\*+)*\//gim,cssPolyfillCommentRe:/\/\*\s*@polyfill ([^*]*\*+([^/*][^*]*\*+)*\/)([^{]*?){/gim,selectorReSuffix:"([>\\s~+[.,{:][\\s\\S]*)?$",hostRe:/@host/gim,cache:{},shimStyling:function(e){window.ShadowDOMPolyfill&&(r.cacheDefinition(e),r.shimShadowDOMStyling(e.styles,e.options.name))},shimShadowDOMStyling:function(e,t){window.ShadowDOMPolyfill&&(r.shimPolyfillDirectives(e,t),r.shimAtHost(e,t),r.shimScoping(e,t))},cacheDefinition:function(e){var t=e.options.name,i=e.querySelector("template"),o=i&&templateContent(i),a=o&&o.querySelectorAll("style");e.styles=a?n(a):[],e.templateContent=o,r.cache[t]=e},shimPolyfillDirectives:function(t,n){window.ShadowDOMPolyfill&&t&&e(t,function(e){e.textContent=this.convertPolyfillDirectives(e.textContent,n)},this)},shimAtHost:function(e,t){var n=this.findAtHostStyles(e,t);if(n){var r=this.convertAtHostStyles(n,t);this.addCssToDocument(r)}},shimScoping:function(e,t){e&&this.applyPseudoScoping(e,t)},convertPolyfillDirectives:function(e){for(var t,n="",r=e,i=0;t=this.cssPolyfillCommentRe.exec(r);)n+=r.substring(i,t.index),n+=t[1].slice(0,-2)+"{",i=this.cssPolyfillCommentRe.lastIndex;return n+=r.substring(i,r.length)},findAtHostStyles:function(e,r){var i=e,o=this.cache[r],a=o.templateContent&&o.templateContent.querySelector("shadow");if(a){var s=this.findExtendee(r);if(s){var c=s.options.name,l=this.findAtHostStyles(s.styles,c);i=t(n(l),n(i))}}return i},findExtendee:function(e){var t=this.cache[e];return t&&this.cache[t.options.extends]},findAtHostRules:function(e,t){return Array.prototype.filter.call(e,this.isHostRule.bind(this,t))},isHostRule:function(e,t){return t.selectorText&&t.selectorText.match(e)||t.cssRules&&this.findAtHostRules(t.cssRules,e).length||t.type==CSSRule.WEBKIT_KEYFRAMES_RULE},convertAtHostStyles:function(e,t){for(var n,r=this.stylesToCssText(e),i="",o=0;n=this.hostRuleRe.exec(r);)i+=r.substring(o,n.index),i+=this.scopeHostCss(n[1],t),o=this.hostRuleRe.lastIndex;i+=r.substring(o,r.length);var a=RegExp("^"+t+this.selectorReSuffix,"m"),r=this.rulesToCss(this.findAtHostRules(this.cssToRules(i),a));return r},scopeHostCss:function(e,t){for(var n,r="";n=this.selectorRe.exec(e);)r+=this.scopeHostSelector(n[1],t)+" "+n[2]+"\n ";return r},scopeHostSelector:function(e,t){var n=[],r=e.split(",");return r.forEach(function(e){e=e.trim(),e.indexOf("*")>=0?e=e.replace("*",t):e.match(this.hostFixableRe)&&(e=t+e),n.push(e)},this),n.join(", ")},applyPseudoScoping:function(t,n){e(t,function(e){e.parentNode&&e.parentNode.removeChild(e)});var r=this.stylesToCssText(t).replace(this.hostRuleRe,""),i=this.cssToRules(r),r=this.pseudoScopeRules(i,n);this.addCssToDocument(r)},pseudoScopeRules:function(t,n){var r="";return e(t,function(e){e.selectorText&&e.style&&e.style.cssText?(r+=this.pseudoScopeSelector(e.selectorText,n)+" {\n ",r+=e.style.cssText+"\n}\n\n"):e.media?(r+="@media "+e.media.mediaText+" {\n",r+=this.pseudoScopeRules(e.cssRules,n),r+="\n}\n\n"):e.cssText&&(r+=e.cssText+"\n\n")
},this),r},pseudoScopeSelector:function(e,t){var n=[],r=e.split(",");return r.forEach(function(e){n.push(t+" "+e.trim())}),n.join(", ")},stylesToCssText:function(t,n){var r="";return e(t,function(e){r+=e.textContent+"\n\n"}),n||(r=this.stripCssComments(r)),r},stripCssComments:function(e){return e.replace(this.cssCommentRe,"")},cssToRules:function(e){var t=document.createElement("style");t.textContent=e,document.head.appendChild(t);var n=t.sheet.cssRules;return t.parentNode.removeChild(t),n},rulesToCss:function(e){for(var t=0,n=[];e.length>t;t++)n.push(e[t].cssText);return n.join("\n\n")},addCssToDocument:function(e){e&&this.getSheet().appendChild(document.createTextNode(e))},getSheet:function(){return this.sheet||(this.sheet=document.createElement("style")),this.sheet},apply:function(){this.addCssToDocument("style { display: none !important; }\n"),document.head.appendChild(this.getSheet())}};document.addEventListener("WebComponentsReady",function(){r.apply()}),Toolkit.shimStyling=r.shimStyling,Toolkit.shimShadowDOMStyling=r.shimShadowDOMStyling,Toolkit.shimPolyfillDirectives=r.shimPolyfillDirectives.bind(r)}(window),function(){function e(e,t){var r=n(t);e.resolvePath=function(e){return r+e}}function t(e){if(e){var t=e.split("/");return t.pop(),t.push(""),t.join("/")}return""}function n(e){return t(HTMLImports.getDocumentUrl(e.ownerDocument))}Toolkit.addResolvePath=e}(),function(){function e(e,n,r){var i=e||new t(this);return i.stop(),i.go(n,r),i}var t=function(e){this.context=e};t.prototype={go:function(e,t){this.callback=e,this.handle=setTimeout(function(){this.handle=null,e.call(this.context)}.bind(this),t)},stop:function(){this.handle&&(clearTimeout(this.handle),this.handle=null)},complete:function(){this.handle&&(this.stop(),this.callback.call(this.context))}},Toolkit.job=e}(),function(){document.write("<!-- begin Toolkit injections -->\n"),document.write("<!-- injected meta tags for mobile -->\n"),document.write('<meta name="apple-mobile-web-app-capable" content="yes">\n'),document.write('<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no">\n'),document.write("<!-- injected FOUC prevention -->\n"),document.write("<style>body {opacity: 0;}</style>"),document.write("<!-- end Toolkit injections -->\n"),window.addEventListener("WebComponentsReady",function(){document.body.style.webkitTransition="opacity 0.3s",document.body.style.opacity=1})}();
//@ sourceMappingURL=toolkit.min.js.map